aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog458
-rw-r--r--NEWS850
-rw-r--r--README345
-rw-r--r--acconfig.h58
-rw-r--r--addressbook/ChangeLog2878
-rw-r--r--addressbook/backend/ebook/e-book-util.c210
-rw-r--r--addressbook/backend/ebook/e-card-simple.c311
-rw-r--r--addressbook/backend/ebook/e-card-simple.h18
-rw-r--r--addressbook/backend/ebook/e-card.c1174
-rw-r--r--addressbook/backend/ebook/e-card.h28
-rw-r--r--addressbook/backend/ebook/evolution-ldif-importer.c138
-rw-r--r--addressbook/backend/ebook/evolution-vcard-importer.c105
-rw-r--r--addressbook/backend/pas/pas-backend-file.c598
-rw-r--r--addressbook/backend/pas/pas-backend-ldap.c626
-rw-r--r--addressbook/gui/component/addressbook-component.c135
-rw-r--r--addressbook/gui/component/ldap-config.glade8052
-rw-r--r--addressbook/gui/component/select-names/e-select-names-bonobo.c190
-rw-r--r--addressbook/gui/component/select-names/e-select-names.c589
-rw-r--r--addressbook/gui/component/select-names/e-select-names.h50
-rw-r--r--addressbook/gui/component/select-names/e-simple-card-bonobo.c117
-rw-r--r--addressbook/gui/component/select-names/select-names.glade889
-rw-r--r--addressbook/gui/contact-editor/e-contact-editor-address.c194
-rw-r--r--addressbook/gui/contact-editor/e-contact-editor-fullname.c173
-rw-r--r--addressbook/gui/contact-editor/e-contact-editor.c1232
-rw-r--r--addressbook/gui/contact-editor/e-contact-editor.h25
-rw-r--r--addressbook/gui/contact-editor/e-contact-save-as.c110
-rw-r--r--addressbook/gui/contact-editor/fulladdr.glade867
-rw-r--r--addressbook/gui/contact-editor/fullname.glade1047
-rw-r--r--addressbook/gui/widgets/e-addressbook-reflow-adapter.c411
-rw-r--r--addressbook/gui/widgets/e-addressbook-table-adapter.c117
-rw-r--r--addressbook/gui/widgets/e-minicard.c475
-rw-r--r--art/ChangeLog30
-rw-r--r--art/about-box.pngbin73363 -> 38129 bytes
-rw-r--r--art/splash.pngbin112938 -> 46245 bytes
-rw-r--r--calendar/ChangeLog2539
-rw-r--r--calendar/cal-client/cal-client.c453
-rw-r--r--calendar/cal-client/cal-client.h29
-rw-r--r--calendar/cal-util/cal-component.c60
-rw-r--r--calendar/cal-util/cal-component.h22
-rw-r--r--calendar/cal-util/cal-recur.c34
-rw-r--r--calendar/cal-util/cal-util.c30
-rw-r--r--calendar/cal-util/cal-util.h7
-rw-r--r--calendar/conduits/calendar/calendar-conduit.c168
-rw-r--r--calendar/conduits/todo/todo-conduit.c77
-rw-r--r--calendar/gui/alarm-notify/.cvsignore7
-rw-r--r--calendar/gui/alarm-notify/Makefile.am58
-rw-r--r--calendar/gui/alarm-notify/alarm-queue.c248
-rw-r--r--calendar/gui/calendar-model.c135
-rw-r--r--calendar/gui/calendar-offline-handler.c53
-rw-r--r--calendar/gui/comp-editor-factory.c70
-rw-r--r--calendar/gui/comp-util.c3
-rw-r--r--calendar/gui/dialogs/Makefile.am26
-rw-r--r--calendar/gui/dialogs/alarm-options.c42
-rw-r--r--calendar/gui/dialogs/alarm-options.glade953
-rw-r--r--calendar/gui/dialogs/alarm-page.c373
-rw-r--r--calendar/gui/dialogs/alarm-page.glade827
-rw-r--r--calendar/gui/dialogs/cancel-comp.c14
-rw-r--r--calendar/gui/dialogs/comp-editor-util.c30
-rw-r--r--calendar/gui/dialogs/comp-editor.c178
-rw-r--r--calendar/gui/dialogs/event-editor.c101
-rw-r--r--calendar/gui/dialogs/event-page.c195
-rw-r--r--calendar/gui/dialogs/event-page.glade1187
-rw-r--r--calendar/gui/dialogs/meeting-page.c315
-rw-r--r--calendar/gui/dialogs/meeting-page.h12
-rw-r--r--calendar/gui/dialogs/recur-comp.c24
-rw-r--r--calendar/gui/dialogs/recurrence-page.c510
-rw-r--r--calendar/gui/dialogs/schedule-page.c63
-rw-r--r--calendar/gui/dialogs/send-comp.c14
-rw-r--r--calendar/gui/dialogs/task-details-page.c78
-rw-r--r--calendar/gui/dialogs/task-details-page.glade643
-rw-r--r--calendar/gui/dialogs/task-editor.c118
-rw-r--r--calendar/gui/e-calendar-table.c240
-rw-r--r--calendar/gui/e-day-view.c583
-rw-r--r--calendar/gui/e-itip-control.c482
-rw-r--r--calendar/gui/e-meeting-attendee.c40
-rw-r--r--calendar/gui/e-meeting-model.c171
-rw-r--r--calendar/gui/e-tasks.c73
-rw-r--r--calendar/gui/e-week-view.c389
-rw-r--r--calendar/gui/gnome-cal.c323
-rw-r--r--calendar/gui/itip-control-factory.c282
-rw-r--r--calendar/gui/itip-utils.c255
-rw-r--r--calendar/gui/itip-utils.h15
-rw-r--r--calendar/gui/misc.c2
-rw-r--r--calendar/pcs/cal-backend-file.c619
-rw-r--r--calendar/pcs/cal-backend.c501
-rw-r--r--calendar/pcs/cal-backend.h33
-rw-r--r--calendar/pcs/cal.c265
-rw-r--r--camel/ChangeLog1292
-rw-r--r--camel/Makefile.am46
-rw-r--r--camel/camel-filter-search.c29
-rw-r--r--camel/camel-folder-search.c27
-rw-r--r--camel/camel-mime-filter-canon.c6
-rw-r--r--camel/camel-mime-filter-tohtml.c573
-rw-r--r--camel/camel-mime-filter-tohtml.h14
-rw-r--r--camel/camel-mime-part.c26
-rw-r--r--camel/camel-mime-utils.c177
-rw-r--r--camel/camel-mime-utils.h4
-rw-r--r--camel/camel-multipart-signed.c5
-rw-r--r--camel/camel-sasl-gssapi.c10
-rw-r--r--camel/camel-stream-filter.c4
-rw-r--r--camel/camel-tcp-stream-ssl.c103
-rw-r--r--camel/providers/imap/camel-imap-store-summary.c4
-rw-r--r--camel/providers/imap/camel-imap-store.c82
-rw-r--r--camel/providers/sendmail/camel-sendmail-transport.c2
-rw-r--r--camel/providers/smtp/camel-smtp-transport.c79
-rw-r--r--composer/ChangeLog517
-rw-r--r--composer/e-msg-composer-attachment.c188
-rw-r--r--composer/e-msg-composer.c1095
-rw-r--r--composer/evolution-composer.c182
-rw-r--r--configure.in805
-rw-r--r--default_user/ChangeLog29
-rw-r--r--default_user/Makefile.am2
-rw-r--r--doc/devel/calendar/cal-client/evolution-cal-client-decl.txt47
-rw-r--r--doc/devel/calendar/cal-util/evolution-cal-util-decl.txt38
-rw-r--r--doc/devel/executive-summary/evolution-services.hierarchy7
-rw-r--r--doc/devel/importer/evolution-shell-importer.hierarchy7
-rw-r--r--e-util/ChangeLog480
-rw-r--r--e-util/Makefile.am56
-rw-r--r--e-util/e-bit-array.c429
-rw-r--r--e-util/e-bit-array.h104
-rw-r--r--e-util/e-categories-config.c43
-rw-r--r--e-util/e-component-listener.c83
-rw-r--r--e-util/e-config-listener.c408
-rw-r--r--e-util/e-config-listener.h33
-rw-r--r--e-util/e-dialog-utils.c337
-rw-r--r--e-util/e-html-utils.c5
-rw-r--r--e-util/e-i18n.h75
-rw-r--r--e-util/e-iconv.c610
-rw-r--r--e-util/e-iconv.h49
-rw-r--r--e-util/e-lang-utils.c1
-rw-r--r--e-util/e-msgport.c21
-rw-r--r--e-util/e-msgport.h2
-rw-r--r--e-util/e-pilot-settings.h16
-rw-r--r--e-util/e-proxy.c61
-rw-r--r--e-util/e-sorter-array.c259
-rw-r--r--e-util/e-sorter-array.h77
-rw-r--r--e-util/e-sorter.c153
-rw-r--r--e-util/e-sorter.h82
-rw-r--r--e-util/e-text-event-processor-emacs-like.c489
-rw-r--r--e-util/e-text-event-processor-emacs-like.h70
-rw-r--r--e-util/e-text-event-processor-types.h132
-rw-r--r--e-util/e-text-event-processor.c148
-rw-r--r--e-util/e-text-event-processor.h77
-rw-r--r--e-util/e-util.c1150
-rw-r--r--e-util/e-util.h221
-rw-r--r--e-util/e-xml-hash-utils.c2
-rw-r--r--e-util/e-xml-utils.c502
-rw-r--r--e-util/e-xml-utils.h101
-rw-r--r--filter/ChangeLog331
-rw-r--r--filter/rule-editor.c637
-rw-r--r--filter/vfolder-rule.c484
-rw-r--r--help/C/Makefile.am48
-rw-r--r--help/C/apx-authors.sgml74
-rw-r--r--help/C/apx-fdl.sgml667
-rw-r--r--help/C/apx-gloss.sgml480
-rw-r--r--help/C/apx-gpl.sgml417
-rw-r--r--help/C/config-prefs.sgml936
-rw-r--r--help/C/config-sync.sgml138
-rw-r--r--help/C/evolution-C.omf18
-rw-r--r--help/C/evolution.sgml111
-rw-r--r--help/C/preface.sgml412
-rw-r--r--help/C/usage-contact.sgml571
-rw-r--r--help/C/usage-exchange.sgml748
-rw-r--r--help/C/usage-mail-org.sgml1129
-rw-r--r--help/C/usage-mail.sgml2209
-rw-r--r--help/C/usage-mainwindow.sgml1509
-rw-r--r--help/ChangeLog121
-rw-r--r--help/devel/executive-summary/evolution-services.hierarchy7
-rw-r--r--help/devel/importer/evolution-shell-importer.hierarchy7
-rw-r--r--help/no/evolution-no.omf4
-rw-r--r--libibex/TODO61
-rw-r--r--libical/ChangeLog39
-rw-r--r--libical/src/libical/icalyacc.y2
-rw-r--r--libical/src/libicalvcal/Makefile.am4
-rw-r--r--macros/ChangeLog48
-rw-r--r--macros/autogen.sh13
-rw-r--r--mail/ChangeLog2461
-rw-r--r--mail/component-factory.c469
-rw-r--r--mail/folder-browser.c1010
-rw-r--r--mail/mail-account-gui.c592
-rw-r--r--mail/mail-accounts.c582
-rw-r--r--mail/mail-callbacks.c1208
-rw-r--r--mail/mail-composer-prefs.c754
-rw-r--r--mail/mail-config-druid.c1166
-rw-r--r--mail/mail-display.c1257
-rw-r--r--mail/mail-format.c1525
-rw-r--r--mail/mail-local.c227
-rw-r--r--mail/mail-preferences.c293
-rw-r--r--mail/mail-session.c566
-rw-r--r--mail/mail.h37
-rw-r--r--mail/subscribe-dialog.glade531
-rw-r--r--my-evolution/ChangeLog480
-rw-r--r--my-evolution/Locations65
-rw-r--r--my-evolution/e-summary-preferences.c614
-rw-r--r--po/.cvsignore8
-rw-r--r--po/POTFILES.in70
-rw-r--r--po/POTFILES.skip14
-rw-r--r--shell/ChangeLog2525
-rw-r--r--shell/Evolution-ShellComponent.idl7
-rw-r--r--shell/Evolution-ShellComponentDnd.idl2
-rw-r--r--shell/Evolution-Storage.idl3
-rw-r--r--shell/Makefile.am157
-rw-r--r--shell/e-component-info.c10
-rw-r--r--shell/e-corba-storage-registry.c117
-rw-r--r--shell/e-shell-config-default-folders.c100
-rw-r--r--shell/e-shell-folder-title-bar.c272
-rw-r--r--shell/e-shell-settings-dialog.c98
-rw-r--r--shell/e-shell-shared-folder-picker-dialog.c200
-rw-r--r--shell/e-shell-user-creatable-items-handler.c97
-rw-r--r--shell/e-shortcuts.c265
-rw-r--r--shell/e-storage-set-view.c369
-rw-r--r--shell/e-storage.c146
-rw-r--r--shell/main.c387
-rw-r--r--tools/Makefile.am68
-rw-r--r--tools/evolution-launch-composer.c343
-rw-r--r--ui/ChangeLog52
-rw-r--r--ui/evolution-mail-message.xml6
-rw-r--r--widgets/menus/gal-define-views-dialog.c343
-rw-r--r--widgets/menus/gal-define-views-dialog.h78
-rw-r--r--widgets/menus/gal-define-views-model.c322
-rw-r--r--widgets/menus/gal-define-views-model.h72
-rw-r--r--widgets/menus/gal-define-views.glade287
-rw-r--r--widgets/menus/gal-view-collection.c817
-rw-r--r--widgets/menus/gal-view-collection.h151
-rw-r--r--widgets/menus/gal-view-etable.c303
-rw-r--r--widgets/menus/gal-view-etable.h78
-rw-r--r--widgets/menus/gal-view-factory-etable.c120
-rw-r--r--widgets/menus/gal-view-factory-etable.h62
-rw-r--r--widgets/menus/gal-view-factory.c107
-rw-r--r--widgets/menus/gal-view-factory.h79
-rw-r--r--widgets/menus/gal-view-instance-save-as-dialog.c299
-rw-r--r--widgets/menus/gal-view-instance-save-as-dialog.glade243
-rw-r--r--widgets/menus/gal-view-instance-save-as-dialog.h89
-rw-r--r--widgets/menus/gal-view-instance.c595
-rw-r--r--widgets/menus/gal-view-instance.h116
-rw-r--r--widgets/menus/gal-view-new-dialog.c284
-rw-r--r--widgets/menus/gal-view-new-dialog.glade175
-rw-r--r--widgets/menus/gal-view-new-dialog.h86
-rw-r--r--widgets/menus/gal-view.c206
-rw-r--r--widgets/menus/gal-view.h98
-rw-r--r--widgets/misc/ChangeLog397
-rw-r--r--widgets/misc/e-calendar-item.c258
-rw-r--r--widgets/misc/e-canvas-background.c495
-rw-r--r--widgets/misc/e-canvas-background.h71
-rw-r--r--widgets/misc/e-canvas-utils.c171
-rw-r--r--widgets/misc/e-canvas-utils.h55
-rw-r--r--widgets/misc/e-canvas-vbox.c381
-rw-r--r--widgets/misc/e-canvas-vbox.h93
-rw-r--r--widgets/misc/e-canvas.c1164
-rw-r--r--widgets/misc/e-canvas.h158
-rw-r--r--widgets/misc/e-colors.c103
-rw-r--r--widgets/misc/e-colors.h44
-rw-r--r--widgets/misc/e-combo-button.h12
-rw-r--r--widgets/misc/e-config-page.h12
-rw-r--r--widgets/misc/e-cursors.c156
-rw-r--r--widgets/misc/e-cursors.h68
-rw-r--r--widgets/misc/e-dropdown-button.h12
-rw-r--r--widgets/misc/e-gui-utils.c232
-rw-r--r--widgets/misc/e-gui-utils.h58
-rw-r--r--widgets/misc/e-hsv-utils.c178
-rw-r--r--widgets/misc/e-hsv-utils.h52
-rw-r--r--widgets/misc/e-multi-config-dialog.c108
-rw-r--r--widgets/misc/e-multi-config-dialog.h19
-rw-r--r--widgets/misc/e-popup-menu.c240
-rw-r--r--widgets/misc/e-popup-menu.h142
-rw-r--r--widgets/misc/e-printable.c209
-rw-r--r--widgets/misc/e-printable.h90
-rw-r--r--widgets/misc/e-reflow-model.c355
-rw-r--r--widgets/misc/e-reflow-model.h112
-rw-r--r--widgets/misc/e-reflow.c1501
-rw-r--r--widgets/misc/e-reflow.h146
-rw-r--r--widgets/misc/e-selection-model-array.c557
-rw-r--r--widgets/misc/e-selection-model-array.h96
-rw-r--r--widgets/misc/e-selection-model-simple.c115
-rw-r--r--widgets/misc/e-selection-model-simple.h70
-rw-r--r--widgets/misc/e-selection-model.c689
-rw-r--r--widgets/misc/e-selection-model.h170
-rw-r--r--widgets/misc/e-title-bar.h12
-rw-r--r--widgets/misc/e-unicode.c2272
-rw-r--r--widgets/misc/e-unicode.h133
-rw-r--r--widgets/misc/e-url-entry.h12
-rw-r--r--widgets/misc/gal-categories.glade168
-rw-r--r--widgets/misc/pixmaps/.cvsignore2
-rw-r--r--widgets/misc/pixmaps/cursor_cross.xpm38
-rw-r--r--widgets/misc/pixmaps/cursor_hand_closed.xpm38
-rw-r--r--widgets/misc/pixmaps/cursor_hand_open.xpm38
-rw-r--r--widgets/misc/pixmaps/cursor_zoom_in.xpm37
-rw-r--r--widgets/misc/pixmaps/cursor_zoom_out.xpm37
-rw-r--r--widgets/misc/test-color.c76
-rw-r--r--widgets/table/.cvsignore13
-rw-r--r--widgets/table/add-col.xpm22
-rw-r--r--widgets/table/arrow-down.xpm21
-rw-r--r--widgets/table/arrow-up.xpm21
-rw-r--r--widgets/table/check-empty.xpm21
-rw-r--r--widgets/table/check-filled.xpm21
-rw-r--r--widgets/table/clip.pngbin192 -> 0 bytes
-rw-r--r--widgets/table/e-cell-checkbox.c67
-rw-r--r--widgets/table/e-cell-checkbox.h50
-rw-r--r--widgets/table/e-cell-combo.c658
-rw-r--r--widgets/table/e-cell-combo.h63
-rw-r--r--widgets/table/e-cell-date.c183
-rw-r--r--widgets/table/e-cell-date.h49
-rw-r--r--widgets/table/e-cell-float.c93
-rw-r--r--widgets/table/e-cell-float.h53
-rw-r--r--widgets/table/e-cell-number.c85
-rw-r--r--widgets/table/e-cell-number.h49
-rw-r--r--widgets/table/e-cell-pixbuf.c417
-rw-r--r--widgets/table/e-cell-pixbuf.h53
-rw-r--r--widgets/table/e-cell-popup.c526
-rw-r--r--widgets/table/e-cell-popup.h101
-rw-r--r--widgets/table/e-cell-progress.c456
-rw-r--r--widgets/table/e-cell-progress.h74
-rw-r--r--widgets/table/e-cell-size.c110
-rw-r--r--widgets/table/e-cell-size.h49
-rw-r--r--widgets/table/e-cell-spin-button.c670
-rw-r--r--widgets/table/e-cell-spin-button.h103
-rw-r--r--widgets/table/e-cell-text.c2329
-rw-r--r--widgets/table/e-cell-text.h108
-rw-r--r--widgets/table/e-cell-toggle.c501
-rw-r--r--widgets/table/e-cell-toggle.h62
-rw-r--r--widgets/table/e-cell-tree.c777
-rw-r--r--widgets/table/e-cell-tree.h75
-rw-r--r--widgets/table/e-cell-vbox.c489
-rw-r--r--widgets/table/e-cell-vbox.h65
-rw-r--r--widgets/table/e-cell.c499
-rw-r--r--widgets/table/e-cell.h222
-rw-r--r--widgets/table/e-table-click-to-add.c562
-rw-r--r--widgets/table/e-table-click-to-add.h77
-rw-r--r--widgets/table/e-table-col-dnd.h39
-rw-r--r--widgets/table/e-table-col.c236
-rw-r--r--widgets/table/e-table-col.h101
-rw-r--r--widgets/table/e-table-column-specification.c150
-rw-r--r--widgets/table/e-table-column-specification.h73
-rw-r--r--widgets/table/e-table-column.c291
-rw-r--r--widgets/table/e-table-config-field.c300
-rw-r--r--widgets/table/e-table-config-field.h69
-rw-r--r--widgets/table/e-table-config-no-group.glade2039
-rw-r--r--widgets/table/e-table-config.c1181
-rw-r--r--widgets/table/e-table-config.glade2107
-rw-r--r--widgets/table/e-table-config.h115
-rw-r--r--widgets/table/e-table-defines.h45
-rw-r--r--widgets/table/e-table-example-1.c308
-rw-r--r--widgets/table/e-table-example-2.c349
-rw-r--r--widgets/table/e-table-extras.c292
-rw-r--r--widgets/table/e-table-extras.h82
-rw-r--r--widgets/table/e-table-field-chooser-dialog.c224
-rw-r--r--widgets/table/e-table-field-chooser-dialog.h79
-rw-r--r--widgets/table/e-table-field-chooser-item.c711
-rw-r--r--widgets/table/e-table-field-chooser-item.h75
-rw-r--r--widgets/table/e-table-field-chooser.c282
-rw-r--r--widgets/table/e-table-field-chooser.glade123
-rw-r--r--widgets/table/e-table-field-chooser.h79
-rw-r--r--widgets/table/e-table-group-container.c1512
-rw-r--r--widgets/table/e-table-group-container.h98
-rw-r--r--widgets/table/e-table-group-leaf.c686
-rw-r--r--widgets/table/e-table-group-leaf.h90
-rw-r--r--widgets/table/e-table-group.c712
-rw-r--r--widgets/table/e-table-group.h178
-rw-r--r--widgets/table/e-table-header-item.c1837
-rw-r--r--widgets/table/e-table-header-item.h114
-rw-r--r--widgets/table/e-table-header-utils.c481
-rw-r--r--widgets/table/e-table-header-utils.h55
-rw-r--r--widgets/table/e-table-header.c952
-rw-r--r--widgets/table/e-table-header.h120
-rw-r--r--widgets/table/e-table-item.c3645
-rw-r--r--widgets/table/e-table-item.h227
-rw-r--r--widgets/table/e-table-memory-callbacks.c208
-rw-r--r--widgets/table/e-table-memory-callbacks.h91
-rw-r--r--widgets/table/e-table-memory-store.c583
-rw-r--r--widgets/table/e-table-memory-store.h138
-rw-r--r--widgets/table/e-table-memory.c277
-rw-r--r--widgets/table/e-table-memory.h76
-rw-r--r--widgets/table/e-table-model.c579
-rw-r--r--widgets/table/e-table-model.h170
-rw-r--r--widgets/table/e-table-one.c239
-rw-r--r--widgets/table/e-table-one.h57
-rw-r--r--widgets/table/e-table-scrolled.c229
-rw-r--r--widgets/table/e-table-scrolled.h76
-rw-r--r--widgets/table/e-table-search.c223
-rw-r--r--widgets/table/e-table-search.h71
-rw-r--r--widgets/table/e-table-selection-model.c347
-rw-r--r--widgets/table/e-table-selection-model.h76
-rw-r--r--widgets/table/e-table-simple.c289
-rw-r--r--widgets/table/e-table-simple.h122
-rw-r--r--widgets/table/e-table-size-test.c307
-rw-r--r--widgets/table/e-table-sort-info.c481
-rw-r--r--widgets/table/e-table-sort-info.h107
-rw-r--r--widgets/table/e-table-sorted-variable.c228
-rw-r--r--widgets/table/e-table-sorted-variable.h65
-rw-r--r--widgets/table/e-table-sorted.c310
-rw-r--r--widgets/table/e-table-sorted.h65
-rw-r--r--widgets/table/e-table-sorter.c462
-rw-r--r--widgets/table/e-table-sorter.h74
-rw-r--r--widgets/table/e-table-sorting-utils.c349
-rw-r--r--widgets/table/e-table-sorting-utils.h83
-rw-r--r--widgets/table/e-table-specification.c429
-rw-r--r--widgets/table/e-table-specification.h89
-rw-r--r--widgets/table/e-table-state.c295
-rw-r--r--widgets/table/e-table-state.h74
-rw-r--r--widgets/table/e-table-subset-variable.c250
-rw-r--r--widgets/table/e-table-subset-variable.h82
-rw-r--r--widgets/table/e-table-subset.c471
-rw-r--r--widgets/table/e-table-subset.h89
-rw-r--r--widgets/table/e-table-tooltip.h44
-rw-r--r--widgets/table/e-table-tree.h48
-rw-r--r--widgets/table/e-table-utils.c189
-rw-r--r--widgets/table/e-table-utils.h49
-rw-r--r--widgets/table/e-table-without.c392
-rw-r--r--widgets/table/e-table-without.h91
-rw-r--r--widgets/table/e-table.c3264
-rw-r--r--widgets/table/e-table.diabin4514 -> 0 bytes
-rw-r--r--widgets/table/e-table.h358
-rw-r--r--widgets/table/e-tree-memory-callbacks.c275
-rw-r--r--widgets/table/e-tree-memory-callbacks.h119
-rw-r--r--widgets/table/e-tree-memory.c717
-rw-r--r--widgets/table/e-tree-memory.h101
-rw-r--r--widgets/table/e-tree-model.c1098
-rw-r--r--widgets/table/e-tree-model.h227
-rw-r--r--widgets/table/e-tree-scrolled.c228
-rw-r--r--widgets/table/e-tree-scrolled.h75
-rw-r--r--widgets/table/e-tree-selection-model.c802
-rw-r--r--widgets/table/e-tree-selection-model.h77
-rw-r--r--widgets/table/e-tree-simple.c208
-rw-r--r--widgets/table/e-tree-simple.h85
-rw-r--r--widgets/table/e-tree-sorted-variable.c477
-rw-r--r--widgets/table/e-tree-sorted-variable.h85
-rw-r--r--widgets/table/e-tree-sorted.c1390
-rw-r--r--widgets/table/e-tree-sorted.h86
-rw-r--r--widgets/table/e-tree-table-adapter.c1123
-rw-r--r--widgets/table/e-tree-table-adapter.h93
-rw-r--r--widgets/table/e-tree.c3294
-rw-r--r--widgets/table/e-tree.h310
-rw-r--r--widgets/table/image1.pngbin1858 -> 0 bytes
-rw-r--r--widgets/table/image2.pngbin1987 -> 0 bytes
-rw-r--r--widgets/table/image3.pngbin2051 -> 0 bytes
-rw-r--r--widgets/table/remove-col.xpm22
-rw-r--r--widgets/table/sample.table45
-rw-r--r--widgets/table/spec.xml21
-rw-r--r--widgets/table/table-test.c62
-rw-r--r--widgets/table/table-test.h27
-rw-r--r--widgets/table/test-check.c221
-rw-r--r--widgets/table/test-cols.c265
-rw-r--r--widgets/table/test-table.c478
-rw-r--r--widgets/table/tree-expanded.xpm23
-rw-r--r--widgets/table/tree-unexpanded.xpm23
-rw-r--r--widgets/text/.cvsignore11
-rw-r--r--widgets/text/e-completion-callbacks.c96
-rw-r--r--widgets/text/e-completion-callbacks.h68
-rw-r--r--widgets/text/e-completion-match.c184
-rw-r--r--widgets/text/e-completion-match.h67
-rw-r--r--widgets/text/e-completion-view.c859
-rw-r--r--widgets/text/e-completion-view.h98
-rw-r--r--widgets/text/e-completion.c339
-rw-r--r--widgets/text/e-completion.h91
-rw-r--r--widgets/text/e-entry-test.c83
-rw-r--r--widgets/text/e-entry.c1397
-rw-r--r--widgets/text/e-entry.h87
-rw-r--r--widgets/text/e-table-text-model.c234
-rw-r--r--widgets/text/e-table-text-model.h64
-rw-r--r--widgets/text/e-text-model-repos.c87
-rw-r--r--widgets/text/e-text-model-repos.h69
-rw-r--r--widgets/text/e-text-model-test.c91
-rw-r--r--widgets/text/e-text-model-uri.c344
-rw-r--r--widgets/text/e-text-model-uri.h56
-rw-r--r--widgets/text/e-text-model.c633
-rw-r--r--widgets/text/e-text-model.h113
-rw-r--r--widgets/text/e-text-test.c168
-rw-r--r--widgets/text/e-text.c3471
-rw-r--r--widgets/text/e-text.h239
-rw-r--r--wombat/ChangeLog132
-rw-r--r--wombat/Makefile.am75
-rw-r--r--wombat/wombat-interface-check.c25
-rw-r--r--wombat/wombat-interface-check.h15
-rw-r--r--wombat/wombat-moniker.c184
474 files changed, 38483 insertions, 120586 deletions
diff --git a/ChangeLog b/ChangeLog
index 66974747c6..afbea35077 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,467 +1,95 @@
-2003-03-29 Duarte Loreto <happyguy_pt@hotmail.com>
-
- * AUTHORS: Added myself as new Portuguese translator.
-
-2003-03-28 Ettore Perazzoli <ettore@ximian.com>
-
- * configure.in: Ported check for "killall" vs. "killp" back from
- 1.2.
-
-2003-03-28 Ettore Perazzoli <ettore@ximian.com>
-
- * data/Makefile.am: Fix installation of the .desktop file.
-
-2003-03-27 Ettore Perazzoli <ettore@ximian.com>
-
- * configure.in: Add gal-2.0 to the list of packages to determine
- WOMBAT_CFLAGS and WOMBAT_LIBS.
+== Version 1.2.4 ==
-2003-03-26 Ettore Perazzoli <ettore@ximian.com>
+2003-03-31 Ettore Perazzoli <ettore@ximian.com>
- * configure.in: Autogen help/Makefile.
+ * configure.in: Update version number to 1.2.4.
- * Makefile.am (SUBDIRS): Add help. [#38234]
-
-2003-03-25 Jeffrey Stedfast <fejj@ximian.com>
+2003-03-29 Duarte Loreto <happyguy_pt@hotmail.com>
- * configure.in: Fixed Heimdal include path.
+ * AUTHORS: Added myself as new Portuguese translator.
2003-03-25 Rodney Dawes <dobey@ximian.com>
- * data/evolution.desktop.in: Fix 39901 and 40233
+ * configure.in: Fix the KRB5_CFLAGS to work with heimdal
+ Bump version to 1.2.3.99
2003-03-21 Rodney Dawes <dobey@ximian.com>
* configure.in: Fix the mit krb5+krb4 check to work with --without-kr5
-
-2003-03-19 Ettore Perazzoli <ettore@ximian.com>
-
- * README: Updated considerably.
-
-2003-03-18 Jeffrey Stedfast <fejj@ximian.com>
-
- * configure.in: Fixed a type-o in the krb5 checks.
-
-2003-03-19 Not Zed <NotZed@Ximian.com>
-
- * configure.in (CAMEL_*, E_UTIL_*, ): Add gthread-2.0, to get any
- thread-specific flags (like -D_REENTRANT). Duh. For #39886.
- (LIBIBEX*): Removed old libibex stuff.
-
-2003-03-14 Chris Toshok <toshok@ximian.com>
-
- * tools/evolution-addressbook-export.c (save_cards): use
- bonobo_main_quit, and clean this up a bit.
-
-2003-03-06 Jeffrey Stedfast <fejj@ximian.com>
-
- * configure.in: Added AC_C_INLINE - this should fix bug #39171.
-
-2003-03-05 Jeffrey Stedfast <fejj@ximian.com>
-
- * configure.in: Fix kerberos include paths.
-
-2003-03-05 Ettore Perazzoli <ettore@ximian.com>
-
- * configure.in: Update version number to 1.3.1.99.
-
-== Version 1.3.1 ==
-
-2003-02-28 Dan Winship <danw@ximian.com>
-
- * tools/Makefile.am (evolution_launch_composer_LDADD): Fix
- dependencies
-
-2003-02-28 Hans Petter Jansson <hpj@ximian.com>
-
- * configure.in: Add calendar/importers/Makefile to output.
-
-2003-02-27 Chris Toshok <toshok@ximian.com>
-
- * tools/.cvsignore: ignore some stuff, yo.
- * tools/Makefile.am: add in the evolution-launch-composer stuff.
+2003-03-18 Rodney Dawes <dobey@ximian.com>
- * tools/evolution-launch-composer.c: port this from the 1.2 branch.
+ * configure.in: Fix typos in krb5 check to work --without-krb5
-2003-02-27 JP Rosevear <jpr@ximian.com>
+== Version 1.2.3 ==
- * configure.in: export gnome-pilot cflags
+2003-03-17 Ettore Perazzoli <ettore@ximian.com>
-2003-02-21 Dan Winship <danw@ximian.com>
+ * configure.in: Bump version number to 1.2.3.
- * libversit/Makefile.am: Make this a shared library to prevent
- linking portability problems
+2003-02-20 Dan Winship <danw@ximian.com>
- * tools/Makefile.am (evolution_addressbook_import_LDADD): cleanup
+ * configure.in (CAMEL_INCLUDEDIR): Remove the "/camel" since
+ you're supposed to be able to do "#include <camel/foo.h>"
2003-02-19 Jeffrey Stedfast <fejj@ximian.com>
* configure.in (ENABLE_IPv6): AC_DEFINE() ENABLE_IPv6 if it should
be enabled.
-2003-02-07 Rodney Dawes <dobey@ximian.com>
-
- * data/Makefile.am: Fix installation of desktop/mime files
-
-2003-02-06 Ettore Perazzoli <ettore@ximian.com>
-
- * configure.in: Add fr to ALL_LINGUAS again.
+ * acconfig.h: Added #undef ENABLE_IPv6
-2003-02-06 Rodney Dawes <dobey@ximian.com>
+2003-02-04 Ettore Perazzoli <ettore@ximian.com>
- * configure.in: Fix KRB4_CFLAGS to work correctly
- * data/Makefile.am: Fix desktop file installation path
- * data/evolution.desktop.in: Use correct binary and categories, add
- StartupNotify=1 also, for startup-notification-enabled systems
-
-2003-02-06 Dan Winship <danw@ximian.com>
-
- * configure.in: export priv*dir for libical's configure to use.
-
- * evolution-addressbook.pc.in (Libs): Remove -L${libdir}.
- (CFlags): s/includedir/privincludedir/
-
- * evolution-calendar.pc.in: Likewise
-
- * evolution-shell.pc.in: Likewise. Also change iconsdir to
- imagesdir
-
- * sounds/Makefile.am: remove soundsdir def
-
- * tools/Makefile.am: subst in $(toolsdir) instead of $(bindir)
-
- * tools/evolution-addressbook-clean.in:
- s/EVOLUTION_BINDIR/EVOLUTION_TOOLSDIR/
-
- * tools/evolution-addressbook-abuse.c (main):
- s/PACKAGE/GETTEXT_PACKAGE/ in gettext init
- * tools/evolution-addressbook-export.c (main): Likewise
- * tools/evolution-addressbook-import.c (main): Likewise
-
-2003-02-05 Dan Winship <danw@ximian.com>
-
- * configure.in: Define and AC_SUBST privlibexecdir, privdatadir,
- privincludedir, serverdir, evolutionuidir, imagesdir, buttonsdir,
- soundsdir, gladedir, etspecdir, and viewsdir.
-
- * data/Makefile.am (dtappintegrate, dtappunintegrate): use
- privdatadir
-
-2003-02-04 Dan Winship <danw@ximian.com>
-
- * configure.in: Update AC_DEFINEs to use the new syntax to make
- acconfig.h unnecessary. (Remove unneeded HAVE_KDE_APPLNK define).
- Call GNOME_COMPILE_WARNINGS and add $WARN_CFLAGS to CFLAGS to get
- back to the evo 1.2 behavior of defaulting to -Wall everywhere.
- Fix up privlibdir definition to avoid undefined variables in
- evolution-shell.pc.
-
- * acinclude.m4: Update AC_DEFINE
-
- * acconfig.h: Gone
-
-2003-02-03 Chris Toshok <toshok@ximian.com>
-
- * configure.in (EVOLUTION_MAIL): add gnome-vfs-module-2.0 to the
- deps so we pick up the right include path.
+ * configure.in: Bump version number to 1.2.2.99.
-2003-02-03 Chris Toshok <toshok@ximian.com>
+== Version 1.2.2 ==
- * configure.in: remove the --enable-shlib-components stuff.
+2003-02-04 Ettore Perazzoli <ettore@ximian.com>
-2003-01-28 Jeffrey Stedfast <fejj@ximian.com>
+ * configure.in: Bump version number to 1.2.2.
- * configure.in (HAVE_KRB5): Updated to add gssapi libs, since this
- is what we use krb5 for :-)
+2003-02-03 Rodney Dawes <dobey@ximian.com>
-2003-01-28 Rodney Dawes <dobey@ximian.com>
-
- * tools/Makefile.am (EXTRA_DIST): s/bin_SCRIPTS/tools_SCRIPTS/
-
-2003-01-27 Ettore Perazzoli <ettore@ximian.com>
-
- * tools/evolution-addressbook-export.c: #include bonobo-activation
- instead of oaf.
- (main): Initialize using gnome_program_init().
- (save_cards): Use g_main_loop_quit() instead of gtk_exit().
-
- * tools/evolution-addressbook-import.c: Update include list for
- GNOME 2.
- (main): Initialize using gnome_program_init().
- (unref_executable): Use g_main_loop_quit() instead of gtk_exit().
- (add_cb): Likewise.
-
- * tools/evolution-addressbook-abuse.c: Update include list for
- GNOME 2.
- (main): Initialize using gnome_program_init().
- (use_addressbook): Use g_object_unref() instead of
- gtk_object_unref().
- (main): Use g_timeout_add() instead of gtk_timeout_add().
- (add_cb): Use g_main_loop_quit() instead of gtk_exit().
-
- * configure.in (AC_SUBST): Add tools/Makefile.
-
- * Makefile.am (SUBDIRS): Add tools/ back into the list.
-
- * tools/Makefile.am: Install everything in
- $(datadir)/evolution-$(BASE_VERSION)/tools.
- (INCLUDES): Add the defines that gnome_program_init() likes and
- also add the _DISABLE_DEPRECATED stuff.
-
-2003-01-26 Chris Toshok <toshok@ximian.com>
-
- * configure.in (AC_OUTPUT): add in the conduit Makefile's.
+ * configure.in: Fix the KRB4_CFLAGS checks
-2003-01-26 Chris Toshok <toshok@ximian.com>
-
- * configure.in: only do the CONDUIT_CFLAGS/LIBS stuff if pilot
- conduits have been enabled.
-
-2003-01-26 Chris Toshok <toshok@ximian.com>
-
- * configure.in: in the --enable-pilot-conduits stanza, use
- PKG_CHECK_MODULES to get the gnome-pilot-2.0 (and therefore
- pilot-link) cflags/libs before doing our utf-8 check. also,
- enable the addressbook/calendar CONDUIT_{CFLAGS/LIBS} variables.
-
-2003-01-24 Ettore Perazzoli <ettore@ximian.com>
-
- * configure.in (evolutionuidir): Define iconsdir.
-
-2003-01-24 Jeffrey Stedfast <fejj@ximian.com>
-
- * configure.in (FULL_GNOME_DEPS): Doh. Use the
- MANUAL_[NSPR,NSS]_[CFLAGS,LIBS] variables where appropriate.
-
-2003-01-23 Ettore Perazzoli <ettore@ximian.com>
+2002-12-05 Ettore Perazzoli <ettore@ximian.com>
- * configure.in (idldir): Define componentdir instead of
- COMPONENT_DIR. Set it to $privlibdir/components instead of
- $libdir/evolution-$(BASE_VERSION)/components.
+ * configure.in: Bump version number to 1.2.1.99.
-2003-01-22 Jeffrey Stedfast <fejj@ximian.com>
+== Version 1.2.1 ==
- * configure.in (MOZILLA_NSS): Simplify the whole process into
- about 8 lines by using pkg-config.
+2002-12-05 Ettore Perazzoli <ettore@ximian.com>
-2003-01-22 Ettore Perazzoli <ettore@ximian.com>
+ * configure.in: Bump version to 1.2.1, require GAL 0.22 and
+ GtkHTML 1.1.7.
- * data/Makefile.am: For now, do not install the evolution.1
- manpage. Install all the other files with a -$(BASE_VERSION)
- suffix.
- (dtappintegrate): Update for the new location of cde_app_root.
- (dtappunintegrate): Likewise.
+2002-12-05 Ettore Perazzoli <ettore@ximian.com>
- * data/cde_app_root/dt/appconfig/appmanager/C/Ximian/Makefile.am
- (cdeappmanagerdir): Version using $(BASE_VERSION).
- * data/cde_app_root/dt/appconfig/types/C/Makefile.am
- (cdetypesdir): Likewise.
- * data/cde_app_root/dt/appconfig/icons/C/Makefile.am
- (cdeiconsdir): Likewise.
+ * tools/evolution-launch-composer.c: New.
- * sounds/Makefile.am (soundsdir): Version using $(BASE_VERSION).
+2002-11-26 Ettore Perazzoli <ettore@ximian.com>
- * configure.in: Define BASE_VERSION. Set idldir to
- $datadir/idl/evolution-$BASE_VERSION instead of just
- $datadir/idl/evolution.
+ * configure.in: Define KILL_PROCESS_CMD.
-2003-01-14 Ettore Perazzoli <ettore@ximian.com>
-
- * configure.in (ALL_LINGUAS): Remove fr for now, since it doesn't
- seem to work.
- (AC_OUTPUT): Remove calendar/importers/Makefile for now.
-
-2003-01-14 Rodney Dawes <dobey@ximian.com>
-
- * Makefile.am (EXTRA_DIST): intltool, not xml-i18n-tools
-
-2003-01-07 Dan Winship <danw@ximian.com>
-
- * Makefile.am (SUBDIRS): add po
-
- * configure.in: Move ALL_LINGUAS definition to before
- AM_GLIB_GNU_GETTEXT, or else no linguas for you!
-
-2003-01-06 Dan Winship <danw@ximian.com>
-
- * configure.in (AC_INIT): Use "Evolution", not "evolution", since
- that becomes the value of the PACKAGE variable
- (privlibdir): parse $VERSION by hand since.
- EVOLUTION_MAJOR_VERSION, etc aren't defined any more (and trying
- to pass a variable to AC_INIT won't work). This and the above
- change fix the problem that privlibdir was being defined as
- "${libdir}/Evolution/." instead of "${libdir}/evolution/1.3"
- (GAL_VERSION): AC_SUBST this since it's needed in the .pc files
- (idldir): define this here rather than in each Makefile.am that
- needs it.
- (AC_OUTPUT): Add .pc files
-
- * Makefile.am (pkgconfig_DATA): Add pc files.
- (confexec_DATA): Remove this (fooConf.sh files)
- (SUBDIRS): Move filter earlier in the build. (I think it was
- calendar that depends on it now?)
- (%Conf.sh): Remove this. The .pc files are output by configure.in
- now.
-
- * camel.pc.in, evolution-addressbook.pc.in,
- evolution-calendar.pc.in, evolution-shell.pc.in: Replace the
- *Conf.sh files with these. In addition to the basic variables,
- include camel_providerdir (in camel.pc) and idldir, IDL_INCLUDES
- and privlibdir (in the others).
-
-2002-12-04 Ettore Perazzoli <ettore@ximian.com>
-
- * configure.in: Define COMPONENT_DIR.
-
-2002-11-22 Jeffrey Stedfast <fejj@ximian.com>
-
- * configure.in: Add NSPR CFLAGS and LDFLAGS to the E_UTIL build
- flags.
-
-2002-11-20 Ettore Perazzoli <ettore@ximian.com>
-
- * configure.in: AC_OUTPUT(my-evolution/Makefile).
-
-2002-11-20 Ettore Perazzoli <ettore@ximian.com>
-
- * Makefile.am (changelogs): Add my-evolution.
-
-2002-11-20 Not Zed <NotZed@Ximian.com>
-
- * libibex/*: cvs removed it all. Not much use having it around
- anymore.
-
-2002-11-19 Ettore Perazzoli <ettore@ximian.com>
-
- * configure.in: Check for gconftool-2, and added
- AM_GCONF_SOURCE_2.
-
-2002-11-18 Not Zed <NotZed@Ximian.com>
-
- * configure.in: Added back IMPORTERS_CFLAGS and
- mail/importers/Makefile
-
-2002-11-16 Chris Toshok <toshok@ximian.com>
-
- * configure.in: we require >= 0.0.9.99 of gal.
-
-2002-11-15 Ettore Perazzoli <ettore@ximian.com>
-
- * configure.in: Set up the my-evolution flags properly, do not
- AC_SUBST GNOME_Evolution_Mail.server.in.
-
-2002-11-13 Not Zed <NotZed@Ximian.com>
-
- * Makefile.am (SUBDIRS): re-added filter, mail, composer
-
- * configure.in: Added EVOLUTION_MAIL settings, and mail/makefile.
-
-2002-11-11 Joe Shaw <joe@ximian.com>
-
- * Makefile.am (SUBDIRS): remove tools for now, it's not in
- configure.in.
-
-2002-11-11 Chris Toshok <toshok@ximian.com>
-
- * Makefile.am (SUBDIRS): add addressbook.
-
-2002-11-08 Chris Toshok <toshok@ximian.com>
-
- * configure.in: add some more addressbook paths.
-
-2002-11-08 Not Zed <NotZed@Ximian.com>
-
- * configure.in: Added composer/Makefile & gtkhtml-3.0 deps.
-
-2002-11-07 Chris Toshok <toshok@ximian.com>
-
- * configure.in (AC_OUTPUT): GNOME_Evolution_Summary.oaf.in = >
- GNOME_Evolution_Summary.server.in
-
-2002-11-07 JP Rosevear <jpr@ximian.com>
-
- * configure.in: update e-util and calendar compile flags
-
-2002-11-07 Rodrigo Moya <rodrigo@ximian.com>
-
- * configure.in: added libgnome-2.0 to camel requirements.
-
-2002-11-06 Chris Toshok <toshok@ximian.com>
-
- * configure.in: add some more addressbook dirs to AC_OUTPUT.
-
-2002-11-05 Jeffrey Stedfast <fejj@ximian.com>
-
- * configure.in: Re-enable the filter cflags/libs stuff.
-
-2002-11-05 Chris Toshok <toshok@ximian.com>
-
- * Makefile.am (SUBDIRS): add wombat.
-
-2002-11-05 Chris Toshok <toshok@ximian.com>
-
- * configure.in: add wombat and addressbook compile flags, and add
- wombat and some addressbook dirs to AC_OUTPUT.
-
-2002-11-05 Dan Winship <danw@ximian.com>
-
- * configure.in: change the commented-out soup check to refer to
- the new soup 2.0 in the libsoup module
-
-2002-11-05 Rodrigo Moya <rodrigo@ximian.com>
-
- * configure.in: use correct libgtkhtml-3.0 for calendar and added
- generation of calendar GUI's directories.
-
-2002-11-05 Rodrigo Moya <rodrigo@ximian.com>
-
- * configure.in: enabled libwombat.
-
-2002-11-04 Rodrigo Moya <rodrigo@ximian.com>
-
- * configure.in:
- * Makefile.am: added libversit directory to build.
-
-2002-11-04 Ettore Perazzoli <ettore@ximian.com>
-
- * Makefile.am (SUBDIRS): Add shell.
-
-2002-11-04 Rodrigo Moya <rodrigo@ximian.com>
-
- * configure.in: added calendar/idl/Makefile to AC_OUTPUT
-
-2002-11-04 Ettore Perazzoli <ettore@ximian.com>
-
- * configure.in: Add an AM_GLIB_GNU_GETTEXT.
-
-2002-11-03 Rodrigo Moya <rodrigo@ximian.com>
-
- * configure.in:
- * Makefile.am: re-added calendar component (only non-UI stuff).
+2002-11-22 Not Zed <NotZed@Ximian.com>
- * data/Makefile.am: use intltools instead of xml-i18n-tools.
+ * configure.in (E_UTIL_CFLAGS/LDFLAGS): Added NSPR stuff, so we
+ can nsprpoll on msgports.
-2002-11-03 Ettore Perazzoli <ettore@ximian.com>
+2002-11-07 Ettore Perazzoli <ettore@ximian.com>
- * configure.in: AC_PROG_INTLTOOL instead of
- AM_PROG_XML_I18N_TOOLS.
+ * configure.in (VERSION_COMMENT): 1.2.0.99.
-2002-11-01 Ettore Perazzoli <ettore@ximian.com>
+== Version 1.2 ==
- * configure.in: Update to use Autoconf 2.53. Remove checks for
- scrollkeeper. Remove intl/Makefile and macros/Makefile from
- AC_OUTPUT list. Set up GETTEXT_PACKAGE. Removed
- AM_ACLOCAL_INCLUDE(macros). Added AM_PATH_ORBIT2.
- (EVO_SET_COMPILE_FLAGS): Use PKG_CHECK_MODULES.
- (IDL_INCLUDES): New, -I params to pass to $(ORBIT_IDL) when
- compiling IDL files into stubs.
+2002-11-06 Ettore Perazzoli <ettore@ximian.com>
- * autogen.sh: Changed to use gnome-autogen.sh.
+ * configure.in: Version 1.2.0.
-2002-10-30 Ettore Perazzoli <ettore@ximian.com>
+2002-11-05 Ettore Perazzoli <ettore@ximian.com>
- * configure.in: 1.1.90.99.
+ * configure.in: Version 1.1.90.99.
== Version 1.1.90 (Release Candidate 1) ==
diff --git a/NEWS b/NEWS
index e4a3729b40..1aca0e7765 100644
--- a/NEWS
+++ b/NEWS
@@ -1,4 +1,850 @@
-Evolution 1.3.1, 2003-03-05
+Evolution 1.2.3, 2003-03-31
---------------------------
-First release based on GNOME 2.
+New features:
+
+ * Mail
+
+ - Added support for Kerberos 5 authentication using GSSAPI.
+
+Updated translations:
+
+ - es (Francisco Javier Fernandez)
+ - it (Marco Ciampa)
+ - no (Kjartan Maraas)
+ - pl (Zbigniew Chyla)
+ - pt (Duarte Loreto)
+ - pt_BR (Gustavo Maciel Dias Vieira)
+ - sv (Christian Rose)
+ - zh_TW (Abel Cheung)
+
+
+Evolution 1.2.3, 2003-03-17
+---------------------------
+
+Bugzilla Bugs Fixed (see http://bugzilla.ximian.com/show_bug.cgi):
+
+ * Mail
+
+ #35123 -- The new/post button chooses a different default account
+ to the new message menu. (Leon Zhang)
+ #33267 -- Filters on source account always match all messages when
+ applied to a local folder. (Michael)
+ #38418 -- Set the local provider name to non-NULL to prevent a
+ crash on Solaris. (Jeff)
+ #38499 -- Header display should not collapse whitespace. (Jeff)
+ #37854 -- Re-Allow users to send to address-lists. (Jeff)
+ #36453 -- Text render bug in PGP passphrase prompt. (Jeff)
+ #39138 -- GPG signed part of message has extra blank line
+ after signing when sent via sendmail. (Jeff)
+ #38073 -- Unimplemented option in Advanced Search dialog. (Jeff)
+
+Other fixes:
+
+ * Addressbook
+
+ - support icsCalendar property and corrected a problem with
+ fetching card properties via select names
+
+ * Calendar
+
+ - Various changes to allow the backend to alter the GUI and to
+ handle RECURRENCE-IDS in events
+
+ * Mailer
+
+ - Fixed a memory leak when using Mark All As Read. (Jeff)
+ - Make the inline uuencode handler more robust. (Jeff)
+ - Make the content-id parser more strict to prevent malicious
+ messages from being able to bypass the user's "load http images"
+ preference. (Jeff)
+ - Strip all Bcc headers before passing the message to the local
+ sendmail. (Jeff)
+ - Fixed a type-o in the IPv6 support code. (Jeff)
+
+ * Shell
+
+ - Fixed IDL #includes. (Rodney)
+
+ * Other
+
+ - Backported XML hash utilities.
+
+Updated translations:
+
+ - cs (Michal Bukovjan)
+ - es (Francisco Javier Fernandez)
+ - fr (Christophe Merlet)
+ - it (Marco Ciampa)
+ - pt_BR (Gustavo Maciel Dias Vieira)
+ - ru (Russian translation team)
+ - sv (Christian Rose)
+
+
+Evolution 1.2.2, 2002-02-04
+---------------------------
+
+Bugzilla Bugs Fixed (see http://bugzilla.ximian.com/show_bug.cgi):
+
+ * Calendar
+
+ #34927 -- Crash when entreing wrong URL of attendee in
+ "Collaboration" tab. (Jack Jia)
+ #34933 -- The question window "Send an update version" pops up
+ inappropriately. (Jack Jia)
+ #35003 -- Passwords sometimes displayed on the status
+ bar. (Rodrigo)
+
+ * Addressbook
+
+ #25541 -- Sensitivity issues in the contact editor. (Toshok)
+ #33672 -- Folder deletion. (Jack Jia)
+ #34883 -- Do anonymous bind initially in ldap backend. (Toshok)
+ #34897 -- Address book crash when search. (Toshok)
+ #34898 -- Handle modifications of contact list members in the
+ minicard view. (Sean Gao)
+ #34900 -- Hang when closing file selector using the window manager.
+ (Jack Jia)
+ #35153 -- Changing default contact folder requires restart. (Toshok)
+ #36375 -- Fix typo in ldap backend that was keeping "other_fax" from
+ working. (Sean Gao)
+
+ * Summary
+
+ #36557 -- Adding a mail folder to the Summary sometimes crashes
+ it. (Harry Lu)
+
+ * Mailer
+
+ #36862 -- Fix the account creation wizard so that deleting the
+ SASL AUTH username and then unchecking the
+ "Needs authentication" checkbox won't disallow
+ continuing with the account creation. (Jeff)
+
+ #33525 -- Trying to delete "unmatched" vfolder crashed evolution.
+ (Antonio Xu)
+
+Other fixes:
+
+ * Mailer
+
+ - Do more sanity checking to make sure the addressbook didn't give
+ us recipients with empty addresses. (Jeff)
+ - Fixed a possible crash when deleting IMAP folders. (Jeff)
+ - Correctly create the x-evolution-messages drag-n-drop clipboard
+ buffer. (Jeff)
+ - Fixed a bug in the PGP/MIME code that would sometimes duplicate
+ the last line of text being signed. (Jeff)
+ - Don't canonicalize any MIME parts that we are attempting to
+ verify using PGP/MIME. (Jeff)
+
+ * Summary
+
+ - Added Finland locations to the weather station list (Pekka
+ Pietikainen).
+
+ * Other
+
+ - Fixed a problem compiling Evolution without conduit support on
+ MacOS X. (Ettore)
+ - Use $(DESTDIR) appropriately when installing the default_user
+ directory. (Max Horn)
+ - Updated docs. (Aaron)
+
+Updated translations:
+
+ - es (Pablo Gonzalo del Campo)
+ - et (Tõivo Leedjärv)
+ - hu (Andras Timar)
+ - it (Marco Ciampa, Alessio Frusciante)
+ - lv (Peteris Krisjanis)
+ - no (Kjartan Maraas)
+ - pt_BR (Gustavo Maciel Dias Vieira)
+ - ru (Andrew V. Samoilov)
+ - sk (Stanislav Visnovsky)
+ - sv (Christian Rose)
+ - tr (Fatih Demir)
+ - uk (Andrew V. Samoilov)
+ - zh_CN (Yuedong Du)
+
+
+Evolution 1.2.1, 2002-12-05
+---------------------------
+
+Bugzilla Bugs Fixed (see http://bugzilla.ximian.com/show_bug.cgi):
+
+ * Addressbook
+
+ #16870 -- Fix CR/LF check for empty lines in LDIF importer. (Sean Gao)
+ #28945 -- Contact lists saved as invalid vCards. (Toshok)
+ #31763 -- Find button missing from Select Contacts from Addressbook
+ dialog. (Toshok)
+ #32352 -- The LDAP backend should be much more robust in the face of more
+ restrictive ACL's. (Toshok)
+ #33097 -- Fix crash when changing autocomplete folder list. Also
+ fixes #30323, #33930, and #33332. (Toshok)
+ #34254 -- Fix case sensitive nature of vCard importer. (Sean Gao)
+
+ * Calendar
+
+ #30993 -- Meeting request for recurring meeting should describe
+ the recurrence. (Dan)
+
+ * Mail
+
+ #32932 -- Reopening a Draft loses References/In-Reply-To headers.
+ (Jeff)
+ #33309 -- Errror while 'Scanning folders in "IMAP server
+ exchange.xxx.xxx"' (Michael)
+ #33933 -- Sorting by subject does not result in expected order (Jeff)
+ #34975 -- Unable to see Inbox on SunOne IMAP server. (Jeff)
+ #34882 -- Forwarded messages use the wrong account. (Jeff)
+ #34315 -- Files silently lost when doing Drag and Drop. (Jeff)
+ #34327 -- Dragging doesn't work for non-inline attachments. (Harry Lu)
+ #34975 -- Unable to view Inbox on SunOne IMAP server (Jeff)
+
+Other fixes:
+
+ * Addressbook
+
+ - Fix scope problem where scopes would be saved as "base" and
+ "one" instead of "one" and "sub" repectively. (Toshok)
+ - Fixed a possible (and very probable) crash involving the
+ minicard view. (Toshok)
+ - Fixed a crash in the file backend. (Toshok)
+
+ * Calendar
+
+ - Fixed a bunch of memory leaks related to email meeting
+ scheduling. (Hans)
+ - Make the libical grammar files work with newer versions of
+ Bison.
+
+ * Mail
+
+ - Make the stop button work better when using SSL connections.
+ (Michael)
+
+ * Shell
+
+ - Kill old wombat processes to avoid problems for users who
+ upgrade. (Ettore)
+ - Fixed some localization problems. (Dan)
+ - Fixed the leaks in the settings dialog. (Ettore)
+
+ * Other
+
+ - Fixed compliance of the .omf files with the OMF 1.0 DTD.
+ (Frederic Crozat)
+
+ * Mailer
+
+ - Fixed SSL streams to have cancellable reads and writes.
+ - Auto-subscribe the user to his/her IMAP INBOX
+
+New features:
+
+ - evolution-launch-composer command-line tool to open up the
+ composer with attachments. (Chris Lahey, Federico)
+
+Updated translations:
+
+ - de (Christian Neumair)
+ - et (Tõivo Leedjärv)
+ - fr (Joaquim Fellmann)
+ - pt_BR (Gustavo Maciel Dias Vieira)
+
+
+Evolution 1.2.0, 2002-11-06
+---------------------------
+
+Changes since 1.1.90:
+
+ - Made the default width of the mail filter editing dialog larger.
+ (Dan)
+
+ - Removed the development warning at startup. (Ettore)
+
+
+Evolution 1.1.90, 2002-10-28
+----------------------------
+
+Bugzilla Bugs Fixed (see http://bugzilla.ximian.com/show_bug.cgi):
+
+ * Addressbook
+
+ #25477 -- Crash. (Toshok)
+ #29067 -- Editing an address entry causes it to disappear. (Toshok)
+ #29144 -- Selection problem in directory servers page of
+ preferences dialog. (Toshok)
+ #32144 -- Incorrect filename when saving contact with 8-bit ascii
+ characters. (Toshok)
+
+ * Calendar
+
+ #11434 -- Closing event/task editor & committing fields. (Rodrigo)
+ #16036 -- The work week view goes stupid whrn you scroll through
+ the months. (JP)
+ #19159 -- Application "evolution-alarm-notify" has crashed.
+ (Rodrigo)
+ #25153 -- Crash on iCalendar entry. (Rodrigo)
+ #28951 -- CDO doesn't understand UNTIL=date in RRULE. (JP)
+ #31774 -- Reselecting options for reminder crashes calendar.
+ (Rodrigo)
+ #31812 -- "Day begins" in Settings should respect 12/24 time pref.
+ (JP)
+ #32613 -- "New Appointment" uses local calendar instead of default
+ calendar. (Rodrigo)
+ #32276 -- My custom task view crashes task and calender views
+ every time. (JP)
+ #32371 -- Crash on close/save on calender. (Rodrigo)
+
+ * Mail
+
+ #5529 -- Omit signature when quoting. (Jeff)
+ #15966 -- Visual bug in moving a message to a folder. (Michael)
+ #28735 -- Reply to list isn't looking in Cc: for recipients.
+ (Jeff)
+ #30045 -- Possible man-in-the-middle attack when using SSL -
+ assuming that the forged certificate had an identical
+ md5sum of the real certificate. (Michael)
+ #31456 -- Evolution doesn't see certain IMAP mailboxes.
+ (Michael)
+ #31647 -- Subscribe dialog is broken. (Michael)
+ #31667 -- IMAP filtering can drop out before completion or run
+ multiple times. (Michael)
+ #31788 -- Redundant string in translation. (Jeff)
+ #31789 -- Redundant string in translation. (Jeff)
+ #31891 -- Setup Assistant looses account name if you go back.
+ (Jeff)
+ #32002 -- Crash when creating folder. (Jeff)
+ #32229 -- Mail quits when attempting to open a PGP icon in the
+ message. (Jeff)
+ #32230 -- Preferences crashes the mail component. (Jeff)
+ #32268 -- Filters on source account fail. (Jeff)
+ #32270 -- Passwords are lost when pressing "cancel all" on
+ send/receive. (Jeff)
+ #32293 -- Can't select PGP; it keeps reverting to GPG. (Jeff)
+ #32328 -- New email message sound notification poblem. (Jeff)
+
+ * Shell
+
+ #25891 -- Crash when notifying a CORBA exception. (Ettore)
+ #27735 -- Missing Cancel button in "Open Other User's Folder"
+ dialog. (Ettore)
+ #30950 -- Crash when trying to delete a toplevel folder bar node.
+ (Ettore)
+ #31303 -- X locked when opening a folder bar node that requires a
+ password. (Ettore)
+ #31564 -- 8-bit characters not respected in the "Open Other User's
+ Folder" dialog. (Ettore)
+ #32032 -- Autocompletion folder list doesn't respect 8-bit
+ characters. (Ettore)
+
+ * Summary
+
+ #31581 -- Gnotices news feed doesn't work. (Ettore)
+ #31607 -- Appointments and tasks not listed. (Ettore)
+ #31616 -- Appointments and tasks not listed. (Ettore)
+ #31639 -- Crash when changing preferences. (Ettore)
+
+Other fixes:
+
+ * Addressbook
+
+ - The "Select Names" dialog remembers what folder you were in
+ between uses now, which is useful for people who normally select
+ names out of an LDAP directory. (Dan)
+
+ * Calendar
+
+ - Make sure configuration info can be applied in units changed for
+ task hide option. (JP)
+
+ * Shell
+
+ - Fix settings dialog size for smaller fonts. (Ettore)
+
+
+Evolution 1.1.2, 2002-10-07
+---------------------------
+
+Bugzilla Bugs Fixed (see http://bugzilla.ximian.com/show_bug.cgi):
+
+ * Addressbook
+
+ #17336 -- Evolution mixes up First and Last names sometimes.
+ (Toshok)
+ #27521 -- Crash: exiting from evolution after adding to address
+ book. (Toshok)
+ #28165 -- Contacts crashed when selecting offline IMAP folders.
+ (Toshok)
+ #28392 -- Crash when adding a new contact. (Toshok)
+ #30208 -- LDAP authentication issues. (Toshok)
+ #30481 -- Select contacts dialog not using default contact folder.
+ (Toshok)
+ #30483 -- LDAP folders do not work as an autocompletion folder.
+ (Toshok)
+ #31321 -- Missing VERSION property in exported vCards. (Toshok)
+ #31434 -- Only sends email to first three addresses on contact
+ list. (Toshok)
+ #29171 -- Crash after selecting other user's folder for Offline.
+ (Toshok)
+ #30250 -- Addressbook crashes or hangs after selecting LDAP
+ folder. (Toshok)
+
+ * Calendar
+
+ #14111 -- Gives "are you sure you want to" prompt when no such
+ action has occurred. (JP)
+ #15710 -- Automatically-created reminder always says "Untitled
+ Appointment". (Rodrigo)
+ #15892 -- Running out of disk space can cause loss of calender
+ entries and tasks. (Rodrigo)
+ #18162 -- Double-click on calendar week/month view shouldn't do
+ all-day event. (JP)
+ #19159 -- evolution-alarm-notify crash. (Rodrigo)
+ #24210 -- Calendar is slow. (Rodrigo)
+ #27961 -- vcalendar LAST-MODIFIED field not updated on change.
+ (Rodrigo)
+ #28310 -- Calendar re-runs alarms. (Rodrigo)
+ #28853 -- Crash when deleting tasks in task editor. (Mike)
+ #29983 -- New appointments use 25 hour day. (JP)
+ #30057 -- Calendar GUI does not allow for read-only folders.
+ (Rodrigo)
+ #30290 -- Importer Not Ready when importing .ics Ical file.
+ (Rodrigo)
+ #30381 -- Calendar recurrences "off-by-one". (JP)
+ #31774 -- Reselecting options for remider crashes calendar.
+ (Rodrigo)
+
+ * Conduits
+
+ #21631 -- Palm calendar event with no time should appear as "All
+ day event". (JP)
+ #23763 -- Problem with appointments that cross a day boundary and
+ pilot sync. (JP)
+
+ * Mail
+
+ #236 -- Composer attachment bar wraps lines annoyingly. (Ettore)
+ #4224 -- camel-imap-cache needs better error checking. (Jeff)
+ #20849 -- Folder Properties should be on right click menu.
+ (Michael)
+ #21027 -- Accept broken content-ids. (Jeff)
+ #22496 -- Evolution does not appear to support ALERT messages.
+ (Michael)
+ #24179 -- Character set conversion problem under tr_TR
+ locale. (Radek)
+ #24732 -- Importing mailman mbox files doesn't work. (Ettore)
+ #27391 -- New Message Count not updated in vFolders. (Michael)
+ #28453 -- Forwarding PGP-signed message inline should discard
+ signature. (Jeff)
+ #28209 -- Error messages for Offline folder operations
+ misleading. (Michael)
+ #28834 -- Threaded + hide deleted messes up clear search.
+ (Michael)
+ #29293 -- Back button on final page of new account doesn't work.
+ (Michael)
+ #29625 -- Cannot clear a saved search. (Michael)
+ #29731 -- Crash in libsoup. (Michael)
+ #29808 -- Control-K to mark read broken when preview not shown.
+ (Michael)
+ #29933 -- Mail component forgets pane size sometimes. (Dan)
+ #29965 -- Crash. (Jeff)
+ #30183 -- Advanced search broken. (Jeff)
+ #30269 -- Crash appending to an mbox that is too large (>2GB).
+ (Jeff)
+ #30399 -- Vfolders of imap do not update. (Michael)
+ #30580 -- Closing drafts message asks to save again. (Jeff)
+ #30731 -- "automatically detect links" checkbox doesn't work.
+ (Jeff)
+ #30827 -- Delete on Deleted Message Does not move to next.
+ (Jeff)
+ #30877 -- Improper IMAP folder behavior. (Michael)
+ #30873 -- Cannot display many mails in zh_CN.GB2312. (Jeff)
+ #30876 -- Drag and drop a mail from Trash duplicates it. (Jeff)
+ #30915 -- Crash when upgrading from 1.0.x to 1.1.1. (Jeff)
+ #31000 -- evolution-mail random core dumps. (Michael)
+ #31031 -- Random crashes -- possible memory corruption bug on
+ SMP box. (Michael)
+ #31060 -- Advanced Search no longer works. (Michael)
+ #31087 -- Mailing list filters fail for yahoogroups.com. (Michael)
+ #31331 -- Crash upon opening a mail message. (Michael)
+ #31365 -- Enter password dialog not displaying extended ASCII
+ chars correctly. (Michael)
+ #31379 -- Can't see encrypted mail to myself (and maybe others?)
+ (Jeff)
+ #31456 -- Evolution does not see IMAP mailboxes. (Jeff)
+ #31547 -- Quote the decrypted text when replying to encrypted
+ messages. (Jeff)
+ #31553 -- Next button disabled in Identity window of setup
+ assistant. (Jeff)
+ #31554 -- Cannot run evolution if Reply-to: is set to an invalid
+ address. (Jeff)
+ #31555 -- Account editor mangling reply-to: extended ASCII
+ characters. (Jeff)
+ #31559 -- Evolution crashes when going to Tools -> Preferences.
+ (Jeff)
+ #31655 -- Do not strip 8bit characters from text attachments.
+ (Jeff)
+ #31681 -- Mail filter problem in 1.1.1.99. (Jeff)
+ #31693 -- Try harder to pick the correct From-account to use
+ when replying. (Jeff)
+ #31572 -- valgrind detects a deadlock. (Michael)
+ #31752 -- No EHLO to re-check AUTH capabilities after a STARTTLS
+ has been issued. (Jeff)
+
+ * Shell
+
+ #11645 -- Shortcuts are not updated when a folder is moved.
+ (Ettore)
+ #14019 -- Cannot access the conduit settings directly from
+ Evolution. (Ettore)
+ #16556 -- Start-up wizard doesn't propmpt for IMAP password.
+ (Ettore)
+ #19899 -- First-run code uses free() instead of g_free().
+ (Ettore)
+ #24062 -- When removing a folder with unread messages, sometimes
+ its parent folder stays highlighted even when it
+ shouldn't be. (Ettore)
+ #27662 -- Unread count in shortcut bar doesn't update properly.
+ (Ettore)
+ #27855 -- Send/Receive should be disabled when offline.
+ (Ettore)
+ #24879 -- Crash on folder change. (Mike)
+ #28232 -- Default type for the folder creation dialog is
+ sometimes "Contacts" instead of "mail". (Ettore)
+ #28317 -- File->Close doesn't work. (Ettore)
+ #28451 -- Renaming causes incorrect sorting in the folder tree.
+ (Ettore)
+ #28495 -- Settings dialog resizes when you switch pages.
+ (Ettore)
+ #28591 -- Crash on startup w/ connector installed. (Mike)
+ #29293 -- Back button on final page of new account doesn't work.
+ (Michael)
+ #30248 -- Folder selection dialog crash. (Mike)
+ #30533 -- The folder creation dialog changes the parent folder
+ selection if you specify a name that already exists.
+ (Ettore)
+ #31360 -- Crash when using the folder selection button. (Dan)
+ #31690 -- Importer crash. (Ettore)
+
+ * Summary
+
+ #15101 -- "My Weather" section shows up when it shouldn't.
+ (Ettore)
+ #20737 -- Israel missing from the weather station list.
+ (Sam Popper)
+ #28481 -- Crash during start-up. (Ettore)
+ #28903 -- Unread message counts not reported correctly.
+ (Ettore)
+
+ * gtkhtml-1.1.3
+
+Other fixes:
+
+ * Addressbook
+
+ - Fixed some memory leaks. (Toshok)
+
+ * Calendar
+
+ - Do not allow empty attendee addresses for meetings. (JP)
+ - Better alarm daemon activation. (Rodrigo)
+ - Notification of calendar query errors. (Rodrigo)
+ - Added status messages for all operations. (Rodrigo)
+
+ * Conduits
+
+ - Fixed linking issues. (JP)
+
+ * Shell
+
+ - Some strings that were not translated properly before now are.
+ (Kjartan Maraas)
+ - Sensitivity problem when using the folder selector. (Toshok)
+ - Changed the way shared folders work with Connector. (Dan)
+ - Allow accessing local folders even if some folders with
+ unknown/corrupted metadata type are found in ~/evolution/local.
+ (Ettore)
+ - Importer dialog browse entry now has history dropdown. (Rodrigo)
+ - We no longer allow selecting a folder of a non-allowed type with
+ a double-click in the folder selection dialog. (Dan)
+
+Updated translations:
+
+ - ko (Young-Ho Cha, Changwoo Ryu)
+ - nn (Roy-Magne Mo)
+ - no (Kjartan Maraas)
+ - pl (Zbigniew Chyla)
+ - vi (Pablo Saratxaga)
+ - tr (Gorkem)
+
+
+Evolution 1.1.1, 2002-09-09
+---------------------------
+
+New features:
+
+ * General
+
+ - The toolbar now includes a "New" dropdown menu/button from which
+ you can create messages, appointments, etc. from within any
+ folder.
+
+ - A new, integrated configuration dialog for all of Evolution is
+ now provided.
+
+ - When you use the folder selection dialog, you can now jump to a
+ folder just by typing its name and hitting Enter (instead of
+ using the arrows or the mouse).
+
+ - You can now specify your default mail, calendar, tasks and
+ contacts folders. The shortcuts in the shortcut bar will always
+ point to the default folder; so for example if you have an IMAP
+ account you can specify that the INBOX on the IMAP account is
+ default and clicking on the Inbox icon on the shortcut bar will
+ take you to the INBOX on the IMAP account.
+
+ - Fonts for displaying of HTML mail can now be configured from
+ within Evolution (instead of having to use GNOME Control
+ Center).
+
+ - You can now make Evolution play a sound, beep, or display a
+ message when new mail arrives. It is also possible to trigger
+ these actions based on a filter rule.
+
+ - The behavior of the search bar has been improved, and the UI has
+ been integrated better with the menu bar and the rest of the
+ system.
+
+ - For the table-based views, you can now define, save and reuse
+ view settings using the "View" menu.
+
+ - The Send/Receive button is now always accessible from any
+ folder.
+
+ - Easier to build on non-GNU, and non-GCC systems (e.g. MacOS/X,
+ HP/UX, Solaris).
+
+ - Now installs some libraries and headers required for external
+ module development.
+
+ - You now can drop objects (eg. mail messages, appointments)
+ directly to the folders on the shortcut bar (in 1.0.x, you could
+ only drop them in the folder folder bar).
+
+ * Calendar
+
+ - Loading speed has been improved.
+
+ - When you receive an appointment through email, you can choose
+ which calendar to update, and if its for an existing appointment
+ the folder is automatically detected
+
+ - Calendar importer now supports importing to remote folders.
+
+ - Calendar GUI and alarm daemon now use listeners for the
+ configuration.
+
+ - Reaction to calendar backends crashing has been improved.
+
+ - Show status messages for all long calendar operations.
+
+ - Fixed default reminders description (was 'Untitled
+ appointment').
+
+ - Included timezone information on VCALENDAR's used in copy/paste.
+
+ - Removed extra space that was displayed for categories without
+ icons.
+
+ - Fixed crashes in the alarm daemon.
+
+ - Fixed crashes in calendar related to creating new evolution
+ windows.
+
+ - When right clicking, correctly select the underlying date/time.
+
+ - Meeting scheduling improvements; sends replies when you update
+ your attendance status, warnings if the user changes a meeting
+ they didn't create.
+
+ - Deleting a meeting with a right click will now offer to send a
+ cancellation notice.
+
+ - Can accept meeting replies from non-attendees (they become
+ attendees).
+
+ - Fixed work day so start can't be before end, its minimum 1 hour
+ and the unshaded zone is not rounded to the nearest time
+ division (allowing the work hours to be 0:00 to 23:59).
+
+ - Fixed task view to update completion status the same as the
+ editor.
+
+ - Fixed leap year problem with day of week.
+
+ - Handle "last day of the month" and "last Tuesday of the month"
+ type recurrences.
+
+ * Contacts
+
+ - It is now possible to specify which folders are used for
+ autocompletion globally.
+
+ - Improved address selection dialog (for sending mail and meeting
+ requests).
+
+ - Improved feedback for search results for all backends and the
+ UI.
+
+ - SSL/STARTTLS suport for LDAP has been added.
+
+ - Caches are built for local addressbooks to speed up
+ autocompletion.
+
+ - Fixed wombat/addressbook crashes dealing with autocompletion, it
+ should be much more stable now.
+
+ - Categories on LDAP are now stored using a multivalued attribute
+ (category) instead of a comma separated list (categories), so
+ searches on categories in ldap actually work. The old attribute
+ is deprecated and should not be used.
+
+ - Standardized some of the static properties of addressbooks, and
+ removed some local addressbook logic from the frontend.
+
+ - When editing contacts from the composer entries (To:, CC:), pop
+ up the right kind of editor based on the contact type.
+
+ - Much improved LDAP backend responsiveness and performance.
+
+ * Mail
+
+ - New, much faster indexing engine. This results in faster mail
+ incorporation, faster mail display, and faster searches.
+ Overall, the new engine should work much better for larger
+ folders, and take considerably less space on the disk.
+
+ - Faster POP3 download, using the server's pipeline extensions if
+ available.
+
+ - If you type multiple words in the search bar for the
+ "... Contains" rules, Evolution will search messages that
+ contain all of the words you specified, in any order.
+
+ - More consistent search results for indexed, non-indexed and
+ remote folders.
+
+ - UTF8 (Unicode) used for all searches, even with IMAP servers.
+
+ - It is now possible to mark messages for follow-up and other
+ flags. It is also possible to change the color in which a
+ specific message is displayed in the mail list.
+
+ - When the message list is sorted by a certain field, it is possible
+ to jump to the first item in the list that matches a certain
+ string by just typing the first few characters.
+
+ - Filters are now updated automatically when the destination folder
+ gets moved or removed.
+
+ - A new filter rule allows you to pipe mail through an external
+ process to find out whether or not to filter it.
+
+ - You can now specify which folders get synced when switching to
+ offline mode.
+
+ - All previously read messages are automatically downloaded for
+ offline use.
+
+ - Offline state is preserved between sessions. Generally, offline
+ mode is more stable and complete.
+
+ - STARTTLS support for POP, SMTP and IMAP has been added.
+
+ - IMAP can now handle folder names containing &, -, and UTF-8
+ characters.
+
+ - You can have all of your mail Auto-Cc:ed or auto-Bcc:ed to a
+ specified set of recipients.
+
+ - SMTP error reporting has been improved.
+
+ - Much improved GnuPG support. Better pgp/mime interoperability.
+
+ - Improved support for external Maildir, MH, and mailbox folders,
+ and trees of folders. Internally they share more code now and
+ are easier to maintain.
+
+ - External mailbox folders can interoperate with pine/mutt/elm
+ status flags directly (at slightly performance penalty). See
+ options on the "spool" provider.
+
+ - Many IMAP related bugs fixed. IMAP now passes current folder
+ regression tests.
+
+ - IMAP body search results are now cached. Vastly improving
+ body search vFolder performance with IMAP sources.
+
+ - Optional IPv6 support.
+
+ - Progress bar added to subscribe dialogue.
+
+ - Camel's multithread safe object system streamlined and
+ improved. Many other internal cleanups inside Camel.
+
+ - vFolders can now have an additional column which shows the
+ original location of the message. Particularly useful for Trash
+ folder.
+
+ - New messages dont "upset" the thread view as much, if no sorting
+ is used.
+
+ - Various vFolder tweaks and fixes.
+
+ - Remote inline HTML images are now downloaded incrementally using
+ libsoup and are fully cancellable.
+
+ - Improved quotation display for format=flowed messages.
+
+ * Mail Composer
+
+ - You can now edit a set of signatures within Evolution, and pick
+ which signature you want when composing a message.
+
+ - Handling of replies has been improved; in particular, you can
+ now paste any text as a quotation, and quotation formatting is
+ preserved when switching between HTML and non-HTML mode.
+
+ - Evolution can now generate graphical smileys automatically as
+ you type.
+
+ - Quotation logic has been improved, rewrapping long lines in
+ replies now preserves quotation marks.
+
+ - Multiple simulataneous language support in the spell checker.
+
+ - Cut & Paste support for html between netscape/mozilla/evolution.
+
+ - Optimized rendering of long messages.
+
+ - Improved html rendering, including support for the clear
+ attribute in <br> elements.
+
+ * Summary
+
+ - Can have non-local mail folders displayed on the summary.
+
+ - Improved Calendar and Tasks displayed. Displays overdue and todays
+ tasks in colours.
+
+ - Uses Soup for HTTP downloading news feeds and weather info.
+
+ - Better folder selector.
+
+ - Better Weather/News Feed selector.
+
+ - Can delete user added news feeds.
diff --git a/README b/README
index 4413d468a6..4760b20572 100644
--- a/README
+++ b/README
@@ -1,23 +1,23 @@
-Evolution is the integrated mail, calendar and address book suite from
-Ximian, Inc.
+Evolution is the integrated mail, calendar and address book
+distributed suite from Ximian, Inc.
See http://www.ximian.com/products/evolution for more information.
If you are using Evolution, you may wish to subscribe to the Evolution
-users mailing list. If you are interested in contributing to
+users mailing list. If you are interested in contributing to
development on it, you should certainly subscribe to the Evolution
-Hackers mailing list. Visit
+Hackers mailing list. Visit
+http://developer.ximian.com/community/lists.html to subscribe to
+Ximian mailing lists. If you are planning to work on any part of
+Evolution, please send mail to the mailing list first, to avoid
+duplicated effort (and to make sure that you aren't basing your work
+on interfaces that are expected to change).
- http://developer.ximian.com/community/lists.html
+There are mailing list archives available at
+http://lists.ximian.com/archives/public/evolution/ and
+http://lists.ximian.com/archives/public/evolution-hackers/
-to subscribe or view archives of the Ximian mailing lists.
-
-If you are planning to work on any part of Evolution, please send mail
-to the mailing list first, to avoid duplicated effort (and to make
-sure that you aren't basing your work on interfaces that are expected
-to change).
-
-There is also a #evolution IRC channel on irc.gnome.org.
+There is also an #evolution IRC channel on irc.gnome.org.
Help for Evolution is available in the user manual (select "Help" from
the menu after running the application), at the Ximian knowledge base
@@ -28,229 +28,240 @@ evolution" at the command line), and in the --help strings (run
The rest of this file is dedicated to building Evolution.
-DEPENDENCIES
-------------
+PROBLEMS BUILDING EVOLUTION
+---------------------------
-In order to build Evolution you need to have the full set of GNOME 2
-or GNOME 2.2 development libraries installed.
+Did you read the "How to build" section below?
-GNOME 2 comes with most of the modern distributions, so in most cases
-it should be enough to just install all the devel packages from your
-distribution. If, on the other hand, you want to build GNOME 2 from
-source, please refer to this page:
+If the configure script complains that you don't have a library that
+you know you have installed, it usually means either that you've
+installed things into multiple prefixes (see the bits on GNOME_PATH
+below) or (if you're on Linux) that you installed the "foo" package
+but forgot the "foo-devel" or "foo-dev" packages.
- http://gnome.org/start/2.2/notes/rninstallation.html
-Please make sure you have the most recent versions of the libraries
-installed, since bugs in the libraries can cause bugs in Evolution.
+HOW TO BUILD EVOLUTION
+----------------------
-Additional dependencies, besides the stock GNOME libraries (the
-dependencies should be compiled in the order they are listed here):
+ *** READ THIS BEFORE YOU START BUILDING ANYTHING! ***
- * [If compiling against GNOME 2.0] libgnomeprint and
- libgnomeprintui 2.2.0 or later
+Evolution depends on a large number of unreleased and rapidly-changing
+libraries. Some of these libraries in turn depend on other unreleased
+and rapidly-changing libraries.
- These library come with GNOME 2.2 installations, but not
- with GNOME 2.0 ones. The source code can be downloaded from
- the following locations:
+Building Evolution is HARD, and it's going to stay hard until all of
+the libraries it depends on stabilize, and there's nothing we can do
+to make it any easier until then.
- ftp://ftp.gnome.org/pub/gnome/sources/libgnomeprint
- ftp://ftp.gnome.org/pub/gnome/sources/libgnomeprintui
- * [If compiling against GNOME 2.2] libgnomecanvas 2.2.0.2 or
- later
+GENERAL PRINCIPLES
+------------------
- If you have a GNOME 2.2 installation, you need to upgrade
- libgnomecanvas to this version (or a later one), since
- Evolution exposes a bug in the older versions of the library
- which causes a crash.
+First you have to decide whether you want to install Evolution (and
+its dependencies) into the same prefix as the rest of your GNOME
+install, or into a new prefix. Installing everything into the same
+prefix as the rest of your GNOME install will make it much easier to
+build and run programs, and easier to switch between using packages
+and building it yourself, but it may also make it harder to uninstall
+later.
- If you have a GNOME 2.0 installation, libgnomecanvas 2.0 is
- safe to use.
+If you want to install into the same prefix as the rest of GNOME,
+type:
- * libsoup 1.99.12 or later
+ gnome-config --prefix
+ gnome-config --sysconfdir
- ftp://ftp.gnome.org/pub/gnome/sources/libsoup
+and remember the answers, and pass them to "configure" or "autogen.sh"
+when building the other packages you need. For example:
- * gtkhtml 3.0.1 or later
+ ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var/lib
- ftp://ftp.gnome.org/pub/gnome/sources/gtkhtml
+ --localstatedir is needed to make the docs integrate with scrollkeeper
+ and needs to point to the directory containing the scrollkeeper indices
+ which are in: gnome-config --localstatedir
- * gal 1.99.2 or later
+If you build in another prefix instead, you will need to set the
+GNOME_PATH environment variable (and ACLOCAL_FLAGS as well if building
+from CVS) to include the prefix you install into. For example:
- ftp://ftp.gnome.org/pub/gnome/sources/gal
+ export GNOME_PATH=/usr/local
+ export ACLOCAL_FLAGS="-I /usr/local/share/aclocal"
- * Berkeley's libdb 3.1.17
+(Assuming your shell is bash, and you installed into /usr/local.) You
+need to set GNOME_PATH both during compiling AND when you run
+evolution. Remember also that if you're installing into an odd prefix
+such as /evolution, that you also need to make sure to put
+${prefix}/bin in your PATH and ${prefix}/lib in your LD_LIBRARY_PATH.
- It is important to use *exactly* this version, and not a
- later one, to compile Evolution. Please check the "Building
- Berkeley DB" section below for more information.
- ftp://ftp.ximian.com/pub/ximian-evolution-beta/source/
+DEPENDENCIES
+------------
- * [Optional] Mozilla NSPR/NSS libraries
+The following required libraries are available in GNOME CVS, under the
+given names. Most (but not all) of them are also available as
+tarballs on ftp.gnome.org or one of the Ximian mirrors listed at
+http://ximian.com/mirrors.html.
- These are needed if you want to compile Evolution with SSL
- support.
+If installing from packages, remember that you need both the runtime
+and -devel packages for each library.
- http://www.mozilla.org/
+ - GNU intltool 0.18
- Many distributions ship these as Mozilla development
- packages.
+ - scrollkeeper - 0.1.4 or later
- * [Optional] gnome-pilot 2.0 or later
+ - gnome-xml - 1.8.17 or later in the 1.0 series, but not from the 2.0
+ series (If you get this from GNOME CVS, use the tag "LIB_XML_1_BRANCH".)
- This is only necessary if you want to be able to synchronize
- your Palm device with Evolution.
+ - gnome-print - 0.35 or later
- ftp://ftp.gnome.org/pub/gnome/sources/gnome-pilot
- ftp://ftp.gnome.org/pub/gnome/sources/gnome-pilot-conduits
+ - gdk-pixbuf - 0.18.0 or later
- * [Optional] gnome-spell 1.0.1 or later
+ - ORBit - 0.5.8 or later (If you get this from GNOME CVS, use the
+ tag "orbit-stable-0-5".)
- This is only necessary if you want to have the spell
- checking functionality in Evolution's message composer.
+ - oaf - 0.6.10 or later (If you get this from GNOME CVS, use the tag
+ "oaf-stable-0-6")
- ftp://ftp.gnome.org/pub/gnome/sources/gnome-spell
+ *** If you are using oaf from CVS, you should use the flag
+ *** "--disable-more-warnings" when you configure, or it may fail to
+ *** build.
+ - gnome-vfs - 1.0.5 or later (If you get this from GNOME CVS, use
+ the tag "gnome-vfs-1-0")
-COMPILING BERKELEY DB
----------------------
+ *** If you are using gnome-vfs from CVS, you should use the flag
+ *** "--disable-more-warnings" when configuring, or it may fail to
+ *** build.
- --- IMPORTANT WARNING ---
+ - libglade - 0.14 or later
- The on-disk format of DB files has been changing between versions 2, 3
- and 4. Also, because of the libdb API, there is no way to easily
- handle the different formats from within the application. For this
- reason, Evolution has chosen to use one specific version of the
- library (version 3) and stick to it, so that users do not need to
- convert their addressbook files to use them with different version of
- Evolution.
+ - bonobo - 1.0.3 or later
- That's why Evolution REQUIRES libdb 3.1.17, and NO OTHER VERSION.
+ *** Note that bonobo must be installed with the same --prefix as
+ *** either gnome-libs or evolution for the Makefiles to work
+ *** properly.
- If you force the check to accept a version different from 3.1.17, your
- binary of Evolution will be using a different format from the chosen
- one; this means that it will not be able to read addressbook databases
- created by other versions of Evolution which were compiled in the
- standard way. Also, we DO NOT GUARRANTEE that Evolution will work
- with different versions of libdb at all, even if it can be trivially
- made to compile against them.
+ - bonobo-conf - 1.0.16 or later
- SPECIAL NOTE FOR BINARY PACKAGERS:
+ - gal (GNOME Application Library) - 0.21 or later
- If you are making binary packages for end-users (e.g. if you are a
- distribution vendor), please statically link Evolution to Berkeley
- DB 3.1.17, as mandated by the configure.in check. DO NOT patch
- configure.in to work around the check. Forcing the check to link
- to a different version of the library will only give headaches and
- pain to your users, who will see their addressbook disappear and
- will complain to us (the Evolution team) about losing their data.
+ - gtkhtml - 1.1.5 or later
- Besides, libdb will be linked statically, which means that your
- distribution doesn't actually need to ship DB 3.1.17 itself
- separately.
+ - SOUP - 0.7.x
- The Evolution team will be infinitely grateful for your
- co-operation. Thanks!
+ *** If you are compiling from CVS, grab the soup-0-7 branch.
-If you don't have version 3.1.17 installed on your system or Evolution
-doesn't detect it for some reason, here is a way to get Evolution to
-link to it without messing up your system installation.
+Other non-GNOME Dependencies:
- * Install the content of the tarball somewhere *other* than the
- evolution source tree, e.g: NOT evolution/db-3.1.17 .
+ - Berkeley's libdb - 3.1.17
- * Compile according to instructions, but installing into some custom
- prefix, for example:
+ db3 is available from http://www.sleepycat.com. Make sure to get
+ 3.1.17, which isn't the latest version.
- ../dist/configure --prefix=/home/user/berkeleydb-3.1.17
+ --- IMPORTANT WARNING ---
- * Configure Evolution specifying that it has to look for the DB
- library there, for example:
+ The on-disk format of DB files has been changing between versions
+ 2, 3 and 4. Also, because of the libdb API, there is no way to
+ easily handle the different formats from within the application.
+ For this reason, Evolution has chosen to use one specific version
+ of the library (version 3) and stick to it, so that users do not
+ need to convert their addressbook files to use them with
+ different version of Evolution.
- ./configure --prefix=/opt/gnome
- --with-db3-includes=/home/user/berkeleydb-3.1.17/include
- --with-db3-libs=/home/user/berkeleydb-3.1.17/lib
+ That's why Evolution REQUIRES libdb 3.1.17, and NO OTHER VERSION.
-Evolution links statically to the library, so after you have compiled
-Evolution you can remove the installed library from your system.
+ If you force the check to accept a version different from 3.1.17,
+ your binary of Evolution will be using a different format from
+ the chosen one; this means that it will not be able to read
+ addressbook databases created by other versions of Evolution
+ which were compiled in the standard way. Also, we DO NOT
+ GUARRANTEE that Evolution will work with different versions of
+ libdb at all, even if it can be trivially made to compile against
+ them.
+ SPECIAL NOTE FOR BINARY PACKAGERS:
-CONFIGURING EVOLUTION
----------------------
+ If you are making binary packages for end-users (e.g. if you are
+ a distribution vendor), please statically link Evolution to
+ Berkeley DB 3.1.17, as mandated by the configure.in check. DO
+ NOT patch configure.in to work around the check. Forcing the
+ check to link to a different version of the library will only
+ give headaches and pain to your users, who will see their
+ addressbook disappear and will complain to us (the Evolution
+ team) about losing their data.
-First you have to decide whether you want to install Evolution (and
-its dependencies) into the same prefix as the rest of your GNOME
-install, or into a new prefix.
+ Besides, libdb will be linked statically, which means that your
+ distribution doesn't actually need to ship DB 3.1.17 itself
+ separately.
-Installing everything into the same prefix as the rest of your GNOME
-install will make it much easier to build and run programs, and easier
-to switch between using packages and building it yourself, but it may
-also make it harder to uninstall later. Also, it increases the chance
-that something goes wrong and your GNOME installation gets ruined.
+ The Evolution team will be infinitely grateful for your
+ co-operation. Thanks.
-If you want to install in a different prefix, you need to do the
-following things:
- * Set the PKG_CONFIG_PATH environment variable to contain a
- colon-separated list of all the pkg-config directories that
- will be involved in the build. This basically means a list
- of $prefix/lib/pkgconfig directory names, where $prefix is
- the prefix where a library is installed.
+COMPILING BERKELEY DB
+---------------------
- For example, if you have GNOME installed in /usr and you
- are installing Evolution and its dependencies in
- /opt/evolution, you want to do something like the following
- (assuming you are using Bash):
+If you don't have 3.1.17 installed on your system or Evolution doesn't
+detect it for some reason, here is a way to get Evolution to link to
+it without messing up your system installation.
- export PKG_CONFIG_PATH=/usr/lib/pkgconfig:/opt/evolution/lib/pkgconfig
+ * Get the Sleepycat tarball from:
- * Edit the bonobo-activation-config.xml file (which is
- normally found in /etc/bonobo-activation/) to include the
- location where you are installing Evolution.
+ http://www.sleepycat.com/update/snapshot/db-3.1.17.tar.gz
- In the example given above (GNOME in /usr, Evolution and
- dependencies in /opt/evolution), your
- bonobo-activation-config.xml will have to look like this:
+ * Install the content somewhere _other_ than the evolution source tree.
+ e.g: NOT evolution/db-3.1.17
- <?xml version="1.0"?>
- <oafconfig>
- <searchpath>
- <item>/usr/lib/bonobo/servers</item>
- <item>/opt/evolution/lib/bonobo/servers</item>
- </searchpath>
- </oafconfig>
+ * Compile according to instructions, but installing into some custom
+ prefix, for example:
+
+ ../dist/configure --prefix=/home/user/berkeleydb-3.1.17
+
+ * Autogen Evolution specifying that it has to look for the DB
+ library there, for example:
+
+ ./autogen.sh --prefix=/opt/gnome
+ --with-db3-includes=/home/user/berkeleydb-3.1.17/include
+ --with-db3-libs=/home/user/berkeleydb-3.1.17/lib
- * Pass an appropriate --prefix parameter to the configure
- scripts of Evolution and its dependencies, eg:
- ./configure --prefix=/opt/evolution
+COMPILING PALM PILOT SUPPORT
+----------------------------
-More information on how to use the configure script is available in
-the INSTALL file which is part of the Evolution tarball.
+If you want support for PalmPilot syncing you will also need recent
+versions of:
+1) pilot-link
+http://www.pilot-link.org
-OPTIONAL FEATURES
------------------
+2) gnome-pilot
+http://www.eskil.org/gnome-pilot/
-Some optional features can be enabled at compilation time by passing
-appropriate flags to the configure script:
+3) evolution
+In your evolution source directory do ./autogen.sh --prefix=<evo-prefix>
+--with-pisock=<pilot-link-prefix> --enable-pilot-conduits=yes
+make
+make install
- * GNOME Pilot support.
- Assuming you have installed gnome-pilot, add the following
- options:
+SSL SUPPORT
+-----------
- --with-pisock=<prefix> --enable-pilot-conduits=yes
+If you want SSL support (and someday S/MIME), you will also need
+mozilla-nspr and mozilla-nss, which can be found at
+http://www.mozilla.org.
- Where <prefix> is the location where pilot-link (a package
- that gnome-pilot depends on) was installed.
+Once you have those libraries (and their respective includes)
+installed, in your evolution source directory do:
- * SSL support.
+./autogen.sh --prefix=<evo-prefix> --with-nspr-includes=<nspr-includes-prefix>
+--with-nspr-libs=<nspr-libs-prefix> --with-nss-includes=<nss-includes-prefix>
+--with-nss-libs=<nss-libs-prefix>
- Make sure you have Mozilla's NSS nad NSPR libraries
- installed and pass the following flag:
- --enable-nss
+NEWSGROUP (NNTP) SUPPORT
+------------------------
+Experimental support for NNTP is enabled if you use the --enable-nntp
+configure option, but it's currently unmaintained and highly unstable
+and experimental.
diff --git a/acconfig.h b/acconfig.h
new file mode 100644
index 0000000000..8789e117a3
--- /dev/null
+++ b/acconfig.h
@@ -0,0 +1,58 @@
+#undef ENABLE_NLS
+#undef HAVE_CATGETS
+#undef HAVE_GETTEXT
+#undef HAVE_LC_MESSAGES
+#undef HAVE_STPCPY
+#undef HAVE_LIBSM
+#undef PACKAGE
+#undef VERSION
+#undef ENABLE_THREADS
+#undef SENDMAIL_PATH
+#undef SYSTEM_MAIL_DIR
+#undef HAVE_LDAP
+#undef HAVE_TIMEZONE
+#undef HAVE_ALTZONE
+#undef HAVE_TM_GMTOFF
+#undef HAVE_KRB4
+#undef NEED_KRB_SENDAUTH_PROTO
+#undef HAVE_HEIMDAL_KRB5
+#undef HAVE_MIT_KRB5
+#undef HAVE_KRB5
+#undef HAVE_NSS
+#undef HAVE_OPENSSL
+#undef HAVE_SSL
+#undef USE_DOT
+#undef USE_FCNTL
+#undef USE_FLOCK
+#undef ENABLE_NNTP
+#undef ENABLE_IPv6
+#undef HAVE_BROKEN_SPOOL
+#undef ENABLE_PEDANTIC_PGPMIME
+#undef HAVE_KDE_APPLNK
+
+/* db3 version */
+#undef EVOLUTION_DB_VERSION_MAJOR
+#undef EVOLUTION_DB_VERSION_MINOR
+#undef EVOLUTION_DB_VERSION_PATCH
+
+/* Sub-version identification string. */
+#undef SUB_VERSION
+
+/* Preview-release string */
+#undef VERSION_COMMENT
+
+/* Define if ctime_r takes three arguments */
+#undef CTIME_R_THREE_ARGS
+
+/* Define if gethostbyname_r takes five arguments */
+#undef GETHOSTBYNAME_R_FIVE_ARGS
+
+/* Define if gethostbyaddr_r takes seven arguments */
+#undef GETHOSTBYADDR_R_SEVEN_ARGS
+
+/* Define to `int' if your system doesn't have `socklen_t'. */
+#undef socklen_t
+
+/* Define to the path to a program to kill processes given the name
+ (eg. "killall" or "killp"). */
+#undef KILL_PROCESS_CMD
diff --git a/addressbook/ChangeLog b/addressbook/ChangeLog
index 8099c016ac..79193a3f4b 100644
--- a/addressbook/ChangeLog
+++ b/addressbook/ChangeLog
@@ -1,1105 +1,52 @@
-2003-03-31 Chris Toshok <toshok@ximian.com>
+2003-02-11 JP Rosevear <jpr@ximian.com>
- * backend/ebook/e-book-util.c (get_local_book_uri): new function,
- just return the local uri.
- (set_default_book_uri_local): use get_local_book_uri.
- (e_book_default_book_open): only try and reload the default book
- if it's not already the local book.
-
-2003-03-31 JP Rosevear <jpr@ximian.com>
-
- * conduit/address-conduit.c (card_removed): it emits a list now
-
-2003-03-31 Dan Winship <danw@ximian.com>
-
- * gui/component/select-names/e-select-names.c
- (e_select_names_init): Remove folder-selector button
- initialization.
- (e_select_names_new): Initialize folder-selector button here,
- using the passed-in EvolutionShellClient rather than depending on
- a global variable.
-
- * gui/component/select-names/e-select-names-manager.c
- (e_select_names_manager_activate_dialog): take an
- EvolutionShellClient and pass it to e_select_names_new().
-
- * gui/component/select-names/e-select-names-bonobo.c
- (impl_SelectNames_activate_dialog): get a pointer to the shell
- from bonobo-activation, create a shell_client, and pass it to
- e_select_names_manager_activate_dialog.
-
- * backend/ebook/e-book-util.c (e_book_get_default_book_uri):
- constify return value
-
-2003-03-30 Chris Toshok <toshok@ximian.com>
-
- * backend/ebook/e-vcard.[ch]: braindead, and *extremely* forgiving
- vcard parser. not for public consumption yet.
-
-2003-03-30 Chris Toshok <toshok@ximian.com>
-
- [ fixes bug #39381 (again) ]
- * gui/component/e-address-popup.c (edit_contact_info_cb): add
- "GtkWidget *button" first arg, so we don't crash.
-
-2003-03-28 Chris Toshok <toshok@ximian.com>
-
- [ fixes bug #40403 ]
- * backend/ebook/e-card.c (e_card_get_vobject): revert the fix for
- 28945, as was done on the 1.2 branch. this is because the "fix"
- actually breaks internal use of contact lists. We need to make
- the exporting of contacts DTRT, instead of fixing it here.
-
-2003-03-28 Chris Toshok <toshok@ximian.com>
-
- [ fix the contact editor so that the only time the address is
- parsed is when the user types in the address GtkTextView. ]
- * gui/contact-editor/e-contact-editor.c (address_mailing_changed):
- make this use delivery addresses instead of labels.
- (full_addr_clicked): same.
- (find_address_mailing): same.
-
- * backend/ebook/e-card-simple.c
- (e_card_simple_set_delivery_address): make this operate similar to
- e_card_simple_set_address: it sets both the delivery address and
- the label for the address.
-
-2003-03-26 Chris Toshok <toshok@ximian.com>
-
- [ fixes bug #19178 ]
- * backend/ebook/evolution-ldif-importer.c (ebook_open): use
- e_book_load_address_book_by_uri on the passed in uri.
- (load_file_fn): pass the uri.
-
- * backend/ebook/evolution-vcard-importer.c (ebook_open): use
- e_book_load_address_book_by_uri on the passed in uri.
- (load_file_fn): pass the uri.
-
-2003-03-26 Chris Toshok <toshok@ximian.com>
-
- [ fixes bug #34651 ]
- * gui/component/select-names/e-select-names.c
- (select_entry_changed): strcmp -> g_utf8_collate.
- (update_query): encode the string we pass for the query.
-
-2003-03-26 Chris Toshok <toshok@ximian.com>
-
- [ fixes bug #34085 ]
- * gui/contact-list-editor/e-contact-list-editor.c
- (table_drag_data_received_cb): only successfully complete the drag
- if they dropped a valid vcard (or vcard list). Call
- gtk_drag_finish.
-
-2003-03-26 Chris Toshok <toshok@ximian.com>
-
- * gui/contact-list-editor/Makefile.am (INCLUDES): $evolution_uidir
- -> $evolutionuidir
-
-2003-03-26 Philip Zhao <philip.zhao@sun.com>
-
- [ fixes bug #39170 ]
- * backend/pas/pas-backend.c (pas_backend_create_card): remove
- 'return'.
- (pas_backend_remove_cards): same.
- (pas_backend_modify_card): same.
- (pas_backend_check_connection): same.
- (pas_backend_get_vcard): same.
- (pas_backend_get_cursor): same.
- (pas_backend_get_book_view): same.
- (pas_backend_get_completion_view): same.
- (pas_backend_get_changes): same.
- (pas_backend_authenticate_user): same.
- (pas_backend_get_supported_fields): same.
- (pas_backend_get_supported_auth_methods): same.
-
-2003-03-26 JP Rosevear <jpr@ximian.com>
-
- * conduit/address-conduit.c (local_record_from_ecard): append the
- second line to the address if necessary
- (ecard_from_remote_record): split the address line in two if
- necessary
-
-2003-03-23 Chris Toshok <toshok@ximian.com>
-
- * gui/contact-list-editor/contact-list-editor.glade: set the
- dialog to "Visible: No" so it doesn't flash when we bring it up.
-
-2003-03-23 Chris Toshok <toshok@ximian.com>
-
- [ fixes bug #40026 ]
- * gui/contact-editor/e-contact-editor.c (set_field): add
- EContactEditor arg, and block/unblock signals around the
- gtk_entry_set_text, since that generates a "changed" signal which
- causes problems.
- (set_phone_field): take and pass along an EContactEditor arg.
- (set_fields): pass editor to set_field.
-
-2003-03-23 Chris Toshok <toshok@ximian.com>
-
- * gui/contact-editor/arrow.png: nuke.
-
- * gui/contact-editor/Makefile.am (EXTRA_DIST): remove images_DATA
- (images_DATA): nuke, don't need it anymore.
-
- * gui/contact-editor/e-contact-editor.c
- (connect_arrow_button_signal): rename _replace_button to this. we
- no longer create an image, as it's a GtkArrow in the .glade file
- now.
- (connect_arrow_button_signals): rename _replace_buttons to this.
- no longer pass the arrow.png's to _replace_button.
- (e_contact_editor_init): _replace_buttons ->
- connect_arrow_button_signals.
- (_arrow_pressed): remove some dead code, and some args that aren't
- used.
- (_phone_arrow_pressed): track change to _arrow_pressed.
- (_email_arrow_pressed): same.
- (_address_arrow_pressed): same.
-
-2003-03-23 Chris Toshok <toshok@ximian.com>
-
- [ fixes bug #31786 ]
- * gui/component/addressbook-config.c
- (addressbook_source_dialog_set_source): fix some gtk warnings.
- (set_advanced_button_state): the advanced dialog isn't present in
- the glade file anymore, so ifdef everything dealing with it.
- (addressbook_edit_server_dialog): same.
-
- * gui/component/ldap-config.glade: remove all the unused Advanced
- UI stuff to lessen the amount of strings needing translation.
-
-2003-03-23 Chris Toshok <toshok@ximian.com>
-
- [ fixes bug #32113 ]
- * backend/ebook/e-destination.h: add include_email arg to
- e_destination_get_textrep.
-
- * backend/ebook/e-destination.c (e_destination_get_textrep): add
- include_email arg. if it's TRUE, and if there's an email address to
- add
-
- * gui/contact-list-editor/e-contact-list-model.c
- (contact_list_value_at): use e_destination_get_textrep so we don't
- display QP text, and pass TRUE for include_email.
-
- * gui/widgets/e-minicard.c (add_field): same.
- (remodel): same.
-
- * gui/widgets/e-addressbook-treeview-adapter.c (adapter_get_value): same.
-
- * gui/widgets/e-addressbook-table-adapter.c (addressbook_value_at): same.
-
- * gui/component/select-names/e-select-names-text-model.c
- (e_select_names_text_model_insert_length): pass FALSE for
- include_email.
-
- * gui/component/select-names/e-select-names-model.c
- (e_select_names_model_get_textification): pass FALSE for
- include_email.
- (e_select_names_model_get_string): same.
- (e_select_names_model_replace): same.
- (e_select_names_model_name_pos): same.
- (e_select_names_model_text_pos): same.
-
-2003-03-19 Ettore Perazzoli <ettore@ximian.com>
-
- * backend/ebook/GNOME_Evolution_Addressbook_VCard_Importer.server.in.in:
- Replace "evolution:menu-name" prop with "evolution:menu_name". [#39692]
- * backend/ebook/GNOME_Evolution_Addressbook_LDIF_Importer.server.in.in: Likewise.
-
-2003-03-18 Chris Toshok <toshok@ximian.com>
-
- * gui/component/select-names/e-select-names-table-model.c
- (e_select_names_table_model_col_count): up the column count by one
- for the underline.
- (e_select_names_table_model_value_at): add handling for underline.
-
-2003-03-18 Chris Toshok <toshok@ximian.com>
-
- * gui/component/e-address-popup.c (email_menu_add_option): fix use
- of deprecated gtk_menu_append.
- (card_picker_selection_changed): change this to be used with the
- "changed" signal on GtkTreeSelection.
- (free_str): yeah, gross. i know.
- (card_picker_init): this needed some fixing, so the strings don't
- go away after we insert them into the model. also, connect to the
- "changed" GtkTreeSelection signal instead of using the nonexistant
- gtk_tree_selection_set_func.
- (e_address_popup_construct): gtk_style_unref -> g_object_unref.
- (popup_size_allocate_cb): nuke.
- (e_address_popup_ambiguous_email_add): use gtk_window_set_position
- and let the window manager place the window instead of doing it
- ourself.
-
-2003-03-18 Chris Toshok <toshok@ximian.com>
-
- [ Fixes addressbook bug #39730 ]
- * gui/component/ldap-config.glade: add response ids to the search
- base dialog.
-
- * gui/component/addressbook-config.c
- (addressbook_source_dialog_destroy): use g_object_unref, not
- gtk_widget_destroy, on the GladeXML.
- (addressbook_add_server_druid): call gtk_window_set_type_hint
- GDK_WINDOW_TYPE_HINT_DIALOG so this window looks like a dialog.
- (editor_modify_cb): no more apply button.
- (edit_dialog_apply_clicked): nuked.
- (edit_dialog_close_clicked): rename to _cancal_clicked.
- (edit_dialog_ok_clicked): call gtk_widget_destroy here instead of
- calling _cancel_clicked.
- (addressbook_edit_server_dialog): no more apply button, and
- close_button -> cancel_button. Also, set the hint to
- GDK_WINDOW_TYPE_HINT_DIALOG.
- (ldap_dialog_new): fix compiler warning.
- (addressbook_dialog_create_sources_table): same.
-
-2003-03-18 Chris Toshok <toshok@ximian.com>
-
- * gui/component/select-names/e-select-names-section.etspec: use
- alternating-row-colors="false"
-
- * gui/component/select-names/e-select-names.h: nuke prototypes for
- e_select_names_get_source/section.
-
- * gui/component/select-names/e-select-names.c (set_book): remove
- the signal disconnect from here.
- (addressbook_model_set_uri): same.
- (e_select_names_init): connect to the search_result signal on the
- addressbook model.
- (e_select_names_child_free): disconnect the changed_id signal.
- (e_select_names_add_section): set the underline column so the
- recipient tables look like they did when they were EEntry.
- (e_select_names_add_section): store off the changed_id.
- (e_select_names_get_section): nuke.
- (e_select_names_get_source): nuke.
-
-2003-03-18 JP Rosevear <jpr@ximian.com>
-
- * conduit/address-conduit.c (addrconduit_load_configuration): kill
- warning by sinking objects
-
-2003-03-18 Not Zed <NotZed@Ximian.com>
-
- * gui/component/select-names/e-select-names.c (set_book,
- addressbook_model_set_uri): disconnect/keep track of search result
- signal id.
- (e_select_names_init): Keep track of various signals, particularly
- status signal.
- (e_select_names_dispose): disconnect from any signals that are
- still active. Fixes crash for #38202.
-
-2003-03-13 Chris Toshok <toshok@ximian.com>
-
- * gui/contact-editor/e-contact-editor.c
- (set_entry_changed_signals): use set_entry_changed_signal_email
- for the email entry so the email gets saved out.
- (set_entry_changed_signal_email): new function, analogous to
- set_entry_changed_signal_phone, but for email.
-
-2003-03-12 Chris Toshok <toshok@ximian.com>
-
- [ fixes bug #20210 ]
- * gui/component/select-names/e-select-names-popup.c
- (popup_menu_card): change "Edit Contact Info" to "View Contact
- Info", as you can't always edit the contact (if the book is read
- only).
- (popup_menu_list): same, but for a contact list.
-
-2003-03-11 Chris Toshok <toshok@ximian.com>
-
- [ fixes bug #39507 ]
- * gui/component/select-names/e-select-names.c (search_result): new
- function, sync the models after we do a search.
- (addressbook_model_set_uri): connect to search_result.
-
-2003-03-11 Chris Toshok <toshok@ximian.com>
-
- * gui/component/select-names/e-select-names.c
- (e_select_names_init): fix compiler warnings about deprecated
- functions.
- (e_select_names_child_free): unref the table model.
- (remove_address): re-enable.
- (section_right_click_cb): this is an ETable callback now.
- (e_select_names_add_section): remove a gross gross awful hack, and
- make the recipient tables ETables instead EEntry's. We lose the
- nice underlining, but we can add that back in as another ETable
- style (like strikeout and bold), and we also fix the longstanding
- scrolling problems (like bug #25148) and can finally remove
- addresses by double clicking on them (which is also a bug
- someplace I think.. dunno the # offhand.)
-
- * gui/component/select-names/e-select-names-table-model.c
- (clear_info): always set the count to -1, regardless of what
- model->data is.
-
- * gui/component/select-names/e-select-names-model.c: remove some
- unused enums.
-
- * gui/component/select-names/Makefile.am (etspec_DATA): add
- e-select-names-section.etspec
-
- * gui/component/select-names/e-select-names-section.etspec: new
- file, spec for the To:/Cc:/Bcc: etable's in the select-names
- dialog.
-
-2003-03-11 Not Zed <NotZed@Ximian.com>
-
- * backend/pas/pas-backend-file.c (INITIAL_VCARD): Updated phone
- number. Bug #37204.
-
- * gui/widgets/e-addressbook-util.c (e_addressbook_send_card_list):
- re-enable in build, include e-destination.h. For #39256.
-
-2003-03-06 Ettore Perazzoli <ettore@ximian.com>
-
- * backend/ebook/load-pine-addressbook.c (ebook_create): Likewise.
- * backend/ebook/load-gnomecard-addressbook.c (ebook_create): Likewise.
- * backend/ebook/evolution-vcard-importer.c (ebook_create): Likewise.
- * backend/ebook/evolution-ldif-importer.c (ebook_create): Likewise.
- * backend/ebook/test-client.c (get_cursor_cb): Likewise.
- (ebook_create): Likewise.
- * gui/widgets/e-minicard.c (e_minicard_set_property): Likewise.
- (card_modified_cb): Likewise.
- (e_minicard_event): Likewise.
- * gui/widgets/gal-view-minicard.c (column_width_changed): Likewise.
- * gui/widgets/test-minicard-view.c (ebook_create): Likewise.
- * gui/widgets/gal-view-treeview.c (column_width_changed): Likewise.
-
-2003-03-05 Not Zed <NotZed@Ximian.com>
-
- * gui/component/addressbook-component.c (bonobo_main_quit_cb):
- removed.
- (owner_unset_cb): Basically a noop, the shell does the quit, we
- just note we have no owner anymore.
-
-2003-03-04 JP Rosevear <jpr@ximian.com>
-
- Fixes #37881
-
- * gui/component/select-names/e-simple-card-bonobo.c
- (impl_SimpleCard_get): if we get a null value, send back the empty
- string
-
-2003-03-04 JP Rosevear <jpr@ximian.com>
-
- * gui/component/select-names/e-select-names.etspec: reflect prior column addition
-
- * gui/component/select-names/e-select-names-bonobo.c
- (entry_get_property_fn): set the arg properly
-
- * gui/component/select-names/Evolution-Addressbook-SelectNames.idl:
- add Icscalendar to field list
-
- * backend/pas/pas-backend-ldap.c: add icscalendar to prop list
-
- * backend/ebook/e-card.h: add icscalendar data member
-
- * backend/ebook/e-card.c: add icscalendar to list and its parse
- routine
- (e_card_get_vobject): add icscalendar prop value
- (parse_icscalendar): parse routine
- (e_card_class_init): add icscalendar arg
- (e_card_destroy): destroy icscalendar member
- (e_card_set_arg): set icscalendar
- (e_card_init): init icscalendar
- (e_card_get_arg): return icscalendar
-
- * backend/ebook/e-card-simple.c (field_data): add icscalendar
-
- * backend/ebook/e-card-simple.h: ditto
+ Fixes #37881
-2003-03-03 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/component/select-names/e-select-names.c
- (e_select_names_new): Don't set the "modal" property through
- g_object_new().
- (e_select_names_init): Explictly make the dialog modal here.
-
-2003-03-03 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/widgets/e-addressbook-view.c (create_minicard_view): No need
- to do any reparenting here; the widget is created with no parent.
-
-2003-03-03 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/component/select-names/e-select-names.c
- (e_select_names_init): Instead of using gtk_widget_unparent(),
- remove the widget from the container using gtk_container_remove().
- This fixes a bunch of crashers in all the places using the
- ESelectNames widget/control.
-
-2003-02-28 Dan Winship <danw@ximian.com>
-
- * gui/contact-editor/Makefile.am: Build libecontacteditor as an
- uninstalled shared library.
-
- * gui/contact-list-editor/Makefile.am: Likewise for
- libecontactlisteditor
-
- * gui/merging/Makefile.am: and libecardmerging
-
- * gui/search/Makefile.am: and libeaddressbooksearch
-
- * gui/widgets/Makefile.am: and libeminicard
-
- * printing/Makefile.am: and libecontactprint
-
- * gui/component/Makefile.am (libevolution_addressbook_la_LIBADD):
- Update for new library names (and get rid of libtool portability
- warnings).
-
-2003-02-28 Dan Winship <danw@ximian.com>
-
- * backend/ebook/e-card.c (e_card_list_send, e_card_send): Remove
- these from here; talking to the mailer doesn't really belong at
- the libebook level anyway.
-
- * backend/ebook/Makefile.am: Remove Evolution-Composer CORBA
- stuff, which fixes some linking problems on OS X.
-
- * gui/widgets/e-addressbook-util.c (e_addressbook_send_card_list,
- e_addressbook_send_card): Move from e-card.c and rename.
-
- * gui/widgets/Makefile.am: move Evolution-Composer CORBA stuff
- here
-
- * gui/widgets/e-addressbook-view.c (send_as, send_to,
- e_addressbook_view_send, e_addressbook_view_send_to): Update for
- new function names.
-
- * gui/contact-list-editor/e-contact-list-editor.c (file_send_as_cb,
- file_send_to_cb): Likewise
-
- * gui/contact-editor/e-contact-editor.c (file_send_as_cb,
- file_send_to_cb): Likewise
-
-2003-02-27 Chris Toshok <toshok@ximian.com>
-
- * gui/component/addressbook.c (book_open_cb): use g_signal_connect
- here, not swapped... although since we pass the widget as the
- closure it really doesn't matter.
- (load_uri_auth_cb): use a GtkDialog here.
- (search_result): same.
-
- * gui/component/select-names/e-simple-card-bonobo.h: add prototype
- for e_simple_card_bonobo_construct to fix warning.
-
- * gui/widgets/e-addressbook-view.c (create_alphabet): remove call
- to gtk_widget_set_usize.
-
- * gui/contact-editor/e-contact-editor-address.c
- (e_contact_editor_address_init): gtk_window_set_policy =>
- gtk_window_set_resizable.
-
- * gui/contact-editor/e-contact-editor-fullname.c
- (e_contact_editor_fullname_init): same.
-
-2003-02-27 JP Rosevear <jpr@ximian.com>
-
- * conduit/Makefile.am: link to libversit libtool object
-
-2003-02-27 Rodney Dawes <dobey@ximian.com>
-
- * backend/ebook/Makefile.am: Fix for server files from Antonio Xu
-
-2003-02-26 Chris Toshok <toshok@ximian.com>
-
- * backend/ebook/e-book.c (e_book_load_uri): if we fail to activate
- factories for a given protocol, return.
-
- * gui/component/ldap-config.glade: remove the two unused custom
- widgets to cut down on gtk warning spam.
-
-2003-02-21 Dan Winship <danw@ximian.com>
-
- * backend/ebook/Makefile.am (libebook_la_LIBADD): depend on
- libversit.la, libcamel.la, libename.la, and libeutil.la.
- (test_client_LDADD, test_client_list_LDADD, test_card_LDADD,
- evolution_vcard_importer_LDADD, evolution_ldif_importer_LDADD,
- load_pine_addressbook_LDADD, load_gnomecard_addressbook_LDADD):
- Remove those dependencies from here, since they're pulled in by
- libebook.
-
- * gui/component/Makefile.am (libevolution_addressbook_la_LIBADD):
- Remove libebook's dependencies
-
- * gui/component/select-names/Makefile.am
- (libeselectnames_la_LIBADD): add this
-
- * gui/widgets/Makefile.am (various disabled *_test_LDADD): cleanup
-
- * printing/Makefile.am (contact_print_test_LDADD,
- contact_print_style_editor_test_LDADD): cleanup
-
-2003-02-20 Dan Winship <danw@ximian.com>
-
- * gui/component/Makefile.am (libevolution_addressbook_la_LIBADD):
- s/libemiscwidgets.a/libemiscwidgets.la/
-
- * gui/widgets/Makefile.am: Likewise (in a bunch of commented-out
- test programs)
-
-2003-02-19 Dan Winship <danw@ximian.com>
-
- * gui/widgets/e-addressbook-model.c: Make parent_class static.
-
- * gui/widgets/e-addressbook-reflow-adapter.c: Likewise
-
- * gui/widgets/e-addressbook-table-adapter.c: Likewise
-
-2003-02-19 Chris Toshok <toshok@ximian.com>
-
- [ fix #38074 ]
- * gui/component/e-address-popup.c (add_contacts_cb): first arg is
- a GtkWidget. duh.
-
-2003-02-19 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/contact-editor/Makefile.am (INCLUDES): Use $(evolutionuidir)
- instead of $(evolution_uidir). [Pointed out by Grzegorz Goawski.]
-
-2003-02-17 Chris Toshok <toshok@ximian.com>
-
- * gui/component/select-names/e-select-names-completion.c
- (e_select_names_completion_start_query): if we can complete solely
- from our cached cards, call e_completion_end_search from here when
- we're done.
-
-2003-02-17 Chris Toshok <toshok@ximian.com>
-
- * gui/component/addressbook-component.c
- (ensure_completion_uris_exist): plug memory leak (always free
- val).
-
-2003-02-16 Chris Toshok <toshok@ximian.com>
-
- * backend/pas/pas-backend-file.c
- (pas_backend_file_search_timeout): move the bulk of the
- non-summary searching stuff here. we aggregate up to our
- threshold, then send them to the front end and register a timeout
- to do another batch. This keeps us from totally spamming the UI,
- making things a bit more responsive.
- (pas_backend_file_search): set up the closure and call the timeout
- in an idle func.
-
-2003-02-16 Chris Toshok <toshok@ximian.com>
-
- * gui/component/select-names/e-select-names-manager.c
- (e_select_names_manager_entry_new): indent properly.
-
-2003-02-16 Chris Toshok <toshok@ximian.com>
-
- * gui/widgets/e-addressbook-reflow-adapter.c (unlink_model):
- disconnect search_started and search_result.
- (addressbook_compare): if we're loading, just compare model
- positions (so we just append while loading).
- (remove_card): use e_reflow_model_item_removed.
- (search_started): new function, set loading = TRUE.
- (search_result): new function, set loading = FALSE and emit
- "comparison_changed".
- (e_addressbook_reflow_adapter_init): init loading and the new
- signal ids.
- (e_addressbook_reflow_adapter_construct): connect "search_started"
- and "search_result".
-
- * gui/widgets/e-addressbook-model.h (struct
- _EAddressbookModelClass): add search_started signal.
-
- * gui/widgets/e-addressbook-model.c
- (e_addressbook_model_class_init): new signal "search_started".
- (book_view_loaded): emit "search_started" after "model_changed".
- (remove_card): simplify this, and use CARD_REMOVED all the time,
- instead of just in the single card case.
-
-2003-02-10 Chris Toshok <toshok@ximian.com>
-
- * backend/pas/pas-backend-file.c
- (pas_backend_file_search_timeout): split out the bulk of the
- non-summary searching logic to here. we do 1 "card_threshold"
- sized lump per timeout.
- (pas_backend_file_search): use pas_backend_file_search_timeout.
-
-2003-02-10 Chris Toshok <toshok@ximian.com>
-
- [ fixes bug #33066 ]
- * gui/contact-editor/e-contact-editor.c
- (set_urlentry_changed_signal_field): new function
- (set_entry_changed_signals): call
- set_urlentry_changed_signal_field for entry-web, entry-caluri, and
- entry-fburl.
- (fill_in_field): add handling for EUrlEntry's.
- (extract_field): same.
- (enable_widget): same.
- (e_contact_editor_create_date): show the widget.
- (e_contact_editor_create_web): same, create a url entry.
- (set_urlentry_changed_signal_field): new function
-
- * gui/contact-editor/contact-editor.glade: entry-web,
- entry-caluri, and entry-fburl are all custom widgets now.
-
-2003-02-10 Ettore Perazzoli <ettore@ximian.com>
-
- * backend/ebook/Makefile.am: Install load-pine-addressbook and
- load-gnomecard-addressbook into ${privdatadir}/tools. Install
- evolution-vcard-importer and evolution-ldif-importer into
- ${privlibexecdir}.
-
- * backend/ebook/GNOME_Evolution_Addressbook_VCard_Importer.server.in:
- Removed.
-
- * backend/ebook/GNOME_Evolution_Addressbook_LDIF_Importer.server.in:
- Removed.
-
- * backend/ebook/GNOME_Evolution_Addressbook_VCard_Importer.server.in.in:
- New. Specify an absolute path for the executable, using
- @LIBEXECDIR@.
- * backend/ebook/GNOME_Evolution_Addressbook_LDIF_Importer.server.in.in:
- Likewise.
-
-2003-02-09 Chris Toshok <toshok@ximian.com>
-
- * gui/component/select-names/e-select-names-completion.c
- (sexp_initials): gone.
- (match_initials): gone.
- (book_query_sexp): remove the primary handling.
- (book_query_score): same.
-
- * backend/ebook/e-card.c (e_card_set_property):
- g_value_get_pointer => g_value_get_object for "category_list".
-
- * backend/ebook/e-book.c (struct _EBookPrivate): add a comment.
-
- * backend/pas/pas-backend-ldap.c (func_beginswith): performance at
- the cost of a tiny bit of correctness. If the ldap server doesn't
- support evolutionPerson don't query on fileAs, use sn (since
- that's effectively what gets used in the display when fileAs isn't
- supported.)
-
-2003-02-09 Chris Toshok <toshok@ximian.com>
-
- * gui/component/select-names/e-select-names-completion.c: lots of
- changes here. should be a big performance gain. god i hope this
- is finally right.
-
-2003-02-08 Chris Toshok <toshok@ximian.com>
-
- [ huge change, all for 1 little performance problem :) fixes #18207 ]
- * gui/widgets/e-addressbook-model.c (get_view): use
- e_book_check_static_capability here to make things a little
- prettier.
- (remove_card): complain about my life, and add code to use one
- "model_changed" signal if we get back a list of cards instead of
- multiple "card_removed" signals.
-
- * gui/widgets/e-addressbook-model.h: little clean up.
-
- * gui/widgets/e-addressbook-view.c (delete): write a bulk-remove
- case for this. if the backend supports it, send all the ids at
- once. otherwise loop over the ids.
- (e_addressbook_view_delete_selection): fake a CardAndBook
- structure and call delete, instead of duplicating the code in 2
- places.
-
- * gui/component/addressbook.c (delete_contact_cb): don't call
- e_contact_editor_confirm_delete here, it's handled by the
- EAddressbookView.
-
- * backend/pas/pas-card-cursor.c (pas_card_cursor_construct): fix a
- compiler warning about a stupid crash.
-
- * backend/pas/pas-book.h (PASOperation): RemoveCard ->
- RemoveCards.
- (PASRemoveCardsReques): char *id -> GList *ids.
- (PASRequest): PASRemoveCardRequest -> PASRemoveCardsRequest.
-
- * backend/pas/pas-book.c (pas_book_queue_remove_cards): build up a
- GList from the id sequence.
- (pas_book_respond_remove): notifyCardRemoved ->
- notifyCardsRemoved.
- (impl_GNOME_Evolution_Addressbook_Book_removeCards): rename.
- (pas_book_free_request): free the idlist for RemoveCards.
- (pas_book_class_init): removeCard -> removeCards.
-
- * backend/pas/pas-book-view.h: change prototype for
- pas_book_view_notify_remove, and add prototype for
- pas_book_view_notify_remove_1.
-
- * backend/pas/pas-book-view.c (pas_book_view_notify_remove_1):
- build up a list and call pas_book_view_notify_remove.
- (pas_book_view_notify_remove): build up the corba id sequence and
- call BookViewListener::notifyCardsRemoved.
-
- * backend/pas/pas-backend.h: remove_card -> remove_cards.
-
- * backend/pas/pas-backend.c (pas_backend_remove_cards): rename
- from _remove_card.
- (process_client_requests): RemoveCard -> RemoveCards and
- _remove_card -> _remove_cards.
-
- * backend/pas/pas-backend-ldap.c (check_schema_support):
- g_strcasecmp -> g_ascii_strcasecmp.
- (remove_card_handler): _remove => _remove_1.
- (modify_card_modify_handler): same.
- (pas_backend_ldap_process_remove_cards): rename from _remove_card.
- (pas_backend_ldap_class_init): _remove_card -> _remove_cards.
-
- * backend/pas/pas-backend-file.c (pas_backend_file_class_init):
- remove_card -> remove_cards.
- (pas_backend_file_get_static_capabilities): add "bulk-removes".
- (pas_backend_file_process_remove_cards): rewrite this function
- largely, so that it handles lists of ids. first we loop through
- and for every successful deletion we build a list of deleted
- ECards. Then for each view we build a list (a subset of the
- deleted ECard list) and pass back that list to the view.
- (pas_backend_file_process_modify_card): use _remove_1 instead of
- _remove.
- (ecard_matches_search): new function.
-
- * backend/pas/pas-backend-card-sexp.c
- (pas_backend_card_sexp_match_vcard): rewrite in terms of
- _match_ecard.
- (pas_backend_card_sexp_match_ecard): new function, the guts from
- _match_vcard.
-
- * backend/pas/pas-backend-card-sexp.h: add prototype for
- pas_backend_card_sexp_match_ecard.
-
- * backend/idl/addressbook.idl: the card removal stuff now takes
- CardIdList.
-
- * backend/ebook/e-book.c (e_book_get_static_capabilities): cache
- successful capability queries (since they're static).
- (e_book_check_static_capability): new, convenience function to
- check if a particular capability is supported.
- (e_book_remove_card_by_id): build a single element GList and call
- e_book_remove_cards.
- (e_book_remove_cards): build up a CORBA sequence from the GList
- and call Book::removeCards.
- (e_book_dispose): free the cached capabilities string.
-
- * backend/ebook/e-book.h: add new prototypes for
- e_book_check_static_capability and e_book_remove_cards.
-
- * backend/ebook/e-book-view.h (struct _EBookViewClass): rename
- "card_removed" signal to "cards_removed".
-
- * backend/ebook/e-book-view.c (e_book_view_do_removed_event): id
- -> ids, and free the id list.
- (e_book_view_check_listener_queue): CardRemovedEvent ->
- CardsRemovedEvent.
-
- * backend/ebook/e-book-view-listener.c
- (e_book_view_listener_queue_response): free the id list.
- (e_book_view_listener_queue_idlist_event): new function, used for
- cards_removed.
- (e_book_view_listener_queue_status_event): id -> ids.
- (e_book_view_listener_queue_sequence_event): same.
- (e_book_view_listener_queue_message_event): same.
- (impl_BookViewListener_notify_cards_removed): call
- queue_idlist_event.
- (e_book_view_listener_dispose): free the id list.
- (e_book_view_listener_class_init): track change to idl call.
-
- * backend/ebook/e-book-view-listener.h
- (EBookViewListenerOperation): CardRemovedEvent ->
- CardsRemovedEvent.
- (EBookViewListenerResponse): char *id -> GList *ids.
-
- * backend/ebook/e-book-listener.c
- (impl_BookListener_respond_remove_cards): rename from remove_card.
-
-2003-02-06 Chris Toshok <toshok@ximian.com>
-
- * gui/component/e-address-popup.c (email_table_save_card_cb):
- check the status, not the book, and unref the book here.
- (contact_editor_cb): same.
- (start_query): unref the book in the failure case.
- (add_card_idle_cb): addressbook_load_default_book returns void
- now.
- (edit_contact_info_cb): same.
- (e_address_popup_query): same.
-
- * gui/component/addressbook.c (control_activate_cb): track change
- to addressbook_load_uri return type.
- (set_prop): same.
- (addressbook_load_uri): return type is void now.
- (addressbook_load_default_book): same.
-
- * gui/component/addressbook.h:
- addressbook_load_uri/addressbook_load_default_book return void
- now.
-
- * conduit/address-conduit.c (start_addressbook_server):
- e_book_load_default_book returns void now.
-
- * backend/ebook/e-book-util.h: track changes to return types.
-
- * backend/ebook/e-book-util.c (e_book_load_address_book_by_uri):
- fallout from change to e_book_load_uri. return type for this
- function is void now too.
- (e_book_use_address_book_by_uri): same.
- (e_book_use_default_book): same.
- (e_book_load_default_book): same.
- (got_uri_book_cb): if unsuccessful and book is non-NULL, unref it
- here.
- (got_default_book_cb): same.
-
- * backend/ebook/e-book.c (e_book_load_uri): no longer return a
- gboolean. any error is communicated to the callback.
-
- * backend/ebook/e-book.h: e_book_load_uri no longer returns a
- gboolean (it's void.)
-
- * backend/ebook/evolution-ldif-importer.c (ebook_create): track
- change to the e_book_load_uri family of functions.
-
- * backend/ebook/test-client-list.c (ebook_create): same.
+ * gui/component/select-names/e-simple-card-bonobo.c
+ (impl_SimpleCard_get): if we get a null value, send back the empty
+ string
- * backend/ebook/test-client.c (ebook_create): same.
+2003-02-07 JP Rosevear <jpr@ximian.com>
- * backend/ebook/load-pine-addressbook.c (ebook_create): same.
+ * gui/component/select-names/e-select-names.etspec: reflect prior column addition
- * backend/ebook/evolution-vcard-importer.c (ebook_create): same.
+ * gui/component/select-names/e-select-names-bonobo.c
+ (entry_get_property_fn): set the arg properly
-2003-02-06 Ettore Perazzoli <ettore@ximian.com>
+ * gui/component/select-names/Evolution-Addressbook-SelectNames.idl:
+ add Icscalendar to field list
- * backend/ebook/Makefile.am (e-book-marshal.c, e-book-marshal.h):
- Use different tmp file names so these rules can be executed in
- parallel without interfering with each otehr.
+ * backend/pas/pas-backend-ldap.c: add icscalendar to prop list
- * backend/pas/Makefile.am: Make the ORBit compilation work
- properly with parallel makes (i.e. make sure it does not spawn
- multiple orbit-idl processes on the same IDL file at the same
- time).
- * gui/component/select-names/Makefile.am: Likewise.
- * backend/ebook/Makefile.am: Likewise.
+ * backend/ebook/e-card.h: add icscalendar data member
-2003-02-06 Dan Winship <danw@ximian.com>
+ * backend/ebook/e-card.c: add icscalendar to list and its parse
+ routine
+ (e_card_get_vobject): add icscalendar prop value
+ (parse_icscalendar): parse routine
+ (e_card_class_init): add icscalendar arg
+ (e_card_destroy): destroy icscalendar member
+ (e_card_set_arg): set icscalendar
+ (e_card_init): init icscalendar
+ (e_card_get_arg): return icscalendar
- * gui/component/addressbook-config.c (main):
- s/PACKAGE/GETTEXT_PACKAGE/ in gettext setup.
+ * backend/ebook/e-card-simple.c (field_data): add icscalendar
-2003-02-05 Dan Winship <danw@ximian.com>
+ * backend/ebook/e-card-simple.h: ditto
- * backend/ebook/Makefile.am (INCLUDES): Remove cruft.
- (libebookincludedir): Use privincludedir.
+2003-02-13 Jack Jia <jack.jia@sun.com>
- * backend/ebook/e-book-util.c: #include <string.h>
- * backend/ebook/e-card-compare.c: Likewise
- * backend/ebook/load-pine-addressbook.c: Likewise
- * backend/ebook/test-client.c: Likewise
+ [ fixes bug #34900 ]
+ * gui/contact-editor/e-contact-save-as.c: change the "delete_event"
+ signal to "destroy".
- * backend/ebook/evolution-vcard-importer.c: #include
- <e-book-util.h>
- (factory_fn): Fix this to actually return the importer.
+2003-02-03 Jack Jia <jack.jia@sun.com>
- * backend/ebook/evolution-ldif-importer.c (parseLine): #include
- <e-book-util.h> and <bonobo/bonobo-main.h>. Use g_ascii_strcmp.
+ [ the fix for #33672 ]
+ * gui/component/addressbook-component.c (remove_folder): delete the
+ file addressbook.db.summary, and replace "unlink" with a gnome-vfs
+ function "gnome_vfs_unlink_from_uri".
- * backend/ebook/e-card.c (e_card_email_match_single_string):
- (e_card_email_find_number): s/g_str/g_ascii_str/
- * backend/ebook/e-destination.c (e_destination_equal): Likewise.
- Also, add an "else return FALSE;"
-
-
- * backend/pas/Makefile.am (INCLUDES): Remove cruft
- (ldapschemadir): Use privdatadir
- (pasincludedir): Use privincludedir.
-
- * backend/pas/pas-book-factory.c (pas_book_factory_activate):
- Remove unused variable.
- * backend/pas/pas-book-view.c (pas_book_view_new): Likewise
-
-
- * printing/Makefile.am (ecpsdir): Define in terms of privdatadir.
- (gladedir): Defined in configure.in now.
-
- * printing/e-contact-print.c: #include <string.h>
-
- * printing/test-print.c: #include <bonobo/bonobo-main.h>
- * printing/test-contact-print-style-editor.c: Likewise
-
-
- * gui/contact-editor/Makefile.am (INCLUDES): Remove some cruft.
- rename ICONSDIR to IMAGESDIR.
- (images_DATA): Install arrow.png in imagesdir instead of
- privdatadir.
-
- * gui/contact-editor/e-contact-quick-add.c: #include <string.h>
-
- * gui/contact-editor/e-contact-editor.c: #include <string.h>
- (e_contact_editor_init): s/EVOLUTION_ICONSDIR/EVOLUTION_IMAGESDIR/
- (e_contact_editor_new): s/gtk_object_ref/g_object_ref/
- (_replace_button): Look in imagesdir, not privdatadir
- (_phone_arrow_pressed): Remove call to deprecated
- gtk_check_menu_item_set_show_toggle.
- (_email_arrow_pressed): Likewise
- (_address_arrow_pressed): Likewise
- (set_address_field): Remove unused variable
- (enable_widget):
- s/gtk_entry_set_editable/gtk_editable_set_editable/
-
- * gui/contact-editor/e-contact-editor-address.c
- (e_contact_editor_address_init):
- s/EVOLUTION_ICONSDIR/EVOLUTION_IMAGESDIR
- (e_contact_editor_address_set_property):
- s/gtk_entry_set_editable/gtk_editable_set_editable/
-
- * gui/contact-editor/e-contact-editor-fullname.c
- (e_contact_editor_fullname_init):
- s/EVOLUTION_ICONSDIR/EVOLUTION_IMAGESDIR
- (e_contact_editor_fullname_set_property): Likewise.
-
-
- * gui/contact-list-editor/Makefile.am (INCLUDES): Remove cruft,
- s/ICONSDIR/IMAGESDIR/
- (gladedir, etspecdir): Remove definitions.
-
- * gui/contact-list-editor/e-contact-list-editor.c: #include
- <string.h>
- (e_contact_list_editor_init): s/ICONSDIR/IMAGESDIR/
- (e_contact_list_editor_new): s/gtk_object_ref/g_object_ref/
-
- * gui/contact-list-editor/e-contact-list-model.c: #include <string.h>
-
-
- * gui/merging/Makefile.am (INCLUDES): Remove cruft.
- * gui/search/Makefile.am (ruledir): Define in terms of privdatadir
-
-
- * gui/widgets/Makefile.am (INCLUDES): Remove cruft.
- (gladedir, etspecdir): Remove definitions.
- (glade_DATA): Empty, so remove it.
-
- * gui/widgets/e-addressbook-reflow-adapter.c: #include <string.h>
- (addressbook_get_property): Remove unused variable
-
- * gui/widgets/e-addressbook-view.c: #include <string.h>
- (get_selection_model): Add a g_return_val_if_reached.
-
- * gui/widgets/e-minicard.c: #include string.h, gtkmain.h,
- gnome-canvas-pixbuf.h
- (field_changed): s/gtk_object_unref/g_object_unref/
- (get_left_width): Remove unused variable
-
- * gui/widgets/e-minicard-control.c: #include <string.h>
- (pstream_load, pstream_save): Use g_ascii_strcasecmp
-
- * gui/widgets/e-minicard-view.c: #include <string.h>
-
- * gui/widgets/e-minicard-view-widget.c
- (e_minicard_view_widget_new): s/gtk_type_new/g_object_new/
-
-
- * gui/component/select-names/Makefile.am (INCLUDES): Remove cruft.
- (serverdir, gladedir, etspecdir): Remove definitions
-
- * gui/component/select-names/e-select-names.c: #include <string.h>
-
- * gui/component/select-names/e-select-names-popup.c
- (init_html_mail): Remove deprecated
- gtk_check_menu_item_set_show_toggle call.
-
- * gui/component/select-names/e-select-names-manager.c
- (e_select_names_manager_entry_free):
- s/gtk_timeout_remove/g_source_remove/
-
-
- * gui/component/Makefile.am (INCLUDES): Remove cruft, rename
- ICONSDIR to IMAGESDIR.
- (serverdir, gladedir): Remove defintions.
-
- * gui/component/addressbook-component.c (IS_CONTACT_TYPE): use
- g_ascii_strcasecmp
- (add_creatable_item): s/ICONSDIR/IMAGESDIR/
-
- * gui/component/component-factory.c: #include <string.h>
-
- * gui/component/e-address-widget.c: Likewise.
- (e_address_widget_destroy): s/gtk_idle_remove/g_source_remove/
- (e_address_widget_schedule_query): s/gtk_idle_add/g_idle_add/
-
-
- * conduit/Makefile.am (INCLUDES): Remove cruft
-
-2003-02-05 Dan Winship <danw@ximian.com>
-
- * gui/component/addressbook-config.c (main): Replace deprecated
- glade_gnome_init() with glade_init().
-
- * gui/contact-editor/test-editor.c (main): Likewise.
-
- * printing/test-contact-print-style-editor.c (main): Likewise.
-
- * printing/test-print.c (main): Likewise.
-
-2003-02-03 Chris Toshok <toshok@ximian.com>
-
- [ pull forward Jack Jia's fix for #34900 ]
- * gui/contact-editor/e-contact-save-as.c (e_contact_save_as): use
- a weak ref for the file selector.
- (e_contact_list_save_as): same.
- (destroy_it): rewrite this as a weak ref notify function.
- (close_it): remove frees of the info (it's freed in the weak ref
- function).
- (save_it): same.
-
-2003-02-03 Chris Toshok <toshok@ximian.com>
-
- * gui/component/addressbook-component.c (remove_folder): pull
- forward Jack Jia's fix for #33672, but convert it to use unlink
- instead of the gnome-vfs stuff.
-
-2003-01-27 Chris Toshok <toshok@ximian.com>
-
- * gui/contact-editor/contact-editor.glade: add a scrolled window
- (SHADOW_IN) around the address textview.
-
-2003-01-26 Chris Toshok <toshok@ximian.com>
-
- * gui/contact-editor/contact-editor.glade: rename the category
- entry to entry-categories.
-
- * gui/contact-editor/e-contact-editor.c
- (set_entry_changed_signals): use the specialized "changed" signal
- handlers for entry-company and entry-fullname.
-
-2003-01-26 Chris Toshok <toshok@ximian.com>
-
- * gui/component/Makefile.am: i need to sleep more.
-
-2003-01-26 Chris Toshok <toshok@ximian.com>
-
- * gui/component/Makefile.am (componentdir): need to assign this
- here or else the lib doesn't get built.
-
-2003-01-26 Chris Toshok <toshok@ximian.com>
-
- * printing/e-contact-print.c (e_contact_start_new_page): begin the
- new page after showing the last one.
- (complete_sequence): beginpage before we start printing.
- (e_contact_print_response): GtkDialog-ify this.
- (e_contact_print_dialog_new): "clicked" -> "response".
- (e_contact_print_card_dialog_new): same.
- (e_contact_print_card_list_dialog_new): same.
-
-2003-01-26 Chris Toshok <toshok@ximian.com>
-
- * Makefile.am (CONDUIT_SUBDIR): enable this, as building the
- conduit works if you have gnome-pilot2.
-
-2003-01-25 Chris Toshok <toshok@ximian.com>
-
- * conduit/address-conduit.c: GObjectify the stuff in here that
- refers to addressbook objects. the gnome-pilot stuff is still
- GtkObject for the moment.
-
-2003-01-24 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/component/Makefile.am (iconsdir): Remove definition; this is
- now in configure.in.
- * gui/contact-editor/Makefile.am (iconsdir): Likewise.
- * gui/contact-list-editor/Makefile.am (iconsdir): Likewise.
-
2003-01-23 Sean Gao <Sean.Gao@Sun.COM>
[ fixes bug #34898 ]
@@ -1111,373 +58,26 @@
[ fixes bug #36375 ]
* backend/pas/pas-backend-ldap.c: use PHONE_OTHER_FAX instead of
PHONE_OTHER for "other_fax".
-
-2003-01-23 Chris Toshok <toshok@ximian.com>
- [ fixes bug #31014, roll this in from the 1.2 branch ]
- * backend/pas/pas-backend-ldap.c: use "categories" instead of
- "category" for the ECard field so the UI/get_supported_fields stuff
- actually thinks its usable in the contact editor..
-
-2003-01-23 Chris Toshok <toshok@ximian.com>
+2003-01-10 Chris Toshok <toshok@ximian.com>
* backend/pas/pas-backend-ldap.c (pas_backend_ldap_connect): fix
for bug 34883 broke ssl transactions (at least those where we were
connecting to port 636). Move it to after the SSL stanza.
-2003-01-23 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/component/select-names/Makefile.am (componentdir): Remove
- definition; no need to set it here since it's now defined in
- configure.in
- * gui/component/Makefile.am (componentdir): Likewise.
-
-2003-01-22 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/component/select-names/Makefile.am (gladedir): Version using
- $(BASE_VERSION).
- (etspecdir): Likewise.
- (iconsdir): Likewise.
-
- * gui/contact-list-editor/Makefile.am (iconsdir): Version using
- $(BASE_VERSION).
- (gladedir): Likewise.
-
- * gui/merging/Makefile.am (gladedir): Version using $(BASE_VERSION).
-
- * gui/search/Makefile.am (ruledir): Version using $(BASE_VERSION).
-
- * gui/component/Makefile.am (INCLUDES): Update EVOLUTION_IMAGESDIR
- to be versioned through $(BASE_VERSION).
-
- * gui/widgets/e-addressbook-view.c (init_collection): Use
- EVOLUTION_GALVIEWSDIR.
-
- * gui/widgets/Makefile.am (INCLUDES): Define EVOLUTION_GALVIEWSDIR
- and update EVOLUTION_IMAGESDIR.
-
-2003-01-21 Radek Doulik <rodo@ximian.com>
-
- * printing/e-contact-print.c (e_contact_print_button): don't use
- gnome_print_multipage_new_from_sizes and add warning
-
-2003-01-14 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/widgets/e-addressbook-util.c
- (e_addressbook_prompt_save_dialog): Change dialog from
- Yes/No/Cancel to Discard/Cancel/Save to match the HIG.
-
- * gui/search/e-addressbook-search-dialog.c
- (e_addressbook_search_dialog_init): Change dialog from OK/Cancel
- to Cancel/OK to match the HIG.
-
- * gui/contact-editor/e-contact-save-as.c (file_exists): Change
- dialog from Overwrite/Cancel to Cancel/Overwrite to match the HIG.
-
- * gui/contact-editor/e-contact-quick-add.c
- (build_quick_add_dialog): Fix typo s/reponse/response/. Also
- change the dialog to be Edit/Cancel/OK instead of OK/Edit/Cancel
- to match the HIG.
-
- * gui/contact-editor/e-contact-editor.c
- (e_contact_editor_confirm_delete): Make alert cancel/delete
- instead of delete/cancel to match the HIG.
-
- * gui/contact-editor/e-contact-editor-fullname.c
- (e_contact_editor_fullname_init): Make dialog Cancel/OK instead of
- OK/Cancel to match the HIG.
-
- * gui/contact-editor/e-contact-editor-address.c
- (e_contact_editor_address_init): Make dialog Cancel/OK instead of
- OK/Cancel to match the HIG.
-
- * gui/component/select-names/e-select-names.c
- (e_select_names_init): Make dialog Cancel/OK instead of OK/Cancel
- to match the HIG.
-
-2003-01-14 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/component/Makefile.am (EXTRA_DIST): Add $(schema_DATA).
-
-2003-01-09 Chris Toshok <toshok@ximian.com>
-
- * gui/component/addressbook.c (control_activate_cb): try to load
- the uri again if it failed previously.
- (book_open_cb): set failed_to_load based on the response.
- (set_prop): initialize failed_to_load to FALSE before we kick off
- the first load.
-
- * backend/pas/pas-book-factory.c
- (pas_book_factory_process_request): if the load_uri fails, remove
- it from the hashtable and free it, so we'll try to load it again
- from scratch the next time it's requested instead of serving up a
- backend that doesn't function.
-
- * backend/pas/pas-backend.c (pas_backend_get_uri): we need to be
- able to get the uri from backends that aren't loaded (so we can
- remove them from the hashtable.)
-
-2003-01-09 Chris Toshok <toshok@ximian.com>
-
- * backend/pas/pas-backend-ldap.c (query_ldap_root_dse): doh, fix
- build error.
-
-2003-01-09 Chris Toshok <toshok@ximian.com>
-
- * gui/component/select-names/e-select-names-popup.c: #include
- gtklabel.h, fixes an unresolved symbol.
-
-2003-01-09 Chris Toshok <toshok@ximian.com>
-
- * backend/pas/pas-backend-ldap.c (query_ldap_root_dse): build up
- the list of supported auth_methods.
- (pas_backend_ldap_process_get_supported_auth_methods): respond
- with the list of auth methods we've built up.
- (pas_backend_ldap_dispose): unref the auth_method list.
- (pas_backend_ldap_class_init): hook up
- pas_backend_ldap_process_get_supported_auth_methods.
-
- * backend/pas/pas-backend.c
- (pas_backend_get_supported_auth_methods): new function.
- (process_client_requests): add clause for GetSupportedAuthMethods.
-
- * backend/pas/pas-backend.h: add prototype for
- pas_backend_get_supported_auth_methods, and add it to the class
- vtable.
-
- * backend/pas/pas-book.h: add GetSupportedAuthMethods enum member
- and PASGetSupportedAuthMethodsRequest. and add prototype for
- pas_book_respond_get_supported_auth_methods.
-
- * backend/pas/pas-book.c
- (pas_book_queue_get_supported_auth_methods): new function.
- (impl_GNOME_Evolution_Addressbook_Book_getSupportedAuthMethods):
- new function.
- (pas_book_respond_get_supported_auth_methods): new function.
- (pas_book_free_request): add clause for GetSupportedAuthMethods.
- (pas_book_class_init): hook up getSupportedAuthMethods.
-
- * backend/ebook/e-book-listener.c
- (e_book_listener_queue_get_supported_fields_response): fields ->
- list.
- (e_book_listener_queue_get_supported_auth_methods_response): new
- function.
- (impl_BookListener_response_get_supported_auth_methods): new
- function.
- (e_book_listener_class_init): hook up
- epv->notifySupportedAuthMethods.
-
- * backend/ebook/e-book-listener.h: add
- GetSupportedAuthMethodsResponse enum member, and change the field
- name from "fields" to list (and use it for both GetSupportedFields
- and GetSupportedAuthMethods)
-
- * backend/ebook/e-book.c (e_book_get_supported_auth_methods): new
- function.
- (e_book_do_response_get_supported_auth_methods): new function.
-
- * backend/ebook/e-book.h: add prototype for
- e_book_get_supported_auth_methods.
-
- * backend/idl/addressbook.idl: add getSupportedAuthMethods IDL
- call.
-
-2003-01-09 Chris Toshok <toshok@ximian.com>
-
- * backend/pas/pas-book-factory.c (backend_last_client_gone_cb):
- deal with backends that might not have loaded successfully
- (they'll have a NULL uri).
-
-2003-01-09 Chris Toshok <toshok@ximian.com>
-
- * gui/component/select-names/e-select-names-bonobo.c
- (e_select_names_bonobo_new): call e_select_names_bonobo_construct
- on the newly created object.
-
-2003-01-09 Chris Toshok <toshok@ximian.com>
-
- * gui/component/Makefile.am: addressbook-config.etspec is gone.
-
- * gui/component/addressbook-config.c: make the sources table be a
- gtktreeview instead of an etable.
-
- * gui/component/ldap-config.glade: remove all references to
- gnome-hint.png
-
-2003-01-09 Chris Toshok <toshok@ximian.com>
-
- * gui/widgets/gal-view-minicard.c (column_width_changed): fix
- parameter types here (this signal isn't generated from an ETable.)
-
- * gui/widgets/gal-view-factory-minicard.c: include e-util.h
-
- * gui/widgets/e-minicard.h: include gnome-canvas.h here.
-
- * gui/widgets/e-addressbook-table-adapter.c: #include
- e-destination.h here.
-
- * gui/widgets/e-minicard.c: same.
-
-2003-01-09 Chris Toshok <toshok@ximian.com>
-
- * gui/contact-editor/e-contact-editor.[ch]: remove the select
- names stuff (the Related Contacts button/entry.)
-
- * gui/contact-editor/contact-editor.glade: same.
-
-2003-01-09 Chris Toshok <toshok@ximian.com>
-
- * gui/component/select-names/GNOME_Evolution_Addressbook_SelectNames.server.in.in:
- comment out the factory oaf_server, and change the location of the
- SelectNames controls to be
- OAFIID:GNOME_Evolution_Addressbook_Factory so the normal
- addressbook.so will create them.
-
- * gui/component/select-names/Makefile.am
- (libeselectnames_la_SOURCES): remove the
- e-select-names-factory.[ch] stuff for the time being.
-
- * gui/component/component-factory.c (factory): we're now (for the
- time being) the factory for the select names control.
-
-2003-01-08 Chris Toshok <toshok@ximian.com>
-
- * gui/widgets/e-addressbook-view.c: oops, don't include
- e-treeview-selection-model.h unless we're building the treeview.
-
-2003-01-08 Jeffrey Stedfast <fejj@ximian.com>
-
- * backend/pas/pas-backend-ldap.c
- (pas_backend_ldap_process_authenticate_user): Fix to build.
-
-2003-01-08 Chris Toshok <toshok@ximian.com>
-
- * gui/component/apps_evolution_addressbook.schemas: add in the
- schema entry for minimum_query_length.
-
-2003-01-08 Chris Toshok <toshok@ximian.com>
-
- * gui/widgets/e-addressbook-view.h: add
- E_ADDRESSBOOK_VIEW_TREEVIEW to the enum, ifdef'ed out.
-
- * gui/widgets/e-addressbook-view.c
- (e_addressbook_view_class_init): add ifdefed treeview code.
- (init_collection): same.
- (display_view): same.
- (get_selection_model): same.
- (treeview_row_activated): same.
- (create_treeview_view): same.
- (change_view_type): same.xo
- (e_addressbook_view_print): same.
- (e_addressbook_view_print_preview): same.
-
- * gui/widgets/Makefile.am: add in the treeview sources (commented
- out).
-
-2003-01-08 Chris Toshok <toshok@ximian.com>
-
- * gui/widgets/gal-view-minicard.c (gal_view_minicard_edit): add
- parent arg.
-
- * gui/widgets/e-addressbook-treeview-adapter.[ch]: new files, for
- a GtkTreeView view of contacts.
-
- * gui/widgets/gal-view-treeview.[ch]: same
-
- * gui/widgets/gal-view-favroty-treeview.[ch]: same
-
-2003-01-08 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/component/Makefile.am: $(datadir)/evolution/images instead
- of $(datadir)/images/evolution.
- * gui/contact-editor/Makefile.am: Likewise.
- * gui/contact-list-editor/Makefile.am (iconsdir): Likewise.
- * gui/widgets/Makefile.am: Likewise.
-
-2002-01-08 Dan Winship <danw@ximian.com>
-
- Move PASBook request handling into PASBackend itself since all
- existing backends do it exactly the same way. (Part of 32866).
-
- * backend/pas/pas-backend.h (PASBackendClass): add new methods for
- the various pas book requests.
-
- * backend/pas/pas-backend.c: Add a clients list to
- PASBackendPrivate.
- (pas_backend_create_card, etc): Add these to invoke the new
- methods.
- (process_client_requests, book_destroy_cb): Moved here and
- slightly rewritten from pas-backend-file.
- (last_client_gone): Now static.
- (add_client, remove_client): Default implementations, based on
- pas-backend-file, that add the client to/remove it from the
- backend's clients list and connect to its requests_queued signal.
- (pas_backend_init, pas_backend_dispose): Deal with the clients
- list.
-
- * backend/pas/pas-backend-file.c (struct _PASBackendFilePrivate):
- Remove GList *clients.
- (pas_backend_file_process_client_requests,
- pas_backend_file_book_destroy_db, pas_backend_file_add_client,
- pas_backend_file_remove_client): Gone.
- (pas_backend_file_class_init): Remove add_client/remove_client
- method initializations, add initializations for processing the
- various book requests.
-
- * backend/pas/pas-backend-ldap.c (struct _PASBackendLDAPPrivate):
- Remove GList *clients.
- (pas_backend_ldap_process_create_card, etc): Make these take the
- specific PAS*Request types rather than a generic PASRequest.
- (pas_backend_ldap_process_client_requests,
- pas_backend_ldap_book_destroy_db, pas_backend_ldap_add_client,
- pas_backend_ldap_remove_client): Gone.
- (pas_backend_ldap_class_init): Remove add_client/remove_client
- method initializations, add initializations for processing the
- various book requests.
-
-2003-01-07 Chris Toshok <toshok@ximian.com>
-
- * backend/pas/evolutionperson.schema: fix the SYNTAX for the
- telephone attributes, and make the fax attributes more closely
- mirror those from core.schema. Fixes the schema for openldap-2.1.
-
-2003-01-06 Dan Winship <danw@ximian.com>
-
- * backend/idl/Makefile.am: remove idldir def (defined by
- configure.in now)
-
- * gui/component/select-names/Makefile.am: Likewise
-
2003-01-01 Chris Toshok <toshok@ximian.com>
- [ fixes the non-ui portion of #36183 ]
- * gui/component/select-names/e-select-names-completion.c
- (e_select_names_completion_start_query): use the entry's
- minimum_query_length instead of a constant here.
- (e_select_names_completion_set_minimum_query_length): new
- function, set the entry's minimum_query_length.
-
- * gui/component/select-names/e-select-names-manager.c
- (e_select_names_manager_entry_new): set the minimum_query length
- after setting the completion books.
- (read_completion_settings_from_db): rename
- read_completion_books_from_db to this, and read the
- minimum_query_length too.
- (db_listener): rename uris_listener to this, and listen for
- changes on both the uris and minimum_query_length settings.
-
- * gui/component/select-names/e-select-names-completion.h: add
- prototype for e_select_names_completion_set_minimum_query_length.
-
- * gui/component/select-names/e-select-names-manager.h: add
- minimum_query_length to struct _ESelectNamesManager.
+ [ fixes bug #31014 ]
+ * backend/pas/pas-backend-ldap.c: use "categories" instead of
+ "category" for the ECard field so the UI/get_supported_fields stuff
+ actually thinks its usable in the contact editor..
-2002-12-19 Ettore Perazzoli <ettore@ximian.com>
+2003-01-01 Chris Toshok <toshok@ximian.com>
- * gui/component/addressbook-config.c
- (addressbook_config_control_new): Made it return an
- EvolutionConfigControl instead of a BonoboControl (and removed a
- bogus EvolutionConfigControl -> BonoboControl cast).
+ [ fixes bug #34883 ]
+ * backend/pas/pas-backend-ldap.c (pas_backend_ldap_connect):
+ perform an anonymous bind as the first thing after opening the
+ connection.
2002-12-17 Chris Toshok <toshok@ximian.com>
@@ -1486,152 +86,7 @@
(addressbook_value_at): don't free the return of
e_card_simple_get_const, as this causes a double free later on.
-2002-12-18 Chris Toshok <toshok@ximian.com>
-
- * gui/component/e-address-popup.c: convert the clist in here to a
- GtkTreeView. your guess is as good as mine if it works (i can't
- test it at present) but it compiles.
-
-2002-12-18 Chris Toshok <toshok@ximian.com>
-
- * gui/widgets/e-addressbook-view.c (jump_to_letters):
- g_string_sprintfa -> g_string_append_printf.
- (create_alphabet): same.
- (create_minicard_view): remove gtk_widget_{push,pop}_visual.
-
- * gui/widgets/Makefile.am (INCLUDES): add -D*_DISABLE_DEPRECATED.
-
-2002-12-18 Chris Toshok <toshok@ximian.com>
-
- * gui/widgets/e-minicard.c (e_minicard_realize): drop use of
- "font" arg.
- (get_left_width): use pango to calculate this instead of a GdkFont.
-
- * gui/widgets/e-minicard-view.c: drop include of e-unicode.h.
-
- * gui/widgets/e-minicard-label.c (e_minicard_label_construct):
- don't need to create the font anymore.
-
- * gui/search/Makefile.am (INCLUDES): add -D*_DISABLE_DEPRECATED.
-
- * gui/search/e-addressbook-search-dialog.c
- (e_addressbook_search_dialog_new): use g_object_new instead of
- gtk_type_new.
-
- * gui/merging/Makefile.am (INCLUDES): add -D*_DISABLE_DEPRECATED.
-
- * gui/contact-list-editor/Makefile.am (INCLUDES): add
- -D*_DISABLE_DEPRECATED.
-
- * gui/contact-list-editor/e-contact-list-editor.c (is_named):
- strdup (or not, if we don't need to save the value) instead of
- using the e_utf8 functions.
- (fill_in_info): same.
-
- * gui/contact-editor/Makefile.am (INCLUDES): add
- -D*_DISABLE_DEPRECATED.
-
- * gui/contact-editor/e-contact-save-as.c (e_contact_save_as):
- strdup (or not, if we don't need to save the value) instead of
- using the e_utf8 functions.
- (e_contact_list_save_as): same.
-
- * gui/contact-editor/e-contact-quick-add.c (clicked_cb): strdup
- (or not, if we don't need to save the value) instead of using the
- e_utf8 functions.
- (build_quick_add_dialog): same.
-
- * gui/contact-editor/e-contact-editor.c (phone_entry_changed):
- strdup (or not, if we don't need to save the value) instead of
- using the e_utf8 functions.
- (file_as_set_style): same.
- (name_entry_changed): same.
- (full_name_clicked): same.
- (categories_clicked): same.
- (set_field): same.
- (fill_in_field): same.
- (fill_in_single_field): same.
- (extract_field): same.
- (extract_single_field): same.
-
- * gui/contact-editor/e-contact-editor-fullname.c (extract_field):
- just strdup, it's already utf8.
-
- * gui/contact-editor/e-contact-editor-address.c (extract_field):
- they're all entries, use GTK_ENTRY foo here.
-
- * gui/component/select-names/Makefile.am (INCLUDES): add
- -D*_DISABLE_DEPRECATED.
-
- * gui/component/select-names/e-select-names.c
- (e_select_names_add_section): remove the extra
- utf8_from_locale_string stuff.
-
- * gui/component/select-names/e-select-names-popup.c
- (set_uiinfo_label): gtk_container_children ->
- gtk_container_get_children, and remove the extra utf8 stuff.
-
- * gui/component/Makefile.am (INCLUDES): add
- -D*_DISABLE_DEPRECATED.
-
- * gui/component/addressbook-storage.c
- (addressbook_storage_init_source_uri): g_string_sprintfa ->
- g_string_append_printf.
-
- * gui/component/addressbook-config.c (focus_help):
- gtk_notebook_set_page -> gtk_notebook_set_current_page.
- (addressbook_source_dialog_set_source): same.
- (auth_optionmenu_activated): gtk_container_children ->
- gtk_container_get_children.
- (ssl_optionmenu_activated): same.
- (ssl_optionmenu_selected): same, and gtk_notebook_set_page ->
- gtk_notebook_set_current_page.
- (scope_optionmenu_activated): same.
- (set_advanced_button_state): same.
- (addressbook_ldap_init): hook "response" to gtk_widget_destroy to
- make the dialog go away when clicked.
- (addressbook_ldap_auth): same.
- (addressbook_root_dse_query): same.
- (do_ldap_root_dse_query): same.
- (addressbook_config_control_new): fix return type and cast.
- (main): remove call to gtk_widget_push_visual.
-
- * gui/component/addressbook-config.h:
- addressbook_config_control_new returns a BonoboObject, not a
- BonoboControl.
-
- * gui/component/addressbook.c: remove e-unicode.h include.
-
- * backend/pas/Makefile.am (INCLUDES): Add
- -DLIBGNOME_DISABLE_DEPRECATED.
-
- * backend/ebook/Makefile.am (INCLUDES): Add
- -DLIBGNOME_DISABLE_DEPRECATED.
-
- * backend/ebook/e-card.c (e_card_get_property): remove misleading
- comment.
-
-2002-12-17 Chris Toshok <toshok@ximian.com>
-
- * backend/pas/pas-backend-ldap.c (build_card_from_entry):
- g_strcasecmp -> g_ascii_strcasecmp.
- (FIND_INSERT): same.
-
- * backend/pas/pas-backend-file.c (pas_backend_file_load_uri):
- g_dirname -> g_path_get_dirname.
-
- * backend/pas/Makefile.am (INCLUDES): add
- -DG_DISABLE_DEPRECATED.
-
- * backend/ebook/Makefile.am (INCLUDES): add
- -DG_DISABLE_DEPRECATED.
-
-2002-12-17 Chris Toshok <toshok@ximian.com>
-
- * gui/component/select-names/e-select-names-manager.c
- (uris_listener): oops, use strcmp, not !strcmp here.
-
-2002-12-17 Chris Toshok <toshok@ximian.com>
+2002-12-05 Chris Toshok <toshok@ximian.com>
[ Fixes bug #35135 ]
* backend/ebook/e-book-util.c (set_default_book_uri_local): don't
@@ -1643,116 +98,6 @@
(set_default_book_uri_from_bonobo_conf): install the bonobo conf
listener so we'll get updates.
-2002-12-16 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/component/addressbook-config.c
- (addressbook_config_control_new): Use
- evolution_shell_client_corba_objref() instead of BONOBO_OBJREF()
- to get the Shell CORBA object.
-
-2002-12-16 Jeffrey Stedfast <fejj@ximian.com>
-
- * gui/component/addressbook-config.c: Don't #include
- <e-util/e-html-utils.h>
-
-2002-12-09 Chris Toshok <toshok@ximian.com>
-
- * gui/search/e-addressbook-search-dialog.[ch]: GObject-ize this.
-
-2002-12-09 Chris Toshok <toshok@ximian.com>
-
- * gui/component/addressbook.c (load_uri_auth_cb): pass
- "Addressbook" to e_passwords*.
- (addressbook_authenticate): same.
-
-2002-12-09 Chris Toshok <toshok@ximian.com>
-
- * gui/component/addressbook.c (search_cb): remove
- PENDING_PORT_WORK.
- (addressbook_search_activated): same.
- (addressbook_query_changed): same.
-
- * gui/component/Makefile.am (libevolution_addressbook_la_LIBADD):
- add libfilter.la back in.
-
-2002-12-09 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/widgets/e-minicard-control.c: #define MINICARD_CONTROL_ID.
-
-2002-12-08 Chris Toshok <toshok@ximian.com>
-
- * gui/widgets/e-addressbook-util.c (e_addressbook_error_dialog):
- connect ::response to gtk_widget_destroy so the dialog goes away.
-
- * gui/widgets/e-minicard-label.c (e_minicard_label_construct):
- don't use font_gdk anymore on EText. it doesn't exist.
-
-2002-12-08 Chris Toshok <toshok@ximian.com>
-
- * gui/widgets/e-addressbook-reflow-adapter.c (text_height): this
- uses pango now.
- (addressbook_height): same.
-
-2002-12-06 Chris Toshok <toshok@ximian.com>
-
- * backend/ebook/e-book.c (e_book_commit_card): use e_card_set_book
- instead of basically duplicating its code here.
- (e_book_add_card): same.
-
-2002-12-06 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/component/e-cardlist-model.c: #include <string.h>.
-
- * gui/component/addressbook-storage.c: #include <string.h>,
- <ctype.h>, <unistd.h>.
-
- * gui/component/addressbook-factory.c: Removed.
-
- * gui/component/addressbook-component.c: #include
- <bonobo/bonobo-main.h>, <unistd.h> and <string.h>.
- (create_view): addressbook_new_control() instead of
- addressbook_factory_new_control().
-
- * gui/component/select-names/e-select-names.c
- (e_addressbook_create_ebook_table): Removed unused variable.
- (e_select_names_add_section): Removed unused variable.
-
- * gui/component/select-names/e-select-names-manager.c
- (focus_in_cb): Use g_source_remove() here instead of
- gtk_timeout_remove().
-
- * gui/component/component-factory.c: New.
-
- * gui/widgets/e-minicard-control.c
- (e_minicard_control_factory_init): Removed.
- (e_minicard_control_control_factory): Removed.
- (e_minicard_control_new): New.
-
- * gui/component/e-address-widget.c
- (e_address_widget_factory_init): Removed.
- (e_address_widget_new_control): Renamed from
- e_address_widget_factory_new_control(), made public.
- (e_address_widget_factory): Removed.
-
- * gui/component/e-address-popup.c (e_address_popup_new_control):
- New.
- (e_address_popup_factory_new_control): Removed.
- (e_address_popup_factory): Removed.
- (e_address_popup_factory_init): Removed.
-
- * gui/component/addressbook-config.c
- (addressbook_config_register_factory): Removed.
- (addressbook_config_create_control): New.
-
- * gui/component/addressbook-component.c
- (addressbook_component_factory_init): Removed.
- (addressbook_component_get_object): New.
- (owner_set_cb): Do not call addressbok_config_register_factory().
-
- * gui/component/addressbook.c (addressbook_factory_init): Removed.
- (addressbook_new_control): Renamed from
- addressbook_factory_new_control().
-
2002-12-05 Jeffrey Stedfast <fejj@ximian.com>
* gui/component/select-names/e-select-names.etspec: Use collate
@@ -1766,70 +111,35 @@
naming errors returned from query_ldap_root_dse, as some servers
(older openldap servers among others i'm sure) don't have a root
dse at all.
-
-2002-12-02 Not Zed <NotZed@Ximian.com>
-
- * gui/widgets/e-addressbook-view.c (e_contact_print_button):
- gnomedialog -> gtkdialog stuff. print dialog is a gtkdialog now.
- * gui/contact-editor/e-contact-editor.c: include gtkstock.h
+2002-12-02 Chris Toshok <toshok@ximian.com>
+ * backend/ebook/e-card.c (e_card_get_vobject): back out fix for
+ #28945 because it breaks some internal assumptions about the
+ structure of contact lists.
-2002-11-27 Not Zed <NotZed@Ximian.com>
+2002-11-30 Chris Toshok <toshok@ximian.com>
- * gui/contact-editor/e-contact-editor-address.c: #include gtkstock.h
+ [ the rest of the fix for #31763 ]
+ * gui/component/select-names/e-select-names.h (struct
+ _ESelectNames): add status_image.
-2002-11-29 Chris Toshok <toshok@ximian.com>
+ * gui/component/select-names/select-names.glade: add an icon to
+ the status bar.
- * gui/widgets/e-minicard-view-widget.c (column_width_changed): the
- detail is supposed to go after the signal id, not at the end of
- the parameter list.
+ * gui/component/select-names/e-select-names.c
+ (e_select_names_init): init (and initially hide) status_image.
+ (status_message): show the image if there's a status message, hide
+ it if there's not.
2002-11-28 Chris Toshok <toshok@ximian.com>
- [ roll forward from 1.2 branch, partial fix for #31763 ]
+
+ [ partial fix for #31763 ]
* gui/component/select-names/select-names.glade: add the Find
button back in.
-
-2002-11-28 Chris Toshok <toshok@ximian.com>
-
- * gui/widgets/e-addressbook-view.c (create_minicard_view): remove
- the button_press_event handler (that did nothing). this makes it
- so button presses actually get to the canvas (and therefore we can
- now drag the lines in the reflow widget).
-
-2002-11-26 Chris Toshok <toshok@ximian.com>
-
- * gui/contact-editor/e-contact-quick-add.c: add include for
- gtkstock.h.
-
- * gui/contact-list-editor/e-contact-list-model.c
- (e_contact_list_model_add_destination): add pre_change call.
- (e_contact_list_model_remove_row): same.
- (e_contact_list_model_remove_all): same.
-
- * gui/contact-list-editor/e-contact-list-editor.c
- (e_contact_list_editor_new): ref/sink the contact list editor so
- we don't get the floating unref warning from gtk.
-
- * gui/contact-editor/e-contact-editor.c (e_contact_editor_new):
- ref/sink the contact editor so we don't get the floating unref
- warning from gtk.
- (e_contact_editor_init): use g_build_filename instead of
- g_concat_dir_and_file.
-
- * gui/widgets/e-minicard-label.c
- (e_minicard_label_resize_children): use MAX (value, 0) to make
- sure we aren't passing negative values for clip-widths.
-
- * gui/widgets/e-minicard.c (e_minicard_realize): use MAX (value,
- 0) to make sure we aren't passing negative values for widths.
-
- * gui/contact-editor/e-contact-editor.c (e_contact_editor_init):
- use g_build_filename.
-
+
2002-11-26 Chris Toshok <toshok@ximian.com>
- [ roll forward from 1.2 branch ]
* backend/pas/pas-backend-file.c
(pas_backend_file_process_get_vcard): never pass NULL as the vcard
to the corba call, it causes a crash. This particular bug bit us
@@ -1838,67 +148,15 @@
2002-11-26 Chris Toshok <toshok@ximian.com>
- [ roll forward from 1.2 branch, Fixes addressbook bug #28945 ]
+ [ Fixes addressbook bug #28945 ]
* backend/ebook/e-card.c (e_card_get_vobject): if the email
property is xml, get the real address from the e-destination.
Fixes saving contact lists.
-2002-11-26 Chris Toshok <toshok@ximian.com>
-
- * gui/widgets/e-minicard.c (e_minicard_reflow): remove redundant
- setting of y2.
-
- * gui/contact-list-editor/e-contact-list-editor.c
- (e_contact_list_editor_init): show the table.
-
- * gui/component/select-names/e-select-names-completion.c: remove
- an unnecessary #include.
-
- * gui/component/addressbook-storage.c (addressbook_storage_setup):
- use g_build_filename.
-
- * gui/component/addressbook-component.c (remove_folder): use
- g_build_filename.
- (add_creatable_item): same.
- (ensure_completion_uris_exist): same, and use the right gconf
- paths for completion uris.
-
-2002-11-26 Chris Toshok <toshok@ximian.com>
-
- * gui/component/select-names/e-select-names-manager.c
- (read_completion_books_from_db): use new schema for
- completion/uris.
- (uris_listener): same.
-
- * gui/component/select-names/e-select-names.h: Convert to
- GtkDialog from GnomeDialog.
-
- * gui/component/select-names/e-select-names.c: Convert to
- GtkDialog from GnomeDialog.
- (folder_selected): use new schema for last_used_uri.
- (e_select_names_init): same.
- (e_select_names_set_default): use pango markup to set
- bold/not-bold.
- (e_select_names_add_section): don't bother creating an EEntry, we
- can use pango and a normal label. This also keeps us from
- wrapping "contacts ->" at the '-'.
-
- * gui/component/apps_evolution_addressbook.schemas: new file.
-
- * gui/component/Makefile.am: add the schema stuff.
-
-2002-11-24 Chris Toshok <toshok@ximian.com>
-
- * gui/component/addressbook-config.c (query_for_supported_bases):
- show the etable.
- (addressbook_add_server_druid): show_all before returning the
- dialog, so the druid shows up.
-
2002-11-23 Chris Toshok <toshok@ximian.com>
- [ roll forward from the 1.2 branch. fixes #25540, part of #29630,
- as well as other selection issues in the contact editor and ACL
- issues in the ldap backend ]
+ [ fixes #25540, part of #29630, as well as other selection issues
+ in the contact editor and ACL issues in the ldap backend ]
* backend/pas/pas-backend-ldap.c (check_schema_support): reset the
schema check state to FALSE if the read returned nothing (and the
user had not authenticated). we'll requery if/when they auth.
@@ -1943,1006 +201,38 @@
(e_contact_editor_address_set_arg): same, and make the labels
sensitive/insensitive depending on the editable state of the
dialog.
-
+
+2002-11-22 Chris Toshok <toshok@ximian.com>
+
+ * gui/widgets/e-addressbook-reflow-adapter.c (unlink_model): we
+ need to disconnect the model_changed signal too. This at the very
+ least is bad and at the worst could cause crashes.
+
2002-11-22 Chris Toshok <toshok@ximian.com>
- [ roll forward Sean.Gao@sun.com's fix for #16870 from the 1.2
- branch ]
+ [ fixes #16870, constibuted by Sean.Gao@sun.com ]
* backend/ebook/evolution-ldif-importer.c (getNextLDIFEntry):
- check for both LR and CRLF as empty line markers.
+ check for both LF and CRLF as empty line markers.
2002-11-22 Chris Toshok <toshok@ximian.com>
- [ rolling forward fix for #34254 from 1.2 branch ]
+ [ fixes #34254, contributed by Sean.Gao@sun.com ]
* backend/ebook/evolution-vcard-importer.c (check_file_is_vcard):
- use g-ascii_strncasecmp instead of strncmp.
- (support_format_fn): use g_ascii_strcasecmp instead of strcmp.
+ use g_strncasecmp instead of strncmp here.
+ (support_format_fn): use g_strcasecmp instead of strcmp here.
-2002-11-20 Chris Toshok <toshok@ximian.com>
+2002-11-21 Chris Toshok <toshok@ximian.com>
- * gui/component/addressbook-storage.h: roll forward the scope fix.
+ * gui/component/addressbook-storage.h: reorder the enum to match
+ the order used in the option menu in the .glade file. Fixes lots
+ of reports of scopes being saved as "base" instead of "one".
2002-11-20 Chris Toshok <toshok@ximian.com>
- * gui/contact-editor/e-contact-editor.c: roll forward the fix for
- the contact editor.
-
-2002-11-21 Not Zed <NotZed@Ximian.com>
-
- * gui/component/select-names/e-select-names-bonobo.c
- (entry_changed): Pass type to bonobo_ctonrol_set_property, and
- also NULL terminate the valist.
-
- * gui/component/select-names/e-select-names-text-model.c
- (changed_cb): Fix signature for signal.
-
-2002-11-19 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/component/select-names/GNOME_Evolution_Addressbook_SelectNames.server.in.in,
- * gui/component/select-names/Makefile.am: Same changes as below
- for the SelectNames component.
-
-2002-11-18 Chris Toshok <toshok@ximian.com>
-
- * gui/component/select-names/e-select-names.c
- (e_select_names_init): show the custom table.
-
-2002-11-18 Chris Toshok <toshok@ximian.com>
-
- * gui/widgets/gal-view-minicard.c (gal_view_minicard_attach):
- remove the cast to (int) - column_width is a double.
-
- * gui/widgets/e-minicard.c (e_minicard_class_init): the height
- property is only readable, not readwrite.
-
- * gui/widgets/e-minicard-view-widget.c
- (e_minicard_view_widget_class_init): make column_width a double
- property.
- (e_minicard_view_widget_set_property): don't cast to (int).
- column_width is double in the e-minicard-view.
- (e_minicard_view_widget_realize): same.
- (e_minicard_view_widget_get_property): use g_value_set_double for
- column_width.
-
-2002-11-17 Chris Toshok <toshok@ximian.com>
-
- * gui/component/select-names/Makefile.am (servers_DATA): oops,
- missed some "oaf"'s.
-
-2002-11-16 Chris Toshok <toshok@ximian.com>
-
- * gui/contact-editor/e-contact-editor.c
- (e_contact_editor_build_phone_ui): sink the popup.
- (e_contact_editor_build_email_ui): same.
- (e_contact_editor_build_address_ui): same.
-
- * gui/component/addressbook-config.c (ldap_dialog_new): show
- everything from dialog->page down, so custom widgets show up.
-
-2002-11-15 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/component/Makefile.am: Added rule to generate
- GNOME_Evolution_Addressbook.server.in from
- GNOME_Evolution_Addressbook.server.in.in, substituting
- @LIBEXECDIR@.
-
- * GNOME_Evolution_Addressbook.server.in.in: Renamed from
- GNOME_Evolution_Addressbook.server.in. Added @LIBEXECDIR@ before
- the location of the executable.
-
- * gui/component/select-names/select-names.glade: Ported to Glade
- 2.
-
- * gui/component/select-names/recipient.glade: Ported to Glade 2.
-
-2002-11-15 Rodney Dawes <dobey@ximian.com>
-
- * gui/component/addressbook-component.c: Use bonobo_main_quit.
-
-2002-11-14 Chris Toshok <toshok@ximian.com>
-
- * gui/widgets/gal-view-factory-minicard.c: clean this up a tad.
-
- * gui/widgets/e-addressbook-view.c (init_collection): re-enable
- this.
- (setup_menus): same.
-
- * gui/widgets/gal-view-minicard.[ch]: more GObject work.
-
-2002-11-12 Chris Toshok <toshok@ximian.com>
-
- * gui/contact-editor/e-contact-editor.c (_popup_position): push_in
- = FALSE, no clue why... :)
- (_arrow_pressed): call g_signal_stop_emission here, seems to fix
- things.
-
- * gui/component/select-names/e-select-names.c
- (e_select_names_init): fix warnings.
-
- * gui/component/select-names/e-select-names-manager.c
- (e_select_names_manager_activate_dialog): fix warning.
-
- * gui/component/addressbook.c (forget_passwords_cb): remove the
- PENDING_PORT ifdef.
- (load_uri_auth_cb): same.
- (addressbook_authenticate): same.
-
- * gui/component/addressbook-factory.c (main): same.
-
- * gui/component/addressbook-storage.c (load_source_data): be
- silent about text nodes if they contain nothing but whitespace.
-
-2002-11-11 Chris Toshok <toshok@ximian.com>
-
- * backend/pas/pas-card-cursor.c (pas_card_cursor_dispose): guard
- against multiple invocations.
-
- * backend/pas/pas-backend-ldap.c (view_destroy): change signature
- to that of a weak ref notify function.
- (cursor_destroy): same.
- (pas_backend_ldap_book_destroy_cb): same.
- (get_cursor_handler): ::destroy -> weak_ref.
- (pas_backend_ldap_process_get_book_view): same.
- (pas_backend_ldap_add_client): same.
-
- * backend/pas/pas-backend-file.c (cursor_destroy): change
- signature to that of a weak ref notify function.
- (view_destroy): same.
- (pas_backend_file_book_destroy_cb): same.
- (pas_backend_file_process_get_cursor): ::destroy -> weak_ref.
- (pas_backend_file_process_get_book_view): same.
- (pas_backend_file_process_get_completion_view): same.
- (pas_backend_file_process_get_changes): same.
- (pas_backend_file_add_client): same.
-
- * backend/ebook/test-client.c (get_cursor_cb): unref the book and
- exit here.
- (get_card_cb): pass a query string to get_cursor.
-
- * backend/ebook/e-book-view.c (e_book_view_class_init): correct
- marshaller for "card_added".
-
-2002-11-11 Chris Toshok <toshok@ximian.com>
-
- * gui/widgets/test-reflow.c (destroy_callback): change signature
- to that of a weak ref notify function.
- (main): ::destroy -> weak_ref.
-
- * gui/widgets/test-minicard.c (destroy_callback): change signature
- to that of a weak ref notify function.
- (main): ::destroy -> weak_ref.
-
- * gui/widgets/test-minicard-view.c (destroy_callback): change
- signature to that of a weak ref notify function.
- (main): ::destroy -> weak_ref.
-
- * gui/widgets/test-minicard-label.c (destroy_callback): change
- signature to that of a weak ref notify function.
- (main): ::destroy -> weak_ref.
-
- * gui/widgets/e-minicard-widget.c (e_minicard_widget_init): ifdef
- out the call to gnome_canvas_set_scroll_region. It doesn't seem
- necessary judging from the rest of the code, and it also crashes
- the addressbook if it's in.
-
- * gui/widgets/e-minicard-widget-test.c (destroy_callback): change
- signature to that of a weak ref notify function.
- (main): ::destroy -> weak_ref.
-
- * gui/widgets/e-minicard-control.c (free_struct): change signature
- to that of a weak ref notify function.
- (e_minicard_control_factory): ::destroy -> weak_ref.
-
- * gui/widgets/e-addressbook-view.c (e_addressbook_view_init):
- ::destroy -> weak_ref.
- (e_addressbook_view_print): same.
- (free_closure): change signature to that of a weak ref notify
- function.
- (e_contact_print_destroy): same.
- (invisible_destroyed): same.
-
- * gui/widgets/e-addressbook-util.c
- (e_addressbook_prompt_save_dialog): convert from GnomeDialog to
- GtkDialog.
- (e_addressbook_show_multiple_cards): same.
-
- * gui/contact-list-editor/e-contact-list-editor.c
- (prompt_to_save_changes): change response ids to use
- GTK_RESPONSE_.
-
- * gui/component/select-names/e-select-names-manager.c
- (clear_widget): new function.
- (e_select_names_manager_activate_dialog): ::destroy -> weak_ref.
-
- * gui/component/select-names/e-select-names.c (clear_widget):
- change signature to that of a weak ref notify function.
- (e_select_names_init): ::destroy -> weak_ref.
-
- * gui/component/e-address-popup.c (mini_wizard_destroy_cb): change
- signature to that of a weak ref notify function.
- (mini_wizard_new): ::destroy -> weak_ref.
-
- * gui/component/addressbook-config.c
- (addressbook_source_dialog_destroy): change signature to that of a
- weak ref notify function.
- (ldap_config_control_destroy_callback): same.
- (addressbook_add_server_druid): ::destroy -> weak_ref.
- (addressbook_edit_server_dialog): same.
- (ldap_config_control_new): same.
-
- * gui/component/addressbook.c (destroy_callback): change signature
- to that of a a weak ref notify function.
- (addressbook_factory_new_control): ::destroy -> weak_ref.
-
- * gui/merging/e-card-merging.c (response): rename clicked to this,
- and destroy the dialog here.
- (match_query_callback): ::clicked -> ::response
-
- * gui/merging/e-card-merging-book-commit-duplicate-detected.glade:
- convert.
-
- * gui/merging/e-card-duplicate-detected.glade: same.
-
-2002-11-11 Chris Toshok <toshok@ximian.com>
-
- * gui/contact-editor/e-contact-editor.c (_arrow_pressed): change
- around a little, still ifdefed though.
-
- * gui/contact-editor/e-contact-save-as.c (file_exists): same.
- (save_it): deal with the GtkDialog response ids.
-
- * gui/contact-editor/e-contact-editor.c
- (e_contact_editor_confirm_delete): just build the dialog here
- (using gtk_message_dialog*).
-
- * gui/contact-editor/Makefile.am (glade_DATA): remove
- file-exists.glade and e-contact-editor-confirm-delete.glade.
-
-2002-11-11 Chris Toshok <toshok@ximian.com>
-
- * backend/pas/pas-card-cursor.c (pas_card_cursor_dispose): guard
- against multiple invocations.
-
- * backend/pas/pas-backend-ldap.c (view_destroy): change signature
- to that of weak ref's notify function - also, don't use the type
- check macros on the freed GObject.
- (cursor_destroy): same.
- (pas_backend_ldap_book_destroy_cb): same.
- (pas_backend_ldap_add_client): use weak_ref insteead of ::destroy.
- (get_cursor_handler): same.
- (pas_backend_ldap_process_get_book_view): same.
-
- * backend/pas/pas-backend-file.c (cursor_destroy): change
- signature to that of weak ref's notify function - also, don't use
- the type check macros on the freed GObject.
- (pas_backend_file_book_destroy_cb): same.
- (view_destroy): same.
- (pas_backend_file_process_get_cursor): use weak_ref instead of
- ::destroy.
- (pas_backend_file_process_get_book_view): same.
- (pas_backend_file_process_get_completion_view): same.
- (pas_backend_file_process_get_changes): same.
- (pas_backend_file_add_client): same.
-
-2002-11-10 Chris Toshok <toshok@ximian.com>
-
- * backend/pas/pas-backend-card-sexp.c
- (pas_backend_card_sexp_dispose): guard against multiple
- invocations.
-
- * backend/pas/pas-card-cursor.c (pas_card_cursor_dispose): same.
-
- * backend/pas/pas-book.c (pas_book_dispose): same.
-
- * backend/pas/pas-book-view.c (pas_book_view_dispose): same.
-
- * backend/pas/pas-book-factory.c (pas_book_factory_dispose): same.
-
- * backend/pas/pas-backend-summary.c (pas_backend_summary_dispose): same.
-
- * backend/pas/pas-backend-ldap.c (pas_backend_ldap_dispose): same.
-
- * backend/pas/pas-backend-file.c (pas_backend_file_dispose): same.
-
- * backend/ebook/e-book-listener.c (e_book_listener_dispose): guard
- against multiple invocations.
-
- * backend/ebook/e-card.c (e_card_dispose): same.
-
- * backend/ebook/e-card-simple.c (e_card_simple_dispose): same.
-
- * backend/ebook/e-card-cursor.c (e_card_cursor_dispose): same.
-
- * backend/ebook/e-book.c (e_book_dispose): same.
-
- * backend/ebook/e-book-view-listener.c (e_book_view_listener_dispose): same.
-
-2002-11-08 Chris Toshok <toshok@ximian.com>
-
- * gui/widgets/e-addressbook-model.c (free_data): guard against
- multiple invocations.
- (remove_book_view): same.
- (addressbook_dispose): same.
-
- * gui/widgets/e-addressbook-view.c (e_addressbook_view_dispose):
- same.
-
- * gui/widgets/e-minicard-view-widget.c
- (e_minicard_view_widget_dispose): same.
-
- * gui/widgets/e-minicard-view.c (e_minicard_view_dispose): same.
-
- * gui/widgets/e-minicard-widget.c (e_minicard_widget_dispose):
- same.
-
-2002-11-08 Chris Toshok <toshok@ximian.com>
-
- * gui/widgets/e-addressbook-reflow-adapter.c
- (addressbook_get_property): oops, missed these casts.
-
- * gui/component/addressbook.c (get_master_list): remove the
- PENDING_PORT_WORK ifdef, just ported ECategoriesMasterList.
- (make_suboptions): same.
-
- * gui/contact-editor/e-contact-editor.c (categories_clicked):
- same.
-
-2002-11-08 Chris Toshok <toshok@ximian.com>
-
- * gui/widgets/test-reflow.c: port work.
-
- * gui/widgets/test-minicard-view.c: port work.
-
- * gui/widgets/e-minicard.[ch]: port work.
-
- * gui/widgets/e-minicard-widget.c: port work.
-
- * gui/widgets/e-minicard-view.c: port work.
-
- * gui/widgets/e-minicard-view-widget.c
- (e_minicard_view_widget_size_allocate): gtk_->g_ change i missed.
- (e_minicard_view_widget_reflow): same.
-
- * gui/widgets/e-minicard-label.c: port work.
-
- * gui/widgets/e-minicard-control.c (get_prop): gtk_->g_ change i
- missed.
-
- * gui/widgets/e-addressbook-view.c (setup_menus): ifdef this
- PENDING_PORT_WORK for now.
- (has_email_address_1): gtk_->g_ change i missed.
- (print): remove the PENDING_PORT_WORK from here, as the print_*
- symbols now resolve.
- (delete): gtk_->g_ changes.
- (new_card): same.
- (new_list): same.
- (sources): same.
- (create_minicard_view): same.
- (table_double_click): same.
- (create_table_view): same.
- (e_contact_print_destroy): same.
- (e_contact_print_button): same.
- (e_addressbook_view_print): same, and remove the PENDING_PORT_WORK
- ifdef.
- (e_addressbook_view_print_preview): same.
- (do_remove): gtk_->g_ changes.
- (e_addressbook_view_save_state): same.
- (view_transfer_cards): same.
-
- * gui/widgets/e-addressbook-view.h (struct _EAddressbookView):
- GtkObject -> GObject.
-
- * gui/widgets/e-addressbook-util.c (e_addressbook_error_dialog):
- GnomeDialog -> GtkDialog.
-
- * gui/widgets/e-addressbook-table-adapter.c
- (addressbook_set_value_at): a gtk_->g_ change i missed.
- (e_addressbook_table_adapter_class_init): gtk_type_class ->
- g_type_class_peek_parent.
-
- * gui/widgets/e-addressbook-reflow-adapter.c
- (addressbook_get_property): use g_object_get_property for
- aggregated properties.
- (e_addressbook_reflow_adapter_class_init): gtk_type_class ->
- g_type_class_peek_parent.
-
- * gui/merging/e-card-merging.c (match_query_callback): some misc
- gtk_->g_ changes i missed.
-
-2002-11-08 Chris Toshok <toshok@ximian.com>
-
- * gui/component/select-names/e-select-names-model.h: parent class
- is GObjectClass.
-
- * gui/component/select-names/e-simple-card-bonobo.c
- (impl_dispose): guard against multiple invocations, and chain
- dispose.
-
- * gui/component/select-names/e-select-names.c
- (e_select_names_dispose): guard against multiple invocations.
-
- * gui/component/select-names/e-select-names-text-model.c
- (e_select_names_text_model_dispose): guard against multiple
- invocations.
- (e_select_names_text_model_set_source): fix casts.
-
- * gui/component/select-names/e-select-names-table-model.c
- (e_select_names_table_model_add_source): remove the GTK_OBJECT
- cast, fixes a warning.
- (clear_info): guard against multiple invocations from ::dispose.
-
- * gui/component/select-names/e-select-names-manager.c
- (e_select_names_manager_dispose): same.
-
- * gui/component/select-names/e-select-names-completion.c
- (e_select_names_completion_dispose): same.
-
- * gui/component/select-names/e-select-names-bonobo.c
- (impl_dispose): guard against multiple invocations.
-
-2002-11-08 Chris Toshok <toshok@ximian.com>
-
- * gui/contact-list-editor/contact-list-editor.glade: convert to glade-2
-
- * gui/contact-list-editor/e-contact-list-editor.c: port work.
-
- * gui/contact-list-editor/e-contact-list-model.[ch]: port work.
-
-2002-11-08 Chris Toshok <toshok@ximian.com>
-
- * gui/contact-editor/e-contact-editor-address.[ch]: port work.
-
- * gui/contact-editor/e-contact-editor-fullname.[ch]: port work.
-
- * gui/contact-editor/e-contact-editor.[ch]: port work.
-
- * gui/contact-editor/e-contact-quick-add.c: port work.
-
- * gui/contact-editor/e-contact-save-as.c: port work.
-
-2002-11-08 Chris Toshok <toshok@ximian.com>
-
- * backend/ebook/e-book-util.c
- (set_default_book_uri_from_config_db): prepend /apps/Evolution to
- config db paths.
-
- * gui/component/select-names/e-select-names-manager.c (read_completion_books_from_db): same.
- (uris_listener): same.
-
-2002-11-08 Chris Toshok <toshok@ximian.com>
-
- * gui/contact-editor/e-contact-editor.c: more porting work.
-
- * e-contact-editor-fullname.[ch]: more porting work.
-
- * e-contact-editor.c: more porting work.
-
- * e-contact-quick-add.c: more porting work.
-
- * e-contact-save-as.c: more porting work.
-
- * test-editor.c: more porting work.
-
- * e-contact-editor-confirm-delete.glade, file-exists.glade,
- fulladdr.glade, fullname.glade: run these through
- libglade-convert.
-
-2002-11-07 Chris Toshok <toshok@ximian.com>
-
- * gui/component/Makefile.am (evolution_addressbook_LDADD): add
- lots of libs back in since they're building now.
-
- * gui/component/addressbook-config.c: more porting work.
-
- * gui/component/addressbook.c: more porting work.
-
- * gui/component/e-address-popup.[ch]: more porting work.
-
- * gui/component/e-address-widget.[ch]: more porting work.
-
- * gui/component/e-cardlist-model.[ch]: more porting work.
-
-2002-11-07 Chris Toshok <toshok@ximian.com>
-
- * gui/component/select-names/e-select-names-bonobo.[ch]: more
- porting work.
-
- * gui/component/select-names/e-select-names-completion.[ch]: more
- porting work.
-
- * gui/component/select-names/e-select-names-manager.[ch]: more
- porting work.
-
- * gui/component/select-names/e-select-names-model.[ch]: more
- porting work.
-
- * gui/component/select-names/e-select-names-popup.c: more
- porting work.
-
- * gui/component/select-names/e-select-names-table-model.[ch]: more
- porting work.
-
- * gui/component/select-names/e-select-names-text-model.[ch]: more
- porting work.
-
- * gui/component/select-names/e-select-names.[ch]: more
- porting work.
-
-2002-11-07 Chris Toshok <toshok@ximian.com>
-
- * backend/ebook/Makefile.am: tests are linking now, and link in
- libcamel.la.
-
- * backend/ebook/e-destination.c (e_destination_get_name): un-ifdef
- since camel is compiling.
- (e_destination_get_email): same.
- (e_destination_get_address): same.
- (e_destination_get_textrep): same.
-
- * backend/ebook/e-card-compare.c (name_fragment_match): use e_utf8_casefold_*.
- (name_fragment_match_with_synonyms): same.
- (e_card_compare_name_to_string_full): same.
- (e_card_compare_name): same.
-
-2002-11-07 Chris Toshok <toshok@ximian.com>
-
- * backend/ebook/e-book-util.h: add prototypes for e_utf8_casefold_collate{_len}
-
- * backend/ebook/e-book-util.c (e_utf8_casefold_collate_len): move
- utf8_casefold_collate_len here.
- (e_utf8_casefold_collate): move utf8_casefold_collate here.
-
-2002-11-06 Chris Toshok <toshok@ximian.com>
-
- * printing/e-contact-print-envelope.c: port this to
- gnome2/gnomeprint2.
-
- * printing/e-contact-print-style-editor.c: same.
-
- * printing/e-contact-print.c: same.
-
- * printing/test-contact-print-style-editor.c: same.
-
- * printing/test-print.c: same.
-
- * printing/e-contact-print.glade: libglade-convert to libglade-2.
-
- * printing/Makefile.am (contact_print_test_LDADD)
- (contact_print_style_editor_test_LDADD): remove libcamel.la from
- these for the time being to get things linking.
-
-2002-11-06 Chris Toshok <toshok@ximian.com>
-
- * gui/widgets/gal-view-minicard.[ch]: gobjectify this.
-
- * gui/widgets/e-minicard.[ch]: gobjectify this.
- (e_minicard_class_init): change the
- min/max values of the width/height paramspecs so that they can
- actually be set to something other than 0.0.
-
- * gui/widgets/e-minicard-widget.[ch]: gobjectify this.
-
- * gui/widgets/e-minicard-view.[ch]: gobjectify this.
- (set_empty_message): don't need e_utf8_from_locale_string anymore.
-
- * gui/widgets/e-minicard-view-widget.[ch]: gobjectify this.
-
- * gui/widgets/e-minicard-label.[ch]: gobjectify this.
-
- * gui/widgets/e-addressbook-view.[ch]: gobjectify this.
-
- * gui/widgets/e-addressbook-table-adapter.[ch]: gobjectify this.
-
- * gui/widgets/e-addressbook-reflow-adapter.[ch]: gobjectify this.
-
- * gui/widgets/e-addressbook-model.[ch]: gobjectify this.
-
- * gui/widgets/e-minicard-control.c (e_minicard_control_factory):
- fix bonobo_persist_stream_new api change.
-
- * gui/contact-list-editor/e-contact-list-model.c
- (e_contact_list_model_add_destination): get rid of the
- gtk_object_sink here.
-
- * gui/component/ldap-config.glade: glade-2 version of this file.
-
- * gui/component/e-address-popup.c (e_address_popup_refresh_names):
- don't need e_utf8_to_gtk_string anymore.
-
- * gui/component/addressbook.c (make_suboptions): don't need
- e_utf8_to_locale_string anymore.
-
- * gui/component/addressbook-config.c
- (addressbook_dialog_get_source): get rid of the e_utf8 gtk_entry
- functions.
- (addressbook_source_dialog_set_source): same.
- (general_tab_check): same.
- (port_changed_func): same.
- (connecting_tab_check): same.
- (query_for_supported_bases): same.
- (display_name_check): same.
- (display_name_page_prepare): same.
- (edit_source_clicked): same.
- (addressbook_config_create_new_source): same.
-
-2002-11-06 Chris Toshok <toshok@ximian.com>
-
- * backend/pas/pas-backend-card-sexp.c
- (pas_backend_card_sexp_class_init): use g_type_class_peek_parent.
-
- * backend/pas/pas-card-cursor.c (pas_card_cursor_class_init): same.
-
- * backend/pas/pas-book-view.c (pas_book_view_class_init): same.
-
- * backend/pas/pas-book-factory.c (pas_book_factory_class_init): same.
-
- * backend/pas/pas-backend-summary.c (pas_backend_summary_class_init): same.
-
- * backend/pas/pas-backend-ldap.c (pas_backend_ldap_class_init): same.
-
- * backend/pas/pas-backend-file.c (pas_backend_file_class_init): same.
-
- * backend/ebook/e-book-marshal.list: ENUM -> INT.
-
- * backend/ebook/e-book-view.c (e_book_view_dispose): guard against
- this being called multiple times.
- (e_book_view_class_init): ENUM -> INT in the sequence_complete
- signal.
-
- * backend/ebook/e-book.c (e_book_do_response_open): un-ifdef the
- component_died signal stuff.
-
-2002-11-06 Chris Toshok <toshok@ximian.com>
-
- * backend/ebook/e-book-util.c (e_book_expand_uri): call
- g_build_filename, not g_build_path.
-
-2002-11-06 Chris Toshok <toshok@ximian.com>
-
- * backend/ebook/e-destination.[ch]: fix the gnome-xml headers.
-
-2002-11-06 Chris Toshok <toshok@ximian.com>
-
- * gui/widgets/gal-view-minicard.c: fix the gnome-xml headers.
-
- * gui/widgets/e-addressbook-view.c
- (e_addressbook_view_class_init): convert from gtk signals and args
- to GSignal and GObject properties.
- (e_addressbook_view_dispose): rename _destroy to this.
- (e_addressbook_view_set_property): rework _set_arg to this.
- (e_addressbook_view_get_property): rework _get_arg to this.
- (display_view): if we're here we need to choose a view, regardless
- of whether or not the GAL_IS_VIEW_* macros tell us which type it
- is.
-
- * gui/widgets/e-addressbook-table-adapter.c: fix the gnome-xml
- headers.
-
- * gui/widgets/e-addressbook-model.c
- (e_addressbook_model_class_init): use INT, not ENUM in the signal here.
-
- * gui/component/addressbook-config.c: another big gtk_* -> g_*
- renaming.
-
- * gui/component/addressbook.c: same.
-
- * gui/component/e-address-popup.c: same.
-
- * gui/component/e-address-widget.c: same.
-
- * gui/component/e-cardlist-model.c: fix the gnome-xml headers, and
- more gtk_* -> g_* renaming.
-
- * gui/component/addressbook-component.c (owner_set_cb): use
- evolution_shell_client_corba_objref as per ettore's change to
- EvolutionShellClient..
- (create_view): fix the call to bonobo_control_set_property.
- (create_component): gtk_signal_connect -> g_signal_connect.
-
- * gui/component/addressbook-storage.c: fix the gnome-xml
- headers.
- (addressbook_storage_setup): use
- evolution_shell_client_corba_objref as per ettore's change to
- EvolutionShellClient..
- (addressbook_get_other_contact_storage): gtk_signal_connect ->
- g_signal_connect.
- (load_source_data): root->childs -> root->childrens.
-
-2002-11-06 Chris Toshok <toshok@ximian.com>
-
- * gui/search/e-addressbook-search-dialog.c: fix some #include's.
-
-2002-11-06 Chris Toshok <toshok@ximian.com>
-
- * Makefile.am (SUBDIRS): only build the backend and gui dirs for
- now. printing and conduits are no-man's land at present.
-
- * addressbook/gui/merging/e-card-merging.[ch]: Port to
- GObject/gnome2.
-
-2002-11-05 Chris Toshok <toshok@ximian.com>
-
- * gui/component/.cvsignore: ignore the new .server file.
-
- * gui/component/Makefile.am: typical port stuff. switch the .oaf
- to .server, and leave out a lot of libs so we can actually get
- things linking.
-
- * gui/component/GNOME_Evolution_Addressbook.server.in: rename
- .oaf.in here.
-
- * gui/component/addressbook-component.c: Port to GObject/gnome2.
-
- * gui/component/addressbook-config.c: Port to GObject/gnome2.
-
- * gui/component/addressbook-factory.c: Port to GObject/gnome2.
-
- * gui/component/addressbook-storage.c: Port to GObject/gnome2.
-
- * gui/component/addressbook.[ch]: Port to GObject/gnome2.
-
- * gui/component/e-address-popup.[ch]: Port to GObject/gnome2.
-
- * gui/component/e-address-widget.[ch]: Port to GObject/gnome2.
-
- * gui/component/e-cardlist-model.h: Port to GObject/gnome2.
-
-2002-11-05 Chris Toshok <toshok@ximian.com>
-
- * gui/contact-list-editor/.cvsignore: ignore the marshal generated
- stuff.
-
- * gui/contact-list-editor/Makefile.am: typical port stuff. add
- marshaller generation foo, dist it...
-
- * gui/contact-list-editor/e-contact-list-editor.[ch]: Port to
- GObject/gnome2.
-
- * gui/contact-list-editor/e-contact-list-model.[ch]: Port to
- GObject/gnome2.
-
-2002-11-05 Chris Toshok <toshok@ximian.com>
-
- * gui/contact-editor/.cvsignore: ignore the marshal generated
- stuff.
-
- * gui/contact-editor/Makefile.am: typical port stuff. add
- marshaller generation foo, dist it...
-
- * gui/contact-editor/e-contact-editor-address.[ch]: Port to GObject/gnome2.
-
- * gui/contact-editor/e-contact-editor-fullname.c: Port to GObject/gnome2.
-
- * gui/contact-editor/e-contact-editor.c: Port to GObject/gnome2.
-
- * gui/contact-editor/e-contact-quick-add.c: Port to GObject/gnome2.
-
- * gui/contact-editor/e-contact-save-as.[ch]: Port to GObject/gnome2.
-
- * gui/contact-editor/test-editor.c: Port to GObject/gnome2.
-
-2002-11-05 Chris Toshok <toshok@ximian.com>
-
- * gui/widgets/e-addressbook-model.[ch]: Port to GObject/gnome2.
-
- * gui/widgets/e-addressbook-reflow-adapter.c: Port to
- GObject/gnome2.
-
- * gui/widgets/e-addressbook-table-adapter.c: Port to
- GObject/gnome2.
-
- * gui/widgets/e-addressbook-util.c: Port to GObject/gnome2.
-
- * gui/widgets/e-addressbook-view.[ch]: Port to GObject/gnome2.
-
- * gui/widgets/e-minicard-control.c: Port to GObject/gnome2.
-
- * gui/widgets/e-minicard-label.[ch]: Port to GObject/gnome2.
-
- * gui/widgets/e-minicard-view-widget.[ch]: Port to GObject/gnome2.
-
- * gui/widgets/e-minicard-view.[ch]: Port to GObject/gnome2.
-
- * gui/widgets/e-minicard-widget-test.c: Port to GObject/gnome2.
-
- * gui/widgets/e-minicard-widget.c: Port to GObject/gnome2.
-
- * gui/widgets/e-minicard.[ch]: Port to GObject/gnome2.
-
- * gui/widgets/gal-view-factory-minicard.c: Port to GObject/gnome2.
-
- * gui/widgets/gal-view-minicard.c: Port to GObject/gnome2.
-
- * gui/widgets/test-minicard-label.c: Port to GObject/gnome2.
-
- * gui/widgets/test-minicard-view.c: Port to GObject/gnome2.
-
- * gui/widgets/test-minicard.c: Port to GObject/gnome2.
-
- * gui/widgets/test-reflow.c: Port to GObject/gnome2.
-
- * gui/widgets/Makefile.am: typical port stuff. add marshaller
- generation foo, dist it...
-
- * gui/widgets/.cvsignore: ignore the marshaller stuff.
-
-2002-11-05 Chris Toshok <toshok@ximian.com>
-
- * gui/component/select-names/e-simple-card-bonobo.[ch]: Port to
- GObject/gnome2.
-
- * gui/component/select-names/e-select-names.[ch]: Port to
- GObject/gnome2.
-
- * gui/component/select-names/e-select-names-text-model.c: Port to
- GObject/gnome2.
-
- * gui/component/select-names/e-select-names-table-model.c: Port to
- GObject/gnome2.
-
- * gui/component/select-names/e-select-names-popup.[ch]: Port to
- GObject/gnome2.
-
- * gui/component/select-names/e-select-names-model.c: Port to
- GObject/gnome2.
-
- * gui/component/select-names/e-select-names-manager.[ch]: Port to
- GObject/gnome2.
-
- * gui/component/select-names/e-select-names-factory.c: Port to
- GObject/gnome2.
-
- * gui/component/select-names/e-select-names-completion.[ch]: Port
- to GObject/gnome2.
-
- * gui/component/select-names/e-select-names-bonobo.[ch]: Port to
- GObject/gnome2.
-
- * gui/component/select-names/Makefile.am: typical port stuff. add
- marshaller generation foo, dist it, and switch the .oaf to .server
-
- * gui/component/select-names/.cvsignore: ignore the marshaller
- stuff.
-
-2002-11-05 Chris Toshok <toshok@ximian.com>
-
- * backend/ebook/.cvsignore: ignore the generated marshaller files.
-
- * backend/ebook/e-destination.c (e_destination_dispose): rename
- e_destination_destroy.
- (e_destination_equal): ifdef this out for now, PENDING_PORT_WORK.
- (e_destination_get_name): same.
- (e_destination_get_email): same.
- (e_destination_get_address): same.
- (e_destination_get_textrep): same.
-
- * backend/ebook/Makefile.am: don't build the executables
- (importers and loaders) for now. Also, s/oaf/server, and use
- INTLTOOL_SERVER_RULE.
-
- * backend/ebook/e-book-util.c (e_book_get_config_database):
- un-#ifdef this.
- (e_book_default_book_open): un-#ifdef ths code in here that relies
- on the e_config_listener.
-
-2002-11-05 Dan Winship <danw@ximian.com>
-
- * backend/pas/pas-backend-ldap.c (send_pending_adds): copy a
- memleak fix from pas-backend-ad.
-
-2002-11-05 Chris Toshok <toshok@ximian.com>
-
- * backend/ebook/e-card.c: g_date_* => g_date_get_*, fixes
- G_DISABLE_DEPRECATED build.
-
- * backend/ebook/e-book-listener.[ch]: remove the servant crap i'd
- c&p'ed and put in here.
-
- * backend/ebook/e-book-view-listener.[ch]: remove the servant crap
- i'd c&p'ed and put in here.
-
- * backend/pas/pas-book-factory.[ch]: subclass from BonoboObject,
- and remove the servant crap from here too. whee.
-
- * backend/pas/pas-card-cursor.[ch]: remove the servant crap i'd
- c&p'ed and put in here.
-
- * backend/pas/pas-book.[ch]: remove the servant crap i'd c&p'ed
- and put in here.
-
- * backend/pas/pas-book-view.[ch]: remove the servant crap i'd
- c&p'ed and put in here.
-
-2002-11-05 Chris Toshok <toshok@ximian.com>
-
- * backend/pas/pas-backend-card-sexp.[ch]: port to gnome 2.
-
- * backend/pas/pas-backend-file.[ch]: same.
-
- * backend/pas/pas-backend-file.[ch]: same.
-
- * backend/pas/pas-backend-ldap.[ch]: same.
-
- * backend/pas/pas-backend-summary.[ch]: same.
-
- * backend/pas/pas-backend.[ch]: same.
-
- * backend/pas/pas-book-factory.[ch]: same.
-
- * backend/pas/pas-book-view.[ch]: same.
-
- * backend/pas/pas-book.[ch]: same.
-
- * backend/pas/pas-card-cursor.[ch]: same.
-
- * backend/pas/pas-marshal.list: list of marshallers.
-
- * backend/pas/Makefile.am (libpas_a_SOURCES): add pas-marshal.c
- also add the marshal building foo.
-
- * backend/pas/.cvsignore: ignore pas-marshal.[ch]
-
-2002-11-05 Chris Toshok <toshok@ximian.com>
-
- * backend/ebook/test-client-list.c (main): don't call
- bonobo_activation_init directly.
-
- * backend/ebook/test-client.c (get_card_cb): don't unref the card
- here since we never reffed it.
- (main): no need to call bonobo_activation_init, as
- gnome_program_init did it for us.
-
- * backend/ebook/e-card-simple.c (e_card_simple_get_property):
- s/g_value_{set,get}_pointer/g_value_{set,get}_object
-
- * backend/ebook/e-book-util.c (set_default_book_uri_local): make
- sure to terminate args with NULL for g_build_filename.
-
- * backend/ebook/e-book-listener.c: nuke e_book_listener_get_type
- and use the BONOBO_TYPE_FUNC_FULL macro.
-
- * backend/ebook/e-book-listener.h: add the epv to
- EBookListenerClass so BONOBO_TYPE_FUNC_FULL works.
-
- * backend/ebook/e-book-view-listener.c: nuke
- e_book_view_listener_get_type and use the BONOBO_TYPE_FUNC_FULL
- macro.
-
- * backend/ebook/e-book-view-listener.h: add the epv to
- EBookViewListenerClass so BONOBO_TYPE_FUNC_FULL works.
-
-2002-11-02 Chris Toshok <toshok@ximian.com>
-
- * backend/ebook/e-book-types.h: just include glib.h instead of the
- gtk stuff.
-
- * backend/ebook/e-book-listener.[ch]: convert to
- GObject/bonobo-activation/etc/etc.
- * e-book-util.[ch]: same.
- * e-book-view-listener.[ch]: same.
- * e-book-view.[ch]: same.
- * e-book.[ch]: same.
- * e-card-compare.[ch]: same.
- * e-card-cursor.[ch]: same.
- * e-card-simple.[ch]: same.
- * e-card.[ch]: same.
- * e-destination.[ch]: same.
- * evolution-ldif-importer.c: same.
- * evolution-vcard-importer.c: same.
- * load-gnomecard-addressbook.c: same.
- * load-pine-addressbok.c: same.
- * test-card.c: same.
- * test-client-list.c: same.
- * test-client.c: same.
-
- * backend/ebook/Makefile.am: add e-book-marshal.c to SOURCES, add
- e-book-marshal.[ch] to CLEANFILES, and add e-book-marshal.list to
- EXTRA_DIST. Also, remove the camel libs from the test LDADD's,
- and leave e-destination.[ch] out of the build.
-
- * backend/ebook/.cvsignore: ignore e-book-marshal.[ch]
-
- * backend/ebook/e-book-marshal.list: marshallers for e-book.
+ [ Should fixes bugs #30323, #33097, #33930, #33332 ]
+ * gui/contact-editor/e-contact-editor.c: unref the *@(&E(@
+ select_names_contacts object. fixes the very, very, very
+ longstanding crash when modifying the list of completion folders.
2002-10-28 Larry Ewing <lewing@ximian.com>
diff --git a/addressbook/backend/ebook/e-book-util.c b/addressbook/backend/ebook/e-book-util.c
index cc00d045f4..dac9022051 100644
--- a/addressbook/backend/ebook/e-book-util.c
+++ b/addressbook/backend/ebook/e-book-util.c
@@ -27,10 +27,12 @@
#include <config.h>
#include "e-book-util.h"
-#include <string.h>
-#include <glib.h>
-#include <glib-object.h>
-#include <e-util/e-config-listener.h>
+#include <gtk/gtkobject.h>
+#include <gtk/gtksignal.h>
+#include <libgnome/gnome-defs.h>
+#include <libgnome/gnome-util.h>
+#include <bonobo/bonobo-listener.h>
+#include <bonobo/bonobo-event-source.h>
#include "e-card-compare.h"
typedef struct _CommonBookInfo CommonBookInfo;
@@ -55,7 +57,7 @@ e_book_expand_uri (const char *uri)
char *ret_val;
char *file_name;
- file_name = g_build_filename(uri + offset, "addressbook.db", NULL);
+ file_name = g_concat_dir_and_file(uri + offset, "addressbook.db");
ret_val = g_strdup_printf("file://%s", file_name);
g_free(file_name);
return ret_val;
@@ -73,27 +75,32 @@ got_uri_book_cb (EBook *book, EBookStatus status, gpointer closure)
if (status == E_BOOK_STATUS_SUCCESS) {
info->cb (book, info->closure);
} else {
- if (book)
- g_object_unref (book);
info->cb (NULL, info->closure);
}
g_free (info);
}
-void
+gboolean
e_book_load_address_book_by_uri (EBook *book, const char *uri, EBookCallback open_response, gpointer closure)
{
+ gboolean rv;
char *real_uri;
- g_return_if_fail (book != NULL);
- g_return_if_fail (E_IS_BOOK (book));
- g_return_if_fail (open_response != NULL);
+ g_return_val_if_fail (book != NULL, FALSE);
+ g_return_val_if_fail (E_IS_BOOK (book), FALSE);
+ g_return_val_if_fail (open_response != NULL, FALSE);
real_uri = e_book_expand_uri (uri);
- e_book_load_uri (book, real_uri, open_response, closure);
+ rv = e_book_load_uri (book, real_uri, open_response, closure);
+
+ if (!rv) {
+ g_warning ("Couldn't load addressbook %s", real_uri);
+ }
g_free (real_uri);
+
+ return rv;
}
void
@@ -109,16 +116,19 @@ e_book_use_address_book_by_uri (const char *uri, EBookCommonCallback cb, gpointe
info->closure = closure;
book = e_book_new ();
- e_book_load_address_book_by_uri (book, uri, got_uri_book_cb, info);
+ if (! e_book_load_address_book_by_uri (book, uri, got_uri_book_cb, info)) {
+ gtk_object_unref (GTK_OBJECT (book));
+ g_free (info);
+ }
}
-EConfigListener *
-e_book_get_config_database ()
+Bonobo_ConfigDatabase
+e_book_get_config_database (CORBA_Environment *ev)
{
- static EConfigListener *config_db;
+ static Bonobo_ConfigDatabase config_db;
if (config_db == NULL)
- config_db = e_config_listener_new ();
+ config_db = bonobo_get_object ("wombat:", "Bonobo/ConfigDatabase", ev);
return config_db;
}
@@ -136,7 +146,7 @@ got_default_book_cb (EBook *book, EBookStatus status, gpointer closure)
default book got loaded twice. */
if (common_default_book) {
- g_object_unref (book);
+ gtk_object_unref (GTK_OBJECT (book));
book = common_default_book;
}
@@ -147,8 +157,7 @@ got_default_book_cb (EBook *book, EBookStatus status, gpointer closure)
}
} else {
- if (book)
- g_object_unref (book);
+
info->cb (NULL, info->closure);
}
@@ -173,33 +182,22 @@ e_book_use_default_book (EBookCommonCallback cb, gpointer closure)
info->closure = closure;
book = e_book_new ();
- e_book_load_default_book (book, got_default_book_cb, info);
+ if (! e_book_load_default_book (book, got_default_book_cb, info)) {
+ gtk_object_unref (GTK_OBJECT (book));
+ g_free (info);
+ }
}
static char *default_book_uri;
-static char*
-get_local_book_uri (void)
-{
- char *filename;
- char *uri;
-
- filename = g_build_filename (g_get_home_dir(),
- "evolution/local/Contacts/addressbook.db",
- NULL);
- uri = g_strdup_printf ("file://%s", filename);
-
- g_free (filename);
-
- return uri;
-}
-
static void
set_default_book_uri_local (void)
{
- g_free (default_book_uri);
+ char *filename;
- default_book_uri = get_local_book_uri ();
+ filename = gnome_util_prepend_user_home ("evolution/local/Contacts/addressbook.db");
+ default_book_uri = g_strdup_printf ("file://%s", filename);
+ g_free (filename);
}
static void
@@ -217,33 +215,37 @@ set_default_book_uri (char *val)
}
}
-#define DEFAULT_CONTACTS_URI_PATH "/apps/evolution/shell/default_folders/contacts_uri"
static void
-default_folder_listener (EConfigListener *cl, const char *key, gpointer data)
+default_folder_listener (BonoboListener *listener, char *event_name,
+ CORBA_any *any, CORBA_Environment *ev,
+ gpointer user_data)
{
+ Bonobo_ConfigDatabase config_db;
char *val;
- if (strcmp (key, DEFAULT_CONTACTS_URI_PATH))
- return;
-
- val = e_config_listener_get_string (cl, DEFAULT_CONTACTS_URI_PATH);
+ config_db = e_book_get_config_database (ev);
+ val = bonobo_config_get_string (config_db, "/DefaultFolders/contacts_uri", ev);
set_default_book_uri (val);
}
static void
-set_default_book_uri_from_config_db (void)
+set_default_book_uri_from_bonobo_conf (void)
{
char *val;
- EConfigListener* config_db;
+ Bonobo_ConfigDatabase config_db;
+ CORBA_Environment ev;
- config_db = e_book_get_config_database ();
- val = e_config_listener_get_string_with_default (config_db, DEFAULT_CONTACTS_URI_PATH, NULL, NULL);
+ CORBA_exception_init (&ev);
+ config_db = e_book_get_config_database (&ev);
+ val = bonobo_config_get_string (config_db, "/DefaultFolders/contacts_uri", &ev);
- g_signal_connect (config_db,
- "key_changed",
- G_CALLBACK (default_folder_listener), NULL);
+ bonobo_event_source_client_add_listener (config_db, default_folder_listener,
+ "Bonobo/ConfigDatabase:change/DefaultFolders:contacts_uri",
+ NULL,
+ NULL);
+ CORBA_exception_free (&ev);
set_default_book_uri (val);
}
@@ -262,34 +264,28 @@ e_book_default_book_open (EBook *book, EBookStatus status, gpointer closure)
g_free (default_book_closure);
/* If there's a transient error, report it to the caller, but
- * if the old default folder has disappeared, fall back to the
- * local contacts folder instead, except when the default
- * folder is also the local folder.
+ * if the old default folder has disappeared, fall back to
+ * the local contacts folder instead.
*/
if (status == E_BOOK_STATUS_PROTOCOL_NOT_SUPPORTED ||
status == E_BOOK_STATUS_NO_SUCH_BOOK) {
- char *local_uri = get_local_book_uri();
- if (strcmp (local_uri, default_book_uri)) {
- set_default_book_uri_local ();
- e_book_load_default_book (book, user_response, user_closure);
- }
- else
- user_response (book, status, user_closure);
- g_free (local_uri);
+ set_default_book_uri_local ();
+ e_book_load_default_book (book, user_response, user_closure);
} else {
user_response (book, status, user_closure);
}
}
-void
+gboolean
e_book_load_default_book (EBook *book, EBookCallback open_response, gpointer closure)
{
- const char *uri;
+ char *uri;
+ gboolean rv;
DefaultBookClosure *default_book_closure;
- g_return_if_fail (book != NULL);
- g_return_if_fail (E_IS_BOOK (book));
- g_return_if_fail (open_response != NULL);
+ g_return_val_if_fail (book != NULL, FALSE);
+ g_return_val_if_fail (E_IS_BOOK (book), FALSE);
+ g_return_val_if_fail (open_response != NULL, FALSE);
uri = e_book_get_default_book_uri ();
@@ -298,16 +294,21 @@ e_book_load_default_book (EBook *book, EBookCallback open_response, gpointer clo
default_book_closure->closure = closure;
default_book_closure->open_response = open_response;
- e_book_load_uri (book, uri,
- e_book_default_book_open, default_book_closure);
+ rv = e_book_load_uri (book, uri,
+ e_book_default_book_open, default_book_closure);
+
+ if (!rv) {
+ g_warning ("Couldn't load default addressbook");
+ }
+ return rv;
}
-const char *
+char*
e_book_get_default_book_uri ()
{
if (!default_book_uri)
- set_default_book_uri_from_config_db ();
+ set_default_book_uri_from_bonobo_conf ();
return default_book_uri;
}
@@ -335,15 +336,15 @@ struct _SimpleQueryInfo {
static void
book_add_simple_query (EBook *book, SimpleQueryInfo *info)
{
- GList *pending = g_object_get_data (G_OBJECT(book), "sq_pending");
+ GList *pending = gtk_object_get_data (GTK_OBJECT (book), "sq_pending");
pending = g_list_prepend (pending, info);
- g_object_set_data (G_OBJECT (book), "sq_pending", pending);
+ gtk_object_set_data (GTK_OBJECT (book), "sq_pending", pending);
}
static SimpleQueryInfo *
book_lookup_simple_query (EBook *book, guint tag)
{
- GList *pending = g_object_get_data (G_OBJECT (book), "sq_pending");
+ GList *pending = gtk_object_get_data (GTK_OBJECT (book), "sq_pending");
while (pending) {
SimpleQueryInfo *sq = pending->data;
if (sq->tag == tag)
@@ -356,7 +357,7 @@ book_lookup_simple_query (EBook *book, guint tag)
static void
book_remove_simple_query (EBook *book, SimpleQueryInfo *info)
{
- GList *pending = g_object_get_data (G_OBJECT (book), "sq_pending");
+ GList *pending = gtk_object_get_data (GTK_OBJECT (book), "sq_pending");
GList *i;
for (i=pending; i != NULL; i = g_list_next (i)) {
@@ -366,17 +367,17 @@ book_remove_simple_query (EBook *book, SimpleQueryInfo *info)
break;
}
}
- g_object_set_data (G_OBJECT (book), "sq_pending", pending);
+ gtk_object_set_data (GTK_OBJECT (book), "sq_pending", pending);
}
static guint
book_issue_tag (EBook *book)
{
- gpointer ptr = g_object_get_data (G_OBJECT (book), "sq_tag");
+ gpointer ptr = gtk_object_get_data (GTK_OBJECT (book), "sq_tag");
guint tag = GPOINTER_TO_UINT (ptr);
if (tag == 0)
tag = 1;
- g_object_set_data (G_OBJECT (book), "sq_tag", GUINT_TO_POINTER (tag+1));
+ gtk_object_set_data (GTK_OBJECT (book), "sq_tag", GUINT_TO_POINTER (tag+1));
return tag;
}
@@ -387,7 +388,7 @@ simple_query_new (EBook *book, const char *query, EBookSimpleQueryCallback cb, g
sq->tag = book_issue_tag (book);
sq->book = book;
- g_object_ref (book);
+ gtk_object_ref (GTK_OBJECT (book));
sq->query = g_strdup (query);
sq->cb = cb;
sq->closure = closure;
@@ -403,17 +404,17 @@ static void
simple_query_disconnect (SimpleQueryInfo *sq)
{
if (sq->add_tag) {
- g_signal_handler_disconnect (sq->view, sq->add_tag);
+ gtk_signal_disconnect (GTK_OBJECT (sq->view), sq->add_tag);
sq->add_tag = 0;
}
if (sq->seq_complete_tag) {
- g_signal_handler_disconnect (sq->view, sq->seq_complete_tag);
+ gtk_signal_disconnect (GTK_OBJECT (sq->view), sq->seq_complete_tag);
sq->seq_complete_tag = 0;
}
if (sq->view) {
- g_object_unref (sq->view);
+ gtk_object_unref (GTK_OBJECT (sq->view));
sq->view = NULL;
}
}
@@ -429,9 +430,9 @@ simple_query_free (SimpleQueryInfo *sq)
g_free (sq->query);
if (sq->book)
- g_object_unref (sq->book);
+ gtk_object_unref (GTK_OBJECT (sq->book));
- g_list_foreach (sq->cards, (GFunc) g_object_unref, NULL);
+ g_list_foreach (sq->cards, (GFunc) gtk_object_unref, NULL);
g_list_free (sq->cards);
g_free (sq);
@@ -446,7 +447,7 @@ simple_query_card_added_cb (EBookView *view, const GList *cards, gpointer closur
return;
sq->cards = g_list_concat (sq->cards, g_list_copy ((GList *) cards));
- g_list_foreach ((GList *) cards, (GFunc) g_object_ref, NULL);
+ g_list_foreach ((GList *) cards, (GFunc) gtk_object_ref, NULL);
}
static void
@@ -480,12 +481,16 @@ simple_query_book_view_cb (EBook *book, EBookStatus status, EBookView *book_view
}
sq->view = book_view;
- g_object_ref (book_view);
+ gtk_object_ref (GTK_OBJECT (book_view));
- sq->add_tag = g_signal_connect (sq->view, "card_added",
- G_CALLBACK (simple_query_card_added_cb), sq);
- sq->seq_complete_tag = g_signal_connect (sq->view, "sequence_complete",
- G_CALLBACK (simple_query_sequence_complete_cb), sq);
+ sq->add_tag = gtk_signal_connect (GTK_OBJECT (sq->view),
+ "card_added",
+ GTK_SIGNAL_FUNC (simple_query_card_added_cb),
+ sq);
+ sq->seq_complete_tag = gtk_signal_connect (GTK_OBJECT (sq->view),
+ "sequence_complete",
+ GTK_SIGNAL_FUNC (simple_query_sequence_complete_cb),
+ sq);
}
guint
@@ -783,26 +788,3 @@ e_book_query_address_default (const gchar *email,
e_book_use_default_book (have_address_book_open_cb, info);
}
-
-/* bad place for this i know. */
-int
-e_utf8_casefold_collate_len (const gchar *str1, const gchar *str2, int len)
-{
- gchar *s1 = g_utf8_casefold(str1, len);
- gchar *s2 = g_utf8_casefold(str2, len);
- int rv;
-
- rv = g_utf8_collate (s1, s2);
-
- g_free (s1);
- g_free (s2);
-
- return rv;
-}
-
-int
-e_utf8_casefold_collate (const gchar *str1, const gchar *str2)
-{
- return e_utf8_casefold_collate_len (str1, str2, -1);
-}
-
diff --git a/addressbook/backend/ebook/e-card-simple.c b/addressbook/backend/ebook/e-card-simple.c
index db008011cd..daab2f211c 100644
--- a/addressbook/backend/ebook/e-card-simple.c
+++ b/addressbook/backend/ebook/e-card-simple.c
@@ -13,19 +13,19 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include <bonobo/bonobo-i18n.h>
+#include <gtk/gtkobject.h>
+#include <gal/util/e-unicode-i18n.h>
#include <gal/util/e-util.h>
#include <libversit/vcc.h>
#include "e-card-simple.h"
-/* Object property IDs */
+/* Object argument IDs */
enum {
- PROP_0,
- PROP_CARD,
+ ARG_0,
+ ARG_CARD,
};
-static GObjectClass *parent_class;
typedef enum _ECardSimpleInternalType ECardSimpleInternalType;
typedef struct _ECardSimpleFieldData ECardSimpleFieldData;
@@ -115,9 +115,9 @@ static int field_data_count = sizeof (field_data) / sizeof (field_data[0]);
static void e_card_simple_init (ECardSimple *simple);
static void e_card_simple_class_init (ECardSimpleClass *klass);
-static void e_card_simple_dispose (GObject *object);
-static void e_card_simple_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec);
-static void e_card_simple_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec);
+static void e_card_simple_destroy (GtkObject *object);
+static void e_card_simple_set_arg (GtkObject *object, GtkArg *arg, guint arg_id);
+static void e_card_simple_get_arg (GtkObject *object, GtkArg *arg, guint arg_id);
static void fill_in_info(ECardSimple *simple);
@@ -208,25 +208,24 @@ char *address_names[] = {
*
* Return value: The type ID of the &ECardSimple class.
**/
-GType
+GtkType
e_card_simple_get_type (void)
{
- static GType simple_type = 0;
+ static GtkType simple_type = 0;
if (!simple_type) {
- static const GTypeInfo simple_info = {
- sizeof (ECardSimpleClass),
- NULL, /* base_init */
- NULL, /* base_finalize */
- (GClassInitFunc) e_card_simple_class_init,
- NULL, /* class_finalize */
- NULL, /* class_data */
+ GtkTypeInfo simple_info = {
+ "ECardSimple",
sizeof (ECardSimple),
- 0, /* n_preallocs */
- (GInstanceInitFunc) e_card_simple_init,
+ sizeof (ECardSimpleClass),
+ (GtkClassInitFunc) e_card_simple_class_init,
+ (GtkObjectInitFunc) e_card_simple_init,
+ NULL, /* reserved_1 */
+ NULL, /* reserved_2 */
+ (GtkClassInitFunc) NULL
};
- simple_type = g_type_register_static (G_TYPE_OBJECT, "ECardSimple", &simple_info, 0);
+ simple_type = gtk_type_unique (gtk_object_get_type (), &simple_info);
}
return simple_type;
@@ -241,10 +240,10 @@ e_card_simple_get_type (void)
ECardSimple *
e_card_simple_new (ECard *card)
{
- ECardSimple *simple = g_object_new (E_TYPE_CARD_SIMPLE, NULL);
- g_object_set(simple,
- "card", card,
- NULL);
+ ECardSimple *simple = E_CARD_SIMPLE(gtk_type_new(e_card_simple_get_type()));
+ gtk_object_set(GTK_OBJECT(simple),
+ "card", card,
+ NULL);
return simple;
}
@@ -320,22 +319,16 @@ e_card_simple_get_vcard_assume_utf8 (ECardSimple *simple)
static void
e_card_simple_class_init (ECardSimpleClass *klass)
{
- GObjectClass *object_class;
-
- object_class = G_OBJECT_CLASS(klass);
+ GtkObjectClass *object_class;
- parent_class = g_type_class_ref (G_TYPE_OBJECT);
+ object_class = GTK_OBJECT_CLASS(klass);
- object_class->dispose = e_card_simple_dispose;
- object_class->get_property = e_card_simple_get_property;
- object_class->set_property = e_card_simple_set_property;
+ gtk_object_add_arg_type ("ECardSimple::card",
+ GTK_TYPE_OBJECT, GTK_ARG_READWRITE, ARG_CARD);
- g_object_class_install_property (object_class, PROP_CARD,
- g_param_spec_object ("card",
- _("ECard"),
- /*_( */"XXX blurb" /*)*/,
- E_TYPE_CARD,
- G_PARAM_READWRITE));
+ object_class->destroy = e_card_simple_destroy;
+ object_class->get_arg = e_card_simple_get_arg;
+ object_class->set_arg = e_card_simple_set_arg;
}
/*
@@ -343,103 +336,73 @@ e_card_simple_class_init (ECardSimpleClass *klass)
*/
static void
-e_card_simple_dispose (GObject *object)
+e_card_simple_destroy (GtkObject *object)
{
ECardSimple *simple;
int i;
simple = E_CARD_SIMPLE (object);
- if (simple->card) {
- g_object_unref(simple->card);
- simple->card = NULL;
- }
- if (simple->temp_fields) {
- g_list_foreach(simple->temp_fields, (GFunc) g_free, NULL);
- g_list_free(simple->temp_fields);
- simple->temp_fields = NULL;
- }
-
- for(i = 0; i < E_CARD_SIMPLE_PHONE_ID_LAST; i++) {
- if (simple->phone[i]) {
- e_card_phone_unref (simple->phone[i]);
- simple->phone[i] = NULL;
- }
- }
- for(i = 0; i < E_CARD_SIMPLE_EMAIL_ID_LAST; i++) {
- if (simple->email[i]) {
- g_free(simple->email[i]);
- simple->email[i] = NULL;
- }
- }
- for(i = 0; i < E_CARD_SIMPLE_ADDRESS_ID_LAST; i++) {
- if (simple->address[i]) {
- e_card_address_label_unref(simple->address[i]);
- simple->address[i] = NULL;
- }
- }
- for(i = 0; i < E_CARD_SIMPLE_ADDRESS_ID_LAST; i++) {
- if (simple->delivery[i]) {
- e_card_delivery_address_unref(simple->delivery[i]);
- simple->delivery[i] = NULL;
- }
- }
+ if (simple->card)
+ gtk_object_unref(GTK_OBJECT(simple->card));
+ g_list_foreach(simple->temp_fields, (GFunc) g_free, NULL);
+ g_list_free(simple->temp_fields);
+ simple->temp_fields = NULL;
- if (G_OBJECT_CLASS (parent_class)->dispose)
- G_OBJECT_CLASS (parent_class)->dispose (object);
+ for(i = 0; i < E_CARD_SIMPLE_PHONE_ID_LAST; i++)
+ e_card_phone_unref (simple->phone[i]);
+ for(i = 0; i < E_CARD_SIMPLE_EMAIL_ID_LAST; i++)
+ g_free(simple->email[i]);
+ for(i = 0; i < E_CARD_SIMPLE_ADDRESS_ID_LAST; i++)
+ e_card_address_label_unref(simple->address[i]);
+ for(i = 0; i < E_CARD_SIMPLE_ADDRESS_ID_LAST; i++)
+ e_card_delivery_address_unref(simple->delivery[i]);
}
/* Set_arg handler for the simple */
static void
-e_card_simple_set_property (GObject *object,
- guint prop_id,
- const GValue *value,
- GParamSpec *pspec)
+e_card_simple_set_arg (GtkObject *object, GtkArg *arg, guint arg_id)
{
ECardSimple *simple;
simple = E_CARD_SIMPLE (object);
- switch (prop_id) {
- case PROP_CARD:
+ switch (arg_id) {
+ case ARG_CARD:
if (simple->card)
- g_object_unref(simple->card);
+ gtk_object_unref(GTK_OBJECT(simple->card));
g_list_foreach(simple->temp_fields, (GFunc) g_free, NULL);
g_list_free(simple->temp_fields);
simple->temp_fields = NULL;
- if (g_value_get_object (value))
- simple->card = E_CARD(g_value_get_object (value));
+ if (GTK_VALUE_OBJECT(*arg))
+ simple->card = E_CARD(GTK_VALUE_OBJECT(*arg));
else
simple->card = NULL;
if(simple->card)
- g_object_ref(simple->card);
+ gtk_object_ref(GTK_OBJECT(simple->card));
fill_in_info(simple);
break;
default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
- break;
+ return;
}
}
/* Get_arg handler for the simple */
static void
-e_card_simple_get_property (GObject *object,
- guint prop_id,
- GValue *value,
- GParamSpec *pspec)
+e_card_simple_get_arg (GtkObject *object, GtkArg *arg, guint arg_id)
{
ECardSimple *simple;
simple = E_CARD_SIMPLE (object);
- switch (prop_id) {
- case PROP_CARD:
+ switch (arg_id) {
+ case ARG_CARD:
e_card_simple_sync_card(simple);
- g_value_set_object (value, simple->card);
+ GTK_VALUE_OBJECT (*arg) = (GtkObject *) simple->card;
break;
default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+ arg->type = GTK_TYPE_INVALID;
break;
}
}
@@ -481,12 +444,12 @@ fill_in_info(ECardSimple *simple)
EIterator *iterator;
- g_object_get(card,
- "address_label", &address_list,
- "address", &delivery_list,
- "phone", &phone_list,
- "email", &email_list,
- NULL);
+ gtk_object_get(GTK_OBJECT(card),
+ "address_label", &address_list,
+ "address", &delivery_list,
+ "phone", &phone_list,
+ "email", &email_list,
+ NULL);
for (i = 0; i < E_CARD_SIMPLE_PHONE_ID_LAST; i++) {
e_card_phone_unref(simple->phone[i]);
simple->phone[i] = NULL;
@@ -510,7 +473,7 @@ fill_in_info(ECardSimple *simple)
}
}
}
- g_object_unref(iterator);
+ gtk_object_unref(GTK_OBJECT(iterator));
for (i = 0; i < E_CARD_SIMPLE_EMAIL_ID_LAST; i++) {
g_free(simple->email[i]);
@@ -525,7 +488,7 @@ fill_in_info(ECardSimple *simple)
}
}
}
- g_object_unref(iterator);
+ gtk_object_unref(GTK_OBJECT(iterator));
for (i = 0; i < E_CARD_SIMPLE_ADDRESS_ID_LAST; i++) {
e_card_address_label_unref(simple->address[i]);
@@ -540,7 +503,7 @@ fill_in_info(ECardSimple *simple)
}
}
}
- g_object_unref(iterator);
+ gtk_object_unref(GTK_OBJECT(iterator));
for (i = 0; i < E_CARD_SIMPLE_ADDRESS_ID_LAST; i++) {
e_card_delivery_address_unref(simple->delivery[i]);
@@ -555,7 +518,7 @@ fill_in_info(ECardSimple *simple)
}
}
}
- g_object_unref(iterator);
+ gtk_object_unref(GTK_OBJECT(iterator));
e_card_free_empty_lists (card);
}
}
@@ -577,12 +540,12 @@ e_card_simple_sync_card(ECardSimple *simple)
EIterator *iterator;
- g_object_get(card,
- "address_label", &address_list,
- "address", &delivery_list,
- "phone", &phone_list,
- "email", &email_list,
- NULL);
+ gtk_object_get(GTK_OBJECT(card),
+ "address_label", &address_list,
+ "address", &delivery_list,
+ "phone", &phone_list,
+ "email", &email_list,
+ NULL);
for (iterator = e_list_get_iterator(phone_list); e_iterator_is_valid(iterator); e_iterator_next(iterator) ) {
int i;
@@ -622,7 +585,7 @@ e_card_simple_sync_card(ECardSimple *simple)
}
}
}
- g_object_unref(iterator);
+ gtk_object_unref(GTK_OBJECT(iterator));
for (i = 0; i < E_CARD_SIMPLE_PHONE_ID_LAST; i ++) {
if (simple->phone[i]) {
simple->phone[i]->flags = phone_correspondences[i];
@@ -648,7 +611,7 @@ e_card_simple_sync_card(ECardSimple *simple)
}
}
}
- g_object_unref(iterator);
+ gtk_object_unref(GTK_OBJECT(iterator));
for (i = 0; i < E_CARD_SIMPLE_EMAIL_ID_LAST; i ++) {
if (simple->email[i]) {
e_list_append(email_list, simple->email[i]);
@@ -677,7 +640,7 @@ e_card_simple_sync_card(ECardSimple *simple)
}
}
}
- g_object_unref(iterator);
+ gtk_object_unref(GTK_OBJECT(iterator));
for (i = 0; i < E_CARD_SIMPLE_ADDRESS_ID_LAST; i ++) {
if (simple->address[i]) {
simple->address[i]->flags &= ~E_CARD_ADDR_MASK;
@@ -708,7 +671,7 @@ e_card_simple_sync_card(ECardSimple *simple)
}
}
}
- g_object_unref(iterator);
+ gtk_object_unref(GTK_OBJECT(iterator));
for (i = 0; i < E_CARD_SIMPLE_ADDRESS_ID_LAST; i ++) {
if (simple->delivery[i]) {
simple->delivery[i]->flags &= ~E_CARD_ADDR_MASK;
@@ -783,8 +746,6 @@ void e_card_simple_set_delivery_address (ECardSimple *simple
{
e_card_delivery_address_unref(simple->delivery[id]);
simple->delivery[id] = e_card_delivery_address_ref(delivery);
- e_card_address_label_unref(simple->address[id]);
- simple->address[id] = e_card_delivery_address_to_label(simple->delivery[id]);
simple->changed = TRUE;
}
@@ -809,17 +770,17 @@ char *e_card_simple_get (ECardSimple *simple,
switch(type) {
case E_CARD_SIMPLE_INTERNAL_TYPE_STRING:
if (simple->card) {
- g_object_get(simple->card,
- field_data[field].ecard_field, &string,
- NULL);
+ gtk_object_get(GTK_OBJECT(simple->card),
+ field_data[field].ecard_field, &string,
+ NULL);
return g_strdup(string);
} else
return NULL;
case E_CARD_SIMPLE_INTERNAL_TYPE_DATE:
if (simple->card) {
- g_object_get(simple->card,
- field_data[field].ecard_field, &date,
- NULL);
+ gtk_object_get(GTK_OBJECT(simple->card),
+ field_data[field].ecard_field, &date,
+ NULL);
if (date != NULL) {
char buf[26];
struct tm then;
@@ -857,9 +818,9 @@ char *e_card_simple_get (ECardSimple *simple,
case E_CARD_SIMPLE_INTERNAL_TYPE_BOOL:
if (simple->card) {
gboolean boole;
- g_object_get (simple->card,
- field_data[field].ecard_field, &boole,
- NULL);
+ gtk_object_get (GTK_OBJECT (simple->card),
+ field_data[field].ecard_field, &boole,
+ NULL);
if (boole)
return g_strdup("true");
else
@@ -873,19 +834,19 @@ char *e_card_simple_get (ECardSimple *simple,
if (simple->card) {
gboolean is_list;
- g_object_get(simple->card,
- "file_as", &string,
- NULL);
+ gtk_object_get(GTK_OBJECT(simple->card),
+ "file_as", &string,
+ NULL);
if (string && *string)
return g_strdup(string);
- g_object_get(simple->card,
- "full_name", &string,
- NULL);
+ gtk_object_get(GTK_OBJECT(simple->card),
+ "full_name", &string,
+ NULL);
if (string && *string)
return g_strdup(string);
- g_object_get(simple->card,
- "org", &string,
- NULL);
+ gtk_object_get(GTK_OBJECT(simple->card),
+ "org", &string,
+ NULL);
if (string && *string)
return g_strdup(string);
is_list = e_card_evolution_list (simple->card);
@@ -899,33 +860,33 @@ char *e_card_simple_get (ECardSimple *simple,
return NULL;
case E_CARD_SIMPLE_FIELD_FAMILY_NAME:
if (simple->card) {
- g_object_get (simple->card,
- "name", &name,
- NULL);
+ gtk_object_get (GTK_OBJECT(simple->card),
+ "name", &name,
+ NULL);
return g_strdup (name->family);
} else
return NULL;
case E_CARD_SIMPLE_FIELD_GIVEN_NAME:
if (simple->card) {
- g_object_get (simple->card,
- "name", &name,
- NULL);
+ gtk_object_get (GTK_OBJECT(simple->card),
+ "name", &name,
+ NULL);
return g_strdup (name->given);
} else
return NULL;
case E_CARD_SIMPLE_FIELD_ADDITIONAL_NAME:
if (simple->card) {
- g_object_get (simple->card,
- "name", &name,
- NULL);
+ gtk_object_get (GTK_OBJECT(simple->card),
+ "name", &name,
+ NULL);
return g_strdup (name->additional);
} else
return NULL;
case E_CARD_SIMPLE_FIELD_NAME_SUFFIX:
if (simple->card) {
- g_object_get (simple->card,
- "name", &name,
- NULL);
+ gtk_object_get (GTK_OBJECT(simple->card),
+ "name", &name,
+ NULL);
return g_strdup (name->suffix);
} else
return NULL;
@@ -1001,9 +962,9 @@ file_as_get_style (ECardSimple *simple)
if (!company)
company = g_strdup("");
if (filestring) {
- g_object_get (simple->card,
- "name", &name,
- NULL);
+ gtk_object_get (GTK_OBJECT (simple->card),
+ "name", &name,
+ NULL);
if (!name) {
goto end;
@@ -1039,9 +1000,9 @@ file_as_set_style(ECardSimple *simple, int style)
if (!company)
company = g_strdup("");
- g_object_get (simple->card,
- "name", &name,
- NULL);
+ gtk_object_get (GTK_OBJECT (simple->card),
+ "name", &name,
+ NULL);
if (name) {
string = name_to_style(name, company, style);
e_card_simple_set(simple, E_CARD_SIMPLE_FIELD_FILE_AS, string);
@@ -1064,17 +1025,17 @@ void e_card_simple_set (ECardSimple *simple,
case E_CARD_SIMPLE_FIELD_FULL_NAME:
case E_CARD_SIMPLE_FIELD_ORG:
style = file_as_get_style(simple);
- g_object_set(simple->card,
- field_data[field].ecard_field, data,
- NULL);
+ gtk_object_set(GTK_OBJECT(simple->card),
+ field_data[field].ecard_field, data,
+ NULL);
file_as_set_style(simple, style);
break;
default:
switch(type) {
case E_CARD_SIMPLE_INTERNAL_TYPE_STRING:
- g_object_set(simple->card,
- field_data[field].ecard_field, data,
- NULL);
+ gtk_object_set(GTK_OBJECT(simple->card),
+ field_data[field].ecard_field, data,
+ NULL);
break;
case E_CARD_SIMPLE_INTERNAL_TYPE_DATE:
break; /* FIXME!!!! */
@@ -1108,9 +1069,9 @@ void e_card_simple_set (ECardSimple *simple,
boole = FALSE;
else if (!strcasecmp (data, "false"))
boole = FALSE;
- g_object_set (simple->card,
- field_data[field].ecard_field, boole,
- NULL);
+ gtk_object_set (GTK_OBJECT (simple->card),
+ field_data[field].ecard_field, boole,
+ NULL);
}
break;
}
@@ -1150,7 +1111,7 @@ const char *e_card_simple_get_ecard_field (ECardSimple *simple,
const char *e_card_simple_get_name (ECardSimple *simple,
ECardSimpleField field)
{
- return _(field_data[field].name);
+ return U_(field_data[field].name);
}
gboolean
@@ -1181,7 +1142,7 @@ e_card_simple_get_allow_newlines (ECardSimple *simple,
const char *e_card_simple_get_short_name (ECardSimple *simple,
ECardSimpleField field)
{
- return _(field_data[field].short_name);
+ return U_(field_data[field].short_name);
}
void e_card_simple_arbitrary_foreach (ECardSimple *simple,
@@ -1191,9 +1152,9 @@ void e_card_simple_arbitrary_foreach (ECardSimple
if (simple->card) {
EList *list;
EIterator *iterator;
- g_object_get(simple->card,
- "arbitrary", &list,
- NULL);
+ gtk_object_get(GTK_OBJECT(simple->card),
+ "arbitrary", &list,
+ NULL);
for (iterator = e_list_get_iterator(list); e_iterator_is_valid(iterator); e_iterator_next(iterator)) {
const ECardArbitrary *arbitrary = e_iterator_get(iterator);
if (callback)
@@ -1209,9 +1170,9 @@ const ECardArbitrary *e_card_simple_get_arbitrary (ECardSimple *sim
if (simple->card) {
EList *list;
EIterator *iterator;
- g_object_get(simple->card,
- "arbitrary", &list,
- NULL);
+ gtk_object_get(GTK_OBJECT(simple->card),
+ "arbitrary", &list,
+ NULL);
for (iterator = e_list_get_iterator(list); e_iterator_is_valid(iterator); e_iterator_next(iterator)) {
const ECardArbitrary *arbitrary = e_iterator_get(iterator);
if (!strcasecmp(arbitrary->key, key))
@@ -1234,9 +1195,9 @@ void e_card_simple_set_arbitrary (ECardSimple *sim
EIterator *iterator;
simple->changed = TRUE;
- g_object_get(simple->card,
- "arbitrary", &list,
- NULL);
+ gtk_object_get(GTK_OBJECT(simple->card),
+ "arbitrary", &list,
+ NULL);
for (iterator = e_list_get_iterator(list); e_iterator_is_valid(iterator); e_iterator_next(iterator)) {
const ECardArbitrary *arbitrary = e_iterator_get(iterator);
if (!strcasecmp(arbitrary->key, key)) {
@@ -1263,9 +1224,9 @@ e_card_simple_set_name (ECardSimple *simple, ECardName *name)
{
int style;
style = file_as_get_style(simple);
- g_object_set (simple->card,
- "name", name,
- NULL);
+ gtk_object_set (GTK_OBJECT (simple->card),
+ "name", name,
+ NULL);
file_as_set_style(simple, style);
}
diff --git a/addressbook/backend/ebook/e-card-simple.h b/addressbook/backend/ebook/e-card-simple.h
index 868d4e1573..b2b5147f3d 100644
--- a/addressbook/backend/ebook/e-card-simple.h
+++ b/addressbook/backend/ebook/e-card-simple.h
@@ -13,18 +13,17 @@
#define __E_CARD_SIMPLE_H__
#include <time.h>
-#include <glib-object.h>
+#include <gtk/gtk.h>
#include <stdio.h>
#include <ebook/e-card.h>
#include <ebook/e-card-types.h>
#include <e-util/e-list.h>
#define E_TYPE_CARD_SIMPLE (e_card_simple_get_type ())
-#define E_CARD_SIMPLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), E_TYPE_CARD_SIMPLE, ECardSimple))
-#define E_CARD_SIMPLE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), E_TYPE_CARD_SIMPLE, ECardSimpleClass))
-#define E_IS_CARD_SIMPLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), E_TYPE_CARD_SIMPLE))
-#define E_IS_CARD_SIMPLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), E_TYPE_CARD_SIMPLE))
-#define E_CARD_SIMPLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), E_TYPE_CARD_SIMPLE, ECardSimpleClass))
+#define E_CARD_SIMPLE(obj) (GTK_CHECK_CAST ((obj), E_TYPE_CARD_SIMPLE, ECardSimple))
+#define E_CARD_SIMPLE_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), E_TYPE_CARD_SIMPLE, ECardSimpleClass))
+#define E_IS_CARD_SIMPLE(obj) (GTK_CHECK_TYPE ((obj), E_TYPE_CARD_SIMPLE))
+#define E_IS_CARD_SIMPLE_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), E_TYPE_CARD_SIMPLE))
typedef enum _ECardSimplePhoneId ECardSimplePhoneId;
typedef enum _ECardSimpleEmailId ECardSimpleEmailId;
@@ -139,7 +138,7 @@ typedef struct _ECardSimple ECardSimple;
typedef struct _ECardSimpleClass ECardSimpleClass;
struct _ECardSimple {
- GObject object;
+ GtkObject object;
ECard *card;
GList *temp_fields;
@@ -153,7 +152,7 @@ struct _ECardSimple {
};
struct _ECardSimpleClass {
- GObjectClass parent_class;
+ GtkObjectClass parent_class;
};
typedef void (*ECardSimpleArbitraryCallback) (const ECardArbitrary *arbitrary, gpointer closure);
@@ -227,7 +226,8 @@ ECardSimpleField e_card_simple_map_phone_to_field (ECardSimplePho
ECardSimpleField e_card_simple_map_email_to_field (ECardSimpleEmailId email_id);
ECardSimpleField e_card_simple_map_address_to_field (ECardSimpleAddressId address_id);
-GType e_card_simple_get_type (void);
+/* Standard Gtk function */
+GtkType e_card_simple_get_type (void);
#endif /* ! __E_CARD_SIMPLE_H__ */
diff --git a/addressbook/backend/ebook/e-card.c b/addressbook/backend/ebook/e-card.c
index 945888dad7..9c77ab6a4b 100644
--- a/addressbook/backend/ebook/e-card.c
+++ b/addressbook/backend/ebook/e-card.c
@@ -12,6 +12,7 @@
#include "e-card.h"
+#include <gal/util/e-i18n.h>
#include <gal/widgets/e-unicode.h>
#include <ctype.h>
@@ -21,13 +22,15 @@
#include <time.h>
#include <math.h>
-#include <bonobo/bonobo-i18n.h>
+#include <gtk/gtkobject.h>
+#include <bonobo/bonobo-object-client.h>
#include <gal/util/e-util.h>
#include <libversit/vcc.h>
#include "e-util/ename/e-name-western.h"
#include "e-util/ename/e-address-western.h"
#include "e-book.h"
+#include "e-destination.h"
#define is_a_prop_of(obj,prop) (isAPropertyOf ((obj),(prop)))
#define str_val(obj) (the_str = (vObjectValueType (obj))? fakeCString (vObjectUStringZValue (obj)) : calloc (1, 1))
@@ -39,55 +42,53 @@
#define XEV_LIST_SHOW_ADDRESSES "X-EVOLUTION-LIST-SHOW_ADDRESSES"
#define XEV_RELATED_CONTACTS "X-EVOLUTION-RELATED_CONTACTS"
-/* Object property IDs */
+/* Object argument IDs */
enum {
- PROP_0,
- PROP_FILE_AS,
- PROP_FULL_NAME,
- PROP_NAME,
- PROP_ADDRESS,
- PROP_ADDRESS_LABEL,
- PROP_PHONE,
- PROP_EMAIL,
- PROP_BIRTH_DATE,
- PROP_URL,
- PROP_ORG,
- PROP_ORG_UNIT,
- PROP_OFFICE,
- PROP_TITLE,
- PROP_ROLE,
- PROP_MANAGER,
- PROP_ASSISTANT,
- PROP_NICKNAME,
- PROP_SPOUSE,
- PROP_ANNIVERSARY,
- PROP_MAILER,
- PROP_CALURI,
- PROP_FBURL,
- PROP_ICSCALENDAR,
- PROP_NOTE,
- PROP_RELATED_CONTACTS,
- PROP_CATEGORIES,
- PROP_CATEGORY_LIST,
- PROP_WANTS_HTML,
- PROP_WANTS_HTML_SET,
- PROP_EVOLUTION_LIST,
- PROP_EVOLUTION_LIST_SHOW_ADDRESSES,
- PROP_ARBITRARY,
- PROP_ID,
- PROP_LAST_USE,
- PROP_USE_SCORE,
+ ARG_0,
+ ARG_FILE_AS,
+ ARG_FULL_NAME,
+ ARG_NAME,
+ ARG_ADDRESS,
+ ARG_ADDRESS_LABEL,
+ ARG_PHONE,
+ ARG_EMAIL,
+ ARG_BIRTH_DATE,
+ ARG_URL,
+ ARG_ORG,
+ ARG_ORG_UNIT,
+ ARG_OFFICE,
+ ARG_TITLE,
+ ARG_ROLE,
+ ARG_MANAGER,
+ ARG_ASSISTANT,
+ ARG_NICKNAME,
+ ARG_SPOUSE,
+ ARG_ANNIVERSARY,
+ ARG_MAILER,
+ ARG_CALURI,
+ ARG_FBURL,
+ ARG_ICSCALENDAR,
+ ARG_NOTE,
+ ARG_RELATED_CONTACTS,
+ ARG_CATEGORIES,
+ ARG_CATEGORY_LIST,
+ ARG_WANTS_HTML,
+ ARG_WANTS_HTML_SET,
+ ARG_EVOLUTION_LIST,
+ ARG_EVOLUTION_LIST_SHOW_ADDRESSES,
+ ARG_ARBITRARY,
+ ARG_ID,
+ ARG_LAST_USE,
+ ARG_USE_SCORE,
};
-static GObjectClass *parent_class;
-
static void parse(ECard *card, VObject *vobj, char *default_charset);
static void e_card_init (ECard *card);
static void e_card_class_init (ECardClass *klass);
-static void e_card_dispose (GObject *object);
-static void e_card_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec);
-static void e_card_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec);
+static void e_card_destroy (GtkObject *object);
+static void e_card_set_arg (GtkObject *object, GtkArg *arg, guint arg_id);
+static void e_card_get_arg (GtkObject *object, GtkArg *arg, guint arg_id);
static void assign_string(VObject *vobj, char *default_charset, char **string);
@@ -182,25 +183,24 @@ struct {
*
* Return value: The type ID of the &ECard class.
**/
-GType
+GtkType
e_card_get_type (void)
{
- static GType card_type = 0;
+ static GtkType card_type = 0;
if (!card_type) {
- static const GTypeInfo card_info = {
- sizeof (ECardClass),
- NULL, /* base_init */
- NULL, /* base_finalize */
- (GClassInitFunc) e_card_class_init,
- NULL, /* class_finalize */
- NULL, /* class_data */
+ GtkTypeInfo card_info = {
+ "ECard",
sizeof (ECard),
- 0, /* n_preallocs */
- (GInstanceInitFunc) e_card_init,
+ sizeof (ECardClass),
+ (GtkClassInitFunc) e_card_class_init,
+ (GtkObjectInitFunc) e_card_init,
+ NULL, /* reserved_1 */
+ NULL, /* reserved_2 */
+ (GtkClassInitFunc) NULL
};
- card_type = g_type_register_static (G_TYPE_OBJECT, "ECard", &card_info, 0);
+ card_type = gtk_type_unique (gtk_object_get_type (), &card_info);
}
return card_type;
@@ -209,7 +209,7 @@ e_card_get_type (void)
ECard *
e_card_new_with_default_charset (char *vcard, char *default_charset)
{
- ECard *card = g_object_new (E_TYPE_CARD, NULL);
+ ECard *card = E_CARD(gtk_type_new(e_card_get_type()));
VObject *vobj = Parse_MIME(vcard, strlen(vcard));
while(vobj) {
VObject *next;
@@ -248,7 +248,7 @@ e_card_duplicate(ECard *card)
if (card->book) {
new_card->book = card->book;
- g_object_ref (new_card->book);
+ gtk_object_ref (GTK_OBJECT (new_card->book));
}
return new_card;
@@ -282,7 +282,7 @@ e_card_get_use_score(ECard *card)
e_card_get_today (&today);
g_date_set_dmy (&last_use, card->last_use->day, card->last_use->month, card->last_use->year);
- days_since_last_use = g_date_get_julian (&today) - g_date_get_julian (&last_use);
+ days_since_last_use = g_date_julian (&today) - g_date_julian (&last_use);
/* Apply a seven-day "grace period" to the use score decay. */
days_since_last_use -= 7;
@@ -306,9 +306,9 @@ e_card_touch(ECard *card)
if (card->last_use == NULL)
card->last_use = g_new (ECardDate, 1);
- card->last_use->day = g_date_get_day (&today);
- card->last_use->month = g_date_get_month (&today);
- card->last_use->year = g_date_get_year (&today);
+ card->last_use->day = g_date_day (&today);
+ card->last_use->month = g_date_month (&today);
+ card->last_use->year = g_date_year (&today);
card->raw_use_score = use_score + 1.0;
}
@@ -360,10 +360,10 @@ e_card_set_book (ECard *card, EBook *book)
g_return_if_fail (card && E_IS_CARD (card));
if (card->book)
- g_object_unref (card->book);
+ gtk_object_unref (GTK_OBJECT (card->book));
card->book = book;
if (card->book)
- g_object_ref (card->book);
+ gtk_object_ref (GTK_OBJECT (card->book));
}
gchar *
@@ -543,7 +543,7 @@ e_card_get_vobject (const ECard *card, gboolean assumeUTF8)
if (!(is_ascii || assumeUTF8))
addPropValue (addressprop, "CHARSET", "UTF-8");
}
- g_object_unref(iterator);
+ gtk_object_unref(GTK_OBJECT(iterator));
}
if ( card->address_label ) {
@@ -558,7 +558,7 @@ e_card_get_vobject (const ECard *card, gboolean assumeUTF8)
set_address_flags (labelprop, address_label->flags);
}
- g_object_unref(iterator);
+ gtk_object_unref(GTK_OBJECT(iterator));
}
if ( card->phone ) {
@@ -570,7 +570,7 @@ e_card_get_vobject (const ECard *card, gboolean assumeUTF8)
set_phone_flags (phoneprop, phone->flags);
}
- g_object_unref(iterator);
+ gtk_object_unref(GTK_OBJECT(iterator));
}
if ( card->email ) {
@@ -580,7 +580,7 @@ e_card_get_vobject (const ECard *card, gboolean assumeUTF8)
emailprop = ADD_PROP_VALUE(vobj, VCEmailAddressProp, (char *) e_iterator_get(iterator));
addProp (emailprop, VCInternetProp);
}
- g_object_unref(iterator);
+ gtk_object_unref(GTK_OBJECT(iterator));
}
if ( card->bday ) {
@@ -834,9 +834,9 @@ parse_email(ECard *card, VObject *vobj, char *default_charset)
EList *list;
assign_string(vobj, default_charset, &next_email);
- g_object_get(card,
- "email", &list,
- NULL);
+ gtk_object_get(GTK_OBJECT(card),
+ "email", &list,
+ NULL);
e_list_append(list, next_email);
g_free (next_email);
}
@@ -864,9 +864,9 @@ parse_phone(ECard *card, VObject *vobj, char *default_charset)
assign_string(vobj, default_charset, &(next_phone->number));
next_phone->flags = get_phone_flags(vobj);
- g_object_get(card,
- "phone", &list,
- NULL);
+ gtk_object_get(GTK_OBJECT(card),
+ "phone", &list,
+ NULL);
e_list_append(list, next_phone);
e_card_phone_unref (next_phone);
}
@@ -886,9 +886,9 @@ parse_address(ECard *card, VObject *vobj, char *default_charset)
next_addr->code = e_v_object_get_child_value (vobj, VCPostalCodeProp, default_charset);
next_addr->country = e_v_object_get_child_value (vobj, VCCountryNameProp, default_charset);
- g_object_get(card,
- "address", &list,
- NULL);
+ gtk_object_get(GTK_OBJECT(card),
+ "address", &list,
+ NULL);
e_list_append(list, next_addr);
e_card_delivery_address_unref (next_addr);
}
@@ -902,9 +902,9 @@ parse_address_label(ECard *card, VObject *vobj, char *default_charset)
next_addr->flags = get_address_flags (vobj);
assign_string(vobj, default_charset, &next_addr->data);
- g_object_get(card,
- "address_label", &list,
- NULL);
+ gtk_object_get(GTK_OBJECT(card),
+ "address_label", &list,
+ NULL);
e_list_append(list, next_addr);
e_card_address_label_unref (next_addr);
}
@@ -1063,7 +1063,7 @@ add_list_unique(ECard *card, EList *list, char *string)
e_list_append(list, temp);
}
g_free(temp);
- g_object_unref(iterator);
+ gtk_object_unref(GTK_OBJECT(iterator));
}
static void
@@ -1073,9 +1073,9 @@ do_parse_categories(ECard *card, char *str)
char *copy = g_new(char, length + 1);
int i, j;
EList *list;
- g_object_get(card,
- "category_list", &list,
- NULL);
+ gtk_object_get(GTK_OBJECT(card),
+ "category_list", &list,
+ NULL);
for (i = 0, j = 0; str[i]; i++, j++) {
switch (str[i]) {
case '\\':
@@ -1198,9 +1198,9 @@ parse_arbitrary(ECard *card, VObject *vobj, char *default_charset)
assign_string(vobj, default_charset, &(arbitrary->value));
- g_object_get(card,
- "arbitrary", &list,
- NULL);
+ gtk_object_get(GTK_OBJECT(card),
+ "arbitrary", &list,
+ NULL);
e_list_append(list, arbitrary);
e_card_arbitrary_unref(arbitrary);
}
@@ -1242,7 +1242,7 @@ parse_use_score(ECard *card, VObject *vobj, char *default_charset)
static void
parse_attribute(ECard *card, VObject *vobj, char *default_charset)
{
- ParsePropertyFunc function = g_hash_table_lookup(E_CARD_GET_CLASS(card)->attribute_jump_table, vObjectName(vobj));
+ ParsePropertyFunc function = g_hash_table_lookup(E_CARD_CLASS(GTK_OBJECT(card)->klass)->attribute_jump_table, vObjectName(vobj));
if ( function )
function(card, vobj, default_charset);
}
@@ -1280,11 +1280,9 @@ static void
e_card_class_init (ECardClass *klass)
{
int i;
- GObjectClass *object_class;
+ GtkObjectClass *object_class;
- object_class = G_OBJECT_CLASS(klass);
-
- parent_class = g_type_class_ref (G_TYPE_OBJECT);
+ object_class = GTK_OBJECT_CLASS(klass);
klass->attribute_jump_table = g_hash_table_new(g_str_hash, g_str_equal);
@@ -1292,257 +1290,81 @@ e_card_class_init (ECardClass *klass)
g_hash_table_insert(klass->attribute_jump_table, attribute_jump_array[i].key, attribute_jump_array[i].function);
}
- object_class->dispose = e_card_dispose;
- object_class->get_property = e_card_get_property;
- object_class->set_property = e_card_set_property;
-
- g_object_class_install_property (object_class, PROP_FILE_AS,
- g_param_spec_string ("file_as",
- _("File As"),
- /*_( */"XXX blurb" /*)*/,
- NULL,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_FULL_NAME,
- g_param_spec_string ("full_name",
- _("Full Name"),
- /*_( */"XXX blurb" /*)*/,
- NULL,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_NAME,
- g_param_spec_pointer ("name",
- _("Name"),
- /*_( */"XXX blurb" /*)*/,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_ADDRESS,
- g_param_spec_object ("address",
- _("Address"),
- /*_( */"XXX blurb" /*)*/,
- E_TYPE_LIST,
- G_PARAM_READABLE));
-
- g_object_class_install_property (object_class, PROP_ADDRESS_LABEL,
- g_param_spec_object ("address_label",
- _("Address Label"),
- /*_( */"XXX blurb" /*)*/,
- E_TYPE_LIST,
- G_PARAM_READABLE));
-
- g_object_class_install_property (object_class, PROP_PHONE,
- g_param_spec_object ("phone",
- _("Phone"),
- /*_( */"XXX blurb" /*)*/,
- E_TYPE_LIST,
- G_PARAM_READABLE));
-
- g_object_class_install_property (object_class, PROP_EMAIL,
- g_param_spec_object ("email",
- _("Email"),
- /*_( */"XXX blurb" /*)*/,
- E_TYPE_LIST,
- G_PARAM_READABLE));
-
- g_object_class_install_property (object_class, PROP_BIRTH_DATE,
- g_param_spec_pointer ("birth_date",
- _("Birth date"),
- /*_( */"XXX blurb" /*)*/,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_URL,
- g_param_spec_string ("url",
- _("URL"),
- /*_( */"XXX blurb" /*)*/,
- NULL,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_ORG,
- g_param_spec_string ("org",
- _("Organization"),
- /*_( */"XXX blurb" /*)*/,
- NULL,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_ORG_UNIT,
- g_param_spec_string ("org_unit",
- _("Organizational Unit"),
- /*_( */"XXX blurb" /*)*/,
- NULL,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_OFFICE,
- g_param_spec_string ("office",
- _("Office"),
- /*_( */"XXX blurb" /*)*/,
- NULL,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_TITLE,
- g_param_spec_string ("title",
- _("Title"),
- /*_( */"XXX blurb" /*)*/,
- NULL,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_ROLE,
- g_param_spec_string ("role",
- _("Role"),
- /*_( */"XXX blurb" /*)*/,
- NULL,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_MANAGER,
- g_param_spec_string ("manager",
- _("Manager"),
- /*_( */"XXX blurb" /*)*/,
- NULL,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_ASSISTANT,
- g_param_spec_string ("assistant",
- _("Assistant"),
- /*_( */"XXX blurb" /*)*/,
- NULL,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_NICKNAME,
- g_param_spec_string ("nickname",
- _("Nickname"),
- /*_( */"XXX blurb" /*)*/,
- NULL,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_SPOUSE,
- g_param_spec_string ("spouse",
- _("Spouse"),
- /*_( */"XXX blurb" /*)*/,
- NULL,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_ANNIVERSARY,
- g_param_spec_pointer ("anniversary",
- _("Anniversary"),
- /*_( */"XXX blurb" /*)*/,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_MAILER,
- g_param_spec_string ("mailer",
- _("Mailer"),
- /*_( */"XXX blurb" /*)*/,
- NULL,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_CALURI,
- g_param_spec_string ("caluri",
- _("Calendar URI"),
- /*_( */"XXX blurb" /*)*/,
- NULL,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_FBURL,
- g_param_spec_string ("fburl",
- _("Free/Busy URL"),
- /*_( */"XXX blurb" /*)*/,
- NULL,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_ICSCALENDAR,
- g_param_spec_string ("icscalendar",
- _("ICS Calendar"),
- /*_( */"XXX blurb" /*)*/,
- NULL,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_NOTE,
- g_param_spec_string ("note",
- _("Note"),
- /*_( */"XXX blurb" /*)*/,
- NULL,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_RELATED_CONTACTS,
- g_param_spec_string ("related_contacts",
- _("Related Contacts"),
- /*_( */"XXX blurb" /*)*/,
- NULL,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_CATEGORIES,
- g_param_spec_string ("categories",
- _("Categories"),
- /*_( */"XXX blurb" /*)*/,
- NULL,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_CATEGORY_LIST,
- g_param_spec_object ("category list",
- _("Category List"),
- /*_( */"XXX blurb" /*)*/,
- E_TYPE_LIST,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_WANTS_HTML,
- g_param_spec_boolean ("wants_html",
- _("Wants HTML"),
- /*_( */"XXX blurb" /*)*/,
- FALSE,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_WANTS_HTML_SET,
- g_param_spec_boolean ("wants_html_set",
- _("Wants HTML set"),
- /*_( */"XXX blurb" /*)*/,
- FALSE,
- G_PARAM_READABLE));
-
- g_object_class_install_property (object_class, PROP_EVOLUTION_LIST,
- g_param_spec_boolean ("list",
- _("List"),
- /*_( */"XXX blurb" /*)*/,
- FALSE,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_EVOLUTION_LIST_SHOW_ADDRESSES,
- g_param_spec_boolean ("list_show_addresses",
- _("List Show Addresses"),
- /*_( */"XXX blurb" /*)*/,
- FALSE,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_ARBITRARY,
- g_param_spec_object ("arbitrary",
- _("Arbitrary"),
- /*_( */"XXX blurb" /*)*/,
- E_TYPE_LIST,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_ID,
- g_param_spec_string ("id",
- _("ID"),
- /*_( */"XXX blurb" /*)*/,
- NULL,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_LAST_USE,
- g_param_spec_pointer ("last_use",
- _("Last Use"),
- /*_( */"XXX blurb" /*)*/,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_USE_SCORE,
- /* XXX at some point we
- should remove
- LAX_VALIDATION and figure
- out some hard min & max
- scores. */
- g_param_spec_float ("use_score",
- _("Use Score"),
- /*_( */"XXX blurb" /*)*/,
- 0.0,
- 0.0,
- 0.0,
- G_PARAM_READWRITE | G_PARAM_LAX_VALIDATION));
+ gtk_object_add_arg_type ("ECard::file_as",
+ GTK_TYPE_STRING, GTK_ARG_READWRITE, ARG_FILE_AS);
+ gtk_object_add_arg_type ("ECard::full_name",
+ GTK_TYPE_STRING, GTK_ARG_READWRITE, ARG_FULL_NAME);
+ gtk_object_add_arg_type ("ECard::name",
+ GTK_TYPE_POINTER, GTK_ARG_READWRITE, ARG_NAME);
+ gtk_object_add_arg_type ("ECard::address",
+ GTK_TYPE_OBJECT, GTK_ARG_READABLE, ARG_ADDRESS);
+ gtk_object_add_arg_type ("ECard::address_label",
+ GTK_TYPE_OBJECT, GTK_ARG_READABLE, ARG_ADDRESS_LABEL);
+ gtk_object_add_arg_type ("ECard::phone",
+ GTK_TYPE_OBJECT, GTK_ARG_READABLE, ARG_PHONE);
+ gtk_object_add_arg_type ("ECard::email",
+ GTK_TYPE_OBJECT, GTK_ARG_READABLE, ARG_EMAIL);
+ gtk_object_add_arg_type ("ECard::birth_date",
+ GTK_TYPE_POINTER, GTK_ARG_READWRITE, ARG_BIRTH_DATE);
+ gtk_object_add_arg_type ("ECard::url",
+ GTK_TYPE_STRING, GTK_ARG_READWRITE, ARG_URL);
+ gtk_object_add_arg_type ("ECard::org",
+ GTK_TYPE_STRING, GTK_ARG_READWRITE, ARG_ORG);
+ gtk_object_add_arg_type ("ECard::org_unit",
+ GTK_TYPE_STRING, GTK_ARG_READWRITE, ARG_ORG_UNIT);
+ gtk_object_add_arg_type ("ECard::office",
+ GTK_TYPE_STRING, GTK_ARG_READWRITE, ARG_OFFICE);
+ gtk_object_add_arg_type ("ECard::title",
+ GTK_TYPE_STRING, GTK_ARG_READWRITE, ARG_TITLE);
+ gtk_object_add_arg_type ("ECard::role",
+ GTK_TYPE_STRING, GTK_ARG_READWRITE, ARG_ROLE);
+ gtk_object_add_arg_type ("ECard::manager",
+ GTK_TYPE_STRING, GTK_ARG_READWRITE, ARG_MANAGER);
+ gtk_object_add_arg_type ("ECard::assistant",
+ GTK_TYPE_STRING, GTK_ARG_READWRITE, ARG_ASSISTANT);
+ gtk_object_add_arg_type ("ECard::nickname",
+ GTK_TYPE_STRING, GTK_ARG_READWRITE, ARG_NICKNAME);
+ gtk_object_add_arg_type ("ECard::spouse",
+ GTK_TYPE_STRING, GTK_ARG_READWRITE, ARG_SPOUSE);
+ gtk_object_add_arg_type ("ECard::anniversary",
+ GTK_TYPE_POINTER, GTK_ARG_READWRITE, ARG_ANNIVERSARY);
+ gtk_object_add_arg_type ("ECard::mailer",
+ GTK_TYPE_STRING, GTK_ARG_READWRITE, ARG_MAILER);
+ gtk_object_add_arg_type ("ECard::caluri",
+ GTK_TYPE_STRING, GTK_ARG_READWRITE, ARG_CALURI);
+ gtk_object_add_arg_type ("ECard::fburl",
+ GTK_TYPE_STRING, GTK_ARG_READWRITE, ARG_FBURL);
+ gtk_object_add_arg_type ("ECard::icscalendar",
+ GTK_TYPE_STRING, GTK_ARG_READWRITE, ARG_ICSCALENDAR);
+ gtk_object_add_arg_type ("ECard::note",
+ GTK_TYPE_STRING, GTK_ARG_READWRITE, ARG_NOTE);
+ gtk_object_add_arg_type ("ECard::related_contacts",
+ GTK_TYPE_STRING, GTK_ARG_READWRITE, ARG_RELATED_CONTACTS);
+ gtk_object_add_arg_type ("ECard::categories",
+ GTK_TYPE_STRING, GTK_ARG_READWRITE, ARG_CATEGORIES);
+ gtk_object_add_arg_type ("ECard::category_list",
+ GTK_TYPE_OBJECT, GTK_ARG_READWRITE, ARG_CATEGORY_LIST);
+ gtk_object_add_arg_type ("ECard::wants_html",
+ GTK_TYPE_BOOL, GTK_ARG_READWRITE, ARG_WANTS_HTML);
+ gtk_object_add_arg_type ("ECard::wants_html_set",
+ GTK_TYPE_BOOL, GTK_ARG_READABLE, ARG_WANTS_HTML);
+ gtk_object_add_arg_type ("ECard::list",
+ GTK_TYPE_BOOL, GTK_ARG_READWRITE, ARG_EVOLUTION_LIST);
+ gtk_object_add_arg_type ("ECard::list_show_addresses",
+ GTK_TYPE_BOOL, GTK_ARG_READWRITE, ARG_EVOLUTION_LIST_SHOW_ADDRESSES);
+ gtk_object_add_arg_type ("ECard::arbitrary",
+ GTK_TYPE_OBJECT, GTK_ARG_READWRITE, ARG_ARBITRARY);
+ gtk_object_add_arg_type ("ECard::id",
+ GTK_TYPE_STRING, GTK_ARG_READWRITE, ARG_ID);
+ gtk_object_add_arg_type ("ECard::last_use",
+ GTK_TYPE_POINTER, GTK_ARG_READWRITE, ARG_LAST_USE);
+ gtk_object_add_arg_type ("ECard::use_score",
+ GTK_TYPE_FLOAT, GTK_ARG_READWRITE, ARG_USE_SCORE);
+
+
+ object_class->destroy = e_card_destroy;
+ object_class->get_arg = e_card_get_arg;
+ object_class->set_arg = e_card_set_arg;
}
ECardPhone *
@@ -1936,7 +1758,7 @@ e_card_email_match_single_string (const gchar *a, const gchar *b)
for (xa=a; *xa && *xa != '@'; ++xa);
for (xb=b; *xb && *xb != '@'; ++xb);
- if (xa-a != xb-b || *xa != *xb || g_ascii_strncasecmp (a, b, xa-a))
+ if (xa-a != xb-b || *xa != *xb || g_strncasecmp (a, b, xa-a))
return FALSE;
if (*xa == '\0')
@@ -1977,7 +1799,7 @@ e_card_email_match_string (const ECard *card, const gchar *str)
if (e_card_email_match_single_string (e_iterator_get (iter), str))
return TRUE;
}
- g_object_unref (iter);
+ gtk_object_unref (GTK_OBJECT (iter));
return FALSE;
}
@@ -1996,14 +1818,14 @@ e_card_email_find_number (const ECard *card, const gchar *email)
iter = e_list_get_iterator (card->email);
for (e_iterator_reset (iter); e_iterator_is_valid (iter); e_iterator_next (iter)) {
- if (!g_ascii_strcasecmp (e_iterator_get (iter), email))
+ if (!g_strcasecmp (e_iterator_get (iter), email))
goto finished;
++count;
}
count = -1;
finished:
- g_object_unref (iter);
+ gtk_object_unref (GTK_OBJECT (iter));
return count;
}
@@ -2013,82 +1835,75 @@ e_card_email_find_number (const ECard *card, const gchar *email)
*/
static void
-e_card_dispose (GObject *object)
+e_card_destroy (GtkObject *object)
{
ECard *card = E_CARD(object);
+ g_free(card->id);
+ if (card->book)
+ gtk_object_unref (GTK_OBJECT (card->book));
+ g_free(card->file_as);
+ g_free(card->fname);
+ e_card_name_unref(card->name);
+ g_free(card->bday);
+
+ g_free(card->url);
+ g_free(card->org);
+ g_free(card->org_unit);
+ g_free(card->office);
+ g_free(card->title);
+ g_free(card->role);
+ g_free(card->manager);
+ g_free(card->assistant);
+ g_free(card->nickname);
+ g_free(card->spouse);
+ g_free(card->anniversary);
+ g_free(card->caluri);
+ g_free(card->fburl);
+ g_free(card->icscalendar);
+ g_free(card->note);
+ g_free(card->related_contacts);
-#define FREE_IF(x) do { if ((x)) { g_free (x); x = NULL; } } while (0)
-#define UNREF_IF(x) do { if ((x)) { g_object_unref (x); x = NULL; } } while (0)
-
- FREE_IF (card->id);
- UNREF_IF (card->book);
- FREE_IF(card->file_as);
- FREE_IF(card->fname);
- if (card->name) {
- e_card_name_unref(card->name);
- card->name = NULL;
- }
- FREE_IF(card->bday);
-
- FREE_IF(card->url);
- FREE_IF(card->org);
- FREE_IF(card->org_unit);
- FREE_IF(card->office);
- FREE_IF(card->title);
- FREE_IF(card->role);
- FREE_IF(card->manager);
- FREE_IF(card->assistant);
- FREE_IF(card->nickname);
- FREE_IF(card->spouse);
- FREE_IF(card->anniversary);
- FREE_IF(card->caluri);
- FREE_IF(card->fburl);
- FREE_IF(card->icscalendar);
- FREE_IF(card->note);
- FREE_IF(card->related_contacts);
-
- UNREF_IF (card->categories);
- UNREF_IF (card->email);
- UNREF_IF (card->phone);
- UNREF_IF (card->address);
- UNREF_IF (card->address_label);
-
- if (G_OBJECT_CLASS (parent_class)->dispose)
- G_OBJECT_CLASS (parent_class)->dispose (object);
+ if (card->categories)
+ gtk_object_unref(GTK_OBJECT(card->categories));
+ if (card->email)
+ gtk_object_unref(GTK_OBJECT(card->email));
+ if (card->phone)
+ gtk_object_unref(GTK_OBJECT(card->phone));
+ if (card->address)
+ gtk_object_unref(GTK_OBJECT(card->address));
+ if (card->address_label)
+ gtk_object_unref(GTK_OBJECT(card->address_label));
}
/* Set_arg handler for the card */
static void
-e_card_set_property (GObject *object,
- guint prop_id,
- const GValue *value,
- GParamSpec *pspec)
+e_card_set_arg (GtkObject *object, GtkArg *arg, guint arg_id)
{
ECard *card;
card = E_CARD (object);
- switch (prop_id) {
- case PROP_FILE_AS:
+ switch (arg_id) {
+ case ARG_FILE_AS:
g_free(card->file_as);
- card->file_as = g_strdup(g_value_get_string (value));
+ card->file_as = g_strdup(GTK_VALUE_STRING(*arg));
if (card->file_as == NULL)
card->file_as = g_strdup("");
break;
- case PROP_FULL_NAME:
+ case ARG_FULL_NAME:
g_free(card->fname);
- card->fname = g_strdup(g_value_get_string (value));
+ card->fname = g_strdup(GTK_VALUE_STRING(*arg));
if (card->fname == NULL)
card->fname = g_strdup("");
e_card_name_unref (card->name);
card->name = e_card_name_from_string (card->fname);
break;
- case PROP_NAME:
+ case ARG_NAME:
e_card_name_unref (card->name);
- card->name = e_card_name_ref(g_value_get_pointer (value));
+ card->name = e_card_name_ref(GTK_VALUE_POINTER(*arg));
if (card->name == NULL)
card->name = e_card_name_new();
if (card->fname == NULL) {
@@ -2108,193 +1923,189 @@ e_card_set_property (GObject *object,
card->file_as = string;
}
break;
- case PROP_CATEGORIES:
+ case ARG_CATEGORIES:
if (card->categories)
- g_object_unref(card->categories);
+ gtk_object_unref(GTK_OBJECT(card->categories));
card->categories = NULL;
- if (g_value_get_string (value))
- do_parse_categories(card, (char*)g_value_get_string (value));
+ if (GTK_VALUE_STRING(*arg))
+ do_parse_categories(card, GTK_VALUE_STRING(*arg));
break;
- case PROP_CATEGORY_LIST:
+ case ARG_CATEGORY_LIST:
if (card->categories)
- g_object_unref(card->categories);
- card->categories = E_LIST(g_value_get_object(value));
+ gtk_object_unref(GTK_OBJECT(card->categories));
+ card->categories = E_LIST(GTK_VALUE_OBJECT(*arg));
if (card->categories)
- g_object_ref(card->categories);
+ gtk_object_ref(GTK_OBJECT(card->categories));
break;
- case PROP_BIRTH_DATE:
+ case ARG_BIRTH_DATE:
g_free(card->bday);
- if (g_value_get_pointer (value)) {
+ if (GTK_VALUE_POINTER (*arg)) {
card->bday = g_new (ECardDate, 1);
- memcpy (card->bday, g_value_get_pointer (value), sizeof (ECardDate));
+ memcpy (card->bday, GTK_VALUE_POINTER (*arg), sizeof (ECardDate));
} else {
card->bday = NULL;
}
break;
- case PROP_URL:
+ case ARG_URL:
g_free(card->url);
- card->url = g_strdup(g_value_get_string(value));
+ card->url = g_strdup(GTK_VALUE_STRING(*arg));
break;
- case PROP_ORG:
+ case ARG_ORG:
g_free(card->org);
- card->org = g_strdup(g_value_get_string(value));
+ card->org = g_strdup(GTK_VALUE_STRING(*arg));
break;
- case PROP_ORG_UNIT:
+ case ARG_ORG_UNIT:
g_free(card->org_unit);
- card->org_unit = g_strdup(g_value_get_string(value));
+ card->org_unit = g_strdup(GTK_VALUE_STRING(*arg));
break;
- case PROP_OFFICE:
+ case ARG_OFFICE:
g_free(card->office);
- card->office = g_strdup(g_value_get_string(value));
+ card->office = g_strdup(GTK_VALUE_STRING(*arg));
break;
- case PROP_TITLE:
+ case ARG_TITLE:
g_free(card->title);
- card->title = g_strdup(g_value_get_string(value));
+ card->title = g_strdup(GTK_VALUE_STRING(*arg));
break;
- case PROP_ROLE:
+ case ARG_ROLE:
g_free(card->role);
- card->role = g_strdup(g_value_get_string(value));
+ card->role = g_strdup(GTK_VALUE_STRING(*arg));
break;
- case PROP_MANAGER:
+ case ARG_MANAGER:
g_free(card->manager);
- card->manager = g_strdup(g_value_get_string(value));
+ card->manager = g_strdup(GTK_VALUE_STRING(*arg));
break;
- case PROP_ASSISTANT:
+ case ARG_ASSISTANT:
g_free(card->assistant);
- card->assistant = g_strdup(g_value_get_string(value));
+ card->assistant = g_strdup(GTK_VALUE_STRING(*arg));
break;
- case PROP_NICKNAME:
+ case ARG_NICKNAME:
g_free(card->nickname);
- card->nickname = g_strdup(g_value_get_string(value));
+ card->nickname = g_strdup(GTK_VALUE_STRING(*arg));
break;
- case PROP_SPOUSE:
+ case ARG_SPOUSE:
g_free(card->spouse);
- card->spouse = g_strdup(g_value_get_string(value));
+ card->spouse = g_strdup(GTK_VALUE_STRING(*arg));
break;
- case PROP_ANNIVERSARY:
+ case ARG_ANNIVERSARY:
g_free(card->anniversary);
- if (g_value_get_pointer (value)) {
+ if (GTK_VALUE_POINTER (*arg)) {
card->anniversary = g_new (ECardDate, 1);
- memcpy (card->anniversary, g_value_get_pointer (value), sizeof (ECardDate));
+ memcpy (card->anniversary, GTK_VALUE_POINTER (*arg), sizeof (ECardDate));
} else {
card->anniversary = NULL;
}
break;
- case PROP_MAILER:
+ case ARG_MAILER:
g_free(card->mailer);
- card->mailer = g_strdup(g_value_get_string(value));
+ card->mailer = g_strdup(GTK_VALUE_STRING(*arg));
break;
- case PROP_CALURI:
+ case ARG_CALURI:
g_free(card->caluri);
- card->caluri = g_strdup(g_value_get_string(value));
+ card->caluri = g_strdup(GTK_VALUE_STRING(*arg));
break;
- case PROP_FBURL:
+ case ARG_FBURL:
g_free(card->fburl);
- card->fburl = g_strdup(g_value_get_string(value));
+ card->fburl = g_strdup(GTK_VALUE_STRING(*arg));
break;
- case PROP_ICSCALENDAR:
+ case ARG_ICSCALENDAR:
g_free(card->icscalendar);
- card->icscalendar = g_strdup(g_value_get_string(value));
+ card->icscalendar = g_strdup(GTK_VALUE_STRING(*arg));
break;
- case PROP_NOTE:
+ case ARG_NOTE:
g_free (card->note);
- card->note = g_strdup(g_value_get_string(value));
+ card->note = g_strdup(GTK_VALUE_STRING(*arg));
break;
- case PROP_RELATED_CONTACTS:
+ case ARG_RELATED_CONTACTS:
g_free (card->related_contacts);
- card->related_contacts = g_strdup(g_value_get_string(value));
+ card->related_contacts = g_strdup(GTK_VALUE_STRING(*arg));
break;
- case PROP_WANTS_HTML:
- card->wants_html = g_value_get_boolean (value);
+ case ARG_WANTS_HTML:
+ card->wants_html = GTK_VALUE_BOOL(*arg);
card->wants_html_set = TRUE;
break;
- case PROP_ARBITRARY:
+ case ARG_ARBITRARY:
if (card->arbitrary)
- g_object_unref(card->arbitrary);
- card->arbitrary = E_LIST(g_value_get_pointer(value));
+ gtk_object_unref(GTK_OBJECT(card->arbitrary));
+ card->arbitrary = E_LIST(GTK_VALUE_OBJECT(*arg));
if (card->arbitrary)
- g_object_ref(card->arbitrary);
+ gtk_object_ref(GTK_OBJECT(card->arbitrary));
break;
- case PROP_ID:
+ case ARG_ID:
g_free(card->id);
- card->id = g_strdup(g_value_get_string(value));
+ card->id = g_strdup(GTK_VALUE_STRING(*arg));
if (card->id == NULL)
card->id = g_strdup ("");
break;
- case PROP_LAST_USE:
+ case ARG_LAST_USE:
g_free(card->last_use);
- if (g_value_get_pointer (value)) {
+ if (GTK_VALUE_POINTER (*arg)) {
card->last_use = g_new (ECardDate, 1);
- memcpy (card->last_use, g_value_get_pointer (value), sizeof (ECardDate));
+ memcpy (card->last_use, GTK_VALUE_POINTER (*arg), sizeof (ECardDate));
} else {
card->last_use = NULL;
}
break;
- case PROP_USE_SCORE:
- card->raw_use_score = g_value_get_float (value);
+ case ARG_USE_SCORE:
+ card->raw_use_score = GTK_VALUE_FLOAT(*arg);
break;
- case PROP_EVOLUTION_LIST:
- card->list = g_value_get_boolean (value);
+ case ARG_EVOLUTION_LIST:
+ card->list = GTK_VALUE_BOOL(*arg);
break;
- case PROP_EVOLUTION_LIST_SHOW_ADDRESSES:
- card->list_show_addresses = g_value_get_boolean (value);
+ case ARG_EVOLUTION_LIST_SHOW_ADDRESSES:
+ card->list_show_addresses = GTK_VALUE_BOOL(*arg);
break;
default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
- break;
+ return;
}
}
/* Get_arg handler for the card */
static void
-e_card_get_property (GObject *object,
- guint prop_id,
- GValue *value,
- GParamSpec *pspec)
+e_card_get_arg (GtkObject *object, GtkArg *arg, guint arg_id)
{
ECard *card;
card = E_CARD (object);
- switch (prop_id) {
- case PROP_FILE_AS:
- g_value_set_string (value, card->file_as);
+ switch (arg_id) {
+ case ARG_FILE_AS:
+ GTK_VALUE_STRING (*arg) = card->file_as;
break;
- case PROP_FULL_NAME:
- g_value_set_string (value, card->fname);
+ case ARG_FULL_NAME:
+ GTK_VALUE_STRING (*arg) = card->fname;
break;
- case PROP_NAME:
- g_value_set_pointer (value, card->name);
+ case ARG_NAME:
+ GTK_VALUE_POINTER(*arg) = card->name;
break;
- case PROP_ADDRESS:
+ case ARG_ADDRESS:
if (!card->address)
card->address = e_list_new((EListCopyFunc) e_card_delivery_address_ref,
(EListFreeFunc) e_card_delivery_address_unref,
NULL);
- g_value_set_object (value, card->address);
+ GTK_VALUE_OBJECT(*arg) = GTK_OBJECT(card->address);
break;
- case PROP_ADDRESS_LABEL:
+ case ARG_ADDRESS_LABEL:
if (!card->address_label)
card->address_label = e_list_new((EListCopyFunc) e_card_address_label_ref,
(EListFreeFunc) e_card_address_label_unref,
NULL);
- g_value_set_object (value, card->address_label);
+ GTK_VALUE_OBJECT(*arg) = GTK_OBJECT(card->address_label);
break;
- case PROP_PHONE:
+ case ARG_PHONE:
if (!card->phone)
card->phone = e_list_new((EListCopyFunc) e_card_phone_ref,
(EListFreeFunc) e_card_phone_unref,
NULL);
- g_value_set_object (value, card->phone);
+ GTK_VALUE_OBJECT(*arg) = GTK_OBJECT(card->phone);
break;
- case PROP_EMAIL:
+ case ARG_EMAIL:
if (!card->email)
card->email = e_list_new((EListCopyFunc) g_strdup,
(EListFreeFunc) g_free,
NULL);
- g_value_set_object (value, card->email);
+ GTK_VALUE_OBJECT(*arg) = GTK_OBJECT(card->email);
break;
- case PROP_CATEGORIES:
+ case ARG_CATEGORIES:
{
int i;
char ** strs;
@@ -2310,102 +2121,103 @@ e_card_get_property (GObject *object,
strs[i] = (char *)e_iterator_get(iterator);
}
strs[i] = 0;
- g_value_set_string(value, g_strjoinv(", ", strs));
+ GTK_VALUE_STRING(*arg) = g_strjoinv(", ", strs);
g_free(strs);
}
break;
- case PROP_CATEGORY_LIST:
+ case ARG_CATEGORY_LIST:
if (!card->categories)
card->categories = e_list_new((EListCopyFunc) g_strdup,
(EListFreeFunc) g_free,
NULL);
- g_value_set_object (value, card->categories);
+ GTK_VALUE_OBJECT(*arg) = GTK_OBJECT(card->categories);
break;
- case PROP_BIRTH_DATE:
- g_value_set_pointer (value, card->bday);
+ case ARG_BIRTH_DATE:
+ GTK_VALUE_POINTER(*arg) = card->bday;
break;
- case PROP_URL:
- g_value_set_string (value, card->url);
+ case ARG_URL:
+ GTK_VALUE_STRING(*arg) = card->url;
break;
- case PROP_ORG:
- g_value_set_string (value, card->org);
+ case ARG_ORG:
+ GTK_VALUE_STRING(*arg) = card->org;
break;
- case PROP_ORG_UNIT:
- g_value_set_string (value, card->org_unit);
+ case ARG_ORG_UNIT:
+ GTK_VALUE_STRING(*arg) = card->org_unit;
break;
- case PROP_OFFICE:
- g_value_set_string (value, card->office);
+ case ARG_OFFICE:
+ GTK_VALUE_STRING(*arg) = card->office;
break;
- case PROP_TITLE:
- g_value_set_string (value, card->title);
+ case ARG_TITLE:
+ GTK_VALUE_STRING(*arg) = card->title;
break;
- case PROP_ROLE:
- g_value_set_string (value, card->role);
+ case ARG_ROLE:
+ GTK_VALUE_STRING(*arg) = card->role;
break;
- case PROP_MANAGER:
- g_value_set_string (value, card->manager);
+ case ARG_MANAGER:
+ GTK_VALUE_STRING(*arg) = card->manager;
break;
- case PROP_ASSISTANT:
- g_value_set_string (value, card->assistant);
+ case ARG_ASSISTANT:
+ GTK_VALUE_STRING(*arg) = card->assistant;
break;
- case PROP_NICKNAME:
- g_value_set_string (value, card->nickname);
+ case ARG_NICKNAME:
+ GTK_VALUE_STRING(*arg) = card->nickname;
break;
- case PROP_SPOUSE:
- g_value_set_string (value, card->spouse);
+ case ARG_SPOUSE:
+ GTK_VALUE_STRING(*arg) = card->spouse;
break;
- case PROP_ANNIVERSARY:
- g_value_set_pointer (value, card->anniversary);
+ case ARG_ANNIVERSARY:
+ GTK_VALUE_POINTER(*arg) = card->anniversary;
break;
- case PROP_MAILER:
- g_value_set_string (value, card->mailer);
+ case ARG_MAILER:
+ GTK_VALUE_STRING(*arg) = card->mailer;
break;
- case PROP_CALURI:
- g_value_set_string (value, card->caluri);
+ case ARG_CALURI:
+ GTK_VALUE_STRING(*arg) = card->caluri;
break;
- case PROP_FBURL:
- g_value_set_string (value, card->fburl);
+ case ARG_FBURL:
+ GTK_VALUE_STRING(*arg) = card->fburl;
break;
- case PROP_ICSCALENDAR:
- g_value_set_string (value, card->icscalendar);
+ case ARG_ICSCALENDAR:
+ GTK_VALUE_STRING(*arg) = card->icscalendar;
break;
- case PROP_NOTE:
- g_value_set_string (value, card->note);
+ case ARG_NOTE:
+ GTK_VALUE_STRING(*arg) = card->note;
break;
- case PROP_RELATED_CONTACTS:
- g_value_set_string (value, card->related_contacts);
+ case ARG_RELATED_CONTACTS:
+ GTK_VALUE_STRING(*arg) = card->related_contacts;
break;
- case PROP_WANTS_HTML:
- g_value_set_boolean (value, card->wants_html);
+ case ARG_WANTS_HTML:
+ GTK_VALUE_BOOL(*arg) = card->wants_html;
break;
- case PROP_WANTS_HTML_SET:
- g_value_set_boolean (value, card->wants_html_set);
+ case ARG_WANTS_HTML_SET:
+ GTK_VALUE_BOOL(*arg) = card->wants_html_set;
break;
- case PROP_ARBITRARY:
+ case ARG_ARBITRARY:
if (!card->arbitrary)
card->arbitrary = e_list_new((EListCopyFunc) e_card_arbitrary_ref,
(EListFreeFunc) e_card_arbitrary_unref,
NULL);
- g_value_set_object (value, card->arbitrary);
+ GTK_VALUE_OBJECT(*arg) = GTK_OBJECT(card->arbitrary);
break;
- case PROP_ID:
- g_value_set_string (value, card->id);
+ case ARG_ID:
+ GTK_VALUE_STRING(*arg) = card->id;
break;
- case PROP_LAST_USE:
- g_value_set_pointer (value, card->last_use);
+ case ARG_LAST_USE:
+ GTK_VALUE_POINTER(*arg) = card->last_use;
break;
- case PROP_USE_SCORE:
- g_value_set_float (value, e_card_get_use_score (card));
+
+ case ARG_USE_SCORE:
+ GTK_VALUE_FLOAT(*arg) = e_card_get_use_score (card);
break;
- case PROP_EVOLUTION_LIST:
- g_value_set_boolean (value, card->list);
+ case ARG_EVOLUTION_LIST:
+ GTK_VALUE_BOOL(*arg) = card->list;
break;
- case PROP_EVOLUTION_LIST_SHOW_ADDRESSES:
- g_value_set_boolean (value, card->list_show_addresses);
+ case ARG_EVOLUTION_LIST_SHOW_ADDRESSES:
+ GTK_VALUE_BOOL(*arg) = card->list_show_addresses;
break;
default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+ arg->type = GTK_TYPE_INVALID;
break;
}
}
@@ -2461,7 +2273,7 @@ e_card_load_cards_from_file_with_default_charset(const char *filename, char *def
GList *list = NULL;
while(vobj) {
VObject *next;
- ECard *card = g_object_new (E_TYPE_CARD, NULL);
+ ECard *card = E_CARD(gtk_type_new(e_card_get_type()));
parse(card, vobj, default_charset);
next = nextVObjectInList(vobj);
cleanVObject(vobj);
@@ -2485,7 +2297,7 @@ e_card_load_cards_from_string_with_default_charset(const char *str, char *defaul
GList *list = NULL;
while(vobj) {
VObject *next;
- ECard *card = g_object_new (E_TYPE_CARD, NULL);
+ ECard *card = E_CARD(gtk_type_new(e_card_get_type()));
parse(card, vobj, default_charset);
next = nextVObjectInList(vobj);
cleanVObject(vobj);
@@ -2506,32 +2318,32 @@ void
e_card_free_empty_lists (ECard *card)
{
if (card->address && e_list_length (card->address) == 0) {
- g_object_unref (card->address);
+ gtk_object_unref (GTK_OBJECT (card->address));
card->address = NULL;
}
if (card->address_label && e_list_length (card->address_label) == 0) {
- g_object_unref (card->address_label);
+ gtk_object_unref (GTK_OBJECT (card->address_label));
card->address_label = NULL;
}
if (card->phone && e_list_length (card->phone) == 0) {
- g_object_unref (card->phone);
+ gtk_object_unref (GTK_OBJECT (card->phone));
card->phone = NULL;
}
if (card->email && e_list_length (card->email) == 0) {
- g_object_unref (card->email);
+ gtk_object_unref (GTK_OBJECT (card->email));
card->email = NULL;
}
if (card->categories && e_list_length (card->categories) == 0) {
- g_object_unref (card->categories);
+ gtk_object_unref (GTK_OBJECT (card->categories));
card->categories = NULL;
}
if (card->arbitrary && e_list_length (card->arbitrary) == 0) {
- g_object_unref (card->arbitrary);
+ gtk_object_unref (GTK_OBJECT (card->arbitrary));
card->arbitrary = NULL;
}
}
@@ -2734,6 +2546,278 @@ set_address_flags (VObject *vobj, ECardAddressFlags flags)
}
}
+#include <Evolution-Composer.h>
+
+#define COMPOSER_OAFID "OAFIID:GNOME_Evolution_Mail_Composer"
+
+void
+e_card_list_send (GList *cards, ECardDisposition disposition)
+{
+ BonoboObjectClient *bonobo_server;
+ GNOME_Evolution_Composer composer_server;
+ CORBA_Environment ev;
+
+ if (cards == NULL)
+ return;
+
+ /* First, I obtain an object reference that represents the Composer. */
+ bonobo_server = bonobo_object_activate (COMPOSER_OAFID, 0);
+
+ g_return_if_fail (bonobo_server != NULL);
+
+ composer_server = bonobo_object_corba_objref (BONOBO_OBJECT (bonobo_server));
+
+ CORBA_exception_init (&ev);
+
+ if (disposition == E_CARD_DISPOSITION_AS_TO) {
+ GNOME_Evolution_Composer_RecipientList *to_list, *cc_list, *bcc_list;
+ CORBA_char *subject;
+ int to_i, bcc_i;
+ GList *iter;
+ gint to_length = 0, bcc_length = 0;
+
+ /* Figure out how many addresses of each kind we have. */
+ for (iter = cards; iter != NULL; iter = g_list_next (iter)) {
+ ECard *card = E_CARD (iter->data);
+ if (e_card_evolution_list (card)) {
+ gint len = card->email ? e_list_length (card->email) : 0;
+ if (e_card_evolution_list_show_addresses (card))
+ to_length += len;
+ else
+ bcc_length += len;
+ } else {
+ if (card->email != NULL)
+ ++to_length;
+ }
+ }
+
+ /* Now I have to make a CORBA sequences that represents a recipient list with
+ the right number of entries, for the cards. */
+ to_list = GNOME_Evolution_Composer_RecipientList__alloc ();
+ to_list->_maximum = to_length;
+ to_list->_length = to_length;
+ if (to_length > 0) {
+ to_list->_buffer = CORBA_sequence_GNOME_Evolution_Composer_Recipient_allocbuf (to_length);
+ }
+
+ cc_list = GNOME_Evolution_Composer_RecipientList__alloc ();
+ cc_list->_maximum = cc_list->_length = 0;
+
+ bcc_list = GNOME_Evolution_Composer_RecipientList__alloc ();
+ bcc_list->_maximum = bcc_length;
+ bcc_list->_length = bcc_length;
+ if (bcc_length > 0) {
+ bcc_list->_buffer = CORBA_sequence_GNOME_Evolution_Composer_Recipient_allocbuf (bcc_length);
+ }
+
+ to_i = 0;
+ bcc_i = 0;
+ while (cards != NULL) {
+ ECard *card = cards->data;
+ EIterator *iterator;
+ gchar *name, *addr;
+ gboolean is_list, is_hidden, free_name_addr;
+ GNOME_Evolution_Composer_Recipient *recipient;
+
+ if (card->email != NULL) {
+
+ is_list = e_card_evolution_list (card);
+ is_hidden = is_list && !e_card_evolution_list_show_addresses (card);
+
+ for (iterator = e_list_get_iterator (card->email); e_iterator_is_valid (iterator); e_iterator_next (iterator)) {
+
+ if (is_hidden) {
+ recipient = &(bcc_list->_buffer[bcc_i]);
+ ++bcc_i;
+ } else {
+ recipient = &(to_list->_buffer[to_i]);
+ ++to_i;
+ }
+
+ name = "";
+ addr = "";
+ free_name_addr = FALSE;
+ if (e_iterator_is_valid (iterator)) {
+
+ if (is_list) {
+ /* We need to decode the list entries, which are XMLified EDestinations. */
+ EDestination *dest = e_destination_import (e_iterator_get (iterator));
+ if (dest != NULL) {
+ name = g_strdup (e_destination_get_name (dest));
+ addr = g_strdup (e_destination_get_email (dest));
+ free_name_addr = TRUE;
+ gtk_object_unref (GTK_OBJECT (dest));
+ }
+
+ } else { /* is just a plain old card */
+ if (card->name)
+ name = e_card_name_to_string (card->name);
+ addr = g_strdup ((char *) e_iterator_get (iterator));
+ free_name_addr = TRUE;
+ }
+ }
+
+ recipient->name = CORBA_string_dup (name ? name : "");
+ recipient->address = CORBA_string_dup (addr ? addr : "");
+
+ if (free_name_addr) {
+ g_free ((gchar *) name);
+ g_free ((gchar *) addr);
+ }
+
+ /* If this isn't a list, we quit after the first (i.e. the default) address. */
+ if (!is_list)
+ break;
+
+ }
+ gtk_object_unref (GTK_OBJECT (iterator));
+ }
+
+ cards = g_list_next (cards);
+ }
+
+ subject = CORBA_string_dup ("");
+
+ GNOME_Evolution_Composer_setHeaders (composer_server, "", to_list, cc_list, bcc_list, subject, &ev);
+ if (ev._major != CORBA_NO_EXCEPTION) {
+ g_printerr ("gui/e-meeting-edit.c: I couldn't set the composer headers via CORBA! Aagh.\n");
+ CORBA_exception_free (&ev);
+ return;
+ }
+
+ CORBA_free (to_list);
+ CORBA_free (cc_list);
+ CORBA_free (bcc_list);
+ CORBA_free (subject);
+ }
+
+ if (disposition == E_CARD_DISPOSITION_AS_ATTACHMENT) {
+ CORBA_char *content_type, *filename, *description;
+ GNOME_Evolution_Composer_AttachmentData *attach_data;
+ CORBA_boolean show_inline;
+ char *tempstr;
+
+ GNOME_Evolution_Composer_RecipientList *to_list, *cc_list, *bcc_list;
+ CORBA_char *subject;
+
+ content_type = CORBA_string_dup ("text/x-vcard");
+ filename = CORBA_string_dup ("");
+
+ if (cards->next) {
+ description = CORBA_string_dup (_("Multiple VCards"));
+ } else {
+ char *file_as;
+
+ gtk_object_get(GTK_OBJECT(cards->data),
+ "file_as", &file_as,
+ NULL);
+
+ tempstr = g_strdup_printf (_("VCard for %s"), file_as);
+ description = CORBA_string_dup (tempstr);
+ g_free (tempstr);
+ }
+
+ show_inline = FALSE;
+
+ tempstr = e_card_list_get_vcard (cards);
+ attach_data = GNOME_Evolution_Composer_AttachmentData__alloc();
+ attach_data->_maximum = attach_data->_length = strlen (tempstr);
+ attach_data->_buffer = CORBA_sequence_CORBA_char_allocbuf (attach_data->_length);
+ strcpy (attach_data->_buffer, tempstr);
+ g_free (tempstr);
+
+ GNOME_Evolution_Composer_attachData (composer_server,
+ content_type, filename, description,
+ show_inline, attach_data,
+ &ev);
+
+ if (ev._major != CORBA_NO_EXCEPTION) {
+ g_printerr ("gui/e-meeting-edit.c: I couldn't attach data to the composer via CORBA! Aagh.\n");
+ CORBA_exception_free (&ev);
+ return;
+ }
+
+ CORBA_free (content_type);
+ CORBA_free (filename);
+ CORBA_free (description);
+ CORBA_free (attach_data);
+
+ to_list = GNOME_Evolution_Composer_RecipientList__alloc ();
+ to_list->_maximum = to_list->_length = 0;
+
+ cc_list = GNOME_Evolution_Composer_RecipientList__alloc ();
+ cc_list->_maximum = cc_list->_length = 0;
+
+ bcc_list = GNOME_Evolution_Composer_RecipientList__alloc ();
+ bcc_list->_maximum = bcc_list->_length = 0;
+
+ if (!cards || cards->next) {
+ subject = CORBA_string_dup ("Contact information");
+ } else {
+ ECard *card = cards->data;
+ const gchar *tempstr2;
+
+ tempstr2 = NULL;
+ gtk_object_get(GTK_OBJECT(card),
+ "file_as", &tempstr2,
+ NULL);
+ if (!tempstr2 || !*tempstr2)
+ gtk_object_get(GTK_OBJECT(card),
+ "full_name", &tempstr2,
+ NULL);
+ if (!tempstr2 || !*tempstr2)
+ gtk_object_get(GTK_OBJECT(card),
+ "org", &tempstr2,
+ NULL);
+ if (!tempstr2 || !*tempstr2) {
+ EList *list;
+ EIterator *iterator;
+ gtk_object_get(GTK_OBJECT(card),
+ "email", &list,
+ NULL);
+ iterator = e_list_get_iterator (list);
+ if (e_iterator_is_valid (iterator)) {
+ tempstr2 = e_iterator_get (iterator);
+ }
+ gtk_object_unref (GTK_OBJECT (iterator));
+ }
+
+ if (!tempstr2 || !*tempstr2)
+ tempstr = g_strdup_printf ("Contact information");
+ else
+ tempstr = g_strdup_printf ("Contact information for %s", tempstr2);
+ subject = CORBA_string_dup (tempstr);
+ g_free (tempstr);
+ }
+
+ GNOME_Evolution_Composer_setHeaders (composer_server, "", to_list, cc_list, bcc_list, subject, &ev);
+
+ CORBA_free (to_list);
+ CORBA_free (cc_list);
+ CORBA_free (bcc_list);
+ CORBA_free (subject);
+ }
+
+ GNOME_Evolution_Composer_show (composer_server, &ev);
+
+ if (ev._major != CORBA_NO_EXCEPTION) {
+ g_printerr ("gui/e-meeting-edit.c: I couldn't show the composer via CORBA! Aagh.\n");
+ CORBA_exception_free (&ev);
+ return;
+ }
+
+ CORBA_exception_free (&ev);
+}
+
+void
+e_card_send (ECard *card, ECardDisposition disposition)
+{
+ GList *list;
+ list = g_list_prepend (NULL, card);
+ e_card_list_send (list, disposition);
+ g_list_free (list);
+}
+
gboolean
e_card_evolution_list (ECard *card)
{
diff --git a/addressbook/backend/ebook/e-card.h b/addressbook/backend/ebook/e-card.h
index d82d5f4cb6..dbaa954ba7 100644
--- a/addressbook/backend/ebook/e-card.h
+++ b/addressbook/backend/ebook/e-card.h
@@ -13,17 +13,16 @@
#define __E_CARD_H__
#include <time.h>
-#include <glib-object.h>
+#include <gtk/gtkobject.h>
#include <stdio.h>
#include <ebook/e-card-types.h>
#include <e-util/e-list.h>
#define E_TYPE_CARD (e_card_get_type ())
-#define E_CARD(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), E_TYPE_CARD, ECard))
-#define E_CARD_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), E_TYPE_CARD, ECardClass))
-#define E_IS_CARD(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), E_TYPE_CARD))
-#define E_IS_CARD_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), E_TYPE_CARD))
-#define E_CARD_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), E_TYPE_CARD, ECardClass))
+#define E_CARD(obj) (GTK_CHECK_CAST ((obj), E_TYPE_CARD, ECard))
+#define E_CARD_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), E_TYPE_CARD, ECardClass))
+#define E_IS_CARD(obj) (GTK_CHECK_TYPE ((obj), E_TYPE_CARD))
+#define E_IS_CARD_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), E_TYPE_CARD))
typedef struct _ECard ECard;
typedef struct _ECardClass ECardClass;
@@ -31,7 +30,7 @@ typedef struct _ECardClass ECardClass;
struct _EBook; /* Forward reference */
struct _ECard {
- GObject object;
+ GtkObject object;
char *id;
struct _EBook *book; /* The EBook this card is from. */
@@ -113,7 +112,7 @@ struct _ECard {
};
struct _ECardClass {
- GObjectClass parent_class;
+ GtkObjectClass parent_class;
GHashTable *attribute_jump_table;
};
@@ -196,6 +195,16 @@ GList *e_card_load_cards_from_string_with_default_charset (const
char *default_charset);
void e_card_free_empty_lists (ECard *card);
+enum _ECardDisposition {
+ E_CARD_DISPOSITION_AS_ATTACHMENT,
+ E_CARD_DISPOSITION_AS_TO,
+};
+typedef enum _ECardDisposition ECardDisposition;
+void e_card_send (ECard *card,
+ ECardDisposition disposition);
+void e_card_list_send (GList *cards,
+ ECardDisposition disposition);
+
/* Getting ECards via their URIs */
typedef void (*ECardCallback) (ECard *card, gpointer closure);
void e_card_load_uri (const gchar *book_uri,
@@ -204,6 +213,7 @@ void e_card_load_uri (const gchar
gpointer closure);
-GType e_card_get_type (void);
+/* Standard Gtk function */
+GtkType e_card_get_type (void);
#endif /* ! __E_CARD_H__ */
diff --git a/addressbook/backend/ebook/evolution-ldif-importer.c b/addressbook/backend/ebook/evolution-ldif-importer.c
index 7a204daa95..5602f3fb18 100644
--- a/addressbook/backend/ebook/evolution-ldif-importer.c
+++ b/addressbook/backend/ebook/evolution-ldif-importer.c
@@ -13,24 +13,22 @@
*/
#include <config.h>
+#include <bonobo.h>
+#include <gnome.h>
+#include <liboaf/liboaf.h>
#include <stdio.h>
#include <ctype.h>
-#include <string.h>
#include <e-book.h>
-#include <e-book-util.h>
#include <e-card-simple.h>
#include <e-destination.h>
-#include <libgnome/gnome-init.h>
-#include <bonobo/bonobo-generic-factory.h>
-#include <bonobo/bonobo-main.h>
-
#include <importer/evolution-importer.h>
#include <importer/GNOME_Evolution_Importer.h>
#define COMPONENT_FACTORY_IID "OAFIID:GNOME_Evolution_Addressbook_LDIF_ImporterFactory"
-#define COMPONENT_IID "OAFIID:GNOME_Evolution_Addressbook_LDIF_Importer"
+
+static BonoboGenericFactory *factory = NULL;
static GHashTable *dn_card_hash;
@@ -240,17 +238,17 @@ parseLine( ECardSimple *simple, ECardDeliveryAddress *address, char **buf )
field_handled = FALSE;
for (i = 0; i < num_ldif_fields; i ++) {
- if (!g_ascii_strcasecmp (ptr, ldif_fields[i].ldif_attribute)) {
+ if (!g_strcasecmp (ptr, ldif_fields[i].ldif_attribute)) {
if (ldif_fields[i].flags & FLAG_ADDRESS) {
- if (!g_ascii_strcasecmp (ptr, "locality"))
+ if (!g_strcasecmp (ptr, "locality"))
address->city = g_strdup (ldif_value->str);
- else if (!g_ascii_strcasecmp (ptr, "countryname"))
+ else if (!g_strcasecmp (ptr, "countryname"))
address->country = g_strdup (ldif_value->str);
- else if (!g_ascii_strcasecmp (ptr, "postalcode"))
+ else if (!g_strcasecmp (ptr, "postalcode"))
address->code = g_strdup (ldif_value->str);
- else if (!g_ascii_strcasecmp (ptr, "st"))
+ else if (!g_strcasecmp (ptr, "st"))
address->region = g_strdup (ldif_value->str);
- else if (!g_ascii_strcasecmp (ptr, "streetaddress"))
+ else if (!g_strcasecmp (ptr, "streetaddress"))
address->street = g_strdup (ldif_value->str);
}
else {
@@ -264,16 +262,16 @@ parseLine( ECardSimple *simple, ECardDeliveryAddress *address, char **buf )
/* handle objectclass/dn/member out here */
if (!field_handled) {
- if (!g_ascii_strcasecmp (ptr, "dn"))
+ if (!g_strcasecmp (ptr, "dn"))
g_hash_table_insert (dn_card_hash, g_strdup(ldif_value->str), simple->card);
- else if (!g_ascii_strcasecmp (ptr, "objectclass") && !g_ascii_strcasecmp (ldif_value->str, "groupofnames")) {
+ else if (!g_strcasecmp (ptr, "objectclass") && !g_strcasecmp (ldif_value->str, "groupofnames")) {
e_card_simple_set (simple, E_CARD_SIMPLE_FIELD_IS_LIST, "true");
}
- else if (!g_ascii_strcasecmp (ptr, "member")) {
+ else if (!g_strcasecmp (ptr, "member")) {
EList *email;
- g_object_get (simple->card,
- "email", &email,
- NULL);
+ gtk_object_get (GTK_OBJECT (simple->card),
+ "email", &email,
+ NULL);
e_list_append (email, ldif_value->str);
}
}
@@ -328,7 +326,7 @@ getNextLDIFEntry( FILE *f )
while (buf) {
if (!parseLine (simple, address, &buf)) {
/* parsing error */
- g_object_unref (simple);
+ gtk_object_unref (GTK_OBJECT (simple));
e_card_delivery_address_unref (address);
return NULL;
}
@@ -376,17 +374,17 @@ resolve_list_card (LDIFImporter *gci, ECard *card)
if (!e_card_evolution_list (card))
return;
- g_object_get (card,
- "email", &email,
- "full_name", &full_name,
- NULL);
+ gtk_object_get (GTK_OBJECT (card),
+ "email", &email,
+ "full_name", &full_name,
+ NULL);
/* set file_as to full_name so we don't later try and figure
out a first/last name for the list. */
if (full_name)
- g_object_set (card,
- "file_as", full_name,
- NULL);
+ gtk_object_set (GTK_OBJECT (card),
+ "file_as", full_name,
+ NULL);
email_iter = e_list_get_iterator (email);
while (e_iterator_is_valid (email_iter)) {
@@ -399,7 +397,7 @@ resolve_list_card (LDIFImporter *gci, ECard *card)
gchar *dest_xml;
e_destination_set_card (dest, dn_card, 0); /* Hard-wired for default e-mail, since netscape only exports 1 email address */
dest_xml = e_destination_export (dest);
- g_object_unref (dest);
+ gtk_object_unref (GTK_OBJECT (dest));
if (dest_xml) {
e_iterator_set (email_iter, dest_xml);
g_free (dest_xml);
@@ -450,18 +448,33 @@ book_open_cb (EBook *book, EBookStatus status, gpointer closure)
}
static void
-ebook_open (LDIFImporter *gci, const char *uri)
+ebook_create (LDIFImporter *gci)
{
+ gchar *path, *uri;
+
gci->book = e_book_new ();
if (!gci->book) {
printf ("%s: %s(): Couldn't create EBook, bailing.\n",
__FILE__,
- G_GNUC_FUNCTION);
+ __FUNCTION__);
return;
}
+#if 0
+ path = g_concat_dir_and_file (g_get_home_dir (),
+ "evolution/local/Contacts/addressbook.db");
+ uri = g_strdup_printf ("file://%s", path);
+ g_free (path);
+
+ if (! e_book_load_uri (gci->book, uri, book_open_cb, gci)) {
+ printf ("error calling load_uri!\n");
+ }
+ g_free(uri);
+#endif
- e_book_load_address_book_by_uri (gci->book, uri, book_open_cb, gci);
+ if (! e_book_load_default_book (gci->book, book_open_cb, gci)) {
+ g_warning ("Error calling load_default_book");
+ }
}
/* EvolutionImporter methods */
@@ -536,16 +549,16 @@ support_format_fn (EvolutionImporter *importer,
}
static void
-importer_destroy_cb (gpointer data,
- GObject *where_object_was)
+importer_destroy_cb (GtkObject *object,
+ LDIFImporter *gci)
{
- bonobo_main_quit ();
+ gtk_main_quit ();
}
static gboolean
load_file_fn (EvolutionImporter *importer,
const char *filename,
- const char *uri,
+ const char *folderpath,
void *closure)
{
LDIFImporter *gci;
@@ -555,33 +568,62 @@ load_file_fn (EvolutionImporter *importer,
gci->cardlist = NULL;
gci->iterator = NULL;
gci->ready = FALSE;
- ebook_open (gci, uri);
+ ebook_create (gci);
return TRUE;
}
static BonoboObject *
factory_fn (BonoboGenericFactory *_factory,
- const char *component_id,
void *closure)
{
EvolutionImporter *importer;
LDIFImporter *gci;
- if (!strcmp (component_id, COMPONENT_IID)) {
- gci = g_new (LDIFImporter, 1);
- importer = evolution_importer_new (support_format_fn, load_file_fn,
- process_item_fn, NULL, gci);
+ gci = g_new (LDIFImporter, 1);
+ importer = evolution_importer_new (support_format_fn, load_file_fn,
+ process_item_fn, NULL, gci);
- g_object_weak_ref (G_OBJECT (importer),
- importer_destroy_cb, gci);
+ gtk_signal_connect (GTK_OBJECT (importer), "destroy",
+ GTK_SIGNAL_FUNC (importer_destroy_cb), gci);
- return BONOBO_OBJECT (importer);
+ return BONOBO_OBJECT (importer);
+}
+
+static void
+importer_init (void)
+{
+ if (factory != NULL)
+ return;
+
+ factory = bonobo_generic_factory_new (COMPONENT_FACTORY_IID,
+ factory_fn, NULL);
+
+ if (factory == NULL) {
+ g_error ("Unable to create factory");
}
- else {
- g_warning (COMPONENT_FACTORY_IID ": Don't know what to do with %s", component_id);
- return NULL;
+
+ bonobo_running_context_auto_exit_unref (BONOBO_OBJECT (factory));
+}
+
+int
+main (int argc,
+ char **argv)
+{
+ CORBA_ORB orb;
+
+ gnome_init_with_popt_table ("Evolution-LDIF-Importer",
+ "0.0", argc, argv, oaf_popt_options, 0,
+ NULL);
+ orb = oaf_init (argc, argv);
+ if (bonobo_init (orb, CORBA_OBJECT_NIL, CORBA_OBJECT_NIL) == FALSE) {
+ g_error ("Could not initialize Bonobo.");
}
+
+ importer_init ();
+ bonobo_main ();
+
+ return 0;
}
-BONOBO_ACTIVATION_FACTORY (COMPONENT_FACTORY_IID, "Evolution LDIF Importer Factory", VERSION, factory_fn, NULL);
+
diff --git a/addressbook/backend/ebook/evolution-vcard-importer.c b/addressbook/backend/ebook/evolution-vcard-importer.c
index b5baebf2d1..f07192d72c 100644
--- a/addressbook/backend/ebook/evolution-vcard-importer.c
+++ b/addressbook/backend/ebook/evolution-vcard-importer.c
@@ -1,14 +1,13 @@
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
#include <config.h>
#include <stdio.h>
-#include <string.h>
+#include <liboaf/liboaf.h>
#include <bonobo/bonobo-context.h>
#include <bonobo/bonobo-generic-factory.h>
#include <bonobo/bonobo-main.h>
#include <e-book.h>
-#include <e-book-util.h>
#include <importer/evolution-importer.h>
#include <importer/GNOME_Evolution_Importer.h>
@@ -16,10 +15,12 @@
#include <e-util/e-path.h>
#define COMPONENT_FACTORY_IID "OAFIID:GNOME_Evolution_Addressbook_VCard_ImporterFactory"
-#define COMPONENT_IID "OAFIID:GNOME_Evolution_Addressbook_VCard_Importer"
+
+static BonoboGenericFactory *factory = NULL;
typedef struct {
char *filename;
+ char *folderpath;
GList *cardlist;
GList *iterator;
EBook *book;
@@ -30,7 +31,7 @@ static void
add_card_cb (EBook *book, EBookStatus status, const gchar *id, gpointer closure)
{
ECard *card = E_CARD(closure);
- g_object_unref(card);
+ gtk_object_unref(GTK_OBJECT(card));
}
static void
@@ -43,18 +44,39 @@ book_open_cb (EBook *book, EBookStatus status, gpointer closure)
}
static void
-ebook_open (VCardImporter *gci, const char *uri)
+ebook_create (VCardImporter *gci)
{
+ gchar *path, *uri;
+ gchar *epath;
+
gci->book = e_book_new ();
if (!gci->book) {
printf ("%s: %s(): Couldn't create EBook, bailing.\n",
__FILE__,
- G_GNUC_FUNCTION);
+ __FUNCTION__);
return;
}
- e_book_load_address_book_by_uri (gci->book, uri, book_open_cb, gci);
+#if 0
+ path = g_concat_dir_and_file (g_get_home_dir (), "evolution/local");
+ uri = g_strdup_printf ("file://%s", path);
+ g_free (path);
+
+ epath = e_path_to_physical (uri, gci->folderpath);
+ g_free (uri);
+ uri = g_strdup_printf ("%s/addressbook.db", epath);
+ g_free (epath);
+
+ if (! e_book_load_uri (gci->book, uri, book_open_cb, gci)) {
+ printf ("error calling load_uri!\n");
+ }
+ g_free(uri);
+#endif
+
+ if (! e_book_load_default_book (gci->book, book_open_cb, gci)) {
+ g_warning ("Error calling load_default_book");
+ }
}
/* EvolutionImporter methods */
@@ -128,7 +150,7 @@ check_file_is_vcard (const char *filename)
return FALSE;
}
- if (g_ascii_strncasecmp (line, "BEGIN:VCARD", 11) == 0) {
+ if (g_strncasecmp (line, "BEGIN:VCARD", 11) == 0) {
result = TRUE;
} else {
result = FALSE;
@@ -151,7 +173,7 @@ support_format_fn (EvolutionImporter *importer,
return check_file_is_vcard (filename);
}
for (i = 0; supported_extensions[i] != NULL; i++) {
- if (g_ascii_strcasecmp (supported_extensions[i], ext) == 0)
+ if (g_strcasecmp (supported_extensions[i], ext) == 0)
return check_file_is_vcard (filename);
}
@@ -159,16 +181,16 @@ support_format_fn (EvolutionImporter *importer,
}
static void
-importer_destroy_cb (gpointer data,
- GObject *where_object_was)
+importer_destroy_cb (GtkObject *object,
+ VCardImporter *gci)
{
- bonobo_main_quit ();
+ gtk_main_quit ();
}
static gboolean
load_file_fn (EvolutionImporter *importer,
const char *filename,
- const char *uri,
+ const char *folderpath,
void *closure)
{
VCardImporter *gci;
@@ -179,35 +201,66 @@ load_file_fn (EvolutionImporter *importer,
gci = (VCardImporter *) closure;
gci->filename = g_strdup (filename);
+ gci->folderpath = g_strdup (folderpath);
gci->cardlist = NULL;
gci->iterator = NULL;
gci->ready = FALSE;
- ebook_open (gci, uri);
+ ebook_create (gci);
return TRUE;
}
static BonoboObject *
factory_fn (BonoboGenericFactory *_factory,
- const char *component_id,
void *closure)
{
EvolutionImporter *importer;
VCardImporter *gci;
- if (!strcmp (component_id, COMPONENT_IID)) {
- gci = g_new (VCardImporter, 1);
- importer = evolution_importer_new (support_format_fn, load_file_fn,
- process_item_fn, NULL, gci);
+ gci = g_new (VCardImporter, 1);
+ importer = evolution_importer_new (support_format_fn, load_file_fn,
+ process_item_fn, NULL, gci);
+
+ gtk_signal_connect (GTK_OBJECT (importer), "destroy",
+ GTK_SIGNAL_FUNC (importer_destroy_cb), gci);
- g_object_weak_ref (G_OBJECT (importer),
- importer_destroy_cb, gci);
- return BONOBO_OBJECT (importer);
+ return BONOBO_OBJECT (importer);
+}
+
+static void
+importer_init (void)
+{
+ if (factory != NULL)
+ return;
+
+ factory = bonobo_generic_factory_new (COMPONENT_FACTORY_IID,
+ factory_fn, NULL);
+
+ if (factory == NULL) {
+ g_error ("Unable to create factory");
}
- else {
- g_warning (COMPONENT_FACTORY_IID ": Don't know what to do with %s", component_id);
- return NULL;
+
+ bonobo_running_context_auto_exit_unref (BONOBO_OBJECT (factory));
+}
+
+int
+main (int argc,
+ char **argv)
+{
+ CORBA_ORB orb;
+
+ gnome_init_with_popt_table ("Evolution-VCard-Importer",
+ PACKAGE, argc, argv, oaf_popt_options, 0,
+ NULL);
+ orb = oaf_init (argc, argv);
+ if (bonobo_init (orb, CORBA_OBJECT_NIL, CORBA_OBJECT_NIL) == FALSE) {
+ g_error ("Could not initialize Bonobo.");
}
+
+ importer_init ();
+ bonobo_main ();
+
+ return 0;
}
-BONOBO_ACTIVATION_FACTORY (COMPONENT_FACTORY_IID, "Evolution VCard Importer Factory", VERSION, factory_fn, NULL);
+
diff --git a/addressbook/backend/pas/pas-backend-file.c b/addressbook/backend/pas/pas-backend-file.c
index 06eb84cc4e..ddef2a568b 100644
--- a/addressbook/backend/pas/pas-backend-file.c
+++ b/addressbook/backend/pas/pas-backend-file.c
@@ -10,13 +10,15 @@
#include "pas-backend-file.h"
#include <stdio.h>
-#include <string.h>
#include <unistd.h>
#include <fcntl.h>
#include <time.h>
#include <db.h>
#include <sys/stat.h>
+#include <libgnome/gnome-defs.h>
+#include <libgnome/gnome-i18n.h>
+
#include <e-util/e-db3-utils.h>
#if DB_VERSION_MAJOR != 3 || \
@@ -25,14 +27,15 @@
#error Including wrong DB3. Need libdb 3.1.17.
#endif
+#include <gtk/gtksignal.h>
+#include <libgnome/gnome-defs.h>
+#include <libgnome/gnome-util.h>
#include <gal/util/e-util.h>
#include <gal/widgets/e-unicode.h>
#include <ebook/e-card-simple.h>
#include <e-util/e-dbhash.h>
#include <e-util/e-db3-utils.h>
-#include <libgnome/gnome-i18n.h>
-
#include "pas-book.h"
#include "pas-card-cursor.h"
#include "pas-backend-card-sexp.h"
@@ -51,10 +54,13 @@ typedef struct _PASBackendFileSearchContext PASBackendFileSearchContext;
typedef struct _PasBackendFileChangeContext PASBackendFileChangeContext;
struct _PASBackendFilePrivate {
+ GList *clients;
+ gboolean loaded;
char *uri;
char *filename;
DB *file_db;
EList *book_views;
+ gboolean writable;
GHashTable *address_lists;
PASBackendSummary *summary;
};
@@ -208,7 +214,7 @@ pas_backend_file_book_view_copy(const PASBackendFileBookView *book_view, void *c
new_book_view->search = g_strdup(book_view->search);
new_book_view->card_sexp = book_view->card_sexp;
if (new_book_view->card_sexp)
- g_object_ref(new_book_view->card_sexp);
+ gtk_object_ref(GTK_OBJECT(new_book_view->card_sexp));
new_book_view->change_id = g_strdup(book_view->change_id);
if (book_view->change_context) {
@@ -230,7 +236,7 @@ pas_backend_file_book_view_free(PASBackendFileBookView *book_view, void *closure
{
g_free(book_view->search);
if (book_view->card_sexp)
- g_object_unref (book_view->card_sexp);
+ gtk_object_unref (GTK_OBJECT(book_view->card_sexp));
g_free(book_view->change_id);
if (book_view->change_context) {
@@ -268,7 +274,7 @@ get_nth(PASCardCursor *cursor, long n, gpointer data)
}
static void
-cursor_destroy(gpointer data, GObject *where_object_was)
+cursor_destroy(GtkObject *object, gpointer data)
{
CORBA_Environment ev;
GNOME_Evolution_Addressbook_Book corba_book;
@@ -294,7 +300,7 @@ cursor_destroy(gpointer data, GObject *where_object_was)
}
static void
-view_destroy(gpointer data, GObject *where_object_was)
+view_destroy(GtkObject *object, gpointer data)
{
PASBook *book = (PASBook *)data;
PASBackendFile *bf;
@@ -304,7 +310,7 @@ view_destroy(gpointer data, GObject *where_object_was)
bf = PAS_BACKEND_FILE(pas_book_get_backend(book));
for (iterator = e_list_get_iterator(bf->priv->book_views); e_iterator_is_valid(iterator); e_iterator_next(iterator)) {
const PASBackendFileBookView *view = e_iterator_get(iterator);
- if (view->book_view == (PASBookView*)where_object_was) {
+ if (view->book_view == PAS_BOOK_VIEW(object)) {
e_iterator_delete(iterator);
success = TRUE;
break;
@@ -312,7 +318,7 @@ view_destroy(gpointer data, GObject *where_object_was)
}
if (!success)
g_warning ("Failed to remove from book_views list");
- g_object_unref(iterator);
+ gtk_object_unref(GTK_OBJECT(iterator));
bonobo_object_unref(BONOBO_OBJECT(book));
}
@@ -337,116 +343,6 @@ vcard_matches_search (const PASBackendFileBookView *view, char *vcard_string)
return pas_backend_card_sexp_match_vcard (view->card_sexp, vcard_string);
}
-static gboolean
-ecard_matches_search (const PASBackendFileBookView *view, ECard *card)
-{
- /* If this is not a search context view, it doesn't match be default */
- if (view->card_sexp == NULL)
- return FALSE;
-
- return pas_backend_card_sexp_match_ecard (view->card_sexp, card);
-}
-
-typedef struct {
- PASBackendFile *bf;
- PASBook *book;
- const PASBackendFileBookView *view;
- DBC *dbc;
-
- int card_count;
- int card_threshold;
- int card_threshold_max;
- GList *cards;
-
- gboolean done_first;
- gboolean search_needed;
-} FileBackendSearchClosure;
-
-static void
-free_search_closure (FileBackendSearchClosure *closure)
-{
- g_list_foreach (closure->cards, (GFunc)g_free, NULL);
- g_list_free (closure->cards);
- g_free (closure);
-}
-
-static gboolean
-pas_backend_file_search_timeout (gpointer data)
-{
- FileBackendSearchClosure *closure = data;
- int db_error = 0;
- DBT id_dbt, vcard_dbt;
- int file_version_name_len;
- DBC *dbc = closure->dbc;
-
- file_version_name_len = strlen (PAS_BACKEND_FILE_VERSION_NAME);
-
- memset (&id_dbt, 0, sizeof (id_dbt));
- memset (&vcard_dbt, 0, sizeof (vcard_dbt));
-
- if (closure->done_first) {
- db_error = dbc->c_get(dbc, &id_dbt, &vcard_dbt, DB_NEXT);
- }
- else {
- db_error = dbc->c_get(dbc, &id_dbt, &vcard_dbt, DB_FIRST);
- closure->done_first = TRUE;
- }
-
- while (db_error == 0) {
-
- /* don't include the version in the list of cards */
- if (id_dbt.size != file_version_name_len+1
- || strcmp (id_dbt.data, PAS_BACKEND_FILE_VERSION_NAME)) {
- char *vcard_string = vcard_dbt.data;
-
- /* check if the vcard matches the search sexp */
- if ((!closure->search_needed) || vcard_matches_search (closure->view, vcard_string)) {
- closure->cards = g_list_prepend (closure->cards, g_strdup (vcard_string));
- closure->card_count ++;
- }
-
- /* If we've accumulated a number of checks, pass them off to the client. */
- if (closure->card_count >= closure->card_threshold) {
- pas_book_view_notify_add (closure->view->book_view, closure->cards);
- /* Clean up the handed-off data. */
- g_list_foreach (closure->cards, (GFunc)g_free, NULL);
- g_list_free (closure->cards);
- closure->cards = NULL;
- closure->card_count = 0;
-
- /* Yeah, this scheme is overly complicated. But I like it. */
- if (closure->card_threshold < closure->card_threshold_max) {
- closure->card_threshold = MIN (2*closure->card_threshold, closure->card_threshold_max);
- }
-
- /* return here, we'll do the next lump in the next callback */
- g_timeout_add (200, pas_backend_file_search_timeout, closure);
-
- return FALSE;
- }
- }
-
- db_error = dbc->c_get(dbc, &id_dbt, &vcard_dbt, DB_NEXT);
- }
-
- dbc->c_close (dbc);
-
- if (db_error != DB_NOTFOUND) {
- g_warning ("pas_backend_file_search: error building list\n");
- free_search_closure (closure);
- }
-
- if (closure->card_count)
- pas_book_view_notify_add (closure->view->book_view, closure->cards);
-
- pas_book_view_notify_complete (closure->view->book_view, GNOME_Evolution_Addressbook_BookViewListener_Success);
-
- free_search_closure (closure);
-
- return FALSE;
-}
-
-
static void
pas_backend_file_search (PASBackendFile *bf,
PASBook *book,
@@ -456,6 +352,9 @@ pas_backend_file_search (PASBackendFile *bf,
PASBackendFileBookView *view = (PASBackendFileBookView *)cnstview;
gboolean search_needed;
+ if (!bf->priv->loaded)
+ return;
+
search_needed = TRUE;
if ( ! strcmp (view->search, "(contains \"x-evolution-any-field\" \"\")"))
@@ -467,7 +366,7 @@ pas_backend_file_search (PASBackendFile *bf,
pas_book_view_notify_status_message (view->book_view, _("Loading..."));
if (view->card_sexp) {
- g_object_unref (view->card_sexp);
+ gtk_object_unref (GTK_OBJECT(view->card_sexp));
view->card_sexp = NULL;
}
@@ -482,24 +381,74 @@ pas_backend_file_search (PASBackendFile *bf,
do_summary_query (bf, view, completion_search);
}
else {
- FileBackendSearchClosure *closure = g_new0 (FileBackendSearchClosure, 1);
- DB *db = bf->priv->file_db;
- int db_error;
+ gint card_count = 0, card_threshold = 20, card_threshold_max = 3000;
+ int db_error = 0;
+ GList *cards = NULL;
+ DB *db = bf->priv->file_db;
+ DBC *dbc;
+ DBT id_dbt, vcard_dbt;
+ int file_version_name_len;
+
+ file_version_name_len = strlen (PAS_BACKEND_FILE_VERSION_NAME);
- closure->card_threshold = 20;
- closure->card_threshold_max = 3000;
- closure->search_needed = search_needed;
- closure->view = view;
- closure->bf = bf;
- closure->book = book;
+ db_error = db->cursor (db, NULL, &dbc, 0);
- db_error = db->cursor (db, NULL, &closure->dbc, 0);
+ memset (&id_dbt, 0, sizeof (id_dbt));
+ memset (&vcard_dbt, 0, sizeof (vcard_dbt));
if (db_error != 0) {
g_warning ("pas_backend_file_search: error building list\n");
} else {
- g_idle_add (pas_backend_file_search_timeout, closure);
+ db_error = dbc->c_get(dbc, &id_dbt, &vcard_dbt, DB_FIRST);
+
+ while (db_error == 0) {
+
+ /* don't include the version in the list of cards */
+ if (id_dbt.size != file_version_name_len+1
+ || strcmp (id_dbt.data, PAS_BACKEND_FILE_VERSION_NAME)) {
+ char *vcard_string = vcard_dbt.data;
+
+ /* check if the vcard matches the search sexp */
+ if ((!search_needed) || vcard_matches_search (view, vcard_string)) {
+ cards = g_list_prepend (cards, g_strdup (vcard_string));
+ card_count ++;
+ }
+
+ /* If we've accumulated a number of checks, pass them off to the client. */
+ if (card_count >= card_threshold) {
+ pas_book_view_notify_add (view->book_view, cards);
+ /* Clean up the handed-off data. */
+ g_list_foreach (cards, (GFunc)g_free, NULL);
+ g_list_free (cards);
+ cards = NULL;
+ card_count = 0;
+
+ /* Yeah, this scheme is overly complicated. But I like it. */
+ if (card_threshold < card_threshold_max) {
+ card_threshold = MIN (2*card_threshold, card_threshold_max);
+ }
+ }
+ }
+
+ db_error = dbc->c_get(dbc, &id_dbt, &vcard_dbt, DB_NEXT);
+ }
+ dbc->c_close (dbc);
+
+ if (db_error != DB_NOTFOUND) {
+ g_warning ("pas_backend_file_search: error building list\n");
+ }
}
+
+ if (card_count)
+ pas_book_view_notify_add (view->book_view, cards);
+
+ pas_book_view_notify_complete (view->book_view, GNOME_Evolution_Addressbook_BookViewListener_Success);
+
+ /*
+ ** It's fine to do this now since the data has been handed off.
+ */
+ g_list_foreach (cards, (GFunc)g_free, NULL);
+ g_list_free (cards);
}
}
@@ -541,6 +490,9 @@ pas_backend_file_changes (PASBackendFile *bf,
memset (&id_dbt, 0, sizeof (id_dbt));
memset (&vcard_dbt, 0, sizeof (vcard_dbt));
+ if (!bf->priv->loaded)
+ return;
+
/* Find the changed ids */
dirname = g_strdup (bf->priv->filename);
slash = strrchr (dirname, '/');
@@ -572,9 +524,9 @@ pas_backend_file_changes (PASBackendFile *bf,
* card changing
*/
card = e_card_new (vcard_dbt.data);
- g_object_set (card, "last_use", NULL, "use_score", 0.0, NULL);
+ gtk_object_set (GTK_OBJECT (card), "last_use", NULL, "use_score", 0.0, NULL);
vcard_string = e_card_get_vcard_assume_utf8 (card);
- g_object_unref (card);
+ gtk_object_unref (GTK_OBJECT (card));
/* check what type of change has occurred, if any */
switch (e_dbhash_compare (ehash, id, vcard_string)) {
@@ -612,7 +564,7 @@ pas_backend_file_changes (PASBackendFile *bf,
for (v = ctx->del_ids; v != NULL; v = v->next){
char *id = v->data;
- pas_book_view_notify_remove_1 (view->book_view, id);
+ pas_book_view_notify_remove (view->book_view, id);
}
pas_book_view_notify_complete (view->book_view, GNOME_Evolution_Addressbook_BookViewListener_Success);
@@ -684,7 +636,7 @@ do_create(PASBackend *backend,
ret_val = NULL;
}
- g_object_unref(card);
+ gtk_object_unref(GTK_OBJECT(card));
card = NULL;
if (vcard_ptr && ret_val)
@@ -716,7 +668,7 @@ pas_backend_file_process_create_card (PASBackend *backend,
bonobo_object_unref (BONOBO_OBJECT (view->book_view));
}
}
- g_object_unref(iterator);
+ gtk_object_unref(GTK_OBJECT(iterator));
pas_book_respond_create (
book,
@@ -739,76 +691,59 @@ pas_backend_file_process_create_card (PASBackend *backend,
}
static void
-pas_backend_file_process_remove_cards (PASBackend *backend,
- PASBook *book,
- PASRemoveCardsRequest *req)
+pas_backend_file_process_remove_card (PASBackend *backend,
+ PASBook *book,
+ PASRemoveCardRequest *req)
{
PASBackendFile *bf = PAS_BACKEND_FILE (backend);
DB *db = bf->priv->file_db;
DBT id_dbt, vcard_dbt;
int db_error;
EIterator *iterator;
+ char *vcard_string;
const char *id;
- GList *l;
- GList *removed_cards = NULL;
- GNOME_Evolution_Addressbook_BookListener_CallStatus rv = GNOME_Evolution_Addressbook_BookListener_Success;
-
- for (l = req->ids; l; l = l->next) {
- id = l->data;
- string_to_dbt (id, &id_dbt);
- memset (&vcard_dbt, 0, sizeof (vcard_dbt));
+ id = req->id;
+ string_to_dbt (id, &id_dbt);
+ memset (&vcard_dbt, 0, sizeof (vcard_dbt));
- db_error = db->get (db, NULL, &id_dbt, &vcard_dbt, 0);
- if (0 != db_error) {
- rv = GNOME_Evolution_Addressbook_BookListener_CardNotFound;
- continue;
- }
+ db_error = db->get (db, NULL, &id_dbt, &vcard_dbt, 0);
+ if (0 != db_error) {
+ pas_book_respond_remove (
+ book,
+ GNOME_Evolution_Addressbook_BookListener_CardNotFound);
+ return;
+ }
- db_error = db->del (db, NULL, &id_dbt, 0);
- if (0 != db_error) {
- rv = GNOME_Evolution_Addressbook_BookListener_CardNotFound;
- continue;
- }
-
- removed_cards = g_list_prepend (removed_cards, e_card_new (vcard_dbt.data));
+ db_error = db->del (db, NULL, &id_dbt, 0);
+ if (0 != db_error) {
+ pas_book_respond_remove (
+ book,
+ GNOME_Evolution_Addressbook_BookListener_CardNotFound);
+ return;
}
- /* if we actually removed some, try to sync */
- if (removed_cards) {
- db_error = db->sync (db, 0);
- if (db_error != 0)
- g_warning ("db->sync failed.\n");
- }
+ db_error = db->sync (db, 0);
+ if (db_error != 0)
+ g_warning ("db->sync failed.\n");
+
+ vcard_string = vcard_dbt.data;
for (iterator = e_list_get_iterator (bf->priv->book_views); e_iterator_is_valid(iterator); e_iterator_next(iterator)) {
const PASBackendFileBookView *view = e_iterator_get(iterator);
- GList *view_removed = NULL;
- for (l = removed_cards; l; l = l->next) {
- ECard *removed_card = l->data;
- if (ecard_matches_search (view, removed_card)) {
- view_removed = g_list_prepend (view_removed, (char*)e_card_get_id (removed_card));
- }
- }
- if (view_removed) {
+ if (vcard_matches_search (view, vcard_string)) {
bonobo_object_ref (BONOBO_OBJECT (view->book_view));
- pas_book_view_notify_remove (view->book_view, view_removed);
+ pas_book_view_notify_remove (view->book_view, req->id);
pas_book_view_notify_complete (view->book_view, GNOME_Evolution_Addressbook_BookViewListener_Success);
bonobo_object_unref (BONOBO_OBJECT (view->book_view));
- g_list_free (view_removed);
}
}
- g_object_unref(iterator);
+ gtk_object_unref(GTK_OBJECT(iterator));
- pas_book_respond_remove (book, rv);
-
- for (l = removed_cards; l; l = l->next) {
- ECard *c = l->data;
- pas_backend_summary_remove_card (bf->priv->summary, e_card_get_id (c));
- g_object_unref (c);
- }
-
- g_list_free (removed_cards);
+ pas_book_respond_remove (
+ book,
+ GNOME_Evolution_Addressbook_BookListener_Success);
+ pas_backend_summary_remove_card (bf->priv->summary, id);
}
static void
@@ -878,7 +813,7 @@ pas_backend_file_process_modify_card (PASBackend *backend,
else if (new_match)
pas_book_view_notify_add_1 (view->book_view, req->vcard);
else /* if (old_match) */
- pas_book_view_notify_remove_1 (view->book_view, id);
+ pas_book_view_notify_remove (view->book_view, id);
pas_book_view_notify_complete (view->book_view, GNOME_Evolution_Addressbook_BookViewListener_Success);
@@ -887,7 +822,7 @@ pas_backend_file_process_modify_card (PASBackend *backend,
CORBA_exception_free (&ev);
}
- g_object_unref(iterator);
+ gtk_object_unref(GTK_OBJECT(iterator));
pas_book_respond_modify (
book,
@@ -904,7 +839,7 @@ pas_backend_file_process_modify_card (PASBackend *backend,
g_free(old_vcard_string);
- g_object_unref(card);
+ gtk_object_unref(GTK_OBJECT(card));
}
static void
@@ -1038,8 +973,8 @@ pas_backend_file_process_get_cursor (PASBackend *backend,
get_nth,
cursor_data);
- g_object_weak_ref (G_OBJECT (cursor),
- cursor_destroy, cursor_data);
+ gtk_signal_connect(GTK_OBJECT(cursor), "destroy",
+ GTK_SIGNAL_FUNC(cursor_destroy), cursor_data);
pas_book_respond_get_cursor (
book,
@@ -1059,11 +994,14 @@ pas_backend_file_process_get_book_view (PASBackend *backend,
PASBackendFileBookView view;
EIterator *iterator;
+ g_return_if_fail (req->listener != NULL);
+
bonobo_object_ref(BONOBO_OBJECT(book));
book_view = pas_book_view_new (req->listener);
- g_object_weak_ref (G_OBJECT (book_view), view_destroy, book);
+ gtk_signal_connect(GTK_OBJECT(book_view), "destroy",
+ GTK_SIGNAL_FUNC(view_destroy), book);
view.book_view = book_view;
view.search = g_strdup (req->search);
@@ -1079,13 +1017,10 @@ pas_backend_file_process_get_book_view (PASBackend *backend,
: GNOME_Evolution_Addressbook_BookListener_CardNotFound /* XXX */),
book_view);
- if (!pas_backend_is_loaded (backend))
- return;
-
iterator = e_list_get_iterator(bf->priv->book_views);
e_iterator_last(iterator);
pas_backend_file_search (bf, book, e_iterator_get(iterator), FALSE);
- g_object_unref(iterator);
+ gtk_object_unref(GTK_OBJECT(iterator));
}
static void
@@ -1098,11 +1033,14 @@ pas_backend_file_process_get_completion_view (PASBackend *backend,
PASBackendFileBookView view;
EIterator *iterator;
+ g_return_if_fail (req->listener != NULL);
+
bonobo_object_ref(BONOBO_OBJECT(book));
book_view = pas_book_view_new (req->listener);
- g_object_weak_ref (G_OBJECT (book_view), view_destroy, book);
+ gtk_signal_connect(GTK_OBJECT(book_view), "destroy",
+ GTK_SIGNAL_FUNC(view_destroy), book);
view.book_view = book_view;
view.search = g_strdup (req->search);
@@ -1118,13 +1056,10 @@ pas_backend_file_process_get_completion_view (PASBackend *backend,
: GNOME_Evolution_Addressbook_BookListener_CardNotFound /* XXX */),
book_view);
- if (!pas_backend_is_loaded (backend))
- return;
-
iterator = e_list_get_iterator(bf->priv->book_views);
e_iterator_last(iterator);
pas_backend_file_search (bf, book, e_iterator_get(iterator), TRUE);
- g_object_unref(iterator);
+ gtk_object_unref(GTK_OBJECT(iterator));
}
static void
@@ -1138,11 +1073,14 @@ pas_backend_file_process_get_changes (PASBackend *backend,
PASBackendFileChangeContext ctx;
EIterator *iterator;
+ g_return_if_fail (req->listener != NULL);
+
bonobo_object_ref(BONOBO_OBJECT(book));
book_view = pas_book_view_new (req->listener);
- g_object_weak_ref (G_OBJECT (book_view), view_destroy, book);
+ gtk_signal_connect(GTK_OBJECT(book_view), "destroy",
+ GTK_SIGNAL_FUNC(view_destroy), book);
pas_book_respond_get_changes (book,
(book_view != NULL
@@ -1164,13 +1102,10 @@ pas_backend_file_process_get_changes (PASBackend *backend,
e_list_append(bf->priv->book_views, &view);
- if (!pas_backend_is_loaded (backend))
- return;
-
iterator = e_list_get_iterator(bf->priv->book_views);
e_iterator_last(iterator);
pas_backend_file_changes (bf, book, e_iterator_get(iterator));
- g_object_unref(iterator);
+ gtk_object_unref(GTK_OBJECT(iterator));
}
static void
@@ -1219,14 +1154,85 @@ pas_backend_file_process_get_supported_fields (PASBackend *backend,
for (i = 0; i < E_CARD_SIMPLE_FIELD_LAST; i ++)
e_list_append (fields, e_card_simple_get_ecard_field (simple, i));
- g_object_unref (card);
- g_object_unref (simple);
+ gtk_object_unref (GTK_OBJECT (card));
+ gtk_object_unref (GTK_OBJECT (simple));
pas_book_respond_get_supported_fields (book,
GNOME_Evolution_Addressbook_BookListener_Success,
fields);
}
+static void
+pas_backend_file_process_client_requests (PASBook *book)
+{
+ PASBackend *backend;
+ PASRequest *req;
+
+ backend = pas_book_get_backend (book);
+
+ req = pas_book_pop_request (book);
+ if (req == NULL)
+ return;
+
+ switch (req->op) {
+ case CreateCard:
+ pas_backend_file_process_create_card (backend, book, (PASCreateCardRequest*)req);
+ break;
+
+ case RemoveCard:
+ pas_backend_file_process_remove_card (backend, book, (PASRemoveCardRequest*)req);
+ break;
+
+ case ModifyCard:
+ pas_backend_file_process_modify_card (backend, book, (PASModifyCardRequest*)req);
+ break;
+
+ case CheckConnection:
+ pas_backend_file_process_check_connection (backend, book, (PASCheckConnectionRequest*)req);
+ break;
+
+ case GetVCard:
+ pas_backend_file_process_get_vcard (backend, book, (PASGetVCardRequest*)req);
+ break;
+
+ case GetCursor:
+ pas_backend_file_process_get_cursor (backend, book, (PASGetCursorRequest*)req);
+ break;
+
+ case GetBookView:
+ pas_backend_file_process_get_book_view (backend, book, (PASGetBookViewRequest*)req);
+ break;
+
+ case GetCompletionView:
+ pas_backend_file_process_get_completion_view (backend, book, (PASGetCompletionViewRequest*)req);
+ break;
+
+ case GetChanges:
+ pas_backend_file_process_get_changes (backend, book, (PASGetChangesRequest*)req);
+ break;
+
+ case AuthenticateUser:
+ pas_backend_file_process_authenticate_user (backend, book, (PASAuthenticateUserRequest*)req);
+ break;
+
+ case GetSupportedFields:
+ pas_backend_file_process_get_supported_fields (backend, book, (PASGetSupportedFieldsRequest*)req);
+ break;
+ }
+
+ pas_book_free_request (req);
+}
+
+static void
+pas_backend_file_book_destroy_cb (PASBook *book, gpointer data)
+{
+ PASBackendFile *backend;
+
+ backend = PAS_BACKEND_FILE (data);
+
+ pas_backend_remove_client (PAS_BACKEND (backend), book);
+}
+
/*
** versions:
**
@@ -1301,7 +1307,7 @@ pas_backend_file_upgrade_db (PASBackendFile *bf, char *old_version)
card_failed++;
}
- g_object_unref (card);
+ gtk_object_unref (GTK_OBJECT(card));
}
db_error = dbc->c_get(dbc, &id_dbt, &vcard_dbt, DB_NEXT);
@@ -1353,10 +1359,11 @@ pas_backend_file_maybe_upgrade_db (PASBackendFile *bf)
return ret_val;
}
+
#define INITIAL_VCARD "BEGIN:VCARD\n\
X-EVOLUTION-FILE-AS:Ximian, Inc.\n\
LABEL;WORK;QUOTED-PRINTABLE:401 Park Drive 3 West=0ABoston, MA 02215=0AUSA\n\
-TEL;WORK;VOICE:(617) 375-3800\n\
+TEL;WORK;VOICE:(617) 236-0442\n\
TEL;WORK;FAX:(617) 236-8630\n\
EMAIL;INTERNET:hello@ximian.com\n\
URL:www.ximian.com/\n\
@@ -1378,6 +1385,8 @@ pas_backend_file_load_uri (PASBackend *backend,
struct stat sb;
char *summary_filename;
+ g_assert (bf->priv->loaded == FALSE);
+
db_version (&major, &minor, &patch);
if (major != 3 ||
@@ -1422,10 +1431,10 @@ pas_backend_file_load_uri (PASBackend *backend,
char *create_initial_file;
char *dir;
- dir = g_path_get_dirname(filename);
- create_initial_file = g_build_filename (dir, "create-initial", NULL);
+ dir = g_dirname(filename);
+ create_initial_file = g_concat_dir_and_file(dir, "create-initial");
- if (g_file_test(create_initial_file, G_FILE_TEST_EXISTS)) {
+ if (g_file_exists(create_initial_file)) {
char *id;
id = do_create(backend, INITIAL_VCARD, NULL);
g_free (id);
@@ -1444,9 +1453,14 @@ pas_backend_file_load_uri (PASBackend *backend,
return GNOME_Evolution_Addressbook_BookListener_OtherError;
}
- if (!pas_backend_file_maybe_upgrade_db (bf)) {
+ bf->priv->writable = writable;
+
+ if (pas_backend_file_maybe_upgrade_db (bf))
+ bf->priv->loaded = TRUE;
+ else {
db->close (db, 0);
bf->priv->file_db = NULL;
+ bf->priv->writable = FALSE;
return GNOME_Evolution_Addressbook_BookListener_OtherError;
}
@@ -1459,6 +1473,7 @@ pas_backend_file_load_uri (PASBackend *backend,
if (stat (bf->priv->filename, &sb) == -1) {
db->close (db, 0);
bf->priv->file_db = NULL;
+ bf->priv->writable = FALSE;
return GNOME_Evolution_Addressbook_BookListener_OtherError;
}
db_mtime = sb.st_mtime;
@@ -1472,8 +1487,6 @@ pas_backend_file_load_uri (PASBackend *backend,
build_summary (bf->priv);
}
- pas_backend_set_is_loaded (backend, TRUE);
- pas_backend_set_is_writable (backend, writable);
return GNOME_Evolution_Addressbook_BookListener_Success;
}
@@ -1485,15 +1498,99 @@ pas_backend_file_get_uri (PASBackend *backend)
bf = PAS_BACKEND_FILE (backend);
+ g_return_val_if_fail (bf->priv->loaded, NULL);
g_assert (bf->priv->uri != NULL);
return bf->priv->uri;
}
+static gboolean
+pas_backend_file_add_client (PASBackend *backend,
+ GNOME_Evolution_Addressbook_BookListener listener)
+{
+ PASBackendFile *bf;
+ PASBook *book;
+
+ g_assert (backend != NULL);
+ g_assert (PAS_IS_BACKEND_FILE (backend));
+
+ bf = PAS_BACKEND_FILE (backend);
+
+ book = pas_book_new (backend, listener);
+
+ if (!book) {
+ if (!bf->priv->clients)
+ pas_backend_last_client_gone (backend);
+
+ return FALSE;
+ }
+
+ gtk_signal_connect (GTK_OBJECT (book), "destroy",
+ pas_backend_file_book_destroy_cb, backend);
+
+ gtk_signal_connect (GTK_OBJECT (book), "requests_queued",
+ pas_backend_file_process_client_requests, NULL);
+
+ bf->priv->clients = g_list_prepend (
+ bf->priv->clients, book);
+
+ if (bf->priv->loaded) {
+ pas_book_respond_open (
+ book, GNOME_Evolution_Addressbook_BookListener_Success);
+ if (bf->priv->writable)
+ pas_book_report_writable (book, bf->priv->writable);
+ } else {
+ pas_book_respond_open (
+ book, GNOME_Evolution_Addressbook_BookListener_OtherError);
+ }
+
+ bonobo_object_unref (BONOBO_OBJECT (book));
+
+ return TRUE;
+}
+
+static void
+pas_backend_file_remove_client (PASBackend *backend,
+ PASBook *book)
+{
+ PASBackendFile *bf;
+ GList *l;
+ PASBook *lbook;
+
+ g_return_if_fail (backend != NULL);
+ g_return_if_fail (PAS_IS_BACKEND_FILE (backend));
+ g_return_if_fail (book != NULL);
+ g_return_if_fail (PAS_IS_BOOK (book));
+
+ bf = PAS_BACKEND_FILE (backend);
+
+ /* Find the book in the list of clients */
+
+ for (l = bf->priv->clients; l; l = l->next) {
+ lbook = PAS_BOOK (l->data);
+
+ if (lbook == book)
+ break;
+ }
+
+ g_assert (l != NULL);
+
+ /* Disconnect */
+
+ bf->priv->clients = g_list_remove_link (bf->priv->clients, l);
+ g_list_free_1 (l);
+
+ /* When all clients go away, notify the parent factory about it so that
+ * it may decide whether to kill the backend or not.
+ */
+ if (!bf->priv->clients)
+ pas_backend_last_client_gone (backend);
+}
+
static char *
-pas_backend_file_get_static_capabilities (PASBackend *backend)
+pas_backend_file_get_static_capabilities (PASBackend *backend)
{
- return g_strdup("local,do-initial-query,bulk-removes");
+ return g_strdup("local,do-initial-query,cache-completions");
}
static gboolean
@@ -1516,10 +1613,10 @@ pas_backend_file_new (void)
{
PASBackendFile *backend;
- backend = g_object_new (PAS_TYPE_BACKEND_FILE, NULL);
+ backend = gtk_type_new (pas_backend_file_get_type ());
if (! pas_backend_file_construct (backend)) {
- g_object_unref (backend);
+ gtk_object_unref (GTK_OBJECT (backend));
return NULL;
}
@@ -1528,53 +1625,40 @@ pas_backend_file_new (void)
}
static void
-pas_backend_file_dispose (GObject *object)
+pas_backend_file_destroy (GtkObject *object)
{
PASBackendFile *bf;
bf = PAS_BACKEND_FILE (object);
- if (bf->priv) {
- g_object_unref(bf->priv->book_views);
- g_object_unref(bf->priv->summary);
- g_free (bf->priv->uri);
- g_free (bf->priv->filename);
+ gtk_object_unref(GTK_OBJECT(bf->priv->book_views));
+ gtk_object_unref(GTK_OBJECT(bf->priv->summary));
+ g_free (bf->priv->uri);
+ g_free (bf->priv->filename);
- g_free (bf->priv);
- bf->priv = NULL;
- }
+ g_free (bf->priv);
- G_OBJECT_CLASS (pas_backend_file_parent_class)->dispose (object);
+ GTK_OBJECT_CLASS (pas_backend_file_parent_class)->destroy (object);
}
static void
pas_backend_file_class_init (PASBackendFileClass *klass)
{
- GObjectClass *object_class = G_OBJECT_CLASS (klass);
+ GtkObjectClass *object_class = (GtkObjectClass *) klass;
PASBackendClass *parent_class;
- pas_backend_file_parent_class = g_type_class_peek_parent (klass);
+ pas_backend_file_parent_class = gtk_type_class (pas_backend_get_type ());
parent_class = PAS_BACKEND_CLASS (klass);
/* Set the virtual methods. */
parent_class->load_uri = pas_backend_file_load_uri;
parent_class->get_uri = pas_backend_file_get_uri;
+ parent_class->add_client = pas_backend_file_add_client;
+ parent_class->remove_client = pas_backend_file_remove_client;
parent_class->get_static_capabilities = pas_backend_file_get_static_capabilities;
- parent_class->create_card = pas_backend_file_process_create_card;
- parent_class->remove_cards = pas_backend_file_process_remove_cards;
- parent_class->modify_card = pas_backend_file_process_modify_card;
- parent_class->check_connection = pas_backend_file_process_check_connection;
- parent_class->get_vcard = pas_backend_file_process_get_vcard;
- parent_class->get_cursor = pas_backend_file_process_get_cursor;
- parent_class->get_book_view = pas_backend_file_process_get_book_view;
- parent_class->get_completion_view = pas_backend_file_process_get_completion_view;
- parent_class->get_changes = pas_backend_file_process_get_changes;
- parent_class->authenticate_user = pas_backend_file_process_authenticate_user;
- parent_class->get_supported_fields = pas_backend_file_process_get_supported_fields;
-
- object_class->dispose = pas_backend_file_dispose;
+ object_class->destroy = pas_backend_file_destroy;
}
static void
@@ -1583,8 +1667,11 @@ pas_backend_file_init (PASBackendFile *backend)
PASBackendFilePrivate *priv;
priv = g_new0 (PASBackendFilePrivate, 1);
+ priv->loaded = FALSE;
+ priv->clients = NULL;
priv->book_views = e_list_new((EListCopyFunc) pas_backend_file_book_view_copy, (EListFreeFunc) pas_backend_file_book_view_free, NULL);
priv->uri = NULL;
+ priv->writable = FALSE;
backend->priv = priv;
}
@@ -1592,25 +1679,24 @@ pas_backend_file_init (PASBackendFile *backend)
/**
* pas_backend_file_get_type:
*/
-GType
+GtkType
pas_backend_file_get_type (void)
{
- static GType type = 0;
+ static GtkType type = 0;
if (! type) {
- GTypeInfo info = {
- sizeof (PASBackendFileClass),
- NULL, /* base_class_init */
- NULL, /* base_class_finalize */
- (GClassInitFunc) pas_backend_file_class_init,
- NULL, /* class_finalize */
- NULL, /* class_data */
+ GtkTypeInfo info = {
+ "PASBackendFile",
sizeof (PASBackendFile),
- 0, /* n_preallocs */
- (GInstanceInitFunc) pas_backend_file_init
+ sizeof (PASBackendFileClass),
+ (GtkClassInitFunc) pas_backend_file_class_init,
+ (GtkObjectInitFunc) pas_backend_file_init,
+ NULL, /* reserved 1 */
+ NULL, /* reserved 2 */
+ (GtkClassInitFunc) NULL
};
- type = g_type_register_static (PAS_TYPE_BACKEND, "PASBackendFile", &info, 0);
+ type = gtk_type_unique (pas_backend_get_type (), &info);
}
return type;
diff --git a/addressbook/backend/pas/pas-backend-ldap.c b/addressbook/backend/pas/pas-backend-ldap.c
index 237bc8597c..866bad8148 100644
--- a/addressbook/backend/pas/pas-backend-ldap.c
+++ b/addressbook/backend/pas/pas-backend-ldap.c
@@ -10,7 +10,10 @@
#include "config.h"
#include <fcntl.h>
-#include <string.h>
+#include <gtk/gtksignal.h>
+
+#include <libgnome/gnome-defs.h>
+#include <libgnome/gnome-i18n.h>
#ifdef DEBUG
#define LDAP_DEBUG
@@ -35,7 +38,6 @@
#include <e-util/e-sexp.h>
#include <ebook/e-card-simple.h>
-#include <libgnome/gnome-i18n.h>
#include "pas-backend-ldap.h"
#include "pas-backend-card-sexp.h"
@@ -44,9 +46,6 @@
#include <stdlib.h>
-/* this is broken currently, don't enable it */
-/*#define ENABLE_SASL_BINDS*/
-
typedef enum {
PAS_BACKEND_LDAP_TLS_NO,
PAS_BACKEND_LDAP_TLS_ALWAYS,
@@ -88,6 +87,7 @@ typedef struct LDAPOp LDAPOp;
struct _PASBackendLDAPPrivate {
char *uri;
gboolean connected;
+ GList *clients;
gchar *ldap_host; /* the hostname of the server */
int ldap_port; /* the port of the server */
@@ -112,7 +112,6 @@ struct _PASBackendLDAPPrivate {
LDAP *ldap;
EList *supported_fields;
- EList *supported_auth_methods;
/* whether or not there's support for the objectclass we need
to store all our additional fields */
@@ -120,6 +119,8 @@ struct _PASBackendLDAPPrivate {
gboolean calEntrySupported;
gboolean evolutionPersonChecked;
+ gboolean writable;
+
/* our operations */
GHashTable *id_to_op;
int active_ops;
@@ -293,7 +294,7 @@ remove_view (int msgid, LDAPOp *op, PASBookView *view)
}
static void
-view_destroy(gpointer data, GObject *where_object_was)
+view_destroy(GtkObject *object, gpointer data)
{
PASBook *book = (PASBook *)data;
PASBackendLDAP *bl;
@@ -306,7 +307,7 @@ view_destroy(gpointer data, GObject *where_object_was)
while (e_iterator_is_valid (iter)) {
PASBackendLDAPBookView *view = (PASBackendLDAPBookView*)e_iterator_get (iter);
- if (view->book_view == (PASBookView*)where_object_was) {
+ if (view->book_view == PAS_BOOK_VIEW(object)) {
GNOME_Evolution_Addressbook_Book corba_book;
CORBA_Environment ev;
@@ -321,7 +322,7 @@ view_destroy(gpointer data, GObject *where_object_was)
/* free up the view structure */
g_free (view->search);
- g_object_unref (view->card_sexp);
+ gtk_object_unref (GTK_OBJECT (view->card_sexp));
g_free (view);
/* and remove it from our list */
@@ -346,7 +347,7 @@ view_destroy(gpointer data, GObject *where_object_was)
e_iterator_next (iter);
}
- g_object_unref (iter);
+ gtk_object_unref (GTK_OBJECT (iter));
}
@@ -371,7 +372,7 @@ find_book_view (PASBackendLDAP *bl)
rv = v->book_view;
}
- g_object_unref (iter);
+ gtk_object_unref (GTK_OBJECT (iter));
return rv;
}
@@ -457,20 +458,20 @@ check_schema_support (PASBackendLDAP *bl)
continue;
for (j = 0; oc->oc_names[j]; j++)
- if (!g_ascii_strcasecmp (oc->oc_names[j], EVOLUTIONPERSON)) {
+ if (!g_strcasecmp (oc->oc_names[j], EVOLUTIONPERSON)) {
g_print ("support found on ldap server for objectclass evolutionPerson\n");
bl->priv->evolutionPersonSupported = TRUE;
add_oc_attributes_to_supported_fields (bl, oc);
}
- else if (!g_ascii_strcasecmp (oc->oc_names[j], CALENTRY)) {
+ else if (!g_strcasecmp (oc->oc_names[j], CALENTRY)) {
g_print ("support found on ldap server for objectclass calEntry\n");
bl->priv->calEntrySupported = TRUE;
add_oc_attributes_to_supported_fields (bl, oc);
}
- else if (!g_ascii_strcasecmp (oc->oc_names[j], INETORGPERSON)
- || !g_ascii_strcasecmp (oc->oc_names[j], ORGANIZATIONALPERSON)
- || !g_ascii_strcasecmp (oc->oc_names[j], PERSON)) {
+ else if (!g_strcasecmp (oc->oc_names[j], INETORGPERSON)
+ || !g_strcasecmp (oc->oc_names[j], ORGANIZATIONALPERSON)
+ || !g_strcasecmp (oc->oc_names[j], PERSON)) {
add_oc_attributes_to_supported_fields (bl, oc);
}
@@ -487,7 +488,7 @@ check_schema_support (PASBackendLDAP *bl)
of draconian acl's that keep subschema
reads from working until the user is
authed. */
- if (!pas_backend_is_writable (PAS_BACKEND (bl))) {
+ if (!bl->priv->writable) {
g_warning ("subschema read returned nothing before successful auth");
bl->priv->evolutionPersonChecked = FALSE;
}
@@ -590,25 +591,8 @@ query_ldap_root_dse (PASBackendLDAP *bl)
values = ldap_get_values (ldap, resp, "supportedSASLMechanisms");
if (values) {
- char *auth_method;
- if (bl->priv->supported_auth_methods)
- g_object_unref (bl->priv->supported_auth_methods);
- bl->priv->supported_auth_methods = e_list_new ((EListCopyFunc)g_strdup, (EListFreeFunc)g_free, NULL);
-
- auth_method = g_strdup_printf ("ldap/simple-binddn|%s", _("Using Distinguished Name (DN)"));
- e_list_append (bl->priv->supported_auth_methods, auth_method);
- g_free (auth_method);
-
- auth_method = g_strdup_printf ("ldap/simple-email|%s", _("Using Email Address"));
- e_list_append (bl->priv->supported_auth_methods, auth_method);
- g_free (auth_method);
-
- for (i = 0; values[i]; i++) {
- auth_method = g_strdup_printf ("sasl/%s|%s", values[i], values[i]);
- e_list_append (bl->priv->supported_auth_methods, auth_method);
- g_free (auth_method);
+ for (i = 0; values[i]; i++)
g_message ("supported SASL mechanism: %s", values[i]);
- }
ldap_value_free (values);
}
@@ -721,7 +705,6 @@ pas_backend_ldap_connect (PASBackendLDAP *bl)
if (!bl->priv->evolutionPersonChecked)
check_schema_support (bl);
- pas_backend_set_is_loaded (PAS_BACKEND (bl), TRUE);
return GNOME_Evolution_Addressbook_BookListener_Success;
}
else
@@ -1051,7 +1034,7 @@ static void
add_objectclass_mod (PASBackendLDAP *bl, GPtrArray *mod_array, GList *existing_objectclasses)
{
#define FIND_INSERT(oc) \
- if (!g_list_find_custom (existing_objectclasses, (oc), (GCompareFunc)g_ascii_strcasecmp)) \
+ if (!g_list_find_custom (existing_objectclasses, (oc), (GCompareFunc)g_strcasecmp)) \
g_ptr_array_add (objectclasses, g_strdup ((oc)))
#define INSERT(oc) \
g_ptr_array_add (objectclasses, g_strdup ((oc)))
@@ -1167,7 +1150,7 @@ create_card_handler (LDAPOp *op, LDAPMessage *res)
e_iterator_next (iter);
}
- g_object_unref (iter);
+ gtk_object_unref (GTK_OBJECT (iter));
}
else {
ldap_perror (ldap, "create_card");
@@ -1191,14 +1174,14 @@ create_card_dtor (LDAPOp *op)
LDAPCreateOp *create_op = (LDAPCreateOp*)op;
g_free (create_op->dn);
- g_object_unref (create_op->new_card);
+ gtk_object_unref (GTK_OBJECT (create_op->new_card));
g_free (create_op);
}
static void
pas_backend_ldap_process_create_card (PASBackend *backend,
PASBook *book,
- PASCreateCardRequest *req)
+ PASRequest *req)
{
LDAPCreateOp *create_op = g_new (LDAPCreateOp, 1);
PASBackendLDAP *bl = PAS_BACKEND_LDAP (backend);
@@ -1213,9 +1196,9 @@ pas_backend_ldap_process_create_card (PASBackend *backend,
book_view = find_book_view (bl);
- printf ("vcard = %s\n", req->vcard);
+ printf ("vcard = %s\n", req->create.vcard);
- new_ecard = e_card_new (req->vcard);
+ new_ecard = e_card_new (req->create.vcard);
create_op->new_card = e_card_simple_new (new_ecard);
create_op->dn = create_dn_from_ecard (create_op->new_card, bl->priv->ldap_rootdn);
@@ -1235,7 +1218,7 @@ pas_backend_ldap_process_create_card (PASBackend *backend,
create_op->dn);
g_free (create_op->dn);
- g_object_unref (create_op->new_card);
+ gtk_object_unref (GTK_OBJECT(create_op->new_card));
g_free (create_op);
return;
}
@@ -1350,13 +1333,13 @@ remove_card_handler (LDAPOp *op, LDAPMessage *res)
bonobo_object_dup_ref(bonobo_object_corba_objref(BONOBO_OBJECT(view->book_view)), &ev);
- pas_book_view_notify_remove_1 (view->book_view, remove_op->id);
+ pas_book_view_notify_remove (view->book_view, remove_op->id);
bonobo_object_release_unref(bonobo_object_corba_objref(BONOBO_OBJECT(view->book_view)), &ev);
e_iterator_next (iter);
}
- g_object_unref (iter);
+ gtk_object_unref (GTK_OBJECT (iter));
}
else {
ldap_perror (bl->priv->ldap, "remove_card");
@@ -1379,9 +1362,9 @@ remove_card_dtor (LDAPOp *op)
}
static void
-pas_backend_ldap_process_remove_cards (PASBackend *backend,
- PASBook *book,
- PASRemoveCardsRequest *req)
+pas_backend_ldap_process_remove_card (PASBackend *backend,
+ PASBook *book,
+ PASRequest *req)
{
LDAPRemoveOp *remove_op = g_new (LDAPRemoveOp, 1);
PASBackendLDAP *bl = PAS_BACKEND_LDAP (backend);
@@ -1391,12 +1374,7 @@ pas_backend_ldap_process_remove_cards (PASBackend *backend,
book_view = find_book_view (bl);
- /*
- ** since we didn't pass "bulk-removes" in our static
- ** capabilities, we should only get 1 length lists here, so
- ** the id we're deleting is the first and only id in the list.
- */
- remove_op->id = g_strdup (req->ids->data);
+ remove_op->id = g_strdup (req->remove.id);
do {
book_view_notify_status (book_view, _("Removing card from LDAP server..."));
@@ -1482,14 +1460,14 @@ modify_card_modify_handler (LDAPOp *op, LDAPMessage *res)
else if (new_match)
pas_book_view_notify_add_1 (view->book_view, modify_op->vcard);
else /* if (old_match) */
- pas_book_view_notify_remove_1 (view->book_view, e_card_simple_get_id (modify_op->card));
+ pas_book_view_notify_remove (view->book_view, e_card_simple_get_id (modify_op->card));
pas_book_view_notify_complete (view->book_view, GNOME_Evolution_Addressbook_BookViewListener_Success);
bonobo_object_release_unref(bonobo_object_corba_objref(BONOBO_OBJECT(view->book_view)), &ev);
e_iterator_next (iter);
}
- g_object_unref (iter);
+ gtk_object_unref (GTK_OBJECT (iter));
}
else {
ldap_perror (ldap, "ldap_modify_s");
@@ -1605,17 +1583,17 @@ modify_card_dtor (LDAPOp *op)
g_list_free (modify_op->existing_objectclasses);
g_free (modify_op->current_vcard);
if (modify_op->current_card)
- g_object_unref (modify_op->current_card);
+ gtk_object_unref (GTK_OBJECT (modify_op->current_card));
g_free (modify_op->vcard);
if (modify_op->card)
- g_object_unref (modify_op->card);
+ gtk_object_unref (GTK_OBJECT (modify_op->card));
g_free (modify_op);
}
static void
pas_backend_ldap_process_modify_card (PASBackend *backend,
PASBook *book,
- PASModifyCardRequest *req)
+ PASRequest *req)
{
LDAPModifyOp *modify_op = g_new0 (LDAPModifyOp, 1);
PASBackendLDAP *bl = PAS_BACKEND_LDAP (backend);
@@ -1627,10 +1605,10 @@ pas_backend_ldap_process_modify_card (PASBackend *backend,
book_view = find_book_view (bl);
- modify_op->vcard = g_strdup (req->vcard);
+ modify_op->vcard = g_strdup (req->modify.vcard);
new_ecard = e_card_new (modify_op->vcard);
modify_op->card = e_card_simple_new (new_ecard);
- g_object_unref (new_ecard);
+ gtk_object_unref (GTK_OBJECT (new_ecard));
modify_op->id = e_card_simple_get_id(modify_op->card);
ldap = bl->priv->ldap;
@@ -1697,7 +1675,7 @@ get_vcard_handler (LDAPOp *op, LDAPMessage *res)
GNOME_Evolution_Addressbook_BookListener_Success,
vcard);
g_free (vcard);
- g_object_unref (simple);
+ gtk_object_unref (GTK_OBJECT (simple));
ldap_op_finished (op);
}
else if (msg_type == LDAP_RES_SEARCH_RESULT) {
@@ -1727,7 +1705,7 @@ get_vcard_dtor (LDAPOp *op)
static void
pas_backend_ldap_process_get_vcard (PASBackend *backend,
PASBook *book,
- PASGetVCardRequest *req)
+ PASRequest *req)
{
LDAPGetVCardOp *get_vcard_op = g_new0 (LDAPGetVCardOp, 1);
PASBackendLDAP *bl = PAS_BACKEND_LDAP (backend);
@@ -1739,7 +1717,7 @@ pas_backend_ldap_process_get_vcard (PASBackend *backend,
book_view = find_book_view (bl);
do {
- ldap_error = ldap_search_ext (ldap, req->id,
+ ldap_error = ldap_search_ext (ldap, req->get_vcard.id,
LDAP_SCOPE_BASE,
"(objectclass=*)",
NULL, 0, NULL, NULL,
@@ -1786,7 +1764,7 @@ get_nth(PASCardCursor *cursor, long n, gpointer data)
}
static void
-cursor_destroy(gpointer data, GObject *where_object_was)
+cursor_destroy(GtkObject *object, gpointer data)
{
PASBackendLDAPCursorPrivate *cursor_data = (PASBackendLDAPCursorPrivate *) data;
@@ -1837,7 +1815,7 @@ get_cursor_handler (LDAPOp *op, LDAPMessage *res)
cursor_op->cursor_data->num_elements ++;
cursor_op->cursor_data->elements = g_list_prepend (cursor_op->cursor_data->elements,
vcard);
- g_object_unref (simple);
+ gtk_object_unref (GTK_OBJECT (simple));
}
}
}
@@ -1852,7 +1830,8 @@ get_cursor_handler (LDAPOp *op, LDAPMessage *res)
get_nth,
cursor_op->cursor_data);
- g_object_weak_ref (G_OBJECT (cursor), cursor_destroy, cursor_op->cursor_data);
+ gtk_signal_connect(GTK_OBJECT(cursor), "destroy",
+ GTK_SIGNAL_FUNC(cursor_destroy), cursor_op->cursor_data);
cursor_op->responded = TRUE;
}
@@ -1878,7 +1857,7 @@ get_cursor_dtor (LDAPOp *op)
LDAPGetCursorOp *cursor_op = (LDAPGetCursorOp*)op;
if (!cursor_op->responded) {
- cursor_destroy (cursor_op->cursor_data, NULL);
+ cursor_destroy (NULL, cursor_op->cursor_data);
}
g_free (op);
@@ -1887,7 +1866,7 @@ get_cursor_dtor (LDAPOp *op)
static void
pas_backend_ldap_process_get_cursor (PASBackend *backend,
PASBook *book,
- PASGetCursorRequest *req)
+ PASRequest *req)
{
PASBackendLDAP *bl = PAS_BACKEND_LDAP (backend);
LDAP *ldap = bl->priv->ldap;
@@ -2154,9 +2133,9 @@ anniversary_populate (ECardSimple *card, char **values)
{
if (values[0]) {
ECardDate dt = e_card_date_from_string (values[0]);
- g_object_set (card->card,
- "anniversary", &dt,
- NULL);
+ gtk_object_set (GTK_OBJECT (card->card),
+ "anniversary", &dt,
+ NULL);
}
}
@@ -2166,9 +2145,9 @@ anniversary_ber (ECardSimple *card)
ECardDate *dt;
struct berval** result = NULL;
- g_object_get (card->card,
- "anniversary", &dt,
- NULL);
+ gtk_object_get (GTK_OBJECT (card->card),
+ "anniversary", &dt,
+ NULL);
if (dt) {
char *anniversary;
@@ -2193,15 +2172,15 @@ anniversary_compare (ECardSimple *ecard1, ECardSimple *ecard2)
char *date1 = NULL, *date2 = NULL;
gboolean equal;
- g_object_get (ecard1->card,
- "anniversary", &dt,
- NULL);
+ gtk_object_get (GTK_OBJECT (ecard1->card),
+ "anniversary", &dt,
+ NULL);
if (dt)
date1 = e_card_date_to_string (dt);
- g_object_get (ecard2->card,
- "anniversary", &dt,
- NULL);
+ gtk_object_get (GTK_OBJECT (ecard2->card),
+ "anniversary", &dt,
+ NULL);
if (dt)
date2 = e_card_date_to_string (dt);
@@ -2221,9 +2200,9 @@ birthday_populate (ECardSimple *card, char **values)
{
if (values[0]) {
ECardDate dt = e_card_date_from_string (values[0]);
- g_object_set (card->card,
- "birth_date", &dt,
- NULL);
+ gtk_object_set (GTK_OBJECT (card->card),
+ "birth_date", &dt,
+ NULL);
}
}
@@ -2233,9 +2212,9 @@ birthday_ber (ECardSimple *card)
ECardDate *dt;
struct berval** result = NULL;
- g_object_get (card->card,
- "birth_date", &dt,
- NULL);
+ gtk_object_get (GTK_OBJECT (card->card),
+ "birth_date", &dt,
+ NULL);
if (dt) {
char *birthday;
@@ -2260,15 +2239,15 @@ birthday_compare (ECardSimple *ecard1, ECardSimple *ecard2)
char *date1 = NULL, *date2 = NULL;
gboolean equal;
- g_object_get (ecard1->card,
- "birth_date", &dt,
- NULL);
+ gtk_object_get (GTK_OBJECT (ecard1->card),
+ "birth_date", &dt,
+ NULL);
if (dt)
date1 = e_card_date_to_string (dt);
- g_object_get (ecard2->card,
- "birth_date", &dt,
- NULL);
+ gtk_object_get (GTK_OBJECT (ecard2->card),
+ "birth_date", &dt,
+ NULL);
if (dt)
date2 = e_card_date_to_string (dt);
@@ -2290,9 +2269,9 @@ category_populate (ECardSimple *card, char **values)
ECard *ecard;
EList *categories;
- g_object_get (card,
- "card", &ecard,
- NULL);
+ gtk_object_get (GTK_OBJECT (card),
+ "card", &ecard,
+ NULL);
categories = e_list_new((EListCopyFunc) g_strdup,
(EListFreeFunc) g_free,
@@ -2301,11 +2280,11 @@ category_populate (ECardSimple *card, char **values)
for (i = 0; values[i]; i++)
e_list_append (categories, values[i]);
- g_object_set (ecard,
- "category_list", categories,
- NULL);
+ gtk_object_set (GTK_OBJECT (ecard),
+ "category_list", categories,
+ NULL);
- g_object_unref (categories);
+ gtk_object_unref (GTK_OBJECT (categories));
e_card_simple_sync_card (card);
}
@@ -2319,13 +2298,13 @@ category_ber (ECardSimple *card)
ECard *ecard;
int i;
- g_object_get (card,
- "card", &ecard,
- NULL);
+ gtk_object_get (GTK_OBJECT (card),
+ "card", &ecard,
+ NULL);
- g_object_get (ecard,
- "category_list", &categories,
- NULL);
+ gtk_object_get (GTK_OBJECT (ecard),
+ "category_list", &categories,
+ NULL);
if (e_list_length (categories) != 0) {
result = g_new0 (struct berval*, e_list_length (categories) + 1);
@@ -2339,7 +2318,7 @@ category_ber (ECardSimple *card)
result[i]->bv_len = strlen (category);
}
- g_object_unref (iterator);
+ gtk_object_unref (GTK_OBJECT (iterator));
}
return result;
@@ -2615,12 +2594,10 @@ func_beginswith(struct _ESExp *f, int argc, struct _ESExpResult **argv, void *da
str, str));
}
else if (!strcmp (ldap_attr, "fileAs")) {
- if (ldap_data->bl->priv->evolutionPersonSupported)
- ldap_data->list = g_list_prepend(ldap_data->list,
- g_strdup_printf("(fileAs=%s*)", str));
- else
- ldap_data->list = g_list_prepend(ldap_data->list,
- g_strdup_printf("(sn=%s*)", str));
+ ldap_data->list = g_list_prepend(ldap_data->list,
+ g_strdup_printf(
+ "(|(fileAs=%s*)(&(!(fileAs=*))(sn=%s*)))",
+ str, str));
}
else {
ldap_data->list = g_list_prepend(ldap_data->list,
@@ -2781,7 +2758,7 @@ build_card_from_entry (LDAP *ldap, LDAPMessage *e, GList **existing_objectclasse
struct prop_info *info = NULL;
char **values;
- if (existing_objectclasses && !g_ascii_strcasecmp (attr, "objectclass")) {
+ if (existing_objectclasses && !strcasecmp (attr, "objectclass")) {
values = ldap_get_values (ldap, e, attr);
for (i = 0; values[i]; i ++)
*existing_objectclasses = g_list_append (*existing_objectclasses, g_strdup (values[i]));
@@ -2790,7 +2767,7 @@ build_card_from_entry (LDAP *ldap, LDAPMessage *e, GList **existing_objectclasse
}
else {
for (i = 0; i < num_prop_infos; i ++)
- if (!g_ascii_strcasecmp (attr, prop_info[i].ldap_attr)) {
+ if (!g_strcasecmp (attr, prop_info[i].ldap_attr)) {
info = &prop_info[i];
break;
}
@@ -2807,7 +2784,7 @@ build_card_from_entry (LDAP *ldap, LDAPMessage *e, GList **existing_objectclasse
}
else if (info->prop_type & PROP_TYPE_COMPLEX) {
/* if it's a list call the ecard-populate function,
- which calls g_object_set to set the property */
+ which calls gtk_object_set to set the property */
info->populate_ecard_func(card,
values);
}
@@ -2825,7 +2802,7 @@ build_card_from_entry (LDAP *ldap, LDAPMessage *e, GList **existing_objectclasse
e_card_simple_sync_card (card);
- g_object_unref (ecard);
+ gtk_object_unref (GTK_OBJECT (ecard));
return card;
}
@@ -2891,7 +2868,7 @@ poll_ldap (PASBackendLDAP *bl)
}
e_iterator_next (iter);
}
- g_object_unref (iter);
+ gtk_object_unref (GTK_OBJECT (iter));
return TRUE;
}
@@ -2902,7 +2879,6 @@ send_pending_adds (LDAPSearchOp *search_op)
search_op->num_sent_this_time += search_op->num_pending_adds;
pas_book_view_notify_add (search_op->op.view, search_op->pending_adds);
g_list_foreach (search_op->pending_adds, (GFunc)g_free, NULL);
- g_list_free (search_op->pending_adds);
search_op->pending_adds = NULL;
search_op->num_pending_adds = 0;
}
@@ -2968,7 +2944,7 @@ ldap_search_handler (LDAPOp *op, LDAPMessage *res)
e_card_simple_get_vcard_assume_utf8 (card));
search_op->num_pending_adds ++;
- g_object_unref (card);
+ gtk_object_unref (GTK_OBJECT(card));
e = ldap_next_entry(ldap, e);
}
@@ -3094,27 +3070,34 @@ pas_backend_ldap_search (PASBackendLDAP *bl,
}
static void
-ldap_get_view (PASBackend *backend,
- PASBook *book,
- const char *search,
- GNOME_Evolution_Addressbook_BookViewListener listener,
- int limit)
+pas_backend_ldap_process_get_book_view (PASBackend *backend,
+ PASBook *book,
+ PASRequest *req)
{
PASBackendLDAP *bl = PAS_BACKEND_LDAP (backend);
PASBookView *book_view;
PASBackendLDAPBookView *view;
- book_view = pas_book_view_new (listener);
+ g_return_if_fail (req->get_book_view.listener != NULL);
+
+ book_view = pas_book_view_new (req->get_book_view.listener);
bonobo_object_ref(BONOBO_OBJECT(book));
- g_object_weak_ref (G_OBJECT (book_view), view_destroy, book);
+ gtk_signal_connect(GTK_OBJECT(book_view), "destroy",
+ GTK_SIGNAL_FUNC(view_destroy), book);
view = g_new0(PASBackendLDAPBookView, 1);
view->book_view = book_view;
- view->search = g_strdup(search);
+ view->search = g_strdup(req->get_book_view.search);
view->card_sexp = pas_backend_card_sexp_new (view->search);
view->blpriv = bl->priv;
- view->limit = limit;
+
+ if (req->op == GetCompletionView) {
+ view->limit = MIN (bl->priv->ldap_limit, 100);
+ }
+ else {
+ view->limit = bl->priv->ldap_limit;
+ }
e_list_append(bl->priv->book_views, view);
@@ -3130,155 +3113,92 @@ ldap_get_view (PASBackend *backend,
}
static void
-pas_backend_ldap_process_get_book_view (PASBackend *backend,
- PASBook *book,
- PASGetBookViewRequest *req)
-{
- PASBackendLDAP *bl = PAS_BACKEND_LDAP (backend);
-
- ldap_get_view (backend, book, req->search, req->listener,
- bl->priv->ldap_limit);
-}
-
-static void
-pas_backend_ldap_process_get_completion_view (PASBackend *backend,
- PASBook *book,
- PASGetCompletionViewRequest *req)
-{
- PASBackendLDAP *bl = PAS_BACKEND_LDAP (backend);
-
- ldap_get_view (backend, book, req->search, req->listener,
- MIN (bl->priv->ldap_limit, 100));
-}
-
-static void
-pas_backend_ldap_process_get_changes (PASBackend *backend,
- PASBook *book,
- PASGetChangesRequest *req)
-{
- /* FIXME: implement */
-}
-
-static void
pas_backend_ldap_process_check_connection (PASBackend *backend,
PASBook *book,
- PASCheckConnectionRequest *req)
+ PASRequest *req)
{
PASBackendLDAP *bl = PAS_BACKEND_LDAP (backend);
pas_book_report_connection (book, bl->priv->connected);
}
-#define LDAP_SIMPLE_PREFIX "ldap/simple-"
-#define SASL_PREFIX "sasl/"
-
static void
pas_backend_ldap_process_authenticate_user (PASBackend *backend,
PASBook *book,
- PASAuthenticateUserRequest *req)
+ PASRequest *req)
{
PASBackendLDAP *bl = PAS_BACKEND_LDAP (backend);
int ldap_error;
char *dn = NULL;
- if (!strncasecmp (req->auth_method, LDAP_SIMPLE_PREFIX, strlen (LDAP_SIMPLE_PREFIX))) {
-
- if (!strcmp (req->auth_method, "ldap/simple-email")) {
- LDAPMessage *res, *e;
- char *query = g_strdup_printf ("(mail=%s)", req->user);
+ if (!strcmp (req->auth_user.auth_method, "ldap/simple-email")) {
+ LDAPMessage *res, *e;
+ char *query = g_strdup_printf ("(mail=%s)", req->auth_user.user);
- ldap_error = ldap_search_s (bl->priv->ldap,
- bl->priv->ldap_rootdn,
- bl->priv->ldap_scope,
- query,
- NULL, 0, &res);
- g_free (query);
+ ldap_error = ldap_search_s (bl->priv->ldap,
+ bl->priv->ldap_rootdn,
+ bl->priv->ldap_scope,
+ query,
+ NULL, 0, &res);
+ g_free (query);
- if (ldap_error == LDAP_SUCCESS) {
- char *entry_dn;
+ if (ldap_error == LDAP_SUCCESS) {
+ char *entry_dn;
- e = ldap_first_entry (bl->priv->ldap, res);
+ e = ldap_first_entry (bl->priv->ldap, res);
- entry_dn = ldap_get_dn (bl->priv->ldap, e);
- dn = g_strdup(entry_dn);
+ entry_dn = ldap_get_dn (bl->priv->ldap, e);
+ dn = g_strdup(entry_dn);
- ldap_memfree (entry_dn);
- ldap_msgfree (res);
- }
- else {
- pas_book_respond_authenticate_user (book,
- GNOME_Evolution_Addressbook_BookListener_PermissionDenied);
- return;
- }
- }
- else if (!strcmp (req->auth_method, "ldap/simple-binddn")) {
- dn = g_strdup (req->user);
+ ldap_memfree (entry_dn);
+ ldap_msgfree (res);
}
-
- /* now authenticate against the DN we were either supplied or queried for */
- printf ("simple auth as %s\n", dn);
- ldap_error = ldap_simple_bind_s(bl->priv->ldap,
- dn,
- req->passwd);
-
- pas_book_respond_authenticate_user (book,
- ldap_error_to_response (ldap_error));
- }
-#ifdef ENABLE_SASL_BINDS
- else if (!strncasecmp (req->auth_method, SASL_PREFIX, strlen (SASL_PREFIX))) {
- g_print ("sasl bind (mech = %s) as %s", req->auth_method + strlen (SASL_PREFIX), req->user);
- ldap_error = ldap_sasl_bind_s (bl->priv->ldap,
- NULL,
- req->auth_method + strlen (SASL_PREFIX),
- req->passwd,
- NULL,
- NULL,
- NULL);
-
- if (ldap_error == LDAP_NOT_SUPPORTED)
- pas_book_respond_authenticate_user (book,
- GNOME_Evolution_Addressbook_BookListener_UnsupportedAuthenticationMethod);
- else
+ else {
pas_book_respond_authenticate_user (book,
- ldap_error_to_response (ldap_error));
+ GNOME_Evolution_Addressbook_BookListener_PermissionDenied);
+ return;
+ }
}
-#endif
- else {
- pas_book_respond_authenticate_user (book,
- GNOME_Evolution_Addressbook_BookListener_UnsupportedAuthenticationMethod);
- return;
+ else if (!strcmp (req->auth_user.auth_method, "ldap/simple-binddn")) {
+ dn = g_strdup (req->auth_user.user);
}
- if (ldap_error == LDAP_SUCCESS) {
- bl->priv->auth_dn = dn;
- bl->priv->auth_passwd = g_strdup (req->passwd);
+ /* now authenticate against the DN we were either supplied or queried for */
+ printf ("authenticating as %s\n", dn);
+ ldap_error = ldap_simple_bind_s(bl->priv->ldap,
+ dn,
+ req->auth_user.passwd);
- pas_backend_set_is_writable (backend, TRUE);
+ bl->priv->auth_dn = dn;
+ bl->priv->auth_passwd = g_strdup (req->auth_user.passwd);
- /* force a requery on the root dse since some ldap
- servers are set up such that they don't report
- anything (including the schema DN) until the user
- is authenticated */
- if (!bl->priv->evolutionPersonChecked) {
- ldap_error = query_ldap_root_dse (bl);
+ pas_book_respond_authenticate_user (book,
+ ldap_error_to_response (ldap_error));
- if (LDAP_SUCCESS == ldap_error) {
- if (!bl->priv->evolutionPersonChecked)
- check_schema_support (bl);
- }
- else
- g_warning ("Failed to perform root dse query after authenticating, (ldap_error 0x%02x)", ldap_error);
- }
+ bl->priv->writable = (ldap_error == LDAP_SUCCESS);
+
+ /* if the bind was successful we force a requery on the root
+ dse since some ldap servers are set up such that they don't
+ report anything (including the schema DN) until the user is
+ authenticated */
+ if (!bl->priv->evolutionPersonChecked && ldap_error == LDAP_SUCCESS) {
+ ldap_error = query_ldap_root_dse (bl);
- pas_book_report_writable (book, TRUE);
+ if (LDAP_SUCCESS == ldap_error) {
+ if (!bl->priv->evolutionPersonChecked)
+ check_schema_support (bl);
+ }
+ else
+ g_warning ("Failed to perform root dse query after authenticating, (ldap_error 0x%02x)", ldap_error);
}
+ pas_book_report_writable (book, bl->priv->writable);
}
static void
pas_backend_ldap_process_get_supported_fields (PASBackend *backend,
PASBook *book,
- PASGetSupportedFieldsRequest *req)
+ PASRequest *req)
{
PASBackendLDAP *bl = PAS_BACKEND_LDAP (backend);
@@ -3289,16 +3209,75 @@ pas_backend_ldap_process_get_supported_fields (PASBackend *backend,
}
static void
-pas_backend_ldap_process_get_supported_auth_methods (PASBackend *backend,
- PASBook *book,
- PASGetSupportedAuthMethodsRequest *req)
+pas_backend_ldap_process_client_requests (PASBook *book)
+{
+ PASBackend *backend;
+ PASRequest *req;
+
+ backend = pas_book_get_backend (book);
+
+ req = pas_book_pop_request (book);
+ if (req == NULL)
+ return;
+
+ switch (req->op) {
+ case CreateCard:
+ pas_backend_ldap_process_create_card (backend, book, req);
+ break;
+
+ case RemoveCard:
+ pas_backend_ldap_process_remove_card (backend, book, req);
+ break;
+
+ case ModifyCard:
+ pas_backend_ldap_process_modify_card (backend, book, req);
+ break;
+
+ case CheckConnection:
+ pas_backend_ldap_process_check_connection (backend, book, req);
+ break;
+
+ case GetVCard:
+ pas_backend_ldap_process_get_vcard (backend, book, req);
+ break;
+
+ case GetCursor:
+ pas_backend_ldap_process_get_cursor (backend, book, req);
+ break;
+
+ case GetBookView:
+ pas_backend_ldap_process_get_book_view (backend, book, req);
+ break;
+
+ case GetCompletionView:
+ /* we don't support summaries so completion view requests are the same as book view requests */
+ pas_backend_ldap_process_get_book_view (backend, book, req);
+ break;
+
+ case GetChanges:
+ /* FIXME: Code this. */
+ break;
+
+ case AuthenticateUser:
+ pas_backend_ldap_process_authenticate_user (backend, book, req);
+ break;
+ case GetSupportedFields:
+ pas_backend_ldap_process_get_supported_fields (backend, book, req);
+ break;
+ }
+
+ pas_book_free_request (req);
+}
+
+static void
+pas_backend_ldap_book_destroy_cb (PASBook *book, gpointer data)
{
- PASBackendLDAP *bl = PAS_BACKEND_LDAP (backend);
+ PASBackendLDAP *backend;
- pas_book_respond_get_supported_auth_methods (book,
- GNOME_Evolution_Addressbook_BookListener_Success,
- bl->priv->supported_auth_methods);
+ backend = PAS_BACKEND_LDAP (data);
+
+ pas_backend_remove_client (PAS_BACKEND (backend), book);
}
static GNOME_Evolution_Addressbook_BookListener_CallStatus
@@ -3392,7 +3371,75 @@ pas_backend_ldap_get_uri (PASBackend *backend)
return bl->priv->uri;
}
-static char*
+static gboolean
+pas_backend_ldap_add_client (PASBackend *backend,
+ GNOME_Evolution_Addressbook_BookListener listener)
+{
+ PASBackendLDAP *bl;
+ PASBook *book;
+
+ g_assert (backend != NULL);
+ g_assert (PAS_IS_BACKEND_LDAP (backend));
+
+ bl = PAS_BACKEND_LDAP (backend);
+
+ book = pas_book_new (backend, listener);
+
+ if (!book) {
+ if (!bl->priv->clients)
+ pas_backend_last_client_gone (backend);
+
+ return FALSE;
+ }
+
+ gtk_signal_connect (GTK_OBJECT (book), "destroy",
+ pas_backend_ldap_book_destroy_cb, backend);
+
+ gtk_signal_connect (GTK_OBJECT (book), "requests_queued",
+ pas_backend_ldap_process_client_requests, NULL);
+
+ bl->priv->clients = g_list_prepend (
+ bl->priv->clients, book);
+
+ if (bl->priv->connected) {
+ pas_book_respond_open (
+ book, GNOME_Evolution_Addressbook_BookListener_Success);
+ } else {
+ pas_book_respond_open (
+ book, GNOME_Evolution_Addressbook_BookListener_OtherError);
+ }
+
+ pas_book_report_writable (book, bl->priv->writable);
+
+ bonobo_object_unref (BONOBO_OBJECT (book));
+
+ return TRUE;
+}
+
+static void
+pas_backend_ldap_remove_client (PASBackend *backend,
+ PASBook *book)
+{
+ PASBackendLDAP *bl;
+
+ g_return_if_fail (backend != NULL);
+ g_return_if_fail (PAS_IS_BACKEND_LDAP (backend));
+ g_return_if_fail (book != NULL);
+ g_return_if_fail (PAS_IS_BOOK (book));
+
+ bl = PAS_BACKEND_LDAP (backend);
+
+ /* Disconnect */
+ bl->priv->clients = g_list_remove (bl->priv->clients, book);
+
+ /* When all clients go away, notify the parent factory about it so that
+ * it may decide whether to kill the backend or not.
+ */
+ if (!bl->priv->clients)
+ pas_backend_last_client_gone (backend);
+}
+
+static char *
pas_backend_ldap_get_static_capabilities (PASBackend *backend)
{
return g_strdup("net");
@@ -3418,10 +3465,10 @@ pas_backend_ldap_new (void)
{
PASBackendLDAP *backend;
- backend = g_object_new (PAS_TYPE_BACKEND_LDAP, NULL);
+ backend = gtk_type_new (pas_backend_ldap_get_type ());
if (! pas_backend_ldap_construct (backend)) {
- g_object_unref (backend);
+ gtk_object_unref (GTK_OBJECT (backend));
return NULL;
}
@@ -3440,71 +3487,51 @@ call_dtor (int msgid, LDAPOp *op, gpointer data)
}
static void
-pas_backend_ldap_dispose (GObject *object)
+pas_backend_ldap_destroy (GtkObject *object)
{
PASBackendLDAP *bl;
bl = PAS_BACKEND_LDAP (object);
- if (bl->priv) {
- g_hash_table_foreach_remove (bl->priv->id_to_op, (GHRFunc)call_dtor, NULL);
- g_hash_table_destroy (bl->priv->id_to_op);
+ g_hash_table_foreach_remove (bl->priv->id_to_op, (GHRFunc)call_dtor, NULL);
+ g_hash_table_destroy (bl->priv->id_to_op);
- if (bl->priv->poll_timeout != -1) {
- printf ("removing timeout\n");
- g_source_remove (bl->priv->poll_timeout);
- }
-
- g_object_unref (bl->priv->book_views);
-
- if (bl->priv->supported_fields)
- g_object_unref (bl->priv->supported_fields);
+ if (bl->priv->poll_timeout != -1) {
+ printf ("removing timeout\n");
+ g_source_remove (bl->priv->poll_timeout);
+ }
- if (bl->priv->supported_auth_methods)
- g_object_unref (bl->priv->supported_auth_methods);
+ gtk_object_unref (GTK_OBJECT (bl->priv->book_views));
- g_free (bl->priv->uri);
+ if (bl->priv->supported_fields)
+ gtk_object_unref (GTK_OBJECT (bl->priv->supported_fields));
- g_free (bl->priv);
- bl->priv = NULL;
- }
+ g_free (bl->priv->uri);
- if (G_OBJECT_CLASS (pas_backend_ldap_parent_class)->dispose)
- G_OBJECT_CLASS (pas_backend_ldap_parent_class)->dispose (object);
+ GTK_OBJECT_CLASS (pas_backend_ldap_parent_class)->destroy (object);
}
static void
pas_backend_ldap_class_init (PASBackendLDAPClass *klass)
{
- GObjectClass *object_class = G_OBJECT_CLASS (klass);
+ GtkObjectClass *object_class = (GtkObjectClass *) klass;
PASBackendClass *parent_class;
/* get client side information (extensions present in the library) */
get_ldap_library_info ();
- pas_backend_ldap_parent_class = g_type_class_peek_parent (klass);
+ pas_backend_ldap_parent_class = gtk_type_class (pas_backend_get_type ());
parent_class = PAS_BACKEND_CLASS (klass);
/* Set the virtual methods. */
parent_class->load_uri = pas_backend_ldap_load_uri;
parent_class->get_uri = pas_backend_ldap_get_uri;
+ parent_class->add_client = pas_backend_ldap_add_client;
+ parent_class->remove_client = pas_backend_ldap_remove_client;
parent_class->get_static_capabilities = pas_backend_ldap_get_static_capabilities;
- parent_class->create_card = pas_backend_ldap_process_create_card;
- parent_class->remove_cards = pas_backend_ldap_process_remove_cards;
- parent_class->modify_card = pas_backend_ldap_process_modify_card;
- parent_class->check_connection = pas_backend_ldap_process_check_connection;
- parent_class->get_vcard = pas_backend_ldap_process_get_vcard;
- parent_class->get_cursor = pas_backend_ldap_process_get_cursor;
- parent_class->get_book_view = pas_backend_ldap_process_get_book_view;
- parent_class->get_completion_view = pas_backend_ldap_process_get_completion_view;
- parent_class->get_changes = pas_backend_ldap_process_get_changes;
- parent_class->authenticate_user = pas_backend_ldap_process_authenticate_user;
- parent_class->get_supported_fields = pas_backend_ldap_process_get_supported_fields;
- parent_class->get_supported_auth_methods = pas_backend_ldap_process_get_supported_auth_methods;
-
- object_class->dispose = pas_backend_ldap_dispose;
+ object_class->destroy = pas_backend_ldap_destroy;
}
static void
@@ -3526,25 +3553,24 @@ pas_backend_ldap_init (PASBackendLDAP *backend)
/**
* pas_backend_ldap_get_type:
*/
-GType
+GtkType
pas_backend_ldap_get_type (void)
{
- static GType type = 0;
+ static GtkType type = 0;
if (! type) {
- GTypeInfo info = {
- sizeof (PASBackendLDAPClass),
- NULL, /* base_class_init */
- NULL, /* base_class_finalize */
- (GClassInitFunc) pas_backend_ldap_class_init,
- NULL, /* class_finalize */
- NULL, /* class_data */
+ GtkTypeInfo info = {
+ "PASBackendLDAP",
sizeof (PASBackendLDAP),
- 0, /* n_preallocs */
- (GInstanceInitFunc) pas_backend_ldap_init
+ sizeof (PASBackendLDAPClass),
+ (GtkClassInitFunc) pas_backend_ldap_class_init,
+ (GtkObjectInitFunc) pas_backend_ldap_init,
+ NULL, /* reserved 1 */
+ NULL, /* reserved 2 */
+ (GtkClassInitFunc) NULL
};
- type = g_type_register_static (PAS_TYPE_BACKEND, "PASBackendLDAP", &info, 0);
+ type = gtk_type_unique (pas_backend_get_type (), &info);
}
return type;
diff --git a/addressbook/gui/component/addressbook-component.c b/addressbook/gui/component/addressbook-component.c
index b1db690d2a..4fc4f54df7 100644
--- a/addressbook/gui/component/addressbook-component.c
+++ b/addressbook/gui/component/addressbook-component.c
@@ -33,11 +33,8 @@
#include <sys/types.h>
#include <sys/stat.h>
#include <errno.h>
-#include <string.h>
-#include <unistd.h>
#include <bonobo/bonobo-generic-factory.h>
-#include <bonobo/bonobo-main.h>
#include "evolution-shell-component.h"
#include "evolution-shell-component-dnd.h"
@@ -82,7 +79,7 @@ static const EvolutionShellComponentFolderType folder_types[] = {
{ NULL }
};
-#define IS_CONTACT_TYPE(x) (g_ascii_strcasecmp((x), "contacts") == 0 || g_ascii_strcasecmp ((x), "contacts/ldap") == 0 || g_ascii_strcasecmp((x), "contacts/public") == 0)
+#define IS_CONTACT_TYPE(x) (g_strcasecmp((x), "contacts") == 0 || g_strcasecmp ((x), "contacts/ldap") == 0 || g_strcasecmp((x), "contacts/public") == 0)
/* EvolutionShellComponent methods and signals. */
@@ -99,8 +96,8 @@ create_view (EvolutionShellComponent *shell_component,
if (!IS_CONTACT_TYPE (type))
return EVOLUTION_SHELL_COMPONENT_UNSUPPORTEDTYPE;
- control = addressbook_new_control ();
- bonobo_control_set_property (control, NULL, "folder_uri", TC_CORBA_string, physical_uri, NULL);
+ control = addressbook_factory_new_control ();
+ bonobo_control_set_property (control, "folder_uri", physical_uri, NULL);
*control_return = control;
@@ -135,9 +132,11 @@ remove_folder (EvolutionShellComponent *shell_component,
void *closure)
{
CORBA_Environment ev;
- char *db_path, *summary_path, *subdir_path;
+ char *addressbook_db_path, *addressbook_db_summary, *subdir_path;
struct stat sb;
int rv;
+ GnomeVFSURI *dir_uri, *data_uri, *summary_uri;
+ GnomeVFSResult data_result, summary_result;
CORBA_exception_init(&ev);
@@ -164,7 +163,7 @@ remove_folder (EvolutionShellComponent *shell_component,
return;
}
- subdir_path = g_build_filename (physical_uri + 7, "subfolders", NULL);
+ subdir_path = g_concat_dir_and_file (physical_uri + 7, "subfolders");
rv = stat (subdir_path, &sb);
g_free (subdir_path);
if (rv != -1) {
@@ -174,29 +173,43 @@ remove_folder (EvolutionShellComponent *shell_component,
CORBA_exception_free(&ev);
return;
}
+
+ addressbook_db_path = g_concat_dir_and_file (physical_uri + 7, "addressbook.db");
+ addressbook_db_summary = g_concat_dir_and_file (physical_uri + 7, "addressbook.db.summary");
+
+ data_uri = gnome_vfs_uri_new (addressbook_db_path);
+ summary_uri = gnome_vfs_uri_new (addressbook_db_summary);
- db_path = g_build_filename (physical_uri + 7, "addressbook.db", NULL);
- summary_path = g_build_filename (physical_uri + 7, "addressbook.db.summary", NULL);
- rv = unlink (db_path);
-
- if (rv == 0 || (rv == -1 && errno == ENOENT))
- rv = unlink (summary_path);
+ g_free (addressbook_db_path);
+ g_free (addressbook_db_summary);
- if (rv == 0 || (rv == -1 && errno == ENOENT)) {
+ if (!data_uri || !summary_uri) {
GNOME_Evolution_ShellComponentListener_notifyResult (listener,
- GNOME_Evolution_ShellComponentListener_OK,
- &ev);
+ GNOME_Evolution_ShellComponentListener_INVALID_URI,
+ &ev);
+ CORBA_exception_free (&ev);
+ return;
}
- else {
- GNOME_Evolution_ShellComponentListener_notifyResult (listener,
- GNOME_Evolution_ShellComponentListener_PERMISSION_DENIED,
- &ev);
+
+ data_result = gnome_vfs_unlink_from_uri (data_uri);
+ summary_result = gnome_vfs_unlink_from_uri (summary_uri);
+ if ((data_result == GNOME_VFS_OK || data_result == GNOME_VFS_ERROR_NOT_FOUND) && (summary_result == GNOME_VFS_OK || summary_result == GNOME_VFS_ERROR_NOT_FOUND))
+ {
+ GNOME_Evolution_ShellComponentListener_notifyResult (listener,
+ GNOME_Evolution_ShellComponentListener_OK,
+ &ev);
+ } else {
+ GNOME_Evolution_ShellComponentListener_notifyResult (listener,
+ GNOME_Evolution_ShellComponentListener_PERMISSION_DENIED,
+ &ev);
}
-
- g_free (db_path);
- g_free (summary_path);
-
- CORBA_exception_free(&ev);
+
+ if (data_uri)
+ gnome_vfs_uri_unref (data_uri);
+ if (summary_uri)
+ gnome_vfs_uri_unref (summary_uri);
+
+ CORBA_exception_free (&ev);
}
/* ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** */
@@ -378,18 +391,27 @@ owner_set_cb (EvolutionShellComponent *shell_component,
if (global_shell_client == NULL)
global_shell_client = shell_client;
+ addressbook_config_register_factory (bonobo_object_corba_objref (BONOBO_OBJECT (shell_client)));
+
addressbook_storage_setup (shell_component, evolution_homedir);
}
+static gboolean
+gtk_main_quit_cb (gpointer closure)
+{
+ gtk_main_quit ();
+ return TRUE;
+}
+
static void
owner_unset_cb (EvolutionShellComponent *shell_component,
GNOME_Evolution_Shell shell_interface,
gpointer user_data)
{
owner_count --;
-
- if (owner_count == 0)
- global_shell_client = NULL;
+ if (owner_count == 0) {
+ g_idle_add (gtk_main_quit_cb, NULL);
+ }
}
/* FIXME We should perhaps take the time to figure out if the book is editable. */
@@ -520,8 +542,8 @@ add_creatable_item (EvolutionShellComponent *shell_component,
icon_path = NULL;
icon = NULL;
} else {
- icon_path = g_build_filename (EVOLUTION_IMAGESDIR, icon_name, NULL);
- icon = gdk_pixbuf_new_from_file (icon_path, NULL);
+ icon_path = g_concat_dir_and_file (EVOLUTION_ICONSDIR, icon_name);
+ icon = gdk_pixbuf_new_from_file (icon_path);
}
evolution_shell_component_add_user_creatable_item (shell_component,
@@ -569,12 +591,12 @@ create_component (void)
_("Create a new contact list"), 'l',
"contact-list-16.png");
- g_signal_connect (shell_component, "owner_set",
- G_CALLBACK (owner_set_cb), NULL);
- g_signal_connect (shell_component, "owner_unset",
- G_CALLBACK (owner_unset_cb), NULL);
- g_signal_connect (shell_component, "user_create_new_item",
- G_CALLBACK (user_create_new_item_cb), NULL);
+ gtk_signal_connect (GTK_OBJECT (shell_component), "owner_set",
+ GTK_SIGNAL_FUNC (owner_set_cb), NULL);
+ gtk_signal_connect (GTK_OBJECT (shell_component), "owner_unset",
+ GTK_SIGNAL_FUNC (owner_unset_cb), NULL);
+ gtk_signal_connect (GTK_OBJECT (shell_component), "user_create_new_item",
+ GTK_SIGNAL_FUNC (user_create_new_item_cb), NULL);
return BONOBO_OBJECT (shell_component);
}
@@ -584,12 +606,15 @@ ensure_completion_uris_exist()
{
/* Initialize the completion uris if they aren't set yet. The
default set is just the local Contacts folder. */
- EConfigListener *db;
+ Bonobo_ConfigDatabase db;
+ CORBA_Environment ev;
char *val;
- db = e_book_get_config_database ();
+ CORBA_exception_init (&ev);
+
+ db = addressbook_config_database (&ev);
- val = e_config_listener_get_string (db, "/apps/evolution/addressbook/completion/uris");
+ val = bonobo_config_get_string (db, "/Addressbook/Completion/uris", &ev);
if (!val) {
EFolderListItem f[2];
@@ -597,7 +622,7 @@ ensure_completion_uris_exist()
/* in the case where the user is running for the first
time, populate the list with the local contact
folder */
- dirname = g_build_filename (g_get_home_dir (), "evolution/local/Contacts", NULL);
+ dirname = gnome_util_prepend_user_home("evolution/local/Contacts");
uri = g_strdup_printf ("file://%s", dirname);
f[0].uri = "evolution:/local/Contacts";
@@ -610,17 +635,33 @@ ensure_completion_uris_exist()
g_free (dirname);
g_free (uri);
- e_config_listener_set_string (db, "/apps/evolution/addressbook/completion/uris", val);
+ bonobo_config_set_string (db, "/Addressbook/Completion/uris", val, &ev);
+
+ g_free (val);
}
- g_free (val);
+ CORBA_exception_free (&ev);
}
-/* FIXME this is wrong. */
-BonoboObject *
-addressbook_component_init (void)
+/* FIXME this should probably be renamed as we don't use factories anymore. */
+void
+addressbook_component_factory_init (void)
{
+ BonoboObject *object;
+ int result;
+
+ object = create_component ();
+
+ /* FIXME: Handle errors better? */
+
+ result = oaf_active_server_register (GNOME_EVOLUTION_ADDRESSBOOK_COMPONENT_ID,
+ bonobo_object_corba_objref (object));
+ if (result == OAF_REG_ERROR)
+ g_error ("Cannot register -- %s", GNOME_EVOLUTION_ADDRESSBOOK_COMPONENT_ID);
+
+ /* XXX this could probably go someplace else, but I'll leave
+ it here for now since it's a component init time
+ operation. */
ensure_completion_uris_exist ();
- return create_component ();
}
diff --git a/addressbook/gui/component/ldap-config.glade b/addressbook/gui/component/ldap-config.glade
index d561298d27..a7be68f785 100644
--- a/addressbook/gui/component/ldap-config.glade
+++ b/addressbook/gui/component/ldap-config.glade
@@ -1,2631 +1,5819 @@
-<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*-->
-<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd">
-
-<glade-interface>
-<requires lib="gnome"/>
-
-<widget class="GtkWindow" id="account-editor-window">
- <property name="title" translatable="yes">Edit LDAP Server</property>
- <property name="type">GTK_WINDOW_TOPLEVEL</property>
- <property name="window_position">GTK_WIN_POS_NONE</property>
- <property name="modal">False</property>
- <property name="resizable">True</property>
- <property name="destroy_with_parent">False</property>
-
- <child>
- <widget class="GtkVBox" id="vbox37">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">0</property>
-
+<?xml version="1.0"?>
+<GTK-Interface>
+
+<project>
+ <name>addressbook-config-mockup</name>
+ <program_name>addressbook-config-mockup</program_name>
+ <directory></directory>
+ <source_directory>src</source_directory>
+ <pixmaps_directory>../../../art</pixmaps_directory>
+ <language>C</language>
+ <gnome_support>True</gnome_support>
+ <gettext_support>True</gettext_support>
+</project>
+
+<widget>
+ <class>GnomeDialog</class>
+ <name>Add/Edit Attribute Mappings--Simple Version</name>
+ <visible>False</visible>
+ <title>Add (or Edit) Attribute Mappings</title>
+ <type>GTK_WINDOW_TOPLEVEL</type>
+ <position>GTK_WIN_POS_NONE</position>
+ <modal>False</modal>
+ <allow_shrink>True</allow_shrink>
+ <allow_grow>True</allow_grow>
+ <auto_shrink>False</auto_shrink>
+ <auto_close>False</auto_close>
+ <hide_on_close>False</hide_on_close>
+
+ <widget>
+ <class>GtkVBox</class>
+ <child_name>GnomeDialog:vbox</child_name>
+ <name>dialog-vbox4</name>
+ <homogeneous>False</homogeneous>
+ <spacing>8</spacing>
+ <child>
+ <padding>4</padding>
+ <expand>True</expand>
+ <fill>True</fill>
+ </child>
+
+ <widget>
+ <class>GtkHButtonBox</class>
+ <child_name>GnomeDialog:action_area</child_name>
+ <name>dialog-action_area4</name>
+ <layout_style>GTK_BUTTONBOX_END</layout_style>
+ <spacing>8</spacing>
+ <child_min_width>85</child_min_width>
+ <child_min_height>27</child_min_height>
+ <child_ipad_x>7</child_ipad_x>
+ <child_ipad_y>0</child_ipad_y>
<child>
- <widget class="GtkNotebook" id="account-editor-notebook">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="show_tabs">True</property>
- <property name="show_border">True</property>
- <property name="tab_pos">GTK_POS_TOP</property>
- <property name="scrollable">False</property>
- <property name="enable_popup">False</property>
-
- <child>
- <widget class="GtkVBox" id="account-editor-general-vbox">
- <property name="border_width">6</property>
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">3</property>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>True</fill>
+ <pack>GTK_PACK_END</pack>
+ </child>
- <child>
- <widget class="GtkHBox" id="hbox100">
- <property name="border_width">3</property>
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">4</property>
-
- <child>
- <widget class="GtkLabel" id="label431">
- <property name="visible">True</property>
- <property name="label" translatable="yes">_Display name:</property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkAlignment" id="alignment45">
- <property name="visible">True</property>
- <property name="xalign">1</property>
- <property name="yalign">0.5</property>
- <property name="xscale">0.9</property>
- <property name="yscale">1</property>
-
- <child>
- <widget class="GtkEntry" id="account-editor-display-name-entry">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="editable">True</property>
- <property name="visibility">True</property>
- <property name="max_length">0</property>
- <property name="text" translatable="yes"></property>
- <property name="has_frame">True</property>
- <property name="invisible_char" translatable="yes">*</property>
- <property name="activates_default">False</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
+ <widget>
+ <class>GtkButton</class>
+ <name>button37</name>
+ <can_default>True</can_default>
+ <can_focus>True</can_focus>
+ <stock_button>GNOME_STOCK_BUTTON_OK</stock_button>
+ </widget>
+
+ <widget>
+ <class>GtkButton</class>
+ <name>button39</name>
+ <can_default>True</can_default>
+ <can_focus>True</can_focus>
+ <stock_button>GNOME_STOCK_BUTTON_CANCEL</stock_button>
+ </widget>
+ </widget>
- <child>
- <widget class="GtkHSeparator" id="hseparator12">
- <property name="visible">True</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="tab_expand">False</property>
- <property name="tab_fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label331">
- <property name="visible">True</property>
- <property name="label" translatable="yes">General</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="type">tab</property>
- </packing>
+ <widget>
+ <class>GtkVBox</class>
+ <name>vbox30</name>
+ <homogeneous>False</homogeneous>
+ <spacing>0</spacing>
+ <child>
+ <padding>0</padding>
+ <expand>True</expand>
+ <fill>True</fill>
+ </child>
+
+ <widget>
+ <class>GtkHBox</class>
+ <name>hbox66</name>
+ <border_width>3</border_width>
+ <homogeneous>False</homogeneous>
+ <spacing>3</spacing>
+ <child>
+ <padding>0</padding>
+ <expand>True</expand>
+ <fill>True</fill>
+ </child>
+
+ <widget>
+ <class>GnomePixmap</class>
+ <name>pixmap35</name>
+ <filename>ldap.png</filename>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
</child>
+ </widget>
+ <widget>
+ <class>GtkLabel</class>
+ <name>label283</name>
+ <label>Please select an Evolution attribute and an
+LDAP attribute to associate with it.</label>
+ <justify>GTK_JUSTIFY_LEFT</justify>
+ <wrap>False</wrap>
+ <xalign>0.5</xalign>
+ <yalign>0.5</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
+ </child>
+ </widget>
+ </widget>
+
+ <widget>
+ <class>GtkHSeparator</class>
+ <name>hseparator8</name>
+ <child>
+ <padding>0</padding>
+ <expand>True</expand>
+ <fill>True</fill>
+ </child>
+ </widget>
+
+ <widget>
+ <class>GtkTable</class>
+ <name>table18</name>
+ <border_width>3</border_width>
+ <rows>2</rows>
+ <columns>2</columns>
+ <homogeneous>False</homogeneous>
+ <row_spacing>3</row_spacing>
+ <column_spacing>3</column_spacing>
+ <child>
+ <padding>0</padding>
+ <expand>True</expand>
+ <fill>True</fill>
+ </child>
+
+ <widget>
+ <class>GtkLabel</class>
+ <name>label284</name>
+ <label>_Evolution attribute:</label>
+ <justify>GTK_JUSTIFY_CENTER</justify>
+ <wrap>False</wrap>
+ <xalign>0</xalign>
+ <yalign>0.5</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <default_focus_target>combo-entry2</default_focus_target>
<child>
- <widget class="GtkVBox" id="account-editor-connecting-vbox">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">0</property>
+ <left_attach>0</left_attach>
+ <right_attach>1</right_attach>
+ <top_attach>0</top_attach>
+ <bottom_attach>1</bottom_attach>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <xexpand>False</xexpand>
+ <yexpand>False</yexpand>
+ <xshrink>False</xshrink>
+ <yshrink>False</yshrink>
+ <xfill>True</xfill>
+ <yfill>False</yfill>
+ </child>
+ </widget>
- <child>
- <placeholder/>
- </child>
- </widget>
- <packing>
- <property name="tab_expand">False</property>
- <property name="tab_fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label334">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Connecting</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="type">tab</property>
- </packing>
+ <widget>
+ <class>GtkLabel</class>
+ <name>label285</name>
+ <label>_LDAP attribute:</label>
+ <justify>GTK_JUSTIFY_CENTER</justify>
+ <wrap>False</wrap>
+ <xalign>0</xalign>
+ <yalign>0.5</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <default_focus_target>combo-entry3</default_focus_target>
+ <child>
+ <left_attach>0</left_attach>
+ <right_attach>1</right_attach>
+ <top_attach>1</top_attach>
+ <bottom_attach>2</bottom_attach>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <xexpand>False</xexpand>
+ <yexpand>False</yexpand>
+ <xshrink>False</xshrink>
+ <yshrink>False</yshrink>
+ <xfill>True</xfill>
+ <yfill>False</yfill>
</child>
+ </widget>
+ <widget>
+ <class>GtkCombo</class>
+ <name>combo4</name>
+ <value_in_list>False</value_in_list>
+ <ok_if_empty>True</ok_if_empty>
+ <case_sensitive>False</case_sensitive>
+ <use_arrows>True</use_arrows>
+ <use_arrows_always>False</use_arrows_always>
+ <items></items>
<child>
- <widget class="GtkVBox" id="account-editor-searching-vbox">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">0</property>
+ <left_attach>1</left_attach>
+ <right_attach>2</right_attach>
+ <top_attach>0</top_attach>
+ <bottom_attach>1</bottom_attach>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <xexpand>True</xexpand>
+ <yexpand>False</yexpand>
+ <xshrink>False</xshrink>
+ <yshrink>False</yshrink>
+ <xfill>True</xfill>
+ <yfill>False</yfill>
+ </child>
- <child>
- <placeholder/>
- </child>
- </widget>
- <packing>
- <property name="tab_expand">False</property>
- <property name="tab_fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label344">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Searching</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="type">tab</property>
- </packing>
+ <widget>
+ <class>GtkEntry</class>
+ <child_name>GtkCombo:entry</child_name>
+ <name>combo-entry2</name>
+ <can_focus>True</can_focus>
+ <editable>True</editable>
+ <text_visible>True</text_visible>
+ <text_max_length>0</text_max_length>
+ <text></text>
+ </widget>
+ </widget>
+
+ <widget>
+ <class>GtkCombo</class>
+ <name>combo5</name>
+ <value_in_list>False</value_in_list>
+ <ok_if_empty>True</ok_if_empty>
+ <case_sensitive>False</case_sensitive>
+ <use_arrows>True</use_arrows>
+ <use_arrows_always>False</use_arrows_always>
+ <items></items>
+ <child>
+ <left_attach>1</left_attach>
+ <right_attach>2</right_attach>
+ <top_attach>1</top_attach>
+ <bottom_attach>2</bottom_attach>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <xexpand>True</xexpand>
+ <yexpand>False</yexpand>
+ <xshrink>False</xshrink>
+ <yshrink>False</yshrink>
+ <xfill>True</xfill>
+ <yfill>False</yfill>
</child>
+
+ <widget>
+ <class>GtkEntry</class>
+ <child_name>GtkCombo:entry</child_name>
+ <name>combo-entry3</name>
+ <can_focus>True</can_focus>
+ <editable>True</editable>
+ <text_visible>True</text_visible>
+ <text_max_length>0</text_max_length>
+ <text></text>
+ </widget>
</widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
+ </widget>
+ </widget>
+ </widget>
+</widget>
+<widget>
+ <class>GnomeDialog</class>
+ <name>Add/Edit Attribute Mappings-- Multiple Selection Version</name>
+ <visible>False</visible>
+ <title>Add (or Edit) Attribute Mappings</title>
+ <type>GTK_WINDOW_TOPLEVEL</type>
+ <position>GTK_WIN_POS_NONE</position>
+ <modal>False</modal>
+ <default_width>393</default_width>
+ <default_height>324</default_height>
+ <allow_shrink>False</allow_shrink>
+ <allow_grow>True</allow_grow>
+ <auto_shrink>False</auto_shrink>
+ <auto_close>False</auto_close>
+ <hide_on_close>False</hide_on_close>
+
+ <widget>
+ <class>GtkVBox</class>
+ <child_name>GnomeDialog:vbox</child_name>
+ <name>vbox31</name>
+ <homogeneous>False</homogeneous>
+ <spacing>8</spacing>
+ <child>
+ <padding>4</padding>
+ <expand>True</expand>
+ <fill>True</fill>
+ </child>
+
+ <widget>
+ <class>GtkHButtonBox</class>
+ <child_name>GnomeDialog:action_area</child_name>
+ <name>hbuttonbox9</name>
+ <layout_style>GTK_BUTTONBOX_END</layout_style>
+ <spacing>8</spacing>
+ <child_min_width>85</child_min_width>
+ <child_min_height>27</child_min_height>
+ <child_ipad_x>7</child_ipad_x>
+ <child_ipad_y>0</child_ipad_y>
<child>
- <widget class="GtkHSeparator" id="hseparator10">
- <property name="visible">True</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>True</fill>
+ <pack>GTK_PACK_END</pack>
</child>
+ <widget>
+ <class>GtkButton</class>
+ <name>button40</name>
+ <can_default>True</can_default>
+ <can_focus>True</can_focus>
+ <stock_button>GNOME_STOCK_BUTTON_OK</stock_button>
+ </widget>
+
+ <widget>
+ <class>GtkButton</class>
+ <name>button41</name>
+ <can_default>True</can_default>
+ <can_focus>True</can_focus>
+ <stock_button>GNOME_STOCK_BUTTON_CANCEL</stock_button>
+ </widget>
+ </widget>
+
+ <widget>
+ <class>GtkVBox</class>
+ <name>vbox32</name>
+ <homogeneous>False</homogeneous>
+ <spacing>0</spacing>
<child>
- <widget class="GtkHBox" id="hbox120">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">0</property>
+ <padding>0</padding>
+ <expand>True</expand>
+ <fill>True</fill>
+ </child>
+ <widget>
+ <class>GtkHBox</class>
+ <name>hbox67</name>
+ <border_width>3</border_width>
+ <homogeneous>False</homogeneous>
+ <spacing>3</spacing>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
+ </child>
+
+ <widget>
+ <class>GnomePixmap</class>
+ <name>pixmap36</name>
+ <filename>ldap.png</filename>
<child>
- <widget class="GtkHButtonBox" id="hbuttonbox20">
- <property name="visible">True</property>
- <property name="layout_style">GTK_BUTTONBOX_END</property>
- <property name="spacing">0</property>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
+ </child>
+ </widget>
- <child>
- <widget class="GtkButton" id="account-editor-ok-button">
- <property name="visible">True</property>
- <property name="sensitive">False</property>
- <property name="can_default">True</property>
- <property name="can_focus">True</property>
- <property name="label">gtk-ok</property>
- <property name="use_stock">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- </widget>
- </child>
+ <widget>
+ <class>GtkLabel</class>
+ <name>label286</name>
+ <label>Please select an Evolution attribute and an
+LDAP attribute to associate with it.</label>
+ <justify>GTK_JUSTIFY_LEFT</justify>
+ <wrap>False</wrap>
+ <xalign>0.5</xalign>
+ <yalign>0.5</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
+ </child>
+ </widget>
+ </widget>
+
+ <widget>
+ <class>GtkHSeparator</class>
+ <name>hseparator9</name>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
+ </child>
+ </widget>
+
+ <widget>
+ <class>GtkTable</class>
+ <name>table19</name>
+ <border_width>3</border_width>
+ <rows>2</rows>
+ <columns>2</columns>
+ <homogeneous>False</homogeneous>
+ <row_spacing>3</row_spacing>
+ <column_spacing>3</column_spacing>
+ <child>
+ <padding>0</padding>
+ <expand>True</expand>
+ <fill>True</fill>
+ </child>
+
+ <widget>
+ <class>GtkLabel</class>
+ <name>label287</name>
+ <label>_Evolution attribute:</label>
+ <justify>GTK_JUSTIFY_CENTER</justify>
+ <wrap>False</wrap>
+ <xalign>0</xalign>
+ <yalign>0.5</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <default_focus_target>entry32</default_focus_target>
+ <child>
+ <left_attach>0</left_attach>
+ <right_attach>1</right_attach>
+ <top_attach>0</top_attach>
+ <bottom_attach>1</bottom_attach>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <xexpand>False</xexpand>
+ <yexpand>False</yexpand>
+ <xshrink>False</xshrink>
+ <yshrink>False</yshrink>
+ <xfill>True</xfill>
+ <yfill>False</yfill>
+ </child>
+ </widget>
- <child>
- <widget class="GtkButton" id="account-editor-cancel-button">
- <property name="visible">True</property>
- <property name="can_default">True</property>
- <property name="can_focus">True</property>
- <property name="label">gtk-cancel</property>
- <property name="use_stock">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- </widget>
- </child>
+ <widget>
+ <class>GtkCombo</class>
+ <name>combo6</name>
+ <value_in_list>False</value_in_list>
+ <ok_if_empty>True</ok_if_empty>
+ <case_sensitive>False</case_sensitive>
+ <use_arrows>True</use_arrows>
+ <use_arrows_always>False</use_arrows_always>
+ <items></items>
+ <child>
+ <left_attach>1</left_attach>
+ <right_attach>2</right_attach>
+ <top_attach>0</top_attach>
+ <bottom_attach>1</bottom_attach>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <xexpand>True</xexpand>
+ <yexpand>False</yexpand>
+ <xshrink>False</xshrink>
+ <yshrink>False</yshrink>
+ <xfill>True</xfill>
+ <yfill>False</yfill>
+ </child>
+
+ <widget>
+ <class>GtkEntry</class>
+ <child_name>GtkCombo:entry</child_name>
+ <name>entry32</name>
+ <can_focus>True</can_focus>
+ <editable>True</editable>
+ <text_visible>True</text_visible>
+ <text_max_length>0</text_max_length>
+ <text></text>
+ </widget>
+ </widget>
+
+ <widget>
+ <class>GtkLabel</class>
+ <name>label288</name>
+ <label>_LDAP attributes:</label>
+ <justify>GTK_JUSTIFY_CENTER</justify>
+ <wrap>False</wrap>
+ <xalign>0</xalign>
+ <yalign>7.45058e-09</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <child>
+ <left_attach>0</left_attach>
+ <right_attach>1</right_attach>
+ <top_attach>1</top_attach>
+ <bottom_attach>2</bottom_attach>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <xexpand>False</xexpand>
+ <yexpand>True</yexpand>
+ <xshrink>False</xshrink>
+ <yshrink>False</yshrink>
+ <xfill>True</xfill>
+ <yfill>True</yfill>
+ </child>
+ </widget>
+
+ <widget>
+ <class>GtkScrolledWindow</class>
+ <name>scrolledwindow6</name>
+ <hscrollbar_policy>GTK_POLICY_AUTOMATIC</hscrollbar_policy>
+ <vscrollbar_policy>GTK_POLICY_AUTOMATIC</vscrollbar_policy>
+ <hupdate_policy>GTK_UPDATE_CONTINUOUS</hupdate_policy>
+ <vupdate_policy>GTK_UPDATE_CONTINUOUS</vupdate_policy>
+ <child>
+ <left_attach>1</left_attach>
+ <right_attach>2</right_attach>
+ <top_attach>1</top_attach>
+ <bottom_attach>2</bottom_attach>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <xexpand>False</xexpand>
+ <yexpand>False</yexpand>
+ <xshrink>False</xshrink>
+ <yshrink>False</yshrink>
+ <xfill>True</xfill>
+ <yfill>True</yfill>
+ </child>
+
+ <widget>
+ <class>GtkCList</class>
+ <name>clist4</name>
+ <can_focus>True</can_focus>
+ <columns>2</columns>
+ <column_widths>163,80</column_widths>
+ <selection_mode>GTK_SELECTION_SINGLE</selection_mode>
+ <show_titles>True</show_titles>
+ <shadow_type>GTK_SHADOW_IN</shadow_type>
+
+ <widget>
+ <class>GtkLabel</class>
+ <child_name>CList:title</child_name>
+ <name>label289</name>
+ <label>Attribute</label>
+ <justify>GTK_JUSTIFY_CENTER</justify>
+ <wrap>False</wrap>
+ <xalign>0.5</xalign>
+ <yalign>0.5</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
</widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
+
+ <widget>
+ <class>GtkLabel</class>
+ <child_name>CList:title</child_name>
+ <name>label290</name>
+ <label>Select</label>
+ <justify>GTK_JUSTIFY_CENTER</justify>
+ <wrap>False</wrap>
+ <xalign>0.5</xalign>
+ <yalign>0.5</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ </widget>
+ </widget>
+ </widget>
+ </widget>
</widget>
- </child>
+ </widget>
</widget>
-<widget class="GtkWindow" id="account-druid-window">
- <property name="title" translatable="yes">Add LDAP Server</property>
- <property name="type">GTK_WINDOW_TOPLEVEL</property>
- <property name="window_position">GTK_WIN_POS_NONE</property>
- <property name="modal">False</property>
- <property name="resizable">True</property>
- <property name="destroy_with_parent">False</property>
+<widget>
+ <class>GtkWindow</class>
+ <name>account-editor-window</name>
+ <visible>False</visible>
+ <title>account-editor</title>
+ <type>GTK_WINDOW_TOPLEVEL</type>
+ <position>GTK_WIN_POS_NONE</position>
+ <modal>False</modal>
+ <allow_shrink>False</allow_shrink>
+ <allow_grow>True</allow_grow>
+ <auto_shrink>False</auto_shrink>
+
+ <widget>
+ <class>GtkVBox</class>
+ <name>vbox37</name>
+ <homogeneous>False</homogeneous>
+ <spacing>0</spacing>
+
+ <widget>
+ <class>GtkNotebook</class>
+ <name>account-editor-notebook</name>
+ <can_focus>True</can_focus>
+ <show_tabs>True</show_tabs>
+ <show_border>True</show_border>
+ <tab_pos>GTK_POS_TOP</tab_pos>
+ <scrollable>False</scrollable>
+ <tab_hborder>2</tab_hborder>
+ <tab_vborder>2</tab_vborder>
+ <popup_enable>False</popup_enable>
+ <child>
+ <padding>0</padding>
+ <expand>True</expand>
+ <fill>True</fill>
+ </child>
- <child>
- <widget class="GnomeDruid" id="account-druid">
- <property name="border_width">4</property>
- <property name="visible">True</property>
- <property name="show_help">False</property>
+ <widget>
+ <class>GtkVBox</class>
+ <name>account-editor-general-vbox</name>
+ <border_width>6</border_width>
+ <homogeneous>False</homogeneous>
+ <spacing>3</spacing>
+
+ <widget>
+ <class>GtkHBox</class>
+ <name>hbox100</name>
+ <border_width>3</border_width>
+ <homogeneous>False</homogeneous>
+ <spacing>4</spacing>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
+ </child>
- <child>
- <widget class="GnomeDruidPageEdge" id="druidpagestart1">
- <property name="visible">True</property>
- <property name="position">GNOME_EDGE_START</property>
- <property name="title" translatable="yes">LDAP Configuration Assistant</property>
- <property name="text" translatable="yes">This assistant will help you to access online directory services
-using LDAP (Lightweight Directory Access Protocol) servers.
+ <widget>
+ <class>GtkLabel</class>
+ <name>label431</name>
+ <label>_Display name:</label>
+ <justify>GTK_JUSTIFY_CENTER</justify>
+ <wrap>False</wrap>
+ <xalign>0.5</xalign>
+ <yalign>0.5</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
+ </child>
+ </widget>
+
+ <widget>
+ <class>GtkAlignment</class>
+ <name>alignment45</name>
+ <xalign>1</xalign>
+ <yalign>0.5</yalign>
+ <xscale>0.9</xscale>
+ <yscale>1</yscale>
+ <child>
+ <padding>0</padding>
+ <expand>True</expand>
+ <fill>True</fill>
+ </child>
+
+ <widget>
+ <class>GtkEntry</class>
+ <name>account-editor-display-name-entry</name>
+ <can_focus>True</can_focus>
+ <editable>True</editable>
+ <text_visible>True</text_visible>
+ <text_max_length>0</text_max_length>
+ <text></text>
+ </widget>
+ </widget>
+ </widget>
-Adding a new LDAP server requires some specialized information
-about the server. Please contact your system administrator if you
-need help finding this information.</property>
- <property name="title_color">#ffffffffffff</property>
- <property name="text_color">#000000000000</property>
- <property name="background_color">#000000000000</property>
- <property name="logo_background_color">#000000000000</property>
- <property name="textbox_color">#ffffffffffff</property>
+ <widget>
+ <class>GtkHSeparator</class>
+ <name>hseparator12</name>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
+ </child>
+ </widget>
+ </widget>
+
+ <widget>
+ <class>GtkLabel</class>
+ <child_name>Notebook:tab</child_name>
+ <name>label331</name>
+ <label>General</label>
+ <justify>GTK_JUSTIFY_CENTER</justify>
+ <wrap>False</wrap>
+ <xalign>0.5</xalign>
+ <yalign>0.5</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ </widget>
+
+ <widget>
+ <class>GtkVBox</class>
+ <name>account-editor-connecting-vbox</name>
+ <homogeneous>False</homogeneous>
+ <spacing>0</spacing>
+
+ <widget>
+ <class>Placeholder</class>
+ </widget>
+ </widget>
+
+ <widget>
+ <class>GtkLabel</class>
+ <child_name>Notebook:tab</child_name>
+ <name>label334</name>
+ <label>Connecting</label>
+ <justify>GTK_JUSTIFY_CENTER</justify>
+ <wrap>False</wrap>
+ <xalign>0.5</xalign>
+ <yalign>0.5</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ </widget>
+
+ <widget>
+ <class>GtkVBox</class>
+ <name>account-editor-searching-vbox</name>
+ <homogeneous>False</homogeneous>
+ <spacing>0</spacing>
+
+ <widget>
+ <class>Placeholder</class>
+ </widget>
+ </widget>
+
+ <widget>
+ <class>GtkLabel</class>
+ <child_name>Notebook:tab</child_name>
+ <name>label344</name>
+ <label>Searching</label>
+ <justify>GTK_JUSTIFY_CENTER</justify>
+ <wrap>False</wrap>
+ <xalign>0.5</xalign>
+ <yalign>0.5</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ </widget>
+
+ <widget>
+ <class>GtkVBox</class>
+ <name>account-editor-objectclasses-vbox</name>
+ <homogeneous>False</homogeneous>
+ <spacing>0</spacing>
+
+ <widget>
+ <class>Placeholder</class>
</widget>
+ </widget>
+
+ <widget>
+ <class>GtkLabel</class>
+ <child_name>Notebook:tab</child_name>
+ <name>account-editor-objectclasses-label</name>
+ <label>Objectclasses</label>
+ <justify>GTK_JUSTIFY_CENTER</justify>
+ <wrap>False</wrap>
+ <xalign>0.5</xalign>
+ <yalign>0.5</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ </widget>
+
+ <widget>
+ <class>GtkVBox</class>
+ <name>account-editor-mappings-vbox</name>
+ <homogeneous>False</homogeneous>
+ <spacing>0</spacing>
+
+ <widget>
+ <class>Placeholder</class>
+ </widget>
+ </widget>
+
+ <widget>
+ <class>GtkLabel</class>
+ <child_name>Notebook:tab</child_name>
+ <name>account-editor-mappings-label</name>
+ <label>Mappings</label>
+ <justify>GTK_JUSTIFY_CENTER</justify>
+ <wrap>False</wrap>
+ <xalign>0.5</xalign>
+ <yalign>0.5</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ </widget>
+
+ <widget>
+ <class>GtkVBox</class>
+ <name>account-editor-dn-customization-vbox</name>
+ <homogeneous>False</homogeneous>
+ <spacing>0</spacing>
+
+ <widget>
+ <class>Placeholder</class>
+ </widget>
+ </widget>
+
+ <widget>
+ <class>GtkLabel</class>
+ <child_name>Notebook:tab</child_name>
+ <name>account-editor-dn-customization-label</name>
+ <label>DN Customization</label>
+ <justify>GTK_JUSTIFY_CENTER</justify>
+ <wrap>False</wrap>
+ <xalign>0.5</xalign>
+ <yalign>0.5</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ </widget>
+ </widget>
+
+ <widget>
+ <class>GtkHSeparator</class>
+ <name>hseparator10</name>
+ <child>
+ <padding>0</padding>
+ <expand>True</expand>
+ <fill>True</fill>
</child>
+ </widget>
+ <widget>
+ <class>GtkHBox</class>
+ <name>hbox120</name>
+ <homogeneous>False</homogeneous>
+ <spacing>0</spacing>
<child>
- <widget class="GnomeDruidPageStandard" id="add-server-druid-info-page">
- <property name="visible">True</property>
- <property name="title" translatable="yes">Step 1: Server Information</property>
- <property name="title_foreground">#e6e0bfffe498</property>
- <property name="background">#c5480812e498</property>
- <property name="logo_background">#a440081dc8cc</property>
-
- <child internal-child="vbox">
- <widget class="GtkVBox" id="druid-vbox1">
- <property name="border_width">3</property>
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">3</property>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
+ </child>
- <child>
- <widget class="GtkVBox" id="account-druid-general-vbox">
- <property name="border_width">3</property>
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">3</property>
-
- <child>
- <widget class="GtkLabel" id="label158">
- <property name="visible">True</property>
- <property name="label" translatable="yes">The first step in configuring an LDAP server is to provide its name, and your log in
-information. Please ask your system administrator if you are unsure of this information.</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">7.45058e-09</property>
- <property name="yalign">0.5</property>
- <property name="xpad">3</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkHSeparator" id="hseparator2">
- <property name="visible">True</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
- </widget>
+ <widget>
+ <class>GtkNotebook</class>
+ <name>account-editor-advanced-button-notebook</name>
+ <show_tabs>False</show_tabs>
+ <show_border>False</show_border>
+ <tab_pos>GTK_POS_TOP</tab_pos>
+ <scrollable>False</scrollable>
+ <tab_hborder>2</tab_hborder>
+ <tab_vborder>2</tab_vborder>
+ <popup_enable>False</popup_enable>
+ <child>
+ <padding>0</padding>
+ <expand>True</expand>
+ <fill>True</fill>
+ </child>
+
+ <widget>
+ <class>GtkHButtonBox</class>
+ <name>hbuttonbox21</name>
+ <layout_style>GTK_BUTTONBOX_START</layout_style>
+ <spacing>0</spacing>
+ <child_min_width>85</child_min_width>
+ <child_min_height>27</child_min_height>
+ <child_ipad_x>7</child_ipad_x>
+ <child_ipad_y>0</child_ipad_y>
+
+ <widget>
+ <class>GtkButton</class>
+ <name>account-editor-fewer-options-button</name>
+ <can_default>True</can_default>
+ <can_focus>True</can_focus>
+ <label>&lt;&lt; Fewer Options</label>
+ <relief>GTK_RELIEF_NORMAL</relief>
+ </widget>
+ </widget>
+
+ <widget>
+ <class>GtkLabel</class>
+ <child_name>Notebook:tab</child_name>
+ <name>label554</name>
+ <label>label554</label>
+ <justify>GTK_JUSTIFY_CENTER</justify>
+ <wrap>False</wrap>
+ <xalign>0.5</xalign>
+ <yalign>0.5</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ </widget>
+
+ <widget>
+ <class>GtkHButtonBox</class>
+ <name>hbuttonbox28</name>
+ <layout_style>GTK_BUTTONBOX_START</layout_style>
+ <spacing>0</spacing>
+ <child_min_width>85</child_min_width>
+ <child_min_height>27</child_min_height>
+ <child_ipad_x>7</child_ipad_x>
+ <child_ipad_y>0</child_ipad_y>
+
+ <widget>
+ <class>GtkButton</class>
+ <name>account-editor-more-options-button</name>
+ <can_default>True</can_default>
+ <can_focus>True</can_focus>
+ <label>_More Options &gt;&gt;</label>
+ <relief>GTK_RELIEF_NORMAL</relief>
+ </widget>
+ </widget>
+
+ <widget>
+ <class>GtkLabel</class>
+ <child_name>Notebook:tab</child_name>
+ <name>label555</name>
+ <label>label555</label>
+ <justify>GTK_JUSTIFY_CENTER</justify>
+ <wrap>False</wrap>
+ <xalign>0.5</xalign>
+ <yalign>0.5</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ </widget>
+ </widget>
+
+ <widget>
+ <class>GtkHButtonBox</class>
+ <name>hbuttonbox20</name>
+ <layout_style>GTK_BUTTONBOX_END</layout_style>
+ <spacing>0</spacing>
+ <child_min_width>85</child_min_width>
+ <child_min_height>27</child_min_height>
+ <child_ipad_x>7</child_ipad_x>
+ <child_ipad_y>0</child_ipad_y>
+ <child>
+ <padding>0</padding>
+ <expand>True</expand>
+ <fill>True</fill>
+ </child>
+
+ <widget>
+ <class>GtkButton</class>
+ <name>account-editor-ok-button</name>
+ <sensitive>False</sensitive>
+ <can_default>True</can_default>
+ <can_focus>True</can_focus>
+ <stock_button>GNOME_STOCK_BUTTON_OK</stock_button>
+ <relief>GTK_RELIEF_NORMAL</relief>
+ </widget>
+
+ <widget>
+ <class>GtkButton</class>
+ <name>account-editor-apply-button</name>
+ <sensitive>False</sensitive>
+ <can_default>True</can_default>
+ <can_focus>True</can_focus>
+ <stock_button>GNOME_STOCK_BUTTON_APPLY</stock_button>
+ <relief>GTK_RELIEF_NORMAL</relief>
+ </widget>
+
+ <widget>
+ <class>GtkButton</class>
+ <name>account-editor-close-button</name>
+ <can_default>True</can_default>
+ <can_focus>True</can_focus>
+ <stock_button>GNOME_STOCK_BUTTON_CLOSE</stock_button>
+ <relief>GTK_RELIEF_NORMAL</relief>
+ </widget>
+ </widget>
+ </widget>
+ </widget>
+</widget>
+
+<widget>
+ <class>GtkWindow</class>
+ <name>account-druid-window</name>
+ <visible>False</visible>
+ <title>account-druid</title>
+ <type>GTK_WINDOW_TOPLEVEL</type>
+ <position>GTK_WIN_POS_NONE</position>
+ <modal>False</modal>
+ <allow_shrink>False</allow_shrink>
+ <allow_grow>True</allow_grow>
+ <auto_shrink>False</auto_shrink>
+
+ <widget>
+ <class>GnomeDruid</class>
+ <name>account-druid</name>
+
+ <widget>
+ <class>GnomeDruidPageStart</class>
+ <name>druidpagestart1</name>
+ <title>LDAP Configuration Assistant</title>
+ <text>This assistant will help you to access online directory services
+using LDAP (Lightweight Directory Access Protocol) servers.
+
+Adding a new LDAP server requires some specialized information
+about the server. Please contact your system administrator if you
+need help finding this information.</text>
+ <title_color>255,255,255</title_color>
+ <text_color>0,0,0</text_color>
+ <background_color>0,0,0</background_color>
+ <logo_background_color>0,0,0</logo_background_color>
+ <textbox_color>255,255,255</textbox_color>
+ <logo_image>ldap.png</logo_image>
+ <watermark_image>xstdruidbg-3.png</watermark_image>
+ </widget>
+
+ <widget>
+ <class>GnomeDruidPageStandard</class>
+ <name>add-server-druid-info-page</name>
+ <title>Step 1: Server Information</title>
+ <title_color>255,255,255</title_color>
+ <background_color>0,0,0</background_color>
+ <logo_background_color>0,0,0</logo_background_color>
+
+ <widget>
+ <class>GtkVBox</class>
+ <child_name>GnomeDruidPageStandard:vbox</child_name>
+ <name>druid-vbox1</name>
+ <border_width>3</border_width>
+ <homogeneous>False</homogeneous>
+ <spacing>3</spacing>
+ <child>
+ <padding>0</padding>
+ <expand>True</expand>
+ <fill>True</fill>
+ </child>
+
+ <widget>
+ <class>GtkVBox</class>
+ <name>account-druid-general-vbox</name>
+ <border_width>3</border_width>
+ <homogeneous>False</homogeneous>
+ <spacing>3</spacing>
+ <child>
+ <padding>0</padding>
+ <expand>True</expand>
+ <fill>True</fill>
</child>
+
+ <widget>
+ <class>GtkLabel</class>
+ <name>label158</name>
+ <label>The first step in configuring an LDAP server is to provide its name, and your log in
+information. Please ask your system administrator if you are unsure of this information.</label>
+ <justify>GTK_JUSTIFY_LEFT</justify>
+ <wrap>False</wrap>
+ <xalign>7.45058e-09</xalign>
+ <yalign>0.5</yalign>
+ <xpad>3</xpad>
+ <ypad>0</ypad>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
+ </child>
+ </widget>
+
+ <widget>
+ <class>GtkHSeparator</class>
+ <name>hseparator2</name>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
+ </child>
+ </widget>
</widget>
- </child>
+ </widget>
+ </widget>
- <child>
- <widget class="GnomeDruidPageStandard" id="add-server-druid-connecting-page">
- <property name="visible">True</property>
- <property name="title" translatable="yes">Step 2: Connecting to Server</property>
- <property name="title_foreground">#e6e0bfffe498</property>
- <property name="background">#c5480812e498</property>
- <property name="logo_background">#a440081dc8cc</property>
-
- <child internal-child="vbox">
- <widget class="GtkVBox" id="druid-vbox2">
- <property name="border_width">3</property>
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">3</property>
+ <widget>
+ <class>GnomeDruidPageStandard</class>
+ <name>add-server-druid-connecting-page</name>
+ <title>Step 2: Connecting to Server</title>
+ <title_color>255,255,255</title_color>
+ <background_color>0,0,0</background_color>
+ <logo_background_color>0,0,0</logo_background_color>
+
+ <widget>
+ <class>GtkVBox</class>
+ <child_name>GnomeDruidPageStandard:vbox</child_name>
+ <name>druid-vbox2</name>
+ <border_width>3</border_width>
+ <homogeneous>False</homogeneous>
+ <spacing>3</spacing>
+ <child>
+ <padding>0</padding>
+ <expand>True</expand>
+ <fill>True</fill>
+ </child>
+
+ <widget>
+ <class>GtkVBox</class>
+ <name>account-druid-connecting-vbox</name>
+ <border_width>3</border_width>
+ <homogeneous>False</homogeneous>
+ <spacing>3</spacing>
+ <child>
+ <padding>0</padding>
+ <expand>True</expand>
+ <fill>True</fill>
+ </child>
- <child>
- <widget class="GtkVBox" id="account-druid-connecting-vbox">
- <property name="border_width">3</property>
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">3</property>
-
- <child>
- <widget class="GtkLabel" id="label174">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Now, you must specify how you want to connect to the LDAP server. The SSL (Secure Sockets Layer)
+ <widget>
+ <class>GtkLabel</class>
+ <name>label174</name>
+ <label>Now, you must specify how you want to connect to the LDAP server. The SSL (Secure Sockets Layer)
and TLS (Transport Layer Security) protocols are used by some servers to cryptographically protect
-your connection. Ask your system administrator if your LDAP server uses these protocols.</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">7.45058e-09</property>
- <property name="yalign">0.5</property>
- <property name="xpad">3</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkHSeparator" id="hseparator3">
- <property name="visible">True</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
- </widget>
+your connection. Ask your system administrator if your LDAP server uses these protocols.</label>
+ <justify>GTK_JUSTIFY_LEFT</justify>
+ <wrap>False</wrap>
+ <xalign>7.45058e-09</xalign>
+ <yalign>0.5</yalign>
+ <xpad>3</xpad>
+ <ypad>0</ypad>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
+ </child>
+ </widget>
+
+ <widget>
+ <class>GtkHSeparator</class>
+ <name>hseparator3</name>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
+ </child>
+ </widget>
+ </widget>
+ </widget>
+ </widget>
+
+ <widget>
+ <class>GnomeDruidPageStandard</class>
+ <name>add-server-druid-searching-page</name>
+ <title>Step 3: Searching the Directory</title>
+ <title_color>255,255,255</title_color>
+ <background_color>0,0,0</background_color>
+ <logo_background_color>0,0,0</logo_background_color>
+
+ <widget>
+ <class>GtkVBox</class>
+ <child_name>GnomeDruidPageStandard:vbox</child_name>
+ <name>vbox23</name>
+ <border_width>3</border_width>
+ <homogeneous>False</homogeneous>
+ <spacing>3</spacing>
+ <child>
+ <padding>0</padding>
+ <expand>True</expand>
+ <fill>True</fill>
+ </child>
+
+ <widget>
+ <class>GtkVBox</class>
+ <name>account-druid-searching-vbox</name>
+ <border_width>3</border_width>
+ <homogeneous>False</homogeneous>
+ <spacing>3</spacing>
+ <child>
+ <padding>0</padding>
+ <expand>True</expand>
+ <fill>True</fill>
</child>
+
+ <widget>
+ <class>GtkLabel</class>
+ <name>label254</name>
+ <label>The options on this page control how many entries should be included in your
+searches, and how long a search should take. Ask your system administrator if you
+need to change these options.</label>
+ <justify>GTK_JUSTIFY_LEFT</justify>
+ <wrap>False</wrap>
+ <xalign>0.5</xalign>
+ <yalign>0.5</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
+ </child>
+ </widget>
+
+ <widget>
+ <class>GtkHSeparator</class>
+ <name>hseparator7</name>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
+ </child>
+ </widget>
</widget>
- </child>
+ </widget>
+ </widget>
- <child>
- <widget class="GnomeDruidPageStandard" id="add-server-druid-searching-page">
- <property name="visible">True</property>
- <property name="title" translatable="yes">Step 3: Searching the Directory</property>
- <property name="title_foreground">#e6e0bfffe498</property>
- <property name="background">#c5480812e498</property>
- <property name="logo_background">#a440081dc8cc</property>
-
- <child internal-child="vbox">
- <widget class="GtkVBox" id="vbox23">
- <property name="border_width">3</property>
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">3</property>
+ <widget>
+ <class>GnomeDruidPageStandard</class>
+ <name>add-server-druid-display-name-page</name>
+ <title>Step 4: Display Name</title>
+ <title_color>255,255,255</title_color>
+ <background_color>0,0,0</background_color>
+ <logo_background_color>0,0,0</logo_background_color>
+
+ <widget>
+ <class>GtkVBox</class>
+ <child_name>GnomeDruidPageStandard:vbox</child_name>
+ <name>druid-vbox5</name>
+ <border_width>3</border_width>
+ <homogeneous>False</homogeneous>
+ <spacing>3</spacing>
+ <child>
+ <padding>0</padding>
+ <expand>True</expand>
+ <fill>True</fill>
+ </child>
+
+ <widget>
+ <class>GtkVBox</class>
+ <name>vbox21</name>
+ <border_width>3</border_width>
+ <homogeneous>False</homogeneous>
+ <spacing>3</spacing>
+ <child>
+ <padding>0</padding>
+ <expand>True</expand>
+ <fill>True</fill>
+ </child>
+ <widget>
+ <class>GtkLabel</class>
+ <name>label198</name>
+ <label>Specifying a display name is the last required step in configuring an LDAP server.</label>
+ <justify>GTK_JUSTIFY_LEFT</justify>
+ <wrap>False</wrap>
+ <xalign>7.45058e-09</xalign>
+ <yalign>0.5</yalign>
+ <xpad>3</xpad>
+ <ypad>0</ypad>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
+ </child>
+ </widget>
+
+ <widget>
+ <class>GtkHSeparator</class>
+ <name>hseparator5</name>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
+ </child>
+ </widget>
+
+ <widget>
+ <class>GtkTable</class>
+ <name>table15</name>
+ <border_width>3</border_width>
+ <rows>1</rows>
+ <columns>2</columns>
+ <homogeneous>False</homogeneous>
+ <row_spacing>3</row_spacing>
+ <column_spacing>3</column_spacing>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
+ </child>
+
+ <widget>
+ <class>GtkEntry</class>
+ <name>druid-display-name-entry</name>
+ <can_focus>True</can_focus>
+ <has_focus>True</has_focus>
+ <editable>True</editable>
+ <text_visible>True</text_visible>
+ <text_max_length>0</text_max_length>
+ <text></text>
<child>
- <widget class="GtkVBox" id="account-druid-searching-vbox">
- <property name="border_width">3</property>
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">3</property>
-
- <child>
- <widget class="GtkLabel" id="label254">
- <property name="visible">True</property>
- <property name="label" translatable="yes">The options on this page control how many entries should be included in your
-searches, and how long a search should take. Ask your system administrator if you
-need to change these options.</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkHSeparator" id="hseparator7">
- <property name="visible">True</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
+ <left_attach>1</left_attach>
+ <right_attach>2</right_attach>
+ <top_attach>0</top_attach>
+ <bottom_attach>1</bottom_attach>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <xexpand>True</xexpand>
+ <yexpand>False</yexpand>
+ <xshrink>False</xshrink>
+ <yshrink>False</yshrink>
+ <xfill>True</xfill>
+ <yfill>False</yfill>
</child>
</widget>
- </child>
- </widget>
- </child>
-
- <child>
- <widget class="GnomeDruidPageStandard" id="add-server-druid-display-name-page">
- <property name="visible">True</property>
- <property name="title" translatable="yes">Step 4: Display Name</property>
- <property name="title_foreground">#e6e0bfffe498</property>
- <property name="background">#c5480812e498</property>
- <property name="logo_background">#a440081dc8cc</property>
-
- <child internal-child="vbox">
- <widget class="GtkVBox" id="druid-vbox5">
- <property name="border_width">3</property>
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">3</property>
+ <widget>
+ <class>GtkLabel</class>
+ <name>label199</name>
+ <label>_Display name:</label>
+ <justify>GTK_JUSTIFY_LEFT</justify>
+ <wrap>False</wrap>
+ <xalign>0</xalign>
+ <yalign>0.5</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <default_focus_target>druid-display-name-entry</default_focus_target>
<child>
- <widget class="GtkVBox" id="vbox21">
- <property name="border_width">3</property>
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">3</property>
-
- <child>
- <widget class="GtkLabel" id="label198">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Specifying a display name is the last required step in configuring an LDAP server.</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">7.45058e-09</property>
- <property name="yalign">0.5</property>
- <property name="xpad">3</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkHSeparator" id="hseparator5">
- <property name="visible">True</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkTable" id="table15">
- <property name="border_width">3</property>
- <property name="visible">True</property>
- <property name="n_rows">1</property>
- <property name="n_columns">2</property>
- <property name="homogeneous">False</property>
- <property name="row_spacing">3</property>
- <property name="column_spacing">3</property>
-
- <child>
- <widget class="GtkEntry" id="druid-display-name-entry">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="has_focus">True</property>
- <property name="editable">True</property>
- <property name="visibility">True</property>
- <property name="max_length">0</property>
- <property name="text" translatable="yes"></property>
- <property name="has_frame">True</property>
- <property name="invisible_char" translatable="yes">*</property>
- <property name="activates_default">False</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label199">
- <property name="visible">True</property>
- <property name="label" translatable="yes">_Display name:</property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="mnemonic_widget">druid-display-name-entry</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkNotebook" id="notebook15">
- <property name="visible">True</property>
- <property name="show_tabs">False</property>
- <property name="show_border">False</property>
- <property name="tab_pos">GTK_POS_TOP</property>
- <property name="scrollable">False</property>
- <property name="enable_popup">False</property>
-
- <child>
- <widget class="GtkLabel" id="label207">
- <property name="visible">True</property>
- <property name="label" translatable="yes">This is the name for this server that will appear in your Evolution folder list.
-It is for display purposes only. </property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="tab_expand">False</property>
- <property name="tab_fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label208">
- <property name="visible">True</property>
- <property name="label" translatable="yes">label163</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="type">tab</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label215">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Selecting this option will let you change Evolution's default settings for LDAP
-searches, and for creating and editing contacts. </property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="tab_expand">False</property>
- <property name="tab_fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label210">
- <property name="visible">True</property>
- <property name="label" translatable="yes">label164</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="type">tab</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="pack_type">GTK_PACK_END</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
+ <left_attach>0</left_attach>
+ <right_attach>1</right_attach>
+ <top_attach>0</top_attach>
+ <bottom_attach>1</bottom_attach>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <xexpand>False</xexpand>
+ <yexpand>False</yexpand>
+ <xshrink>False</xshrink>
+ <yshrink>False</yshrink>
+ <xfill>True</xfill>
+ <yfill>False</yfill>
</child>
</widget>
- </child>
+ </widget>
+
+ <widget>
+ <class>GtkNotebook</class>
+ <name>notebook15</name>
+ <show_tabs>False</show_tabs>
+ <show_border>False</show_border>
+ <tab_pos>GTK_POS_TOP</tab_pos>
+ <scrollable>False</scrollable>
+ <tab_hborder>2</tab_hborder>
+ <tab_vborder>2</tab_vborder>
+ <popup_enable>False</popup_enable>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
+ <pack>GTK_PACK_END</pack>
+ </child>
+
+ <widget>
+ <class>GtkHBox</class>
+ <name>hbox41</name>
+ <border_width>3</border_width>
+ <homogeneous>False</homogeneous>
+ <spacing>2</spacing>
+
+ <widget>
+ <class>GnomePixmap</class>
+ <name>pixmap21</name>
+ <filename>gnome-hint.png</filename>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
+ </child>
+ </widget>
+
+ <widget>
+ <class>GtkLabel</class>
+ <name>label207</name>
+ <label>This is the name for this server that will appear in your Evolution folder list.
+It is for display purposes only. </label>
+ <justify>GTK_JUSTIFY_LEFT</justify>
+ <wrap>False</wrap>
+ <xalign>0</xalign>
+ <yalign>0.5</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
+ </child>
+ </widget>
+ </widget>
+
+ <widget>
+ <class>GtkLabel</class>
+ <child_name>Notebook:tab</child_name>
+ <name>label208</name>
+ <label>label163</label>
+ <justify>GTK_JUSTIFY_CENTER</justify>
+ <wrap>False</wrap>
+ <xalign>0.5</xalign>
+ <yalign>0.5</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ </widget>
+
+ <widget>
+ <class>GtkHBox</class>
+ <name>hbox42</name>
+ <border_width>3</border_width>
+ <homogeneous>False</homogeneous>
+ <spacing>3</spacing>
+
+ <widget>
+ <class>GnomePixmap</class>
+ <name>pixmap22</name>
+ <filename>gnome-hint.png</filename>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
+ </child>
+ </widget>
+
+ <widget>
+ <class>GtkLabel</class>
+ <name>label215</name>
+ <label>Selecting this option will let you change Evolution's default settings for LDAP
+searches, and for creating and editing contacts. </label>
+ <justify>GTK_JUSTIFY_LEFT</justify>
+ <wrap>False</wrap>
+ <xalign>0.5</xalign>
+ <yalign>0.5</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
+ </child>
+ </widget>
+ </widget>
+
+ <widget>
+ <class>GtkLabel</class>
+ <child_name>Notebook:tab</child_name>
+ <name>label210</name>
+ <label>label164</label>
+ <justify>GTK_JUSTIFY_CENTER</justify>
+ <wrap>False</wrap>
+ <xalign>0.5</xalign>
+ <yalign>0.5</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ </widget>
+ </widget>
</widget>
- </child>
+ </widget>
+ </widget>
- <child>
- <widget class="GnomeDruidPageEdge" id="add-server-druid-finish-page">
- <property name="visible">True</property>
- <property name="position">GNOME_EDGE_FINISH</property>
- <property name="title" translatable="yes">Finished</property>
- <property name="text" translatable="yes">Congratulations, you are finished setting up this LDAP server. You
+ <widget>
+ <class>GnomeDruidPageFinish</class>
+ <name>add-server-druid-finish-page</name>
+ <title>Finished</title>
+ <text>Congratulations, you are finished setting up this LDAP server. You
are now ready to access this directory.
-Please click the &quot;Finish&quot; button to save the settings you have entered here.</property>
- <property name="title_color">#ffffffffffff</property>
- <property name="text_color">#000000000000</property>
- <property name="background_color">#000000000000</property>
- <property name="logo_background_color">#000000000000</property>
- <property name="textbox_color">#ffffffffffff</property>
- </widget>
- </child>
+Please click the &quot;Finish&quot; button to save the settings you have entered here.</text>
+ <background_color>0,0,0</background_color>
+ <logo_background_color>0,0,0</logo_background_color>
+ <textbox_color>255,255,255</textbox_color>
+ <text_color>0,0,0</text_color>
+ <title_color>255,255,255</title_color>
+ <watermark_image>xstdruidbg-3.png</watermark_image>
</widget>
- </child>
+ </widget>
</widget>
-<widget class="GtkDialog" id="addressbook-sources-window">
- <property name="title" translatable="yes">Addressbook Sources</property>
- <property name="type">GTK_WINDOW_TOPLEVEL</property>
- <property name="window_position">GTK_WIN_POS_NONE</property>
- <property name="modal">False</property>
- <property name="default_width">355</property>
- <property name="default_height">285</property>
- <property name="resizable">True</property>
- <property name="destroy_with_parent">False</property>
- <property name="has_separator">True</property>
-
- <child internal-child="vbox">
- <widget class="GtkVBox" id="addressbook-sources-vbox">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">8</property>
-
- <child internal-child="action_area">
- <widget class="GtkHButtonBox" id="hbuttonbox27">
- <property name="visible">True</property>
- <property name="layout_style">GTK_BUTTONBOX_END</property>
-
- <child>
- <widget class="GtkButton" id="button104">
- <property name="visible">True</property>
- <property name="can_default">True</property>
- <property name="can_focus">True</property>
- <property name="label">gtk-ok</property>
- <property name="use_stock">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="response_id">0</property>
- </widget>
- </child>
+<widget>
+ <class>GtkWindow</class>
+ <name>edit_server_window_simple</name>
+ <visible>False</visible>
+ <title>edit_server_window_simple</title>
+ <type>GTK_WINDOW_TOPLEVEL</type>
+ <position>GTK_WIN_POS_NONE</position>
+ <modal>False</modal>
+ <allow_shrink>False</allow_shrink>
+ <allow_grow>True</allow_grow>
+ <auto_shrink>False</auto_shrink>
+
+ <widget>
+ <class>GtkVBox</class>
+ <name>vbox67</name>
+ <homogeneous>False</homogeneous>
+ <spacing>0</spacing>
+
+ <widget>
+ <class>GtkNotebook</class>
+ <name>notebook25</name>
+ <can_focus>True</can_focus>
+ <show_tabs>True</show_tabs>
+ <show_border>True</show_border>
+ <tab_pos>GTK_POS_TOP</tab_pos>
+ <scrollable>False</scrollable>
+ <tab_hborder>2</tab_hborder>
+ <tab_vborder>2</tab_vborder>
+ <popup_enable>False</popup_enable>
+ <child>
+ <padding>0</padding>
+ <expand>True</expand>
+ <fill>True</fill>
+ </child>
+ <widget>
+ <class>GtkVBox</class>
+ <name>vbox68</name>
+ <border_width>6</border_width>
+ <homogeneous>False</homogeneous>
+ <spacing>3</spacing>
+
+ <widget>
+ <class>GtkHBox</class>
+ <name>hbox121</name>
+ <border_width>3</border_width>
+ <homogeneous>False</homogeneous>
+ <spacing>4</spacing>
<child>
- <widget class="GtkButton" id="button105">
- <property name="visible">True</property>
- <property name="can_default">True</property>
- <property name="can_focus">True</property>
- <property name="label">gtk-apply</property>
- <property name="use_stock">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="response_id">0</property>
- </widget>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
</child>
- <child>
- <widget class="GtkButton" id="button106">
- <property name="visible">True</property>
- <property name="can_default">True</property>
- <property name="can_focus">True</property>
- <property name="label">gtk-close</property>
- <property name="use_stock">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="response_id">0</property>
+ <widget>
+ <class>GtkLabel</class>
+ <name>label484</name>
+ <label>_Display name:</label>
+ <justify>GTK_JUSTIFY_CENTER</justify>
+ <wrap>False</wrap>
+ <xalign>0.5</xalign>
+ <yalign>0.5</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
+ </child>
+ </widget>
+
+ <widget>
+ <class>GtkAlignment</class>
+ <name>alignment52</name>
+ <xalign>1</xalign>
+ <yalign>0.5</yalign>
+ <xscale>0.9</xscale>
+ <yscale>1</yscale>
+ <child>
+ <padding>0</padding>
+ <expand>True</expand>
+ <fill>True</fill>
+ </child>
+
+ <widget>
+ <class>GtkEntry</class>
+ <name>entry54</name>
+ <can_focus>True</can_focus>
+ <editable>True</editable>
+ <text_visible>True</text_visible>
+ <text_max_length>0</text_max_length>
+ <text></text>
</widget>
+ </widget>
+ </widget>
+
+ <widget>
+ <class>GtkHSeparator</class>
+ <name>hseparator13</name>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
</child>
</widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="pack_type">GTK_PACK_END</property>
- </packing>
- </child>
- <child>
- <widget class="GtkHBox" id="addressbook-sources">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">0</property>
-
- <child>
- <widget class="Custom" id="sourcesTable">
- <property name="visible">True</property>
- <property name="creation_function">addressbook_dialog_create_sources_table</property>
- <property name="int1">0</property>
- <property name="int2">0</property>
- <property name="last_modification_time">Thu, 11 Apr 2002 00:31:02 GMT</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
+ <widget>
+ <class>GtkTable</class>
+ <name>table32</name>
+ <border_width>3</border_width>
+ <rows>3</rows>
+ <columns>2</columns>
+ <homogeneous>False</homogeneous>
+ <row_spacing>3</row_spacing>
+ <column_spacing>3</column_spacing>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
</child>
+ <widget>
+ <class>GtkLabel</class>
+ <name>label485</name>
+ <label>_Server name:</label>
+ <justify>GTK_JUSTIFY_CENTER</justify>
+ <wrap>False</wrap>
+ <xalign>0</xalign>
+ <yalign>0.5</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <default_focus_target>entry55</default_focus_target>
+ <child>
+ <left_attach>0</left_attach>
+ <right_attach>1</right_attach>
+ <top_attach>0</top_attach>
+ <bottom_attach>1</bottom_attach>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <xexpand>False</xexpand>
+ <yexpand>False</yexpand>
+ <xshrink>False</xshrink>
+ <yshrink>False</yshrink>
+ <xfill>True</xfill>
+ <yfill>False</yfill>
+ </child>
+ </widget>
+
+ <widget>
+ <class>GtkLabel</class>
+ <name>label486</name>
+ <label>_Log in method:</label>
+ <justify>GTK_JUSTIFY_CENTER</justify>
+ <wrap>False</wrap>
+ <xalign>0</xalign>
+ <yalign>0.5</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <child>
+ <left_attach>0</left_attach>
+ <right_attach>1</right_attach>
+ <top_attach>1</top_attach>
+ <bottom_attach>2</bottom_attach>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <xexpand>False</xexpand>
+ <yexpand>False</yexpand>
+ <xshrink>False</xshrink>
+ <yshrink>False</yshrink>
+ <xfill>True</xfill>
+ <yfill>False</yfill>
+ </child>
+ </widget>
+
+ <widget>
+ <class>GtkLabel</class>
+ <name>label487</name>
+ <label>Distinguished _name:</label>
+ <justify>GTK_JUSTIFY_CENTER</justify>
+ <wrap>False</wrap>
+ <xalign>0</xalign>
+ <yalign>0.5</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <default_focus_target>entry56</default_focus_target>
+ <child>
+ <left_attach>0</left_attach>
+ <right_attach>1</right_attach>
+ <top_attach>2</top_attach>
+ <bottom_attach>3</bottom_attach>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <xexpand>False</xexpand>
+ <yexpand>False</yexpand>
+ <xshrink>False</xshrink>
+ <yshrink>False</yshrink>
+ <xfill>True</xfill>
+ <yfill>False</yfill>
+ </child>
+ </widget>
+
+ <widget>
+ <class>GtkEntry</class>
+ <name>entry55</name>
+ <can_focus>True</can_focus>
+ <has_focus>True</has_focus>
+ <editable>True</editable>
+ <text_visible>True</text_visible>
+ <text_max_length>0</text_max_length>
+ <text></text>
+ <child>
+ <left_attach>1</left_attach>
+ <right_attach>2</right_attach>
+ <top_attach>0</top_attach>
+ <bottom_attach>1</bottom_attach>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <xexpand>True</xexpand>
+ <yexpand>False</yexpand>
+ <xshrink>False</xshrink>
+ <yshrink>False</yshrink>
+ <xfill>True</xfill>
+ <yfill>False</yfill>
+ </child>
+ </widget>
+
+ <widget>
+ <class>GtkAlignment</class>
+ <name>alignment53</name>
+ <xalign>7.45058e-09</xalign>
+ <yalign>0.5</yalign>
+ <xscale>0</xscale>
+ <yscale>1</yscale>
+ <child>
+ <left_attach>1</left_attach>
+ <right_attach>2</right_attach>
+ <top_attach>1</top_attach>
+ <bottom_attach>2</bottom_attach>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <xexpand>True</xexpand>
+ <yexpand>False</yexpand>
+ <xshrink>False</xshrink>
+ <yshrink>False</yshrink>
+ <xfill>True</xfill>
+ <yfill>False</yfill>
+ </child>
+
+ <widget>
+ <class>GtkOptionMenu</class>
+ <name>optionmenu18</name>
+ <can_focus>True</can_focus>
+ <items>Anonymously
+Using email address
+Using distinguished name (DN)
+</items>
+ <initial_choice>2</initial_choice>
+ </widget>
+ </widget>
+
+ <widget>
+ <class>GtkEntry</class>
+ <name>entry56</name>
+ <can_focus>True</can_focus>
+ <editable>True</editable>
+ <text_visible>True</text_visible>
+ <text_max_length>0</text_max_length>
+ <text></text>
+ <child>
+ <left_attach>1</left_attach>
+ <right_attach>2</right_attach>
+ <top_attach>2</top_attach>
+ <bottom_attach>3</bottom_attach>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <xexpand>True</xexpand>
+ <yexpand>False</yexpand>
+ <xshrink>False</xshrink>
+ <yshrink>False</yshrink>
+ <xfill>True</xfill>
+ <yfill>False</yfill>
+ </child>
+ </widget>
+ </widget>
+
+ <widget>
+ <class>GtkNotebook</class>
+ <name>notebook26</name>
+ <show_tabs>False</show_tabs>
+ <show_border>False</show_border>
+ <tab_pos>GTK_POS_TOP</tab_pos>
+ <scrollable>False</scrollable>
+ <tab_hborder>2</tab_hborder>
+ <tab_vborder>2</tab_vborder>
+ <popup_enable>False</popup_enable>
<child>
- <widget class="GtkVBox" id="vbox73">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">0</property>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
+ <pack>GTK_PACK_END</pack>
+ </child>
+ <widget>
+ <class>GtkHBox</class>
+ <name>hbox122</name>
+ <border_width>3</border_width>
+ <homogeneous>False</homogeneous>
+ <spacing>2</spacing>
+
+ <widget>
+ <class>GnomePixmap</class>
+ <name>pixmap66</name>
+ <filename>gnome-hint.png</filename>
<child>
- <widget class="GtkLabel" id="label529">
- <property name="visible">True</property>
- <property name="label" translatable="yes">
-</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
</child>
+ </widget>
+ <widget>
+ <class>GtkLabel</class>
+ <name>label488</name>
+ <label>This is the full name of your ldap server. For example, &quot;ldap.mycompany.com&quot;.</label>
+ <justify>GTK_JUSTIFY_CENTER</justify>
+ <wrap>False</wrap>
+ <xalign>0.5</xalign>
+ <yalign>0.5</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
<child>
- <widget class="GtkVButtonBox" id="vbuttonbox18">
- <property name="visible">True</property>
- <property name="layout_style">GTK_BUTTONBOX_START</property>
- <property name="spacing">0</property>
-
- <child>
- <widget class="GtkButton" id="addSource">
- <property name="visible">True</property>
- <property name="can_default">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">_Add</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkButton" id="editSource">
- <property name="visible">True</property>
- <property name="can_default">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">_Edit</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkButton" id="deleteSource">
- <property name="visible">True</property>
- <property name="can_default">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">De_lete</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
</child>
</widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
- </widget>
- </child>
-</widget>
-
-<widget class="GtkWindow" id="general-tab-window">
- <property name="title" translatable="yes">general-tab</property>
- <property name="type">GTK_WINDOW_TOPLEVEL</property>
- <property name="window_position">GTK_WIN_POS_NONE</property>
- <property name="modal">False</property>
- <property name="resizable">True</property>
- <property name="destroy_with_parent">False</property>
-
- <child>
- <widget class="GtkVBox" id="general-tab">
- <property name="border_width">6</property>
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">3</property>
-
- <child>
- <widget class="GtkTable" id="table36">
- <property name="border_width">3</property>
- <property name="visible">True</property>
- <property name="n_rows">3</property>
- <property name="n_columns">2</property>
- <property name="homogeneous">False</property>
- <property name="row_spacing">3</property>
- <property name="column_spacing">3</property>
-
- <child>
- <widget class="GtkLabel" id="label534">
- <property name="visible">True</property>
- <property name="label" translatable="yes">_Server name:</property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="mnemonic_widget">server-name-entry</property>
+ </widget>
+
+ <widget>
+ <class>GtkLabel</class>
+ <child_name>Notebook:tab</child_name>
+ <name>label489</name>
+ <label>label163</label>
+ <justify>GTK_JUSTIFY_CENTER</justify>
+ <wrap>False</wrap>
+ <xalign>0.5</xalign>
+ <yalign>0.5</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ </widget>
+
+ <widget>
+ <class>GtkHBox</class>
+ <name>hbox123</name>
+ <border_width>3</border_width>
+ <homogeneous>False</homogeneous>
+ <spacing>2</spacing>
+
+ <widget>
+ <class>GnomePixmap</class>
+ <name>pixmap67</name>
+ <filename>gnome-hint.png</filename>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
+ </child>
</widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label535">
- <property name="visible">True</property>
- <property name="label" translatable="yes">_Log in method:</property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
+
+ <widget>
+ <class>GtkLabel</class>
+ <name>label490</name>
+ <label>label168</label>
+ <justify>GTK_JUSTIFY_CENTER</justify>
+ <wrap>False</wrap>
+ <xalign>0.5</xalign>
+ <yalign>0.5</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
+ </child>
</widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkEntry" id="server-name-entry">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="has_focus">True</property>
- <property name="editable">True</property>
- <property name="visibility">True</property>
- <property name="max_length">0</property>
- <property name="text" translatable="yes"></property>
- <property name="has_frame">True</property>
- <property name="invisible_char" translatable="yes">*</property>
- <property name="activates_default">False</property>
+ </widget>
+
+ <widget>
+ <class>GtkLabel</class>
+ <child_name>Notebook:tab</child_name>
+ <name>label491</name>
+ <label>label164</label>
+ <justify>GTK_JUSTIFY_CENTER</justify>
+ <wrap>False</wrap>
+ <xalign>0.5</xalign>
+ <yalign>0.5</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ </widget>
+
+ <widget>
+ <class>GtkHBox</class>
+ <name>hbox124</name>
+ <border_width>3</border_width>
+ <homogeneous>False</homogeneous>
+ <spacing>2</spacing>
+
+ <widget>
+ <class>GnomePixmap</class>
+ <name>pixmap68</name>
+ <filename>gnome-hint.png</filename>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
+ </child>
</widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="y_options"></property>
- </packing>
- </child>
- <child>
- <widget class="GtkAlignment" id="alignment63">
- <property name="visible">True</property>
- <property name="xalign">7.45058e-09</property>
- <property name="yalign">0.5</property>
- <property name="xscale">0</property>
- <property name="yscale">1</property>
+ <widget>
+ <class>GtkLabel</class>
+ <name>label492</name>
+ <label>label169</label>
+ <justify>GTK_JUSTIFY_CENTER</justify>
+ <wrap>False</wrap>
+ <xalign>0.5</xalign>
+ <yalign>0.5</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
+ </child>
+ </widget>
+ </widget>
+
+ <widget>
+ <class>GtkLabel</class>
+ <child_name>Notebook:tab</child_name>
+ <name>label493</name>
+ <label>label165</label>
+ <justify>GTK_JUSTIFY_CENTER</justify>
+ <wrap>False</wrap>
+ <xalign>0.5</xalign>
+ <yalign>0.5</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ </widget>
+
+ <widget>
+ <class>Placeholder</class>
+ </widget>
+
+ <widget>
+ <class>GtkLabel</class>
+ <child_name>Notebook:tab</child_name>
+ <name>label494</name>
+ <label>label214</label>
+ <justify>GTK_JUSTIFY_CENTER</justify>
+ <wrap>False</wrap>
+ <xalign>0.5</xalign>
+ <yalign>0.5</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ </widget>
+
+ <widget>
+ <class>GtkHBox</class>
+ <name>hbox125</name>
+ <border_width>3</border_width>
+ <homogeneous>False</homogeneous>
+ <spacing>2</spacing>
+
+ <widget>
+ <class>GnomePixmap</class>
+ <name>pixmap69</name>
+ <filename>gnome-hint.png</filename>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
+ </child>
+ </widget>
+ <widget>
+ <class>GtkLabel</class>
+ <name>label495</name>
+ <label>This is the name for this server that will appear in your Evolution folder list.
+It is for display purposes only. </label>
+ <justify>GTK_JUSTIFY_LEFT</justify>
+ <wrap>False</wrap>
+ <xalign>0</xalign>
+ <yalign>0.5</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
<child>
- <widget class="GtkOptionMenu" id="auth-optionmenu">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="history">0</property>
-
- <child internal-child="menu">
- <widget class="GtkMenu" id="convertwidget28">
- <property name="visible">True</property>
-
- <child>
- <widget class="GtkMenuItem" id="convertwidget29">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Anonymously</property>
- <property name="use_underline">True</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkMenuItem" id="convertwidget30">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Using email address</property>
- <property name="use_underline">True</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkMenuItem" id="convertwidget31">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Using distinguished name (DN)</property>
- <property name="use_underline">True</property>
- </widget>
- </child>
- </widget>
- </child>
- </widget>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
</child>
</widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="y_options"></property>
- </packing>
+ </widget>
+
+ <widget>
+ <class>GtkLabel</class>
+ <child_name>Notebook:tab</child_name>
+ <name>label496</name>
+ <label>label452</label>
+ <justify>GTK_JUSTIFY_CENTER</justify>
+ <wrap>False</wrap>
+ <xalign>0.5</xalign>
+ <yalign>0.5</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ </widget>
+ </widget>
+ </widget>
+
+ <widget>
+ <class>GtkLabel</class>
+ <child_name>Notebook:tab</child_name>
+ <name>label497</name>
+ <label>General</label>
+ <justify>GTK_JUSTIFY_CENTER</justify>
+ <wrap>False</wrap>
+ <xalign>0.5</xalign>
+ <yalign>0.5</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ </widget>
+
+ <widget>
+ <class>GtkVBox</class>
+ <name>vbox69</name>
+ <border_width>6</border_width>
+ <homogeneous>False</homogeneous>
+ <spacing>3</spacing>
+
+ <widget>
+ <class>GtkTable</class>
+ <name>table33</name>
+ <border_width>3</border_width>
+ <rows>2</rows>
+ <columns>2</columns>
+ <homogeneous>False</homogeneous>
+ <row_spacing>3</row_spacing>
+ <column_spacing>3</column_spacing>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
</child>
+ <widget>
+ <class>GtkLabel</class>
+ <name>label498</name>
+ <label>_Port number:</label>
+ <justify>GTK_JUSTIFY_CENTER</justify>
+ <wrap>False</wrap>
+ <xalign>0</xalign>
+ <yalign>0.5</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <child>
+ <left_attach>0</left_attach>
+ <right_attach>1</right_attach>
+ <top_attach>0</top_attach>
+ <bottom_attach>1</bottom_attach>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <xexpand>False</xexpand>
+ <yexpand>False</yexpand>
+ <xshrink>False</xshrink>
+ <yshrink>False</yshrink>
+ <xfill>True</xfill>
+ <yfill>False</yfill>
+ </child>
+ </widget>
+
+ <widget>
+ <class>GtkAlignment</class>
+ <name>alignment54</name>
+ <xalign>7.45058e-09</xalign>
+ <yalign>0.5</yalign>
+ <xscale>0</xscale>
+ <yscale>1</yscale>
+ <child>
+ <left_attach>1</left_attach>
+ <right_attach>2</right_attach>
+ <top_attach>1</top_attach>
+ <bottom_attach>2</bottom_attach>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <xexpand>False</xexpand>
+ <yexpand>False</yexpand>
+ <xshrink>False</xshrink>
+ <yshrink>False</yshrink>
+ <xfill>True</xfill>
+ <yfill>False</yfill>
+ </child>
+
+ <widget>
+ <class>GtkVBox</class>
+ <name>vbox70</name>
+ <homogeneous>False</homogeneous>
+ <spacing>0</spacing>
+
+ <widget>
+ <class>GtkRadioButton</class>
+ <name>radiobutton9</name>
+ <can_focus>True</can_focus>
+ <label>_Always</label>
+ <active>False</active>
+ <draw_indicator>True</draw_indicator>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
+ </child>
+ </widget>
+
+ <widget>
+ <class>GtkRadioButton</class>
+ <name>radiobutton10</name>
+ <can_focus>True</can_focus>
+ <label>_If necessary </label>
+ <active>False</active>
+ <draw_indicator>True</draw_indicator>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
+ </child>
+ </widget>
+
+ <widget>
+ <class>GtkRadioButton</class>
+ <name>radiobutton11</name>
+ <can_focus>True</can_focus>
+ <label>_Don't use SSL/TLS</label>
+ <active>False</active>
+ <draw_indicator>True</draw_indicator>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
+ </child>
+ </widget>
+ </widget>
+ </widget>
+
+ <widget>
+ <class>GtkAlignment</class>
+ <name>alignment55</name>
+ <xalign>7.45058e-09</xalign>
+ <yalign>0.5</yalign>
+ <xscale>0</xscale>
+ <yscale>1</yscale>
+ <child>
+ <left_attach>1</left_attach>
+ <right_attach>2</right_attach>
+ <top_attach>0</top_attach>
+ <bottom_attach>1</bottom_attach>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <xexpand>False</xexpand>
+ <yexpand>False</yexpand>
+ <xshrink>False</xshrink>
+ <yshrink>False</yshrink>
+ <xfill>True</xfill>
+ <yfill>False</yfill>
+ </child>
+
+ <widget>
+ <class>GtkPixmap</class>
+ <name>pixmap70</name>
+ <filename>gnome-hint.png</filename>
+ <xalign>0.5</xalign>
+ <yalign>0.5</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <build_insensitive>True</build_insensitive>
+ </widget>
+ </widget>
+
+ <widget>
+ <class>GtkAlignment</class>
+ <name>alignment56</name>
+ <xalign>7.45058e-09</xalign>
+ <yalign>0.5</yalign>
+ <xscale>0</xscale>
+ <yscale>1</yscale>
+ <child>
+ <left_attach>1</left_attach>
+ <right_attach>2</right_attach>
+ <top_attach>0</top_attach>
+ <bottom_attach>1</bottom_attach>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <xexpand>True</xexpand>
+ <yexpand>False</yexpand>
+ <xshrink>False</xshrink>
+ <yshrink>False</yshrink>
+ <xfill>True</xfill>
+ <yfill>False</yfill>
+ </child>
+
+ <widget>
+ <class>GtkCombo</class>
+ <name>combo8</name>
+ <value_in_list>False</value_in_list>
+ <ok_if_empty>True</ok_if_empty>
+ <case_sensitive>False</case_sensitive>
+ <use_arrows>True</use_arrows>
+ <use_arrows_always>False</use_arrows_always>
+ <items>380
+666
+1234
+</items>
+
+ <widget>
+ <class>GtkEntry</class>
+ <child_name>GtkCombo:entry</child_name>
+ <name>entry57</name>
+ <can_focus>True</can_focus>
+ <has_focus>True</has_focus>
+ <editable>True</editable>
+ <text_visible>True</text_visible>
+ <text_max_length>0</text_max_length>
+ <text>380</text>
+ </widget>
+ </widget>
+ </widget>
+
+ <widget>
+ <class>GtkLabel</class>
+ <name>label499</name>
+ <label>U_se SSL/TLS:</label>
+ <justify>GTK_JUSTIFY_CENTER</justify>
+ <wrap>False</wrap>
+ <xalign>0</xalign>
+ <yalign>7.45058e-09</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <child>
+ <left_attach>0</left_attach>
+ <right_attach>1</right_attach>
+ <top_attach>1</top_attach>
+ <bottom_attach>2</bottom_attach>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <xexpand>False</xexpand>
+ <yexpand>True</yexpand>
+ <xshrink>False</xshrink>
+ <yshrink>False</yshrink>
+ <xfill>True</xfill>
+ <yfill>True</yfill>
+ </child>
+ </widget>
+ </widget>
+
+ <widget>
+ <class>GtkNotebook</class>
+ <name>notebook27</name>
+ <show_tabs>False</show_tabs>
+ <show_border>False</show_border>
+ <tab_pos>GTK_POS_TOP</tab_pos>
+ <scrollable>False</scrollable>
+ <tab_hborder>2</tab_hborder>
+ <tab_vborder>2</tab_vborder>
+ <popup_enable>False</popup_enable>
<child>
- <widget class="GtkNotebook" id="auth-label-notebook">
- <property name="visible">True</property>
- <property name="sensitive">False</property>
- <property name="show_tabs">False</property>
- <property name="show_border">False</property>
- <property name="tab_pos">GTK_POS_TOP</property>
- <property name="scrollable">False</property>
- <property name="enable_popup">False</property>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
+ <pack>GTK_PACK_END</pack>
+ </child>
+ <widget>
+ <class>GtkHBox</class>
+ <name>hbox126</name>
+ <border_width>3</border_width>
+ <homogeneous>False</homogeneous>
+ <spacing>3</spacing>
+
+ <widget>
+ <class>GnomePixmap</class>
+ <name>pixmap71</name>
+ <filename>gnome-hint.png</filename>
<child>
- <widget class="GtkLabel" id="label553">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Email Address:</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="tab_expand">False</property>
- <property name="tab_fill">True</property>
- </packing>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
</child>
+ </widget>
+ <widget>
+ <class>GtkLabel</class>
+ <name>label500</name>
+ <label>This is the port on the LDAP server that Evolution will try to connect to. A
+list of standard ports has been provided. Ask your system administrator
+what port you should specify.</label>
+ <justify>GTK_JUSTIFY_LEFT</justify>
+ <wrap>False</wrap>
+ <xalign>0.5</xalign>
+ <yalign>0.5</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
<child>
- <widget class="GtkLabel" id="label546">
- <property name="visible">True</property>
- <property name="label" translatable="yes">label546</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="type">tab</property>
- </packing>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
</child>
-
+ </widget>
+ </widget>
+
+ <widget>
+ <class>GtkLabel</class>
+ <child_name>Notebook:tab</child_name>
+ <name>label501</name>
+ <label>label163</label>
+ <justify>GTK_JUSTIFY_CENTER</justify>
+ <wrap>False</wrap>
+ <xalign>0.5</xalign>
+ <yalign>0.5</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ </widget>
+
+ <widget>
+ <class>GtkHBox</class>
+ <name>hbox127</name>
+ <border_width>3</border_width>
+ <homogeneous>False</homogeneous>
+ <spacing>2</spacing>
+
+ <widget>
+ <class>GnomePixmap</class>
+ <name>pixmap72</name>
+ <filename>gnome-hint.png</filename>
<child>
- <widget class="GtkLabel" id="label536">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Distinguished _name:</property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="tab_expand">False</property>
- <property name="tab_fill">True</property>
- </packing>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
</child>
+ </widget>
+ <widget>
+ <class>GtkLabel</class>
+ <name>label502</name>
+ <label>Selecting this option means that Evolution will only connect to your LDAP server if
+your LDAP server supports SSL or TLS.</label>
+ <justify>GTK_JUSTIFY_LEFT</justify>
+ <wrap>False</wrap>
+ <xalign>7.45058e-09</xalign>
+ <yalign>0.5</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
<child>
- <widget class="GtkLabel" id="label547">
- <property name="visible">True</property>
- <property name="label" translatable="yes">label547</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="type">tab</property>
- </packing>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
</child>
</widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">2</property>
- <property name="bottom_attach">3</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkNotebook" id="auth-entry-notebook">
- <property name="visible">True</property>
- <property name="sensitive">False</property>
- <property name="show_tabs">False</property>
- <property name="show_border">False</property>
- <property name="tab_pos">GTK_POS_TOP</property>
- <property name="scrollable">False</property>
- <property name="enable_popup">False</property>
-
+ </widget>
+
+ <widget>
+ <class>GtkLabel</class>
+ <child_name>Notebook:tab</child_name>
+ <name>label503</name>
+ <label>label398</label>
+ <justify>GTK_JUSTIFY_CENTER</justify>
+ <wrap>False</wrap>
+ <xalign>0.5</xalign>
+ <yalign>0.5</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ </widget>
+
+ <widget>
+ <class>GtkHBox</class>
+ <name>hbox128</name>
+ <border_width>3</border_width>
+ <homogeneous>False</homogeneous>
+ <spacing>2</spacing>
+
+ <widget>
+ <class>GnomePixmap</class>
+ <name>pixmap73</name>
+ <filename>gnome-hint.png</filename>
<child>
- <widget class="GtkEntry" id="email-entry">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="editable">True</property>
- <property name="visibility">True</property>
- <property name="max_length">0</property>
- <property name="text" translatable="yes"></property>
- <property name="has_frame">True</property>
- <property name="invisible_char" translatable="yes">*</property>
- <property name="activates_default">False</property>
- </widget>
- <packing>
- <property name="tab_expand">False</property>
- <property name="tab_fill">True</property>
- </packing>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
</child>
+ </widget>
+ <widget>
+ <class>GtkLabel</class>
+ <name>label504</name>
+ <label>Selecting this option means that Evolution will only try to use SSL/TLS if you are in a
+insecure environment. For example, if you and your LDAP server are behind a firewall
+at work, then Evolution doesn't need to use SSL/TLS because your connection is already
+secure.</label>
+ <justify>GTK_JUSTIFY_LEFT</justify>
+ <wrap>False</wrap>
+ <xalign>7.45058e-09</xalign>
+ <yalign>0.5</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
+ </child>
+ </widget>
+ </widget>
+
+ <widget>
+ <class>GtkLabel</class>
+ <child_name>Notebook:tab</child_name>
+ <name>label505</name>
+ <label>label396</label>
+ <justify>GTK_JUSTIFY_CENTER</justify>
+ <wrap>False</wrap>
+ <xalign>0.5</xalign>
+ <yalign>0.5</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ </widget>
+
+ <widget>
+ <class>GtkHBox</class>
+ <name>hbox129</name>
+ <border_width>3</border_width>
+ <homogeneous>False</homogeneous>
+ <spacing>2</spacing>
+
+ <widget>
+ <class>GnomePixmap</class>
+ <name>pixmap74</name>
+ <filename>gnome-hint.png</filename>
<child>
- <widget class="GtkLabel" id="label549">
- <property name="visible">True</property>
- <property name="label" translatable="yes">label549</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="type">tab</property>
- </packing>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
</child>
+ </widget>
+ <widget>
+ <class>GtkLabel</class>
+ <name>label506</name>
+ <label>Selecting this option means that your server does not support either SSL or TLS. This
+means that your connection will be insecure, and that you will be vulnerable to security
+exploits. </label>
+ <justify>GTK_JUSTIFY_LEFT</justify>
+ <wrap>False</wrap>
+ <xalign>7.45058e-09</xalign>
+ <yalign>0.5</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
<child>
- <widget class="GtkEntry" id="dn-entry">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="editable">True</property>
- <property name="visibility">True</property>
- <property name="max_length">0</property>
- <property name="text" translatable="yes"></property>
- <property name="has_frame">True</property>
- <property name="invisible_char" translatable="yes">*</property>
- <property name="activates_default">False</property>
- </widget>
- <packing>
- <property name="tab_expand">False</property>
- <property name="tab_fill">True</property>
- </packing>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
</child>
+ </widget>
+ </widget>
+
+ <widget>
+ <class>GtkLabel</class>
+ <child_name>Notebook:tab</child_name>
+ <name>label507</name>
+ <label>label397</label>
+ <justify>GTK_JUSTIFY_CENTER</justify>
+ <wrap>False</wrap>
+ <xalign>0.5</xalign>
+ <yalign>0.5</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ </widget>
+ </widget>
+ </widget>
+
+ <widget>
+ <class>GtkLabel</class>
+ <child_name>Notebook:tab</child_name>
+ <name>label508</name>
+ <label>Connecting</label>
+ <justify>GTK_JUSTIFY_CENTER</justify>
+ <wrap>False</wrap>
+ <xalign>0.5</xalign>
+ <yalign>0.5</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ </widget>
+
+ <widget>
+ <class>GtkVBox</class>
+ <name>vbox71</name>
+ <border_width>6</border_width>
+ <homogeneous>False</homogeneous>
+ <spacing>3</spacing>
+
+ <widget>
+ <class>GtkTable</class>
+ <name>table34</name>
+ <border_width>3</border_width>
+ <rows>4</rows>
+ <columns>2</columns>
+ <homogeneous>False</homogeneous>
+ <row_spacing>3</row_spacing>
+ <column_spacing>3</column_spacing>
+ <child>
+ <padding>0</padding>
+ <expand>True</expand>
+ <fill>True</fill>
+ </child>
+ <widget>
+ <class>GtkLabel</class>
+ <name>label509</name>
+ <label>_Search base:</label>
+ <justify>GTK_JUSTIFY_LEFT</justify>
+ <wrap>False</wrap>
+ <xalign>0</xalign>
+ <yalign>0.5</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <child>
+ <left_attach>0</left_attach>
+ <right_attach>1</right_attach>
+ <top_attach>0</top_attach>
+ <bottom_attach>1</bottom_attach>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <xexpand>False</xexpand>
+ <yexpand>False</yexpand>
+ <xshrink>False</xshrink>
+ <yshrink>False</yshrink>
+ <xfill>True</xfill>
+ <yfill>False</yfill>
+ </child>
+ </widget>
+
+ <widget>
+ <class>GtkLabel</class>
+ <name>label510</name>
+ <label>S_earch scope: </label>
+ <justify>GTK_JUSTIFY_LEFT</justify>
+ <wrap>False</wrap>
+ <xalign>0</xalign>
+ <yalign>0.5</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <child>
+ <left_attach>0</left_attach>
+ <right_attach>1</right_attach>
+ <top_attach>1</top_attach>
+ <bottom_attach>2</bottom_attach>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <xexpand>False</xexpand>
+ <yexpand>False</yexpand>
+ <xshrink>False</xshrink>
+ <yshrink>False</yshrink>
+ <xfill>True</xfill>
+ <yfill>False</yfill>
+ </child>
+ </widget>
+
+ <widget>
+ <class>GtkAlignment</class>
+ <name>alignment57</name>
+ <xalign>7.45058e-09</xalign>
+ <yalign>7.45058e-09</yalign>
+ <xscale>0</xscale>
+ <yscale>1</yscale>
+ <child>
+ <left_attach>1</left_attach>
+ <right_attach>2</right_attach>
+ <top_attach>1</top_attach>
+ <bottom_attach>2</bottom_attach>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <xexpand>False</xexpand>
+ <yexpand>False</yexpand>
+ <xshrink>False</xshrink>
+ <yshrink>False</yshrink>
+ <xfill>True</xfill>
+ <yfill>False</yfill>
+ </child>
+
+ <widget>
+ <class>GtkOptionMenu</class>
+ <name>optionmenu19</name>
+ <can_focus>True</can_focus>
+ <items>Sub
+One
+</items>
+ <initial_choice>0</initial_choice>
+ </widget>
+ </widget>
+
+ <widget>
+ <class>GtkHBox</class>
+ <name>hbox130</name>
+ <border_width>3</border_width>
+ <homogeneous>False</homogeneous>
+ <spacing>3</spacing>
+ <child>
+ <left_attach>1</left_attach>
+ <right_attach>2</right_attach>
+ <top_attach>0</top_attach>
+ <bottom_attach>1</bottom_attach>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <xexpand>True</xexpand>
+ <yexpand>False</yexpand>
+ <xshrink>False</xshrink>
+ <yshrink>False</yshrink>
+ <xfill>True</xfill>
+ <yfill>True</yfill>
+ </child>
+
+ <widget>
+ <class>GtkEntry</class>
+ <name>entry58</name>
+ <can_focus>True</can_focus>
+ <has_focus>True</has_focus>
+ <editable>True</editable>
+ <text_visible>True</text_visible>
+ <text_max_length>0</text_max_length>
+ <text></text>
<child>
- <widget class="GtkLabel" id="label550">
- <property name="visible">True</property>
- <property name="label" translatable="yes">label550</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="type">tab</property>
- </packing>
+ <padding>0</padding>
+ <expand>True</expand>
+ <fill>True</fill>
</child>
</widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">2</property>
- <property name="bottom_attach">3</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
- <child>
- <widget class="GtkNotebook" id="general-tab-help">
- <property name="visible">True</property>
- <property name="show_tabs">False</property>
- <property name="show_border">False</property>
- <property name="tab_pos">GTK_POS_TOP</property>
- <property name="scrollable">False</property>
- <property name="enable_popup">False</property>
-
- <child>
- <widget class="GtkLabel" id="label537">
- <property name="visible">True</property>
- <property name="label" translatable="yes">This is the full name of your ldap server. For example, &quot;ldap.mycompany.com&quot;.</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
+ <widget>
+ <class>GtkButton</class>
+ <name>button90</name>
+ <can_focus>True</can_focus>
+ <label> S_how Supported Bases </label>
+ <relief>GTK_RELIEF_NORMAL</relief>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
+ </child>
</widget>
- <packing>
- <property name="tab_expand">False</property>
- <property name="tab_fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label538">
- <property name="visible">True</property>
- <property name="label" translatable="yes">label163</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
+ </widget>
+
+ <widget>
+ <class>GtkLabel</class>
+ <name>label511</name>
+ <label>_Timeout (minutes):</label>
+ <justify>GTK_JUSTIFY_LEFT</justify>
+ <wrap>False</wrap>
+ <xalign>0</xalign>
+ <yalign>1</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <child>
+ <left_attach>0</left_attach>
+ <right_attach>1</right_attach>
+ <top_attach>2</top_attach>
+ <bottom_attach>3</bottom_attach>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <xexpand>False</xexpand>
+ <yexpand>False</yexpand>
+ <xshrink>False</xshrink>
+ <yshrink>False</yshrink>
+ <xfill>True</xfill>
+ <yfill>False</yfill>
+ </child>
+ </widget>
+
+ <widget>
+ <class>GtkAlignment</class>
+ <name>alignment58</name>
+ <xalign>7.45058e-09</xalign>
+ <yalign>0.5</yalign>
+ <xscale>1</xscale>
+ <yscale>1</yscale>
+ <child>
+ <left_attach>1</left_attach>
+ <right_attach>2</right_attach>
+ <top_attach>2</top_attach>
+ <bottom_attach>3</bottom_attach>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <xexpand>True</xexpand>
+ <yexpand>False</yexpand>
+ <xshrink>False</xshrink>
+ <yshrink>False</yshrink>
+ <xfill>True</xfill>
+ <yfill>False</yfill>
+ </child>
+
+ <widget>
+ <class>GtkHBox</class>
+ <name>hbox131</name>
+ <border_width>3</border_width>
+ <homogeneous>False</homogeneous>
+ <spacing>3</spacing>
+
+ <widget>
+ <class>GtkLabel</class>
+ <name>label512</name>
+ <label>1:00</label>
+ <justify>GTK_JUSTIFY_CENTER</justify>
+ <wrap>False</wrap>
+ <xalign>0.5</xalign>
+ <yalign>0.5</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
+ </child>
+ </widget>
+
+ <widget>
+ <class>GtkHScale</class>
+ <name>hscale5</name>
+ <can_focus>True</can_focus>
+ <draw_value>False</draw_value>
+ <value_pos>GTK_POS_LEFT</value_pos>
+ <digits>0</digits>
+ <policy>GTK_UPDATE_DELAYED</policy>
+ <value>3</value>
+ <lower>1</lower>
+ <upper>5</upper>
+ <step>0.5</step>
+ <page>1</page>
+ <page_size>0</page_size>
+ <child>
+ <padding>0</padding>
+ <expand>True</expand>
+ <fill>True</fill>
+ </child>
+ </widget>
+
+ <widget>
+ <class>GtkLabel</class>
+ <name>label513</name>
+ <label>5:00</label>
+ <justify>GTK_JUSTIFY_CENTER</justify>
+ <wrap>False</wrap>
+ <xalign>0</xalign>
+ <yalign>0.5</yalign>
+ <xpad>3</xpad>
+ <ypad>0</ypad>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
+ </child>
+ </widget>
+
+ <widget>
+ <class>GtkLabel</class>
+ <name>label514</name>
+ <label>Selected:</label>
+ <justify>GTK_JUSTIFY_CENTER</justify>
+ <wrap>False</wrap>
+ <xalign>1</xalign>
+ <yalign>0.5</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
+ </child>
+ </widget>
+
+ <widget>
+ <class>GtkLabel</class>
+ <name>label515</name>
+ <label>2:30</label>
+ <justify>GTK_JUSTIFY_CENTER</justify>
+ <wrap>False</wrap>
+ <xalign>0.5</xalign>
+ <yalign>0.5</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
+ </child>
+ </widget>
</widget>
- <packing>
- <property name="type">tab</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label539">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Evolution will use this email address to authenticate you with the server</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
+ </widget>
+
+ <widget>
+ <class>GtkLabel</class>
+ <name>label516</name>
+ <label>_Download limit:</label>
+ <justify>GTK_JUSTIFY_LEFT</justify>
+ <wrap>False</wrap>
+ <xalign>0</xalign>
+ <yalign>0.5</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <child>
+ <left_attach>0</left_attach>
+ <right_attach>1</right_attach>
+ <top_attach>3</top_attach>
+ <bottom_attach>4</bottom_attach>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <xexpand>False</xexpand>
+ <yexpand>False</yexpand>
+ <xshrink>False</xshrink>
+ <yshrink>False</yshrink>
+ <xfill>True</xfill>
+ <yfill>False</yfill>
+ </child>
+ </widget>
+
+ <widget>
+ <class>GtkAlignment</class>
+ <name>alignment59</name>
+ <xalign>0</xalign>
+ <yalign>0.5</yalign>
+ <xscale>0</xscale>
+ <yscale>1</yscale>
+ <child>
+ <left_attach>1</left_attach>
+ <right_attach>2</right_attach>
+ <top_attach>3</top_attach>
+ <bottom_attach>4</bottom_attach>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <xexpand>False</xexpand>
+ <yexpand>False</yexpand>
+ <xshrink>False</xshrink>
+ <yshrink>False</yshrink>
+ <xfill>True</xfill>
+ <yfill>True</yfill>
+ </child>
+
+ <widget>
+ <class>GtkHBox</class>
+ <name>hbox132</name>
+ <border_width>3</border_width>
+ <homogeneous>False</homogeneous>
+ <spacing>3</spacing>
+
+ <widget>
+ <class>GtkSpinButton</class>
+ <name>spinbutton5</name>
+ <can_focus>True</can_focus>
+ <climb_rate>1</climb_rate>
+ <digits>0</digits>
+ <numeric>False</numeric>
+ <update_policy>GTK_UPDATE_ALWAYS</update_policy>
+ <snap>False</snap>
+ <wrap>False</wrap>
+ <value>100</value>
+ <lower>0</lower>
+ <upper>10000</upper>
+ <step>1</step>
+ <page>10</page>
+ <page_size>10</page_size>
+ <child>
+ <padding>0</padding>
+ <expand>True</expand>
+ <fill>True</fill>
+ </child>
+ </widget>
+
+ <widget>
+ <class>GtkLabel</class>
+ <name>label517</name>
+ <label>cards</label>
+ <justify>GTK_JUSTIFY_CENTER</justify>
+ <wrap>False</wrap>
+ <xalign>0.5</xalign>
+ <yalign>0.5</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
+ </child>
+ </widget>
</widget>
- <packing>
- <property name="tab_expand">False</property>
- <property name="tab_fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label540">
- <property name="visible">True</property>
- <property name="label" translatable="yes">label164</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
+ </widget>
+ </widget>
+
+ <widget>
+ <class>GtkNotebook</class>
+ <name>notebook28</name>
+ <show_tabs>False</show_tabs>
+ <show_border>False</show_border>
+ <tab_pos>GTK_POS_TOP</tab_pos>
+ <scrollable>False</scrollable>
+ <tab_hborder>2</tab_hborder>
+ <tab_vborder>2</tab_vborder>
+ <popup_enable>False</popup_enable>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
+ <pack>GTK_PACK_END</pack>
+ </child>
+
+ <widget>
+ <class>GtkHBox</class>
+ <name>hbox133</name>
+ <border_width>3</border_width>
+ <homogeneous>False</homogeneous>
+ <spacing>3</spacing>
+
+ <widget>
+ <class>GnomePixmap</class>
+ <name>pixmap75</name>
+ <filename>gnome-hint.png</filename>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
+ </child>
+ </widget>
+
+ <widget>
+ <class>GtkLabel</class>
+ <name>label518</name>
+ <label>The search base is the distinguished name (DN) of the entry where your searches will
+begin. If you leave this blank, the search will begin at the root of the directory tree.</label>
+ <justify>GTK_JUSTIFY_LEFT</justify>
+ <wrap>False</wrap>
+ <xalign>7.45058e-09</xalign>
+ <yalign>0.5</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
+ </child>
</widget>
- <packing>
- <property name="type">tab</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label541">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Evolution will use this DN to authenticate you with the server</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
+ </widget>
+
+ <widget>
+ <class>GtkLabel</class>
+ <child_name>Notebook:tab</child_name>
+ <name>label519</name>
+ <label>label163</label>
+ <justify>GTK_JUSTIFY_CENTER</justify>
+ <wrap>False</wrap>
+ <xalign>0.5</xalign>
+ <yalign>0.5</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ </widget>
+
+ <widget>
+ <class>GtkHBox</class>
+ <name>hbox134</name>
+ <border_width>3</border_width>
+ <homogeneous>False</homogeneous>
+ <spacing>2</spacing>
+
+ <widget>
+ <class>GnomePixmap</class>
+ <name>pixmap76</name>
+ <filename>gnome-hint.png</filename>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
+ </child>
</widget>
- <packing>
- <property name="tab_expand">False</property>
- <property name="tab_fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label542">
- <property name="visible">True</property>
- <property name="label" translatable="yes">label165</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
+
+ <widget>
+ <class>GtkLabel</class>
+ <name>label520</name>
+ <label>The search scope defines how deep you would like the search to extend down the
+directory tree. A search scope of &quot;sub&quot; will include all entries below your search base.
+A search scope of &quot;one&quot; will only include the entries one level beneath your base.
+</label>
+ <justify>GTK_JUSTIFY_LEFT</justify>
+ <wrap>False</wrap>
+ <xalign>0.5</xalign>
+ <yalign>0.5</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
+ </child>
</widget>
- <packing>
- <property name="type">tab</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label552">
- <property name="visible">True</property>
- <property name="label" translatable="yes">This is the method evolution will use to authenticate you. Note that setting this to &quot;Email Address&quot; requires anonymous access to your ldap server.</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">True</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
+ </widget>
+
+ <widget>
+ <class>GtkLabel</class>
+ <child_name>Notebook:tab</child_name>
+ <name>label521</name>
+ <label>label164</label>
+ <justify>GTK_JUSTIFY_CENTER</justify>
+ <wrap>False</wrap>
+ <xalign>0.5</xalign>
+ <yalign>0.5</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ </widget>
+
+ <widget>
+ <class>GtkHBox</class>
+ <name>hbox135</name>
+ <border_width>3</border_width>
+ <homogeneous>False</homogeneous>
+ <spacing>2</spacing>
+
+ <widget>
+ <class>GnomePixmap</class>
+ <name>pixmap77</name>
+ <filename>gnome-hint.png</filename>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
+ </child>
</widget>
- <packing>
- <property name="tab_expand">False</property>
- <property name="tab_fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label551">
- <property name="visible">True</property>
- <property name="label" translatable="yes">label551</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
+
+ <widget>
+ <class>GtkLabel</class>
+ <name>label522</name>
+ <label>This option controls how long a search will be run.</label>
+ <justify>GTK_JUSTIFY_CENTER</justify>
+ <wrap>False</wrap>
+ <xalign>0.5</xalign>
+ <yalign>0.5</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
+ </child>
</widget>
- <packing>
- <property name="type">tab</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label544">
- <property name="visible">True</property>
- <property name="label" translatable="yes">This is the name for this server that will appear in your Evolution folder list.
-It is for display purposes only. </property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
+ </widget>
+
+ <widget>
+ <class>GtkLabel</class>
+ <child_name>Notebook:tab</child_name>
+ <name>label523</name>
+ <label>label165</label>
+ <justify>GTK_JUSTIFY_CENTER</justify>
+ <wrap>False</wrap>
+ <xalign>0.5</xalign>
+ <yalign>0.5</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ </widget>
+
+ <widget>
+ <class>GtkHBox</class>
+ <name>hbox136</name>
+ <border_width>3</border_width>
+ <homogeneous>False</homogeneous>
+ <spacing>2</spacing>
+
+ <widget>
+ <class>GnomePixmap</class>
+ <name>pixmap78</name>
+ <filename>gnome-hint.png</filename>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
+ </child>
</widget>
- <packing>
- <property name="tab_expand">False</property>
- <property name="tab_fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label545">
- <property name="visible">True</property>
- <property name="label" translatable="yes">label452</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
+
+ <widget>
+ <class>GtkLabel</class>
+ <name>label524</name>
+ <label>This is the maximum number of entries to download. Setting this number to be
+too large will slow down your addressbook.</label>
+ <justify>GTK_JUSTIFY_LEFT</justify>
+ <wrap>False</wrap>
+ <xalign>7.45058e-09</xalign>
+ <yalign>0.5</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
+ </child>
</widget>
- <packing>
- <property name="type">tab</property>
- </packing>
- </child>
+ </widget>
+
+ <widget>
+ <class>GtkLabel</class>
+ <child_name>Notebook:tab</child_name>
+ <name>label525</name>
+ <label>label166</label>
+ <justify>GTK_JUSTIFY_CENTER</justify>
+ <wrap>False</wrap>
+ <xalign>0.5</xalign>
+ <yalign>0.5</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ </widget>
</widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="pack_type">GTK_PACK_END</property>
- </packing>
+ </widget>
+
+ <widget>
+ <class>GtkLabel</class>
+ <child_name>Notebook:tab</child_name>
+ <name>label526</name>
+ <label>Searching</label>
+ <justify>GTK_JUSTIFY_CENTER</justify>
+ <wrap>False</wrap>
+ <xalign>0.5</xalign>
+ <yalign>0.5</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ </widget>
+ </widget>
+
+ <widget>
+ <class>GtkHSeparator</class>
+ <name>hseparator14</name>
+ <child>
+ <padding>0</padding>
+ <expand>True</expand>
+ <fill>True</fill>
</child>
</widget>
- </child>
+
+ <widget>
+ <class>GtkHBox</class>
+ <name>hbox142</name>
+ <homogeneous>False</homogeneous>
+ <spacing>0</spacing>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
+ </child>
+
+ <widget>
+ <class>GtkHButtonBox</class>
+ <name>hbuttonbox25</name>
+ <layout_style>GTK_BUTTONBOX_START</layout_style>
+ <spacing>0</spacing>
+ <child_min_width>85</child_min_width>
+ <child_min_height>27</child_min_height>
+ <child_ipad_x>7</child_ipad_x>
+ <child_ipad_y>0</child_ipad_y>
+ <child>
+ <padding>0</padding>
+ <expand>True</expand>
+ <fill>True</fill>
+ </child>
+
+ <widget>
+ <class>GtkButton</class>
+ <name>button100</name>
+ <can_default>True</can_default>
+ <can_focus>True</can_focus>
+ <label>_More Options &gt;&gt;</label>
+ <relief>GTK_RELIEF_NORMAL</relief>
+ </widget>
+ </widget>
+
+ <widget>
+ <class>GtkHButtonBox</class>
+ <name>hbuttonbox26</name>
+ <layout_style>GTK_BUTTONBOX_END</layout_style>
+ <spacing>0</spacing>
+ <child_min_width>85</child_min_width>
+ <child_min_height>27</child_min_height>
+ <child_ipad_x>7</child_ipad_x>
+ <child_ipad_y>0</child_ipad_y>
+ <child>
+ <padding>0</padding>
+ <expand>True</expand>
+ <fill>True</fill>
+ </child>
+
+ <widget>
+ <class>GtkButton</class>
+ <name>button101</name>
+ <can_default>True</can_default>
+ <can_focus>True</can_focus>
+ <stock_button>GNOME_STOCK_BUTTON_OK</stock_button>
+ <relief>GTK_RELIEF_NORMAL</relief>
+ </widget>
+
+ <widget>
+ <class>GtkButton</class>
+ <name>button102</name>
+ <can_default>True</can_default>
+ <can_focus>True</can_focus>
+ <stock_button>GNOME_STOCK_BUTTON_APPLY</stock_button>
+ <relief>GTK_RELIEF_NORMAL</relief>
+ </widget>
+
+ <widget>
+ <class>GtkButton</class>
+ <name>button103</name>
+ <can_default>True</can_default>
+ <can_focus>True</can_focus>
+ <stock_button>GNOME_STOCK_BUTTON_CLOSE</stock_button>
+ <relief>GTK_RELIEF_NORMAL</relief>
+ </widget>
+ </widget>
+ </widget>
+ </widget>
</widget>
-<widget class="GtkWindow" id="connecting-tab-window">
- <property name="title" translatable="yes">connecting-tab</property>
- <property name="type">GTK_WINDOW_TOPLEVEL</property>
- <property name="window_position">GTK_WIN_POS_NONE</property>
- <property name="modal">False</property>
- <property name="resizable">True</property>
- <property name="destroy_with_parent">False</property>
+<widget>
+ <class>GnomeDialog</class>
+ <name>addressbook-sources-window</name>
+ <visible>False</visible>
+ <title>Addressbook Sources</title>
+ <type>GTK_WINDOW_TOPLEVEL</type>
+ <position>GTK_WIN_POS_NONE</position>
+ <modal>False</modal>
+ <default_width>355</default_width>
+ <default_height>285</default_height>
+ <allow_shrink>True</allow_shrink>
+ <allow_grow>True</allow_grow>
+ <auto_shrink>False</auto_shrink>
+ <auto_close>False</auto_close>
+ <hide_on_close>False</hide_on_close>
+
+ <widget>
+ <class>GtkVBox</class>
+ <child_name>GnomeDialog:vbox</child_name>
+ <name>addressbook-sources-vbox</name>
+ <homogeneous>False</homogeneous>
+ <spacing>8</spacing>
+ <child>
+ <padding>4</padding>
+ <expand>True</expand>
+ <fill>True</fill>
+ </child>
+
+ <widget>
+ <class>GtkHButtonBox</class>
+ <child_name>GnomeDialog:action_area</child_name>
+ <name>hbuttonbox27</name>
+ <layout_style>GTK_BUTTONBOX_END</layout_style>
+ <spacing>8</spacing>
+ <child_min_width>85</child_min_width>
+ <child_min_height>27</child_min_height>
+ <child_ipad_x>7</child_ipad_x>
+ <child_ipad_y>0</child_ipad_y>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>True</fill>
+ <pack>GTK_PACK_END</pack>
+ </child>
- <child>
- <widget class="GtkVBox" id="connecting-tab">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">0</property>
+ <widget>
+ <class>GtkButton</class>
+ <name>button104</name>
+ <can_default>True</can_default>
+ <can_focus>True</can_focus>
+ <stock_button>GNOME_STOCK_BUTTON_OK</stock_button>
+ </widget>
+
+ <widget>
+ <class>GtkButton</class>
+ <name>button105</name>
+ <can_default>True</can_default>
+ <can_focus>True</can_focus>
+ <stock_button>GNOME_STOCK_BUTTON_APPLY</stock_button>
+ </widget>
+
+ <widget>
+ <class>GtkButton</class>
+ <name>button106</name>
+ <can_default>True</can_default>
+ <can_focus>True</can_focus>
+ <stock_button>GNOME_STOCK_BUTTON_CLOSE</stock_button>
+ </widget>
+ </widget>
+ <widget>
+ <class>GtkHBox</class>
+ <name>addressbook-sources</name>
+ <homogeneous>False</homogeneous>
+ <spacing>0</spacing>
<child>
- <widget class="GtkTable" id="table14">
- <property name="border_width">3</property>
- <property name="visible">True</property>
- <property name="n_rows">2</property>
- <property name="n_columns">2</property>
- <property name="homogeneous">False</property>
- <property name="row_spacing">3</property>
- <property name="column_spacing">3</property>
-
- <child>
- <widget class="GtkLabel" id="label175">
- <property name="visible">True</property>
- <property name="label" translatable="yes">_Port number:</property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
- </packing>
+ <padding>0</padding>
+ <expand>True</expand>
+ <fill>True</fill>
+ </child>
+
+ <widget>
+ <class>Custom</class>
+ <name>sourcesTable</name>
+ <creation_function>addressbook_dialog_create_sources_table</creation_function>
+ <int1>0</int1>
+ <int2>0</int2>
+ <last_modification_time>Thu, 11 Apr 2002 00:31:02 GMT</last_modification_time>
+ <child>
+ <padding>0</padding>
+ <expand>True</expand>
+ <fill>True</fill>
+ </child>
+ </widget>
+
+ <widget>
+ <class>GtkVBox</class>
+ <name>vbox73</name>
+ <homogeneous>False</homogeneous>
+ <spacing>0</spacing>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
+ </child>
+
+ <widget>
+ <class>GtkLabel</class>
+ <name>label529</name>
+ <label>
+</label>
+ <justify>GTK_JUSTIFY_CENTER</justify>
+ <wrap>False</wrap>
+ <xalign>0.5</xalign>
+ <yalign>0.5</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
</child>
+ </widget>
+ <widget>
+ <class>GtkVButtonBox</class>
+ <name>vbuttonbox18</name>
+ <layout_style>GTK_BUTTONBOX_START</layout_style>
+ <spacing>0</spacing>
+ <child_min_width>85</child_min_width>
+ <child_min_height>27</child_min_height>
+ <child_ipad_x>7</child_ipad_x>
+ <child_ipad_y>0</child_ipad_y>
<child>
- <widget class="GtkAlignment" id="alignment21">
- <property name="visible">True</property>
- <property name="xalign">7.45058e-09</property>
- <property name="yalign">0.5</property>
- <property name="xscale">0</property>
- <property name="yscale">1</property>
+ <padding>0</padding>
+ <expand>True</expand>
+ <fill>True</fill>
+ </child>
- <child>
- <widget class="GtkCombo" id="port-combo">
- <property name="visible">True</property>
- <property name="value_in_list">False</property>
- <property name="allow_empty">True</property>
- <property name="case_sensitive">False</property>
- <property name="enable_arrow_keys">True</property>
- <property name="enable_arrows_always">False</property>
-
- <child internal-child="entry">
- <widget class="GtkEntry" id="entry27">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="has_focus">True</property>
- <property name="editable">True</property>
- <property name="visibility">True</property>
- <property name="max_length">0</property>
- <property name="text" translatable="yes"></property>
- <property name="has_frame">True</property>
- <property name="invisible_char" translatable="yes">*</property>
- <property name="activates_default">False</property>
- </widget>
- </child>
-
- <child internal-child="list">
- <widget class="GtkList" id="convertwidget32">
- <property name="visible">True</property>
- <property name="selection_mode">GTK_SELECTION_BROWSE</property>
-
- <child>
- <widget class="GtkListItem" id="convertwidget33">
- <property name="visible">True</property>
-
- <child>
- <widget class="GtkLabel" id="convertwidget34">
- <property name="visible">True</property>
- <property name="label" translatable="yes">389</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- </child>
- </widget>
- </child>
-
- <child>
- <widget class="GtkListItem" id="convertwidget35">
- <property name="visible">True</property>
-
- <child>
- <widget class="GtkLabel" id="convertwidget36">
- <property name="visible">True</property>
- <property name="label" translatable="yes">636</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- </child>
- </widget>
- </child>
-
- <child>
- <widget class="GtkListItem" id="convertwidget37">
- <property name="visible">True</property>
-
- <child>
- <widget class="GtkLabel" id="convertwidget38">
- <property name="visible">True</property>
- <property name="label" translatable="yes">3268</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- </child>
- </widget>
- </child>
-
- <child>
- <widget class="GtkListItem" id="convertwidget39">
- <property name="visible">True</property>
-
- <child>
- <widget class="GtkLabel" id="convertwidget40">
- <property name="visible">True</property>
- <property name="label" translatable="yes"></property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- </child>
- </widget>
- </child>
- </widget>
- </child>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label176">
- <property name="visible">True</property>
- <property name="label" translatable="yes">U_se SSL/TLS:</property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="x_options">fill</property>
- </packing>
+ <widget>
+ <class>GtkButton</class>
+ <name>addSource</name>
+ <can_default>True</can_default>
+ <can_focus>True</can_focus>
+ <label>_Add</label>
+ <relief>GTK_RELIEF_NORMAL</relief>
+ </widget>
+
+ <widget>
+ <class>GtkButton</class>
+ <name>editSource</name>
+ <can_default>True</can_default>
+ <can_focus>True</can_focus>
+ <label>_Edit</label>
+ <relief>GTK_RELIEF_NORMAL</relief>
+ </widget>
+
+ <widget>
+ <class>GtkButton</class>
+ <name>deleteSource</name>
+ <can_default>True</can_default>
+ <can_focus>True</can_focus>
+ <label>De_lete</label>
+ <relief>GTK_RELIEF_NORMAL</relief>
+ </widget>
+ </widget>
+ </widget>
+ </widget>
+ </widget>
+</widget>
+
+<widget>
+ <class>GtkWindow</class>
+ <name>general-tab-window</name>
+ <visible>False</visible>
+ <title>general-tab</title>
+ <type>GTK_WINDOW_TOPLEVEL</type>
+ <position>GTK_WIN_POS_NONE</position>
+ <modal>False</modal>
+ <allow_shrink>False</allow_shrink>
+ <allow_grow>True</allow_grow>
+ <auto_shrink>False</auto_shrink>
+
+ <widget>
+ <class>GtkVBox</class>
+ <name>general-tab</name>
+ <border_width>6</border_width>
+ <homogeneous>False</homogeneous>
+ <spacing>3</spacing>
+
+ <widget>
+ <class>GtkTable</class>
+ <name>table36</name>
+ <border_width>3</border_width>
+ <rows>3</rows>
+ <columns>2</columns>
+ <homogeneous>False</homogeneous>
+ <row_spacing>3</row_spacing>
+ <column_spacing>3</column_spacing>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
+ </child>
+
+ <widget>
+ <class>GtkLabel</class>
+ <name>label534</name>
+ <label>_Server name:</label>
+ <justify>GTK_JUSTIFY_CENTER</justify>
+ <wrap>False</wrap>
+ <xalign>0</xalign>
+ <yalign>0.5</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <default_focus_target>server-name-entry</default_focus_target>
+ <child>
+ <left_attach>0</left_attach>
+ <right_attach>1</right_attach>
+ <top_attach>0</top_attach>
+ <bottom_attach>1</bottom_attach>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <xexpand>False</xexpand>
+ <yexpand>False</yexpand>
+ <xshrink>False</xshrink>
+ <yshrink>False</yshrink>
+ <xfill>True</xfill>
+ <yfill>False</yfill>
+ </child>
+ </widget>
+
+ <widget>
+ <class>GtkLabel</class>
+ <name>label535</name>
+ <label>_Log in method:</label>
+ <justify>GTK_JUSTIFY_CENTER</justify>
+ <wrap>False</wrap>
+ <xalign>0</xalign>
+ <yalign>0.5</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <child>
+ <left_attach>0</left_attach>
+ <right_attach>1</right_attach>
+ <top_attach>1</top_attach>
+ <bottom_attach>2</bottom_attach>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <xexpand>False</xexpand>
+ <yexpand>False</yexpand>
+ <xshrink>False</xshrink>
+ <yshrink>False</yshrink>
+ <xfill>True</xfill>
+ <yfill>False</yfill>
+ </child>
+ </widget>
+
+ <widget>
+ <class>GtkEntry</class>
+ <name>server-name-entry</name>
+ <can_focus>True</can_focus>
+ <has_focus>True</has_focus>
+ <editable>True</editable>
+ <text_visible>True</text_visible>
+ <text_max_length>0</text_max_length>
+ <text></text>
+ <child>
+ <left_attach>1</left_attach>
+ <right_attach>2</right_attach>
+ <top_attach>0</top_attach>
+ <bottom_attach>1</bottom_attach>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <xexpand>True</xexpand>
+ <yexpand>False</yexpand>
+ <xshrink>False</xshrink>
+ <yshrink>False</yshrink>
+ <xfill>True</xfill>
+ <yfill>False</yfill>
+ </child>
+ </widget>
+
+ <widget>
+ <class>GtkAlignment</class>
+ <name>alignment63</name>
+ <xalign>7.45058e-09</xalign>
+ <yalign>0.5</yalign>
+ <xscale>0</xscale>
+ <yscale>1</yscale>
+ <child>
+ <left_attach>1</left_attach>
+ <right_attach>2</right_attach>
+ <top_attach>1</top_attach>
+ <bottom_attach>2</bottom_attach>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <xexpand>True</xexpand>
+ <yexpand>False</yexpand>
+ <xshrink>False</xshrink>
+ <yshrink>False</yshrink>
+ <xfill>True</xfill>
+ <yfill>False</yfill>
+ </child>
+
+ <widget>
+ <class>GtkOptionMenu</class>
+ <name>auth-optionmenu</name>
+ <can_focus>True</can_focus>
+ <items>Anonymously
+Using email address
+Using distinguished name (DN)
+</items>
+ <initial_choice>0</initial_choice>
+ </widget>
+ </widget>
+
+ <widget>
+ <class>GtkNotebook</class>
+ <name>auth-label-notebook</name>
+ <sensitive>False</sensitive>
+ <show_tabs>False</show_tabs>
+ <show_border>False</show_border>
+ <tab_pos>GTK_POS_TOP</tab_pos>
+ <scrollable>False</scrollable>
+ <tab_hborder>2</tab_hborder>
+ <tab_vborder>2</tab_vborder>
+ <popup_enable>False</popup_enable>
+ <child>
+ <left_attach>0</left_attach>
+ <right_attach>1</right_attach>
+ <top_attach>2</top_attach>
+ <bottom_attach>3</bottom_attach>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <xexpand>False</xexpand>
+ <yexpand>False</yexpand>
+ <xshrink>False</xshrink>
+ <yshrink>False</yshrink>
+ <xfill>True</xfill>
+ <yfill>True</yfill>
+ </child>
+
+ <widget>
+ <class>GtkLabel</class>
+ <name>label553</name>
+ <label>Email Address:</label>
+ <justify>GTK_JUSTIFY_CENTER</justify>
+ <wrap>False</wrap>
+ <xalign>0</xalign>
+ <yalign>0.5</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ </widget>
+
+ <widget>
+ <class>GtkLabel</class>
+ <child_name>Notebook:tab</child_name>
+ <name>label546</name>
+ <label>label546</label>
+ <justify>GTK_JUSTIFY_CENTER</justify>
+ <wrap>False</wrap>
+ <xalign>0.5</xalign>
+ <yalign>0.5</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ </widget>
+
+ <widget>
+ <class>GtkLabel</class>
+ <name>label536</name>
+ <label>Distinguished _name:</label>
+ <justify>GTK_JUSTIFY_CENTER</justify>
+ <wrap>False</wrap>
+ <xalign>0</xalign>
+ <yalign>0.5</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ </widget>
+
+ <widget>
+ <class>GtkLabel</class>
+ <child_name>Notebook:tab</child_name>
+ <name>label547</name>
+ <label>label547</label>
+ <justify>GTK_JUSTIFY_CENTER</justify>
+ <wrap>False</wrap>
+ <xalign>0.5</xalign>
+ <yalign>0.5</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ </widget>
+ </widget>
+
+ <widget>
+ <class>GtkNotebook</class>
+ <name>auth-entry-notebook</name>
+ <sensitive>False</sensitive>
+ <show_tabs>False</show_tabs>
+ <show_border>False</show_border>
+ <tab_pos>GTK_POS_TOP</tab_pos>
+ <scrollable>False</scrollable>
+ <tab_hborder>2</tab_hborder>
+ <tab_vborder>2</tab_vborder>
+ <popup_enable>False</popup_enable>
+ <child>
+ <left_attach>1</left_attach>
+ <right_attach>2</right_attach>
+ <top_attach>2</top_attach>
+ <bottom_attach>3</bottom_attach>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <xexpand>False</xexpand>
+ <yexpand>False</yexpand>
+ <xshrink>False</xshrink>
+ <yshrink>False</yshrink>
+ <xfill>True</xfill>
+ <yfill>True</yfill>
+ </child>
+
+ <widget>
+ <class>GtkEntry</class>
+ <name>email-entry</name>
+ <can_focus>True</can_focus>
+ <editable>True</editable>
+ <text_visible>True</text_visible>
+ <text_max_length>0</text_max_length>
+ <text></text>
+ </widget>
+
+ <widget>
+ <class>GtkLabel</class>
+ <child_name>Notebook:tab</child_name>
+ <name>label549</name>
+ <label>label549</label>
+ <justify>GTK_JUSTIFY_CENTER</justify>
+ <wrap>False</wrap>
+ <xalign>0.5</xalign>
+ <yalign>0.5</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ </widget>
+
+ <widget>
+ <class>GtkEntry</class>
+ <name>dn-entry</name>
+ <can_focus>True</can_focus>
+ <editable>True</editable>
+ <text_visible>True</text_visible>
+ <text_max_length>0</text_max_length>
+ <text></text>
+ </widget>
+
+ <widget>
+ <class>GtkLabel</class>
+ <child_name>Notebook:tab</child_name>
+ <name>label550</name>
+ <label>label550</label>
+ <justify>GTK_JUSTIFY_CENTER</justify>
+ <wrap>False</wrap>
+ <xalign>0.5</xalign>
+ <yalign>0.5</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ </widget>
+ </widget>
+ </widget>
+
+ <widget>
+ <class>GtkNotebook</class>
+ <name>general-tab-help</name>
+ <show_tabs>False</show_tabs>
+ <show_border>False</show_border>
+ <tab_pos>GTK_POS_TOP</tab_pos>
+ <scrollable>False</scrollable>
+ <tab_hborder>2</tab_hborder>
+ <tab_vborder>2</tab_vborder>
+ <popup_enable>False</popup_enable>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
+ <pack>GTK_PACK_END</pack>
+ </child>
+
+ <widget>
+ <class>GtkHBox</class>
+ <name>hbox145</name>
+ <border_width>3</border_width>
+ <homogeneous>False</homogeneous>
+ <spacing>2</spacing>
+
+ <widget>
+ <class>GnomePixmap</class>
+ <name>pixmap79</name>
+ <filename>gnome-hint.png</filename>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
+ </child>
+ </widget>
+
+ <widget>
+ <class>GtkLabel</class>
+ <name>label537</name>
+ <label>This is the full name of your ldap server. For example, &quot;ldap.mycompany.com&quot;.</label>
+ <justify>GTK_JUSTIFY_CENTER</justify>
+ <wrap>False</wrap>
+ <xalign>0.5</xalign>
+ <yalign>0.5</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
+ </child>
+ </widget>
+ </widget>
+
+ <widget>
+ <class>GtkLabel</class>
+ <child_name>Notebook:tab</child_name>
+ <name>label538</name>
+ <label>label163</label>
+ <justify>GTK_JUSTIFY_CENTER</justify>
+ <wrap>False</wrap>
+ <xalign>0.5</xalign>
+ <yalign>0.5</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ </widget>
+
+ <widget>
+ <class>GtkHBox</class>
+ <name>hbox146</name>
+ <border_width>3</border_width>
+ <homogeneous>False</homogeneous>
+ <spacing>2</spacing>
+
+ <widget>
+ <class>GnomePixmap</class>
+ <name>pixmap80</name>
+ <filename>gnome-hint.png</filename>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
</child>
+ </widget>
+ <widget>
+ <class>GtkLabel</class>
+ <name>label539</name>
+ <label>Evolution will use this email address to authenticate you with the server</label>
+ <justify>GTK_JUSTIFY_CENTER</justify>
+ <wrap>False</wrap>
+ <xalign>0.5</xalign>
+ <yalign>0.5</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
+ </child>
+ </widget>
+ </widget>
+
+ <widget>
+ <class>GtkLabel</class>
+ <child_name>Notebook:tab</child_name>
+ <name>label540</name>
+ <label>label164</label>
+ <justify>GTK_JUSTIFY_CENTER</justify>
+ <wrap>False</wrap>
+ <xalign>0.5</xalign>
+ <yalign>0.5</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ </widget>
+
+ <widget>
+ <class>GtkHBox</class>
+ <name>hbox147</name>
+ <border_width>3</border_width>
+ <homogeneous>False</homogeneous>
+ <spacing>2</spacing>
+
+ <widget>
+ <class>GnomePixmap</class>
+ <name>pixmap81</name>
+ <filename>gnome-hint.png</filename>
<child>
- <widget class="GtkAlignment" id="alignment60">
- <property name="visible">True</property>
- <property name="xalign">7.45058e-09</property>
- <property name="yalign">0.5</property>
- <property name="xscale">0</property>
- <property name="yscale">1</property>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
+ </child>
+ </widget>
- <child>
- <widget class="GtkOptionMenu" id="ssl-optionmenu">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="history">0</property>
-
- <child internal-child="menu">
- <widget class="GtkMenu" id="convertwidget41">
- <property name="visible">True</property>
-
- <child>
- <widget class="GtkMenuItem" id="convertwidget42">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Always</property>
- <property name="use_underline">True</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkMenuItem" id="convertwidget43">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Whenever Possible</property>
- <property name="use_underline">True</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkMenuItem" id="convertwidget44">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Never</property>
- <property name="use_underline">True</property>
- </widget>
- </child>
- </widget>
- </child>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">True</property>
- </packing>
+ <widget>
+ <class>GtkLabel</class>
+ <name>label541</name>
+ <label>Evolution will use this DN to authenticate you with the server</label>
+ <justify>GTK_JUSTIFY_CENTER</justify>
+ <wrap>False</wrap>
+ <xalign>0.5</xalign>
+ <yalign>0.5</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
+ </child>
+ </widget>
+ </widget>
+
+ <widget>
+ <class>GtkLabel</class>
+ <child_name>Notebook:tab</child_name>
+ <name>label542</name>
+ <label>label165</label>
+ <justify>GTK_JUSTIFY_CENTER</justify>
+ <wrap>False</wrap>
+ <xalign>0.5</xalign>
+ <yalign>0.5</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ </widget>
+
+ <widget>
+ <class>GtkLabel</class>
+ <name>label552</name>
+ <label>This is the method evolution will use to authenticate you. Note that setting this to &quot;Email Address&quot; requires anonymous access to your ldap server.</label>
+ <justify>GTK_JUSTIFY_CENTER</justify>
+ <wrap>True</wrap>
+ <xalign>0.5</xalign>
+ <yalign>0.5</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ </widget>
+
+ <widget>
+ <class>GtkLabel</class>
+ <child_name>Notebook:tab</child_name>
+ <name>label551</name>
+ <label>label551</label>
+ <justify>GTK_JUSTIFY_CENTER</justify>
+ <wrap>False</wrap>
+ <xalign>0.5</xalign>
+ <yalign>0.5</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ </widget>
+
+ <widget>
+ <class>GtkHBox</class>
+ <name>hbox148</name>
+ <border_width>3</border_width>
+ <homogeneous>False</homogeneous>
+ <spacing>2</spacing>
+
+ <widget>
+ <class>GnomePixmap</class>
+ <name>pixmap82</name>
+ <filename>gnome-hint.png</filename>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
+ </child>
+ </widget>
+
+ <widget>
+ <class>GtkLabel</class>
+ <name>label544</name>
+ <label>This is the name for this server that will appear in your Evolution folder list.
+It is for display purposes only. </label>
+ <justify>GTK_JUSTIFY_LEFT</justify>
+ <wrap>False</wrap>
+ <xalign>0</xalign>
+ <yalign>0.5</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
+ </child>
+ </widget>
+ </widget>
+
+ <widget>
+ <class>GtkLabel</class>
+ <child_name>Notebook:tab</child_name>
+ <name>label545</name>
+ <label>label452</label>
+ <justify>GTK_JUSTIFY_CENTER</justify>
+ <wrap>False</wrap>
+ <xalign>0.5</xalign>
+ <yalign>0.5</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ </widget>
+ </widget>
+ </widget>
+</widget>
+
+<widget>
+ <class>GtkWindow</class>
+ <name>connecting-tab-window</name>
+ <visible>False</visible>
+ <title>connecting-tab</title>
+ <type>GTK_WINDOW_TOPLEVEL</type>
+ <position>GTK_WIN_POS_NONE</position>
+ <modal>False</modal>
+ <allow_shrink>False</allow_shrink>
+ <allow_grow>True</allow_grow>
+ <auto_shrink>False</auto_shrink>
+
+ <widget>
+ <class>GtkVBox</class>
+ <name>connecting-tab</name>
+ <homogeneous>False</homogeneous>
+ <spacing>0</spacing>
+
+ <widget>
+ <class>GtkTable</class>
+ <name>table14</name>
+ <border_width>3</border_width>
+ <rows>2</rows>
+ <columns>2</columns>
+ <homogeneous>False</homogeneous>
+ <row_spacing>3</row_spacing>
+ <column_spacing>3</column_spacing>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>True</fill>
</child>
+ <widget>
+ <class>GtkLabel</class>
+ <name>label175</name>
+ <label>_Port number:</label>
+ <justify>GTK_JUSTIFY_CENTER</justify>
+ <wrap>False</wrap>
+ <xalign>0</xalign>
+ <yalign>0.5</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <child>
+ <left_attach>0</left_attach>
+ <right_attach>1</right_attach>
+ <top_attach>0</top_attach>
+ <bottom_attach>1</bottom_attach>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <xexpand>False</xexpand>
+ <yexpand>False</yexpand>
+ <xshrink>False</xshrink>
+ <yshrink>False</yshrink>
+ <xfill>True</xfill>
+ <yfill>False</yfill>
+ </child>
+ </widget>
+
+ <widget>
+ <class>GtkAlignment</class>
+ <name>alignment23</name>
+ <xalign>7.45058e-09</xalign>
+ <yalign>0.5</yalign>
+ <xscale>0</xscale>
+ <yscale>1</yscale>
+ <child>
+ <left_attach>1</left_attach>
+ <right_attach>2</right_attach>
+ <top_attach>0</top_attach>
+ <bottom_attach>1</bottom_attach>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <xexpand>False</xexpand>
+ <yexpand>False</yexpand>
+ <xshrink>False</xshrink>
+ <yshrink>False</yshrink>
+ <xfill>True</xfill>
+ <yfill>False</yfill>
+ </child>
+
+ <widget>
+ <class>GtkPixmap</class>
+ <name>pixmap11</name>
+ <filename>gnome-hint.png</filename>
+ <xalign>0.5</xalign>
+ <yalign>0.5</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <build_insensitive>True</build_insensitive>
+ </widget>
+ </widget>
+
+ <widget>
+ <class>GtkAlignment</class>
+ <name>alignment21</name>
+ <xalign>7.45058e-09</xalign>
+ <yalign>0.5</yalign>
+ <xscale>0</xscale>
+ <yscale>1</yscale>
+ <child>
+ <left_attach>1</left_attach>
+ <right_attach>2</right_attach>
+ <top_attach>0</top_attach>
+ <bottom_attach>1</bottom_attach>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <xexpand>True</xexpand>
+ <yexpand>False</yexpand>
+ <xshrink>False</xshrink>
+ <yshrink>False</yshrink>
+ <xfill>True</xfill>
+ <yfill>False</yfill>
+ </child>
+
+ <widget>
+ <class>GtkCombo</class>
+ <name>port-combo</name>
+ <value_in_list>False</value_in_list>
+ <ok_if_empty>True</ok_if_empty>
+ <case_sensitive>False</case_sensitive>
+ <use_arrows>True</use_arrows>
+ <use_arrows_always>False</use_arrows_always>
+ <items>389
+636
+3268
+</items>
+
+ <widget>
+ <class>GtkEntry</class>
+ <child_name>GtkCombo:entry</child_name>
+ <name>entry27</name>
+ <can_focus>True</can_focus>
+ <has_focus>True</has_focus>
+ <editable>True</editable>
+ <text_visible>True</text_visible>
+ <text_max_length>0</text_max_length>
+ <text>389</text>
+ </widget>
+ </widget>
+ </widget>
+
+ <widget>
+ <class>GtkLabel</class>
+ <name>label176</name>
+ <label>U_se SSL/TLS:</label>
+ <justify>GTK_JUSTIFY_CENTER</justify>
+ <wrap>False</wrap>
+ <xalign>0</xalign>
+ <yalign>0.5</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <child>
+ <left_attach>0</left_attach>
+ <right_attach>1</right_attach>
+ <top_attach>1</top_attach>
+ <bottom_attach>2</bottom_attach>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <xexpand>False</xexpand>
+ <yexpand>True</yexpand>
+ <xshrink>False</xshrink>
+ <yshrink>False</yshrink>
+ <xfill>True</xfill>
+ <yfill>True</yfill>
+ </child>
+ </widget>
+
+ <widget>
+ <class>GtkAlignment</class>
+ <name>alignment60</name>
+ <xalign>7.45058e-09</xalign>
+ <yalign>0.5</yalign>
+ <xscale>0</xscale>
+ <yscale>1</yscale>
+ <child>
+ <left_attach>1</left_attach>
+ <right_attach>2</right_attach>
+ <top_attach>1</top_attach>
+ <bottom_attach>2</bottom_attach>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <xexpand>False</xexpand>
+ <yexpand>False</yexpand>
+ <xshrink>False</xshrink>
+ <yshrink>False</yshrink>
+ <xfill>True</xfill>
+ <yfill>True</yfill>
+ </child>
+
+ <widget>
+ <class>GtkOptionMenu</class>
+ <name>ssl-optionmenu</name>
+ <can_focus>True</can_focus>
+ <items>Always
+Whenever Possible
+Never
+</items>
+ <initial_choice>1</initial_choice>
+ </widget>
+ </widget>
+ </widget>
+
+ <widget>
+ <class>GtkNotebook</class>
+ <name>connecting-tab-help</name>
+ <show_tabs>False</show_tabs>
+ <show_border>False</show_border>
+ <tab_pos>GTK_POS_TOP</tab_pos>
+ <scrollable>False</scrollable>
+ <tab_hborder>2</tab_hborder>
+ <tab_vborder>2</tab_vborder>
+ <popup_enable>False</popup_enable>
<child>
- <widget class="GtkNotebook" id="connecting-tab-help">
- <property name="visible">True</property>
- <property name="show_tabs">False</property>
- <property name="show_border">False</property>
- <property name="tab_pos">GTK_POS_TOP</property>
- <property name="scrollable">False</property>
- <property name="enable_popup">False</property>
-
- <child>
- <widget class="GtkLabel" id="label178">
- <property name="visible">True</property>
- <property name="label" translatable="yes">This is the port on the LDAP server that Evolution will try to connect to. A
+ <padding>0</padding>
+ <expand>True</expand>
+ <fill>True</fill>
+ </child>
+
+ <widget>
+ <class>GtkHBox</class>
+ <name>hbox30</name>
+ <border_width>3</border_width>
+ <homogeneous>False</homogeneous>
+ <spacing>3</spacing>
+
+ <widget>
+ <class>GnomePixmap</class>
+ <name>pixmap7</name>
+ <filename>gnome-hint.png</filename>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
+ </child>
+ </widget>
+
+ <widget>
+ <class>GtkLabel</class>
+ <name>label178</name>
+ <label>This is the port on the LDAP server that Evolution will try to connect to. A
list of standard ports has been provided. Ask your system administrator
-what port you should specify.</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="tab_expand">False</property>
- <property name="tab_fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label179">
- <property name="visible">True</property>
- <property name="label" translatable="yes">label163</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="type">tab</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label395">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Selecting this option means that Evolution will only connect to your LDAP server if
-your LDAP server supports SSL or TLS.</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">7.45058e-09</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="tab_expand">False</property>
- <property name="tab_fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label398">
- <property name="visible">True</property>
- <property name="label" translatable="yes">label398</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="type">tab</property>
- </packing>
+what port you should specify.</label>
+ <justify>GTK_JUSTIFY_LEFT</justify>
+ <wrap>False</wrap>
+ <xalign>0.5</xalign>
+ <yalign>0.5</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
+ </child>
+ </widget>
+ </widget>
+
+ <widget>
+ <class>GtkLabel</class>
+ <child_name>Notebook:tab</child_name>
+ <name>label179</name>
+ <label>label163</label>
+ <justify>GTK_JUSTIFY_CENTER</justify>
+ <wrap>False</wrap>
+ <xalign>0.5</xalign>
+ <yalign>0.5</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ </widget>
+
+ <widget>
+ <class>GtkHBox</class>
+ <name>hbox31</name>
+ <border_width>3</border_width>
+ <homogeneous>False</homogeneous>
+ <spacing>2</spacing>
+
+ <widget>
+ <class>GnomePixmap</class>
+ <name>pixmap8</name>
+ <filename>gnome-hint.png</filename>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
</child>
+ </widget>
+ <widget>
+ <class>GtkLabel</class>
+ <name>label395</name>
+ <label>Selecting this option means that Evolution will only connect to your LDAP server if
+your LDAP server supports SSL or TLS.</label>
+ <justify>GTK_JUSTIFY_LEFT</justify>
+ <wrap>False</wrap>
+ <xalign>7.45058e-09</xalign>
+ <yalign>0.5</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
<child>
- <widget class="GtkLabel" id="label399">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Selecting this option means that Evolution will only try to use SSL/TLS if you are in a
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
+ </child>
+ </widget>
+ </widget>
+
+ <widget>
+ <class>GtkLabel</class>
+ <child_name>Notebook:tab</child_name>
+ <name>label398</name>
+ <label>label398</label>
+ <justify>GTK_JUSTIFY_CENTER</justify>
+ <wrap>False</wrap>
+ <xalign>0.5</xalign>
+ <yalign>0.5</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ </widget>
+
+ <widget>
+ <class>GtkHBox</class>
+ <name>hbox91</name>
+ <border_width>3</border_width>
+ <homogeneous>False</homogeneous>
+ <spacing>2</spacing>
+
+ <widget>
+ <class>GnomePixmap</class>
+ <name>pixmap43</name>
+ <filename>gnome-hint.png</filename>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
+ </child>
+ </widget>
+
+ <widget>
+ <class>GtkLabel</class>
+ <name>label399</name>
+ <label>Selecting this option means that Evolution will only try to use SSL/TLS if you are in a
insecure environment. For example, if you and your LDAP server are behind a firewall
at work, then Evolution doesn't need to use SSL/TLS because your connection is already
-secure.</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">7.45058e-09</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="tab_expand">False</property>
- <property name="tab_fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label396">
- <property name="visible">True</property>
- <property name="label" translatable="yes">label396</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="type">tab</property>
- </packing>
+secure.</label>
+ <justify>GTK_JUSTIFY_LEFT</justify>
+ <wrap>False</wrap>
+ <xalign>7.45058e-09</xalign>
+ <yalign>0.5</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
</child>
-
+ </widget>
+ </widget>
+
+ <widget>
+ <class>GtkLabel</class>
+ <child_name>Notebook:tab</child_name>
+ <name>label396</name>
+ <label>label396</label>
+ <justify>GTK_JUSTIFY_CENTER</justify>
+ <wrap>False</wrap>
+ <xalign>0.5</xalign>
+ <yalign>0.5</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ </widget>
+
+ <widget>
+ <class>GtkHBox</class>
+ <name>hbox92</name>
+ <border_width>3</border_width>
+ <homogeneous>False</homogeneous>
+ <spacing>2</spacing>
+
+ <widget>
+ <class>GnomePixmap</class>
+ <name>pixmap44</name>
+ <filename>gnome-hint.png</filename>
<child>
- <widget class="GtkLabel" id="label400">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Selecting this option means that your server does not support either SSL or TLS. This
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
+ </child>
+ </widget>
+
+ <widget>
+ <class>GtkLabel</class>
+ <name>label400</name>
+ <label>Selecting this option means that your server does not support either SSL or TLS. This
means that your connection will be insecure, and that you will be vulnerable to security
-exploits. </property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">7.45058e-09</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="tab_expand">False</property>
- <property name="tab_fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label397">
- <property name="visible">True</property>
- <property name="label" translatable="yes">label397</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="type">tab</property>
- </packing>
+exploits. </label>
+ <justify>GTK_JUSTIFY_LEFT</justify>
+ <wrap>False</wrap>
+ <xalign>7.45058e-09</xalign>
+ <yalign>0.5</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
</child>
</widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
+ </widget>
+
+ <widget>
+ <class>GtkLabel</class>
+ <child_name>Notebook:tab</child_name>
+ <name>label397</name>
+ <label>label397</label>
+ <justify>GTK_JUSTIFY_CENTER</justify>
+ <wrap>False</wrap>
+ <xalign>0.5</xalign>
+ <yalign>0.5</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ </widget>
</widget>
- </child>
+ </widget>
</widget>
-<widget class="GtkWindow" id="searching-tab-window">
- <property name="title" translatable="yes">searching-tab</property>
- <property name="type">GTK_WINDOW_TOPLEVEL</property>
- <property name="window_position">GTK_WIN_POS_NONE</property>
- <property name="modal">False</property>
- <property name="resizable">True</property>
- <property name="destroy_with_parent">False</property>
-
- <child>
- <widget class="GtkVBox" id="searching-tab">
- <property name="border_width">6</property>
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">3</property>
+<widget>
+ <class>GtkWindow</class>
+ <name>searching-tab-window</name>
+ <visible>False</visible>
+ <title>searching-tab</title>
+ <type>GTK_WINDOW_TOPLEVEL</type>
+ <position>GTK_WIN_POS_NONE</position>
+ <modal>False</modal>
+ <allow_shrink>False</allow_shrink>
+ <allow_grow>True</allow_grow>
+ <auto_shrink>False</auto_shrink>
+
+ <widget>
+ <class>GtkVBox</class>
+ <name>searching-tab</name>
+ <border_width>6</border_width>
+ <homogeneous>False</homogeneous>
+ <spacing>3</spacing>
+
+ <widget>
+ <class>GtkTable</class>
+ <name>table30</name>
+ <border_width>3</border_width>
+ <rows>4</rows>
+ <columns>2</columns>
+ <homogeneous>False</homogeneous>
+ <row_spacing>3</row_spacing>
+ <column_spacing>3</column_spacing>
+ <child>
+ <padding>0</padding>
+ <expand>True</expand>
+ <fill>True</fill>
+ </child>
+
+ <widget>
+ <class>GtkLabel</class>
+ <name>label455</name>
+ <label>_Search base:</label>
+ <justify>GTK_JUSTIFY_LEFT</justify>
+ <wrap>False</wrap>
+ <xalign>0</xalign>
+ <yalign>0.5</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <child>
+ <left_attach>0</left_attach>
+ <right_attach>1</right_attach>
+ <top_attach>0</top_attach>
+ <bottom_attach>1</bottom_attach>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <xexpand>False</xexpand>
+ <yexpand>False</yexpand>
+ <xshrink>False</xshrink>
+ <yshrink>False</yshrink>
+ <xfill>True</xfill>
+ <yfill>False</yfill>
+ </child>
+ </widget>
+
+ <widget>
+ <class>GtkLabel</class>
+ <name>label456</name>
+ <label>S_earch scope: </label>
+ <justify>GTK_JUSTIFY_LEFT</justify>
+ <wrap>False</wrap>
+ <xalign>0</xalign>
+ <yalign>0.5</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <child>
+ <left_attach>0</left_attach>
+ <right_attach>1</right_attach>
+ <top_attach>1</top_attach>
+ <bottom_attach>2</bottom_attach>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <xexpand>False</xexpand>
+ <yexpand>False</yexpand>
+ <xshrink>False</xshrink>
+ <yshrink>False</yshrink>
+ <xfill>True</xfill>
+ <yfill>False</yfill>
+ </child>
+ </widget>
+
+ <widget>
+ <class>GtkAlignment</class>
+ <name>alignment49</name>
+ <xalign>7.45058e-09</xalign>
+ <yalign>7.45058e-09</yalign>
+ <xscale>0</xscale>
+ <yscale>1</yscale>
+ <child>
+ <left_attach>1</left_attach>
+ <right_attach>2</right_attach>
+ <top_attach>1</top_attach>
+ <bottom_attach>2</bottom_attach>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <xexpand>False</xexpand>
+ <yexpand>False</yexpand>
+ <xshrink>False</xshrink>
+ <yshrink>False</yshrink>
+ <xfill>True</xfill>
+ <yfill>False</yfill>
+ </child>
+
+ <widget>
+ <class>GtkOptionMenu</class>
+ <name>scope-optionmenu</name>
+ <can_focus>True</can_focus>
+ <items>One
+Sub
+</items>
+ <initial_choice>0</initial_choice>
+ </widget>
+ </widget>
+
+ <widget>
+ <class>GtkHBox</class>
+ <name>hbox109</name>
+ <border_width>3</border_width>
+ <homogeneous>False</homogeneous>
+ <spacing>3</spacing>
+ <child>
+ <left_attach>1</left_attach>
+ <right_attach>2</right_attach>
+ <top_attach>0</top_attach>
+ <bottom_attach>1</bottom_attach>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <xexpand>True</xexpand>
+ <yexpand>False</yexpand>
+ <xshrink>False</xshrink>
+ <yshrink>False</yshrink>
+ <xfill>True</xfill>
+ <yfill>True</yfill>
+ </child>
+
+ <widget>
+ <class>GtkEntry</class>
+ <name>rootdn-entry</name>
+ <can_focus>True</can_focus>
+ <has_focus>True</has_focus>
+ <editable>True</editable>
+ <text_visible>True</text_visible>
+ <text_max_length>0</text_max_length>
+ <text></text>
+ <child>
+ <padding>0</padding>
+ <expand>True</expand>
+ <fill>True</fill>
+ </child>
+ </widget>
+
+ <widget>
+ <class>GtkButton</class>
+ <name>rootdn-button</name>
+ <can_focus>True</can_focus>
+ <label> S_how Supported Bases </label>
+ <relief>GTK_RELIEF_NORMAL</relief>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
+ </child>
+ </widget>
+ </widget>
+
+ <widget>
+ <class>GtkLabel</class>
+ <name>label457</name>
+ <label>_Timeout (minutes):</label>
+ <justify>GTK_JUSTIFY_LEFT</justify>
+ <wrap>False</wrap>
+ <xalign>0</xalign>
+ <yalign>1</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <child>
+ <left_attach>0</left_attach>
+ <right_attach>1</right_attach>
+ <top_attach>2</top_attach>
+ <bottom_attach>3</bottom_attach>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <xexpand>False</xexpand>
+ <yexpand>False</yexpand>
+ <xshrink>False</xshrink>
+ <yshrink>False</yshrink>
+ <xfill>True</xfill>
+ <yfill>False</yfill>
+ </child>
+ </widget>
+
+ <widget>
+ <class>GtkAlignment</class>
+ <name>alignment50</name>
+ <xalign>7.45058e-09</xalign>
+ <yalign>0.5</yalign>
+ <xscale>1</xscale>
+ <yscale>1</yscale>
+ <child>
+ <left_attach>1</left_attach>
+ <right_attach>2</right_attach>
+ <top_attach>2</top_attach>
+ <bottom_attach>3</bottom_attach>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <xexpand>True</xexpand>
+ <yexpand>False</yexpand>
+ <xshrink>False</xshrink>
+ <yshrink>False</yshrink>
+ <xfill>True</xfill>
+ <yfill>False</yfill>
+ </child>
+
+ <widget>
+ <class>GtkHBox</class>
+ <name>hbox110</name>
+ <border_width>3</border_width>
+ <homogeneous>False</homogeneous>
+ <spacing>3</spacing>
+
+ <widget>
+ <class>GtkLabel</class>
+ <name>label458</name>
+ <label>1:00</label>
+ <justify>GTK_JUSTIFY_CENTER</justify>
+ <wrap>False</wrap>
+ <xalign>0.5</xalign>
+ <yalign>0.5</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
+ </child>
+ </widget>
+
+ <widget>
+ <class>GtkHScale</class>
+ <name>timeout-scale</name>
+ <can_focus>True</can_focus>
+ <draw_value>False</draw_value>
+ <value_pos>GTK_POS_LEFT</value_pos>
+ <digits>0</digits>
+ <policy>GTK_UPDATE_DELAYED</policy>
+ <value>3</value>
+ <lower>1</lower>
+ <upper>5</upper>
+ <step>0.5</step>
+ <page>1</page>
+ <page_size>0</page_size>
+ <child>
+ <padding>0</padding>
+ <expand>True</expand>
+ <fill>True</fill>
+ </child>
+ </widget>
+
+ <widget>
+ <class>GtkLabel</class>
+ <name>label459</name>
+ <label>5:00</label>
+ <justify>GTK_JUSTIFY_CENTER</justify>
+ <wrap>False</wrap>
+ <xalign>0</xalign>
+ <yalign>0.5</yalign>
+ <xpad>3</xpad>
+ <ypad>0</ypad>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
+ </child>
+ </widget>
+
+ <widget>
+ <class>GtkLabel</class>
+ <name>label460</name>
+ <label>Selected:</label>
+ <justify>GTK_JUSTIFY_CENTER</justify>
+ <wrap>False</wrap>
+ <xalign>1</xalign>
+ <yalign>0.5</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
+ </child>
+ </widget>
+
+ <widget>
+ <class>GtkLabel</class>
+ <name>label461</name>
+ <label>2:30</label>
+ <justify>GTK_JUSTIFY_CENTER</justify>
+ <wrap>False</wrap>
+ <xalign>0.5</xalign>
+ <yalign>0.5</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
+ </child>
+ </widget>
+ </widget>
+ </widget>
+
+ <widget>
+ <class>GtkLabel</class>
+ <name>label462</name>
+ <label>_Download limit:</label>
+ <justify>GTK_JUSTIFY_LEFT</justify>
+ <wrap>False</wrap>
+ <xalign>0</xalign>
+ <yalign>0.5</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <child>
+ <left_attach>0</left_attach>
+ <right_attach>1</right_attach>
+ <top_attach>3</top_attach>
+ <bottom_attach>4</bottom_attach>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <xexpand>False</xexpand>
+ <yexpand>False</yexpand>
+ <xshrink>False</xshrink>
+ <yshrink>False</yshrink>
+ <xfill>True</xfill>
+ <yfill>False</yfill>
+ </child>
+ </widget>
+
+ <widget>
+ <class>GtkAlignment</class>
+ <name>alignment51</name>
+ <xalign>0</xalign>
+ <yalign>0.5</yalign>
+ <xscale>0</xscale>
+ <yscale>1</yscale>
+ <child>
+ <left_attach>1</left_attach>
+ <right_attach>2</right_attach>
+ <top_attach>3</top_attach>
+ <bottom_attach>4</bottom_attach>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <xexpand>False</xexpand>
+ <yexpand>False</yexpand>
+ <xshrink>False</xshrink>
+ <yshrink>False</yshrink>
+ <xfill>True</xfill>
+ <yfill>True</yfill>
+ </child>
+
+ <widget>
+ <class>GtkHBox</class>
+ <name>hbox111</name>
+ <border_width>3</border_width>
+ <homogeneous>False</homogeneous>
+ <spacing>3</spacing>
+
+ <widget>
+ <class>GtkSpinButton</class>
+ <name>download-limit-spinbutton</name>
+ <can_focus>True</can_focus>
+ <climb_rate>1</climb_rate>
+ <digits>0</digits>
+ <numeric>False</numeric>
+ <update_policy>GTK_UPDATE_ALWAYS</update_policy>
+ <snap>False</snap>
+ <wrap>False</wrap>
+ <value>100</value>
+ <lower>0</lower>
+ <upper>10000</upper>
+ <step>1</step>
+ <page>10</page>
+ <page_size>10</page_size>
+ <child>
+ <padding>0</padding>
+ <expand>True</expand>
+ <fill>True</fill>
+ </child>
+ </widget>
+
+ <widget>
+ <class>GtkLabel</class>
+ <name>label463</name>
+ <label>cards</label>
+ <justify>GTK_JUSTIFY_CENTER</justify>
+ <wrap>False</wrap>
+ <xalign>0.5</xalign>
+ <yalign>0.5</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
+ </child>
+ </widget>
+ </widget>
+ </widget>
+ </widget>
+ <widget>
+ <class>GtkNotebook</class>
+ <name>searching-tab-help</name>
+ <show_tabs>False</show_tabs>
+ <show_border>False</show_border>
+ <tab_pos>GTK_POS_TOP</tab_pos>
+ <scrollable>False</scrollable>
+ <tab_hborder>2</tab_hborder>
+ <tab_vborder>2</tab_vborder>
+ <popup_enable>False</popup_enable>
<child>
- <widget class="GtkTable" id="table30">
- <property name="border_width">3</property>
- <property name="visible">True</property>
- <property name="n_rows">4</property>
- <property name="n_columns">2</property>
- <property name="homogeneous">False</property>
- <property name="row_spacing">3</property>
- <property name="column_spacing">3</property>
-
- <child>
- <widget class="GtkLabel" id="label455">
- <property name="visible">True</property>
- <property name="label" translatable="yes">_Search base:</property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label456">
- <property name="visible">True</property>
- <property name="label" translatable="yes">S_earch scope: </property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
- </packing>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
+ <pack>GTK_PACK_END</pack>
+ </child>
+
+ <widget>
+ <class>GtkHBox</class>
+ <name>hbox112</name>
+ <border_width>3</border_width>
+ <homogeneous>False</homogeneous>
+ <spacing>3</spacing>
+
+ <widget>
+ <class>GnomePixmap</class>
+ <name>pixmap60</name>
+ <filename>gnome-hint.png</filename>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
</child>
+ </widget>
+ <widget>
+ <class>GtkLabel</class>
+ <name>label464</name>
+ <label>The search base is the distinguished name (DN) of the entry where your searches will
+begin. If you leave this blank, the search will begin at the root of the directory tree.</label>
+ <justify>GTK_JUSTIFY_LEFT</justify>
+ <wrap>False</wrap>
+ <xalign>7.45058e-09</xalign>
+ <yalign>0.5</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
<child>
- <widget class="GtkAlignment" id="alignment49">
- <property name="visible">True</property>
- <property name="xalign">7.45058e-09</property>
- <property name="yalign">7.45058e-09</property>
- <property name="xscale">0</property>
- <property name="yscale">1</property>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
+ </child>
+ </widget>
+ </widget>
+
+ <widget>
+ <class>GtkLabel</class>
+ <child_name>Notebook:tab</child_name>
+ <name>label465</name>
+ <label>label163</label>
+ <justify>GTK_JUSTIFY_CENTER</justify>
+ <wrap>False</wrap>
+ <xalign>0.5</xalign>
+ <yalign>0.5</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ </widget>
+
+ <widget>
+ <class>GtkHBox</class>
+ <name>hbox113</name>
+ <border_width>3</border_width>
+ <homogeneous>False</homogeneous>
+ <spacing>2</spacing>
+
+ <widget>
+ <class>GnomePixmap</class>
+ <name>pixmap61</name>
+ <filename>gnome-hint.png</filename>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
+ </child>
+ </widget>
- <child>
- <widget class="GtkOptionMenu" id="scope-optionmenu">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="history">0</property>
-
- <child internal-child="menu">
- <widget class="GtkMenu" id="convertwidget45">
- <property name="visible">True</property>
-
- <child>
- <widget class="GtkMenuItem" id="convertwidget46">
- <property name="visible">True</property>
- <property name="label" translatable="yes">One</property>
- <property name="use_underline">True</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkMenuItem" id="convertwidget47">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Sub</property>
- <property name="use_underline">True</property>
- </widget>
- </child>
- </widget>
- </child>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
- </packing>
+ <widget>
+ <class>GtkLabel</class>
+ <name>label466</name>
+ <label>The search scope defines how deep you would like the search to extend down the
+directory tree. A search scope of &quot;sub&quot; will include all entries below your search base.
+A search scope of &quot;one&quot; will only include the entries one level beneath your base.
+</label>
+ <justify>GTK_JUSTIFY_LEFT</justify>
+ <wrap>False</wrap>
+ <xalign>0.5</xalign>
+ <yalign>0.5</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
</child>
+ </widget>
+ </widget>
+
+ <widget>
+ <class>GtkLabel</class>
+ <child_name>Notebook:tab</child_name>
+ <name>label467</name>
+ <label>label164</label>
+ <justify>GTK_JUSTIFY_CENTER</justify>
+ <wrap>False</wrap>
+ <xalign>0.5</xalign>
+ <yalign>0.5</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ </widget>
+
+ <widget>
+ <class>GtkHBox</class>
+ <name>hbox114</name>
+ <border_width>3</border_width>
+ <homogeneous>False</homogeneous>
+ <spacing>2</spacing>
+
+ <widget>
+ <class>GnomePixmap</class>
+ <name>pixmap62</name>
+ <filename>gnome-hint.png</filename>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
+ </child>
+ </widget>
+ <widget>
+ <class>GtkLabel</class>
+ <name>label468</name>
+ <label>This option controls how long a search will be run.</label>
+ <justify>GTK_JUSTIFY_CENTER</justify>
+ <wrap>False</wrap>
+ <xalign>0.5</xalign>
+ <yalign>0.5</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
+ </child>
+ </widget>
+ </widget>
+
+ <widget>
+ <class>GtkLabel</class>
+ <child_name>Notebook:tab</child_name>
+ <name>label469</name>
+ <label>label165</label>
+ <justify>GTK_JUSTIFY_CENTER</justify>
+ <wrap>False</wrap>
+ <xalign>0.5</xalign>
+ <yalign>0.5</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ </widget>
+
+ <widget>
+ <class>GtkHBox</class>
+ <name>hbox115</name>
+ <border_width>3</border_width>
+ <homogeneous>False</homogeneous>
+ <spacing>2</spacing>
+
+ <widget>
+ <class>GnomePixmap</class>
+ <name>pixmap63</name>
+ <filename>gnome-hint.png</filename>
<child>
- <widget class="GtkHBox" id="hbox109">
- <property name="border_width">3</property>
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">3</property>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
+ </child>
+ </widget>
- <child>
- <widget class="GtkEntry" id="rootdn-entry">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="has_focus">True</property>
- <property name="editable">True</property>
- <property name="visibility">True</property>
- <property name="max_length">0</property>
- <property name="text" translatable="yes"></property>
- <property name="has_frame">True</property>
- <property name="invisible_char" translatable="yes">*</property>
- <property name="activates_default">False</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
+ <widget>
+ <class>GtkLabel</class>
+ <name>label470</name>
+ <label>This is the maximum number of entries to download. Setting this number to be
+too large will slow down your addressbook.</label>
+ <justify>GTK_JUSTIFY_LEFT</justify>
+ <wrap>False</wrap>
+ <xalign>7.45058e-09</xalign>
+ <yalign>0.5</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
+ </child>
+ </widget>
+ </widget>
+
+ <widget>
+ <class>GtkLabel</class>
+ <child_name>Notebook:tab</child_name>
+ <name>label471</name>
+ <label>label166</label>
+ <justify>GTK_JUSTIFY_CENTER</justify>
+ <wrap>False</wrap>
+ <xalign>0.5</xalign>
+ <yalign>0.5</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ </widget>
+ </widget>
+ </widget>
+</widget>
- <child>
- <widget class="GtkButton" id="rootdn-button">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes"> S_how Supported Bases </property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label457">
- <property name="visible">True</property>
- <property name="label" translatable="yes">_Timeout (minutes):</property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">1</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">2</property>
- <property name="bottom_attach">3</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
- </packing>
+<widget>
+ <class>GtkWindow</class>
+ <name>objectclasses-tab-window</name>
+ <visible>False</visible>
+ <title>objectclasses-tab</title>
+ <type>GTK_WINDOW_TOPLEVEL</type>
+ <position>GTK_WIN_POS_NONE</position>
+ <modal>False</modal>
+ <allow_shrink>False</allow_shrink>
+ <allow_grow>True</allow_grow>
+ <auto_shrink>False</auto_shrink>
+
+ <widget>
+ <class>GtkVBox</class>
+ <name>objectclasses-tab</name>
+ <border_width>3</border_width>
+ <homogeneous>False</homogeneous>
+ <spacing>3</spacing>
+
+ <widget>
+ <class>GtkHBox</class>
+ <name>hbox93</name>
+ <border_width>3</border_width>
+ <homogeneous>False</homogeneous>
+ <spacing>3</spacing>
+ <child>
+ <padding>0</padding>
+ <expand>True</expand>
+ <fill>True</fill>
+ </child>
+
+ <widget>
+ <class>GtkVBox</class>
+ <name>vbox51</name>
+ <border_width>3</border_width>
+ <homogeneous>False</homogeneous>
+ <spacing>3</spacing>
+ <child>
+ <padding>0</padding>
+ <expand>True</expand>
+ <fill>True</fill>
+ </child>
+
+ <widget>
+ <class>GtkLabel</class>
+ <name>label405</name>
+ <label>Objectclasses Used on Server:</label>
+ <justify>GTK_JUSTIFY_CENTER</justify>
+ <wrap>False</wrap>
+ <xalign>0.5</xalign>
+ <yalign>0.5</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
</child>
+ </widget>
+ <widget>
+ <class>Custom</class>
+ <name>objectclasses-server-table</name>
+ <creation_function>objectclasses_create_server_table</creation_function>
+ <int1>0</int1>
+ <int2>0</int2>
+ <last_modification_time>Tue, 16 Apr 2002 17:09:21 GMT</last_modification_time>
<child>
- <widget class="GtkAlignment" id="alignment50">
- <property name="visible">True</property>
- <property name="xalign">7.45058e-09</property>
- <property name="yalign">0.5</property>
- <property name="xscale">1</property>
- <property name="yscale">1</property>
+ <padding>0</padding>
+ <expand>True</expand>
+ <fill>True</fill>
+ </child>
+ </widget>
+ </widget>
+
+ <widget>
+ <class>GtkVBox</class>
+ <name>vbox52</name>
+ <border_width>3</border_width>
+ <homogeneous>False</homogeneous>
+ <spacing>3</spacing>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>True</fill>
+ </child>
+
+ <widget>
+ <class>GtkLabel</class>
+ <name>label407</name>
+ <label>
+</label>
+ <justify>GTK_JUSTIFY_CENTER</justify>
+ <wrap>False</wrap>
+ <xalign>0.5</xalign>
+ <yalign>0.5</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
+ </child>
+ </widget>
- <child>
- <widget class="GtkHBox" id="hbox110">
- <property name="border_width">3</property>
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">3</property>
-
- <child>
- <widget class="GtkLabel" id="label458">
- <property name="visible">True</property>
- <property name="label" translatable="yes">1:00</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkHScale" id="timeout-scale">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="draw_value">False</property>
- <property name="value_pos">GTK_POS_LEFT</property>
- <property name="digits">0</property>
- <property name="update_policy">GTK_UPDATE_CONTINUOUS</property>
- <property name="inverted">False</property>
- <property name="adjustment">3 1 5 0.5 1 0</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label459">
- <property name="visible">True</property>
- <property name="label" translatable="yes">5:00</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">3</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label460">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Selected:</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">1</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label461">
- <property name="visible">True</property>
- <property name="label" translatable="yes">2:30</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">2</property>
- <property name="bottom_attach">3</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label462">
- <property name="visible">True</property>
- <property name="label" translatable="yes">_Download limit:</property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">3</property>
- <property name="bottom_attach">4</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
- </packing>
+ <widget>
+ <class>GtkVButtonBox</class>
+ <name>vbuttonbox15</name>
+ <layout_style>GTK_BUTTONBOX_START</layout_style>
+ <spacing>1</spacing>
+ <child_min_width>47</child_min_width>
+ <child_min_height>27</child_min_height>
+ <child_ipad_x>7</child_ipad_x>
+ <child_ipad_y>0</child_ipad_y>
+ <child>
+ <padding>0</padding>
+ <expand>True</expand>
+ <fill>True</fill>
</child>
+ <widget>
+ <class>GtkButton</class>
+ <name>objectclasses-add-button</name>
+ <can_default>True</can_default>
+ <can_focus>True</can_focus>
+ <label>_Add -&gt;</label>
+ <relief>GTK_RELIEF_NORMAL</relief>
+ </widget>
+
+ <widget>
+ <class>GtkButton</class>
+ <name>objectclasses-remove-button</name>
+ <can_default>True</can_default>
+ <can_focus>True</can_focus>
+ <label>&lt;- _Remove</label>
+ <relief>GTK_RELIEF_NORMAL</relief>
+ </widget>
+ </widget>
+ </widget>
+
+ <widget>
+ <class>GtkVBox</class>
+ <name>vbox53</name>
+ <border_width>3</border_width>
+ <homogeneous>False</homogeneous>
+ <spacing>3</spacing>
+ <child>
+ <padding>0</padding>
+ <expand>True</expand>
+ <fill>True</fill>
+ </child>
+
+ <widget>
+ <class>GtkLabel</class>
+ <name>label408</name>
+ <label>Objectclasses Used in Evolution:</label>
+ <justify>GTK_JUSTIFY_CENTER</justify>
+ <wrap>False</wrap>
+ <xalign>0.5</xalign>
+ <yalign>0.5</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
<child>
- <widget class="GtkAlignment" id="alignment51">
- <property name="visible">True</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xscale">0</property>
- <property name="yscale">1</property>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
+ </child>
+ </widget>
- <child>
- <widget class="GtkHBox" id="hbox111">
- <property name="border_width">3</property>
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">3</property>
-
- <child>
- <widget class="GtkSpinButton" id="download-limit-spinbutton">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="climb_rate">1</property>
- <property name="digits">0</property>
- <property name="numeric">False</property>
- <property name="update_policy">GTK_UPDATE_ALWAYS</property>
- <property name="snap_to_ticks">False</property>
- <property name="wrap">False</property>
- <property name="adjustment">100 0 10000 1 10 10</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label463">
- <property name="visible">True</property>
- <property name="label" translatable="yes">cards</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">3</property>
- <property name="bottom_attach">4</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
+ <widget>
+ <class>Custom</class>
+ <name>objectclasses-evolution-table</name>
+ <creation_function>objectclasses_create_evolution_table</creation_function>
+ <int1>0</int1>
+ <int2>0</int2>
+ <last_modification_time>Tue, 16 Apr 2002 17:09:43 GMT</last_modification_time>
+ <child>
+ <padding>0</padding>
+ <expand>True</expand>
+ <fill>True</fill>
+ </child>
+ </widget>
+ </widget>
+ </widget>
+
+ <widget>
+ <class>GtkHButtonBox</class>
+ <name>hbuttonbox16</name>
+ <border_width>6</border_width>
+ <layout_style>GTK_BUTTONBOX_DEFAULT_STYLE</layout_style>
+ <spacing>0</spacing>
+ <child_min_width>87</child_min_width>
+ <child_min_height>27</child_min_height>
+ <child_ipad_x>7</child_ipad_x>
+ <child_ipad_y>0</child_ipad_y>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
+ <pack>GTK_PACK_END</pack>
</child>
+ <widget>
+ <class>GtkButton</class>
+ <name>objectclasses-default-button</name>
+ <can_default>True</can_default>
+ <can_focus>True</can_focus>
+ <label>R_estore Defaults</label>
+ <relief>GTK_RELIEF_NORMAL</relief>
+ </widget>
+ </widget>
+ </widget>
+</widget>
+
+<widget>
+ <class>GtkWindow</class>
+ <name>mappings-tab-window</name>
+ <visible>False</visible>
+ <title>mappings-tab</title>
+ <type>GTK_WINDOW_TOPLEVEL</type>
+ <position>GTK_WIN_POS_NONE</position>
+ <modal>False</modal>
+ <allow_shrink>False</allow_shrink>
+ <allow_grow>True</allow_grow>
+ <auto_shrink>False</auto_shrink>
+
+ <widget>
+ <class>GtkVBox</class>
+ <name>mappings-tab</name>
+ <border_width>3</border_width>
+ <homogeneous>False</homogeneous>
+ <spacing>3</spacing>
+
+ <widget>
+ <class>GtkHBox</class>
+ <name>hbox94</name>
+ <border_width>3</border_width>
+ <homogeneous>False</homogeneous>
+ <spacing>3</spacing>
<child>
- <widget class="GtkNotebook" id="searching-tab-help">
- <property name="visible">True</property>
- <property name="show_tabs">False</property>
- <property name="show_border">False</property>
- <property name="tab_pos">GTK_POS_TOP</property>
- <property name="scrollable">False</property>
- <property name="enable_popup">False</property>
-
- <child>
- <widget class="GtkLabel" id="label464">
- <property name="visible">True</property>
- <property name="label" translatable="yes">The search base is the distinguished name (DN) of the entry where your searches will
-begin. If you leave this blank, the search will begin at the root of the directory tree.</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">7.45058e-09</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
+ <padding>0</padding>
+ <expand>True</expand>
+ <fill>True</fill>
+ </child>
+
+ <widget>
+ <class>GtkVBox</class>
+ <name>vbox55</name>
+ <border_width>3</border_width>
+ <homogeneous>False</homogeneous>
+ <spacing>3</spacing>
+ <child>
+ <padding>0</padding>
+ <expand>True</expand>
+ <fill>True</fill>
+ </child>
+
+ <widget>
+ <class>GtkScrolledWindow</class>
+ <name>scrolledwindow21</name>
+ <hscrollbar_policy>GTK_POLICY_AUTOMATIC</hscrollbar_policy>
+ <vscrollbar_policy>GTK_POLICY_AUTOMATIC</vscrollbar_policy>
+ <hupdate_policy>GTK_UPDATE_CONTINUOUS</hupdate_policy>
+ <vupdate_policy>GTK_UPDATE_CONTINUOUS</vupdate_policy>
+ <child>
+ <padding>0</padding>
+ <expand>True</expand>
+ <fill>True</fill>
+ </child>
+
+ <widget>
+ <class>GtkCList</class>
+ <name>clist18</name>
+ <can_focus>True</can_focus>
+ <columns>2</columns>
+ <column_widths>146,80</column_widths>
+ <selection_mode>GTK_SELECTION_SINGLE</selection_mode>
+ <show_titles>True</show_titles>
+ <shadow_type>GTK_SHADOW_IN</shadow_type>
+
+ <widget>
+ <class>GtkLabel</class>
+ <child_name>CList:title</child_name>
+ <name>label411</name>
+ <label>Evolution Attribute</label>
+ <justify>GTK_JUSTIFY_CENTER</justify>
+ <wrap>False</wrap>
+ <xalign>0.5</xalign>
+ <yalign>0.5</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
</widget>
- <packing>
- <property name="tab_expand">False</property>
- <property name="tab_fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label465">
- <property name="visible">True</property>
- <property name="label" translatable="yes">label163</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
+
+ <widget>
+ <class>GtkLabel</class>
+ <child_name>CList:title</child_name>
+ <name>label412</name>
+ <label>Associated LDAP Attribute</label>
+ <justify>GTK_JUSTIFY_CENTER</justify>
+ <wrap>False</wrap>
+ <xalign>0.5</xalign>
+ <yalign>0.5</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
</widget>
- <packing>
- <property name="type">tab</property>
- </packing>
+ </widget>
+ </widget>
+ </widget>
+
+ <widget>
+ <class>GtkVBox</class>
+ <name>vbox56</name>
+ <border_width>3</border_width>
+ <homogeneous>False</homogeneous>
+ <spacing>3</spacing>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
+ </child>
+
+ <widget>
+ <class>GtkLabel</class>
+ <name>label413</name>
+ <label>
+</label>
+ <justify>GTK_JUSTIFY_CENTER</justify>
+ <wrap>False</wrap>
+ <xalign>0.5</xalign>
+ <yalign>0.5</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
</child>
+ </widget>
+ <widget>
+ <class>GtkVButtonBox</class>
+ <name>vbuttonbox16</name>
+ <layout_style>GTK_BUTTONBOX_DEFAULT_STYLE</layout_style>
+ <spacing>0</spacing>
+ <child_min_width>85</child_min_width>
+ <child_min_height>27</child_min_height>
+ <child_ipad_x>7</child_ipad_x>
+ <child_ipad_y>0</child_ipad_y>
<child>
- <widget class="GtkLabel" id="label466">
- <property name="visible">True</property>
- <property name="label" translatable="yes">The search scope defines how deep you would like the search to extend down the
-directory tree. A search scope of &quot;sub&quot; will include all entries below your search base.
-A search scope of &quot;one&quot; will only include the entries one level beneath your base.
-</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="tab_expand">False</property>
- <property name="tab_fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label467">
- <property name="visible">True</property>
- <property name="label" translatable="yes">label164</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="type">tab</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label468">
- <property name="visible">True</property>
- <property name="label" translatable="yes">This option controls how long a search will be run.</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="tab_expand">False</property>
- <property name="tab_fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label469">
- <property name="visible">True</property>
- <property name="label" translatable="yes">label165</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="type">tab</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label470">
- <property name="visible">True</property>
- <property name="label" translatable="yes">This is the maximum number of entries to download. Setting this number to be
-too large will slow down your addressbook.</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">7.45058e-09</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="tab_expand">False</property>
- <property name="tab_fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label471">
- <property name="visible">True</property>
- <property name="label" translatable="yes">label166</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="type">tab</property>
- </packing>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
</child>
+
+ <widget>
+ <class>GtkButton</class>
+ <name>button71</name>
+ <can_default>True</can_default>
+ <can_focus>True</can_focus>
+ <label>_Add Mapping</label>
+ <relief>GTK_RELIEF_NORMAL</relief>
+ </widget>
+
+ <widget>
+ <class>GtkButton</class>
+ <name>button72</name>
+ <can_default>True</can_default>
+ <can_focus>True</can_focus>
+ <label>_Edit Mapping</label>
+ <relief>GTK_RELIEF_NORMAL</relief>
+ </widget>
+
+ <widget>
+ <class>GtkButton</class>
+ <name>button73</name>
+ <can_default>True</can_default>
+ <can_focus>True</can_focus>
+ <label>_Delete Mapping</label>
+ <relief>GTK_RELIEF_NORMAL</relief>
+ </widget>
</widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="pack_type">GTK_PACK_END</property>
- </packing>
+ </widget>
+ </widget>
+
+ <widget>
+ <class>GtkHButtonBox</class>
+ <name>hbuttonbox17</name>
+ <layout_style>GTK_BUTTONBOX_DEFAULT_STYLE</layout_style>
+ <spacing>30</spacing>
+ <child_min_width>85</child_min_width>
+ <child_min_height>27</child_min_height>
+ <child_ipad_x>7</child_ipad_x>
+ <child_ipad_y>0</child_ipad_y>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
+ <pack>GTK_PACK_END</pack>
</child>
+
+ <widget>
+ <class>GtkButton</class>
+ <name>button74</name>
+ <can_default>True</can_default>
+ <can_focus>True</can_focus>
+ <label>Re_store Defaults</label>
+ <relief>GTK_RELIEF_NORMAL</relief>
+ </widget>
</widget>
- </child>
+ </widget>
</widget>
-<widget class="GtkDialog" id="supported-bases-dialog">
- <property name="title" translatable="yes">Supported Search Bases</property>
- <property name="type">GTK_WINDOW_TOPLEVEL</property>
- <property name="window_position">GTK_WIN_POS_NONE</property>
- <property name="modal">False</property>
- <property name="default_width">300</property>
- <property name="default_height">200</property>
- <property name="resizable">True</property>
- <property name="destroy_with_parent">False</property>
- <property name="has_separator">True</property>
-
- <child internal-child="vbox">
- <widget class="GtkVBox" id="dialog-vbox5">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">8</property>
-
- <child internal-child="action_area">
- <widget class="GtkHButtonBox" id="dialog-action_area5">
- <property name="visible">True</property>
- <property name="layout_style">GTK_BUTTONBOX_END</property>
-
- <child>
- <widget class="GtkButton" id="button107">
- <property name="visible">True</property>
- <property name="can_default">True</property>
- <property name="can_focus">True</property>
- <property name="label">gtk-ok</property>
- <property name="use_stock">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="response_id">-5</property>
- </widget>
+<widget>
+ <class>GtkWindow</class>
+ <name>dn-customization-tab-window</name>
+ <visible>False</visible>
+ <title>dn-customization-tab</title>
+ <type>GTK_WINDOW_TOPLEVEL</type>
+ <position>GTK_WIN_POS_NONE</position>
+ <modal>False</modal>
+ <allow_shrink>False</allow_shrink>
+ <allow_grow>True</allow_grow>
+ <auto_shrink>False</auto_shrink>
+
+ <widget>
+ <class>GtkVBox</class>
+ <name>dn-customization-tab</name>
+ <border_width>3</border_width>
+ <homogeneous>False</homogeneous>
+ <spacing>3</spacing>
+
+ <widget>
+ <class>GtkNotebook</class>
+ <name>notebook24</name>
+ <show_tabs>False</show_tabs>
+ <show_border>False</show_border>
+ <tab_pos>GTK_POS_TOP</tab_pos>
+ <scrollable>False</scrollable>
+ <tab_hborder>2</tab_hborder>
+ <tab_vborder>2</tab_vborder>
+ <popup_enable>False</popup_enable>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
+ <pack>GTK_PACK_END</pack>
+ </child>
+
+ <widget>
+ <class>GtkHBox</class>
+ <name>hbox116</name>
+ <border_width>3</border_width>
+ <homogeneous>False</homogeneous>
+ <spacing>2</spacing>
+
+ <widget>
+ <class>GnomePixmap</class>
+ <name>pixmap64</name>
+ <filename>gnome-hint.png</filename>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
</child>
+ </widget>
+ <widget>
+ <class>GtkLabel</class>
+ <name>label473</name>
+ <label>To add an attribute to the DN, select it from the list and click the &quot;Add Attribute&quot; button.
+Any values that you add to the DN will become required values for any new contacts
+that you add to the directory on the LDAP server. </label>
+ <justify>GTK_JUSTIFY_LEFT</justify>
+ <wrap>False</wrap>
+ <xalign>7.45058e-09</xalign>
+ <yalign>0.5</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
<child>
- <widget class="GtkButton" id="button109">
- <property name="visible">True</property>
- <property name="can_default">True</property>
- <property name="can_focus">True</property>
- <property name="label">gtk-cancel</property>
- <property name="use_stock">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="response_id">-6</property>
- </widget>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
+ </child>
+ </widget>
+ </widget>
+
+ <widget>
+ <class>GtkLabel</class>
+ <child_name>Notebook:tab</child_name>
+ <name>label474</name>
+ <label>label163</label>
+ <justify>GTK_JUSTIFY_CENTER</justify>
+ <wrap>False</wrap>
+ <xalign>0.5</xalign>
+ <yalign>0.5</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ </widget>
+
+ <widget>
+ <class>GtkHBox</class>
+ <name>hbox117</name>
+ <border_width>3</border_width>
+ <homogeneous>False</homogeneous>
+ <spacing>3</spacing>
+
+ <widget>
+ <class>GnomePixmap</class>
+ <name>pixmap65</name>
+ <filename>gnome-hint.png</filename>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
</child>
</widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="pack_type">GTK_PACK_END</property>
- </packing>
+
+ <widget>
+ <class>GtkLabel</class>
+ <name>label475</name>
+ <label>Selecting this option will let you change Evolution's default settings for LDAP
+searches, and for creating and editing contacts. </label>
+ <justify>GTK_JUSTIFY_LEFT</justify>
+ <wrap>False</wrap>
+ <xalign>0.5</xalign>
+ <yalign>0.5</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
+ </child>
+ </widget>
+ </widget>
+
+ <widget>
+ <class>GtkLabel</class>
+ <child_name>Notebook:tab</child_name>
+ <name>label476</name>
+ <label>label164</label>
+ <justify>GTK_JUSTIFY_CENTER</justify>
+ <wrap>False</wrap>
+ <xalign>0.5</xalign>
+ <yalign>0.5</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ </widget>
+ </widget>
+
+ <widget>
+ <class>GtkTable</class>
+ <name>table31</name>
+ <border_width>3</border_width>
+ <rows>2</rows>
+ <columns>2</columns>
+ <homogeneous>False</homogeneous>
+ <row_spacing>3</row_spacing>
+ <column_spacing>3</column_spacing>
+ <child>
+ <padding>0</padding>
+ <expand>True</expand>
+ <fill>True</fill>
+ </child>
+
+ <widget>
+ <class>GtkVBox</class>
+ <name>vbox64</name>
+ <homogeneous>False</homogeneous>
+ <spacing>0</spacing>
+ <child>
+ <left_attach>1</left_attach>
+ <right_attach>2</right_attach>
+ <top_attach>1</top_attach>
+ <bottom_attach>2</bottom_attach>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <xexpand>False</xexpand>
+ <yexpand>False</yexpand>
+ <xshrink>False</xshrink>
+ <yshrink>False</yshrink>
+ <xfill>False</xfill>
+ <yfill>True</yfill>
+ </child>
+
+ <widget>
+ <class>GtkLabel</class>
+ <name>label477</name>
+ <label></label>
+ <justify>GTK_JUSTIFY_CENTER</justify>
+ <wrap>False</wrap>
+ <xalign>0.5</xalign>
+ <yalign>0.5</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
+ </child>
+ </widget>
+
+ <widget>
+ <class>GtkVButtonBox</class>
+ <name>vbuttonbox17</name>
+ <layout_style>GTK_BUTTONBOX_START</layout_style>
+ <spacing>10</spacing>
+ <child_min_width>85</child_min_width>
+ <child_min_height>27</child_min_height>
+ <child_ipad_x>7</child_ipad_x>
+ <child_ipad_y>0</child_ipad_y>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
+ </child>
+
+ <widget>
+ <class>GtkButton</class>
+ <name>button78</name>
+ <can_default>True</can_default>
+ <can_focus>True</can_focus>
+ <label>_Add to DN</label>
+ <relief>GTK_RELIEF_NORMAL</relief>
+ </widget>
+ </widget>
+ </widget>
+
+ <widget>
+ <class>GtkScrolledWindow</class>
+ <name>scrolledwindow22</name>
+ <hscrollbar_policy>GTK_POLICY_AUTOMATIC</hscrollbar_policy>
+ <vscrollbar_policy>GTK_POLICY_AUTOMATIC</vscrollbar_policy>
+ <hupdate_policy>GTK_UPDATE_CONTINUOUS</hupdate_policy>
+ <vupdate_policy>GTK_UPDATE_CONTINUOUS</vupdate_policy>
+ <child>
+ <left_attach>0</left_attach>
+ <right_attach>1</right_attach>
+ <top_attach>1</top_attach>
+ <bottom_attach>2</bottom_attach>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <xexpand>True</xexpand>
+ <yexpand>True</yexpand>
+ <xshrink>False</xshrink>
+ <yshrink>False</yshrink>
+ <xfill>True</xfill>
+ <yfill>True</yfill>
+ </child>
+
+ <widget>
+ <class>GtkCList</class>
+ <name>clist19</name>
+ <can_focus>True</can_focus>
+ <columns>2</columns>
+ <column_widths>152,80</column_widths>
+ <selection_mode>GTK_SELECTION_SINGLE</selection_mode>
+ <show_titles>True</show_titles>
+ <shadow_type>GTK_SHADOW_IN</shadow_type>
+
+ <widget>
+ <class>GtkLabel</class>
+ <child_name>CList:title</child_name>
+ <name>label478</name>
+ <label>LDAP Attribute</label>
+ <justify>GTK_JUSTIFY_CENTER</justify>
+ <wrap>False</wrap>
+ <xalign>0.5</xalign>
+ <yalign>0.5</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ </widget>
+
+ <widget>
+ <class>GtkLabel</class>
+ <child_name>CList:title</child_name>
+ <name>label479</name>
+ <label>Corresponding Evolution Attribute</label>
+ <justify>GTK_JUSTIFY_CENTER</justify>
+ <wrap>False</wrap>
+ <xalign>0.5</xalign>
+ <yalign>0.5</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ </widget>
+ </widget>
+ </widget>
+
+ <widget>
+ <class>GtkHBox</class>
+ <name>hbox118</name>
+ <border_width>3</border_width>
+ <homogeneous>False</homogeneous>
+ <spacing>3</spacing>
+ <child>
+ <left_attach>0</left_attach>
+ <right_attach>1</right_attach>
+ <top_attach>0</top_attach>
+ <bottom_attach>1</bottom_attach>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <xexpand>True</xexpand>
+ <yexpand>False</yexpand>
+ <xshrink>False</xshrink>
+ <yshrink>False</yshrink>
+ <xfill>True</xfill>
+ <yfill>True</yfill>
+ </child>
+
+ <widget>
+ <class>GtkLabel</class>
+ <name>label480</name>
+ <label>_Distinguished Name (DN):</label>
+ <justify>GTK_JUSTIFY_CENTER</justify>
+ <wrap>False</wrap>
+ <xalign>0.5</xalign>
+ <yalign>0.5</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <default_focus_target>entry53</default_focus_target>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
+ </child>
+ </widget>
+
+ <widget>
+ <class>GtkEntry</class>
+ <name>entry53</name>
+ <can_focus>True</can_focus>
+ <editable>True</editable>
+ <text_visible>True</text_visible>
+ <text_max_length>0</text_max_length>
+ <text></text>
+ <child>
+ <padding>0</padding>
+ <expand>True</expand>
+ <fill>True</fill>
+ </child>
+ </widget>
+ </widget>
+
+ <widget>
+ <class>GtkHButtonBox</class>
+ <name>hbuttonbox18</name>
+ <layout_style>GTK_BUTTONBOX_DEFAULT_STYLE</layout_style>
+ <spacing>0</spacing>
+ <child_min_width>85</child_min_width>
+ <child_min_height>27</child_min_height>
+ <child_ipad_x>7</child_ipad_x>
+ <child_ipad_y>0</child_ipad_y>
+ <child>
+ <left_attach>1</left_attach>
+ <right_attach>2</right_attach>
+ <top_attach>0</top_attach>
+ <bottom_attach>1</bottom_attach>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <xexpand>False</xexpand>
+ <yexpand>False</yexpand>
+ <xshrink>False</xshrink>
+ <yshrink>False</yshrink>
+ <xfill>False</xfill>
+ <yfill>True</yfill>
+ </child>
+
+ <widget>
+ <class>GtkButton</class>
+ <name>button79</name>
+ <can_default>True</can_default>
+ <can_focus>True</can_focus>
+ <label>_Restore Defaults</label>
+ <relief>GTK_RELIEF_NORMAL</relief>
+ </widget>
+ </widget>
+ </widget>
+ </widget>
+</widget>
+
+<widget>
+ <class>GnomeDialog</class>
+ <name>supported-bases-dialog</name>
+ <visible>False</visible>
+ <title>Supported Search Bases</title>
+ <type>GTK_WINDOW_TOPLEVEL</type>
+ <position>GTK_WIN_POS_NONE</position>
+ <modal>False</modal>
+ <default_width>300</default_width>
+ <default_height>200</default_height>
+ <allow_shrink>True</allow_shrink>
+ <allow_grow>True</allow_grow>
+ <auto_shrink>False</auto_shrink>
+ <auto_close>False</auto_close>
+ <hide_on_close>False</hide_on_close>
+
+ <widget>
+ <class>GtkVBox</class>
+ <child_name>GnomeDialog:vbox</child_name>
+ <name>dialog-vbox5</name>
+ <homogeneous>False</homogeneous>
+ <spacing>8</spacing>
+ <child>
+ <padding>4</padding>
+ <expand>True</expand>
+ <fill>True</fill>
+ </child>
+
+ <widget>
+ <class>GtkHButtonBox</class>
+ <child_name>GnomeDialog:action_area</child_name>
+ <name>dialog-action_area5</name>
+ <layout_style>GTK_BUTTONBOX_END</layout_style>
+ <spacing>8</spacing>
+ <child_min_width>85</child_min_width>
+ <child_min_height>27</child_min_height>
+ <child_ipad_x>7</child_ipad_x>
+ <child_ipad_y>0</child_ipad_y>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>True</fill>
+ <pack>GTK_PACK_END</pack>
</child>
+ <widget>
+ <class>GtkButton</class>
+ <name>button107</name>
+ <can_default>True</can_default>
+ <can_focus>True</can_focus>
+ <stock_button>GNOME_STOCK_BUTTON_OK</stock_button>
+ </widget>
+
+ <widget>
+ <class>GtkButton</class>
+ <name>button109</name>
+ <can_default>True</can_default>
+ <can_focus>True</can_focus>
+ <stock_button>GNOME_STOCK_BUTTON_CANCEL</stock_button>
+ </widget>
+ </widget>
+
+ <widget>
+ <class>Custom</class>
+ <name>supported-bases-table</name>
+ <creation_function>supported_bases_create_table</creation_function>
+ <int1>0</int1>
+ <int2>0</int2>
+ <last_modification_time>Fri, 12 Apr 2002 20:06:45 GMT</last_modification_time>
<child>
- <widget class="Custom" id="supported-bases-table">
- <property name="visible">True</property>
- <property name="creation_function">supported_bases_create_table</property>
- <property name="int1">0</property>
- <property name="int2">0</property>
- <property name="last_modification_time">Fri, 12 Apr 2002 20:06:45 GMT</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
+ <padding>0</padding>
+ <expand>True</expand>
+ <fill>True</fill>
</child>
</widget>
- </child>
+ </widget>
</widget>
-</glade-interface>
+</GTK-Interface>
diff --git a/addressbook/gui/component/select-names/e-select-names-bonobo.c b/addressbook/gui/component/select-names/e-select-names-bonobo.c
index 0f18614c1a..411aedf761 100644
--- a/addressbook/gui/component/select-names/e-select-names-bonobo.c
+++ b/addressbook/gui/component/select-names/e-select-names-bonobo.c
@@ -27,18 +27,13 @@
#include "e-select-names-bonobo.h"
#include "e-simple-card-bonobo.h"
-#include <bonobo-activation/bonobo-activation-activate.h>
-
#include <bonobo/bonobo-property-bag.h>
#include <bonobo/bonobo-control.h>
-#include <bonobo/bonobo-exception.h>
#include <bonobo/bonobo-event-source.h>
#include <gal/util/e-util.h>
#include <gal/e-text/e-entry.h>
-#include "evolution-shell-client.h"
-
#include "Evolution-Addressbook-SelectNames.h"
#include "e-select-names-manager.h"
@@ -48,7 +43,7 @@
-#define PARENT_TYPE BONOBO_TYPE_OBJECT
+#define PARENT_TYPE bonobo_object_get_type ()
static BonoboObjectClass *parent_class = NULL;
struct _ESelectNamesBonoboPrivate {
@@ -84,7 +79,7 @@ entry_get_property_fn (BonoboPropertyBag *bag,
case ENTRY_PROPERTY_ID_TEXT:
{
ETextModel *text_model;
- text_model = E_TEXT_MODEL (g_object_get_data (G_OBJECT (w), "select_names_text_model"));
+ text_model = E_TEXT_MODEL (gtk_object_get_data (GTK_OBJECT (w), "select_names_text_model"));
g_assert (text_model != NULL);
BONOBO_ARG_SET_STRING (arg, e_text_model_get_text (text_model));
@@ -96,7 +91,7 @@ entry_get_property_fn (BonoboPropertyBag *bag,
ESelectNamesModel *model;
char *text;
- model = E_SELECT_NAMES_MODEL (g_object_get_data (G_OBJECT (w), "select_names_model"));
+ model = E_SELECT_NAMES_MODEL (gtk_object_get_data (GTK_OBJECT (w), "select_names_model"));
g_assert (model != NULL);
text = e_select_names_model_get_address_text (model, ", ");
@@ -110,7 +105,7 @@ entry_get_property_fn (BonoboPropertyBag *bag,
ESelectNamesModel *model;
char *text;
- model = E_SELECT_NAMES_MODEL (g_object_get_data (G_OBJECT (w), "select_names_model"));
+ model = E_SELECT_NAMES_MODEL (gtk_object_get_data (GTK_OBJECT (w), "select_names_model"));
g_assert (model != NULL);
text = e_select_names_model_export_destinationv (model);
@@ -126,7 +121,7 @@ entry_get_property_fn (BonoboPropertyBag *bag,
int i;
GNOME_Evolution_Addressbook_SimpleCardList *card_list;
- model = E_SELECT_NAMES_MODEL (g_object_get_data (G_OBJECT (w), "select_names_model"));
+ model = E_SELECT_NAMES_MODEL (gtk_object_get_data (GTK_OBJECT (w), "select_names_model"));
g_assert (model != NULL);
count = e_select_names_model_count (model);
@@ -141,7 +136,7 @@ entry_get_property_fn (BonoboPropertyBag *bag,
const ECard *card = e_destination_get_card (destination);
ECardSimple *simple = e_card_simple_new ((ECard *) card);
ESimpleCardBonobo *simple_card = e_simple_card_bonobo_new (simple);
- g_object_unref (simple);
+ gtk_object_unref (GTK_OBJECT (simple));
card_list->_buffer[i] = bonobo_object_corba_objref (BONOBO_OBJECT (simple_card));
}
@@ -154,7 +149,7 @@ entry_get_property_fn (BonoboPropertyBag *bag,
case ENTRY_PROPERTY_ID_ALLOW_CONTACT_LISTS:
{
ESelectNamesCompletion *comp;
- comp = E_SELECT_NAMES_COMPLETION (g_object_get_data (G_OBJECT (w), "completion_handler"));
+ comp = E_SELECT_NAMES_COMPLETION (gtk_object_get_data (GTK_OBJECT (w), "completion_handler"));
g_assert (comp != NULL);
BONOBO_ARG_SET_BOOLEAN (arg, e_select_names_completion_get_match_contact_lists (comp));
@@ -188,7 +183,7 @@ entry_set_property_fn (BonoboPropertyBag *bag,
case ENTRY_PROPERTY_ID_ADDRESSES:
{
ESelectNamesModel *model;
- model = E_SELECT_NAMES_MODEL (g_object_get_data (G_OBJECT (w), "select_names_model"));
+ model = E_SELECT_NAMES_MODEL (gtk_object_get_data (GTK_OBJECT (w), "select_names_model"));
g_assert (model != NULL);
e_entry_set_text (E_ENTRY (w), BONOBO_ARG_GET_STRING (arg));
@@ -199,7 +194,7 @@ entry_set_property_fn (BonoboPropertyBag *bag,
case ENTRY_PROPERTY_ID_DESTINATIONS:
{
ESelectNamesModel *model;
- model = E_SELECT_NAMES_MODEL (g_object_get_data (G_OBJECT (w), "select_names_model"));
+ model = E_SELECT_NAMES_MODEL (gtk_object_get_data (GTK_OBJECT (w), "select_names_model"));
g_assert (model != NULL);
e_select_names_model_import_destinationv (model, BONOBO_ARG_GET_STRING (arg));
@@ -210,7 +205,7 @@ entry_set_property_fn (BonoboPropertyBag *bag,
case ENTRY_PROPERTY_ID_ALLOW_CONTACT_LISTS:
{
ESelectNamesCompletion *comp;
- comp = E_SELECT_NAMES_COMPLETION (g_object_get_data (G_OBJECT (w), "completion_handler"));
+ comp = E_SELECT_NAMES_COMPLETION (gtk_object_get_data (GTK_OBJECT (w), "completion_handler"));
g_assert (comp != NULL);
e_select_names_completion_set_match_contact_lists (comp, BONOBO_ARG_GET_BOOLEAN (arg));
@@ -218,7 +213,7 @@ entry_set_property_fn (BonoboPropertyBag *bag,
}
case ENTRY_PROPERTY_ID_ENTRY_CHANGED:
- g_object_set_data (G_OBJECT (w), "entry_property_id_changed", GUINT_TO_POINTER (1));
+ gtk_object_set_data (GTK_OBJECT (w), "entry_property_id_changed", GUINT_TO_POINTER (1));
break;
default:
@@ -226,16 +221,46 @@ entry_set_property_fn (BonoboPropertyBag *bag,
}
}
+
+/* CORBA interface implementation. */
+
+static POA_GNOME_Evolution_Addressbook_SelectNames__vepv SelectNames_vepv;
+
+static POA_GNOME_Evolution_Addressbook_SelectNames *
+create_servant (void)
+{
+ POA_GNOME_Evolution_Addressbook_SelectNames *servant;
+ CORBA_Environment ev;
+
+ servant = (POA_GNOME_Evolution_Addressbook_SelectNames *) g_new0 (BonoboObjectServant, 1);
+ servant->vepv = &SelectNames_vepv;
+
+ CORBA_exception_init (&ev);
+
+ POA_GNOME_Evolution_Addressbook_SelectNames__init ((PortableServer_Servant) servant, &ev);
+ if (ev._major != CORBA_NO_EXCEPTION) {
+ g_free (servant);
+ CORBA_exception_free (&ev);
+ return NULL;
+ }
+
+ CORBA_exception_free (&ev);
+
+ return servant;
+}
+
static void
impl_SelectNames_add_section (PortableServer_Servant servant,
const CORBA_char *id,
const CORBA_char *title,
CORBA_Environment *ev)
{
+ BonoboObject *bonobo_object;
ESelectNamesBonobo *select_names;
ESelectNamesBonoboPrivate *priv;
- select_names = E_SELECT_NAMES_BONOBO (bonobo_object (servant));
+ bonobo_object = bonobo_object_from_servant (servant);
+ select_names = E_SELECT_NAMES_BONOBO (bonobo_object);
priv = select_names->priv;
e_select_names_manager_add_section (priv->manager, id, title);
@@ -248,10 +273,12 @@ impl_SelectNames_add_section_with_limit (PortableServer_Servant servant,
CORBA_short limit,
CORBA_Environment *ev)
{
+ BonoboObject *bonobo_object;
ESelectNamesBonobo *select_names;
ESelectNamesBonoboPrivate *priv;
- select_names = E_SELECT_NAMES_BONOBO (bonobo_object (servant));
+ bonobo_object = bonobo_object_from_servant (servant);
+ select_names = E_SELECT_NAMES_BONOBO (bonobo_object);
priv = select_names->priv;
e_select_names_manager_add_section_with_limit (priv->manager, id, title, limit);
@@ -260,10 +287,10 @@ impl_SelectNames_add_section_with_limit (PortableServer_Servant servant,
static void
entry_changed (GtkWidget *widget, BonoboControl *control)
{
- gboolean changed = GPOINTER_TO_UINT (g_object_get_data (G_OBJECT (widget), "entry_property_id_changed"));
+ gboolean changed = GPOINTER_TO_UINT (gtk_object_get_data (GTK_OBJECT (widget), "entry_property_id_changed"));
if (!changed)
- bonobo_control_set_property (control, NULL, "entry_changed", TC_CORBA_boolean, TRUE, NULL);
+ bonobo_control_set_property (control, "entry_changed", TRUE, NULL);
}
static void
@@ -307,13 +334,15 @@ impl_SelectNames_get_entry_for_section (PortableServer_Servant servant,
const CORBA_char *section_id,
CORBA_Environment *ev)
{
+ BonoboObject *bonobo_object;
ESelectNamesBonobo *select_names;
ESelectNamesBonoboPrivate *priv;
GtkWidget *entry_widget;
BonoboControl *control;
BonoboPropertyBag *property_bag;
- select_names = E_SELECT_NAMES_BONOBO (bonobo_object (servant));
+ bonobo_object = bonobo_object_from_servant (servant);
+ select_names = E_SELECT_NAMES_BONOBO (bonobo_object);
priv = select_names->priv;
entry_widget = e_select_names_manager_create_entry (priv->manager, section_id);
@@ -349,10 +378,9 @@ impl_SelectNames_get_entry_for_section (PortableServer_Servant servant,
BONOBO_ARG_BOOLEAN, NULL, NULL,
BONOBO_PROPERTY_WRITEABLE);
- bonobo_control_set_properties (control, bonobo_object_corba_objref (BONOBO_OBJECT (property_bag)), NULL);
- bonobo_object_unref (BONOBO_OBJECT (property_bag));
+ bonobo_control_set_properties (control, property_bag);
- g_signal_connect (entry_widget, "changed", G_CALLBACK (entry_changed), control);
+ gtk_signal_connect (GTK_OBJECT (entry_widget), "changed", GTK_SIGNAL_FUNC (entry_changed), control);
return CORBA_Object_duplicate (bonobo_object_corba_objref (BONOBO_OBJECT (control)), ev);
}
@@ -362,32 +390,22 @@ impl_SelectNames_activate_dialog (PortableServer_Servant servant,
const CORBA_char *section_id,
CORBA_Environment *ev)
{
+ BonoboObject *bonobo_object;
ESelectNamesBonobo *select_names;
ESelectNamesBonoboPrivate *priv;
- EvolutionShellClient *shell_client;
- GNOME_Evolution_Shell shell;
- select_names = E_SELECT_NAMES_BONOBO (bonobo_object (servant));
+ bonobo_object = bonobo_object_from_servant (servant);
+ select_names = E_SELECT_NAMES_BONOBO (bonobo_object);
priv = select_names->priv;
- shell = bonobo_activation_activate_from_id (
- "OAFIID:GNOME_Evolution_Shell",
- Bonobo_ACTIVATION_FLAG_EXISTING_ONLY,
- NULL, ev);
- if (BONOBO_EX (ev))
- return;
-
- shell_client = evolution_shell_client_new (shell);
- e_select_names_manager_activate_dialog (priv->manager, shell_client,
- section_id);
- g_object_unref (shell_client);
+ e_select_names_manager_activate_dialog (priv->manager, section_id);
}
/* GtkObject methods. */
static void
-impl_dispose (GObject *object)
+impl_destroy (GtkObject *object)
{
ESelectNamesBonobo *select_names;
ESelectNamesBonoboPrivate *priv;
@@ -395,43 +413,55 @@ impl_dispose (GObject *object)
select_names = E_SELECT_NAMES_BONOBO (object);
priv = select_names->priv;
- if (priv) {
- if (priv->manager->names) {
- gtk_widget_destroy (GTK_WIDGET (priv->manager->names));
- priv->manager->names = NULL;
- }
-
- g_object_unref (priv->manager);
-
- g_free (priv);
- select_names->priv = NULL;
+ if (priv->manager->names) {
+ gtk_widget_destroy (GTK_WIDGET (priv->manager->names));
+ priv->manager->names = NULL;
}
- if (G_OBJECT_CLASS (parent_class)->dispose)
- G_OBJECT_CLASS (parent_class)->dispose (object);
+ gtk_object_unref (GTK_OBJECT (priv->manager));
+
+ g_free (priv);
}
static void
-e_select_names_bonobo_class_init (ESelectNamesBonoboClass *klass)
+corba_class_init ()
{
- GObjectClass *object_class;
+ POA_GNOME_Evolution_Addressbook_SelectNames__vepv *vepv;
POA_GNOME_Evolution_Addressbook_SelectNames__epv *epv;
+ PortableServer_ServantBase__epv *base_epv;
- object_class = G_OBJECT_CLASS (klass);
- parent_class = g_type_class_peek_parent (klass);
+ base_epv = g_new0 (PortableServer_ServantBase__epv, 1);
+ base_epv->_private = NULL;
+ base_epv->finalize = NULL;
+ base_epv->default_POA = NULL;
- object_class->dispose = impl_dispose;
-
- epv = &klass->epv;
+ epv = g_new0 (POA_GNOME_Evolution_Addressbook_SelectNames__epv, 1);
epv->addSection = impl_SelectNames_add_section;
epv->addSectionWithLimit = impl_SelectNames_add_section_with_limit;
epv->getEntryBySection = impl_SelectNames_get_entry_for_section;
epv->activateDialog = impl_SelectNames_activate_dialog;
+
+ vepv = &SelectNames_vepv;
+ vepv->Bonobo_Unknown_epv = bonobo_object_get_epv ();
+ vepv->GNOME_Evolution_Addressbook_SelectNames_epv = epv;
+}
+
+static void
+class_init (ESelectNamesBonoboClass *klass)
+{
+ GtkObjectClass *object_class;
+
+ object_class = GTK_OBJECT_CLASS (klass);
+ parent_class = gtk_type_class (bonobo_object_get_type ());
+
+ object_class->destroy = impl_destroy;
+
+ corba_class_init ();
}
static void
-e_select_names_bonobo_init (ESelectNamesBonobo *select_names)
+init (ESelectNamesBonobo *select_names)
{
ESelectNamesBonoboPrivate *priv;
@@ -440,26 +470,29 @@ e_select_names_bonobo_init (ESelectNamesBonobo *select_names)
priv->manager = e_select_names_manager_new ();
priv->event_source = NULL;
- g_signal_connect (priv->manager,
- "changed",
- G_CALLBACK (manager_changed_cb),
- select_names);
+ gtk_signal_connect (GTK_OBJECT (priv->manager),
+ "changed",
+ GTK_SIGNAL_FUNC (manager_changed_cb),
+ select_names);
+
+ gtk_signal_connect (GTK_OBJECT (priv->manager),
+ "ok",
+ GTK_SIGNAL_FUNC (manager_ok_cb),
+ select_names);
- g_signal_connect (priv->manager,
- "ok",
- G_CALLBACK (manager_ok_cb),
- select_names);
-
select_names->priv = priv;
}
-static void
-e_select_names_bonobo_construct (ESelectNamesBonobo *select_names)
+void
+e_select_names_bonobo_construct (ESelectNamesBonobo *select_names,
+ GNOME_Evolution_Addressbook_SelectNames corba_object)
{
g_return_if_fail (select_names != NULL);
g_return_if_fail (E_IS_SELECT_NAMES_BONOBO (select_names));
+ bonobo_object_construct (BONOBO_OBJECT (select_names), corba_object);
+
g_assert (select_names->priv->event_source == NULL);
select_names->priv->event_source = bonobo_event_source_new ();
bonobo_object_add_interface (BONOBO_OBJECT (select_names), BONOBO_OBJECT (select_names->priv->event_source));
@@ -468,18 +501,21 @@ e_select_names_bonobo_construct (ESelectNamesBonobo *select_names)
ESelectNamesBonobo *
e_select_names_bonobo_new (void)
{
+ POA_GNOME_Evolution_Addressbook_SelectNames *servant;
+ GNOME_Evolution_Addressbook_SelectNames corba_object;
ESelectNamesBonobo *select_names;
- select_names = g_object_new (E_TYPE_SELECT_NAMES_BONOBO, NULL);
+ servant = create_servant ();
+ if (servant == NULL)
+ return NULL;
+
+ select_names = gtk_type_new (e_select_names_bonobo_get_type ());
- e_select_names_bonobo_construct (select_names);
+ corba_object = bonobo_object_activate_servant (BONOBO_OBJECT (select_names), servant);
+ e_select_names_bonobo_construct (select_names, corba_object);
return select_names;
}
-BONOBO_TYPE_FUNC_FULL (
- ESelectNamesBonobo,
- GNOME_Evolution_Addressbook_SelectNames,
- PARENT_TYPE,
- e_select_names_bonobo);
+E_MAKE_TYPE (e_select_names_bonobo, "ESelectNamesBonobo", ESelectNamesBonobo, class_init, init, PARENT_TYPE)
diff --git a/addressbook/gui/component/select-names/e-select-names.c b/addressbook/gui/component/select-names/e-select-names.c
index a189077c92..7ebd100d67 100644
--- a/addressbook/gui/component/select-names/e-select-names.c
+++ b/addressbook/gui/component/select-names/e-select-names.c
@@ -19,10 +19,12 @@
*/
#include <config.h>
-#include <string.h>
#include <glib.h>
-#include <gtk/gtk.h>
+#include <libgnome/gnome-defs.h>
#include <libgnome/gnome-i18n.h>
+#include <libgnomeui/gnome-stock.h>
+#include <libgnomeui/gnome-dialog.h>
+#include <libgnomeui/gnome-dialog-util.h>
#include <gal/e-table/e-table-simple.h>
#include <gal/e-table/e-table-without.h>
@@ -42,21 +44,23 @@
#include "e-select-names.h"
#include <addressbook/backend/ebook/e-card-simple.h>
-#include "e-select-names-table-model.h"
+#include "e-select-names-text-model.h"
#include <gal/widgets/e-categories-master-list-option-menu.h>
+#include <gal/widgets/e-unicode.h>
#include <gal/e-text/e-entry.h>
#include <e-util/e-categories-master-list-wombat.h>
-#include "e-util/e-sexp.h"
-static void e_select_names_init (ESelectNames *names);
+static void e_select_names_init (ESelectNames *card);
static void e_select_names_class_init (ESelectNamesClass *klass);
-static void e_select_names_dispose (GObject *object);
+static void e_select_names_set_arg (GtkObject *o, GtkArg *arg, guint arg_id);
+static void e_select_names_get_arg (GtkObject *object, GtkArg *arg, guint arg_id);
+static void e_select_names_destroy (GtkObject *object);
static void update_query (GtkWidget *widget, ESelectNames *e_select_names);
-static void sync_table_and_models (ESelectNamesModel *triggering_model, ESelectNames *esl);
+extern EvolutionShellClient *global_shell_client;
-static GtkDialogClass *parent_class = NULL;
-#define PARENT_TYPE gtk_dialog_get_type()
+static GnomeDialogClass *parent_class = NULL;
+#define PARENT_TYPE gnome_dialog_get_type()
/* The arguments we take */
enum {
@@ -64,35 +68,33 @@ enum {
};
typedef struct {
- char *title;
- ESelectNamesModel *source;
- ESelectNamesTableModel *table_model;
- ESelectNames *names;
- GtkWidget *label;
- GtkWidget *button;
- GtkWidget *recipient_table;
- gulong changed_id;
+ char *title;
+ ESelectNamesModel *source;
+ ESelectNamesTextModel *text_model;
+ ESelectNames *names;
+ GtkWidget *label;
+ GtkWidget *button;
} ESelectNamesChild;
-GType
+GtkType
e_select_names_get_type (void)
{
- static GType type = 0;
+ static GtkType type = 0;
if (!type) {
- static const GTypeInfo info = {
- sizeof (ESelectNamesClass),
- NULL, /* base_init */
- NULL, /* base_finalize */
- (GClassInitFunc) e_select_names_class_init,
- NULL, /* class_finalize */
- NULL, /* class_data */
+ static const GtkTypeInfo info =
+ {
+ "ESelectNames",
sizeof (ESelectNames),
- 0, /* n_preallocs */
- (GInstanceInitFunc) e_select_names_init,
+ sizeof (ESelectNamesClass),
+ (GtkClassInitFunc) e_select_names_class_init,
+ (GtkObjectInitFunc) e_select_names_init,
+ /* reserved_1 */ NULL,
+ /* reserved_2 */ NULL,
+ (GtkClassInitFunc) NULL,
};
- type = g_type_register_static (PARENT_TYPE, "ESelectNames", &info, 0);
+ type = gtk_type_unique (PARENT_TYPE, &info);
}
return type;
@@ -101,34 +103,30 @@ e_select_names_get_type (void)
static void
e_select_names_class_init (ESelectNamesClass *klass)
{
- GObjectClass *object_class;
+ GtkObjectClass *object_class;
- object_class = G_OBJECT_CLASS (klass);
+ object_class = (GtkObjectClass*) klass;
- parent_class = g_type_class_peek_parent (klass);
+ parent_class = gtk_type_class (PARENT_TYPE);
- object_class->dispose = e_select_names_dispose;
+ object_class->set_arg = e_select_names_set_arg;
+ object_class->get_arg = e_select_names_get_arg;
+ object_class->destroy = e_select_names_destroy;
}
GtkWidget *e_addressbook_create_ebook_table(char *name, char *string1, char *string2, int num1, int num2);
GtkWidget *e_addressbook_create_folder_selector(char *name, char *string1, char *string2, int num1, int num2);
static void
-search_result (EAddressbookModel *model, EBookViewStatus status, ESelectNames *esn)
-{
- sync_table_and_models (NULL, esn);
-}
-
-static void
set_book(EBook *book, EBookStatus status, ESelectNames *esn)
{
- g_object_set(esn->model,
- "book", book,
- NULL);
+ gtk_object_set(GTK_OBJECT(esn->model),
+ "book", book,
+ NULL);
update_query (NULL, esn);
- g_object_unref(book);
- g_object_unref(esn->model);
- g_object_unref(esn);
+ gtk_object_unref(GTK_OBJECT(book));
+ gtk_object_unref(GTK_OBJECT(esn->model));
+ gtk_object_unref(GTK_OBJECT(esn));
}
static void
@@ -151,8 +149,8 @@ addressbook_model_set_uri(ESelectNames *e_select_names, EAddressbookModel *model
book = e_book_new();
- g_object_ref(e_select_names);
- g_object_ref(model);
+ gtk_object_ref(GTK_OBJECT(e_select_names));
+ gtk_object_ref(GTK_OBJECT(model));
addressbook_load_uri(book, book_uri, (EBookCallback) set_book, e_select_names);
g_free (book_uri);
@@ -221,7 +219,7 @@ real_add_address_cb (int model_row, gpointer closure)
e_select_names_model_append (child->source, dest);
e_select_names_model_clean (child->source, FALSE);
- g_object_unref(card);
+ gtk_object_unref(GTK_OBJECT(card));
}
}
@@ -270,7 +268,7 @@ esn_get_key_fn (ETableModel *source, int row, void *closure)
EAddressbookModel *model = E_ADDRESSBOOK_MODEL (closure);
ECard *card = e_addressbook_model_get_card (model, row);
void *key = card_key (card);
- g_object_unref (card);
+ gtk_object_unref (GTK_OBJECT (card));
return key;
}
@@ -300,13 +298,14 @@ e_addressbook_create_ebook_table(char *name, char *string1, char *string2, int n
ETableModel *without;
EAddressbookModel *model;
GtkWidget *table;
+ char *spec;
model = e_addressbook_model_new ();
adapter = E_TABLE_MODEL (e_addressbook_table_adapter_new (model));
- g_object_set(model,
- "editable", FALSE,
- NULL);
+ gtk_object_set(GTK_OBJECT(model),
+ "editable", FALSE,
+ NULL);
without = e_table_without_new (adapter,
g_str_hash,
@@ -322,9 +321,9 @@ e_addressbook_create_ebook_table(char *name, char *string1, char *string2, int n
EVOLUTION_ETSPECDIR "/e-select-names.etspec",
NULL);
- g_object_set_data(G_OBJECT(table), "adapter", adapter);
- g_object_set_data(G_OBJECT(table), "without", without);
- g_object_set_data(G_OBJECT(table), "model", model);
+ gtk_object_set_data(GTK_OBJECT(table), "adapter", adapter);
+ gtk_object_set_data(GTK_OBJECT(table), "without", without);
+ gtk_object_set_data(GTK_OBJECT(table), "model", model);
return table;
}
@@ -332,48 +331,45 @@ e_addressbook_create_ebook_table(char *name, char *string1, char *string2, int n
GtkWidget *
e_addressbook_create_folder_selector(char *name, char *string1, char *string2, int num1, int num2)
{
- return g_object_new (EVOLUTION_TYPE_FOLDER_SELECTOR_BUTTON, NULL);
+ return (GtkWidget *)gtk_type_new (EVOLUTION_TYPE_FOLDER_SELECTOR_BUTTON);
}
static void
folder_selected (EvolutionFolderSelectorButton *button, GNOME_Evolution_Folder *folder,
ESelectNames *e_select_names)
{
+ Bonobo_ConfigDatabase db;
+
addressbook_model_set_uri(e_select_names, e_select_names->model, folder->physicalUri);
- e_config_listener_set_string (e_book_get_config_database(),
- "/apps/evolution/addressbook/select_names/last_used_uri", folder->physicalUri);
+ db = addressbook_config_database (NULL);
+ bonobo_config_set_string (db, "/Addressbook/select_names_uri", folder->physicalUri, NULL);
}
static void
update_query (GtkWidget *widget, ESelectNames *e_select_names)
{
char *category = "";
- const char *search = "";
+ char *search = "";
char *query;
char *q_array[4];
int i;
- GString *s = g_string_new ("");
-
if (e_select_names->categories) {
category = e_categories_master_list_option_menu_get_category (E_CATEGORIES_MASTER_LIST_OPTION_MENU (e_select_names->categories));
}
if (e_select_names->select_entry) {
search = gtk_entry_get_text (GTK_ENTRY (e_select_names->select_entry));
}
-
- e_sexp_encode_string (s, search);
-
i = 0;
q_array[i++] = "(contains \"email\" \"\")";
if (category && *category)
q_array[i++] = g_strdup_printf ("(is \"category\" \"%s\")", category);
if (search && *search)
- q_array[i++] = g_strdup_printf ("(or (beginswith \"email\" %s) "
- " (beginswith \"full_name\" %s) "
- " (beginswith \"nickname\" %s)"
- " (beginswith \"file_as\" %s))",
- s->str, s->str, s->str, s->str);
+ q_array[i++] = g_strdup_printf ("(or (beginswith \"email\" \"%s\") "
+ " (beginswith \"full_name\" \"%s\") "
+ " (beginswith \"nickname\" \"%s\")"
+ " (beginswith \"file_as\" \"%s\"))",
+ search, search, search, search);
q_array[i++] = NULL;
if (i > 2) {
char *temp = g_strjoinv (" ", q_array);
@@ -382,27 +378,32 @@ update_query (GtkWidget *widget, ESelectNames *e_select_names)
} else {
query = g_strdup (q_array[0]);
}
- g_object_set (e_select_names->model,
- "query", query,
- NULL);
+ gtk_object_set (GTK_OBJECT (e_select_names->model),
+ "query", query,
+ NULL);
for (i = 1; q_array[i]; i++) {
g_free (q_array[i]);
}
g_free (query);
- g_string_free (s, TRUE);
}
static void
status_message (EAddressbookModel *model, const gchar *message, ESelectNames *e_select_names)
{
- if (message == NULL)
+ if (message == NULL) {
+ if (e_select_names->status_image)
+ gtk_widget_hide (e_select_names->status_image);
gtk_label_set_text (GTK_LABEL (e_select_names->status_message), "");
- else
+ }
+ else {
+ if (e_select_names->status_image)
+ gtk_widget_show (e_select_names->status_image);
gtk_label_set_text (GTK_LABEL (e_select_names->status_message), message);
+ }
}
static void
-categories_changed (GtkWidget *widget, ESelectNames *e_select_names)
+categories_changed (GtkWidget *widget, gint value, ESelectNames *e_select_names)
{
update_query (widget, e_select_names);
}
@@ -411,7 +412,7 @@ static void
select_entry_changed (GtkWidget *widget, ESelectNames *e_select_names)
{
if (e_select_names->select_entry) {
- const char *select_string = gtk_entry_get_text (GTK_ENTRY (e_select_names->select_entry));
+ char *select_string = gtk_entry_get_text (GTK_ENTRY (e_select_names->select_entry));
char *select_strcoll_string = g_utf8_collate_key (select_string, -1);
int count;
ETable *table;
@@ -428,7 +429,7 @@ select_entry_changed (GtkWidget *widget, ESelectNames *e_select_names)
E_CARD_SIMPLE_FIELD_NAME_OR_ORG,
model_row),
-1);
- if (g_utf8_collate (select_strcoll_string, row_strcoll_string) <= 0) {
+ if (strcmp (select_strcoll_string, row_strcoll_string) <= 0) {
g_free (row_strcoll_string);
break;
}
@@ -459,15 +460,15 @@ e_select_names_create_categories (gchar *name,
ecml = e_categories_master_list_wombat_new ();
option_menu = e_categories_master_list_option_menu_new (ecml);
- g_object_unref (ecml);
+ gtk_object_unref (GTK_OBJECT (ecml));
return option_menu;
}
static void
-clear_widget (gpointer data, GObject *where_object_was)
+clear_widget (GtkWidget *w, gpointer user_data)
{
- GtkWidget **widget_ref = data;
+ GtkWidget **widget_ref = user_data;
*widget_ref = NULL;
}
@@ -476,8 +477,14 @@ e_select_names_init (ESelectNames *e_select_names)
{
GladeXML *gui;
GtkWidget *widget, *button;
+ const char *selector_types[] = { "contacts/*", NULL };
+ char *filename;
+ char *contacts_uri;
+ Bonobo_ConfigDatabase db;
+
+ db = addressbook_config_database (NULL);
- gui = glade_xml_new (EVOLUTION_GLADEDIR "/select-names.glade", NULL, NULL);
+ gui = glade_xml_new (EVOLUTION_GLADEDIR "/select-names.glade", NULL);
e_select_names->gui = gui;
e_select_names->children = g_hash_table_new(g_str_hash, g_str_equal);
@@ -489,172 +496,156 @@ e_select_names_init (ESelectNames *e_select_names)
return;
}
gtk_widget_ref(widget);
- gtk_container_remove(GTK_CONTAINER(widget->parent), widget);
- gtk_box_pack_start(GTK_BOX(GTK_DIALOG(e_select_names)->vbox), widget, TRUE, TRUE, 0);
+ gtk_widget_unparent(widget);
+ gtk_box_pack_start(GTK_BOX(GNOME_DIALOG(e_select_names)->vbox), widget, TRUE, TRUE, 0);
gtk_widget_unref(widget);
- gtk_dialog_add_buttons (GTK_DIALOG (e_select_names),
- GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
- GTK_STOCK_OK, GTK_RESPONSE_OK,
- NULL);
-
- gtk_dialog_set_default_response (GTK_DIALOG (e_select_names),
- GTK_RESPONSE_OK);
-
- gtk_window_set_modal (GTK_WINDOW (e_select_names), TRUE);
+ gnome_dialog_append_buttons(GNOME_DIALOG(e_select_names),
+ GNOME_STOCK_BUTTON_OK,
+ GNOME_STOCK_BUTTON_CANCEL,
+ NULL);
+ gnome_dialog_set_default(GNOME_DIALOG(e_select_names), 0);
gtk_window_set_title(GTK_WINDOW(e_select_names), _("Select Contacts from Addressbook"));
- gtk_window_set_resizable(GTK_WINDOW(e_select_names), TRUE);
+ gtk_window_set_policy(GTK_WINDOW(e_select_names), FALSE, TRUE, FALSE);
e_select_names->table = E_TABLE_SCROLLED(glade_xml_get_widget(gui, "table-source"));
- e_select_names->model = g_object_get_data(G_OBJECT(e_select_names->table), "model");
- e_select_names->adapter = g_object_get_data(G_OBJECT(e_select_names->table), "adapter");
- e_select_names->without = g_object_get_data(G_OBJECT(e_select_names->table), "without");
- gtk_widget_show (GTK_WIDGET (e_select_names->table));
+ e_select_names->model = gtk_object_get_data(GTK_OBJECT(e_select_names->table), "model");
+ e_select_names->adapter = gtk_object_get_data(GTK_OBJECT(e_select_names->table), "adapter");
+ e_select_names->without = gtk_object_get_data(GTK_OBJECT(e_select_names->table), "without");
e_select_names->status_message = glade_xml_get_widget (gui, "status-message");
if (e_select_names->status_message && !GTK_IS_LABEL (e_select_names->status_message))
e_select_names->status_message = NULL;
if (e_select_names->status_message) {
- e_select_names->status_id = g_signal_connect (e_select_names->model, "status_message",
- G_CALLBACK (status_message), e_select_names);
- g_object_weak_ref (G_OBJECT (e_select_names->status_message), clear_widget, &e_select_names->status_message);
+ gtk_signal_connect (GTK_OBJECT (e_select_names->model), "status_message",
+ GTK_SIGNAL_FUNC (status_message), e_select_names);
+ gtk_signal_connect(GTK_OBJECT(e_select_names->status_message), "destroy",
+ GTK_SIGNAL_FUNC(clear_widget), &e_select_names->status_message);
}
-
- e_select_names->search_id = g_signal_connect (e_select_names->model,
- "search_result", G_CALLBACK (search_result),
- e_select_names);
+ e_select_names->status_image = glade_xml_get_widget (gui, "status-image");
+ gtk_widget_hide (e_select_names->status_image);
e_select_names->categories = glade_xml_get_widget (gui, "custom-categories");
if (e_select_names->categories && !E_IS_CATEGORIES_MASTER_LIST_OPTION_MENU (e_select_names->categories))
e_select_names->categories = NULL;
if (e_select_names->categories) {
- g_signal_connect(e_select_names->categories, "changed",
- G_CALLBACK(categories_changed), e_select_names);
- g_object_weak_ref (G_OBJECT (e_select_names->categories), clear_widget, &e_select_names->categories);
+ gtk_signal_connect(GTK_OBJECT(e_select_names->categories), "changed",
+ GTK_SIGNAL_FUNC(categories_changed), e_select_names);
+ gtk_signal_connect(GTK_OBJECT(e_select_names->categories), "destroy",
+ GTK_SIGNAL_FUNC(clear_widget), &e_select_names->categories);
}
- gtk_widget_show (e_select_names->categories);
e_select_names->select_entry = glade_xml_get_widget (gui, "entry-select");
if (e_select_names->select_entry && !GTK_IS_ENTRY (e_select_names->select_entry))
e_select_names->select_entry = NULL;
if (e_select_names->select_entry) {
- g_signal_connect(e_select_names->select_entry, "changed",
- G_CALLBACK(select_entry_changed), e_select_names);
- g_signal_connect(e_select_names->select_entry, "activate",
- G_CALLBACK(update_query), e_select_names);
- g_object_weak_ref (G_OBJECT (e_select_names->select_entry), clear_widget, &e_select_names->select_entry);
+ gtk_signal_connect(GTK_OBJECT(e_select_names->select_entry), "changed",
+ GTK_SIGNAL_FUNC(select_entry_changed), e_select_names);
+ gtk_signal_connect(GTK_OBJECT(e_select_names->select_entry), "activate",
+ GTK_SIGNAL_FUNC(update_query), e_select_names);
+ gtk_signal_connect(GTK_OBJECT(e_select_names->select_entry), "destroy",
+ GTK_SIGNAL_FUNC(clear_widget), &e_select_names->select_entry);
}
button = glade_xml_get_widget (gui, "button-find");
if (button && GTK_IS_BUTTON (button))
- g_signal_connect(button, "clicked",
- G_CALLBACK(update_query), e_select_names);
+ gtk_signal_connect(GTK_OBJECT(button), "clicked",
+ GTK_SIGNAL_FUNC(update_query), e_select_names);
+
+ contacts_uri = bonobo_config_get_string_with_default (db, "/Addressbook/select_names_uri",
+ NULL, NULL);
+ if (!contacts_uri) {
+ contacts_uri = bonobo_config_get_string_with_default (db, "/DefaultFolders/contacts_uri",
+ NULL,
+ NULL);
+ }
+ if (!contacts_uri) {
+ filename = gnome_util_prepend_user_home("evolution/local/Contacts");
+ contacts_uri = g_strdup_printf("file://%s", filename);
+ g_free (filename);
+ }
button = glade_xml_get_widget (gui, "folder-selector");
+ evolution_folder_selector_button_construct (EVOLUTION_FOLDER_SELECTOR_BUTTON (button),
+ global_shell_client,
+ _("Find contact in"),
+ contacts_uri,
+ selector_types);
if (button && EVOLUTION_IS_FOLDER_SELECTOR_BUTTON (button))
- g_signal_connect(button, "selected",
- G_CALLBACK(folder_selected), e_select_names);
- gtk_widget_show (button);
-
- g_signal_connect (e_table_scrolled_get_table (e_select_names->table), "double_click",
- G_CALLBACK (add_address), e_select_names);
- g_signal_connect (e_table_scrolled_get_table (e_select_names->table), "selection_change",
- G_CALLBACK (selection_change), e_select_names);
+ gtk_signal_connect(GTK_OBJECT(button), "selected",
+ GTK_SIGNAL_FUNC(folder_selected), e_select_names);
+
+ gtk_signal_connect (GTK_OBJECT (e_table_scrolled_get_table (e_select_names->table)), "double_click",
+ GTK_SIGNAL_FUNC (add_address), e_select_names);
+ gtk_signal_connect (GTK_OBJECT (e_table_scrolled_get_table (e_select_names->table)), "selection_change",
+ GTK_SIGNAL_FUNC (selection_change), e_select_names);
selection_change (e_table_scrolled_get_table (e_select_names->table), e_select_names);
+
+ addressbook_model_set_uri(e_select_names, e_select_names->model, contacts_uri);
+
+ g_free (contacts_uri);
}
static void e_select_names_child_free(char *key, ESelectNamesChild *child, ESelectNames *e_select_names)
{
- g_signal_handler_disconnect(child->source, child->changed_id);
-
+ gtk_signal_disconnect_by_func (GTK_OBJECT (child->source), GTK_SIGNAL_FUNC (sync_table_and_models), e_select_names);
g_free(child->title);
- g_object_unref(child->table_model);
- g_object_unref(child->source);
+ gtk_object_unref(GTK_OBJECT(child->text_model));
+ gtk_object_unref(GTK_OBJECT(child->source));
g_free(key);
g_free(child);
}
static void
-e_select_names_dispose (GObject *object)
+e_select_names_destroy (GtkObject *object)
{
ESelectNames *e_select_names = E_SELECT_NAMES(object);
- printf("eselectnames dispose\n");
-
- if (e_select_names->status_id) {
- g_signal_handler_disconnect(e_select_names->model, e_select_names->status_id);
- e_select_names->status_id = 0;
- }
+ gtk_object_unref(GTK_OBJECT(e_select_names->gui));
+ g_hash_table_foreach(e_select_names->children, (GHFunc) e_select_names_child_free, e_select_names);
+ g_hash_table_destroy(e_select_names->children);
+ gtk_object_unref(GTK_OBJECT(e_select_names->without));
+ gtk_object_unref(GTK_OBJECT(e_select_names->adapter));
+ gtk_object_unref(GTK_OBJECT(e_select_names->model));
- if (e_select_names->search_id) {
- g_signal_handler_disconnect(e_select_names->model, e_select_names->search_id);
- e_select_names->search_id = 0;
- }
+ g_free(e_select_names->def);
- if (e_select_names->gui) {
- g_object_unref(e_select_names->gui);
- e_select_names->gui = NULL;
- }
+ (*(GTK_OBJECT_CLASS(parent_class))->destroy)(object);
+}
- if (e_select_names->children) {
- g_hash_table_foreach(e_select_names->children, (GHFunc) e_select_names_child_free, e_select_names);
- g_hash_table_destroy(e_select_names->children);
- e_select_names->children = NULL;
- }
+GtkWidget*
+e_select_names_new (void)
+{
+ GtkWidget *widget = GTK_WIDGET (gtk_type_new (e_select_names_get_type ()));
+ return widget;
+}
- if (e_select_names->without) {
- g_object_unref(e_select_names->without);
- e_select_names->without = NULL;
- }
- if (e_select_names->adapter) {
- g_object_unref(e_select_names->adapter);
- e_select_names->adapter = NULL;
- }
- if (e_select_names->model) {
- g_object_unref(e_select_names->model);
- e_select_names->model = NULL;
- }
+static void
+e_select_names_set_arg (GtkObject *o, GtkArg *arg, guint arg_id)
+{
+ ESelectNames *editor;
- if (e_select_names->def) {
- g_free(e_select_names->def);
- e_select_names->def = NULL;
+ editor = E_SELECT_NAMES (o);
+
+ switch (arg_id){
+ default:
+ return;
}
-
- if (G_OBJECT_CLASS(parent_class)->dispose)
- G_OBJECT_CLASS(parent_class)->dispose(object);
}
-GtkWidget*
-e_select_names_new (EvolutionShellClient *shell_client)
+static void
+e_select_names_get_arg (GtkObject *object, GtkArg *arg, guint arg_id)
{
ESelectNames *e_select_names;
- const char *selector_types[] = { "contacts/*", NULL };
- char *contacts_uri;
- GtkWidget *button;
- EConfigListener *db;
-
- e_select_names = g_object_new (E_TYPE_SELECT_NAMES, NULL);
-
- db = e_book_get_config_database ();
- contacts_uri = e_config_listener_get_string_with_default (
- db, "/apps/evolution/addressbook/select_names/last_used_uri",
- NULL, NULL);
- if (!contacts_uri)
- contacts_uri = g_strdup (e_book_get_default_book_uri ());
-
- button = glade_xml_get_widget (e_select_names->gui, "folder-selector");
- evolution_folder_selector_button_construct (EVOLUTION_FOLDER_SELECTOR_BUTTON (button),
- shell_client,
- _("Find contact in"),
- contacts_uri,
- selector_types);
- addressbook_model_set_uri(e_select_names, e_select_names->model, contacts_uri);
-
- g_free (contacts_uri);
+ e_select_names = E_SELECT_NAMES (object);
- return GTK_WIDGET (e_select_names);
+ switch (arg_id) {
+ default:
+ arg->type = GTK_TYPE_INVALID;
+ break;
+ }
}
static void
@@ -663,60 +654,85 @@ button_clicked(GtkWidget *button, ESelectNamesChild *child)
real_add_address(child->names, child);
}
+#if 0
static void
remove_address(ETable *table, int row, int col, GdkEvent *event, ESelectNamesChild *child)
{
e_select_names_model_delete (child->source, row);
}
+#endif
struct _RightClickData {
ESelectNamesChild *child;
- int row;
+ int index;
};
typedef struct _RightClickData RightClickData;
+#if 0
+static GSList *selected_rows = NULL;
+
+static void
+etable_selection_foreach_cb (int row, void *data)
+{
+ /* Build a list of rows in reverse order, then remove them,
+ necessary because otherwise it'll start trying to delete
+ rows out of index in ETableModel */
+ selected_rows = g_slist_prepend (selected_rows, GINT_TO_POINTER (row));
+}
+
+static void
+selected_rows_foreach_cb (void *row, void *data)
+{
+ ESelectNamesChild *child = data;
+
+ remove_address (NULL, GPOINTER_TO_INT (row), 0, NULL, child);
+}
+#endif
+
static void
remove_cb (GtkWidget *widget, void *data)
{
RightClickData *rcdata = (RightClickData *)data;
- e_select_names_model_delete (rcdata->child->source, rcdata->row);
+ e_select_names_model_delete (rcdata->child->source, rcdata->index);
/* Free everything we've created */
g_free (rcdata);
}
static void
-section_right_click_cb (ETable *et, int row, int col, GdkEvent *ev, ESelectNamesChild *child)
+section_right_click_cb (EText *text, GdkEventButton *ev, gint pos, ESelectNamesChild *child)
{
- static EPopupMenu right_click_menu[] = {
- E_POPUP_ITEM (N_("Remove"), G_CALLBACK (remove_cb), 0),
+ EPopupMenu right_click_menu[] = {
+ E_POPUP_ITEM (N_("Remove"), GTK_SIGNAL_FUNC (remove_cb), 0),
E_POPUP_TERMINATOR
};
- RightClickData *rcdata = g_new0 (RightClickData, 1);
+ gint index;
- rcdata->row = row;
- rcdata->child = child;
+ e_select_names_model_text_pos (child->source, child->text_model->seplen, pos, &index, NULL, NULL);
- e_popup_menu_run (right_click_menu, (GdkEvent *)ev, 0, 0, rcdata);
+ if (index != -1) {
+ RightClickData *rcdata = g_new0 (RightClickData, 1);
+ rcdata->index = index;
+ rcdata->child = child;
+
+ e_popup_menu_run (right_click_menu, (GdkEvent *)ev, 0, 0, rcdata);
+ }
}
void
-e_select_names_add_section (ESelectNames *e_select_names,
- const char *name, const char *id,
- ESelectNamesModel *source)
+e_select_names_add_section(ESelectNames *e_select_names, char *name, char *id, ESelectNamesModel *source)
{
ESelectNamesChild *child;
GtkWidget *button;
- GtkWidget *label;
GtkWidget *alignment;
+ GtkWidget *label;
GtkTable *table;
char *label_text;
ETable *etable;
- ETableExtras *extras;
- ECell *string_cell;
GtkWidget *sw;
+ GtkWidget *recipient_table;
if (g_hash_table_lookup(e_select_names->children, id)) {
return;
@@ -727,34 +743,45 @@ e_select_names_add_section (ESelectNames *e_select_names,
child = g_new(ESelectNamesChild, 1);
child->names = e_select_names;
- child->title = g_strdup (_(name));
+ child->title = e_utf8_from_locale_string(_(name));
- child->table_model = (ESelectNamesTableModel*)e_select_names_table_model_new (source);
+ child->text_model = (ESelectNamesTextModel *) e_select_names_text_model_new (source);
+ e_select_names_text_model_set_separator (child->text_model, "\n");
child->source = source;
- g_object_ref(child->source);
+ gtk_object_ref(GTK_OBJECT(child->source));
e_select_names->child_count++;
alignment = gtk_alignment_new(0, 0, 1, 0);
- label_text = g_strconcat (child->title, " ->", NULL);
-
- label = gtk_label_new ("");
+ button = gtk_button_new ();
- gtk_label_set_markup (GTK_LABEL(label), label_text);
+ label = e_entry_new ();
+ gtk_object_set(GTK_OBJECT(label),
+ "draw_background", FALSE,
+ "draw_borders", FALSE,
+ "draw_button", TRUE,
+ "editable", FALSE,
+ "text", "",
+ "use_ellipsis", FALSE,
+ "justification", GTK_JUSTIFY_CENTER,
+ NULL);
+ label_text = g_strconcat (child->title, " ->", NULL);
+ gtk_object_set (GTK_OBJECT (label),
+ "text", label_text,
+ "emulate_label_resize", TRUE,
+ NULL);
g_free (label_text);
-
- button = gtk_button_new ();
gtk_container_add (GTK_CONTAINER (button), label);
child->label = label;
child->button = button;
gtk_container_add(GTK_CONTAINER(alignment), button);
gtk_widget_show_all(alignment);
- g_signal_connect(button, "clicked",
- G_CALLBACK(button_clicked), child);
+ gtk_signal_connect(GTK_OBJECT(button), "clicked",
+ GTK_SIGNAL_FUNC(button_clicked), child);
gtk_table_attach(table, alignment,
0, 1,
e_select_names->child_count,
@@ -765,37 +792,33 @@ e_select_names_add_section (ESelectNames *e_select_names,
etable = e_table_scrolled_get_table (e_select_names->table);
gtk_widget_set_sensitive (button, e_table_selected_count (etable) > 0);
- extras = e_table_extras_new ();
- string_cell = e_table_extras_get_cell (extras, "string");
-
- g_object_set (string_cell,
- "underline_column", 2,
- NULL);
-
- sw = e_table_scrolled_new_from_spec_file (E_TABLE_MODEL (child->table_model),
- extras,
- EVOLUTION_ETSPECDIR "/e-select-names-section.etspec",
- NULL);
- g_object_unref (extras);
-
- child->recipient_table = GTK_WIDGET (e_table_scrolled_get_table (E_TABLE_SCROLLED (sw)));
-
- g_signal_connect (child->recipient_table,
- "right_click",
- G_CALLBACK (section_right_click_cb),
- child);
-
- gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (sw),
- GTK_POLICY_AUTOMATIC,
- GTK_POLICY_AUTOMATIC);
- g_signal_connect(child->recipient_table, "double_click",
- G_CALLBACK(remove_address), child);
-
- child->changed_id = g_signal_connect (child->source,
- "changed",
- G_CALLBACK (sync_table_and_models),
- e_select_names);
+ sw = gtk_scrolled_window_new (NULL, NULL);
+ recipient_table = e_entry_new ();
+ gtk_object_set (GTK_OBJECT (recipient_table),
+ "model", child->text_model,
+ "allow_newlines", TRUE,
+ NULL);
+
+ gtk_signal_connect (GTK_OBJECT (recipient_table),
+ "popup",
+ GTK_SIGNAL_FUNC (section_right_click_cb),
+ child);
+
+ gtk_scrolled_window_add_with_viewport (GTK_SCROLLED_WINDOW (sw), recipient_table);
+
+#if 0
+ gtk_signal_connect(GTK_OBJECT(e_table_scrolled_get_table(E_TABLE_SCROLLED(etable))), "right_click",
+ GTK_SIGNAL_FUNC(section_right_click_cb), child);
+ gtk_signal_connect(GTK_OBJECT(e_table_scrolled_get_table(E_TABLE_SCROLLED(etable))), "double_click",
+ GTK_SIGNAL_FUNC(remove_address), child);
+#endif
+
+
+ gtk_signal_connect (GTK_OBJECT (child->source),
+ "changed",
+ GTK_SIGNAL_FUNC (sync_table_and_models),
+ e_select_names);
gtk_widget_show_all (sw);
@@ -811,6 +834,54 @@ e_select_names_add_section (ESelectNames *e_select_names,
sync_table_and_models (child->source, e_select_names);
}
+static void *
+card_copy(const void *value, void *closure)
+{
+ gtk_object_ref(GTK_OBJECT(value));
+ return (void *)value;
+}
+
+static void
+card_free(void *value, void *closure)
+{
+ gtk_object_unref(GTK_OBJECT(value));
+}
+
+EList *
+e_select_names_get_section(ESelectNames *e_select_names, char *id)
+{
+ ESelectNamesChild *child;
+ int i;
+ int rows;
+ EList *list;
+
+ child = g_hash_table_lookup(e_select_names->children, id);
+ if (!child)
+ return NULL;
+ rows = e_select_names_model_count (child->source);
+
+ list = e_list_new(card_copy, card_free, NULL);
+ for (i = 0; i < rows; i++) {
+ ECard *card = e_select_names_model_get_card (child->source, i);
+ e_list_append(list, card);
+ gtk_object_unref(GTK_OBJECT(card));
+ }
+ return list;
+}
+
+ESelectNamesModel *
+e_select_names_get_source(ESelectNames *e_select_names,
+ char *id)
+{
+ ESelectNamesChild *child = g_hash_table_lookup(e_select_names->children, id);
+ if (child) {
+ if (child->source)
+ gtk_object_ref(GTK_OBJECT(child->source));
+ return child->source;
+ } else
+ return NULL;
+}
+
void
e_select_names_set_default (ESelectNames *e_select_names,
const char *id)
@@ -819,12 +890,10 @@ e_select_names_set_default (ESelectNames *e_select_names,
if (e_select_names->def) {
child = g_hash_table_lookup(e_select_names->children, e_select_names->def);
- if (child) {
- GtkWidget *label = child->label;
-
- /* set the previous default to non-bold */
- gtk_label_set_markup (GTK_LABEL (label), child->title);
- }
+ if (child)
+ gtk_object_set (GTK_OBJECT (E_ENTRY (child->label)->item),
+ "bold", FALSE,
+ NULL);
}
g_free(e_select_names->def);
@@ -832,13 +901,9 @@ e_select_names_set_default (ESelectNames *e_select_names,
if (e_select_names->def) {
child = g_hash_table_lookup(e_select_names->children, e_select_names->def);
- if (child) {
- GtkWidget *label = child->label;
- char *markup = g_strconcat ("<b>", child->title, "</b>", NULL);
-
- /* set the new default to bold */
- gtk_label_set_markup (GTK_LABEL (label), markup);
- g_free (markup);
- }
+ if (child)
+ gtk_object_set (GTK_OBJECT (E_ENTRY (child->label)->item),
+ "bold", TRUE,
+ NULL);
}
}
diff --git a/addressbook/gui/component/select-names/e-select-names.h b/addressbook/gui/component/select-names/e-select-names.h
index 8e672da92a..b70655b932 100644
--- a/addressbook/gui/component/select-names/e-select-names.h
+++ b/addressbook/gui/component/select-names/e-select-names.h
@@ -22,15 +22,17 @@
#include <glib.h>
#include <gtk/gtkwidget.h>
-#include <gtk/gtkdialog.h>
+#include <libgnome/gnome-defs.h>
+#include <libgnome/gnome-util.h>
+#include <libgnomeui/gnome-dialog.h>
#include <glade/glade.h>
#include <gal/e-table/e-table.h>
#include <gal/e-table/e-table-scrolled.h>
-#include "evolution-shell-client.h"
-#include "e-addressbook-model.h"
+#include <addressbook/gui/widgets/e-addressbook-model.h>
#include "e-select-names-model.h"
+#include "e-util/e-list.h"
#ifdef __cplusplus
extern "C" {
@@ -45,11 +47,11 @@ extern "C" {
* --------------------------------------------------------------------------------
*/
-#define E_TYPE_SELECT_NAMES (e_select_names_get_type ())
-#define E_SELECT_NAMES(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), E_TYPE_SELECT_NAMES, ESelectNames))
-#define E_SELECT_NAMES_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), E_TYPE_SELECT_NAMES, ESelectNamesClass))
-#define E_IS_SELECT_NAMES(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), E_TYPE_SELECT_NAMES))
-#define E_IS_SELECT_NAMES_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), E_TYPE_SELECT_NAMES))
+#define E_SELECT_NAMES_TYPE (e_select_names_get_type ())
+#define E_SELECT_NAMES(obj) (GTK_CHECK_CAST ((obj), E_SELECT_NAMES_TYPE, ESelectNames))
+#define E_SELECT_NAMES_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), E_SELECT_NAMES_TYPE, ESelectNamesClass))
+#define E_IS_SELECT_NAMES(obj) (GTK_CHECK_TYPE ((obj), E_SELECT_NAMES_TYPE))
+#define E_IS_SELECT_NAMES_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((obj), E_SELECT_NAMES_TYPE))
typedef struct _ESelectNames ESelectNames;
typedef struct _ESelectNamesClass ESelectNamesClass;
@@ -57,7 +59,7 @@ typedef struct _ESelectNamesFolder ESelectNamesFolder;
struct _ESelectNames
{
- GtkDialog parent;
+ GnomeDialog parent;
/* item specific fields */
GladeXML *gui;
@@ -71,29 +73,31 @@ struct _ESelectNames
GtkWidget *categories;
GtkWidget *select_entry;
GtkWidget *status_message;
+ GtkWidget *status_image;
char *def;
ESelectNamesFolder *current_folder;
-
- /* signal handlers */
- gulong status_id;
- gulong search_id;
};
struct _ESelectNamesClass
{
- GtkDialogClass parent_class;
+ GnomeDialogClass parent_class;
};
-GtkWidget *e_select_names_new (EvolutionShellClient *shell_client);
-GType e_select_names_get_type (void);
-
-void e_select_names_add_section (ESelectNames *e_select_names,
- const char *name,
- const char *id,
- ESelectNamesModel *source);
-void e_select_names_set_default (ESelectNames *e_select_names,
- const char *id);
+GtkWidget *e_select_names_new (void);
+GtkType e_select_names_get_type (void);
+
+void e_select_names_add_section (ESelectNames *e_select_names,
+ char *name,
+ char *id,
+ ESelectNamesModel *source);
+ESelectNamesModel *e_select_names_get_source (ESelectNames *e_select_names,
+ char *id);
+void e_select_names_set_default (ESelectNames *e_select_names,
+ const char *id);
+/* Returns a ref counted list of addresses. */
+EList *e_select_names_get_section (ESelectNames *e_select_names,
+ char *id);
#ifdef __cplusplus
}
diff --git a/addressbook/gui/component/select-names/e-simple-card-bonobo.c b/addressbook/gui/component/select-names/e-simple-card-bonobo.c
index 07203618b3..35154b44a6 100644
--- a/addressbook/gui/component/select-names/e-simple-card-bonobo.c
+++ b/addressbook/gui/component/select-names/e-simple-card-bonobo.c
@@ -33,7 +33,7 @@
#include "Evolution-Addressbook-SelectNames.h"
-#define PARENT_TYPE BONOBO_TYPE_OBJECT
+#define PARENT_TYPE bonobo_object_get_type ()
static BonoboObjectClass *parent_class = NULL;
struct _ESimpleCardBonoboPrivate {
@@ -41,17 +41,45 @@ struct _ESimpleCardBonoboPrivate {
};
+/* CORBA interface implementation. */
+
+static POA_GNOME_Evolution_Addressbook_SimpleCard__vepv SimpleCard_vepv;
+
+static POA_GNOME_Evolution_Addressbook_SimpleCard *
+create_servant (void)
+{
+ POA_GNOME_Evolution_Addressbook_SimpleCard *servant;
+ CORBA_Environment ev;
+
+ servant = (POA_GNOME_Evolution_Addressbook_SimpleCard *) g_new0 (BonoboObjectServant, 1);
+ servant->vepv = &SimpleCard_vepv;
+
+ CORBA_exception_init (&ev);
+
+ POA_GNOME_Evolution_Addressbook_SimpleCard__init ((PortableServer_Servant) servant, &ev);
+ if (ev._major != CORBA_NO_EXCEPTION) {
+ g_free (servant);
+ CORBA_exception_free (&ev);
+ return NULL;
+ }
+
+ CORBA_exception_free (&ev);
+
+ return servant;
+}
static GNOME_Evolution_Addressbook_SimpleCard_Arbitrary *
impl_SimpleCard_get_arbitrary (PortableServer_Servant servant,
const CORBA_char *key,
CORBA_Environment *ev)
{
+ BonoboObject *bonobo_object;
ESimpleCardBonobo *simple_card;
ESimpleCardBonoboPrivate *priv;
GNOME_Evolution_Addressbook_SimpleCard_Arbitrary *ret_val = GNOME_Evolution_Addressbook_SimpleCard_Arbitrary__alloc ();
- simple_card = E_SIMPLE_CARD_BONOBO (bonobo_object (servant));
+ bonobo_object = bonobo_object_from_servant (servant);
+ simple_card = E_SIMPLE_CARD_BONOBO (bonobo_object);
priv = simple_card->priv;
if (priv->card_simple) {
@@ -75,10 +103,12 @@ impl_SimpleCard_set_arbitrary (PortableServer_Servant servant,
const CORBA_char *value,
CORBA_Environment *ev)
{
+ BonoboObject *bonobo_object;
ESimpleCardBonobo *simple_card;
ESimpleCardBonoboPrivate *priv;
- simple_card = E_SIMPLE_CARD_BONOBO (bonobo_object (servant));
+ bonobo_object = bonobo_object_from_servant (servant);
+ simple_card = E_SIMPLE_CARD_BONOBO (bonobo_object);
priv = simple_card->priv;
if (priv->card_simple) {
@@ -91,10 +121,12 @@ impl_SimpleCard_get (PortableServer_Servant servant,
GNOME_Evolution_Addressbook_SimpleCard_Field field,
CORBA_Environment *ev)
{
+ BonoboObject *bonobo_object;
ESimpleCardBonobo *simple_card;
ESimpleCardBonoboPrivate *priv;
- simple_card = E_SIMPLE_CARD_BONOBO (bonobo_object (servant));
+ bonobo_object = bonobo_object_from_servant (servant);
+ simple_card = E_SIMPLE_CARD_BONOBO (bonobo_object);
priv = simple_card->priv;
if (priv->card_simple) {
@@ -114,11 +146,12 @@ impl_SimpleCard_set (PortableServer_Servant servant,
const CORBA_char *value,
CORBA_Environment *ev)
{
-
+ BonoboObject *bonobo_object;
ESimpleCardBonobo *simple_card;
ESimpleCardBonoboPrivate *priv;
- simple_card = E_SIMPLE_CARD_BONOBO (bonobo_object (servant));
+ bonobo_object = bonobo_object_from_servant (servant);
+ simple_card = E_SIMPLE_CARD_BONOBO (bonobo_object);
priv = simple_card->priv;
if (priv->card_simple) {
@@ -132,7 +165,7 @@ impl_SimpleCard_set (PortableServer_Servant servant,
/* GtkObject methods. */
static void
-impl_dispose (GObject *object)
+impl_destroy (GtkObject *object)
{
ESimpleCardBonobo *simple_card;
ESimpleCardBonoboPrivate *priv;
@@ -140,40 +173,54 @@ impl_dispose (GObject *object)
simple_card = E_SIMPLE_CARD_BONOBO (object);
priv = simple_card->priv;
- if (priv) {
- if (priv->card_simple) {
- g_object_unref (priv->card_simple);
- }
-
- g_free (priv);
- simple_card->priv = NULL;
+ if (priv->card_simple) {
+ gtk_object_unref (GTK_OBJECT (priv->card_simple));
}
- if (G_OBJECT_CLASS(parent_class)->dispose)
- G_OBJECT_CLASS(parent_class)->dispose(object);
+ g_free (priv);
+
+ simple_card->priv = NULL;
}
static void
-e_simple_card_bonobo_class_init (ESimpleCardBonoboClass *klass)
+corba_class_init ()
{
- GObjectClass *object_class;
+ POA_GNOME_Evolution_Addressbook_SimpleCard__vepv *vepv;
POA_GNOME_Evolution_Addressbook_SimpleCard__epv *epv;
+ PortableServer_ServantBase__epv *base_epv;
- object_class = G_OBJECT_CLASS (klass);
- parent_class = g_type_class_ref (BONOBO_TYPE_OBJECT);
-
- object_class->dispose = impl_dispose;
+ base_epv = g_new0 (PortableServer_ServantBase__epv, 1);
+ base_epv->_private = NULL;
+ base_epv->finalize = NULL;
+ base_epv->default_POA = NULL;
- epv = &klass->epv;
+ epv = g_new0 (POA_GNOME_Evolution_Addressbook_SimpleCard__epv, 1);
epv->getArbitrary = impl_SimpleCard_get_arbitrary;
epv->setArbitrary = impl_SimpleCard_set_arbitrary;
epv->get = impl_SimpleCard_get;
epv->set = impl_SimpleCard_set;
+
+ vepv = &SimpleCard_vepv;
+ vepv->Bonobo_Unknown_epv = bonobo_object_get_epv ();
+ vepv->GNOME_Evolution_Addressbook_SimpleCard_epv = epv;
+}
+
+static void
+class_init (ESimpleCardBonoboClass *klass)
+{
+ GtkObjectClass *object_class;
+
+ object_class = GTK_OBJECT_CLASS (klass);
+ parent_class = gtk_type_class (bonobo_object_get_type ());
+
+ object_class->destroy = impl_destroy;
+
+ corba_class_init ();
}
static void
-e_simple_card_bonobo_init (ESimpleCardBonobo *simple_card)
+init (ESimpleCardBonobo *simple_card)
{
ESimpleCardBonoboPrivate *priv;
@@ -187,30 +234,36 @@ e_simple_card_bonobo_init (ESimpleCardBonobo *simple_card)
void
e_simple_card_bonobo_construct (ESimpleCardBonobo *simple_card,
+ GNOME_Evolution_Addressbook_SimpleCard corba_object,
ECardSimple *card_simple)
{
g_return_if_fail (simple_card != NULL);
g_return_if_fail (E_IS_SIMPLE_CARD_BONOBO (simple_card));
+ bonobo_object_construct (BONOBO_OBJECT (simple_card), corba_object);
+
simple_card->priv->card_simple = card_simple;
- g_object_ref (card_simple);
+ gtk_object_ref (GTK_OBJECT (card_simple));
}
ESimpleCardBonobo *
e_simple_card_bonobo_new (ECardSimple *card_simple)
{
+ POA_GNOME_Evolution_Addressbook_SimpleCard *servant;
+ GNOME_Evolution_Addressbook_SimpleCard corba_object;
ESimpleCardBonobo *simple_card;
- simple_card = g_object_new (E_TYPE_SIMPLE_CARD_BONOBO, NULL);
+ servant = create_servant ();
+ if (servant == NULL)
+ return NULL;
+
+ simple_card = gtk_type_new (e_simple_card_bonobo_get_type ());
- e_simple_card_bonobo_construct (simple_card, card_simple);
+ corba_object = bonobo_object_activate_servant (BONOBO_OBJECT (simple_card), servant);
+ e_simple_card_bonobo_construct (simple_card, corba_object, card_simple);
return simple_card;
}
-BONOBO_TYPE_FUNC_FULL (
- ESimpleCardBonobo,
- GNOME_Evolution_Addressbook_SimpleCard,
- PARENT_TYPE,
- e_simple_card_bonobo);
+E_MAKE_TYPE (e_simple_card_bonobo, "ESimpleCardBonobo", ESimpleCardBonobo, class_init, init, PARENT_TYPE)
diff --git a/addressbook/gui/component/select-names/select-names.glade b/addressbook/gui/component/select-names/select-names.glade
index 9a6b38f461..6485876fbf 100644
--- a/addressbook/gui/component/select-names/select-names.glade
+++ b/addressbook/gui/component/select-names/select-names.glade
@@ -1,451 +1,518 @@
-<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*-->
-<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd">
+<?xml version="1.0"?>
+<GTK-Interface>
-<glade-interface>
+<project>
+ <name>Select-names</name>
+ <program_name>select-names</program_name>
+ <directory></directory>
+ <source_directory>src</source_directory>
+ <pixmaps_directory>../../../../art/</pixmaps_directory>
+ <language>C</language>
+ <gnome_support>True</gnome_support>
+ <gettext_support>True</gettext_support>
+ <output_main_file>False</output_main_file>
+ <output_support_files>False</output_support_files>
+ <output_build_files>False</output_build_files>
+</project>
-<widget class="GtkDialog" id="dialog-top">
- <property name="title" translatable="yes">Select Names</property>
- <property name="type">GTK_WINDOW_TOPLEVEL</property>
- <property name="window_position">GTK_WIN_POS_NONE</property>
- <property name="modal">False</property>
- <property name="default_width">417</property>
- <property name="default_height">332</property>
- <property name="resizable">True</property>
- <property name="destroy_with_parent">False</property>
- <property name="has_separator">True</property>
+<widget>
+ <class>GnomeDialog</class>
+ <name>dialog-top</name>
+ <visible>False</visible>
+ <title>Select Names</title>
+ <type>GTK_WINDOW_TOPLEVEL</type>
+ <position>GTK_WIN_POS_NONE</position>
+ <modal>False</modal>
+ <default_width>417</default_width>
+ <default_height>332</default_height>
+ <allow_shrink>False</allow_shrink>
+ <allow_grow>True</allow_grow>
+ <auto_shrink>False</auto_shrink>
+ <auto_close>False</auto_close>
+ <hide_on_close>False</hide_on_close>
- <child internal-child="vbox">
- <widget class="GtkVBox" id="dialog-vbox1">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">3</property>
+ <widget>
+ <class>GtkVBox</class>
+ <child_name>GnomeDialog:vbox</child_name>
+ <name>dialog-vbox1</name>
+ <border_width>3</border_width>
+ <homogeneous>False</homogeneous>
+ <spacing>3</spacing>
+ <child>
+ <padding>4</padding>
+ <expand>True</expand>
+ <fill>True</fill>
+ </child>
- <child internal-child="action_area">
- <widget class="GtkHButtonBox" id="dialog-action_area1">
- <property name="visible">True</property>
- <property name="layout_style">GTK_BUTTONBOX_END</property>
+ <widget>
+ <class>GtkHButtonBox</class>
+ <child_name>GnomeDialog:action_area</child_name>
+ <name>dialog-action_area1</name>
+ <layout_style>GTK_BUTTONBOX_END</layout_style>
+ <spacing>8</spacing>
+ <child_min_width>85</child_min_width>
+ <child_min_height>27</child_min_height>
+ <child_ipad_x>7</child_ipad_x>
+ <child_ipad_y>0</child_ipad_y>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>True</fill>
+ <pack>GTK_PACK_END</pack>
+ </child>
- <child>
- <widget class="GtkButton" id="button4">
- <property name="visible">True</property>
- <property name="can_default">True</property>
- <property name="has_default">True</property>
- <property name="can_focus">True</property>
- <property name="label">gtk-ok</property>
- <property name="use_stock">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="response_id">0</property>
- </widget>
- </child>
+ <widget>
+ <class>GtkButton</class>
+ <name>button4</name>
+ <can_default>True</can_default>
+ <has_default>True</has_default>
+ <can_focus>True</can_focus>
+ <stock_button>GNOME_STOCK_BUTTON_OK</stock_button>
+ </widget>
- <child>
- <widget class="GtkButton" id="button5">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label">gtk-cancel</property>
- <property name="use_stock">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="response_id">0</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="pack_type">GTK_PACK_END</property>
- </packing>
- </child>
+ <widget>
+ <class>GtkButton</class>
+ <name>button5</name>
+ <can_focus>True</can_focus>
+ <stock_button>GNOME_STOCK_BUTTON_CANCEL</stock_button>
+ </widget>
+ </widget>
+ <widget>
+ <class>GtkTable</class>
+ <name>table-top</name>
+ <rows>3</rows>
+ <columns>1</columns>
+ <homogeneous>False</homogeneous>
+ <row_spacing>3</row_spacing>
+ <column_spacing>3</column_spacing>
<child>
- <widget class="GtkTable" id="table-top">
- <property name="visible">True</property>
- <property name="n_rows">3</property>
- <property name="n_columns">1</property>
- <property name="homogeneous">False</property>
- <property name="row_spacing">3</property>
- <property name="column_spacing">3</property>
+ <padding>0</padding>
+ <expand>True</expand>
+ <fill>True</fill>
+ </child>
- <child>
- <widget class="GtkHSeparator" id="hseparator1">
- <property name="visible">True</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="x_options"></property>
- <property name="y_options"></property>
- </packing>
- </child>
+ <widget>
+ <class>GtkHSeparator</class>
+ <name>hseparator1</name>
+ <child>
+ <left_attach>0</left_attach>
+ <right_attach>1</right_attach>
+ <top_attach>1</top_attach>
+ <bottom_attach>2</bottom_attach>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <xexpand>False</xexpand>
+ <yexpand>False</yexpand>
+ <xshrink>False</xshrink>
+ <yshrink>False</yshrink>
+ <xfill>False</xfill>
+ <yfill>False</yfill>
+ </child>
+ </widget>
- <child>
- <widget class="GtkFrame" id="frame1">
- <property name="visible">True</property>
- <property name="label_xalign">0</property>
- <property name="label_yalign">0.5</property>
- <property name="shadow_type">GTK_SHADOW_ETCHED_IN</property>
+ <widget>
+ <class>GtkFrame</class>
+ <name>frame1</name>
+ <label>Show Contacts</label>
+ <label_xalign>0</label_xalign>
+ <shadow_type>GTK_SHADOW_ETCHED_IN</shadow_type>
+ <child>
+ <left_attach>0</left_attach>
+ <right_attach>1</right_attach>
+ <top_attach>0</top_attach>
+ <bottom_attach>1</bottom_attach>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <xexpand>True</xexpand>
+ <yexpand>False</yexpand>
+ <xshrink>False</xshrink>
+ <yshrink>False</yshrink>
+ <xfill>True</xfill>
+ <yfill>False</yfill>
+ </child>
- <child>
- <widget class="GtkTable" id="table5">
- <property name="border_width">3</property>
- <property name="visible">True</property>
- <property name="n_rows">2</property>
- <property name="n_columns">2</property>
- <property name="homogeneous">False</property>
- <property name="row_spacing">3</property>
- <property name="column_spacing">3</property>
+ <widget>
+ <class>GtkTable</class>
+ <name>table5</name>
+ <border_width>3</border_width>
+ <rows>2</rows>
+ <columns>2</columns>
+ <homogeneous>False</homogeneous>
+ <row_spacing>3</row_spacing>
+ <column_spacing>3</column_spacing>
- <child>
- <widget class="GtkLabel" id="label30">
- <property name="visible">True</property>
- <property name="label" translatable="yes">_Folder:</property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
- </packing>
- </child>
+ <widget>
+ <class>GtkLabel</class>
+ <name>label30</name>
+ <label>_Folder:</label>
+ <justify>GTK_JUSTIFY_CENTER</justify>
+ <wrap>False</wrap>
+ <xalign>0</xalign>
+ <yalign>0.5</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <child>
+ <left_attach>0</left_attach>
+ <right_attach>1</right_attach>
+ <top_attach>0</top_attach>
+ <bottom_attach>1</bottom_attach>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <xexpand>False</xexpand>
+ <yexpand>False</yexpand>
+ <xshrink>False</xshrink>
+ <yshrink>False</yshrink>
+ <xfill>True</xfill>
+ <yfill>False</yfill>
+ </child>
+ </widget>
- <child>
- <widget class="GtkLabel" id="label31">
- <property name="visible">True</property>
- <property name="label" translatable="yes">_Category:</property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
- </packing>
- </child>
+ <widget>
+ <class>GtkLabel</class>
+ <name>label31</name>
+ <label>_Category:</label>
+ <justify>GTK_JUSTIFY_CENTER</justify>
+ <wrap>False</wrap>
+ <xalign>0</xalign>
+ <yalign>0.5</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <child>
+ <left_attach>0</left_attach>
+ <right_attach>1</right_attach>
+ <top_attach>1</top_attach>
+ <bottom_attach>2</bottom_attach>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <xexpand>False</xexpand>
+ <yexpand>False</yexpand>
+ <xshrink>False</xshrink>
+ <yshrink>False</yshrink>
+ <xfill>True</xfill>
+ <yfill>False</yfill>
+ </child>
+ </widget>
- <child>
- <widget class="GtkAlignment" id="alignment5">
- <property name="visible">True</property>
- <property name="xalign">7.45058e-09</property>
- <property name="yalign">0.5</property>
- <property name="xscale">0</property>
- <property name="yscale">1</property>
+ <widget>
+ <class>GtkAlignment</class>
+ <name>alignment5</name>
+ <xalign>7.45058e-09</xalign>
+ <yalign>0.5</yalign>
+ <xscale>0</xscale>
+ <yscale>1</yscale>
+ <child>
+ <left_attach>1</left_attach>
+ <right_attach>2</right_attach>
+ <top_attach>1</top_attach>
+ <bottom_attach>2</bottom_attach>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <xexpand>True</xexpand>
+ <yexpand>False</yexpand>
+ <xshrink>False</xshrink>
+ <yshrink>False</yshrink>
+ <xfill>True</xfill>
+ <yfill>True</yfill>
+ </child>
- <child>
- <widget class="Custom" id="custom-categories">
- <property name="visible">True</property>
- <property name="creation_function">e_select_names_create_categories</property>
- <property name="int1">0</property>
- <property name="int2">0</property>
- <property name="last_modification_time">Tue, 19 Feb 2002 23:06:24 GMT</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
+ <widget>
+ <class>Custom</class>
+ <name>custom-categories</name>
+ <creation_function>e_select_names_create_categories</creation_function>
+ <int1>0</int1>
+ <int2>0</int2>
+ <last_modification_time>Tue, 19 Feb 2002 23:06:24 GMT</last_modification_time>
+ </widget>
+ </widget>
- <child>
- <widget class="Custom" id="folder-selector">
- <property name="visible">True</property>
- <property name="creation_function">e_addressbook_create_folder_selector</property>
- <property name="int1">0</property>
- <property name="int2">0</property>
- <property name="last_modification_time">Mon, 15 Jul 2002 02:21:32 GMT</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
- </widget>
- </child>
+ <widget>
+ <class>Custom</class>
+ <name>folder-selector</name>
+ <creation_function>e_addressbook_create_folder_selector</creation_function>
+ <int1>0</int1>
+ <int2>0</int2>
+ <last_modification_time>Mon, 15 Jul 2002 02:21:32 GMT</last_modification_time>
+ <child>
+ <left_attach>1</left_attach>
+ <right_attach>2</right_attach>
+ <top_attach>0</top_attach>
+ <bottom_attach>1</bottom_attach>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <xexpand>False</xexpand>
+ <yexpand>False</yexpand>
+ <xshrink>False</xshrink>
+ <yshrink>False</yshrink>
+ <xfill>True</xfill>
+ <yfill>True</yfill>
+ </child>
+ </widget>
+ </widget>
+ </widget>
+ <widget>
+ <class>GtkVBox</class>
+ <name>vbox5</name>
+ <homogeneous>False</homogeneous>
+ <spacing>0</spacing>
+ <child>
+ <left_attach>0</left_attach>
+ <right_attach>1</right_attach>
+ <top_attach>1</top_attach>
+ <bottom_attach>2</bottom_attach>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <xexpand>False</xexpand>
+ <yexpand>True</yexpand>
+ <xshrink>False</xshrink>
+ <yshrink>False</yshrink>
+ <xfill>True</xfill>
+ <yfill>True</yfill>
+ </child>
+
+ <widget>
+ <class>GtkTable</class>
+ <name>table4</name>
+ <rows>2</rows>
+ <columns>2</columns>
+ <homogeneous>False</homogeneous>
+ <row_spacing>3</row_spacing>
+ <column_spacing>3</column_spacing>
+ <child>
+ <padding>0</padding>
+ <expand>True</expand>
+ <fill>True</fill>
+ </child>
+
+ <widget>
+ <class>GtkLabel</class>
+ <name>label32</name>
+ <label>Type a name into the entry, or
+select one from the list below:</label>
+ <justify>GTK_JUSTIFY_LEFT</justify>
+ <wrap>False</wrap>
+ <xalign>0</xalign>
+ <yalign>0.5</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <child>
+ <left_attach>0</left_attach>
+ <right_attach>1</right_attach>
+ <top_attach>0</top_attach>
+ <bottom_attach>1</bottom_attach>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <xexpand>False</xexpand>
+ <yexpand>False</yexpand>
+ <xshrink>False</xshrink>
+ <yshrink>False</yshrink>
+ <xfill>True</xfill>
+ <yfill>False</yfill>
+ </child>
+ </widget>
+
+ <widget>
+ <class>GtkTable</class>
+ <name>table-recipients</name>
+ <rows>5</rows>
+ <columns>2</columns>
+ <homogeneous>False</homogeneous>
+ <row_spacing>3</row_spacing>
+ <column_spacing>3</column_spacing>
+ <child>
+ <left_attach>1</left_attach>
+ <right_attach>2</right_attach>
+ <top_attach>1</top_attach>
+ <bottom_attach>2</bottom_attach>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <xexpand>True</xexpand>
+ <yexpand>True</yexpand>
+ <xshrink>False</xshrink>
+ <yshrink>False</yshrink>
+ <xfill>True</xfill>
+ <yfill>True</yfill>
+ </child>
+
+ <widget>
+ <class>GtkLabel</class>
+ <name>label20</name>
+ <label>Selected Contacts:</label>
+ <justify>GTK_JUSTIFY_CENTER</justify>
+ <wrap>True</wrap>
+ <xalign>0.5</xalign>
+ <yalign>0.5</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
<child>
- <widget class="GtkLabel" id="label1">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Show Contacts</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="type">label_item</property>
- </packing>
+ <left_attach>1</left_attach>
+ <right_attach>2</right_attach>
+ <top_attach>0</top_attach>
+ <bottom_attach>1</bottom_attach>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <xexpand>False</xexpand>
+ <yexpand>False</yexpand>
+ <xshrink>False</xshrink>
+ <yshrink>False</yshrink>
+ <xfill>True</xfill>
+ <yfill>False</yfill>
</child>
</widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="y_options"></property>
- </packing>
- </child>
+ </widget>
- <child>
- <widget class="GtkVBox" id="vbox5">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">0</property>
+ <widget>
+ <class>GtkAlignment</class>
+ <name>alignment4</name>
+ <xalign>7.45058e-09</xalign>
+ <yalign>0.5</yalign>
+ <xscale>1</xscale>
+ <yscale>1</yscale>
+ <child>
+ <left_attach>0</left_attach>
+ <right_attach>1</right_attach>
+ <top_attach>1</top_attach>
+ <bottom_attach>2</bottom_attach>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <xexpand>True</xexpand>
+ <yexpand>True</yexpand>
+ <xshrink>False</xshrink>
+ <yshrink>False</yshrink>
+ <xfill>True</xfill>
+ <yfill>True</yfill>
+ </child>
- <child>
- <widget class="GtkTable" id="table4">
- <property name="visible">True</property>
- <property name="n_rows">2</property>
- <property name="n_columns">2</property>
- <property name="homogeneous">False</property>
- <property name="row_spacing">3</property>
- <property name="column_spacing">3</property>
+ <widget>
+ <class>GtkVBox</class>
+ <name>vbox6</name>
+ <border_width>3</border_width>
+ <homogeneous>False</homogeneous>
+ <spacing>3</spacing>
- <child>
- <widget class="GtkLabel" id="label32">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Type a name into the entry, or
-select one from the list below:</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
- </packing>
- </child>
+ <widget>
+ <class>GtkHBox</class>
+ <name>hbox1</name>
+ <homogeneous>False</homogeneous>
+ <spacing>3</spacing>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
+ </child>
+ <widget>
+ <class>GtkEntry</class>
+ <name>entry-select</name>
+ <can_focus>True</can_focus>
+ <editable>True</editable>
+ <text_visible>True</text_visible>
+ <text_max_length>0</text_max_length>
+ <text></text>
<child>
- <widget class="GtkTable" id="table-recipients">
- <property name="visible">True</property>
- <property name="n_rows">1</property>
- <property name="n_columns">2</property>
- <property name="homogeneous">False</property>
- <property name="row_spacing">3</property>
- <property name="column_spacing">3</property>
-
- <child>
- <widget class="GtkLabel" id="label20">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Selected Contacts:</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">True</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- </packing>
+ <padding>0</padding>
+ <expand>True</expand>
+ <fill>True</fill>
</child>
+ </widget>
+ <widget>
+ <class>GtkButton</class>
+ <name>button-find</name>
+ <can_focus>True</can_focus>
+ <label>Find</label>
+ <relief>GTK_RELIEF_NORMAL</relief>
<child>
- <widget class="GtkAlignment" id="alignment4">
- <property name="visible">True</property>
- <property name="xalign">7.45058e-09</property>
- <property name="yalign">0.5</property>
- <property name="xscale">1</property>
- <property name="yscale">1</property>
-
- <child>
- <widget class="GtkVBox" id="vbox6">
- <property name="border_width">3</property>
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">3</property>
-
- <child>
- <widget class="GtkHBox" id="hbox1">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">3</property>
-
- <child>
- <widget class="GtkEntry" id="entry-select">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="editable">True</property>
- <property name="visibility">True</property>
- <property name="max_length">0</property>
- <property name="text" translatable="yes"></property>
- <property name="has_frame">True</property>
- <property name="invisible_char" translatable="yes">*</property>
- <property name="activates_default">False</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkButton" id="button-find">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">Find</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
+ </child>
+ </widget>
+ </widget>
- <child>
- <widget class="GtkAlignment" id="alignment3">
- <property name="visible">True</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xscale">1</property>
- <property name="yscale">1</property>
+ <widget>
+ <class>GtkAlignment</class>
+ <name>alignment3</name>
+ <xalign>0.5</xalign>
+ <yalign>0.5</yalign>
+ <xscale>1</xscale>
+ <yscale>1</yscale>
+ <child>
+ <padding>0</padding>
+ <expand>True</expand>
+ <fill>True</fill>
+ </child>
- <child>
- <widget class="Custom" id="table-source">
- <property name="visible">True</property>
- <property name="creation_function">e_addressbook_create_ebook_table</property>
- <property name="int1">0</property>
- <property name="int2">0</property>
- <property name="last_modification_time">Sat, 10 Jun 2000 22:02:57 GMT</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- </packing>
- </child>
+ <widget>
+ <class>Custom</class>
+ <name>table-source</name>
+ <creation_function>e_addressbook_create_ebook_table</creation_function>
+ <int1>0</int1>
+ <int2>0</int2>
+ <last_modification_time>Sat, 10 Jun 2000 22:02:57 GMT</last_modification_time>
</widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
+ </widget>
</widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="x_options">fill</property>
- </packing>
+ </widget>
+ </widget>
+ </widget>
+
+ <widget>
+ <class>GtkHBox</class>
+ <name>status-hbox</name>
+ <homogeneous>False</homogeneous>
+ <spacing>3</spacing>
+ <child>
+ <left_attach>0</left_attach>
+ <right_attach>1</right_attach>
+ <top_attach>2</top_attach>
+ <bottom_attach>3</bottom_attach>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <xexpand>False</xexpand>
+ <yexpand>True</yexpand>
+ <xshrink>False</xshrink>
+ <yshrink>False</yshrink>
+ <xfill>True</xfill>
+ <yfill>True</yfill>
+ </child>
+
+ <widget>
+ <class>Custom</class>
+ <name>status-image</name>
+ <visible>False</visible>
+ <creation_function>e_create_image_widget</creation_function>
+ <string1>evolution-contacts-mini.png</string1>
+ <int1>0</int1>
+ <int2>0</int2>
+ <last_modification_time>Thu, 28 Nov 2002 22:26:05 GMT</last_modification_time>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
</child>
+ </widget>
+ <widget>
+ <class>GtkLabel</class>
+ <name>status-message</name>
+ <label></label>
+ <justify>GTK_JUSTIFY_LEFT</justify>
+ <wrap>False</wrap>
+ <xalign>4.84288e-08</xalign>
+ <yalign>0.5</yalign>
+ <xpad>0</xpad>
+ <ypad>3</ypad>
<child>
- <widget class="GtkLabel" id="status-message">
- <property name="visible">True</property>
- <property name="label" translatable="yes"></property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">3</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">2</property>
- <property name="bottom_attach">3</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
- </packing>
+ <padding>0</padding>
+ <expand>True</expand>
+ <fill>True</fill>
</child>
</widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
+ </widget>
</widget>
- </child>
+ </widget>
</widget>
-</glade-interface>
+</GTK-Interface>
diff --git a/addressbook/gui/contact-editor/e-contact-editor-address.c b/addressbook/gui/contact-editor/e-contact-editor-address.c
index f6a75bbfe5..42cb190074 100644
--- a/addressbook/gui/contact-editor/e-contact-editor-address.c
+++ b/addressbook/gui/contact-editor/e-contact-editor-address.c
@@ -24,56 +24,57 @@
#include <e-contact-editor-address.h>
#include <glib.h>
+#include <libgnome/gnome-defs.h>
#include <libgnome/gnome-i18n.h>
+#include <libgnomeui/gnome-stock.h>
#include <libgnomeui/gnome-window-icon.h>
#include <libgnome/gnome-util.h>
+#include <gal/widgets/e-unicode.h>
#include <gal/widgets/e-gui-utils.h>
#include <gtk/gtkcombo.h>
-#include <gtk/gtkentry.h>
-#include <gtk/gtkstock.h>
-#include <gtk/gtklabel.h>
#include <string.h>
#include <stdlib.h>
#include <locale.h>
static void e_contact_editor_address_init (EContactEditorAddress *card);
static void e_contact_editor_address_class_init (EContactEditorAddressClass *klass);
-static void e_contact_editor_address_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec);
-static void e_contact_editor_address_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec);
-static void e_contact_editor_address_dispose (GObject *object);
+static void e_contact_editor_address_set_arg (GtkObject *o, GtkArg *arg, guint arg_id);
+static void e_contact_editor_address_get_arg (GtkObject *object, GtkArg *arg, guint arg_id);
+static void e_contact_editor_address_destroy (GtkObject *object);
static void fill_in_info(EContactEditorAddress *editor);
static void extract_info(EContactEditorAddress *editor);
-static GtkDialogClass *parent_class = NULL;
+static GnomeDialogClass *parent_class = NULL;
/* The arguments we take */
enum {
- PROP_0,
- PROP_ADDRESS,
- PROP_EDITABLE
+ ARG_0,
+ ARG_ADDRESS,
+ ARG_EDITABLE
};
-GType
+GtkType
e_contact_editor_address_get_type (void)
{
- static GType contact_editor_address_type = 0;
-
- if (!contact_editor_address_type) {
- static const GTypeInfo contact_editor_address_info = {
- sizeof (EContactEditorAddressClass),
- NULL, /* base_init */
- NULL, /* base_finalize */
- (GClassInitFunc) e_contact_editor_address_class_init,
- NULL, /* class_finalize */
- NULL, /* class_data */
- sizeof (EContactEditorAddress),
- 0, /* n_preallocs */
- (GInstanceInitFunc) e_contact_editor_address_init,
- };
-
- contact_editor_address_type = g_type_register_static (GTK_TYPE_DIALOG, "EContactEditorAddress", &contact_editor_address_info, 0);
- }
+ static GtkType contact_editor_address_type = 0;
+
+ if (!contact_editor_address_type)
+ {
+ static const GtkTypeInfo contact_editor_address_info =
+ {
+ "EContactEditorAddress",
+ sizeof (EContactEditorAddress),
+ sizeof (EContactEditorAddressClass),
+ (GtkClassInitFunc) e_contact_editor_address_class_init,
+ (GtkObjectInitFunc) e_contact_editor_address_init,
+ /* reserved_1 */ NULL,
+ /* reserved_2 */ NULL,
+ (GtkClassInitFunc) NULL,
+ };
+
+ contact_editor_address_type = gtk_type_unique (gnome_dialog_get_type (), &contact_editor_address_info);
+ }
return contact_editor_address_type;
}
@@ -81,28 +82,22 @@ e_contact_editor_address_get_type (void)
static void
e_contact_editor_address_class_init (EContactEditorAddressClass *klass)
{
- GObjectClass *object_class;
-
- object_class = G_OBJECT_CLASS (klass);
-
- parent_class = g_type_class_ref (GTK_TYPE_DIALOG);
-
- object_class->set_property = e_contact_editor_address_set_property;
- object_class->get_property = e_contact_editor_address_get_property;
- object_class->dispose = e_contact_editor_address_dispose;
-
- g_object_class_install_property (object_class, PROP_ADDRESS,
- g_param_spec_pointer ("address",
- _("Address"),
- /*_( */"XXX blurb" /*)*/,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_EDITABLE,
- g_param_spec_boolean ("editable",
- _("Editable"),
- /*_( */"XXX blurb" /*)*/,
- FALSE,
- G_PARAM_READWRITE));
+ GtkObjectClass *object_class;
+ GnomeDialogClass *dialog_class;
+
+ object_class = (GtkObjectClass*) klass;
+ dialog_class = (GnomeDialogClass *) klass;
+
+ parent_class = gtk_type_class (gnome_dialog_get_type ());
+
+ gtk_object_add_arg_type ("EContactEditorAddress::address", GTK_TYPE_POINTER,
+ GTK_ARG_READWRITE, ARG_ADDRESS);
+ gtk_object_add_arg_type ("EContactEditorAddress::editable", GTK_TYPE_BOOL,
+ GTK_ARG_READWRITE, ARG_EDITABLE);
+
+ object_class->set_arg = e_contact_editor_address_set_arg;
+ object_class->get_arg = e_contact_editor_address_get_arg;
+ object_class->destroy = e_contact_editor_address_destroy;
}
static GList *
@@ -413,16 +408,17 @@ e_contact_editor_address_init (EContactEditorAddress *e_contact_editor_address)
GtkWidget *widget;
char *icon_path;
- gtk_dialog_add_buttons (GTK_DIALOG (e_contact_editor_address),
- GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
- GTK_STOCK_OK, GTK_RESPONSE_OK,
- NULL);
+ gnome_dialog_append_button ( GNOME_DIALOG(e_contact_editor_address),
+ GNOME_STOCK_BUTTON_OK);
+
+ gnome_dialog_append_button ( GNOME_DIALOG(e_contact_editor_address),
+ GNOME_STOCK_BUTTON_CANCEL);
- gtk_window_set_resizable(GTK_WINDOW(e_contact_editor_address), TRUE);
+ gtk_window_set_policy(GTK_WINDOW(e_contact_editor_address), FALSE, TRUE, FALSE);
e_contact_editor_address->address = NULL;
- gui = glade_xml_new (EVOLUTION_GLADEDIR "/fulladdr.glade", NULL, NULL);
+ gui = glade_xml_new (EVOLUTION_GLADEDIR "/fulladdr.glade", NULL);
e_contact_editor_address->gui = gui;
setup_tab_order (gui);
@@ -433,57 +429,50 @@ e_contact_editor_address_init (EContactEditorAddress *e_contact_editor_address)
GTK_WINDOW (widget)->title);
widget = glade_xml_get_widget(gui, "table-checkaddress");
- g_object_ref(widget);
+ gtk_widget_ref(widget);
gtk_container_remove(GTK_CONTAINER(widget->parent), widget);
- gtk_box_pack_start (GTK_BOX (GTK_DIALOG (e_contact_editor_address)->vbox), widget, TRUE, TRUE, 0);
- g_object_unref(widget);
+ gtk_box_pack_start (GTK_BOX (GNOME_DIALOG (e_contact_editor_address)->vbox), widget, TRUE, TRUE, 0);
+ gtk_widget_unref(widget);
- icon_path = g_concat_dir_and_file (EVOLUTION_IMAGESDIR, "evolution-contacts-mini.png");
+ icon_path = g_concat_dir_and_file (EVOLUTION_ICONSDIR, "evolution-contacts-mini.png");
gnome_window_icon_set_from_file (GTK_WINDOW (e_contact_editor_address), icon_path);
g_free (icon_path);
}
void
-e_contact_editor_address_dispose (GObject *object)
+e_contact_editor_address_destroy (GtkObject *object)
{
EContactEditorAddress *e_contact_editor_address = E_CONTACT_EDITOR_ADDRESS(object);
- if (e_contact_editor_address->gui) {
- g_object_unref(e_contact_editor_address->gui);
- e_contact_editor_address->gui = NULL;
- }
-
- if (e_contact_editor_address->address) {
- e_card_delivery_address_unref(e_contact_editor_address->address);
- e_contact_editor_address->address = NULL;
- }
+ if (e_contact_editor_address->gui)
+ gtk_object_unref(GTK_OBJECT(e_contact_editor_address->gui));
+ e_card_delivery_address_unref(e_contact_editor_address->address);
}
GtkWidget*
e_contact_editor_address_new (const ECardDeliveryAddress *address)
{
- GtkWidget *widget = g_object_new (E_TYPE_CONTACT_EDITOR_ADDRESS, NULL);
- g_object_set (widget,
- "address", address,
- NULL);
+ GtkWidget *widget = GTK_WIDGET (gtk_type_new (e_contact_editor_address_get_type ()));
+ gtk_object_set (GTK_OBJECT(widget),
+ "address", address,
+ NULL);
return widget;
}
static void
-e_contact_editor_address_set_property (GObject *object, guint prop_id,
- const GValue *value, GParamSpec *pspec)
+e_contact_editor_address_set_arg (GtkObject *o, GtkArg *arg, guint arg_id)
{
EContactEditorAddress *e_contact_editor_address;
- e_contact_editor_address = E_CONTACT_EDITOR_ADDRESS (object);
+ e_contact_editor_address = E_CONTACT_EDITOR_ADDRESS (o);
- switch (prop_id){
- case PROP_ADDRESS:
+ switch (arg_id){
+ case ARG_ADDRESS:
e_card_delivery_address_unref(e_contact_editor_address->address);
- e_contact_editor_address->address = e_card_delivery_address_copy(g_value_get_pointer (value));
+ e_contact_editor_address->address = e_card_delivery_address_copy(GTK_VALUE_POINTER (*arg));
fill_in_info(e_contact_editor_address);
break;
- case PROP_EDITABLE: {
+ case ARG_EDITABLE: {
int i;
char *widget_names[] = {
"entry-street",
@@ -502,16 +491,16 @@ e_contact_editor_address_set_property (GObject *object, guint prop_id,
"label-code",
NULL
};
- e_contact_editor_address->editable = g_value_get_boolean (value) ? TRUE : FALSE;
+ e_contact_editor_address->editable = GTK_VALUE_BOOL (*arg) ? TRUE : FALSE;
for (i = 0; widget_names[i] != NULL; i ++) {
GtkWidget *w = glade_xml_get_widget(e_contact_editor_address->gui, widget_names[i]);
if (GTK_IS_ENTRY (w)) {
- gtk_editable_set_editable (GTK_EDITABLE (w),
- e_contact_editor_address->editable);
+ gtk_entry_set_editable (GTK_ENTRY (w),
+ e_contact_editor_address->editable);
}
else if (GTK_IS_COMBO (w)) {
- gtk_editable_set_editable (GTK_EDITABLE (GTK_COMBO (w)->entry),
- e_contact_editor_address->editable);
+ gtk_entry_set_editable (GTK_ENTRY (GTK_COMBO (w)->entry),
+ e_contact_editor_address->editable);
gtk_widget_set_sensitive (GTK_COMBO (w)->button, e_contact_editor_address->editable);
}
else if (GTK_IS_LABEL (w)) {
@@ -520,30 +509,26 @@ e_contact_editor_address_set_property (GObject *object, guint prop_id,
}
break;
}
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
- break;
}
}
static void
-e_contact_editor_address_get_property (GObject *object, guint prop_id,
- GValue *value, GParamSpec *pspec)
+e_contact_editor_address_get_arg (GtkObject *object, GtkArg *arg, guint arg_id)
{
EContactEditorAddress *e_contact_editor_address;
e_contact_editor_address = E_CONTACT_EDITOR_ADDRESS (object);
- switch (prop_id) {
- case PROP_ADDRESS:
+ switch (arg_id) {
+ case ARG_ADDRESS:
extract_info(e_contact_editor_address);
- g_value_set_pointer (value, e_card_delivery_address_ref(e_contact_editor_address->address));
+ GTK_VALUE_POINTER (*arg) = e_card_delivery_address_ref(e_contact_editor_address->address);
break;
- case PROP_EDITABLE:
- g_value_set_boolean (value, e_contact_editor_address->editable ? TRUE : FALSE);
+ case ARG_EDITABLE:
+ GTK_VALUE_BOOL (*arg) = e_contact_editor_address->editable ? TRUE : FALSE;
break;
default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+ arg->type = GTK_TYPE_INVALID;
break;
}
}
@@ -551,12 +536,9 @@ e_contact_editor_address_get_property (GObject *object, guint prop_id,
static void
fill_in_field(EContactEditorAddress *editor, char *field, char *string)
{
- GtkEntry *entry = GTK_ENTRY(glade_xml_get_widget(editor->gui, field));
- if (entry) {
- if (string)
- gtk_entry_set_text(entry, string);
- else
- gtk_entry_set_text(entry, "");
+ GtkEditable *editable = GTK_EDITABLE(glade_xml_get_widget(editor->gui, field));
+ if (editable) {
+ e_utf8_gtk_editable_set_text(editable, string);
}
}
@@ -578,9 +560,9 @@ fill_in_info(EContactEditorAddress *editor)
static char *
extract_field(EContactEditorAddress *editor, char *field)
{
- GtkEntry *entry = GTK_ENTRY(glade_xml_get_widget(editor->gui, field));
- if (entry)
- return g_strdup (gtk_entry_get_text(entry));
+ GtkEditable *editable = GTK_EDITABLE(glade_xml_get_widget(editor->gui, field));
+ if (editable)
+ return e_utf8_gtk_editable_get_text(editable);
else
return NULL;
}
diff --git a/addressbook/gui/contact-editor/e-contact-editor-fullname.c b/addressbook/gui/contact-editor/e-contact-editor-fullname.c
index 917a8fd075..faf382c729 100644
--- a/addressbook/gui/contact-editor/e-contact-editor-fullname.c
+++ b/addressbook/gui/contact-editor/e-contact-editor-fullname.c
@@ -20,53 +20,52 @@
*/
#include <config.h>
+#include <libgnomeui/gnome-stock.h>
+#include <gal/widgets/e-unicode.h>
#include "e-contact-editor-fullname.h"
#include <libgnomeui/gnome-window-icon.h>
#include <libgnome/gnome-util.h>
-#include <libgnome/gnome-i18n.h>
#include <gtk/gtkcombo.h>
-#include <gtk/gtkstock.h>
-#include <gtk/gtkentry.h>
-#include <gtk/gtklabel.h>
static void e_contact_editor_fullname_init (EContactEditorFullname *card);
static void e_contact_editor_fullname_class_init (EContactEditorFullnameClass *klass);
-static void e_contact_editor_fullname_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec);
-static void e_contact_editor_fullname_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec);
-static void e_contact_editor_fullname_dispose (GObject *object);
+static void e_contact_editor_fullname_set_arg (GtkObject *o, GtkArg *arg, guint arg_id);
+static void e_contact_editor_fullname_get_arg (GtkObject *object, GtkArg *arg, guint arg_id);
+static void e_contact_editor_fullname_destroy (GtkObject *object);
static void fill_in_info(EContactEditorFullname *editor);
static void extract_info(EContactEditorFullname *editor);
-static GtkDialogClass *parent_class = NULL;
+static GnomeDialogClass *parent_class = NULL;
/* The arguments we take */
enum {
- PROP_0,
- PROP_NAME,
- PROP_EDITABLE
+ ARG_0,
+ ARG_NAME,
+ ARG_EDITABLE
};
-GType
+GtkType
e_contact_editor_fullname_get_type (void)
{
- static GType contact_editor_fullname_type = 0;
-
- if (!contact_editor_fullname_type) {
- static const GTypeInfo contact_editor_fullname_info = {
- sizeof (EContactEditorFullnameClass),
- NULL, /* base_init */
- NULL, /* base_finalize */
- (GClassInitFunc) e_contact_editor_fullname_class_init,
- NULL, /* class_finalize */
- NULL, /* class_data */
- sizeof (EContactEditorFullname),
- 0, /* n_preallocs */
- (GInstanceInitFunc) e_contact_editor_fullname_init,
- };
-
- contact_editor_fullname_type = g_type_register_static (GTK_TYPE_DIALOG, "EContactEditorFullname", &contact_editor_fullname_info, 0);
- }
+ static GtkType contact_editor_fullname_type = 0;
+
+ if (!contact_editor_fullname_type)
+ {
+ static const GtkTypeInfo contact_editor_fullname_info =
+ {
+ "EContactEditorFullname",
+ sizeof (EContactEditorFullname),
+ sizeof (EContactEditorFullnameClass),
+ (GtkClassInitFunc) e_contact_editor_fullname_class_init,
+ (GtkObjectInitFunc) e_contact_editor_fullname_init,
+ /* reserved_1 */ NULL,
+ /* reserved_2 */ NULL,
+ (GtkClassInitFunc) NULL,
+ };
+
+ contact_editor_fullname_type = gtk_type_unique (gnome_dialog_get_type (), &contact_editor_fullname_info);
+ }
return contact_editor_fullname_type;
}
@@ -74,28 +73,23 @@ e_contact_editor_fullname_get_type (void)
static void
e_contact_editor_fullname_class_init (EContactEditorFullnameClass *klass)
{
- GObjectClass *object_class;
+ GtkObjectClass *object_class;
+ GnomeDialogClass *dialog_class;
- object_class = G_OBJECT_CLASS (klass);
+ object_class = (GtkObjectClass*) klass;
+ dialog_class = (GnomeDialogClass *) klass;
- parent_class = g_type_class_ref (GTK_TYPE_DIALOG);
+ parent_class = gtk_type_class (gnome_dialog_get_type ());
- object_class->set_property = e_contact_editor_fullname_set_property;
- object_class->get_property = e_contact_editor_fullname_get_property;
- object_class->dispose = e_contact_editor_fullname_dispose;
+ gtk_object_add_arg_type ("EContactEditorFullname::name", GTK_TYPE_POINTER,
+ GTK_ARG_READWRITE, ARG_NAME);
- g_object_class_install_property (object_class, PROP_NAME,
- g_param_spec_pointer ("name",
- _("Name"),
- /*_( */"XXX blurb" /*)*/,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_EDITABLE,
- g_param_spec_boolean ("editable",
- _("Editable"),
- /*_( */"XXX blurb" /*)*/,
- FALSE,
- G_PARAM_READWRITE));
+ gtk_object_add_arg_type ("EContactEditorFullname::editable", GTK_TYPE_BOOL,
+ GTK_ARG_READWRITE, ARG_EDITABLE);
+
+ object_class->set_arg = e_contact_editor_fullname_set_arg;
+ object_class->get_arg = e_contact_editor_fullname_get_arg;
+ object_class->destroy = e_contact_editor_fullname_destroy;
}
static void
@@ -105,15 +99,16 @@ e_contact_editor_fullname_init (EContactEditorFullname *e_contact_editor_fullnam
GtkWidget *widget;
char *icon_path;
- gtk_dialog_add_buttons (GTK_DIALOG (e_contact_editor_fullname),
- GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
- GTK_STOCK_OK, GTK_RESPONSE_OK,
- NULL);
+ gnome_dialog_append_button ( GNOME_DIALOG(e_contact_editor_fullname),
+ GNOME_STOCK_BUTTON_OK);
+
+ gnome_dialog_append_button ( GNOME_DIALOG(e_contact_editor_fullname),
+ GNOME_STOCK_BUTTON_CANCEL);
- gtk_window_set_resizable(GTK_WINDOW(e_contact_editor_fullname), TRUE);
+ gtk_window_set_policy(GTK_WINDOW(e_contact_editor_fullname), TRUE, TRUE, FALSE);
e_contact_editor_fullname->name = NULL;
- gui = glade_xml_new (EVOLUTION_GLADEDIR "/fullname.glade", NULL, NULL);
+ gui = glade_xml_new (EVOLUTION_GLADEDIR "/fullname.glade", NULL);
e_contact_editor_fullname->gui = gui;
widget = glade_xml_get_widget(gui, "dialog-checkfullname");
@@ -121,57 +116,50 @@ e_contact_editor_fullname_init (EContactEditorFullname *e_contact_editor_fullnam
GTK_WINDOW (widget)->title);
widget = glade_xml_get_widget(gui, "table-checkfullname");
- g_object_ref(widget);
+ gtk_widget_ref(widget);
gtk_container_remove(GTK_CONTAINER(widget->parent), widget);
- gtk_box_pack_start (GTK_BOX (GTK_DIALOG (e_contact_editor_fullname)->vbox), widget, TRUE, TRUE, 0);
- g_object_unref(widget);
+ gtk_box_pack_start (GTK_BOX (GNOME_DIALOG (e_contact_editor_fullname)->vbox), widget, TRUE, TRUE, 0);
+ gtk_widget_unref(widget);
- icon_path = g_concat_dir_and_file (EVOLUTION_IMAGESDIR, "evolution-contacts-mini.png");
+ icon_path = g_concat_dir_and_file (EVOLUTION_ICONSDIR, "evolution-contacts-mini.png");
gnome_window_icon_set_from_file (GTK_WINDOW (e_contact_editor_fullname), icon_path);
g_free (icon_path);
}
void
-e_contact_editor_fullname_dispose (GObject *object)
+e_contact_editor_fullname_destroy (GtkObject *object)
{
EContactEditorFullname *e_contact_editor_fullname = E_CONTACT_EDITOR_FULLNAME(object);
- if (e_contact_editor_fullname->gui) {
- g_object_unref(e_contact_editor_fullname->gui);
- e_contact_editor_fullname->gui = NULL;
- }
-
- if (e_contact_editor_fullname->name) {
- e_card_name_unref(e_contact_editor_fullname->name);
- e_contact_editor_fullname->name = NULL;
- }
+ if (e_contact_editor_fullname->gui)
+ gtk_object_unref(GTK_OBJECT(e_contact_editor_fullname->gui));
+ e_card_name_unref(e_contact_editor_fullname->name);
}
GtkWidget*
e_contact_editor_fullname_new (const ECardName *name)
{
- GtkWidget *widget = g_object_new (E_TYPE_CONTACT_EDITOR_FULLNAME, NULL);
- g_object_set (widget,
+ GtkWidget *widget = GTK_WIDGET (gtk_type_new (e_contact_editor_fullname_get_type ()));
+ gtk_object_set (GTK_OBJECT(widget),
"name", name,
NULL);
return widget;
}
static void
-e_contact_editor_fullname_set_property (GObject *object, guint prop_id,
- const GValue *value, GParamSpec *pspec)
+e_contact_editor_fullname_set_arg (GtkObject *o, GtkArg *arg, guint arg_id)
{
EContactEditorFullname *e_contact_editor_fullname;
- e_contact_editor_fullname = E_CONTACT_EDITOR_FULLNAME (object);
+ e_contact_editor_fullname = E_CONTACT_EDITOR_FULLNAME (o);
- switch (prop_id){
- case PROP_NAME:
+ switch (arg_id){
+ case ARG_NAME:
e_card_name_unref(e_contact_editor_fullname->name);
- e_contact_editor_fullname->name = e_card_name_copy(g_value_get_pointer (value));
+ e_contact_editor_fullname->name = e_card_name_copy(GTK_VALUE_POINTER (*arg));
fill_in_info(e_contact_editor_fullname);
break;
- case PROP_EDITABLE: {
+ case ARG_EDITABLE: {
int i;
char *widget_names[] = {
"combo-title",
@@ -186,16 +174,17 @@ e_contact_editor_fullname_set_property (GObject *object, guint prop_id,
"label-last",
NULL
};
- e_contact_editor_fullname->editable = g_value_get_boolean (value) ? TRUE : FALSE;
+
+ e_contact_editor_fullname->editable = GTK_VALUE_BOOL (*arg) ? TRUE : FALSE;
for (i = 0; widget_names[i] != NULL; i ++) {
GtkWidget *w = glade_xml_get_widget(e_contact_editor_fullname->gui, widget_names[i]);
if (GTK_IS_ENTRY (w)) {
- gtk_editable_set_editable (GTK_EDITABLE (w),
- e_contact_editor_fullname->editable);
+ gtk_entry_set_editable (GTK_ENTRY (w),
+ e_contact_editor_fullname->editable);
}
else if (GTK_IS_COMBO (w)) {
- gtk_editable_set_editable (GTK_EDITABLE (GTK_COMBO (w)->entry),
- e_contact_editor_fullname->editable);
+ gtk_entry_set_editable (GTK_ENTRY (GTK_COMBO (w)->entry),
+ e_contact_editor_fullname->editable);
gtk_widget_set_sensitive (GTK_COMBO (w)->button, e_contact_editor_fullname->editable);
}
else if (GTK_IS_LABEL (w)) {
@@ -204,30 +193,26 @@ e_contact_editor_fullname_set_property (GObject *object, guint prop_id,
}
break;
}
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
- break;
}
}
static void
-e_contact_editor_fullname_get_property (GObject *object, guint prop_id,
- GValue *value, GParamSpec *pspec)
+e_contact_editor_fullname_get_arg (GtkObject *object, GtkArg *arg, guint arg_id)
{
EContactEditorFullname *e_contact_editor_fullname;
e_contact_editor_fullname = E_CONTACT_EDITOR_FULLNAME (object);
- switch (prop_id) {
- case PROP_NAME:
+ switch (arg_id) {
+ case ARG_NAME:
extract_info(e_contact_editor_fullname);
- g_value_set_pointer (value, e_card_name_ref(e_contact_editor_fullname->name));
+ GTK_VALUE_POINTER (*arg) = e_card_name_ref(e_contact_editor_fullname->name);
break;
- case PROP_EDITABLE:
- g_value_set_boolean (value, e_contact_editor_fullname->editable ? TRUE : FALSE);
+ case ARG_EDITABLE:
+ GTK_VALUE_BOOL (*arg) = e_contact_editor_fullname->editable ? TRUE : FALSE;
break;
default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+ arg->type = GTK_TYPE_INVALID;
break;
}
}
@@ -238,7 +223,7 @@ fill_in_field(EContactEditorFullname *editor, char *field, char *string)
GtkEntry *entry = GTK_ENTRY(glade_xml_get_widget(editor->gui, field));
if (entry) {
if (string)
- gtk_entry_set_text(entry, string);
+ e_utf8_gtk_entry_set_text(entry, string);
else
gtk_entry_set_text(entry, "");
}
@@ -262,7 +247,7 @@ extract_field(EContactEditorFullname *editor, char *field)
{
GtkEntry *entry = GTK_ENTRY(glade_xml_get_widget(editor->gui, field));
if (entry)
- return g_strdup (gtk_entry_get_text(entry));
+ return e_utf8_gtk_entry_get_text(entry);
else
return NULL;
}
diff --git a/addressbook/gui/contact-editor/e-contact-editor.c b/addressbook/gui/contact-editor/e-contact-editor.c
index 3450c307aa..8d6a5782d1 100644
--- a/addressbook/gui/contact-editor/e-contact-editor.c
+++ b/addressbook/gui/contact-editor/e-contact-editor.c
@@ -23,26 +23,24 @@
#include "e-contact-editor.h"
-#include <string.h>
#include <time.h>
#include <gtk/gtkcheckbutton.h>
#include <gtk/gtkcheckmenuitem.h>
#include <gtk/gtkcombo.h>
-#include <gtk/gtktextview.h>
-#include <gtk/gtkmessagedialog.h>
-#include <gtk/gtkstock.h>
-#include <gtk/gtkentry.h>
-#include <gtk/gtklabel.h>
+#include <gtk/gtktext.h>
#include <libgnomeui/gnome-popup-menu.h>
+#include <libgnomeui/gnome-dialog-util.h>
#include <libgnomeui/gnome-window-icon.h>
+#include <libgnomeui/gnome-stock.h>
#include <libgnome/gnome-i18n.h>
#include <bonobo/bonobo-ui-container.h>
#include <bonobo/bonobo-ui-util.h>
-#include <bonobo/bonobo-window.h>
#include <gdk-pixbuf/gdk-pixbuf.h>
+#include <gdk-pixbuf/gnome-canvas-pixbuf.h>
#include <gal/widgets/e-categories.h>
#include <gal/widgets/e-gui-utils.h>
+#include <gal/widgets/e-unicode.h>
#include <gal/e-text/e-entry.h>
#include <e-util/e-categories-master-list-wombat.h>
@@ -52,14 +50,12 @@
#include "addressbook/gui/widgets/e-addressbook-util.h"
#include "e-util/e-gui-utils.h"
#include "widgets/misc/e-dateedit.h"
-#include "widgets/misc/e-url-entry.h"
#include "shell/evolution-shell-component-utils.h"
#include "e-card-merging.h"
#include "e-contact-editor-address.h"
#include "e-contact-editor-fullname.h"
-#include "e-contact-editor-marshal.h"
#include "e-contact-save-as.h"
/* Signal IDs */
@@ -73,10 +69,13 @@ enum {
static void e_contact_editor_init (EContactEditor *card);
static void e_contact_editor_class_init (EContactEditorClass *klass);
-static void e_contact_editor_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec);
-static void e_contact_editor_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec);
-static void e_contact_editor_dispose (GObject *object);
+static void e_contact_editor_set_arg (GtkObject *o, GtkArg *arg, guint arg_id);
+static void e_contact_editor_get_arg (GtkObject *object, GtkArg *arg, guint arg_id);
+static void e_contact_editor_destroy (GtkObject *object);
+#if 0
+static GtkWidget *e_contact_editor_build_dialog(EContactEditor *editor, gchar *entry_id, gchar *label_id, gchar *title, GList **list, GnomeUIInfo **info);
+#endif
static void _email_arrow_pressed (GtkWidget *widget, GdkEventButton *button, EContactEditor *editor);
static void _phone_arrow_pressed (GtkWidget *widget, GdkEventButton *button, EContactEditor *editor);
static void _address_arrow_pressed (GtkWidget *widget, GdkEventButton *button, EContactEditor *editor);
@@ -99,13 +98,13 @@ static guint contact_editor_signals[LAST_SIGNAL];
/* The arguments we take */
enum {
- PROP_0,
- PROP_BOOK,
- PROP_CARD,
- PROP_IS_NEW_CARD,
- PROP_EDITABLE,
- PROP_CHANGED,
- PROP_WRITABLE_FIELDS
+ ARG_0,
+ ARG_BOOK,
+ ARG_CARD,
+ ARG_IS_NEW_CARD,
+ ARG_EDITABLE,
+ ARG_CHANGED,
+ ARG_WRITABLE_FIELDS
};
enum {
@@ -116,152 +115,150 @@ enum {
static GSList *all_contact_editors = NULL;
-GType
+GtkType
e_contact_editor_get_type (void)
{
- static GType contact_editor_type = 0;
-
- if (!contact_editor_type) {
- static const GTypeInfo contact_editor_info = {
- sizeof (EContactEditorClass),
- NULL, /* base_init */
- NULL, /* base_finalize */
- (GClassInitFunc) e_contact_editor_class_init,
- NULL, /* class_finalize */
- NULL, /* class_data */
- sizeof (EContactEditor),
- 0, /* n_preallocs */
- (GInstanceInitFunc) e_contact_editor_init,
- };
+ static GtkType contact_editor_type = 0;
- contact_editor_type = g_type_register_static (GTK_TYPE_OBJECT, "EContactEditor", &contact_editor_info, 0);
- }
+ if (!contact_editor_type)
+ {
+ static const GtkTypeInfo contact_editor_info =
+ {
+ "EContactEditor",
+ sizeof (EContactEditor),
+ sizeof (EContactEditorClass),
+ (GtkClassInitFunc) e_contact_editor_class_init,
+ (GtkObjectInitFunc) e_contact_editor_init,
+ /* reserved_1 */ NULL,
+ /* reserved_2 */ NULL,
+ (GtkClassInitFunc) NULL,
+ };
+
+ contact_editor_type = gtk_type_unique (GTK_TYPE_OBJECT, &contact_editor_info);
+ }
+
+ return contact_editor_type;
+}
- return contact_editor_type;
+typedef void (*GtkSignal_NONE__INT_OBJECT) (GtkObject * object,
+ gint arg1,
+ GtkObject *arg2,
+ gpointer user_data);
+
+static void
+e_marshal_NONE__INT_OBJECT (GtkObject * object,
+ GtkSignalFunc func,
+ gpointer func_data, GtkArg * args)
+{
+ GtkSignal_NONE__INT_OBJECT rfunc;
+ rfunc = (GtkSignal_NONE__INT_OBJECT) func;
+ (*rfunc) (object,
+ GTK_VALUE_INT (args[0]),
+ GTK_VALUE_OBJECT (args[1]),
+ func_data);
}
static void
e_contact_editor_class_init (EContactEditorClass *klass)
{
- GObjectClass *object_class = G_OBJECT_CLASS (klass);
-
- parent_class = g_type_class_ref (GTK_TYPE_OBJECT);
-
- object_class->set_property = e_contact_editor_set_property;
- object_class->get_property = e_contact_editor_get_property;
- object_class->dispose = e_contact_editor_dispose;
-
- g_object_class_install_property (object_class, PROP_BOOK,
- g_param_spec_object ("book",
- _("Book"),
- /*_( */"XXX blurb" /*)*/,
- E_TYPE_BOOK,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_CARD,
- g_param_spec_object ("card",
- _("Card"),
- /*_( */"XXX blurb" /*)*/,
- E_TYPE_CARD,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_IS_NEW_CARD,
- g_param_spec_boolean ("is_new_card",
- _("Is New Card"),
- /*_( */"XXX blurb" /*)*/,
- FALSE,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_WRITABLE_FIELDS,
- g_param_spec_object ("writable_fields",
- _("Writable Fields"),
- /*_( */"XXX blurb" /*)*/,
- E_TYPE_LIST,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_EDITABLE,
- g_param_spec_boolean ("editable",
- _("Editable"),
- /*_( */"XXX blurb" /*)*/,
- FALSE,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_CHANGED,
- g_param_spec_boolean ("changed",
- _("Changed"),
- /*_( */"XXX blurb" /*)*/,
- FALSE,
- G_PARAM_READWRITE));
+ GtkObjectClass *object_class;
+
+ object_class = (GtkObjectClass*) klass;
+
+ parent_class = gtk_type_class (GTK_TYPE_OBJECT);
+
+ gtk_object_add_arg_type ("EContactEditor::book", GTK_TYPE_OBJECT,
+ GTK_ARG_READWRITE, ARG_BOOK);
+ gtk_object_add_arg_type ("EContactEditor::card", GTK_TYPE_OBJECT,
+ GTK_ARG_READWRITE, ARG_CARD);
+ gtk_object_add_arg_type ("EContactEditor::is_new_card", GTK_TYPE_BOOL,
+ GTK_ARG_READWRITE, ARG_IS_NEW_CARD);
+ gtk_object_add_arg_type ("EContactEditor::writable_fields", GTK_TYPE_POINTER,
+ GTK_ARG_READWRITE, ARG_WRITABLE_FIELDS);
+ gtk_object_add_arg_type ("EContactEditor::editable", GTK_TYPE_BOOL,
+ GTK_ARG_READWRITE, ARG_EDITABLE);
+ gtk_object_add_arg_type ("EContactEditor::changed", GTK_TYPE_BOOL,
+ GTK_ARG_READWRITE, ARG_CHANGED);
contact_editor_signals[CARD_ADDED] =
- g_signal_new ("card_added",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_FIRST,
- G_STRUCT_OFFSET (EContactEditorClass, card_added),
- NULL, NULL,
- ece_marshal_NONE__INT_OBJECT,
- G_TYPE_NONE, 2,
- G_TYPE_INT, G_TYPE_OBJECT);
+ gtk_signal_new ("card_added",
+ GTK_RUN_FIRST,
+ object_class->type,
+ GTK_SIGNAL_OFFSET (EContactEditorClass, card_added),
+ e_marshal_NONE__INT_OBJECT,
+ GTK_TYPE_NONE, 2,
+ GTK_TYPE_INT, GTK_TYPE_OBJECT);
contact_editor_signals[CARD_MODIFIED] =
- g_signal_new ("card_modified",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_FIRST,
- G_STRUCT_OFFSET (EContactEditorClass, card_modified),
- NULL, NULL,
- ece_marshal_NONE__INT_OBJECT,
- G_TYPE_NONE, 2,
- G_TYPE_INT, G_TYPE_OBJECT);
+ gtk_signal_new ("card_modified",
+ GTK_RUN_FIRST,
+ object_class->type,
+ GTK_SIGNAL_OFFSET (EContactEditorClass, card_modified),
+ e_marshal_NONE__INT_OBJECT,
+ GTK_TYPE_NONE, 2,
+ GTK_TYPE_INT, GTK_TYPE_OBJECT);
contact_editor_signals[CARD_DELETED] =
- g_signal_new ("card_deleted",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_FIRST,
- G_STRUCT_OFFSET (EContactEditorClass, card_deleted),
- NULL, NULL,
- ece_marshal_NONE__INT_OBJECT,
- G_TYPE_NONE, 2,
- G_TYPE_INT, G_TYPE_OBJECT);
+ gtk_signal_new ("card_deleted",
+ GTK_RUN_FIRST,
+ object_class->type,
+ GTK_SIGNAL_OFFSET (EContactEditorClass, card_deleted),
+ e_marshal_NONE__INT_OBJECT,
+ GTK_TYPE_NONE, 2,
+ GTK_TYPE_INT, GTK_TYPE_OBJECT);
contact_editor_signals[EDITOR_CLOSED] =
- g_signal_new ("editor_closed",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_FIRST,
- G_STRUCT_OFFSET (EContactEditorClass, editor_closed),
- NULL, NULL,
- ece_marshal_NONE__NONE,
- G_TYPE_NONE, 0);
+ gtk_signal_new ("editor_closed",
+ GTK_RUN_FIRST,
+ object_class->type,
+ GTK_SIGNAL_OFFSET (EContactEditorClass, editor_closed),
+ gtk_marshal_NONE__NONE,
+ GTK_TYPE_NONE, 0);
+
+ gtk_object_class_add_signals (object_class, contact_editor_signals, LAST_SIGNAL);
+
+ object_class->set_arg = e_contact_editor_set_arg;
+ object_class->get_arg = e_contact_editor_get_arg;
+ object_class->destroy = e_contact_editor_destroy;
}
static void
-connect_arrow_button_signal (EContactEditor *editor, gchar *button_xml, GCallback func)
+_replace_button(EContactEditor *editor, gchar *button_xml, gchar *image, GtkSignalFunc func)
{
GladeXML *gui = editor->gui;
GtkWidget *button = glade_xml_get_widget(gui, button_xml);
+ GtkWidget *pixmap;
+ gchar *image_temp;
if (button && GTK_IS_BUTTON(button)) {
- g_signal_connect(button, "button_press_event", func, editor);
+ image_temp = g_strdup_printf("%s/%s", EVOLUTIONDIR, image);
+ pixmap = e_create_image_widget(NULL, image_temp, NULL, 0, 0);
+ gtk_container_add(GTK_CONTAINER(button),
+ pixmap);
+ g_free(image_temp);
+ gtk_widget_show(pixmap);
+ gtk_signal_connect(GTK_OBJECT(button), "button_press_event", func, editor);
}
}
static void
-connect_arrow_button_signals (EContactEditor *editor)
+_replace_buttons(EContactEditor *editor)
{
- connect_arrow_button_signal(editor, "button-phone1", G_CALLBACK (_phone_arrow_pressed));
- connect_arrow_button_signal(editor, "button-phone2", G_CALLBACK (_phone_arrow_pressed));
- connect_arrow_button_signal(editor, "button-phone3", G_CALLBACK (_phone_arrow_pressed));
- connect_arrow_button_signal(editor, "button-phone4", G_CALLBACK (_phone_arrow_pressed));
- connect_arrow_button_signal(editor, "button-address", G_CALLBACK (_address_arrow_pressed));
- connect_arrow_button_signal(editor, "button-email1", G_CALLBACK (_email_arrow_pressed));
+ _replace_button(editor, "button-phone1", "arrow.png", _phone_arrow_pressed);
+ _replace_button(editor, "button-phone2", "arrow.png", _phone_arrow_pressed);
+ _replace_button(editor, "button-phone3", "arrow.png", _phone_arrow_pressed);
+ _replace_button(editor, "button-phone4", "arrow.png", _phone_arrow_pressed);
+ _replace_button(editor, "button-address", "arrow.png", _address_arrow_pressed);
+ _replace_button(editor, "button-email1", "arrow.png", _email_arrow_pressed);
}
static void
wants_html_changed (GtkWidget *widget, EContactEditor *editor)
{
gboolean wants_html;
- g_object_get (widget,
+ gtk_object_get(GTK_OBJECT(widget),
"active", &wants_html,
NULL);
- g_object_set (editor->card,
+ gtk_object_set(GTK_OBJECT(editor->card),
"wants_html", wants_html,
NULL);
@@ -286,7 +283,7 @@ phone_entry_changed (GtkWidget *widget, EContactEditor *editor)
} else
return;
phone = e_card_phone_new();
- phone->number = g_strdup (gtk_entry_get_text(entry));
+ phone->number = e_utf8_gtk_entry_get_text(entry);
e_card_simple_set_phone(editor->simple, editor->phone_choice[which - 1], phone);
e_card_phone_unref(phone);
set_fields(editor);
@@ -297,21 +294,23 @@ phone_entry_changed (GtkWidget *widget, EContactEditor *editor)
static void
email_entry_changed (GtkWidget *widget, EContactEditor *editor)
{
- const gchar *string;
+ gchar *string;
GtkEntry *entry = GTK_ENTRY(widget);
- string = gtk_entry_get_text(entry);
+ string = e_utf8_gtk_entry_get_text(entry);
e_card_simple_set_email(editor->simple, editor->email_choice, string);
+ g_free (string);
+
widget_changed (widget, editor);
}
static void
-address_text_changed (GtkTextBuffer *buffer, EContactEditor *editor)
+address_text_changed (GtkWidget *widget, EContactEditor *editor)
{
+ GtkEditable *editable = GTK_EDITABLE(widget);
ECardAddrLabel *address;
- GtkTextIter start_iter, end_iter;
if (editor->address_choice == -1)
return;
@@ -325,35 +324,26 @@ address_text_changed (GtkTextBuffer *buffer, EContactEditor *editor)
check = glade_xml_get_widget(editor->gui, "checkbutton-mailingaddress");
if (check && GTK_IS_CHECK_BUTTON (check)) {
- g_signal_handlers_block_matched (check,
- G_SIGNAL_MATCH_DATA,
- 0, 0,
- NULL, NULL, editor);
+ gtk_signal_handler_block_by_data (GTK_OBJECT (check), editor);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (check), TRUE);
- g_signal_handlers_unblock_matched (check,
- G_SIGNAL_MATCH_DATA,
- 0, 0,
- NULL, NULL, editor);
+ gtk_signal_handler_unblock_by_data (GTK_OBJECT (check), editor);
}
}
- gtk_text_buffer_get_start_iter (GTK_TEXT_BUFFER (buffer), &start_iter);
- gtk_text_buffer_get_end_iter (GTK_TEXT_BUFFER (buffer), &end_iter);
-
- address->data = gtk_text_buffer_get_text (GTK_TEXT_BUFFER (buffer), &start_iter, &end_iter, FALSE);
+ address->data = e_utf8_gtk_editable_get_chars(editable, 0, -1);
e_card_simple_set_address(editor->simple, editor->address_choice, address);
e_card_address_label_unref(address);
- widget_changed (NULL, editor);
+ widget_changed (widget, editor);
}
static void
address_mailing_changed (GtkWidget *widget, EContactEditor *editor)
{
- const ECardDeliveryAddress *curr;
- ECardDeliveryAddress *address;
+ ECardAddrLabel *address;
+ GtkWidget *text;
gboolean mailing_address;
if (editor->address_choice == -1)
@@ -362,31 +352,32 @@ address_mailing_changed (GtkWidget *widget, EContactEditor *editor)
mailing_address = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget));
/* Mark the current address as the mailing address */
- curr = e_card_simple_get_delivery_address (editor->simple,
- editor->address_choice);
-
- address = e_card_delivery_address_copy (curr);
-
- if (mailing_address)
- address->flags |= E_CARD_ADDR_DEFAULT;
- else
- address->flags &= ~E_CARD_ADDR_DEFAULT;
+ text = glade_xml_get_widget(editor->gui, "text-address");
+ if (text && GTK_IS_TEXT(text)) {
- e_card_simple_set_delivery_address(editor->simple, editor->address_choice, address);
- e_card_delivery_address_unref (address);
+ address = e_card_address_label_new();
+
+ if (mailing_address)
+ address->flags |= E_CARD_ADDR_DEFAULT;
+ else
+ address->flags &= ~E_CARD_ADDR_DEFAULT;
+ address->data = e_utf8_gtk_editable_get_chars(GTK_EDITABLE (text), 0, -1);
+
+ e_card_simple_set_address(editor->simple, editor->address_choice, address);
+ e_card_address_label_unref(address);
+ }
/* Unset the previous mailing address flag */
if (mailing_address && editor->address_mailing != -1) {
- const ECardDeliveryAddress *curr;
+ const ECardAddrLabel *curr;
- curr = e_card_simple_get_delivery_address(editor->simple,
- editor->address_mailing);
- address = e_card_delivery_address_copy (curr);
+ curr = e_card_simple_get_address(editor->simple,
+ editor->address_mailing);
+ address = e_card_address_label_copy (curr);
address->flags &= ~E_CARD_ADDR_DEFAULT;
- e_card_simple_set_delivery_address(editor->simple,
- editor->address_mailing,
- address);
- e_card_delivery_address_unref (address);
+ e_card_simple_set_address(editor->simple,
+ editor->address_mailing,
+ address);
}
/* Remember the new mailing address */
@@ -493,7 +484,7 @@ file_as_get_style (EContactEditor *editor)
if (!(file_as && GTK_IS_ENTRY(file_as)))
return -1;
- filestring = g_strdup (gtk_entry_get_text(file_as));
+ filestring = e_utf8_gtk_entry_get_text(file_as);
style = -1;
for (i = 0; i < 5; i++) {
@@ -523,7 +514,7 @@ file_as_set_style(EContactEditor *editor, int style)
return;
if (style == -1) {
- string = g_strdup (gtk_entry_get_text(file_as));
+ string = e_utf8_gtk_entry_get_text(file_as);
strings = g_list_append(strings, string);
}
@@ -533,7 +524,9 @@ file_as_set_style(EContactEditor *editor, int style)
if (style_makes_sense(editor->name, editor->company, i)) {
char *u;
u = name_to_style(editor->name, editor->company, i);
- if (u) strings = g_list_append(strings, u);
+ string = e_utf8_to_gtk_string (widget, u);
+ g_free (u);
+ if (string) strings = g_list_append(strings, string);
}
}
@@ -546,7 +539,7 @@ file_as_set_style(EContactEditor *editor, int style)
if (style != -1) {
string = name_to_style(editor->name, editor->company, style);
- gtk_entry_set_text(file_as, string);
+ e_utf8_gtk_entry_set_text(file_as, string);
g_free(string);
}
}
@@ -555,14 +548,15 @@ static void
name_entry_changed (GtkWidget *widget, EContactEditor *editor)
{
int style = 0;
- const char *string;
+ char *string;
style = file_as_get_style(editor);
e_card_name_unref(editor->name);
- string = gtk_entry_get_text (GTK_ENTRY(widget));
+ string = e_utf8_gtk_entry_get_text (GTK_ENTRY(widget));
editor->name = e_card_name_from_string(string);
+ g_free (string);
file_as_set_style(editor, style);
@@ -578,7 +572,7 @@ company_entry_changed (GtkWidget *widget, EContactEditor *editor)
g_free(editor->company);
- editor->company = g_strdup (gtk_entry_get_text(GTK_ENTRY(widget)));
+ editor->company = e_utf8_gtk_entry_get_text(GTK_ENTRY(widget));
file_as_set_style(editor, style);
@@ -599,17 +593,8 @@ set_entry_changed_signal_phone(EContactEditor *editor, char *id)
{
GtkWidget *widget = glade_xml_get_widget(editor->gui, id);
if (widget && GTK_IS_ENTRY(widget))
- g_signal_connect(widget, "changed",
- G_CALLBACK (phone_entry_changed), editor);
-}
-
-static void
-set_entry_changed_signal_email(EContactEditor *editor, char *id)
-{
- GtkWidget *widget = glade_xml_get_widget(editor->gui, id);
- if (widget && GTK_IS_ENTRY(widget))
- g_signal_connect(widget, "changed",
- G_CALLBACK (email_entry_changed), editor);
+ gtk_signal_connect(GTK_OBJECT(widget), "changed",
+ phone_entry_changed, editor);
}
static void
@@ -631,19 +616,8 @@ set_entry_changed_signal_field(EContactEditor *editor, char *id)
{
GtkWidget *widget = glade_xml_get_widget(editor->gui, id);
if (widget && GTK_IS_ENTRY(widget))
- g_signal_connect(widget, "changed",
- G_CALLBACK (field_changed), editor);
-}
-
-static void
-set_urlentry_changed_signal_field (EContactEditor *editor, char *id)
-{
- GtkWidget *widget = glade_xml_get_widget(editor->gui, id);
- if (widget && E_IS_URL_ENTRY(widget)) {
- GtkWidget *entry = e_url_entry_get_entry (E_URL_ENTRY (widget));
- g_signal_connect (entry, "changed",
- G_CALLBACK (field_changed), editor);
- }
+ gtk_signal_connect(GTK_OBJECT(widget), "changed",
+ field_changed, editor);
}
static void
@@ -654,80 +628,122 @@ set_entry_changed_signals(EContactEditor *editor)
set_entry_changed_signal_phone(editor, "entry-phone2");
set_entry_changed_signal_phone(editor, "entry-phone3");
set_entry_changed_signal_phone(editor, "entry-phone4");
-
- set_entry_changed_signal_email(editor, "entry-email1");
-
+ widget = glade_xml_get_widget(editor->gui, "entry-email1");
+ if (widget && GTK_IS_ENTRY(widget)) {
+ gtk_signal_connect(GTK_OBJECT(widget), "changed",
+ email_entry_changed, editor);
+ }
widget = glade_xml_get_widget(editor->gui, "text-address");
- if (widget && GTK_IS_TEXT_VIEW(widget)) {
- GtkTextBuffer *buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (widget));
- g_signal_connect(buffer, "changed",
- G_CALLBACK (address_text_changed), editor);
+ if (widget && GTK_IS_TEXT(widget)) {
+ gtk_signal_connect(GTK_OBJECT(widget), "changed",
+ address_text_changed, editor);
}
-
widget = glade_xml_get_widget(editor->gui, "entry-fullname");
if (widget && GTK_IS_ENTRY(widget)) {
- g_signal_connect (widget, "changed",
- G_CALLBACK (name_entry_changed), editor);
+ gtk_signal_connect(GTK_OBJECT(widget), "changed",
+ name_entry_changed, editor);
}
-
widget = glade_xml_get_widget(editor->gui, "entry-company");
if (widget && GTK_IS_ENTRY(widget)) {
- g_signal_connect (widget, "changed",
- G_CALLBACK (company_entry_changed), editor);
+ gtk_signal_connect(GTK_OBJECT(widget), "changed",
+ company_entry_changed, editor);
+ }
+ widget = glade_xml_get_widget(editor->gui, "entry-web");
+ if (widget && GTK_IS_ENTRY(widget)) {
+ gtk_signal_connect(GTK_OBJECT(widget), "changed",
+ widget_changed, editor);
+ }
+ widget = glade_xml_get_widget(editor->gui, "entry-categories");
+ if (widget && GTK_IS_ENTRY(widget)) {
+ gtk_signal_connect(GTK_OBJECT(widget), "changed",
+ widget_changed, editor);
+ }
+ widget = glade_xml_get_widget(editor->gui, "entry-jobtitle");
+ if (widget && GTK_IS_ENTRY(widget)) {
+ gtk_signal_connect(GTK_OBJECT(widget), "changed",
+ widget_changed, editor);
+ }
+ widget = glade_xml_get_widget(editor->gui, "entry-file-as");
+ if (widget && GTK_IS_ENTRY(widget)) {
+ gtk_signal_connect(GTK_OBJECT(widget), "changed",
+ widget_changed, editor);
+ }
+ widget = glade_xml_get_widget(editor->gui, "entry-manager");
+ if (widget && GTK_IS_ENTRY(widget)) {
+ gtk_signal_connect(GTK_OBJECT(widget), "changed",
+ widget_changed, editor);
+ }
+ widget = glade_xml_get_widget(editor->gui, "entry-assistant");
+ if (widget && GTK_IS_ENTRY(widget)) {
+ gtk_signal_connect(GTK_OBJECT(widget), "changed",
+ widget_changed, editor);
+ }
+ widget = glade_xml_get_widget(editor->gui, "entry-office");
+ if (widget && GTK_IS_ENTRY(widget)) {
+ gtk_signal_connect(GTK_OBJECT(widget), "changed",
+ widget_changed, editor);
+ }
+ widget = glade_xml_get_widget(editor->gui, "entry-department");
+ if (widget && GTK_IS_ENTRY(widget)) {
+ gtk_signal_connect(GTK_OBJECT(widget), "changed",
+ widget_changed, editor);
+ }
+ widget = glade_xml_get_widget(editor->gui, "entry-profession");
+ if (widget && GTK_IS_ENTRY(widget)) {
+ gtk_signal_connect(GTK_OBJECT(widget), "changed",
+ widget_changed, editor);
+ }
+ widget = glade_xml_get_widget(editor->gui, "entry-nickname");
+ if (widget && GTK_IS_ENTRY(widget)) {
+ gtk_signal_connect(GTK_OBJECT(widget), "changed",
+ widget_changed, editor);
+ }
+ widget = glade_xml_get_widget(editor->gui, "entry-spouse");
+ if (widget && GTK_IS_ENTRY(widget)) {
+ gtk_signal_connect(GTK_OBJECT(widget), "changed",
+ widget_changed, editor);
}
-
- set_urlentry_changed_signal_field (editor, "entry-web");
- set_urlentry_changed_signal_field (editor, "entry-caluri");
- set_urlentry_changed_signal_field (editor, "entry-fburl");
-
- set_entry_changed_signal_field(editor, "entry-categories");
- set_entry_changed_signal_field(editor, "entry-jobtitle");
- set_entry_changed_signal_field(editor, "entry-file-as");
- set_entry_changed_signal_field(editor, "entry-manager");
- set_entry_changed_signal_field(editor, "entry-assistant");
- set_entry_changed_signal_field(editor, "entry-office");
- set_entry_changed_signal_field(editor, "entry-department");
- set_entry_changed_signal_field(editor, "entry-profession");
- set_entry_changed_signal_field(editor, "entry-nickname");
- set_entry_changed_signal_field(editor, "entry-spouse");
-
widget = glade_xml_get_widget(editor->gui, "text-comments");
- if (widget && GTK_IS_TEXT_VIEW(widget)) {
- GtkTextBuffer *buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (widget));
- g_signal_connect (buffer, "changed",
- G_CALLBACK (widget_changed), editor);
+ if (widget && GTK_IS_TEXT(widget)) {
+ gtk_signal_connect(GTK_OBJECT(widget), "changed",
+ widget_changed, editor);
}
widget = glade_xml_get_widget(editor->gui, "dateedit-birthday");
if (widget && E_IS_DATE_EDIT(widget)) {
- g_signal_connect (widget, "changed",
- G_CALLBACK (widget_changed), editor);
+ gtk_signal_connect(GTK_OBJECT(widget), "changed",
+ widget_changed, editor);
}
widget = glade_xml_get_widget(editor->gui, "dateedit-anniversary");
if (widget && E_IS_DATE_EDIT(widget)) {
- g_signal_connect (widget, "changed",
- G_CALLBACK (widget_changed), editor);
+ gtk_signal_connect(GTK_OBJECT(widget), "changed",
+ widget_changed, editor);
+ }
+ widget = glade_xml_get_widget(editor->gui, "entry-web");
+ if (widget && GTK_IS_ENTRY(widget)) {
+ gtk_signal_connect(GTK_OBJECT(widget), "changed",
+ widget_changed, editor);
}
+
}
static void
full_name_clicked(GtkWidget *button, EContactEditor *editor)
{
- GtkDialog *dialog = GTK_DIALOG(e_contact_editor_fullname_new(editor->name));
+ GnomeDialog *dialog = GNOME_DIALOG(e_contact_editor_fullname_new(editor->name));
int result;
- g_object_set (dialog,
+ gtk_object_set (GTK_OBJECT (dialog),
"editable", editor->fullname_editable,
NULL);
gtk_widget_show(GTK_WIDGET(dialog));
- result = gtk_dialog_run (dialog);
- gtk_widget_hide (GTK_WIDGET (dialog));
+ result = gnome_dialog_run (dialog);
- if (editor->fullname_editable && result == GTK_RESPONSE_OK) {
+ if (editor->fullname_editable && result == 0) {
ECardName *name;
GtkWidget *fname_widget;
int style = 0;
- g_object_get (dialog,
+ gtk_object_get(GTK_OBJECT(dialog),
"name", &name,
NULL);
@@ -736,7 +752,7 @@ full_name_clicked(GtkWidget *button, EContactEditor *editor)
fname_widget = glade_xml_get_widget(editor->gui, "entry-fullname");
if (fname_widget && GTK_IS_ENTRY(fname_widget)) {
char *full_name = e_card_name_to_string(name);
- gtk_entry_set_text(GTK_ENTRY(fname_widget), full_name);
+ e_utf8_gtk_entry_set_text(GTK_ENTRY(fname_widget), full_name);
g_free(full_name);
}
@@ -745,116 +761,137 @@ full_name_clicked(GtkWidget *button, EContactEditor *editor)
file_as_set_style(editor, style);
}
- gtk_widget_destroy (GTK_WIDGET (dialog));
+ gtk_object_unref(GTK_OBJECT(dialog));
}
static void
full_addr_clicked(GtkWidget *button, EContactEditor *editor)
{
- GtkDialog *dialog;
+ GnomeDialog *dialog;
int result;
const ECardDeliveryAddress *address;
address = e_card_simple_get_delivery_address(editor->simple, editor->address_choice);
- dialog = GTK_DIALOG(e_contact_editor_address_new(address));
- g_object_set (dialog,
- "editable", editor->address_editable[editor->address_choice],
- NULL);
+ dialog = GNOME_DIALOG(e_contact_editor_address_new(address));
+ gtk_object_set (GTK_OBJECT (dialog),
+ "editable", editor->address_editable[editor->address_choice],
+ NULL);
gtk_widget_show(GTK_WIDGET(dialog));
- result = gtk_dialog_run (dialog);
-
- gtk_widget_hide (GTK_WIDGET (dialog));
-
- if (editor->address_editable[editor->address_choice] && result == GTK_RESPONSE_OK) {
+ result = gnome_dialog_run (dialog);
+ if (editor->address_editable[editor->address_choice] && result == 0) {
ECardDeliveryAddress *new_address;
GtkWidget *address_widget;
- int saved_choice = editor->address_choice;
- editor->address_choice = -1;
-
- g_object_get (dialog,
+ gtk_object_get(GTK_OBJECT(dialog),
"address", &new_address,
NULL);
address_widget = glade_xml_get_widget(editor->gui, "text-address");
- if (address_widget && GTK_IS_TEXT_VIEW(address_widget)) {
- GtkTextBuffer *buffer;
- GtkTextIter start_iter, end_iter;
+ if (address_widget && GTK_IS_EDITABLE(address_widget)) {
char *string = e_card_delivery_address_to_string(new_address);
-
- buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (address_widget));
-
- gtk_text_buffer_get_start_iter (buffer, &start_iter);
- gtk_text_buffer_get_end_iter (buffer, &end_iter);
-
- gtk_text_buffer_delete (buffer, &start_iter, &end_iter);
-
- gtk_text_buffer_insert (buffer, &start_iter, string, strlen (string));
-
+ e_utf8_gtk_editable_set_text(GTK_EDITABLE(address_widget), string);
g_free(string);
+ } else {
+ ECardAddrLabel *address = e_card_delivery_address_to_label(new_address);
+ e_card_simple_set_address(editor->simple, editor->address_choice, address);
+ e_card_address_label_unref(address);
}
- editor->address_choice = saved_choice;
-
e_card_simple_set_delivery_address(editor->simple, editor->address_choice, new_address);
e_card_delivery_address_unref(new_address);
}
- gtk_widget_destroy (GTK_WIDGET (dialog));
+ gtk_object_unref(GTK_OBJECT(dialog));
}
static void
categories_clicked(GtkWidget *button, EContactEditor *editor)
{
char *categories = NULL;
- GtkDialog *dialog;
+ GnomeDialog *dialog;
int result;
GtkWidget *entry = glade_xml_get_widget(editor->gui, "entry-categories");
ECategoriesMasterList *ecml;
if (entry && GTK_IS_ENTRY(entry))
- categories = g_strdup (gtk_entry_get_text(GTK_ENTRY(entry)));
+ categories = e_utf8_gtk_entry_get_text(GTK_ENTRY(entry));
else if (editor->card)
- g_object_get (editor->card,
+ gtk_object_get(GTK_OBJECT(editor->card),
"categories", &categories,
NULL);
- dialog = GTK_DIALOG(e_categories_new(categories));
+ dialog = GNOME_DIALOG(e_categories_new(categories));
if (dialog == NULL) {
- GtkWidget *uh_oh = gtk_message_dialog_new (NULL,
- 0, GTK_MESSAGE_ERROR,
- GTK_RESPONSE_OK,
- _("Category editor not available."));
- g_free (categories);
+ GtkWidget *uh_oh = gnome_error_dialog (_("Category editor not available."));
gtk_widget_show (uh_oh);
return;
}
ecml = e_categories_master_list_wombat_new ();
- g_object_set (dialog,
+ gtk_object_set(GTK_OBJECT(dialog),
"header", _("This contact belongs to these categories:"),
"ecml", ecml,
NULL);
- g_object_unref (ecml);
+ gtk_object_unref (GTK_OBJECT (ecml));
gtk_widget_show(GTK_WIDGET(dialog));
- result = gtk_dialog_run (dialog);
+ result = gnome_dialog_run (dialog);
g_free (categories);
- if (result == GTK_RESPONSE_OK) {
- g_object_get (dialog,
+ if (result == 0) {
+ gtk_object_get(GTK_OBJECT(dialog),
"categories", &categories,
NULL);
if (entry && GTK_IS_ENTRY(entry))
- gtk_entry_set_text(GTK_ENTRY(entry), categories);
+ e_utf8_gtk_entry_set_text(GTK_ENTRY(entry), categories);
else
- g_object_set (editor->card,
+ gtk_object_set(GTK_OBJECT(editor->card),
"categories", categories,
NULL);
g_free(categories);
}
- gtk_widget_destroy(GTK_WIDGET(dialog));
+ gtk_object_destroy(GTK_OBJECT(dialog));
+}
+
+static void
+ensure_select_names_contact (EContactEditor *editor)
+{
+ if (editor->select_names_contacts == NULL) {
+ editor->select_names_contacts = e_select_names_manager_new ();
+ e_select_names_manager_add_section (editor->select_names_contacts,
+ "contacts",
+ "Related Contacts");
+ }
+
+ set_entry_changed_signal_field(editor, "entry-caluri");
+ set_entry_changed_signal_field(editor, "entry-fburl");
}
+static void
+contacts_clicked (GtkWidget *button, EContactEditor *editor)
+{
+ ensure_select_names_contact (editor);
+ e_select_names_manager_activate_dialog (editor->select_names_contacts,
+ "contacts");
+}
+
+static void
+add_lists (EContactEditor *editor)
+{
+ GtkWidget *table = glade_xml_get_widget (editor->gui, "table-contacts");
+ if (table && GTK_IS_TABLE (table)) {
+ GtkWidget *entry;
+
+ ensure_select_names_contact (editor);
+ entry = e_select_names_manager_create_entry (editor->select_names_contacts,
+ "contacts");
+ gtk_signal_connect(GTK_OBJECT(entry), "changed",
+ widget_changed, editor);
+ gtk_table_attach_defaults (GTK_TABLE (table), entry, 0, 1, 0, 1);
+ gtk_widget_show (entry);
+ }
+}
+
+
typedef struct {
EContactEditor *ce;
gboolean should_close;
@@ -871,8 +908,8 @@ card_added_cb (EBook *book, EBookStatus status, const char *id, EditorCloseStruc
e_card_set_id (ce->card, id);
- g_signal_emit (ce, contact_editor_signals[CARD_ADDED], 0,
- status, ce->card);
+ gtk_signal_emit (GTK_OBJECT (ce), contact_editor_signals[CARD_ADDED],
+ status, ce->card);
if (status == E_BOOK_STATUS_SUCCESS) {
ce->is_new_card = FALSE;
@@ -886,7 +923,7 @@ card_added_cb (EBook *book, EBookStatus status, const char *id, EditorCloseStruc
}
}
- g_object_unref (ce);
+ gtk_object_unref (GTK_OBJECT (ce));
g_free (ecs);
}
@@ -899,8 +936,8 @@ card_modified_cb (EBook *book, EBookStatus status, EditorCloseStruct *ecs)
gtk_widget_set_sensitive (ce->app, TRUE);
ce->in_async_call = FALSE;
- g_signal_emit (ce, contact_editor_signals[CARD_MODIFIED], 0,
- status, ce->card);
+ gtk_signal_emit (GTK_OBJECT (ce), contact_editor_signals[CARD_MODIFIED],
+ status, ce->card);
if (status == E_BOOK_STATUS_SUCCESS) {
if (should_close) {
@@ -912,7 +949,7 @@ card_modified_cb (EBook *book, EBookStatus status, EditorCloseStruct *ecs)
}
}
- g_object_unref (ce);
+ gtk_object_unref (GTK_OBJECT (ce));
g_free (ecs);
}
@@ -927,7 +964,7 @@ save_card (EContactEditor *ce, gboolean should_close)
EditorCloseStruct *ecs = g_new(EditorCloseStruct, 1);
ecs->ce = ce;
- g_object_ref (ecs->ce);
+ gtk_object_ref (GTK_OBJECT (ecs->ce));
ecs->should_close = should_close;
@@ -935,9 +972,9 @@ save_card (EContactEditor *ce, gboolean should_close)
ce->in_async_call = TRUE;
if (ce->is_new_card)
- e_card_merging_book_add_card (ce->book, ce->card, (EBookIdCallback)card_added_cb, ecs);
+ e_card_merging_book_add_card (ce->book, ce->card, GTK_SIGNAL_FUNC(card_added_cb), ecs);
else
- e_card_merging_book_commit_card (ce->book, ce->card, (EBookCallback)card_modified_cb, ecs);
+ e_card_merging_book_commit_card (ce->book, ce->card, GTK_SIGNAL_FUNC(card_modified_cb), ecs);
}
}
@@ -948,7 +985,7 @@ close_dialog (EContactEditor *ce)
if (ce->app != NULL) {
gtk_widget_destroy (ce->app);
ce->app = NULL;
- g_signal_emit (ce, contact_editor_signals[EDITOR_CLOSED], 0);
+ gtk_signal_emit (GTK_OBJECT (ce), contact_editor_signals[EDITOR_CLOSED]);
}
}
@@ -959,12 +996,12 @@ prompt_to_save_changes (EContactEditor *editor)
return TRUE;
switch (e_addressbook_prompt_save_dialog (GTK_WINDOW(editor->app))) {
- case GTK_RESPONSE_YES:
+ case 0: /* Save */
save_card (editor, FALSE);
return TRUE;
- case GTK_RESPONSE_NO:
+ case 1: /* Discard */
return TRUE;
- case GTK_RESPONSE_CANCEL:
+ case 2: /* Cancel */
default:
return FALSE;
}
@@ -1022,7 +1059,7 @@ file_send_as_cb (GtkWidget *widget, gpointer data)
e_card_simple_sync_card (ce->simple);
card = ce->card;
- e_addressbook_send_card(card, E_ADDRESSBOOK_DISPOSITION_AS_ATTACHMENT);
+ e_card_send(card, E_CARD_DISPOSITION_AS_ATTACHMENT);
}
static void
@@ -1037,38 +1074,27 @@ file_send_to_cb (GtkWidget *widget, gpointer data)
e_card_simple_sync_card (ce->simple);
card = ce->card;
- e_addressbook_send_card(card, E_ADDRESSBOOK_DISPOSITION_AS_TO);
+ e_card_send(card, E_CARD_DISPOSITION_AS_TO);
}
gboolean
-e_contact_editor_confirm_delete (GtkWindow *parent)
-{
- GtkWidget *dialog;
- gint result;
-
- dialog = gtk_message_dialog_new (parent,
- 0,
- GTK_MESSAGE_QUESTION,
- GTK_BUTTONS_NONE,
-#if notyet
- /* XXX we really need to handle the plural case here.. */
- (plural
- ? _("Are you sure you want\n"
- "to delete these contacts?"))
-#endif
- _("Are you sure you want\n"
- "to delete this contact?"));
+e_contact_editor_confirm_delete(GtkWindow *parent)
+{
+ GnomeDialog *dialog;
+ GladeXML *gui;
+ int result;
- gtk_dialog_add_buttons (GTK_DIALOG (dialog),
- GTK_STOCK_CANCEL, GTK_RESPONSE_REJECT,
- GTK_STOCK_DELETE, GTK_RESPONSE_ACCEPT,
- NULL);
+ gui = glade_xml_new (EVOLUTION_GLADEDIR "/e-contact-editor-confirm-delete.glade", NULL);
- result = gtk_dialog_run(GTK_DIALOG (dialog));
+ dialog = GNOME_DIALOG(glade_xml_get_widget(gui, "confirm-dialog"));
- gtk_widget_destroy (dialog);
+ gnome_dialog_set_parent(dialog, parent);
+
+ result = gnome_dialog_run_and_close(dialog);
+
+ gtk_object_unref(GTK_OBJECT(gui));
- return (result == GTK_RESPONSE_ACCEPT);
+ return !result;
}
static void
@@ -1077,8 +1103,8 @@ card_deleted_cb (EBook *book, EBookStatus status, EContactEditor *ce)
gtk_widget_set_sensitive (ce->app, TRUE);
ce->in_async_call = FALSE;
- g_signal_emit (ce, contact_editor_signals[CARD_DELETED], 0,
- status, ce->card);
+ gtk_signal_emit (GTK_OBJECT (ce), contact_editor_signals[CARD_DELETED],
+ status, ce->card);
/* always close the dialog after we successfully delete a card */
if (status == E_BOOK_STATUS_SUCCESS)
@@ -1092,8 +1118,8 @@ delete_cb (GtkWidget *widget, gpointer data)
ECard *card = ce->card;
ECardSimple *simple = ce->simple;
- g_object_ref(card);
- g_object_ref(simple);
+ gtk_object_ref(GTK_OBJECT(card));
+ gtk_object_ref(GTK_OBJECT(simple));
if (e_contact_editor_confirm_delete(GTK_WINDOW(ce->app))) {
@@ -1104,12 +1130,12 @@ delete_cb (GtkWidget *widget, gpointer data)
gtk_widget_set_sensitive (ce->app, FALSE);
ce->in_async_call = TRUE;
- e_book_remove_card (ce->book, card, (EBookCallback)card_deleted_cb, ce);
+ e_book_remove_card (ce->book, card, GTK_SIGNAL_FUNC(card_deleted_cb), ce);
}
}
- g_object_unref(card);
- g_object_unref(simple);
+ gtk_object_unref(GTK_OBJECT(card));
+ gtk_object_unref(GTK_OBJECT(simple));
}
/* Emits the signal to request printing a card */
@@ -1192,8 +1218,8 @@ create_ui (EContactEditor *ce)
bonobo_ui_component_add_verb_list_with_data (ce->uic, verbs, ce);
bonobo_ui_util_set_ui (ce->uic, EVOLUTION_DATADIR,
- EVOLUTION_UIDIR "/evolution-contact-editor.xml",
- "evolution-contact-editor", NULL);
+ "evolution-contact-editor.xml",
+ "evolution-contact-editor");
e_pixmaps_update (ce->uic, pixmaps);
}
@@ -1247,6 +1273,7 @@ setup_tab_order(GladeXML *gui)
list = add_to_tab_order(list, gui, "entry-web");
list = add_to_tab_order(list, gui, "button-fulladdr");
list = add_to_tab_order(list, gui, "text-address");
+ list = add_to_tab_order(list, gui, "alignment-contacts");
list = g_list_reverse(list);
e_container_change_tab_order(GTK_CONTAINER(container), list);
g_list_free(list);
@@ -1292,7 +1319,7 @@ e_contact_editor_init (EContactEditor *e_contact_editor)
e_contact_editor->in_async_call = FALSE;
e_contact_editor->editable = TRUE;
- gui = glade_xml_new (EVOLUTION_GLADEDIR "/contact-editor.glade", NULL, NULL);
+ gui = glade_xml_new (EVOLUTION_GLADEDIR "/contact-editor.glade", NULL);
e_contact_editor->gui = gui;
setup_tab_order(gui);
@@ -1303,33 +1330,40 @@ e_contact_editor_init (EContactEditor *e_contact_editor)
(GtkCallback) add_field_callback,
e_contact_editor);
- connect_arrow_button_signals(e_contact_editor);
+ _replace_buttons(e_contact_editor);
+ add_lists (e_contact_editor);
set_entry_changed_signals(e_contact_editor);
wants_html = glade_xml_get_widget(e_contact_editor->gui, "checkbutton-htmlmail");
if (wants_html && GTK_IS_TOGGLE_BUTTON(wants_html))
- g_signal_connect (wants_html, "toggled",
- G_CALLBACK (wants_html_changed), e_contact_editor);
+ gtk_signal_connect(GTK_OBJECT(wants_html), "toggled",
+ wants_html_changed, e_contact_editor);
widget = glade_xml_get_widget(e_contact_editor->gui, "checkbutton-mailingaddress");
if (widget && GTK_IS_TOGGLE_BUTTON(widget))
- g_signal_connect (widget, "toggled",
- G_CALLBACK (address_mailing_changed), e_contact_editor);
+ gtk_signal_connect(GTK_OBJECT(widget), "toggled",
+ address_mailing_changed, e_contact_editor);
widget = glade_xml_get_widget(e_contact_editor->gui, "button-fullname");
if (widget && GTK_IS_BUTTON(widget))
- g_signal_connect (widget, "clicked",
- G_CALLBACK (full_name_clicked), e_contact_editor);
+ gtk_signal_connect(GTK_OBJECT(widget), "clicked",
+ full_name_clicked, e_contact_editor);
widget = glade_xml_get_widget(e_contact_editor->gui, "button-fulladdr");
if (widget && GTK_IS_BUTTON(widget))
- g_signal_connect (widget, "clicked",
- G_CALLBACK (full_addr_clicked), e_contact_editor);
+ gtk_signal_connect(GTK_OBJECT(widget), "clicked",
+ full_addr_clicked, e_contact_editor);
widget = glade_xml_get_widget(e_contact_editor->gui, "button-categories");
if (widget && GTK_IS_BUTTON(widget))
- g_signal_connect (widget, "clicked",
- G_CALLBACK (categories_clicked), e_contact_editor);
+ gtk_signal_connect(GTK_OBJECT(widget), "clicked",
+ categories_clicked, e_contact_editor);
+
+ widget = glade_xml_get_widget(e_contact_editor->gui, "button-contacts");
+ if (widget && GTK_IS_BUTTON(widget))
+ gtk_signal_connect(GTK_OBJECT(widget), "clicked",
+ contacts_clicked, e_contact_editor);
+
/* Construct the app */
bonobo_win = bonobo_window_new ("contact-editor-dialog", _("Contact Editor"));
@@ -1338,13 +1372,13 @@ e_contact_editor_init (EContactEditor *e_contact_editor)
{
GtkWidget *contents;
- contents = bonobo_dock_get_client_area (gnome_app_get_dock (GNOME_APP(e_contact_editor->app)));
-
+ contents = gnome_dock_get_client_area (
+ GNOME_DOCK (GNOME_APP (e_contact_editor->app)->dock));
if (!contents) {
g_message ("contact_editor_construct(): Could not get contents");
return;
}
- g_object_ref (contents);
+ gtk_widget_ref (contents);
gtk_container_remove (GTK_CONTAINER (contents->parent), contents);
bonobo_window_set_contents (BONOBO_WINDOW (bonobo_win), contents);
gtk_widget_destroy (e_contact_editor->app);
@@ -1352,7 +1386,9 @@ e_contact_editor_init (EContactEditor *e_contact_editor)
}
/* Build the menu and toolbar */
- container = bonobo_window_get_ui_container (BONOBO_WINDOW (e_contact_editor->app));
+
+ container = bonobo_ui_container_new ();
+ bonobo_ui_container_set_win (container, BONOBO_WINDOW (e_contact_editor->app));
e_contact_editor->uic = bonobo_ui_component_new_default ();
if (!e_contact_editor->uic) {
@@ -1360,8 +1396,8 @@ e_contact_editor_init (EContactEditor *e_contact_editor)
return;
}
bonobo_ui_component_set_container (e_contact_editor->uic,
- bonobo_object_corba_objref (BONOBO_OBJECT (container)),
- NULL);
+ bonobo_object_corba_objref (
+ BONOBO_OBJECT (container)));
create_ui (e_contact_editor);
@@ -1371,89 +1407,68 @@ e_contact_editor_init (EContactEditor *e_contact_editor)
/* Connect to the deletion of the dialog */
- g_signal_connect (e_contact_editor->app, "delete_event",
+ gtk_signal_connect (GTK_OBJECT (e_contact_editor->app), "delete_event",
GTK_SIGNAL_FUNC (app_delete_event_cb), e_contact_editor);
/* set the icon */
- icon_path = g_build_filename (EVOLUTION_IMAGESDIR, "evolution-contacts-mini.png", NULL);
+ icon_path = g_concat_dir_and_file (EVOLUTION_ICONSDIR, "evolution-contacts-mini.png");
gnome_window_icon_set_from_file (GTK_WINDOW (e_contact_editor->app), icon_path);
g_free (icon_path);
}
void
-e_contact_editor_dispose (GObject *object) {
+e_contact_editor_destroy (GtkObject *object) {
EContactEditor *e_contact_editor = E_CONTACT_EDITOR(object);
if (e_contact_editor->writable_fields) {
- g_object_unref(e_contact_editor->writable_fields);
- e_contact_editor->writable_fields = NULL;
+ gtk_object_unref(GTK_OBJECT(e_contact_editor->writable_fields));
}
if (e_contact_editor->email_list) {
g_list_foreach(e_contact_editor->email_list, (GFunc) g_free, NULL);
g_list_free(e_contact_editor->email_list);
- e_contact_editor->email_list = NULL;
}
if (e_contact_editor->email_info) {
g_free(e_contact_editor->email_info);
- e_contact_editor->email_info = NULL;
}
if (e_contact_editor->email_popup) {
- g_object_unref(e_contact_editor->email_popup);
- e_contact_editor->email_popup = NULL;
+ gtk_widget_unref(e_contact_editor->email_popup);
}
if (e_contact_editor->phone_list) {
g_list_foreach(e_contact_editor->phone_list, (GFunc) g_free, NULL);
g_list_free(e_contact_editor->phone_list);
- e_contact_editor->phone_list = NULL;
}
if (e_contact_editor->phone_info) {
g_free(e_contact_editor->phone_info);
- e_contact_editor->phone_info = NULL;
}
if (e_contact_editor->phone_popup) {
- g_object_unref(e_contact_editor->phone_popup);
- e_contact_editor->phone_popup = NULL;
+ gtk_widget_unref(e_contact_editor->phone_popup);
}
if (e_contact_editor->address_list) {
g_list_foreach(e_contact_editor->address_list, (GFunc) g_free, NULL);
g_list_free(e_contact_editor->address_list);
- e_contact_editor->address_list = NULL;
}
if (e_contact_editor->address_info) {
g_free(e_contact_editor->address_info);
- e_contact_editor->address_info = NULL;
}
if (e_contact_editor->address_popup) {
- g_object_unref(e_contact_editor->address_popup);
- e_contact_editor->address_popup = NULL;
+ gtk_widget_unref(e_contact_editor->address_popup);
}
- if (e_contact_editor->simple) {
- g_object_unref(e_contact_editor->simple);
- e_contact_editor->simple = NULL;
- }
+ if (e_contact_editor->simple)
+ gtk_object_unref(GTK_OBJECT(e_contact_editor->simple));
- if (e_contact_editor->book) {
- g_object_unref(e_contact_editor->book);
- e_contact_editor->book = NULL;
- }
+ if (e_contact_editor->book)
+ gtk_object_unref(GTK_OBJECT(e_contact_editor->book));
- if (e_contact_editor->name) {
- e_card_name_unref(e_contact_editor->name);
- e_contact_editor->name = NULL;
- }
+ if (e_contact_editor->select_names_contacts)
+ gtk_object_unref(GTK_OBJECT(e_contact_editor->select_names_contacts));
- if (e_contact_editor->company) {
- g_free (e_contact_editor->company);
- e_contact_editor->company = NULL;
- }
+ e_card_name_unref(e_contact_editor->name);
+ g_free (e_contact_editor->company);
- if (e_contact_editor->gui) {
- g_object_unref(e_contact_editor->gui);
- e_contact_editor->gui = NULL;
- }
+ gtk_object_unref(GTK_OBJECT(e_contact_editor->gui));
}
static void
@@ -1482,7 +1497,7 @@ supported_fields_cb (EBook *book, EBookStatus status,
return;
}
- g_object_set (ce,
+ gtk_object_set (GTK_OBJECT (ce),
"writable_fields", fields,
NULL);
@@ -1492,8 +1507,7 @@ supported_fields_cb (EBook *book, EBookStatus status,
}
static void
-contact_editor_destroy_notify (void *data,
- GObject *where_the_object_was)
+contact_editor_destroy_notify (void *data)
{
EContactEditor *ce = E_CONTACT_EDITOR (data);
@@ -1511,20 +1525,17 @@ e_contact_editor_new (EBook *book,
g_return_val_if_fail (E_IS_BOOK (book), NULL);
g_return_val_if_fail (E_IS_CARD (card), NULL);
- ce = g_object_new (E_TYPE_CONTACT_EDITOR, NULL);
+ ce = E_CONTACT_EDITOR (gtk_type_new (E_CONTACT_EDITOR_TYPE));
all_contact_editors = g_slist_prepend (all_contact_editors, ce);
- g_object_weak_ref (G_OBJECT (ce), contact_editor_destroy_notify, ce);
-
- g_object_ref (ce);
- gtk_object_sink (GTK_OBJECT (ce));
+ gtk_object_weakref (GTK_OBJECT (ce), contact_editor_destroy_notify, ce);
- g_object_set (ce,
- "book", book,
- "card", card,
- "is_new_card", is_new_card,
- "editable", editable,
- NULL);
+ gtk_object_set (GTK_OBJECT (ce),
+ "book", book,
+ "card", card,
+ "is_new_card", is_new_card,
+ "editable", editable,
+ NULL);
if (book)
e_book_get_supported_fields (book, (EBookFieldsCallback)supported_fields_cb, ce);
@@ -1533,37 +1544,37 @@ e_contact_editor_new (EBook *book,
}
static void
-e_contact_editor_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec)
+e_contact_editor_set_arg (GtkObject *o, GtkArg *arg, guint arg_id)
{
EContactEditor *editor;
- editor = E_CONTACT_EDITOR (object);
+ editor = E_CONTACT_EDITOR (o);
- switch (prop_id){
- case PROP_BOOK:
+ switch (arg_id){
+ case ARG_BOOK:
if (editor->book)
- g_object_unref(editor->book);
- editor->book = E_BOOK(g_value_get_object (value));
- g_object_ref (editor->book);
+ gtk_object_unref(GTK_OBJECT(editor->book));
+ editor->book = E_BOOK(GTK_VALUE_OBJECT (*arg));
+ gtk_object_ref (GTK_OBJECT (editor->book));
/* XXX more here about editable/etc. */
break;
- case PROP_CARD:
+ case ARG_CARD:
if (editor->card)
- g_object_unref(editor->card);
- editor->card = e_card_duplicate(E_CARD(g_value_get_object (value)));
- g_object_set(editor->simple,
- "card", editor->card,
- NULL);
+ gtk_object_unref(GTK_OBJECT(editor->card));
+ editor->card = e_card_duplicate(E_CARD(GTK_VALUE_OBJECT (*arg)));
+ gtk_object_set(GTK_OBJECT(editor->simple),
+ "card", editor->card,
+ NULL);
fill_in_info(editor);
editor->changed = FALSE;
break;
- case PROP_IS_NEW_CARD:
- editor->is_new_card = g_value_get_boolean (value) ? TRUE : FALSE;
+ case ARG_IS_NEW_CARD:
+ editor->is_new_card = GTK_VALUE_BOOL (*arg) ? TRUE : FALSE;
break;
- case PROP_EDITABLE: {
- gboolean new_value = g_value_get_boolean (value) ? TRUE : FALSE;
+ case ARG_EDITABLE: {
+ gboolean new_value = GTK_VALUE_BOOL (*arg) ? TRUE : FALSE;
gboolean changed = (editor->editable != new_value);
editor->editable = new_value;
@@ -1575,8 +1586,8 @@ e_contact_editor_set_property (GObject *object, guint prop_id, const GValue *val
break;
}
- case PROP_CHANGED: {
- gboolean new_value = g_value_get_boolean (value) ? TRUE : FALSE;
+ case ARG_CHANGED: {
+ gboolean new_value = GTK_VALUE_BOOL (*arg) ? TRUE : FALSE;
gboolean changed = (editor->changed != new_value);
editor->changed = new_value;
@@ -1585,60 +1596,57 @@ e_contact_editor_set_property (GObject *object, guint prop_id, const GValue *val
command_state_changed (editor);
break;
}
- case PROP_WRITABLE_FIELDS:
+ case ARG_WRITABLE_FIELDS:
if (editor->writable_fields)
- g_object_unref(editor->writable_fields);
- editor->writable_fields = g_value_get_object (value);
+ gtk_object_unref(GTK_OBJECT(editor->writable_fields));
+ editor->writable_fields = GTK_VALUE_POINTER (*arg);
if (editor->writable_fields)
- g_object_ref (editor->writable_fields);
+ gtk_object_ref (GTK_OBJECT (editor->writable_fields));
else
editor->writable_fields = e_list_new(NULL, NULL, NULL);
enable_writable_fields (editor);
break;
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
- break;
}
}
static void
-e_contact_editor_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec)
+e_contact_editor_get_arg (GtkObject *object, GtkArg *arg, guint arg_id)
{
EContactEditor *e_contact_editor;
e_contact_editor = E_CONTACT_EDITOR (object);
- switch (prop_id) {
- case PROP_BOOK:
- g_value_set_object (value, e_contact_editor->book);
+ switch (arg_id) {
+ case ARG_BOOK:
+ GTK_VALUE_OBJECT (*arg) = GTK_OBJECT(e_contact_editor->book);
break;
- case PROP_CARD:
+ case ARG_CARD:
e_card_simple_sync_card(e_contact_editor->simple);
extract_info(e_contact_editor);
- g_value_set_object (value, e_contact_editor->card);
+ GTK_VALUE_OBJECT (*arg) = GTK_OBJECT(e_contact_editor->card);
break;
- case PROP_IS_NEW_CARD:
- g_value_set_boolean (value, e_contact_editor->is_new_card ? TRUE : FALSE);
+ case ARG_IS_NEW_CARD:
+ GTK_VALUE_BOOL (*arg) = e_contact_editor->is_new_card ? TRUE : FALSE;
break;
- case PROP_EDITABLE:
- g_value_set_boolean (value, e_contact_editor->editable ? TRUE : FALSE);
+ case ARG_EDITABLE:
+ GTK_VALUE_BOOL (*arg) = e_contact_editor->editable ? TRUE : FALSE;
break;
- case PROP_CHANGED:
- g_value_set_boolean (value, e_contact_editor->changed ? TRUE : FALSE);
+ case ARG_CHANGED:
+ GTK_VALUE_BOOL (*arg) = e_contact_editor->changed ? TRUE : FALSE;
break;
- case PROP_WRITABLE_FIELDS:
+ case ARG_WRITABLE_FIELDS:
if (e_contact_editor->writable_fields)
- g_value_set_object (value, e_list_duplicate (e_contact_editor->writable_fields));
+ GTK_VALUE_POINTER (*arg) = e_list_duplicate (e_contact_editor->writable_fields);
else
- g_value_set_object (value, NULL);
+ GTK_VALUE_POINTER (*arg) = NULL;
break;
default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+ arg->type = GTK_TYPE_INVALID;
break;
}
}
@@ -1647,15 +1655,14 @@ static void
_popup_position(GtkMenu *menu,
gint *x,
gint *y,
- gboolean *push_in,
gpointer data)
{
GtkWidget *button = GTK_WIDGET(data);
GtkRequisition request;
int mh, mw;
gdk_window_get_origin (button->window, x, y);
- *x += button->allocation.x;
- *y += button->allocation.y;
+ *x += button->allocation.width;
+ *y += button->allocation.height;
gtk_widget_size_request(GTK_WIDGET(menu), &request);
@@ -1674,26 +1681,30 @@ _popup_position(GtkMenu *menu,
if ((*y + mh) > gdk_screen_height ())
*y = gdk_screen_height () - mh;
-
- *push_in = FALSE;
}
static gint
-_arrow_pressed (GtkWidget *widget, GdkEventButton *button, EContactEditor *editor, GtkWidget *popup, GList **list, GnomeUIInfo **info, gchar *label)
+_arrow_pressed (GtkWidget *widget, GdkEventButton *button, EContactEditor *editor, GtkWidget *popup, GList **list, GnomeUIInfo **info, gchar *label, gchar *entry, gchar *dialog_title)
{
gint menu_item;
-
- g_signal_stop_emission_by_name (widget, "button_press_event");
-
+ gtk_signal_emit_stop_by_name(GTK_OBJECT(widget), "button_press_event");
gtk_widget_realize(popup);
- menu_item = gnome_popup_menu_do_popup_modal(popup, _popup_position, widget, button, editor, widget);
+ menu_item = gnome_popup_menu_do_popup_modal(popup, _popup_position, widget, button, editor);
if ( menu_item != -1 ) {
- GtkWidget *label_widget = glade_xml_get_widget(editor->gui, label);
- if (label_widget && GTK_IS_LABEL(label_widget)) {
- g_object_set (label_widget,
- "label", _(g_list_nth_data(*list, menu_item)),
- NULL);
+#if 0
+ if (menu_item == g_list_length (*list)) {
+ e_contact_editor_build_dialog(editor, entry, label, dialog_title, list, info);
+ } else {
+#endif
+ GtkWidget *label_widget = glade_xml_get_widget(editor->gui, label);
+ if (label_widget && GTK_IS_LABEL(label_widget)) {
+ gtk_object_set(GTK_OBJECT(label_widget),
+ "label", _(g_list_nth_data(*list, menu_item)),
+ NULL);
+ }
+#if 0
}
+#endif
}
return menu_item;
}
@@ -1759,11 +1770,9 @@ e_contact_editor_build_phone_ui (EContactEditor *editor)
e_contact_editor_build_ui_info(editor->phone_list, &editor->phone_info);
if ( editor->phone_popup )
- g_object_unref(editor->phone_popup);
+ gtk_widget_unref(editor->phone_popup);
editor->phone_popup = gnome_popup_menu_new(editor->phone_info);
- g_object_ref (editor->phone_popup);
- gtk_object_sink (GTK_OBJECT (editor->phone_popup));
}
}
@@ -1787,11 +1796,9 @@ e_contact_editor_build_email_ui (EContactEditor *editor)
e_contact_editor_build_ui_info(editor->email_list, &editor->email_info);
if ( editor->email_popup )
- g_object_unref(editor->email_popup);
+ gtk_widget_unref(editor->email_popup);
editor->email_popup = gnome_popup_menu_new(editor->email_info);
- g_object_ref (editor->email_popup);
- gtk_object_sink (GTK_OBJECT (editor->email_popup));
}
}
@@ -1815,13 +1822,96 @@ e_contact_editor_build_address_ui (EContactEditor *editor)
e_contact_editor_build_ui_info(editor->address_list, &editor->address_info);
if ( editor->address_popup )
- g_object_unref(editor->address_popup);
+ gtk_widget_unref(editor->address_popup);
editor->address_popup = gnome_popup_menu_new(editor->address_info);
- g_object_ref (editor->address_popup);
- gtk_object_sink (GTK_OBJECT (editor->address_popup));
}
}
+#if 0
+static void
+_dialog_clicked(GtkWidget *dialog, gint button, EContactEditor *editor)
+{
+ GtkWidget *label = gtk_object_get_data(GTK_OBJECT(dialog),
+ "e_contact_editor_label");
+
+ GtkWidget *dialog_entry = gtk_object_get_data(GTK_OBJECT(dialog),
+ "e_contact_editor_dialog_entry");
+
+ GList **list = gtk_object_get_data(GTK_OBJECT(dialog),
+ "e_contact_editor_list");
+ GList **info = gtk_object_get_data(GTK_OBJECT(dialog),
+ "e_contact_editor_info");
+ switch (button) {
+ case 0:
+ if (label && GTK_IS_LABEL(label)) {
+ gtk_object_set(GTK_OBJECT(label),
+ "label", gtk_entry_get_text(GTK_ENTRY(dialog_entry)),
+ NULL);
+ *list = g_list_append(*list, e_utf8_gtk_entry_get_text(GTK_ENTRY(dialog_entry)));
+ g_free(*info);
+ *info = NULL;
+ }
+ break;
+ }
+ gnome_dialog_close(GNOME_DIALOG(dialog));
+}
+
+static void
+_dialog_destroy(EContactEditor *editor, GtkWidget *dialog)
+{
+ gnome_dialog_close(GNOME_DIALOG(dialog));
+}
+
+static GtkWidget *
+e_contact_editor_build_dialog(EContactEditor *editor, gchar *entry_id, gchar *label_id, gchar *title, GList **list, GnomeUIInfo **info)
+{
+ GtkWidget *dialog_entry = gtk_entry_new();
+ GtkWidget *entry = glade_xml_get_widget(editor->gui, entry_id);
+ GtkWidget *label = glade_xml_get_widget(editor->gui, label_id);
+
+ GtkWidget *dialog = gnome_dialog_new(title,
+ NULL);
+
+ gtk_container_add(GTK_CONTAINER(GNOME_DIALOG(dialog)->vbox),
+ gtk_widget_new (gtk_frame_get_type(),
+ "border_width", 4,
+ "label", title,
+ "child", gtk_widget_new(gtk_alignment_get_type(),
+ "child", dialog_entry,
+ "xalign", .5,
+ "yalign", .5,
+ "xscale", 1.0,
+ "yscale", 1.0,
+ "border_width", 9,
+ NULL),
+ NULL));
+
+ gnome_dialog_append_button_with_pixmap(GNOME_DIALOG(dialog),
+ "Add",
+ GNOME_STOCK_PIXMAP_ADD);
+ gnome_dialog_append_button(GNOME_DIALOG(dialog), GNOME_STOCK_BUTTON_CANCEL);
+ gnome_dialog_set_default(GNOME_DIALOG(dialog), 0);
+
+ gtk_signal_connect(GTK_OBJECT(dialog), "clicked",
+ _dialog_clicked, editor);
+ gtk_signal_connect_while_alive(GTK_OBJECT(editor), "destroy",
+ _dialog_destroy, GTK_OBJECT(dialog), GTK_OBJECT(dialog));
+
+ gtk_object_set_data(GTK_OBJECT(dialog),
+ "e_contact_editor_entry", entry);
+ gtk_object_set_data(GTK_OBJECT(dialog),
+ "e_contact_editor_label", label);
+ gtk_object_set_data(GTK_OBJECT(dialog),
+ "e_contact_editor_dialog_entry", dialog_entry);
+ gtk_object_set_data(GTK_OBJECT(dialog),
+ "e_contact_editor_list", list);
+ gtk_object_set_data(GTK_OBJECT(dialog),
+ "e_contact_editor_info", info);
+
+ gtk_widget_show_all(dialog);
+ return dialog;
+}
+#endif
static void
_phone_arrow_pressed (GtkWidget *widget, GdkEventButton *button, EContactEditor *editor)
@@ -1853,9 +1943,11 @@ _phone_arrow_pressed (GtkWidget *widget, GdkEventButton *button, EContactEditor
checked = phone && phone->number && *phone->number;
gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(editor->phone_info[i].widget),
checked);
+ gtk_check_menu_item_set_show_toggle(GTK_CHECK_MENU_ITEM(editor->phone_info[i].widget),
+ TRUE);
}
- result = _arrow_pressed (widget, button, editor, editor->phone_popup, &editor->phone_list, &editor->phone_info, label);
+ result = _arrow_pressed (widget, button, editor, editor->phone_popup, &editor->phone_list, &editor->phone_info, label, entry, "Add new phone number type");
if (result != -1) {
editor->phone_choice[which - 1] = result;
@@ -1882,9 +1974,11 @@ _email_arrow_pressed (GtkWidget *widget, GdkEventButton *button, EContactEditor
checked = string && *string;
gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(editor->email_info[i].widget),
checked);
+ gtk_check_menu_item_set_show_toggle(GTK_CHECK_MENU_ITEM(editor->email_info[i].widget),
+ TRUE);
}
- result = _arrow_pressed (widget, button, editor, editor->email_popup, &editor->email_list, &editor->email_info, "label-email1");
+ result = _arrow_pressed (widget, button, editor, editor->email_popup, &editor->email_list, &editor->email_info, "label-email1", "entry-email1", "Add new Email type");
if (result != -1) {
editor->email_choice = result;
@@ -1911,9 +2005,11 @@ _address_arrow_pressed (GtkWidget *widget, GdkEventButton *button, EContactEdito
checked = address && address->data && *address->data;
gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(editor->address_info[i].widget),
checked);
+ gtk_check_menu_item_set_show_toggle(GTK_CHECK_MENU_ITEM(editor->address_info[i].widget),
+ TRUE);
}
- result = _arrow_pressed (widget, button, editor, editor->address_popup, &editor->address_list, &editor->address_info, "label-address");
+ result = _arrow_pressed (widget, button, editor, editor->address_popup, &editor->address_list, &editor->address_info, "label-address", "text-address", "Add new Address type");
if (result != -1) {
set_address_field(editor, result);
@@ -1928,48 +2024,42 @@ _address_arrow_pressed (GtkWidget *widget, GdkEventButton *button, EContactEdito
static void
find_address_mailing (EContactEditor *editor)
{
- const ECardDeliveryAddress *address;
+ const ECardAddrLabel *address;
int i;
editor->address_mailing = -1;
for (i = 0; i < E_CARD_SIMPLE_ADDRESS_ID_LAST; i++) {
- address = e_card_simple_get_delivery_address(editor->simple, i);
+ address = e_card_simple_get_address(editor->simple, i);
if (address && (address->flags & E_CARD_ADDR_DEFAULT)) {
if (editor->address_mailing == -1) {
editor->address_mailing = i;
} else {
- ECardDeliveryAddress *new;
+ ECardAddrLabel *new;
- new = e_card_delivery_address_copy (address);
+ new = e_card_address_label_copy (address);
new->flags &= ~E_CARD_ADDR_DEFAULT;
- e_card_simple_set_delivery_address(editor->simple, i, new);
- e_card_delivery_address_unref (new);
+ e_card_simple_set_address(editor->simple, i, new);
+ e_card_address_label_unref (new);
}
}
}
}
static void
-set_field(EContactEditor *editor, GtkEntry *entry, const char *string)
+set_field(GtkEntry *entry, const char *string)
{
- const char *oldstring = gtk_entry_get_text(entry);
+ char *oldstring = e_utf8_gtk_entry_get_text(entry);
if (!string)
string = "";
- if (strcmp(string, oldstring)) {
- g_signal_handlers_block_matched (entry,
- G_SIGNAL_MATCH_DATA,
- 0, 0, NULL, NULL, editor);
- gtk_entry_set_text(entry, string);
- g_signal_handlers_unblock_matched (entry,
- G_SIGNAL_MATCH_DATA,
- 0, 0, NULL, NULL, editor);
- }
+ if (strcmp(string, oldstring))
+ e_utf8_gtk_entry_set_text(entry, string);
+ g_free (oldstring);
}
static void
-set_phone_field(EContactEditor *editor, GtkWidget *entry, const ECardPhone *phone)
+set_phone_field(GtkWidget *entry, const ECardPhone *phone)
{
- set_field(editor, GTK_ENTRY(entry), phone ? phone->number : "");
+ set_field(GTK_ENTRY(entry), phone ? phone->number : "");
}
static void
@@ -1981,23 +2071,23 @@ set_fields(EContactEditor *editor)
entry = glade_xml_get_widget(editor->gui, "entry-phone1");
if (entry && GTK_IS_ENTRY(entry))
- set_phone_field(editor, entry, e_card_simple_get_phone(editor->simple, editor->phone_choice[0]));
+ set_phone_field(entry, e_card_simple_get_phone(editor->simple, editor->phone_choice[0]));
entry = glade_xml_get_widget(editor->gui, "entry-phone2");
if (entry && GTK_IS_ENTRY(entry))
- set_phone_field(editor, entry, e_card_simple_get_phone(editor->simple, editor->phone_choice[1]));
+ set_phone_field(entry, e_card_simple_get_phone(editor->simple, editor->phone_choice[1]));
entry = glade_xml_get_widget(editor->gui, "entry-phone3");
if (entry && GTK_IS_ENTRY(entry))
- set_phone_field(editor, entry, e_card_simple_get_phone(editor->simple, editor->phone_choice[2]));
+ set_phone_field(entry, e_card_simple_get_phone(editor->simple, editor->phone_choice[2]));
entry = glade_xml_get_widget(editor->gui, "entry-phone4");
if (entry && GTK_IS_ENTRY(entry))
- set_phone_field(editor, entry, e_card_simple_get_phone(editor->simple, editor->phone_choice[3]));
+ set_phone_field(entry, e_card_simple_get_phone(editor->simple, editor->phone_choice[3]));
entry = glade_xml_get_widget(editor->gui, "entry-email1");
if (entry && GTK_IS_ENTRY(entry))
- set_field(editor, GTK_ENTRY(entry), e_card_simple_get_email(editor->simple, editor->email_choice));
+ set_field(GTK_ENTRY(entry), e_card_simple_get_email(editor->simple, editor->email_choice));
@@ -2014,7 +2104,7 @@ set_fields(EContactEditor *editor)
label_widget = glade_xml_get_widget(editor->gui, "label-address");
if (label_widget && GTK_IS_LABEL(label_widget)) {
- g_object_set (label_widget,
+ gtk_object_set(GTK_OBJECT(label_widget),
"label", _(g_list_nth_data(editor->address_list, i)),
NULL);
}
@@ -2029,25 +2119,25 @@ set_address_field(EContactEditor *editor, int result)
text = glade_xml_get_widget(editor->gui, "text-address");
- if (text && GTK_IS_TEXT_VIEW(text)) {
- GtkTextBuffer *buffer;
- GtkTextIter start_iter, end_iter;
+ if (text && GTK_IS_TEXT(text)) {
+ int position;
+ GtkEditable *editable;
const ECardAddrLabel *address;
if (result == -1)
result = editor->address_choice;
editor->address_choice = -1;
- buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (text));
-
- gtk_text_buffer_get_start_iter (buffer, &start_iter);
- gtk_text_buffer_get_end_iter (buffer, &end_iter);
-
- gtk_text_buffer_delete (buffer, &start_iter, &end_iter);
+ position = 0;
+ editable = GTK_EDITABLE(text);
+ gtk_editable_delete_text(editable, 0, -1);
address = e_card_simple_get_address(editor->simple, result);
- if (address && address->data)
- gtk_text_buffer_insert (buffer, &start_iter, address->data, strlen (address->data));
+ if (address && address->data) {
+ gchar *u = e_utf8_to_gtk_string ((GtkWidget *) editable, address->data);
+ gtk_editable_insert_text(editable, u, strlen(u), &position);
+ g_free (u);
+ }
check = glade_xml_get_widget(editor->gui, "checkbutton-mailingaddress");
if (check && GTK_IS_CHECK_BUTTON (check)) {
@@ -2081,6 +2171,7 @@ add_field_callback(GtkWidget *widget, EContactEditor *editor)
"entry-spouse",
"text-comments",
"entry-categories",
+ "entry-contacts",
"entry-file-as",
"dateedit-anniversary",
"dateedit-birthday",
@@ -2102,7 +2193,7 @@ add_field_callback(GtkWidget *widget, EContactEditor *editor)
if (!strcmp(name, builtins[i]))
return;
}
- if (GTK_IS_ENTRY(widget) || GTK_IS_TEXT_VIEW(widget)) {
+ if (GTK_IS_ENTRY(widget) || GTK_IS_TEXT(widget)) {
editor->arbitrary_fields = g_list_prepend(editor->arbitrary_fields, g_strdup(name));
}
}
@@ -2133,16 +2224,15 @@ static void
fill_in_field(EContactEditor *editor, char *id, char *value)
{
GtkWidget *widget = glade_xml_get_widget(editor->gui, id);
-
- if (widget && E_IS_URL_ENTRY (widget))
- widget = e_url_entry_get_entry (E_URL_ENTRY (widget));
-
if (widget && GTK_IS_EDITABLE(widget)) {
int position = 0;
GtkEditable *editable = GTK_EDITABLE(widget);
gtk_editable_delete_text(editable, 0, -1);
- if (value)
- gtk_editable_insert_text(editable, value, strlen(value), &position);
+ if (value) {
+ gchar *u = e_utf8_to_gtk_string ((GtkWidget *) editable, value);
+ gtk_editable_insert_text(editable, u, strlen(u), &position);
+ g_free (u);
+ }
}
}
@@ -2150,7 +2240,7 @@ static void
fill_in_card_field(EContactEditor *editor, ECard *card, char *id, char *key)
{
char *string;
- g_object_get (card,
+ gtk_object_get(GTK_OBJECT(card),
key, &string,
NULL);
fill_in_field(editor, id, string);
@@ -2169,8 +2259,11 @@ fill_in_single_field(EContactEditor *editor, char *name)
gtk_editable_delete_text(editable, 0, -1);
arbitrary = e_card_simple_get_arbitrary(simple,
name);
- if (arbitrary && arbitrary->value)
- gtk_editable_insert_text(editable, arbitrary->value, strlen(arbitrary->value), &position);
+ if (arbitrary && arbitrary->value) {
+ gchar *u = e_utf8_to_gtk_string ((GtkWidget *) editable, arbitrary->value);
+ gtk_editable_insert_text(editable, u, strlen(u), &position);
+ g_free (u);
+ }
}
}
@@ -2379,8 +2472,8 @@ enable_writable_fields(EContactEditor *editor)
g_hash_table_destroy (dropdown_hash);
g_hash_table_destroy (supported_hash);
- g_object_unref (simple);
- g_object_unref (card);
+ gtk_object_unref (GTK_OBJECT(simple));
+ gtk_object_unref (GTK_OBJECT(card));
}
static void
@@ -2434,7 +2527,7 @@ fill_in_info(EContactEditor *editor)
GList *list;
gboolean wants_html, wants_html_set;
- g_object_get (card,
+ gtk_object_get(GTK_OBJECT(card),
"file_as", &file_as,
"related_contacts", &related_contacts,
"name", &name,
@@ -2457,7 +2550,7 @@ fill_in_info(EContactEditor *editor)
if (wants_html_set) {
GtkWidget *widget = glade_xml_get_widget(editor->gui, "checkbutton-htmlmail");
if (widget && GTK_IS_CHECK_BUTTON(widget)) {
- g_object_set (widget,
+ gtk_object_set(GTK_OBJECT(widget),
"active", wants_html,
NULL);
}
@@ -2495,6 +2588,12 @@ fill_in_info(EContactEditor *editor)
e_date_edit_set_time (dateedit, -1);
}
+ if (editor->select_names_contacts && related_contacts && *related_contacts) {
+ ESelectNamesModel *model = e_select_names_manager_get_source (editor->select_names_contacts,
+ "contacts");
+ e_select_names_model_import_destinationv (model, related_contacts);
+ }
+
set_fields(editor);
}
}
@@ -2503,22 +2602,18 @@ static void
extract_field(EContactEditor *editor, ECard *card, char *editable_id, char *key)
{
GtkWidget *widget = glade_xml_get_widget(editor->gui, editable_id);
-
- if (widget && E_IS_URL_ENTRY (widget))
- widget = e_url_entry_get_entry (E_URL_ENTRY (widget));
-
- if (widget && GTK_IS_EDITABLE (widget)) {
+ if (widget && GTK_IS_EDITABLE(widget)) {
GtkEditable *editable = GTK_EDITABLE(widget);
- char *string = gtk_editable_get_chars(editable, 0, -1);
+ char *string = e_utf8_gtk_editable_get_chars(editable, 0, -1);
if (string && *string)
- g_object_set (card,
- key, string,
- NULL);
+ gtk_object_set(GTK_OBJECT(card),
+ key, string,
+ NULL);
else
- g_object_set (card,
- key, NULL,
- NULL);
+ gtk_object_set(GTK_OBJECT(card),
+ key, NULL,
+ NULL);
if (string) g_free(string);
}
@@ -2531,7 +2626,7 @@ extract_single_field(EContactEditor *editor, char *name)
ECardSimple *simple = editor->simple;
if (widget && GTK_IS_EDITABLE(widget)) {
GtkEditable *editable = GTK_EDITABLE(widget);
- char *string = gtk_editable_get_chars(editable, 0, -1);
+ char *string = e_utf8_gtk_editable_get_chars(editable, 0, -1);
if (string && *string)
e_card_simple_set_arbitrary(simple,
@@ -2561,10 +2656,10 @@ extract_info(EContactEditor *editor)
widget = glade_xml_get_widget(editor->gui, "entry-file-as");
if (widget && GTK_IS_EDITABLE(widget)) {
GtkEditable *editable = GTK_EDITABLE(widget);
- char *string = gtk_editable_get_chars(editable, 0, -1);
+ char *string = e_utf8_gtk_editable_get_chars(editable, 0, -1);
if (string && *string)
- g_object_set (card,
+ gtk_object_set(GTK_OBJECT(card),
"file_as", string,
NULL);
@@ -2579,8 +2674,23 @@ extract_info(EContactEditor *editor)
extract_single_field(editor, list->data);
}
+ if (editor->select_names_contacts) {
+ ESelectNamesModel *model = e_select_names_manager_get_source (editor->select_names_contacts,
+ "contacts");
+ char *string = e_select_names_model_export_destinationv (model);
+ if (string && *string)
+ gtk_object_set (GTK_OBJECT (card),
+ "related_contacts", string,
+ NULL);
+ else
+ gtk_object_set (GTK_OBJECT (card),
+ "related_contacts", NULL,
+ NULL);
+ g_free (string);
+ }
+
if (editor->name)
- g_object_set (card,
+ gtk_object_set(GTK_OBJECT(card),
"name", editor->name,
NULL);
@@ -2591,11 +2701,11 @@ extract_info(EContactEditor *editor)
&anniversary.month,
&anniversary.day)) {
/* g_print ("%d %d %d\n", anniversary.year, anniversary.month, anniversary.day); */
- g_object_set (card,
+ gtk_object_set(GTK_OBJECT(card),
"anniversary", &anniversary,
NULL);
} else
- g_object_set (card,
+ gtk_object_set(GTK_OBJECT(card),
"anniversary", NULL,
NULL);
}
@@ -2607,11 +2717,11 @@ extract_info(EContactEditor *editor)
&bday.month,
&bday.day)) {
/* g_print ("%d %d %d\n", bday.year, bday.month, bday.day); */
- g_object_set (card,
+ gtk_object_set(GTK_OBJECT(card),
"birth_date", &bday,
NULL);
} else
- g_object_set (card,
+ gtk_object_set(GTK_OBJECT(card),
"birth_date", NULL,
NULL);
}
@@ -2659,22 +2769,6 @@ e_contact_editor_create_date(gchar *name,
TRUE);
e_date_edit_set_show_time (E_DATE_EDIT (widget), FALSE);
e_date_edit_set_time (E_DATE_EDIT (widget), -1);
- gtk_widget_show (widget);
- return widget;
-}
-
-GtkWidget *
-e_contact_editor_create_web(gchar *name,
- gchar *string1, gchar *string2,
- gint int1, gint int2);
-
-GtkWidget *
-e_contact_editor_create_web(gchar *name,
- gchar *string1, gchar *string2,
- gint int1, gint int2)
-{
- GtkWidget *widget = e_url_entry_new ();
- gtk_widget_show (widget);
return widget;
}
@@ -2682,20 +2776,16 @@ static void
enable_widget (GtkWidget *widget, gboolean enabled)
{
if (GTK_IS_ENTRY (widget)) {
- gtk_editable_set_editable (GTK_EDITABLE (widget), enabled);
+ gtk_entry_set_editable (GTK_ENTRY (widget), enabled);
}
- else if (GTK_IS_TEXT_VIEW (widget)) {
- gtk_text_view_set_editable (GTK_TEXT_VIEW (widget), enabled);
+ else if (GTK_IS_TEXT (widget)) {
+ gtk_text_set_editable (GTK_TEXT (widget), enabled);
}
else if (GTK_IS_COMBO (widget)) {
- gtk_editable_set_editable (GTK_EDITABLE (GTK_COMBO (widget)->entry),
- enabled);
+ gtk_entry_set_editable (GTK_ENTRY (GTK_COMBO (widget)->entry),
+ enabled);
gtk_widget_set_sensitive (GTK_COMBO (widget)->button, enabled);
}
- else if (E_IS_URL_ENTRY (widget)) {
- GtkWidget *e = e_url_entry_get_entry (E_URL_ENTRY (widget));
- gtk_editable_set_editable (GTK_EDITABLE (e), enabled);
- }
else if (E_IS_DATE_EDIT (widget)) {
e_date_edit_set_editable (E_DATE_EDIT (widget), enabled);
}
diff --git a/addressbook/gui/contact-editor/e-contact-editor.h b/addressbook/gui/contact-editor/e-contact-editor.h
index 8642aecac1..a7619bd55c 100644
--- a/addressbook/gui/contact-editor/e-contact-editor.h
+++ b/addressbook/gui/contact-editor/e-contact-editor.h
@@ -25,11 +25,15 @@
#include <bonobo/bonobo-ui-component.h>
#include <glade/glade.h>
+#include "addressbook/gui/component/select-names/e-select-names-manager.h"
#include "addressbook/backend/ebook/e-book.h"
#include "addressbook/backend/ebook/e-card.h"
#include "addressbook/backend/ebook/e-card-simple.h"
-G_BEGIN_DECLS
+#ifdef __cplusplus
+extern "C" {
+#pragma }
+#endif /* __cplusplus */
/* EContactEditor - A dialog displaying information about a contact.
*
@@ -40,11 +44,11 @@ G_BEGIN_DECLS
* card ECard * RW The card currently being edited
*/
-#define E_TYPE_CONTACT_EDITOR (e_contact_editor_get_type ())
-#define E_CONTACT_EDITOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), E_TYPE_CONTACT_EDITOR, EContactEditor))
-#define E_CONTACT_EDITOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), E_TYPE_CONTACT_EDITOR, EContactEditorClass))
-#define E_IS_CONTACT_EDITOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), E_TYPE_CONTACT_EDITOR))
-#define E_IS_CONTACT_EDITOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), E_TYPE_CONTACT_EDITOR))
+#define E_CONTACT_EDITOR_TYPE (e_contact_editor_get_type ())
+#define E_CONTACT_EDITOR(obj) (GTK_CHECK_CAST ((obj), E_CONTACT_EDITOR_TYPE, EContactEditor))
+#define E_CONTACT_EDITOR_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), E_CONTACT_EDITOR_TYPE, EContactEditorClass))
+#define E_IS_CONTACT_EDITOR(obj) (GTK_CHECK_TYPE ((obj), E_CONTACT_EDITOR_TYPE))
+#define E_IS_CONTACT_EDITOR_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((obj), E_CONTACT_EDITOR_TYPE))
typedef struct _EContactEditor EContactEditor;
@@ -74,6 +78,8 @@ struct _EContactEditor
GList *phone_list;
GList *address_list;
+ ESelectNamesManager *select_names_contacts;
+
ECardName *name;
char *company;
@@ -121,7 +127,7 @@ EContactEditor *e_contact_editor_new (EBook *book,
ECard *card,
gboolean is_new_card,
gboolean editable);
-GType e_contact_editor_get_type (void);
+GtkType e_contact_editor_get_type (void);
void e_contact_editor_show (EContactEditor *editor);
void e_contact_editor_close (EContactEditor *editor);
@@ -131,6 +137,9 @@ gboolean e_contact_editor_confirm_delete (GtkWindow *parent);
gboolean e_contact_editor_request_close_all (void);
-G_END_DECLS
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
#endif /* __E_CONTACT_EDITOR_H__ */
diff --git a/addressbook/gui/contact-editor/e-contact-save-as.c b/addressbook/gui/contact-editor/e-contact-save-as.c
index 2478eadeb1..10d2fcfdf3 100644
--- a/addressbook/gui/contact-editor/e-contact-save-as.c
+++ b/addressbook/gui/contact-editor/e-contact-save-as.c
@@ -26,14 +26,17 @@
#include <fcntl.h>
#include <gtk/gtkfilesel.h>
#include <gtk/gtksignal.h>
-#include <gtk/gtkmessagedialog.h>
+#include <gtk/gtk.h>
+#include <libgnomeui/gnome-dialog.h>
#include <gal/util/e-util.h>
+#include <gal/widgets/e-unicode.h>
#include <libgnome/gnome-i18n.h>
#include <errno.h>
#include <string.h>
#include <libgnomeui/gnome-messagebox.h>
+#include <libgnomeui/gnome-stock.h>
-static gint file_exists(GtkFileSelection *filesel, const char *filename);
+static int file_exists(GtkFileSelection *filesel, const char *filename);
typedef struct {
GtkFileSelection *filesel;
@@ -53,24 +56,22 @@ save_it(GtkWidget *widget, SaveAsInfo *info)
if (error == EEXIST) {
response = file_exists(info->filesel, filename);
switch (response) {
- case GTK_RESPONSE_ACCEPT : /* Overwrite */
+ case 0 : /* Overwrite */
e_write_file(filename, info->vcard, O_WRONLY | O_CREAT | O_TRUNC);
break;
- case GTK_RESPONSE_REJECT : /* cancel */
+ case 1 : /* cancel */
return;
}
} else if (error != 0) {
GtkWidget *dialog;
char *str;
- str = g_strdup_printf (_("Error saving %s: %s"), filename, strerror(errno));
- dialog = gtk_message_dialog_new (GTK_WINDOW (info->filesel),
- GTK_DIALOG_DESTROY_WITH_PARENT,
- GTK_MESSAGE_ERROR,
- GTK_BUTTONS_OK,
- str);
+ str = g_strdup_printf ("Error saving %s: %s", filename, strerror(errno));
+ dialog = gnome_message_box_new (str, GNOME_MESSAGE_BOX_ERROR, GNOME_STOCK_BUTTON_OK, NULL);
g_free (str);
+ gnome_dialog_set_parent (GNOME_DIALOG (dialog), GTK_WINDOW (info->filesel));
+
gtk_widget_show (dialog);
return;
@@ -86,9 +87,8 @@ close_it(GtkWidget *widget, SaveAsInfo *info)
}
static void
-destroy_it(void *data, GObject *where_the_object_was)
+destroy_it(GtkWidget *widget, SaveAsInfo *info)
{
- SaveAsInfo *info = data;
g_free (info->vcard);
g_free (info);
}
@@ -122,25 +122,29 @@ e_contact_save_as(char *title, ECard *card, GtkWindow *parent_window)
GtkFileSelection *filesel;
char *file;
char *name;
+ char *locale_name;
SaveAsInfo *info = g_new(SaveAsInfo, 1);
filesel = GTK_FILE_SELECTION(gtk_file_selection_new(title));
- g_object_get (card,
- "file_as", &name,
- NULL);
- file = make_safe_filename (g_get_home_dir(), name);
+ gtk_object_get (GTK_OBJECT (card),
+ "file_as", &name,
+ NULL);
+ locale_name = e_utf8_to_locale_string (name);
+ file = make_safe_filename (g_get_home_dir(), locale_name);
gtk_file_selection_set_filename (filesel, file);
g_free (file);
+ g_free (locale_name);
info->filesel = filesel;
info->vcard = e_card_get_vcard(card);
- g_signal_connect(filesel->ok_button, "clicked",
- G_CALLBACK (save_it), info);
- g_signal_connect(filesel->cancel_button, "clicked",
- G_CALLBACK (close_it), info);
- g_object_weak_ref (G_OBJECT (filesel), destroy_it, info);
+ gtk_signal_connect(GTK_OBJECT(filesel->ok_button), "clicked",
+ save_it, info);
+ gtk_signal_connect(GTK_OBJECT(filesel->cancel_button), "clicked",
+ close_it, info);
+ gtk_signal_connect(GTK_OBJECT(filesel), "destroy",
+ destroy_it, info);
if (parent_window) {
gtk_window_set_transient_for (GTK_WINDOW (filesel),
@@ -161,13 +165,15 @@ e_contact_list_save_as(char *title, GList *list, GtkWindow *parent_window)
/* This is a filename. Translators take note. */
if (list && list->data && list->next == NULL) {
- char *name, *file;
- g_object_get (list->data,
- "file_as", &name,
- NULL);
- file = make_safe_filename (g_get_home_dir(), name);
+ char *name, *locale_name, *file;
+ gtk_object_get (GTK_OBJECT (list->data),
+ "file_as", &name,
+ NULL);
+ locale_name = e_utf8_to_locale_string (name);
+ file = make_safe_filename (g_get_home_dir(), locale_name);
gtk_file_selection_set_filename (filesel, file);
g_free (file);
+ g_free (locale_name);
} else {
char *file;
file = make_safe_filename (g_get_home_dir(), _("list"));
@@ -178,11 +184,12 @@ e_contact_list_save_as(char *title, GList *list, GtkWindow *parent_window)
info->filesel = filesel;
info->vcard = e_card_list_get_vcard (list);
- g_signal_connect(filesel->ok_button, "clicked",
- G_CALLBACK (save_it), info);
- g_signal_connect(filesel->cancel_button, "clicked",
- G_CALLBACK (close_it), info);
- g_object_weak_ref (G_OBJECT (filesel), destroy_it, info);
+ gtk_signal_connect(GTK_OBJECT(filesel->ok_button), "clicked",
+ save_it, info);
+ gtk_signal_connect(GTK_OBJECT(filesel->cancel_button), "clicked",
+ close_it, info);
+ gtk_signal_connect(GTK_OBJECT(filesel), "destroy",
+ destroy_it, info);
if (parent_window) {
gtk_window_set_transient_for (GTK_WINDOW (filesel),
@@ -193,24 +200,31 @@ e_contact_list_save_as(char *title, GList *list, GtkWindow *parent_window)
gtk_widget_show(GTK_WIDGET(filesel));
}
-static gint
+static int
file_exists(GtkFileSelection *filesel, const char *filename)
{
- GtkWidget *dialog;
- gint response;
-
- dialog = gtk_message_dialog_new (GTK_WINDOW (filesel),
- 0,
- GTK_MESSAGE_QUESTION,
- GTK_BUTTONS_NONE,
- _("%s already exists\nDo you want to overwrite it?"), filename);
-
- gtk_dialog_add_buttons (GTK_DIALOG (dialog),
- GTK_STOCK_CANCEL, GTK_RESPONSE_REJECT,
- _("Overwrite"), GTK_RESPONSE_ACCEPT,
- NULL);
+ GnomeDialog *dialog = NULL;
+ GtkWidget *label;
+ GladeXML *gui = NULL;
+ int result = 0;
+ char *string;
+
+ gui = glade_xml_new (EVOLUTION_GLADEDIR "/file-exists.glade", NULL);
+ dialog = GNOME_DIALOG(glade_xml_get_widget(gui, "dialog-exists"));
+
+ label = glade_xml_get_widget (gui, "label-exists");
+ if (GTK_IS_LABEL (label)) {
+ string = g_strdup_printf (_("%s already exists\nDo you want to overwrite it?"), filename);
+ gtk_label_set_text (GTK_LABEL (label), string);
+ g_free (string);
+ }
+
+ gnome_dialog_set_parent(dialog, GTK_WINDOW(filesel));
+
+ gtk_widget_show (GTK_WIDGET (dialog));
+ result = gnome_dialog_run_and_close(dialog);
+
+ g_free(gui);
- response = gtk_dialog_run (GTK_DIALOG (dialog));
- gtk_widget_destroy (dialog);
- return response;
+ return result;
}
diff --git a/addressbook/gui/contact-editor/fulladdr.glade b/addressbook/gui/contact-editor/fulladdr.glade
index 023c0b57be..fc767c1c89 100644
--- a/addressbook/gui/contact-editor/fulladdr.glade
+++ b/addressbook/gui/contact-editor/fulladdr.glade
@@ -1,446 +1,473 @@
-<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*-->
-<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd">
+<?xml version="1.0"?>
+<GTK-Interface>
-<glade-interface>
+<project>
+ <name>fulladdr</name>
+ <program_name>fulladdr</program_name>
+ <directory></directory>
+ <source_directory>src</source_directory>
+ <pixmaps_directory>pixmaps</pixmaps_directory>
+ <language>C</language>
+ <gnome_support>True</gnome_support>
+ <gettext_support>True</gettext_support>
+ <use_widget_names>True</use_widget_names>
+ <output_main_file>False</output_main_file>
+ <output_support_files>False</output_support_files>
+ <output_build_files>False</output_build_files>
+</project>
-<widget class="GtkDialog" id="dialog-checkaddress">
- <property name="title" translatable="yes">Check Address</property>
- <property name="type">GTK_WINDOW_TOPLEVEL</property>
- <property name="window_position">GTK_WIN_POS_NONE</property>
- <property name="modal">True</property>
- <property name="resizable">True</property>
- <property name="destroy_with_parent">False</property>
- <property name="has_separator">True</property>
+<widget>
+ <class>GnomeDialog</class>
+ <name>dialog-checkaddress</name>
+ <visible>False</visible>
+ <title>Check Address</title>
+ <type>GTK_WINDOW_TOPLEVEL</type>
+ <position>GTK_WIN_POS_NONE</position>
+ <modal>True</modal>
+ <allow_shrink>False</allow_shrink>
+ <allow_grow>True</allow_grow>
+ <auto_shrink>False</auto_shrink>
+ <auto_close>False</auto_close>
+ <hide_on_close>False</hide_on_close>
- <child internal-child="vbox">
- <widget class="GtkVBox" id="vbox-container">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">8</property>
-
- <child internal-child="action_area">
- <widget class="GtkHButtonBox" id="hbuttonbox1">
- <property name="visible">True</property>
- <property name="layout_style">GTK_BUTTONBOX_END</property>
-
- <child>
- <widget class="GtkButton" id="button1">
- <property name="visible">True</property>
- <property name="can_default">True</property>
- <property name="has_default">True</property>
- <property name="can_focus">True</property>
- <property name="label">gtk-ok</property>
- <property name="use_stock">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="response_id">0</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkButton" id="button2">
- <property name="visible">True</property>
- <property name="can_default">True</property>
- <property name="can_focus">True</property>
- <property name="label">gtk-cancel</property>
- <property name="use_stock">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="response_id">0</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="pack_type">GTK_PACK_END</property>
- </packing>
- </child>
+ <widget>
+ <class>GtkVBox</class>
+ <child_name>GnomeDialog:vbox</child_name>
+ <name>vbox-container</name>
+ <homogeneous>False</homogeneous>
+ <spacing>8</spacing>
+ <child>
+ <padding>4</padding>
+ <expand>True</expand>
+ <fill>True</fill>
+ </child>
+ <widget>
+ <class>GtkHButtonBox</class>
+ <child_name>GnomeDialog:action_area</child_name>
+ <name>hbuttonbox1</name>
+ <layout_style>GTK_BUTTONBOX_END</layout_style>
+ <spacing>8</spacing>
+ <child_min_width>85</child_min_width>
+ <child_min_height>27</child_min_height>
+ <child_ipad_x>7</child_ipad_x>
+ <child_ipad_y>0</child_ipad_y>
<child>
- <widget class="GtkTable" id="table-checkaddress">
- <property name="border_width">8</property>
- <property name="visible">True</property>
- <property name="n_rows">4</property>
- <property name="n_columns">4</property>
- <property name="homogeneous">False</property>
- <property name="row_spacing">6</property>
- <property name="column_spacing">6</property>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>True</fill>
+ <pack>GTK_PACK_END</pack>
+ </child>
- <child>
- <widget class="GtkLabel" id="label-street">
- <property name="visible">True</property>
- <property name="label" translatable="yes">_Address:</property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">1</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="mnemonic_widget">entry-street</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
+ <widget>
+ <class>GtkButton</class>
+ <name>button1</name>
+ <can_default>True</can_default>
+ <has_default>True</has_default>
+ <can_focus>True</can_focus>
+ <stock_button>GNOME_STOCK_BUTTON_OK</stock_button>
+ </widget>
- <child>
- <widget class="GtkLabel" id="label-city">
- <property name="visible">True</property>
- <property name="label" translatable="yes">_City:</property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">1</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="mnemonic_widget">entry-city</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">2</property>
- <property name="bottom_attach">3</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
+ <widget>
+ <class>GtkButton</class>
+ <name>button2</name>
+ <can_default>True</can_default>
+ <can_focus>True</can_focus>
+ <stock_button>GNOME_STOCK_BUTTON_CANCEL</stock_button>
+ </widget>
+ </widget>
- <child>
- <widget class="GtkEntry" id="entry-city">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="editable">True</property>
- <property name="visibility">True</property>
- <property name="max_length">0</property>
- <property name="text" translatable="yes"></property>
- <property name="has_frame">True</property>
- <property name="invisible_char" translatable="yes">*</property>
- <property name="activates_default">False</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">2</property>
- <property name="bottom_attach">3</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
+ <widget>
+ <class>GtkTable</class>
+ <name>table-checkaddress</name>
+ <border_width>8</border_width>
+ <rows>4</rows>
+ <columns>4</columns>
+ <homogeneous>False</homogeneous>
+ <row_spacing>6</row_spacing>
+ <column_spacing>6</column_spacing>
+ <child>
+ <padding>0</padding>
+ <expand>True</expand>
+ <fill>True</fill>
+ </child>
- <child>
- <widget class="GtkEntry" id="entry-ext">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="editable">True</property>
- <property name="visibility">True</property>
- <property name="max_length">0</property>
- <property name="text" translatable="yes"></property>
- <property name="has_frame">True</property>
- <property name="invisible_char" translatable="yes">*</property>
- <property name="activates_default">False</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
+ <widget>
+ <class>GtkLabel</class>
+ <name>label-street</name>
+ <label>_Address:</label>
+ <justify>GTK_JUSTIFY_LEFT</justify>
+ <wrap>False</wrap>
+ <xalign>1</xalign>
+ <yalign>0.5</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <focus_target>entry-street</focus_target>
+ <child>
+ <left_attach>0</left_attach>
+ <right_attach>1</right_attach>
+ <top_attach>0</top_attach>
+ <bottom_attach>1</bottom_attach>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <xexpand>False</xexpand>
+ <yexpand>False</yexpand>
+ <xshrink>False</xshrink>
+ <yshrink>False</yshrink>
+ <xfill>True</xfill>
+ <yfill>True</yfill>
+ </child>
+ </widget>
- <child>
- <widget class="GtkLabel" id="label-po">
- <property name="visible">True</property>
- <property name="label" translatable="yes">_PO Box:</property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">1</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="mnemonic_widget">entry-po</property>
- </widget>
- <packing>
- <property name="left_attach">2</property>
- <property name="right_attach">3</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
+ <widget>
+ <class>GtkLabel</class>
+ <name>label-city</name>
+ <label>_City:</label>
+ <justify>GTK_JUSTIFY_CENTER</justify>
+ <wrap>False</wrap>
+ <xalign>1</xalign>
+ <yalign>0.5</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <focus_target>entry-city</focus_target>
+ <child>
+ <left_attach>0</left_attach>
+ <right_attach>1</right_attach>
+ <top_attach>2</top_attach>
+ <bottom_attach>3</bottom_attach>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <xexpand>False</xexpand>
+ <yexpand>False</yexpand>
+ <xshrink>False</xshrink>
+ <yshrink>False</yshrink>
+ <xfill>True</xfill>
+ <yfill>True</yfill>
+ </child>
+ </widget>
- <child>
- <widget class="GtkLabel" id="label-ext">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Address _2:</property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">1</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="mnemonic_widget">entry-ext</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
+ <widget>
+ <class>GtkEntry</class>
+ <name>entry-city</name>
+ <can_focus>True</can_focus>
+ <editable>True</editable>
+ <text_visible>True</text_visible>
+ <text_max_length>0</text_max_length>
+ <text></text>
+ <child>
+ <left_attach>1</left_attach>
+ <right_attach>2</right_attach>
+ <top_attach>2</top_attach>
+ <bottom_attach>3</bottom_attach>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <xexpand>True</xexpand>
+ <yexpand>False</yexpand>
+ <xshrink>False</xshrink>
+ <yshrink>False</yshrink>
+ <xfill>True</xfill>
+ <yfill>True</yfill>
+ </child>
+ </widget>
- <child>
- <widget class="GtkEntry" id="entry-po">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="editable">True</property>
- <property name="visibility">True</property>
- <property name="max_length">0</property>
- <property name="text" translatable="yes"></property>
- <property name="has_frame">True</property>
- <property name="invisible_char" translatable="yes">*</property>
- <property name="activates_default">False</property>
- </widget>
- <packing>
- <property name="left_attach">3</property>
- <property name="right_attach">4</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
+ <widget>
+ <class>GtkEntry</class>
+ <name>entry-ext</name>
+ <width>100</width>
+ <can_focus>True</can_focus>
+ <editable>True</editable>
+ <text_visible>True</text_visible>
+ <text_max_length>0</text_max_length>
+ <text></text>
+ <child>
+ <left_attach>1</left_attach>
+ <right_attach>2</right_attach>
+ <top_attach>1</top_attach>
+ <bottom_attach>2</bottom_attach>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <xexpand>True</xexpand>
+ <yexpand>False</yexpand>
+ <xshrink>False</xshrink>
+ <yshrink>False</yshrink>
+ <xfill>True</xfill>
+ <yfill>True</yfill>
+ </child>
+ </widget>
- <child>
- <widget class="GtkEntry" id="entry-street">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="has_focus">True</property>
- <property name="editable">True</property>
- <property name="visibility">True</property>
- <property name="max_length">0</property>
- <property name="text" translatable="yes"></property>
- <property name="has_frame">True</property>
- <property name="invisible_char" translatable="yes">*</property>
- <property name="activates_default">False</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">4</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
+ <widget>
+ <class>GtkLabel</class>
+ <name>label-po</name>
+ <label>_PO Box:</label>
+ <justify>GTK_JUSTIFY_CENTER</justify>
+ <wrap>False</wrap>
+ <xalign>1</xalign>
+ <yalign>0.5</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <focus_target>entry-po</focus_target>
+ <child>
+ <left_attach>2</left_attach>
+ <right_attach>3</right_attach>
+ <top_attach>1</top_attach>
+ <bottom_attach>2</bottom_attach>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <xexpand>False</xexpand>
+ <yexpand>False</yexpand>
+ <xshrink>False</xshrink>
+ <yshrink>False</yshrink>
+ <xfill>True</xfill>
+ <yfill>True</yfill>
+ </child>
+ </widget>
- <child>
- <widget class="GtkLabel" id="label-region">
- <property name="visible">True</property>
- <property name="label" translatable="yes">_State/Province:</property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">1</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="mnemonic_widget">entry-region</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">3</property>
- <property name="bottom_attach">4</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
+ <widget>
+ <class>GtkLabel</class>
+ <name>label-ext</name>
+ <label>Address _2:</label>
+ <justify>GTK_JUSTIFY_CENTER</justify>
+ <wrap>False</wrap>
+ <xalign>1</xalign>
+ <yalign>0.5</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <focus_target>entry-ext</focus_target>
+ <child>
+ <left_attach>0</left_attach>
+ <right_attach>1</right_attach>
+ <top_attach>1</top_attach>
+ <bottom_attach>2</bottom_attach>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <xexpand>False</xexpand>
+ <yexpand>False</yexpand>
+ <xshrink>False</xshrink>
+ <yshrink>False</yshrink>
+ <xfill>True</xfill>
+ <yfill>True</yfill>
+ </child>
+ </widget>
- <child>
- <widget class="GtkEntry" id="entry-region">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="editable">True</property>
- <property name="visibility">True</property>
- <property name="max_length">0</property>
- <property name="text" translatable="yes"></property>
- <property name="has_frame">True</property>
- <property name="invisible_char" translatable="yes">*</property>
- <property name="activates_default">False</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">3</property>
- <property name="bottom_attach">4</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
+ <widget>
+ <class>GtkEntry</class>
+ <name>entry-po</name>
+ <width>100</width>
+ <can_focus>True</can_focus>
+ <editable>True</editable>
+ <text_visible>True</text_visible>
+ <text_max_length>0</text_max_length>
+ <text></text>
+ <child>
+ <left_attach>3</left_attach>
+ <right_attach>4</right_attach>
+ <top_attach>1</top_attach>
+ <bottom_attach>2</bottom_attach>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <xexpand>False</xexpand>
+ <yexpand>False</yexpand>
+ <xshrink>False</xshrink>
+ <yshrink>False</yshrink>
+ <xfill>True</xfill>
+ <yfill>True</yfill>
+ </child>
+ </widget>
- <child>
- <widget class="GtkCombo" id="combo-country">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="value_in_list">False</property>
- <property name="allow_empty">True</property>
- <property name="case_sensitive">False</property>
- <property name="enable_arrow_keys">True</property>
- <property name="enable_arrows_always">False</property>
+ <widget>
+ <class>GtkEntry</class>
+ <name>entry-street</name>
+ <can_focus>True</can_focus>
+ <has_focus>True</has_focus>
+ <editable>True</editable>
+ <text_visible>True</text_visible>
+ <text_max_length>0</text_max_length>
+ <text></text>
+ <child>
+ <left_attach>1</left_attach>
+ <right_attach>4</right_attach>
+ <top_attach>0</top_attach>
+ <bottom_attach>1</bottom_attach>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <xexpand>True</xexpand>
+ <yexpand>False</yexpand>
+ <xshrink>False</xshrink>
+ <yshrink>False</yshrink>
+ <xfill>True</xfill>
+ <yfill>True</yfill>
+ </child>
+ </widget>
- <child internal-child="entry">
- <widget class="GtkEntry" id="entry-country">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="editable">True</property>
- <property name="visibility">True</property>
- <property name="max_length">0</property>
- <property name="text" translatable="yes"></property>
- <property name="has_frame">True</property>
- <property name="invisible_char" translatable="yes">*</property>
- <property name="activates_default">False</property>
- </widget>
- </child>
+ <widget>
+ <class>GtkLabel</class>
+ <name>label-region</name>
+ <label>_State/Province:</label>
+ <justify>GTK_JUSTIFY_CENTER</justify>
+ <wrap>False</wrap>
+ <xalign>1</xalign>
+ <yalign>0.5</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <focus_target>entry-region</focus_target>
+ <child>
+ <left_attach>0</left_attach>
+ <right_attach>1</right_attach>
+ <top_attach>3</top_attach>
+ <bottom_attach>4</bottom_attach>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <xexpand>False</xexpand>
+ <yexpand>False</yexpand>
+ <xshrink>False</xshrink>
+ <yshrink>False</yshrink>
+ <xfill>True</xfill>
+ <yfill>True</yfill>
+ </child>
+ </widget>
- <child internal-child="list">
- <widget class="GtkList" id="convertwidget1">
- <property name="visible">True</property>
- <property name="selection_mode">GTK_SELECTION_BROWSE</property>
+ <widget>
+ <class>GtkEntry</class>
+ <name>entry-region</name>
+ <can_focus>True</can_focus>
+ <editable>True</editable>
+ <text_visible>True</text_visible>
+ <text_max_length>0</text_max_length>
+ <text></text>
+ <child>
+ <left_attach>1</left_attach>
+ <right_attach>2</right_attach>
+ <top_attach>3</top_attach>
+ <bottom_attach>4</bottom_attach>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <xexpand>True</xexpand>
+ <yexpand>False</yexpand>
+ <xshrink>False</xshrink>
+ <yshrink>False</yshrink>
+ <xfill>True</xfill>
+ <yfill>True</yfill>
+ </child>
+ </widget>
- <child>
- <widget class="GtkListItem" id="convertwidget2">
- <property name="visible">True</property>
+ <widget>
+ <class>GtkCombo</class>
+ <name>combo-country</name>
+ <width>100</width>
+ <can_focus>True</can_focus>
+ <value_in_list>False</value_in_list>
+ <ok_if_empty>True</ok_if_empty>
+ <case_sensitive>False</case_sensitive>
+ <use_arrows>True</use_arrows>
+ <use_arrows_always>False</use_arrows_always>
+ <items></items>
+ <child>
+ <left_attach>3</left_attach>
+ <right_attach>4</right_attach>
+ <top_attach>3</top_attach>
+ <bottom_attach>4</bottom_attach>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <xexpand>False</xexpand>
+ <yexpand>False</yexpand>
+ <xshrink>False</xshrink>
+ <yshrink>False</yshrink>
+ <xfill>True</xfill>
+ <yfill>True</yfill>
+ </child>
- <child>
- <widget class="GtkLabel" id="convertwidget3">
- <property name="visible">True</property>
- <property name="label" translatable="yes"></property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- </child>
- </widget>
- </child>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="left_attach">3</property>
- <property name="right_attach">4</property>
- <property name="top_attach">3</property>
- <property name="bottom_attach">4</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
+ <widget>
+ <class>GtkEntry</class>
+ <child_name>GtkCombo:entry</child_name>
+ <name>entry-country</name>
+ <can_focus>True</can_focus>
+ <editable>True</editable>
+ <text_visible>True</text_visible>
+ <text_max_length>0</text_max_length>
+ <text></text>
+ </widget>
+ </widget>
- <child>
- <widget class="GtkEntry" id="entry-code">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="editable">True</property>
- <property name="visibility">True</property>
- <property name="max_length">0</property>
- <property name="text" translatable="yes"></property>
- <property name="has_frame">True</property>
- <property name="invisible_char" translatable="yes">*</property>
- <property name="activates_default">False</property>
- </widget>
- <packing>
- <property name="left_attach">3</property>
- <property name="right_attach">4</property>
- <property name="top_attach">2</property>
- <property name="bottom_attach">3</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
+ <widget>
+ <class>GtkEntry</class>
+ <name>entry-code</name>
+ <width>100</width>
+ <can_focus>True</can_focus>
+ <editable>True</editable>
+ <text_visible>True</text_visible>
+ <text_max_length>0</text_max_length>
+ <text></text>
+ <child>
+ <left_attach>3</left_attach>
+ <right_attach>4</right_attach>
+ <top_attach>2</top_attach>
+ <bottom_attach>3</bottom_attach>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <xexpand>False</xexpand>
+ <yexpand>False</yexpand>
+ <xshrink>False</xshrink>
+ <yshrink>False</yshrink>
+ <xfill>True</xfill>
+ <yfill>True</yfill>
+ </child>
+ </widget>
- <child>
- <widget class="GtkLabel" id="label-code">
- <property name="visible">True</property>
- <property name="label" translatable="yes">_ZIP Code:</property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">1</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="mnemonic_widget">entry-code</property>
- </widget>
- <packing>
- <property name="left_attach">2</property>
- <property name="right_attach">3</property>
- <property name="top_attach">2</property>
- <property name="bottom_attach">3</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
+ <widget>
+ <class>GtkLabel</class>
+ <name>label-code</name>
+ <label>_ZIP Code:</label>
+ <justify>GTK_JUSTIFY_CENTER</justify>
+ <wrap>False</wrap>
+ <xalign>1</xalign>
+ <yalign>0.5</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <focus_target>entry-code</focus_target>
+ <child>
+ <left_attach>2</left_attach>
+ <right_attach>3</right_attach>
+ <top_attach>2</top_attach>
+ <bottom_attach>3</bottom_attach>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <xexpand>False</xexpand>
+ <yexpand>False</yexpand>
+ <xshrink>False</xshrink>
+ <yshrink>False</yshrink>
+ <xfill>True</xfill>
+ <yfill>True</yfill>
+ </child>
+ </widget>
- <child>
- <widget class="GtkLabel" id="label-country">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Countr_y:</property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">1</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="mnemonic_widget">entry-country</property>
- </widget>
- <packing>
- <property name="left_attach">2</property>
- <property name="right_attach">3</property>
- <property name="top_attach">3</property>
- <property name="bottom_attach">4</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
+ <widget>
+ <class>GtkLabel</class>
+ <name>label-country</name>
+ <label>Countr_y:</label>
+ <justify>GTK_JUSTIFY_CENTER</justify>
+ <wrap>False</wrap>
+ <xalign>1</xalign>
+ <yalign>0.5</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <focus_target>entry-country</focus_target>
+ <child>
+ <left_attach>2</left_attach>
+ <right_attach>3</right_attach>
+ <top_attach>3</top_attach>
+ <bottom_attach>4</bottom_attach>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <xexpand>False</xexpand>
+ <yexpand>False</yexpand>
+ <xshrink>False</xshrink>
+ <yshrink>False</yshrink>
+ <xfill>True</xfill>
+ <yfill>True</yfill>
+ </child>
+ </widget>
</widget>
- </child>
+ </widget>
</widget>
-</glade-interface>
+</GTK-Interface>
diff --git a/addressbook/gui/contact-editor/fullname.glade b/addressbook/gui/contact-editor/fullname.glade
index f890d2cb88..fad1642d89 100644
--- a/addressbook/gui/contact-editor/fullname.glade
+++ b/addressbook/gui/contact-editor/fullname.glade
@@ -1,674 +1,389 @@
-<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*-->
-<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd">
-
-<glade-interface>
-
-<widget class="GtkDialog" id="dialog-checkfullname">
- <property name="title" translatable="yes">Check Full Name</property>
- <property name="type">GTK_WINDOW_TOPLEVEL</property>
- <property name="window_position">GTK_WIN_POS_NONE</property>
- <property name="modal">True</property>
- <property name="resizable">True</property>
- <property name="destroy_with_parent">False</property>
- <property name="has_separator">True</property>
-
- <child internal-child="vbox">
- <widget class="GtkVBox" id="vbox-container">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">8</property>
-
- <child internal-child="action_area">
- <widget class="GtkHButtonBox" id="hbuttonbox1">
- <property name="visible">True</property>
- <property name="layout_style">GTK_BUTTONBOX_END</property>
-
- <child>
- <widget class="GtkButton" id="button1">
- <property name="visible">True</property>
- <property name="can_default">True</property>
- <property name="can_focus">True</property>
- <property name="label">gtk-ok</property>
- <property name="use_stock">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="response_id">0</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkButton" id="button2">
- <property name="visible">True</property>
- <property name="can_default">True</property>
- <property name="can_focus">True</property>
- <property name="label">gtk-cancel</property>
- <property name="use_stock">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="response_id">0</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="pack_type">GTK_PACK_END</property>
- </packing>
- </child>
-
+<?xml version="1.0"?>
+<GTK-Interface>
+
+<project>
+ <name>fullname</name>
+ <program_name>fullname</program_name>
+ <directory></directory>
+ <source_directory>src</source_directory>
+ <pixmaps_directory>pixmaps</pixmaps_directory>
+ <language>C</language>
+ <gnome_support>True</gnome_support>
+ <gettext_support>True</gettext_support>
+ <use_widget_names>True</use_widget_names>
+ <output_main_file>False</output_main_file>
+ <output_support_files>False</output_support_files>
+ <output_build_files>False</output_build_files>
+</project>
+
+<widget>
+ <class>GnomeDialog</class>
+ <name>dialog-checkfullname</name>
+ <visible>False</visible>
+ <title>Check Full Name</title>
+ <type>GTK_WINDOW_TOPLEVEL</type>
+ <position>GTK_WIN_POS_NONE</position>
+ <modal>True</modal>
+ <allow_shrink>True</allow_shrink>
+ <allow_grow>True</allow_grow>
+ <auto_shrink>False</auto_shrink>
+ <auto_close>False</auto_close>
+ <hide_on_close>False</hide_on_close>
+
+ <widget>
+ <class>GtkVBox</class>
+ <child_name>GnomeDialog:vbox</child_name>
+ <name>vbox-container</name>
+ <homogeneous>False</homogeneous>
+ <spacing>8</spacing>
+ <child>
+ <padding>4</padding>
+ <expand>True</expand>
+ <fill>True</fill>
+ </child>
+
+ <widget>
+ <class>GtkHButtonBox</class>
+ <child_name>GnomeDialog:action_area</child_name>
+ <name>hbuttonbox1</name>
+ <layout_style>GTK_BUTTONBOX_END</layout_style>
+ <spacing>8</spacing>
+ <child_min_width>85</child_min_width>
+ <child_min_height>27</child_min_height>
+ <child_ipad_x>7</child_ipad_x>
+ <child_ipad_y>0</child_ipad_y>
<child>
- <widget class="GtkTable" id="table-checkfullname">
- <property name="border_width">8</property>
- <property name="visible">True</property>
- <property name="n_rows">5</property>
- <property name="n_columns">3</property>
- <property name="homogeneous">False</property>
- <property name="row_spacing">6</property>
- <property name="column_spacing">21</property>
-
- <child>
- <widget class="GtkCombo" id="combo-title">
- <property name="visible">True</property>
- <property name="value_in_list">False</property>
- <property name="allow_empty">True</property>
- <property name="case_sensitive">False</property>
- <property name="enable_arrow_keys">True</property>
- <property name="enable_arrows_always">False</property>
-
- <child internal-child="entry">
- <widget class="GtkEntry" id="entry-title">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="editable">True</property>
- <property name="visibility">True</property>
- <property name="max_length">0</property>
- <property name="text" translatable="yes"></property>
- <property name="has_frame">True</property>
- <property name="invisible_char" translatable="yes">*</property>
- <property name="activates_default">False</property>
- </widget>
- </child>
-
- <child internal-child="list">
- <widget class="GtkList" id="convertwidget1">
- <property name="visible">True</property>
- <property name="selection_mode">GTK_SELECTION_BROWSE</property>
-
- <child>
- <widget class="GtkListItem" id="convertwidget2">
- <property name="visible">True</property>
-
- <child>
- <widget class="GtkLabel" id="convertwidget3">
- <property name="visible">True</property>
- <property name="label" translatable="yes"></property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- </child>
- </widget>
- </child>
-
- <child>
- <widget class="GtkListItem" id="convertwidget4">
- <property name="visible">True</property>
-
- <child>
- <widget class="GtkLabel" id="convertwidget5">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Mr.</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- </child>
- </widget>
- </child>
-
- <child>
- <widget class="GtkListItem" id="convertwidget6">
- <property name="visible">True</property>
-
- <child>
- <widget class="GtkLabel" id="convertwidget7">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Mrs.</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- </child>
- </widget>
- </child>
-
- <child>
- <widget class="GtkListItem" id="convertwidget8">
- <property name="visible">True</property>
-
- <child>
- <widget class="GtkLabel" id="convertwidget9">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Ms.</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- </child>
- </widget>
- </child>
-
- <child>
- <widget class="GtkListItem" id="convertwidget10">
- <property name="visible">True</property>
-
- <child>
- <widget class="GtkLabel" id="convertwidget11">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Miss</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- </child>
- </widget>
- </child>
-
- <child>
- <widget class="GtkListItem" id="convertwidget12">
- <property name="visible">True</property>
-
- <child>
- <widget class="GtkLabel" id="convertwidget13">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Dr.</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- </child>
- </widget>
- </child>
-
- <child>
- <widget class="GtkListItem" id="convertwidget14">
- <property name="visible">True</property>
-
- <child>
- <widget class="GtkLabel" id="convertwidget15">
- <property name="visible">True</property>
- <property name="label" translatable="yes"></property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- </child>
- </widget>
- </child>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkCombo" id="combo-suffix">
- <property name="visible">True</property>
- <property name="value_in_list">False</property>
- <property name="allow_empty">True</property>
- <property name="case_sensitive">False</property>
- <property name="enable_arrow_keys">True</property>
- <property name="enable_arrows_always">False</property>
-
- <child internal-child="entry">
- <widget class="GtkEntry" id="entry-suffix">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="editable">True</property>
- <property name="visibility">True</property>
- <property name="max_length">0</property>
- <property name="text" translatable="yes"></property>
- <property name="has_frame">True</property>
- <property name="invisible_char" translatable="yes">*</property>
- <property name="activates_default">False</property>
- </widget>
- </child>
-
- <child internal-child="list">
- <widget class="GtkList" id="convertwidget16">
- <property name="visible">True</property>
- <property name="selection_mode">GTK_SELECTION_BROWSE</property>
-
- <child>
- <widget class="GtkListItem" id="convertwidget17">
- <property name="visible">True</property>
-
- <child>
- <widget class="GtkLabel" id="convertwidget18">
- <property name="visible">True</property>
- <property name="label" translatable="yes"></property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- </child>
- </widget>
- </child>
-
- <child>
- <widget class="GtkListItem" id="convertwidget19">
- <property name="visible">True</property>
-
- <child>
- <widget class="GtkLabel" id="convertwidget20">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Sr.</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- </child>
- </widget>
- </child>
-
- <child>
- <widget class="GtkListItem" id="convertwidget21">
- <property name="visible">True</property>
-
- <child>
- <widget class="GtkLabel" id="convertwidget22">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Jr.</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- </child>
- </widget>
- </child>
-
- <child>
- <widget class="GtkListItem" id="convertwidget23">
- <property name="visible">True</property>
-
- <child>
- <widget class="GtkLabel" id="convertwidget24">
- <property name="visible">True</property>
- <property name="label" translatable="yes">I</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- </child>
- </widget>
- </child>
-
- <child>
- <widget class="GtkListItem" id="convertwidget25">
- <property name="visible">True</property>
-
- <child>
- <widget class="GtkLabel" id="convertwidget26">
- <property name="visible">True</property>
- <property name="label" translatable="yes">II</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- </child>
- </widget>
- </child>
-
- <child>
- <widget class="GtkListItem" id="convertwidget27">
- <property name="visible">True</property>
-
- <child>
- <widget class="GtkLabel" id="convertwidget28">
- <property name="visible">True</property>
- <property name="label" translatable="yes">III</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- </child>
- </widget>
- </child>
-
- <child>
- <widget class="GtkListItem" id="convertwidget29">
- <property name="visible">True</property>
-
- <child>
- <widget class="GtkLabel" id="convertwidget30">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Esq.</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- </child>
- </widget>
- </child>
-
- <child>
- <widget class="GtkListItem" id="convertwidget31">
- <property name="visible">True</property>
-
- <child>
- <widget class="GtkLabel" id="convertwidget32">
- <property name="visible">True</property>
- <property name="label" translatable="yes"></property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- </child>
- </widget>
- </child>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">4</property>
- <property name="bottom_attach">5</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkEntry" id="entry-first">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="editable">True</property>
- <property name="visibility">True</property>
- <property name="max_length">0</property>
- <property name="text" translatable="yes"></property>
- <property name="has_frame">True</property>
- <property name="invisible_char" translatable="yes">*</property>
- <property name="activates_default">False</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">3</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkEntry" id="entry-middle">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="editable">True</property>
- <property name="visibility">True</property>
- <property name="max_length">0</property>
- <property name="text" translatable="yes"></property>
- <property name="has_frame">True</property>
- <property name="invisible_char" translatable="yes">*</property>
- <property name="activates_default">False</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">3</property>
- <property name="top_attach">2</property>
- <property name="bottom_attach">3</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkEntry" id="entry-last">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="editable">True</property>
- <property name="visibility">True</property>
- <property name="max_length">0</property>
- <property name="text" translatable="yes"></property>
- <property name="has_frame">True</property>
- <property name="invisible_char" translatable="yes">*</property>
- <property name="activates_default">False</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">3</property>
- <property name="top_attach">3</property>
- <property name="bottom_attach">4</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label-first">
- <property name="visible">True</property>
- <property name="label" translatable="yes">_First:</property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="mnemonic_widget">entry-first</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label-title">
- <property name="visible">True</property>
- <property name="label" translatable="yes">_Title:</property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="mnemonic_widget">entry-title</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>True</fill>
+ <pack>GTK_PACK_END</pack>
+ </child>
- <child>
- <widget class="GtkLabel" id="label-middle">
- <property name="visible">True</property>
- <property name="label" translatable="yes">_Middle:</property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="mnemonic_widget">entry-middle</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">2</property>
- <property name="bottom_attach">3</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
+ <widget>
+ <class>GtkButton</class>
+ <name>button1</name>
+ <can_default>True</can_default>
+ <can_focus>True</can_focus>
+ <stock_button>GNOME_STOCK_BUTTON_OK</stock_button>
+ </widget>
+
+ <widget>
+ <class>GtkButton</class>
+ <name>button2</name>
+ <can_default>True</can_default>
+ <can_focus>True</can_focus>
+ <stock_button>GNOME_STOCK_BUTTON_CANCEL</stock_button>
+ </widget>
+ </widget>
- <child>
- <widget class="GtkLabel" id="label-last">
- <property name="visible">True</property>
- <property name="label" translatable="yes">_Last:</property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="mnemonic_widget">entry-last</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">3</property>
- <property name="bottom_attach">4</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
+ <widget>
+ <class>GtkTable</class>
+ <name>table-checkfullname</name>
+ <border_width>8</border_width>
+ <rows>5</rows>
+ <columns>3</columns>
+ <homogeneous>False</homogeneous>
+ <row_spacing>6</row_spacing>
+ <column_spacing>21</column_spacing>
+ <child>
+ <padding>0</padding>
+ <expand>True</expand>
+ <fill>True</fill>
+ </child>
- <child>
- <widget class="GtkLabel" id="label-suffix">
- <property name="visible">True</property>
- <property name="label" translatable="yes">_Suffix:</property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="mnemonic_widget">entry-suffix</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">4</property>
- <property name="bottom_attach">5</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
+ <widget>
+ <class>GtkCombo</class>
+ <name>combo-title</name>
+ <value_in_list>False</value_in_list>
+ <ok_if_empty>True</ok_if_empty>
+ <case_sensitive>False</case_sensitive>
+ <use_arrows>True</use_arrows>
+ <use_arrows_always>False</use_arrows_always>
+ <items>
+Mr.
+Mrs.
+Ms.
+Miss
+Dr.
+</items>
+ <child>
+ <left_attach>1</left_attach>
+ <right_attach>2</right_attach>
+ <top_attach>0</top_attach>
+ <bottom_attach>1</bottom_attach>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <xexpand>True</xexpand>
+ <yexpand>False</yexpand>
+ <xshrink>False</xshrink>
+ <yshrink>False</yshrink>
+ <xfill>True</xfill>
+ <yfill>False</yfill>
+ </child>
+
+ <widget>
+ <class>GtkEntry</class>
+ <child_name>GtkCombo:entry</child_name>
+ <name>entry-title</name>
+ <can_focus>True</can_focus>
+ <editable>True</editable>
+ <text_visible>True</text_visible>
+ <text_max_length>0</text_max_length>
+ <text></text>
</widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
+ </widget>
+
+ <widget>
+ <class>GtkCombo</class>
+ <name>combo-suffix</name>
+ <value_in_list>False</value_in_list>
+ <ok_if_empty>True</ok_if_empty>
+ <case_sensitive>False</case_sensitive>
+ <use_arrows>True</use_arrows>
+ <use_arrows_always>False</use_arrows_always>
+ <items>
+Sr.
+Jr.
+I
+II
+III
+Esq.
+</items>
+ <child>
+ <left_attach>1</left_attach>
+ <right_attach>2</right_attach>
+ <top_attach>4</top_attach>
+ <bottom_attach>5</bottom_attach>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <xexpand>True</xexpand>
+ <yexpand>False</yexpand>
+ <xshrink>False</xshrink>
+ <yshrink>False</yshrink>
+ <xfill>True</xfill>
+ <yfill>False</yfill>
+ </child>
+
+ <widget>
+ <class>GtkEntry</class>
+ <child_name>GtkCombo:entry</child_name>
+ <name>entry-suffix</name>
+ <can_focus>True</can_focus>
+ <editable>True</editable>
+ <text_visible>True</text_visible>
+ <text_max_length>0</text_max_length>
+ <text></text>
+ </widget>
+ </widget>
+
+ <widget>
+ <class>GtkEntry</class>
+ <name>entry-first</name>
+ <can_focus>True</can_focus>
+ <editable>True</editable>
+ <text_visible>True</text_visible>
+ <text_max_length>0</text_max_length>
+ <text></text>
+ <child>
+ <left_attach>1</left_attach>
+ <right_attach>3</right_attach>
+ <top_attach>1</top_attach>
+ <bottom_attach>2</bottom_attach>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <xexpand>True</xexpand>
+ <yexpand>False</yexpand>
+ <xshrink>False</xshrink>
+ <yshrink>False</yshrink>
+ <xfill>True</xfill>
+ <yfill>False</yfill>
+ </child>
+ </widget>
+
+ <widget>
+ <class>GtkEntry</class>
+ <name>entry-middle</name>
+ <can_focus>True</can_focus>
+ <editable>True</editable>
+ <text_visible>True</text_visible>
+ <text_max_length>0</text_max_length>
+ <text></text>
+ <child>
+ <left_attach>1</left_attach>
+ <right_attach>3</right_attach>
+ <top_attach>2</top_attach>
+ <bottom_attach>3</bottom_attach>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <xexpand>True</xexpand>
+ <yexpand>False</yexpand>
+ <xshrink>False</xshrink>
+ <yshrink>False</yshrink>
+ <xfill>True</xfill>
+ <yfill>False</yfill>
+ </child>
+ </widget>
+
+ <widget>
+ <class>GtkEntry</class>
+ <name>entry-last</name>
+ <can_focus>True</can_focus>
+ <editable>True</editable>
+ <text_visible>True</text_visible>
+ <text_max_length>0</text_max_length>
+ <text></text>
+ <child>
+ <left_attach>1</left_attach>
+ <right_attach>3</right_attach>
+ <top_attach>3</top_attach>
+ <bottom_attach>4</bottom_attach>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <xexpand>True</xexpand>
+ <yexpand>False</yexpand>
+ <xshrink>False</xshrink>
+ <yshrink>False</yshrink>
+ <xfill>True</xfill>
+ <yfill>False</yfill>
+ </child>
+ </widget>
+
+ <widget>
+ <class>GtkLabel</class>
+ <name>label-first</name>
+ <label>_First:</label>
+ <justify>GTK_JUSTIFY_CENTER</justify>
+ <wrap>False</wrap>
+ <xalign>0</xalign>
+ <yalign>0.5</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <focus_target>entry-first</focus_target>
+ <child>
+ <left_attach>0</left_attach>
+ <right_attach>1</right_attach>
+ <top_attach>1</top_attach>
+ <bottom_attach>2</bottom_attach>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <xexpand>False</xexpand>
+ <yexpand>False</yexpand>
+ <xshrink>False</xshrink>
+ <yshrink>False</yshrink>
+ <xfill>True</xfill>
+ <yfill>True</yfill>
+ </child>
+ </widget>
+
+ <widget>
+ <class>GtkLabel</class>
+ <name>label-title</name>
+ <label>_Title:</label>
+ <justify>GTK_JUSTIFY_CENTER</justify>
+ <wrap>False</wrap>
+ <xalign>0</xalign>
+ <yalign>0.5</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <focus_target>entry-title</focus_target>
+ <child>
+ <left_attach>0</left_attach>
+ <right_attach>1</right_attach>
+ <top_attach>0</top_attach>
+ <bottom_attach>1</bottom_attach>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <xexpand>False</xexpand>
+ <yexpand>False</yexpand>
+ <xshrink>False</xshrink>
+ <yshrink>False</yshrink>
+ <xfill>True</xfill>
+ <yfill>True</yfill>
+ </child>
+ </widget>
+
+ <widget>
+ <class>GtkLabel</class>
+ <name>label-middle</name>
+ <label>_Middle:</label>
+ <justify>GTK_JUSTIFY_CENTER</justify>
+ <wrap>False</wrap>
+ <xalign>0</xalign>
+ <yalign>0.5</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <focus_target>entry-middle</focus_target>
+ <child>
+ <left_attach>0</left_attach>
+ <right_attach>1</right_attach>
+ <top_attach>2</top_attach>
+ <bottom_attach>3</bottom_attach>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <xexpand>False</xexpand>
+ <yexpand>False</yexpand>
+ <xshrink>False</xshrink>
+ <yshrink>False</yshrink>
+ <xfill>True</xfill>
+ <yfill>True</yfill>
+ </child>
+ </widget>
+
+ <widget>
+ <class>GtkLabel</class>
+ <name>label-last</name>
+ <label>_Last:</label>
+ <justify>GTK_JUSTIFY_CENTER</justify>
+ <wrap>False</wrap>
+ <xalign>0</xalign>
+ <yalign>0.5</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <focus_target>entry-last</focus_target>
+ <child>
+ <left_attach>0</left_attach>
+ <right_attach>1</right_attach>
+ <top_attach>3</top_attach>
+ <bottom_attach>4</bottom_attach>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <xexpand>False</xexpand>
+ <yexpand>False</yexpand>
+ <xshrink>False</xshrink>
+ <yshrink>False</yshrink>
+ <xfill>True</xfill>
+ <yfill>True</yfill>
+ </child>
+ </widget>
+
+ <widget>
+ <class>GtkLabel</class>
+ <name>label-suffix</name>
+ <label>_Suffix:</label>
+ <justify>GTK_JUSTIFY_CENTER</justify>
+ <wrap>False</wrap>
+ <xalign>0</xalign>
+ <yalign>0.5</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <focus_target>entry-suffix</focus_target>
+ <child>
+ <left_attach>0</left_attach>
+ <right_attach>1</right_attach>
+ <top_attach>4</top_attach>
+ <bottom_attach>5</bottom_attach>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <xexpand>False</xexpand>
+ <yexpand>False</yexpand>
+ <xshrink>False</xshrink>
+ <yshrink>False</yshrink>
+ <xfill>True</xfill>
+ <yfill>True</yfill>
+ </child>
+ </widget>
</widget>
- </child>
+ </widget>
</widget>
-</glade-interface>
+</GTK-Interface>
diff --git a/addressbook/gui/widgets/e-addressbook-reflow-adapter.c b/addressbook/gui/widgets/e-addressbook-reflow-adapter.c
index 7f99062144..cd306d1627 100644
--- a/addressbook/gui/widgets/e-addressbook-reflow-adapter.c
+++ b/addressbook/gui/widgets/e-addressbook-reflow-adapter.c
@@ -2,18 +2,20 @@
#include <config.h>
-#include <string.h>
-#include <libgnome/gnome-i18n.h>
-#include "e-addressbook-marshal.h"
#include "e-addressbook-reflow-adapter.h"
#include "e-addressbook-model.h"
#include "e-addressbook-view.h"
#include "e-addressbook-util.h"
+#include <gal/util/e-i18n.h>
+
#include "e-minicard.h"
+#include <gal/widgets/e-unicode.h>
+#include <gal/widgets/e-font.h>
#include <gal/widgets/e-popup-menu.h>
#include <gal/widgets/e-gui-utils.h>
+#include <gal/unicode/gunicode.h>
#include "e-contact-save-as.h"
#include "addressbook/printing/e-contact-print.h"
#include "addressbook/printing/e-contact-print-envelope.h"
@@ -21,24 +23,21 @@
struct _EAddressbookReflowAdapterPrivate {
EAddressbookModel *model;
-
- gboolean loading;
-
+
int create_card_id, remove_card_id, modify_card_id, model_changed_id;
- int search_started_id, search_result_id;
};
#define PARENT_TYPE e_reflow_model_get_type()
-static EReflowModel *parent_class;
+EReflowModel *parent_class;
#define d(x)
enum {
- PROP_0,
- PROP_BOOK,
- PROP_QUERY,
- PROP_EDITABLE,
- PROP_MODEL,
+ ARG_0,
+ ARG_BOOK,
+ ARG_QUERY,
+ ARG_EDITABLE,
+ ARG_MODEL,
};
enum {
@@ -53,53 +52,53 @@ unlink_model(EAddressbookReflowAdapter *adapter)
{
EAddressbookReflowAdapterPrivate *priv = adapter->priv;
- if (priv->model && priv->create_card_id)
- g_signal_handler_disconnect (priv->model,
- priv->create_card_id);
- if (priv->model && priv->remove_card_id)
- g_signal_handler_disconnect (priv->model,
- priv->remove_card_id);
- if (priv->model && priv->modify_card_id)
- g_signal_handler_disconnect (priv->model,
- priv->modify_card_id);
- if (priv->model && priv->model_changed_id)
- g_signal_handler_disconnect (priv->model,
- priv->model_changed_id);
- if (priv->model && priv->search_started_id)
- g_signal_handler_disconnect (priv->model,
- priv->search_started_id);
- if (priv->model && priv->search_result_id)
- g_signal_handler_disconnect (priv->model,
- priv->search_result_id);
+ gtk_signal_disconnect(GTK_OBJECT (priv->model),
+ priv->create_card_id);
+ gtk_signal_disconnect(GTK_OBJECT (priv->model),
+ priv->remove_card_id);
+ gtk_signal_disconnect(GTK_OBJECT (priv->model),
+ priv->modify_card_id);
+ gtk_signal_disconnect(GTK_OBJECT (priv->model),
+ priv->model_changed_id);
priv->create_card_id = 0;
priv->remove_card_id = 0;
priv->modify_card_id = 0;
priv->model_changed_id = 0;
- priv->search_started_id = 0;
- priv->search_result_id = 0;
- if (priv->model)
- g_object_unref (priv->model);
+ gtk_object_unref(GTK_OBJECT(priv->model));
priv->model = NULL;
}
static int
-text_height (PangoLayout *layout, const gchar *text)
+count_lines (const gchar *text)
{
- int height;
+ int num_lines = 1;
+ gunichar unival;
- pango_layout_set_text (layout, text, -1);
+ for (text = e_unicode_get_utf8 (text, &unival); (unival && text); text = e_unicode_get_utf8 (text, &unival)) {
+ if (unival == '\n') {
+ num_lines ++;
+ }
+ }
- pango_layout_get_pixel_size (layout, NULL, &height);
+ return num_lines;
+}
+
+static int
+text_height (GnomeCanvas *canvas, const gchar *text)
+{
+ EFont *font = e_font_from_gdk_font (((GtkWidget *) canvas)->style->font);
+ gint height = e_font_height (font) * count_lines (text) / canvas->pixels_per_unit;
+ e_font_unref (font);
return height;
}
static void
-addressbook_dispose(GObject *object)
+addressbook_finalize(GtkObject *object)
{
EAddressbookReflowAdapter *adapter = E_ADDRESSBOOK_REFLOW_ADAPTER(object);
@@ -121,21 +120,21 @@ addressbook_count (EReflowModel *erm)
return e_addressbook_model_card_count (priv->model);
}
-/* This function returns the height of the minicard in question */
+/* This function returns the number of items in our EReflowModel. */
static int
addressbook_height (EReflowModel *erm, int i, GnomeCanvasGroup *parent)
{
EAddressbookReflowAdapter *adapter = E_ADDRESSBOOK_REFLOW_ADAPTER(erm);
EAddressbookReflowAdapterPrivate *priv = adapter->priv;
+ /* FIXME */
ECardSimpleField field;
int count = 0;
+ int height;
char *string;
ECardSimple *simple = e_card_simple_new (e_addressbook_model_card_at (priv->model, i));
- PangoLayout *layout = gtk_widget_create_pango_layout (GTK_WIDGET (GNOME_CANVAS_ITEM (parent)->canvas), "");
- int height;
string = e_card_simple_get(simple, E_CARD_SIMPLE_FIELD_FILE_AS);
- height = text_height (layout, string ? string : "") + 10.0;
+ height = text_height (GNOME_CANVAS_ITEM (parent)->canvas, string ? string : "") + 10.0;
g_free(string);
for(field = E_CARD_SIMPLE_FIELD_FULL_NAME; field != E_CARD_SIMPLE_FIELD_LAST_SIMPLE_STRING && count < 5; field++) {
@@ -148,9 +147,9 @@ addressbook_height (EReflowModel *erm, int i, GnomeCanvasGroup *parent)
int this_height;
int field_text_height;
- this_height = text_height (layout, e_card_simple_get_name(simple, field));
+ this_height = text_height (GNOME_CANVAS_ITEM (parent)->canvas, e_card_simple_get_name(simple, field));
- field_text_height = text_height (layout, string);
+ field_text_height = text_height (GNOME_CANVAS_ITEM (parent)->canvas, string);
if (this_height < field_text_height)
this_height = field_text_height;
@@ -163,8 +162,7 @@ addressbook_height (EReflowModel *erm, int i, GnomeCanvasGroup *parent)
}
height += 2;
- g_object_unref (simple);
- g_object_unref (layout);
+ gtk_object_unref (GTK_OBJECT (simple));
return height;
}
@@ -175,32 +173,27 @@ addressbook_compare (EReflowModel *erm, int n1, int n2)
EAddressbookReflowAdapter *adapter = E_ADDRESSBOOK_REFLOW_ADAPTER(erm);
EAddressbookReflowAdapterPrivate *priv = adapter->priv;
ECard *card1, *card2;
-
- if (priv->loading) {
- return n1-n2;
- }
- else {
- card1 = e_addressbook_model_card_at (priv->model, n1);
- card2 = e_addressbook_model_card_at (priv->model, n2);
-
- if (card1 && card2) {
- char *file_as1, *file_as2;
- file_as1 = card1->file_as;
- file_as2 = card2->file_as;
- if (file_as1 && file_as2)
- return g_utf8_collate(file_as1, file_as2);
- if (file_as1)
- return -1;
- if (file_as2)
- return 1;
- return strcmp(e_card_get_id(card1), e_card_get_id(card2));
- }
- if (card1)
+
+ card1 = e_addressbook_model_card_at (priv->model, n1);
+ card2 = e_addressbook_model_card_at (priv->model, n2);
+
+ if (card1 && card2) {
+ char *file_as1, *file_as2;
+ file_as1 = card1->file_as;
+ file_as2 = card2->file_as;
+ if (file_as1 && file_as2)
+ return g_utf8_collate(file_as1, file_as2);
+ if (file_as1)
return -1;
- if (card2)
+ if (file_as2)
return 1;
- return 0;
+ return strcmp(e_card_get_id(card1), e_card_get_id(card2));
}
+ if (card1)
+ return -1;
+ if (card2)
+ return 1;
+ return 0;
}
static int
@@ -208,9 +201,9 @@ adapter_drag_begin (EMinicard *card, GdkEvent *event, EAddressbookReflowAdapter
{
gint ret_val = 0;
- g_signal_emit (adapter,
- e_addressbook_reflow_adapter_signals[DRAG_BEGIN], 0,
- event, &ret_val);
+ gtk_signal_emit (GTK_OBJECT(adapter),
+ e_addressbook_reflow_adapter_signals[DRAG_BEGIN],
+ event, &ret_val);
return ret_val;
}
@@ -229,13 +222,13 @@ addressbook_incarnate (EReflowModel *erm, int i, GnomeCanvasGroup *parent)
NULL);
#if 0
- g_signal_connect (item, "selected",
- G_CALLBACK(card_selected), 0, emvm);
+ gtk_signal_connect (GTK_OBJECT (item), "selected",
+ GTK_SIGNAL_FUNC(card_selected), emvm);
#endif
- g_signal_connect (item, "drag_begin",
- G_CALLBACK(adapter_drag_begin), adapter);
-
+ gtk_signal_connect (GTK_OBJECT (item), "drag_begin",
+ GTK_SIGNAL_FUNC(adapter_drag_begin), adapter);
+
return item;
}
@@ -250,10 +243,12 @@ addressbook_reincarnate (EReflowModel *erm, int i, GnomeCanvasItem *item)
NULL);
}
+
+
static void
-create_card (EAddressbookModel *model,
- gint index, gint count,
- EAddressbookReflowAdapter *adapter)
+create_card(EAddressbookModel *model,
+ gint index, gint count,
+ EAddressbookReflowAdapter *adapter)
{
e_reflow_model_items_inserted (E_REFLOW_MODEL (adapter),
index,
@@ -261,155 +256,129 @@ create_card (EAddressbookModel *model,
}
static void
-remove_card (EAddressbookModel *model,
- gint index,
- EAddressbookReflowAdapter *adapter)
+remove_card(EAddressbookModel *model,
+ gint index,
+ EAddressbookReflowAdapter *adapter)
{
- e_reflow_model_item_removed (E_REFLOW_MODEL (adapter), index);
+ e_reflow_model_changed (E_REFLOW_MODEL (adapter));
}
static void
-modify_card (EAddressbookModel *model,
- gint index,
- EAddressbookReflowAdapter *adapter)
+modify_card(EAddressbookModel *model,
+ gint index,
+ EAddressbookReflowAdapter *adapter)
{
e_reflow_model_item_changed (E_REFLOW_MODEL (adapter), index);
}
static void
-model_changed (EAddressbookModel *model,
- EAddressbookReflowAdapter *adapter)
+model_changed(EAddressbookModel *model,
+ EAddressbookReflowAdapter *adapter)
{
e_reflow_model_changed (E_REFLOW_MODEL (adapter));
}
static void
-search_started (EAddressbookModel *model,
- EAddressbookReflowAdapter *adapter)
+addressbook_set_arg (GtkObject *o, GtkArg *arg, guint arg_id)
{
+ EAddressbookReflowAdapter *adapter = E_ADDRESSBOOK_REFLOW_ADAPTER(o);
EAddressbookReflowAdapterPrivate *priv = adapter->priv;
- priv->loading = TRUE;
-}
-
-static void
-search_result (EAddressbookModel *model,
- EBookViewStatus status,
- EAddressbookReflowAdapter *adapter)
-{
- EAddressbookReflowAdapterPrivate *priv = adapter->priv;
-
- priv->loading = FALSE;
-
- e_reflow_model_comparison_changed (E_REFLOW_MODEL (adapter));
-}
-
-static void
-addressbook_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec)
-{
- EAddressbookReflowAdapter *adapter = E_ADDRESSBOOK_REFLOW_ADAPTER(object);
- EAddressbookReflowAdapterPrivate *priv = adapter->priv;
-
- switch (prop_id) {
- case PROP_BOOK:
- g_object_set (priv->model,
- "book", g_value_get_object (value),
- NULL);
+ switch (arg_id){
+ case ARG_BOOK:
+ gtk_object_set (GTK_OBJECT (priv->model),
+ "book", GTK_VALUE_OBJECT (*arg),
+ NULL);
break;
- case PROP_QUERY:
- g_object_set (priv->model,
- "query", g_value_get_string (value),
- NULL);
+ case ARG_QUERY:
+ gtk_object_set (GTK_OBJECT (priv->model),
+ "query", GTK_VALUE_STRING (*arg),
+ NULL);
break;
- case PROP_EDITABLE:
- g_object_set (priv->model,
- "editable", g_value_get_boolean (value),
- NULL);
- break;
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+ case ARG_EDITABLE:
+ gtk_object_set (GTK_OBJECT (priv->model),
+ "editable", GTK_VALUE_BOOL (*arg),
+ NULL);
break;
}
}
static void
-addressbook_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec)
+addressbook_get_arg (GtkObject *o, GtkArg *arg, guint arg_id)
{
- EAddressbookReflowAdapter *adapter = E_ADDRESSBOOK_REFLOW_ADAPTER(object);
+ EAddressbookReflowAdapter *adapter = E_ADDRESSBOOK_REFLOW_ADAPTER(o);
EAddressbookReflowAdapterPrivate *priv = adapter->priv;
- switch (prop_id) {
- case PROP_BOOK: {
- g_object_get_property (G_OBJECT (priv->model),
- "book", value);
+ switch (arg_id) {
+ case ARG_BOOK: {
+ EBook *book;
+ gtk_object_get (GTK_OBJECT (priv->model),
+ "book", &book,
+ NULL);
+ if (book)
+ GTK_VALUE_OBJECT (*arg) = GTK_OBJECT(book);
+ else
+ GTK_VALUE_OBJECT (*arg) = NULL;
break;
}
- case PROP_QUERY: {
- g_object_get_property (G_OBJECT (priv->model),
- "query", value);
+ case ARG_QUERY: {
+ char *query;
+ gtk_object_get (GTK_OBJECT (priv->model),
+ "query", &query,
+ NULL);
+ GTK_VALUE_STRING (*arg) = query;
break;
}
- case PROP_EDITABLE: {
- g_object_get_property (G_OBJECT (priv->model),
- "editable", value);
+ case ARG_EDITABLE: {
+ gboolean editable;
+ gtk_object_get (GTK_OBJECT (priv->model),
+ "editable", &editable,
+ NULL);
+ GTK_VALUE_BOOL (*arg) = editable;
break;
}
- case PROP_MODEL:
- g_value_set_object (value, priv->model);
+ case ARG_MODEL:
+ if (priv->model)
+ GTK_VALUE_OBJECT (*arg) = GTK_OBJECT (priv->model);
+ else
+ GTK_VALUE_OBJECT (*arg) = NULL;
break;
default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+ arg->type = GTK_TYPE_INVALID;
break;
}
}
static void
-e_addressbook_reflow_adapter_class_init (GObjectClass *object_class)
+e_addressbook_reflow_adapter_class_init (GtkObjectClass *object_class)
{
EReflowModelClass *model_class = (EReflowModelClass *) object_class;
- parent_class = g_type_class_peek_parent (object_class);
-
- object_class->set_property = addressbook_set_property;
- object_class->get_property = addressbook_get_property;
- object_class->dispose = addressbook_dispose;
-
- g_object_class_install_property (object_class, PROP_BOOK,
- g_param_spec_object ("book",
- _("Book"),
- /*_( */"XXX blurb" /*)*/,
- E_TYPE_BOOK,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_QUERY,
- g_param_spec_string ("query",
- _("Query"),
- /*_( */"XXX blurb" /*)*/,
- NULL,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_EDITABLE,
- g_param_spec_boolean ("editable",
- _("Editable"),
- /*_( */"XXX blurb" /*)*/,
- FALSE,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_MODEL,
- g_param_spec_object ("model",
- _("Model"),
- /*_( */"XXX blurb" /*)*/,
- E_TYPE_ADDRESSBOOK_MODEL,
- G_PARAM_READABLE));
+ parent_class = gtk_type_class (PARENT_TYPE);
+
+ object_class->set_arg = addressbook_set_arg;
+ object_class->get_arg = addressbook_get_arg;
+ object_class->finalize = addressbook_finalize;
+
+ gtk_object_add_arg_type ("EAddressbookReflowAdapter::book", GTK_TYPE_OBJECT,
+ GTK_ARG_READWRITE, ARG_BOOK);
+ gtk_object_add_arg_type ("EAddressbookReflowAdapter::query", GTK_TYPE_STRING,
+ GTK_ARG_READWRITE, ARG_QUERY);
+ gtk_object_add_arg_type ("EAddressbookReflowAdapter::editable", GTK_TYPE_BOOL,
+ GTK_ARG_READWRITE, ARG_EDITABLE);
+ gtk_object_add_arg_type ("EAddressbookReflowAdapter::model", E_ADDRESSBOOK_MODEL_TYPE,
+ GTK_ARG_READABLE, ARG_MODEL);
e_addressbook_reflow_adapter_signals [DRAG_BEGIN] =
- g_signal_new ("drag_begin",
- G_OBJECT_CLASS_TYPE(object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (EAddressbookReflowAdapterClass, drag_begin),
- NULL, NULL,
- e_addressbook_marshal_INT__POINTER,
- G_TYPE_INT, 1, G_TYPE_POINTER);
+ gtk_signal_new ("drag_begin",
+ GTK_RUN_LAST,
+ object_class->type,
+ GTK_SIGNAL_OFFSET (EAddressbookReflowAdapterClass, drag_begin),
+ gtk_marshal_INT__POINTER,
+ GTK_TYPE_INT, 1, GTK_TYPE_POINTER);
+
+
+ gtk_object_class_add_signals (object_class, e_addressbook_reflow_adapter_signals, LAST_SIGNAL);
model_class->set_width = addressbook_set_width;
model_class->count = addressbook_count;
@@ -427,34 +396,30 @@ e_addressbook_reflow_adapter_init (GtkObject *object)
priv = adapter->priv = g_new0 (EAddressbookReflowAdapterPrivate, 1);
- priv->loading = FALSE;
priv->create_card_id = 0;
priv->remove_card_id = 0;
priv->modify_card_id = 0;
priv->model_changed_id = 0;
- priv->search_started_id = 0;
- priv->search_result_id = 0;
}
-GType
+GtkType
e_addressbook_reflow_adapter_get_type (void)
{
- static GType type = 0;
+ static GtkType type = 0;
- if (!type) {
- static const GTypeInfo info = {
- sizeof (EAddressbookReflowAdapterClass),
- NULL, /* base_init */
- NULL, /* base_finalize */
- (GClassInitFunc) e_addressbook_reflow_adapter_class_init,
- NULL, /* class_finalize */
- NULL, /* class_data */
+ if (!type){
+ GtkTypeInfo info = {
+ "EAddressbookReflowAdapter",
sizeof (EAddressbookReflowAdapter),
- 0, /* n_preallocs */
- (GInstanceInitFunc) e_addressbook_reflow_adapter_init,
+ sizeof (EAddressbookReflowAdapterClass),
+ (GtkClassInitFunc) e_addressbook_reflow_adapter_class_init,
+ (GtkObjectInitFunc) e_addressbook_reflow_adapter_init,
+ NULL, /* reserved 1 */
+ NULL, /* reserved 2 */
+ (GtkClassInitFunc) NULL
};
- type = g_type_register_static (PARENT_TYPE, "EAddressbookReflowAdapter", &info, 0);
+ type = gtk_type_unique (PARENT_TYPE, &info);
}
return type;
@@ -467,32 +432,24 @@ e_addressbook_reflow_adapter_construct (EAddressbookReflowAdapter *adapter,
EAddressbookReflowAdapterPrivate *priv = adapter->priv;
priv->model = model;
- g_object_ref (priv->model);
-
- priv->create_card_id = g_signal_connect(priv->model,
- "card_added",
- G_CALLBACK(create_card),
- adapter);
- priv->remove_card_id = g_signal_connect(priv->model,
- "card_removed",
- G_CALLBACK(remove_card),
- adapter);
- priv->modify_card_id = g_signal_connect(priv->model,
- "card_changed",
- G_CALLBACK(modify_card),
- adapter);
- priv->model_changed_id = g_signal_connect(priv->model,
- "model_changed",
- G_CALLBACK(model_changed),
+ gtk_object_ref (GTK_OBJECT (priv->model));
+
+ priv->create_card_id = gtk_signal_connect(GTK_OBJECT(priv->model),
+ "card_added",
+ GTK_SIGNAL_FUNC(create_card),
+ adapter);
+ priv->remove_card_id = gtk_signal_connect(GTK_OBJECT(priv->model),
+ "card_removed",
+ GTK_SIGNAL_FUNC(remove_card),
adapter);
- priv->search_started_id = g_signal_connect(priv->model,
- "search_started",
- G_CALLBACK(search_started),
- adapter);
- priv->search_result_id = g_signal_connect(priv->model,
- "search_result",
- G_CALLBACK(search_result),
+ priv->modify_card_id = gtk_signal_connect(GTK_OBJECT(priv->model),
+ "card_changed",
+ GTK_SIGNAL_FUNC(modify_card),
adapter);
+ priv->model_changed_id = gtk_signal_connect(GTK_OBJECT(priv->model),
+ "model_changed",
+ GTK_SIGNAL_FUNC(model_changed),
+ adapter);
}
EReflowModel *
@@ -500,7 +457,7 @@ e_addressbook_reflow_adapter_new (EAddressbookModel *model)
{
EAddressbookReflowAdapter *et;
- et = g_object_new (E_TYPE_ADDRESSBOOK_REFLOW_ADAPTER, NULL);
+ et = gtk_type_new (e_addressbook_reflow_adapter_get_type ());
e_addressbook_reflow_adapter_construct (et, model);
diff --git a/addressbook/gui/widgets/e-addressbook-table-adapter.c b/addressbook/gui/widgets/e-addressbook-table-adapter.c
index 3680af259c..55d20af199 100644
--- a/addressbook/gui/widgets/e-addressbook-table-adapter.c
+++ b/addressbook/gui/widgets/e-addressbook-table-adapter.c
@@ -5,10 +5,9 @@
#include "e-addressbook-table-adapter.h"
#include "e-card-merging.h"
#include "e-addressbook-util.h"
-#include "ebook/e-destination.h"
-#include <libxml/tree.h>
-#include <libxml/parser.h>
-#include <libxml/xmlmemory.h>
+#include <gnome-xml/tree.h>
+#include <gnome-xml/parser.h>
+#include <gnome-xml/xmlmemory.h>
#include <gnome.h>
struct _EAddressbookTableAdapterPrivate {
@@ -21,7 +20,7 @@ struct _EAddressbookTableAdapterPrivate {
};
#define PARENT_TYPE e_table_model_get_type()
-static ETableModelClass *parent_class;
+ETableModelClass *parent_class;
#define COLS (E_CARD_SIMPLE_FIELD_LAST)
@@ -31,14 +30,14 @@ unlink_model(EAddressbookTableAdapter *adapter)
EAddressbookTableAdapterPrivate *priv = adapter->priv;
int i;
- g_signal_handler_disconnect (priv->model,
- priv->create_card_id);
- g_signal_handler_disconnect (priv->model,
- priv->remove_card_id);
- g_signal_handler_disconnect (priv->model,
- priv->modify_card_id);
- g_signal_handler_disconnect (priv->model,
- priv->model_changed_id);
+ gtk_signal_disconnect(GTK_OBJECT (priv->model),
+ priv->create_card_id);
+ gtk_signal_disconnect(GTK_OBJECT (priv->model),
+ priv->remove_card_id);
+ gtk_signal_disconnect(GTK_OBJECT (priv->model),
+ priv->modify_card_id);
+ gtk_signal_disconnect(GTK_OBJECT (priv->model),
+ priv->model_changed_id);
priv->create_card_id = 0;
priv->remove_card_id = 0;
@@ -48,12 +47,12 @@ unlink_model(EAddressbookTableAdapter *adapter)
/* free up the existing mapping if there is one */
if (priv->simples) {
for (i = 0; i < priv->count; i ++)
- g_object_unref (priv->simples[i]);
+ gtk_object_unref (GTK_OBJECT (priv->simples[i]));
g_free (priv->simples);
priv->simples = NULL;
}
- g_object_unref (priv->model);
+ gtk_object_unref(GTK_OBJECT(priv->model));
priv->model = NULL;
}
@@ -67,7 +66,7 @@ build_simple_mapping(EAddressbookTableAdapter *adapter)
/* free up the existing mapping if there is one */
if (priv->simples) {
for (i = 0; i < priv->count; i ++)
- g_object_unref (priv->simples[i]);
+ gtk_object_unref (GTK_OBJECT (priv->simples[i]));
g_free (priv->simples);
}
@@ -76,7 +75,7 @@ build_simple_mapping(EAddressbookTableAdapter *adapter)
priv->simples = g_new (ECardSimple*, priv->count);
for (i = 0; i < priv->count; i ++) {
priv->simples[i] = e_card_simple_new (e_addressbook_model_card_at (priv->model, i));
- g_object_ref (priv->simples[i]);
+ gtk_object_ref (GTK_OBJECT (priv->simples[i]));
}
}
@@ -124,8 +123,8 @@ addressbook_value_at (ETableModel *etc, int col, int row)
EDestination *dest = e_destination_import (value);
if (dest) {
/* XXX blech, we leak this */
- value = g_strdup (e_destination_get_textrep (dest, TRUE));
- g_object_unref (dest);
+ value = g_strdup (e_destination_get_address (dest));
+ gtk_object_unref (GTK_OBJECT (dest));
}
}
@@ -138,6 +137,7 @@ static void
card_modified_cb (EBook* book, EBookStatus status,
gpointer user_data)
{
+ /* g_print ("%s: %s(): a card was modified\n", __FILE__, __FUNCTION__); */
if (status != E_BOOK_STATUS_SUCCESS)
e_addressbook_error_dialog (_("Error modifying card"), status);
}
@@ -157,9 +157,9 @@ addressbook_set_value_at (ETableModel *etc, int col, int row, const void *val)
e_card_simple_set(priv->simples[row],
col,
val);
- g_object_get(priv->simples[row],
- "card", &card,
- NULL);
+ gtk_object_get(GTK_OBJECT(priv->simples[row]),
+ "card", &card,
+ NULL);
e_card_merging_book_commit_card(e_addressbook_model_get_ebook(priv->model),
card, card_modified_cb, NULL);
@@ -210,8 +210,8 @@ addressbook_append_row (ETableModel *etm, ETableModel *source, gint row)
}
e_card_simple_sync_card(simple);
e_card_merging_book_add_card (e_addressbook_model_get_ebook (priv->model), card, NULL, NULL);
- g_object_unref (simple);
- g_object_unref (card);
+ gtk_object_unref(GTK_OBJECT(simple));
+ gtk_object_unref(GTK_OBJECT(card));
}
/* This function duplicates the value passed to it. */
@@ -251,7 +251,7 @@ e_addressbook_table_adapter_class_init (GtkObjectClass *object_class)
{
ETableModelClass *model_class = (ETableModelClass *) object_class;
- parent_class = g_type_class_peek_parent (object_class);
+ parent_class = gtk_type_class (PARENT_TYPE);
object_class->destroy = addressbook_destroy;
@@ -313,7 +313,7 @@ remove_card (EAddressbookModel *model,
e_table_model_pre_change (E_TABLE_MODEL (adapter));
- g_object_unref (priv->simples[index]);
+ gtk_object_unref (GTK_OBJECT (priv->simples[index]));
memmove (priv->simples + index, priv->simples + index + 1, (priv->count - index - 1) * sizeof (ECardSimple *));
priv->count --;
e_table_model_rows_deleted (E_TABLE_MODEL (adapter), index, 1);
@@ -328,9 +328,9 @@ modify_card (EAddressbookModel *model,
e_table_model_pre_change (E_TABLE_MODEL (adapter));
- g_object_unref (priv->simples[index]);
+ gtk_object_unref (GTK_OBJECT (priv->simples[index]));
priv->simples[index] = e_card_simple_new (e_addressbook_model_card_at (priv->model, index));
- g_object_ref (priv->simples[index]);
+ gtk_object_ref (GTK_OBJECT (priv->simples[index]));
e_table_model_row_changed (E_TABLE_MODEL (adapter), index);
}
@@ -343,25 +343,24 @@ model_changed (EAddressbookModel *model,
e_table_model_changed (E_TABLE_MODEL (adapter));
}
-GType
+GtkType
e_addressbook_table_adapter_get_type (void)
{
- static GType type = 0;
+ static GtkType type = 0;
- if (!type) {
- static const GTypeInfo info = {
- sizeof (EAddressbookTableAdapterClass),
- NULL, /* base_init */
- NULL, /* base_finalize */
- (GClassInitFunc) e_addressbook_table_adapter_class_init,
- NULL, /* class_finalize */
- NULL, /* class_data */
+ if (!type){
+ GtkTypeInfo info = {
+ "EAddressbookTableAdapter",
sizeof (EAddressbookTableAdapter),
- 0, /* n_preallocs */
- (GInstanceInitFunc) e_addressbook_table_adapter_init,
+ sizeof (EAddressbookTableAdapterClass),
+ (GtkClassInitFunc) e_addressbook_table_adapter_class_init,
+ (GtkObjectInitFunc) e_addressbook_table_adapter_init,
+ NULL, /* reserved 1 */
+ NULL, /* reserved 2 */
+ (GtkClassInitFunc) NULL
};
- type = g_type_register_static (PARENT_TYPE, "EAddressbookTableAdapter", &info, 0);
+ type = gtk_type_unique (PARENT_TYPE, &info);
}
return type;
@@ -374,24 +373,24 @@ e_addressbook_table_adapter_construct (EAddressbookTableAdapter *adapter,
EAddressbookTableAdapterPrivate *priv = adapter->priv;
priv->model = model;
- g_object_ref (priv->model);
-
- priv->create_card_id = g_signal_connect(priv->model,
- "card_added",
- G_CALLBACK(create_card),
- adapter);
- priv->remove_card_id = g_signal_connect(priv->model,
- "card_removed",
- G_CALLBACK(remove_card),
- adapter);
- priv->modify_card_id = g_signal_connect(priv->model,
- "card_changed",
- G_CALLBACK(modify_card),
- adapter);
- priv->model_changed_id = g_signal_connect(priv->model,
- "model_changed",
- G_CALLBACK(model_changed),
+ gtk_object_ref (GTK_OBJECT (priv->model));
+
+ priv->create_card_id = gtk_signal_connect(GTK_OBJECT(priv->model),
+ "card_added",
+ GTK_SIGNAL_FUNC(create_card),
+ adapter);
+ priv->remove_card_id = gtk_signal_connect(GTK_OBJECT(priv->model),
+ "card_removed",
+ GTK_SIGNAL_FUNC(remove_card),
+ adapter);
+ priv->modify_card_id = gtk_signal_connect(GTK_OBJECT(priv->model),
+ "card_changed",
+ GTK_SIGNAL_FUNC(modify_card),
adapter);
+ priv->model_changed_id = gtk_signal_connect(GTK_OBJECT(priv->model),
+ "model_changed",
+ GTK_SIGNAL_FUNC(model_changed),
+ adapter);
build_simple_mapping (adapter);
}
@@ -401,7 +400,7 @@ e_addressbook_table_adapter_new (EAddressbookModel *model)
{
EAddressbookTableAdapter *et;
- et = g_object_new(E_TYPE_ADDRESSBOOK_TABLE_ADAPTER, NULL);
+ et = gtk_type_new (e_addressbook_table_adapter_get_type ());
e_addressbook_table_adapter_construct (et, model);
diff --git a/addressbook/gui/widgets/e-minicard.c b/addressbook/gui/widgets/e-minicard.c
index 8bebb4cdb0..98fe4c4e05 100644
--- a/addressbook/gui/widgets/e-minicard.c
+++ b/addressbook/gui/widgets/e-minicard.c
@@ -20,34 +20,32 @@
*/
#include <config.h>
-#include <string.h>
#include <glib.h>
#include <gtk/gtkdnd.h>
-#include <gtk/gtkmain.h>
#include <gdk/gdkkeysyms.h>
+#include <libgnome/gnome-defs.h>
#include <libgnome/gnome-i18n.h>
-#include <libgnomecanvas/gnome-canvas-rect-ellipse.h>
-#include <libgnomecanvas/gnome-canvas-pixbuf.h>
+#include <libgnomeui/gnome-canvas-rect-ellipse.h>
+#include <gdk-pixbuf/gnome-canvas-pixbuf.h>
#include <gal/e-text/e-text.h>
#include <gal/util/e-util.h>
#include <gal/widgets/e-canvas-utils.h>
#include <gal/widgets/e-canvas.h>
+#include <gal/unicode/gunicode.h>
#include "addressbook/backend/ebook/e-book.h"
-#include "e-addressbook-marshal.h"
#include "e-addressbook-util.h"
#include "e-minicard.h"
#include "e-minicard-label.h"
#include "e-minicard-view.h"
#include "e-contact-editor.h"
#include "e-card-merging.h"
-#include "ebook/e-destination.h"
static void e_minicard_init (EMinicard *card);
static void e_minicard_class_init (EMinicardClass *klass);
-static void e_minicard_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec);
-static void e_minicard_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec);
-static void e_minicard_dispose (GObject *object);
-static void e_minicard_finalize (GObject *object);
+static void e_minicard_set_arg (GtkObject *o, GtkArg *arg, guint arg_id);
+static void e_minicard_get_arg (GtkObject *object, GtkArg *arg, guint arg_id);
+static void e_minicard_destroy (GtkObject *object);
+static void e_minicard_finalize (GtkObject *object);
static gboolean e_minicard_event (GnomeCanvasItem *item, GdkEvent *event);
static void e_minicard_realize (GnomeCanvasItem *item);
static void e_minicard_unrealize (GnomeCanvasItem *item);
@@ -82,14 +80,14 @@ e_minicard_field_destroy(EMinicardField *field)
/* The arguments we take */
enum {
- PROP_0,
- PROP_WIDTH,
- PROP_HEIGHT,
- PROP_HAS_FOCUS,
- PROP_SELECTED,
- PROP_HAS_CURSOR,
- PROP_EDITABLE,
- PROP_CARD
+ ARG_0,
+ ARG_WIDTH,
+ ARG_HEIGHT,
+ ARG_HAS_FOCUS,
+ ARG_SELECTED,
+ ARG_HAS_CURSOR,
+ ARG_EDITABLE,
+ ARG_CARD
};
enum {
@@ -100,112 +98,80 @@ enum {
static guint e_minicard_signals [LAST_SIGNAL] = {0, };
-GType
+GtkType
e_minicard_get_type (void)
{
- static GType type = 0;
-
- if (!type) {
- static const GTypeInfo info = {
- sizeof (EMinicardClass),
- NULL, /* base_init */
- NULL, /* base_finalize */
- (GClassInitFunc) e_minicard_class_init,
- NULL, /* class_finalize */
- NULL, /* class_data */
- sizeof (EMinicard),
- 0, /* n_preallocs */
- (GInstanceInitFunc) e_minicard_init,
- };
-
- type = g_type_register_static (gnome_canvas_group_get_type (), "EMinicard", &info, 0);
- }
+ static GtkType minicard_type = 0;
+
+ if (!minicard_type)
+ {
+ static const GtkTypeInfo minicard_info =
+ {
+ "EMinicard",
+ sizeof (EMinicard),
+ sizeof (EMinicardClass),
+ (GtkClassInitFunc) e_minicard_class_init,
+ (GtkObjectInitFunc) e_minicard_init,
+ /* reserved_1 */ NULL,
+ /* reserved_2 */ NULL,
+ (GtkClassInitFunc) NULL,
+ };
+
+ minicard_type = gtk_type_unique (gnome_canvas_group_get_type (), &minicard_info);
+ }
- return type;
+ return minicard_type;
}
static void
e_minicard_class_init (EMinicardClass *klass)
{
- GObjectClass *object_class = (GObjectClass*) klass;
- GnomeCanvasItemClass *item_class = (GnomeCanvasItemClass *) klass;
+ GtkObjectClass *object_class;
+ GnomeCanvasItemClass *item_class;
- object_class->set_property = e_minicard_set_property;
- object_class->get_property = e_minicard_get_property;
- object_class->dispose = e_minicard_dispose;
- object_class->finalize = e_minicard_finalize;
+ object_class = (GtkObjectClass*) klass;
+ item_class = (GnomeCanvasItemClass *) klass;
parent_class = gtk_type_class (gnome_canvas_group_get_type ());
-
- g_object_class_install_property (object_class, PROP_WIDTH,
- g_param_spec_double ("width",
- _("Width"),
- /*_( */"XXX blurb" /*)*/,
- 0.0, G_MAXDOUBLE, 10.0,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_HEIGHT,
- g_param_spec_double ("height",
- _("Height"),
- /*_( */"XXX blurb" /*)*/,
- 0.0, G_MAXDOUBLE, 10.0,
- G_PARAM_READABLE));
-
- g_object_class_install_property (object_class, PROP_HAS_FOCUS,
- /* XXX should be _enum */
- g_param_spec_int ("has_focus",
- _("Has Focus"),
- /*_( */"XXX blurb" /*)*/,
- E_MINICARD_FOCUS_TYPE_START, E_MINICARD_FOCUS_TYPE_END,
- E_MINICARD_FOCUS_TYPE_START,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_SELECTED,
- g_param_spec_boolean ("selected",
- _("Selected"),
- /*_( */"XXX blurb" /*)*/,
- FALSE,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_HAS_CURSOR,
- g_param_spec_boolean ("has_cursor",
- _("Has Cursor"),
- /*_( */"XXX blurb" /*)*/,
- FALSE,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_EDITABLE,
- g_param_spec_boolean ("editable",
- _("Editable"),
- /*_( */"XXX blurb" /*)*/,
- FALSE,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_CARD,
- g_param_spec_object ("card",
- _("Card"),
- /*_( */"XXX blurb" /*)*/,
- E_TYPE_CARD,
- G_PARAM_READWRITE));
+ gtk_object_add_arg_type ("EMinicard::width", GTK_TYPE_DOUBLE,
+ GTK_ARG_READWRITE, ARG_WIDTH);
+ gtk_object_add_arg_type ("EMinicard::height", GTK_TYPE_DOUBLE,
+ GTK_ARG_READABLE, ARG_HEIGHT);
+ gtk_object_add_arg_type ("EMinicard::has_focus", GTK_TYPE_ENUM,
+ GTK_ARG_READWRITE, ARG_HAS_FOCUS);
+ gtk_object_add_arg_type ("EMinicard::selected", GTK_TYPE_BOOL,
+ GTK_ARG_READWRITE, ARG_SELECTED);
+ gtk_object_add_arg_type ("EMinicard::has_cursor", GTK_TYPE_BOOL,
+ GTK_ARG_READWRITE, ARG_HAS_CURSOR);
+ gtk_object_add_arg_type ("EMinicard::editable", GTK_TYPE_BOOL,
+ GTK_ARG_READWRITE, ARG_EDITABLE);
+ gtk_object_add_arg_type ("EMinicard::card", GTK_TYPE_OBJECT,
+ GTK_ARG_READWRITE, ARG_CARD);
+
e_minicard_signals [SELECTED] =
- g_signal_new ("selected",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (EMinicardClass, selected),
- NULL, NULL,
- e_addressbook_marshal_INT__POINTER,
- G_TYPE_INT, 1, G_TYPE_POINTER);
+ gtk_signal_new ("selected",
+ GTK_RUN_LAST,
+ object_class->type,
+ GTK_SIGNAL_OFFSET (EMinicardClass, selected),
+ gtk_marshal_INT__POINTER,
+ GTK_TYPE_INT, 1, GTK_TYPE_POINTER);
e_minicard_signals [DRAG_BEGIN] =
- g_signal_new ("drag_begin",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (EMinicardClass, drag_begin),
- NULL, NULL,
- e_addressbook_marshal_INT__POINTER,
- G_TYPE_INT, 1, G_TYPE_POINTER);
-
+ gtk_signal_new ("drag_begin",
+ GTK_RUN_LAST,
+ object_class->type,
+ GTK_SIGNAL_OFFSET (EMinicardClass, drag_begin),
+ gtk_marshal_INT__POINTER,
+ GTK_TYPE_INT, 1, GTK_TYPE_POINTER);
+
+ gtk_object_class_add_signals (object_class, e_minicard_signals, LAST_SIGNAL);
+
+ object_class->set_arg = e_minicard_set_arg;
+ object_class->get_arg = e_minicard_get_arg;
+ object_class->destroy = e_minicard_destroy;
+ object_class->finalize = e_minicard_finalize;
+
/* GnomeCanvasItem method overrides */
item_class->realize = e_minicard_realize;
item_class->unrealize = e_minicard_unrealize;
@@ -230,7 +196,7 @@ e_minicard_init (EMinicard *minicard)
minicard->card = NULL;
minicard->simple = e_card_simple_new(NULL);
- minicard->list_icon_pixbuf = gdk_pixbuf_new_from_file (EVOLUTION_IMAGESDIR "/" LIST_ICON_FILENAME, NULL);
+ minicard->list_icon_pixbuf = gdk_pixbuf_new_from_file (EVOLUTION_IMAGESDIR "/" LIST_ICON_FILENAME);
minicard->list_icon_size = gdk_pixbuf_get_height (minicard->list_icon_pixbuf);
minicard->editor = NULL;
@@ -278,34 +244,34 @@ set_has_cursor (EMinicard *minicard, gboolean has_cursor)
static void
-e_minicard_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec)
+e_minicard_set_arg (GtkObject *o, GtkArg *arg, guint arg_id)
{
GnomeCanvasItem *item;
EMinicard *e_minicard;
GList *l;
- item = GNOME_CANVAS_ITEM (object);
- e_minicard = E_MINICARD (object);
+ item = GNOME_CANVAS_ITEM (o);
+ e_minicard = E_MINICARD (o);
- switch (prop_id){
- case PROP_WIDTH:
- if (e_minicard->width != g_value_get_double (value)) {
- e_minicard->width = g_value_get_double (value);
+ switch (arg_id){
+ case ARG_WIDTH:
+ if (e_minicard->width != GTK_VALUE_DOUBLE (*arg)) {
+ e_minicard->width = GTK_VALUE_DOUBLE (*arg);
e_minicard_resize_children(e_minicard);
if ( GTK_OBJECT_FLAGS( e_minicard ) & GNOME_CANVAS_ITEM_REALIZED )
e_canvas_item_request_reflow(item);
}
break;
- case PROP_HAS_FOCUS:
+ case ARG_HAS_FOCUS:
if (e_minicard->fields) {
- if ( g_value_get_int(value) == E_FOCUS_START ||
- g_value_get_int(value) == E_FOCUS_CURRENT) {
+ if ( GTK_VALUE_ENUM(*arg) == E_FOCUS_START ||
+ GTK_VALUE_ENUM(*arg) == E_FOCUS_CURRENT) {
gnome_canvas_item_set(E_MINICARD_FIELD(e_minicard->fields->data)->label,
- "has_focus", g_value_get_int (value),
+ "has_focus", GTK_VALUE_ENUM(*arg),
NULL);
- } else if ( g_value_get_int (value) == E_FOCUS_END ) {
+ } else if ( GTK_VALUE_ENUM(*arg) == E_FOCUS_END ) {
gnome_canvas_item_set(E_MINICARD_FIELD(g_list_last(e_minicard->fields)->data)->label,
- "has_focus", g_value_get_int (value),
+ "has_focus", GTK_VALUE_ENUM(*arg),
NULL);
}
}
@@ -314,79 +280,76 @@ e_minicard_set_property (GObject *object, guint prop_id, const GValue *value, G
e_canvas_item_grab_focus(item, FALSE);
}
break;
- case PROP_SELECTED:
- if (e_minicard->selected != g_value_get_boolean (value))
- set_selected (e_minicard, g_value_get_boolean (value));
+ case ARG_SELECTED:
+ if (e_minicard->selected != GTK_VALUE_BOOL(*arg))
+ set_selected (e_minicard, GTK_VALUE_BOOL(*arg));
break;
- case PROP_EDITABLE:
- e_minicard->editable = g_value_get_boolean (value);
+ case ARG_EDITABLE:
+ e_minicard->editable = GTK_VALUE_BOOL(*arg);
for (l = e_minicard->fields; l; l = l->next)
- g_object_set (E_MINICARD_FIELD (l->data)->label,
- "editable", e_minicard->editable,
- NULL);
+ gtk_object_set (GTK_OBJECT (E_MINICARD_FIELD (l->data)->label),
+ "editable", e_minicard->editable,
+ NULL);
break;
- case PROP_HAS_CURSOR:
- d(g_print("%s: PROP_HAS_CURSOR\n", G_GNUC_FUNCTION));
- if (e_minicard->has_cursor != g_value_get_boolean (value))
- set_has_cursor (e_minicard, g_value_get_boolean (value));
+ case ARG_HAS_CURSOR:
+ d(g_print("%s: ARG_HAS_CURSOR\n", __FUNCTION__));
+ if (e_minicard->has_cursor != GTK_VALUE_BOOL(*arg))
+ set_has_cursor (e_minicard, GTK_VALUE_BOOL(*arg));
break;
- case PROP_CARD:
+ case ARG_CARD:
if (e_minicard->card)
- g_object_unref (e_minicard->card);
- e_minicard->card = E_CARD(g_value_get_object (value));
+ gtk_object_unref (GTK_OBJECT(e_minicard->card));
+ e_minicard->card = E_CARD(GTK_VALUE_OBJECT (*arg));
if (e_minicard->card)
- g_object_ref (e_minicard->card);
- g_object_set(e_minicard->simple,
- "card", e_minicard->card,
- NULL);
+ gtk_object_ref (GTK_OBJECT(e_minicard->card));
+ gtk_object_set(GTK_OBJECT(e_minicard->simple),
+ "card", e_minicard->card,
+ NULL);
remodel(e_minicard);
e_canvas_item_request_reflow(item);
e_minicard->changed = FALSE;
break;
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
- break;
}
}
static void
-e_minicard_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec)
+e_minicard_get_arg (GtkObject *object, GtkArg *arg, guint arg_id)
{
EMinicard *e_minicard;
e_minicard = E_MINICARD (object);
- switch (prop_id) {
- case PROP_WIDTH:
- g_value_set_double (value, e_minicard->width);
- break;
- case PROP_HEIGHT:
- g_value_set_double (value, e_minicard->height);
- break;
- case PROP_HAS_FOCUS:
- g_value_set_int (value, e_minicard->has_focus ? E_FOCUS_CURRENT : E_FOCUS_NONE);
+ switch (arg_id) {
+ case ARG_WIDTH:
+ GTK_VALUE_DOUBLE (*arg) = e_minicard->width;
+ break;
+ case ARG_HEIGHT:
+ GTK_VALUE_DOUBLE (*arg) = e_minicard->height;
+ break;
+ case ARG_HAS_FOCUS:
+ GTK_VALUE_ENUM (*arg) = e_minicard->has_focus ? E_FOCUS_CURRENT : E_FOCUS_NONE;
break;
- case PROP_SELECTED:
- g_value_set_boolean (value, e_minicard->selected);
+ case ARG_SELECTED:
+ GTK_VALUE_BOOL (*arg) = e_minicard->selected;
break;
- case PROP_HAS_CURSOR:
- g_value_set_boolean (value, e_minicard->has_cursor);
+ case ARG_HAS_CURSOR:
+ GTK_VALUE_BOOL (*arg) = e_minicard->has_cursor;
break;
- case PROP_EDITABLE:
- g_value_set_boolean (value, e_minicard->editable);
+ case ARG_EDITABLE:
+ GTK_VALUE_BOOL (*arg) = e_minicard->editable;
break;
- case PROP_CARD:
+ case ARG_CARD:
e_card_simple_sync_card(e_minicard->simple);
- g_value_set_object (value, e_minicard->card);
+ GTK_VALUE_OBJECT (*arg) = GTK_OBJECT(e_minicard->card);
break;
default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
- break;
+ arg->type = GTK_TYPE_INVALID;
+ break;
}
}
static void
-e_minicard_dispose (GObject *object)
+e_minicard_destroy (GtkObject *object)
{
EMinicard *e_minicard;
@@ -395,25 +358,19 @@ e_minicard_dispose (GObject *object)
e_minicard = E_MINICARD (object);
- if (e_minicard->fields) {
- g_list_foreach(e_minicard->fields, (GFunc) e_minicard_field_destroy, NULL);
- g_list_free(e_minicard->fields);
- e_minicard->fields = NULL;
- }
+ g_list_foreach(e_minicard->fields, (GFunc) e_minicard_field_destroy, NULL);
+ g_list_free(e_minicard->fields);
- if (e_minicard->list_icon_pixbuf) {
- gdk_pixbuf_unref (e_minicard->list_icon_pixbuf);
- e_minicard->list_icon_pixbuf = NULL;
- }
+ gdk_pixbuf_unref (e_minicard->list_icon_pixbuf);
- if (G_OBJECT_CLASS (parent_class)->dispose)
- (* G_OBJECT_CLASS (parent_class)->dispose) (object);
+ if (GTK_OBJECT_CLASS (parent_class)->destroy)
+ (* GTK_OBJECT_CLASS (parent_class)->destroy) (object);
}
static void
-e_minicard_finalize (GObject *object)
+e_minicard_finalize (GtkObject *object)
{
EMinicard *e_minicard;
@@ -423,12 +380,12 @@ e_minicard_finalize (GObject *object)
e_minicard = E_MINICARD (object);
if (e_minicard->card)
- g_object_unref (e_minicard->card);
+ gtk_object_unref (GTK_OBJECT(e_minicard->card));
if (e_minicard->simple)
- g_object_unref (e_minicard->simple);
+ gtk_object_unref (GTK_OBJECT(e_minicard->simple));
- if (G_OBJECT_CLASS (parent_class)->finalize)
- (* G_OBJECT_CLASS (parent_class)->finalize) (object);
+ if (GTK_OBJECT_CLASS (parent_class)->finalize)
+ (* GTK_OBJECT_CLASS (parent_class)->finalize) (object);
}
static void
@@ -450,8 +407,8 @@ e_minicard_realize (GnomeCanvasItem *item)
gnome_canvas_rect_get_type(),
"x1", (double) 0,
"y1", (double) 0,
- "x2", (double) MAX (e_minicard->width - 1, 0),
- "y2", (double) MAX (e_minicard->height - 1, 0),
+ "x2", (double) e_minicard->width - 1,
+ "y2", (double) e_minicard->height - 1,
"outline_color", NULL,
NULL );
@@ -460,8 +417,8 @@ e_minicard_realize (GnomeCanvasItem *item)
gnome_canvas_rect_get_type(),
"x1", (double) 2,
"y1", (double) 2,
- "x2", (double) MAX (e_minicard->width - 3, 0),
- "y2", (double) MAX (e_minicard->height - 3, 0),
+ "x2", (double) e_minicard->width - 3,
+ "y2", (double) e_minicard->height - 3,
"fill_color_gdk", &canvas->style->bg[GTK_STATE_NORMAL],
NULL );
@@ -469,9 +426,12 @@ e_minicard_realize (GnomeCanvasItem *item)
gnome_canvas_item_new( group,
e_text_get_type(),
"anchor", GTK_ANCHOR_NW,
- "width", (double) MAX( e_minicard->width - 12, 0 ),
+ "width", (double) ( e_minicard->width - 12 ),
"clip", TRUE,
"use_ellipsis", TRUE,
+#if 0
+ "font", "fixed-bold-10",
+#endif
"fill_color_gdk", &canvas->style->fg[GTK_STATE_NORMAL],
"text", "",
"draw_background", FALSE,
@@ -510,7 +470,7 @@ e_minicard_unrealize (GnomeCanvasItem *item)
static void
card_modified_cb (EBook* book, EBookStatus status, gpointer user_data)
{
- d(g_print ("%s: %s(): a card was modified\n", __FILE__, G_GNUC_FUNCTION));
+ d(g_print ("%s: %s(): a card was modified\n", __FILE__, __FUNCTION__));
if (status != E_BOOK_STATUS_SUCCESS)
e_addressbook_error_dialog (_("Error modifying card"), status);
}
@@ -520,7 +480,7 @@ static void
editor_closed_cb (GtkObject *editor, gpointer data)
{
EMinicard *minicard = data;
- g_object_unref (editor);
+ gtk_object_unref (GTK_OBJECT (editor));
minicard->editor = NULL;
}
@@ -532,12 +492,12 @@ e_minicard_event (GnomeCanvasItem *item, GdkEvent *event)
e_minicard = E_MINICARD (item);
canvas = GTK_WIDGET (GNOME_CANVAS_ITEM (item)->canvas);
-
+
switch( event->type ) {
case GDK_FOCUS_CHANGE:
{
GdkEventFocus *focus_event = (GdkEventFocus *) event;
- d(g_print("%s: GDK_FOCUS_CHANGE: %s\n", G_GNUC_FUNCTION, focus_event->in?"in":"out"));
+ d(g_print("%s: GDK_FOCUS_CHANGE: %s\n", __FUNCTION__, focus_event->in?"in":"out"));
if (focus_event->in) {
/* Chris: When EMinicard gets the cursor, if it doesn't have the focus, it should take it. */
e_minicard->has_focus = TRUE;
@@ -553,9 +513,9 @@ e_minicard_event (GnomeCanvasItem *item, GdkEvent *event)
if (E_IS_MINICARD_VIEW(GNOME_CANVAS_ITEM(e_minicard)->parent)) {
- g_object_get(GNOME_CANVAS_ITEM(e_minicard)->parent,
- "book", &book,
- NULL);
+ gtk_object_get(GTK_OBJECT(GNOME_CANVAS_ITEM(e_minicard)->parent),
+ "book", &book,
+ NULL);
}
@@ -641,26 +601,26 @@ e_minicard_event (GnomeCanvasItem *item, GdkEvent *event)
} else {
EBook *book = NULL;
if (E_IS_MINICARD_VIEW(item->parent)) {
- g_object_get(item->parent,
- "book", &book,
- NULL);
+ gtk_object_get(GTK_OBJECT(item->parent),
+ "book", &book,
+ NULL);
}
if (book != NULL) {
if (e_card_evolution_list (e_minicard->card)) {
EContactListEditor *editor = e_addressbook_show_contact_list_editor (book, e_minicard->card,
FALSE, e_minicard->editable);
- e_minicard->editor = G_OBJECT (editor);
+ e_minicard->editor = GTK_OBJECT (editor);
}
else {
EContactEditor *editor = e_addressbook_show_contact_editor (book, e_minicard->card,
FALSE, e_minicard->editable);
- e_minicard->editor = G_OBJECT (editor);
+ e_minicard->editor = GTK_OBJECT (editor);
}
- g_object_ref (e_minicard->editor);
+ gtk_object_ref (e_minicard->editor);
- g_signal_connect (e_minicard->editor, "editor_closed",
- G_CALLBACK (editor_closed_cb), e_minicard);
+ gtk_signal_connect (e_minicard->editor, "editor_closed",
+ GTK_SIGNAL_FUNC (editor_closed_cb), e_minicard);
}
}
@@ -676,9 +636,9 @@ e_minicard_event (GnomeCanvasItem *item, GdkEvent *event)
EMinicardField *field = E_MINICARD_FIELD(list->data);
GnomeCanvasItem *item = field->label;
EFocus has_focus;
- g_object_get(item,
- "has_focus", &has_focus,
- NULL);
+ gtk_object_get(GTK_OBJECT(item),
+ "has_focus", &has_focus,
+ NULL);
if (has_focus != E_FOCUS_NONE) {
if (event->key.state & GDK_SHIFT_MASK)
list = list->prev;
@@ -739,11 +699,11 @@ field_changed (EText *text, EMinicard *e_minicard)
gboolean is_list = FALSE;
type = GPOINTER_TO_INT
- (g_object_get_data(G_OBJECT(text),
- "EMinicard:field"));
- g_object_get(text,
- "text", &string,
- NULL);
+ (gtk_object_get_data(GTK_OBJECT(text),
+ "EMinicard:field"));
+ gtk_object_get(GTK_OBJECT(text),
+ "text", &string,
+ NULL);
/*
* If the card is coresponding with a contact list and the field be
@@ -764,7 +724,7 @@ field_changed (EText *text, EMinicard *e_minicard)
new_string = e_destination_export(dest);
g_free(string);
string=new_string;
- g_object_unref (dest);
+ gtk_object_unref (GTK_OBJECT (dest));
}
}
}
@@ -803,10 +763,10 @@ add_field (EMinicard *e_minicard, ECardSimpleField field, gdouble left_width)
if (!strncmp (string, "<?xml", 5)) {
EDestination *dest = e_destination_import (string);
if (dest != NULL) {
- gchar *new_string = g_strdup (e_destination_get_textrep (dest, TRUE));
+ gchar *new_string = g_strdup (e_destination_get_address (dest));
g_free (string);
string = new_string;
- g_object_unref (dest);
+ gtk_object_unref (GTK_OBJECT (dest));
}
}
@@ -818,16 +778,16 @@ add_field (EMinicard *e_minicard, ECardSimpleField field, gdouble left_width)
"max_field_name_length", left_width,
"editable", e_minicard->editable,
NULL );
- g_signal_connect(E_MINICARD_LABEL(new_item)->field,
- "changed", G_CALLBACK (field_changed), e_minicard);
- g_signal_connect(E_MINICARD_LABEL(new_item)->field,
- "activate", G_CALLBACK (field_activated), e_minicard);
- g_object_set(E_MINICARD_LABEL(new_item)->field,
- "allow_newlines", e_card_simple_get_allow_newlines (e_minicard->simple, field),
- NULL);
- g_object_set_data(G_OBJECT (E_MINICARD_LABEL(new_item)->field),
- "EMinicard:field",
- GINT_TO_POINTER(field));
+ gtk_signal_connect(GTK_OBJECT(E_MINICARD_LABEL(new_item)->field),
+ "changed", GTK_SIGNAL_FUNC(field_changed), e_minicard);
+ gtk_signal_connect(GTK_OBJECT(E_MINICARD_LABEL(new_item)->field),
+ "activate", GTK_SIGNAL_FUNC(field_activated), e_minicard);
+ gtk_object_set(GTK_OBJECT(E_MINICARD_LABEL(new_item)->field),
+ "allow_newlines", e_card_simple_get_allow_newlines (e_minicard->simple, field),
+ NULL);
+ gtk_object_set_data(GTK_OBJECT(E_MINICARD_LABEL(new_item)->field),
+ "EMinicard:field",
+ GINT_TO_POINTER(field));
minicard_field = g_new(EMinicardField, 1);
minicard_field->field = field;
@@ -839,25 +799,24 @@ add_field (EMinicard *e_minicard, ECardSimpleField field, gdouble left_width)
g_free(string);
}
-static int
+static gdouble
get_left_width(EMinicard *e_minicard)
{
gchar *name;
ECardSimpleField field;
- int width = -1;
- PangoLayout *layout;
+ gdouble width = -1;
+ GdkFont *font;
+
+ font = ((GtkWidget *) ((GnomeCanvasItem *) e_minicard)->canvas)->style->font;
- layout = gtk_widget_create_pango_layout (GTK_WIDGET (GNOME_CANVAS_ITEM (e_minicard)->canvas), "");
for(field = E_CARD_SIMPLE_FIELD_FULL_NAME; field != E_CARD_SIMPLE_FIELD_LAST; field++) {
- int this_width;
+ gdouble this_width;
name = g_strdup_printf("%s:", e_card_simple_get_name(e_minicard->simple, field));
- pango_layout_set_text (layout, name, -1);
- pango_layout_get_pixel_size (layout, &this_width, NULL);
+ this_width = gdk_text_width(font, name, strlen(name));
if (width < this_width)
width = this_width;
g_free(name);
}
- g_object_unref (layout);
return width;
}
@@ -871,7 +830,7 @@ remodel( EMinicard *e_minicard )
ECardSimpleField field;
GList *list;
char *file_as;
- int left_width = -1;
+ gdouble left_width = -1;
if (e_minicard->header_text) {
file_as = e_card_simple_get(e_minicard->simple, E_CARD_SIMPLE_FIELD_FILE_AS);
@@ -906,17 +865,17 @@ remodel( EMinicard *e_minicard )
if (!strncmp (string, "<?xml", 4)) {
EDestination *dest = e_destination_import (string);
if (dest != NULL) {
- gchar *new_string = g_strdup (e_destination_get_textrep (dest, TRUE));
+ gchar *new_string = g_strdup (e_destination_get_address (dest));
g_free (string);
string = new_string;
- g_object_unref (dest);
+ gtk_object_unref (GTK_OBJECT (dest));
}
}
e_minicard->fields = g_list_append(e_minicard->fields, minicard_field);
- g_object_set(minicard_field->label,
- "field", string,
- NULL);
+ gtk_object_set(GTK_OBJECT(minicard_field->label),
+ "field", string,
+ NULL);
count ++;
} else {
e_minicard_field_destroy(minicard_field);
@@ -955,9 +914,9 @@ e_minicard_reflow( GnomeCanvasItem *item, int flags )
old_height = e_minicard->height;
- g_object_get( e_minicard->header_text,
- "text_height", &text_height,
- NULL );
+ gtk_object_get( GTK_OBJECT( e_minicard->header_text ),
+ "text_height", &text_height,
+ NULL );
e_minicard->height = text_height + 10.0;
@@ -968,15 +927,19 @@ e_minicard_reflow( GnomeCanvasItem *item, int flags )
for(list = e_minicard->fields; list; list = g_list_next(list)) {
EMinicardField *field = E_MINICARD_FIELD(list->data);
GnomeCanvasItem *item = field->label;
- g_object_get (item,
- "height", &text_height,
- NULL);
+ gtk_object_get (GTK_OBJECT(item),
+ "height", &text_height,
+ NULL);
e_canvas_item_move_absolute(item, 2, e_minicard->height);
e_minicard->height += text_height;
}
e_minicard->height += 2;
gnome_canvas_item_set( e_minicard->rect,
+ "y2", (double) e_minicard->height - 1,
+ NULL );
+
+ gnome_canvas_item_set( e_minicard->rect,
"x2", (double) e_minicard->width - 1.0,
"y2", (double) e_minicard->height - 1.0,
NULL );
@@ -1012,12 +975,12 @@ e_minicard_compare (EMinicard *minicard1, EMinicard *minicard2)
if (minicard1->card && minicard2->card) {
char *file_as1, *file_as2;
- g_object_get(minicard1->card,
- "file_as", &file_as1,
- NULL);
- g_object_get(minicard2->card,
- "file_as", &file_as2,
- NULL);
+ gtk_object_get(GTK_OBJECT(minicard1->card),
+ "file_as", &file_as1,
+ NULL);
+ gtk_object_get(GTK_OBJECT(minicard2->card),
+ "file_as", &file_as2,
+ NULL);
if (file_as1 && file_as2)
return g_utf8_collate(file_as1, file_as2);
if (file_as1)
@@ -1036,15 +999,15 @@ e_minicard_selected (EMinicard *minicard, GdkEvent *event)
gint ret_val = 0;
GnomeCanvasItem *item = GNOME_CANVAS_ITEM (minicard);
if (item->parent) {
- guint signal_id = g_signal_lookup ("selection_event", G_OBJECT_TYPE (item->parent));
+ guint signal_id = gtk_signal_lookup ("selection_event", GTK_OBJECT_TYPE (item->parent));
/* We should probably check the signature here, but I
* don't think it's worth the time required to code
* it.
*/
if (signal_id != 0) {
- g_signal_emit(item->parent,
- signal_id, 0,
- item, event, &ret_val);
+ gtk_signal_emit(GTK_OBJECT(item->parent),
+ signal_id,
+ item, event, &ret_val);
}
}
return ret_val;
@@ -1055,9 +1018,9 @@ e_minicard_drag_begin (EMinicard *minicard, GdkEvent *event)
{
gint ret_val = 0;
GnomeCanvasItem *parent;
- g_signal_emit (minicard,
- e_minicard_signals[DRAG_BEGIN], 0,
- event, &ret_val);
+ gtk_signal_emit (GTK_OBJECT(minicard),
+ e_minicard_signals[DRAG_BEGIN],
+ event, &ret_val);
parent = GNOME_CANVAS_ITEM (minicard)->parent;
if (parent && E_IS_REFLOW (parent)) {
diff --git a/art/ChangeLog b/art/ChangeLog
index c80396ce26..92c9af2d06 100644
--- a/art/ChangeLog
+++ b/art/ChangeLog
@@ -1,34 +1,8 @@
-2003-03-03 Ettore Perazzoli <ettore@ximian.com>
+2002-11-06 Ettore Perazzoli <ettore@ximian.com>
+ * splash.png: New artwork from Jakub.
* about-box.png: New artwork from Jakub.
-2003-02-06 Dan Winship <danw@ximian.com>
-
- * Makefile.am: remove imagesdir, etc, which are now defined in
- configure.in
-
-2003-01-22 Ettore Perazzoli <ettore@ximian.com>
-
- * Makefile.am (imagesdir): Version using $(BASE_VERSION).
- (buttonsdir): Likewise.
- (conduitsdir): Likewise.
- (install-data-local): New rule to install evolution.png as
- evolution-$(BASE_VERSION).png.
- (EXTRA_DIST): Add evolution.png.
-
-2003-01-08 Ettore Perazzoli <ettore@ximian.com>
-
- * Makefile.am (imagesdir): Install images into
- $(datadir)/evolution/images instead of
- $(datadir)/images/evolution.
- (buttonsdir): Likewise, these go into
- $(datadir)/evolution/images/buttons now.
- (conduits_DATA): Likewise, $(datadir)/evolution/images/conduits.
-
-2002-11-25 Ettore Perazzoli <ettore@ximian.com>
-
- * splash.png: New work-in-progress splash from Jakub.
-
2002-10-28 Ettore Perazzoli <ettore@ximian.com>
* splash.png: New artwork from Jakub.
diff --git a/art/about-box.png b/art/about-box.png
index d2ab5aac49..7df6464871 100644
--- a/art/about-box.png
+++ b/art/about-box.png
Binary files differ
diff --git a/art/splash.png b/art/splash.png
index d0fbdc16a5..f7b25cd217 100644
--- a/art/splash.png
+++ b/art/splash.png
Binary files differ
diff --git a/calendar/ChangeLog b/calendar/ChangeLog
index 89682e69c6..ce74a21ba9 100644
--- a/calendar/ChangeLog
+++ b/calendar/ChangeLog
@@ -1,514 +1,125 @@
-2003-04-01 JP Rosevear <jpr@ximian.com>
+2003-02-25 JP Rosevear <jpr@ximian.com>
- Fix for #17231 (Evo portion)
-
- * conduits/todo/todo-conduit.c (comp_from_remote_record): test for
- secret flag properly
-
- * conduits/calendar/calendar-conduit.c (comp_from_remote_record):
- ditto
-
-2003-04-01 Rodrigo Moya <rodrigo@ximian.com>
-
- * importers/icalendar-importer.c (load_file_fn, vcal_load_file_fn):
- added filename (tasks.ics/calendar.ics) to the URI if it does not
- contain it.
-
-2003-03-31 Rodrigo Moya <rodrigo@ximian.com>
-
- Fixes #39961
-
- * gui/e-meeting-time-sel.c
- (e_meeting_time_selector_options_menu_position_callback):
- (e_meeting_time_selector_autopick_menu_position_callback): use the
- button's allocation to position the popup menu.
-
-2003-03-29 Not Zed <NotZed@Ximian.com>
-
- Fixes #39895
-
- * gui/e-day-view.h (EDayViewColors): add an unfocussed colour to
- draw the selection in when we're not focussed.
-
- * gui/e-day-view.c (e_day_view_realize): Initialise
- E_DAY_VIEW_COLOR_BG_SELECTED_UNFOCUSSED to be 1/2 saturation of
- the focussed colour.
-
- * gui/e-day-view-main-item.c (e_day_view_main_item_draw): Use the
- UFOCUSSED colour if we aren't focussed, rather than just not
- drawing anything.
-
-2003-03-28 JP Rosevear <jpr@ximian.com>
-
- * gui/e-itip-control.c (get_servers): the shell client is a
- g_object now, ref appropriately
-
-2003-03-28 Hans Petter Jansson <hpj@ximian.com>
-
- * gui/e-day-view.c (comp_destroy_cb)
- (e_day_view_on_long_event_button_press)
- (e_day_view_on_event_button_press)
- (e_day_view_on_long_event_click)
- (e_day_view_on_event_click)
- (e_day_view_on_event_double_click)
- (e_day_view_on_delete_appointment): Hold weak references to the
- CalComponent instead of connecting to the "destroy" signal.
-
- * gui/e-week-view.c (comp_destroy_cb)
- (e_week_view_on_text_item_event): Ditto.
-
-2003-03-28 Hans Petter Jansson <hpj@ximian.com>
-
- Fixes #39954
-
- * gui/dialogs/recurrence-page.c (make_recurrence_special):
- Destroy would-be children of the container before the container.
-
-2003-03-28 JP Rosevear <jpr@ximian.com>
-
- * gui/dialogs/meeting-page.c (meeting_page_init): init new members
- (get_current_account): get a matching account for the currently
- selected user in the combo
- (meeting_page_finalize): unref the meeting attendee if there is
- one
- (meeting_page_fill_widgets): don't set the combo list here
- (clear_widgets): set the default organizer here and if we don't
- have an organizer, add the default organizer as an attendee
- (meeting_page_fill_component): use get_current_account
- (org_changed_cb): if this is a new meeting and the organizer
- changes, change the attendee
- (change_clicked_cb): no need to set the default here
- (init_widgets): reflect changed callback name
- (meeting_page_construct): set the combo strings here
- (popup_delete_cb): remove the organizer attendee if the user
- explicitly deletes it
-
- * gui/e-meeting-model.c (attendee_changed_cb): set row properly
-
- * gui/itip-utils.c (comp_to_list): skip the user themselves if
- cancelling or requesting
-
-2003-03-26 Rodrigo Moya <rodrigo@ximian.com>
-
- * importers/icalendar-importer.c (gnome_calendar_import_data_fn): use
- g_object_unref for CalClient's.
- (create_checkboxes_control): use g_signal_connect.
-
- * cal-client/cal-client.c (cal_client_get_load_state): return correct
- values in g_return_val_if_fail.
-
-2003-03-26 Jack Jia <jack.jia@sun.com>
-
- * calendar/gui/dialogs/alarm-options.c
- (malarm_widgets_to_alarm): add a parameter(TC_CORBA_string) to
- the bonobo_widget_get_property.
+ * gui/dialogs/meeting-page.c (meeting_page_fill_widgets): don't
+ let the user change to an email organizer if the back end is not
+ an email address
+
+2003-02-20 JP Rosevear <jpr@ximian.com>
+
+ * gui/e-itip-control.c (class_init): override finalize, not
+ destroy
+ (start_calendar_server): take itip as a param and gtk_main_quit if
+ it gets destroyed while we are waiting for the cal client to load
+ (start_default_server): ditto
+ (get_servers): take itip as a param and don't load if we've been
+ destroyed, check for an except when retrieving the folder list
+ (init): ref the html control
+ (finalize): clean up, unref html control
+ (write_html): if the html widget has been destroyed, don't write
+ anything out
+ (show_current_todo): pass extra param
+ (show_current): ref/unref the itip control to avoid finalization while
+ we are working, pass extra param
+ (button_selected_cb): pass extra param
+ (object_requested_cb): ditto
+
+2003-02-18 JP Rosevear <jpr@ximian.com>
+
+ Fixes #38218
-2003-03-25 Dan Winship <danw@ximian.com>
-
- * gui/itip-utils.c: Update for e_notice move
-
- * gui/tasks-control.c (confirm_expunge): Move the code that used
- to be e_gnome_dialog_set_parent here, since it was marked
- deprecated and this was the only place using it.
-
- * gui/dialogs/comp-editor.c: Update for e_notice move
- (page_changed_cb, page_summary_changed_cb, page_dates_changed_cb):
- Pass a parent_window to e_notice.
-
- * gui/dialogs/meeting-page.c: Update for e_notice move.
- (meeting_page_fill_component, meeting_page_fill_component,
- popup_delegate_cb): Pass a parent_window to e_notice
-
-2003-03-25 Dan Winship <danw@ximian.com>
-
- * cal-util/cal-util.c (cal_util_parse_ics_file): Utility wrapper
- around icalparser.
-
- * cal-util/test-recur.c (main): Use it
-
- * pcs/cal-backend-file.c (open_cal): Likewise
-
- * gui/comp-editor-factory.c (open_client): Add the OpenClient to
- the hash before calling cal_client_open_calendar, since in some
- failure cases, that will call cal_opened_cb (which will free the
- oc) with a failure immediately, causing a crash if we then try to
- deref it.
+ * gui/calendar-offline-handler.c (backend_cal_opened_online): set
+ the backend to REMOTE mode when it opens
+ (backend_go_online): prepare to set calendar mode to REMOTE
+ (impl_goOnline): get all the local calendars and set to REMOTE
-2003-03-21 JP Rosevear <jpr@ximian.com>
+2003-02-11 JP Rosevear <jpr@ximian.com>
- Fixes #32248
+ Fixes #37881
- * conduits/todo/todo-conduit.c (comp_from_remote_record): make
- sure the due date is actually a date
+ * gui/e-meeting-model.c (process_section): if the attendee is the
+ empty string, try to get the email
-2003-03-21 JP Rosevear <jpr@ximian.com>
+2003-02-11 JP Rosevear <jpr@ximian.com>
- Fixes #31660
+ Fixes #37883
- * conduits/calendar/calendar-conduit.c (rrules_mostly_equal):
- check if the rrules are equal other than until/count
- (find_last_cb): update the data with the start timet
- (local_record_from_comp): handle the case where the recurrence
- rule ends after a certain number occurrences
- (comp_from_remote_record): same
-
-2003-03-20 JP Rosevear <jpr@ximian.com>
-
- * conduits/calendar/calendar-conduit.c
- (e_calendar_context_destroy): calcomponents are gobjects now
- (calconduit_load_configuration): ref and sink to avoid warnings
-
- * conduits/todo/todo-conduit.c (todoconduit_load_configuration):
- ref and sink to avoid warnings
- (e_todo_context_destroy): calcomponents are gobjects now
-
-2003-03-20 Rodrigo Moya <rodrigo@ximian.com>
-
- * gui/dialogs/cancel-comp.c (cancel_component_dialog): use a
- GtkMessageDialog and deal correctly with the dialog's reponses.
-
-2003-03-20 Rodrigo Moya <rodrigo@ximian.com>
-
- Fixes #39770
-
- * gui/itip-utils.c (itip_Send_comp): check the CORBA exception instead
- of the g_return_val_if_fail. Also, use a CORBA_Object for the value
- returned from bonobo_activation_activate_from_id.
+ * idl/evolution-calendar.idl: getLdapAttribute can raise NotFound
-2003-03-20 Rodrigo Moya <rodrigo@ximian.com>
-
- * importers/ical-importer.c: removed activation of shell_client.
- (importer_destroy_cb): no need to unref shell_client.
- (connect_to_shell): removed.
- (ical_importer_new, vcal_importer_new): don't call connect_to_shell.
-
-2003-03-20 Rodrigo Moya <rodrigo@ximian.com>
-
- * importers/ical-importer.c (get_uri_from_folder_path): removed.
- (load_file_fn, vcal_load_file_fn): use physical_uri instead of
- folderpath.
-
-2003-03-19 Ettore Perazzoli <ettore@ximian.com>
-
- * importers/GNOME_Evolution_Calendar_Importer.server.in.in:
- Replace "evolution:menu-name" prop with "evolution:menu_name".
- [#39692]
-
-2003-03-18 Rodrigo Moya <rodrigo@ximian.com>
-
- * gui/dialogs/send-comp.c (send_component_dialog): use GtkMessageDialog
- instead of gnome_question_dialog, and deal correctly with the dialog's
- response.
-
-2003-03-18 Rodrigo Moya <rodrigo@ximian.com>
-
- Fixes #34505
-
- * gui/alarm-notify/alarm-queue.c (remove_queued_alarm): added removal
- of the alarm itself in the calendar if the (new) argument says so.
- Also, set expecting_update flag to TRUE.
- (add_component_alarms): initialize expecting_update to FALSE.
- (remove_alarms): don't remove the component if expecting_update is
- TRUE.
- (obj_updated_cb, notify_dialog_cb, procedure_notification): adapted
- to changes in remove_queued_alarm.
+2003-02-11 JP Rosevear <jpr@ximian.com>
-2003-03-17 Hans Petter Jansson <hpj@ximian.com>
-
- Fixes #34095
-
- * gui/e-meeting-model.c (append_row): Don't leak meeting attendees;
- unref the attendee after it's assigned to model.
-
- * gui/dialogs/meeting-page.c (meeting_page_destroy): Free the actual
- array of deleted attendees.
-
- * gui/dialogs/event-editor.c (event_editor_destroy): Free the private
- structure.
-
- * gui/itip-utils.c (comp_description): Rework free/busy information
- composer so we can free date/time information after use. Then free it.
- (itip_send_comp): Free the allocated CORBA buffer for attachment data.
-
- * gui/dialogs/comp-editor-util.c (comp_editor_contacts_to_component):
- Free the destination contacts string once we're done with it.
-
- * gui/e-calendar-table.c (invisible_destroyed): Unref the invisible.
-
- * gui/e-day-view.c (invisible_destroyed): Ditto.
-
- * gui/e-week-view.c (invisible_destroyed): Ditto.
-
-2003-03-17 Hans Petter Jansson <hpj@ximian.com>
-
- Fixes #39757
-
- * gui/dialogs/alarm-page.c (sensitize_buttons): Somehow this code
- reverted to thinking it was dealing with a GtkCList, when in reality
- it's a GtkTreeView. Fix that, so the buttons are sensitized correctly.
-
-2003-03-17 Hans Petter Jansson <hpj@ximian.com>
-
- Fixes #39736
-
- * gui/e-day-view.c: Reduce the size of the large-digits font so it's
- en par with the one in 1.2.
-
-2003-03-14 Rodrigo Moya <rodrigo@ximian.com>
-
- Fixes #39740
-
- * gui/e-meeting-model.c (is_cell_editable): check row number is valid
- before using it as index for the GPtrArray.
-
-2003-03-14 Rodrigo Moya <rodrigo@ximian.com>
-
- Fixes #39356
-
- * gui/Makefile.am:
- * gui/tasks-migrate.[ch]: removed tasks migration obsolete stuff.
-
- * gui/calendar-component.c (owner_set_cb): don't call tasks_migrate.
-
-2003-03-14 Rodrigo Moya <rodrigo@ximian.com>
+ Fixes #37806, #37697
- * pcs/cal-factory.c (impl_CalFactory_uriList): set_release
- on the sequence we create.
-
- * cal-client/cal-client.c (cal_client_uri_list): don't leak the
- string sequence returned by CalFactory_uriList.
-
-2003-03-13 Rodrigo Moya <rodrigo@ximian.com>
+ * gui/e-itip-control.c (e_itip_control_set_data): if the text is
+ null or the empty string, just clear the widget
+ (init): set the html widget to initially be blank
- * pcs/query-backend.c (query_backend_new): use a weak ref instead
- of connecting to backend's "destroy" signal.
- (backend_destroyed_cb, query_destroyed_cb): changed to be weak
- reference callbacks.
+2003-02-07 JP Rosevear <jpr@ximian.com>
-2003-03-12 Rodrigo Moya <rodrigo@ximian.com>
+ * pcs/cal.c (impl_Cal_get_ldap_attribute): implement
- * gui/dialogs/save-comp.c (save_component_dialog): don't use
- GNOME_STOCK_* defines, but GTK_STOCK_*.
-
-2003-03-12 Rodrigo Moya <rodrigo@ximian.com>
-
- * gui/dialogs/save-comp.[ch] (save_component_dialog): corrected
- button ordering and changed the return type to be a GtkResponseType.
-
- * gui/dialogs/comp-editor.c (prompt_to_save_changes): adapted to
- changes in save_component_dialog.
-
-2003-03-11 Dan Winship <danw@ximian.com>
-
- * gui/calendar-config.c (on_timezone_set): Update for timezone
- dialog API changes.
-
- * gui/e-timezone-entry.c: Likewise
-
-2003-03-11 Rodrigo Moya <rodrigo@ximian.com>
-
- * gui/gnome-cal.c (gnome_calendar_open): issue more descriptive
- warnings.
-
-2003-03-09 Rodrigo Moya <rodrigo@ximian.com>
-
- * gui/alarm-notify/alarm-notify.c (alarm_notify_add_calendar): if we
- already have the client loaded, don't remove it, just increment its
- reference count.
-
- * gui/alarm-notify/alarm-queue.c (remove_queued_alarm): added new
- argument to specify whether we want the component's structure removed
- if no more alarms exist, and only free the structure if TRUE.
- (remove_alarms): added same new argument and pass it over to
- remove_queued_alarm.
- (remove_comp, obj_updated_cb): passed new argument to remove_alarms.
- (procedure_notification): passed new argument to remove_queued_alarm.
- (obj_removed_cb): set all freed pointers to NULL.
- (notify_dialog_cb): only remove the alarm if the pointers are not NULL.
-
-2003-03-07 Rodrigo Moya <rodrigo@ximian.com>
-
- * gui/alarm-notify/save.c (get_calendars_to_load): create the array
- to be returned only once.
-
-2003-03-06 Rodrigo Moya <rodrigo@ximian.com>
-
- * gui/alarm-queue.c (display_notification): ref the CalClient.
- (notify_dialog_cb): unref the CalClient.
-
-2003-03-06 Rodrigo Moya <rodrigo@ximian.com>
-
- * gui/alarm-notify/alarm-notify-dialog.[ch]
- (alarm_notify_dialog_disable_buttons): new function.
- (alarm_notify_dialog): made it return a pointer to the dialog structure.
+ * pcs/cal-backend.h: add virtual method
- * gui/alarm-notify/alarm-queue.c (remove_alarms, remove_comp): splitted
- alarm removal out of remove_comp.
- (obj_updated_cb): remove the component only when needed. In normal
- updates, just update the internal structure.
- (edit_component): don't get a CompQueuedAlarms as argument, since it
- might be removed.
- (on_dialog_obj_updated_cb, on_dialog_obj_removed_cb): callbacks for
- modifications during dialog display.
- (notify_dialog_cb): disconnect from "obj_*ed" signals and call
- edit_component with the new set of arguments.
- (display_notification): added more data to the closure structure.
+ * pcs/cal-backend.c (cal_backend_get_ldap_attribute): call
+ get_ldap_attribute_method
-2003-03-05 Rodrigo Moya <rodrigo@ximian.com>
+ * pcs/cal-backend-file.c (cal_backend_file_class_init): overrid
+ get_ldap_attribute method
- Fixes #31382
+ * idl/evolution-calendar.idl: add getLdapAttribute method
- * gui/e-meeting-model.c (async_read): don't assume the buffer is
- always full, but use GNOME_VFS_ERROR_EOF instead for knowing when
- the read has finished.
+ * gui/e-meeting-model.c (process_section): take simple card list
+ as arg and try to use the ldap attribute (if any) as the attendee,
+ else use the email address
+ (select_names_ok_cb): get the simple card list
-2003-03-05 JP Rosevear <jpr@ximian.com>
+ * cal-client/cal-client.h: add proto
- * gui/apps_evolution_calendar.schemas: fix defaults and
- descriptions to match what calendar-config wants them to be
+ * cal-client/cal-client.c (cal_client_init): init ldap_attribute
+ to NULL
+ (cal_client_destroy): free ldap_attribute
+ (cal_client_get_ldap_attribute): accessor
-2003-03-05 JP Rosevear <jpr@ximian.com>
-
- * gui/e-itip-control.c (show_current): g_objectify ref/unref
+2003-02-07 Rodrigo Moya <rodrigo@ximian.com>
- * gui/itip-bonobo-control.c (set_data_idle_cb): as above
- (pstream_load): ditto
+ Fixes #37706
- * gui/dialogs/alarm-options.c (alarm_to_malarm_widgets): as above
+ * gui/comp-editor-factory.c (cal_opened_cb): added PERMISSION_DENIED
+ case for not ending process on g_assert_not_reached.
-2003-03-05 JP Rosevear <jpr@ximian.com>
-
- * gui/e-itip-control.c (class_init): override finalize, not
- destroy
- (start_calendar_server): take itip as a param and gtk_main_quit if
- it gets destroyed while we are waiting for the cal client to load
- (start_default_server): ditto
- (get_servers): take itip as a param and don't load if we've been
- destroyed, check for an except when retrieving the folder list
- (init): ref the html control
- (destroy): mark ourselves as destroyed
- (finalize): clean up, unref html control
- (write_html): if the html widget has been destroyed, don't write
- anything out
- (show_current_todo): pass extra param
- (show_current): ref/unref the itip control to avoid finalization while
- we are working, pass extra param
- (button_selected_cb): pass extra param
- (object_requested_cb): ditto
-
-2003-03-05 Rodrigo Moya <rodrigo@ximian.com>
-
- * gui/calendar-offline-handler.c (backend_go_offline,
- backend_go_online): cast CalClient's to GObject, not GtkObject.
-
-2003-03-04 JP Rosevear <jpr@ximian.com>
+2003-02-05 JP Rosevear <jpr@ximian.com>
- * gui/dialogs/meeting-page.c (meeting_page_fill_widgets): don't
- let the user change to an email organizer if the back end is not
- an email addres
-
-2003-03-04 JP Rosevear <jpr@ximian.com>
-
- Fixes #37881
-
- * gui/e-meeting-model.c (process_section): if the attendee is the
- empty string, try to get the email
-
-2003-03-04 JP Rosevear <jpr@ximian.com>
-
- * gui/calendar-offline-handler.c (backend_cal_opened_online): set
- the backend to REMOTE mode when it opens
- (backend_go_online): prepare to set calendar mode to REMOTE
- (impl_goOnline): get all the local calendars and set to REMOTE
+ * gui/itip-utils.c (itip_organizer_is_user): call
+ cal_client_get_cal_address instead of cal_client_get_email_address
-2003-03-04 JP Rosevear <jpr@ximian.com>
-
- Fixes #37881
-
- * gui/e-meeting-model.c (process_section): if the attendee is the
- empty string, try to get the email
-
-2003-03-04 JP Rosevear <jpr@ximian.com>
-
- Fixes #37883
-
- * idl/evolution-calendar.idl: getLdapAttribute can raise NotFound
-
-2003-03-04 JP Rosevear <jpr@ximian.com>
-
- Fixes #37806, #37697
-
- * gui/e-itip-control.c (e_itip_control_set_data): if the text is
- null or the empty string, just clear the widget
- (init): set the html widget to initially be blank
-
-2003-03-04 JP Rosevear <jpr@ximian.com>
-
- * pcs/cal.c (impl_Cal_get_ldap_attribute): implement
+ * gui/dialogs/meeting-page.c (meeting_page_construct): ditto
- * pcs/cal-backend.h: add virtual method
+ * pcs/cal.c (impl_Cal_get_cal_address): implement updated method
+ name
+ (cal_class_init): set method implementation
- * pcs/cal-backend.c (cal_backend_get_ldap_attribute): call
- get_ldap_attribute_method
+ * pcs/cal-backend.c (cal_backend_class_init): init get_cal_address
+ virtual function
+ (cal_backend_get_cal_address): call proper function
- * pcs/cal-backend-file.c (cal_backend_file_class_init): overrid
- get_ldap_attribute method
+ * pcs/cal-backend.h: update proto, rename get_email_address
+ virtual function to get_cal_address virtual function
- * idl/evolution-calendar.idl: add getLdapAttribute method
+ * pcs/cal-backend-file.c (cal_backend_file_class_init): match
+ get_cal_address call
+ (cal_backend_file_get_cal_address): rename from
+ cal_backend_file_get_email_address
- * gui/e-meeting-model.c (process_section): take simple card list
- as arg and try to use the ldap attribute (if any) as the attendee,
- else use the email address
- (select_names_ok_cb): get the simple card list
+ * cal-client/cal-client.c: rename email_address private member to
+ cal_address
+ (cal_client_init): init cal_address
+ (cal_client_destroy): free cal_address and properly free
+ alarm_email_address
+ (cal_client_get_cal_address): rename from
+ cal_client_get_email_address and call proper corba function
- * cal-client/cal-client.h: add proto
-
- * cal-client/cal-client.c (cal_client_init): init ldap_attribute
- to NULL
- (cal_client_destroy): free ldap_attribute
- (cal_client_get_ldap_attribute): accessor
-
-2003-03-04 JP Rosevear <jpr@ximian.com>
-
- * gui/itip-utils.c (itip_organizer_is_user): call
- cal_client_get_cal_address instead of cal_client_get_email_address
-
- * gui/dialogs/meeting-page.c (meeting_page_construct): ditto
-
- * pcs/cal.c (impl_Cal_get_cal_address): implement updated method
- name
- (cal_class_init): set method implementation
-
- * pcs/cal-backend.c (cal_backend_class_init): init get_cal_address
- virtual function
- (cal_backend_get_cal_address): call proper function
-
- * pcs/cal-backend.h: update proto, rename get_email_address
- virtual function to get_cal_address virtual function
-
- * pcs/cal-backend-file.c (cal_backend_file_class_init): match
- get_cal_address call
- (cal_backend_file_get_cal_address): rename from
- cal_backend_file_get_email_address
-
- * cal-client/cal-client.c: rename email_address private member to
- cal_address
- (cal_client_init): init cal_address
- (cal_client_destroy): free cal_address and properly free
- alarm_email_address
- (cal_client_get_cal_address): rename from
- cal_client_get_email_address and call proper corba function
-
-2003-03-04 JP Rosevear <jpr@ximian.com>
-
- * idl/evolution-calendar.idl: fix comment
-
-2003-03-04 JP Rosevear <jpr@ximian.com>
-
- * gui/calendar-model.c (calendar_model_append_row): update FIXME
- note
-
-2003-03-04 JP Rosevear <jpr@ximian.com>
+ * cal-client/cal-client.h: update proto
+
+2003-02-05 JP Rosevear <jpr@ximian.com>
* gui/dialogs/recur-comp.h: fix copyright
@@ -516,19 +127,26 @@
(recur_component_dialog): say "recurring journal entry" instead of
just "recurring journal"
-2003-03-04 JP Rosevear <jpr@ximian.com>
-
- Partially Fixes #23606 (from Jack Jia <jack.jia@sun.com>)
-
- * gui/dialogs/schedule-page.c (update_time): handle no end date if
- the start is date only
+2003-02-05 JP Rosevear <jpr@ximian.com>
- * gui/dialogs/event-page.c (update_time): ditto
+ * idl/evolution-calendar.idl: fix comment
-2003-03-04 JP Rosevear <jpr@ximian.com>
+2003-02-05 JP Rosevear <jpr@ximian.com>
+
+ * gui/calendar-model.c (calendar_model_append_row): update FIXME
+ note
- Merging in 1.2 stuff
+2003-02-04 JP Rosevear <jpr@ximian.com>
+
+ Partially Fixes #23606 (from Jack Jia <jack.jia@sun.com>)
+ * gui/dialogs/schedule-page.c (update_time): handle no end date if
+ the start is date only
+
+ * gui/dialogs/event-page.c (update_time): ditto
+
+2003-01-31 JP Rosevear <jpr@ximian.com>
+
Fixes #35598
* gui/dialogs/task-details-page.c
@@ -540,6 +158,8 @@
* gui/dialogs/task-details-page.glade: remove needs-action menu
item
+2003-01-30 JP Rosevear <jpr@ximian.com>
+
Fixes #36763
* gui/dialogs/alarm-page.c (add_clicked_cb): if no address was set
@@ -568,12 +188,24 @@
NULL
* idl/evolution-calendar.idl: add getAlarmEmailAddress method
-
+
+2003-30-01 Ronald Kuetemeier <ronald@kuetemeier.com>
+
+ Fixes #35572
+
+ * gui/alarm-notify/alarm-queue.c: set saved_notification_time to last
+ notification time when we update the config to last notification, so
+ alarms will not get trigged again if a new calendar window is opened.
+
+2003-01-29 JP Rosevear <jpr@ximian.com>
+
Fixes #37102
* gui/dialogs/task-editor.c (set_menu_sens): don't allow task
assignment if the backend says not to
+2003-01-28 JP Rosevear <jpr@ximian.com>
+
* gui/dialogs/recurrence-page.c (fill_component): kill warning
(preview_recur): display the recurrences in the dtstart timezone
if possible
@@ -587,14 +219,20 @@
* gui/tag-calendar.h (tag_calendar_by_comp): update proto
+2003-01-28 JP Rosevear <jpr@ximian.com>
+
* gui/dialogs/recurrence-page.c (recurrence_page_set_dates): make
sure we always update the preview
+2003-01-27 JP Rosevear <jpr@ximian.com>
+
* conduits/todo/todo-conduit.c (add_record): make sure to create a
unique uid for the record
* conduits/calendar/calendar-conduit.c (add_record): ditto
+2003-01-24 JP Rosevear <jpr@ximian.com>
+
* conduits/todo/todo-conduit.c (e_todo_context_new): init default
comp and timezone to NULL
(e_todo_context_destroy): unref default comp
@@ -608,9 +246,13 @@
(pre_sync): get the default comp via the client
(add_record): pass the default comp as the base comp
+2003-01-24 JP Rosevear <jpr@ximian.com>
+
* conduits/calendar/calendar-conduit.c (local_record_from_comp):
only add the recurrence rule if its not an instance
+2003-01-22 JP Rosevear <jpr@ximian.com>
+
* gui/itip-control-factory.c (set_data_idle_cb): idle call back to
set control data
(pstream_load): set the data in an idle callback to avoid deadlock
@@ -625,6 +267,16 @@
(e_itip_control_set_view_only): accessor
(e_itip_control_get_view_only): ditto
+2003-01-22 Jack Jia <jack.jia@sun.com>
+
+ Fixes #34927
+
+ * gui/e-meeting-model.c (async_open): Call process_callback function
+ to process the data when it can not open free-busy url correctly.
+ Don't try to close the invalid handle.
+
+2003-01-20 JP Rosevear <jpr@ximian.com>
+
Fixes #36909
* gui/dialogs/alarm-page.c (button_options_clicked_cb): indicate
@@ -636,19 +288,27 @@
repeating is not allowed, sensitize the widgets appropriately
(alarm_options_dialog_run): store the repeat param
+2003-01-16 JP Rosevear <jpr@ximian.com>
+
* gui/calendar-model.c (calendar_model_append_row): guard against
saving before the calendar is open
* gui/e-day-view.c (e_day_view_key_press): ditto
+2003-01-15 JP Rosevear <jpr@ximian.com>
+
* gui/dialogs/comp-editor.c (page_changed_cb): change warning
dialog to not mention email
(page_summary_changed_cb): ditto
(page_dates_changed_cb): ditto
+2003-01-13 JP Rosevear <jpr@ximian.com>
+
* gui/itip-utils.c (itip_organizer_is_user): make the compare case
insensitive
+2003-01-12 JP Rosevear <jpr@ximian.com>
+
* gui/dialogs/meeting-page.c (meeting_page_fill_widgets): don't
allow the organizer to be changed if its not an email address
@@ -664,17 +324,25 @@
* pcs/cal.c (build_fb_seq): set the max
+2003-01-09 JP Rosevear <jpr@ximian.com>
+
* gui/e-meeting-model.c
(e_meeting_model_add_attendee_with_defaults): correct typo and set
rsvp appropriately
+2003-01-06 JP Rosevear <jpr@ximian.com>
+
* gui/dialogs/send-comp.c (send_component_dialog): if save
schedules, return FALSE for now
+2003-01-03 JP Rosevear <jpr@ximian.com>
+
* gui/dialogs/recurrence-page.c (sensitize_recur_widgets):
de-sensitize the preview widget if we are viewing an instance
(preview_recur): return if the comp is an instance
+2003-01-02 JP Rosevear <jpr@ximian.com>
+
* gui/dialogs/event-page.glade: name the show time frame
* gui/dialogs/event-page.c (event_page_fill_widgets)
@@ -682,6 +350,8 @@
(event_page_fill_widgets): hide/show frame as needed
(get_widgets): get the frame
+2003-01-02 JP Rosevear <jpr@ximian.com>
+
* gui/alarm-notify/alarm-queue.c (mail_notification): kill mail
notification code
@@ -707,11 +377,15 @@
* pcs/cal.c (impl_Cal_get_static_capabilities): ditto
+2002-12-30 JP Rosevear <jpr@ximian.com>
+
* gui/alarm-notify/alarm-queue.c (get_default_address): utility
routine to snag address info
* gui/alarm-notify/Makefile.am: build composer idl
+2002-12-20 JP Rosevear <jpr@ximian.com>
+
* *.c: pass client param for send an cancel params
* gui/dialogs/send-comp.c (send_component_dialog): take client as
@@ -725,6 +399,8 @@
* gui/dialogs/cancel-comp.h (cancel_component_dialog): update proto
+2002-12-20 JP Rosevear <jpr@ximian.com>
+
* gui/dialogs/alarm-options.glade: add Send To: button
* gui/dialogs/alarm-options.c (addressbook_clicked_cb): display
@@ -732,6 +408,8 @@
(setup_select_names): attach above to Send To: button clicked
signal
+2002-12-20 JP Rosevear <jpr@ximian.com>
+
* gui/dialogs/alarm-options.c (get_widgets): get mail alarm
widgets
(setup_select_names): add the select names widget
@@ -762,6 +440,8 @@
* cal-util/cal-component.h: new protos
+2002-12-18 JP Rosevear <jpr@ximian.com>
+
* gui/calendar-model.c (calendar_model_append_row): use
cal_comp_task_new_with_defaults
@@ -776,6 +456,8 @@
* gui/comp-util.c (cal_comp_task_new_with_defaults): new utility
routine
+2002-12-18 JP Rosevear <jpr@ximian.com>
+
* cal-util/cal-util.c (generate_absolute_triggers): skip omitted
alarm types
(add_alarm_occurrences_cb): ditto
@@ -791,10 +473,14 @@
* pcs/cal-backend.c (cal_backend_get_scheduling_information):
remove dead param
+2002-12-17 JP Rosevear <jpr@ximian.com>
+
* gui/dialogs/meeting-page.h: delete proto
* gui/dialogs/meeting-page.c: remove dead routine
+2002-12-17 JP Rosevear <jpr@ximian.com>
+
* gui/dialogs/event-editor.c (event_editor_edit_comp): we don't
need to add the organizer as an attendee ourselves, just set the
edit level properly
@@ -838,6 +524,8 @@
* cal-client/cal-client.h: add a proto, delete a proto
+2002-12-16 JP Rosevear <jpr@ximian.com>
+
* gui/dialogs/meeting-page.c (right_click_cb): if the attendee is
not fully editable, don't allow deletion
(meeting_page_construct): keep the default organizer as an itip
@@ -885,6 +573,8 @@
* pcs/cal.c (impl_Cal_get_scheduling_information): implement above
+2002-12-11 JP Rosevear <jpr@ximian.com>
+
* gui/e-day-view.c: pass NULL as parent to recur dialog
* gui/e-week-view.c: ditto
@@ -900,14 +590,25 @@
* gui/dialogs/recur-comp.c (recur_component_dialog): take a parent
argument and set the dialog parent if non-null
- * gui/e-week-view.c (e_day_view_on_editing_stopped): Don't update
- appointment if both the old and the new summary texts are empty.
-
+2002-12-11 Jack Jia <jack.jia@sun.com>
+
+ Fixes #34933
+
+ * gui/e-day-view.c (e_day_view_on_editing_stopped): Don't update
+ appointment if both the old and the new summary texts are empty.
+
+ * gui/e-week-view.c (e_day_view_on_editing_stopped): Don't update
+ appointment if both the old and the new summary texts are empty.
+
+2002-12-10 JP Rosevear <jpr@ximian.com>
+
* gui/e-week-view.c (e_week_view_show_popup_menu): mask out "make
moveable" if its an instance
* gui/e-day-view.c (e_day_view_on_event_right_click): ditto
+2002-12-09 JP Rosevear <jpr@ximian.com>
+
* gui/e-week-view.c (e_week_view_on_editing_stopped): if its
an instance, show the recur comp dialog and modify it based on the
response (or not if cancel is hit)
@@ -928,12 +629,16 @@
* gui/dialogs/recur-comp.h: update proto
+2002-12-06 JP Rosevear <jpr@ximian.com>
+
* gui/e-day-view.c (e_day_view_on_long_event_click): allow
dragging if its an instance
(e_day_view_on_event_click): ditto
(e_day_view_on_top_canvas_motion): ditto
(e_day_view_on_main_canvas_motion): ditto
+2002-12-06 JP Rosevear <jpr@ximian.com>
+
* gui/dialogs/comp-editor.c (save_comp): if its an instance,
update with the mod type
(real_edit_comp): ask the user what instances they want to change
@@ -943,686 +648,25 @@
* gui/dialogs/Makefile.am: Compile new files
- * gui/e-day-view.c (e_day_view_on_delete_occurrence): if its an
- instance, just remove with THIS mod
-
- * gui/e-week-view.c (e_week_view_on_delete_occurrence): ditto
-
- * cal-client/cal-client.c (cal_client_remove_object_with_mod):
- send the mod parameter to the backend
- (cal_client_remove_object): implement with above
- (cal_client_update_object_with_mod): send the mod parameter to the
- backend
- (cal_client_update_object): implement with above
-
- * cal-client/cal-client.h: new protos
-
- * cal-client/cal-client.c (cal_client_is_read_only): return
- booleans in the pre conditions
- (cal_client_update_object): pass mod param
- (cal_client_update_objects): ditto
- (cal_client_remove_object): ditto
- (cal_client_ensure_timezone_on_server): ditto
-
- * pcs/cal.c (impl_Cal_update_objects): take mod param
- (impl_Cal_remove_object): ditto
-
- * pcs/cal-backend.h: fix protos
-
- * pcs/cal-backend.c (cal_backend_update_objects): take mod param
- (cal_backend_remove_object): ditto
-
- * pcs/cal-backend-file.c (cal_backend_file_update_objects): take
- mod param
- (cal_backend_file_remove_object): ditto
-
- * cal-util/cal-util.h: add mod enum
-
- * cal-util/cal-recur.c (cal_recur_generate_instances_of_rule): if
- its an instance, just report the instance
-
- * cal-util/cal-component.h: new protos
-
- * cal-util/cal-component.c (cal_component_is_instance): indicate
- whether the component is an instance or not
- (cal_component_free_range): free a range
-
- * idl/evolution-calendar.idl: get remove and update to take mod
- type
-
-2003-03-03 Hans Petter Jansson <hpj@ximian.com>
-
- * gui/dialogs/alarm-page.c
- * gui/dialogs/event-page.c
- * gui/dialogs/meeting-page.c
- * gui/dialogs/recurrence-page.c
- * gui/dialogs/schedule-page.c
- * gui/dialogs/task-details-page.c
- * gui/dialogs/task-page.c (get_widgets): gtk_widget_unparent() ->
- gtk_container_remove(). The former caused crashes in the
- addressbook's name-selector.
-
-2003-03-01 Hans Petter Jansson <hpj@ximian.com>
-
- * Makefile.am: Do importers after the other dirs, as it relies on
- generated files from there. This is still not optimal... Should
- probably introduce dependencies.
-
-2003-02-28 Hans Petter Jansson <hpj@ximian.com>
-
- * importers/Makefile.am: Shlibify.
-
- * importers/GNOME_Evolution_Calendar_Importer.server.in.in:
- Shlibify.
-
- * importers/icalendar-importer.c: Add necessary includes.
- (importer_destroy_cb): This is now a GWeakNotify func. gtk_ -> g_.
- (ical_importer_new)
- (vcal_importer_new)
- (gnome_calendar_importer_destroy_cb): Destroy signal -> weak ref.
-
- * importers/main.c: Add necessary includes. Shlibify.
-
-2003-02-28 Dan Winship <danw@ximian.com>
-
- * gui/dialogs/Makefile.am: build libcal-dialogs as an uninstalled
- shared library
- ($(IDL_GENERATED_H), etc): Only generate
- Evolution-Addressbook-SelectNames.h, not the corresponding .c
- files, or we'll get duplicate symbol errors trying to link this
- into libevolution_calendar.la
-
- * gui/Makefile.am (libevolution_calendar_la_LIBADD): Update for
- that (and eliminate libtool portability warnings)
-
-2003-02-28 Hans Petter Jansson <hpj@ximian.com>
-
- * Makefile.am (SUBDIRS): Add importers/.
-
- * importers/Makefile.am (server_in_files)
- (server_DATA): Insert $(libexecdir).
-
- * importers/icalendar-importer.c (connect_to_shell):
- oaf_activate_from_id() -> bonobo_activation_activate_from_id().
- (load_vcalendar_file): U_() -> _().
-
- * importers/GNOME_Evolution_Calendar_Importer.server.in:
- Renamed to corresponding .in.in.
-
-2003-02-28 Dan Winship <danw@ximian.com>
-
- * gui/Makefile.am (libevolution_calendar_la_LIBADD): Remove
- libalarm.a, which was not being used by the calendar.
-
- * gui/main.c: Remove unneeded alarm.h include.
-
- * gui/alarm-notify/Makefile.am (noinst_LIBRARIES): Stop building
- libalarm.a
- (evolution_alarm_notify_SOURCES): Add alarm.c, alarm.h
- (evolution_alarm_notify_LDADD): Remove libalarm.a
-
-2003-02-27 JP Rosevear <jpr@ximian.com>
-
- * conduits/todo/Makefile.am: link to versist libtool object
-
- * conduits/calendar/Makefile.am: ditto
-
-2003-02-26 Hans Petter Jansson <hpj@ximian.com>
-
- This makes alarm notification work.
-
- * gui/alarm-notify/notify-main.c (main): Initialize GTK. Don't
- initialize bonobo activation - bonobo_init() does that for us.
-
-2003-02-26 Hans Petter Jansson <hpj@ximian.com>
-
- This makes creating appointments and tasks from the "New" button work.
-
- * gui/main.c (comp_editor_factory_fn): Doesn't need to take any args.
- (factory): Add a handler for CompEditorFactory.
-
-2003-02-26 Hans Petter Jansson <hpj@ximian.com>
-
- Fixes Ximian #37895.
-
- * gui/e-day-view.c (e_day_view_destroy): g_object_unref () ->
- pango_font_description_free ().
- (e_day_view_style_set): Ditto.
-
- * gui/e-week-view.c (e_week_view_destroy): Ditto.
-
-2003-02-26 Hans Petter Jansson <hpj@ximian.com>
-
- Fixes Ximian #38306.
-
- * gui/e-itip-control.c (clean_up): Do nothing if the private structure
- has been freed. Don't call non-g_free() freers with NULL pointers.
- (destroy): Do nothing if the private structure has been freed. Clear
- pointers to freed blocks.
-
-2003-02-25 Hans Petter Jansson <hpj@ximian.com>
-
- * gui/print.c (print_calendar): Use fixed margins of 5% of page
- width/height. This is the same cheat as gtkhtml employs to get
- around the fact that GNOME_PRINT_KEY_PAGE_MARGIN_* don't return
- useful values (I think). It sort of sucks, but is better than
- no margins at all.
- (print_comp): Ditto.
-
-2003-02-25 Hans Petter Jansson <hpj@ximian.com>
-
- * gui/calendar-config.c (calendar_config_get_default_view): Get
- default view from correct key.
-
-2003-02-25 Hans Petter Jansson <hpj@ximian.com>
-
- * gui/dialogs/cal-prefs-dialog.c (get_widgets): Show start/end-of-day
- widgets.
-
-2003-02-23 Hans Petter Jansson <hpj@ximian.com>
-
- * cal-client/cal-client.c (cal_client_is_read_only): Don't warn
- if calendar isn't loaded... Doesn't seem to hurt, but this should
- probably be investigated further.
-
- * gui/dialogs/comp-editor-util.c (comp_editor_contacts_to_widget):
- If we have no contacts, don't bother trying to set them in the
- widget. Used to pass a NULL list, which would lead to much anxiety
- in callees.
-
- * gui/dialogs/meeting-page.c (meeting_page_fill_widgets):
- If we have no potential organizers, emit a sensible warning.
-
- * gui/dialogs/task-page.c (init_widgets): Don't try to connect to
- the "changed" signal of the GtkTextView -- we listen to the
- GtkTextBuffer now.
-
-2003-02-20 Not Zed <NotZed@Ximian.com>
-
- * gui/e-itip-control.c (destroy): dont unref accounts anymore.
- (change_status): itipAddress -> EAccount.
-
- * gui/calendar-model.c (calendar_model_destroy): dont unref
- accounts anymore.
- (calendar_model_value_at): simplify logic using account_list_find.
-
- * gui/dialogs/task-editor.c (task_editor_edit_comp): use new
- itip_addresses interfaces.
-
- * gui/dialogs/meeting-page.c (meeting_page_construct): use new
- itip_addresses_* interfaces. Should probably be using e_account
- directly.
- (meeting_page_finalize): dont unref the accounts list.
-
- * gui/dialogs/event-editor.c (event_editor_edit_comp): dont unref
- accounts anymore.
-
- * gui/itip-utils.c (itip_addresses_get_default): Just use
- e_account_list_get_default.
- (itip_addresses_get): dont ref the account object, just keep 1 ref
- to it.
- (find_account): remove.
- (itip_organizer_is_user): use e_account_list_find now.
- (itip_sentby_is_user): "
- (comp_limit_attendees): "
-
-2003-02-19 Not Zed <NotZed@Ximian.com>
-
- * gui/dialogs/meeting-page.c: addresses->accounts
- (meeting_page_finalize): unref accounts.
-
- * gui/dialogs/event-editor.c: Use EAccountList api's
-
- * pcs/cal-backend-util.c (cal_backend_mail_account_get): Removed,
- use a global EAccountList instead.
- (cal_backend_mail_account_get_default): Use the global
- EAccountList directly.
- (cal_backend_mail_account_is_valid): And here too.
-
- * gui/itip-utils.h: Removed ItipAddress structure.
-
- * gui/itip-utils.c (itip_addresses_get): Change it to return a
- global account object, so we dont need to duplicate all account
- info in the calendar.
- (itip_addresses_free, itip_address_free): Removed, use
- g_object_unref.
- (itip_addresses_get_default): Return an EAccount.
- (find_account): helper to lookup accounts based on name/address.
- (itip_organizer_is_user): Use helper to find account.
- (itip_sentby_is_user): "
- (comp_limit_attendees): "
- (comp_sentby): Update to use an EAccount direclty.
- (get_address): Removed, now redundant.
-
- * gui/e-itip-control.c: Changed priv->addresses to be accounts
- EAccountList.
- (destroy): unref accounts.
- (find_my_address): Change to use accounts list directly, also fix
- a small potential memleak.
-
- * gui/calendar-model.c: Change priv->addresses to be a direct
- reference to an EAccountList, renamed priv->accounts.
- (calendar_model_destroy): unref accounts.
- (calendar_model_value_at): Use EAccountList directly to lookup
- members.
-
- * gui/calendar-config.c (calendar_config_get_timezone)
- (calendar_config_set_timezone): Fix timezone key.
- (calendar_config_get_24_hour_format): Same for 24 hour format key.
- (calendar_config_set_24_hour_format): And here.
- (calendar_config_get_week_start_day): "
- (calendar_config_set_week_start_day): "
- (calendar_config_get_day_start_hour): "
- (calendar_config_set_day_start_hour): "
- (calendar_config_get_day_start_minute): "
- (calendar_config_set_day_start_minute): "
- (calendar_config_get_day_end_hour): "
- (calendar_config_set_day_end_hour): "
- (calendar_config_get_day_end_minute)
- (calendar_config_set_day_end_minute)
- (calendar_config_get_time_divisions)
- (calendar_config_set_time_divisions)
- (calendar_config_get_dnav_show_week_no)
- (calendar_config_set_dnav_show_week_no)
- (calendar_config_get_default_view)
- (calendar_config_set_default_view)
- (calendar_config_get_hpane_pos, calendar_config_set_hpane_pos)
- (calendar_config_get_vpane_pos, calendar_config_set_vpane_pos)
- (calendar_config_get_month_hpane_pos)
- (calendar_config_set_month_hpane_pos)
- (calendar_config_get_month_vpane_pos)
- (calendar_config_set_month_vpane_pos)
- (calendar_config_get_compress_weekend)
- (calendar_config_set_compress_weekend)
- (calendar_config_get_show_event_end)
- (calendar_config_set_show_event_end)
- (calendar_config_get_working_days)
- (calendar_config_set_working_days)
- (calendar_config_get_hide_completed_tasks)
- (calendar_config_set_hide_completed_tasks)
- (calendar_config_get_hide_completed_tasks_units)
- (calendar_config_set_hide_completed_tasks_units)
- (calendar_config_get_hide_completed_tasks_value)
- (calendar_config_set_hide_completed_tasks_value)
- (calendar_config_get_confirm_delete)
- (calendar_config_set_confirm_delete)
- (calendar_config_get_confirm_expunge)
- (calendar_config_set_confirm_expunge)
- (calendar_config_get_tasks_due_today_color)
- (calendar_config_set_tasks_due_today_color)
- (calendar_config_get_tasks_overdue_color)
- (calendar_config_set_tasks_overdue_color)
- (calendar_config_get_use_default_reminder)
- (calendar_config_set_use_default_reminder)
- (calendar_config_get_default_reminder_interval)
- (calendar_config_set_default_reminder_interval)
- (calendar_config_get_default_reminder_units)
- (calendar_config_set_default_reminder_units)
- (calendar_config_default_calendar_folder)
- (calendar_config_default_tasks_folder): Update config paths for
- new config convention, etc.
-
- * gui/alarm-notify/save.c (KEY_LAST_NOTIFICATION_TIME, etc):
- Updated keys to lowercase/proper path.
- (save_calendars_to_load): Store the calendars list as a gconf
- list.
- (get_calendars_to_load): Load the calendars list as a gconf list.
- (save_blessed_program): Similar, for the blessed program list.
- (is_blessed_program): Same here.
-
- * gui/alarm-notify/config-data.c (config_data_get_timezone): Update
- the path to the timezone key.
- (config_data_get_24_hour_format): Fix path to config option.
-
- * conduits/todo/todo-conduit.c (get_default_timezone): lower-case
- the timezone key.
-
- * conduits/calendar/calendar-conduit.c (get_default_timezone):
- lower-case the timezone key.
-
- * cal-client/cal-client.c (get_default_uri): Use the proper path
- to get the default folder uri's.
-
-2003-02-23 Hans Petter Jansson <hpj@ximian.com>
-
- * gui/gnome-cal.c (backend_died_cb): Appease the compiler.
- (gnome_calendar_update_paned_quanta): Don't actually try to set
- the quantum properties. The quantum code should probably go away
- entirely now that the panes update during resize, but let's keep
- it around for a bit more.
-
- * gui/dialogs/event-editor.c (event_editor_construct): Ref & sink
- the pages.
-
- * gui/dialogs/task-editor.c (task_editor_construct): Ref & sink
- the pages.
-
-2003-02-23 Hans Petter Jansson <hpj@ximian.com>
-
- * gui/cal-search-bar.c (make_suboptions): Eliminate
- e_utf8_to_gtk_string ().
-
- * gui/e-timezone-entry.c (e_timezone_entry_get_display_name):
- Ditto.
-
- * gui/calendar-model.c (date_value_to_string):
- e_utf8_from_locale_string () -> g_locale_to_utf8 ().
- (calendar_model_value_to_string): Ditto.
-
- * gui/e-cell-date-edit-text.c (ecd_get_text): Ditto.
-
- * gui/e-itip-control.c (write_label_piece): Ditto.
-
- * gui/print.c (format_date): Ditto.
- (print_week_view_background): Ditto.
- (print_month_summary): Ditto.
- (print_date_label): Ditto.
- (print_comp_item): Ditto.
-
- * gui/alarm-notify/alarm-notify-dialog.c (write_html_heading):
- Ditto.
-
-2003-02-22 Hans Petter Jansson <hpj@ximian.com>
-
- * gui/dialogs/task-details-page.c (get_widgets): Show the custom
- widgets, since libglade appears to not want to do that.
-
- * gui/dialogs/task-page.c (clear_widgets): Make the description
- field use a GtkTextView.
- (task_page_fill_widgets): Ditto.
- (task_page_fill_component): Ditto.
- (init_widgets): Ditto.
- (get_widgets): Show the custom widgets, since libglade doesn't do it.
-
-2003-02-22 Hans Petter Jansson <hpj@ximian.com>
-
- * pcs/cal-backend.c (cal_backend_unref_categories): Add an
- iteration statement. Fixes hang in wombat.
-
-2003-02-22 Hans Petter Jansson <hpj@ximian.com>
-
- * gui/apps_evolution_calendar.schemas: Commit fixes from
- Grzegorz Goawski <grzegol@pld.org.pl>.
-
-2003-02-21 Hans Petter Jansson <hpj@ximian.com>
-
- * gui/calendar-model.c (calendar_model_class_init): GObject, not
- GtkObject.
- (calendar_model_destroy): -> calendar_model_finalize ().
-
- * gui/calendar-view.c (calendar_view_class_init): GObject, not
- GtkObject.
- (calendar_view_destroy): -> calendar_view_finalize ().
-
- * gui/comp-editor-factory.c (comp_editor_factory_class_init):
- GObject, not GtkObject.
- (comp_editor_factory_destroy): -> comp_editor_factory_finalize ().
-
- * gui/e-day-view.c (e_day_view_long_event_button_press):
- gtk_signal_disconnect () -> g_signal_handler_disconnect ().
- (e_day_view_on_event_button_press): Ditto.
- (e_day_view_on_long_event_click): Ditto.
- (e_day_view_on_event_click): Ditto.
- (e_day_view_on_event_double_click): Ditto.
- (e_day_view_on_delete_appointment): Ditto.
-
- * gui/e-week-view.c (e_week_view_on_text_item_event):
- gtk_signal_disconnect () -> g_signal_handler_disconnect ().
-
- * gui/alarm-notify/alarm-notify.c (AlarmNotify_RemoveCalendar):
- Don't cast to GtkObject.
-
-2003-02-21 Dan Winship <danw@ximian.com>
-
- * cal-client/Makefile.am (libcal_client_la_LIBADD): depend on
- libcal-util, libwombat, and libeutil
- (client_test_LDADD): Remove those deps from here
-
- * cal-util/Makefile.am (libcal_util_la_LIBADD): depend on
- libical-evolution.la
- (test_recur_LDADD): Remove that dependency here (and an ancient
- libversit dependency).
-
- * gui/alarm-notify/Makefile.am (evolution_alarm_notify_LDADD):
- remove some deps
-
- * gui/Makefile.am (libevolution_calendar_la_LIBADD): Likewise.
-
-2003-02-20 Hans Petter Jansson <hpj@ximian.com>
-
- * gui/apps_evolution_calendar.schemas: Add GConf schemas.
-
- * gui/Makefile.am (EXTRA_DIST): Dist GConf schemas.
- (install-data-local): Install GConf schemas.
-
-2003-02-20 Dan Winship <danw@ximian.com>
-
- * gui/Makefile.am (libevolution_calendar_la_LIBADD):
- s/libemiscwidgets.a/libemiscwidgets.la/ and likewise for
- libetimezonedialog
-
-2003-02-19 Ettore Perazzoli <ettore@ximian.com>
-
- * pcs/Makefile.am: Split $(CORBA_GENERATED_H) rule from the
- $(CORBA_GENERATED_C) rule to that it autogens properly when using
- parallel makes.
- * cal-client/Makefile.am: Likewise.
-
- * gui/gnome-cal.c (gnome_calendar_setup_view_menus): Fix path to
- the calendar's GAL Views directory. [Pointed out by Grzegorz
- Goawski.]
-
-2003-02-11 Hans Petter Jansson <hpj@ximian.com>
-
- Enable printing for calendar and tasks.
-
- * gui/print.c: Set default font to be "Sans". Store the PrintConfig
- globally instead of PaperInfo (which doesn't exist anymore).
- (get_font_for_size): Don't use
- gnome_font_face_find_closest_from_weight_slant() anymore, since
- it's broken. Instead, use gnome_font_face_find() and put bold- and
- italicness in the name to look for. Descenders can now be negative,
- so have to take the absolute value to get font height.
- (print_comp): Use global, persistent print configuration.
- GnomePrintDialog is now a GtkDialog. Remove manual configuration
- parameter shuffling. Set up page using new methods.
- (print_calendar): Like print_comp(). For month view, force landscape
- mode by temporarily setting it in the config, and remove the old hack.
- (print_setup): Port. I'm not sure this works, but at least it
- compiles now. How do I test this code path?
- (print_day_view): Pass NULL for page denominator.
- (print_week_view): Ditto.
- (print_month_view): Ditto.
- (print_year_view): Ditto.
- (print_comp_item): Add missing gnome_print_beginpage(). How did this
- work before?
-
- * gui/tasks-control.c: Store the PrintConfig globally instead of
- passing individual parameters every time. Persistent too.
- (print_title): Look for "Sans Bold" instead of "Times" with
- GNOME_FONT_BOLD property. Don't use find_closest_from_weight_slant().
- (print_tasks): Set up page using new methods. GnomePrintMaster ->
- GnomePrintJob. Get params from global config instead of args.
- (tasks_control_print_cmd): Use global, persistent print configuration.
- Remove manual portrait/landscape hack. GnomePrintDialog is now a
- GtkDialog. Set params in global config instead of passing them to
- print_tasks().
- (tasks_control_print_preview_cmd): print_tasks() now takes fewer
- args.
-
-2003-02-11 Hans Petter Jansson <hpj@ximian.com>
-
- * gui/e-meeting-time-sel.c (e_meeting_time_selector_construct):
- Don't use gtk_scrolled_window_set_scrollbar_spacing() anymore.
-
-2003-02-10 Hans Petter Jansson <hpj@ximian.com>
-
- * pcs/cal-backend-file.c (save): Don't try to make an error string
- from an uninitialized GnomeVFSResult.
-
-2003-02-10 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/Makefile.am: Make the CORBA IDL compilation work with
- parallel makes.
- * gui/dialogs/Makefile.am: Likewise.
- * gui/alarm-notify/Makefile.am: Likewise.
-
-2003-02-07 Rodney Dawes <dobey@ximian.com>
-
- * gui/alarm-notify/GNOME_Evolution_Calendar_AlarmNotify.server.in:
- remove this file, as it's generated now
- * gui/alarm-notify/GNOME_Evolution_Calendar_AlarmNotify.server.in.in:
- Add this file to generate the .server.in from, with hardcoded path
- * gui/alarm-notify/Makefile.am: Hardcode path in server file
-
-2003-02-07 Rodrigo Moya <rodrigo@ximian.com>
-
- Fixes #37706
-
- * gui/comp-editor-factory.c (cal_opened_cb): added PERMISSION_DENIED
- case for not ending process on g_assert_not_reached.
-
-2003-02-06 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/e-day-view-time-item.c
- (e_day_view_time_item_show_popup_menu): Use
- e_auto_kill_popup_menu_on_selection_done() instead of
- e_auto_kill_popup_menu_on_hide().
- * gui/dialogs/meeting-page.c (right_click_cb): Likewise.
-
-2003-02-06 Dan Winship <danw@ximian.com>
-
- * gui/dialogs/event-page.c (make_timezone_entry): show the widget
- before returning it.
-
- * importers/main.c (main): s/PACKAGE/GETTEXT_PACKAGE/ in gettext
- init
-
-2003-02-05 Dan Winship <danw@ximian.com>
-
- * gui/Makefile.am (INCLUDES): Remove cruft. Rename ICONSDIR to
- IMAGESDIR.
- (gladedir, etspecdir, serverdir): Remove definitions
- (libevolution_calendar_la_LDFLAGS): Remove -export-dynamic, add
- -module.
-
- * gui/calendar-config.c: #include <string.h>
-
- * gui/calendar-component.c (add_creatable_item):
- s/ICONSDIR/IMAGESDIR/
-
- * gui/comp-util.c: #include <string.h>
-
- * gui/e-alarm-list.c: #include e-time-utils.h
- (row_deleted): Remove unused variable.
- (e_alarm_list_append): Likewise.
-
- * gui/e-date-time-list.c: #include e-time-utils.h, timeutil.h,
- calendar-config.h
- (row_deleted): Remove unused variable
- (e_date_time_list_append): Likewise.
-
- * gui/e-day-view.c (e_day_view_unrealize): Remove unused var
- (e_day_view_style_set): Likewise.
- (e_day_view_set_event_font_cb): Likewise.
-
- * gui/e-day-view-time-item.c: #include <string.h>
- (e_day_view_time_item_get_column_width): Remove unused variable.
-
- * gui/e-itip-control.c: #include <unistd.h>
- (url_requested_cb): s/ICONSDIR/IMAGESDIR/
-
- * gui/e-week-view.c (e_week_view_unrealize): Remove unused variable
- (e_week_view_style_set): Likewise
-
- * gui/e-week-view-titles-item.c: #include string.h
- * gui/itip-bonobo-control.c: Likewise
- * gui/print.c: Likewise
-
-
- * gui/alarm-notify/Makefile.am: Use privlibexecdir.
- (INCLUDES): Remove cruft.
- (gladedir, serversdir): Remove definitions
- (evolution_alarm_notify_LDFLAGS): Remove no-longer-needed
- -export-dynamic.
-
- * gui/alarm-notify/alarm-notify-dialog.c (write_html_heading):
- s/ICONSDIR/IMAGESDIR
-
- * gui/alarm-notify/notify-main.c (main): Fix up gettext
- initialization
-
-
- * gui/dialogs/Makefile.am (INCLUDES): Remove cruft. Rename
- ICONSDIR to IMAGESDIR.
- (gladedir, etspecdir): Remove definitions
-
- * gui/dialogs/alarm-page.c: #include gtktreeselection.h and
- gtkcellrenderertext.h
- (append_reminder): Remove unused variable.
- (alarm_page_fill_component): Likewise.
- (alarm_page_set_summary): Likewise.
- (delete_clicked_cb): Likewise.
-
- * gui/dialogs/comp-editor.c (make_icon_from_comp):
- s/ICONSDIR/IMAGESDIR/
-
- * gui/dialogs/event-page.c: #include <string.h>
-
- * gui/dialogs/meeting-page.c (meeting_page_construct): Remove
- unused variable.
- (meeting_page_fill_widgets): Likewise
-
- * gui/dialogs/recurrence-page.c: #include gtktreeselection.h and
- gtkcellrenderertext.h
- (append_exception): Remove unused variable
- (fill_component): Likewise
- (recurrence_page_set_summary): Likewise.
- (exception_delete_cb): Likewise
-
-
- * cal-client/Makefile.am (libcal_clientincludedir): Define in
- terms of privincludedir
-
- * cal-client/client-test.c (main): Fix up gettext initialization
-
- * cal-client/cal-client.c (cal_client_construct): Likewise
-
-
- * cal-util/Makefile.am (INCLUDES): Remove cruft.
- (libcal_utilincludedir): Define in terms of privincludedir
-
-
- * pcs/Makefile.am (INCLUDES): Remove cruft.
- (pcsincludedir): Define in terms of privincludedir
-
- * pcs/cal-backend-file.c (cal_backend_file_finalize): Remove
- unused variable
-
-
- * importers/Makefile.am: Update this some although it's not
- currently being built
-
-2003-02-05 Dan Winship <danw@ximian.com>
-
- * gui/alarm-notify/notify-main.c (main):
- s/glade_gnome_init/glade_init/
-
- * gui/calendar-offline-handler.c: s/BonoboXObject/BonoboObject/
+2002-12-06 Rodrigo Moya <rodrigo@ximian.com>
- * gui/comp-editor-factory.c: Likewise
+ Fixes #35003
-2003-02-05 Dan Winship <danw@ximian.com>
+ * gui/misc.[ch] (get_uri_without_password): new function for
+ removing the password from the CalClient's uris.
- * cal-util/cal-recur.c (cal_recur_nth): array of localized month
- day names ("1st" - "31st")
+ * gui/gnome-cal.c (client_cal_opened_cb): use the URI returned by
+ get_uri_without_password for messages.
+ (backend_error_cb): likewise.
+ (backend_died_cb): likewise.
+ (gnome_calendar_open): likewise.
+ (open_error, method_error, permission_error): likewise.
- * gui/dialogs/recurrence-page.c (make_recur_month_num_submenu,
- make_recur_month_num_menu, month_num_menu_selection_done_cb): Use
- the new cal_recur_nth[] array. The way this was done before didn't
- localize properly.
+ * gui/e-tasks.c (e_tasks_open): hide the password from the URI
+ being displayed in messages.
+ (backend_error_cb): likewise.
- From evolution-1-2-branch:
+2002-12-02 Dan Winship <danw@ximian.com>
* gui/e-itip-control.c (write_recurrence_piece): Describe
recurrences, if we can. #30993
@@ -1634,1138 +678,103 @@
just the date, for describing the end of recurrences (since the
time in the UNTIL is the *beginning* of the last instance, which
would confuse people).
- (update_item): Set the VCALENDAR's METHOD.
- (ok_clicked_cb): Use update_item, not remove_item, to process a
- cancelation. Part of #33875.
-
- * pcs/cal-backend-file.c (cal_backend_file_cancel_object): New,
- handle an ICAL_METHOD_CANCEL update.
- (cal_backend_file_update_objects): Call
- cal_backend_file_update_object or cal_backend_file_cancel_object
- as appropriate.
-
-2003-02-04 Hans Petter Jansson <hpj@ximian.com>
-
- * gui/e-meeting-time-sel.c
- (e_meeting_time_selector_on_invite_others_button_draw):
- Rename to e_meeting_time_selector_on_invite_others_button_expose()
- and handle "expose-event" instead of "draw".
- (e_meeting_time_selector_construct): The "draw" signal doesn't exist
- anymore - connect to "expose-event" instead.
-
- * gui/dialogs/event-page.c (clear_widgets): Clear the GtkTextBuffer
- for the description.
- (event_page_fill_widgets): Use the GtkTextBuffer.
- (event_page_fill_component): Use the GtkTextBuffer.
- (init_widgets): Create a GtkTextBuffer for the GtkTextView. Set word
- wrap. Connect to the "changed" signal of the model instead of the view.
-
-2003-02-04 Hans Petter Jansson <hpj@ximian.com>
-
- * gui/e-meeting-time-sel-item.c
- (e_meeting_time_selector_item_paint_day_top): Use PangoLayout to
- draw text.
-
-2003-02-02 Hans Petter Jansson <hpj@ximian.com>
-
- * gui/e-day-view.c (e_day_view_set_event_font_cb): Skip setting the
- "font_gdk" arg for now.
- (e_day_view_update_main_canvas_drag): Ditto.
-
- * gui/e-week-view.c (e_week_view_style_set): Ditto.
-
- * gui/weekday-picker.c (configure_items): Ditto.
-
- * gui/dialogs/event-page.c (get_widgets): Show custom widgets
- manually, since the visibility specified in the Glade XML appears
- to not have any effect.
-
- * gui/dialogs/recurrence-page.c (get_widgets): Ditto.
-
-2003-01-30 Ronald Kuetemeier <ronald@kuetemeier.com>
-
- Fixes #35572
-
- * gui/alarm-notify/alarm-queue.c: set saved_notification_time to last
- notification time when we update the config to last notification, so
- alarms will not get trigged again if a new calendar window is opened.
-
-2003-01-26 Chris Toshok <toshok@ximian.com>
-
- * conduits/todo/todo-conduit.c: CalClient and CalComponent are
- GObjects.
-
- * conduits/calendar/calendar-conduit.c: same.
-
-2003-01-26 Chris Toshok <toshok@ximian.com>
-
- * conduits/calendar/calendar-conduit.c (start_calendar_server):
- fix warning.
- (get_default_timezone): BonoboConfigDatabase -> e_config_listener.
- (accept_all_cookies): remove.
- (conduit_get_gpilot_conduit): remove the oaf initialization stuff.
-
- * conduits/todo/todo-conduit.c (start_calendar_server):
- fix warning.
- (get_default_timezone): BonoboConfigDatabase -> e_config_listener.
- (accept_all_cookies): remove.
- (conduit_get_gpilot_conduit): remove the oaf initialization stuff.
-
- * Makefile.am (CONDUIT_DIR): uncomment the conduit stuff.
-
-2003-01-26 Hans Petter Jansson <hpj@ximian.com>
-
- Make clicks, drags and resizes work, and pangoize remaining strings.
- Fix EText placement.
-
- * gui/e-day-view-top-item.c (e_day_view_top_item_draw_long_event):
- Use Pango.
-
- * gui/e-day-view.c (e_day_view_on_top_canvas_button_press):
- Don't add scroll offset, it's already factored in.
- (e_day_view_on_main_canvas_button_press): Ditto.
- (e_day_view_on_top_canvas_motion): Ditto.
- (e_day_view_on_main_canvas_motion): Ditto.
- (e_day_view_reshape_long_event): Don't set the "font_gdk" property.
- Its non-existence will prevent the other properties from being set as
- well.
- (e_day_view_reshape_day_event): Ditto.
- (e_day_view_update_top_canvas_drag): Ditto.
- (e_day_view_start_editing_event): ETextEventProcessor is a GObject
- now. So use g_signal_stuff.
- (e_day_view_check_auto_scroll): Factor out scroll offset before
- checking the pointer's position relative to widget.
- (e_day_view_auto_scroll_handler): Don't freeze the canvas when
- scrolling - it will fail to update the canvas. If this is not
- intended behaviour, it's a bug in the canvas, I think.
- (e_day_view_on_main_canvas_drag_motion): Factor in the scroll offset
- before checking for auto-scroll, since the function requires this.
-
- * gui/e-week-view.c (e_week_view_reshape_event_span): Don't set the
- "font_gdk" property. Its non-existence will prevent the other
- properties from being set as well.
- (e_week_view_start_editing_event): ETextEventProcessor is a GObject
- now. So use g_signal_stuff.
-
-2003-01-25 Hans Petter Jansson <hpj@ximian.com>
-
- Mainly making all views use PangoLayouts for text. When drawing a
- PangoLayout, the draw offset is the top left corner of the layout,
- not the text's baseline. Keep this in mind when viewing the
- changes. I'll be brief about the exact changes, since they speak
- better for themselves.
-
- * gui/e-day-view-time-item.c (e_day_view_time_item_get_column_width):
- Use Pango.
- (e_day_view_time_item_draw): Use Pango.
-
- * gui/e-day-view-top-item.c (e_day_view_top_item_draw): Use Pango.
- (e_day_view_top_item_draw_long_event): Add some FIXME text so we can
- see when this is being used. Is it in use at all?
-
- * gui/e-day-view.c: No longer specify an explicit X font string for
- the large font. Use the main font, and change the point size.
- (e_day_view_init): Use Pango.
- (e_day_view_style_set): Use Pango. Comment out the gdk_font setting
- for the drag text items for now.
-
- * gui/e-day-view.h: Use Pango.
-
- * gui/e-week-view-event-item.c (e_week_view_draw_time): Use Pango.
-
- * gui/e-week-view-main-item.c (e_week_view_main_item_draw_day):
- Use Pango.
-
- * gui/e-week-view-titles-item.c (e_week_view_titles_item_draw):
- Use Pango.
-
- * gui/e-week-view.c: No longer specify an explicit X font string for
- the small font. Use the main font, and change the point size.
- (e_week_view_init): Use Pango.
- (e_week_view_destroy): Use Pango.
- (get_string_width): Implemented for convenience.
- (get_digit_width): Implemented for convenience.
- (e_week_view_style_set): Use Pango.
- (e_week_view_recalc_cell_sizes): Use Pango.
- (e_week_view_get_time_string_width): Use Pango.
-
- * gui/e-week-view.h: Use Pango.
-
- Following are some random UTF-8 fixes and a crash fix.
-
- * gui/itip-utils.c (comp_description): Use g_locale_to_utf8 ().
-
- * gui/dialogs/comp-editor.c (make_title_from_comp): Return a
- UTF-8 string.
-
- * gui/dialogs/alarm-page.c (alarm_page_set_summary): Pass UTF-8
- directly to GTK.
-
- * gui/dialogs/delete-comp.c (delete_component_dialog): Ditto.
-
- * gui/dialogs/meeting-page.c (meeting_page_fill_widgets): Ditto.
- (meeting_page_construct): Ditto.
-
- * gui/dialogs/recurrence-page.c (recurrence_page_set_summary): Ditto.
-
- * gui/dialogs/event-editor.c (event_editor_finalize): Fix crash caused
- by gtk_object_destroy()-ing a non-GtkObject.
-
-2003-01-24 Hans Petter Jansson <hpj@ximian.com>
-
- * gui/e-day-view.c (e_day_view_on_editing_stopped): Don't insist
- appointment is updated if both old and new summary are blank.
-
- * gui/e-week-view.c (e_week_view_on_editing_stopped): Ditto.
-
- * gui/e-timezone-entry.c (on_button_clicked): Timezone dialog is now
- a GtkDialog. Treat it as such.
-
- * gui/goto.c (ecal_event): Goto dialog is now a GtkDialog. Treat it
- as such.
- (goto_dialog): Ditto.
-
- * gui/goto-dialog.glade: Set the return IDs from the dialog buttons.
-
- * gui/dialogs/meeting-page.c (popup_delegate_cb): Enable the delegate
- dialog. It's now a GtkDialog, so treat it like one.
- (right_click_cb): Use GTK stock item, not GNOME (that doesn't work
- anymore).
-
- * gui/e-delegate-dialog.glade: Set the return IDs from dialog buttons.
-
- * gui/print.c (print_calendar): Correct the print dialog init. Code
- is still not enabled, though.
-
- * gui/tasks-control.c (print_tasks): Add a warning about printing
- being disabled.
-
-2003-01-24 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/dialogs/Makefile.am (iconsdir): Remove, this is now defined
- in configure.in.
-
- * gui/Makefile.am (iconsdir): Remove; this is now defined in
- configure.in.
-
- * gui/alarm-notify/Makefile.am (iconsdir): Remove; this is now
- defined in configure.in.
-
-2003-01-23 Hans Petter Jansson <hpj@ximian.com>
-
- * gui/dialogs/event-page.c (get_widgets): GTK_OBJECT -> G_OBJECT cast.
-
- * gui/dialogs/alarm-page.c (get_widgets): Ditto.
-
- * gui/dialogs/meeting-page.c (get_widgets): Ditto.
-
- * gui/dialogs/recurrence-page.c (get_widgets): Ditto.
-
- * gui/dialogs/schedule-page.c (get_widget): Ditto.
-
- * gui/dialogs/task-details-page.c (get_widget): Ditto.
-
- * gui/dialogs/task-page.c (get_widget): Ditto.
- * gui/e-meeting-time-sel.c (e_meeting_time_selector_construct): Add a
- FIXME comment to think about.
+2002-11-30 Hans Petter Jansson <hpj@ximian.com>
- * gui/dialogs/comp-editor.c (comp_editor_merge_ui): Add a terminating
- NULL to the concatenation.
-
-2003-01-23 Hans Petter Jansson <hpj@ximian.com>
-
- Fixes some trivial, but distracting, warnings.
-
- * gui/calendar-config.c (on_timezone_set): Fix constness.
-
- * gui/e-timezone-entry.c (on_button_clicked): Fix constness.
-
- * gui/dialogs/event-page.c (contacts_changed_cb): Fix constness.
-
- * gui/dialogs/task-page.c (contacts_changed_cb): Fix constness.
-
- * gui/e-itip-control.c (start_default_server): Cast callback with
- G_CALLBACK ().
-
- * gui/dialogs/schedule-page.c (init_widgets): Cast callback with
- G_CALLBACK ().
-
- * gui/calendar-offline-handler.c (impl_dispose): Takes GObject,
- not GtkObject.
- (impl_finalize): Ditto.
-
- * gui/calendar-view.c (calendar_view_edit): Now takes parent window
- as second arg.
-
- * gui/e-meeting-model.c (select_names_ok_cb): Fix constness.
- (get_select_name_dialog): Cast callback to BonoboListenerCallbackFn.
-
- * gui/e-meeting-time-sel.c
- (e_meeting_time_selector_options_menu_position_callback): Add the
- push_in arg to arg list. This was crash-prone before.
- (e_meeting_time_selector_autopick_menu_position_callback): Ditto.
-
- * gui/alarm-notify/alarm-notify-dialog.c: Include e-unicode.h.
-
-2003-01-23 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/Makefile.am (componentdir): Removed definition; this is now
- defined in configure.in.
-
-2003-01-22 Ettore Perazzoli <ettore@ximian.com>
-
- * pcs/cal-backend.c (cal_backend_ref_categories): Do not put the
- category in both the changed_categories and the categories hashes;
- fixes a double-free when finalizing the CalBackend.
-
-2003-01-22 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/gnome-cal.c (gnome_calendar_setup_view_menus): Use
- EVOLUTION_GALVIEWSDIR.
-
- * gui/e-tasks.c (e_tasks_setup_view_menus): Use
- EVOLUTION_GALVIEWSDIR.
-
- * cal-util/Makefile.am: Install libcal-util.la in $(privlibdir)
- instead of $(libdir).
-
- * gui/dialogs/comp-editor.c (setup_widgets): Get
- evolution-comp-editor.xml from EVOLUTION_UIDIR.
- (comp_editor_merge_ui): Get the file in EVOLUTION_UIDIR.
-
- * gui/tasks-control.c (tasks_control_activate): Get
- evolution-tasks.xml from EVOLUTION_UI_DIRECTORY.
-
- * gui/calendar-commands.c (calendar_control_activate): Get
- evolution-calendar.xml from EVOLUTION_UI_DIRECTORY.
-
- * pcs/Makefile.am (pcsincludedir): Version using $(BASE_VERSION).
-
- * importers/Makefile.am: Install evolution-calendar-importer in
- $(libexecdir)/evolution/$(BASE_VERSION).
- (sounddir): Remove.
-
- * gui/dialogs/Makefile.am (iconsdir): Version using
- $(BASE_VERSION).
- (gladedir): Likewise.
- (etspecdir): Likewise.
-
- * gui/Makefile.am (help_base): Remove.
- (install-data-local): Do not make the $(help_base)/C directory.
- (etspecdir): Version using $(BASE_VERSION).
- (gladedir): Likewise.
- (iconsdir): Likewise.
- (INCLUDES): Update the EVOLUTION_IMAGESDIR define to be versioned,
- and add a -DEVOLUTION_GALVIEWSDIR.
-
- * cal-util/Makefile.am: Install evolution-alarm-notify in
- $(libexecdir)/evolution/$(BASE_VERSION).
-
- * cal-util/Makefile.am (libcal_utilincludedir): Version using
- $(BASE_VERSION).
- * gui/alarm-notify/Makefile.am (iconsdir): Likewise.
- (gladedir): Likewise.
-
- * cal-client/Makefile.am: Install libcal-client.la in privlibdir
- instead of libdir.
- (libcal_clientincludedir): Version using $(BASE_VERSION).
-
-2003-01-18 Hans Petter Jansson <hpj@ximian.com>
-
- * gui/print.c (print_calendar): Create a GnomePrintDialog,
- not a GnomePrinterDialog. They're different things. Patch from
- Chema.
-
-2003-01-17 Dan Winship <danw@ximian.com>
-
- * pcs/cal-backend.c: Move some non-file-backend-specific stuff
- from cal-backend-file here so it can be shared with other
- backends.
- (CalBackendPrivate): add this, containing the categories hashes
- and the (formerly public) clients list.
- (cal_backend_init, cal_backend_finalize): Handle backend->priv.
- (cal_destroy_cb): Simplify this (and redo it as a weak notify
- func)
- (cal_backend_add_cal): Keep a weak ref on the cal rather than
- connecting to its "destroy" signal. Call notify_categories_changed
- to let the new cal know about them.
- (get_object): Default implementation of cal_backend_get_object.
- that calls cal_component_get_as_string on the return value of
- cal_backend_get_object_component.
- (cal_backend_notify_mode, cal_backend_notify_update,
- cal_backend_notify_remove, cal_backend_notify_error): Notify each
- Cal about something.
- (cal_backend_ref_categories, cal_backend_unref_categories):
- Maintain a list of categories that are used by components in the
- backend, and trigger categories_changed notifications as needed.
-
- * pcs/cal-backend-file.c: Remove stuff that was moved to
- CalBackend (notify funcs, category handling, get_object
- implementation)
-
-2003-01-16 Hans Petter Jansson <hpj@ximian.com>
-
- * gui/e-alarm-list.[ch]: Implement EAlarmList as CalComponentAlarm
- list with a GtkTreeModel interface.
-
- * gui/Makefile.am: Add e-alarm-list.[ch].
-
- * gui/dialogs/alarm-page.[ch]: Use GtkTreeView with the new
- EAlarmList as model for the alarm list. Update copyright.
-
- * gui/dialogs/recurrence-page.[ch]: Update copyright.
- (free_exception_date_time): Removed.
- (fill_exception_widgets): Kill a lingering clist operation.
-
-2003-01-15 Hans Petter Jansson <hpj@ximian.com>
-
- * gui/e-meeting-time-sel.c (e_meeting_time_selector_construct):
- Create accel groups for popup menus. Fixes crash.
-
- * gui/e-date-time-list.[ch]: Implement EDateTimeList as
- CalComponentDateTime list with a GtkTreeModel interface.
-
- * gui/Makefile.am: Add e-date-time-list.[ch].
-
- * gui/dialogs/recurrence-page.c: Use GtkTreeView with the new
- EDateTimeList as model for the exception list.
-
- * gui/e-day-view.c: Silence warnings caused by missing casts.
-
- * gui/e-week-view.c: Silence warnings caused by missing casts.
-
-2003-01-15 Rodney Dawes <dobey@ximian.com>
-
- * gui/Makefile.am: Added libevolution_calendar_la_LDFLAGS, and
- avoid versioning the shlib component
-
-2003-01-14 Ettore Perazzoli <ettore@ximian.com>
-
- * cal-client/Makefile.am (CORBA_SOURCES_GENERATED): Renamed from
- CORBA_GENERATED.
- (CORBA_GENERATED): New, put both $(CORBA_SOURCES_GENERATED) and
- $(CORBA_HEADERS_GENERATED) in it.
- (BUILT_SOURCES): Put $(CORBA_GENERATED) in here.
-
-2003-01-14 Hans Petter Jansson <hpj@ximian.com>
+ * gui/e-meeting-model.c (append_row): Don't leak meeting attendees;
+ unref the attendee after it's assigned to model.
+ (select_names_ok_cb): Free the destinations string after we're done
+ with it.
- * gui/e-calendar-table.c (tasks_popup_menu): Cast signal handlers
- to GtkSignalFunc, avoid warnings.
+ * gui/dialogs/meeting-page.c (meeting_page_destroy): Free the actual
+ array of deleted attendees.
- * gui/gnome-cal.c (set_view): Only set view ID if we have an instance.
+ * gui/dialogs/event-editor.c (event_editor_destroy): Free the private
+ structure.
-2003-01-14 Ettore Perazzoli <ettore@ximian.com>
+ * gui/itip-utils.c (comp_description): Rework free/busy information
+ composer so we can free date/time information after use. Then free it.
+ (itip_send_comp): Free the allocated CORBA buffer for attachment data.
- * cal-util/Makefile.am (EXTRA_DIST): cal-util-marshal.list.
+ * gui/dialogs/comp-editor-util.c (comp_editor_contacts_to_component):
+ Free the destination contacts string once we're done with it.
- * Makefile.am: Comment out the CONDUIT_DIR stuff for now.
+ * gui/e-calendar-table.c (invisible_destroyed): Unref the invisible.
-2003-01-14 Rodney Dawes <dobey@ximian.com>
+ * gui/e-day-view.c (invisible_destroyed): Ditto.
- * gui/gnome-cal.c: Use GtkPaned instead of EPaned
+ * gui/e-week-view.c (invisible_destroyed): Ditto.
-2003-01-14 Hans Petter Jansson <hpj@ximian.com>
-
- * gui/e-day-view.c (e_day_view_init): Work around canvas crashes
- by ensuring rectangles have an initial width.
-
-2003-01-13 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/config-control-factory.h: Removed.
- * gui/config-control-factory.c: Removed.
-
- * gui/itip-bonobo-control.c: Renamed from itip-control-factory.c.
- (itip_bonobo_control_new): New.
- (itip_control_factory_init): Removed.
-
- * gui/itip-bonobo-control.h: Renamed from itip-control-factory.h.
-
- * gui/tasks-control-factory.c: Removed.
- * gui/tasks-control-factory.h: Removed.
-
- * gui/control-factory.c (control_factory_init): Removed.
-
- * gui/Makefile.am: Updated to build everything as
- libevolution-calendar.so and install in the COMPONENTDIR.
-
- * gui/GNOME_Evolution_Calendar.server.in.in: Updated to build the
- component as a shared library.
-
- * gui/main.c (main): Removed.
-
- * gui/calendar-component.c (calendar_component_get_object): New.
- (owner_set_cb): Do not store the shell pointer in shells.
- (owner_unset_cb): Do not remove the shell pointer from shells;
- instead, just set global_shell_client to NULL.
-
- * gui/calendar-component.h: Renamed from component-factory.h.
- * gui/calendar-component.c: Renamed from component-factory.c.
-
-2003-01-10 Ettore Perazzoli <ettore@ximian.com>
-
- * importers/icalendar-importer.c (connect_to_shell):
- CORBA_Object_release() the CORBA shell.
-
-2003-01-09 Dan Winship <danw@ximian.com>
-
- * gui/dialogs/recurrence-page.c (make_recur_month_num_submenu,
- make_recur_month_num_menu, month_num_menu_selection_done_cb): Use
- the new cal_recur_nth[] array. The way this was done before didn't
- localize properly.
-
- * cal-util/cal-recur.c (cal_recur_nth): array of localized month
- day names ("1st" - "31st")
-
- * cal-util/cal-component.c (cal_component_set_recurid): Allow
- recur_id to be NULL to clear the recurrence id. (Based on a story
- by JP on evolution-1-2-recurid-branch)
-
- * gui/print.c: Remove unused gnome-print-copies.h #include
-
- * pcs/query.c (query_new): Use g_object_weak_ref rather than
- connecting to "destroy" (which doesn't actually exist on a
- CalBackend)
- (backend_destroyed_cb): Update prototype.
-
-2003-01-08 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/alarm-notify/Makefile.am: Icons are now in
- $(datadir)/evolution/images instead of
- $(datadir)/images/evolution.
- * gui/Makefile.am: Likewise.
- * gui/dialogs/Makefile.am: Likewise.
-
-2003-01-06 Dan Winship <danw@ximian.com>
-
- * idl/Makefile.am: remove idldir definition. (It's defined in
- configure.in now)
-
-2002-12-19 Hans Petter Jansson <hpj@ximian.com>
-
- * gui/calendar-commands.c (calendar_control_deactivate):
- Replace gtk_signal_disconnect_by_data() with
- g_signal_handlers_disconnect_matched(). Former takes GtkObject,
- latter takes GObject.
-
- * gui/calendar-model.c (calendar_model_destroy): Ditto.
- (update_query): Ditto.
- (calendar_model_set_cal_client): Ditto.
+2002-11-26 Dan Winship <danw@ximian.com>
- * gui/e-day-view.c (e_day_view_destroy): Ditto.
- (update_query): Ditto.
- (e_day_view_set_cal_client): Ditto.
-
- * gui/e-tasks.c (query_eval_error_cb): Ditto.
- (query_query_done_cb): Ditto.
-
- * gui/e-week-view.c (e_week_view_destroy): Ditto.
- (update_query): Ditto.
- (e_week_view_set_cal_client): Ditto.
-
- * gui/gnome-cal.c (update_query): Ditto.
- (gnome_calendar_destroy): Ditto.
-
- * gui/tasks-control.c (tasks_control_deactivate): Ditto.
-
- * gui/e-comp-editor-registry.c (foreach_close_cb): Replace
- gtk_signal_handler_(un)block_by_data() with
- g_signal_handlers_(un)block_matched(). Former takes GtkObject, latter
- takes GObject.
-
- * gui/dialogs/alarm-page.c (alarm_page_get_type): Replace with
- E_MAKE_TYPE().
- (alarm_page_class_init): Use GObject as base class instead of
- GtkObject, and set up finalization instead of destroy handler.
- (alarm_page_destroy): Change to alarm_page_finalize() and assume
- parent is GObject, not GtkObject.
- (alarm_page_new): Use g_object_new(), not gtk_type_new().
-
- * gui/dialogs/event-page.c: Same general changes as above file.
- (update_time): Replace gtk_signal_handler_(un)block_by_data()
- with g_signal_handlers_(un)block_matched().
- (clear_widgets): Ditto.
- (times_updated): Ditto.
-
- * gui/dialogs/recurrence-page.c: Same general changes as above file.
- (clear_widgets): Replace gtk_signal_handler_(un)block_by_data()
- with g_signal_handlers_(un)block_matched().
- (append_exception): Ditto.
- (fill_ending_date): Ditto.
- (recurrence_page_fill_widgets): Ditto.
-
- * gui/dialogs/comp-editor.c: Same general changes as above file.
- (comp_editor_finalize): Replace gtk_signal_disconnect_by_data()
- with g_signal_handlers_disconnect_matched().
- (comp_editor_remove_page): Ditto.
-
- * gui/dialogs/event-editor.c: Same general changes as above file.
- * gui/dialogs/meeting-page.c: Same general changes as above file.
- * gui/dialogs/schedule-page.c: Same general changes as above file.
- * gui/dialogs/task-details-page.c: Same general changes.
- * gui/dialogs/task-editor.c: Same general changes as above file.
- * gui/dialogs/task-page.c: Same general changes as above file.
- * gui/dialogs/e-delegate-dialog.c: Same general changes.
-
-2002-12-16 Jeffrey Stedfast <fejj@ximian.com>
-
- * gui/e-itip-control.c (write_html): Use camel_text_to_html()
- instead.
-
-2002-12-16 Jeffrey Stedfast <fejj@ximian.com>
-
- * gui/e-itip-control.c (write_html): Correctly convert text.value
- into HTML here (ie, don't pass "<i>None</i>" into e_text_to_html()
- if text.value is NULL).
-
-2002-12-06 Rodrigo Moya <rodrigo@ximian.com>
-
- Fixes #35003
-
- * gui/misc.[ch] (get_uri_without_password): new function for
- removing the password from the CalClient's uris.
-
- * gui/gnome-cal.c (client_cal_opened_cb): use the URI returned by
- get_uri_without_password for messages.
- (backend_error_cb): likewise.
- (backend_died_cb): likewise.
- (gnome_calendar_open): likewise.
- (open_error, method_error, permission_error): likewise.
+ * gui/e-itip-control.c (update_item): Set the VCALENDAR's METHOD.
+ (ok_clicked_cb): Use update_item, not remove_item, to process a
+ cancelation. Part of #33875.
- * gui/e-tasks.c (e_tasks_open): hide the password from the URI
- being displayed in messages.
- (backend_error_cb): likewise.
+ * pcs/cal-backend-file.c (cal_backend_file_cancel_object): New,
+ handle an ICAL_METHOD_CANCEL update.
+ (cal_backend_file_update_objects): Call
+ cal_backend_file_update_object or cal_backend_file_cancel_object
+ as appropriate.
-2002-12-06 Hans Petter Jansson <hpj@ximian.com>
-
- * cal-client/cal-query.c (cal_query_done_status_enum_get_type):
- Implement GType for this enumeration.
- (cal_query_class_init): Use the enumeration instead of the
- abstract one.
-
- * cal-client/cal-query.h: Add type macro and proto for enum.
-
-2002-12-06 Hans Petter Jansson <hpj@ximian.com>
-
- * gui/component-factory.c (create_view): Pass the env argument to
- bonobo_control_set_property ().
-
- * gui/e-meeting-model.c (class_init): We're no longer derived from
- GtkObject, so use GObject class methods instead. destroy->finalize.
- (destroy): Zapped.
- (finalize): Implement based on old destroy ().
-
-2002-12-06 Hans Petter Jansson <hpj@ximian.com>
-
- * cal-client/cal-client.c (cal_client_open_status_enum_get_type):
- Create a non-abstract enumeration type derived from GEnum.
- (cal_client_set_mode_status_enum_get_type): Ditto.
- (cal_mode_enum_get_type): Ditto.
- (cal_client_class_init): Use our enumerations and not the abstract
- one.
- (cal_client_finalize): Don't destroy factories, since the CalClient
- doesn't own them anymore. They're shared between CalClients now.
- (get_factories): Implement. Move the factory setup code here from
- cal_client_construct (), and cache the factories. This is hopefully
- temporary, until wombat goes away or is fixed.
- (cal_client_construct): Most of the code moved to get_factories ().
-
- * cal-client/cal-client.h: Add enumeration type macros and protos.
-
- * gui/cal-search-bar.c (cal_search_bar_get_type): Removed in favour
- of E_MAKE_TYPE, which uses GObject calls.
- (cal_search_bar_class_init): Use g_type_class_peek_parent ().
-
- * gui/calendar-model.c (calendar_model_get_type):
- (calendar_model_class_init): Ditto, like above file.
- * gui/calendar-view.c (calendar_view_get_type):
- (calendar_view_class_init): Ditto.
- * gui/e-calendar-table.c (e_calendar_table_get_type):
- (e_calendar_table_class_init): Ditto.
- * gui/e-comp-editor-registry.c (e_comp_editor_registry_get_type):
- (class_init): Ditto.
- * gui/e-day-view-main-item.c (e_day_view_main_item_get_type):
- (e_day_view_main_item_class_init): Ditto.
- * gui/e-day-view-time-item.c (e_day_view_time_item_get_type):
- (e_day_view_time_item_class_init): Ditto.
- * gui/e-day-view-top-item.c (e_day_view_top_item_get_type):
- (e_day_view_top_item_class_init): Ditto.
- * gui/e-day-view.c (e_day_view_get_type):
- (e_day_view_class_init): Ditto.
- * gui/e-itip-control.c (e_itip_control_get_type):
- (class_init): Ditto.
- * gui/e-meeting-attendee.c (e_meeting_attendee_get_type):
- (class_init): Ditto.
- * gui/e-meeting-model.c (e_meeting_model_get_type):
- (class_init): Ditto.
- * gui/e-meeting-time-sel-item.c
- (e_meeting_time_selector_item_get_type):
- (e_meeting_time_selector_item_class_init): Ditto.
- * gui/e-meeting-time-sel.c
- (e_meeting_time_selector_get_type):
- (e_meeting_time_selector_class_init): Ditto.
- * gui/e-timezone-entry.c (e_timezone_entry_get_type):
- (e_timezone_entry_class_init): Ditto.
- * gui/e-week-view-event-item.c (e_week_view_event_item_get_type):
- (e_week_view_event_item_class_init): Ditto.
- * gui/e-week-view-main-item.c (e_week_view_main_item_get_type):
- (e_week_view_main_item_class_init): Ditto.
- * gui/e-week-view-titles-item.c (e_week_view_titles_item_get_type):
- (e_week_view_titles_item_class_init): Ditto.
- * gui/gnome-cal.c (gnome_calendar_get_type):
- (gnome_calendar_class_init): Ditto.
- * gui/weekday-picker.c (weekday_picker_get_type):
- (weekday_picker_class_init): Ditto.
-
- * gui/e-week-view.c (e_week_view_get_type):
- (e_week_view_class_init): Ditto, but parent_class init was moved
- from get_type() to class_init().
-
- * gui/calendar-view-factory.c (calendar_view_factory_get_type):
- (calendar_view_factory_class_init): Ditto, and set up finalize
- callback instead of destroy.
- (calendar_view_factory_finalize): It's a GObject, so implement this.
- (celendar_view_factory_destroy): Move code to _finalize() and remove.
-
- * gui/main.c (init_bonobo): Remove extraneous bonobo_activation_init().
-
-2002-11-27 Not Zed <NotZed@Ximian.com>
-
- * gui/itip-utils.[ch]: run fix.sh over this.
-
- * gui/dialogs/*.[ch]: run fix.sh over all of this.
+ * cal-util/cal-component.c (cal_component_set_recurid): If
+ @recur_id is NULL, clear the recurrence-id.
2002-11-26 Richard Li <Richard.Li@Sun.COM>
* cal-client/cal-client.c (cal_client_construct): removed extra call
to CORBA_exception_init.
-2002-11-22 Not Zed <NotZed@Ximian.com>
-
- * gui/dialogs/delete-comp.c (delete_component_dialog): Changed
- e_messagebox -> gtk_messagedialog.
-
-2002-11-21 Not Zed <NotZed@Ximian.com>
-
- * gui/component-factory.c (create_view): pass type to
- bonobo_control_set_property.
-
-2002-11-20 Not Zed <NotZed@Ximian.com>
-
- * gui/Makefile.am (EXTRA_DIST): fix typo, servers_in_files ->
- server_in_files.
-
-2002-11-19 Ettore Perazzoli <ettore@ximian.com>
-
- * Makefile.am: Added rule to generate
- GNOME_Evolution_Calendar.server.in from
- GNOME_Evolution_Calendar.server.in.in, substituting @LIBEXECDIR@.
- Also, install evolution-calendar in $libexecdir instead of
- $bindir.
-
- * gui/GNOME_Evolution_Calendar.server.in.in: Renamed from
- GNOME_Evolution_Calendar.server.in. Prepended the executable name
- with @LIBEXECDIR@.
-
-2002-11-19 Not Zed <NotZed@Ximian.com>
+2002-11-15 JP Rosevear <jpr@ximian.com>
- * gui/e-meeting-model.c (get_select_name_dialog): pass type to
- bonobo_widget::set_property.
- (select_names_ok_cb): ", for get_property.
-
- * gui/dialogs/e-delegate-dialog.c (e_delegate_dialog_construct):
- pass type to bonobo_widget::set_property & plug small leak.
- (e_delegate_dialog_get_delegate): ", for get_property.
- (e_delegate_dialog_get_delegate_name): "
-
- * gui/dialogs/comp-editor-util.c (comp_editor_contacts_to_widget):
- pass type to bonobo_widget::set_property.
- (comp_editor_contacts_to_component): ", for get_property
-
-2002-11-16 Chris Toshok <toshok@ximian.com>
-
- * gui/e-meeting-time-sel.c (e_meeting_time_selector_style_set):
- use new e_table_header_compute_height signature.
-
-2002-11-15 Rodney Dawes <dobey@ximian.com>
+ * gui/e-day-view.c (e_day_view_on_delete_occurrence): if its an
+ instance, just remove with THIS mod
- * gui/component-factory.c: Use bonobo_main_quit instead of gtk
+ * gui/e-week-view.c (e_week_view_on_delete_occurrence): ditto
-2002-11-13 Federico Mena Quintero <federico@ximian.com>
-
- * cal-client/cal-query.c: #include <string.h>
- (obj_removed_cb): Fixed prototype.
-
- * cal-client/cal-client.c (get_objects_atomically): Fix use of
- g_signal_handler_disconnect().
-
- * cal-client/client-test.c (create_client): Add G_CALLBACK casts.
-
-2002-11-12 Federico Mena Quintero <federico@ximian.com>
-
- * pcs/cal-backend-util.c: #include <string.h>
-
- * pcs/cal.c: Fixed prototypes of the CORBA method implementations.
-
- * pcs/cal-backend-file.c (cal_backend_file_dispose): Added a
- dispose method.
- (cal_backend_file_get_free_busy): Converted to use EConfigListener
- rather than BonoboConfigDatabase.
-
- * gui/alarm-notify/alarm-notify.c: #include <string.h>, fix use of
- g_hash_table_lookup_extended().
-
- * gui/alarm-notify/alarm-notify-dialog.c: Substitute deprecated
- GTK+ functions for new ones.
-
- * gui/alarm-notify/alarm-queue.c: Likewise.
-
- * gui/alarm-notify/notify-main.c: #include <string.h>,
- <gtk/gtkmain.h>.
-
- * gui/alarm-notify/save.c: #include <string.h>.
-
-2002-11-08 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/calendar-commands.c (calendar_control_deactivate): Use
- g_object_set_data(..., NULL) instead of gtk_object_remove_data().
-
- * gui/calendar-commands.c: Use g_object_{set,get}_* functions
- instead of gtk_object_{set,get}_*.
- * gui/calendar-commands.c: Likewise.
- * gui/calendar-config.c: Likewise.
- * gui/control-factory.c: Likewise.
- * gui/e-calendar-table.c: Likewise.
- * gui/e-comp-editor-registry.c: Likewise.
- * gui/e-day-view-main-item.c: Likewise.
- * gui/e-day-view-time-item.c: Likewise.
- * gui/e-day-view-top-item.c: Likewise.
- * gui/e-day-view.c: Likewise.
- * gui/e-meeting-attendee.c: Likewise.
- * gui/e-meeting-model.c: Likewise.
- * gui/e-meeting-time-sel-item.c: Likewise.
- * gui/e-meeting-time-sel.c: Likewise.
- * gui/e-week-view-event-item.c: Likewise.
- * gui/e-week-view-layout.c: Likewise.
- * gui/e-week-view-main-item.c: Likewise.
- * gui/e-week-view-titles-item.c: Likewise.
- * gui/e-week-view.c: Likewise.
- * gui/gnome-cal.c: Likewise.
- * gui/print.c: Likewise.
-
-2002-11-08 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/calendar-commands.c: Use g_object_ref()/g_object_unref()
- instead of gtk_object_ref/gtk_object_unref().
- * gui/calendar-config.c: Likewise.
- * gui/calendar-model.c: Likewise.
- * gui/comp-editor-factory.c: Likewise.
- * gui/comp-util.c: Likewise.
- * gui/e-calendar-table.c: Likewise.
- * gui/e-day-view.c: Likewise.
- * gui/e-itip-control.c: Likewise.
- * gui/e-meeting-model.c: Likewise.
- * gui/e-meeting-time-sel.c: Likewise.
- * gui/e-tasks.c: Likewise.
- * gui/e-timezone-entry.c: Likewise.
- * gui/e-week-view.c: Likewise.
- * gui/gnome-cal.c: Likewise.
- * gui/goto.c: Likewise.
- * gui/itip-utils.c: Likewise.
- * gui/print.c: Likewise.
- * gui/tasks-control.c: Likewise.
- * gui/tasks-migrate.c: Likewise.
-
- * gui/cal-search-bar.c: Use g_object_new() instead of
- gtk_type_new().
- * gui/calendar-model.c: Likewise.
- * gui/calendar-view-factory.c: Likewise.
- * gui/calendar-view.c: Likewise.
- * gui/calendar-view.c: Likewise.
- * gui/comp-editor-factory.c: Likewise.
- * gui/e-calendar-table.c: Likewise.
- * gui/e-cell-date-edit-text.c: Likewise.
- * gui/e-comp-editor-registry.c: Likewise.
- * gui/e-day-view.c: Likewise.
- * gui/e-itip-control.c: Likewise.
- * gui/e-meeting-attendee.c: Likewise.
- * gui/e-meeting-attendee.c: Likewise.
- * gui/e-meeting-model.c: Likewise.
- * gui/e-meeting-time-sel.c: Likewise.
- * gui/e-tasks.c: Likewise.
- * gui/e-timezone-entry.c: Likewise.
- * gui/e-week-view.c: Likewise.
- * gui/gnome-cal.c: Likewise.
- * gui/weekday-picker.c: Likewise.
-
- * gui/e-itip-control.c (get_servers): g_object_unref the
- shell_client instead of using bonobo_object_unref().
-
- * gui/component-factory.c (owner_set_cb): Use
- evolution_shell_client_corba_objref() instead of
- bonobo_object_corba_objref().
-
-2002-11-08 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/calendar-commands.c: Use g_signal_connect() instead of
- gtk_signal_connect().
- * calendar-commands.c: Likewise.
- * calendar-config.c: Likewise.
- * calendar-model.c: Likewise.
- * comp-editor-factory.c: Likewise.
- * component-factory.c: Likewise.
- * control-factory.c: Likewise.
- * e-calendar-table.c: Likewise.
- * e-comp-editor-registry.c: Likewise.
- * e-day-view-time-item.c: Likewise.
- * e-day-view.c: Likewise.
- * e-itip-control.c: Likewise.
- * e-meeting-model.c: Likewise.
- * e-meeting-time-sel.c: Likewise.
- * e-tasks.c: Likewise.
- * e-timezone-entry.c: Likewise.
- * e-week-view.c: Likewise.
- * gnome-cal.c: Likewise.
- * goto.c: Likewise.
- * tasks-control.c: Likewise.
- * tasks-migrate.c: Likewise.
- * weekday-picker.c: Likewise.
-
-2002-11-08 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/calendar-offline-handler.c
- (calendar_offline_handler_class_init): GObjectified.
- (impl_finalize): Finalize impl.
- (impl_dispose): Dispose impl.
- (calendar_offline_handler_new): Use g_object_new().
- (backend_cal_opened): use g_signal_connect() instead of
- gtk_signal_connect().
- (backend_go_offline): Likewise.
- (backend_cal_opened): g_object_unref() instead of
- gtk_object_unref().
- (backend_go_offline): Likewise.
-
-2002-11-08 Rodrigo Moya <rodrigo@ximian.com>
-
- * importers/evolution-calendar-importer.h: use GLib macros.
-
- * importers/main.c (init_importer): use bonobo_generic_factory_new,
- not bonobo_generic_factory_new_multi.
- (main): don't use libgnome functions.
-
-2002-11-07 Rodrigo Moya <rodrigo@ximian.com>
-
- * cal-client/client-test.c: don't use GTK, we don't need it.
-
-2002-11-07 JP Rosevear <jpr@ximian.com>
-
- * Initial port of gui/ subdir to GNOME 2
-
-2002-11-07 Rodrigo Moya <rodrigo@ximian.com>
-
- * importers/icalendar-importer.c: removed non-existant headers.
-
- * importers/Makefile.am: changes for BonoboActivation.
-
- * gui/GNOME_Evolution_Calendar.server.in: install to $libdir, not
- $datadir.
-
-2002-11-07 Rodrigo Moya <rodrigo@ximian.com>
-
- * cal-client/query-listener.[ch]: converted to BonoboObject.
-
- * gui/dialogs/comp-editor-util.c (parse_contact_string): use glib's
- g_utf8_strchr.
-
- * gui/dialogs/delete-comp.c: removed non-existant headers. Use
- GtkStock instead of GnomeStock.
-
- * gui/dialogs/e-delegate-dialog.c: converted to BonoboActivation.
- (e_delegate_dialog_construct): adapted to changes in glade_xml_new.
-
-2002-11-07 Rodrigo Moya <rodrigo@ximian.com>
-
- * pcs/cal.[ch]: converted to BonoboObject.
- (impl_Cal_get_query): bonobo_object_unref the query returned by
- cal_backend_get_query if we can't duplicate it.
-
- * pcs/query.[ch]:
- * pcs/cal-factory.[ch]: converted to BonoboObject.
-
- * pcs/query-backend.[ch]:
- * pcs/cal-backend-file.[ch]:
- * pcs/cal-backend.[ch]: GObjectify.
-
-2002-11-06 Rodrigo Moya <rodrigo@ximian.com>
-
- * gui/cal-prefs-dialog.c: #include gtkoptionmenu.h.
- (cal_prefs_dialog_new): adapted to changes in glade_xml_new.
-
- * gui/dialogs/event-page.h:
- * gui/dialogs/meeting-page.h:
- * gui/dialogs/recurrence-page.h:
- * gui/dialogs/schedule-page.h:
- * gui/dialogs/task-details-page.h:
- * gui/dialogs/task-page.h:
- * gui/cal-prefs-dialog.h: use correctly the macros.
-
- * gui/dialogs/cancel-comp.c:
- * gui/dialogs/changed-comp.c:
- * gui/dialogs/comp-editor-page.c:
- * gui/gnome-cal.h: removed non-existent headers.
-
- * gui/dialogs/comp-editor.c: remove non-existent headers.
- (close_dialog): gtk_widget_destroy the widget.
- (setup_widgets, comp_editor_merge_ui): use BonoboWindow correctly.
- (comp_editor_set_cal_client, comp_editor_send_comp,
- comp_editor_edit_comp): use G_OBJECT_GET_CLASS for
- getting the class of an object.
-
- * gui/dialogs/comp-editor-page.c (comp_editor_page_class_init):
- use g_signal_* functions.
-
- * gui/dialogs/comp-editor-util.c: converted to BonoboActivation.
-
- * gui/dialogs/comp-editor.h: #include bonobo-window.h, not
- bonobo-win.h.
-
-2002-11-06 Rodrigo Moya <rodrigo@ximian.com>
-
- * gui/alarm-notify/GNOME_Evolution_Calendar_AlarmNotify.server.in:
- * gui/GNOME_Evolution_Calendar.server.in: renmaed .oaf.in files.
-
- * gui/alarm-notify/Makefile.am:
- * gui/Makefile.am: fixed rules for .server files.
-
-2002-11-06 Rodrigo Moya <rodrigo@ximian.com>
-
- * gui/dialogs/comp-editor-util.[ch]
- (comp_editor_connect_contacts_changed): don't return a
- Bonobo_EventSource_ListenerId, since it does not exist anymore,
- and was not even being used.
-
- * gui/e-timezone-entry.h: use GLib macros.
-
- * gui/dialogs/*.glade:
- * gui/alarm-notify/*.glade:
- * gui/*.glade: converted to Glade2 format.
-
-2002-11-05 Rodrigo Moya <rodrigo@ximian.com>
-
- * gui/dialogs/alarm-options.c (alarm_options_dialog_run): adapted to
- to new glade_xml_new signature.
-
- * gui/calendar-model.h:
- * gui/dialogs/comp-editor-page.h:
- * gui/dialogs/alarm-page.[ch]: removed non-existant header files.
-
- * gui/dialogs/comp-editor-util.h: added missing headers.
-
-2002-11-05 Rodrigo Moya <rodrigo@ximian.com>
-
- * pcs/cal-backend.c: use libxml2 headers.
-
- * gui/alarm-notify/Makefile.am:
- * gui/dialogs/Makefile.am:
- * gui/Makefile.am: s/XML_I18N/INTLTOOL. Fixed execution of
- $(ORBIT_IDL).
-
- * gui/alarm-notify/alarm-notify.[ch]: converted to BonoboObject.
-
- * gui/alarm-notify/alarm-notify-dialog.c: compilation fixes.
- (alarm_notify_dialog): adapted to new glade_xml_new signature.
-
- * gui/alarm-notify/alarm-queue.c: ported to BonoboActivation and
- GtkStock and GtkDialog.
-
- * gui/alarm-notify/notify-main.c: ported to BonoboActivation and
- use GObject functions instead of GtkObject ones.
-
- * gui/alarm-notify/save.h: removed BonoboConfig related functions.
-
- * gui/alarm-notify/config-data.c: use GObject functions instead of
- GtkObject ones.
-
- * TODO.port: added file for keeping track of disabled things while we
- port.
-
-2002-11-04 Rodrigo Moya <rodrigo@ximian.com>
-
- * cal-util/cal-util-marshal.list: added new marshallers.
-
- * cal-client/cal-client.c (get_objects_atomically): fixed calls to
- g_signal_handler_disconnect_by_func.
- (cal_client_class_init): fixed typos.
-
- * cal-client/cal-client-multi.[ch]:
- * cal-client/cal-client-types.c:
- * cal-client/cal-query.[ch]: ported to GObject.
-
- * cal-client/cal-listener.[ch]: converted to BonoboObject.
-
- * cal-client/Makefile.am:
- * pcs/Makefile.am: fixed flags for orbit-idl
-
-2002-11-04 Rodrigo Moya <rodrigo@ximian.com>
-
- * cal-util/Makefile.am:
- * cal-util/cal-util-marshal.list: added marshallers.
-
- * cal-client/cal-client.[ch]: ported to GObject.
-
-2002-11-04 Rodrigo Moya <rodrigo@ximian.com>
-
- * cal-util/cal-component.[ch]: ported to GObject.
+ * cal-client/cal-client.c (cal_client_remove_object_with_mod):
+ send the mod parameter to the backend
+ (cal_client_remove_object): implement with above
+ (cal_client_update_object_with_mod): send the mod parameter to the
+ backend
+ (cal_client_update_object): implement with above
- * cal-util/cal-util.c (cal_util_generate_alarms_for_comp): use
- g_object_* instead of gtk_object_*.
+ * cal-client/cal-client.h: new protos
-2002-11-03 Rodrigo Moya <rodrigo@ximian.com>
+2002-11-14 JP Rosevear <jpr@ximian.com>
- * cal-client/cal-client.c (get_default_uri): use EConfigListener
- instead of BonoboConfig.
+ * cal-client/cal-client.c (cal_client_is_read_only): return
+ booleans in the pre conditions
+ (cal_client_update_object): pass mod param
+ (cal_client_update_objects): ditto
+ (cal_client_remove_object): ditto
+ (cal_client_ensure_timezone_on_server): ditto
- * cal-client/cal-client.c:
- * cal-client/cal-listener.[ch]:
- * cal-client/query-listener.c: warning free.
+ * pcs/cal.c (impl_Cal_update_objects): take mod param
+ (impl_Cal_remove_object): ditto
-2002-11-03 Rodrigo Moya <rodrigo@ximian.com>
+ * pcs/cal-backend.h: fix protos
- * pcs/cal-backend-util.[ch]: don't use BonoboConfig, but
- EConfigListener.
+ * pcs/cal-backend.c (cal_backend_update_objects): take mod param
+ (cal_backend_remove_object): ditto
- * gui/calendar-config.c: use /apps/Evolution prefix for all
- configuration keys.
+ * pcs/cal-backend-file.c (cal_backend_file_update_objects): take
+ mod param
+ (cal_backend_file_remove_object): ditto
-2002-10-31 Rodrigo Moya <rodrigo@ximian.com>
+ * cal-util/cal-util.h: add mod enum
- * cal-util/cal-component.[ch]:
- * cal-util/cal-recur.h:
- * cal-util/cal-util.[ch]:
- * cal-client/cal-client.h:
- * cal-client/cal-client-multi.h:
- * cal-client/cal-client-types.[ch]:
- * cal-client/cal-listener.h
- * cal-client/cal-query.[ch]:
- * cal-client/query-listener.h:
- * pcs/cal.h:
- * pcs/cal-backend.[ch]:
- * pcs/cal-backend-file.h:
- * pcs/cal-backend-util.h:
- * pcs/cal-common.h:
- * pcs/cal-factory.h:
- * pcs/query.[ch]:
- * pcs/query-backend.[ch]: started GNOME 2 porting.
- cal-util, cal-client and pcs compiled ok.
+ * cal-util/cal-recur.c (cal_recur_generate_instances_of_rule): if
+ its an instance, just report the instance
- * cal-client/cal-client.c (cal_client_construct):
- * pcs/cal-factory.c: use b-a instead of OAF and bonobo-config
- instead of bonobo-conf.
+ * cal-util/cal-component.h: new protos
-2002-10-29 Rodrigo Moya <rodrigo@ximian.com>
+ * cal-util/cal-component.c (cal_component_is_instance): indicate
+ whether the component is an instance or not
+ (cal_component_free_range): free a range
- * gui/gnome-cal.c (backend_died_cb): cleaned up the status bar
- messages for all widgets.
+ * idl/evolution-calendar.idl: get remove and update to take mod
+ type
2002-10-24 JP Rosevear <jpr@ximian.com>
diff --git a/calendar/cal-client/cal-client.c b/calendar/cal-client/cal-client.c
index 9921899636..f0730b2326 100644
--- a/calendar/cal-client/cal-client.c
+++ b/calendar/cal-client/cal-client.c
@@ -22,14 +22,14 @@
#include <config.h>
#endif
-#include <string.h>
-#include <bonobo-activation/bonobo-activation.h>
+#include <gtk/gtksignal.h>
+#include <liboaf/liboaf.h>
#include <bonobo/bonobo-exception.h>
+#include <bonobo/bonobo-moniker-util.h>
+#include <bonobo-conf/bonobo-config-database.h>
#include <libgnome/gnome-util.h>
#include "e-util/e-component-listener.h"
-#include "e-util/e-config-listener.h"
-#include "cal-util/cal-util-marshal.h"
#include "cal-client-types.h"
#include "cal-client.h"
#include "cal-listener.h"
@@ -98,9 +98,9 @@ enum {
LAST_SIGNAL
};
-static void cal_client_class_init (CalClientClass *klass);
-static void cal_client_init (CalClient *client, CalClientClass *klass);
-static void cal_client_finalize (GObject *object);
+static void cal_client_class_init (CalClientClass *class);
+static void cal_client_init (CalClient *client);
+static void cal_client_destroy (GtkObject *object);
static char *client_get_password_cb (WombatClient *w_client,
const gchar *prompt,
@@ -114,7 +114,7 @@ static void cal_client_get_object_timezones_cb (icalparameter *param,
static guint cal_client_signals[LAST_SIGNAL];
-static GObjectClass *parent_class;
+static GtkObjectClass *parent_class;
@@ -126,185 +126,121 @@ static GObjectClass *parent_class;
*
* Return value: The type ID of the #CalClient class.
**/
-GType
+GtkType
cal_client_get_type (void)
{
- static GType cal_client_type = 0;
+ static GtkType cal_client_type = 0;
if (!cal_client_type) {
- static GTypeInfo info = {
- sizeof (CalClientClass),
- (GBaseInitFunc) NULL,
- (GBaseFinalizeFunc) NULL,
- (GClassInitFunc) cal_client_class_init,
- NULL, NULL,
- sizeof (CalClient),
- 0,
- (GInstanceInitFunc) cal_client_init
- };
- cal_client_type = g_type_register_static (G_TYPE_OBJECT, "CalClient", &info, 0);
- }
-
- return cal_client_type;
-}
-
-GType
-cal_client_open_status_enum_get_type (void)
-{
- static GType cal_client_open_status_enum_type = 0;
-
- if (!cal_client_open_status_enum_type) {
- static GEnumValue values [] = {
- { CAL_CLIENT_OPEN_SUCCESS, "CalClientOpenSuccess", "success" },
- { CAL_CLIENT_OPEN_ERROR, "CalClientOpenError", "error" },
- { CAL_CLIENT_OPEN_NOT_FOUND, "CalClientOpenNotFound", "not-found" },
- { CAL_CLIENT_OPEN_PERMISSION_DENIED, "CalClientOpenPermissionDenied", "denied" },
- { CAL_CLIENT_OPEN_METHOD_NOT_SUPPORTED, "CalClientOpenMethodNotSupported", "unsupported" },
- { -1, NULL, NULL }
+ static const GtkTypeInfo cal_client_info = {
+ "CalClient",
+ sizeof (CalClient),
+ sizeof (CalClientClass),
+ (GtkClassInitFunc) cal_client_class_init,
+ (GtkObjectInitFunc) cal_client_init,
+ NULL, /* reserved_1 */
+ NULL, /* reserved_2 */
+ (GtkClassInitFunc) NULL
};
- cal_client_open_status_enum_type = g_enum_register_static ("CalClientOpenStatusEnum", values);
+ cal_client_type = gtk_type_unique (GTK_TYPE_OBJECT, &cal_client_info);
}
- return cal_client_open_status_enum_type;
-}
-
-GType
-cal_client_set_mode_status_enum_get_type (void)
-{
- static GType cal_client_set_mode_status_enum_type = 0;
-
- if (!cal_client_set_mode_status_enum_type) {
- static GEnumValue values [] = {
- { CAL_CLIENT_SET_MODE_SUCCESS, "CalClientSetModeSuccess", "success" },
- { CAL_CLIENT_SET_MODE_ERROR, "CalClientSetModeError", "error" },
- { CAL_CLIENT_SET_MODE_NOT_SUPPORTED, "CalClientSetModeNotSupported", "unsupported" },
- { -1, NULL, NULL }
- };
-
- cal_client_set_mode_status_enum_type =
- g_enum_register_static ("CalClientSetModeStatusEnum", values);
- }
-
- return cal_client_set_mode_status_enum_type;
+ return cal_client_type;
}
-GType
-cal_mode_enum_get_type (void)
-{
- static GType cal_mode_enum_type = 0;
-
- if (!cal_mode_enum_type) {
- static GEnumValue values [] = {
- { CAL_MODE_INVALID, "CalModeInvalid", "invalid" },
- { CAL_MODE_LOCAL, "CalModeLocal", "local" },
- { CAL_MODE_REMOTE, "CalModeRemote", "remote" },
- { CAL_MODE_ANY, "CalModeAny", "any" },
- { -1, NULL, NULL }
- };
-
- cal_mode_enum_type = g_enum_register_static ("CalModeEnum", values);
- }
-
- return cal_mode_enum_type;
-}
+#define marshal_NONE__ENUM_ENUM gtk_marshal_NONE__INT_INT
/* Class initialization function for the calendar client */
static void
-cal_client_class_init (CalClientClass *klass)
+cal_client_class_init (CalClientClass *class)
{
- GObjectClass *object_class;
+ GtkObjectClass *object_class;
- object_class = (GObjectClass *) klass;
+ object_class = (GtkObjectClass *) class;
- parent_class = g_type_class_peek_parent (klass);
+ parent_class = gtk_type_class (GTK_TYPE_OBJECT);
cal_client_signals[CAL_OPENED] =
- g_signal_new ("cal_opened",
- G_TYPE_FROM_CLASS (klass),
- G_SIGNAL_RUN_FIRST,
- G_STRUCT_OFFSET (CalClientClass, cal_opened),
- NULL, NULL,
- g_cclosure_marshal_VOID__ENUM,
- G_TYPE_NONE, 1,
- CAL_CLIENT_OPEN_STATUS_ENUM_TYPE);
+ gtk_signal_new ("cal_opened",
+ GTK_RUN_FIRST,
+ object_class->type,
+ GTK_SIGNAL_OFFSET (CalClientClass, cal_opened),
+ gtk_marshal_NONE__ENUM,
+ GTK_TYPE_NONE, 1,
+ GTK_TYPE_ENUM);
cal_client_signals[CAL_SET_MODE] =
- g_signal_new ("cal_set_mode",
- G_TYPE_FROM_CLASS (klass),
- G_SIGNAL_RUN_FIRST,
- G_STRUCT_OFFSET (CalClientClass, cal_set_mode),
- NULL, NULL,
- cal_util_marshal_VOID__ENUM_ENUM,
- G_TYPE_NONE, 2,
- CAL_CLIENT_SET_MODE_STATUS_ENUM_TYPE,
- CAL_MODE_ENUM_TYPE);
+ gtk_signal_new ("cal_set_mode",
+ GTK_RUN_FIRST,
+ object_class->type,
+ GTK_SIGNAL_OFFSET (CalClientClass, cal_set_mode),
+ marshal_NONE__ENUM_ENUM,
+ GTK_TYPE_NONE, 2,
+ GTK_TYPE_ENUM,
+ GTK_TYPE_ENUM);
cal_client_signals[OBJ_UPDATED] =
- g_signal_new ("obj_updated",
- G_TYPE_FROM_CLASS (klass),
- G_SIGNAL_RUN_FIRST,
- G_STRUCT_OFFSET (CalClientClass, obj_updated),
- NULL, NULL,
- g_cclosure_marshal_VOID__STRING,
- G_TYPE_NONE, 1,
- G_TYPE_STRING);
+ gtk_signal_new ("obj_updated",
+ GTK_RUN_FIRST,
+ object_class->type,
+ GTK_SIGNAL_OFFSET (CalClientClass, obj_updated),
+ gtk_marshal_NONE__STRING,
+ GTK_TYPE_NONE, 1,
+ GTK_TYPE_STRING);
cal_client_signals[OBJ_REMOVED] =
- g_signal_new ("obj_removed",
- G_TYPE_FROM_CLASS (klass),
- G_SIGNAL_RUN_FIRST,
- G_STRUCT_OFFSET (CalClientClass, obj_removed),
- NULL, NULL,
- g_cclosure_marshal_VOID__STRING,
- G_TYPE_NONE, 1,
- G_TYPE_STRING);
+ gtk_signal_new ("obj_removed",
+ GTK_RUN_FIRST,
+ object_class->type,
+ GTK_SIGNAL_OFFSET (CalClientClass, obj_removed),
+ gtk_marshal_NONE__STRING,
+ GTK_TYPE_NONE, 1,
+ GTK_TYPE_STRING);
cal_client_signals[BACKEND_ERROR] =
- g_signal_new ("backend_error",
- G_TYPE_FROM_CLASS (klass),
- G_SIGNAL_RUN_FIRST,
- G_STRUCT_OFFSET (CalClientClass, backend_error),
- NULL, NULL,
- g_cclosure_marshal_VOID__STRING,
- G_TYPE_NONE, 1,
- G_TYPE_STRING);
+ gtk_signal_new ("backend_error",
+ GTK_RUN_FIRST,
+ object_class->type,
+ GTK_SIGNAL_OFFSET (CalClientClass, backend_error),
+ gtk_marshal_NONE__STRING,
+ GTK_TYPE_NONE, 1,
+ GTK_TYPE_STRING);
cal_client_signals[CATEGORIES_CHANGED] =
- g_signal_new ("categories_changed",
- G_TYPE_FROM_CLASS (klass),
- G_SIGNAL_RUN_FIRST,
- G_STRUCT_OFFSET (CalClientClass, categories_changed),
- NULL, NULL,
- g_cclosure_marshal_VOID__POINTER,
- G_TYPE_NONE, 1,
- G_TYPE_POINTER);
+ gtk_signal_new ("categories_changed",
+ GTK_RUN_FIRST,
+ object_class->type,
+ GTK_SIGNAL_OFFSET (CalClientClass, categories_changed),
+ gtk_marshal_NONE__POINTER,
+ GTK_TYPE_NONE, 1,
+ GTK_TYPE_POINTER);
cal_client_signals[FORGET_PASSWORD] =
- g_signal_new ("forget_password",
- G_TYPE_FROM_CLASS (klass),
- G_SIGNAL_RUN_FIRST,
- G_STRUCT_OFFSET (CalClientClass, forget_password),
- NULL, NULL,
- g_cclosure_marshal_VOID__STRING,
- G_TYPE_NONE, 1,
- G_TYPE_STRING);
+ gtk_signal_new ("forget_password",
+ GTK_RUN_FIRST,
+ object_class->type,
+ GTK_SIGNAL_OFFSET (CalClientClass, forget_password),
+ gtk_marshal_NONE__STRING,
+ GTK_TYPE_NONE, 1,
+ GTK_TYPE_STRING);
cal_client_signals[BACKEND_DIED] =
- g_signal_new ("backend_died",
- G_TYPE_FROM_CLASS (klass),
- G_SIGNAL_RUN_FIRST,
- G_STRUCT_OFFSET (CalClientClass, backend_died),
- NULL, NULL,
- g_cclosure_marshal_VOID__VOID,
- G_TYPE_NONE, 0);
+ gtk_signal_new ("backend_died",
+ GTK_RUN_FIRST,
+ object_class->type,
+ GTK_SIGNAL_OFFSET (CalClientClass, backend_died),
+ gtk_marshal_NONE__NONE,
+ GTK_TYPE_NONE, 0);
- klass->cal_opened = NULL;
- klass->obj_updated = NULL;
- klass->obj_removed = NULL;
- klass->categories_changed = NULL;
- klass->forget_password = NULL;
- klass->backend_died = NULL;
+ gtk_object_class_add_signals (object_class, cal_client_signals, LAST_SIGNAL);
- object_class->finalize = cal_client_finalize;
+ class->cal_opened = NULL;
+ class->obj_updated = NULL;
+ class->obj_removed = NULL;
+ class->categories_changed = NULL;
+ class->forget_password = NULL;
+ class->backend_died = NULL;
+
+ object_class->destroy = cal_client_destroy;
}
/* Object initialization function for the calendar client */
static void
-cal_client_init (CalClient *client, CalClientClass *klass)
+cal_client_init (CalClient *client)
{
CalClientPrivate *priv;
@@ -412,9 +348,9 @@ free_timezone (gpointer key, gpointer value, gpointer data)
icaltimezone_free (value, TRUE);
}
-/* Finalize handler for the calendar client */
+/* Destroy handler for the calendar client */
static void
-cal_client_finalize (GObject *object)
+cal_client_destroy (GtkObject *object)
{
CalClient *client;
CalClientPrivate *priv;
@@ -432,16 +368,13 @@ cal_client_finalize (GObject *object)
}
if (priv->comp_listener) {
- g_signal_handlers_disconnect_matched (G_OBJECT (priv->comp_listener),
- G_SIGNAL_MATCH_DATA,
- 0, 0, NULL, NULL,
- client);
- g_object_unref (G_OBJECT (priv->comp_listener));
+ gtk_signal_disconnect_by_data (GTK_OBJECT (priv->comp_listener), client);
+ gtk_object_unref (GTK_OBJECT (priv->comp_listener));
priv->comp_listener = NULL;
}
priv->w_client = NULL;
- /* destroy_factories (client); */
+ destroy_factories (client);
destroy_cal (client);
priv->load_state = CAL_CLIENT_LOAD_NOT_LOADED;
@@ -475,8 +408,8 @@ cal_client_finalize (GObject *object)
g_free (priv);
client->priv = NULL;
- if (G_OBJECT_CLASS (parent_class)->finalize)
- (* G_OBJECT_CLASS (parent_class)->finalize) (object);
+ if (GTK_OBJECT_CLASS (parent_class)->destroy)
+ (* GTK_OBJECT_CLASS (parent_class)->destroy) (object);
}
@@ -491,7 +424,7 @@ backend_died_cb (EComponentListener *cl, gpointer user_data)
priv = client->priv;
priv->load_state = CAL_CLIENT_LOAD_NOT_LOADED;
- g_signal_emit (G_OBJECT (client), cal_client_signals[BACKEND_DIED], 0);
+ gtk_signal_emit (GTK_OBJECT (client), cal_client_signals[BACKEND_DIED]);
}
/* Signal handlers for the listener's signals */
@@ -535,8 +468,8 @@ cal_opened_cb (CalListener *listener,
/* setup component listener */
priv->comp_listener = e_component_listener_new (priv->cal, 0);
- g_signal_connect (G_OBJECT (priv->comp_listener), "component_died",
- G_CALLBACK (backend_died_cb), client);
+ gtk_signal_connect (GTK_OBJECT (priv->comp_listener), "component_died",
+ GTK_SIGNAL_FUNC (backend_died_cb), client);
goto out;
case GNOME_Evolution_Calendar_Listener_ERROR:
@@ -577,10 +510,10 @@ cal_opened_cb (CalListener *listener,
* signal and clean up.
*/
- g_object_ref (G_OBJECT (client));
+ gtk_object_ref (GTK_OBJECT (client));
- g_signal_emit (G_OBJECT (client), cal_client_signals[CAL_OPENED],
- 0, client_status);
+ gtk_signal_emit (GTK_OBJECT (client), cal_client_signals[CAL_OPENED],
+ client_status);
if (client_status != CAL_CLIENT_OPEN_SUCCESS) {
priv->load_state = CAL_CLIENT_LOAD_NOT_LOADED;
@@ -590,7 +523,7 @@ cal_opened_cb (CalListener *listener,
g_assert (priv->load_state != CAL_CLIENT_LOAD_LOADING);
- g_object_unref (G_OBJECT (client));
+ gtk_object_unref (GTK_OBJECT (client));
}
/* Handle the cal_set_mode notification from the listener */
@@ -629,32 +562,32 @@ cal_set_mode_cb (CalListener *listener,
* signal and clean up.
*/
- g_object_ref (G_OBJECT (client));
+ gtk_object_ref (GTK_OBJECT (client));
- g_signal_emit (G_OBJECT (client), cal_client_signals[CAL_SET_MODE],
- 0, client_status, mode);
+ gtk_signal_emit (GTK_OBJECT (client), cal_client_signals[CAL_SET_MODE],
+ client_status, mode);
- g_object_unref (G_OBJECT (client));
+ gtk_object_unref (GTK_OBJECT (client));
}
/* Handle the obj_updated signal from the listener */
static void
-obj_updated_cb (CalListener *listener, const CORBA_char *uid, gpointer data)
+obj_updated_cb (CalListener *listener, const GNOME_Evolution_Calendar_CalObjUID uid, gpointer data)
{
CalClient *client;
client = CAL_CLIENT (data);
- g_signal_emit (G_OBJECT (client), cal_client_signals[OBJ_UPDATED], 0, uid);
+ gtk_signal_emit (GTK_OBJECT (client), cal_client_signals[OBJ_UPDATED], uid);
}
/* Handle the obj_removed signal from the listener */
static void
-obj_removed_cb (CalListener *listener, const CORBA_char *uid, gpointer data)
+obj_removed_cb (CalListener *listener, const GNOME_Evolution_Calendar_CalObjUID uid, gpointer data)
{
CalClient *client;
client = CAL_CLIENT (data);
- g_signal_emit (G_OBJECT (client), cal_client_signals[OBJ_REMOVED], 0, uid);
+ gtk_signal_emit (GTK_OBJECT (client), cal_client_signals[OBJ_REMOVED], uid);
}
/* Handle the error_occurred signal from the listener */
@@ -664,7 +597,7 @@ backend_error_cb (CalListener *listener, const char *message, gpointer data)
CalClient *client;
client = CAL_CLIENT (data);
- g_signal_emit (G_OBJECT (client), cal_client_signals[BACKEND_ERROR], 0, message);
+ gtk_signal_emit (GTK_OBJECT (client), cal_client_signals[BACKEND_ERROR], message);
}
/* Handle the categories_changed signal from the listener */
@@ -684,7 +617,7 @@ categories_changed_cb (CalListener *listener, const GNOME_Evolution_Calendar_Str
for (i = 0; i < categories->_length; i++)
cats->pdata[i] = categories->_buffer[i];
- g_signal_emit (G_OBJECT (client), cal_client_signals[CATEGORIES_CHANGED], 0, cats);
+ gtk_signal_emit (GTK_OBJECT (client), cal_client_signals[CATEGORIES_CHANGED], cats);
g_ptr_array_free (cats, TRUE);
}
@@ -719,28 +652,40 @@ client_forget_password_cb (WombatClient *w_client,
client = CAL_CLIENT (user_data);
g_return_if_fail (IS_CAL_CLIENT (client));
- g_signal_emit (G_OBJECT (client),
- cal_client_signals [FORGET_PASSWORD],
- 0, key);
+ gtk_signal_emit (GTK_OBJECT (client),
+ cal_client_signals [FORGET_PASSWORD],
+ key);
}
-static GList *
-get_factories (void)
+/**
+ * cal_client_construct:
+ * @client: A calendar client.
+ *
+ * Constructs a calendar client object by contacting all available
+ * calendar factories.
+ *
+ * Return value: The same object as the @client argument, or NULL if the
+ * calendar factory could not be contacted.
+ **/
+CalClient *
+cal_client_construct (CalClient *client)
{
- static GList *factories = NULL;
+ CalClientPrivate *priv;
GNOME_Evolution_Calendar_CalFactory factory;
- Bonobo_ServerInfoList *servers;
+ OAF_ServerInfoList *servers;
CORBA_Environment ev;
int i;
- if (factories != NULL)
- return factories;
+ g_return_val_if_fail (client != NULL, NULL);
+ g_return_val_if_fail (IS_CAL_CLIENT (client), NULL);
+
+ priv = client->priv;
CORBA_exception_init (&ev);
- servers = bonobo_activation_query ("repo_ids.has ('IDL:GNOME/Evolution/Calendar/CalFactory:1.0')", NULL, &ev);
+ servers = oaf_query ("repo_ids.has ('IDL:GNOME/Evolution/Calendar/CalFactory:1.0')", NULL, &ev);
if (ev._major != CORBA_NO_EXCEPTION) {
g_message ("Cannot perform OAF query for Calendar servers.");
CORBA_exception_free (&ev);
@@ -751,50 +696,25 @@ get_factories (void)
g_warning ("No Calendar servers installed.");
for (i = 0; i < servers->_length; i++) {
- const Bonobo_ServerInfo *info;
+ const OAF_ServerInfo *info;
info = servers->_buffer + i;
factory = (GNOME_Evolution_Calendar_CalFactory)
- bonobo_activation_activate_from_id (info->iid, 0, NULL, &ev);
+ oaf_activate_from_id (info->iid, 0, NULL, &ev);
if (BONOBO_EX (&ev)) {
-#if 0
g_warning ("cal_client_construct: Could not activate calendar server %s", info->iid);
CORBA_free (servers);
CORBA_exception_free (&ev);
return NULL;
-#endif
}
- else
- factories = g_list_prepend (factories, factory);
+
+ priv->factories = g_list_prepend (priv->factories, factory);
}
CORBA_free (servers);
- CORBA_exception_free (&ev);
- return factories;
-}
-
-/**
- * cal_client_construct:
- * @client: A calendar client.
- *
- * Constructs a calendar client object by contacting all available
- * calendar factories.
- *
- * Return value: The same object as the @client argument, or NULL if the
- * calendar factory could not be contacted.
- **/
-CalClient *
-cal_client_construct (CalClient *client)
-{
- CalClientPrivate *priv;
-
- g_return_val_if_fail (client != NULL, NULL);
- g_return_val_if_fail (IS_CAL_CLIENT (client), NULL);
-
- priv = client->priv;
- priv->factories = get_factories ();
+ CORBA_exception_free (&ev);
return client;
}
@@ -812,11 +732,11 @@ cal_client_new (void)
{
CalClient *client;
- client = g_object_new (CAL_CLIENT_TYPE, NULL);
+ client = gtk_type_new (CAL_CLIENT_TYPE);
if (!cal_client_construct (client)) {
g_message ("cal_client_new(): could not construct the calendar client");
- g_object_unref (G_OBJECT (client));
+ gtk_object_unref (GTK_OBJECT (client));
return NULL;
}
@@ -964,21 +884,31 @@ get_fall_back_uri (gboolean tasks)
static char *
get_default_uri (gboolean tasks)
{
- EConfigListener *db;
+ Bonobo_ConfigDatabase db;
char *uri;
+ CORBA_Environment ev;
- db = e_config_listener_new ();
+ CORBA_exception_init (&ev);
+
+ db = bonobo_get_object ("wombat:", "Bonobo/ConfigDatabase", &ev);
+ if (BONOBO_EX (&ev) || db == CORBA_OBJECT_NIL) {
+ CORBA_exception_free (&ev);
+ return NULL;
+ }
+
if (tasks)
- uri = e_config_listener_get_string (db, "/apps/evolution/shell/default_folders/tasks_uri");
+ uri = bonobo_config_get_string (db, "/DefaultFolders/tasks_uri", &ev);
else
- uri = e_config_listener_get_string (db, "/apps/evolution/shell/default_folders/calendar_uri");
- g_object_unref (G_OBJECT (db));
+ uri = bonobo_config_get_string (db, "/DefaultFolders/calendar_uri", &ev);
+ bonobo_object_release_unref (db, NULL);
- if (!uri)
+ if (BONOBO_EX (&ev)) {
+ CORBA_exception_free (&ev);
uri = get_fall_back_uri (tasks);
- else
+ } else {
uri = cal_util_expand_uri (uri, tasks);
+ }
return uri;
}
@@ -1075,10 +1005,8 @@ cal_client_uri_list (CalClient *client, CalMode mode)
uris = NULL;
break;
}
- else {
+ else
uris = g_list_concat (uris, build_uri_list (uri_seq));
- CORBA_free (uri_seq);
- }
CORBA_exception_free (&ev);
}
@@ -1101,8 +1029,8 @@ cal_client_get_load_state (CalClient *client)
{
CalClientPrivate *priv;
- g_return_val_if_fail (client != NULL, CAL_CLIENT_LOAD_NOT_LOADED);
- g_return_val_if_fail (IS_CAL_CLIENT (client), CAL_CLIENT_LOAD_NOT_LOADED);
+ g_return_val_if_fail (client != NULL, FALSE);
+ g_return_val_if_fail (IS_CAL_CLIENT (client), FALSE);
priv = client->priv;
return priv->load_state;
@@ -1145,13 +1073,12 @@ cal_client_is_read_only (CalClient *client)
CORBA_Environment ev;
CORBA_boolean read_only;
- g_return_val_if_fail (client != NULL, FALSE);
- g_return_val_if_fail (IS_CAL_CLIENT (client), FALSE);
+ g_return_val_if_fail (client != NULL, TRUE);
+ g_return_val_if_fail (IS_CAL_CLIENT (client), TRUE);
priv = client->priv;
- if (priv->load_state != CAL_CLIENT_LOAD_LOADED)
- return FALSE;
+ g_return_val_if_fail (priv->load_state == CAL_CLIENT_LOAD_LOADED, FALSE);
CORBA_exception_init (&ev);
read_only = GNOME_Evolution_Calendar_Cal_isReadOnly (priv->cal, &ev);
@@ -1448,7 +1375,7 @@ cal_client_get_default_object (CalClient *client, CalObjType type, CalComponent
*comp = cal_component_new ();
if (!cal_component_set_icalcomponent (*comp, icalcomp)) {
icalcomponent_free (icalcomp);
- g_object_unref (*comp);
+ gtk_object_unref (GTK_OBJECT (*comp));
*comp = NULL;
retval = CAL_CLIENT_GET_SYNTAX_ERROR;
@@ -1530,7 +1457,7 @@ cal_client_get_object (CalClient *client, const char *uid, CalComponent **comp)
*comp = cal_component_new ();
if (!cal_component_set_icalcomponent (*comp, icalcomp)) {
icalcomponent_free (icalcomp);
- g_object_unref (G_OBJECT (*comp));
+ gtk_object_unref (GTK_OBJECT (*comp));
*comp = NULL;
retval = CAL_CLIENT_GET_SYNTAX_ERROR;
@@ -1540,7 +1467,7 @@ cal_client_get_object (CalClient *client, const char *uid, CalComponent **comp)
/* Now make sure we have all timezones needed for this object.
We do this to try to avoid any problems caused by getting a timezone
in the middle of other code. Any calls to ORBit result in a
- recursive call of the GLib main loop, which can cause problems for
+ recursive call of the GTK+ main loop, which can cause problems for
code that doesn't expect it. Currently GnomeCanvas has problems if
we try to get a timezone in the middle of a redraw, and there is a
resize pending, which leads to an assert failure and an abort. */
@@ -1645,7 +1572,7 @@ cal_client_get_timezone (CalClient *client,
tmp_zone = icaltimezone_new ();
if (!tmp_zone) {
/* FIXME: Needs better error code - out of memory. Or just
- abort like GLib does? */
+ abort like GTK+ does? */
retval = CAL_CLIENT_GET_NOT_FOUND;
goto out;
}
@@ -1771,7 +1698,7 @@ build_change_list (GNOME_Evolution_Calendar_CalObjChangeSeq *seq)
ccc->comp = cal_component_new ();
if (!cal_component_set_icalcomponent (ccc->comp, icalcomp)) {
icalcomponent_free (icalcomp);
- g_object_unref (G_OBJECT (ccc->comp));
+ gtk_object_unref (GTK_OBJECT (ccc->comp));
continue;
}
ccc->type = corba_coc->type;
@@ -1966,7 +1893,7 @@ cal_client_get_free_busy (CalClient *client, GList *users,
comp = cal_component_new ();
if (!cal_component_set_icalcomponent (comp, icalcomp)) {
icalcomponent_free (icalcomp);
- g_object_unref (G_OBJECT (comp));
+ gtk_object_unref (GTK_OBJECT (comp));
continue;
}
@@ -2003,7 +1930,7 @@ generate_instances_obj_updated_cb (CalClient *client, const char *uid, gpointer
return;
g_hash_table_remove (uid_comp_hash, uid);
- g_object_unref (G_OBJECT (comp));
+ gtk_object_unref (GTK_OBJECT (comp));
status = cal_client_get_object (client, uid, &comp);
@@ -2040,7 +1967,7 @@ generate_instances_obj_removed_cb (CalClient *client, const char *uid, gpointer
return;
g_hash_table_remove (uid_comp_hash, uid);
- g_object_unref (G_OBJECT (comp));
+ gtk_object_unref (GTK_OBJECT (comp));
}
/* Adds a component to the list; called from g_hash_table_foreach() */
@@ -2077,13 +2004,13 @@ get_objects_atomically (CalClient *client, CalObjType type, time_t start, time_t
/* While we are getting the actual object data, keep track of changes */
- obj_updated_id = g_signal_connect (G_OBJECT (client), "obj_updated",
- G_CALLBACK (generate_instances_obj_updated_cb),
- uid_comp_hash);
+ obj_updated_id = gtk_signal_connect (GTK_OBJECT (client), "obj_updated",
+ GTK_SIGNAL_FUNC (generate_instances_obj_updated_cb),
+ uid_comp_hash);
- obj_removed_id = g_signal_connect (G_OBJECT (client), "obj_removed",
- G_CALLBACK (generate_instances_obj_removed_cb),
- uid_comp_hash);
+ obj_removed_id = gtk_signal_connect (GTK_OBJECT (client), "obj_removed",
+ GTK_SIGNAL_FUNC (generate_instances_obj_removed_cb),
+ uid_comp_hash);
/* Get the objects */
@@ -2126,8 +2053,8 @@ get_objects_atomically (CalClient *client, CalObjType type, time_t start, time_t
* notification signals and generate the final list of components.
*/
- g_signal_handler_disconnect (client, obj_updated_id);
- g_signal_handler_disconnect (client, obj_removed_id);
+ gtk_signal_disconnect (GTK_OBJECT (client), obj_updated_id);
+ gtk_signal_disconnect (GTK_OBJECT (client), obj_removed_id);
objects = NULL;
g_hash_table_foreach (uid_comp_hash, add_component, &objects);
@@ -2154,7 +2081,7 @@ add_instance (CalComponent *comp, time_t start, time_t end, gpointer data)
ci = g_new (struct comp_instance, 1);
ci->comp = comp;
- g_object_ref (G_OBJECT (ci->comp));
+ gtk_object_ref (GTK_OBJECT (ci->comp));
ci->start = start;
ci->end = end;
@@ -2192,7 +2119,7 @@ compare_comp_instance (gconstpointer a, gconstpointer b)
* way so that the generated instances are actually in the server at the time
* the initial cal_client_get_objects_in_range() query ends.
*
- * The callback function should do a g_object_ref() of the calendar component
+ * The callback function should do a gtk_object_ref() of the calendar component
* it gets passed if it intends to keep it around.
**/
void
@@ -2227,7 +2154,7 @@ cal_client_generate_instances (CalClient *client, CalObjType type,
cal_recur_generate_instances (comp, start, end, add_instance, &instances,
cal_client_resolve_tzid_cb, client,
priv->default_zone);
- g_object_unref (G_OBJECT (comp));
+ gtk_object_unref (GTK_OBJECT (comp));
}
g_list_free (objects);
@@ -2254,7 +2181,7 @@ cal_client_generate_instances (CalClient *client, CalObjType type,
struct comp_instance *ci;
ci = l->data;
- g_object_unref (G_OBJECT (ci->comp));
+ gtk_object_unref (GTK_OBJECT (ci->comp));
g_free (ci);
}
@@ -2325,7 +2252,7 @@ build_component_alarms_list (GNOME_Evolution_Calendar_CalComponentAlarmsSeq *seq
comp = cal_component_new ();
if (!cal_component_set_icalcomponent (comp, icalcomp)) {
icalcomponent_free (icalcomp);
- g_object_unref (G_OBJECT (comp));
+ gtk_object_unref (GTK_OBJECT (comp));
continue;
}
@@ -2469,7 +2396,7 @@ cal_client_get_alarms_for_object (CalClient *client, const char *uid,
comp = cal_component_new ();
if (!cal_component_set_icalcomponent (comp, icalcomp)) {
icalcomponent_free (icalcomp);
- g_object_unref (G_OBJECT (comp));
+ gtk_object_unref (GTK_OBJECT (comp));
goto out;
}
diff --git a/calendar/cal-client/cal-client.h b/calendar/cal-client/cal-client.h
index e44014b9be..867557ea08 100644
--- a/calendar/cal-client/cal-client.h
+++ b/calendar/cal-client/cal-client.h
@@ -21,24 +21,21 @@
#ifndef CAL_CLIENT_H
#define CAL_CLIENT_H
-#include <glib-object.h>
+#include <libgnome/gnome-defs.h>
+#include <gtk/gtkobject.h>
#include <cal-util/cal-recur.h>
#include <cal-util/cal-util.h>
#include <cal-client/cal-query.h>
-G_BEGIN_DECLS
+BEGIN_GNOME_DECLS
#define CAL_CLIENT_TYPE (cal_client_get_type ())
-#define CAL_CLIENT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CAL_CLIENT_TYPE, CalClient))
-#define CAL_CLIENT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CAL_CLIENT_TYPE, CalClientClass))
-#define IS_CAL_CLIENT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CAL_CLIENT_TYPE))
-#define IS_CAL_CLIENT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CAL_CLIENT_TYPE))
-
-#define CAL_CLIENT_OPEN_STATUS_ENUM_TYPE (cal_client_open_status_enum_get_type ())
-#define CAL_CLIENT_SET_MODE_STATUS_ENUM_TYPE (cal_client_set_mode_status_enum_get_type ())
-#define CAL_MODE_ENUM_TYPE (cal_mode_enum_get_type ())
+#define CAL_CLIENT(obj) (GTK_CHECK_CAST ((obj), CAL_CLIENT_TYPE, CalClient))
+#define CAL_CLIENT_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), CAL_CLIENT_TYPE, CalClientClass))
+#define IS_CAL_CLIENT(obj) (GTK_CHECK_TYPE ((obj), CAL_CLIENT_TYPE))
+#define IS_CAL_CLIENT_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), CAL_CLIENT_TYPE))
typedef struct _CalClient CalClient;
typedef struct _CalClientClass CalClientClass;
@@ -93,14 +90,14 @@ typedef enum {
} CalClientLoadState;
struct _CalClient {
- GObject object;
+ GtkObject object;
/* Private data */
CalClientPrivate *priv;
};
struct _CalClientClass {
- GObjectClass parent_class;
+ GtkObjectClass parent_class;
/* Notification signals */
@@ -124,11 +121,7 @@ typedef gchar * (* CalClientAuthFunc) (CalClient *client,
const gchar *key,
gpointer user_data);
-GType cal_client_get_type (void);
-
-GType cal_client_open_status_enum_get_type (void);
-GType cal_client_set_mode_status_enum_get_type (void);
-GType cal_mode_enum_get_type (void);
+GtkType cal_client_get_type (void);
CalClient *cal_client_construct (CalClient *client);
@@ -228,6 +221,6 @@ char* cal_client_get_component_as_string (CalClient *client,
-G_END_DECLS
+END_GNOME_DECLS
#endif
diff --git a/calendar/cal-util/cal-component.c b/calendar/cal-util/cal-component.c
index 671af4a9ec..2c9fce2f85 100644
--- a/calendar/cal-util/cal-component.c
+++ b/calendar/cal-util/cal-component.c
@@ -24,6 +24,7 @@
#include <stdlib.h>
#include <unistd.h>
#include <glib.h>
+#include <libgnome/gnome-defs.h>
#include <libgnome/gnome-i18n.h>
#include "cal-component.h"
#include "timeutil.h"
@@ -180,11 +181,11 @@ struct _CalComponentAlarm {
-static void cal_component_class_init (CalComponentClass *klass);
-static void cal_component_init (CalComponent *comp, CalComponentClass *klass);
-static void cal_component_finalize (GObject *object);
+static void cal_component_class_init (CalComponentClass *class);
+static void cal_component_init (CalComponent *comp);
+static void cal_component_destroy (GtkObject *object);
-static GObjectClass *parent_class;
+static GtkObjectClass *parent_class;
@@ -196,23 +197,24 @@ static GObjectClass *parent_class;
*
* Return value: The type ID of the #CalComponent class.
**/
-GType
+GtkType
cal_component_get_type (void)
{
- static GType cal_component_type = 0;
+ static GtkType cal_component_type = 0;
if (!cal_component_type) {
- static GTypeInfo info = {
- sizeof (CalComponentClass),
- (GBaseInitFunc) NULL,
- (GBaseFinalizeFunc) NULL,
- (GClassInitFunc) cal_component_class_init,
- NULL, NULL,
- sizeof (CalComponent),
- 0,
- (GInstanceInitFunc) cal_component_init
- };
- cal_component_type = g_type_register_static (G_TYPE_OBJECT, "CalComponent", &info, 0);
+ static const GtkTypeInfo cal_component_info = {
+ "CalComponent",
+ sizeof (CalComponent),
+ sizeof (CalComponentClass),
+ (GtkClassInitFunc) cal_component_class_init,
+ (GtkObjectInitFunc) cal_component_init,
+ NULL, /* reserved_1 */
+ NULL, /* reserved_2 */
+ (GtkClassInitFunc) NULL
+ };
+
+ cal_component_type = gtk_type_unique (GTK_TYPE_OBJECT, &cal_component_info);
}
return cal_component_type;
@@ -220,20 +222,20 @@ cal_component_get_type (void)
/* Class initialization function for the calendar component object */
static void
-cal_component_class_init (CalComponentClass *klass)
+cal_component_class_init (CalComponentClass *class)
{
- GObjectClass *object_class;
+ GtkObjectClass *object_class;
- object_class = (GObjectClass *) klass;
+ object_class = (GtkObjectClass *) class;
- parent_class = g_type_class_peek_parent (klass);
+ parent_class = gtk_type_class (GTK_TYPE_OBJECT);
- object_class->finalize = cal_component_finalize;
+ object_class->destroy = cal_component_destroy;
}
/* Object initialization function for the calendar component object */
static void
-cal_component_init (CalComponent *comp, CalComponentClass *klass)
+cal_component_init (CalComponent *comp)
{
CalComponentPrivate *priv;
@@ -356,9 +358,9 @@ free_icalcomponent (CalComponent *comp, gboolean free)
priv->need_sequence_inc = FALSE;
}
-/* Finalize handler for the calendar component object */
+/* Destroy handler for the calendar component object */
static void
-cal_component_finalize (GObject *object)
+cal_component_destroy (GtkObject *object)
{
CalComponent *comp;
CalComponentPrivate *priv;
@@ -376,8 +378,8 @@ cal_component_finalize (GObject *object)
g_free (priv);
comp->priv = NULL;
- if (G_OBJECT_CLASS (parent_class)->finalize)
- (* G_OBJECT_CLASS (parent_class)->finalize) (object);
+ if (GTK_OBJECT_CLASS (parent_class)->destroy)
+ (* GTK_OBJECT_CLASS (parent_class)->destroy) (object);
}
@@ -433,7 +435,7 @@ cal_component_gen_uid (void)
CalComponent *
cal_component_new (void)
{
- return CAL_COMPONENT (g_object_new (CAL_COMPONENT_TYPE, NULL));
+ return CAL_COMPONENT (gtk_type_new (CAL_COMPONENT_TYPE));
}
/**
@@ -4785,7 +4787,7 @@ cal_component_alarms_free (CalComponentAlarms *alarms)
g_return_if_fail (alarms != NULL);
g_assert (alarms->comp != NULL);
- g_object_unref (G_OBJECT (alarms->comp));
+ gtk_object_unref (GTK_OBJECT (alarms->comp));
for (l = alarms->alarms; l; l = l->next) {
CalAlarmInstance *instance;
diff --git a/calendar/cal-util/cal-component.h b/calendar/cal-util/cal-component.h
index f363099836..3117dcdf2e 100644
--- a/calendar/cal-util/cal-component.h
+++ b/calendar/cal-util/cal-component.h
@@ -22,21 +22,21 @@
#ifndef CAL_COMPONENT_H
#define CAL_COMPONENT_H
-#include <glib/gmacros.h>
+#include <libgnome/gnome-defs.h>
#include <time.h>
-#include <glib-object.h>
+#include <gtk/gtkobject.h>
#include <ical.h>
-G_BEGIN_DECLS
+BEGIN_GNOME_DECLS
#define CAL_COMPONENT_TYPE (cal_component_get_type ())
-#define CAL_COMPONENT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CAL_COMPONENT_TYPE, CalComponent))
-#define CAL_COMPONENT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CAL_COMPONENT_TYPE, \
+#define CAL_COMPONENT(obj) (GTK_CHECK_CAST ((obj), CAL_COMPONENT_TYPE, CalComponent))
+#define CAL_COMPONENT_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), CAL_COMPONENT_TYPE, \
CalComponentClass))
-#define IS_CAL_COMPONENT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CAL_COMPONENT_TYPE))
-#define IS_CAL_COMPONENT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CAL_COMPONENT_TYPE))
+#define IS_CAL_COMPONENT(obj) (GTK_CHECK_TYPE ((obj), CAL_COMPONENT_TYPE))
+#define IS_CAL_COMPONENT_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), CAL_COMPONENT_TYPE))
/* Types of calendar components to be stored by a CalComponent, as per RFC 2445.
* We don't put the alarm component type here since we store alarms as separate
@@ -184,19 +184,19 @@ typedef struct _CalComponentClass CalComponentClass;
typedef struct _CalComponentPrivate CalComponentPrivate;
struct _CalComponent {
- GObject object;
+ GtkObject object;
/* Private data */
CalComponentPrivate *priv;
};
struct _CalComponentClass {
- GObjectClass parent_class;
+ GtkObjectClass parent_class;
};
/* Calendar component */
-GType cal_component_get_type (void);
+GtkType cal_component_get_type (void);
char *cal_component_gen_uid (void);
@@ -444,6 +444,6 @@ icalcomponent *cal_component_alarm_get_icalcomponent (CalComponentAlarm *alarm);
-G_END_DECLS
+END_GNOME_DECLS
#endif
diff --git a/calendar/cal-util/cal-recur.c b/calendar/cal-util/cal-recur.c
index 123198676c..8ba1fc435d 100644
--- a/calendar/cal-util/cal-recur.c
+++ b/calendar/cal-util/cal-recur.c
@@ -23,7 +23,6 @@
#include <config.h>
#include <stdlib.h>
#include <string.h>
-#include <libgnome/gnome-i18n.h>
#include <cal-util/cal-recur.h>
#include <cal-util/timeutil.h>
@@ -3981,36 +3980,3 @@ cal_recur_set_rule_end_date (icalproperty *prop,
icalproperty_add_parameter (prop, param);
}
-const char *cal_recur_nth[31] = {
- N_("1st"),
- N_("2nd"),
- N_("3rd"),
- N_("4th"),
- N_("5th"),
- N_("6th"),
- N_("7th"),
- N_("8th"),
- N_("9th"),
- N_("10th"),
- N_("11th"),
- N_("12th"),
- N_("13th"),
- N_("14th"),
- N_("15th"),
- N_("16th"),
- N_("17th"),
- N_("18th"),
- N_("19th"),
- N_("20th"),
- N_("21st"),
- N_("22nd"),
- N_("23rd"),
- N_("24th"),
- N_("25th"),
- N_("26th"),
- N_("27th"),
- N_("28th"),
- N_("29th"),
- N_("30th"),
- N_("31st")
-};
diff --git a/calendar/cal-util/cal-util.c b/calendar/cal-util/cal-util.c
index ad495bca77..bb89c043b4 100644
--- a/calendar/cal-util/cal-util.c
+++ b/calendar/cal-util/cal-util.c
@@ -23,6 +23,7 @@
#include <stdlib.h>
#include <string.h>
#include <glib.h>
+#include <libgnome/gnome-defs.h>
#include <libgnome/gnome-i18n.h>
#include <libgnome/gnome-util.h>
#include "cal-util.h"
@@ -102,33 +103,6 @@ cal_util_new_top_level (void)
return icalcomp;
}
-static char *
-get_line_fn (char *buf, size_t size, void *file)
-{
- return fgets (buf, size, file);
-}
-
-icalcomponent *
-cal_util_parse_ics_file (const char *filename)
-{
- icalparser *parser;
- icalcomponent *icalcomp;
- FILE *file;
-
- file = fopen (filename, "r");
- if (!file)
- return NULL;
-
- parser = icalparser_new ();
- icalparser_set_gen_data (parser, file);
-
- icalcomp = icalparser_parse (parser, get_line_fn);
- icalparser_free (parser);
- fclose (file);
-
- return icalcomp;
-}
-
/* Computes the range of time in which recurrences should be generated for a
* component in order to compute alarm trigger times.
*/
@@ -483,7 +457,7 @@ cal_util_generate_alarms_for_comp (CalComponent *comp,
alarms = g_new (CalComponentAlarms, 1);
alarms->comp = comp;
- g_object_ref (G_OBJECT (alarms->comp));
+ gtk_object_ref (GTK_OBJECT (alarms->comp));
alarms->alarms = g_slist_sort (aod.triggers, compare_alarm_instance);
return alarms;
diff --git a/calendar/cal-util/cal-util.h b/calendar/cal-util/cal-util.h
index 7b4f6c051e..e48fb2b80e 100644
--- a/calendar/cal-util/cal-util.h
+++ b/calendar/cal-util/cal-util.h
@@ -22,13 +22,14 @@
#ifndef CAL_UTIL_H
#define CAL_UTIL_H
+#include <libgnome/gnome-defs.h>
#include <ical.h>
#include <time.h>
#include <glib.h>
#include <cal-util/cal-component.h>
#include <cal-util/cal-recur.h>
-G_BEGIN_DECLS
+BEGIN_GNOME_DECLS
@@ -71,8 +72,6 @@ void cal_obj_uid_list_free (GList *list);
icalcomponent *cal_util_new_top_level (void);
-icalcomponent *cal_util_parse_ics_file (const char *filename);
-
CalComponentAlarms *cal_util_generate_alarms_for_comp (CalComponent *comp,
time_t start,
time_t end,
@@ -99,7 +98,7 @@ char *cal_util_expand_uri (char *uri, gboolean tasks);
void cal_util_add_timezones_from_component (icalcomponent *vcal_comp,
CalComponent *comp);
-G_END_DECLS
+END_GNOME_DECLS
#endif
diff --git a/calendar/conduits/calendar/calendar-conduit.c b/calendar/conduits/calendar/calendar-conduit.c
index 5358605826..4cb47e49ea 100644
--- a/calendar/conduits/calendar/calendar-conduit.c
+++ b/calendar/conduits/calendar/calendar-conduit.c
@@ -23,6 +23,8 @@
#include <config.h>
+#include <bonobo.h>
+#include <bonobo-conf/bonobo-config-database.h>
#include <cal-client/cal-client-types.h>
#include <cal-client/cal-client.h>
#include <cal-util/timeutil.h>
@@ -37,7 +39,6 @@
#include <e-pilot-map.h>
#include <e-pilot-settings.h>
#include <e-pilot-util.h>
-#include <e-config-listener.h>
GnomePilotConduit * conduit_get_gpilot_conduit (guint32);
void conduit_destroy_gpilot_conduit (GnomePilotConduit*);
@@ -85,7 +86,7 @@ struct _ECalLocalRecord {
static void
calconduit_destroy_record (ECalLocalRecord *local)
{
- g_object_unref (local->comp);
+ gtk_object_unref (GTK_OBJECT (local->comp));
free_Appointment (local->appt);
g_free (local->appt);
g_free (local);
@@ -118,11 +119,7 @@ calconduit_load_configuration (guint32 pilot_id)
/* Sync Type */
management = gnome_pilot_conduit_management_new ("e_calendar_conduit", GNOME_PILOT_CONDUIT_MGMT_ID);
- gtk_object_ref (GTK_OBJECT (management));
- gtk_object_sink (GTK_OBJECT (management));
config = gnome_pilot_conduit_config_new (management, pilot_id);
- gtk_object_ref (GTK_OBJECT (config));
- gtk_object_sink (GTK_OBJECT (config));
if (!gnome_pilot_conduit_config_is_enabled (config, &c->sync_type))
c->sync_type = GnomePilotConduitSyncTypeNotSet;
gtk_object_unref (GTK_OBJECT (config));
@@ -310,9 +307,9 @@ e_calendar_context_destroy (ECalConduitContext *ctxt)
e_cal_gui_destroy (ctxt->gui);
if (ctxt->client != NULL)
- g_object_unref (ctxt->client);
- if (ctxt->default_comp != NULL)
- g_object_unref (ctxt->default_comp);
+ gtk_object_unref (GTK_OBJECT (ctxt->client));
+ if (ctxt->default_comp != NULL)
+ gtk_object_unref (GTK_OBJECT (ctxt->default_comp));
if (ctxt->uids != NULL)
cal_obj_uid_list_free (ctxt->uids);
@@ -412,8 +409,8 @@ start_calendar_server (ECalConduitContext *ctxt)
ctxt->client = cal_client_new ();
- g_signal_connect (ctxt->client, "cal_opened",
- G_CALLBACK (start_calendar_server_cb), &success);
+ gtk_signal_connect (GTK_OBJECT (ctxt->client), "cal_opened",
+ start_calendar_server_cb, &success);
if (!cal_client_open_default_calendar (ctxt->client, FALSE))
return -1;
@@ -444,14 +441,24 @@ get_timezone (CalClient *client, const char *tzid)
static icaltimezone *
get_default_timezone (void)
{
- EConfigListener *listener;
+ Bonobo_ConfigDatabase db;
icaltimezone *timezone = NULL;
char *location;
+ CORBA_Environment ev;
- listener = e_config_listener_new ();
+ CORBA_exception_init (&ev);
+
+ db = bonobo_get_object ("wombat:", "Bonobo/ConfigDatabase", &ev);
+
+ if (BONOBO_EX (&ev) || db == CORBA_OBJECT_NIL) {
+ CORBA_exception_free (&ev);
+ return NULL;
+ }
+
+ CORBA_exception_free (&ev);
- location = e_config_listener_get_string_with_default (listener,
- "/apps/evolution/calendar/display/timezone", "UTC", NULL);
+ location = bonobo_config_get_string_with_default (db,
+ "/Calendar/Display/Timezone", "UTC", NULL);
if (!location || !location[0]) {
g_free (location);
location = g_strdup ("UTC");
@@ -460,7 +467,7 @@ get_default_timezone (void)
timezone = icaltimezone_get_builtin_timezone (location);
g_free (location);
- g_object_unref (listener);
+ bonobo_object_release_unref (db, NULL);
return timezone;
}
@@ -701,33 +708,6 @@ compute_status (ECalConduitContext *ctxt, ECalLocalRecord *local, const char *ui
}
}
-static gboolean
-rrules_mostly_equal (struct icalrecurrencetype *a, struct icalrecurrencetype *b)
-{
- struct icalrecurrencetype acopy, bcopy;
-
- acopy = *a;
- bcopy = *b;
-
- acopy.until = bcopy.until = icaltime_null_time ();
- acopy.count = bcopy.count = 0;
-
- if (!memcmp (&acopy, &bcopy, sizeof (struct icalrecurrencetype)))
- return TRUE;
-
- return FALSE;
-}
-
-static gboolean
-find_last_cb (CalComponent *comp, time_t start, time_t end, gpointer data)
-{
- time_t *last = data;
-
- *last = start;
-
- return TRUE;
-}
-
static GnomePilotRecord
local_record_to_pilot_record (ECalLocalRecord *local,
ECalConduitContext *ctxt)
@@ -770,7 +750,7 @@ local_record_from_comp (ECalLocalRecord *local, CalComponent *comp, ECalConduitC
g_return_if_fail (comp != NULL);
local->comp = comp;
- g_object_ref (comp);
+ gtk_object_ref (GTK_OBJECT (comp));
cal_component_get_uid (local->comp, &uid);
local->local.ID = e_pilot_map_lookup_pid (ctxt->map, uid, TRUE);
@@ -906,24 +886,14 @@ local_record_from_comp (ECalLocalRecord *local, CalComponent *comp, ECalConduitC
local->appt->repeatFrequency = recur->interval;
}
- if (!icaltime_is_null_time (recur->until)) {
- local->appt->repeatForever = 0;
- local->appt->repeatEnd = icaltimetype_to_tm_with_zone (&recur->until,
- icaltimezone_get_utc_timezone (),
- default_tz);
- } else if (recur->count > 0) {
- time_t last = -1;
- struct icaltimetype itt;
-
- /* The palm does not support count recurrences */
- local->appt->repeatForever = 0;
- cal_recur_generate_instances (comp, -1, -1, find_last_cb, &last,
- cal_client_resolve_tzid_cb, ctxt->client,
- default_tz);
- itt = icaltime_from_timet_with_zone (last, TRUE, default_tz);
- local->appt->repeatEnd = icaltimetype_to_tm (&itt);
- } else {
+ if (icaltime_is_null_time (recur->until)) {
local->appt->repeatForever = 1;
+ } else {
+ local->appt->repeatForever = 0;
+ icaltimezone_convert_time (&recur->until,
+ icaltimezone_get_utc_timezone (),
+ default_tz);
+ local->appt->repeatEnd = icaltimetype_to_tm (&recur->until);
}
cal_component_free_recur_list (list);
@@ -1016,13 +986,13 @@ local_record_from_uid (ECalLocalRecord *local,
if (status == CAL_CLIENT_GET_SUCCESS) {
local_record_from_comp (local, comp, ctxt);
- g_object_unref (comp);
+ gtk_object_unref (GTK_OBJECT (comp));
} else if (status == CAL_CLIENT_GET_NOT_FOUND) {
comp = cal_component_new ();
cal_component_set_new_vtype (comp, CAL_COMPONENT_EVENT);
cal_component_set_uid (comp, uid);
local_record_from_comp (local, comp, ctxt);
- g_object_unref (comp);
+ gtk_object_unref (GTK_OBJECT (comp));
} else {
INFO ("Object did not exist");
}
@@ -1032,7 +1002,6 @@ static CalComponent *
comp_from_remote_record (GnomePilotConduitSyncAbs *conduit,
GnomePilotRecord *remote,
CalComponent *in_comp,
- CalClient *client,
icaltimezone *timezone)
{
CalComponent *comp;
@@ -1153,47 +1122,17 @@ comp_from_remote_record (GnomePilotConduitSyncAbs *conduit,
}
if (recur.freq != ICAL_NO_RECURRENCE) {
- GSList *list = NULL, *existing;
- struct icalrecurrencetype *erecur;
+ GSList *list = NULL;
/* recurrence start of week */
recur.week_start = get_ical_day (appt.repeatWeekstart);
if (!appt.repeatForever) {
- recur.until = tm_to_icaltimetype (&appt.repeatEnd, TRUE);
+ recur.until = tm_to_icaltimetype (&appt.repeatEnd, TRUE);
}
list = g_slist_append (list, &recur);
cal_component_set_rrule_list (comp, list);
-
- /* If the desktop uses count and rrules are
- * equivalent, use count still on the desktop */
- if (!appt.repeatForever && cal_component_has_rrules (in_comp)) {
- cal_component_get_rrule_list (in_comp, &existing);
- erecur = existing->data;
-
- /* If the rules are otherwise the same and the existing uses count,
- see if they end at the same point */
- if (rrules_mostly_equal (&recur, erecur) &&
- icaltime_is_null_time (erecur->until) && erecur->count > 0) {
- time_t last, elast;
-
- cal_recur_generate_instances (comp, -1, -1, find_last_cb, &last,
- cal_client_resolve_tzid_cb, client,
- timezone);
- cal_recur_generate_instances (in_comp, -1, -1, find_last_cb, &elast,
- cal_client_resolve_tzid_cb, client,
- timezone);
-
-
- if (last == elast) {
- recur.until = icaltime_null_time ();
- recur.count = erecur->count;
- cal_component_set_rrule_list (comp, list);
- }
- }
- }
-
g_slist_free (list);
} else {
cal_component_set_rrule_list (comp, NULL);
@@ -1264,7 +1203,7 @@ comp_from_remote_record (GnomePilotConduitSyncAbs *conduit,
cal_component_set_transparency (comp, CAL_COMPONENT_TRANSP_NONE);
- if (remote->secret)
+ if (remote->attr & dlpRecAttrSecret)
cal_component_set_classification (comp, CAL_COMPONENT_CLASS_PRIVATE);
else
cal_component_set_classification (comp, CAL_COMPONENT_CLASS_PUBLIC);
@@ -1396,7 +1335,7 @@ pre_sync (GnomePilotConduit *conduit,
cal_component_get_uid (ccc->comp, &uid);
if (e_pilot_map_lookup_pid (ctxt->map, uid, FALSE) == 0) {
ctxt->changed = g_list_remove (ctxt->changed, ccc);
- g_object_unref (ccc->comp);
+ gtk_object_unref (GTK_OBJECT (ccc->comp));
g_free (ccc);
}
}
@@ -1662,7 +1601,7 @@ add_record (GnomePilotConduitSyncAbs *conduit,
LOG ("add_record: adding %s to desktop\n", print_remote (remote));
- comp = comp_from_remote_record (conduit, remote, ctxt->default_comp, ctxt->client, ctxt->timezone);
+ comp = comp_from_remote_record (conduit, remote, ctxt->default_comp, ctxt->timezone);
/* Give it a new UID otherwise it will be the uid of the default comp */
uid = cal_component_gen_uid ();
@@ -1673,7 +1612,7 @@ add_record (GnomePilotConduitSyncAbs *conduit,
g_free (uid);
- g_object_unref (comp);
+ gtk_object_unref (GTK_OBJECT (comp));
return retval;
}
@@ -1692,8 +1631,8 @@ replace_record (GnomePilotConduitSyncAbs *conduit,
LOG ("replace_record: replace %s with %s\n",
print_local (local), print_remote (remote));
- new_comp = comp_from_remote_record (conduit, remote, local->comp, ctxt->client, ctxt->timezone);
- g_object_unref (local->comp);
+ new_comp = comp_from_remote_record (conduit, remote, local->comp, ctxt->timezone);
+ gtk_object_unref (GTK_OBJECT (local->comp));
local->comp = new_comp;
update_comp (conduit, local->comp, ctxt);
@@ -1851,6 +1790,16 @@ revert_settings (GnomePilotConduit *conduit, ECalConduitContext *ctxt)
ctxt->new_cfg = calconduit_dupe_configuration (ctxt->cfg);
}
+static ORBit_MessageValidationResult
+accept_all_cookies (CORBA_unsigned_long request_id,
+ CORBA_Principal *principal,
+ CORBA_char *operation)
+{
+ /* allow ALL cookies */
+ return ORBIT_MESSAGE_ALLOW_ALL;
+}
+
+
GnomePilotConduit *
conduit_get_gpilot_conduit (guint32 pilot_id)
{
@@ -1859,6 +1808,21 @@ conduit_get_gpilot_conduit (guint32 pilot_id)
LOG ("in calendar's conduit_get_gpilot_conduit\n");
+ /* we need to find wombat with oaf, so make sure oaf
+ is initialized here. once the desktop is converted
+ to oaf and gpilotd is built with oaf, this can go away */
+ if (!oaf_is_initialized ()) {
+ char *argv[ 1 ] = {"hi"};
+ oaf_init (1, argv);
+
+ if (bonobo_init (CORBA_OBJECT_NIL,
+ CORBA_OBJECT_NIL,
+ CORBA_OBJECT_NIL) == FALSE)
+ g_error (_("Could not initialize Bonobo"));
+
+ ORBit_set_request_validation_handler (accept_all_cookies);
+ }
+
retval = gnome_pilot_conduit_sync_abs_new ("DatebookDB", 0x64617465);
g_assert (retval != NULL);
diff --git a/calendar/conduits/todo/todo-conduit.c b/calendar/conduits/todo/todo-conduit.c
index a07ed35706..7f834921ca 100644
--- a/calendar/conduits/todo/todo-conduit.c
+++ b/calendar/conduits/todo/todo-conduit.c
@@ -23,6 +23,9 @@
#include <config.h>
+#include <liboaf/liboaf.h>
+#include <bonobo.h>
+#include <bonobo-conf/bonobo-config-database.h>
#include <cal-client/cal-client-types.h>
#include <cal-client/cal-client.h>
#include <cal-util/timeutil.h>
@@ -38,7 +41,6 @@
#include <e-pilot-map.h>
#include <e-pilot-settings.h>
#include <e-pilot-util.h>
-#include <e-config-listener.h>
GnomePilotConduit * conduit_get_gpilot_conduit (guint32);
void conduit_destroy_gpilot_conduit (GnomePilotConduit*);
@@ -84,7 +86,7 @@ struct _EToDoLocalRecord {
static void
todoconduit_destroy_record (EToDoLocalRecord *local)
{
- g_object_unref (local->comp);
+ gtk_object_unref (GTK_OBJECT (local->comp));
free_ToDo (local->todo);
g_free (local->todo);
g_free (local);
@@ -117,11 +119,7 @@ todoconduit_load_configuration (guint32 pilot_id)
c->pilot_id = pilot_id;
management = gnome_pilot_conduit_management_new ("e_todo_conduit", GNOME_PILOT_CONDUIT_MGMT_ID);
- gtk_object_ref (GTK_OBJECT (management));
- gtk_object_sink (GTK_OBJECT (management));
config = gnome_pilot_conduit_config_new (management, pilot_id);
- gtk_object_ref (GTK_OBJECT (config));
- gtk_object_sink (GTK_OBJECT (config));
if (!gnome_pilot_conduit_config_is_enabled (config, &c->sync_type))
c->sync_type = GnomePilotConduitSyncTypeNotSet;
gtk_object_unref (GTK_OBJECT (config));
@@ -309,10 +307,10 @@ e_todo_context_destroy (EToDoConduitContext *ctxt)
e_todo_gui_destroy (ctxt->gui);
if (ctxt->client != NULL)
- g_object_unref (ctxt->client);
+ gtk_object_unref (GTK_OBJECT (ctxt->client));
if (ctxt->default_comp != NULL)
- g_object_unref (ctxt->default_comp);
+ gtk_object_unref (GTK_OBJECT (ctxt->default_comp));
if (ctxt->uids != NULL)
cal_obj_uid_list_free (ctxt->uids);
@@ -419,8 +417,8 @@ start_calendar_server (EToDoConduitContext *ctxt)
ctxt->client = cal_client_new ();
- g_signal_connect (ctxt->client, "cal_opened",
- G_CALLBACK (start_calendar_server_cb), &success);
+ gtk_signal_connect (GTK_OBJECT (ctxt->client), "cal_opened",
+ start_calendar_server_cb, &success);
if (!cal_client_open_default_tasks (ctxt->client, FALSE))
return -1;
@@ -451,14 +449,24 @@ get_timezone (CalClient *client, const char *tzid)
static icaltimezone *
get_default_timezone (void)
{
- EConfigListener *listener;
+ Bonobo_ConfigDatabase db;
icaltimezone *timezone = NULL;
char *location;
+ CORBA_Environment ev;
- listener = e_config_listener_new ();
+ CORBA_exception_init (&ev);
+
+ db = bonobo_get_object ("wombat:", "Bonobo/ConfigDatabase", &ev);
+
+ if (BONOBO_EX (&ev) || db == CORBA_OBJECT_NIL) {
+ CORBA_exception_free (&ev);
+ return NULL;
+ }
+
+ CORBA_exception_free (&ev);
- location = e_config_listener_get_string_with_default (listener,
- "/apps/evolution/calendar/display/timezone", "UTC", NULL);
+ location = bonobo_config_get_string_with_default (db,
+ "/Calendar/Display/Timezone", "UTC", NULL);
if (!location || !location[0]) {
g_free (location);
location = g_strdup ("UTC");
@@ -467,7 +475,7 @@ get_default_timezone (void)
timezone = icaltimezone_get_builtin_timezone (location);
g_free (location);
- g_object_unref (listener);
+ bonobo_object_release_unref (db, NULL);
return timezone;
}
@@ -586,7 +594,7 @@ local_record_from_comp (EToDoLocalRecord *local, CalComponent *comp, EToDoCondui
g_return_if_fail (comp != NULL);
local->comp = comp;
- g_object_ref (comp);
+ gtk_object_ref (GTK_OBJECT (comp));
cal_component_get_uid (local->comp, &uid);
local->local.ID = e_pilot_map_lookup_pid (ctxt->map, uid, TRUE);
@@ -685,13 +693,13 @@ local_record_from_uid (EToDoLocalRecord *local,
if (status == CAL_CLIENT_GET_SUCCESS) {
local_record_from_comp (local, comp, ctxt);
- g_object_unref (comp);
+ gtk_object_unref (GTK_OBJECT (comp));
} else if (status == CAL_CLIENT_GET_NOT_FOUND) {
comp = cal_component_new ();
cal_component_set_new_vtype (comp, CAL_COMPONENT_TODO);
cal_component_set_uid (comp, uid);
local_record_from_comp (local, comp, ctxt);
- g_object_unref (comp);
+ gtk_object_unref (GTK_OBJECT (comp));
} else {
INFO ("Object did not exist");
}
@@ -780,7 +788,7 @@ comp_from_remote_record (GnomePilotConduitSyncAbs *conduit,
}
if (!is_empty_time (todo.due)) {
- due = tm_to_icaltimetype (&todo.due, TRUE);
+ due = tm_to_icaltimetype (&todo.due, FALSE);
dt.value = &due;
cal_component_set_due (comp, &dt);
}
@@ -805,7 +813,7 @@ comp_from_remote_record (GnomePilotConduitSyncAbs *conduit,
cal_component_set_priority (comp, &priority);
cal_component_set_transparency (comp, CAL_COMPONENT_TRANSP_NONE);
- if (remote->secret)
+ if (remote->attr & dlpRecAttrSecret)
cal_component_set_classification (comp, CAL_COMPONENT_CLASS_PRIVATE);
else
cal_component_set_classification (comp, CAL_COMPONENT_CLASS_PUBLIC);
@@ -1185,7 +1193,7 @@ add_record (GnomePilotConduitSyncAbs *conduit,
update_comp (conduit, comp, ctxt);
e_pilot_map_insert (ctxt->map, remote->ID, uid, FALSE);
- g_object_unref (comp);
+ gtk_object_unref (GTK_OBJECT (comp));
return retval;
}
@@ -1205,7 +1213,7 @@ replace_record (GnomePilotConduitSyncAbs *conduit,
print_local (local), print_remote (remote));
new_comp = comp_from_remote_record (conduit, remote, local->comp, ctxt->timezone);
- g_object_unref (local->comp);
+ gtk_object_unref (GTK_OBJECT (local->comp));
local->comp = new_comp;
update_comp (conduit, local->comp, ctxt);
@@ -1362,6 +1370,16 @@ revert_settings (GnomePilotConduit *conduit, EToDoConduitContext *ctxt)
ctxt->new_cfg = todoconduit_dupe_configuration (ctxt->cfg);
}
+static ORBit_MessageValidationResult
+accept_all_cookies (CORBA_unsigned_long request_id,
+ CORBA_Principal *principal,
+ CORBA_char *operation)
+{
+ /* allow ALL cookies */
+ return ORBIT_MESSAGE_ALLOW_ALL;
+}
+
+
GnomePilotConduit *
conduit_get_gpilot_conduit (guint32 pilot_id)
{
@@ -1370,6 +1388,21 @@ conduit_get_gpilot_conduit (guint32 pilot_id)
LOG ("in todo's conduit_get_gpilot_conduit\n");
+ /* we need to find wombat with oaf, so make sure oaf
+ is initialized here. once the desktop is converted
+ to oaf and gpilotd is built with oaf, this can go away */
+ if (!oaf_is_initialized ()) {
+ char *argv[ 1 ] = {"hi"};
+ oaf_init (1, argv);
+
+ if (bonobo_init (CORBA_OBJECT_NIL,
+ CORBA_OBJECT_NIL,
+ CORBA_OBJECT_NIL) == FALSE)
+ g_error (_("Could not initialize Bonobo"));
+
+ ORBit_set_request_validation_handler (accept_all_cookies);
+ }
+
retval = gnome_pilot_conduit_sync_abs_new ("ToDoDB", 0x746F646F);
g_assert (retval != NULL);
diff --git a/calendar/gui/alarm-notify/.cvsignore b/calendar/gui/alarm-notify/.cvsignore
index 5d0cf13a94..f6892abafa 100644
--- a/calendar/gui/alarm-notify/.cvsignore
+++ b/calendar/gui/alarm-notify/.cvsignore
@@ -8,5 +8,8 @@ evolution-calendar-skels.c
evolution-calendar-common.c
evolution-calendar.h
evolution-alarm-notify
-GNOME_Evolution_Calendar_AlarmNotify.server
-GNOME_Evolution_Calendar_AlarmNotify.server.in
+Evolution-Composer-common.c
+Evolution-Composer-skels.c
+Evolution-Composer-stubs.c
+Evolution-Composer.h
+GNOME_Evolution_Calendar_AlarmNotify.oaf
diff --git a/calendar/gui/alarm-notify/Makefile.am b/calendar/gui/alarm-notify/Makefile.am
index a85e99a9cf..eedfb95040 100644
--- a/calendar/gui/alarm-notify/Makefile.am
+++ b/calendar/gui/alarm-notify/Makefile.am
@@ -1,21 +1,30 @@
-CORBA_GENERATED_H = \
- evolution-calendar.h
-CORBA_GENERATED_C = \
+CORBA_GENERATED = \
+ Evolution-Composer.h \
+ Evolution-Composer-common.c \
+ Evolution-Composer-skels.c \
+ Evolution-Composer-stubs.c \
+ evolution-calendar.h \
evolution-calendar-common.c \
evolution-calendar-skels.c \
evolution-calendar-stubs.c
-CORBA_GENERATED = $(CORBA_GENERATED_C) $(CORBA_GENERATED_H)
-idls = $(top_srcdir)/calendar/idl/evolution-calendar.idl
-idl_flags = $(IDL_INCLUDES)
+idls = \
+ $(top_srcdir)/composer/Evolution-Composer.idl \
+ $(top_srcdir)/calendar/idl/evolution-calendar.idl
-$(CORBA_GENERATED_H): $(idls)
+idl_flags = `$(GNOME_CONFIG) --cflags idl` -I $(datadir)/idl
+
+$(CORBA_GENERATED): $(idls)
+ $(ORBIT_IDL) $(idl_flags) $(srcdir)/../../../composer/Evolution-Composer.idl
$(ORBIT_IDL) $(idl_flags) $(top_srcdir)/calendar/idl/evolution-calendar.idl
-$(CORBA_GENERATED_C): $(CORBA_GENERATED_H)
+bin_PROGRAMS = evolution-alarm-notify
-privlibexec_PROGRAMS = evolution-alarm-notify
+noinst_LIBRARIES = libalarm.a
+libalarm_a_SOURCES = \
+ alarm.c \
+ alarm.h
INCLUDES = \
-DG_LOG_DOMAIN=\"evolution-alarm-notify\" \
@@ -25,18 +34,22 @@ INCLUDES = \
-I$(top_srcdir)/libical/src/libical \
-I$(top_builddir)/libical/src/libical \
-I$(top_srcdir)/widgets \
+ -I$(includedir) \
+ -DEVOLUTION_DATADIR=\""$(datadir)"\" \
-DEVOLUTION_GLADEDIR=\""$(gladedir)"\" \
- -DEVOLUTION_IMAGESDIR=\""$(imagesdir)"\" \
+ -DEVOLUTION_ICONSDIR=\""$(iconsdir)"\" \
-DEVOLUTION_LOCALEDIR=\""$(localedir)"\" \
$(EVOLUTION_CALENDAR_CFLAGS)
+iconsdir = $(datadir)/images/evolution
+
+gladedir = $(datadir)/evolution/glade
+
glade_DATA = \
alarm-notify.glade
evolution_alarm_notify_SOURCES = \
$(CORBA_GENERATED) \
- alarm.c \
- alarm.h \
alarm-notify.c \
alarm-notify.h \
alarm-notify-dialog.c \
@@ -50,22 +63,27 @@ evolution_alarm_notify_SOURCES = \
save.h
evolution_alarm_notify_LDADD = \
+ libalarm.a \
$(top_builddir)/calendar/cal-client/libcal-client.la \
$(top_builddir)/calendar/cal-util/libcal-util.la \
+ $(top_builddir)/libical/src/libical/libical-evolution.la \
+ $(top_builddir)/libwombat/libwombat.la \
+ $(top_builddir)/e-util/libeutil.la \
$(EVOLUTION_CALENDAR_LIBS)
-server_in_files = \
- GNOME_Evolution_Calendar_AlarmNotify.server.in.in
+evolution_alarm_notify_LDFLAGS = -export-dynamic
+
+oafdir = $(datadir)/oaf
+oaf_in_files = \
+ GNOME_Evolution_Calendar_AlarmNotify.oaf.in
-server_DATA = $(server_in_files:.server.in.in=.server)
-$(server_in_files:.server.in.in=.server.in): $(server_in_files)
- sed -e "s|\@LIBEXECDIR\@|$(privlibexecdir)|" $< > $@
+oaf_DATA = $(oaf_in_files:.oaf.in=.oaf)
-@INTLTOOL_SERVER_RULE@
+@XML_I18N_MERGE_OAF_RULE@
EXTRA_DIST = \
- $(server_DATA) \
- $(server_in_files) \
+ $(oaf_DATA) \
+ $(oaf_in_files) \
$(glade_DATA)
BUILT_SOURCES = $(CORBA_GENERATED)
diff --git a/calendar/gui/alarm-notify/alarm-queue.c b/calendar/gui/alarm-notify/alarm-queue.c
index fc52172851..c24adc0ec3 100644
--- a/calendar/gui/alarm-notify/alarm-queue.c
+++ b/calendar/gui/alarm-notify/alarm-queue.c
@@ -22,20 +22,20 @@
#include <config.h>
#endif
-#include <string.h>
#include <glib.h>
-#include <bonobo-activation/bonobo-activation.h>
+#include <liboaf/liboaf.h>
#include <bonobo/bonobo-object.h>
#include <gtk/gtksignal.h>
#include <gtk/gtkbox.h>
-#include <gtk/gtkdialog.h>
#include <gtk/gtklabel.h>
#include <gtk/gtkcheckbutton.h>
-#include <gtk/gtkstock.h>
+#include <libgnome/gnome-defs.h>
#include <libgnome/gnome-i18n.h>
#include <libgnome/gnome-exec.h>
#include <libgnome/gnome-sound.h>
+#include <libgnomeui/gnome-dialog.h>
#include <libgnomeui/gnome-dialog-util.h>
+#include <libgnomeui/gnome-stock.h>
#include <libgnomeui/gnome-uidefs.h>
#include <cal-util/timeutil.h>
#include "alarm.h"
@@ -87,9 +87,6 @@ typedef struct {
/* List of QueuedAlarm structures */
GSList *queued_alarms;
-
- /* Flags */
- gboolean expecting_update;
} CompQueuedAlarms;
/* Pair of a queued alarm ID and the alarm trigger instance it refers to */
@@ -196,8 +193,7 @@ lookup_queued_alarm (CompQueuedAlarms *cqa, gpointer alarm_id)
* the last one listed for the component, it removes the component itself.
*/
static void
-remove_queued_alarm (CompQueuedAlarms *cqa, gpointer alarm_id,
- gboolean free_object, gboolean remove_alarm)
+remove_queued_alarm (CompQueuedAlarms *cqa, gpointer alarm_id)
{
QueuedAlarm *qa;
const char *uid;
@@ -217,13 +213,6 @@ remove_queued_alarm (CompQueuedAlarms *cqa, gpointer alarm_id,
cqa->queued_alarms = g_slist_remove_link (cqa->queued_alarms, l);
g_slist_free_1 (l);
- if (remove_alarm) {
- cal_component_remove_alarm (cqa->alarms->comp, qa->instance->auid);
- cqa->expecting_update = TRUE;
- cal_client_update_object (cqa->parent_client->client, cqa->alarms->comp);
- cqa->expecting_update = FALSE;
- }
-
g_free (qa);
/* If this was the last queued alarm for this component, remove the
@@ -233,16 +222,14 @@ remove_queued_alarm (CompQueuedAlarms *cqa, gpointer alarm_id,
if (cqa->queued_alarms != NULL)
return;
- if (free_object) {
- cal_component_get_uid (cqa->alarms->comp, &uid);
- g_hash_table_remove (cqa->parent_client->uid_alarms_hash, uid);
- cqa->parent_client = NULL;
- cal_component_alarms_free (cqa->alarms);
- g_free (cqa);
- } else {
- cal_component_alarms_free (cqa->alarms);
- cqa->alarms = NULL;
- }
+ cal_component_get_uid (cqa->alarms->comp, &uid);
+ g_hash_table_remove (cqa->parent_client->uid_alarms_hash, uid);
+ cqa->parent_client = NULL;
+
+ cal_component_alarms_free (cqa->alarms);
+ cqa->alarms = NULL;
+
+ g_free (cqa);
}
/* Callback used when an alarm triggers */
@@ -319,7 +306,6 @@ add_component_alarms (ClientAlarms *ca, CalComponentAlarms *alarms)
cqa = g_new (CompQueuedAlarms, 1);
cqa->parent_client = ca;
cqa->alarms = alarms;
- cqa->expecting_update = FALSE;
cqa->queued_alarms = NULL;
@@ -438,11 +424,22 @@ lookup_comp_queued_alarms (ClientAlarms *ca, const char *uid)
return g_hash_table_lookup (ca->uid_alarms_hash, uid);
}
+/* Removes a component an its alarms */
static void
-remove_alarms (CompQueuedAlarms *cqa, gboolean free_object)
+remove_comp (ClientAlarms *ca, const char *uid)
{
+ CompQueuedAlarms *cqa;
GSList *l;
+ cqa = lookup_comp_queued_alarms (ca, uid);
+ if (!cqa)
+ return;
+
+ /* If a component is present, then it means we must have alarms queued
+ * for it.
+ */
+ g_assert (cqa->queued_alarms != NULL);
+
for (l = cqa->queued_alarms; l;) {
QueuedAlarm *qa;
@@ -455,28 +452,9 @@ remove_alarms (CompQueuedAlarms *cqa, gboolean free_object)
l = l->next;
alarm_remove (qa->alarm_id);
- remove_queued_alarm (cqa, qa->alarm_id, free_object, FALSE);
+ remove_queued_alarm (cqa, qa->alarm_id);
}
-}
-
-/* Removes a component an its alarms */
-static void
-remove_comp (ClientAlarms *ca, const char *uid)
-{
- CompQueuedAlarms *cqa;
-
- cqa = lookup_comp_queued_alarms (ca, uid);
- if (!cqa)
- return;
-
- /* If a component is present, then it means we must have alarms queued
- * for it.
- */
- g_assert (cqa->queued_alarms != NULL);
-
- remove_alarms (cqa, TRUE);
-
/* The list should be empty now, and thus the queued component alarms
* structure should have been freed and removed from the hash table.
*/
@@ -494,10 +472,11 @@ obj_updated_cb (CalClient *client, const char *uid, gpointer data)
CalComponentAlarms *alarms;
gboolean found;
icaltimezone *zone;
- CompQueuedAlarms *cqa;
ca = data;
+ remove_comp (ca, uid);
+
now = time (NULL);
zone = config_data_get_timezone ();
@@ -506,51 +485,10 @@ obj_updated_cb (CalClient *client, const char *uid, gpointer data)
found = cal_client_get_alarms_for_object (ca->client, uid, now, day_end, &alarms);
- if (!found) {
- remove_comp (ca, uid);
+ if (!found)
return;
- }
-
- cqa = lookup_comp_queued_alarms (ca, uid);
- if (!cqa)
- add_component_alarms (ca, alarms);
- else {
- GSList *l;
-
- /* if already in the list, just update it */
- remove_alarms (cqa, FALSE);
- cqa->alarms = alarms;
- cqa->queued_alarms = NULL;
-
- /* add the new alarms */
- for (l = cqa->alarms->alarms; l; l = l->next) {
- CalAlarmInstance *instance;
- gpointer alarm_id;
- QueuedAlarm *qa;
-
- instance = l->data;
-
- alarm_id = alarm_add (instance->trigger, alarm_trigger_cb, cqa, NULL);
- if (!alarm_id) {
- g_message ("obj_updated_cb(): Could not schedule a trigger for "
- "%ld, discarding...", (long) instance->trigger);
- continue;
- }
-
- qa = g_new (QueuedAlarm, 1);
- qa->alarm_id = alarm_id;
- qa->instance = instance;
- qa->snooze = FALSE;
-
- cqa->queued_alarms = g_slist_prepend (cqa->queued_alarms, qa);
- }
- if (cqa->queued_alarms == NULL) {
- if (!cqa->expecting_update)
- remove_comp (ca, uid);
- } else
- cqa->queued_alarms = g_slist_reverse (cqa->queued_alarms);
- }
+ add_component_alarms (ca, alarms);
}
/* Called when a calendar component is removed; we must delete its corresponding
@@ -613,22 +551,24 @@ create_snooze (CompQueuedAlarms *cqa, gpointer alarm_id, int snooze_mins)
/* Launches a component editor for a component */
static void
-edit_component (CalClient *client, CalComponent *comp)
+edit_component (CompQueuedAlarms *cqa)
{
+ CalComponent *comp;
const char *uid;
const char *uri;
CORBA_Environment ev;
GNOME_Evolution_Calendar_CompEditorFactory factory;
+ comp = cqa->alarms->comp;
cal_component_get_uid (comp, &uid);
- uri = cal_client_get_uri (client);
+ uri = cal_client_get_uri (cqa->parent_client->client);
/* Get the factory */
CORBA_exception_init (&ev);
- factory = bonobo_activation_activate_from_id ("OAFIID:GNOME_Evolution_Calendar_CompEditorFactory",
- 0, NULL, &ev);
+ factory = oaf_activate_from_id ("OAFIID:GNOME_Evolution_Calendar_CompEditorFactory",
+ 0, NULL, &ev);
if (ev._major != CORBA_NO_EXCEPTION) {
g_message ("edit_component(): Could not activate the component editor factory");
@@ -660,33 +600,8 @@ edit_component (CalClient *client, CalComponent *comp)
struct notify_dialog_closure {
CompQueuedAlarms *cqa;
gpointer alarm_id;
- CalClient *client;
- CalComponent *comp;
- gpointer dialog;
};
-static void
-on_dialog_obj_updated_cb (CalClient *client, const char *uid, gpointer data)
-{
- struct notify_dialog_closure *c = data;
-}
-
-static void
-on_dialog_obj_removed_cb (CalClient *client, const char *uid, gpointer data)
-{
- const char *our_uid;
- struct notify_dialog_closure *c = data;
-
- cal_component_get_uid (c->comp, &our_uid);
- g_return_if_fail (our_uid && *our_uid);
-
- if (!strcmp (uid, our_uid)) {
- alarm_notify_dialog_disable_buttons (c->dialog);
- c->cqa = NULL;
- c->alarm_id = NULL;
- }
-}
-
/* Callback used from the alarm notify dialog */
static void
notify_dialog_cb (AlarmNotifyResult result, int snooze_mins, gpointer data)
@@ -695,18 +610,13 @@ notify_dialog_cb (AlarmNotifyResult result, int snooze_mins, gpointer data)
c = data;
- g_signal_handlers_disconnect_matched (c->client, G_SIGNAL_MATCH_FUNC,
- 0, 0, NULL, on_dialog_obj_updated_cb, NULL);
- g_signal_handlers_disconnect_matched (c->client, G_SIGNAL_MATCH_FUNC,
- 0, 0, NULL, on_dialog_obj_removed_cb, NULL);
-
switch (result) {
case ALARM_NOTIFY_SNOOZE:
create_snooze (c->cqa, c->alarm_id, snooze_mins);
break;
case ALARM_NOTIFY_EDIT:
- edit_component (c->client, c->comp);
+ edit_component (c->cqa);
break;
case ALARM_NOTIFY_CLOSE:
@@ -717,10 +627,7 @@ notify_dialog_cb (AlarmNotifyResult result, int snooze_mins, gpointer data)
g_assert_not_reached ();
}
- if (c->cqa != NULL)
- remove_queued_alarm (c->cqa, c->alarm_id, TRUE, TRUE);
- g_object_unref (c->comp);
- g_object_unref (c->client);
+ remove_queued_alarm (c->cqa, c->alarm_id);
g_free (c);
}
@@ -777,21 +684,12 @@ display_notification (time_t trigger, CompQueuedAlarms *cqa,
c = g_new (struct notify_dialog_closure, 1);
c->cqa = cqa;
c->alarm_id = alarm_id;
- c->comp = cal_component_clone (comp);
- c->client = c->cqa->parent_client->client;
- g_object_ref (c->client);
-
- if (!(c->dialog = alarm_notify_dialog (trigger,
- qa->instance->occur_start, qa->instance->occur_end,
- vtype, message,
- notify_dialog_cb, c)))
+
+ if (!alarm_notify_dialog (trigger,
+ qa->instance->occur_start, qa->instance->occur_end,
+ vtype, message,
+ notify_dialog_cb, c))
g_message ("display_notification(): Could not create the alarm notify dialog");
- else {
- g_signal_connect (c->client, "obj_updated",
- G_CALLBACK (on_dialog_obj_updated_cb), c);
- g_signal_connect (c->client, "obj_removed",
- G_CALLBACK (on_dialog_obj_removed_cb), c);
- }
}
/* Performs notification of an audio alarm */
@@ -836,23 +734,16 @@ static void
mail_notification (time_t trigger, CompQueuedAlarms *cqa, gpointer alarm_id)
{
GtkWidget *dialog;
- GtkWidget *label;
/* FIXME */
display_notification (trigger, cqa, alarm_id, FALSE);
- dialog = gtk_dialog_new_with_buttons (_("Warning"),
- NULL, 0,
- GTK_STOCK_OK, GTK_RESPONSE_CANCEL,
- NULL);
- label = gtk_label_new (_("Evolution does not support calendar reminders with\n"
- "email notifications yet, but this reminder was\n"
- "configured to send an email. Evolution will display\n"
- "a normal reminder dialog box instead."));
- gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox), label, TRUE, TRUE, 4);
-
- gtk_dialog_run (GTK_DIALOG (dialog));
+ dialog = gnome_warning_dialog (_("Evolution does not support calendar reminders with\n"
+ "email notifications yet, but this reminder was\n"
+ "configured to send an email. Evolution will display\n"
+ "a normal reminder dialog box instead."));
+ gnome_dialog_run (GNOME_DIALOG (dialog));
}
/* Performs notification of a procedure alarm */
@@ -866,11 +757,10 @@ procedure_notification_dialog (const char *cmd, const char *url)
if (is_blessed_program (url))
return TRUE;
- dialog = gtk_dialog_new_with_buttons (_("Warning"),
- NULL, 0,
- GTK_STOCK_NO, GTK_RESPONSE_CANCEL,
- GTK_STOCK_YES, GTK_RESPONSE_OK,
- NULL);
+ dialog = gnome_dialog_new (_("Warning"),
+ GNOME_STOCK_BUTTON_YES,
+ GNOME_STOCK_BUTTON_NO,
+ NULL);
str = g_strdup_printf (_("An Evolution Calendar reminder is about to trigger. "
"This reminder is configured to run the following program:\n\n"
@@ -881,21 +771,21 @@ procedure_notification_dialog (const char *cmd, const char *url)
gtk_label_set_line_wrap (GTK_LABEL (label), TRUE);
gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT);
gtk_widget_show (label);
- gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox),
+ gtk_box_pack_start (GTK_BOX (GNOME_DIALOG (dialog)->vbox),
label, TRUE, TRUE, 4);
g_free (str);
checkbox = gtk_check_button_new_with_label
(_("Do not ask me about this program again."));
gtk_widget_show (checkbox);
- gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox),
+ gtk_box_pack_start (GTK_BOX (GNOME_DIALOG (dialog)->vbox),
checkbox, TRUE, TRUE, 4);
/* Run the dialog */
- btn = gtk_dialog_run (GTK_DIALOG (dialog));
- if (btn == GTK_RESPONSE_OK && gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (checkbox)))
+ btn = gnome_dialog_run (GNOME_DIALOG (dialog));
+ if (btn == GNOME_YES && gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (checkbox)))
save_blessed_program (url);
- gtk_widget_destroy (dialog);
+ gnome_dialog_close (GNOME_DIALOG (dialog));
return (btn == GNOME_YES);
}
@@ -955,7 +845,7 @@ procedure_notification (time_t trigger, CompQueuedAlarms *cqa, gpointer alarm_id
if (result < 0)
goto fallback;
- remove_queued_alarm (cqa, alarm_id, TRUE, TRUE);
+ remove_queued_alarm (cqa, alarm_id);
return;
fallback:
@@ -1045,7 +935,7 @@ alarm_queue_add_client (CalClient *client)
ca = g_new (ClientAlarms, 1);
ca->client = client;
- g_object_ref (ca->client);
+ gtk_object_ref (GTK_OBJECT (ca->client));
ca->refcount = 1;
g_hash_table_insert (client_alarms_hash, client, ca);
@@ -1053,16 +943,13 @@ alarm_queue_add_client (CalClient *client)
ca->uid_alarms_hash = g_hash_table_new (g_str_hash, g_str_equal);
if (cal_client_get_load_state (client) != CAL_CLIENT_LOAD_LOADED)
- g_signal_connect (client, "cal_opened",
- G_CALLBACK (cal_opened_cb),
- ca);
+ gtk_signal_connect (GTK_OBJECT (client), "cal_opened",
+ GTK_SIGNAL_FUNC (cal_opened_cb), ca);
- g_signal_connect (client, "obj_updated",
- G_CALLBACK (obj_updated_cb),
- ca);
- g_signal_connect (client, "obj_removed",
- G_CALLBACK (obj_removed_cb),
- ca);
+ gtk_signal_connect (GTK_OBJECT (client), "obj_updated",
+ GTK_SIGNAL_FUNC (obj_updated_cb), ca);
+ gtk_signal_connect (GTK_OBJECT (client), "obj_removed",
+ GTK_SIGNAL_FUNC (obj_removed_cb), ca);
if (cal_client_get_load_state (client) == CAL_CLIENT_LOAD_LOADED) {
load_alarms_for_today (ca);
@@ -1138,10 +1025,9 @@ alarm_queue_remove_client (CalClient *client)
/* Clean up */
- g_signal_handlers_disconnect_matched (ca->client, G_SIGNAL_MATCH_DATA,
- 0, 0, NULL, NULL, ca);
+ gtk_signal_disconnect_by_data (GTK_OBJECT (ca->client), ca);
- g_object_unref (ca->client);
+ gtk_object_unref (GTK_OBJECT (ca->client));
ca->client = NULL;
g_hash_table_destroy (ca->uid_alarms_hash);
diff --git a/calendar/gui/calendar-model.c b/calendar/gui/calendar-model.c
index d4b5185351..910d72fa17 100644
--- a/calendar/gui/calendar-model.c
+++ b/calendar/gui/calendar-model.c
@@ -29,7 +29,7 @@
#include <ctype.h>
#include <libgnomeui/gnome-messagebox.h>
-#include <libgnomeui/gnome-stock-icons.h>
+#include <libgnomeui/gnome-stock.h>
#include <libgnome/gnome-i18n.h>
#include <gal/widgets/e-unicode.h>
#include <e-util/e-time-utils.h>
@@ -97,7 +97,7 @@ struct _CalendarModelPrivate {
gchar *default_category;
/* Addresses for determining icons */
- EAccountList *accounts;
+ GList *addresses;
/* The current timezone. */
icaltimezone *zone;
@@ -113,7 +113,7 @@ struct _CalendarModelPrivate {
static void calendar_model_class_init (CalendarModelClass *class);
static void calendar_model_init (CalendarModel *model);
-static void calendar_model_finalize (GObject *object);
+static void calendar_model_destroy (GtkObject *object);
static int calendar_model_column_count (ETableModel *etm);
static int calendar_model_row_count (ETableModel *etm);
@@ -144,23 +144,42 @@ static ETableModelClass *parent_class;
*
* Return value: The type ID of the #CalendarModel class.
**/
+GtkType
+calendar_model_get_type (void)
+{
+ static GtkType calendar_model_type = 0;
+
+ if (!calendar_model_type) {
+ static GtkTypeInfo calendar_model_info = {
+ "CalendarModel",
+ sizeof (CalendarModel),
+ sizeof (CalendarModelClass),
+ (GtkClassInitFunc) calendar_model_class_init,
+ (GtkObjectInitFunc) calendar_model_init,
+ NULL, /* reserved_1 */
+ NULL, /* reserved_2 */
+ (GtkClassInitFunc) NULL
+ };
+
+ calendar_model_type = gtk_type_unique (E_TABLE_MODEL_TYPE, &calendar_model_info);
+ }
-E_MAKE_TYPE (calendar_model, "CalendarModel", CalendarModel, calendar_model_class_init,
- calendar_model_init, E_TABLE_MODEL_TYPE);
+ return calendar_model_type;
+}
/* Class initialization function for the calendar table model */
static void
calendar_model_class_init (CalendarModelClass *class)
{
- GObjectClass *object_class;
+ GtkObjectClass *object_class;
ETableModelClass *etm_class;
- object_class = (GObjectClass *) class;
+ object_class = (GtkObjectClass *) class;
etm_class = (ETableModelClass *) class;
- parent_class = g_type_class_peek_parent (class);
+ parent_class = gtk_type_class (E_TABLE_MODEL_TYPE);
- object_class->finalize = calendar_model_finalize;
+ object_class->destroy = calendar_model_destroy;
etm_class->column_count = calendar_model_column_count;
etm_class->row_count = calendar_model_row_count;
@@ -215,7 +234,7 @@ calendar_model_init (CalendarModel *model)
priv->timeout_id = g_timeout_add (CALENDAR_MODEL_REFRESH_TIMEOUT,
calendar_model_timeout_cb, model);
- priv->accounts = itip_addresses_get ();
+ priv->addresses = itip_addresses_get ();
priv->zone = NULL;
@@ -276,7 +295,7 @@ free_objects (CalendarModel *model)
comp = g_array_index (priv->objects, CalComponent *, i);
g_assert (comp != NULL);
- g_object_unref (comp);
+ gtk_object_unref (GTK_OBJECT (comp));
object_data = &g_array_index (priv->objects_data,
CalendarModelObjectData, i);
@@ -289,7 +308,7 @@ free_objects (CalendarModel *model)
/* Destroy handler for the calendar table model */
static void
-calendar_model_finalize (GObject *object)
+calendar_model_destroy (GtkObject *object)
{
CalendarModel *model;
CalendarModelPrivate *priv;
@@ -308,8 +327,8 @@ calendar_model_finalize (GObject *object)
/* Free the calendar client interface object */
if (priv->client) {
- g_signal_handlers_disconnect_matched (priv->client, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, model);
- g_object_unref (priv->client);
+ gtk_signal_disconnect_by_data (GTK_OBJECT (priv->client), model);
+ gtk_object_unref (GTK_OBJECT (priv->client));
priv->client = NULL;
}
@@ -319,9 +338,8 @@ calendar_model_finalize (GObject *object)
}
if (priv->query) {
- g_signal_handlers_disconnect_matched (priv->query, G_SIGNAL_MATCH_DATA,
- 0, 0, NULL, NULL, model);
- g_object_unref (priv->query);
+ gtk_signal_disconnect_by_data (GTK_OBJECT (priv->query), model);
+ gtk_object_unref (GTK_OBJECT (priv->query));
priv->query = NULL;
}
@@ -340,8 +358,10 @@ calendar_model_finalize (GObject *object)
g_free (priv->default_category);
+ itip_addresses_free (priv->addresses);
+
if (priv->activity) {
- g_object_unref (priv->activity);
+ gtk_object_unref (GTK_OBJECT (priv->activity));
priv->activity = NULL;
}
@@ -350,8 +370,8 @@ calendar_model_finalize (GObject *object)
g_free (priv);
model->priv = NULL;
- if (G_OBJECT_CLASS (parent_class)->finalize)
- (* G_OBJECT_CLASS (parent_class)->finalize) (object);
+ if (GTK_OBJECT_CLASS (parent_class)->destroy)
+ (* GTK_OBJECT_CLASS (parent_class)->destroy) (object);
}
@@ -826,6 +846,7 @@ calendar_model_value_at (ETableModel *etm, int col, int row)
case CAL_COMPONENT_FIELD_ICON:
{
+ ItipAddress *ia;
GSList *attendees = NULL, *sl;
gint retval = 0;
@@ -839,17 +860,23 @@ calendar_model_value_at (ETableModel *etm, int col, int row)
for (sl = attendees; sl != NULL; sl = sl->next) {
CalComponentAttendee *ca = sl->data;
const char *text;
+ GList *l;
text = itip_strip_mailto (ca->value);
- if (e_account_list_find(priv->accounts, E_ACCOUNT_FIND_ID_ADDRESS, text) != NULL) {
- if (ca->delto != NULL)
- retval = 3;
- else
- retval = 2;
- break;
+ for (l = priv->addresses; l != NULL; l = l->next) {
+ ia = l->data;
+
+ if (!strcmp (text, ia->address)) {
+ if (ca->delto != NULL)
+ retval = 3;
+ else
+ retval = 2;
+ goto cleanup;
+ }
}
}
+ cleanup:
cal_component_free_attendee_list (attendees);
return GINT_TO_POINTER (retval);
break;
@@ -1394,7 +1421,7 @@ calendar_model_append_row (ETableModel *etm, ETableModel *source, gint row)
g_message ("calendar_model_append_row(): Could not add new object!");
}
- g_object_unref (comp);
+ gtk_object_unref (GTK_OBJECT (comp));
}
/* Duplicates a string value */
@@ -1460,7 +1487,7 @@ calendar_model_duplicate_value (ETableModel *etm, int col, const void *value)
CalComponent *comp;
comp = CAL_COMPONENT (value);
- g_object_ref (comp);
+ gtk_object_ref (GTK_OBJECT (comp));
return comp;
}
@@ -1516,7 +1543,7 @@ calendar_model_free_value (ETableModel *etm, int col, void *value)
case CAL_COMPONENT_FIELD_COMPONENT:
if (value)
- g_object_unref (value);
+ gtk_object_unref (GTK_OBJECT (value));
break;
default:
@@ -1670,7 +1697,7 @@ date_value_to_string (ETableModel *etm, const void *value)
e_time_format_date_and_time (&tmp_tm, priv->use_24_hour_format,
TRUE, FALSE,
buffer, sizeof (buffer));
- return g_locale_to_utf8 (buffer, -1, NULL, NULL, NULL);
+ return e_utf8_from_locale_string (buffer);
}
@@ -1698,17 +1725,17 @@ calendar_model_value_to_string (ETableModel *etm, int col, const void *value)
case CAL_COMPONENT_FIELD_ICON:
if (GPOINTER_TO_INT (value) == 0)
- return g_locale_to_utf8 (_("Normal"), -1, NULL, NULL, NULL);
+ return e_utf8_from_locale_string (_("Normal"));
else if (GPOINTER_TO_INT (value) == 1)
- return g_locale_to_utf8 (_("Recurring"), -1, NULL, NULL, NULL);
+ return e_utf8_from_locale_string (_("Recurring"));
else
- return g_locale_to_utf8 (_("Assigned"), -1, NULL, NULL, NULL);
+ return e_utf8_from_locale_string (_("Assigned"));
case CAL_COMPONENT_FIELD_HAS_ALARMS:
case CAL_COMPONENT_FIELD_COMPLETE:
case CAL_COMPONENT_FIELD_RECURRING:
case CAL_COMPONENT_FIELD_OVERDUE:
- return g_locale_to_utf8 (value ? _("Yes") : _("No"), -1, NULL, NULL, NULL);
+ return e_utf8_from_locale_string (value ? _("Yes") : _("No"));
case CAL_COMPONENT_FIELD_COLOR:
return NULL;
@@ -1741,7 +1768,7 @@ calendar_model_value_to_string (ETableModel *etm, int col, const void *value)
CalendarModel *
calendar_model_new (void)
{
- return CALENDAR_MODEL (g_object_new (TYPE_CALENDAR_MODEL, NULL));
+ return CALENDAR_MODEL (gtk_type_new (TYPE_CALENDAR_MODEL));
}
@@ -1964,9 +1991,8 @@ update_query (CalendarModel *model)
priv->query = NULL;
if (old_query) {
- g_signal_handlers_disconnect_matched (old_query, G_SIGNAL_MATCH_DATA,
- 0, 0, NULL, NULL, model);
- g_object_unref (old_query);
+ gtk_signal_disconnect_by_data (GTK_OBJECT (old_query), model);
+ gtk_object_unref (GTK_OBJECT (old_query));
}
g_assert (priv->sexp != NULL);
@@ -1982,14 +2008,14 @@ update_query (CalendarModel *model)
return;
}
- g_signal_connect (priv->query, "obj_updated",
- G_CALLBACK (query_obj_updated_cb), model);
- g_signal_connect (priv->query, "obj_removed",
- G_CALLBACK (query_obj_removed_cb), model);
- g_signal_connect (priv->query, "query_done",
- G_CALLBACK (query_query_done_cb), model);
- g_signal_connect (priv->query, "eval_error",
- G_CALLBACK (query_eval_error_cb), model);
+ gtk_signal_connect (GTK_OBJECT (priv->query), "obj_updated",
+ GTK_SIGNAL_FUNC (query_obj_updated_cb), model);
+ gtk_signal_connect (GTK_OBJECT (priv->query), "obj_removed",
+ GTK_SIGNAL_FUNC (query_obj_removed_cb), model);
+ gtk_signal_connect (GTK_OBJECT (priv->query), "query_done",
+ GTK_SIGNAL_FUNC (query_query_done_cb), model);
+ gtk_signal_connect (GTK_OBJECT (priv->query), "eval_error",
+ GTK_SIGNAL_FUNC (query_eval_error_cb), model);
}
/* Callback used when a calendar is opened into the server */
@@ -2061,7 +2087,7 @@ remove_object (CalendarModel *model, const char *uid)
calendar_model_free_object_data (model, object_data);
g_array_remove_index (priv->objects_data, *idx);
- g_object_unref (orig_comp);
+ gtk_object_unref (GTK_OBJECT (orig_comp));
n = *idx;
g_free (idx);
@@ -2085,7 +2111,7 @@ calendar_model_set_status_message (CalendarModel *model, const char *message)
if (!message || !*message) {
if (priv->activity) {
- g_object_unref (priv->activity);
+ gtk_object_unref (GTK_OBJECT (priv->activity));
priv->activity = NULL;
}
}
@@ -2094,7 +2120,7 @@ calendar_model_set_status_message (CalendarModel *model, const char *message)
char *client_id = g_strdup_printf ("%p", model);
if (progress_icon[0] == NULL)
- progress_icon[0] = gdk_pixbuf_new_from_file (EVOLUTION_IMAGESDIR "/" EVOLUTION_TASKS_PROGRESS_IMAGE, NULL);
+ progress_icon[0] = gdk_pixbuf_new_from_file (EVOLUTION_IMAGESDIR "/" EVOLUTION_TASKS_PROGRESS_IMAGE);
priv->activity = evolution_activity_client_new (
global_shell_client, client_id,
progress_icon, message, TRUE, &display);
@@ -2153,11 +2179,11 @@ calendar_model_set_cal_client (CalendarModel *model, CalClient *client, CalObjTy
return;
if (client)
- g_object_ref (client);
+ gtk_object_ref (GTK_OBJECT (client));
if (priv->client) {
- g_signal_handlers_disconnect_matched (priv->client, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, model);
- g_object_unref (priv->client);
+ gtk_signal_disconnect_by_data (GTK_OBJECT (priv->client), model);
+ gtk_object_unref (GTK_OBJECT (priv->client));
}
priv->client = client;
@@ -2167,7 +2193,8 @@ calendar_model_set_cal_client (CalendarModel *model, CalClient *client, CalObjTy
if (cal_client_get_load_state (priv->client) == CAL_CLIENT_LOAD_LOADED)
update_query (model);
else
- g_signal_connect (priv->client, "cal_opened", G_CALLBACK (cal_opened_cb), model);
+ gtk_signal_connect (GTK_OBJECT (priv->client), "cal_opened",
+ GTK_SIGNAL_FUNC (cal_opened_cb), model);
}
}
@@ -2276,7 +2303,7 @@ calendar_model_mark_task_complete (CalendarModel *model,
**/
CalComponent *
calendar_model_get_component (CalendarModel *model,
- gint row)
+ gint row)
{
CalendarModelPrivate *priv;
diff --git a/calendar/gui/calendar-offline-handler.c b/calendar/gui/calendar-offline-handler.c
index c5b742d614..f7e4615b2d 100644
--- a/calendar/gui/calendar-offline-handler.c
+++ b/calendar/gui/calendar-offline-handler.c
@@ -34,8 +34,8 @@
#include <cal-client/cal-client.h>
#include "calendar-offline-handler.h"
-#define PARENT_TYPE bonobo_object_get_type ()
-static BonoboObjectClass *parent_class = NULL;
+#define PARENT_TYPE bonobo_x_object_get_type ()
+static BonoboXObjectClass *parent_class = NULL;
struct _CalendarOfflineHandlerPrivate {
CalClient *client;
@@ -152,11 +152,12 @@ backend_cal_opened_offline (CalClient *client, CalClientOpenStatus status, gpoin
if (status != CAL_CLIENT_OPEN_SUCCESS) {
update_offline (offline_handler);
- g_object_unref (client);
+ gtk_object_unref (GTK_OBJECT (client));
return;
}
- g_signal_connect (client, "cal_set_mode", G_CALLBACK (backend_cal_set_mode), offline_handler);
+ gtk_signal_connect (GTK_OBJECT (client), "cal_set_mode",
+ backend_cal_set_mode, offline_handler);
cal_client_set_mode (client, CAL_MODE_LOCAL);
}
@@ -166,7 +167,7 @@ backend_cal_opened_online (CalClient *client, CalClientOpenStatus status, gpoint
CalendarOfflineHandler *offline_handler = data;
if (status != CAL_CLIENT_OPEN_SUCCESS) {
- g_object_unref (G_OBJECT (client));
+ gtk_object_unref (GTK_OBJECT (client));
return;
}
@@ -182,11 +183,12 @@ backend_go_offline (gpointer data, gpointer user_data)
gboolean success;
client = cal_client_new ();
- g_signal_connect (client, "cal_opened", G_CALLBACK (backend_cal_opened_offline), offline_handler);
+ gtk_signal_connect (GTK_OBJECT (client), "cal_opened",
+ backend_cal_opened_offline, offline_handler);
success = cal_client_open_calendar (client, uri, TRUE);
if (!success) {
update_offline (offline_handler);
- g_object_unref (client);
+ gtk_object_unref (GTK_OBJECT (client));
return;
}
}
@@ -200,11 +202,11 @@ backend_go_online (gpointer data, gpointer user_data)
gboolean success;
client = cal_client_new ();
- g_signal_connect (G_OBJECT (client), "cal_opened",
- G_CALLBACK (backend_cal_opened_online), offline_handler);
+ gtk_signal_connect (GTK_OBJECT (client), "cal_opened",
+ backend_cal_opened_online, offline_handler);
success = cal_client_open_calendar (client, uri, TRUE);
if (!success) {
- g_object_unref (G_OBJECT (client));
+ gtk_object_unref (GTK_OBJECT (client));
return;
}
}
@@ -245,10 +247,10 @@ impl_goOnline (PortableServer_Servant servant,
g_list_foreach (uris, backend_go_online, offline_handler);
}
-/* GObject methods. */
+/* GtkObject methods. */
static void
-impl_dispose (GObject *object)
+impl_destroy (GtkObject *object)
{
CalendarOfflineHandler *offline_handler;
CalendarOfflineHandlerPrivate *priv;
@@ -262,22 +264,12 @@ impl_dispose (GObject *object)
CORBA_exception_init (&ev);
CORBA_Object_release (priv->listener_interface, &ev);
CORBA_exception_free (&ev);
-
- priv->listener_interface = CORBA_OBJECT_NIL;
}
-}
-
-static void
-impl_finalize (GObject *object)
-{
- CalendarOfflineHandler *offline_handler;
- CalendarOfflineHandlerPrivate *priv;
-
- offline_handler = CALENDAR_OFFLINE_HANDLER (object);
- priv = offline_handler->priv;
-
g_free (priv);
+
+ if (GTK_OBJECT_CLASS (parent_class)->destroy != NULL)
+ (* GTK_OBJECT_CLASS (parent_class)->destroy) (object);
}
/* GTK+ type initialization. */
@@ -285,12 +277,11 @@ impl_finalize (GObject *object)
static void
calendar_offline_handler_class_init (CalendarOfflineHandlerClass *klass)
{
- GObjectClass *object_class;
+ GtkObjectClass *object_class;
POA_GNOME_Evolution_Offline__epv *epv;
- object_class = G_OBJECT_CLASS (klass);
- object_class->dispose = impl_dispose;
- object_class->finalize = impl_finalize;
+ object_class = GTK_OBJECT_CLASS (klass);
+ object_class->destroy = impl_destroy;
epv = & klass->epv;
epv->_get_isOffline = impl__get_isOffline;
@@ -319,9 +310,9 @@ calendar_offline_handler_new (void)
{
CalendarOfflineHandler *new;
- new = g_object_new (calendar_offline_handler_get_type (), NULL);
+ new = gtk_type_new (calendar_offline_handler_get_type ());
return new;
}
-BONOBO_TYPE_FUNC_FULL (CalendarOfflineHandler, GNOME_Evolution_Offline, PARENT_TYPE, calendar_offline_handler);
+BONOBO_X_TYPE_FUNC_FULL (CalendarOfflineHandler, GNOME_Evolution_Offline, PARENT_TYPE, calendar_offline_handler);
diff --git a/calendar/gui/comp-editor-factory.c b/calendar/gui/comp-editor-factory.c
index 6c40a0d644..cef7ce29c9 100644
--- a/calendar/gui/comp-editor-factory.c
+++ b/calendar/gui/comp-editor-factory.c
@@ -22,9 +22,10 @@
#include <config.h>
#endif
-#include <gtk/gtkmessagedialog.h>
#include <bonobo/bonobo-exception.h>
-#include <bonobo/bonobo-i18n.h>
+#include <libgnomeui/gnome-dialog.h>
+#include <libgnomeui/gnome-dialog-util.h>
+#include <libgnome/gnome-i18n.h>
#include <evolution-calendar.h>
#include <e-util/e-url.h>
#include <cal-client/cal-client.h>
@@ -91,7 +92,7 @@ struct CompEditorFactoryPrivate {
static void comp_editor_factory_class_init (CompEditorFactoryClass *class);
static void comp_editor_factory_init (CompEditorFactory *factory);
-static void comp_editor_factory_finalize (GObject *object);
+static void comp_editor_factory_destroy (GtkObject *object);
static void impl_editExisting (PortableServer_Servant servant,
const CORBA_char *str_uri,
@@ -102,29 +103,29 @@ static void impl_editNew (PortableServer_Servant servant,
const GNOME_Evolution_Calendar_CalObjType type,
CORBA_Environment *ev);
-static BonoboObjectClass *parent_class = NULL;
+static BonoboXObjectClass *parent_class = NULL;
-BONOBO_TYPE_FUNC_FULL (CompEditorFactory,
- GNOME_Evolution_Calendar_CompEditorFactory,
- BONOBO_OBJECT_TYPE,
- comp_editor_factory);
+BONOBO_X_TYPE_FUNC_FULL (CompEditorFactory,
+ GNOME_Evolution_Calendar_CompEditorFactory,
+ BONOBO_X_OBJECT_TYPE,
+ comp_editor_factory);
/* Class initialization function for the component editor factory */
static void
comp_editor_factory_class_init (CompEditorFactoryClass *class)
{
- GObjectClass *object_class;
+ GtkObjectClass *object_class;
- object_class = (GObjectClass *) class;
+ object_class = (GtkObjectClass *) class;
- parent_class = g_type_class_peek_parent (class);
+ parent_class = gtk_type_class (BONOBO_X_OBJECT_TYPE);
class->epv.editExisting = impl_editExisting;
class->epv.editNew = impl_editNew;
- object_class->finalize = comp_editor_factory_finalize;
+ object_class->destroy = comp_editor_factory_destroy;
}
/* Object initialization function for the component editor factory */
@@ -160,7 +161,7 @@ free_client (OpenClient *oc)
g_free (oc->uri);
oc->uri = NULL;
- g_object_unref (oc->client);
+ gtk_object_unref (GTK_OBJECT (oc->client));
oc->client = NULL;
for (l = oc->pending; l; l = l->next) {
@@ -187,7 +188,7 @@ free_client_cb (gpointer key, gpointer value, gpointer data)
/* Destroy handler for the component editor factory */
static void
-comp_editor_factory_finalize (GObject *object)
+comp_editor_factory_destroy (GtkObject *object)
{
CompEditorFactory *factory;
CompEditorFactoryPrivate *priv;
@@ -205,8 +206,8 @@ comp_editor_factory_finalize (GObject *object)
g_free (priv);
factory->priv = NULL;
- if (G_OBJECT_CLASS (parent_class)->finalize)
- (* G_OBJECT_CLASS (parent_class)->finalize) (object);
+ if (GTK_OBJECT_CLASS (parent_class)->destroy)
+ (* GTK_OBJECT_CLASS (parent_class)->destroy) (object);
}
@@ -283,7 +284,7 @@ edit_existing (OpenClient *oc, const char *uid)
default:
g_message ("edit_exiting(): Unsupported object type %d", (int) vtype);
- g_object_unref (comp);
+ gtk_object_unref (GTK_OBJECT (comp));
return;
}
@@ -292,7 +293,8 @@ edit_existing (OpenClient *oc, const char *uid)
comp_editor_focus (editor);
oc->editor_count++;
- g_signal_connect (editor, "destroy", G_CALLBACK (editor_destroy_cb), oc);
+ gtk_signal_connect (GTK_OBJECT (editor), "destroy",
+ GTK_SIGNAL_FUNC (editor_destroy_cb), oc);
e_comp_editor_registry_add (comp_editor_registry, editor, TRUE);
}
@@ -381,7 +383,8 @@ edit_new (OpenClient *oc, const GNOME_Evolution_Calendar_CompEditorFactory_CompE
comp_editor_focus (editor);
oc->editor_count++;
- g_signal_connect (editor, "destroy", G_CALLBACK (editor_destroy_cb), oc);
+ gtk_signal_connect (GTK_OBJECT (editor), "destroy",
+ GTK_SIGNAL_FUNC (editor_destroy_cb), oc);
e_comp_editor_registry_add (comp_editor_registry, editor, TRUE);
}
@@ -438,7 +441,6 @@ cal_opened_cb (CalClient *client, CalClientOpenStatus status, gpointer data)
OpenClient *oc;
CompEditorFactory *factory;
CompEditorFactoryPrivate *priv;
- GtkWidget *dialog = NULL;
oc = data;
factory = oc->factory;
@@ -451,9 +453,7 @@ cal_opened_cb (CalClient *client, CalClientOpenStatus status, gpointer data)
return;
case CAL_CLIENT_OPEN_ERROR:
- dialog = gtk_message_dialog_new (NULL, GTK_DIALOG_MODAL,
- GTK_MESSAGE_ERROR, GTK_BUTTONS_CLOSE,
- _("Error while opening the calendar"));
+ gnome_error_dialog (_("Error while opening the calendar"));
break;
case CAL_CLIENT_OPEN_NOT_FOUND:
@@ -462,25 +462,18 @@ cal_opened_cb (CalClient *client, CalClientOpenStatus status, gpointer data)
return;
case CAL_CLIENT_OPEN_METHOD_NOT_SUPPORTED:
- dialog = gtk_message_dialog_new (NULL, GTK_DIALOG_MODAL,
- GTK_MESSAGE_ERROR, GTK_BUTTONS_CLOSE,
- _("Method not supported when opening the calendar"));
+ gnome_error_dialog (_("Method not supported when opening the calendar"));
break;
case CAL_CLIENT_OPEN_PERMISSION_DENIED :
- dialog = gtk_message_dialog_new (NULL, GTK_DIALOG_MODAL,
- GTK_MESSAGE_ERROR, GTK_BUTTONS_CLOSE,
- _("Permission denied to open the calendar"));
+ gnome_error_dialog (_("Permission denied to open calendar"));
break;
-
+
default:
g_assert_not_reached ();
return;
}
- gtk_dialog_run (GTK_DIALOG (dialog));
- gtk_widget_destroy (dialog);
-
g_hash_table_remove (priv->uri_client_hash, oc->uri);
free_client (oc);
}
@@ -512,18 +505,19 @@ open_client (CompEditorFactory *factory, const char *uristr)
oc->pending = NULL;
oc->open = FALSE;
- g_signal_connect (oc->client, "cal_opened", G_CALLBACK (cal_opened_cb), oc);
-
- g_hash_table_insert (priv->uri_client_hash, oc->uri, oc);
+ gtk_signal_connect (GTK_OBJECT (oc->client), "cal_opened",
+ GTK_SIGNAL_FUNC (cal_opened_cb), oc);
if (!cal_client_open_calendar (oc->client, uristr, FALSE)) {
g_free (oc->uri);
- g_object_unref (oc->client);
+ gtk_object_unref (GTK_OBJECT (oc->client));
g_free (oc);
return NULL;
}
+ g_hash_table_insert (priv->uri_client_hash, oc->uri, oc);
+
return oc;
}
@@ -659,7 +653,7 @@ impl_editNew (PortableServer_Servant servant,
CompEditorFactory *
comp_editor_factory_new (void)
{
- return g_object_new (TYPE_COMP_EDITOR_FACTORY, NULL);
+ return gtk_type_new (TYPE_COMP_EDITOR_FACTORY);
}
diff --git a/calendar/gui/comp-util.c b/calendar/gui/comp-util.c
index fc3496be67..951fff204e 100644
--- a/calendar/gui/comp-util.c
+++ b/calendar/gui/comp-util.c
@@ -23,7 +23,6 @@
#include <config.h>
#endif
-#include <string.h>
#include "calendar-config.h"
#include "comp-util.h"
#include "dialogs/delete-comp.h"
@@ -230,7 +229,7 @@ cal_comp_is_on_server (CalComponent *comp, CalClient *client)
switch (status) {
case CAL_CLIENT_GET_SUCCESS:
- g_object_unref (server_comp);
+ gtk_object_unref (GTK_OBJECT (server_comp));
return TRUE;
case CAL_CLIENT_GET_SYNTAX_ERROR:
diff --git a/calendar/gui/dialogs/Makefile.am b/calendar/gui/dialogs/Makefile.am
index 53ea88a9dc..bcba6c22fe 100644
--- a/calendar/gui/dialogs/Makefile.am
+++ b/calendar/gui/dialogs/Makefile.am
@@ -1,12 +1,13 @@
IDLS = $(top_srcdir)/addressbook/gui/component/select-names/Evolution-Addressbook-SelectNames.idl
-IDL_GENERATED_H = \
- Evolution-Addressbook-SelectNames.h
-IDL_GENERATED = $(IDL_GENERATED_H)
+IDL_GENERATED = \
+ Evolution-Addressbook-SelectNames.h \
+ Evolution-Addressbook-SelectNames-common.c \
+ Evolution-Addressbook-SelectNames-skels.c \
+ Evolution-Addressbook-SelectNames-stubs.c
-$(IDL_GENERATED_H): $(IDLS)
- $(ORBIT_IDL) -I $(srcdir) $(IDL_INCLUDES) \
- --nostubs --noskels --nocommon \
+$(IDL_GENERATED): $(IDLS)
+ $(ORBIT_IDL) -I $(srcdir) -I $(datadir)/idl `$(GNOME_CONFIG) --cflags idl` \
$(top_srcdir)/addressbook/gui/component/select-names/Evolution-Addressbook-SelectNames.idl
BUILT_SOURCES = $(IDL_GENERATED)
@@ -23,16 +24,17 @@ INCLUDES = \
-I$(top_srcdir)/shell \
-I$(top_srcdir)/addressbook/backend \
-I$(top_builddir)/addressbook/backend \
+ -I$(includedir) \
-DEVOLUTION_DATADIR=\""$(datadir)"\" \
-DEVOLUTION_GLADEDIR=\""$(gladedir)"\" \
- -DEVOLUTION_IMAGESDIR=\""$(imagesdir)"\" \
+ -DEVOLUTION_ICONSDIR=\""$(iconsdir)"\" \
-DEVOLUTION_ETSPECDIR=\""$(etspecdir)"\" \
- -DEVOLUTION_UIDIR=\""$(evolutionuidir)"\" \
+ -DGNOMELOCALEDIR=\""$(localedir)"\" \
$(EVOLUTION_CALENDAR_CFLAGS)
-noinst_LTLIBRARIES = libcal-dialogs.la
+noinst_LIBRARIES = libcal-dialogs.a
-libcal_dialogs_la_SOURCES = \
+libcal_dialogs_a_SOURCES = \
$(IDL_GENERATED) \
alarm-options.c \
alarm-options.h \
@@ -77,6 +79,9 @@ libcal_dialogs_la_SOURCES = \
task-page.c \
task-page.h
+iconsdir = $(datadir)/images/evolution
+
+gladedir = $(datadir)/evolution/glade
glade_DATA = \
alarm-options.glade \
alarm-page.glade \
@@ -89,6 +94,7 @@ glade_DATA = \
task-details-page.glade \
task-page.glade
+etspecdir = $(datadir)/evolution/etspec/
etspec_DATA = meeting-page.etspec
CLEANFILES = $(BUILT_SOURCES)
diff --git a/calendar/gui/dialogs/alarm-options.c b/calendar/gui/dialogs/alarm-options.c
index 2261bb0bd7..cf64bff9a8 100644
--- a/calendar/gui/dialogs/alarm-options.c
+++ b/calendar/gui/dialogs/alarm-options.c
@@ -24,12 +24,14 @@
#include <string.h>
#include <glib.h>
+#include <libgnome/gnome-defs.h>
#include <libgnome/gnome-i18n.h>
#include <gtk/gtkmain.h>
#include <gtk/gtkcheckbutton.h>
#include <gtk/gtksignal.h>
#include <gtk/gtkwindow.h>
#include <gtk/gtkhbox.h>
+#include <liboaf/liboaf.h>
#include <bonobo/bonobo-control.h>
#include <bonobo/bonobo-exception.h>
#include <bonobo/bonobo-widget.h>
@@ -166,7 +168,7 @@ setup_select_names (Dialog *dialog)
CORBA_exception_init (&ev);
- dialog->corba_select_names = bonobo_activation_activate_from_id (SELECT_NAMES_OAFID, 0, NULL, &ev);
+ dialog->corba_select_names = oaf_activate_from_id (SELECT_NAMES_OAFID, 0, NULL, &ev);
if (BONOBO_EX (&ev))
return FALSE;
@@ -256,19 +258,19 @@ init_widgets (Dialog *dialog)
dialog->canceled = TRUE;
- g_signal_connect((dialog->toplevel), "delete_event",
- G_CALLBACK (toplevel_delete_event_cb), dialog);
+ gtk_signal_connect (GTK_OBJECT (dialog->toplevel), "delete_event",
+ GTK_SIGNAL_FUNC (toplevel_delete_event_cb), dialog);
- g_signal_connect((dialog->button_ok), "clicked",
- G_CALLBACK (button_ok_clicked_cb), dialog);
+ gtk_signal_connect (GTK_OBJECT (dialog->button_ok), "clicked",
+ GTK_SIGNAL_FUNC (button_ok_clicked_cb), dialog);
- g_signal_connect((dialog->button_cancel), "clicked",
- G_CALLBACK (button_cancel_clicked_cb), dialog);
+ gtk_signal_connect (GTK_OBJECT (dialog->button_cancel), "clicked",
+ GTK_SIGNAL_FUNC (button_cancel_clicked_cb), dialog);
/* Alarm repeat */
- g_signal_connect((dialog->repeat_toggle), "toggled",
- G_CALLBACK (repeat_toggle_toggled_cb), dialog);
+ gtk_signal_connect (GTK_OBJECT (dialog->repeat_toggle), "toggled",
+ GTK_SIGNAL_FUNC (repeat_toggle_toggled_cb), dialog);
}
/* Fills the audio alarm widgets with the values from the alarm component */
@@ -350,7 +352,7 @@ alarm_to_malarm_widgets (Dialog *dialog, CalComponentAlarm *alarm)
"destinations", e_destination_exportv (destv), NULL);
for (i = 0; i < len; i++)
- g_object_unref (GTK_OBJECT (destv[i]));
+ gtk_object_unref (GTK_OBJECT (destv[i]));
g_free (destv);
cal_component_free_attendee_list (attendee_list);
@@ -616,7 +618,7 @@ malarm_widgets_to_alarm (Dialog *dialog, CalComponentAlarm *alarm)
/* Attendees */
bonobo_widget_get_property (BONOBO_WIDGET (dialog->malarm_addresses), "destinations",
- TC_CORBA_string, &str, NULL);
+ &str, NULL);
destv = e_destination_importv (str);
g_free (str);
@@ -761,23 +763,23 @@ alarm_options_dialog_run (CalComponentAlarm *alarm, const char *email, gboolean
g_return_val_if_fail (alarm != NULL, FALSE);
- dialog.repeat = repeat;
- dialog.email = email;
- dialog.xml = glade_xml_new (EVOLUTION_GLADEDIR "/alarm-options.glade", NULL, NULL);
+ dialog.repeat = repeat;
+ dialog.email = email;
+ dialog.xml = glade_xml_new (EVOLUTION_GLADEDIR "/alarm-options.glade", NULL);
if (!dialog.xml) {
g_message ("alarm_options_dialog_new(): Could not load the Glade XML file!");
return FALSE;
}
if (!get_widgets (&dialog)) {
- g_object_unref(dialog.xml);
+ gtk_object_unref (GTK_OBJECT (dialog.xml));
return FALSE;
}
-
+
if (!setup_select_names (&dialog)) {
- g_object_unref (dialog.xml);
- return FALSE;
- }
+ gtk_object_unref (GTK_OBJECT (dialog.xml));
+ return FALSE;
+ }
init_widgets (&dialog);
@@ -790,7 +792,7 @@ alarm_options_dialog_run (CalComponentAlarm *alarm, const char *email, gboolean
dialog_to_alarm (&dialog, alarm);
gtk_widget_destroy (dialog.toplevel);
- g_object_unref(dialog.xml);
+ gtk_object_unref (GTK_OBJECT (dialog.xml));
return TRUE;
}
diff --git a/calendar/gui/dialogs/alarm-options.glade b/calendar/gui/dialogs/alarm-options.glade
index 83f0af1f80..ef36167157 100644
--- a/calendar/gui/dialogs/alarm-options.glade
+++ b/calendar/gui/dialogs/alarm-options.glade
@@ -1,556 +1,463 @@
-<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*-->
-<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd">
-
-<glade-interface>
-<requires lib="gnome"/>
-
-<widget class="GtkWindow" id="alarm-options-toplevel">
- <property name="title" translatable="yes"></property>
- <property name="type">GTK_WINDOW_TOPLEVEL</property>
- <property name="window_position">GTK_WIN_POS_NONE</property>
- <property name="modal">True</property>
- <property name="resizable">True</property>
- <property name="destroy_with_parent">False</property>
-
- <child>
- <widget class="GtkVBox" id="vbox1">
- <property name="border_width">4</property>
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">4</property>
-
+<?xml version="1.0"?>
+<GTK-Interface>
+
+<project>
+ <name>Dialogs</name>
+ <program_name>dialogs</program_name>
+ <directory></directory>
+ <source_directory>src</source_directory>
+ <pixmaps_directory>pixmaps</pixmaps_directory>
+ <language>C</language>
+ <gnome_support>True</gnome_support>
+ <gettext_support>True</gettext_support>
+</project>
+
+<widget>
+ <class>GtkWindow</class>
+ <name>alarm-options-toplevel</name>
+ <visible>False</visible>
+ <title></title>
+ <type>GTK_WINDOW_DIALOG</type>
+ <position>GTK_WIN_POS_NONE</position>
+ <modal>True</modal>
+ <allow_shrink>False</allow_shrink>
+ <allow_grow>True</allow_grow>
+ <auto_shrink>True</auto_shrink>
+
+ <widget>
+ <class>GtkVBox</class>
+ <name>vbox1</name>
+ <border_width>4</border_width>
+ <homogeneous>False</homogeneous>
+ <spacing>4</spacing>
+
+ <widget>
+ <class>GtkFrame</class>
+ <name>frame1</name>
+ <label>Alarm Repeat</label>
+ <label_xalign>0</label_xalign>
+ <shadow_type>GTK_SHADOW_ETCHED_IN</shadow_type>
<child>
- <widget class="GtkFrame" id="frame1">
- <property name="visible">True</property>
- <property name="label_xalign">0</property>
- <property name="label_yalign">0.5</property>
- <property name="shadow_type">GTK_SHADOW_ETCHED_IN</property>
-
- <child>
- <widget class="GtkHBox" id="hbox1">
- <property name="border_width">4</property>
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">4</property>
-
- <child>
- <widget class="GtkCheckButton" id="repeat-toggle">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="has_focus">True</property>
- <property name="label" translatable="yes">Repeat the alarm</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="active">False</property>
- <property name="inconsistent">False</property>
- <property name="draw_indicator">True</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkHBox" id="repeat-group">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">4</property>
-
- <child>
- <widget class="GtkSpinButton" id="repeat-quantity">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="climb_rate">1</property>
- <property name="digits">0</property>
- <property name="numeric">False</property>
- <property name="update_policy">GTK_UPDATE_ALWAYS</property>
- <property name="snap_to_ticks">False</property>
- <property name="wrap">False</property>
- <property name="adjustment">1 1 999 1 10 10</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label1">
- <property name="visible">True</property>
- <property name="label" translatable="yes">extra times every</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkSpinButton" id="repeat-value">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="climb_rate">1</property>
- <property name="digits">0</property>
- <property name="numeric">False</property>
- <property name="update_policy">GTK_UPDATE_ALWAYS</property>
- <property name="snap_to_ticks">False</property>
- <property name="wrap">False</property>
- <property name="adjustment">1 0 999 1 10 10</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkOptionMenu" id="repeat-unit">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="history">0</property>
-
- <child internal-child="menu">
- <widget class="GtkMenu" id="convertwidget1">
- <property name="visible">True</property>
-
- <child>
- <widget class="GtkMenuItem" id="convertwidget2">
- <property name="visible">True</property>
- <property name="label" translatable="yes">minutes</property>
- <property name="use_underline">True</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkMenuItem" id="convertwidget3">
- <property name="visible">True</property>
- <property name="label" translatable="yes">hours</property>
- <property name="use_underline">True</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkMenuItem" id="convertwidget4">
- <property name="visible">True</property>
- <property name="label" translatable="yes">days</property>
- <property name="use_underline">True</property>
- </widget>
- </child>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
- </widget>
- </child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
+ </child>
+ <widget>
+ <class>GtkHBox</class>
+ <name>hbox1</name>
+ <border_width>4</border_width>
+ <homogeneous>False</homogeneous>
+ <spacing>4</spacing>
+
+ <widget>
+ <class>GtkCheckButton</class>
+ <name>repeat-toggle</name>
+ <can_focus>True</can_focus>
+ <has_focus>True</has_focus>
+ <label>Repeat the alarm</label>
+ <active>False</active>
+ <draw_indicator>True</draw_indicator>
<child>
- <widget class="GtkLabel" id="label1">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Alarm Repeat</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="type">label_item</property>
- </packing>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
</child>
</widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkVBox" id="dalarm-group">
- <property name="homogeneous">False</property>
- <property name="spacing">4</property>
+ <widget>
+ <class>GtkHBox</class>
+ <name>repeat-group</name>
+ <homogeneous>False</homogeneous>
+ <spacing>4</spacing>
<child>
- <widget class="GtkLabel" id="label2">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Message to Display</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
</child>
- <child>
- <widget class="GtkScrolledWindow" id="scrolledwindow1">
- <property name="visible">True</property>
- <property name="hscrollbar_policy">GTK_POLICY_NEVER</property>
- <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
- <property name="shadow_type">GTK_SHADOW_IN</property>
- <property name="window_placement">GTK_CORNER_TOP_LEFT</property>
-
- <child>
- <widget class="GtkTextView" id="dalarm-description">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="editable">True</property>
- <property name="justification">GTK_JUSTIFY_LEFT</property>
- <property name="wrap_mode">GTK_WRAP_WORD</property>
- <property name="cursor_visible">True</property>
- <property name="pixels_above_lines">0</property>
- <property name="pixels_below_lines">0</property>
- <property name="pixels_inside_wrap">0</property>
- <property name="left_margin">0</property>
- <property name="right_margin">0</property>
- <property name="indent">0</property>
- <property name="text" translatable="yes"></property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
+ <widget>
+ <class>GtkSpinButton</class>
+ <name>repeat-quantity</name>
+ <can_focus>True</can_focus>
+ <climb_rate>1</climb_rate>
+ <digits>0</digits>
+ <numeric>False</numeric>
+ <update_policy>GTK_UPDATE_ALWAYS</update_policy>
+ <snap>False</snap>
+ <wrap>False</wrap>
+ <value>1</value>
+ <lower>1</lower>
+ <upper>999</upper>
+ <step>1</step>
+ <page>10</page>
+ <page_size>10</page_size>
+ <child>
+ <padding>0</padding>
+ <expand>True</expand>
+ <fill>True</fill>
+ </child>
+ </widget>
+
+ <widget>
+ <class>GtkLabel</class>
+ <name>label1</name>
+ <label>extra times every</label>
+ <justify>GTK_JUSTIFY_CENTER</justify>
+ <wrap>False</wrap>
+ <xalign>0.5</xalign>
+ <yalign>0.5</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
+ </child>
+ </widget>
+
+ <widget>
+ <class>GtkSpinButton</class>
+ <name>repeat-value</name>
+ <can_focus>True</can_focus>
+ <climb_rate>1</climb_rate>
+ <digits>0</digits>
+ <numeric>False</numeric>
+ <update_policy>GTK_UPDATE_ALWAYS</update_policy>
+ <snap>False</snap>
+ <wrap>False</wrap>
+ <value>1</value>
+ <lower>0</lower>
+ <upper>999</upper>
+ <step>1</step>
+ <page>10</page>
+ <page_size>10</page_size>
+ <child>
+ <padding>0</padding>
+ <expand>True</expand>
+ <fill>True</fill>
+ </child>
+ </widget>
+
+ <widget>
+ <class>GtkOptionMenu</class>
+ <name>repeat-unit</name>
+ <can_focus>True</can_focus>
+ <items>minutes
+hours
+days
+</items>
+ <initial_choice>0</initial_choice>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
+ </child>
+ </widget>
</widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
+ </widget>
+ </widget>
+ <widget>
+ <class>GtkVBox</class>
+ <name>dalarm-group</name>
+ <visible>False</visible>
+ <homogeneous>False</homogeneous>
+ <spacing>4</spacing>
<child>
- <widget class="GtkHBox" id="aalarm-group">
- <property name="homogeneous">False</property>
- <property name="spacing">4</property>
-
- <child>
- <widget class="GtkLabel" id="label3">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Play sound:</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
+ <padding>0</padding>
+ <expand>True</expand>
+ <fill>True</fill>
+ </child>
- <child>
- <widget class="GnomeFileEntry" id="file-entry1">
- <property name="visible">True</property>
- <property name="max_saved">10</property>
- <property name="directory_entry">False</property>
- <property name="modal">False</property>
-
- <child internal-child="entry">
- <widget class="GtkEntry" id="aalarm-attach">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="editable">True</property>
- <property name="visibility">True</property>
- <property name="max_length">0</property>
- <property name="text" translatable="yes"></property>
- <property name="has_frame">True</property>
- <property name="invisible_char" translatable="yes">*</property>
- <property name="activates_default">False</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
+ <widget>
+ <class>GtkLabel</class>
+ <name>label2</name>
+ <label>Message to Display</label>
+ <justify>GTK_JUSTIFY_CENTER</justify>
+ <wrap>False</wrap>
+ <xalign>0</xalign>
+ <yalign>0.5</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
+ </child>
+ </widget>
+
+ <widget>
+ <class>GtkScrolledWindow</class>
+ <name>scrolledwindow1</name>
+ <hscrollbar_policy>GTK_POLICY_NEVER</hscrollbar_policy>
+ <vscrollbar_policy>GTK_POLICY_AUTOMATIC</vscrollbar_policy>
+ <hupdate_policy>GTK_UPDATE_CONTINUOUS</hupdate_policy>
+ <vupdate_policy>GTK_UPDATE_CONTINUOUS</vupdate_policy>
+ <child>
+ <padding>0</padding>
+ <expand>True</expand>
+ <fill>True</fill>
+ </child>
+
+ <widget>
+ <class>GtkText</class>
+ <name>dalarm-description</name>
+ <can_focus>True</can_focus>
+ <editable>True</editable>
+ <text></text>
</widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
+ </widget>
+ </widget>
+ <widget>
+ <class>GtkHBox</class>
+ <name>aalarm-group</name>
+ <visible>False</visible>
+ <homogeneous>False</homogeneous>
+ <spacing>4</spacing>
<child>
- <widget class="GtkVBox" id="malarm-group">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">4</property>
-
- <child>
- <widget class="GtkHBox" id="malarm-address-group">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">4</property>
-
- <child>
- <widget class="GtkButton" id="malarm-addressbook">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">Send To:</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <placeholder/>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label7">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Message to Send</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
+ </child>
- <child>
- <widget class="GtkScrolledWindow" id="scrolledwindow2">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="hscrollbar_policy">GTK_POLICY_NEVER</property>
- <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
- <property name="shadow_type">GTK_SHADOW_NONE</property>
- <property name="window_placement">GTK_CORNER_TOP_LEFT</property>
-
- <child>
- <widget class="GtkTextView" id="malarm-description">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="editable">True</property>
- <property name="justification">GTK_JUSTIFY_LEFT</property>
- <property name="wrap_mode">GTK_WRAP_WORD</property>
- <property name="cursor_visible">True</property>
- <property name="pixels_above_lines">0</property>
- <property name="pixels_below_lines">0</property>
- <property name="pixels_inside_wrap">0</property>
- <property name="left_margin">0</property>
- <property name="right_margin">0</property>
- <property name="indent">0</property>
- <property name="text" translatable="yes"></property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
+ <widget>
+ <class>GtkLabel</class>
+ <name>label3</name>
+ <label>Play sound:</label>
+ <justify>GTK_JUSTIFY_CENTER</justify>
+ <wrap>False</wrap>
+ <xalign>0.5</xalign>
+ <yalign>0.5</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
+ </child>
+ </widget>
+
+ <widget>
+ <class>GnomeFileEntry</class>
+ <name>file-entry1</name>
+ <max_saved>10</max_saved>
+ <directory>False</directory>
+ <modal>False</modal>
+ <child>
+ <padding>0</padding>
+ <expand>True</expand>
+ <fill>True</fill>
+ </child>
+
+ <widget>
+ <class>GtkEntry</class>
+ <child_name>GnomeEntry:entry</child_name>
+ <name>aalarm-attach</name>
+ <can_focus>True</can_focus>
+ <editable>True</editable>
+ <text_visible>True</text_visible>
+ <text_max_length>0</text_max_length>
+ <text></text>
</widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
+ </widget>
+ </widget>
+ <widget>
+ <class>GtkVBox</class>
+ <name>malarm-group</name>
+ <homogeneous>False</homogeneous>
+ <spacing>4</spacing>
<child>
- <widget class="GtkHBox" id="palarm-group">
- <property name="homogeneous">False</property>
- <property name="spacing">4</property>
-
- <child>
- <widget class="GtkLabel" id="label5">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Run program:</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkEntry" id="palarm-program">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="editable">True</property>
- <property name="visibility">True</property>
- <property name="max_length">0</property>
- <property name="text" translatable="yes"></property>
- <property name="has_frame">True</property>
- <property name="invisible_char" translatable="yes">*</property>
- <property name="activates_default">False</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
+ </child>
+ <widget>
+ <class>GtkScrolledWindow</class>
+ <name>scrolledwindow2</name>
+ <hscrollbar_policy>GTK_POLICY_NEVER</hscrollbar_policy>
+ <vscrollbar_policy>GTK_POLICY_AUTOMATIC</vscrollbar_policy>
+ <hupdate_policy>GTK_UPDATE_CONTINUOUS</hupdate_policy>
+ <vupdate_policy>GTK_UPDATE_CONTINUOUS</vupdate_policy>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
+ <pack>GTK_PACK_END</pack>
+ </child>
+
+ <widget>
+ <class>GtkText</class>
+ <name>malarm-description</name>
+ <can_focus>True</can_focus>
+ <editable>True</editable>
+ <text></text>
+ </widget>
+ </widget>
+
+ <widget>
+ <class>GtkLabel</class>
+ <name>label7</name>
+ <label>Message to Send</label>
+ <justify>GTK_JUSTIFY_CENTER</justify>
+ <wrap>False</wrap>
+ <xalign>0</xalign>
+ <yalign>0.5</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
+ <pack>GTK_PACK_END</pack>
+ </child>
+ </widget>
+
+ <widget>
+ <class>GtkHBox</class>
+ <name>malarm-address-group</name>
+ <homogeneous>False</homogeneous>
+ <spacing>4</spacing>
+ <child>
+ <padding>0</padding>
+ <expand>True</expand>
+ <fill>True</fill>
+ </child>
+
+ <widget>
+ <class>GtkButton</class>
+ <name>malarm-addressbook</name>
+ <can_focus>True</can_focus>
+ <label>Send To:</label>
+ <relief>GTK_RELIEF_NORMAL</relief>
<child>
- <widget class="GtkLabel" id="label6">
- <property name="visible">True</property>
- <property name="label" translatable="yes">With these arguments:</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
</child>
+ </widget>
- <child>
- <widget class="GtkEntry" id="palarm-args">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="editable">True</property>
- <property name="visibility">True</property>
- <property name="max_length">0</property>
- <property name="text" translatable="yes"></property>
- <property name="has_frame">True</property>
- <property name="invisible_char" translatable="yes">*</property>
- <property name="activates_default">False</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
+ <widget>
+ <class>Placeholder</class>
</widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
+ </widget>
+ </widget>
+ <widget>
+ <class>GtkHBox</class>
+ <name>palarm-group</name>
+ <visible>False</visible>
+ <homogeneous>False</homogeneous>
+ <spacing>4</spacing>
<child>
- <widget class="GtkHButtonBox" id="hbuttonbox1">
- <property name="visible">True</property>
- <property name="layout_style">GTK_BUTTONBOX_END</property>
- <property name="spacing">30</property>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
+ </child>
- <child>
- <widget class="GtkButton" id="button-ok">
- <property name="visible">True</property>
- <property name="can_default">True</property>
- <property name="has_default">True</property>
- <property name="can_focus">True</property>
- <property name="label">gtk-ok</property>
- <property name="use_stock">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- </widget>
- </child>
+ <widget>
+ <class>GtkLabel</class>
+ <name>label5</name>
+ <label>Run program:</label>
+ <justify>GTK_JUSTIFY_CENTER</justify>
+ <wrap>False</wrap>
+ <xalign>0.5</xalign>
+ <yalign>0.5</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
+ </child>
+ </widget>
+
+ <widget>
+ <class>GtkEntry</class>
+ <name>palarm-program</name>
+ <can_focus>True</can_focus>
+ <editable>True</editable>
+ <text_visible>True</text_visible>
+ <text_max_length>0</text_max_length>
+ <text></text>
+ <child>
+ <padding>0</padding>
+ <expand>True</expand>
+ <fill>True</fill>
+ </child>
+ </widget>
+
+ <widget>
+ <class>GtkLabel</class>
+ <name>label6</name>
+ <label>With these arguments:</label>
+ <justify>GTK_JUSTIFY_CENTER</justify>
+ <wrap>False</wrap>
+ <xalign>0.5</xalign>
+ <yalign>0.5</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
+ </child>
+ </widget>
+
+ <widget>
+ <class>GtkEntry</class>
+ <name>palarm-args</name>
+ <can_focus>True</can_focus>
+ <editable>True</editable>
+ <text_visible>True</text_visible>
+ <text_max_length>0</text_max_length>
+ <text></text>
+ <child>
+ <padding>0</padding>
+ <expand>True</expand>
+ <fill>True</fill>
+ </child>
+ </widget>
+ </widget>
- <child>
- <widget class="GtkButton" id="button-cancel">
- <property name="visible">True</property>
- <property name="can_default">True</property>
- <property name="can_focus">True</property>
- <property name="label">gtk-cancel</property>
- <property name="use_stock">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
+ <widget>
+ <class>GtkHButtonBox</class>
+ <name>hbuttonbox1</name>
+ <layout_style>GTK_BUTTONBOX_END</layout_style>
+ <spacing>30</spacing>
+ <child_min_width>85</child_min_width>
+ <child_min_height>27</child_min_height>
+ <child_ipad_x>7</child_ipad_x>
+ <child_ipad_y>0</child_ipad_y>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
</child>
+
+ <widget>
+ <class>GtkButton</class>
+ <name>button-ok</name>
+ <can_default>True</can_default>
+ <has_default>True</has_default>
+ <can_focus>True</can_focus>
+ <stock_button>GNOME_STOCK_BUTTON_OK</stock_button>
+ <relief>GTK_RELIEF_NORMAL</relief>
+ </widget>
+
+ <widget>
+ <class>GtkButton</class>
+ <name>button-cancel</name>
+ <can_default>True</can_default>
+ <can_focus>True</can_focus>
+ <stock_button>GNOME_STOCK_BUTTON_CANCEL</stock_button>
+ <relief>GTK_RELIEF_NORMAL</relief>
+ </widget>
</widget>
- </child>
+ </widget>
</widget>
-</glade-interface>
+</GTK-Interface>
diff --git a/calendar/gui/dialogs/alarm-page.c b/calendar/gui/dialogs/alarm-page.c
index 2008881ff3..78322eaf52 100644
--- a/calendar/gui/dialogs/alarm-page.c
+++ b/calendar/gui/dialogs/alarm-page.c
@@ -1,14 +1,12 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
/* Evolution calendar - Alarm page of the calendar component dialogs
*
- * Copyright (C) 2001-2003 Ximian, Inc.
+ * Copyright (C) 2001 Ximian, Inc.
*
* Authors: Federico Mena-Quintero <federico@ximian.com>
* Miguel de Icaza <miguel@ximian.com>
* Seth Alves <alves@hungry.com>
* JP Rosevear <jpr@ximian.com>
- * Hans Petter Jansson <hpj@ximian.com>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of version 2 of the GNU General Public
@@ -29,11 +27,8 @@
#endif
#include <string.h>
-#include <gtk/gtkcellrenderertext.h>
#include <gtk/gtksignal.h>
-#include <gtk/gtktreeview.h>
-#include <gtk/gtktreeselection.h>
-#include <gtk/gtkoptionmenu.h>
+#include <libgnome/gnome-defs.h>
#include <libgnome/gnome-i18n.h>
#include <glade/glade.h>
#include <gal/widgets/e-unicode.h>
@@ -44,7 +39,6 @@
#include "../calendar-config.h"
#include "comp-editor-util.h"
#include "alarm-options.h"
-#include "../e-alarm-list.h"
#include "alarm-page.h"
@@ -76,9 +70,6 @@ struct _AlarmPagePrivate {
/* Alarm options dialog and the alarm we maintain */
CalComponentAlarm *alarm;
- /* Alarm store for the GtkTreeView list widget */
- EAlarmList *list_store;
-
gboolean updating;
};
@@ -134,7 +125,7 @@ static const int time_map[] = {
static void alarm_page_class_init (AlarmPageClass *class);
static void alarm_page_init (AlarmPage *apage);
-static void alarm_page_finalize (GObject *object);
+static void alarm_page_destroy (GtkObject *object);
static GtkWidget *alarm_page_get_widget (CompEditorPage *page);
static void alarm_page_focus_main_widget (CompEditorPage *page);
@@ -155,21 +146,41 @@ static CompEditorPageClass *parent_class = NULL;
*
* Return value: The type ID of the #AlarmPage class.
**/
+GtkType
+alarm_page_get_type (void)
+{
+ static GtkType alarm_page_type;
+
+ if (!alarm_page_type) {
+ static const GtkTypeInfo alarm_page_info = {
+ "AlarmPage",
+ sizeof (AlarmPage),
+ sizeof (AlarmPageClass),
+ (GtkClassInitFunc) alarm_page_class_init,
+ (GtkObjectInitFunc) alarm_page_init,
+ NULL, /* reserved_1 */
+ NULL, /* reserved_2 */
+ (GtkClassInitFunc) NULL
+ };
+
+ alarm_page_type = gtk_type_unique (TYPE_COMP_EDITOR_PAGE,
+ &alarm_page_info);
+ }
-E_MAKE_TYPE (alarm_page, "AlarmPage", AlarmPage, alarm_page_class_init,
- alarm_page_init, TYPE_COMP_EDITOR_PAGE);
+ return alarm_page_type;
+}
/* Class initialization function for the alarm page */
static void
alarm_page_class_init (AlarmPageClass *class)
{
CompEditorPageClass *editor_page_class;
- GObjectClass *gobject_class;
+ GtkObjectClass *object_class;
editor_page_class = (CompEditorPageClass *) class;
- gobject_class = (GObjectClass *) class;
+ object_class = (GtkObjectClass *) class;
- parent_class = g_type_class_ref (TYPE_COMP_EDITOR_PAGE);
+ parent_class = gtk_type_class (TYPE_COMP_EDITOR_PAGE);
editor_page_class->get_widget = alarm_page_get_widget;
editor_page_class->focus_main_widget = alarm_page_focus_main_widget;
@@ -178,7 +189,7 @@ alarm_page_class_init (AlarmPageClass *class)
editor_page_class->set_summary = alarm_page_set_summary;
editor_page_class->set_dates = alarm_page_set_dates;
- gobject_class->finalize = alarm_page_finalize;
+ object_class->destroy = alarm_page_destroy;
}
/* Object initialization function for the alarm page */
@@ -209,7 +220,7 @@ alarm_page_init (AlarmPage *apage)
/* create the default alarm, which will contain the
* X-EVOLUTION-NEEDS-DESCRIPTION property, so that we
- * set a correct description if none is set */
+ * set a correct description if none is ser */
priv->alarm = cal_component_alarm_new ();
icalcomp = cal_component_alarm_get_icalcomponent (priv->alarm);
@@ -222,7 +233,7 @@ alarm_page_init (AlarmPage *apage)
/* Destroy handler for the alarm page */
static void
-alarm_page_finalize (GObject *object)
+alarm_page_destroy (GtkObject *object)
{
AlarmPage *apage;
AlarmPagePrivate *priv;
@@ -234,7 +245,7 @@ alarm_page_finalize (GObject *object)
priv = apage->priv;
if (priv->xml) {
- g_object_unref (priv->xml);
+ gtk_object_unref (GTK_OBJECT (priv->xml));
priv->xml = NULL;
}
@@ -243,16 +254,11 @@ alarm_page_finalize (GObject *object)
priv->alarm = NULL;
}
- if (priv->list_store) {
- g_object_unref (priv->list_store);
- priv->list_store = NULL;
- }
-
g_free (priv);
apage->priv = NULL;
- if (G_OBJECT_CLASS (parent_class)->finalize)
- (* G_OBJECT_CLASS (parent_class)->finalize) (object);
+ if (GTK_OBJECT_CLASS (parent_class)->destroy)
+ (* GTK_OBJECT_CLASS (parent_class)->destroy) (object);
}
@@ -305,7 +311,174 @@ clear_widgets (AlarmPage *apage)
e_dialog_option_menu_set (priv->time, CAL_ALARM_TRIGGER_RELATIVE_START, time_map);
/* List data */
- e_alarm_list_clear (priv->list_store);
+ gtk_clist_clear (GTK_CLIST (priv->list));
+}
+
+/* Builds a string for the duration of the alarm. If the duration is zero, returns NULL. */
+static char *
+get_alarm_duration_string (struct icaldurationtype *duration)
+{
+ GString *string = g_string_new (NULL);
+ char *ret;
+ gboolean have_something;
+
+ have_something = FALSE;
+
+ if (duration->days > 1) {
+ g_string_sprintf (string, _("%d days"), duration->days);
+ have_something = TRUE;
+ } else if (duration->days == 1) {
+ g_string_append (string, _("1 day"));
+ have_something = TRUE;
+ }
+
+ if (duration->weeks > 1) {
+ g_string_sprintf (string, _("%d weeks"), duration->weeks);
+ have_something = TRUE;
+ } else if (duration->weeks == 1) {
+ g_string_append (string, _("1 week"));
+ have_something = TRUE;
+ }
+
+ if (duration->hours > 1) {
+ g_string_sprintf (string, _("%d hours"), duration->hours);
+ have_something = TRUE;
+ } else if (duration->hours == 1) {
+ g_string_append (string, _("1 hour"));
+ have_something = TRUE;
+ }
+
+ if (duration->minutes > 1) {
+ g_string_sprintf (string, _("%d minutes"), duration->minutes);
+ have_something = TRUE;
+ } else if (duration->minutes == 1) {
+ g_string_append (string, _("1 minute"));
+ have_something = TRUE;
+ }
+
+ if (duration->seconds > 1) {
+ g_string_sprintf (string, _("%d seconds"), duration->seconds);
+ have_something = TRUE;
+ } else if (duration->seconds == 1) {
+ g_string_append (string, _("1 second"));
+ have_something = TRUE;
+ }
+
+ if (have_something) {
+ ret = string->str;
+ g_string_free (string, FALSE);
+ return ret;
+ } else {
+ g_string_free (string, TRUE);
+ return NULL;
+ }
+}
+
+static char *
+get_alarm_string (CalComponentAlarm *alarm)
+{
+ CalAlarmAction action;
+ CalAlarmTrigger trigger;
+ char string[256];
+ char *base, *str = NULL, *dur;
+
+ string [0] = '\0';
+
+ cal_component_alarm_get_action (alarm, &action);
+ cal_component_alarm_get_trigger (alarm, &trigger);
+
+ switch (action) {
+ case CAL_ALARM_AUDIO:
+ base = _("Play a sound");
+ break;
+
+ case CAL_ALARM_DISPLAY:
+ base = _("Display a message");
+ break;
+
+ case CAL_ALARM_EMAIL:
+ base = _("Send an email");
+ break;
+
+ case CAL_ALARM_PROCEDURE:
+ base = _("Run a program");
+ break;
+
+ case CAL_ALARM_NONE:
+ case CAL_ALARM_UNKNOWN:
+ default:
+ base = _("Unknown action to be performed");
+ break;
+ }
+
+ /* FIXME: This does not look like it will localize correctly. */
+
+ switch (trigger.type) {
+ case CAL_ALARM_TRIGGER_RELATIVE_START:
+ dur = get_alarm_duration_string (&trigger.u.rel_duration);
+
+ if (dur) {
+ if (trigger.u.rel_duration.is_neg)
+ str = g_strdup_printf (_("%s %s before the start of the appointment"),
+ base, dur);
+ else
+ str = g_strdup_printf (_("%s %s after the start of the appointment"),
+ base, dur);
+
+ g_free (dur);
+ } else
+ str = g_strdup_printf (_("%s at the start of the appointment"), base);
+
+ break;
+
+ case CAL_ALARM_TRIGGER_RELATIVE_END:
+ dur = get_alarm_duration_string (&trigger.u.rel_duration);
+
+ if (dur) {
+ if (trigger.u.rel_duration.is_neg)
+ str = g_strdup_printf (_("%s %s before the end of the appointment"),
+ base, dur);
+ else
+ str = g_strdup_printf (_("%s %s after the end of the appointment"),
+ base, dur);
+
+ g_free (dur);
+ } else
+ str = g_strdup_printf (_("%s at the end of the appointment"), base);
+
+ break;
+
+ case CAL_ALARM_TRIGGER_ABSOLUTE: {
+ struct icaltimetype itt;
+ icaltimezone *utc_zone, *current_zone;
+ char *location;
+ struct tm tm;
+ char buf[256];
+
+ /* Absolute triggers come in UTC, so convert them to the local timezone */
+
+ itt = trigger.u.abs_time;
+
+ utc_zone = icaltimezone_get_utc_timezone ();
+ location = calendar_config_get_timezone ();
+ current_zone = icaltimezone_get_builtin_timezone (location);
+
+ tm = icaltimetype_to_tm_with_zone (&itt, utc_zone, current_zone);
+
+ e_time_format_date_and_time (&tm, calendar_config_get_24_hour_format (),
+ FALSE, FALSE, buf, sizeof (buf));
+
+ str = g_strdup_printf (_("%s at %s"), base, buf);
+
+ break; }
+
+ case CAL_ALARM_TRIGGER_NONE:
+ default:
+ str = g_strdup_printf (_("%s for an unknown trigger type"), base);
+ break;
+ }
+
+ return str;
}
static void
@@ -313,19 +486,15 @@ sensitize_buttons (AlarmPage *apage)
{
AlarmPagePrivate *priv;
CalClient *client;
- GtkTreeSelection *selection;
- GtkTreeIter iter;
- gboolean have_selected;
-
+ GtkCList *clist;
+
priv = apage->priv;
-
+
client = COMP_EDITOR_PAGE (apage)->client;
- selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (priv->list));
- have_selected = gtk_tree_selection_get_selected (selection, NULL, &iter);
+ clist = GTK_CLIST (priv->list);
- gtk_widget_set_sensitive (priv->add,
- cal_client_get_one_alarm_only (client) && have_selected ? FALSE : TRUE);
- gtk_widget_set_sensitive (priv->delete, have_selected);
+ gtk_widget_set_sensitive (priv->add, cal_client_get_one_alarm_only (client) && clist->rows > 0 ? FALSE : TRUE);
+ gtk_widget_set_sensitive (priv->delete, clist->rows > 0 ? TRUE : FALSE);
}
/* Appends an alarm to the list */
@@ -333,14 +502,20 @@ static void
append_reminder (AlarmPage *apage, CalComponentAlarm *alarm)
{
AlarmPagePrivate *priv;
- GtkTreeView *view;
- GtkTreeIter iter;
+ GtkCList *clist;
+ char *c[1];
+ int i;
priv = apage->priv;
- view = GTK_TREE_VIEW (priv->list);
- e_alarm_list_append (priv->list_store, &iter, alarm);
- gtk_tree_selection_select_iter (gtk_tree_view_get_selection (view), &iter);
+ clist = GTK_CLIST (priv->list);
+
+ c[0] = get_alarm_string (alarm);
+ i = gtk_clist_append (clist, c);
+
+ gtk_clist_set_row_data_full (clist, i, alarm, (GtkDestroyNotify) cal_component_alarm_free);
+ gtk_clist_select_row (clist, i, 0);
+ g_free (c[0]);
sensitize_buttons (apage);
}
@@ -351,9 +526,10 @@ alarm_page_fill_widgets (CompEditorPage *page, CalComponent *comp)
{
AlarmPage *apage;
AlarmPagePrivate *priv;
- GtkWidget *menu;
CalComponentText text;
GList *alarms, *l;
+ GtkCList *clist;
+ GtkWidget *menu;
CompEditorPageDates dates;
int i;
@@ -381,6 +557,7 @@ alarm_page_fill_widgets (CompEditorPage *page, CalComponent *comp)
alarms = cal_component_get_alarm_uids (comp);
+ clist = GTK_CLIST (priv->list);
for (l = alarms; l != NULL; l = l->next) {
CalComponentAlarm *ca, *ca_copy;
const char *auid;
@@ -417,11 +594,9 @@ alarm_page_fill_component (CompEditorPage *page, CalComponent *comp)
{
AlarmPage *apage;
AlarmPagePrivate *priv;
- GtkTreeView *view;
- GtkTreeModel *model;
- GtkTreeIter iter;
- gboolean valid_iter;
GList *list, *l;
+ GtkCList *clist;
+ int i;
apage = ALARM_PAGE (page);
priv = apage->priv;
@@ -439,16 +614,13 @@ alarm_page_fill_component (CompEditorPage *page, CalComponent *comp)
/* Add the new alarms */
- view = GTK_TREE_VIEW (priv->list);
- model = GTK_TREE_MODEL (priv->list_store);
-
- for (valid_iter = gtk_tree_model_get_iter_first (model, &iter); valid_iter;
- valid_iter = gtk_tree_model_iter_next (model, &iter)) {
+ clist = GTK_CLIST (priv->list);
+ for (i = 0; i < clist->rows; i++) {
CalComponentAlarm *alarm, *alarm_copy;
icalcomponent *icalcomp;
icalproperty *icalprop;
- alarm = (CalComponentAlarm *) e_alarm_list_get_alarm (priv->list_store, &iter);
+ alarm = gtk_clist_get_row_data (clist, i);
g_assert (alarm != NULL);
/* We set the description of the alarm if it's got
@@ -490,11 +662,14 @@ alarm_page_set_summary (CompEditorPage *page, const char *summary)
{
AlarmPage *apage;
AlarmPagePrivate *priv;
+ gchar *s;
apage = ALARM_PAGE (page);
priv = apage->priv;
- gtk_label_set_text (GTK_LABEL (priv->summary), summary);
+ s = e_utf8_to_gtk_string (priv->summary, summary);
+ gtk_label_set_text (GTK_LABEL (priv->summary), s);
+ g_free (s);
}
/* set_dates handler for the alarm page */
@@ -512,7 +687,7 @@ alarm_page_set_dates (CompEditorPage *page, CompEditorPageDates *dates)
-/* Gets the widgets from the XML file and returns TRUE if they are all available. */
+/* Gets the widgets from the XML file and returns if they are all available. */
static gboolean
get_widgets (AlarmPage *apage)
{
@@ -532,14 +707,14 @@ get_widgets (AlarmPage *apage)
/* Get the GtkAccelGroup from the toplevel window, so we can install
it when the notebook page is mapped. */
toplevel = gtk_widget_get_toplevel (priv->main);
- accel_groups = gtk_accel_groups_from_object (G_OBJECT (toplevel));
+ accel_groups = gtk_accel_groups_from_object (GTK_OBJECT (toplevel));
if (accel_groups) {
page->accel_group = accel_groups->data;
gtk_accel_group_ref (page->accel_group);
}
gtk_widget_ref (priv->main);
- gtk_container_remove (GTK_CONTAINER (priv->main->parent), priv->main);
+ gtk_widget_unparent (priv->main);
priv->summary = GW ("summary");
priv->date_time = GW ("date-time");
@@ -656,36 +831,23 @@ delete_clicked_cb (GtkButton *button, gpointer data)
{
AlarmPage *apage;
AlarmPagePrivate *priv;
- GtkTreeSelection *selection;
- GtkTreeIter iter;
- GtkTreePath *path;
- gboolean valid_iter;
+ GtkCList *clist;
+ int sel;
apage = ALARM_PAGE (data);
priv = apage->priv;
- selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (priv->list));
- if (!gtk_tree_selection_get_selected (selection, NULL, &iter)) {
- g_warning ("Could not get a selection to delete.");
+ clist = GTK_CLIST (priv->list);
+ if (!clist->selection)
return;
- }
-
- path = gtk_tree_model_get_path (GTK_TREE_MODEL (priv->list_store), &iter);
- e_alarm_list_remove (priv->list_store, &iter);
- /* Select closest item after removal */
- valid_iter = gtk_tree_model_get_iter (GTK_TREE_MODEL (priv->list_store), &iter, path);
- if (!valid_iter) {
- gtk_tree_path_prev (path);
- valid_iter = gtk_tree_model_get_iter (GTK_TREE_MODEL (priv->list_store), &iter, path);
- }
+ sel = GPOINTER_TO_INT (clist->selection->data);
- if (valid_iter)
- gtk_tree_selection_select_iter (selection, &iter);
+ gtk_clist_remove (clist, sel);
+ if (sel >= clist->rows)
+ sel--;
sensitize_buttons (apage);
-
- gtk_tree_path_free (path);
}
/* Callback used when the alarm options button is clicked */
@@ -714,51 +876,26 @@ static void
init_widgets (AlarmPage *apage)
{
AlarmPagePrivate *priv;
- GtkTreeViewColumn *column;
- GtkCellRenderer *cell_renderer;
priv = apage->priv;
/* Reminder buttons */
- g_signal_connect ((priv->add), "clicked",
- G_CALLBACK (add_clicked_cb), apage);
- g_signal_connect ((priv->delete), "clicked",
- G_CALLBACK (delete_clicked_cb), apage);
+ gtk_signal_connect (GTK_OBJECT (priv->add), "clicked",
+ GTK_SIGNAL_FUNC (add_clicked_cb), apage);
+ gtk_signal_connect (GTK_OBJECT (priv->delete), "clicked",
+ GTK_SIGNAL_FUNC (delete_clicked_cb), apage);
/* Connect the default signal handler to use to make sure we notify
* upstream of changes to the widget values.
*/
- g_signal_connect ((priv->add), "clicked",
- G_CALLBACK (field_changed_cb), apage);
- g_signal_connect ((priv->delete), "clicked",
- G_CALLBACK (field_changed_cb), apage);
+ gtk_signal_connect (GTK_OBJECT (priv->add), "clicked",
+ GTK_SIGNAL_FUNC (field_changed_cb), apage);
+ gtk_signal_connect (GTK_OBJECT (priv->delete), "clicked",
+ GTK_SIGNAL_FUNC (field_changed_cb), apage);
/* Options button */
- g_signal_connect ((priv->button_options), "clicked",
- G_CALLBACK (button_options_clicked_cb), apage);
-
- /* Alarm list */
-
- /* Model */
- priv->list_store = e_alarm_list_new ();
- gtk_tree_view_set_model (GTK_TREE_VIEW (priv->list),
- GTK_TREE_MODEL (priv->list_store));
-
- /* View */
- column = gtk_tree_view_column_new ();
- gtk_tree_view_column_set_title (column, "Action/Trigger"); /* Not shown */
- cell_renderer = GTK_CELL_RENDERER (gtk_cell_renderer_text_new ());
- gtk_tree_view_column_pack_start (column, cell_renderer, TRUE);
- gtk_tree_view_column_add_attribute (column, cell_renderer, "text", E_ALARM_LIST_COLUMN_DESCRIPTION);
- gtk_tree_view_append_column (GTK_TREE_VIEW (priv->list), column);
-
- sensitize_buttons (apage);
-#if 0
- /* If we want the alarm setup widgets to reflect the currently selected alarm, we
- * need to do something like this */
- g_signal_connect (gtk_tree_view_get_selection (GTK_TREE_VIEW (priv->list)), "changed",
- G_CALLBACK (alarm_selection_changed_cb), apage);
-#endif
+ gtk_signal_connect (GTK_OBJECT (priv->button_options), "clicked",
+ GTK_SIGNAL_FUNC (button_options_clicked_cb), apage);
}
@@ -780,7 +917,7 @@ alarm_page_construct (AlarmPage *apage)
priv = apage->priv;
priv->xml = glade_xml_new (EVOLUTION_GLADEDIR "/alarm-page.glade",
- NULL, NULL);
+ NULL);
if (!priv->xml) {
g_message ("alarm_page_construct(): "
"Could not load the Glade XML file!");
@@ -811,9 +948,9 @@ alarm_page_new (void)
{
AlarmPage *apage;
- apage = g_object_new (TYPE_ALARM_PAGE, NULL);
+ apage = gtk_type_new (TYPE_ALARM_PAGE);
if (!alarm_page_construct (apage)) {
- g_object_unref ((apage));
+ gtk_object_unref (GTK_OBJECT (apage));
return NULL;
}
diff --git a/calendar/gui/dialogs/alarm-page.glade b/calendar/gui/dialogs/alarm-page.glade
index cb4509abe2..494b5edd64 100644
--- a/calendar/gui/dialogs/alarm-page.glade
+++ b/calendar/gui/dialogs/alarm-page.glade
@@ -1,490 +1,385 @@
-<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*-->
-<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd">
-
-<glade-interface>
-
-<widget class="GtkWindow" id="alarm-toplevel">
- <property name="title" translatable="yes">window1</property>
- <property name="type">GTK_WINDOW_TOPLEVEL</property>
- <property name="window_position">GTK_WIN_POS_NONE</property>
- <property name="modal">False</property>
- <property name="resizable">True</property>
- <property name="destroy_with_parent">False</property>
-
- <child>
- <widget class="GtkVBox" id="alarm-page">
- <property name="border_width">4</property>
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">4</property>
-
+<?xml version="1.0"?>
+<GTK-Interface>
+
+<project>
+ <name>alarm-page</name>
+ <program_name>alarm-page</program_name>
+ <directory></directory>
+ <source_directory>.</source_directory>
+ <pixmaps_directory>pixmaps</pixmaps_directory>
+ <language>C</language>
+ <gnome_support>True</gnome_support>
+ <gettext_support>True</gettext_support>
+ <output_main_file>False</output_main_file>
+ <output_support_files>False</output_support_files>
+ <output_build_files>False</output_build_files>
+</project>
+
+<widget>
+ <class>GtkWindow</class>
+ <name>alarm-toplevel</name>
+ <visible>False</visible>
+ <title>window1</title>
+ <type>GTK_WINDOW_TOPLEVEL</type>
+ <position>GTK_WIN_POS_NONE</position>
+ <modal>False</modal>
+ <allow_shrink>False</allow_shrink>
+ <allow_grow>True</allow_grow>
+ <auto_shrink>False</auto_shrink>
+
+ <widget>
+ <class>GtkVBox</class>
+ <name>alarm-page</name>
+ <border_width>4</border_width>
+ <homogeneous>False</homogeneous>
+ <spacing>4</spacing>
+
+ <widget>
+ <class>GtkFrame</class>
+ <name>frame33</name>
+ <label>Basics</label>
+ <label_xalign>0</label_xalign>
+ <shadow_type>GTK_SHADOW_ETCHED_IN</shadow_type>
<child>
- <widget class="GtkFrame" id="frame33">
- <property name="visible">True</property>
- <property name="label_xalign">0</property>
- <property name="label_yalign">0.5</property>
- <property name="shadow_type">GTK_SHADOW_ETCHED_IN</property>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>True</fill>
+ </child>
+ <widget>
+ <class>GtkTable</class>
+ <name>table13</name>
+ <border_width>4</border_width>
+ <rows>2</rows>
+ <columns>2</columns>
+ <homogeneous>False</homogeneous>
+ <row_spacing>2</row_spacing>
+ <column_spacing>2</column_spacing>
+
+ <widget>
+ <class>GtkLabel</class>
+ <name>label62</name>
+ <label>Summary:</label>
+ <justify>GTK_JUSTIFY_CENTER</justify>
+ <wrap>False</wrap>
+ <xalign>0</xalign>
+ <yalign>0.5</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
<child>
- <widget class="GtkTable" id="table13">
- <property name="border_width">4</property>
- <property name="visible">True</property>
- <property name="n_rows">2</property>
- <property name="n_columns">2</property>
- <property name="homogeneous">False</property>
- <property name="row_spacing">2</property>
- <property name="column_spacing">2</property>
-
- <child>
- <widget class="GtkLabel" id="label62">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Summary:</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label63">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Date/Time:</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
+ <left_attach>0</left_attach>
+ <right_attach>1</right_attach>
+ <top_attach>0</top_attach>
+ <bottom_attach>1</bottom_attach>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <xexpand>False</xexpand>
+ <yexpand>False</yexpand>
+ <xshrink>False</xshrink>
+ <yshrink>False</yshrink>
+ <xfill>True</xfill>
+ <yfill>False</yfill>
+ </child>
+ </widget>
- <child>
- <widget class="GtkLabel" id="summary">
- <property name="visible">True</property>
- <property name="label" translatable="yes"></property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">4</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="y_options"></property>
- </packing>
- </child>
+ <widget>
+ <class>GtkLabel</class>
+ <name>label63</name>
+ <label>Date/Time:</label>
+ <justify>GTK_JUSTIFY_CENTER</justify>
+ <wrap>False</wrap>
+ <xalign>0</xalign>
+ <yalign>0</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <child>
+ <left_attach>0</left_attach>
+ <right_attach>1</right_attach>
+ <top_attach>1</top_attach>
+ <bottom_attach>2</bottom_attach>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <xexpand>False</xexpand>
+ <yexpand>False</yexpand>
+ <xshrink>False</xshrink>
+ <yshrink>False</yshrink>
+ <xfill>True</xfill>
+ <yfill>True</yfill>
+ </child>
+ </widget>
- <child>
- <widget class="GtkLabel" id="date-time">
- <property name="visible">True</property>
- <property name="label" translatable="yes"></property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">7.45058e-09</property>
- <property name="yalign">0.5</property>
- <property name="xpad">4</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
- </widget>
+ <widget>
+ <class>GtkLabel</class>
+ <name>summary</name>
+ <width>10</width>
+ <label></label>
+ <justify>GTK_JUSTIFY_LEFT</justify>
+ <wrap>False</wrap>
+ <xalign>0</xalign>
+ <yalign>0.5</yalign>
+ <xpad>4</xpad>
+ <ypad>0</ypad>
+ <child>
+ <left_attach>1</left_attach>
+ <right_attach>2</right_attach>
+ <top_attach>0</top_attach>
+ <bottom_attach>1</bottom_attach>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <xexpand>True</xexpand>
+ <yexpand>False</yexpand>
+ <xshrink>False</xshrink>
+ <yshrink>False</yshrink>
+ <xfill>True</xfill>
+ <yfill>False</yfill>
</child>
+ </widget>
+ <widget>
+ <class>GtkLabel</class>
+ <name>date-time</name>
+ <width>10</width>
+ <label></label>
+ <justify>GTK_JUSTIFY_LEFT</justify>
+ <wrap>False</wrap>
+ <xalign>7.45058e-09</xalign>
+ <yalign>0.5</yalign>
+ <xpad>4</xpad>
+ <ypad>0</ypad>
<child>
- <widget class="GtkLabel" id="label1">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Basics</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="type">label_item</property>
- </packing>
+ <left_attach>1</left_attach>
+ <right_attach>2</right_attach>
+ <top_attach>1</top_attach>
+ <bottom_attach>2</bottom_attach>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <xexpand>True</xexpand>
+ <yexpand>False</yexpand>
+ <xshrink>False</xshrink>
+ <yshrink>False</yshrink>
+ <xfill>True</xfill>
+ <yfill>True</yfill>
</child>
</widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">True</property>
- </packing>
- </child>
+ </widget>
+ </widget>
+ <widget>
+ <class>GtkFrame</class>
+ <name>frame34</name>
+ <label>Reminders</label>
+ <label_xalign>0</label_xalign>
+ <shadow_type>GTK_SHADOW_ETCHED_IN</shadow_type>
<child>
- <widget class="GtkFrame" id="frame34">
- <property name="visible">True</property>
- <property name="label_xalign">0</property>
- <property name="label_yalign">0.5</property>
- <property name="shadow_type">GTK_SHADOW_ETCHED_IN</property>
+ <padding>0</padding>
+ <expand>True</expand>
+ <fill>True</fill>
+ </child>
+ <widget>
+ <class>GtkVBox</class>
+ <name>vbox53</name>
+ <border_width>4</border_width>
+ <homogeneous>False</homogeneous>
+ <spacing>4</spacing>
+
+ <widget>
+ <class>GtkHBox</class>
+ <name>hbox54</name>
+ <homogeneous>False</homogeneous>
+ <spacing>4</spacing>
<child>
- <widget class="GtkVBox" id="vbox53">
- <property name="border_width">4</property>
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">4</property>
-
- <child>
- <widget class="GtkHBox" id="hbox54">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">4</property>
-
- <child>
- <widget class="GtkOptionMenu" id="action">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="history">0</property>
-
- <child internal-child="menu">
- <widget class="GtkMenu" id="convertwidget1">
- <property name="visible">True</property>
-
- <child>
- <widget class="GtkMenuItem" id="convertwidget2">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Display a message</property>
- <property name="use_underline">True</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkMenuItem" id="convertwidget3">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Play a sound</property>
- <property name="use_underline">True</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkMenuItem" id="convertwidget4">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Run a program</property>
- <property name="use_underline">True</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkMenuItem" id="send_an_email1">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Send an Email</property>
- <property name="use_underline">True</property>
- </widget>
- </child>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkSpinButton" id="interval-value">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="climb_rate">1</property>
- <property name="digits">0</property>
- <property name="numeric">True</property>
- <property name="update_policy">GTK_UPDATE_ALWAYS</property>
- <property name="snap_to_ticks">False</property>
- <property name="wrap">False</property>
- <property name="adjustment">1 0 999 1 10 10</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkOptionMenu" id="value-units">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="history">0</property>
-
- <child internal-child="menu">
- <widget class="GtkMenu" id="convertwidget5">
- <property name="visible">True</property>
-
- <child>
- <widget class="GtkMenuItem" id="convertwidget6">
- <property name="visible">True</property>
- <property name="label" translatable="yes">minute(s)</property>
- <property name="use_underline">True</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkMenuItem" id="convertwidget7">
- <property name="visible">True</property>
- <property name="label" translatable="yes">hour(s)</property>
- <property name="use_underline">True</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkMenuItem" id="convertwidget8">
- <property name="visible">True</property>
- <property name="label" translatable="yes">day(s)</property>
- <property name="use_underline">True</property>
- </widget>
- </child>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkOptionMenu" id="relative">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="history">0</property>
-
- <child internal-child="menu">
- <widget class="GtkMenu" id="convertwidget9">
- <property name="visible">True</property>
-
- <child>
- <widget class="GtkMenuItem" id="convertwidget10">
- <property name="visible">True</property>
- <property name="label" translatable="yes">before</property>
- <property name="use_underline">True</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkMenuItem" id="convertwidget11">
- <property name="visible">True</property>
- <property name="label" translatable="yes">after</property>
- <property name="use_underline">True</property>
- </widget>
- </child>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkOptionMenu" id="time">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="history">0</property>
-
- <child internal-child="menu">
- <widget class="GtkMenu" id="convertwidget12">
- <property name="visible">True</property>
-
- <child>
- <widget class="GtkMenuItem" id="convertwidget13">
- <property name="visible">True</property>
- <property name="label" translatable="yes">start of appointment</property>
- <property name="use_underline">True</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkMenuItem" id="convertwidget14">
- <property name="visible">True</property>
- <property name="label" translatable="yes">end of appointment</property>
- <property name="use_underline">True</property>
- </widget>
- </child>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkButton" id="button-options">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">_Options...</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkHBox" id="hbox55">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">0</property>
-
- <child>
- <widget class="GtkScrolledWindow" id="scrolledwindow13">
- <property name="visible">True</property>
- <property name="hscrollbar_policy">GTK_POLICY_NEVER</property>
- <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
- <property name="shadow_type">GTK_SHADOW_IN</property>
- <property name="window_placement">GTK_CORNER_TOP_LEFT</property>
-
- <child>
- <widget class="GtkTreeView" id="list">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="headers_visible">True</property>
- <property name="rules_hint">False</property>
- <property name="reorderable">False</property>
- <property name="enable_search">True</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>True</fill>
+ </child>
- <child>
- <widget class="GtkVButtonBox" id="vbuttonbox2">
- <property name="visible">True</property>
- <property name="layout_style">GTK_BUTTONBOX_START</property>
- <property name="spacing">10</property>
+ <widget>
+ <class>GtkOptionMenu</class>
+ <name>action</name>
+ <can_focus>True</can_focus>
+ <items>Display a message
+Play a sound
+Run a program
+Send an Email
+</items>
+ <initial_choice>0</initial_choice>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
+ </child>
+ </widget>
+
+ <widget>
+ <class>GtkSpinButton</class>
+ <name>interval-value</name>
+ <can_focus>True</can_focus>
+ <climb_rate>1</climb_rate>
+ <digits>0</digits>
+ <numeric>True</numeric>
+ <update_policy>GTK_UPDATE_ALWAYS</update_policy>
+ <snap>False</snap>
+ <wrap>False</wrap>
+ <value>1</value>
+ <lower>0</lower>
+ <upper>999</upper>
+ <step>1</step>
+ <page>10</page>
+ <page_size>10</page_size>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>True</fill>
+ </child>
+ </widget>
+
+ <widget>
+ <class>GtkOptionMenu</class>
+ <name>value-units</name>
+ <can_focus>True</can_focus>
+ <items>minute(s)
+hour(s)
+day(s)
+</items>
+ <initial_choice>0</initial_choice>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
+ </child>
+ </widget>
+
+ <widget>
+ <class>GtkOptionMenu</class>
+ <name>relative</name>
+ <can_focus>True</can_focus>
+ <items>before
+after
+</items>
+ <initial_choice>0</initial_choice>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
+ </child>
+ </widget>
+
+ <widget>
+ <class>GtkOptionMenu</class>
+ <name>time</name>
+ <can_focus>True</can_focus>
+ <items>start of appointment
+end of appointment
+</items>
+ <initial_choice>0</initial_choice>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
+ </child>
+ </widget>
+
+ <widget>
+ <class>GtkButton</class>
+ <name>button-options</name>
+ <can_focus>True</can_focus>
+ <label>_Options...</label>
+ <relief>GTK_RELIEF_NORMAL</relief>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
+ </child>
+ </widget>
+ </widget>
- <child>
- <widget class="GtkButton" id="add">
- <property name="visible">True</property>
- <property name="can_default">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">_Add</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- </widget>
- </child>
+ <widget>
+ <class>GtkHBox</class>
+ <name>hbox55</name>
+ <homogeneous>False</homogeneous>
+ <spacing>0</spacing>
+ <child>
+ <padding>0</padding>
+ <expand>True</expand>
+ <fill>True</fill>
+ </child>
- <child>
- <widget class="GtkButton" id="delete">
- <property name="visible">True</property>
- <property name="can_default">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">_Delete</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
+ <widget>
+ <class>GtkScrolledWindow</class>
+ <name>scrolledwindow13</name>
+ <hscrollbar_policy>GTK_POLICY_NEVER</hscrollbar_policy>
+ <vscrollbar_policy>GTK_POLICY_AUTOMATIC</vscrollbar_policy>
+ <hupdate_policy>GTK_UPDATE_CONTINUOUS</hupdate_policy>
+ <vupdate_policy>GTK_UPDATE_CONTINUOUS</vupdate_policy>
+ <child>
+ <padding>0</padding>
+ <expand>True</expand>
+ <fill>True</fill>
+ </child>
+
+ <widget>
+ <class>GtkCList</class>
+ <name>list</name>
+ <can_focus>True</can_focus>
+ <columns>1</columns>
+ <column_widths>80</column_widths>
+ <selection_mode>GTK_SELECTION_BROWSE</selection_mode>
+ <show_titles>False</show_titles>
+ <shadow_type>GTK_SHADOW_IN</shadow_type>
+
+ <widget>
+ <class>GtkLabel</class>
+ <child_name>CList:title</child_name>
+ <name>label64</name>
+ <label>label55</label>
+ <justify>GTK_JUSTIFY_CENTER</justify>
+ <wrap>False</wrap>
+ <xalign>0.5</xalign>
+ <yalign>0.5</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ </widget>
+ </widget>
+ </widget>
+
+ <widget>
+ <class>GtkVButtonBox</class>
+ <name>vbuttonbox2</name>
+ <layout_style>GTK_BUTTONBOX_START</layout_style>
+ <spacing>10</spacing>
+ <child_min_width>85</child_min_width>
+ <child_min_height>27</child_min_height>
+ <child_ipad_x>7</child_ipad_x>
+ <child_ipad_y>0</child_ipad_y>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
+ </child>
+
+ <widget>
+ <class>GtkButton</class>
+ <name>add</name>
+ <can_default>True</can_default>
+ <can_focus>True</can_focus>
+ <label>_Add</label>
+ <relief>GTK_RELIEF_NORMAL</relief>
</widget>
- </child>
- <child>
- <widget class="GtkLabel" id="label64">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Reminders</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
+ <widget>
+ <class>GtkButton</class>
+ <name>delete</name>
+ <can_default>True</can_default>
+ <can_focus>True</can_focus>
+ <label>_Delete</label>
+ <relief>GTK_RELIEF_NORMAL</relief>
</widget>
- <packing>
- <property name="type">label_item</property>
- </packing>
- </child>
+ </widget>
</widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
+ </widget>
</widget>
- </child>
+ </widget>
</widget>
-</glade-interface>
+</GTK-Interface>
diff --git a/calendar/gui/dialogs/cancel-comp.c b/calendar/gui/dialogs/cancel-comp.c
index 0e48dd3763..19d593182c 100644
--- a/calendar/gui/dialogs/cancel-comp.c
+++ b/calendar/gui/dialogs/cancel-comp.c
@@ -23,8 +23,10 @@
#endif
#include <glib.h>
-#include <gtk/gtkmessagedialog.h>
+#include <libgnome/gnome-defs.h>
#include <libgnome/gnome-i18n.h>
+#include <libgnomeui/gnome-dialog.h>
+#include <libgnomeui/gnome-dialog-util.h>
#include <libgnomeui/gnome-uidefs.h>
#include <gal/widgets/e-unicode.h>
#include "cancel-comp.h"
@@ -45,7 +47,6 @@ cancel_component_dialog (CalClient *client, CalComponent *comp, gboolean deletin
GtkWidget *dialog;
CalComponentVType vtype;
char *str;
- gint response;
if (deleting && cal_client_get_save_schedules (client))
return TRUE;
@@ -86,14 +87,9 @@ cancel_component_dialog (CalClient *client, CalComponent *comp, gboolean deletin
return FALSE;
}
- dialog = gtk_message_dialog_new (NULL, GTK_DIALOG_MODAL,
- GTK_MESSAGE_QUESTION,
- GTK_BUTTONS_YES_NO, str);
+ dialog = gnome_question_dialog_modal (str, NULL, NULL);
- response = gtk_dialog_run (GTK_DIALOG (dialog));
- gtk_widget_destroy (dialog);
-
- if (response == GTK_RESPONSE_YES)
+ if (gnome_dialog_run (GNOME_DIALOG (dialog)) == GNOME_YES)
return TRUE;
else
return FALSE;
diff --git a/calendar/gui/dialogs/comp-editor-util.c b/calendar/gui/dialogs/comp-editor-util.c
index 2df5f94fa7..35910eeb24 100644
--- a/calendar/gui/dialogs/comp-editor-util.c
+++ b/calendar/gui/dialogs/comp-editor-util.c
@@ -26,11 +26,12 @@
#include <string.h>
#include <ical.h>
#include <glib.h>
-#include <gtk/gtklabel.h>
+#include <libgnome/gnome-defs.h>
#include <libgnome/gnome-i18n.h>
-#include <bonobo-activation/bonobo-activation.h>
+#include <liboaf/liboaf.h>
#include <bonobo/bonobo-control.h>
#include <bonobo/bonobo-widget.h>
+#include <gal/unicode/gunicode.h>
#include <ebook/e-destination.h>
#include <e-util/e-time-utils.h>
#include <cal-util/timeutil.h>
@@ -282,11 +283,11 @@ comp_editor_create_contacts_component (void)
CORBA_Environment ev;
CORBA_exception_init (&ev);
- corba_select_names = bonobo_activation_activate_from_id (SELECT_NAMES_OAFID, 0,
- NULL, &ev);
+ corba_select_names = oaf_activate_from_id (SELECT_NAMES_OAFID, 0,
+ NULL, &ev);
/* OAF seems to be broken -- it can return a CORBA_OBJECT_NIL without
- raising an exception in `ev'. Is this true with BonoboActivation? */
+ raising an exception in `ev'. */
if (ev._major != CORBA_NO_EXCEPTION
|| corba_select_names == CORBA_OBJECT_NIL) {
g_warning ("Cannot activate -- %s", SELECT_NAMES_OAFID);
@@ -337,7 +338,7 @@ comp_editor_create_contacts_control (GNOME_Evolution_Addressbook_SelectNames cor
}
-void
+Bonobo_EventSource_ListenerId
comp_editor_connect_contacts_changed (GtkWidget *contacts_entry,
BonoboListenerCallbackFn changed_cb,
gpointer changed_cb_data)
@@ -348,7 +349,7 @@ comp_editor_connect_contacts_changed (GtkWidget *contacts_entry,
cf = bonobo_widget_get_control_frame (BONOBO_WIDGET (contacts_entry));
pb = bonobo_control_frame_get_control_property_bag (cf, NULL);
- bonobo_event_source_client_add_listener (
+ return bonobo_event_source_client_add_listener (
pb, changed_cb,
"Bonobo/Property:change:entry_changed",
NULL, changed_cb_data);
@@ -380,8 +381,8 @@ parse_contact_string (const char *value, char **name, char **email)
return;
}
- lbracket = g_utf8_strchr (value, g_utf8_strlen (value, 0), '<');
- rbracket = g_utf8_strchr (value, g_utf8_strlen (value, 0), '>');
+ lbracket = g_utf8_strchr (value, '<');
+ rbracket = g_utf8_strchr (value, '>');
if (!lbracket || !rbracket || rbracket < lbracket) {
*name = g_strdup (value);
@@ -421,9 +422,6 @@ comp_editor_contacts_to_widget (GtkWidget *contacts_entry,
int i;
cal_component_get_contact_list (comp, &contact_list);
- if (!contact_list)
- return;
-
dest_array = g_ptr_array_new ();
for (elem = contact_list; elem; elem = elem->next) {
CalComponentText *t = elem->data;
@@ -449,14 +447,14 @@ comp_editor_contacts_to_widget (GtkWidget *contacts_entry,
#endif
bonobo_widget_set_property (BONOBO_WIDGET (contacts_entry),
- "destinations", TC_CORBA_string, contacts_string, NULL);
+ "destinations", contacts_string, NULL);
g_free (contacts_string);
/* We free all dest_array except the last NULL we added. */
for (i = 0; i < dest_array->len - 1; i++) {
dest = g_ptr_array_index (dest_array, i);
- g_object_unref((dest));
+ gtk_object_unref (GTK_OBJECT (dest));
}
g_ptr_array_free (dest_array, TRUE);
}
@@ -474,7 +472,7 @@ comp_editor_contacts_to_component (GtkWidget *contacts_entry,
int i;
bonobo_widget_get_property (BONOBO_WIDGET (contacts_entry),
- "destinations", TC_CORBA_string, &contacts_string, NULL);
+ "destinations", &contacts_string, NULL);
#if 0
g_print ("Contacts string: %s\n", contacts_string ? contacts_string : "");
#endif
@@ -506,7 +504,7 @@ comp_editor_contacts_to_component (GtkWidget *contacts_entry,
contact_list = g_slist_prepend (contact_list, t);
- g_object_unref((contact_destv[i]));
+ gtk_object_unref (GTK_OBJECT (contact_destv[i]));
}
}
g_free (contact_destv);
diff --git a/calendar/gui/dialogs/comp-editor.c b/calendar/gui/dialogs/comp-editor.c
index c8d89eae7e..13d582e757 100644
--- a/calendar/gui/dialogs/comp-editor.c
+++ b/calendar/gui/dialogs/comp-editor.c
@@ -28,16 +28,18 @@
#include <unistd.h>
#include <glib.h>
#include <gdk/gdkkeysyms.h>
-#include <gtk/gtkstock.h>
+#include <libgnome/gnome-defs.h>
#include <libgnome/gnome-i18n.h>
#include <libgnomeui/gnome-uidefs.h>
#include <libgnomeui/gnome-dialog.h>
#include <libgnomeui/gnome-dialog-util.h>
+#include <libgnomeui/gnome-stock.h>
#include <libgnomeui/gnome-window-icon.h>
#include <libgnomeui/gnome-messagebox.h>
#include <bonobo/bonobo-ui-container.h>
#include <bonobo/bonobo-ui-util.h>
#include <gal/widgets/e-unicode.h>
+#include <gal/widgets/e-gui-utils.h>
#include <e-util/e-dialog-utils.h>
#include <evolution-shell-component-utils.h>
#include "../print.h"
@@ -88,7 +90,7 @@ struct _CompEditorPrivate {
static void comp_editor_class_init (CompEditorClass *class);
static void comp_editor_init (CompEditor *editor);
static gint comp_editor_key_press_event (GtkWidget *d, GdkEventKey *e);
-static void comp_editor_finalize (GObject *object);
+static void comp_editor_destroy (GtkObject *object);
static void real_set_cal_client (CompEditor *editor, CalClient *client);
static void real_edit_comp (CompEditor *editor, CalComponent *comp);
@@ -150,27 +152,48 @@ static GtkObjectClass *parent_class;
-E_MAKE_TYPE (comp_editor, "CompEditor", CompEditor, comp_editor_class_init, comp_editor_init,
- BONOBO_TYPE_WINDOW);
+GtkType
+comp_editor_get_type (void)
+{
+ static GtkType comp_editor_type = 0;
+
+ if (!comp_editor_type) {
+ static const GtkTypeInfo comp_editor_info = {
+ "CompEditor",
+ sizeof (CompEditor),
+ sizeof (CompEditorClass),
+ (GtkClassInitFunc) comp_editor_class_init,
+ (GtkObjectInitFunc) comp_editor_init,
+ NULL, /* reserved_1 */
+ NULL, /* reserved_2 */
+ (GtkClassInitFunc) NULL
+ };
+
+ comp_editor_type = gtk_type_unique (BONOBO_TYPE_WINDOW,
+ &comp_editor_info);
+ }
+
+ return comp_editor_type;
+}
/* Class initialization function for the calendar component editor */
static void
comp_editor_class_init (CompEditorClass *klass)
{
- GObjectClass *object_class;
+ GtkObjectClass *object_class;
GtkWidgetClass *widget_class;
- object_class = G_OBJECT_CLASS (klass);
+ object_class = GTK_OBJECT_CLASS (klass);
widget_class = GTK_WIDGET_CLASS (klass);
- parent_class = g_type_class_ref(BONOBO_TYPE_WINDOW);
+ parent_class = gtk_type_class (BONOBO_TYPE_WINDOW);
klass->set_cal_client = real_set_cal_client;
klass->edit_comp = real_edit_comp;
klass->send_comp = real_send_comp;
widget_class->key_press_event = comp_editor_key_press_event;
- object_class->finalize = comp_editor_finalize;
+ object_class->destroy = comp_editor_destroy;
}
/* Creates the basic in the editor */
@@ -184,23 +207,22 @@ setup_widgets (CompEditor *editor)
priv = editor->priv;
/* Window and basic vbox */
- container = bonobo_ui_container_new ();
- editor = (CompEditor *) bonobo_window_construct (BONOBO_WINDOW (editor), container,
- "event-editor", "iCalendar Editor");
- g_signal_connect((editor), "delete_event",
- G_CALLBACK (delete_event_cb), editor);
+ bonobo_window_construct (BONOBO_WINDOW (editor),
+ "event-editor", "iCalendar Editor");
+ gtk_signal_connect (GTK_OBJECT (editor), "delete_event",
+ GTK_SIGNAL_FUNC (delete_event_cb), editor);
priv->uic = bonobo_ui_component_new_default ();
- bonobo_ui_component_set_container (priv->uic,
- bonobo_object_corba_objref (BONOBO_OBJECT (container)),
- NULL);
+ container = bonobo_ui_container_new ();
+ bonobo_ui_container_set_win (container, BONOBO_WINDOW (editor));
+ bonobo_ui_component_set_container (priv->uic, BONOBO_OBJREF (container));
bonobo_ui_engine_config_set_path (bonobo_window_get_ui_engine (BONOBO_WINDOW (editor)),
"/evolution/UIConf/kvps");
bonobo_ui_component_add_verb_list_with_data (priv->uic, verbs, editor);
bonobo_ui_util_set_ui (priv->uic, EVOLUTION_DATADIR,
- EVOLUTION_UIDIR "/evolution-comp-editor.xml",
- "evolution-calendar", NULL);
+ "evolution-comp-editor.xml",
+ "evolution-calendar");
e_pixmaps_update (priv->uic, pixmaps);
vbox = gtk_vbox_new (FALSE, GNOME_PAD_SMALL);
@@ -253,7 +275,7 @@ comp_editor_key_press_event (GtkWidget *d, GdkEventKey *e)
/* Destroy handler for the calendar component editor */
static void
-comp_editor_finalize (GObject *object)
+comp_editor_destroy (GtkObject *object)
{
CompEditor *editor;
CompEditorPrivate *priv;
@@ -262,24 +284,24 @@ comp_editor_finalize (GObject *object)
editor = COMP_EDITOR (object);
priv = editor->priv;
- g_signal_handlers_disconnect_matched (priv->client, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, editor);
+ gtk_signal_disconnect_by_data (GTK_OBJECT (priv->client), editor);
/* We want to destroy the pages after the widgets get destroyed,
since they have lots of signal handlers connected to the widgets
with the pages as the data. */
for (l = priv->pages; l != NULL; l = l->next)
- g_object_unref((l->data));
+ gtk_object_unref (GTK_OBJECT (l->data));
if (priv->comp) {
- g_object_unref((priv->comp));
+ gtk_object_unref (GTK_OBJECT (priv->comp));
priv->comp = NULL;
}
g_free (priv);
editor->priv = NULL;
- if (G_OBJECT_CLASS (parent_class)->finalize)
- (* G_OBJECT_CLASS (parent_class)->finalize) (object);
+ if (GTK_OBJECT_CLASS (parent_class)->destroy)
+ (* GTK_OBJECT_CLASS (parent_class)->destroy) (object);
}
static gboolean
@@ -298,7 +320,7 @@ save_comp (CompEditor *editor)
clone = cal_component_clone (priv->comp);
for (l = priv->pages; l != NULL; l = l->next) {
if (!comp_editor_page_fill_component (l->data, clone)) {
- g_object_unref((clone));
+ gtk_object_unref (GTK_OBJECT (clone));
comp_editor_show_page (editor, COMP_EDITOR_PAGE (l->data));
return FALSE;
}
@@ -310,7 +332,7 @@ save_comp (CompEditor *editor)
else
cal_component_abort_sequence (clone);
- g_object_unref((priv->comp));
+ gtk_object_unref (GTK_OBJECT (priv->comp));
priv->comp = clone;
priv->updating = TRUE;
@@ -401,7 +423,7 @@ prompt_to_save_changes (CompEditor *editor, gboolean send)
return TRUE;
switch (save_component_dialog (GTK_WINDOW (editor))) {
- case GTK_RESPONSE_YES: /* Save */
+ case 0: /* Save */
if (cal_component_is_instance (priv->comp))
if (!recur_component_dialog (priv->comp, &priv->mod, GTK_WINDOW (editor)))
return FALSE;
@@ -412,9 +434,9 @@ prompt_to_save_changes (CompEditor *editor, gboolean send)
return TRUE;
else
return FALSE;
- case GTK_RESPONSE_NO: /* Discard */
+ case 1: /* Discard */
return TRUE;
- case GTK_RESPONSE_CANCEL: /* Cancel */
+ case 2: /* Cancel */
default:
return FALSE;
}
@@ -441,7 +463,7 @@ close_dialog (CompEditor *editor)
priv = editor->priv;
- gtk_widget_destroy (GTK_WIDGET (editor));
+ gtk_object_destroy (GTK_OBJECT (editor));
}
@@ -627,7 +649,7 @@ comp_editor_append_page (CompEditor *editor,
priv = editor->priv;
- g_object_ref((page));
+ gtk_object_ref (GTK_OBJECT (page));
/* If we are editing something, fill the widgets with current info */
if (priv->comp != NULL) {
@@ -635,7 +657,7 @@ comp_editor_append_page (CompEditor *editor,
comp = comp_editor_get_current_comp (editor);
comp_editor_page_fill_widgets (page, comp);
- g_object_unref((comp));
+ gtk_object_unref (GTK_OBJECT (comp));
}
page_widget = comp_editor_page_get_widget (page);
@@ -649,19 +671,19 @@ comp_editor_append_page (CompEditor *editor,
gtk_notebook_append_page (priv->notebook, page_widget, label_widget);
/* Listen for things happening on the page */
- g_signal_connect(page, "changed",
- G_CALLBACK (page_changed_cb), editor);
- g_signal_connect(page, "summary_changed",
- G_CALLBACK (page_summary_changed_cb), editor);
- g_signal_connect(page, "dates_changed",
- G_CALLBACK (page_dates_changed_cb), editor);
+ gtk_signal_connect (GTK_OBJECT (page), "changed",
+ GTK_SIGNAL_FUNC (page_changed_cb), editor);
+ gtk_signal_connect (GTK_OBJECT (page), "summary_changed",
+ GTK_SIGNAL_FUNC (page_summary_changed_cb), editor);
+ gtk_signal_connect (GTK_OBJECT (page), "dates_changed",
+ GTK_SIGNAL_FUNC (page_dates_changed_cb), editor);
/* Listen for when the page is mapped/unmapped so we can
install/uninstall the appropriate GtkAccelGroup. */
- g_signal_connect((page_widget), "map",
- G_CALLBACK (page_mapped_cb), page);
- g_signal_connect((page_widget), "unmap",
- G_CALLBACK (page_unmapped_cb), page);
+ gtk_signal_connect (GTK_OBJECT (page_widget), "map",
+ GTK_SIGNAL_FUNC (page_mapped_cb), page);
+ gtk_signal_connect (GTK_OBJECT (page_widget), "unmap",
+ GTK_SIGNAL_FUNC (page_unmapped_cb), page);
/* The first page is the main page of the editor, so we ask it to focus
* its main widget.
@@ -697,13 +719,13 @@ comp_editor_remove_page (CompEditor *editor, CompEditorPage *page)
return;
/* Disconnect all the signals added in append_page(). */
- g_signal_handlers_disconnect_matched (page, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, editor);
- g_signal_handlers_disconnect_matched (page_widget, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, page);
+ gtk_signal_disconnect_by_data (GTK_OBJECT (page), editor);
+ gtk_signal_disconnect_by_data (GTK_OBJECT (page_widget), page);
gtk_notebook_remove_page (priv->notebook, page_num);
priv->pages = g_list_remove (priv->pages, page);
- g_object_unref((page));
+ gtk_object_unref (GTK_OBJECT (page));
}
/**
@@ -747,7 +769,7 @@ comp_editor_set_cal_client (CompEditor *editor, CalClient *client)
g_return_if_fail (editor != NULL);
g_return_if_fail (IS_COMP_EDITOR (editor));
- klass = COMP_EDITOR_CLASS (G_OBJECT_GET_CLASS (editor));
+ klass = COMP_EDITOR_CLASS (GTK_OBJECT (editor)->klass);
if (klass->set_cal_client)
klass->set_cal_client (editor, client);
@@ -778,7 +800,7 @@ comp_editor_get_cal_client (CompEditor *editor)
static char *
make_title_from_comp (CalComponent *comp)
{
- char *title, *title_utf8;
+ char *title;
const char *type_string;
CalComponentVType type;
CalComponentText text;
@@ -804,15 +826,14 @@ make_title_from_comp (CalComponent *comp)
cal_component_get_summary (comp, &text);
if (text.value) {
- title = g_strdup_printf (type_string, text.value);
- } else {
+ char *summary;
+ summary = e_utf8_to_locale_string (text.value);
+ title = g_strdup_printf (type_string, summary);
+ g_free (summary);
+ } else
title = g_strdup_printf (type_string, _("No summary"));
- }
-
- title_utf8 = g_locale_to_utf8 (title, -1, NULL, NULL, NULL);
- g_free (title);
- return title_utf8;
+ return title;
}
static const char *
@@ -821,18 +842,18 @@ make_icon_from_comp (CalComponent *comp)
CalComponentVType type;
if (!comp)
- return EVOLUTION_IMAGESDIR "/evolution-calendar-mini.png";
+ return EVOLUTION_ICONSDIR "/evolution-calendar-mini.png";
type = cal_component_get_vtype (comp);
switch (type) {
case CAL_COMPONENT_EVENT:
- return EVOLUTION_IMAGESDIR "/buttons/new_appointment.png";
+ return EVOLUTION_ICONSDIR "/buttons/new_appointment.png";
break;
case CAL_COMPONENT_TODO:
- return EVOLUTION_IMAGESDIR "/buttons/new_task.png";
+ return EVOLUTION_ICONSDIR "/buttons/new_task.png";
break;
default:
- return EVOLUTION_IMAGESDIR "/evolution-calendar-mini.png";
+ return EVOLUTION_ICONSDIR "/evolution-calendar-mini.png";
}
}
@@ -890,13 +911,13 @@ real_set_cal_client (CompEditor *editor, CalClient *client)
g_return_if_fail (IS_CAL_CLIENT (client));
g_return_if_fail (cal_client_get_load_state (client) ==
CAL_CLIENT_LOAD_LOADED);
- g_object_ref((client));
+ gtk_object_ref (GTK_OBJECT (client));
}
if (priv->client) {
gtk_signal_disconnect_by_data (GTK_OBJECT (priv->client),
editor);
- g_object_unref((priv->client));
+ gtk_object_unref (GTK_OBJECT (priv->client));
}
priv->client = client;
@@ -905,11 +926,11 @@ real_set_cal_client (CompEditor *editor, CalClient *client)
for (elem = priv->pages; elem; elem = elem->next)
comp_editor_page_set_cal_client (elem->data, client);
- g_signal_connect((priv->client), "obj_updated",
- G_CALLBACK (obj_updated_cb), editor);
+ gtk_signal_connect (GTK_OBJECT (priv->client), "obj_updated",
+ GTK_SIGNAL_FUNC (obj_updated_cb), editor);
- g_signal_connect((priv->client), "obj_removed",
- G_CALLBACK (obj_removed_cb), editor);
+ gtk_signal_connect (GTK_OBJECT (priv->client), "obj_removed",
+ GTK_SIGNAL_FUNC (obj_removed_cb), editor);
}
static void
@@ -923,7 +944,7 @@ real_edit_comp (CompEditor *editor, CalComponent *comp)
priv = editor->priv;
if (priv->comp) {
- g_object_unref((priv->comp));
+ gtk_object_unref (GTK_OBJECT (priv->comp));
priv->comp = NULL;
}
@@ -953,9 +974,9 @@ real_send_comp (CompEditor *editor, CalComponentItipMethod method)
if (itip_send_comp (method, priv->comp, priv->client, NULL)) {
tmp_comp = priv->comp;
- g_object_ref((tmp_comp));
+ gtk_object_ref (GTK_OBJECT (tmp_comp));
comp_editor_edit_comp (editor, tmp_comp);
- g_object_unref((tmp_comp));
+ gtk_object_unref (GTK_OBJECT (tmp_comp));
comp_editor_set_changed (editor, TRUE);
save_comp (editor);
@@ -986,7 +1007,7 @@ comp_editor_edit_comp (CompEditor *editor, CalComponent *comp)
g_return_if_fail (comp != NULL);
g_return_if_fail (IS_CAL_COMPONENT (comp));
- klass = COMP_EDITOR_CLASS (G_OBJECT_GET_CLASS (editor));
+ klass = COMP_EDITOR_CLASS (GTK_OBJECT (editor)->klass);
if (klass->edit_comp)
klass->edit_comp (editor, comp);
@@ -1065,7 +1086,7 @@ comp_editor_send_comp (CompEditor *editor, CalComponentItipMethod method)
g_return_val_if_fail (editor != NULL, FALSE);
g_return_val_if_fail (IS_COMP_EDITOR (editor), FALSE);
- klass = COMP_EDITOR_CLASS (G_OBJECT_GET_CLASS (editor));
+ klass = COMP_EDITOR_CLASS (GTK_OBJECT (editor)->klass);
if (klass->send_comp)
return klass->send_comp (editor, method);
@@ -1105,20 +1126,15 @@ comp_editor_merge_ui (CompEditor *editor,
EPixmap *component_pixmaps)
{
CompEditorPrivate *priv;
- char *path;
g_return_if_fail (editor != NULL);
g_return_if_fail (IS_COMP_EDITOR (editor));
priv = editor->priv;
- path = g_strconcat (EVOLUTION_UIDIR "/", filename, NULL);
-
- bonobo_ui_util_set_ui (priv->uic, EVOLUTION_DATADIR, path, "evolution-calendar", NULL);
+ bonobo_ui_util_set_ui (priv->uic, EVOLUTION_DATADIR, filename, "evolution-calendar");
bonobo_ui_component_add_verb_list_with_data (priv->uic, verbs, editor);
- g_free (path);
-
if (component_pixmaps != NULL)
e_pixmaps_update (priv->uic, component_pixmaps);
}
@@ -1278,7 +1294,7 @@ print_cmd (GtkWidget *widget, gpointer data)
comp = comp_editor_get_current_comp (editor);
print_comp (comp, editor->priv->client, FALSE);
- g_object_unref((comp));
+ gtk_object_unref (GTK_OBJECT (comp));
}
static void
@@ -1291,7 +1307,7 @@ print_preview_cmd (GtkWidget *widget, gpointer data)
comp = comp_editor_get_current_comp (editor);
print_comp (comp, editor->priv->client, TRUE);
- g_object_unref((comp));
+ gtk_object_unref (GTK_OBJECT (comp));
}
static void
@@ -1327,7 +1343,7 @@ page_changed_cb (GtkObject *obj, gpointer data)
priv->changed = TRUE;
if (!priv->warned && priv->existing_org && !priv->user_org) {
- e_notice (editor, GTK_MESSAGE_INFO,
+ e_notice (NULL, GNOME_MESSAGE_BOX_INFO,
_("Changes made to this item may be discarded if an update arrives"));
priv->warned = TRUE;
}
@@ -1351,7 +1367,7 @@ page_summary_changed_cb (GtkObject *obj, const char *summary, gpointer data)
priv->changed = TRUE;
if (!priv->warned && priv->existing_org && !priv->user_org) {
- e_notice (editor, GTK_MESSAGE_INFO,
+ e_notice (NULL, GNOME_MESSAGE_BOX_INFO,
_("Changes made to this item may be discarded if an update arrives"));
priv->warned = TRUE;
}
@@ -1375,7 +1391,7 @@ page_dates_changed_cb (GtkObject *obj,
priv->changed = TRUE;
if (!priv->warned && priv->existing_org && !priv->user_org) {
- e_notice (editor, GTK_MESSAGE_INFO,
+ e_notice (NULL, GNOME_MESSAGE_BOX_INFO,
_("Changes made to this item may be discarded if an update arrives"));
priv->warned = TRUE;
}
@@ -1399,7 +1415,7 @@ obj_updated_cb (CalClient *client, const char *uid, gpointer data)
status = cal_client_get_object (priv->client, uid, &comp);
if (status == CAL_CLIENT_GET_SUCCESS) {
comp_editor_edit_comp (editor, comp);
- g_object_unref((comp));
+ gtk_object_unref (GTK_OBJECT (comp));
} else {
GtkWidget *dlg;
diff --git a/calendar/gui/dialogs/event-editor.c b/calendar/gui/dialogs/event-editor.c
index 9004d96e89..9bef6c6c13 100644
--- a/calendar/gui/dialogs/event-editor.c
+++ b/calendar/gui/dialogs/event-editor.c
@@ -58,7 +58,7 @@ static void event_editor_init (EventEditor *ee);
static void event_editor_set_cal_client (CompEditor *editor, CalClient *client);
static void event_editor_edit_comp (CompEditor *editor, CalComponent *comp);
static gboolean event_editor_send_comp (CompEditor *editor, CalComponentItipMethod method);
-static void event_editor_finalize (GObject *object);
+static void event_editor_destroy (GtkObject *object);
static void schedule_meeting_cmd (GtkWidget *widget, gpointer data);
static void refresh_meeting_cmd (GtkWidget *widget, gpointer data);
@@ -94,27 +94,47 @@ static CompEditorClass *parent_class;
*
* Return value: The type ID of the #EventEditor class.
**/
+GtkType
+event_editor_get_type (void)
+{
+ static GtkType event_editor_type = 0;
+
+ if (!event_editor_type) {
+ static const GtkTypeInfo event_editor_info = {
+ "EventEditor",
+ sizeof (EventEditor),
+ sizeof (EventEditorClass),
+ (GtkClassInitFunc) event_editor_class_init,
+ (GtkObjectInitFunc) event_editor_init,
+ NULL, /* reserved_1 */
+ NULL, /* reserved_2 */
+ (GtkClassInitFunc) NULL
+ };
+
+ event_editor_type = gtk_type_unique (TYPE_COMP_EDITOR,
+ &event_editor_info);
+ }
-E_MAKE_TYPE (event_editor, "EventEditor", EventEditor, event_editor_class_init,
- event_editor_init, TYPE_COMP_EDITOR);
+ return event_editor_type;
+}
/* Class initialization function for the event editor */
static void
event_editor_class_init (EventEditorClass *klass)
{
- GObjectClass *gobject_class;
+ GtkObjectClass *object_class;
CompEditorClass *editor_class;
- gobject_class = (GObjectClass *) klass;
+ object_class = (GtkObjectClass *) klass;
editor_class = (CompEditorClass *) klass;
- parent_class = g_type_class_ref(TYPE_COMP_EDITOR);
+ parent_class = gtk_type_class (TYPE_COMP_EDITOR);
editor_class->set_cal_client = event_editor_set_cal_client;
editor_class->edit_comp = event_editor_edit_comp;
editor_class->send_comp = event_editor_send_comp;
- gobject_class->finalize = event_editor_finalize;
+ object_class->destroy = event_editor_destroy;
}
static void
@@ -162,12 +182,12 @@ init_widgets (EventEditor *ee)
priv = ee->priv;
- g_signal_connect((priv->model), "model_row_changed",
- G_CALLBACK (model_row_changed_cb), ee);
- g_signal_connect((priv->model), "model_rows_inserted",
- G_CALLBACK (row_count_changed_cb), ee);
- g_signal_connect((priv->model), "model_rows_deleted",
- G_CALLBACK (row_count_changed_cb), ee);
+ gtk_signal_connect (GTK_OBJECT (priv->model), "model_row_changed",
+ GTK_SIGNAL_FUNC (model_row_changed_cb), ee);
+ gtk_signal_connect (GTK_OBJECT (priv->model), "model_rows_inserted",
+ GTK_SIGNAL_FUNC (row_count_changed_cb), ee);
+ gtk_signal_connect (GTK_OBJECT (priv->model), "model_rows_deleted",
+ GTK_SIGNAL_FUNC (row_count_changed_cb), ee);
}
/* Object initialization function for the event editor */
@@ -192,36 +212,26 @@ event_editor_construct (EventEditor *ee, CalClient *client)
priv = ee->priv;
priv->event_page = event_page_new ();
- g_object_ref (priv->event_page);
- gtk_object_sink (GTK_OBJECT (priv->event_page));
comp_editor_append_page (COMP_EDITOR (ee),
COMP_EDITOR_PAGE (priv->event_page),
_("Appointment"));
priv->alarm_page = alarm_page_new ();
- g_object_ref (priv->alarm_page);
- gtk_object_sink (GTK_OBJECT (priv->alarm_page));
comp_editor_append_page (COMP_EDITOR (ee),
COMP_EDITOR_PAGE (priv->alarm_page),
_("Reminder"));
priv->recur_page = recurrence_page_new ();
- g_object_ref (priv->recur_page);
- gtk_object_sink (GTK_OBJECT (priv->recur_page));
comp_editor_append_page (COMP_EDITOR (ee),
COMP_EDITOR_PAGE (priv->recur_page),
_("Recurrence"));
priv->sched_page = schedule_page_new (priv->model);
- g_object_ref (priv->sched_page);
- gtk_object_sink (GTK_OBJECT (priv->sched_page));
comp_editor_append_page (COMP_EDITOR (ee),
COMP_EDITOR_PAGE (priv->sched_page),
_("Scheduling"));
priv->meet_page = meeting_page_new (priv->model, client);
- g_object_ref (priv->meet_page);
- gtk_object_sink (GTK_OBJECT (priv->meet_page));
comp_editor_append_page (COMP_EDITOR (ee),
COMP_EDITOR_PAGE (priv->meet_page),
_("Meeting"));
@@ -284,6 +294,7 @@ event_editor_edit_comp (CompEditor *editor, CalComponent *comp)
priv->meeting_shown = FALSE;
} else {
GSList *l;
+ GList *addresses, *ll;
int row;
if (!priv->meeting_shown) {
@@ -303,27 +314,22 @@ event_editor_edit_comp (CompEditor *editor, CalComponent *comp)
if (!comp_editor_get_user_org (editor))
e_meeting_attendee_set_edit_level (ia, E_MEETING_ATTENDEE_EDIT_NONE);
e_meeting_model_add_attendee (priv->model, ia);
-
- g_object_unref(ia);
+
+ gtk_object_unref (GTK_OBJECT (ia));
}
/* If we aren't the organizer we can still change our own status */
if (!comp_editor_get_user_org (editor)) {
- EAccountList *accounts;
- EAccount *account;
- EIterator *it;
-
- accounts = itip_addresses_get ();
- for (it = e_list_get_iterator((EList *)accounts);e_iterator_is_valid(it);e_iterator_next(it)) {
+ addresses = itip_addresses_get ();
+ for (ll = addresses; ll != NULL; ll = ll->next) {
EMeetingAttendee *ia;
-
- account = (EAccount*)e_iterator_get(it);
-
- ia = e_meeting_model_find_attendee (priv->model, account->id->address, &row);
+ ItipAddress *a = ll->data;
+
+ ia = e_meeting_model_find_attendee (priv->model, a->address, &row);
if (ia != NULL)
e_meeting_attendee_set_edit_level (ia, E_MEETING_ATTENDEE_EDIT_STATUS);
}
- g_object_unref(it);
+ itip_addresses_free (addresses);
} else if (cal_client_get_organizer_must_attend (client)) {
EMeetingAttendee *ia;
@@ -363,7 +369,7 @@ event_editor_send_comp (CompEditor *editor, CalComponentItipMethod method)
client = e_meeting_model_get_cal_client (priv->model);
result = itip_send_comp (CAL_COMPONENT_METHOD_CANCEL, comp, client, NULL);
- g_object_unref((comp));
+ gtk_object_unref (GTK_OBJECT (comp));
if (!result)
return FALSE;
@@ -378,7 +384,7 @@ event_editor_send_comp (CompEditor *editor, CalComponentItipMethod method)
/* Destroy handler for the event editor */
static void
-event_editor_finalize (GObject *object)
+event_editor_destroy (GtkObject *object)
{
EventEditor *ee;
EventEditorPrivate *priv;
@@ -389,18 +395,19 @@ event_editor_finalize (GObject *object)
ee = EVENT_EDITOR (object);
priv = ee->priv;
- g_object_unref((priv->event_page));
- g_object_unref((priv->alarm_page));
- g_object_unref((priv->recur_page));
- g_object_unref((priv->meet_page));
- g_object_unref((priv->sched_page));
+ gtk_object_unref (GTK_OBJECT (priv->event_page));
+ gtk_object_unref (GTK_OBJECT (priv->alarm_page));
+ gtk_object_unref (GTK_OBJECT (priv->recur_page));
+ gtk_object_unref (GTK_OBJECT (priv->meet_page));
+ gtk_object_unref (GTK_OBJECT (priv->sched_page));
- g_object_unref((priv->model));
+ gtk_object_destroy (GTK_OBJECT (priv->model));
+ gtk_object_unref (GTK_OBJECT (priv->model));
g_free (priv);
- if (G_OBJECT_CLASS (parent_class)->finalize)
- (* G_OBJECT_CLASS (parent_class)->finalize) (object);
+ if (GTK_OBJECT_CLASS (parent_class)->destroy)
+ (* GTK_OBJECT_CLASS (parent_class)->destroy) (object);
}
/**
@@ -417,7 +424,7 @@ event_editor_new (CalClient *client)
{
EventEditor *ee;
- ee = EVENT_EDITOR (g_object_new (TYPE_EVENT_EDITOR, NULL));
+ ee = EVENT_EDITOR (gtk_type_new (TYPE_EVENT_EDITOR));
return event_editor_construct (ee, client);
}
diff --git a/calendar/gui/dialogs/event-page.c b/calendar/gui/dialogs/event-page.c
index 384a39c419..c7ed201e1f 100644
--- a/calendar/gui/dialogs/event-page.c
+++ b/calendar/gui/dialogs/event-page.c
@@ -25,10 +25,9 @@
#include <config.h>
#endif
-#include <string.h>
#include <gtk/gtksignal.h>
-#include <gtk/gtktextview.h>
#include <gtk/gtktogglebutton.h>
+#include <libgnome/gnome-defs.h>
#include <libgnome/gnome-i18n.h>
#include <glade/glade.h>
#include <gal/widgets/e-unicode.h>
@@ -95,7 +94,7 @@ struct _EventPagePrivate {
static void event_page_class_init (EventPageClass *class);
static void event_page_init (EventPage *epage);
-static void event_page_finalize (GObject *object);
+static void event_page_destroy (GtkObject *object);
static GtkWidget *event_page_get_widget (CompEditorPage *page);
static void event_page_focus_main_widget (CompEditorPage *page);
@@ -116,21 +115,41 @@ static CompEditorPageClass *parent_class = NULL;
*
* Return value: The type ID of the #EventPage class.
**/
+GtkType
+event_page_get_type (void)
+{
+ static GtkType event_page_type;
+
+ if (!event_page_type) {
+ static const GtkTypeInfo event_page_info = {
+ "EventPage",
+ sizeof (EventPage),
+ sizeof (EventPageClass),
+ (GtkClassInitFunc) event_page_class_init,
+ (GtkObjectInitFunc) event_page_init,
+ NULL, /* reserved_1 */
+ NULL, /* reserved_2 */
+ (GtkClassInitFunc) NULL
+ };
+
+ event_page_type = gtk_type_unique (TYPE_COMP_EDITOR_PAGE,
+ &event_page_info);
+ }
-E_MAKE_TYPE (event_page, "EventPage", EventPage, event_page_class_init, event_page_init,
- TYPE_COMP_EDITOR_PAGE);
+ return event_page_type;
+}
/* Class initialization function for the event page */
static void
event_page_class_init (EventPageClass *class)
{
CompEditorPageClass *editor_page_class;
- GObjectClass *object_class;
+ GtkObjectClass *object_class;
editor_page_class = (CompEditorPageClass *) class;
- object_class = (GObjectClass *) class;
+ object_class = (GtkObjectClass *) class;
- parent_class = g_type_class_ref (TYPE_COMP_EDITOR_PAGE);
+ parent_class = gtk_type_class (TYPE_COMP_EDITOR_PAGE);
editor_page_class->get_widget = event_page_get_widget;
editor_page_class->focus_main_widget = event_page_focus_main_widget;
@@ -139,7 +158,7 @@ event_page_class_init (EventPageClass *class)
editor_page_class->set_summary = event_page_set_summary;
editor_page_class->set_dates = event_page_set_dates;
- object_class->finalize = event_page_finalize;
+ object_class->destroy = event_page_destroy;
}
/* Object initialization function for the event page */
@@ -182,7 +201,7 @@ event_page_init (EventPage *epage)
/* Destroy handler for the event page */
static void
-event_page_finalize (GObject *object)
+event_page_destroy (GtkObject *object)
{
EventPage *epage;
EventPagePrivate *priv;
@@ -202,15 +221,15 @@ event_page_finalize (GObject *object)
}
if (priv->xml) {
- g_object_unref((priv->xml));
+ gtk_object_unref (GTK_OBJECT (priv->xml));
priv->xml = NULL;
}
g_free (priv);
epage->priv = NULL;
- if (G_OBJECT_CLASS (parent_class)->finalize)
- (* G_OBJECT_CLASS (parent_class)->finalize) (object);
+ if (GTK_OBJECT_CLASS (parent_class)->destroy)
+ (* GTK_OBJECT_CLASS (parent_class)->destroy) (object);
}
@@ -349,7 +368,7 @@ update_time (EventPage *epage, CalComponentDateTime *start_date, CalComponentDat
gtk_signal_handler_block_by_data (GTK_OBJECT (priv->start_time),
epage);
- g_signal_handlers_block_matched (priv->end_time, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, epage);
+ gtk_signal_handler_block_by_data (GTK_OBJECT (priv->end_time), epage);
e_date_edit_set_date (E_DATE_EDIT (priv->start_time), start_tt->year,
start_tt->month, start_tt->day);
@@ -370,7 +389,7 @@ update_time (EventPage *epage, CalComponentDateTime *start_date, CalComponentDat
are the same. */
gtk_signal_handler_block_by_data (GTK_OBJECT (priv->start_timezone),
epage);
- g_signal_handlers_block_matched (priv->end_timezone, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, epage);
+ gtk_signal_handler_block_by_data (GTK_OBJECT (priv->end_timezone), epage);
e_timezone_entry_set_timezone (E_TIMEZONE_ENTRY (priv->start_timezone),
start_zone);
@@ -397,12 +416,12 @@ clear_widgets (EventPage *epage)
/* Summary, description */
e_dialog_editable_set (priv->summary, NULL);
e_dialog_editable_set (priv->location, NULL);
- gtk_text_buffer_set_text (gtk_text_view_get_buffer (GTK_TEXT_VIEW (priv->description)), "", 0);
+ e_dialog_editable_set (priv->description, NULL);
/* Start and end times */
gtk_signal_handler_block_by_data (GTK_OBJECT (priv->start_time),
epage);
- g_signal_handlers_block_matched (priv->end_time, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, epage);
+ gtk_signal_handler_block_by_data (GTK_OBJECT (priv->end_time), epage);
e_date_edit_set_time (E_DATE_EDIT (priv->start_time), 0);
e_date_edit_set_time (E_DATE_EDIT (priv->end_time), 0);
@@ -429,8 +448,8 @@ clear_widgets (EventPage *epage)
static void
contacts_changed_cb (BonoboListener *listener,
- const char *event_name,
- const CORBA_any *arg,
+ char *event_name,
+ CORBA_any *arg,
CORBA_Environment *ev,
gpointer data)
{
@@ -485,8 +504,7 @@ event_page_fill_widgets (CompEditorPage *page, CalComponent *comp)
cal_component_get_description_list (comp, &l);
if (l) {
text = *(CalComponentText *)l->data;
- gtk_text_buffer_set_text (gtk_text_view_get_buffer (GTK_TEXT_VIEW (priv->description)),
- text.value, -1);
+ e_dialog_editable_set (priv->description, text.value);
}
cal_component_free_text_list (l);
@@ -582,12 +600,9 @@ event_page_fill_component (CompEditorPage *page, CalComponent *comp)
char *cat, *str;
CalComponentClassification classif;
CalComponentTransparency transparency;
- GtkTextBuffer *text_buffer;
- GtkTextIter text_iter_start, text_iter_end;
epage = EVENT_PAGE (page);
priv = epage->priv;
- text_buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (priv->description));
/* Summary */
@@ -619,10 +634,7 @@ event_page_fill_component (CompEditorPage *page, CalComponent *comp)
/* Description */
- gtk_text_buffer_get_start_iter (text_buffer, &text_iter_start);
- gtk_text_buffer_get_end_iter (text_buffer, &text_iter_end);
- str = gtk_text_buffer_get_text (text_buffer, &text_iter_start, &text_iter_end, FALSE);
-
+ str = e_dialog_editable_get (priv->description);
if (!str || strlen (str) == 0)
cal_component_set_description_list (comp, NULL);
else {
@@ -773,24 +785,20 @@ get_widgets (EventPage *epage)
/* Get the GtkAccelGroup from the toplevel window, so we can install
it when the notebook page is mapped. */
toplevel = gtk_widget_get_toplevel (priv->main);
- accel_groups = gtk_accel_groups_from_object (G_OBJECT (toplevel));
+ accel_groups = gtk_accel_groups_from_object (GTK_OBJECT (toplevel));
if (accel_groups) {
page->accel_group = accel_groups->data;
gtk_accel_group_ref (page->accel_group);
}
gtk_widget_ref (priv->main);
- gtk_container_remove (GTK_CONTAINER (priv->main->parent), priv->main);
+ gtk_widget_unparent (priv->main);
priv->summary = GW ("general-summary");
priv->location = GW ("location");
- /* Glade's visibility flag doesn't seem to work for custom widgets */
priv->start_time = GW ("start-time");
- gtk_widget_show (priv->start_time);
priv->end_time = GW ("end-time");
- gtk_widget_show (priv->end_time);
-
priv->start_timezone = GW ("start-timezone");
priv->end_timezone = GW ("end-timezone");
priv->all_day_event = GW ("all-day-event");
@@ -1015,22 +1023,22 @@ times_updated (EventPage *epage, gboolean adjust_end_time)
if (set_start_date) {
- g_signal_handlers_block_matched (priv->start_time, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, epage);
+ gtk_signal_handler_block_by_data (GTK_OBJECT (priv->start_time), epage);
e_date_edit_set_date (E_DATE_EDIT (priv->start_time),
start_tt.year, start_tt.month,
start_tt.day);
e_date_edit_set_time_of_day (E_DATE_EDIT (priv->start_time),
start_tt.hour, start_tt.minute);
- g_signal_handlers_unblock_matched (priv->start_time, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, epage);
+ gtk_signal_handler_unblock_by_data (GTK_OBJECT (priv->start_time), epage);
}
if (set_end_date) {
- g_signal_handlers_block_matched (priv->end_time, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, epage);
+ gtk_signal_handler_block_by_data (GTK_OBJECT (priv->end_time), epage);
e_date_edit_set_date (E_DATE_EDIT (priv->end_time),
end_tt.year, end_tt.month, end_tt.day);
e_date_edit_set_time_of_day (E_DATE_EDIT (priv->end_time),
end_tt.hour, end_tt.minute);
- g_signal_handlers_unblock_matched (priv->end_time, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, epage);
+ gtk_signal_handler_unblock_by_data (GTK_OBJECT (priv->end_time), epage);
}
/* Notify upstream */
@@ -1279,7 +1287,6 @@ static gboolean
init_widgets (EventPage *epage)
{
EventPagePrivate *priv;
- GtkTextBuffer *text_buffer;
char *location;
icaltimezone *zone;
@@ -1295,77 +1302,71 @@ init_widgets (EventPage *epage)
epage, NULL);
/* Summary */
- g_signal_connect((priv->summary), "changed",
- G_CALLBACK (summary_changed_cb), epage);
-
- /* Description */
- text_buffer = gtk_text_buffer_new (NULL);
- gtk_text_view_set_buffer (GTK_TEXT_VIEW (priv->description), text_buffer);
- g_object_unref (text_buffer);
+ gtk_signal_connect (GTK_OBJECT (priv->summary), "changed",
+ GTK_SIGNAL_FUNC (summary_changed_cb), epage);
- gtk_text_view_set_wrap_mode (GTK_TEXT_VIEW (priv->description), GTK_WRAP_WORD);
+ /* Description - turn on word wrap. */
+ gtk_text_set_word_wrap (GTK_TEXT (priv->description), TRUE);
/* Start and end times */
- g_signal_connect((priv->start_time), "changed",
- G_CALLBACK (date_changed_cb), epage);
- g_signal_connect((priv->end_time), "changed",
- G_CALLBACK (date_changed_cb), epage);
+ gtk_signal_connect (GTK_OBJECT (priv->start_time), "changed",
+ GTK_SIGNAL_FUNC (date_changed_cb), epage);
+ gtk_signal_connect (GTK_OBJECT (priv->end_time), "changed",
+ GTK_SIGNAL_FUNC (date_changed_cb), epage);
- g_signal_connect((priv->start_timezone), "changed",
- G_CALLBACK (start_timezone_changed_cb), epage);
- g_signal_connect((priv->end_timezone), "changed",
- G_CALLBACK (end_timezone_changed_cb), epage);
+ gtk_signal_connect (GTK_OBJECT (priv->start_timezone), "changed",
+ GTK_SIGNAL_FUNC (start_timezone_changed_cb), epage);
+ gtk_signal_connect (GTK_OBJECT (priv->end_timezone), "changed",
+ GTK_SIGNAL_FUNC (end_timezone_changed_cb), epage);
- g_signal_connect((priv->all_day_event), "toggled",
- G_CALLBACK (all_day_event_toggled_cb), epage);
+ gtk_signal_connect (GTK_OBJECT (priv->all_day_event), "toggled",
+ GTK_SIGNAL_FUNC (all_day_event_toggled_cb), epage);
/* Contacts button */
- g_signal_connect((priv->contacts_btn), "clicked",
- G_CALLBACK (contacts_clicked_cb), epage);
+ gtk_signal_connect (GTK_OBJECT (priv->contacts_btn), "clicked",
+ GTK_SIGNAL_FUNC (contacts_clicked_cb), epage);
/* Categories button */
- g_signal_connect((priv->categories_btn), "clicked",
- G_CALLBACK (categories_clicked_cb), epage);
+ gtk_signal_connect (GTK_OBJECT (priv->categories_btn), "clicked",
+ GTK_SIGNAL_FUNC (categories_clicked_cb), epage);
/* Connect the default signal handler to use to make sure we notify
* upstream of changes to the widget values.
*/
- /* Belongs to priv->description */
- g_signal_connect((text_buffer), "changed",
- G_CALLBACK (field_changed_cb), epage);
-
- g_signal_connect((priv->summary), "changed",
- G_CALLBACK (field_changed_cb), epage);
- g_signal_connect((priv->location), "changed",
- G_CALLBACK (field_changed_cb), epage);
- g_signal_connect((priv->start_time), "changed",
- G_CALLBACK (field_changed_cb), epage);
- g_signal_connect((priv->end_time), "changed",
- G_CALLBACK (field_changed_cb), epage);
- g_signal_connect((priv->start_timezone), "changed",
- G_CALLBACK (field_changed_cb), epage);
- g_signal_connect((priv->end_timezone), "changed",
- G_CALLBACK (field_changed_cb), epage);
- g_signal_connect((priv->all_day_event), "toggled",
- G_CALLBACK (field_changed_cb), epage);
- g_signal_connect((priv->classification_public),
- "toggled", G_CALLBACK (field_changed_cb),
+ gtk_signal_connect (GTK_OBJECT (priv->summary), "changed",
+ GTK_SIGNAL_FUNC (field_changed_cb), epage);
+ gtk_signal_connect (GTK_OBJECT (priv->location), "changed",
+ GTK_SIGNAL_FUNC (field_changed_cb), epage);
+ gtk_signal_connect (GTK_OBJECT (priv->start_time), "changed",
+ GTK_SIGNAL_FUNC (field_changed_cb), epage);
+ gtk_signal_connect (GTK_OBJECT (priv->end_time), "changed",
+ GTK_SIGNAL_FUNC (field_changed_cb), epage);
+ gtk_signal_connect (GTK_OBJECT (priv->start_timezone), "changed",
+ GTK_SIGNAL_FUNC (field_changed_cb), epage);
+ gtk_signal_connect (GTK_OBJECT (priv->end_timezone), "changed",
+ GTK_SIGNAL_FUNC (field_changed_cb), epage);
+ gtk_signal_connect (GTK_OBJECT (priv->all_day_event), "toggled",
+ GTK_SIGNAL_FUNC (field_changed_cb), epage);
+ gtk_signal_connect (GTK_OBJECT (priv->description), "changed",
+ GTK_SIGNAL_FUNC (field_changed_cb), epage);
+ gtk_signal_connect (GTK_OBJECT (priv->classification_public),
+ "toggled", GTK_SIGNAL_FUNC (field_changed_cb),
epage);
- g_signal_connect((priv->classification_private),
- "toggled", G_CALLBACK (field_changed_cb),
+ gtk_signal_connect (GTK_OBJECT (priv->classification_private),
+ "toggled", GTK_SIGNAL_FUNC (field_changed_cb),
epage);
- g_signal_connect((priv->classification_confidential),
- "toggled", G_CALLBACK (field_changed_cb),
+ gtk_signal_connect (GTK_OBJECT (priv->classification_confidential),
+ "toggled", GTK_SIGNAL_FUNC (field_changed_cb),
epage);
- g_signal_connect((priv->show_time_as_free),
- "toggled", G_CALLBACK (field_changed_cb),
+ gtk_signal_connect (GTK_OBJECT (priv->show_time_as_free),
+ "toggled", GTK_SIGNAL_FUNC (field_changed_cb),
epage);
- g_signal_connect((priv->show_time_as_busy),
- "toggled", G_CALLBACK (field_changed_cb),
+ gtk_signal_connect (GTK_OBJECT (priv->show_time_as_busy),
+ "toggled", GTK_SIGNAL_FUNC (field_changed_cb),
epage);
- g_signal_connect((priv->categories), "changed",
- G_CALLBACK (field_changed_cb), epage);
+ gtk_signal_connect (GTK_OBJECT (priv->categories), "changed",
+ GTK_SIGNAL_FUNC (field_changed_cb), epage);
/* Create the contacts entry, a corba control from the address book. */
priv->corba_select_names = comp_editor_create_contacts_component ();
@@ -1407,7 +1408,7 @@ event_page_construct (EventPage *epage)
priv = epage->priv;
priv->xml = glade_xml_new (EVOLUTION_GLADEDIR "/event-page.glade",
- NULL, NULL);
+ NULL);
if (!priv->xml) {
g_message ("event_page_construct(): "
"Could not load the Glade XML file!");
@@ -1442,9 +1443,9 @@ event_page_new (void)
{
EventPage *epage;
- epage = g_object_new (TYPE_EVENT_PAGE, NULL);
+ epage = gtk_type_new (TYPE_EVENT_PAGE);
if (!event_page_construct (epage)) {
- g_object_unref ((epage));
+ gtk_object_unref (GTK_OBJECT (epage));
return NULL;
}
@@ -1464,9 +1465,5 @@ GtkWidget *make_timezone_entry (void);
GtkWidget *
make_timezone_entry (void)
{
- GtkWidget *w;
-
- w = e_timezone_entry_new ();
- gtk_widget_show (w);
- return w;
+ return e_timezone_entry_new ();
}
diff --git a/calendar/gui/dialogs/event-page.glade b/calendar/gui/dialogs/event-page.glade
index 6693c8af65..5f6fbfe14c 100644
--- a/calendar/gui/dialogs/event-page.glade
+++ b/calendar/gui/dialogs/event-page.glade
@@ -1,662 +1,601 @@
-<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*-->
-<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd">
-
-<glade-interface>
-
-<widget class="GtkWindow" id="event-toplevel">
- <property name="title" translatable="yes">window1</property>
- <property name="type">GTK_WINDOW_TOPLEVEL</property>
- <property name="window_position">GTK_WIN_POS_NONE</property>
- <property name="modal">False</property>
- <property name="resizable">True</property>
- <property name="destroy_with_parent">False</property>
-
- <child>
- <widget class="GtkVBox" id="event-page">
- <property name="border_width">4</property>
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">6</property>
-
+<?xml version="1.0"?>
+<GTK-Interface>
+
+<project>
+ <name>event-page</name>
+ <program_name>event-page</program_name>
+ <directory></directory>
+ <source_directory>.</source_directory>
+ <pixmaps_directory>pixmaps</pixmaps_directory>
+ <language>C</language>
+ <gnome_support>True</gnome_support>
+ <gettext_support>True</gettext_support>
+ <output_main_file>False</output_main_file>
+ <output_support_files>False</output_support_files>
+ <output_build_files>False</output_build_files>
+</project>
+
+<widget>
+ <class>GtkWindow</class>
+ <name>event-toplevel</name>
+ <visible>False</visible>
+ <title>window1</title>
+ <type>GTK_WINDOW_TOPLEVEL</type>
+ <position>GTK_WIN_POS_NONE</position>
+ <modal>False</modal>
+ <allow_shrink>False</allow_shrink>
+ <allow_grow>True</allow_grow>
+ <auto_shrink>False</auto_shrink>
+
+ <widget>
+ <class>GtkVBox</class>
+ <name>event-page</name>
+ <border_width>4</border_width>
+ <homogeneous>False</homogeneous>
+ <spacing>6</spacing>
+
+ <widget>
+ <class>GtkTable</class>
+ <name>table11</name>
+ <rows>2</rows>
+ <columns>2</columns>
+ <homogeneous>False</homogeneous>
+ <row_spacing>4</row_spacing>
+ <column_spacing>4</column_spacing>
<child>
- <widget class="GtkTable" id="table11">
- <property name="visible">True</property>
- <property name="n_rows">2</property>
- <property name="n_columns">2</property>
- <property name="homogeneous">False</property>
- <property name="row_spacing">4</property>
- <property name="column_spacing">4</property>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>True</fill>
+ </child>
- <child>
- <widget class="GtkLabel" id="label56">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Su_mmary:</property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">7.45058e-09</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="mnemonic_widget">general-summary</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
- </packing>
- </child>
+ <widget>
+ <class>GtkLabel</class>
+ <name>label56</name>
+ <label>Su_mmary:</label>
+ <justify>GTK_JUSTIFY_CENTER</justify>
+ <wrap>False</wrap>
+ <xalign>7.45058e-09</xalign>
+ <yalign>0.5</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <default_focus_target>general-summary</default_focus_target>
+ <child>
+ <left_attach>0</left_attach>
+ <right_attach>1</right_attach>
+ <top_attach>0</top_attach>
+ <bottom_attach>1</bottom_attach>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <xexpand>False</xexpand>
+ <yexpand>False</yexpand>
+ <xshrink>False</xshrink>
+ <yshrink>False</yshrink>
+ <xfill>True</xfill>
+ <yfill>False</yfill>
+ </child>
+ </widget>
+
+ <widget>
+ <class>GtkEntry</class>
+ <name>general-summary</name>
+ <can_focus>True</can_focus>
+ <editable>True</editable>
+ <text_visible>True</text_visible>
+ <text_max_length>0</text_max_length>
+ <text></text>
+ <child>
+ <left_attach>1</left_attach>
+ <right_attach>2</right_attach>
+ <top_attach>0</top_attach>
+ <bottom_attach>1</bottom_attach>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <xexpand>True</xexpand>
+ <yexpand>False</yexpand>
+ <xshrink>False</xshrink>
+ <yshrink>False</yshrink>
+ <xfill>True</xfill>
+ <yfill>False</yfill>
+ </child>
+ </widget>
+
+ <widget>
+ <class>GtkLabel</class>
+ <name>label61</name>
+ <label>L_ocation:</label>
+ <justify>GTK_JUSTIFY_CENTER</justify>
+ <wrap>False</wrap>
+ <xalign>7.45058e-09</xalign>
+ <yalign>0.5</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <default_focus_target>location</default_focus_target>
+ <child>
+ <left_attach>0</left_attach>
+ <right_attach>1</right_attach>
+ <top_attach>1</top_attach>
+ <bottom_attach>2</bottom_attach>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <xexpand>False</xexpand>
+ <yexpand>False</yexpand>
+ <xshrink>False</xshrink>
+ <yshrink>False</yshrink>
+ <xfill>True</xfill>
+ <yfill>False</yfill>
+ </child>
+ </widget>
+
+ <widget>
+ <class>GtkEntry</class>
+ <name>location</name>
+ <can_focus>True</can_focus>
+ <editable>True</editable>
+ <text_visible>True</text_visible>
+ <text_max_length>0</text_max_length>
+ <text></text>
+ <child>
+ <left_attach>1</left_attach>
+ <right_attach>2</right_attach>
+ <top_attach>1</top_attach>
+ <bottom_attach>2</bottom_attach>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <xexpand>True</xexpand>
+ <yexpand>False</yexpand>
+ <xshrink>False</xshrink>
+ <yshrink>False</yshrink>
+ <xfill>True</xfill>
+ <yfill>False</yfill>
+ </child>
+ </widget>
+ </widget>
- <child>
- <widget class="GtkEntry" id="general-summary">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="editable">True</property>
- <property name="visibility">True</property>
- <property name="max_length">0</property>
- <property name="text" translatable="yes"></property>
- <property name="has_frame">True</property>
- <property name="invisible_char" translatable="yes">*</property>
- <property name="activates_default">False</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="y_options"></property>
- </packing>
- </child>
+ <widget>
+ <class>GtkFrame</class>
+ <name>frame31</name>
+ <label>Date &amp; Time</label>
+ <label_xalign>0</label_xalign>
+ <shadow_type>GTK_SHADOW_ETCHED_IN</shadow_type>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
+ </child>
+ <widget>
+ <class>GtkTable</class>
+ <name>table12</name>
+ <border_width>4</border_width>
+ <rows>2</rows>
+ <columns>4</columns>
+ <homogeneous>False</homogeneous>
+ <row_spacing>4</row_spacing>
+ <column_spacing>4</column_spacing>
+
+ <widget>
+ <class>GtkLabel</class>
+ <name>label57</name>
+ <label>_Start time:</label>
+ <justify>GTK_JUSTIFY_CENTER</justify>
+ <wrap>False</wrap>
+ <xalign>0</xalign>
+ <yalign>0.5</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <focus_target>start-time</focus_target>
<child>
- <widget class="GtkLabel" id="label61">
- <property name="visible">True</property>
- <property name="label" translatable="yes">L_ocation:</property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">7.45058e-09</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="mnemonic_widget">location</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
- </packing>
+ <left_attach>0</left_attach>
+ <right_attach>1</right_attach>
+ <top_attach>0</top_attach>
+ <bottom_attach>1</bottom_attach>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <xexpand>False</xexpand>
+ <yexpand>False</yexpand>
+ <xshrink>False</xshrink>
+ <yshrink>False</yshrink>
+ <xfill>True</xfill>
+ <yfill>False</yfill>
</child>
+ </widget>
+ <widget>
+ <class>GtkLabel</class>
+ <name>label58</name>
+ <label>_End time:</label>
+ <justify>GTK_JUSTIFY_CENTER</justify>
+ <wrap>False</wrap>
+ <xalign>0</xalign>
+ <yalign>0.5</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <focus_target>end-time</focus_target>
<child>
- <widget class="GtkEntry" id="location">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="editable">True</property>
- <property name="visibility">True</property>
- <property name="max_length">0</property>
- <property name="text" translatable="yes"></property>
- <property name="has_frame">True</property>
- <property name="invisible_char" translatable="yes">*</property>
- <property name="activates_default">False</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="y_options"></property>
- </packing>
+ <left_attach>0</left_attach>
+ <right_attach>1</right_attach>
+ <top_attach>1</top_attach>
+ <bottom_attach>2</bottom_attach>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <xexpand>False</xexpand>
+ <yexpand>False</yexpand>
+ <xshrink>False</xshrink>
+ <yshrink>False</yshrink>
+ <xfill>True</xfill>
+ <yfill>False</yfill>
</child>
</widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkFrame" id="frame31">
- <property name="visible">True</property>
- <property name="label_xalign">0</property>
- <property name="label_yalign">0.5</property>
- <property name="shadow_type">GTK_SHADOW_ETCHED_IN</property>
+ <widget>
+ <class>Custom</class>
+ <name>start-time</name>
+ <can_focus>True</can_focus>
+ <creation_function>make_date_edit</creation_function>
+ <string1></string1>
+ <string2></string2>
+ <int1>0</int1>
+ <int2>0</int2>
+ <last_modification_time>Tue, 16 May 2000 19:11:05 GMT</last_modification_time>
<child>
- <widget class="GtkTable" id="table12">
- <property name="border_width">4</property>
- <property name="visible">True</property>
- <property name="n_rows">2</property>
- <property name="n_columns">4</property>
- <property name="homogeneous">False</property>
- <property name="row_spacing">4</property>
- <property name="column_spacing">4</property>
-
- <child>
- <widget class="GtkLabel" id="label57">
- <property name="visible">True</property>
- <property name="label" translatable="yes">_Start time:</property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="mnemonic_widget">start-time</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label58">
- <property name="visible">True</property>
- <property name="label" translatable="yes">_End time:</property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="mnemonic_widget">end-time</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="Custom" id="start-time">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="creation_function">make_date_edit</property>
- <property name="string1"></property>
- <property name="string2"></property>
- <property name="int1">0</property>
- <property name="int2">0</property>
- <property name="last_modification_time">Tue, 16 May 2000 19:11:05 GMT</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="x_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="Custom" id="end-time">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="creation_function">make_date_edit</property>
- <property name="int1">0</property>
- <property name="int2">0</property>
- <property name="last_modification_time">Tue, 16 May 2000 19:11:10 GMT</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="x_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="Custom" id="end-timezone">
- <property name="visible">True</property>
- <property name="creation_function">make_timezone_entry</property>
- <property name="int1">0</property>
- <property name="int2">0</property>
- <property name="last_modification_time">Mon, 18 Jun 2001 23:51:40 GMT</property>
- </widget>
- <packing>
- <property name="left_attach">2</property>
- <property name="right_attach">3</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="x_options"></property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="Custom" id="start-timezone">
- <property name="visible">True</property>
- <property name="creation_function">make_timezone_entry</property>
- <property name="int1">0</property>
- <property name="int2">0</property>
- <property name="last_modification_time">Mon, 18 Jun 2001 23:51:34 GMT</property>
- </widget>
- <packing>
- <property name="left_attach">2</property>
- <property name="right_attach">3</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkAlignment" id="alignment1">
- <property name="visible">True</property>
- <property name="xalign">1</property>
- <property name="yalign">7.45058e-09</property>
- <property name="xscale">0</property>
- <property name="yscale">0</property>
-
- <child>
- <widget class="GtkCheckButton" id="all-day-event">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">A_ll day event</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="active">False</property>
- <property name="inconsistent">False</property>
- <property name="draw_indicator">True</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="left_attach">3</property>
- <property name="right_attach">4</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">2</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
- </widget>
+ <left_attach>1</left_attach>
+ <right_attach>2</right_attach>
+ <top_attach>0</top_attach>
+ <bottom_attach>1</bottom_attach>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <xexpand>False</xexpand>
+ <yexpand>True</yexpand>
+ <xshrink>False</xshrink>
+ <yshrink>False</yshrink>
+ <xfill>False</xfill>
+ <yfill>True</yfill>
</child>
+ </widget>
+ <widget>
+ <class>Custom</class>
+ <name>end-time</name>
+ <can_focus>True</can_focus>
+ <creation_function>make_date_edit</creation_function>
+ <int1>0</int1>
+ <int2>0</int2>
+ <last_modification_time>Tue, 16 May 2000 19:11:10 GMT</last_modification_time>
<child>
- <widget class="GtkLabel" id="label62">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Date &amp; Time</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="type">label_item</property>
- </packing>
+ <left_attach>1</left_attach>
+ <right_attach>2</right_attach>
+ <top_attach>1</top_attach>
+ <bottom_attach>2</bottom_attach>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <xexpand>False</xexpand>
+ <yexpand>True</yexpand>
+ <xshrink>False</xshrink>
+ <yshrink>False</yshrink>
+ <xfill>False</xfill>
+ <yfill>True</yfill>
</child>
</widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkScrolledWindow" id="scrolledwindow12">
- <property name="visible">True</property>
- <property name="hscrollbar_policy">GTK_POLICY_NEVER</property>
- <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
- <property name="shadow_type">GTK_SHADOW_IN</property>
- <property name="window_placement">GTK_CORNER_TOP_LEFT</property>
+ <widget>
+ <class>Custom</class>
+ <name>end-timezone</name>
+ <creation_function>make_timezone_entry</creation_function>
+ <int1>0</int1>
+ <int2>0</int2>
+ <last_modification_time>Mon, 18 Jun 2001 23:51:40 GMT</last_modification_time>
<child>
- <widget class="GtkTextView" id="description">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="editable">True</property>
- <property name="justification">GTK_JUSTIFY_LEFT</property>
- <property name="wrap_mode">GTK_WRAP_WORD</property>
- <property name="cursor_visible">True</property>
- <property name="pixels_above_lines">0</property>
- <property name="pixels_below_lines">0</property>
- <property name="pixels_inside_wrap">0</property>
- <property name="left_margin">0</property>
- <property name="right_margin">0</property>
- <property name="indent">0</property>
- <property name="text" translatable="yes"></property>
- </widget>
+ <left_attach>2</left_attach>
+ <right_attach>3</right_attach>
+ <top_attach>1</top_attach>
+ <bottom_attach>2</bottom_attach>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <xexpand>False</xexpand>
+ <yexpand>False</yexpand>
+ <xshrink>False</xshrink>
+ <yshrink>False</yshrink>
+ <xfill>False</xfill>
+ <yfill>True</yfill>
</child>
</widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkHBox" id="hbox54">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">4</property>
+ <widget>
+ <class>Custom</class>
+ <name>start-timezone</name>
+ <creation_function>make_timezone_entry</creation_function>
+ <int1>0</int1>
+ <int2>0</int2>
+ <last_modification_time>Mon, 18 Jun 2001 23:51:34 GMT</last_modification_time>
<child>
- <widget class="GtkFrame" id="frame32">
- <property name="visible">True</property>
- <property name="label_xalign">0</property>
- <property name="label_yalign">0.5</property>
- <property name="shadow_type">GTK_SHADOW_ETCHED_IN</property>
-
- <child>
- <widget class="GtkHBox" id="hbox52">
- <property name="border_width">2</property>
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">4</property>
-
- <child>
- <widget class="GtkRadioButton" id="classification-public">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">Pu_blic</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="active">True</property>
- <property name="inconsistent">False</property>
- <property name="draw_indicator">True</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkRadioButton" id="classification-private">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">Pri_vate</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="active">False</property>
- <property name="inconsistent">False</property>
- <property name="draw_indicator">True</property>
- <property name="group">classification-public</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkRadioButton" id="classification-confidential">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">Con_fidential</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="active">False</property>
- <property name="inconsistent">False</property>
- <property name="draw_indicator">True</property>
- <property name="group">classification-public</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
- </widget>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label63">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Classification</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="type">label_item</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">True</property>
- </packing>
+ <left_attach>2</left_attach>
+ <right_attach>3</right_attach>
+ <top_attach>0</top_attach>
+ <bottom_attach>1</bottom_attach>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <xexpand>False</xexpand>
+ <yexpand>False</yexpand>
+ <xshrink>False</xshrink>
+ <yshrink>False</yshrink>
+ <xfill>True</xfill>
+ <yfill>True</yfill>
</child>
+ </widget>
+ <widget>
+ <class>GtkAlignment</class>
+ <name>alignment1</name>
+ <xalign>1</xalign>
+ <yalign>7.45058e-09</yalign>
+ <xscale>0</xscale>
+ <yscale>0</yscale>
<child>
- <widget class="GtkFrame" id="show-time-frame">
- <property name="visible">True</property>
- <property name="label_xalign">0</property>
- <property name="label_yalign">0.5</property>
- <property name="shadow_type">GTK_SHADOW_ETCHED_IN</property>
-
- <child>
- <widget class="GtkHBox" id="hbox55">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">4</property>
-
- <child>
- <widget class="GtkRadioButton" id="show-time-as-free">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">F_ree</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="active">False</property>
- <property name="inconsistent">False</property>
- <property name="draw_indicator">True</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkRadioButton" id="show-time-as-busy">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">B_usy</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="active">False</property>
- <property name="inconsistent">False</property>
- <property name="draw_indicator">True</property>
- <property name="group">show-time-as-free</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
- </widget>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label64">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Show Time As</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="type">label_item</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">True</property>
- </packing>
+ <left_attach>3</left_attach>
+ <right_attach>4</right_attach>
+ <top_attach>0</top_attach>
+ <bottom_attach>2</bottom_attach>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <xexpand>True</xexpand>
+ <yexpand>False</yexpand>
+ <xshrink>False</xshrink>
+ <yshrink>False</yshrink>
+ <xfill>True</xfill>
+ <yfill>True</yfill>
</child>
+
+ <widget>
+ <class>GtkCheckButton</class>
+ <name>all-day-event</name>
+ <can_focus>True</can_focus>
+ <label>A_ll day event</label>
+ <active>False</active>
+ <draw_indicator>True</draw_indicator>
+ </widget>
</widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
+ </widget>
+ </widget>
+ <widget>
+ <class>GtkScrolledWindow</class>
+ <name>scrolledwindow12</name>
+ <hscrollbar_policy>GTK_POLICY_NEVER</hscrollbar_policy>
+ <vscrollbar_policy>GTK_POLICY_AUTOMATIC</vscrollbar_policy>
+ <hupdate_policy>GTK_UPDATE_CONTINUOUS</hupdate_policy>
+ <vupdate_policy>GTK_UPDATE_CONTINUOUS</vupdate_policy>
<child>
- <widget class="GtkHBox" id="hbox53">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">2</property>
-
- <child>
- <widget class="GtkButton" id="contacts-button">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">_Contacts...</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
-
- <child>
- <widget class="GtkLabel" id="label59">
- <property name="visible">True</property>
- <property name="label" translatable="yes">_Contacts...</property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">4</property>
- <property name="ypad">0</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
+ <padding>0</padding>
+ <expand>True</expand>
+ <fill>True</fill>
+ </child>
- <child>
- <widget class="GtkEventBox" id="contacts-box">
- <property name="visible">True</property>
-
- <child>
- <placeholder/>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
+ <widget>
+ <class>GtkText</class>
+ <name>description</name>
+ <can_focus>True</can_focus>
+ <editable>True</editable>
+ <text></text>
+ </widget>
+ </widget>
- <child>
- <widget class="GtkButton" id="categories-button">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">Ca_tegories...</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
-
- <child>
- <widget class="GtkLabel" id="label60">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Ca_tegories...</property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">4</property>
- <property name="ypad">0</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
+ <widget>
+ <class>GtkHBox</class>
+ <name>hbox54</name>
+ <homogeneous>False</homogeneous>
+ <spacing>4</spacing>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
+ </child>
- <child>
- <widget class="GtkEntry" id="categories">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="editable">True</property>
- <property name="visibility">True</property>
- <property name="max_length">0</property>
- <property name="text" translatable="yes"></property>
- <property name="has_frame">True</property>
- <property name="invisible_char" translatable="yes">*</property>
- <property name="activates_default">False</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
+ <widget>
+ <class>GtkFrame</class>
+ <name>frame32</name>
+ <label>Classification</label>
+ <label_xalign>0</label_xalign>
+ <shadow_type>GTK_SHADOW_ETCHED_IN</shadow_type>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>True</fill>
+ </child>
+
+ <widget>
+ <class>GtkHBox</class>
+ <name>hbox52</name>
+ <border_width>2</border_width>
+ <homogeneous>False</homogeneous>
+ <spacing>4</spacing>
+
+ <widget>
+ <class>GtkRadioButton</class>
+ <name>classification-public</name>
+ <can_focus>True</can_focus>
+ <label>Pu_blic</label>
+ <active>True</active>
+ <draw_indicator>True</draw_indicator>
+ <group>classification_radio_group</group>
+ <child>
+ <padding>0</padding>
+ <expand>True</expand>
+ <fill>True</fill>
+ </child>
+ </widget>
+
+ <widget>
+ <class>GtkRadioButton</class>
+ <name>classification-private</name>
+ <can_focus>True</can_focus>
+ <label>Pri_vate</label>
+ <active>False</active>
+ <draw_indicator>True</draw_indicator>
+ <group>classification_radio_group</group>
+ <child>
+ <padding>0</padding>
+ <expand>True</expand>
+ <fill>True</fill>
+ </child>
+ </widget>
+
+ <widget>
+ <class>GtkRadioButton</class>
+ <name>classification-confidential</name>
+ <can_focus>True</can_focus>
+ <label>Con_fidential</label>
+ <active>False</active>
+ <draw_indicator>True</draw_indicator>
+ <group>classification_radio_group</group>
+ <child>
+ <padding>0</padding>
+ <expand>True</expand>
+ <fill>True</fill>
+ </child>
+ </widget>
</widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">True</property>
- </packing>
+ </widget>
+
+ <widget>
+ <class>GtkFrame</class>
+ <name>show-time-frame</name>
+ <label>Show Time As</label>
+ <label_xalign>0</label_xalign>
+ <shadow_type>GTK_SHADOW_ETCHED_IN</shadow_type>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>True</fill>
+ </child>
+
+ <widget>
+ <class>GtkHBox</class>
+ <name>hbox55</name>
+ <homogeneous>False</homogeneous>
+ <spacing>4</spacing>
+
+ <widget>
+ <class>GtkRadioButton</class>
+ <name>show-time-as-free</name>
+ <can_focus>True</can_focus>
+ <label>F_ree</label>
+ <active>False</active>
+ <draw_indicator>True</draw_indicator>
+ <group>show_time_as_radio_group</group>
+ <child>
+ <padding>0</padding>
+ <expand>True</expand>
+ <fill>True</fill>
+ </child>
+ </widget>
+
+ <widget>
+ <class>GtkRadioButton</class>
+ <name>show-time-as-busy</name>
+ <can_focus>True</can_focus>
+ <label>B_usy</label>
+ <active>False</active>
+ <draw_indicator>True</draw_indicator>
+ <group>show_time_as_radio_group</group>
+ <child>
+ <padding>0</padding>
+ <expand>True</expand>
+ <fill>True</fill>
+ </child>
+ </widget>
+ </widget>
+ </widget>
+ </widget>
+
+ <widget>
+ <class>GtkHBox</class>
+ <name>hbox53</name>
+ <homogeneous>False</homogeneous>
+ <spacing>2</spacing>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>True</fill>
</child>
+
+ <widget>
+ <class>GtkButton</class>
+ <name>contacts-button</name>
+ <can_focus>True</can_focus>
+ <relief>GTK_RELIEF_NORMAL</relief>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
+ </child>
+
+ <widget>
+ <class>GtkLabel</class>
+ <name>label59</name>
+ <label>_Contacts...</label>
+ <justify>GTK_JUSTIFY_CENTER</justify>
+ <wrap>False</wrap>
+ <xalign>0.5</xalign>
+ <yalign>0.5</yalign>
+ <xpad>4</xpad>
+ <ypad>0</ypad>
+ </widget>
+ </widget>
+
+ <widget>
+ <class>GtkEventBox</class>
+ <name>contacts-box</name>
+ <child>
+ <padding>0</padding>
+ <expand>True</expand>
+ <fill>True</fill>
+ </child>
+
+ <widget>
+ <class>Placeholder</class>
+ </widget>
+ </widget>
+
+ <widget>
+ <class>GtkButton</class>
+ <name>categories-button</name>
+ <can_focus>True</can_focus>
+ <relief>GTK_RELIEF_NORMAL</relief>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
+ </child>
+
+ <widget>
+ <class>GtkLabel</class>
+ <name>label60</name>
+ <label>Ca_tegories...</label>
+ <justify>GTK_JUSTIFY_CENTER</justify>
+ <wrap>False</wrap>
+ <xalign>0.5</xalign>
+ <yalign>0.5</yalign>
+ <xpad>4</xpad>
+ <ypad>0</ypad>
+ </widget>
+ </widget>
+
+ <widget>
+ <class>GtkEntry</class>
+ <name>categories</name>
+ <can_focus>True</can_focus>
+ <editable>True</editable>
+ <text_visible>True</text_visible>
+ <text_max_length>0</text_max_length>
+ <text></text>
+ <child>
+ <padding>0</padding>
+ <expand>True</expand>
+ <fill>True</fill>
+ </child>
+ </widget>
</widget>
- </child>
+ </widget>
</widget>
-</glade-interface>
+</GTK-Interface>
diff --git a/calendar/gui/dialogs/meeting-page.c b/calendar/gui/dialogs/meeting-page.c
index c4f1ec84cb..f337390429 100644
--- a/calendar/gui/dialogs/meeting-page.c
+++ b/calendar/gui/dialogs/meeting-page.c
@@ -31,9 +31,10 @@
#include <gtk/gtktogglebutton.h>
#include <gtk/gtkvbox.h>
#include <gtk/gtkwindow.h>
+#include <libgnome/gnome-defs.h>
#include <libgnome/gnome-i18n.h>
#include <glade/glade.h>
-#include <libgnomeui/gnome-stock-icons.h>
+#include <libgnomeui/gnome-stock.h>
#include <gal/e-table/e-cell-combo.h>
#include <gal/e-table/e-cell-text.h>
#include <gal/e-table/e-table-simple.h>
@@ -42,10 +43,8 @@
#include <gal/widgets/e-popup-menu.h>
#include <gal/widgets/e-gui-utils.h>
#include <widgets/misc/e-dateedit.h>
-#include <e-util/e-dialog-utils.h>
#include <e-util/e-dialog-widgets.h>
-
-#include "../calendar-component.h"
+#include "../component-factory.h"
#include "../e-meeting-attendee.h"
#include "../e-meeting-model.h"
#include "../itip-utils.h"
@@ -78,9 +77,9 @@ struct _MeetingPagePrivate {
CalComponent *comp;
/* List of identities */
- EAccountList *accounts;
- EMeetingAttendee *ia;
- char *default_address;
+ GList *addresses;
+ GList *address_strings;
+ gchar *default_address;
/* Glade XML data */
GladeXML *xml;
@@ -109,7 +108,7 @@ struct _MeetingPagePrivate {
static void meeting_page_class_init (MeetingPageClass *class);
static void meeting_page_init (MeetingPage *mpage);
-static void meeting_page_finalize (GObject *object);
+static void meeting_page_destroy (GtkObject *object);
static GtkWidget *meeting_page_get_widget (CompEditorPage *page);
static void meeting_page_focus_main_widget (CompEditorPage *page);
@@ -130,21 +129,42 @@ static CompEditorPageClass *parent_class = NULL;
*
* Return value: The type ID of the #MeetingPage class.
**/
+GtkType
+meeting_page_get_type (void)
+{
+ static GtkType meeting_page_type;
+
+ if (!meeting_page_type) {
+ static const GtkTypeInfo meeting_page_info = {
+ "MeetingPage",
+ sizeof (MeetingPage),
+ sizeof (MeetingPageClass),
+ (GtkClassInitFunc) meeting_page_class_init,
+ (GtkObjectInitFunc) meeting_page_init,
+ NULL, /* reserved_1 */
+ NULL, /* reserved_2 */
+ (GtkClassInitFunc) NULL
+ };
+
+ meeting_page_type =
+ gtk_type_unique (TYPE_COMP_EDITOR_PAGE,
+ &meeting_page_info);
+ }
-E_MAKE_TYPE (meeting_page, "MeetingPage", MeetingPage, meeting_page_class_init, meeting_page_init,
- TYPE_COMP_EDITOR_PAGE);
+ return meeting_page_type;
+}
/* Class initialization function for the task page */
static void
meeting_page_class_init (MeetingPageClass *class)
{
CompEditorPageClass *editor_page_class;
- GObjectClass *object_class;
+ GtkObjectClass *object_class;
editor_page_class = (CompEditorPageClass *) class;
- object_class = (GObjectClass *) class;
+ object_class = (GtkObjectClass *) class;
- parent_class = g_type_class_ref (TYPE_COMP_EDITOR_PAGE);
+ parent_class = gtk_type_class (TYPE_COMP_EDITOR_PAGE);
editor_page_class->get_widget = meeting_page_get_widget;
editor_page_class->focus_main_widget = meeting_page_focus_main_widget;
@@ -153,7 +173,7 @@ meeting_page_class_init (MeetingPageClass *class)
editor_page_class->set_summary = NULL;
editor_page_class->set_dates = NULL;
- object_class->finalize = meeting_page_finalize;
+ object_class->destroy = meeting_page_destroy;
}
/* Object initialization function for the task page */
@@ -169,9 +189,8 @@ meeting_page_init (MeetingPage *mpage)
priv->comp = NULL;
- priv->accounts = NULL;
- priv->ia = NULL;
- priv->default_address = NULL;
+ priv->addresses = NULL;
+ priv->address_strings = NULL;
priv->xml = NULL;
priv->main = NULL;
@@ -183,37 +202,6 @@ meeting_page_init (MeetingPage *mpage)
priv->updating = FALSE;
}
-static EAccount *
-get_current_account (MeetingPage *mpage)
-{
- MeetingPagePrivate *priv;
- EIterator *it;
- const char *str;
-
- priv = mpage->priv;
-
- str = gtk_entry_get_text (GTK_ENTRY (GTK_COMBO (priv->organizer)->entry));
- if (!str)
- return NULL;
-
- for (it = e_list_get_iterator((EList *)priv->accounts); e_iterator_is_valid(it); e_iterator_next(it)) {
- EAccount *a = (EAccount *)e_iterator_get(it);
- char *full = g_strdup_printf("%s <%s>", a->id->name, a->id->address);
-
- if (!strcmp (full, str)) {
- g_free (full);
- g_object_unref (it);
-
- return a;
- }
-
- g_free (full);
- }
- g_object_unref (it);
-
- return NULL;
-}
-
static void
set_attendees (CalComponent *comp, const GPtrArray *attendees)
{
@@ -243,12 +231,12 @@ cleanup_attendees (GPtrArray *attendees)
int i;
for (i = 0; i < attendees->len; i++)
- g_object_unref((g_ptr_array_index (attendees, i)));
+ gtk_object_unref (GTK_OBJECT (g_ptr_array_index (attendees, i)));
}
/* Destroy handler for the task page */
static void
-meeting_page_finalize (GObject *object)
+meeting_page_destroy (GtkObject *object)
{
MeetingPage *mpage;
MeetingPagePrivate *priv;
@@ -260,26 +248,25 @@ meeting_page_finalize (GObject *object)
priv = mpage->priv;
if (priv->comp != NULL)
- g_object_unref((priv->comp));
+ gtk_object_unref (GTK_OBJECT (priv->comp));
cleanup_attendees (priv->deleted_attendees);
g_ptr_array_free (priv->deleted_attendees, TRUE);
-
- if (priv->ia != NULL)
- g_object_unref (priv->ia);
- g_object_unref((priv->model));
+ itip_addresses_free (priv->addresses);
+
+ gtk_object_unref (GTK_OBJECT (priv->model));
if (priv->xml) {
- g_object_unref((priv->xml));
+ gtk_object_unref (GTK_OBJECT (priv->xml));
priv->xml = NULL;
}
g_free (priv);
mpage->priv = NULL;
- if (G_OBJECT_CLASS (parent_class)->finalize)
- (* G_OBJECT_CLASS (parent_class)->finalize) (object);
+ if (GTK_OBJECT_CLASS (parent_class)->destroy)
+ (* GTK_OBJECT_CLASS (parent_class)->destroy) (object);
}
@@ -318,7 +305,7 @@ clear_widgets (MeetingPage *mpage)
priv = mpage->priv;
- gtk_entry_set_text (GTK_ENTRY (GTK_COMBO (priv->organizer)->entry), priv->default_address);
+ gtk_entry_set_text (GTK_ENTRY (GTK_COMBO (priv->organizer)->entry), "");
gtk_label_set_text (GTK_LABEL (priv->existing_organizer), _("None"));
gtk_widget_show (priv->organizer_table);
@@ -342,7 +329,7 @@ meeting_page_fill_widgets (CompEditorPage *page, CalComponent *comp)
/* Clean out old data */
if (priv->comp != NULL)
- g_object_unref((priv->comp));
+ gtk_object_unref (GTK_OBJECT (priv->comp));
priv->comp = NULL;
cleanup_attendees (priv->deleted_attendees);
@@ -354,12 +341,15 @@ meeting_page_fill_widgets (CompEditorPage *page, CalComponent *comp)
/* Component for cancellation */
priv->comp = cal_component_clone (comp);
+ /* List the user identities for default organizers */
+ gtk_combo_set_popdown_strings (GTK_COMBO (priv->organizer), priv->address_strings);
+
/* If there is an existing organizer show it properly */
if (cal_component_has_organizer (comp)) {
cal_component_get_organizer (comp, &organizer);
if (organizer.value != NULL) {
const gchar *strip = itip_strip_mailto (organizer.value);
- gchar *string;
+ gchar *s, *string;
gtk_widget_hide (priv->organizer_table);
gtk_widget_show (priv->existing_organizer_table);
@@ -379,23 +369,15 @@ meeting_page_fill_widgets (CompEditorPage *page, CalComponent *comp)
string = g_strdup_printf ("%s <%s>", organizer.cn, strip);
else
string = g_strdup (strip);
- gtk_label_set_text (GTK_LABEL (priv->existing_organizer), string);
+ s = e_utf8_to_gtk_string (priv->existing_organizer, string);
+ gtk_label_set_text (GTK_LABEL (priv->existing_organizer), s);
+ g_free (s);
g_free (string);
priv->existing = TRUE;
}
} else {
- EAccount *a;
-
- a = get_current_account (mpage);
- if (a != NULL) {
- priv->ia = e_meeting_model_add_attendee_with_defaults (priv->model);
- g_object_ref (priv->ia);
-
- e_meeting_attendee_set_address (priv->ia, g_strdup_printf ("MAILTO:%s", a->id->address));
- e_meeting_attendee_set_cn (priv->ia, g_strdup (a->id->name));
- e_meeting_attendee_set_status (priv->ia, ICAL_PARTSTAT_ACCEPTED);
- }
+ e_dialog_editable_set (GTK_COMBO (priv->organizer)->entry, priv->default_address);
}
priv->updating = FALSE;
@@ -413,36 +395,50 @@ meeting_page_fill_component (CompEditorPage *page, CalComponent *comp)
priv = mpage->priv;
if (!priv->existing) {
- EAccount *a;
- gchar *addr = NULL;
+ gchar *addr = NULL, *cn = NULL, *sentby = NULL, *str;
+ GList *l;
- /* Find the identity for the organizer or sentby field */
- a = get_current_account (mpage);
+ str = e_dialog_editable_get (GTK_COMBO (priv->organizer)->entry);
- /* Sanity Check */
- if (a == NULL) {
- e_notice (page, GTK_MESSAGE_ERROR,
- _("The organizer selected no longer has an account."));
- return FALSE;
+ /* Find the identity for the organizer or sentby field */
+ for (l = priv->addresses; l != NULL; l = l->next) {
+ ItipAddress *a = l->data;
+
+ if (!strcmp (a->full, str)) {
+ addr = g_strdup (a->address);
+ cn = g_strdup (a->name);
+ }
}
+
+ g_free (str);
- if (a->id->address == NULL || strlen (a->id->address) == 0) {
- e_notice (page, GTK_MESSAGE_ERROR,
+ /* Sanity Check */
+ if (addr == NULL || strlen (addr) == 0) {
+ e_notice (NULL, GNOME_MESSAGE_BOX_ERROR,
_("An organizer is required."));
+ g_free (addr);
+ g_free (cn);
return FALSE;
- }
-
- addr = g_strdup_printf ("MAILTO:%s", a->id->address);
+ } else {
+ gchar *tmp;
+
+ tmp = addr;
+ addr = g_strdup_printf ("MAILTO:%s", addr);
+ g_free (tmp);
+ }
organizer.value = addr;
- organizer.cn = a->id->name;
+ organizer.cn = cn;
+ organizer.sentby = sentby;
cal_component_set_organizer (comp, &organizer);
g_free (addr);
+ g_free (cn);
+ g_free (sentby);
}
if (e_meeting_model_count_actual_attendees (priv->model) < 1) {
- e_notice (page, GTK_MESSAGE_ERROR,
+ e_notice (NULL, GNOME_MESSAGE_BOX_ERROR,
_("At least one attendee is required."));
return FALSE;
}
@@ -473,14 +469,14 @@ get_widgets (MeetingPage *mpage)
/* Get the GtkAccelGroup from the toplevel window, so we can install
it when the notebook page is mapped. */
toplevel = gtk_widget_get_toplevel (priv->main);
- accel_groups = gtk_accel_groups_from_object (G_OBJECT (toplevel));
+ accel_groups = gtk_accel_groups_from_object (GTK_OBJECT (toplevel));
if (accel_groups) {
page->accel_group = accel_groups->data;
gtk_accel_group_ref (page->accel_group);
}
gtk_widget_ref (priv->main);
- gtk_container_remove (GTK_CONTAINER (priv->main->parent), priv->main);
+ gtk_widget_unparent (priv->main);
/* For making the user the organizer */
priv->organizer_table = GW ("organizer-table");
@@ -503,34 +499,18 @@ get_widgets (MeetingPage *mpage)
&& priv->existing_organizer_btn);
}
+/* This is called when any field is changed; it notifies upstream. */
static void
-org_changed_cb (GtkWidget *widget, gpointer data)
+field_changed_cb (GtkWidget *widget, gpointer data)
{
MeetingPage *mpage;
MeetingPagePrivate *priv;
mpage = MEETING_PAGE (data);
priv = mpage->priv;
-
- if (priv->updating)
- return;
- if (!priv->existing && priv->ia != NULL) {
- EAccount *a;
-
- a = get_current_account (mpage);
- if (a != NULL) {
- e_meeting_attendee_set_address (priv->ia, g_strdup_printf ("MAILTO:%s", a->id->address));
- e_meeting_attendee_set_cn (priv->ia, g_strdup (a->id->name));
-
- if (!e_meeting_model_find_attendee (priv->model, e_meeting_attendee_get_address (priv->ia), NULL))
- e_meeting_model_add_attendee (priv->model, priv->ia);
- } else {
- e_meeting_model_remove_attendee (priv->model, priv->ia);
- }
- }
-
- comp_editor_page_notify_changed (COMP_EDITOR_PAGE (mpage));
+ if (!priv->updating)
+ comp_editor_page_notify_changed (COMP_EDITOR_PAGE (mpage));
}
/* Function called to change the organizer */
@@ -548,6 +528,7 @@ change_clicked_cb (GtkWidget *widget, gpointer data)
gtk_widget_show (priv->invite);
e_meeting_model_etable_click_to_add (priv->model, TRUE);
+ e_dialog_editable_set (GTK_COMBO (priv->organizer)->entry, priv->default_address);
comp_editor_page_notify_needs_send (COMP_EDITOR_PAGE (mpage));
priv->existing = FALSE;
@@ -575,17 +556,18 @@ init_widgets (MeetingPage *mpage)
priv = mpage->priv;
/* Organizer */
- g_signal_connect((GTK_COMBO (priv->organizer)->entry), "changed",
- G_CALLBACK (org_changed_cb), mpage);
+ gtk_signal_connect (GTK_OBJECT (GTK_COMBO (priv->organizer)->entry), "changed",
+ GTK_SIGNAL_FUNC (field_changed_cb), mpage);
- g_signal_connect((priv->existing_organizer_btn), "clicked",
- G_CALLBACK (change_clicked_cb), mpage);
+ gtk_signal_connect (GTK_OBJECT (priv->existing_organizer_btn), "clicked",
+ GTK_SIGNAL_FUNC (change_clicked_cb), mpage);
/* Invite button */
- g_signal_connect((priv->invite), "clicked",
- G_CALLBACK (invite_cb), mpage);
+ gtk_signal_connect (GTK_OBJECT (priv->invite), "clicked",
+ GTK_SIGNAL_FUNC (invite_cb), mpage);
}
+#if 0
static void
popup_delegate_cb (GtkWidget *widget, gpointer data)
{
@@ -604,7 +586,7 @@ popup_delegate_cb (GtkWidget *widget, gpointer data)
edd = e_delegate_dialog_new (NULL, itip_strip_mailto (e_meeting_attendee_get_delto (ia)));
dialog = e_delegate_dialog_get_toplevel (edd);
- if (gtk_dialog_run (GTK_DIALOG (dialog)) == GTK_RESPONSE_OK){
+ if (gnome_dialog_run_and_close (GNOME_DIALOG (dialog)) == 0){
EMeetingAttendee *ic;
name = e_delegate_dialog_get_delegate_name (edd);
@@ -612,7 +594,7 @@ popup_delegate_cb (GtkWidget *widget, gpointer data)
/* Make sure we can add the new delegatee person */
if (e_meeting_model_find_attendee (priv->model, address, NULL) != NULL) {
- e_notice (mpage, GTK_MESSAGE_ERROR,
+ e_notice (NULL, GNOME_MESSAGE_BOX_ERROR,
_("That person is already attending the meeting!"));
goto cleanup;
}
@@ -623,7 +605,7 @@ popup_delegate_cb (GtkWidget *widget, gpointer data)
ib = e_meeting_model_find_attendee (priv->model, itip_strip_mailto (e_meeting_attendee_get_delto (ia)), NULL);
if (ib != NULL) {
- g_object_ref((ib));
+ gtk_object_ref (GTK_OBJECT (ib));
g_ptr_array_add (priv->deleted_attendees, ib);
e_meeting_model_remove_attendee (priv->model, ib);
@@ -642,8 +624,9 @@ popup_delegate_cb (GtkWidget *widget, gpointer data)
cleanup:
g_free (name);
g_free (address);
- g_object_unref((edd));
+ gtk_object_unref (GTK_OBJECT (edd));
}
+#endif
static void
popup_delete_cb (GtkWidget *widget, gpointer data)
@@ -657,13 +640,6 @@ popup_delete_cb (GtkWidget *widget, gpointer data)
ia = e_meeting_model_find_attendee_at_row (priv->model, priv->row);
- /* If the user deletes the attendee explicitly, assume they no
- longer want the organizer showing up */
- if (ia == priv->ia) {
- g_object_unref (priv->ia);
- priv->ia = NULL;
- }
-
/* If this was a delegatee, no longer delegate */
if (e_meeting_attendee_is_set_delfrom (ia)) {
EMeetingAttendee *ib;
@@ -677,7 +653,7 @@ popup_delete_cb (GtkWidget *widget, gpointer data)
while (ia != NULL) {
EMeetingAttendee *ib = NULL;
- g_object_ref((ia));
+ gtk_object_ref (GTK_OBJECT (ia));
g_ptr_array_add (priv->deleted_attendees, ia);
e_meeting_model_remove_attendee (priv->model, ia);
@@ -693,11 +669,13 @@ enum {
};
static EPopupMenu context_menu[] = {
- E_POPUP_ITEM (N_("_Delegate To..."), G_CALLBACK (popup_delegate_cb), CAN_DELEGATE),
+#if 0
+ E_POPUP_ITEM (N_("_Delegate To..."), GTK_SIGNAL_FUNC (popup_delegate_cb), CAN_DELEGATE),
E_POPUP_SEPARATOR,
+#endif
- E_POPUP_ITEM (N_("_Delete"), G_CALLBACK (popup_delete_cb), CAN_DELETE),
+ E_POPUP_ITEM (N_("_Delete"), GTK_SIGNAL_FUNC (popup_delete_cb), CAN_DELETE),
E_POPUP_TERMINATOR
};
@@ -717,18 +695,15 @@ right_click_cb (ETable *etable, gint row, gint col, GdkEvent *event, gpointer da
view_row = e_table_model_to_view_row (etable, row);
priv->row = e_meeting_model_etable_view_to_model_row (etable, priv->model, view_row);
- ia = e_meeting_model_find_attendee_at_row (priv->model, priv->row);
- if (e_meeting_attendee_get_edit_level (ia) != E_MEETING_ATTENDEE_EDIT_FULL)
- disable_mask = CAN_DELETE;
-
- /* FIXME: if you enable Delegate, then change index to '1'.
- * (This has now been enabled). */
- /* context_menu[1].pixmap_widget = gnome_stock_new_with_icon (GNOME_STOCK_MENU_TRASH); */
- context_menu[1].pixmap_widget =
- gtk_image_new_from_stock (GTK_STOCK_DELETE, GTK_ICON_SIZE_MENU);
+ ia = e_meeting_model_find_attendee_at_row (priv->model, priv->row);
+ if (e_meeting_attendee_get_edit_level (ia) != E_MEETING_ATTENDEE_EDIT_FULL)
+ disable_mask = CAN_DELETE;
+ /* FIXME: if you enable Delegate, then change index to '1' */
+ context_menu[0].pixmap_widget = gnome_stock_new_with_icon (GNOME_STOCK_MENU_TRASH);
+
menu = e_popup_menu_create (context_menu, disable_mask, hide_mask, data);
- e_auto_kill_popup_menu_on_selection_done (menu);
+ e_auto_kill_popup_menu_on_hide (menu);
gtk_menu_popup (menu, NULL, NULL, NULL, NULL,
event->button.button, event->button.time);
@@ -774,14 +749,12 @@ meeting_page_construct (MeetingPage *mpage, EMeetingModel *emm,
ETable *real_table;
gchar *filename;
const char *backend_address;
- EIterator *it;
- EAccount *def_account;
- GList *address_strings = NULL, *l;
+ GList *l;
priv = mpage->priv;
priv->xml = glade_xml_new (EVOLUTION_GLADEDIR
- "/meeting-page.glade", NULL, NULL);
+ "/meeting-page.glade", NULL);
if (!priv->xml) {
g_message ("meeting_page_construct(): "
"Could not load the Glade XML file!");
@@ -797,43 +770,25 @@ meeting_page_construct (MeetingPage *mpage, EMeetingModel *emm,
/* Address information */
backend_address = cal_client_get_cal_address (client);
- priv->accounts = itip_addresses_get ();
- def_account = itip_addresses_get_default();
- for (it = e_list_get_iterator((EList *)priv->accounts);
- e_iterator_is_valid(it);
- e_iterator_next(it)) {
- EAccount *a = (EAccount *)e_iterator_get(it);
- char *full;
+ priv->addresses = itip_addresses_get ();
+ for (l = priv->addresses; l != NULL; l = l->next) {
+ ItipAddress *a = l->data;
+ char *s;
- full = g_strdup_printf("%s <%s>", a->id->name, a->id->address);
-
- address_strings = g_list_append(address_strings, full);
+ s = e_utf8_to_gtk_string (GTK_COMBO (priv->organizer)->entry, a->full);
+ priv->address_strings = g_list_append (priv->address_strings, s);
/* Note that the address specified by the backend gets
* precedence over the default mail address.
*/
- if (backend_address && !strcmp (backend_address, a->id->address)) {
- if (priv->default_address)
- g_free (priv->default_address);
-
- priv->default_address = g_strdup (full);
- } else if (a == def_account && !priv->default_address) {
- priv->default_address = g_strdup (full);
- }
+ if (backend_address && !strcmp (backend_address, a->address))
+ priv->default_address = a->full;
+ else if (a->default_address && !priv->default_address)
+ priv->default_address = a->full;
}
- g_object_unref(it);
-
- if (address_strings)
- gtk_combo_set_popdown_strings (GTK_COMBO (priv->organizer), address_strings);
- else
- g_warning ("No potential organizers!");
-
- for (l = address_strings; l != NULL; l = l->next)
- g_free (l->data);
- g_list_free (address_strings);
/* The etable displaying attendees and their status */
- g_object_ref((emm));
+ gtk_object_ref (GTK_OBJECT (emm));
priv->model = emm;
filename = g_strdup_printf ("%s/config/et-header-meeting-page", evolution_dir);
@@ -843,11 +798,11 @@ meeting_page_construct (MeetingPage *mpage, EMeetingModel *emm,
g_free (filename);
real_table = e_table_scrolled_get_table (priv->etable);
- g_signal_connect((real_table),
- "right_click", G_CALLBACK (right_click_cb), mpage);
+ gtk_signal_connect (GTK_OBJECT (real_table),
+ "right_click", GTK_SIGNAL_FUNC (right_click_cb), mpage);
- g_signal_connect((real_table->table_canvas), "focus_out_event",
- G_CALLBACK (table_canvas_focus_out_cb), mpage);
+ gtk_signal_connect (GTK_OBJECT (real_table->table_canvas), "focus_out_event",
+ GTK_SIGNAL_FUNC (table_canvas_focus_out_cb), mpage);
gtk_widget_show (GTK_WIDGET (priv->etable));
gtk_box_pack_start (GTK_BOX (priv->main), GTK_WIDGET (priv->etable), TRUE, TRUE, 2);
@@ -871,9 +826,9 @@ meeting_page_new (EMeetingModel *emm, CalClient *client)
{
MeetingPage *mpage;
- mpage = g_object_new (TYPE_MEETING_PAGE, NULL);
+ mpage = gtk_type_new (TYPE_MEETING_PAGE);
if (!meeting_page_construct (mpage, emm, client)) {
- g_object_unref((mpage));
+ gtk_object_unref (GTK_OBJECT (mpage));
return NULL;
}
diff --git a/calendar/gui/dialogs/meeting-page.h b/calendar/gui/dialogs/meeting-page.h
index 2a209b586b..8d25dd1806 100644
--- a/calendar/gui/dialogs/meeting-page.h
+++ b/calendar/gui/dialogs/meeting-page.h
@@ -28,15 +28,15 @@
#include "../itip-utils.h"
#include "comp-editor-page.h"
-G_BEGIN_DECLS
+BEGIN_GNOME_DECLS
#define TYPE_MEETING_PAGE (meeting_page_get_type ())
-#define MEETING_PAGE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_MEETING_PAGE, MeetingPage))
-#define MEETING_PAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_MEETING_PAGE, MeetingPageClass))
-#define IS_MEETING_PAGE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_MEETING_PAGE))
-#define IS_MEETING_PAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), TYPE_MEETING_PAGE))
+#define MEETING_PAGE(obj) (GTK_CHECK_CAST ((obj), TYPE_MEETING_PAGE, MeetingPage))
+#define MEETING_PAGE_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), TYPE_MEETING_PAGE, MeetingPageClass))
+#define IS_MEETING_PAGE(obj) (GTK_CHECK_TYPE ((obj), TYPE_MEETING_PAGE))
+#define IS_MEETING_PAGE_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((obj), TYPE_MEETING_PAGE))
typedef struct _MeetingPagePrivate MeetingPagePrivate;
@@ -62,6 +62,6 @@ CalComponent *meeting_page_get_cancel_comp (MeetingPage *mpage);
-G_END_DECLS
+END_GNOME_DECLS
#endif
diff --git a/calendar/gui/dialogs/recur-comp.c b/calendar/gui/dialogs/recur-comp.c
index 81db34733c..3c9152ccc5 100644
--- a/calendar/gui/dialogs/recur-comp.c
+++ b/calendar/gui/dialogs/recur-comp.c
@@ -24,9 +24,11 @@
#include <glib.h>
#include <gtk/gtk.h>
+#include <libgnome/gnome-defs.h>
#include <libgnome/gnome-i18n.h>
-#include <libgnomeui/gnome-uidefs.h>
+#include <libgnomeui/gnome-stock.h>
#include <gal/widgets/e-unicode.h>
+#include "widgets/misc/e-messagebox.h"
#include "recur-comp.h"
@@ -39,7 +41,7 @@ recur_component_dialog (CalComponent *comp,
char *str;
GtkWidget *dialog, *rb1, *rb2, *rb3, *hbox;
CalComponentVType vtype;
- gboolean ret;
+ int btn;
g_return_val_if_fail (IS_CAL_COMPONENT (comp), CALOBJ_MOD_THIS);
@@ -63,12 +65,15 @@ recur_component_dialog (CalComponent *comp,
return CALOBJ_MOD_THIS;
}
+ dialog = e_message_box_new (str, E_MESSAGE_BOX_QUESTION,
+ GNOME_STOCK_BUTTON_OK,
+ GNOME_STOCK_BUTTON_CANCEL,
+ NULL);
- dialog = gtk_message_dialog_new(parent, 0, GTK_MESSAGE_QUESTION, GTK_BUTTONS_OK_CANCEL, "%s", str);
g_free (str);
hbox = gtk_hbox_new (FALSE, 2);
- gtk_container_add (GTK_CONTAINER (GTK_DIALOG (dialog)->vbox), hbox);
+ gtk_container_add (GTK_CONTAINER (GNOME_DIALOG (dialog)->vbox), hbox);
rb1 = gtk_radio_button_new_with_label (NULL, _("This Instance Only"));
gtk_container_add (GTK_CONTAINER (hbox), rb1);
@@ -78,8 +83,13 @@ recur_component_dialog (CalComponent *comp,
gtk_container_add (GTK_CONTAINER (hbox), rb3);
gtk_widget_show_all (hbox);
-
- ret = gtk_dialog_run (GTK_DIALOG (dialog)) == GTK_RESPONSE_OK;
+
+ gtk_widget_hide (e_message_box_get_checkbox (E_MESSAGE_BOX (dialog)));
+ gnome_dialog_close_hides (GNOME_DIALOG (dialog), TRUE);
+ if (parent != NULL)
+ gnome_dialog_set_parent (GNOME_DIALOG (dialog), parent);
+
+ btn = gnome_dialog_run_and_close (GNOME_DIALOG (dialog));
if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (rb1)))
*mod = CALOBJ_MOD_THIS;
@@ -90,5 +100,5 @@ recur_component_dialog (CalComponent *comp,
gtk_widget_destroy (dialog);
- return ret;
+ return btn == 0 ? TRUE : FALSE;
}
diff --git a/calendar/gui/dialogs/recurrence-page.c b/calendar/gui/dialogs/recurrence-page.c
index aa77ee3990..ff31bb3878 100644
--- a/calendar/gui/dialogs/recurrence-page.c
+++ b/calendar/gui/dialogs/recurrence-page.c
@@ -1,14 +1,11 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-
/* Evolution calendar - Recurrence page of the calendar component dialogs
*
- * Copyright (C) 2001-2003 Ximian, Inc.
+ * Copyright (C) 2001 Ximian, Inc.
*
* Authors: Federico Mena-Quintero <federico@ximian.com>
* Miguel de Icaza <miguel@ximian.com>
* Seth Alves <alves@hungry.com>
* JP Rosevear <jpr@ximian.com>
- * Hans Petter Jansson <hpj@ximiman.com>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of version 2 of the GNU General Public
@@ -28,27 +25,21 @@
#include <config.h>
#endif
-#include <gtk/gtkcellrenderertext.h>
-#include <gtk/gtkmenuitem.h>
#include <gtk/gtkoptionmenu.h>
-#include <gtk/gtktogglebutton.h>
#include <gtk/gtksignal.h>
#include <gtk/gtkspinbutton.h>
-#include <gtk/gtktreeview.h>
-#include <gtk/gtktreeselection.h>
+#include <libgnome/gnome-defs.h>
#include <libgnome/gnome-i18n.h>
#include <glade/glade.h>
#include <gal/widgets/e-unicode.h>
#include <e-util/e-dialog-widgets.h>
#include <e-util/e-time-utils.h>
#include <widgets/misc/e-dateedit.h>
-#include <cal-util/cal-recur.h>
#include <cal-util/timeutil.h>
#include "../calendar-config.h"
#include "../tag-calendar.h"
#include "../weekday-picker.h"
#include "comp-editor-util.h"
-#include "../e-date-time-list.h"
#include "recurrence-page.h"
@@ -131,6 +122,40 @@ static const int ending_types_map[] = {
-1
};
+static const char *date_suffix[] = {
+ N_("st"),
+ N_("nd"),
+ N_("rd"),
+ N_("th"),
+ N_("th"),
+ N_("th"),
+ N_("th"),
+ N_("th"),
+ N_("th"),
+ N_("th"),
+ N_("th"),
+ N_("th"),
+ N_("th"),
+ N_("th"),
+ N_("th"),
+ N_("th"),
+ N_("th"),
+ N_("th"),
+ N_("th"),
+ N_("th"),
+ N_("st"),
+ N_("nd"),
+ N_("rd"),
+ N_("th"),
+ N_("th"),
+ N_("th"),
+ N_("th"),
+ N_("th"),
+ N_("th"),
+ N_("th"),
+ N_("st")
+};
+
/* Private part of the RecurrencePage structure */
struct _RecurrencePagePrivate {
/* Component we use to expand the recurrence rules for the preview */
@@ -140,6 +165,7 @@ struct _RecurrencePagePrivate {
GladeXML *xml;
/* Widgets from the Glade file */
+
GtkWidget *main;
GtkWidget *summary;
@@ -180,17 +206,15 @@ struct _RecurrencePagePrivate {
int ending_count;
/* More widgets from the Glade file */
+
GtkWidget *exception_date;
- GtkWidget *exception_list; /* This is a GtkTreeView now */
+ GtkWidget *exception_list;
GtkWidget *exception_add;
GtkWidget *exception_modify;
GtkWidget *exception_delete;
GtkWidget *preview_bin;
- /* Store for exception_list */
- EDateTimeList *exception_list_store;
-
/* For the recurrence preview, the actual widget */
GtkWidget *preview_calendar;
@@ -201,7 +225,7 @@ struct _RecurrencePagePrivate {
static void recurrence_page_class_init (RecurrencePageClass *class);
static void recurrence_page_init (RecurrencePage *rpage);
-static void recurrence_page_finalize (GObject *object);
+static void recurrence_page_destroy (GtkObject *object);
static GtkWidget *recurrence_page_get_widget (CompEditorPage *page);
static void recurrence_page_focus_main_widget (CompEditorPage *page);
@@ -224,21 +248,41 @@ static CompEditorPageClass *parent_class = NULL;
*
* Return value: The type ID of the #RecurrencePage class.
**/
+GtkType
+recurrence_page_get_type (void)
+{
+ static GtkType recurrence_page_type;
+
+ if (!recurrence_page_type) {
+ static const GtkTypeInfo recurrence_page_info = {
+ "RecurrencePage",
+ sizeof (RecurrencePage),
+ sizeof (RecurrencePageClass),
+ (GtkClassInitFunc) recurrence_page_class_init,
+ (GtkObjectInitFunc) recurrence_page_init,
+ NULL, /* reserved_1 */
+ NULL, /* reserved_2 */
+ (GtkClassInitFunc) NULL
+ };
+
+ recurrence_page_type = gtk_type_unique (TYPE_COMP_EDITOR_PAGE,
+ &recurrence_page_info);
+ }
-E_MAKE_TYPE (recurrence_page, "RecurrencePage", RecurrencePage, recurrence_page_class_init,
- recurrence_page_init, TYPE_COMP_EDITOR_PAGE);
+ return recurrence_page_type;
+}
/* Class initialization function for the recurrence page */
static void
recurrence_page_class_init (RecurrencePageClass *class)
{
CompEditorPageClass *editor_page_class;
- GObjectClass *object_class;
+ GtkObjectClass *object_class;
editor_page_class = (CompEditorPageClass *) class;
- object_class = (GObjectClass *) class;
+ object_class = (GtkObjectClass *) class;
- parent_class = g_type_class_ref(TYPE_COMP_EDITOR_PAGE);
+ parent_class = gtk_type_class (TYPE_COMP_EDITOR_PAGE);
editor_page_class->get_widget = recurrence_page_get_widget;
editor_page_class->focus_main_widget = recurrence_page_focus_main_widget;
@@ -247,7 +291,7 @@ recurrence_page_class_init (RecurrencePageClass *class)
editor_page_class->set_summary = recurrence_page_set_summary;
editor_page_class->set_dates = recurrence_page_set_dates;
- object_class->finalize = recurrence_page_finalize;
+ object_class->destroy = recurrence_page_destroy;
}
/* Object initialization function for the recurrence page */
@@ -290,9 +334,18 @@ recurrence_page_init (RecurrencePage *rpage)
priv->comp = NULL;
}
+/* Frees the CalComponentDateTime stored in the GtkCList */
+static void
+free_exception_date_time (CalComponentDateTime *dt)
+{
+ g_free (dt->value);
+ g_free ((char*)dt->tzid);
+ g_free (dt);
+}
+
/* Destroy handler for the recurrence page */
static void
-recurrence_page_finalize (GObject *object)
+recurrence_page_destroy (GtkObject *object)
{
RecurrencePage *rpage;
RecurrencePagePrivate *priv;
@@ -304,25 +357,20 @@ recurrence_page_finalize (GObject *object)
priv = rpage->priv;
if (priv->xml) {
- g_object_unref((priv->xml));
+ gtk_object_unref (GTK_OBJECT (priv->xml));
priv->xml = NULL;
}
if (priv->comp) {
- g_object_unref((priv->comp));
+ gtk_object_unref (GTK_OBJECT (priv->comp));
priv->comp = NULL;
}
- if (priv->exception_list_store) {
- g_object_unref (priv->exception_list_store);
- priv->exception_list_store = NULL;
- }
-
g_free (priv);
rpage->priv = NULL;
- if (G_OBJECT_CLASS (parent_class)->finalize)
- (* G_OBJECT_CLASS (parent_class)->finalize) (object);
+ if (GTK_OBJECT_CLASS (parent_class)->destroy)
+ (* GTK_OBJECT_CLASS (parent_class)->destroy) (object);
}
@@ -376,38 +424,62 @@ clear_widgets (RecurrencePage *rpage)
priv->month_num = MONTH_NUM_DAY;
priv->month_day = MONTH_DAY_NTH;
- g_signal_handlers_block_matched (priv->none, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage);
- g_signal_handlers_block_matched (priv->simple, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage);
- g_signal_handlers_block_matched (priv->custom, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage);
+ gtk_signal_handler_block_by_data (GTK_OBJECT (priv->none), rpage);
+ gtk_signal_handler_block_by_data (GTK_OBJECT (priv->simple), rpage);
+ gtk_signal_handler_block_by_data (GTK_OBJECT (priv->custom), rpage);
e_dialog_radio_set (priv->none, RECUR_NONE, type_map);
- g_signal_handlers_unblock_matched (priv->none, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage);
- g_signal_handlers_unblock_matched (priv->simple, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage);
- g_signal_handlers_unblock_matched (priv->custom, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage);
+ gtk_signal_handler_unblock_by_data (GTK_OBJECT (priv->none), rpage);
+ gtk_signal_handler_unblock_by_data (GTK_OBJECT (priv->simple), rpage);
+ gtk_signal_handler_unblock_by_data (GTK_OBJECT (priv->custom), rpage);
adj = gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON (priv->interval_value));
- g_signal_handlers_block_matched (adj, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage);
+ gtk_signal_handler_block_by_data (GTK_OBJECT (adj), rpage);
e_dialog_spin_set (priv->interval_value, 1);
- g_signal_handlers_unblock_matched (adj, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage);
+ gtk_signal_handler_unblock_by_data (GTK_OBJECT (adj), rpage);
menu = gtk_option_menu_get_menu (GTK_OPTION_MENU (priv->interval_unit));
- g_signal_handlers_block_matched (menu, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage);
+ gtk_signal_handler_block_by_data (GTK_OBJECT (menu), rpage);
e_dialog_option_menu_set (priv->interval_unit,
ICAL_DAILY_RECURRENCE,
freq_map);
- g_signal_handlers_unblock_matched (menu, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage);
+ gtk_signal_handler_unblock_by_data (GTK_OBJECT (menu), rpage);
priv->ending_date_tt = icaltime_today ();
priv->ending_count = 1;
menu = gtk_option_menu_get_menu (GTK_OPTION_MENU (priv->ending_menu));
- g_signal_handlers_block_matched (menu, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage);
+ gtk_signal_handler_block_by_data (GTK_OBJECT (menu), rpage);
e_dialog_option_menu_set (priv->ending_menu,
ENDING_FOREVER,
ending_types_map);
- g_signal_handlers_unblock_matched (menu, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage);
+ gtk_signal_handler_unblock_by_data (GTK_OBJECT (menu), rpage);
/* Exceptions list */
- e_date_time_list_clear (priv->exception_list_store);
+ gtk_clist_clear (GTK_CLIST (priv->exception_list));
+}
+
+/* Builds a static string out of an exception date */
+static char *
+get_exception_string (CalComponentDateTime *dt)
+{
+ static char buf[256];
+ struct tm tmp_tm;
+
+ tmp_tm.tm_year = dt->value->year - 1900;
+ tmp_tm.tm_mon = dt->value->month - 1;
+ tmp_tm.tm_mday = dt->value->day;
+ tmp_tm.tm_hour = dt->value->hour;
+ tmp_tm.tm_min = dt->value->minute;
+ tmp_tm.tm_sec = dt->value->second;
+ tmp_tm.tm_isdst = -1;
+
+ tmp_tm.tm_wday = time_day_of_week (dt->value->day,
+ dt->value->month - 1,
+ dt->value->year);
+
+ e_time_format_date_and_time (&tmp_tm, calendar_config_get_24_hour_format(), FALSE, FALSE, buf, sizeof (buf));
+
+ return buf;
}
/* Appends an exception date to the list */
@@ -415,14 +487,39 @@ static void
append_exception (RecurrencePage *rpage, CalComponentDateTime *datetime)
{
RecurrencePagePrivate *priv;
- GtkTreeView *view;
- GtkTreeIter iter;
+ CalComponentDateTime *dt;
+ char *c[1];
+ int i;
+ GtkCList *clist;
+ struct icaltimetype *tt;
priv = rpage->priv;
- view = GTK_TREE_VIEW (priv->exception_list);
- e_date_time_list_append (priv->exception_list_store, &iter, datetime);
- gtk_tree_selection_select_iter (gtk_tree_view_get_selection (view), &iter);
+ dt = g_new (CalComponentDateTime, 1);
+ dt->value = g_new (struct icaltimetype, 1);
+ *dt->value = *datetime->value;
+ dt->tzid = g_strdup (datetime->tzid);
+
+ clist = GTK_CLIST (priv->exception_list);
+
+ gtk_signal_handler_block_by_data (GTK_OBJECT (clist), rpage);
+
+ c[0] = get_exception_string (dt);
+ i = gtk_clist_append (clist, c);
+
+ gtk_clist_set_row_data_full (clist, i, dt, (GtkDestroyNotify) free_exception_date_time);
+
+ gtk_clist_select_row (clist, i, 0);
+ gtk_signal_handler_unblock_by_data (GTK_OBJECT (clist), rpage);
+
+ tt = dt->value;
+ e_date_edit_set_date (E_DATE_EDIT (priv->exception_date),
+ tt->year, tt->month, tt->day);
+ e_date_edit_set_time_of_day (E_DATE_EDIT (priv->exception_date),
+ tt->hour, tt->minute);
+
+ gtk_widget_set_sensitive (priv->exception_modify, TRUE);
+ gtk_widget_set_sensitive (priv->exception_delete, TRUE);
}
/* Fills in the exception widgets with the data from the calendar component */
@@ -431,11 +528,14 @@ fill_exception_widgets (RecurrencePage *rpage, CalComponent *comp)
{
RecurrencePagePrivate *priv;
GSList *list, *l;
- gboolean added = FALSE;
+ gboolean added;
priv = rpage->priv;
+
cal_component_get_exdate_list (comp, &list);
+ added = FALSE;
+
for (l = list; l; l = l->next) {
CalComponentDateTime *cdt;
@@ -446,6 +546,9 @@ fill_exception_widgets (RecurrencePage *rpage, CalComponent *comp)
}
cal_component_free_exdate_list (list);
+
+ if (added)
+ gtk_clist_select_row (GTK_CLIST (priv->exception_list), 0, 0);
}
/* Computes a weekday mask for the start day of a calendar component,
@@ -755,13 +858,11 @@ fill_component (RecurrencePage *rpage, CalComponent *comp)
{
RecurrencePagePrivate *priv;
enum recur_type recur_type;
- GtkTreeModel *model;
- GtkTreeIter iter;
- gboolean valid_iter;
+ GtkCList *exception_list;
GSList *list;
+ int i;
priv = rpage->priv;
- model = GTK_TREE_MODEL (priv->exception_list_store);
recur_type = e_dialog_radio_get (priv->none, type_map);
@@ -789,18 +890,15 @@ fill_component (RecurrencePage *rpage, CalComponent *comp)
/* Set exceptions */
list = NULL;
-
- for (valid_iter = gtk_tree_model_get_iter_first (model, &iter); valid_iter;
- valid_iter = gtk_tree_model_iter_next (model, &iter)) {
- const CalComponentDateTime *dt;
- CalComponentDateTime *cdt;
+ exception_list = GTK_CLIST (priv->exception_list);
+ for (i = 0; i < exception_list->rows; i++) {
+ CalComponentDateTime *cdt, *dt;
cdt = g_new (CalComponentDateTime, 1);
cdt->value = g_new (struct icaltimetype, 1);
- dt = e_date_time_list_get_date_time (E_DATE_TIME_LIST (model), &iter);
+ dt = gtk_clist_get_row_data (exception_list, i);
g_assert (dt != NULL);
-
if (!icaltime_is_valid_time (*dt->value)) {
comp_editor_page_display_validation_error (COMP_EDITOR_PAGE (rpage),
_("Recurrence date is invalid"),
@@ -811,6 +909,10 @@ fill_component (RecurrencePage *rpage, CalComponent *comp)
*cdt->value = *dt->value;
cdt->tzid = g_strdup (dt->tzid);
+#if 0
+ g_print ("Adding exception is_date: %i\n", cdt->value->is_date);
+#endif
+
list = g_slist_prepend (list, cdt);
}
@@ -879,7 +981,7 @@ preview_recur (RecurrencePage *rpage)
tag_calendar_by_comp (E_CALENDAR (priv->preview_calendar), comp,
COMP_EDITOR_PAGE (rpage)->client, zone, TRUE, FALSE);
- g_object_unref(comp);
+ gtk_object_unref (GTK_OBJECT (comp));
}
/* Callback used when the recurrence weekday picker changes */
@@ -929,8 +1031,8 @@ make_weekly_special (RecurrencePage *rpage)
weekday_picker_set_days (wp, priv->weekday_day_mask);
weekday_picker_set_blocked_days (wp, priv->weekday_blocked_day_mask);
- g_signal_connect((wp), "changed",
- G_CALLBACK (weekday_picker_changed_cb),
+ gtk_signal_connect (GTK_OBJECT (wp), "changed",
+ GTK_SIGNAL_FUNC (weekday_picker_changed_cb),
rpage);
}
@@ -942,7 +1044,7 @@ month_num_submenu_selection_done_cb (GtkMenuShell *menu_shell, gpointer data)
int month_index;
item = gtk_menu_get_active (GTK_MENU (menu_shell));
- item = gtk_menu_get_active (GTK_MENU (gtk_menu_item_get_submenu (GTK_MENU_ITEM (item))));
+ item = gtk_menu_get_active (GTK_MENU (GTK_MENU_ITEM (item)->submenu));
month_index = GPOINTER_TO_INT (gtk_object_get_user_data (GTK_OBJECT (item)));
gtk_object_set_user_data (GTK_OBJECT (data), GINT_TO_POINTER (month_index));
@@ -957,8 +1059,12 @@ make_recur_month_num_submenu (const char *title, int start, int end)
submenu = gtk_menu_new ();
for (i = start; i < end; i++) {
- item = gtk_menu_item_new_with_label (_(cal_recur_nth[i]));
- gtk_menu_shell_append(GTK_MENU_SHELL(submenu), item);
+ char *date;
+
+ date = g_strdup_printf ("%d%s", i + 1, _(date_suffix[i]));
+ item = gtk_menu_item_new_with_label (date);
+ g_free (date);
+ gtk_menu_append (GTK_MENU (submenu), item);
gtk_object_set_user_data (GTK_OBJECT (item), GINT_TO_POINTER (i + 1));
gtk_widget_show (item);
}
@@ -983,6 +1089,7 @@ make_recur_month_num_menu (int month_index)
GtkWidget *menu, *submenu, *item, *submenu_item;
GtkWidget *omenu;
+ char *date;
int i;
menu = gtk_menu_new ();
@@ -990,32 +1097,34 @@ make_recur_month_num_menu (int month_index)
/* Relation */
for (i = 0; i < sizeof (options) / sizeof (options[0]); i++) {
item = gtk_menu_item_new_with_label (_(options[i]));
- gtk_menu_shell_append(GTK_MENU_SHELL(menu), item);
+ gtk_menu_append (GTK_MENU (menu), item);
gtk_widget_show (item);
}
/* Current date */
- item = gtk_menu_item_new_with_label (_(cal_recur_nth[month_index - 1]));
- gtk_menu_shell_append(GTK_MENU_SHELL(menu), item);
+ date = g_strdup_printf ("%d%s", month_index, _(date_suffix[month_index - 1]));
+ item = gtk_menu_item_new_with_label (date);
+ g_free (date);
+ gtk_menu_append (GTK_MENU (menu), item);
gtk_widget_show (item);
/* Other Submenu */
submenu = gtk_menu_new ();
submenu_item = gtk_menu_item_new_with_label (_("Other Date"));
- gtk_menu_shell_append(GTK_MENU_SHELL(menu), submenu_item);
+ gtk_menu_append (GTK_MENU (menu), submenu_item);
gtk_widget_show (submenu_item);
item = make_recur_month_num_submenu ("1st to 10th", 0, 10);
- gtk_menu_shell_append(GTK_MENU_SHELL(submenu), item);
+ gtk_menu_append (GTK_MENU (submenu), item);
item = make_recur_month_num_submenu ("11th to 20th", 10, 20);
- gtk_menu_shell_append(GTK_MENU_SHELL(submenu), item);
+ gtk_menu_append (GTK_MENU (submenu), item);
item = make_recur_month_num_submenu ("21st to 31st", 20, 31);
- gtk_menu_shell_append(GTK_MENU_SHELL(submenu), item);
+ gtk_menu_append (GTK_MENU (submenu), item);
gtk_menu_item_set_submenu (GTK_MENU_ITEM (submenu_item), submenu);
gtk_object_set_user_data (GTK_OBJECT (submenu_item), GINT_TO_POINTER (month_index));
- g_signal_connect((submenu), "selection_done",
- G_CALLBACK (month_num_submenu_selection_done_cb),
+ gtk_signal_connect (GTK_OBJECT (submenu), "selection_done",
+ GTK_SIGNAL_FUNC (month_num_submenu_selection_done_cb),
submenu_item);
omenu = gtk_option_menu_new ();
@@ -1049,7 +1158,7 @@ make_recur_month_menu (void)
GtkWidget *item;
item = gtk_menu_item_new_with_label (_(options[i]));
- gtk_menu_shell_append(GTK_MENU_SHELL(menu), item);
+ gtk_menu_append (GTK_MENU (menu), item);
gtk_widget_show (item);
}
@@ -1077,6 +1186,7 @@ month_num_menu_selection_done_cb (GtkMenuShell *menu_shell, gpointer data)
if (month_num == MONTH_NUM_OTHER) {
GtkWidget *label, *item;
+ char *date;
item = gtk_menu_get_active (GTK_MENU (menu_shell));
priv->month_index = GPOINTER_TO_INT (gtk_object_get_user_data (GTK_OBJECT (item)));
@@ -1085,7 +1195,9 @@ month_num_menu_selection_done_cb (GtkMenuShell *menu_shell, gpointer data)
e_dialog_option_menu_set (priv->month_num_menu, month_num, month_num_options_map);
label = GTK_BIN (priv->month_num_menu)->child;
- gtk_label_set_text (GTK_LABEL (label), _(cal_recur_nth[priv->month_index - 1]));
+ date = g_strdup_printf ("%d%s", priv->month_index, _(date_suffix[priv->month_index - 1]));
+ gtk_label_set_text (GTK_LABEL (label), date);
+ g_free (date);
e_dialog_option_menu_set (priv->month_num_menu, 0, month_num_options_map);
e_dialog_option_menu_set (priv->month_num_menu, month_num, month_num_options_map);
@@ -1189,16 +1301,16 @@ make_monthly_special (RecurrencePage *rpage)
priv->month_day,
month_day_options_map);
- g_signal_connect((adj), "value_changed", G_CALLBACK (month_index_value_changed_cb),
+ gtk_signal_connect (GTK_OBJECT (adj), "value_changed", GTK_SIGNAL_FUNC (month_index_value_changed_cb),
rpage);
menu = gtk_option_menu_get_menu (GTK_OPTION_MENU (priv->month_num_menu));
- g_signal_connect((menu), "selection_done",
- G_CALLBACK (month_num_menu_selection_done_cb),
+ gtk_signal_connect (GTK_OBJECT (menu), "selection_done",
+ GTK_SIGNAL_FUNC (month_num_menu_selection_done_cb),
rpage);
menu = gtk_option_menu_get_menu (GTK_OPTION_MENU (priv->month_day_menu));
- g_signal_connect((menu), "selection_done",
- G_CALLBACK (month_day_menu_selection_done_cb),
+ gtk_signal_connect (GTK_OBJECT (menu), "selection_done",
+ GTK_SIGNAL_FUNC (month_day_menu_selection_done_cb),
rpage);
}
@@ -1217,16 +1329,16 @@ make_recurrence_special (RecurrencePage *rpage)
priv = rpage->priv;
- if (priv->month_num_menu != NULL) {
- gtk_widget_destroy (priv->month_num_menu);
- priv->month_num_menu = NULL;
- }
if (GTK_BIN (priv->special)->child != NULL) {
gtk_widget_destroy (GTK_BIN (priv->special)->child);
priv->weekday_picker = NULL;
priv->month_day_menu = NULL;
}
+ if (priv->month_num_menu != NULL) {
+ gtk_widget_destroy (priv->month_num_menu);
+ priv->month_num_menu = NULL;
+ }
frequency = e_dialog_option_menu_get (priv->interval_unit, freq_map);
@@ -1306,8 +1418,8 @@ make_ending_until_special (RecurrencePage *rpage)
priv->ending_date_tt.month,
priv->ending_date_tt.day);
- g_signal_connect((de), "changed",
- G_CALLBACK (ending_until_changed_cb), rpage);
+ gtk_signal_connect (GTK_OBJECT (de), "changed",
+ GTK_SIGNAL_FUNC (ending_until_changed_cb), rpage);
/* Make sure the EDateEdit widget uses our timezones to get the
current time. */
@@ -1360,8 +1472,8 @@ make_ending_count_special (RecurrencePage *rpage)
e_dialog_spin_set (priv->ending_count_spin, priv->ending_count);
- g_signal_connect((adj), "value_changed",
- G_CALLBACK (ending_count_value_changed_cb),
+ gtk_signal_connect (GTK_OBJECT (adj), "value_changed",
+ GTK_SIGNAL_FUNC (ending_count_value_changed_cb),
rpage);
}
@@ -1421,7 +1533,7 @@ fill_ending_date (RecurrencePage *rpage, struct icalrecurrencetype *r)
priv = rpage->priv;
menu = gtk_option_menu_get_menu (GTK_OPTION_MENU (priv->ending_menu));
- g_signal_handlers_block_matched (menu, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage);
+ gtk_signal_handler_block_by_data (GTK_OBJECT (menu), rpage);
if (r->count == 0) {
if (r->until.year == 0) {
@@ -1471,7 +1583,7 @@ fill_ending_date (RecurrencePage *rpage, struct icalrecurrencetype *r)
ending_types_map);
}
- g_signal_handlers_unblock_matched (menu, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage);
+ gtk_signal_handler_unblock_by_data (GTK_OBJECT (menu), rpage);
make_ending_special (rpage);
}
@@ -1505,7 +1617,7 @@ recurrence_page_fill_widgets (CompEditorPage *page, CalComponent *comp)
*/
if (priv->comp)
- g_object_unref((priv->comp));
+ gtk_object_unref (GTK_OBJECT (priv->comp));
priv->comp = cal_component_clone (comp);
@@ -1613,11 +1725,11 @@ recurrence_page_fill_widgets (CompEditorPage *page, CalComponent *comp)
goto custom;
menu = gtk_option_menu_get_menu (GTK_OPTION_MENU (priv->interval_unit));
- g_signal_handlers_block_matched (menu, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage);
+ gtk_signal_handler_block_by_data (GTK_OBJECT (menu), rpage);
e_dialog_option_menu_set (priv->interval_unit,
ICAL_DAILY_RECURRENCE,
freq_map);
- g_signal_handlers_unblock_matched (menu, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage);
+ gtk_signal_handler_unblock_by_data (GTK_OBJECT (menu), rpage);
break;
case ICAL_WEEKLY_RECURRENCE: {
@@ -1680,11 +1792,11 @@ recurrence_page_fill_widgets (CompEditorPage *page, CalComponent *comp)
priv->weekday_day_mask = day_mask;
menu = gtk_option_menu_get_menu (GTK_OPTION_MENU (priv->interval_unit));
- g_signal_handlers_block_matched (menu, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage);
+ gtk_signal_handler_block_by_data (GTK_OBJECT (menu), rpage);
e_dialog_option_menu_set (priv->interval_unit,
ICAL_WEEKLY_RECURRENCE,
freq_map);
- g_signal_handlers_unblock_matched (menu, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage);
+ gtk_signal_handler_unblock_by_data (GTK_OBJECT (menu), rpage);
break;
}
@@ -1779,11 +1891,11 @@ recurrence_page_fill_widgets (CompEditorPage *page, CalComponent *comp)
goto custom;
menu = gtk_option_menu_get_menu (GTK_OPTION_MENU (priv->interval_unit));
- g_signal_handlers_block_matched (menu, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage);
+ gtk_signal_handler_block_by_data (GTK_OBJECT (menu), rpage);
e_dialog_option_menu_set (priv->interval_unit,
ICAL_MONTHLY_RECURRENCE,
freq_map);
- g_signal_handlers_unblock_matched (menu, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage);
+ gtk_signal_handler_unblock_by_data (GTK_OBJECT (menu), rpage);
break;
case ICAL_YEARLY_RECURRENCE:
@@ -1796,11 +1908,11 @@ recurrence_page_fill_widgets (CompEditorPage *page, CalComponent *comp)
goto custom;
menu = gtk_option_menu_get_menu (GTK_OPTION_MENU (priv->interval_unit));
- g_signal_handlers_block_matched (menu, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage);
+ gtk_signal_handler_block_by_data (GTK_OBJECT (menu), rpage);
e_dialog_option_menu_set (priv->interval_unit,
ICAL_YEARLY_RECURRENCE,
freq_map);
- g_signal_handlers_unblock_matched (menu, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage);
+ gtk_signal_handler_unblock_by_data (GTK_OBJECT (menu), rpage);
break;
default:
@@ -1809,13 +1921,13 @@ recurrence_page_fill_widgets (CompEditorPage *page, CalComponent *comp)
/* If we got here it means it is a simple recurrence */
- g_signal_handlers_block_matched (priv->none, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage);
- g_signal_handlers_block_matched (priv->simple, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage);
- g_signal_handlers_block_matched (priv->custom, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage);
+ gtk_signal_handler_block_by_data (GTK_OBJECT (priv->none), rpage);
+ gtk_signal_handler_block_by_data (GTK_OBJECT (priv->simple), rpage);
+ gtk_signal_handler_block_by_data (GTK_OBJECT (priv->custom), rpage);
e_dialog_radio_set (priv->simple, RECUR_SIMPLE, type_map);
- g_signal_handlers_unblock_matched (priv->none, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage);
- g_signal_handlers_unblock_matched (priv->simple, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage);
- g_signal_handlers_unblock_matched (priv->custom, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage);
+ gtk_signal_handler_unblock_by_data (GTK_OBJECT (priv->none), rpage);
+ gtk_signal_handler_unblock_by_data (GTK_OBJECT (priv->simple), rpage);
+ gtk_signal_handler_unblock_by_data (GTK_OBJECT (priv->custom), rpage);
gtk_widget_set_sensitive (priv->custom, FALSE);
@@ -1823,9 +1935,9 @@ recurrence_page_fill_widgets (CompEditorPage *page, CalComponent *comp)
make_recurrence_special (rpage);
adj = gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON (priv->interval_value));
- g_signal_handlers_block_matched (adj, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage);
+ gtk_signal_handler_block_by_data (GTK_OBJECT (adj), rpage);
e_dialog_spin_set (priv->interval_value, r->interval);
- g_signal_handlers_unblock_matched (adj, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage);
+ gtk_signal_handler_unblock_by_data (GTK_OBJECT (adj), rpage);
fill_ending_date (rpage, r);
@@ -1833,13 +1945,13 @@ recurrence_page_fill_widgets (CompEditorPage *page, CalComponent *comp)
custom:
- g_signal_handlers_block_matched (priv->none, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage);
- g_signal_handlers_block_matched (priv->simple, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage);
- g_signal_handlers_block_matched (priv->custom, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage);
+ gtk_signal_handler_block_by_data (GTK_OBJECT (priv->none), rpage);
+ gtk_signal_handler_block_by_data (GTK_OBJECT (priv->simple), rpage);
+ gtk_signal_handler_block_by_data (GTK_OBJECT (priv->custom), rpage);
e_dialog_radio_set (priv->custom, RECUR_CUSTOM, type_map);
- g_signal_handlers_unblock_matched (priv->none, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage);
- g_signal_handlers_unblock_matched (priv->simple, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage);
- g_signal_handlers_unblock_matched (priv->custom, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage);
+ gtk_signal_handler_unblock_by_data (GTK_OBJECT (priv->none), rpage);
+ gtk_signal_handler_unblock_by_data (GTK_OBJECT (priv->simple), rpage);
+ gtk_signal_handler_unblock_by_data (GTK_OBJECT (priv->custom), rpage);
gtk_widget_set_sensitive (priv->custom, TRUE);
sensitize_recur_widgets (rpage);
@@ -1868,11 +1980,14 @@ recurrence_page_set_summary (CompEditorPage *page, const char *summary)
{
RecurrencePage *rpage;
RecurrencePagePrivate *priv;
+ gchar *s;
rpage = RECURRENCE_PAGE (page);
priv = rpage->priv;
- gtk_label_set_text (GTK_LABEL (priv->summary), summary);
+ s = e_utf8_to_gtk_string (priv->summary, summary);
+ gtk_label_set_text (GTK_LABEL (priv->summary), s);
+ g_free (s);
}
/* set_dates handler for the recurrence page */
@@ -1949,14 +2064,14 @@ get_widgets (RecurrencePage *rpage)
/* Get the GtkAccelGroup from the toplevel window, so we can install
it when the notebook page is mapped. */
toplevel = gtk_widget_get_toplevel (priv->main);
- accel_groups = gtk_accel_groups_from_object (G_OBJECT (toplevel));
+ accel_groups = gtk_accel_groups_from_object (GTK_OBJECT (toplevel));
if (accel_groups) {
page->accel_group = accel_groups->data;
gtk_accel_group_ref (page->accel_group);
}
gtk_widget_ref (priv->main);
- gtk_container_remove (GTK_CONTAINER (priv->main->parent), priv->main);
+ gtk_widget_unparent (priv->main);
priv->summary = GW ("summary");
priv->date_time = GW ("date-time");
@@ -1974,7 +2089,6 @@ get_widgets (RecurrencePage *rpage)
priv->custom_warning_bin = GW ("custom-warning-bin");
priv->exception_date = GW ("exception-date");
- gtk_widget_show (priv->exception_date);
priv->exception_list = GW ("exception-list");
priv->exception_add = GW ("exception-add");
priv->exception_modify = GW ("exception-modify");
@@ -2113,24 +2227,24 @@ exception_modify_cb (GtkWidget *widget, gpointer data)
{
RecurrencePage *rpage;
RecurrencePagePrivate *priv;
- GtkTreeSelection *selection;
- CalComponentDateTime dt;
- struct icaltimetype icaltime = icaltime_null_time ();
+ GtkCList *clist;
+ CalComponentDateTime *dt;
struct icaltimetype *tt;
- GtkTreeIter iter;
+ int sel;
rpage = RECURRENCE_PAGE (data);
priv = rpage->priv;
- selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (priv->exception_list));
- if (!gtk_tree_selection_get_selected (selection, NULL, &iter)) {
- g_warning ("Could not get a selection to modify.");
+ clist = GTK_CLIST (priv->exception_list);
+ if (!clist->selection)
return;
- }
+
field_changed (rpage);
- dt.value = &icaltime;
- tt = dt.value;
+ sel = GPOINTER_TO_INT (clist->selection->data);
+
+ dt = gtk_clist_get_row_data (clist, sel);
+ tt = dt->value;
e_date_edit_get_date (E_DATE_EDIT (priv->exception_date),
&tt->year, &tt->month, &tt->day);
tt->hour = 0;
@@ -2138,10 +2252,12 @@ exception_modify_cb (GtkWidget *widget, gpointer data)
tt->second = 0;
tt->is_date = 1;
- /* No TZID, since we are using a DATE value now. */
- dt.tzid = NULL;
+ /* We get rid of any old TZID, since we are using a DATE value now. */
+ g_free ((char*)dt->tzid);
+ dt->tzid = NULL;
+
+ gtk_clist_set_text (clist, sel, 0, get_exception_string (dt));
- e_date_time_list_set_date_time (priv->exception_list_store, &iter, &dt);
preview_recur (rpage);
}
@@ -2151,36 +2267,31 @@ exception_delete_cb (GtkWidget *widget, gpointer data)
{
RecurrencePage *rpage;
RecurrencePagePrivate *priv;
- GtkTreeSelection *selection;
- GtkTreeIter iter;
- GtkTreePath *path;
- gboolean valid_iter;
+ GtkCList *clist;
+ int sel;
rpage = RECURRENCE_PAGE (data);
priv = rpage->priv;
- selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (priv->exception_list));
- if (!gtk_tree_selection_get_selected (selection, NULL, &iter)) {
- g_warning ("Could not get a selection to delete.");
+ clist = GTK_CLIST (priv->exception_list);
+ if (!clist->selection)
return;
- }
field_changed (rpage);
- path = gtk_tree_model_get_path (GTK_TREE_MODEL (priv->exception_list_store), &iter);
- e_date_time_list_remove (priv->exception_list_store, &iter);
+ sel = GPOINTER_TO_INT (clist->selection->data);
- /* Select closest item after removal */
- valid_iter = gtk_tree_model_get_iter (GTK_TREE_MODEL (priv->exception_list_store), &iter, path);
- if (!valid_iter) {
- gtk_tree_path_prev (path);
- valid_iter = gtk_tree_model_get_iter (GTK_TREE_MODEL (priv->exception_list_store), &iter, path);
- }
+ gtk_clist_remove (clist, sel);
+ if (sel >= clist->rows)
+ sel--;
- if (valid_iter)
- gtk_tree_selection_select_iter (selection, &iter);
+ if (clist->rows > 0)
+ gtk_clist_select_row (clist, sel, 0);
+ else {
+ gtk_widget_set_sensitive (priv->exception_modify, FALSE);
+ gtk_widget_set_sensitive (priv->exception_delete, FALSE);
+ }
- gtk_tree_path_free (path);
preview_recur (rpage);
}
@@ -2189,27 +2300,24 @@ exception_delete_cb (GtkWidget *widget, gpointer data)
* exception's value.
*/
static void
-exception_selection_changed_cb (GtkTreeSelection *selection, gpointer data)
+exception_select_row_cb (GtkCList *clist, gint row, gint col,
+ GdkEvent *event, gpointer data)
{
RecurrencePage *rpage;
RecurrencePagePrivate *priv;
- const CalComponentDateTime *dt;
+ CalComponentDateTime *dt;
struct icaltimetype *t;
- GtkTreeIter iter;
rpage = RECURRENCE_PAGE (data);
priv = rpage->priv;
- if (!gtk_tree_selection_get_selected (selection, NULL, &iter)) {
- gtk_widget_set_sensitive (priv->exception_modify, FALSE);
- gtk_widget_set_sensitive (priv->exception_delete, FALSE);
+ /* Sometimes GtkCList emits a 'row-selected' signal for row 0 when
+ there are 0 rows in the list (after you delete the last row).
+ So we check that the row is valid here. */
+ if (row >= clist->rows)
return;
- }
- gtk_widget_set_sensitive (priv->exception_modify, TRUE);
- gtk_widget_set_sensitive (priv->exception_delete, TRUE);
-
- dt = e_date_time_list_get_date_time (priv->exception_list_store, &iter);
+ dt = gtk_clist_get_row_data (clist, row);
g_assert (dt != NULL);
t = dt->value;
@@ -2240,8 +2348,6 @@ init_widgets (RecurrencePage *rpage)
ECalendar *ecal;
GtkAdjustment *adj;
GtkWidget *menu;
- GtkTreeViewColumn *column;
- GtkCellRenderer *cell_renderer;
priv = rpage->priv;
@@ -2249,8 +2355,8 @@ init_widgets (RecurrencePage *rpage)
priv->preview_calendar = e_calendar_new ();
ecal = E_CALENDAR (priv->preview_calendar);
- g_signal_connect((ecal->calitem), "date_range_changed",
- G_CALLBACK (preview_date_range_changed_cb),
+ gtk_signal_connect (GTK_OBJECT (ecal->calitem), "date_range_changed",
+ GTK_SIGNAL_FUNC (preview_date_range_changed_cb),
rpage);
calendar_config_configure_e_calendar (ecal);
e_calendar_item_set_max_days_sel (ecal->calitem, 0);
@@ -2270,62 +2376,46 @@ init_widgets (RecurrencePage *rpage)
/* Recurrence types */
- g_signal_connect((priv->none), "toggled",
- G_CALLBACK (type_toggled_cb), rpage);
- g_signal_connect((priv->simple), "toggled",
- G_CALLBACK (type_toggled_cb), rpage);
- g_signal_connect((priv->custom), "toggled",
- G_CALLBACK (type_toggled_cb), rpage);
+ gtk_signal_connect (GTK_OBJECT (priv->none), "toggled",
+ GTK_SIGNAL_FUNC (type_toggled_cb), rpage);
+ gtk_signal_connect (GTK_OBJECT (priv->simple), "toggled",
+ GTK_SIGNAL_FUNC (type_toggled_cb), rpage);
+ gtk_signal_connect (GTK_OBJECT (priv->custom), "toggled",
+ GTK_SIGNAL_FUNC (type_toggled_cb), rpage);
/* Recurrence interval */
adj = gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON (priv->interval_value));
- g_signal_connect((adj), "value_changed",
- G_CALLBACK (interval_value_changed_cb),
+ gtk_signal_connect (GTK_OBJECT (adj), "value_changed",
+ GTK_SIGNAL_FUNC (interval_value_changed_cb),
rpage);
/* Recurrence units */
menu = gtk_option_menu_get_menu (GTK_OPTION_MENU (priv->interval_unit));
- g_signal_connect((menu), "selection_done",
- G_CALLBACK (interval_selection_done_cb),
+ gtk_signal_connect (GTK_OBJECT (menu), "selection_done",
+ GTK_SIGNAL_FUNC (interval_selection_done_cb),
rpage);
/* Recurrence ending */
menu = gtk_option_menu_get_menu (GTK_OPTION_MENU (priv->ending_menu));
- g_signal_connect((menu), "selection_done",
- G_CALLBACK (ending_selection_done_cb), rpage);
+ gtk_signal_connect (GTK_OBJECT (menu), "selection_done",
+ GTK_SIGNAL_FUNC (ending_selection_done_cb), rpage);
/* Exception buttons */
- g_signal_connect((priv->exception_add), "clicked",
- G_CALLBACK (exception_add_cb), rpage);
- g_signal_connect((priv->exception_modify), "clicked",
- G_CALLBACK (exception_modify_cb), rpage);
- g_signal_connect((priv->exception_delete), "clicked",
- G_CALLBACK (exception_delete_cb), rpage);
-
- gtk_widget_set_sensitive (priv->exception_modify, FALSE);
- gtk_widget_set_sensitive (priv->exception_delete, FALSE);
-
- /* Exception list */
-
- /* Model */
- priv->exception_list_store = e_date_time_list_new ();
- gtk_tree_view_set_model (GTK_TREE_VIEW (priv->exception_list),
- GTK_TREE_MODEL (priv->exception_list_store));
-
- /* View */
- column = gtk_tree_view_column_new ();
- gtk_tree_view_column_set_title (column, "Date/Time");
- cell_renderer = GTK_CELL_RENDERER (gtk_cell_renderer_text_new ());
- gtk_tree_view_column_pack_start (column, cell_renderer, TRUE);
- gtk_tree_view_column_add_attribute (column, cell_renderer, "text", E_DATE_TIME_LIST_COLUMN_DESCRIPTION);
- gtk_tree_view_append_column (GTK_TREE_VIEW (priv->exception_list), column);
-
- g_signal_connect (gtk_tree_view_get_selection (GTK_TREE_VIEW (priv->exception_list)), "changed",
- G_CALLBACK (exception_selection_changed_cb), rpage);
+ gtk_signal_connect (GTK_OBJECT (priv->exception_add), "clicked",
+ GTK_SIGNAL_FUNC (exception_add_cb), rpage);
+ gtk_signal_connect (GTK_OBJECT (priv->exception_modify), "clicked",
+ GTK_SIGNAL_FUNC (exception_modify_cb), rpage);
+ gtk_signal_connect (GTK_OBJECT (priv->exception_delete), "clicked",
+ GTK_SIGNAL_FUNC (exception_delete_cb), rpage);
+
+ /* Selections in the exceptions list */
+
+ gtk_signal_connect (GTK_OBJECT (priv->exception_list), "select_row",
+ GTK_SIGNAL_FUNC (exception_select_row_cb), rpage);
}
@@ -2347,7 +2437,7 @@ recurrence_page_construct (RecurrencePage *rpage)
priv = rpage->priv;
priv->xml = glade_xml_new (EVOLUTION_GLADEDIR
- "/recurrence-page.glade", NULL, NULL);
+ "/recurrence-page.glade", NULL);
if (!priv->xml) {
g_message ("recurrence_page_construct(): "
"Could not load the Glade XML file!");
@@ -2378,9 +2468,9 @@ recurrence_page_new (void)
{
RecurrencePage *rpage;
- rpage = g_object_new (TYPE_RECURRENCE_PAGE, NULL);
+ rpage = gtk_type_new (TYPE_RECURRENCE_PAGE);
if (!recurrence_page_construct (rpage)) {
- g_object_unref((rpage));
+ gtk_object_unref (GTK_OBJECT (rpage));
return NULL;
}
diff --git a/calendar/gui/dialogs/schedule-page.c b/calendar/gui/dialogs/schedule-page.c
index 97029704a2..c0a3f5f8f9 100644
--- a/calendar/gui/dialogs/schedule-page.c
+++ b/calendar/gui/dialogs/schedule-page.c
@@ -30,7 +30,9 @@
#include <gtk/gtktogglebutton.h>
#include <gtk/gtkvbox.h>
#include <gtk/gtkwindow.h>
+#include <libgnome/gnome-defs.h>
#include <libgnome/gnome-i18n.h>
+#include <libgnomeui/gnome-stock.h>
#include <libgnomeui/gnome-dialog-util.h>
#include <glade/glade.h>
#include <gal/e-table/e-cell-combo.h>
@@ -77,7 +79,7 @@ struct _SchedulePagePrivate {
static void schedule_page_class_init (SchedulePageClass *class);
static void schedule_page_init (SchedulePage *spage);
-static void schedule_page_finalize (GObject *object);
+static void schedule_page_destroy (GtkObject *object);
static GtkWidget *schedule_page_get_widget (CompEditorPage *page);
static void schedule_page_focus_main_widget (CompEditorPage *page);
@@ -99,21 +101,42 @@ static CompEditorPageClass *parent_class = NULL;
*
* Return value: The type ID of the #SchedulePage class.
**/
+GtkType
+schedule_page_get_type (void)
+{
+ static GtkType schedule_page_type;
+
+ if (!schedule_page_type) {
+ static const GtkTypeInfo schedule_page_info = {
+ "SchedulePage",
+ sizeof (SchedulePage),
+ sizeof (SchedulePageClass),
+ (GtkClassInitFunc) schedule_page_class_init,
+ (GtkObjectInitFunc) schedule_page_init,
+ NULL, /* reserved_1 */
+ NULL, /* reserved_2 */
+ (GtkClassInitFunc) NULL
+ };
+
+ schedule_page_type =
+ gtk_type_unique (TYPE_COMP_EDITOR_PAGE,
+ &schedule_page_info);
+ }
-E_MAKE_TYPE (schedule_page, "SchedulePage", SchedulePage, schedule_page_class_init,
- schedule_page_init, TYPE_COMP_EDITOR_PAGE);
+ return schedule_page_type;
+}
/* Class initialization function for the schedule page */
static void
schedule_page_class_init (SchedulePageClass *class)
{
CompEditorPageClass *editor_page_class;
- GObjectClass *object_class;
+ GtkObjectClass *object_class;
editor_page_class = (CompEditorPageClass *) class;
- object_class = (GObjectClass *) class;
+ object_class = (GtkObjectClass *) class;
- parent_class = g_type_class_ref (TYPE_COMP_EDITOR_PAGE);
+ parent_class = gtk_type_class (TYPE_COMP_EDITOR_PAGE);
editor_page_class->get_widget = schedule_page_get_widget;
editor_page_class->focus_main_widget = schedule_page_focus_main_widget;
@@ -122,7 +145,7 @@ schedule_page_class_init (SchedulePageClass *class)
editor_page_class->set_summary = NULL;
editor_page_class->set_dates = schedule_page_set_dates;
- object_class->finalize = schedule_page_finalize;
+ object_class->destroy = schedule_page_destroy;
}
/* Object initialization function for the schedule page */
@@ -145,7 +168,7 @@ schedule_page_init (SchedulePage *spage)
/* Destroy handler for the schedule page */
static void
-schedule_page_finalize (GObject *object)
+schedule_page_destroy (GtkObject *object)
{
SchedulePage *spage;
SchedulePagePrivate *priv;
@@ -157,17 +180,17 @@ schedule_page_finalize (GObject *object)
priv = spage->priv;
if (priv->xml) {
- g_object_unref((priv->xml));
+ gtk_object_unref (GTK_OBJECT (priv->xml));
priv->xml = NULL;
}
- g_object_unref((priv->model));
+ gtk_object_unref (GTK_OBJECT (priv->model));
g_free (priv);
spage->priv = NULL;
- if (G_OBJECT_CLASS (parent_class)->finalize)
- (* G_OBJECT_CLASS (parent_class)->finalize) (object);
+ if (GTK_OBJECT_CLASS (parent_class)->destroy)
+ (* GTK_OBJECT_CLASS (parent_class)->destroy) (object);
}
@@ -362,14 +385,14 @@ get_widgets (SchedulePage *spage)
/* Get the GtkAccelGroup from the toplevel window, so we can install
it when the notebook page is mapped. */
toplevel = gtk_widget_get_toplevel (priv->main);
- accel_groups = gtk_accel_groups_from_object (G_OBJECT (toplevel));
+ accel_groups = gtk_accel_groups_from_object (GTK_OBJECT (toplevel));
if (accel_groups) {
page->accel_group = accel_groups->data;
gtk_accel_group_ref (page->accel_group);
}
gtk_widget_ref (priv->main);
- gtk_container_remove (GTK_CONTAINER (priv->main->parent), priv->main);
+ gtk_widget_unparent (priv->main);
#undef GW
@@ -383,8 +406,8 @@ init_widgets (SchedulePage *spage)
priv = spage->priv;
- g_signal_connect((priv->sel),
- "changed", G_CALLBACK (times_changed_cb), spage);
+ gtk_signal_connect (GTK_OBJECT (priv->sel),
+ "changed", times_changed_cb, spage);
return TRUE;
@@ -409,7 +432,7 @@ schedule_page_construct (SchedulePage *spage, EMeetingModel *emm)
priv = spage->priv;
priv->xml = glade_xml_new (EVOLUTION_GLADEDIR
- "/schedule-page.glade", NULL, NULL);
+ "/schedule-page.glade", NULL);
if (!priv->xml) {
g_message ("schedule_page_construct(): "
"Could not load the Glade XML file!");
@@ -423,7 +446,7 @@ schedule_page_construct (SchedulePage *spage, EMeetingModel *emm)
}
/* Model */
- g_object_ref((emm));
+ gtk_object_ref (GTK_OBJECT (emm));
priv->model = emm;
/* Selector */
@@ -458,9 +481,9 @@ schedule_page_new (EMeetingModel *emm)
{
SchedulePage *spage;
- spage = g_object_new (TYPE_SCHEDULE_PAGE, NULL);
+ spage = gtk_type_new (TYPE_SCHEDULE_PAGE);
if (!schedule_page_construct (spage, emm)) {
- g_object_unref((spage));
+ gtk_object_unref (GTK_OBJECT (spage));
return NULL;
}
diff --git a/calendar/gui/dialogs/send-comp.c b/calendar/gui/dialogs/send-comp.c
index de89d607c2..7d9875133c 100644
--- a/calendar/gui/dialogs/send-comp.c
+++ b/calendar/gui/dialogs/send-comp.c
@@ -23,8 +23,10 @@
#endif
#include <glib.h>
-#include <gtk/gtkmessagedialog.h>
+#include <libgnome/gnome-defs.h>
#include <libgnome/gnome-i18n.h>
+#include <libgnomeui/gnome-dialog.h>
+#include <libgnomeui/gnome-dialog-util.h>
#include <libgnomeui/gnome-uidefs.h>
#include <gal/widgets/e-unicode.h>
#include "send-comp.h"
@@ -45,7 +47,6 @@ send_component_dialog (CalClient *client, CalComponent *comp, gboolean new)
GtkWidget *dialog;
CalComponentVType vtype;
char *str;
- gint response;
if (cal_client_get_save_schedules (client))
return FALSE;
@@ -80,14 +81,9 @@ send_component_dialog (CalClient *client, CalComponent *comp, gboolean new)
return FALSE;
}
- dialog = gtk_message_dialog_new (NULL, GTK_DIALOG_MODAL,
- GTK_MESSAGE_QUESTION,
- GTK_BUTTONS_YES_NO, str);
+ dialog = gnome_question_dialog_modal (str, NULL, NULL);
- response = gtk_dialog_run (GTK_DIALOG (dialog));
- gtk_widget_destroy (dialog);
-
- if (response == GTK_RESPONSE_YES)
+ if (gnome_dialog_run (GNOME_DIALOG (dialog)) == GNOME_YES)
return TRUE;
else
return FALSE;
diff --git a/calendar/gui/dialogs/task-details-page.c b/calendar/gui/dialogs/task-details-page.c
index 629443dba2..66cfc35c2c 100644
--- a/calendar/gui/dialogs/task-details-page.c
+++ b/calendar/gui/dialogs/task-details-page.c
@@ -27,6 +27,7 @@
#include <gtk/gtksignal.h>
#include <gtk/gtktogglebutton.h>
+#include <libgnome/gnome-defs.h>
#include <libgnome/gnome-i18n.h>
#include <glade/glade.h>
#include <gal/widgets/e-unicode.h>
@@ -88,7 +89,7 @@ static const int priority_map[] = {
static void task_details_page_class_init (TaskDetailsPageClass *class);
static void task_details_page_init (TaskDetailsPage *tdpage);
-static void task_details_page_finalize (GObject *object);
+static void task_details_page_destroy (GtkObject *object);
static GtkWidget *task_details_page_get_widget (CompEditorPage *page);
static void task_details_page_focus_main_widget (CompEditorPage *page);
@@ -107,28 +108,49 @@ static CompEditorPageClass *parent_class = NULL;
*
* Return value: The type ID of the #TaskDetailsPage class.
**/
+GtkType
+task_details_page_get_type (void)
+{
+ static GtkType task_details_page_type;
+
+ if (!task_details_page_type) {
+ static const GtkTypeInfo task_details_page_info = {
+ "TaskDetailsPage",
+ sizeof (TaskDetailsPage),
+ sizeof (TaskDetailsPageClass),
+ (GtkClassInitFunc) task_details_page_class_init,
+ (GtkObjectInitFunc) task_details_page_init,
+ NULL, /* reserved_1 */
+ NULL, /* reserved_2 */
+ (GtkClassInitFunc) NULL
+ };
+
+ task_details_page_type =
+ gtk_type_unique (TYPE_COMP_EDITOR_PAGE,
+ &task_details_page_info);
+ }
-E_MAKE_TYPE (task_details_page, "TaskDetailsPage", TaskDetailsPage, task_details_page_class_init,
- task_details_page_init, TYPE_COMP_EDITOR_PAGE);
+ return task_details_page_type;
+}
/* Class initialization function for the task page */
static void
task_details_page_class_init (TaskDetailsPageClass *class)
{
CompEditorPageClass *editor_page_class;
- GObjectClass *object_class;
+ GtkObjectClass *object_class;
editor_page_class = (CompEditorPageClass *) class;
- object_class = (GObjectClass *) class;
+ object_class = (GtkObjectClass *) class;
- parent_class = g_type_class_ref(TYPE_COMP_EDITOR_PAGE);
+ parent_class = gtk_type_class (TYPE_COMP_EDITOR_PAGE);
editor_page_class->get_widget = task_details_page_get_widget;
editor_page_class->focus_main_widget = task_details_page_focus_main_widget;
editor_page_class->fill_widgets = task_details_page_fill_widgets;
editor_page_class->fill_component = task_details_page_fill_component;
- object_class->finalize = task_details_page_finalize;
+ object_class->destroy = task_details_page_destroy;
}
/* Object initialization function for the task page */
@@ -158,7 +180,7 @@ task_details_page_init (TaskDetailsPage *tdpage)
/* Destroy handler for the task page */
static void
-task_details_page_finalize (GObject *object)
+task_details_page_destroy (GtkObject *object)
{
TaskDetailsPage *tdpage;
TaskDetailsPagePrivate *priv;
@@ -170,15 +192,15 @@ task_details_page_finalize (GObject *object)
priv = tdpage->priv;
if (priv->xml) {
- g_object_unref((priv->xml));
+ gtk_object_unref (GTK_OBJECT (priv->xml));
priv->xml = NULL;
}
g_free (priv);
tdpage->priv = NULL;
- if (G_OBJECT_CLASS (parent_class)->finalize)
- (* G_OBJECT_CLASS (parent_class)->finalize) (object);
+ if (GTK_OBJECT_CLASS (parent_class)->destroy)
+ (* GTK_OBJECT_CLASS (parent_class)->destroy) (object);
}
@@ -452,24 +474,22 @@ get_widgets (TaskDetailsPage *tdpage)
/* Get the GtkAccelGroup from the toplevel window, so we can install
it when the notebook page is mapped. */
toplevel = gtk_widget_get_toplevel (priv->main);
- accel_groups = gtk_accel_groups_from_object (G_OBJECT (toplevel));
+ accel_groups = gtk_accel_groups_from_object (GTK_OBJECT (toplevel));
if (accel_groups) {
page->accel_group = accel_groups->data;
gtk_accel_group_ref (page->accel_group);
}
gtk_widget_ref (priv->main);
- gtk_container_remove (GTK_CONTAINER (priv->main->parent), priv->main);
+ gtk_widget_unparent (priv->main);
priv->status = GW ("status");
priv->priority = GW ("priority");
priv->percent_complete = GW ("percent-complete");
priv->completed_date = GW ("completed-date");
- gtk_widget_show (priv->completed_date);
priv->url_entry = GW ("url_entry");
- gtk_widget_show (priv->url_entry);
priv->url = e_url_entry_get_entry (E_URL_ENTRY (priv->url_entry));
#undef GW
@@ -643,7 +663,7 @@ field_changed_cb (GtkWidget *widget, gpointer data)
tdpage = TASK_DETAILS_PAGE (data);
priv = tdpage->priv;
-
+
if (!priv->updating)
comp_editor_page_notify_changed (COMP_EDITOR_PAGE (tdpage));
}
@@ -665,26 +685,26 @@ init_widgets (TaskDetailsPage *tdpage)
/* Connect signals. The Status, Percent Complete & Date Completed
properties are closely related so whenever one changes we may need
to update the other 2. */
- g_signal_connect((GTK_OPTION_MENU (priv->status)->menu),
+ gtk_signal_connect (GTK_OBJECT (GTK_OPTION_MENU (priv->status)->menu),
"deactivate",
- G_CALLBACK (status_changed), tdpage);
+ GTK_SIGNAL_FUNC (status_changed), tdpage);
- g_signal_connect((GTK_SPIN_BUTTON (priv->percent_complete)->adjustment),
+ gtk_signal_connect (GTK_OBJECT (GTK_SPIN_BUTTON (priv->percent_complete)->adjustment),
"value_changed",
- G_CALLBACK (percent_complete_changed), tdpage);
+ GTK_SIGNAL_FUNC (percent_complete_changed), tdpage);
/* Priority */
- g_signal_connect((GTK_OPTION_MENU (priv->priority)->menu),
+ gtk_signal_connect (GTK_OBJECT (GTK_OPTION_MENU (priv->priority)->menu),
"deactivate",
- G_CALLBACK (field_changed_cb), tdpage);
+ GTK_SIGNAL_FUNC (field_changed_cb), tdpage);
/* Completed Date */
- g_signal_connect((priv->completed_date), "changed",
- G_CALLBACK (date_changed_cb), tdpage);
+ gtk_signal_connect (GTK_OBJECT (priv->completed_date), "changed",
+ GTK_SIGNAL_FUNC (date_changed_cb), tdpage);
/* URL */
- g_signal_connect((priv->url), "changed",
- G_CALLBACK (field_changed_cb), tdpage);
+ gtk_signal_connect (GTK_OBJECT (priv->url), "changed",
+ GTK_SIGNAL_FUNC (field_changed_cb), tdpage);
}
@@ -706,7 +726,7 @@ task_details_page_construct (TaskDetailsPage *tdpage)
priv = tdpage->priv;
priv->xml = glade_xml_new (EVOLUTION_GLADEDIR
- "/task-details-page.glade", NULL, NULL);
+ "/task-details-page.glade", NULL);
if (!priv->xml) {
g_message ("task_details_page_construct(): "
"Could not load the Glade XML file!");
@@ -737,9 +757,9 @@ task_details_page_new (void)
{
TaskDetailsPage *tdpage;
- tdpage = g_object_new (TYPE_TASK_DETAILS_PAGE, NULL);
+ tdpage = gtk_type_new (TYPE_TASK_DETAILS_PAGE);
if (!task_details_page_construct (tdpage)) {
- g_object_unref ((tdpage));
+ gtk_object_unref (GTK_OBJECT (tdpage));
return NULL;
}
diff --git a/calendar/gui/dialogs/task-details-page.glade b/calendar/gui/dialogs/task-details-page.glade
index fba510499d..28bf6a3bcc 100644
--- a/calendar/gui/dialogs/task-details-page.glade
+++ b/calendar/gui/dialogs/task-details-page.glade
@@ -1,382 +1,309 @@
-<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*-->
-<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd">
+<?xml version="1.0"?>
+<GTK-Interface>
-<glade-interface>
+<project>
+ <name>task-details-page</name>
+ <program_name>task-details-page</program_name>
+ <directory></directory>
+ <source_directory>src</source_directory>
+ <pixmaps_directory>pixmaps</pixmaps_directory>
+ <language>C</language>
+ <gnome_support>True</gnome_support>
+ <gettext_support>True</gettext_support>
+</project>
-<widget class="GtkWindow" id="task-details-toplevel">
- <property name="title" translatable="yes">window1</property>
- <property name="type">GTK_WINDOW_TOPLEVEL</property>
- <property name="window_position">GTK_WIN_POS_NONE</property>
- <property name="modal">False</property>
- <property name="resizable">True</property>
- <property name="destroy_with_parent">False</property>
+<widget>
+ <class>GtkWindow</class>
+ <name>task-details-toplevel</name>
+ <visible>False</visible>
+ <title>window1</title>
+ <type>GTK_WINDOW_TOPLEVEL</type>
+ <position>GTK_WIN_POS_NONE</position>
+ <modal>False</modal>
+ <allow_shrink>False</allow_shrink>
+ <allow_grow>True</allow_grow>
+ <auto_shrink>False</auto_shrink>
- <child>
- <widget class="GtkVBox" id="task-details-page">
- <property name="border_width">4</property>
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">4</property>
+ <widget>
+ <class>GtkVBox</class>
+ <name>task-details-page</name>
+ <border_width>4</border_width>
+ <homogeneous>False</homogeneous>
+ <spacing>4</spacing>
+ <widget>
+ <class>GtkFrame</class>
+ <name>frame2</name>
+ <label>Progress</label>
+ <label_xalign>0</label_xalign>
+ <shadow_type>GTK_SHADOW_ETCHED_IN</shadow_type>
<child>
- <widget class="GtkFrame" id="frame2">
- <property name="visible">True</property>
- <property name="label_xalign">0</property>
- <property name="label_yalign">0.5</property>
- <property name="shadow_type">GTK_SHADOW_ETCHED_IN</property>
-
- <child>
- <widget class="GtkVBox" id="vbox1">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">0</property>
-
- <child>
- <widget class="GtkHBox" id="hbox1">
- <property name="border_width">4</property>
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">4</property>
-
- <child>
- <widget class="GtkLabel" id="label17">
- <property name="visible">True</property>
- <property name="label" translatable="yes">_Status:</property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="mnemonic_widget">status</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkOptionMenu" id="status">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="history">0</property>
-
- <child internal-child="menu">
- <widget class="GtkMenu" id="convertwidget1">
- <property name="visible">True</property>
-
- <child>
- <widget class="GtkMenuItem" id="convertwidget2">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Not Started</property>
- <property name="use_underline">True</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkMenuItem" id="convertwidget3">
- <property name="visible">True</property>
- <property name="label" translatable="yes">In Progress</property>
- <property name="use_underline">True</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkMenuItem" id="convertwidget5">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Completed</property>
- <property name="use_underline">True</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkMenuItem" id="convertwidget6">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Cancelled</property>
- <property name="use_underline">True</property>
- </widget>
- </child>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label18">
- <property name="visible">True</property>
- <property name="label" translatable="yes">_Priority:</property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="mnemonic_widget">priority</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkOptionMenu" id="priority">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="history">0</property>
-
- <child internal-child="menu">
- <widget class="GtkMenu" id="convertwidget7">
- <property name="visible">True</property>
-
- <child>
- <widget class="GtkMenuItem" id="convertwidget8">
- <property name="visible">True</property>
- <property name="label" translatable="yes">High</property>
- <property name="use_underline">True</property>
- </widget>
- </child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
+ </child>
- <child>
- <widget class="GtkMenuItem" id="convertwidget9">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Normal</property>
- <property name="use_underline">True</property>
- </widget>
- </child>
+ <widget>
+ <class>GtkVBox</class>
+ <name>vbox1</name>
+ <homogeneous>False</homogeneous>
+ <spacing>0</spacing>
- <child>
- <widget class="GtkMenuItem" id="convertwidget10">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Low</property>
- <property name="use_underline">True</property>
- </widget>
- </child>
+ <widget>
+ <class>GtkHBox</class>
+ <name>hbox1</name>
+ <border_width>4</border_width>
+ <homogeneous>False</homogeneous>
+ <spacing>4</spacing>
+ <child>
+ <padding>0</padding>
+ <expand>True</expand>
+ <fill>True</fill>
+ </child>
- <child>
- <widget class="GtkMenuItem" id="convertwidget11">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Undefined</property>
- <property name="use_underline">True</property>
- </widget>
- </child>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
+ <widget>
+ <class>GtkLabel</class>
+ <name>label17</name>
+ <label>_Status:</label>
+ <justify>GTK_JUSTIFY_CENTER</justify>
+ <wrap>False</wrap>
+ <xalign>0.5</xalign>
+ <yalign>0.5</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <default_focus_target>status</default_focus_target>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
+ </child>
+ </widget>
- <child>
- <widget class="GtkLabel" id="label19">
- <property name="visible">True</property>
- <property name="label" translatable="yes">% Complete</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
+ <widget>
+ <class>GtkOptionMenu</class>
+ <name>status</name>
+ <can_focus>True</can_focus>
+ <items>Not Started
+In Progress
+Completed
+Cancelled
+</items>
+ <initial_choice>0</initial_choice>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
+ </child>
+ </widget>
- <child>
- <widget class="GtkSpinButton" id="percent-complete">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="climb_rate">1</property>
- <property name="digits">0</property>
- <property name="numeric">False</property>
- <property name="update_policy">GTK_UPDATE_ALWAYS</property>
- <property name="snap_to_ticks">False</property>
- <property name="wrap">False</property>
- <property name="adjustment">1 0 100 1 10 10</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
+ <widget>
+ <class>GtkLabel</class>
+ <name>label18</name>
+ <label>_Priority:</label>
+ <justify>GTK_JUSTIFY_CENTER</justify>
+ <wrap>False</wrap>
+ <xalign>0.5</xalign>
+ <yalign>0.5</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <default_focus_target>priority</default_focus_target>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
+ </child>
+ </widget>
- <child>
- <widget class="GtkTable" id="table1">
- <property name="border_width">4</property>
- <property name="visible">True</property>
- <property name="n_rows">1</property>
- <property name="n_columns">2</property>
- <property name="homogeneous">False</property>
- <property name="row_spacing">2</property>
- <property name="column_spacing">4</property>
+ <widget>
+ <class>GtkOptionMenu</class>
+ <name>priority</name>
+ <can_focus>True</can_focus>
+ <items>High
+Normal
+Low
+Undefined
+</items>
+ <initial_choice>0</initial_choice>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
+ </child>
+ </widget>
- <child>
- <widget class="GtkLabel" id="label12">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Date Completed:</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
- </packing>
- </child>
+ <widget>
+ <class>GtkLabel</class>
+ <name>label19</name>
+ <label>% Complete</label>
+ <justify>GTK_JUSTIFY_CENTER</justify>
+ <wrap>False</wrap>
+ <xalign>0.5</xalign>
+ <yalign>0.5</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
+ </child>
+ </widget>
- <child>
- <widget class="Custom" id="completed-date">
- <property name="visible">True</property>
- <property name="creation_function">task_details_page_create_date_edit</property>
- <property name="int1">0</property>
- <property name="int2">0</property>
- <property name="last_modification_time">Fri, 01 Jun 2001 18:58:51 GMT</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
- </widget>
- </child>
+ <widget>
+ <class>GtkSpinButton</class>
+ <name>percent-complete</name>
+ <can_focus>True</can_focus>
+ <climb_rate>1</climb_rate>
+ <digits>0</digits>
+ <numeric>False</numeric>
+ <update_policy>GTK_UPDATE_ALWAYS</update_policy>
+ <snap>False</snap>
+ <wrap>False</wrap>
+ <value>1</value>
+ <lower>0</lower>
+ <upper>100</upper>
+ <step>1</step>
+ <page>10</page>
+ <page_size>10</page_size>
+ <child>
+ <padding>0</padding>
+ <expand>True</expand>
+ <fill>True</fill>
+ </child>
+ </widget>
+ </widget>
+ <widget>
+ <class>GtkTable</class>
+ <name>table1</name>
+ <border_width>4</border_width>
+ <rows>1</rows>
+ <columns>2</columns>
+ <homogeneous>False</homogeneous>
+ <row_spacing>2</row_spacing>
+ <column_spacing>4</column_spacing>
<child>
- <widget class="GtkLabel" id="label1">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Progress</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="type">label_item</property>
- </packing>
+ <padding>0</padding>
+ <expand>True</expand>
+ <fill>True</fill>
</child>
+
+ <widget>
+ <class>GtkLabel</class>
+ <name>label12</name>
+ <label>Date Completed:</label>
+ <justify>GTK_JUSTIFY_CENTER</justify>
+ <wrap>False</wrap>
+ <xalign>0</xalign>
+ <yalign>0.5</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <child>
+ <left_attach>0</left_attach>
+ <right_attach>1</right_attach>
+ <top_attach>0</top_attach>
+ <bottom_attach>1</bottom_attach>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <xexpand>False</xexpand>
+ <yexpand>False</yexpand>
+ <xshrink>False</xshrink>
+ <yshrink>False</yshrink>
+ <xfill>True</xfill>
+ <yfill>False</yfill>
+ </child>
+ </widget>
+
+ <widget>
+ <class>Custom</class>
+ <name>completed-date</name>
+ <creation_function>task_details_page_create_date_edit</creation_function>
+ <int1>0</int1>
+ <int2>0</int2>
+ <last_modification_time>Fri, 01 Jun 2001 18:58:51 GMT</last_modification_time>
+ <child>
+ <left_attach>1</left_attach>
+ <right_attach>2</right_attach>
+ <top_attach>0</top_attach>
+ <bottom_attach>1</bottom_attach>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <xexpand>False</xexpand>
+ <yexpand>False</yexpand>
+ <xshrink>False</xshrink>
+ <yshrink>False</yshrink>
+ <xfill>True</xfill>
+ <yfill>True</yfill>
+ </child>
+ </widget>
</widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
+ </widget>
+ </widget>
+ <widget>
+ <class>GtkTable</class>
+ <name>table2</name>
+ <border_width>4</border_width>
+ <rows>1</rows>
+ <columns>2</columns>
+ <homogeneous>False</homogeneous>
+ <row_spacing>2</row_spacing>
+ <column_spacing>4</column_spacing>
<child>
- <widget class="GtkTable" id="table2">
- <property name="border_width">4</property>
- <property name="visible">True</property>
- <property name="n_rows">1</property>
- <property name="n_columns">2</property>
- <property name="homogeneous">False</property>
- <property name="row_spacing">2</property>
- <property name="column_spacing">4</property>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>True</fill>
+ </child>
- <child>
- <widget class="GtkLabel" id="label14">
- <property name="visible">True</property>
- <property name="label" translatable="yes">URL:</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
- </packing>
- </child>
+ <widget>
+ <class>GtkLabel</class>
+ <name>label14</name>
+ <label>URL:</label>
+ <justify>GTK_JUSTIFY_CENTER</justify>
+ <wrap>False</wrap>
+ <xalign>0</xalign>
+ <yalign>0.5</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <child>
+ <left_attach>0</left_attach>
+ <right_attach>1</right_attach>
+ <top_attach>0</top_attach>
+ <bottom_attach>1</bottom_attach>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <xexpand>False</xexpand>
+ <yexpand>False</yexpand>
+ <xshrink>False</xshrink>
+ <yshrink>False</yshrink>
+ <xfill>True</xfill>
+ <yfill>False</yfill>
+ </child>
+ </widget>
- <child>
- <widget class="Custom" id="url_entry">
- <property name="visible">True</property>
- <property name="creation_function">e_url_entry_new</property>
- <property name="int1">0</property>
- <property name="int2">0</property>
- <property name="last_modification_time">Fri, 08 Feb 2002 21:02:37 GMT</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">True</property>
- </packing>
- </child>
+ <widget>
+ <class>Custom</class>
+ <name>url_entry</name>
+ <creation_function>e_url_entry_new</creation_function>
+ <int1>0</int1>
+ <int2>0</int2>
+ <last_modification_time>Fri, 08 Feb 2002 21:02:37 GMT</last_modification_time>
+ <child>
+ <left_attach>1</left_attach>
+ <right_attach>2</right_attach>
+ <top_attach>0</top_attach>
+ <bottom_attach>1</bottom_attach>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <xexpand>True</xexpand>
+ <yexpand>False</yexpand>
+ <xshrink>False</xshrink>
+ <yshrink>False</yshrink>
+ <xfill>True</xfill>
+ <yfill>True</yfill>
+ </child>
+ </widget>
</widget>
- </child>
+ </widget>
</widget>
-</glade-interface>
+</GTK-Interface>
diff --git a/calendar/gui/dialogs/task-editor.c b/calendar/gui/dialogs/task-editor.c
index 0b2aee9827..051fe1c9b7 100644
--- a/calendar/gui/dialogs/task-editor.c
+++ b/calendar/gui/dialogs/task-editor.c
@@ -52,7 +52,7 @@ static void task_editor_class_init (TaskEditorClass *class);
static void task_editor_init (TaskEditor *te);
static void task_editor_edit_comp (CompEditor *editor, CalComponent *comp);
static gboolean task_editor_send_comp (CompEditor *editor, CalComponentItipMethod method);
-static void task_editor_finalize (GObject *object);
+static void task_editor_destroy (GtkObject *object);
static void assign_task_cmd (GtkWidget *widget, gpointer data);
static void refresh_task_cmd (GtkWidget *widget, gpointer data);
@@ -83,26 +83,46 @@ static CompEditorClass *parent_class;
*
* Return value: The type ID of the #TaskEditor class.
**/
+GtkType
+task_editor_get_type (void)
+{
+ static GtkType task_editor_type = 0;
+
+ if (!task_editor_type) {
+ static const GtkTypeInfo task_editor_info = {
+ "TaskEditor",
+ sizeof (TaskEditor),
+ sizeof (TaskEditorClass),
+ (GtkClassInitFunc) task_editor_class_init,
+ (GtkObjectInitFunc) task_editor_init,
+ NULL, /* reserved_1 */
+ NULL, /* reserved_2 */
+ (GtkClassInitFunc) NULL
+ };
+
+ task_editor_type = gtk_type_unique (TYPE_COMP_EDITOR,
+ &task_editor_info);
+ }
-E_MAKE_TYPE (task_editor, "TaskEditor", TaskEditor, task_editor_class_init, task_editor_init,
- TYPE_COMP_EDITOR);
+ return task_editor_type;
+}
/* Class initialization function for the event editor */
static void
task_editor_class_init (TaskEditorClass *klass)
{
- GObjectClass *object_class;
+ GtkObjectClass *object_class;
CompEditorClass *editor_class;
- object_class = (GObjectClass *) klass;
+ object_class = (GtkObjectClass *) klass;
editor_class = (CompEditorClass *) klass;
- parent_class = g_type_class_ref(TYPE_COMP_EDITOR);
+ parent_class = gtk_type_class (TYPE_COMP_EDITOR);
editor_class->edit_comp = task_editor_edit_comp;
editor_class->send_comp = task_editor_send_comp;
- object_class->finalize = task_editor_finalize;
+ object_class->destroy = task_editor_destroy;
}
static void
@@ -151,12 +171,12 @@ init_widgets (TaskEditor *te)
priv = te->priv;
- g_signal_connect((priv->model), "model_row_changed",
- G_CALLBACK (model_row_changed_cb), te);
- g_signal_connect((priv->model), "model_rows_inserted",
- G_CALLBACK (row_count_changed_cb), te);
- g_signal_connect((priv->model), "model_rows_deleted",
- G_CALLBACK (row_count_changed_cb), te);
+ gtk_signal_connect (GTK_OBJECT (priv->model), "model_row_changed",
+ GTK_SIGNAL_FUNC (model_row_changed_cb), te);
+ gtk_signal_connect (GTK_OBJECT (priv->model), "model_rows_inserted",
+ GTK_SIGNAL_FUNC (row_count_changed_cb), te);
+ gtk_signal_connect (GTK_OBJECT (priv->model), "model_rows_deleted",
+ GTK_SIGNAL_FUNC (row_count_changed_cb), te);
}
/* Object initialization function for the task editor */
@@ -182,22 +202,16 @@ task_editor_construct (TaskEditor *te, CalClient *client)
priv = te->priv;
priv->task_page = task_page_new ();
- g_object_ref (priv->task_page);
- gtk_object_sink (GTK_OBJECT (priv->task_page));
comp_editor_append_page (COMP_EDITOR (te),
COMP_EDITOR_PAGE (priv->task_page),
_("Basic"));
priv->task_details_page = task_details_page_new ();
- g_object_ref (priv->task_details_page);
- gtk_object_sink (GTK_OBJECT (priv->task_details_page));
comp_editor_append_page (COMP_EDITOR (te),
COMP_EDITOR_PAGE (priv->task_details_page),
_("Details"));
priv->meet_page = meeting_page_new (priv->model, client);
- g_object_ref (priv->meet_page);
- gtk_object_sink (GTK_OBJECT (priv->meet_page));
comp_editor_append_page (COMP_EDITOR (te),
COMP_EDITOR_PAGE (priv->meet_page),
_("Assignment"));
@@ -243,42 +257,50 @@ task_editor_edit_comp (CompEditor *editor, CalComponent *comp)
priv->assignment_shown = FALSE;
} else {
GSList *l;
+ GList *addresses, *ll;
int row;
-
- if (!priv->assignment_shown)
+
+ if (!priv->assignment_shown) {
comp_editor_append_page (COMP_EDITOR (te),
COMP_EDITOR_PAGE (priv->meet_page),
_("Assignment"));
-
+ }
+
for (l = attendees; l != NULL; l = l->next) {
CalComponentAttendee *ca = l->data;
EMeetingAttendee *ia;
ia = E_MEETING_ATTENDEE (e_meeting_attendee_new_from_cal_component_attendee (ca));
- if (!comp_editor_get_user_org (editor))
- e_meeting_attendee_set_edit_level (ia, E_MEETING_ATTENDEE_EDIT_NONE);
- e_meeting_model_add_attendee (priv->model, ia);
+ if (!comp_editor_get_user_org (editor))
+ e_meeting_attendee_set_edit_level (ia, E_MEETING_ATTENDEE_EDIT_NONE);
+ e_meeting_model_add_attendee (priv->model, ia);
+
+ gtk_object_unref (GTK_OBJECT (ia));
+ }
- g_object_unref(ia);
+ addresses = itip_addresses_get ();
+ for (ll = addresses; ll != NULL; ll = ll->next) {
+ EMeetingAttendee *ia;
+ ItipAddress *a = ll->data;
+
+ ia = e_meeting_model_find_attendee (priv->model, a->address, &row);
+ if (ia != NULL)
+ e_meeting_attendee_set_edit_level (ia, E_MEETING_ATTENDEE_EDIT_STATUS);
}
+ itip_addresses_free (addresses);
/* If we aren't the organizer we can still change our own status */
if (!comp_editor_get_user_org (editor)) {
- EAccountList *accounts;
- EAccount *account;
- EIterator *it;
-
- accounts = itip_addresses_get ();
- for (it = e_list_get_iterator((EList *)accounts);e_iterator_is_valid(it);e_iterator_next(it)) {
+ addresses = itip_addresses_get ();
+ for (ll = addresses; ll != NULL; ll = ll->next) {
EMeetingAttendee *ia;
-
- account = (EAccount*)e_iterator_get(it);
-
- ia = e_meeting_model_find_attendee (priv->model, account->id->address, &row);
+ ItipAddress *a = ll->data;
+
+ ia = e_meeting_model_find_attendee (priv->model, a->address, &row);
if (ia != NULL)
e_meeting_attendee_set_edit_level (ia, E_MEETING_ATTENDEE_EDIT_STATUS);
}
- g_object_unref(it);
+ itip_addresses_free (addresses);
} else if (cal_client_get_organizer_must_attend (client)) {
EMeetingAttendee *ia;
@@ -286,8 +308,8 @@ task_editor_edit_comp (CompEditor *editor, CalComponent *comp)
if (ia != NULL)
e_meeting_attendee_set_edit_level (ia, E_MEETING_ATTENDEE_EDIT_NONE);
}
-
- priv->assignment_shown = TRUE;
+
+ priv->assignment_shown = TRUE;
}
cal_component_free_attendee_list (attendees);
@@ -318,7 +340,7 @@ task_editor_send_comp (CompEditor *editor, CalComponentItipMethod method)
client = e_meeting_model_get_cal_client (priv->model);
result = itip_send_comp (CAL_COMPONENT_METHOD_CANCEL, comp, client, NULL);
- g_object_unref((comp));
+ gtk_object_unref (GTK_OBJECT (comp));
if (!result)
return FALSE;
@@ -333,7 +355,7 @@ task_editor_send_comp (CompEditor *editor, CalComponentItipMethod method)
/* Destroy handler for the event editor */
static void
-task_editor_finalize (GObject *object)
+task_editor_destroy (GtkObject *object)
{
TaskEditor *te;
TaskEditorPrivate *priv;
@@ -344,14 +366,14 @@ task_editor_finalize (GObject *object)
te = TASK_EDITOR (object);
priv = te->priv;
- g_object_unref((priv->task_page));
- g_object_unref((priv->task_details_page));
- g_object_unref((priv->meet_page));
+ gtk_object_unref (GTK_OBJECT (priv->task_page));
+ gtk_object_unref (GTK_OBJECT (priv->task_details_page));
+ gtk_object_unref (GTK_OBJECT (priv->meet_page));
- g_object_unref((priv->model));
+ gtk_object_unref (GTK_OBJECT (priv->model));
- if (G_OBJECT_CLASS (parent_class)->finalize)
- (* G_OBJECT_CLASS (parent_class)->finalize) (object);
+ if (GTK_OBJECT_CLASS (parent_class)->destroy)
+ (* GTK_OBJECT_CLASS (parent_class)->destroy) (object);
}
/**
@@ -368,7 +390,7 @@ task_editor_new (CalClient *client)
{
TaskEditor *te;
- te = g_object_new (TYPE_TASK_EDITOR, NULL);
+ te = TASK_EDITOR (gtk_type_new (TYPE_TASK_EDITOR));
return task_editor_construct (te, client);
}
diff --git a/calendar/gui/e-calendar-table.c b/calendar/gui/e-calendar-table.c
index 0cf38eedd1..4fff976ed1 100644
--- a/calendar/gui/e-calendar-table.c
+++ b/calendar/gui/e-calendar-table.c
@@ -37,6 +37,7 @@
#include <gal/e-table/e-cell-toggle.h>
#include <gal/e-table/e-cell-text.h>
#include <gal/e-table/e-cell-combo.h>
+#include <gal/util/e-unicode-i18n.h>
#include <gal/widgets/e-popup-menu.h>
#include <e-util/e-dialog-utils.h>
#include <widgets/misc/e-cell-date-edit.h>
@@ -125,8 +126,32 @@ static GdkPixbuf* icon_pixbufs[E_CALENDAR_MODEL_NUM_ICONS] = { 0 };
static GtkTableClass *parent_class;
static GdkAtom clipboard_atom = GDK_NONE;
-E_MAKE_TYPE (e_calendar_table, "ECalendarTable", ECalendarTable, e_calendar_table_class_init,
- e_calendar_table_init, GTK_TYPE_TABLE);
+
+GtkType
+e_calendar_table_get_type (void)
+{
+ static GtkType e_calendar_table_type = 0;
+
+ if (!e_calendar_table_type){
+ GtkTypeInfo e_calendar_table_info = {
+ "ECalendarTable",
+ sizeof (ECalendarTable),
+ sizeof (ECalendarTableClass),
+ (GtkClassInitFunc) e_calendar_table_class_init,
+ (GtkObjectInitFunc) e_calendar_table_init,
+ NULL, /* reserved 1 */
+ NULL, /* reserved 2 */
+ (GtkClassInitFunc) NULL
+ };
+
+ parent_class = gtk_type_class (GTK_TYPE_TABLE);
+ e_calendar_table_type = gtk_type_unique (GTK_TYPE_TABLE,
+ &e_calendar_table_info);
+ }
+
+ return e_calendar_table_type;
+}
+
static void
e_calendar_table_class_init (ECalendarTableClass *class)
@@ -320,11 +345,11 @@ e_calendar_table_init (ECalendarTable *cal_table)
* Normal string fields.
*/
cell = e_cell_text_new (NULL, GTK_JUSTIFY_LEFT);
- g_object_set (G_OBJECT (cell),
- "strikeout_column", CAL_COMPONENT_FIELD_COMPLETE,
- "bold_column", CAL_COMPONENT_FIELD_OVERDUE,
- "color_column", CAL_COMPONENT_FIELD_COLOR,
- NULL);
+ gtk_object_set (GTK_OBJECT (cell),
+ "strikeout_column", CAL_COMPONENT_FIELD_COMPLETE,
+ "bold_column", CAL_COMPONENT_FIELD_OVERDUE,
+ "color_column", CAL_COMPONENT_FIELD_COLOR,
+ NULL);
e_table_extras_add_cell (extras, "calstring", cell);
@@ -333,15 +358,15 @@ e_calendar_table_init (ECalendarTable *cal_table)
* Date fields.
*/
cell = e_cell_date_edit_text_new (NULL, GTK_JUSTIFY_LEFT);
- g_object_set (G_OBJECT (cell),
- "strikeout_column", CAL_COMPONENT_FIELD_COMPLETE,
- "bold_column", CAL_COMPONENT_FIELD_OVERDUE,
- "color_column", CAL_COMPONENT_FIELD_COLOR,
- NULL);
+ gtk_object_set (GTK_OBJECT (cell),
+ "strikeout_column", CAL_COMPONENT_FIELD_COMPLETE,
+ "bold_column", CAL_COMPONENT_FIELD_OVERDUE,
+ "color_column", CAL_COMPONENT_FIELD_COLOR,
+ NULL);
popup_cell = e_cell_date_edit_new ();
e_cell_popup_set_child (E_CELL_POPUP (popup_cell), cell);
- g_object_unref (cell);
+ gtk_object_unref (GTK_OBJECT (cell));
e_table_extras_add_cell (extras, "dateedit", popup_cell);
cal_table->dates_cell = E_CELL_DATE_EDIT (popup_cell);
@@ -356,21 +381,21 @@ e_calendar_table_init (ECalendarTable *cal_table)
/* Classification field. */
cell = e_cell_text_new (NULL, GTK_JUSTIFY_LEFT);
- g_object_set (G_OBJECT (cell),
- "strikeout_column", CAL_COMPONENT_FIELD_COMPLETE,
- "bold_column", CAL_COMPONENT_FIELD_OVERDUE,
- "color_column", CAL_COMPONENT_FIELD_COLOR,
- "editable", FALSE,
- NULL);
+ gtk_object_set (GTK_OBJECT (cell),
+ "strikeout_column", CAL_COMPONENT_FIELD_COMPLETE,
+ "bold_column", CAL_COMPONENT_FIELD_OVERDUE,
+ "color_column", CAL_COMPONENT_FIELD_COLOR,
+ "editable", FALSE,
+ NULL);
popup_cell = e_cell_combo_new ();
e_cell_popup_set_child (E_CELL_POPUP (popup_cell), cell);
- g_object_unref (cell);
+ gtk_object_unref (GTK_OBJECT (cell));
strings = NULL;
- strings = g_list_append (strings, (char*) _("Public"));
- strings = g_list_append (strings, (char*) _("Private"));
- strings = g_list_append (strings, (char*) _("Confidential"));
+ strings = g_list_append (strings, (char*) U_("Public"));
+ strings = g_list_append (strings, (char*) U_("Private"));
+ strings = g_list_append (strings, (char*) U_("Confidential"));
e_cell_combo_set_popdown_strings (E_CELL_COMBO (popup_cell),
strings);
@@ -378,22 +403,22 @@ e_calendar_table_init (ECalendarTable *cal_table)
/* Priority field. */
cell = e_cell_text_new (NULL, GTK_JUSTIFY_LEFT);
- g_object_set (G_OBJECT (cell),
- "strikeout_column", CAL_COMPONENT_FIELD_COMPLETE,
- "bold_column", CAL_COMPONENT_FIELD_OVERDUE,
- "color_column", CAL_COMPONENT_FIELD_COLOR,
- "editable", FALSE,
- NULL);
+ gtk_object_set (GTK_OBJECT (cell),
+ "strikeout_column", CAL_COMPONENT_FIELD_COMPLETE,
+ "bold_column", CAL_COMPONENT_FIELD_OVERDUE,
+ "color_column", CAL_COMPONENT_FIELD_COLOR,
+ "editable", FALSE,
+ NULL);
popup_cell = e_cell_combo_new ();
e_cell_popup_set_child (E_CELL_POPUP (popup_cell), cell);
- g_object_unref (cell);
+ gtk_object_unref (GTK_OBJECT (cell));
strings = NULL;
- strings = g_list_append (strings, (char*) _("High"));
- strings = g_list_append (strings, (char*) _("Normal"));
- strings = g_list_append (strings, (char*) _("Low"));
- strings = g_list_append (strings, (char*) _("Undefined"));
+ strings = g_list_append (strings, (char*) U_("High"));
+ strings = g_list_append (strings, (char*) U_("Normal"));
+ strings = g_list_append (strings, (char*) U_("Low"));
+ strings = g_list_append (strings, (char*) U_("Undefined"));
e_cell_combo_set_popdown_strings (E_CELL_COMBO (popup_cell),
strings);
@@ -401,28 +426,28 @@ e_calendar_table_init (ECalendarTable *cal_table)
/* Percent field. */
cell = e_cell_percent_new (NULL, GTK_JUSTIFY_LEFT);
- g_object_set (G_OBJECT (cell),
- "strikeout_column", CAL_COMPONENT_FIELD_COMPLETE,
- "bold_column", CAL_COMPONENT_FIELD_OVERDUE,
- "color_column", CAL_COMPONENT_FIELD_COLOR,
- NULL);
+ gtk_object_set (GTK_OBJECT (cell),
+ "strikeout_column", CAL_COMPONENT_FIELD_COMPLETE,
+ "bold_column", CAL_COMPONENT_FIELD_OVERDUE,
+ "color_column", CAL_COMPONENT_FIELD_COLOR,
+ NULL);
popup_cell = e_cell_combo_new ();
e_cell_popup_set_child (E_CELL_POPUP (popup_cell), cell);
- g_object_unref (cell);
+ gtk_object_unref (GTK_OBJECT (cell));
strings = NULL;
- strings = g_list_append (strings, (char*) _("0%"));
- strings = g_list_append (strings, (char*) _("10%"));
- strings = g_list_append (strings, (char*) _("20%"));
- strings = g_list_append (strings, (char*) _("30%"));
- strings = g_list_append (strings, (char*) _("40%"));
- strings = g_list_append (strings, (char*) _("50%"));
- strings = g_list_append (strings, (char*) _("60%"));
- strings = g_list_append (strings, (char*) _("70%"));
- strings = g_list_append (strings, (char*) _("80%"));
- strings = g_list_append (strings, (char*) _("90%"));
- strings = g_list_append (strings, (char*) _("100%"));
+ strings = g_list_append (strings, (char*) U_("0%"));
+ strings = g_list_append (strings, (char*) U_("10%"));
+ strings = g_list_append (strings, (char*) U_("20%"));
+ strings = g_list_append (strings, (char*) U_("30%"));
+ strings = g_list_append (strings, (char*) U_("40%"));
+ strings = g_list_append (strings, (char*) U_("50%"));
+ strings = g_list_append (strings, (char*) U_("60%"));
+ strings = g_list_append (strings, (char*) U_("70%"));
+ strings = g_list_append (strings, (char*) U_("80%"));
+ strings = g_list_append (strings, (char*) U_("90%"));
+ strings = g_list_append (strings, (char*) U_("100%"));
e_cell_combo_set_popdown_strings (E_CELL_COMBO (popup_cell),
strings);
@@ -430,20 +455,20 @@ e_calendar_table_init (ECalendarTable *cal_table)
/* Transparency field. */
cell = e_cell_text_new (NULL, GTK_JUSTIFY_LEFT);
- g_object_set (G_OBJECT (cell),
- "strikeout_column", CAL_COMPONENT_FIELD_COMPLETE,
- "bold_column", CAL_COMPONENT_FIELD_OVERDUE,
- "color_column", CAL_COMPONENT_FIELD_COLOR,
- "editable", FALSE,
- NULL);
+ gtk_object_set (GTK_OBJECT (cell),
+ "strikeout_column", CAL_COMPONENT_FIELD_COMPLETE,
+ "bold_column", CAL_COMPONENT_FIELD_OVERDUE,
+ "color_column", CAL_COMPONENT_FIELD_COLOR,
+ "editable", FALSE,
+ NULL);
popup_cell = e_cell_combo_new ();
e_cell_popup_set_child (E_CELL_POPUP (popup_cell), cell);
- g_object_unref (cell);
+ gtk_object_unref (GTK_OBJECT (cell));
strings = NULL;
- strings = g_list_append (strings, (char*) _("Free"));
- strings = g_list_append (strings, (char*) _("Busy"));
+ strings = g_list_append (strings, (char*) U_("Free"));
+ strings = g_list_append (strings, (char*) U_("Busy"));
e_cell_combo_set_popdown_strings (E_CELL_COMBO (popup_cell),
strings);
@@ -451,22 +476,22 @@ e_calendar_table_init (ECalendarTable *cal_table)
/* Status field. */
cell = e_cell_text_new (NULL, GTK_JUSTIFY_LEFT);
- g_object_set (G_OBJECT (cell),
- "strikeout_column", CAL_COMPONENT_FIELD_COMPLETE,
- "bold_column", CAL_COMPONENT_FIELD_OVERDUE,
- "color_column", CAL_COMPONENT_FIELD_COLOR,
- "editable", FALSE,
- NULL);
+ gtk_object_set (GTK_OBJECT (cell),
+ "strikeout_column", CAL_COMPONENT_FIELD_COMPLETE,
+ "bold_column", CAL_COMPONENT_FIELD_OVERDUE,
+ "color_column", CAL_COMPONENT_FIELD_COLOR,
+ "editable", FALSE,
+ NULL);
popup_cell = e_cell_combo_new ();
e_cell_popup_set_child (E_CELL_POPUP (popup_cell), cell);
- g_object_unref (cell);
+ gtk_object_unref (GTK_OBJECT (cell));
strings = NULL;
- strings = g_list_append (strings, (char*) _("Not Started"));
- strings = g_list_append (strings, (char*) _("In Progress"));
- strings = g_list_append (strings, (char*) _("Completed"));
- strings = g_list_append (strings, (char*) _("Cancelled"));
+ strings = g_list_append (strings, (char*) U_("Not Started"));
+ strings = g_list_append (strings, (char*) U_("In Progress"));
+ strings = g_list_append (strings, (char*) U_("Completed"));
+ strings = g_list_append (strings, (char*) U_("Cancelled"));
e_cell_combo_set_popdown_strings (E_CELL_COMBO (popup_cell),
strings);
@@ -507,7 +532,7 @@ e_calendar_table_init (ECalendarTable *cal_table)
extras,
EVOLUTION_ETSPECDIR "/e-calendar-table.etspec",
NULL);
- g_object_unref (extras);
+ gtk_object_unref (GTK_OBJECT (extras));
cal_table->etable = table;
gtk_table_attach (GTK_TABLE (cal_table), table, 0, 1, 0, 1,
@@ -516,9 +541,15 @@ e_calendar_table_init (ECalendarTable *cal_table)
e_table = e_table_scrolled_get_table (E_TABLE_SCROLLED (table));
- g_signal_connect (e_table, "double_click", G_CALLBACK (e_calendar_table_on_double_click), cal_table);
- g_signal_connect (e_table, "right_click", G_CALLBACK (e_calendar_table_on_right_click), cal_table);
- g_signal_connect (e_table, "key_press", G_CALLBACK (e_calendar_table_on_key_press), cal_table);
+ gtk_signal_connect (GTK_OBJECT (e_table), "double_click",
+ GTK_SIGNAL_FUNC (e_calendar_table_on_double_click),
+ cal_table);
+ gtk_signal_connect (GTK_OBJECT (e_table), "right_click",
+ GTK_SIGNAL_FUNC (e_calendar_table_on_right_click),
+ cal_table);
+ gtk_signal_connect (GTK_OBJECT (e_table), "key_press",
+ GTK_SIGNAL_FUNC (e_calendar_table_on_key_press),
+ cal_table);
/* Set up the invisible widget for the clipboard selections */
cal_table->invisible = gtk_invisible_new ();
@@ -526,15 +557,22 @@ e_calendar_table_init (ECalendarTable *cal_table)
clipboard_atom,
GDK_SELECTION_TYPE_STRING,
0);
- g_signal_connect (cal_table->invisible, "selection_get",
- G_CALLBACK (selection_get), cal_table);
- g_signal_connect (cal_table->invisible, "selection_clear_event",
- G_CALLBACK (selection_clear_event), cal_table);
- g_signal_connect (cal_table->invisible, "selection_received",
- G_CALLBACK (selection_received), cal_table);
- g_signal_connect (cal_table->invisible, "destroy",
- G_CALLBACK (invisible_destroyed), cal_table);
-
+ gtk_signal_connect (GTK_OBJECT (cal_table->invisible),
+ "selection_get",
+ GTK_SIGNAL_FUNC (selection_get),
+ (gpointer) cal_table);
+ gtk_signal_connect (GTK_OBJECT (cal_table->invisible),
+ "selection_clear_event",
+ GTK_SIGNAL_FUNC (selection_clear_event),
+ (gpointer) cal_table);
+ gtk_signal_connect (GTK_OBJECT (cal_table->invisible),
+ "selection_received",
+ GTK_SIGNAL_FUNC (selection_received),
+ (gpointer) cal_table);
+ gtk_signal_connect (GTK_OBJECT (cal_table->invisible),
+ "destroy",
+ GTK_SIGNAL_FUNC (invisible_destroyed),
+ (gpointer) cal_table);
cal_table->clipboard_selection = NULL;
}
@@ -550,7 +588,7 @@ e_calendar_table_new (void)
{
GtkWidget *cal_table;
- cal_table = GTK_WIDGET (g_object_new (e_calendar_table_get_type (), NULL));
+ cal_table = GTK_WIDGET (gtk_type_new (e_calendar_table_get_type ()));
return cal_table;
}
@@ -581,7 +619,7 @@ e_calendar_table_destroy (GtkObject *object)
cal_table = E_CALENDAR_TABLE (object);
- g_object_unref (cal_table->model);
+ gtk_object_unref (GTK_OBJECT (cal_table->model));
cal_table->model = NULL;
if (cal_table->invisible)
@@ -947,27 +985,27 @@ enum {
static EPopupMenu tasks_popup_menu [] = {
- E_POPUP_ITEM (N_("_Open"), GTK_SIGNAL_FUNC (e_calendar_table_on_open_task), MASK_SINGLE),
- E_POPUP_ITEM (N_("_Save as..."), GTK_SIGNAL_FUNC (e_calendar_table_on_save_as), MASK_SINGLE),
- E_POPUP_ITEM (N_("_Print..."), GTK_SIGNAL_FUNC (e_calendar_table_on_print_task), MASK_SINGLE),
+ E_POPUP_ITEM (N_("_Open"), e_calendar_table_on_open_task, MASK_SINGLE),
+ E_POPUP_ITEM (N_("_Save as..."), e_calendar_table_on_save_as, MASK_SINGLE),
+ E_POPUP_ITEM (N_("_Print..."), e_calendar_table_on_print_task, MASK_SINGLE),
E_POPUP_SEPARATOR,
- E_POPUP_ITEM (N_("C_ut"), GTK_SIGNAL_FUNC (e_calendar_table_on_cut), MASK_EDITABLE),
- E_POPUP_ITEM (N_("_Copy"), GTK_SIGNAL_FUNC (e_calendar_table_on_copy), 0),
- E_POPUP_ITEM (N_("_Paste"), GTK_SIGNAL_FUNC (e_calendar_table_on_paste), MASK_EDITABLE),
+ E_POPUP_ITEM (N_("C_ut"), e_calendar_table_on_cut, MASK_EDITABLE),
+ E_POPUP_ITEM (N_("_Copy"), e_calendar_table_on_copy, 0),
+ E_POPUP_ITEM (N_("_Paste"), e_calendar_table_on_paste, MASK_EDITABLE),
E_POPUP_SEPARATOR,
- E_POPUP_ITEM (N_("_Assign Task"), GTK_SIGNAL_FUNC (e_calendar_table_on_assign), MASK_SINGLE | MASK_EDITABLE | MASK_ASSIGNABLE),
- E_POPUP_ITEM (N_("_Forward as iCalendar"), GTK_SIGNAL_FUNC (e_calendar_table_on_forward), MASK_SINGLE),
- E_POPUP_ITEM (N_("_Mark as Complete"), GTK_SIGNAL_FUNC (mark_as_complete_cb), MASK_SINGLE | MASK_EDITABLE),
- E_POPUP_ITEM (N_("_Mark Selected Tasks as Complete"), GTK_SIGNAL_FUNC (mark_as_complete_cb), MASK_MULTIPLE | MASK_EDITABLE),
+ E_POPUP_ITEM (N_("_Assign Task"), e_calendar_table_on_assign, MASK_SINGLE | MASK_EDITABLE | MASK_ASSIGNABLE),
+ E_POPUP_ITEM (N_("_Forward as iCalendar"), e_calendar_table_on_forward, MASK_SINGLE),
+ E_POPUP_ITEM (N_("_Mark as Complete"), mark_as_complete_cb, MASK_SINGLE | MASK_EDITABLE),
+ E_POPUP_ITEM (N_("_Mark Selected Tasks as Complete"), mark_as_complete_cb, MASK_MULTIPLE | MASK_EDITABLE),
E_POPUP_SEPARATOR,
- E_POPUP_ITEM (N_("_Delete"), GTK_SIGNAL_FUNC (delete_cb), MASK_SINGLE | MASK_EDITABLE),
- E_POPUP_ITEM (N_("_Delete Selected Tasks"), GTK_SIGNAL_FUNC (delete_cb), MASK_MULTIPLE | MASK_EDITABLE),
+ E_POPUP_ITEM (N_("_Delete"), delete_cb, MASK_SINGLE | MASK_EDITABLE),
+ E_POPUP_ITEM (N_("_Delete Selected Tasks"), delete_cb, MASK_MULTIPLE | MASK_EDITABLE),
E_POPUP_TERMINATOR
};
@@ -1176,7 +1214,7 @@ e_calendar_table_save_state (ECalendarTable *cal_table,
static void
invisible_destroyed (GtkWidget *invisible, ECalendarTable *cal_table)
{
- g_object_unref (cal_table->invisible);
+ gtk_object_unref (GTK_OBJECT (cal_table->invisible));
cal_table->invisible = NULL;
}
@@ -1268,7 +1306,7 @@ selection_received (GtkWidget *invisible,
calendar_model_get_cal_client (cal_table->model),
tmp_comp);
free (uid);
- g_object_unref (tmp_comp);
+ gtk_object_unref (GTK_OBJECT (tmp_comp));
}
subcomp = icalcomponent_get_next_component (
vcal_comp, ICAL_ANY_COMPONENT);
@@ -1284,7 +1322,7 @@ selection_received (GtkWidget *invisible,
cal_client_update_object (
calendar_model_get_cal_client (cal_table->model),
comp);
- g_object_unref (comp);
+ gtk_object_unref (GTK_OBJECT (comp));
}
calendar_model_set_status_message (e_calendar_table_get_model (cal_table), NULL);
diff --git a/calendar/gui/e-day-view.c b/calendar/gui/e-day-view.c
index d557b43c5c..2292a87790 100644
--- a/calendar/gui/e-day-view.c
+++ b/calendar/gui/e-day-view.c
@@ -42,10 +42,9 @@
#include <gtk/gtkwindow.h>
#include <gal/e-text/e-text.h>
#include <gal/widgets/e-canvas-utils.h>
-#include <gal/widgets/e-popup-menu.h>
#include <gal/widgets/e-gui-utils.h>
#include <gal/widgets/e-unicode.h>
-#include <libgnomecanvas/gnome-canvas-rect-ellipse.h>
+#include <libgnomeui/gnome-canvas-rect-ellipse.h>
#include <libgnome/gnome-i18n.h>
#include <libgnome/gnome-exec.h>
#include <libgnome/gnome-util.h>
@@ -78,7 +77,10 @@
/* The minimum amount of space wanted on each side of the date string. */
#define E_DAY_VIEW_DATE_X_PAD 4
-#define E_DAY_VIEW_LARGE_FONT_PTSIZE 18
+#define E_DAY_VIEW_LARGE_FONT \
+ "-adobe-utopia-regular-r-normal-*-*-240-*-*-p-*-iso8859-*"
+#define E_DAY_VIEW_LARGE_FONT_FALLBACK \
+ "-adobe-helvetica-bold-r-normal-*-*-240-*-*-p-*-iso8859-*"
/* The offset from the top/bottom of the canvas before auto-scrolling starts.*/
#define E_DAY_VIEW_AUTO_SCROLL_OFFSET 16
@@ -474,8 +476,32 @@ static gboolean e_day_view_layout_timeout_cb (gpointer data);
static GtkTableClass *parent_class;
static GdkAtom clipboard_atom = GDK_NONE;
-E_MAKE_TYPE (e_day_view, "EDayView", EDayView, e_day_view_class_init,
- e_day_view_init, GTK_TYPE_TABLE);
+
+GtkType
+e_day_view_get_type (void)
+{
+ static GtkType e_day_view_type = 0;
+
+ if (!e_day_view_type){
+ GtkTypeInfo e_day_view_info = {
+ "EDayView",
+ sizeof (EDayView),
+ sizeof (EDayViewClass),
+ (GtkClassInitFunc) e_day_view_class_init,
+ (GtkObjectInitFunc) e_day_view_init,
+ NULL, /* reserved 1 */
+ NULL, /* reserved 2 */
+ (GtkClassInitFunc) NULL
+ };
+
+ parent_class = gtk_type_class (GTK_TYPE_TABLE);
+ e_day_view_type = gtk_type_unique (GTK_TYPE_TABLE,
+ &e_day_view_info);
+ }
+
+ return e_day_view_type;
+}
+
static void
e_day_view_class_init (EDayViewClass *class)
@@ -483,18 +509,18 @@ e_day_view_class_init (EDayViewClass *class)
GtkObjectClass *object_class;
GtkWidgetClass *widget_class;
- parent_class = g_type_class_peek_parent (class);
object_class = (GtkObjectClass *) class;
widget_class = (GtkWidgetClass *) class;
e_day_view_signals[SELECTION_CHANGED] =
gtk_signal_new ("selection_changed",
GTK_RUN_LAST,
- G_TYPE_FROM_CLASS (object_class),
+ object_class->type,
GTK_SIGNAL_OFFSET (EDayViewClass, selection_changed),
gtk_marshal_NONE__NONE,
GTK_TYPE_NONE, 0);
+ gtk_object_class_add_signals (object_class, e_day_view_signals, LAST_SIGNAL);
/* Method override */
object_class->destroy = e_day_view_destroy;
@@ -605,7 +631,7 @@ e_day_view_init (EDayView *day_view)
day_view->default_category = NULL;
- day_view->large_font_desc = NULL;
+ day_view->large_font = NULL;
/* String to use in 12-hour time format for times in the morning. */
day_view->am_string = _("am");
@@ -621,25 +647,39 @@ e_day_view_init (EDayView *day_view)
gtk_table_attach (GTK_TABLE (day_view), day_view->top_canvas,
1, 2, 0, 1, GTK_EXPAND | GTK_FILL, GTK_FILL, 0, 0);
gtk_widget_show (day_view->top_canvas);
- g_signal_connect_after (day_view->top_canvas, "button_press_event",
- G_CALLBACK (e_day_view_on_top_canvas_button_press), day_view);
- g_signal_connect_after (day_view->top_canvas, "button_release_event",
- G_CALLBACK (e_day_view_on_top_canvas_button_release), day_view);
- g_signal_connect_after (day_view->top_canvas, "motion_notify_event",
- G_CALLBACK (e_day_view_on_top_canvas_motion), day_view);
- g_signal_connect_after (day_view->top_canvas, "drag_motion",
- G_CALLBACK (e_day_view_on_top_canvas_drag_motion), day_view);
- g_signal_connect_after (day_view->top_canvas, "drag_leave",
- G_CALLBACK (e_day_view_on_top_canvas_drag_leave), day_view);
-
- g_signal_connect (day_view->top_canvas, "drag_begin",
- G_CALLBACK (e_day_view_on_drag_begin), day_view);
- g_signal_connect (day_view->top_canvas, "drag_end",
- G_CALLBACK (e_day_view_on_drag_end), day_view);
- g_signal_connect (day_view->top_canvas, "drag_data_get",
- G_CALLBACK (e_day_view_on_drag_data_get), day_view);
- g_signal_connect (day_view->top_canvas, "drag_data_received",
- G_CALLBACK (e_day_view_on_top_canvas_drag_data_received), day_view);
+ gtk_signal_connect_after (GTK_OBJECT (day_view->top_canvas), "button_press_event",
+ GTK_SIGNAL_FUNC (e_day_view_on_top_canvas_button_press),
+ day_view);
+ gtk_signal_connect_after (GTK_OBJECT (day_view->top_canvas), "button_release_event",
+ GTK_SIGNAL_FUNC (e_day_view_on_top_canvas_button_release),
+ day_view);
+ gtk_signal_connect_after (GTK_OBJECT (day_view->top_canvas), "motion_notify_event",
+ GTK_SIGNAL_FUNC (e_day_view_on_top_canvas_motion),
+ day_view);
+ gtk_signal_connect_after (GTK_OBJECT (day_view->top_canvas),
+ "drag_motion",
+ GTK_SIGNAL_FUNC (e_day_view_on_top_canvas_drag_motion),
+ day_view);
+ gtk_signal_connect_after (GTK_OBJECT (day_view->top_canvas),
+ "drag_leave",
+ GTK_SIGNAL_FUNC (e_day_view_on_top_canvas_drag_leave),
+ day_view);
+ gtk_signal_connect (GTK_OBJECT (day_view->top_canvas),
+ "drag_begin",
+ GTK_SIGNAL_FUNC (e_day_view_on_drag_begin),
+ day_view);
+ gtk_signal_connect (GTK_OBJECT (day_view->top_canvas),
+ "drag_end",
+ GTK_SIGNAL_FUNC (e_day_view_on_drag_end),
+ day_view);
+ gtk_signal_connect (GTK_OBJECT (day_view->top_canvas),
+ "drag_data_get",
+ GTK_SIGNAL_FUNC (e_day_view_on_drag_data_get),
+ day_view);
+ gtk_signal_connect (GTK_OBJECT (day_view->top_canvas),
+ "drag_data_received",
+ GTK_SIGNAL_FUNC (e_day_view_on_top_canvas_drag_data_received),
+ day_view);
canvas_group = GNOME_CANVAS_GROUP (GNOME_CANVAS (day_view->top_canvas)->root);
@@ -652,7 +692,6 @@ e_day_view_init (EDayView *day_view)
day_view->resize_long_event_rect_item =
gnome_canvas_item_new (canvas_group,
gnome_canvas_rect_get_type(),
- "width_pixels", 1,
NULL);
gnome_canvas_item_hide (day_view->resize_long_event_rect_item);
@@ -684,38 +723,45 @@ e_day_view_init (EDayView *day_view)
1, 2, 1, 2,
GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
gtk_widget_show (day_view->main_canvas);
- g_signal_connect (day_view->main_canvas, "realize",
- G_CALLBACK (e_day_view_on_canvas_realized), day_view);
-
- g_signal_connect_after (day_view->main_canvas,
+ gtk_signal_connect (GTK_OBJECT (day_view->main_canvas), "realize",
+ GTK_SIGNAL_FUNC (e_day_view_on_canvas_realized),
+ day_view);
+ gtk_signal_connect_after (GTK_OBJECT (day_view->main_canvas),
"button_press_event",
- G_CALLBACK (e_day_view_on_main_canvas_button_press),
+ GTK_SIGNAL_FUNC (e_day_view_on_main_canvas_button_press),
day_view);
- g_signal_connect_after (day_view->main_canvas,
+ gtk_signal_connect_after (GTK_OBJECT (day_view->main_canvas),
"button_release_event",
- G_CALLBACK (e_day_view_on_main_canvas_button_release),
+ GTK_SIGNAL_FUNC (e_day_view_on_main_canvas_button_release),
day_view);
- g_signal_connect_after (day_view->main_canvas,
+ gtk_signal_connect_after (GTK_OBJECT (day_view->main_canvas),
"motion_notify_event",
- G_CALLBACK (e_day_view_on_main_canvas_motion),
+ GTK_SIGNAL_FUNC (e_day_view_on_main_canvas_motion),
day_view);
- g_signal_connect_after (day_view->main_canvas,
+ gtk_signal_connect_after (GTK_OBJECT (day_view->main_canvas),
"drag_motion",
- G_CALLBACK (e_day_view_on_main_canvas_drag_motion),
+ GTK_SIGNAL_FUNC (e_day_view_on_main_canvas_drag_motion),
day_view);
- g_signal_connect_after (day_view->main_canvas,
+ gtk_signal_connect_after (GTK_OBJECT (day_view->main_canvas),
"drag_leave",
- G_CALLBACK (e_day_view_on_main_canvas_drag_leave),
+ GTK_SIGNAL_FUNC (e_day_view_on_main_canvas_drag_leave),
day_view);
-
- g_signal_connect (day_view->main_canvas, "drag_begin",
- G_CALLBACK (e_day_view_on_drag_begin), day_view);
- g_signal_connect (day_view->main_canvas, "drag_end",
- G_CALLBACK (e_day_view_on_drag_end), day_view);
- g_signal_connect (day_view->main_canvas, "drag_data_get",
- G_CALLBACK (e_day_view_on_drag_data_get), day_view);
- g_signal_connect (day_view->main_canvas, "drag_data_received",
- G_CALLBACK (e_day_view_on_main_canvas_drag_data_received), day_view);
+ gtk_signal_connect (GTK_OBJECT (day_view->main_canvas),
+ "drag_begin",
+ GTK_SIGNAL_FUNC (e_day_view_on_drag_begin),
+ day_view);
+ gtk_signal_connect (GTK_OBJECT (day_view->main_canvas),
+ "drag_end",
+ GTK_SIGNAL_FUNC (e_day_view_on_drag_end),
+ day_view);
+ gtk_signal_connect (GTK_OBJECT (day_view->main_canvas),
+ "drag_data_get",
+ GTK_SIGNAL_FUNC (e_day_view_on_drag_data_get),
+ day_view);
+ gtk_signal_connect (GTK_OBJECT (day_view->main_canvas),
+ "drag_data_received",
+ GTK_SIGNAL_FUNC (e_day_view_on_main_canvas_drag_data_received),
+ day_view);
canvas_group = GNOME_CANVAS_GROUP (GNOME_CANVAS (day_view->main_canvas)->root);
@@ -728,14 +774,12 @@ e_day_view_init (EDayView *day_view)
day_view->resize_rect_item =
gnome_canvas_item_new (canvas_group,
gnome_canvas_rect_get_type(),
- "width_pixels", 1,
NULL);
gnome_canvas_item_hide (day_view->resize_rect_item);
day_view->resize_bar_item =
gnome_canvas_item_new (canvas_group,
gnome_canvas_rect_get_type(),
- "width_pixels", 1,
NULL);
gnome_canvas_item_hide (day_view->resize_bar_item);
@@ -791,8 +835,10 @@ e_day_view_init (EDayView *day_view)
0, 1, 1, 2,
GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
gtk_widget_show (day_view->time_canvas);
- g_signal_connect_after (day_view->time_canvas, "button_press_event",
- G_CALLBACK (e_day_view_on_time_canvas_button_press), day_view);
+ gtk_signal_connect_after (GTK_OBJECT (day_view->time_canvas),
+ "button_press_event",
+ GTK_SIGNAL_FUNC (e_day_view_on_time_canvas_button_press),
+ day_view);
canvas_group = GNOME_CANVAS_GROUP (GNOME_CANVAS (day_view->time_canvas)->root);
@@ -836,15 +882,22 @@ e_day_view_init (EDayView *day_view)
clipboard_atom,
GDK_SELECTION_TYPE_STRING,
0);
- g_signal_connect (day_view->invisible, "selection_get",
- G_CALLBACK (selection_get), (gpointer) day_view);
- g_signal_connect (day_view->invisible, "selection_clear_event",
- G_CALLBACK (selection_clear_event), (gpointer) day_view);
- g_signal_connect (day_view->invisible, "selection_received",
- G_CALLBACK (selection_received), (gpointer) day_view);
- g_signal_connect (day_view->invisible, "destroy",
- G_CALLBACK (invisible_destroyed), (gpointer) day_view);
-
+ gtk_signal_connect (GTK_OBJECT (day_view->invisible),
+ "selection_get",
+ GTK_SIGNAL_FUNC (selection_get),
+ (gpointer) day_view);
+ gtk_signal_connect (GTK_OBJECT (day_view->invisible),
+ "selection_clear_event",
+ GTK_SIGNAL_FUNC (selection_clear_event),
+ (gpointer) day_view);
+ gtk_signal_connect (GTK_OBJECT (day_view->invisible),
+ "selection_received",
+ GTK_SIGNAL_FUNC (selection_received),
+ (gpointer) day_view);
+ gtk_signal_connect (GTK_OBJECT (day_view->invisible),
+ "destroy",
+ GTK_SIGNAL_FUNC (invisible_destroyed),
+ (gpointer) day_view);
day_view->clipboard_selection = NULL;
day_view->activity = NULL;
@@ -873,7 +926,7 @@ e_day_view_new (void)
{
GtkWidget *day_view;
- day_view = GTK_WIDGET (g_object_new (e_day_view_get_type (), NULL));
+ day_view = GTK_WIDGET (gtk_type_new (e_day_view_get_type ()));
return day_view;
}
@@ -892,8 +945,8 @@ e_day_view_destroy (GtkObject *object)
e_day_view_stop_auto_scroll (day_view);
if (day_view->client) {
- g_signal_handlers_disconnect_matched (day_view->client, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, day_view);
- g_object_unref (day_view->client);
+ gtk_signal_disconnect_by_data (GTK_OBJECT (day_view->client), day_view);
+ gtk_object_unref (GTK_OBJECT (day_view->client));
day_view->client = NULL;
}
@@ -903,15 +956,14 @@ e_day_view_destroy (GtkObject *object)
}
if (day_view->query) {
- g_signal_handlers_disconnect_matched (day_view->query, G_SIGNAL_MATCH_DATA,
- 0, 0, NULL, NULL, day_view);
- g_object_unref (day_view->query);
+ gtk_signal_disconnect_by_data (GTK_OBJECT (day_view->query), day_view);
+ gtk_object_unref (GTK_OBJECT (day_view->query));
day_view->query = NULL;
}
- if (day_view->large_font_desc) {
- pango_font_description_free (day_view->large_font_desc);
- day_view->large_font_desc = NULL;
+ if (day_view->large_font) {
+ gdk_font_unref (day_view->large_font);
+ day_view->large_font = NULL;
}
if (day_view->default_category) {
@@ -940,7 +992,7 @@ e_day_view_destroy (GtkObject *object)
}
if (day_view->activity) {
- g_object_unref (day_view->activity);
+ gtk_object_unref (GTK_OBJECT (day_view->activity));
day_view->activity = NULL;
}
@@ -977,10 +1029,6 @@ e_day_view_realize (GtkWidget *widget)
day_view->colors[E_DAY_VIEW_COLOR_BG_SELECTED].green = 0 * 257;
day_view->colors[E_DAY_VIEW_COLOR_BG_SELECTED].blue = 156 * 257;
- day_view->colors[E_DAY_VIEW_COLOR_BG_SELECTED_UNFOCUSSED].red = 16 * 257;
- day_view->colors[E_DAY_VIEW_COLOR_BG_SELECTED_UNFOCUSSED].green = 78 * 257;
- day_view->colors[E_DAY_VIEW_COLOR_BG_SELECTED_UNFOCUSSED].blue = 139 * 257;
-
day_view->colors[E_DAY_VIEW_COLOR_BG_GRID].red = 0x8000;
day_view->colors[E_DAY_VIEW_COLOR_BG_GRID].green = 0x8000;
day_view->colors[E_DAY_VIEW_COLOR_BG_GRID].blue = 0x8000;
@@ -1082,6 +1130,7 @@ e_day_view_unrealize (GtkWidget *widget)
{
EDayView *day_view;
GdkColormap *colormap;
+ gint i;
day_view = E_DAY_VIEW (widget);
@@ -1089,7 +1138,8 @@ e_day_view_unrealize (GtkWidget *widget)
day_view->main_gc = NULL;
colormap = gtk_widget_get_colormap (widget);
- gdk_colormap_free_colors (colormap, day_view->colors, E_DAY_VIEW_COLOR_LAST);
+ for (i = 0; i < E_DAY_VIEW_COLOR_LAST; i++)
+ gdk_colors_free (colormap, &day_view->colors[i].pixel, 1, 0);
gdk_pixmap_unref (day_view->reminder_icon);
day_view->reminder_icon = NULL;
@@ -1121,16 +1171,17 @@ e_day_view_style_set (GtkWidget *widget,
(*GTK_WIDGET_CLASS (parent_class)->style_set)(widget, previous_style);
day_view = E_DAY_VIEW (widget);
- font = gtk_style_get_font (gtk_widget_get_style (widget));
+ font = widget->style->font;
/* Create the large font. */
- if (day_view->large_font_desc != NULL)
- pango_font_description_free (day_view->large_font_desc);
+ if (day_view->large_font != NULL)
+ gdk_font_unref (day_view->large_font);
- day_view->large_font_desc =
- pango_font_description_copy (gtk_widget_get_style (widget)->font_desc);
- pango_font_description_set_size (day_view->large_font_desc,
- E_DAY_VIEW_LARGE_FONT_PTSIZE * PANGO_SCALE);
+ day_view->large_font = gdk_font_load (E_DAY_VIEW_LARGE_FONT);
+ if (!day_view->large_font)
+ day_view->large_font = gdk_font_load (E_DAY_VIEW_LARGE_FONT_FALLBACK);
+ if (!day_view->large_font)
+ day_view->large_font = font;
/* Recalculate the height of each row based on the font size. */
day_view->row_height = font->ascent + font->descent + E_DAY_VIEW_EVENT_BORDER_HEIGHT + E_DAY_VIEW_EVENT_Y_PAD * 2 + 2 /* FIXME */;
@@ -1234,16 +1285,14 @@ e_day_view_style_set (GtkWidget *widget,
e_day_view_foreach_event (day_view, e_day_view_set_event_font_cb,
font);
-#if 0
- /* FIXME: Port. */
-
/* Set the fonts for the text items used when dragging. */
gnome_canvas_item_set (day_view->drag_long_event_item,
- "font_gdk", font, NULL);
+ "font_gdk", GTK_WIDGET (day_view)->style->font,
+ NULL);
gnome_canvas_item_set (day_view->drag_item,
- "font_gdk", font, NULL);
-#endif
+ "font_gdk", GTK_WIDGET (day_view)->style->font,
+ NULL);
}
@@ -1254,9 +1303,7 @@ e_day_view_set_event_font_cb (EDayView *day_view,
gpointer data)
{
EDayViewEvent *event;
-#if 0
GdkFont *font = data;
-#endif
if (day == E_DAY_VIEW_LONG_EVENT)
event = &g_array_index (day_view->long_events,
@@ -1265,12 +1312,10 @@ e_day_view_set_event_font_cb (EDayView *day_view,
event = &g_array_index (day_view->events[day],
EDayViewEvent, event_num);
-#if 0
if (event->canvas_item)
gnome_canvas_item_set (event->canvas_item,
"font_gdk", font,
NULL);
-#endif
return TRUE;
}
@@ -1340,7 +1385,7 @@ e_day_view_recalc_cell_sizes (EDayView *day_view)
char buffer[128];
g_return_if_fail (((GtkWidget*)day_view)->style != NULL);
- font = gtk_style_get_font (gtk_widget_get_style (GTK_WIDGET (day_view)));
+ font = GTK_WIDGET (day_view)->style->font;
/* Calculate the column sizes, using floating point so that pixels
get divided evenly. Note that we use one more element than the
@@ -1427,12 +1472,9 @@ e_day_view_focus_in (GtkWidget *widget, GdkEventFocus *event)
gtk_widget_queue_draw (day_view->main_canvas);
g_assert (GTK_WIDGET_REALIZED (day_view->main_canvas));
-#if 0
- /* FIXME when gal is fixed */
if (E_CANVAS (day_view->main_canvas)->ic)
gdk_im_begin (E_CANVAS (day_view->main_canvas)->ic,
GTK_LAYOUT (day_view->main_canvas)->bin_window);
-#endif
return FALSE;
}
@@ -1455,12 +1497,8 @@ e_day_view_focus_out (GtkWidget *widget, GdkEventFocus *event)
gtk_widget_queue_draw (day_view->main_canvas);
g_assert (GTK_WIDGET_REALIZED (day_view->main_canvas));
-
-#if 0
- /* FIXME when gal is fixed */
if (E_CANVAS (day_view->main_canvas)->ic)
gdk_im_end ();
-#endif
return FALSE;
}
@@ -1533,7 +1571,7 @@ query_obj_updated_cb (CalQuery *query, const char *uid,
g_print ("updated object's dates unchanged\n");
#endif
e_day_view_foreach_event_with_uid (day_view, uid, e_day_view_update_event_cb, comp);
- g_object_unref (comp);
+ gtk_object_unref (GTK_OBJECT (comp));
gtk_widget_queue_draw (day_view->top_canvas);
gtk_widget_queue_draw (day_view->main_canvas);
return;
@@ -1555,7 +1593,7 @@ query_obj_updated_cb (CalQuery *query, const char *uid,
e_day_view_add_event, day_view,
cal_client_resolve_tzid_cb, day_view->client,
day_view->zone);
- g_object_unref (comp);
+ gtk_object_unref (GTK_OBJECT (comp));
e_day_view_queue_layout (day_view);
}
@@ -1660,9 +1698,8 @@ update_query (EDayView *day_view)
day_view->query = NULL;
if (old_query) {
- g_signal_handlers_disconnect_matched (old_query, G_SIGNAL_MATCH_DATA,
- 0, 0, NULL, NULL, day_view);
- g_object_unref (old_query);
+ gtk_signal_disconnect_by_data (GTK_OBJECT (old_query), day_view);
+ gtk_object_unref (GTK_OBJECT (old_query));
}
g_assert (day_view->sexp != NULL);
@@ -1680,14 +1717,14 @@ update_query (EDayView *day_view)
return;
}
- g_signal_connect (day_view->query, "obj_updated",
- G_CALLBACK (query_obj_updated_cb), day_view);
- g_signal_connect (day_view->query, "obj_removed",
- G_CALLBACK (query_obj_removed_cb), day_view);
- g_signal_connect (day_view->query, "query_done",
- G_CALLBACK (query_query_done_cb), day_view);
- g_signal_connect (day_view->query, "eval_error",
- G_CALLBACK (query_eval_error_cb), day_view);
+ gtk_signal_connect (GTK_OBJECT (day_view->query), "obj_updated",
+ GTK_SIGNAL_FUNC (query_obj_updated_cb), day_view);
+ gtk_signal_connect (GTK_OBJECT (day_view->query), "obj_removed",
+ GTK_SIGNAL_FUNC (query_obj_removed_cb), day_view);
+ gtk_signal_connect (GTK_OBJECT (day_view->query), "query_done",
+ GTK_SIGNAL_FUNC (query_query_done_cb), day_view);
+ gtk_signal_connect (GTK_OBJECT (day_view->query), "eval_error",
+ GTK_SIGNAL_FUNC (query_eval_error_cb), day_view);
}
/* Callback used when the calendar client finishes opening */
@@ -1725,11 +1762,11 @@ e_day_view_set_cal_client (EDayView *day_view,
g_return_if_fail (IS_CAL_CLIENT (client));
if (client)
- g_object_ref (client);
+ gtk_object_ref (GTK_OBJECT (client));
if (day_view->client) {
- g_signal_handlers_disconnect_matched (day_view->client, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, day_view);
- g_object_unref (day_view->client);
+ gtk_signal_disconnect_by_data (GTK_OBJECT (day_view->client), day_view);
+ gtk_object_unref (GTK_OBJECT (day_view->client));
}
day_view->client = client;
@@ -1738,8 +1775,8 @@ e_day_view_set_cal_client (EDayView *day_view,
if (cal_client_get_load_state (day_view->client) == CAL_CLIENT_LOAD_LOADED)
update_query (day_view);
else
- g_signal_connect (day_view->client, "cal_opened",
- G_CALLBACK (cal_opened_cb), day_view);
+ gtk_signal_connect (GTK_OBJECT (day_view->client), "cal_opened",
+ GTK_SIGNAL_FUNC (cal_opened_cb), day_view);
}
}
@@ -1809,9 +1846,9 @@ e_day_view_update_event_cb (EDayView *day_view,
event_num);
}
- g_object_unref (event->comp);
+ gtk_object_unref (GTK_OBJECT (event->comp));
event->comp = comp;
- g_object_ref (comp);
+ gtk_object_ref (GTK_OBJECT (comp));
if (day == E_DAY_VIEW_LONG_EVENT) {
e_day_view_update_long_event_label (day_view, event_num);
@@ -1935,7 +1972,7 @@ e_day_view_remove_event_cb (EDayView *day_view,
if (event->canvas_item)
gtk_object_destroy (GTK_OBJECT (event->canvas_item));
- g_object_unref (event->comp);
+ gtk_object_unref (GTK_OBJECT (event->comp));
if (day == E_DAY_VIEW_LONG_EVENT) {
g_array_remove_index (day_view->long_events, event_num);
@@ -2996,7 +3033,7 @@ e_day_view_on_top_canvas_button_press (GtkWidget *widget,
GdkEventButton *event,
EDayView *day_view)
{
- gint event_x, event_y, day, event_num;
+ gint event_x, event_y, scroll_x, scroll_y, day, event_num;
EDayViewPosition pos;
/* Convert the coords to the main canvas window, or return if the
@@ -3006,6 +3043,12 @@ e_day_view_on_top_canvas_button_press (GtkWidget *widget,
&event_x, &event_y))
return FALSE;
+ /* The top canvas doesn't scroll, but just in case. */
+ gnome_canvas_get_scroll_offsets (GNOME_CANVAS (widget),
+ &scroll_x, &scroll_y);
+ event_x += scroll_x;
+ event_y += scroll_y;
+
pos = e_day_view_convert_position_in_top_canvas (day_view,
event_x, event_y,
&day, &event_num);
@@ -3113,7 +3156,7 @@ e_day_view_on_main_canvas_button_press (GtkWidget *widget,
GdkEventButton *event,
EDayView *day_view)
{
- gint event_x, event_y, row, day, event_num;
+ gint event_x, event_y, scroll_x, scroll_y, row, day, event_num;
EDayViewPosition pos;
#if 0
@@ -3139,6 +3182,11 @@ e_day_view_on_main_canvas_button_press (GtkWidget *widget,
&event_x, &event_y))
return FALSE;
+ gnome_canvas_get_scroll_offsets (GNOME_CANVAS (widget),
+ &scroll_x, &scroll_y);
+ event_x += scroll_x;
+ event_y += scroll_y;
+
/* Find out where the mouse is. */
pos = e_day_view_convert_position_in_main_canvas (day_view,
event_x, event_y,
@@ -3223,7 +3271,7 @@ e_day_view_on_time_canvas_button_press (GtkWidget *widget,
* a pointer to a boolean; will set it to TRUE.
*/
static void
-comp_destroy_cb (gpointer data, GObject *deadbeef)
+comp_destroy_cb (GtkObject *object, gpointer data)
{
gboolean *destroyed;
@@ -3256,16 +3304,18 @@ e_day_view_on_long_event_button_press (EDayView *day_view,
} else if (event->button == 3) {
EDayViewEvent *e;
gboolean destroyed;
+ guint id;
e = &g_array_index (day_view->long_events, EDayViewEvent, event_num);
destroyed = FALSE;
- g_object_weak_ref ((GObject *) e->comp, comp_destroy_cb, &destroyed);
+ id = gtk_signal_connect (GTK_OBJECT (e->comp), "destroy",
+ GTK_SIGNAL_FUNC (comp_destroy_cb), &destroyed);
if (!GTK_WIDGET_HAS_FOCUS (day_view))
gtk_widget_grab_focus (GTK_WIDGET (day_view));
if (!destroyed) {
- g_object_weak_unref ((GObject *) e->comp, comp_destroy_cb, &destroyed);
+ gtk_signal_disconnect (GTK_OBJECT (e->comp), id);
e_day_view_set_selected_time_range_in_top_visible (day_view, e->start, e->end);
@@ -3305,17 +3355,19 @@ e_day_view_on_event_button_press (EDayView *day_view,
} else if (event->button == 3) {
EDayViewEvent *e;
gboolean destroyed;
+ guint id;
e = &g_array_index (day_view->events[day], EDayViewEvent, event_num);
destroyed = FALSE;
- g_object_weak_ref ((GObject *) e->comp, comp_destroy_cb, &destroyed);
+ id = gtk_signal_connect (GTK_OBJECT (e->comp), "destroy",
+ GTK_SIGNAL_FUNC (comp_destroy_cb), &destroyed);
if (!GTK_WIDGET_HAS_FOCUS (day_view))
gtk_widget_grab_focus (GTK_WIDGET (day_view));
if (!destroyed) {
- g_object_weak_unref ((GObject *) e->comp, comp_destroy_cb, &destroyed);
+ gtk_signal_disconnect (GTK_OBJECT (e->comp), id);
e_day_view_set_selected_time_range_visible (day_view, e->start, e->end);
@@ -3353,6 +3405,7 @@ e_day_view_on_long_event_click (EDayView *day_view,
&& (pos == E_DAY_VIEW_POS_LEFT_EDGE
|| pos == E_DAY_VIEW_POS_RIGHT_EDGE)) {
gboolean destroyed;
+ guint id;
if (!e_day_view_find_long_event_days (event,
day_view->days_shown,
@@ -3361,7 +3414,8 @@ e_day_view_on_long_event_click (EDayView *day_view,
return;
destroyed = FALSE;
- g_object_weak_ref ((GObject *) event->comp, comp_destroy_cb, &destroyed);
+ id = gtk_signal_connect (GTK_OBJECT (event->comp), "destroy",
+ GTK_SIGNAL_FUNC (comp_destroy_cb), &destroyed);
/* Grab the keyboard focus, so the event being edited is saved
and we can use the Escape key to abort the resize. */
@@ -3371,7 +3425,7 @@ e_day_view_on_long_event_click (EDayView *day_view,
if (destroyed)
return;
- g_object_weak_unref ((GObject *) event->comp, comp_destroy_cb, &destroyed);
+ gtk_signal_disconnect (GTK_OBJECT (event->comp), id);
if (gdk_pointer_grab (GTK_LAYOUT (day_view->top_canvas)->bin_window, FALSE,
GDK_POINTER_MOTION_MASK
@@ -3437,9 +3491,11 @@ e_day_view_on_event_click (EDayView *day_view,
&& (pos == E_DAY_VIEW_POS_TOP_EDGE
|| pos == E_DAY_VIEW_POS_BOTTOM_EDGE)) {
gboolean destroyed;
+ guint id;
destroyed = FALSE;
- g_object_weak_ref ((GObject *) event->comp, comp_destroy_cb, &destroyed);
+ id = gtk_signal_connect (GTK_OBJECT (event->comp), "destroy",
+ GTK_SIGNAL_FUNC (comp_destroy_cb), &destroyed);
/* Grab the keyboard focus, so the event being edited is saved
and we can use the Escape key to abort the resize. */
@@ -3449,7 +3505,7 @@ e_day_view_on_event_click (EDayView *day_view,
if (destroyed)
return;
- g_object_weak_unref ((GObject *) event->comp, comp_destroy_cb, &destroyed);
+ gtk_signal_disconnect (GTK_OBJECT (event->comp), id);
if (gdk_pointer_grab (GTK_LAYOUT (day_view->main_canvas)->bin_window, FALSE,
GDK_POINTER_MOTION_MASK
@@ -3585,6 +3641,7 @@ e_day_view_on_event_double_click (EDayView *day_view,
{
EDayViewEvent *event;
gboolean destroyed;
+ guint id;
if (day == -1)
event = &g_array_index (day_view->long_events, EDayViewEvent,
@@ -3594,12 +3651,13 @@ e_day_view_on_event_double_click (EDayView *day_view,
event_num);
destroyed = FALSE;
- g_object_weak_ref ((GObject *) event->comp, comp_destroy_cb, &destroyed);
+ id = gtk_signal_connect (GTK_OBJECT (event->comp), "destroy",
+ GTK_SIGNAL_FUNC (comp_destroy_cb), &destroyed);
e_day_view_stop_editing_event (day_view);
if (!destroyed) {
- g_object_weak_unref ((GObject *) event->comp, comp_destroy_cb, &destroyed);
+ gtk_signal_disconnect (GTK_OBJECT (event->comp), id);
if (day_view->calendar)
gnome_calendar_edit_object (day_view->calendar, event->comp, FALSE);
@@ -3651,70 +3709,70 @@ enum {
static EPopupMenu main_items [] = {
E_POPUP_ITEM (N_("New _Appointment"),
- GTK_SIGNAL_FUNC (e_day_view_on_new_appointment), MASK_EDITABLE),
+ e_day_view_on_new_appointment, MASK_EDITABLE),
E_POPUP_ITEM (N_("New All Day _Event"),
- GTK_SIGNAL_FUNC (e_day_view_on_new_event), MASK_EDITABLE),
+ e_day_view_on_new_event, MASK_EDITABLE),
E_POPUP_ITEM (N_("New Meeting"),
- GTK_SIGNAL_FUNC (e_day_view_on_new_meeting), MASK_EDITABLE),
+ e_day_view_on_new_meeting, MASK_EDITABLE),
E_POPUP_ITEM (N_("New Task"),
- GTK_SIGNAL_FUNC (e_day_view_on_new_task), MASK_EDITABLE),
+ e_day_view_on_new_task, MASK_EDITABLE),
E_POPUP_SEPARATOR,
E_POPUP_ITEM (N_("Print..."),
- GTK_SIGNAL_FUNC (e_day_view_on_print), 0),
+ e_day_view_on_print, 0),
E_POPUP_SEPARATOR,
E_POPUP_ITEM (N_("_Paste"),
- GTK_SIGNAL_FUNC (e_day_view_on_paste), MASK_EDITABLE),
+ e_day_view_on_paste, MASK_EDITABLE),
E_POPUP_SEPARATOR,
E_POPUP_SUBMENU (N_("Current View"), NULL, 0),
E_POPUP_ITEM (N_("Go to _Today"),
- GTK_SIGNAL_FUNC (e_day_view_on_goto_today), 0),
+ e_day_view_on_goto_today, 0),
E_POPUP_ITEM (N_("_Go to Date..."),
- GTK_SIGNAL_FUNC (e_day_view_on_goto_date), 0),
+ e_day_view_on_goto_date, 0),
E_POPUP_SEPARATOR,
E_POPUP_ITEM (N_("_Publish Free/Busy Information"),
- GTK_SIGNAL_FUNC (e_day_view_on_publish), 0),
+ e_day_view_on_publish, 0),
E_POPUP_SEPARATOR,
E_POPUP_ITEM (N_("_Settings..."),
- GTK_SIGNAL_FUNC (e_day_view_on_settings), 0),
+ e_day_view_on_settings, 0),
E_POPUP_TERMINATOR
};
static EPopupMenu child_items [] = {
- E_POPUP_ITEM (N_("_Open"), GTK_SIGNAL_FUNC (e_day_view_on_edit_appointment), MASK_EDITING),
- E_POPUP_ITEM (N_("_Save As..."), GTK_SIGNAL_FUNC (e_day_view_on_save_as), MASK_EDITING),
- E_POPUP_ITEM (N_("_Print..."), GTK_SIGNAL_FUNC (e_day_view_on_print_event), MASK_EDITING),
+ E_POPUP_ITEM (N_("_Open"), e_day_view_on_edit_appointment, MASK_EDITING),
+ E_POPUP_ITEM (N_("_Save As..."), e_day_view_on_save_as, MASK_EDITING),
+ E_POPUP_ITEM (N_("_Print..."), e_day_view_on_print_event, MASK_EDITING),
/* Only show this separator if one of the above is shown. */
E_POPUP_SEPARATOR,
- E_POPUP_ITEM (N_("C_ut"), GTK_SIGNAL_FUNC (e_day_view_on_cut), MASK_EDITABLE | MASK_EDITING | MASK_MEETING_ORGANIZER),
- E_POPUP_ITEM (N_("_Copy"), GTK_SIGNAL_FUNC (e_day_view_on_copy), MASK_EDITING | MASK_MEETING_ORGANIZER),
- E_POPUP_ITEM (N_("_Paste"), GTK_SIGNAL_FUNC (e_day_view_on_paste), MASK_EDITABLE),
+ E_POPUP_ITEM (N_("C_ut"), e_day_view_on_cut, MASK_EDITABLE | MASK_EDITING | MASK_MEETING_ORGANIZER),
+ E_POPUP_ITEM (N_("_Copy"), e_day_view_on_copy, MASK_EDITING | MASK_MEETING_ORGANIZER),
+ E_POPUP_ITEM (N_("_Paste"), e_day_view_on_paste, MASK_EDITABLE),
E_POPUP_SEPARATOR,
- E_POPUP_ITEM (N_("_Schedule Meeting..."), GTK_SIGNAL_FUNC (e_day_view_on_meeting), MASK_EDITABLE | MASK_EDITING | MASK_MEETING),
- E_POPUP_ITEM (N_("_Forward as iCalendar..."), GTK_SIGNAL_FUNC (e_day_view_on_forward), MASK_EDITING),
+ E_POPUP_ITEM (N_("_Schedule Meeting..."), e_day_view_on_meeting, MASK_EDITABLE | MASK_EDITING | MASK_MEETING),
+ E_POPUP_ITEM (N_("_Forward as iCalendar..."), e_day_view_on_forward, MASK_EDITING),
E_POPUP_SEPARATOR,
- E_POPUP_ITEM (N_("_Delete"), GTK_SIGNAL_FUNC (e_day_view_on_delete_appointment), MASK_EDITABLE | MASK_SINGLE | MASK_EDITING),
- E_POPUP_ITEM (N_("Make this Occurrence _Movable"), GTK_SIGNAL_FUNC (e_day_view_on_unrecur_appointment), MASK_EDITABLE | MASK_RECURRING | MASK_EDITING | MASK_INSTANCE),
- E_POPUP_ITEM (N_("Delete this _Occurrence"), GTK_SIGNAL_FUNC (e_day_view_on_delete_occurrence), MASK_EDITABLE | MASK_RECURRING | MASK_EDITING),
- E_POPUP_ITEM (N_("Delete _All Occurrences"), GTK_SIGNAL_FUNC (e_day_view_on_delete_appointment), MASK_EDITABLE | MASK_RECURRING | MASK_EDITING),
+ E_POPUP_ITEM (N_("_Delete"), e_day_view_on_delete_appointment, MASK_EDITABLE | MASK_SINGLE | MASK_EDITING),
+ E_POPUP_ITEM (N_("Make this Occurrence _Movable"), e_day_view_on_unrecur_appointment, MASK_EDITABLE | MASK_RECURRING | MASK_EDITING | MASK_INSTANCE),
+ E_POPUP_ITEM (N_("Delete this _Occurrence"), e_day_view_on_delete_occurrence, MASK_EDITABLE | MASK_RECURRING | MASK_EDITING),
+ E_POPUP_ITEM (N_("Delete _All Occurrences"), e_day_view_on_delete_appointment, MASK_EDITABLE | MASK_RECURRING | MASK_EDITING),
E_POPUP_TERMINATOR
};
@@ -3797,7 +3855,8 @@ e_day_view_on_event_right_click (EDayView *day_view,
day_view->popup_event_num = event_num;
popup = e_popup_menu_create (context_menu, disable_mask, hide_mask, day_view);
- g_signal_connect (popup, "selection-done", G_CALLBACK (free_view_popup), day_view);
+ gtk_signal_connect (GTK_OBJECT (popup), "selection-done",
+ GTK_SIGNAL_FUNC (free_view_popup), day_view);
e_popup_menu (popup, (GdkEvent *) bevent);
}
@@ -4052,7 +4111,7 @@ e_day_view_on_publish (GtkWidget *widget, gpointer data)
itip_send_comp (CAL_COMPONENT_METHOD_PUBLISH, comp,
day_view->client, NULL);
- g_object_unref (comp);
+ gtk_object_unref (GTK_OBJECT (comp));
}
g_list_free (comp_list);
@@ -4100,7 +4159,7 @@ e_day_view_on_delete_occurrence (GtkWidget *widget, gpointer data)
if (cal_client_update_object (day_view->client, comp) != CAL_CLIENT_RESULT_SUCCESS)
g_message ("e_day_view_on_delete_occurrence(): Could not update the object!");
- g_object_unref (comp);
+ gtk_object_unref (GTK_OBJECT (comp));
}
static void
@@ -4133,6 +4192,7 @@ e_day_view_on_delete_appointment (GtkWidget *widget, gpointer data)
EDayView *day_view;
EDayViewEvent *event;
gboolean destroyed;
+ guint id;
day_view = E_DAY_VIEW (data);
@@ -4141,13 +4201,14 @@ e_day_view_on_delete_appointment (GtkWidget *widget, gpointer data)
return;
destroyed = FALSE;
- g_object_weak_ref ((GObject *) event->comp, comp_destroy_cb, &destroyed);
+ id = gtk_signal_connect (GTK_OBJECT (event->comp), "destroy",
+ GTK_SIGNAL_FUNC (comp_destroy_cb), &destroyed);
if (day_view->editing_event_day >= 0)
e_day_view_stop_editing_event (day_view);
if (!destroyed) {
- g_object_weak_unref ((GObject *) event->comp, comp_destroy_cb, &destroyed);
+ gtk_signal_disconnect (GTK_OBJECT (event->comp), id);
e_day_view_delete_event_internal (day_view, event);
}
@@ -4294,12 +4355,12 @@ e_day_view_on_unrecur_appointment (GtkWidget *widget, gpointer data)
if (cal_client_update_object (day_view->client, comp) != CAL_CLIENT_RESULT_SUCCESS)
g_message ("e_day_view_on_unrecur_appointment(): Could not update the object!");
- g_object_unref (comp);
+ gtk_object_unref (GTK_OBJECT (comp));
if (cal_client_update_object (day_view->client, new_comp) != CAL_CLIENT_RESULT_SUCCESS)
g_message ("e_day_view_on_unrecur_appointment(): Could not update the object!");
- g_object_unref (new_comp);
+ gtk_object_unref (GTK_OBJECT (new_comp));
}
@@ -4399,7 +4460,7 @@ e_day_view_on_top_canvas_motion (GtkWidget *widget,
{
EDayViewEvent *event = NULL;
EDayViewPosition pos;
- gint event_x, event_y, canvas_x, canvas_y;
+ gint event_x, event_y, scroll_x, scroll_y, canvas_x, canvas_y;
gint day, event_num;
GdkCursor *cursor;
@@ -4414,8 +4475,11 @@ e_day_view_on_top_canvas_motion (GtkWidget *widget,
&event_x, &event_y))
return FALSE;
- canvas_x = event_x;
- canvas_y = event_y;
+ /* The top canvas doesn't scroll, but just in case. */
+ gnome_canvas_get_scroll_offsets (GNOME_CANVAS (widget),
+ &scroll_x, &scroll_y);
+ canvas_x = event_x + scroll_x;
+ canvas_y = event_y + scroll_y;
pos = e_day_view_convert_position_in_top_canvas (day_view,
canvas_x, canvas_y,
@@ -4496,7 +4560,7 @@ e_day_view_on_main_canvas_motion (GtkWidget *widget,
{
EDayViewEvent *event = NULL;
EDayViewPosition pos;
- gint event_x, event_y, canvas_x, canvas_y;
+ gint event_x, event_y, scroll_x, scroll_y, canvas_x, canvas_y;
gint row, day, event_num;
GdkCursor *cursor;
@@ -4511,8 +4575,10 @@ e_day_view_on_main_canvas_motion (GtkWidget *widget,
&event_x, &event_y))
return FALSE;
- canvas_x = event_x;
- canvas_y = event_y;
+ gnome_canvas_get_scroll_offsets (GNOME_CANVAS (widget),
+ &scroll_x, &scroll_y);
+ canvas_x = event_x + scroll_x;
+ canvas_y = event_y + scroll_y;
pos = e_day_view_convert_position_in_main_canvas (day_view,
canvas_x, canvas_y,
@@ -4821,31 +4887,31 @@ e_day_view_finish_long_event_resize (EDayView *day_view)
cal_component_set_dtend (comp, &date);
}
- if (cal_component_is_instance (comp)) {
- CalObjModType mod;
-
- if (recur_component_dialog (comp, &mod, NULL)) {
- if (cal_client_update_object_with_mod (day_view->client, comp, mod) == CAL_CLIENT_RESULT_SUCCESS) {
- if (itip_organizer_is_user (comp, day_view->client) && send_component_dialog (day_view->client, comp, FALSE))
- itip_send_comp (CAL_COMPONENT_METHOD_REQUEST, comp, day_view->client, NULL);
- } else {
- g_message ("e_day_view_finish_resize(): Could not update the object!");
- }
- } else {
- gtk_widget_queue_draw (day_view->top_canvas);
- }
- } else if (cal_client_update_object (day_view->client, comp) == CAL_CLIENT_RESULT_SUCCESS) {
- if (itip_organizer_is_user (comp, day_view->client) && send_component_dialog (day_view->client, comp, TRUE))
- itip_send_comp (CAL_COMPONENT_METHOD_REQUEST, comp, day_view->client, NULL);
- } else {
- g_message ("e_day_view_finish_long_event_resize(): Could not update the object!");
- }
-
- gnome_canvas_item_hide (day_view->resize_long_event_rect_item);
-
- day_view->resize_drag_pos = E_DAY_VIEW_POS_NONE;
-
- g_object_unref (comp);
+ if (cal_component_is_instance (comp)) {
+ CalObjModType mod;
+
+ if (recur_component_dialog (comp, &mod, NULL)) {
+ if (cal_client_update_object_with_mod (day_view->client, comp, mod) == CAL_CLIENT_RESULT_SUCCESS) {
+ if (itip_organizer_is_user (comp, day_view->client) && send_component_dialog (day_view->client, comp, FALSE))
+ itip_send_comp (CAL_COMPONENT_METHOD_REQUEST, comp, day_view->client, NULL);
+ } else {
+ g_message ("e_day_view_finish_resize(): Could not update the object!");
+ }
+ } else {
+ gtk_widget_queue_draw (day_view->top_canvas);
+ }
+ } else if (cal_client_update_object (day_view->client, comp) == CAL_CLIENT_RESULT_SUCCESS) {
+ if (itip_organizer_is_user (comp, day_view->client) && send_component_dialog (day_view->client, comp, TRUE))
+ itip_send_comp (CAL_COMPONENT_METHOD_REQUEST, comp, day_view->client, NULL);
+ } else {
+ g_message ("e_day_view_finish_long_event_resize(): Could not update the object!");
+ }
+
+ gnome_canvas_item_hide (day_view->resize_long_event_rect_item);
+
+ day_view->resize_drag_pos = E_DAY_VIEW_POS_NONE;
+
+ gtk_object_unref (GTK_OBJECT (comp));
}
@@ -4918,8 +4984,8 @@ e_day_view_finish_resize (EDayView *day_view)
gnome_canvas_item_hide (day_view->main_canvas_bottom_resize_bar_item);
day_view->resize_drag_pos = E_DAY_VIEW_POS_NONE;
-
- g_object_unref (comp);
+
+ gtk_object_unref (GTK_OBJECT (comp));
}
@@ -4991,7 +5057,7 @@ e_day_view_free_event_array (EDayView *day_view,
event = &g_array_index (array, EDayViewEvent, event_num);
if (event->canvas_item)
gtk_object_destroy (GTK_OBJECT (event->canvas_item));
- g_object_unref (event->comp);
+ gtk_object_unref (GTK_OBJECT (event->comp));
}
g_array_set_size (array, 0);
@@ -5031,7 +5097,7 @@ e_day_view_add_event (CalComponent *comp,
day_view->zone);
event.comp = comp;
- g_object_ref (comp);
+ gtk_object_ref (GTK_OBJECT (comp));
event.start = start;
event.end = end;
event.canvas_item = NULL;
@@ -5207,7 +5273,7 @@ e_day_view_reshape_long_event (EDayView *day_view,
draw them on top of the resize rect. Nor when editing. */
num_icons = 0;
comp = event->comp;
- font = gtk_style_get_font (gtk_widget_get_style (GTK_WIDGET (day_view)));
+ font = GTK_WIDGET (day_view)->style->font;
if (day_view->resize_drag_pos != E_DAY_VIEW_POS_NONE
&& day_view->resize_event_day == E_DAY_VIEW_LONG_EVENT
@@ -5249,9 +5315,7 @@ e_day_view_reshape_long_event (EDayView *day_view,
event->canvas_item =
gnome_canvas_item_new (GNOME_CANVAS_GROUP (GNOME_CANVAS (day_view->top_canvas)->root),
e_text_get_type (),
-#if 0
- "font_gdk", font,
-#endif
+ "font_gdk", GTK_WIDGET (day_view)->style->font,
"anchor", GTK_ANCHOR_NW,
"clip", TRUE,
"max_lines", 1,
@@ -5260,8 +5324,9 @@ e_day_view_reshape_long_event (EDayView *day_view,
"draw_background", FALSE,
"fill_color_rgba", GNOME_CANVAS_COLOR(0, 0, 0),
NULL);
- g_signal_connect (event->canvas_item, "event",
- G_CALLBACK (e_day_view_on_text_item_event), day_view);
+ gtk_signal_connect (GTK_OBJECT (event->canvas_item), "event",
+ GTK_SIGNAL_FUNC (e_day_view_on_text_item_event),
+ day_view);
e_day_view_update_long_event_label (day_view, event_num);
}
@@ -5278,7 +5343,9 @@ e_day_view_reshape_long_event (EDayView *day_view,
text_w = item_w;
} else {
/* Get the requested size of the label. */
- g_object_get (G_OBJECT (event->canvas_item), "text", &text, NULL);
+ gtk_object_get (GTK_OBJECT (event->canvas_item),
+ "text", &text,
+ NULL);
text_width = 0;
if (text) {
end_of_line = strchr (text, '\n');
@@ -5403,15 +5470,10 @@ e_day_view_reshape_day_event (EDayView *day_view,
}
if (!event->canvas_item) {
- GdkFont *font;
-
- font = gtk_style_get_font (gtk_widget_get_style (GTK_WIDGET (day_view)));
event->canvas_item =
gnome_canvas_item_new (GNOME_CANVAS_GROUP (GNOME_CANVAS (day_view->main_canvas)->root),
e_text_get_type (),
-#if 0
- "font_gdk", font,
-#endif
+ "font_gdk", GTK_WIDGET (day_view)->style->font,
"anchor", GTK_ANCHOR_NW,
"line_wrap", TRUE,
"editable", TRUE,
@@ -5420,9 +5482,12 @@ e_day_view_reshape_day_event (EDayView *day_view,
"draw_background", FALSE,
"fill_color_rgba", GNOME_CANVAS_COLOR(0, 0, 0),
NULL);
- g_signal_connect (event->canvas_item, "event",
- G_CALLBACK (e_day_view_on_text_item_event), day_view);
- e_day_view_update_event_label (day_view, day, event_num);
+ gtk_signal_connect (GTK_OBJECT (event->canvas_item),
+ "event",
+ GTK_SIGNAL_FUNC (e_day_view_on_text_item_event),
+ day_view);
+ e_day_view_update_event_label (day_view, day,
+ event_num);
}
item_w = MAX (item_w, 0);
@@ -5452,12 +5517,12 @@ e_day_view_reshape_main_canvas_resize_bars (EDayView *day_view)
hide the resize bars. */
if (day != -1 && day == day_view->drag_event_day
&& event_num == day_view->drag_event_num) {
- g_object_get (G_OBJECT (day_view->drag_rect_item),
- "x1", &x,
- "y1", &y,
- "x2", &w,
- "y2", &h,
- NULL);
+ gtk_object_get (GTK_OBJECT (day_view->drag_rect_item),
+ "x1", &x,
+ "y1", &y,
+ "x2", &w,
+ "y2", &h,
+ NULL);
w -= x;
x++;
h -= y;
@@ -5691,7 +5756,7 @@ e_day_view_key_press (GtkWidget *widget, GdkEventKey *event)
if (initial_text)
g_free (initial_text);
- g_object_unref (comp);
+ gtk_object_unref (GTK_OBJECT (comp));
return TRUE;
}
@@ -6024,19 +6089,19 @@ e_day_view_start_editing_event (EDayView *day_view,
}
/* Try to move the cursor to the end of the text. */
- g_object_get (G_OBJECT (event->canvas_item),
- "event_processor", &event_processor,
- NULL);
+ gtk_object_get (GTK_OBJECT (event->canvas_item),
+ "event_processor", &event_processor,
+ NULL);
if (event_processor) {
command.action = E_TEP_MOVE;
command.position = E_TEP_END_OF_BUFFER;
- g_signal_emit_by_name (event_processor,
- "command", &command);
+ gtk_signal_emit_by_name (GTK_OBJECT (event_processor),
+ "command", &command);
}
}
-/* This stops the current edit. If accept is TRUE the event summary is updated,
+/* This stops the current edit. If accept is TRUE the event summary is update,
else the edit is cancelled. */
static void
e_day_view_stop_editing_event (EDayView *day_view)
@@ -6075,9 +6140,9 @@ cancel_editing (EDayView *day_view)
/* Reset the text to what was in the component */
cal_component_get_summary (event->comp, &summary);
- g_object_set (G_OBJECT (event->canvas_item),
- "text", summary.value ? summary.value : "",
- NULL);
+ gtk_object_set (GTK_OBJECT (event->canvas_item),
+ "text", summary.value ? summary.value : "",
+ NULL);
/* Stop editing */
e_day_view_stop_editing_event (day_view);
@@ -6219,9 +6284,9 @@ e_day_view_on_editing_stopped (EDayView *day_view,
day_view->resize_bars_event_day = -1;
day_view->resize_bars_event_num = -1;
- g_object_get (G_OBJECT (event->canvas_item),
- "text", &text,
- NULL);
+ gtk_object_get (GTK_OBJECT (event->canvas_item),
+ "text", &text,
+ NULL);
g_assert (text != NULL);
if (string_is_empty (text) && !cal_comp_is_on_server (event->comp, day_view->client)) {
@@ -6361,14 +6426,6 @@ e_day_view_check_auto_scroll (EDayView *day_view,
gint event_x,
gint event_y)
{
- gint scroll_x, scroll_y;
-
- gnome_canvas_get_scroll_offsets (GNOME_CANVAS (day_view->main_canvas),
- &scroll_x, &scroll_y);
-
- event_x -= scroll_x;
- event_y -= scroll_y;
-
day_view->last_mouse_x = event_x;
day_view->last_mouse_y = event_y;
@@ -6438,19 +6495,12 @@ e_day_view_auto_scroll_handler (gpointer data)
if (new_scroll_y != scroll_y) {
/* NOTE: This reduces flicker, but only works if we don't use
canvas items which have X windows. */
-
- /* FIXME: Since GNOME 2.0 we can't do this, since the canvas
- * won't update when its's thawed. Is this a bug or should we
- * really be doing something else? Investigate. */
-#if 0
gtk_layout_freeze (GTK_LAYOUT (day_view->main_canvas));
-#endif
gnome_canvas_scroll_to (GNOME_CANVAS (day_view->main_canvas),
scroll_x, new_scroll_y);
-#if 0
+
gtk_layout_thaw (GTK_LAYOUT (day_view->main_canvas));
-#endif
}
canvas_x = day_view->last_mouse_x + scroll_x;
@@ -6681,10 +6731,6 @@ e_day_view_convert_position_in_main_canvas (EDayView *day_view,
gint day, row, col, event_num;
gint item_x, item_y, item_w, item_h;
-#if 0
- g_print ("e_day_view_convert_position_in_main_canvas: (%d, %d)\n", x, y);
-#endif
-
*day_return = -1;
*row_return = -1;
if (event_num_return)
@@ -6875,11 +6921,9 @@ e_day_view_update_top_canvas_drag (EDayView *day_view,
"y2", item_y + item_h - 1,
NULL);
- font = gtk_style_get_font (gtk_widget_get_style (GTK_WIDGET (day_view)));
+ font = GTK_WIDGET (day_view)->style->font;
gnome_canvas_item_set (day_view->drag_long_event_item,
-#if 0
"font_gdk", font,
-#endif
"clip_width", item_w - (E_DAY_VIEW_LONG_EVENT_BORDER_WIDTH + E_DAY_VIEW_LONG_EVENT_X_PAD) * 2,
"clip_height", item_h - (E_DAY_VIEW_LONG_EVENT_BORDER_HEIGHT + E_DAY_VIEW_LONG_EVENT_Y_PAD) * 2,
NULL);
@@ -6929,14 +6973,13 @@ e_day_view_on_main_canvas_drag_motion (GtkWidget *widget,
gnome_canvas_get_scroll_offsets (GNOME_CANVAS (widget),
&scroll_x, &scroll_y);
-
day_view->drag_event_x = x + scroll_x;
day_view->drag_event_y = y + scroll_y;
e_day_view_reshape_main_canvas_drag_item (day_view);
e_day_view_reshape_main_canvas_resize_bars (day_view);
- e_day_view_check_auto_scroll (day_view, day_view->drag_event_x, day_view->drag_event_y);
+ e_day_view_check_auto_scroll (day_view, x, y);
return TRUE;
}
@@ -7038,11 +7081,9 @@ e_day_view_update_main_canvas_drag (EDayView *day_view,
"y2", item_y + item_h - 1,
NULL);
- font = gtk_style_get_font (gtk_widget_get_style (GTK_WIDGET (day_view)));
+ font = GTK_WIDGET (day_view)->style->font;
gnome_canvas_item_set (day_view->drag_item,
-#if 0
"font_gdk", font,
-#endif
"clip_width", item_w - E_DAY_VIEW_BAR_WIDTH - E_DAY_VIEW_EVENT_X_PAD * 2,
"clip_height", item_h - (E_DAY_VIEW_EVENT_BORDER_HEIGHT + E_DAY_VIEW_EVENT_Y_PAD) * 2,
NULL);
@@ -7376,7 +7417,7 @@ e_day_view_on_top_canvas_drag_data_received (GtkWidget *widget,
"not update the object!");
}
- g_object_unref (comp);
+ gtk_object_unref (GTK_OBJECT (comp));
return;
}
@@ -7504,7 +7545,7 @@ e_day_view_on_main_canvas_drag_data_received (GtkWidget *widget,
"Could not update the object!");
}
- g_object_unref (comp);
+ gtk_object_unref (GTK_OBJECT (comp));
return;
}
@@ -7563,7 +7604,7 @@ e_day_view_get_time_string_width (EDayView *day_view)
static void
invisible_destroyed (GtkWidget *invisible, EDayView *day_view)
{
- g_object_unref (day_view->invisible);
+ gtk_object_unref (GTK_OBJECT (day_view->invisible));
day_view->invisible = NULL;
}
@@ -7663,7 +7704,7 @@ selection_received (GtkWidget *invisible,
cal_client_update_object (day_view->client, comp);
free (uid);
- g_object_unref (comp);
+ gtk_object_unref (GTK_OBJECT (comp));
}
subcomp = icalcomponent_get_next_component (
@@ -7692,7 +7733,7 @@ selection_received (GtkWidget *invisible,
if (itip_organizer_is_user (comp, day_view->client) && send_component_dialog (day_view->client, comp, TRUE))
itip_send_comp (CAL_COMPONENT_METHOD_REQUEST, comp, day_view->client, NULL);
- g_object_unref (comp);
+ gtk_object_unref (GTK_OBJECT (comp));
}
e_day_view_set_status_message (day_view, NULL);
@@ -7770,7 +7811,7 @@ e_day_view_set_status_message (EDayView *day_view, const char *message)
if (!message || !*message) {
if (day_view->activity) {
- g_object_unref (day_view->activity);
+ gtk_object_unref (GTK_OBJECT (day_view->activity));
day_view->activity = NULL;
}
}
@@ -7779,7 +7820,7 @@ e_day_view_set_status_message (EDayView *day_view, const char *message)
char *client_id = g_strdup_printf ("%p", day_view);
if (progress_icon[0] == NULL)
- progress_icon[0] = gdk_pixbuf_new_from_file (EVOLUTION_IMAGESDIR "/" EVOLUTION_CALENDAR_PROGRESS_IMAGE, NULL);
+ progress_icon[0] = gdk_pixbuf_new_from_file (EVOLUTION_IMAGESDIR "/" EVOLUTION_CALENDAR_PROGRESS_IMAGE);
day_view->activity = evolution_activity_client_new (
global_shell_client, client_id,
progress_icon, message, TRUE, &display);
diff --git a/calendar/gui/e-itip-control.c b/calendar/gui/e-itip-control.c
index 48eeae1672..ff2d8079e2 100644
--- a/calendar/gui/e-itip-control.c
+++ b/calendar/gui/e-itip-control.c
@@ -28,17 +28,17 @@
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
-#include <unistd.h>
#include <glib.h>
#include <gtk/gtkmisc.h>
+#include <libgnome/gnome-defs.h>
#include <libgnome/gnome-i18n.h>
#include <libgnome/gnome-util.h>
-#include <libgnomeui/gnome-stock-icons.h>
+#include <libgnomeui/gnome-stock.h>
#include <libgnomeui/gnome-uidefs.h>
#include <libgnomeui/gnome-dialog.h>
#include <libgnomeui/gnome-dialog-util.h>
-#include <bonobo/bonobo-object.h>
#include <bonobo/bonobo-exception.h>
+#include <gal/util/e-unicode-i18n.h>
#include <gal/widgets/e-unicode.h>
#include <gtkhtml/gtkhtml.h>
#include <gtkhtml/gtkhtml-stream.h>
@@ -47,18 +47,17 @@
#include <cal-util/timeutil.h>
#include <cal-client/cal-client.h>
#include <e-util/e-time-utils.h>
+#include <e-util/e-html-utils.h>
#include <e-util/e-dialog-widgets.h>
#include <evolution-shell-client.h>
#include <evolution-folder-selector-button.h>
-#include <camel/camel-mime-filter-tohtml.h>
#include "calendar-config.h"
#include "itip-utils.h"
#include "e-itip-control.h"
struct _EItipControlPrivate {
GtkWidget *html;
- gboolean html_destroyed;
-
+
GPtrArray *event_clients;
CalClient *event_client;
GPtrArray *task_clients;
@@ -77,15 +76,12 @@ struct _EItipControlPrivate {
gchar *calendar_uri;
- EAccountList *accounts;
-
+ GList *addresses;
gchar *from_address;
gchar *delegator_address;
gchar *delegator_name;
gchar *my_address;
gboolean view_only;
-
- gboolean destroyed;
};
/* HTML Strings */
@@ -104,8 +100,7 @@ static const char *tasks_types[] = { "tasks", NULL };
static void class_init (EItipControlClass *klass);
static void init (EItipControl *itip);
-static void destroy (GtkObject *obj);
-static void finalize (GObject *obj);
+static void finalize (GtkObject *obj);
static void url_requested_cb (GtkHTML *html, const gchar *url, GtkHTMLStream *handle, gpointer data);
static gboolean object_requested_cb (GtkHTML *html, GtkHTMLEmbedded *eb, gpointer data);
@@ -113,21 +108,39 @@ static void ok_clicked_cb (GtkHTML *html, const gchar *method, const gchar *url,
static GtkVBoxClass *parent_class = NULL;
-E_MAKE_TYPE (e_itip_control, "EItipControl", EItipControl, class_init, init,
- GTK_TYPE_VBOX);
+
+GtkType
+e_itip_control_get_type (void)
+{
+ static GtkType type = 0;
+
+ if (type == 0) {
+ static const GtkTypeInfo info =
+ {
+ "EItipControl",
+ sizeof (EItipControl),
+ sizeof (EItipControlClass),
+ (GtkClassInitFunc) class_init,
+ (GtkObjectInitFunc) init,
+ /* reserved_1 */ NULL,
+ /* reserved_2 */ NULL,
+ (GtkClassInitFunc) NULL,
+ };
+
+ type = gtk_type_unique (gtk_vbox_get_type (), &info);
+ }
+
+ return type;
+}
static void
class_init (EItipControlClass *klass)
{
- GObjectClass *object_class;
- GtkObjectClass *gtkobject_class;
-
- object_class = G_OBJECT_CLASS (klass);
- gtkobject_class = GTK_OBJECT_CLASS (klass);
-
- parent_class = g_type_class_peek_parent (klass);
+ GtkObjectClass *object_class;
+
+ object_class = GTK_OBJECT_CLASS (klass);
- gtkobject_class->destroy = destroy;
+ parent_class = gtk_type_class (gtk_vbox_get_type ());
object_class->finalize = finalize;
}
@@ -157,28 +170,29 @@ start_calendar_server (EItipControl *itip, char *uri)
client = cal_client_new ();
- g_signal_connect (client, "cal_opened", G_CALLBACK (start_calendar_server_cb), &success);
+ gtk_signal_connect (GTK_OBJECT (client), "cal_opened",
+ start_calendar_server_cb, &success);
- if (!cal_client_open_calendar (client, uri, TRUE))
- goto error;
+ if (!cal_client_open_calendar (client, uri, TRUE))
+ goto error;
/* run a sub event loop to turn cal-client's async load
notification into a synchronous call */
- if (!itip->priv->destroyed) {
- gtk_signal_connect (GTK_OBJECT (itip), "destroy",
- gtk_main_quit, NULL);
-
+ if (!GTK_OBJECT_DESTROYED (itip)) {
+ gtk_signal_connect (GTK_OBJECT (itip), "destroy",
+ gtk_main_quit, NULL);
+
gtk_main ();
+
+ gtk_signal_disconnect_by_func (GTK_OBJECT (itip),
+ gtk_main_quit, NULL);
+ }
- gtk_signal_disconnect_by_func (GTK_OBJECT (itip),
- gtk_main_quit, NULL);
- }
-
if (success)
return client;
-error:
- g_object_unref (client);
+ error:
+ gtk_object_unref (GTK_OBJECT (client));
return NULL;
}
@@ -191,7 +205,8 @@ start_default_server (EItipControl *itip, gboolean tasks)
client = cal_client_new ();
- g_signal_connect (client, "cal_opened", G_CALLBACK (start_calendar_server_cb), &success);
+ gtk_signal_connect (GTK_OBJECT (client), "cal_opened",
+ start_calendar_server_cb, &success);
if (tasks) {
if (!cal_client_open_default_tasks (client, FALSE))
@@ -203,7 +218,7 @@ start_default_server (EItipControl *itip, gboolean tasks)
/* run a sub event loop to turn cal-client's async load
notification into a synchronous call */
- if (!itip->priv->destroyed) {
+ if (!GTK_OBJECT_DESTROYED (itip)) {
gtk_signal_connect (GTK_OBJECT (itip), "destroy",
gtk_main_quit, NULL);
@@ -217,7 +232,7 @@ start_default_server (EItipControl *itip, gboolean tasks)
return client;
error:
- g_object_unref (client);
+ gtk_object_unref (GTK_OBJECT (client));
return NULL;
}
@@ -233,7 +248,7 @@ get_servers (EItipControl *itip, EvolutionShellClient *shell_client, const char
servers = g_ptr_array_new ();
- g_object_ref (shell_client);
+ bonobo_object_ref (BONOBO_OBJECT (shell_client));
registry = evolution_shell_client_get_storage_registry_interface (shell_client);
CORBA_exception_init (&ev);
@@ -266,7 +281,7 @@ get_servers (EItipControl *itip, EvolutionShellClient *shell_client, const char
CalClient *client;
char *uri;
- if (itip->priv->destroyed)
+ if (GTK_OBJECT_DESTROYED (itip))
continue;
if (strcmp (possible_types[k], folder.type))
@@ -285,7 +300,7 @@ get_servers (EItipControl *itip, EvolutionShellClient *shell_client, const char
CORBA_free (folder_list);
}
- g_object_unref (shell_client);
+ bonobo_object_unref (BONOBO_OBJECT (shell_client));
return servers;
}
@@ -305,8 +320,8 @@ find_server (GPtrArray *servers, CalComponent *comp)
client = g_ptr_array_index (servers, i);
status = cal_client_get_object (client, uid, &found_comp);
if (status == CAL_CLIENT_GET_SUCCESS) {
- g_object_unref (found_comp);
- g_object_ref (client);
+ gtk_object_unref (GTK_OBJECT (found_comp));
+ gtk_object_ref (GTK_OBJECT (client));
return client;
}
@@ -316,17 +331,6 @@ find_server (GPtrArray *servers, CalComponent *comp)
}
static void
-html_destroyed (gpointer data)
-{
- EItipControl *itip = data;
- EItipControlPrivate *priv;
-
- priv = itip->priv;
-
- priv->html_destroyed = TRUE;
-}
-
-static void
init (EItipControl *itip)
{
EItipControlPrivate *priv;
@@ -337,7 +341,7 @@ init (EItipControl *itip)
itip->priv = priv;
/* Addresses */
- priv->accounts = itip_addresses_get ();
+ priv->addresses = itip_addresses_get ();
/* Initialize the cal clients */
priv->event_clients = NULL;
@@ -355,7 +359,6 @@ init (EItipControl *itip)
/* Html Widget */
priv->html = gtk_html_new ();
- priv->html_destroyed = FALSE;
gtk_html_set_default_content_type (GTK_HTML (priv->html),
"text/html; charset=utf-8");
gtk_html_load_from_string (GTK_HTML (priv->html), " ", 1);
@@ -368,15 +371,18 @@ init (EItipControl *itip)
gtk_widget_show (scrolled_window);
gtk_container_add (GTK_CONTAINER (scrolled_window), priv->html);
- gtk_object_weakref (GTK_OBJECT (priv->html), html_destroyed, itip);
+ gtk_object_ref (GTK_OBJECT (priv->html));
gtk_widget_set_usize (scrolled_window, 600, 400);
gtk_box_pack_start (GTK_BOX (itip), scrolled_window, FALSE, FALSE, 4);
- g_signal_connect (priv->html, "url_requested", G_CALLBACK (url_requested_cb), itip);
- g_signal_connect (priv->html, "object_requested", G_CALLBACK (object_requested_cb), itip);
- g_signal_connect (priv->html, "submit", G_CALLBACK (ok_clicked_cb), itip);
+ gtk_signal_connect (GTK_OBJECT (priv->html), "url_requested",
+ url_requested_cb, itip);
+ gtk_signal_connect (GTK_OBJECT (priv->html), "object_requested",
+ GTK_SIGNAL_FUNC (object_requested_cb),
+ itip);
+ gtk_signal_connect (GTK_OBJECT (priv->html), "submit",
+ ok_clicked_cb, itip);
- priv->destroyed = FALSE;
}
static void
@@ -385,26 +391,18 @@ clean_up (EItipControl *itip)
EItipControlPrivate *priv;
priv = itip->priv;
- if (!priv)
- return;
g_free (priv->vcalendar);
priv->vcalendar = NULL;
- if (priv->comp) {
- g_object_unref (priv->comp);
- priv->comp = NULL;
- }
-
- if (priv->top_level) {
- icalcomponent_free (priv->top_level);
- priv->top_level = NULL;
- }
+ if (priv->comp)
+ gtk_object_unref (GTK_OBJECT (priv->comp));
+ priv->comp = NULL;
- if (priv->main_comp) {
- icalcomponent_free (priv->main_comp);
- priv->main_comp = NULL;
- }
+ icalcomponent_free (priv->top_level);
+ priv->top_level = NULL;
+ icalcomponent_free (priv->main_comp);
+ priv->main_comp = NULL;
priv->ical_comp = NULL;
priv->current = 0;
@@ -424,18 +422,7 @@ clean_up (EItipControl *itip)
}
static void
-destroy (GtkObject *obj)
-{
- EItipControl *itip = E_ITIP_CONTROL (obj);
- EItipControlPrivate *priv;
-
- priv = itip->priv;
-
- priv->destroyed = TRUE;
-}
-
-static void
-finalize (GObject *obj)
+finalize (GtkObject *obj)
{
EItipControl *itip = E_ITIP_CONTROL (obj);
EItipControlPrivate *priv;
@@ -445,38 +432,34 @@ finalize (GObject *obj)
clean_up (itip);
- if (priv->html)
- gtk_object_weakunref (GTK_OBJECT (priv->html), html_destroyed, itip);
-
- priv->accounts = NULL;
+ if (priv->html)
+ gtk_object_unref (GTK_OBJECT (priv->html));
+ itip_addresses_free (priv->addresses);
+ priv->addresses = NULL;
+
if (priv->event_clients) {
- for (i = 0; i < priv->event_clients->len; i++)
- g_object_unref (g_ptr_array_index (priv->event_clients, i));
+ for (i = 0; i < priv->event_clients->len; i++)
+ gtk_object_unref (GTK_OBJECT (g_ptr_array_index (priv->event_clients, i)));
g_ptr_array_free (priv->event_clients, TRUE);
- priv->event_client = NULL;
- priv->event_clients = NULL;
}
-
if (priv->task_clients) {
- for (i = 0; i < priv->task_clients->len; i++)
- g_object_unref (g_ptr_array_index (priv->task_clients, i));
+ for (i = 0; i < priv->task_clients->len; i++)
+ gtk_object_unref (GTK_OBJECT (g_ptr_array_index (priv->task_clients, i)));
g_ptr_array_free (priv->task_clients, TRUE);
- priv->task_client = NULL;
- priv->task_clients = NULL;
}
g_free (priv);
itip->priv = NULL;
-
- if (G_OBJECT_CLASS (parent_class)->finalize)
- (* G_OBJECT_CLASS (parent_class)->finalize) (obj);
+
+ if (GTK_OBJECT_CLASS (parent_class)->finalize)
+ (* GTK_OBJECT_CLASS (parent_class)->finalize) (obj);
}
GtkWidget *
e_itip_control_new (void)
{
- return g_object_new (E_TYPE_ITIP_CONTROL, NULL);
+ return gtk_type_new (E_TYPE_ITIP_CONTROL);
}
static void
@@ -503,7 +486,7 @@ find_my_address (EItipControl *itip, icalcomponent *ical_comp)
icalparameter *param;
const char *attendee, *name;
char *attendee_clean, *name_clean;
- EIterator *it;
+ GList *l;
value = icalproperty_get_value (prop);
if (value != NULL) {
@@ -524,32 +507,26 @@ find_my_address (EItipControl *itip, icalcomponent *ical_comp)
name = NULL;
name_clean = NULL;
}
-
- it = e_list_get_iterator((EList *)priv->accounts);
- while (e_iterator_is_valid(it)) {
- const EAccount *account = e_iterator_get(it);
-
+
+ for (l = priv->addresses; l != NULL; l = l->next) {
+ ItipAddress *a = l->data;
+
/* Check for a matching address */
if (attendee_clean != NULL
- && !g_ascii_strcasecmp (account->id->address, attendee_clean)) {
- priv->my_address = g_strdup (account->id->address);
+ && !g_strcasecmp (a->address, attendee_clean)) {
+ priv->my_address = g_strdup (a->address);
g_free (attendee_clean);
g_free (name_clean);
- g_free (my_alt_address);
- g_object_unref(it);
return;
}
/* Check for a matching cname to fall back on */
if (name_clean != NULL
- && !g_ascii_strcasecmp (account->id->name, name_clean))
+ && !g_strcasecmp (a->name, name_clean))
my_alt_address = g_strdup (attendee_clean);
-
- e_iterator_next(it);
}
g_free (attendee_clean);
g_free (name_clean);
- g_object_unref(it);
}
priv->my_address = my_alt_address;
@@ -624,7 +601,7 @@ write_label_piece (EItipControl *itip, CalComponentDateTime *dt,
FALSE, FALSE,
time_buf, sizeof (time_buf));
- time_utf8 = g_locale_to_utf8 (time_buf, -1, NULL, NULL, NULL);
+ time_utf8 = e_utf8_from_locale_string (time_buf);
strcat (buffer, time_utf8);
g_free (time_utf8);
@@ -641,9 +618,12 @@ write_label_piece (EItipControl *itip, CalComponentDateTime *dt,
strcat (buffer, " <font size=-1>[");
/* We check if it is one of our builtin timezone names,
- in which case we call gettext to translate it. */
+ in which case we call gettext to translate it, and
+ we need to convert to UTF-8. If it isn't a builtin
+ timezone name, we use it as-is, as it is already
+ UTF-8. */
if (icaltimezone_get_builtin_timezone (display_name)) {
- strcat (buffer, _(display_name));
+ strcat (buffer, U_(display_name));
} else {
strcat (buffer, display_name);
}
@@ -655,15 +635,52 @@ write_label_piece (EItipControl *itip, CalComponentDateTime *dt,
strcat (buffer, etext);
}
+/* copied from recurrence-page.c, so it should be pre-translated */
+static const char *date_suffix[] = {
+ N_("st"),
+ N_("nd"),
+ N_("rd"),
+ N_("th"),
+ N_("th"),
+ N_("th"),
+ N_("th"),
+ N_("th"),
+ N_("th"),
+ N_("th"),
+ N_("th"),
+ N_("th"),
+ N_("th"),
+ N_("th"),
+ N_("th"),
+ N_("th"),
+ N_("th"),
+ N_("th"),
+ N_("th"),
+ N_("th"),
+ N_("st"),
+ N_("nd"),
+ N_("rd"),
+ N_("th"),
+ N_("th"),
+ N_("th"),
+ N_("th"),
+ N_("th"),
+ N_("th"),
+ N_("th"),
+ N_("st")
+};
+
static const char *
nth (int n)
{
+ static char buffer[10];
+
if (n == -1)
return "last";
- else if (n < 1 || n > 31)
+ if (n < 1 || n >= (sizeof (date_suffix) / sizeof (const char *)))
return "?";
- else
- return cal_recur_nth[n];
+ sprintf (buffer, "%d%s", n, date_suffix[n - 1]);
+ return buffer;
}
static const char *dayname[] = {
@@ -818,7 +835,7 @@ set_date_label (EItipControl *itip, GtkHTML *html, GtkHTMLStream *html_stream,
cal_component_get_dtstart (comp, &datetime);
if (datetime.value) {
write_label_piece (itip, &datetime, buffer, 1024,
- _("<b>Starts:</b> "),
+ U_("<b>Starts:</b> "),
"<br>", FALSE);
gtk_html_write (html, html_stream, buffer, strlen(buffer));
wrote = TRUE;
@@ -828,7 +845,7 @@ set_date_label (EItipControl *itip, GtkHTML *html, GtkHTMLStream *html_stream,
buffer[0] = '\0';
cal_component_get_dtend (comp, &datetime);
if (datetime.value){
- write_label_piece (itip, &datetime, buffer, 1024, _("<b>Ends:</b> "), "<br>", FALSE);
+ write_label_piece (itip, &datetime, buffer, 1024, U_("<b>Ends:</b> "), "<br>", FALSE);
gtk_html_write (html, html_stream, buffer, strlen (buffer));
wrote = TRUE;
}
@@ -848,7 +865,7 @@ set_date_label (EItipControl *itip, GtkHTML *html, GtkHTMLStream *html_stream,
/* Pass TRUE as is_utc, so it gets converted to the current
timezone. */
datetime.value->is_utc = TRUE;
- write_label_piece (itip, &datetime, buffer, 1024, _("<b>Completed:</b> "), "<br>", FALSE);
+ write_label_piece (itip, &datetime, buffer, 1024, U_("<b>Completed:</b> "), "<br>", FALSE);
gtk_html_write (html, html_stream, buffer, strlen (buffer));
wrote = TRUE;
task_completed = TRUE;
@@ -858,7 +875,7 @@ set_date_label (EItipControl *itip, GtkHTML *html, GtkHTMLStream *html_stream,
buffer[0] = '\0';
cal_component_get_due (comp, &datetime);
if (type == CAL_COMPONENT_TODO && !task_completed && datetime.value) {
- write_label_piece (itip, &datetime, buffer, 1024, _("<b>Due:</b> "), "<br>", FALSE);
+ write_label_piece (itip, &datetime, buffer, 1024, U_("<b>Due:</b> "), "<br>", FALSE);
gtk_html_write (html, html_stream, buffer, strlen (buffer));
wrote = TRUE;
}
@@ -895,7 +912,7 @@ write_error_html (EItipControl *itip, const gchar *itip_err)
html_stream = gtk_html_begin (GTK_HTML (priv->html));
gtk_html_stream_printf (html_stream,
"<html><head><title>%s</title></head>",
- _("iCalendar Information"));
+ U_("iCalendar Information"));
gtk_html_write (GTK_HTML (priv->html), html_stream,
HTML_BODY_START, strlen(HTML_BODY_START));
@@ -910,7 +927,7 @@ write_error_html (EItipControl *itip, const gchar *itip_err)
gtk_html_stream_printf (html_stream, "<td align=\"left\" valign=\"top\">");
/* Title */
- set_message (GTK_HTML (priv->html), html_stream, _("iCalendar Error"), TRUE);
+ set_message (GTK_HTML (priv->html), html_stream, U_("iCalendar Error"), TRUE);
/* Error */
gtk_html_write (GTK_HTML (priv->html), html_stream, itip_err, strlen(itip_err));
@@ -941,14 +958,14 @@ write_html (EItipControl *itip, const gchar *itip_desc, const gchar *itip_title,
priv = itip->priv;
- if (priv->html_destroyed)
+ if (GTK_OBJECT_DESTROYED (priv->html))
return;
/* Html widget */
html_stream = gtk_html_begin (GTK_HTML (priv->html));
gtk_html_stream_printf (html_stream,
"<html><head><title>%s</title></head>",
- _("iCalendar Information"));
+ U_("iCalendar Information"));
gtk_html_write (GTK_HTML (priv->html), html_stream,
HTML_BODY_START, strlen(HTML_BODY_START));
@@ -979,7 +996,7 @@ write_html (EItipControl *itip, const gchar *itip_desc, const gchar *itip_title,
attendee->cn :
itip_strip_mailto (attendee->value));
} else {
- html = g_strdup_printf (itip_desc, _("An unknown person"));
+ html = g_strdup_printf (itip_desc, U_("An unknown person"));
}
break;
case ICAL_METHOD_REQUEST:
@@ -995,7 +1012,7 @@ write_html (EItipControl *itip, const gchar *itip_desc, const gchar *itip_title,
priv->delegator_name :
priv->delegator_address);
else
- html = g_strdup_printf (itip_desc, _("An unknown person"),
+ html = g_strdup_printf (itip_desc, U_("An unknown person"),
priv->delegator_name ?
priv->delegator_name :
priv->delegator_address);
@@ -1006,7 +1023,7 @@ write_html (EItipControl *itip, const gchar *itip_desc, const gchar *itip_title,
organizer.cn :
itip_strip_mailto (organizer.value));
else
- html = g_strdup_printf (itip_desc, _("An unknown person"));
+ html = g_strdup_printf (itip_desc, U_("An unknown person"));
}
break;
@@ -1023,14 +1040,14 @@ write_html (EItipControl *itip, const gchar *itip_desc, const gchar *itip_title,
organizer.cn :
itip_strip_mailto (organizer.value));
else
- html = g_strdup_printf (itip_desc, _("An unknown person"));
+ html = g_strdup_printf (itip_desc, U_("An unknown person"));
break;
}
gtk_html_write (GTK_HTML (priv->html), html_stream, html, strlen(html));
g_free (html);
/* Describe what the user can do */
- const_html = _("<br> Please review the following information, "
+ const_html = U_("<br> Please review the following information, "
"and then select an action from the menu below.");
gtk_html_write (GTK_HTML (priv->html), html_stream, const_html, strlen(const_html));
@@ -1045,17 +1062,17 @@ write_html (EItipControl *itip, const gchar *itip_desc, const gchar *itip_title,
/* Summary */
cal_component_get_summary (priv->comp, &text);
- html = text.value ? camel_text_to_html (text.value, CAMEL_MIME_FILTER_TOHTML_CONVERT_NL, 0) : _("<i>None</i>");
+ html = e_text_to_html (text.value ? text.value : U_("<i>None</i>"), E_TEXT_TO_HTML_CONVERT_NL);
gtk_html_stream_printf (html_stream, "<b>%s</b><br>%s<br><br>",
- _("Summary:"), html);
+ U_("Summary:"), html);
g_free (html);
/* Location */
cal_component_get_location (priv->comp, &string);
if (string != NULL) {
- html = camel_text_to_html (string, CAMEL_MIME_FILTER_TOHTML_CONVERT_NL, 0);
+ html = e_text_to_html (string, E_TEXT_TO_HTML_CONVERT_NL);
gtk_html_stream_printf (html_stream, "<b>%s</b><br>%s<br><br>",
- _("Location:"), html);
+ U_("Location:"), html);
g_free (html);
}
@@ -1069,24 +1086,24 @@ write_html (EItipControl *itip, const gchar *itip_desc, const gchar *itip_title,
CalComponentAttendee *a = alist->data;
gtk_html_stream_printf (html_stream, "<b>%s</b><br>",
- _("Status:"));
+ U_("Status:"));
switch (a->status) {
case ICAL_PARTSTAT_ACCEPTED:
gtk_html_stream_printf (html_stream, "%s<br><br>",
- _("Accepted"));
+ U_("Accepted"));
break;
case ICAL_PARTSTAT_TENTATIVE:
gtk_html_stream_printf (html_stream, "%s<br><br>",
- _("Tentatively Accepted"));
+ U_("Tentatively Accepted"));
break;
case ICAL_PARTSTAT_DECLINED:
gtk_html_stream_printf (html_stream, "%s<br><br>",
- _("Declined"));
+ U_("Declined"));
break;
default:
gtk_html_stream_printf (html_stream, "%s<br><br>",
- _("Unknown"));
+ U_("Unknown"));
}
}
@@ -1099,9 +1116,9 @@ write_html (EItipControl *itip, const gchar *itip_desc, const gchar *itip_title,
text = *((CalComponentText *)l->data);
if (l && text.value) {
- html = camel_text_to_html (text.value, CAMEL_MIME_FILTER_TOHTML_CONVERT_NL, 0);
+ html = e_text_to_html (text.value, E_TEXT_TO_HTML_CONVERT_NL);
gtk_html_stream_printf (html_stream, "<b>%s</b><br>%s",
- _("Description:"), html);
+ U_("Description:"), html);
g_free (html);
}
cal_component_free_text_list (l);
@@ -1141,9 +1158,9 @@ get_publish_options (gboolean selector)
"</select>&nbsp &nbsp "
"<input TYPE=Submit name=\"ok\" value=\"%s\">"
"</form>",
- _("Choose an action:"),
- _("Update"),
- _("OK"));
+ U_("Choose an action:"),
+ U_("Update"),
+ U_("OK"));
if (selector) {
char *sel;
@@ -1169,12 +1186,12 @@ get_request_options (gboolean selector)
"<input TYPE=\"checkbox\" name=\"rsvp\" value=\"1\" checked>%s&nbsp&nbsp"
"<input TYPE=\"submit\" name=\"ok\" value=\"%s\"><br> "
"</form>",
- _("Choose an action:"),
- _("Accept"),
- _("Tentatively accept"),
- _("Decline"),
- _("RSVP"),
- _("OK"));
+ U_("Choose an action:"),
+ U_("Accept"),
+ U_("Tentatively accept"),
+ U_("Decline"),
+ U_("RSVP"),
+ U_("OK"));
if (selector) {
char *sel;
@@ -1195,9 +1212,9 @@ get_request_fb_options ()
"<option VALUE=\"F\">%s</option></select>&nbsp &nbsp "
"<input TYPE=Submit name=\"ok\" value=\"%s\">"
"</form>",
- _("Choose an action:"),
- _("Send Free/Busy Information"),
- _("OK"));
+ U_("Choose an action:"),
+ U_("Send Free/Busy Information"),
+ U_("OK"));
}
static char*
@@ -1208,9 +1225,9 @@ get_reply_options ()
"<option VALUE=\"R\">%s</option></select>&nbsp &nbsp "
"<input TYPE=Submit name=\"ok\" value=\"%s\">"
"</form>",
- _("Choose an action:"),
- _("Update respondent status"),
- _("OK"));
+ U_("Choose an action:"),
+ U_("Update respondent status"),
+ U_("OK"));
}
static char*
@@ -1221,9 +1238,9 @@ get_refresh_options ()
"<option VALUE=\"S\">%s</option></select>&nbsp &nbsp "
"<input TYPE=Submit name=\"ok\" value=\"%s\">"
"</form>",
- _("Choose an action:"),
- _("Send Latest Information"),
- _("OK"));
+ U_("Choose an action:"),
+ U_("Send Latest Information"),
+ U_("OK"));
}
static char*
@@ -1234,9 +1251,9 @@ get_cancel_options ()
"<option VALUE=\"C\">%s</option></select>&nbsp &nbsp "
"<input TYPE=Submit name=\"ok\" value=\"%s\">"
"</form>",
- _("Choose an action:"),
- _("Cancel"),
- _("OK"));
+ U_("Choose an action:"),
+ U_("Cancel"),
+ U_("OK"));
}
@@ -1292,7 +1309,7 @@ adjust_item (EItipControl *itip, CalComponent *comp)
cal_component_set_description_list (comp, l);
cal_component_free_text_list (l);
- g_object_unref (real_comp);
+ gtk_object_unref (GTK_OBJECT (real_comp));
} else {
CalComponentText text = {_("Unknown"), NULL};
@@ -1316,50 +1333,50 @@ show_current_event (EItipControl *itip)
switch (priv->method) {
case ICAL_METHOD_PUBLISH:
- itip_desc = _("<b>%s</b> has published meeting information.");
- itip_title = _("Meeting Information");
+ itip_desc = U_("<b>%s</b> has published meeting information.");
+ itip_title = U_("Meeting Information");
options = get_publish_options (priv->event_client ? FALSE : TRUE);
break;
case ICAL_METHOD_REQUEST:
if (priv->delegator_address != NULL)
- itip_desc = _("<b>%s</b> requests the presence of %s at a meeting.");
+ itip_desc = U_("<b>%s</b> requests the presence of %s at a meeting.");
else
- itip_desc = _("<b>%s</b> requests your presence at a meeting.");
- itip_title = _("Meeting Proposal");
+ itip_desc = U_("<b>%s</b> requests your presence at a meeting.");
+ itip_title = U_("Meeting Proposal");
options = get_request_options (priv->event_client ? FALSE : TRUE);
break;
case ICAL_METHOD_ADD:
- itip_desc = _("<b>%s</b> wishes to add to an existing meeting.");
- itip_title = _("Meeting Update");
+ itip_desc = U_("<b>%s</b> wishes to add to an existing meeting.");
+ itip_title = U_("Meeting Update");
options = get_publish_options (priv->event_client ? FALSE : TRUE);
break;
case ICAL_METHOD_REFRESH:
- itip_desc = _("<b>%s</b> wishes to receive the latest meeting information.");
- itip_title = _("Meeting Update Request");
+ itip_desc = U_("<b>%s</b> wishes to receive the latest meeting information.");
+ itip_title = U_("Meeting Update Request");
options = get_refresh_options ();
/* Provide extra info, since its not in the component */
adjust_item (itip, priv->comp);
break;
case ICAL_METHOD_REPLY:
- itip_desc = _("<b>%s</b> has replied to a meeting request.");
- itip_title = _("Meeting Reply");
+ itip_desc = U_("<b>%s</b> has replied to a meeting request.");
+ itip_title = U_("Meeting Reply");
options = get_reply_options ();
/* Provide extra info, since might not be in the component */
adjust_item (itip, priv->comp);
break;
case ICAL_METHOD_CANCEL:
- itip_desc = _("<b>%s</b> has cancelled a meeting.");
- itip_title = _("Meeting Cancellation");
+ itip_desc = U_("<b>%s</b> has cancelled a meeting.");
+ itip_title = U_("Meeting Cancellation");
options = get_cancel_options ();
/* Provide extra info, since might not be in the component */
adjust_item (itip, priv->comp);
break;
default:
- itip_desc = _("<b>%s</b> has sent an unintelligible message.");
- itip_title = _("Bad Meeting Message");
+ itip_desc = U_("<b>%s</b> has sent an unintelligible message.");
+ itip_title = U_("Bad Meeting Message");
options = NULL;
}
@@ -1383,50 +1400,50 @@ show_current_todo (EItipControl *itip)
switch (priv->method) {
case ICAL_METHOD_PUBLISH:
- itip_desc = _("<b>%s</b> has published task information.");
- itip_title = _("Task Information");
+ itip_desc = U_("<b>%s</b> has published task information.");
+ itip_title = U_("Task Information");
options = get_publish_options (priv->task_client ? FALSE : TRUE);
break;
case ICAL_METHOD_REQUEST:
if (priv->delegator_address != NULL)
- itip_desc = _("<b>%s</b> requests %s to perform a task.");
+ itip_desc = U_("<b>%s</b> requests %s to perform a task.");
else
- itip_desc = _("<b>%s</b> requests you perform a task.");
- itip_title = _("Task Proposal");
+ itip_desc = U_("<b>%s</b> requests you perform a task.");
+ itip_title = U_("Task Proposal");
options = get_request_options (priv->task_client ? FALSE : TRUE);
break;
case ICAL_METHOD_ADD:
- itip_desc = _("<b>%s</b> wishes to add to an existing task.");
- itip_title = _("Task Update");
+ itip_desc = U_("<b>%s</b> wishes to add to an existing task.");
+ itip_title = U_("Task Update");
options = get_publish_options (priv->task_client ? FALSE : TRUE);
break;
case ICAL_METHOD_REFRESH:
- itip_desc = _("<b>%s</b> wishes to receive the latest task information.");
- itip_title = _("Task Update Request");
+ itip_desc = U_("<b>%s</b> wishes to receive the latest task information.");
+ itip_title = U_("Task Update Request");
options = get_refresh_options ();
/* Provide extra info, since its not in the component */
adjust_item (itip, priv->comp);
break;
case ICAL_METHOD_REPLY:
- itip_desc = _("<b>%s</b> has replied to a task assignment.");
- itip_title = _("Task Reply");
+ itip_desc = U_("<b>%s</b> has replied to a task assignment.");
+ itip_title = U_("Task Reply");
options = get_reply_options ();
/* Provide extra info, since might not be in the component */
adjust_item (itip, priv->comp);
break;
case ICAL_METHOD_CANCEL:
- itip_desc = _("<b>%s</b> has cancelled a task.");
- itip_title = _("Task Cancellation");
+ itip_desc = U_("<b>%s</b> has cancelled a task.");
+ itip_title = U_("Task Cancellation");
options = get_cancel_options ();
/* Provide extra info, since might not be in the component */
adjust_item (itip, priv->comp);
break;
default:
- itip_desc = _("<b>%s</b> has sent an unintelligible message.");
- itip_title = _("Bad Task Message");
+ itip_desc = U_("<b>%s</b> has sent an unintelligible message.");
+ itip_title = U_("Bad Task Message");
options = NULL;
}
@@ -1445,23 +1462,23 @@ show_current_freebusy (EItipControl *itip)
switch (priv->method) {
case ICAL_METHOD_PUBLISH:
- itip_desc = _("<b>%s</b> has published free/busy information.");
- itip_title = _("Free/Busy Information");
+ itip_desc = U_("<b>%s</b> has published free/busy information.");
+ itip_title = U_("Free/Busy Information");
options = NULL;
break;
case ICAL_METHOD_REQUEST:
- itip_desc = _("<b>%s</b> requests your free/busy information.");
- itip_title = _("Free/Busy Request");
+ itip_desc = U_("<b>%s</b> requests your free/busy information.");
+ itip_title = U_("Free/Busy Request");
options = get_request_fb_options ();
break;
case ICAL_METHOD_REPLY:
- itip_desc = _("<b>%s</b> has replied to a free/busy request.");
- itip_title = _("Free/Busy Reply");
+ itip_desc = U_("<b>%s</b> has replied to a free/busy request.");
+ itip_title = U_("Free/Busy Reply");
options = NULL;
break;
default:
- itip_desc = _("<b>%s</b> has sent an unintelligible message.");
- itip_title = _("Bad Free/Busy Message");
+ itip_desc = U_("<b>%s</b> has sent an unintelligible message.");
+ itip_title = U_("Bad Free/Busy Message");
options = NULL;
}
@@ -1498,15 +1515,15 @@ show_current (EItipControl *itip)
priv = itip->priv;
- g_object_ref (itip);
+ gtk_object_ref (GTK_OBJECT (itip));
if (priv->comp)
- g_object_unref (priv->comp);
+ gtk_object_unref (GTK_OBJECT (priv->comp));
if (priv->event_client != NULL)
- g_object_unref (priv->event_client);
+ gtk_object_unref (GTK_OBJECT (priv->event_client));
priv->event_client = NULL;
if (priv->task_client != NULL)
- g_object_unref (priv->task_client);
+ gtk_object_unref (GTK_OBJECT (priv->task_client));
priv->task_client = NULL;
/* Determine any delegate sections */
@@ -1537,10 +1554,10 @@ show_current (EItipControl *itip)
priv->comp = cal_component_new ();
if (!cal_component_set_icalcomponent (priv->comp, priv->ical_comp)) {
- write_error_html (itip, _("The message does not appear to be properly formed"));
- g_object_unref (priv->comp);
+ write_error_html (itip, U_("The message does not appear to be properly formed"));
+ gtk_object_unref (GTK_OBJECT (priv->comp));
priv->comp = NULL;
- g_object_unref (itip);
+ gtk_object_unref (GTK_OBJECT (itip));
return;
};
@@ -1600,12 +1617,12 @@ show_current (EItipControl *itip)
show_current_freebusy (itip);
break;
default:
- write_error_html (itip, _("The message contains only unsupported requests."));
+ write_error_html (itip, U_("The message contains only unsupported requests."));
}
find_my_address (itip, priv->ical_comp);
- g_object_unref (itip);
+ gtk_object_unref (GTK_OBJECT (itip));
}
void
@@ -1631,13 +1648,13 @@ e_itip_control_set_data (EItipControl *itip, const gchar *text)
priv->main_comp = icalparser_parse_string (priv->vcalendar);
if (priv->main_comp == NULL) {
- write_error_html (itip, _("The attachment does not contain a valid calendar message"));
+ write_error_html (itip, U_("The attachment does not contain a valid calendar message"));
return;
}
prop = icalcomponent_get_first_property (priv->main_comp, ICAL_METHOD_PROPERTY);
if (prop == NULL) {
- write_error_html (itip, _("The attachment does not contain a valid calendar message"));
+ write_error_html (itip, U_("The attachment does not contain a valid calendar message"));
return;
}
@@ -1662,7 +1679,7 @@ e_itip_control_set_data (EItipControl *itip, const gchar *text)
priv->ical_comp = get_next (&priv->iter);
if (priv->ical_comp == NULL) {
- write_error_html (itip, _("The attachment has no viewable calendar items"));
+ write_error_html (itip, U_("The attachment has no viewable calendar items"));
return;
}
@@ -1841,14 +1858,14 @@ change_status (icalcomponent *ical_comp, const char *address, icalparameter_part
param = icalparameter_new_partstat (status);
icalproperty_add_parameter (prop, param);
} else {
- EAccount *a;
+ ItipAddress *a;
a = itip_addresses_get_default ();
- prop = icalproperty_new_attendee (a->id->address);
+ prop = icalproperty_new_attendee (a->address);
icalcomponent_add_property (ical_comp, prop);
- param = icalparameter_new_cn (a->id->name);
+ param = icalparameter_new_cn (a->name);
icalproperty_add_parameter (prop, param);
param = icalparameter_new_role (ICAL_ROLE_REQPARTICIPANT);
@@ -1856,6 +1873,8 @@ change_status (icalcomponent *ical_comp, const char *address, icalparameter_part
param = icalparameter_new_partstat (status);
icalproperty_add_parameter (prop, param);
+
+ itip_address_free (a);
}
}
@@ -2019,7 +2038,7 @@ update_attendee_status (EItipControl *itip)
cleanup:
if (comp != NULL)
- g_object_unref (comp);
+ gtk_object_unref (GTK_OBJECT (comp));
gnome_dialog_run_and_close (GNOME_DIALOG (dialog));
}
@@ -2074,7 +2093,7 @@ send_item (EItipControl *itip)
default:
itip_send_comp (CAL_COMPONENT_METHOD_REQUEST, comp, NULL, NULL);
}
- g_object_unref (comp);
+ gtk_object_unref (GTK_OBJECT (comp));
dialog = gnome_ok_dialog (_("Item sent!\n"));
} else {
dialog = gnome_warning_dialog (_("The item could not be sent!\n"));
@@ -2123,7 +2142,7 @@ send_freebusy (EItipControl *itip)
CalComponent *comp = CAL_COMPONENT (l->data);
itip_send_comp (CAL_COMPONENT_METHOD_REPLY, comp, priv->event_client, NULL);
- g_object_unref (comp);
+ gtk_object_unref (GTK_OBJECT (comp));
}
dialog = gnome_ok_dialog (_("Item sent!\n"));
@@ -2150,7 +2169,7 @@ button_selected_cb (EvolutionFolderSelectorButton *button, GNOME_Evolution_Folde
else
uri = cal_util_expand_uri (folder->physicalUri, FALSE);
- g_object_unref (priv->event_client);
+ gtk_object_unref (GTK_OBJECT (priv->event_client));
priv->event_client = start_calendar_server (itip, uri);
g_free (uri);
@@ -2162,7 +2181,7 @@ url_requested_cb (GtkHTML *html, const gchar *url, GtkHTMLStream *handle, gpoint
int len, fd;
char *path;
- path = g_strdup_printf ("%s/%s", EVOLUTION_IMAGESDIR, url);
+ path = g_strdup_printf ("%s/%s", EVOLUTION_ICONSDIR, url);
if ((fd = open (path, O_RDONLY)) == -1) {
g_warning ("%s", g_strerror (errno));
@@ -2218,7 +2237,8 @@ object_requested_cb (GtkHTML *html, GtkHTMLEmbedded *eb, gpointer data)
button = NULL;
}
- g_signal_connect (button, "selected", G_CALLBACK (button_selected_cb), itip);
+ gtk_signal_connect (GTK_OBJECT (button), "selected",
+ button_selected_cb, itip);
gtk_container_add (GTK_CONTAINER (eb), button);
gtk_widget_show (button);
@@ -2358,6 +2378,6 @@ ok_clicked_cb (GtkHTML *html, const gchar *method, const gchar *url, const gchar
default:
itip_send_comp (CAL_COMPONENT_METHOD_REPLY, comp, NULL, NULL);
}
- g_object_unref (comp);
+ gtk_object_unref (GTK_OBJECT (comp));
}
}
diff --git a/calendar/gui/e-meeting-attendee.c b/calendar/gui/e-meeting-attendee.c
index fd34147aef..decab74016 100644
--- a/calendar/gui/e-meeting-attendee.c
+++ b/calendar/gui/e-meeting-attendee.c
@@ -26,7 +26,6 @@
#include <stdlib.h>
#include <gtk/gtk.h>
-#include <gal/util/e-util.h>
#include "e-meeting-attendee.h"
struct _EMeetingAttendeePrivate {
@@ -75,8 +74,31 @@ static void destroy (GtkObject *obj);
static GtkObjectClass *parent_class = NULL;
-E_MAKE_TYPE (e_meeting_attendee, "EMeetingAttendee", EMeetingAttendee,
- class_init, init, GTK_TYPE_OBJECT);
+
+GtkType
+e_meeting_attendee_get_type (void)
+{
+ static GtkType type = 0;
+
+ if (type == 0)
+ {
+ static const GtkTypeInfo info =
+ {
+ "EMeetingAttendee",
+ sizeof (EMeetingAttendee),
+ sizeof (EMeetingAttendeeClass),
+ (GtkClassInitFunc) class_init,
+ (GtkObjectInitFunc) init,
+ /* reserved_1 */ NULL,
+ /* reserved_2 */ NULL,
+ (GtkClassInitFunc) NULL,
+ };
+
+ type = gtk_type_unique (gtk_object_get_type (), &info);
+ }
+
+ return type;
+}
static void
class_init (EMeetingAttendeeClass *klass)
@@ -85,17 +107,19 @@ class_init (EMeetingAttendeeClass *klass)
object_class = GTK_OBJECT_CLASS (klass);
- parent_class = g_type_class_peek_parent (klass);
+ parent_class = gtk_type_class (gtk_object_get_type ());
signals[CHANGED] =
gtk_signal_new ("changed",
GTK_RUN_FIRST,
- G_TYPE_FROM_CLASS (object_class),
+ object_class->type,
GTK_SIGNAL_OFFSET (EMeetingAttendeeClass, changed),
gtk_marshal_NONE__NONE,
GTK_TYPE_NONE, 0);
- object_class->destroy = destroy;
+ gtk_object_class_add_signals (object_class, signals, LAST_SIGNAL);
+
+ object_class->destroy = destroy;
}
static gchar *
@@ -192,7 +216,7 @@ destroy (GtkObject *obj)
GtkObject *
e_meeting_attendee_new (void)
{
- return g_object_new (E_TYPE_MEETING_ATTENDEE, NULL);
+ return gtk_type_new (E_TYPE_MEETING_ATTENDEE);
}
GtkObject *
@@ -200,7 +224,7 @@ e_meeting_attendee_new_from_cal_component_attendee (CalComponentAttendee *ca)
{
EMeetingAttendee *ia;
- ia = E_MEETING_ATTENDEE (g_object_new (E_TYPE_MEETING_ATTENDEE, NULL));
+ ia = E_MEETING_ATTENDEE (gtk_type_new (E_TYPE_MEETING_ATTENDEE));
e_meeting_attendee_set_address (ia, g_strdup (ca->value));
e_meeting_attendee_set_member (ia, g_strdup (ca->member));
diff --git a/calendar/gui/e-meeting-model.c b/calendar/gui/e-meeting-model.c
index 4c0dfaf2fc..e3a9108ae3 100644
--- a/calendar/gui/e-meeting-model.c
+++ b/calendar/gui/e-meeting-model.c
@@ -25,9 +25,11 @@
#endif
#include <glib.h>
+#include <liboaf/liboaf.h>
#include <bonobo/bonobo-control.h>
#include <bonobo/bonobo-widget.h>
#include <bonobo/bonobo-exception.h>
+#include <libgnome/gnome-defs.h>
#include <libgnome/gnome-i18n.h>
#include <libgnome/gnome-util.h>
#include <libgnomevfs/gnome-vfs.h>
@@ -35,6 +37,7 @@
#include <gal/e-table/e-cell-text.h>
#include <gal/e-table/e-cell-popup.h>
#include <gal/e-table/e-cell-combo.h>
+#include <gal/util/e-unicode-i18n.h>
#include <ebook/e-book.h>
#include <ebook/e-card-types.h>
#include <ebook/e-card-cursor.h>
@@ -108,7 +111,7 @@ struct _EMeetingModelQueueData {
static void class_init (EMeetingModelClass *klass);
static void init (EMeetingModel *model);
-static void finalize (GObject *obj);
+static void destroy (GtkObject *obj);
static void refresh_queue_add (EMeetingModel *im, int row,
EMeetingTime *start,
@@ -121,8 +124,8 @@ static gboolean refresh_busy_periods (gpointer data);
static void attendee_changed_cb (EMeetingAttendee *ia, gpointer data);
static void select_names_ok_cb (BonoboListener *listener,
- const char *event_name,
- const CORBA_any *arg,
+ char *event_name,
+ CORBA_any *arg,
CORBA_Environment *ev,
gpointer data);
@@ -131,8 +134,30 @@ static void table_destroy_list_cb (ETableScrolled *etable, gpointer data);
static ETableModelClass *parent_class = NULL;
-E_MAKE_TYPE (e_meeting_model, "EMeetingModel", EMeetingModel,
- class_init, init, E_TABLE_MODEL_TYPE);
+GtkType
+e_meeting_model_get_type (void)
+{
+ static GtkType type = 0;
+
+ if (type == 0)
+ {
+ static const GtkTypeInfo info =
+ {
+ "EMeetingModel",
+ sizeof (EMeetingModel),
+ sizeof (EMeetingModelClass),
+ (GtkClassInitFunc) class_init,
+ (GtkObjectInitFunc) init,
+ /* reserved_1 */ NULL,
+ /* reserved_2 */ NULL,
+ (GtkClassInitFunc) NULL,
+ };
+
+ type = gtk_type_unique (e_table_model_get_type (), &info);
+ }
+
+ return type;
+}
static void
book_open_cb (EBook *book, EBookStatus status, gpointer data)
@@ -383,7 +408,7 @@ append_row (ETableModel *etm, ETableModel *source, int row)
e_meeting_attendee_set_language (ia, g_strdup (e_table_model_value_at (source, E_MEETING_MODEL_LANGUAGE_COL, row)));
e_meeting_model_add_attendee (E_MEETING_MODEL (etm), ia);
- g_object_unref (ia);
+ gtk_object_unref (GTK_OBJECT (ia));
}
static void *
@@ -498,8 +523,6 @@ is_cell_editable (ETableModel *etm, int col, int row)
if (row == -1)
return TRUE;
- if (row >= priv->attendees->len)
- return TRUE;
ia = g_ptr_array_index (priv->attendees, row);
level = e_meeting_attendee_get_edit_level (ia);
@@ -622,15 +645,15 @@ free_duplicated_key (void *key, gpointer data)
static void
class_init (EMeetingModelClass *klass)
{
- GObjectClass *gobject_class;
+ GtkObjectClass *object_class;
ETableModelClass *etm_class;
- gobject_class = G_OBJECT_CLASS (klass);
+ object_class = GTK_OBJECT_CLASS (klass);
etm_class = E_TABLE_MODEL_CLASS (klass);
- parent_class = g_type_class_peek_parent (klass);
+ parent_class = gtk_type_class (E_TABLE_MODEL_TYPE);
- gobject_class->finalize = finalize;
+ object_class->destroy = destroy;
etm_class->column_count = column_count;
etm_class->row_count = row_count;
@@ -685,7 +708,7 @@ init (EMeetingModel *im)
}
static void
-finalize (GObject *obj)
+destroy (GtkObject *obj)
{
EMeetingModel *im = E_MEETING_MODEL (obj);
EMeetingModelPrivate *priv;
@@ -695,19 +718,18 @@ finalize (GObject *obj)
priv = im->priv;
for (i = 0; i < priv->attendees->len; i++)
- g_object_unref (g_ptr_array_index (priv->attendees, i));
+ gtk_object_unref (GTK_OBJECT (g_ptr_array_index (priv->attendees, i)));
g_ptr_array_free (priv->attendees, TRUE);
for (l = priv->tables; l != NULL; l = l->next)
- g_signal_handlers_disconnect_matched (G_OBJECT (l->data), G_SIGNAL_MATCH_DATA,
- 0, 0, NULL, NULL, im);
+ gtk_signal_disconnect_by_data (GTK_OBJECT (l->data), im);
g_list_free (priv->tables);
if (priv->client != NULL)
- g_object_unref (priv->client);
+ gtk_object_unref (GTK_OBJECT (priv->client));
if (priv->ebook != NULL)
- g_object_unref (priv->ebook);
+ gtk_object_unref (GTK_OBJECT (priv->ebook));
if (priv->corba_select_names != CORBA_OBJECT_NIL) {
CORBA_Environment ev;
@@ -730,7 +752,7 @@ finalize (GObject *obj)
GtkObject *
e_meeting_model_new (void)
{
- return g_object_new (E_TYPE_MEETING_MODEL, NULL);
+ return gtk_type_new (E_TYPE_MEETING_MODEL);
}
@@ -752,10 +774,10 @@ e_meeting_model_set_cal_client (EMeetingModel *im, CalClient *client)
priv = im->priv;
if (priv->client != NULL)
- g_object_unref (priv->client);
+ gtk_object_unref (GTK_OBJECT (priv->client));
if (client != NULL)
- g_object_ref (client);
+ gtk_object_ref (GTK_OBJECT (client));
priv->client = client;
}
@@ -800,14 +822,14 @@ build_etable (ETableModel *model, const gchar *spec_file, const gchar *state_fil
cell = e_cell_text_new (NULL, GTK_JUSTIFY_LEFT);
popup_cell = e_cell_combo_new ();
e_cell_popup_set_child (E_CELL_POPUP (popup_cell), cell);
- g_object_unref (cell);
+ gtk_object_unref (GTK_OBJECT (cell));
strings = NULL;
- strings = g_list_append (strings, (char*) _("Individual"));
- strings = g_list_append (strings, (char*) _("Group"));
- strings = g_list_append (strings, (char*) _("Resource"));
- strings = g_list_append (strings, (char*) _("Room"));
- strings = g_list_append (strings, (char*) _("Unknown"));
+ strings = g_list_append (strings, (char*) U_("Individual"));
+ strings = g_list_append (strings, (char*) U_("Group"));
+ strings = g_list_append (strings, (char*) U_("Resource"));
+ strings = g_list_append (strings, (char*) U_("Room"));
+ strings = g_list_append (strings, (char*) U_("Unknown"));
e_cell_combo_set_popdown_strings (E_CELL_COMBO (popup_cell), strings);
e_table_extras_add_cell (extras, "typeedit", popup_cell);
@@ -816,14 +838,14 @@ build_etable (ETableModel *model, const gchar *spec_file, const gchar *state_fil
cell = e_cell_text_new (NULL, GTK_JUSTIFY_LEFT);
popup_cell = e_cell_combo_new ();
e_cell_popup_set_child (E_CELL_POPUP (popup_cell), cell);
- g_object_unref (cell);
+ gtk_object_unref (GTK_OBJECT (cell));
strings = NULL;
- strings = g_list_append (strings, (char*) _("Chair"));
- strings = g_list_append (strings, (char*) _("Required Participant"));
- strings = g_list_append (strings, (char*) _("Optional Participant"));
- strings = g_list_append (strings, (char*) _("Non-Participant"));
- strings = g_list_append (strings, (char*) _("Unknown"));
+ strings = g_list_append (strings, (char*) U_("Chair"));
+ strings = g_list_append (strings, (char*) U_("Required Participant"));
+ strings = g_list_append (strings, (char*) U_("Optional Participant"));
+ strings = g_list_append (strings, (char*) U_("Non-Participant"));
+ strings = g_list_append (strings, (char*) U_("Unknown"));
e_cell_combo_set_popdown_strings (E_CELL_COMBO (popup_cell), strings);
e_table_extras_add_cell (extras, "roleedit", popup_cell);
@@ -832,11 +854,11 @@ build_etable (ETableModel *model, const gchar *spec_file, const gchar *state_fil
cell = e_cell_text_new (NULL, GTK_JUSTIFY_LEFT);
popup_cell = e_cell_combo_new ();
e_cell_popup_set_child (E_CELL_POPUP (popup_cell), cell);
- g_object_unref (cell);
+ gtk_object_unref (GTK_OBJECT (cell));
strings = NULL;
- strings = g_list_append (strings, (char*) _("Yes"));
- strings = g_list_append (strings, (char*) _("No"));
+ strings = g_list_append (strings, (char*) U_("Yes"));
+ strings = g_list_append (strings, (char*) U_("No"));
e_cell_combo_set_popdown_strings (E_CELL_COMBO (popup_cell), strings);
e_table_extras_add_cell (extras, "rsvpedit", popup_cell);
@@ -845,30 +867,32 @@ build_etable (ETableModel *model, const gchar *spec_file, const gchar *state_fil
cell = e_cell_text_new (NULL, GTK_JUSTIFY_LEFT);
popup_cell = e_cell_combo_new ();
e_cell_popup_set_child (E_CELL_POPUP (popup_cell), cell);
- g_object_unref (cell);
+ gtk_object_unref (GTK_OBJECT (cell));
strings = NULL;
- strings = g_list_append (strings, (char*) _("Needs Action"));
- strings = g_list_append (strings, (char*) _("Accepted"));
- strings = g_list_append (strings, (char*) _("Declined"));
- strings = g_list_append (strings, (char*) _("Tentative"));
- strings = g_list_append (strings, (char*) _("Delegated"));
+ strings = g_list_append (strings, (char*) U_("Needs Action"));
+ strings = g_list_append (strings, (char*) U_("Accepted"));
+ strings = g_list_append (strings, (char*) U_("Declined"));
+ strings = g_list_append (strings, (char*) U_("Tentative"));
+ strings = g_list_append (strings, (char*) U_("Delegated"));
e_cell_combo_set_popdown_strings (E_CELL_COMBO (popup_cell), strings);
e_table_extras_add_cell (extras, "statusedit", popup_cell);
etable = e_table_scrolled_new_from_spec_file (model, extras, spec_file, NULL);
real_table = e_table_scrolled_get_table (E_TABLE_SCROLLED (etable));
- g_object_set (G_OBJECT (real_table), "uniform_row_height", TRUE, NULL);
+ gtk_object_set (GTK_OBJECT (real_table), "uniform_row_height", TRUE, NULL);
e_table_load_state (real_table, state_file);
#if 0
- g_signal_connect (real_table, "right_click", G_CALLBACK (right_click_cb), mpage);
+ gtk_signal_connect (GTK_OBJECT (real_table),
+ "right_click", GTK_SIGNAL_FUNC (right_click_cb), mpage);
#endif
- g_signal_connect (etable, "destroy", G_CALLBACK (table_destroy_state_cb), g_strdup (state_file));
+ gtk_signal_connect (GTK_OBJECT (etable), "destroy",
+ GTK_SIGNAL_FUNC (table_destroy_state_cb), g_strdup (state_file));
- g_object_unref (extras);
+ gtk_object_unref (GTK_OBJECT (extras));
return E_TABLE_SCROLLED (etable);
}
@@ -882,10 +906,11 @@ e_meeting_model_add_attendee (EMeetingModel *im, EMeetingAttendee *ia)
e_table_model_pre_change (E_TABLE_MODEL (im));
- g_object_ref (ia);
+ gtk_object_ref (GTK_OBJECT (ia));
g_ptr_array_add (priv->attendees, ia);
- g_signal_connect (ia, "changed", G_CALLBACK (attendee_changed_cb), im);
+ gtk_signal_connect (GTK_OBJECT (ia), "changed",
+ GTK_SIGNAL_FUNC (attendee_changed_cb), im);
e_table_model_row_inserted (E_TABLE_MODEL (im), row_count (E_TABLE_MODEL (im)) - 1);
}
@@ -945,7 +970,7 @@ e_meeting_model_remove_attendee (EMeetingModel *im, EMeetingAttendee *ia)
e_table_model_pre_change (E_TABLE_MODEL (im));
g_ptr_array_remove_index (priv->attendees, row);
- g_object_unref (ia);
+ gtk_object_unref (GTK_OBJECT (ia));
e_table_model_row_deleted (E_TABLE_MODEL (im), row);
}
@@ -965,7 +990,7 @@ e_meeting_model_remove_all_attendees (EMeetingModel *im)
for (i = 0; i < len; i++) {
EMeetingAttendee *ia = g_ptr_array_index (priv->attendees, i);
- g_object_unref (ia);
+ gtk_object_unref (GTK_OBJECT (ia));
}
g_ptr_array_set_size (priv->attendees, 0);
@@ -1119,7 +1144,7 @@ refresh_queue_add (EMeetingModel *im, int row,
g_ptr_array_add (qdata->data, data);
}
- g_object_ref (ia);
+ gtk_object_ref (GTK_OBJECT (ia));
g_ptr_array_add (priv->refresh_queue, ia);
if (priv->refresh_idle_id == -1)
@@ -1145,7 +1170,7 @@ refresh_queue_remove (EMeetingModel *im, EMeetingAttendee *ia)
/* Unref the attendee */
g_ptr_array_remove (priv->refresh_queue, ia);
- g_object_unref (ia);
+ gtk_object_unref (GTK_OBJECT (ia));
}
static void
@@ -1337,7 +1362,7 @@ async_read (GnomeVFSAsyncHandle *handle,
EMeetingModelQueueData *qdata = data;
GnomeVFSFileSize buf_size = BUF_SIZE - 1;
- if (result != GNOME_VFS_OK && result != GNOME_VFS_ERROR_EOF) {
+ if (result != GNOME_VFS_OK) {
gnome_vfs_async_close (handle, async_close, qdata);
return;
}
@@ -1345,7 +1370,7 @@ async_read (GnomeVFSAsyncHandle *handle,
((char *)buffer)[read] = '\0';
qdata->string = g_string_append (qdata->string, buffer);
- if (result == GNOME_VFS_ERROR_EOF) {
+ if (read < requested) {
gnome_vfs_async_close (handle, async_close, qdata);
return;
}
@@ -1362,7 +1387,7 @@ async_open (GnomeVFSAsyncHandle *handle,
GnomeVFSFileSize buf_size = BUF_SIZE - 1;
if (result != GNOME_VFS_OK) {
- gnome_vfs_async_close (handle, async_close, qdata);
+ process_callbacks (qdata);
return;
}
@@ -1392,8 +1417,7 @@ cursor_cb (EBook *book, EBookStatus status, ECardCursor *cursor, gpointer data)
continue;
/* Read in free/busy data from the url */
- gnome_vfs_async_open (&handle, card->fburl, GNOME_VFS_OPEN_READ,
- GNOME_VFS_PRIORITY_DEFAULT, async_open, qdata);
+ gnome_vfs_async_open (&handle, card->fburl, GNOME_VFS_OPEN_READ, async_open, qdata);
return;
}
@@ -1545,7 +1569,8 @@ e_meeting_model_etable_from_model (EMeetingModel *im, const gchar *spec_file, co
priv->tables = g_list_prepend (priv->tables, ets);
- g_signal_connect (ets, "destroy", G_CALLBACK (table_destroy_list_cb), im);
+ gtk_signal_connect (GTK_OBJECT (ets), "destroy",
+ GTK_SIGNAL_FUNC (table_destroy_list_cb), im);
return ets;
}
@@ -1568,7 +1593,7 @@ e_meeting_model_etable_click_to_add (EMeetingModel *im, gboolean click_to_add)
ets = l->data;
real_table = e_table_scrolled_get_table (ets);
- g_object_set (G_OBJECT (real_table), "use_click_to_add", click_to_add, NULL);
+ gtk_object_set (GTK_OBJECT (real_table), "use_click_to_add", click_to_add, NULL);
}
}
@@ -1649,7 +1674,7 @@ get_select_name_dialog (EMeetingModel *im)
control_widget = bonobo_widget_new_control_from_objref (corba_control, CORBA_OBJECT_NIL);
- bonobo_widget_set_property (BONOBO_WIDGET (control_widget), "text", TC_CORBA_string, "", NULL);
+ bonobo_widget_set_property (BONOBO_WIDGET (control_widget), "text", "", NULL);
}
CORBA_exception_free (&ev);
@@ -1658,13 +1683,13 @@ get_select_name_dialog (EMeetingModel *im)
CORBA_exception_init (&ev);
- priv->corba_select_names = bonobo_activation_activate_from_id (SELECT_NAMES_OAFID, 0, NULL, &ev);
+ priv->corba_select_names = oaf_activate_from_id (SELECT_NAMES_OAFID, 0, NULL, &ev);
for (i = 0; sections[i] != NULL; i++)
add_section (priv->corba_select_names, sections[i]);
bonobo_event_source_client_add_listener (priv->corba_select_names,
- (BonoboListenerCallbackFn) select_names_ok_cb,
+ select_names_ok_cb,
"GNOME/Evolution:ok:dialog",
NULL, im);
@@ -1759,8 +1784,8 @@ process_section (EMeetingModel *im, GNOME_Evolution_Addressbook_SimpleCardList *
static void
select_names_ok_cb (BonoboListener *listener,
- const char *event_name,
- const CORBA_any *arg,
+ char *event_name,
+ CORBA_any *arg,
CORBA_Environment *ev,
gpointer data)
{
@@ -1782,14 +1807,14 @@ select_names_ok_cb (BonoboListener *listener,
control_widget = bonobo_widget_new_control_from_objref
(corba_control, CORBA_OBJECT_NIL);
- control_frame = bonobo_widget_get_control_frame (BONOBO_WIDGET (control_widget));
- pb = bonobo_control_frame_get_control_property_bag (control_frame, NULL);
- card_arg = bonobo_property_bag_client_get_value_any (pb, "simple_card_list", NULL);
- if (card_arg != NULL) {
- cards = BONOBO_ARG_GET_GENERAL (card_arg, TC_GNOME_Evolution_Addressbook_SimpleCardList, GNOME_Evolution_Addressbook_SimpleCardList, NULL);
- process_section (im, &cards, roles[i]);
- bonobo_arg_release (card_arg);
- }
+ control_frame = bonobo_widget_get_control_frame (BONOBO_WIDGET (control_widget));
+ pb = bonobo_control_frame_get_control_property_bag (control_frame, NULL);
+ card_arg = bonobo_property_bag_client_get_value_any (pb, "simple_card_list", NULL);
+ if (card_arg != NULL) {
+ cards = BONOBO_ARG_GET_GENERAL (card_arg, TC_GNOME_Evolution_Addressbook_SimpleCardList, GNOME_Evolution_Addressbook_SimpleCardList, NULL);
+ process_section (im, &cards, roles[i]);
+ bonobo_arg_release (card_arg);
+ }
}
}
@@ -1804,7 +1829,7 @@ attendee_changed_cb (EMeetingAttendee *ia, gpointer data)
for (i = 0; i < priv->attendees->len; i++) {
if (ia == g_ptr_array_index (priv->attendees, i)) {
- row = i;
+ row = 1;
break;
}
}
diff --git a/calendar/gui/e-tasks.c b/calendar/gui/e-tasks.c
index cc247c2d85..1108dfdf2b 100644
--- a/calendar/gui/e-tasks.c
+++ b/calendar/gui/e-tasks.c
@@ -29,14 +29,12 @@
#include <gal/menus/gal-view-instance.h>
#include <gal/menus/gal-view-factory-etable.h>
#include <gal/menus/gal-view-etable.h>
-
#include "e-util/e-url.h"
#include "widgets/menus/gal-view-menus.h"
#include "dialogs/task-editor.h"
#include "cal-search-bar.h"
#include "calendar-config.h"
-#include "calendar-component.h"
-#include "comp-util.h"
+#include "component-factory.h"
#include "misc.h"
#include "e-tasks.h"
@@ -88,7 +86,7 @@ E_MAKE_TYPE (e_tasks, "ETasks", ETasks,
/* Class initialization function for the gnome calendar */
- static void
+static void
e_tasks_class_init (ETasksClass *class)
{
GtkObjectClass *object_class;
@@ -100,12 +98,14 @@ e_tasks_class_init (ETasksClass *class)
e_tasks_signals[SELECTION_CHANGED] =
gtk_signal_new ("selection_changed",
GTK_RUN_LAST,
- G_TYPE_FROM_CLASS (object_class),
+ object_class->type,
GTK_SIGNAL_OFFSET (ETasksClass, selection_changed),
gtk_marshal_NONE__INT,
GTK_TYPE_NONE, 1,
GTK_TYPE_INT);
+ gtk_object_class_add_signals (object_class, e_tasks_signals, LAST_SIGNAL);
+
object_class->destroy = e_tasks_destroy;
class->selection_changed = NULL;
@@ -192,10 +192,10 @@ setup_widgets (ETasks *tasks)
priv = tasks->priv;
priv->search_bar = cal_search_bar_new ();
- g_signal_connect (priv->search_bar, "sexp_changed",
- G_CALLBACK (search_bar_sexp_changed_cb), tasks);
- g_signal_connect (priv->search_bar, "category_changed",
- G_CALLBACK (search_bar_category_changed_cb), tasks);
+ gtk_signal_connect (GTK_OBJECT (priv->search_bar), "sexp_changed",
+ GTK_SIGNAL_FUNC (search_bar_sexp_changed_cb), tasks);
+ gtk_signal_connect (GTK_OBJECT (priv->search_bar), "category_changed",
+ GTK_SIGNAL_FUNC (search_bar_category_changed_cb), tasks);
gtk_table_attach (GTK_TABLE (tasks), priv->search_bar, 0, 1, 0, 1,
GTK_EXPAND | GTK_FILL | GTK_SHRINK, 0, 0, 0);
@@ -214,7 +214,8 @@ setup_widgets (ETasks *tasks)
calendar_config_configure_e_calendar_table (E_CALENDAR_TABLE (priv->tasks_view));
- g_signal_connect (etable, "selection_change", G_CALLBACK (table_selection_change_cb), tasks);
+ gtk_signal_connect (GTK_OBJECT (etable), "selection_change",
+ GTK_SIGNAL_FUNC (table_selection_change_cb), tasks);
}
/* Callback used when the set of categories changes in the calendar client */
@@ -247,12 +248,12 @@ e_tasks_construct (ETasks *tasks)
if (!priv->client)
return NULL;
- g_signal_connect (priv->client, "cal_opened",
- G_CALLBACK (cal_opened_cb), tasks);
- g_signal_connect (priv->client, "backend_error",
- G_CALLBACK (backend_error_cb), tasks);
- g_signal_connect (priv->client, "categories_changed",
- G_CALLBACK (client_categories_changed_cb), tasks);
+ gtk_signal_connect (GTK_OBJECT (priv->client), "cal_opened",
+ GTK_SIGNAL_FUNC (cal_opened_cb), tasks);
+ gtk_signal_connect (GTK_OBJECT (priv->client), "backend_error",
+ GTK_SIGNAL_FUNC (backend_error_cb), tasks);
+ gtk_signal_connect (GTK_OBJECT (priv->client), "categories_changed",
+ GTK_SIGNAL_FUNC (client_categories_changed_cb), tasks);
model = e_calendar_table_get_model (E_CALENDAR_TABLE (priv->tasks_view));
g_assert (model != NULL);
@@ -268,11 +269,11 @@ e_tasks_new (void)
{
ETasks *tasks;
- tasks = g_object_new (e_tasks_get_type (), NULL);
+ tasks = gtk_type_new (e_tasks_get_type ());
if (!e_tasks_construct (tasks)) {
g_message ("e_tasks_new(): Could not construct the tasks GUI");
- g_object_unref (tasks);
+ gtk_object_unref (GTK_OBJECT (tasks));
return NULL;
}
@@ -306,7 +307,7 @@ e_tasks_destroy (GtkObject *object)
priv = tasks->priv;
if (priv->client) {
- g_object_unref (priv->client);
+ gtk_object_unref (GTK_OBJECT (priv->client));
priv->client = NULL;
}
@@ -527,7 +528,7 @@ e_tasks_new_task (ETasks *tasks)
cal_component_set_categories (comp, category);
comp_editor_edit_comp (COMP_EDITOR (tedit), comp);
- g_object_unref (comp);
+ gtk_object_unref (GTK_OBJECT (comp));
comp_editor_focus (COMP_EDITOR (tedit));
}
@@ -621,9 +622,8 @@ query_eval_error_cb (CalQuery *query, const char *error_str, gpointer data)
set_status_message (tasks, NULL);
- g_signal_handlers_disconnect_matched (priv->query, G_SIGNAL_MATCH_DATA,
- 0, 0, NULL, NULL, tasks);
- g_object_unref (priv->query);
+ gtk_signal_disconnect_by_data (GTK_OBJECT (priv->query), tasks);
+ gtk_object_unref (GTK_OBJECT (priv->query));
priv->query = NULL;
}
@@ -641,9 +641,8 @@ query_query_done_cb (CalQuery *query, CalQueryDoneStatus status, const char *err
set_status_message (tasks, NULL);
- g_signal_handlers_disconnect_matched (priv->query, G_SIGNAL_MATCH_DATA,
- 0, 0, NULL, NULL, tasks);
- g_object_unref (priv->query);
+ gtk_signal_disconnect_by_data (GTK_OBJECT (priv->query), tasks);
+ gtk_object_unref (GTK_OBJECT (priv->query));
priv->query = NULL;
}
/**
@@ -679,9 +678,12 @@ e_tasks_delete_completed (ETasks *tasks)
return;
}
- g_signal_connect (priv->query, "obj_updated", G_CALLBACK (query_obj_updated_cb), tasks);
- g_signal_connect (priv->query, "query_done", G_CALLBACK (query_query_done_cb), tasks);
- g_signal_connect (priv->query, "eval_error", G_CALLBACK (query_eval_error_cb), tasks);
+ gtk_signal_connect (GTK_OBJECT (priv->query), "obj_updated",
+ GTK_SIGNAL_FUNC (query_obj_updated_cb), tasks);
+ gtk_signal_connect (GTK_OBJECT (priv->query), "query_done",
+ GTK_SIGNAL_FUNC (query_query_done_cb), tasks);
+ gtk_signal_connect (GTK_OBJECT (priv->query), "eval_error",
+ GTK_SIGNAL_FUNC (query_eval_error_cb), tasks);
}
/* Callback used from the view collection when we need to display a new view */
@@ -736,7 +738,7 @@ e_tasks_setup_view_menus (ETasks *tasks, BonoboUIComponent *uic)
dir = gnome_util_prepend_user_home ("/evolution/views/tasks/");
gal_view_collection_set_storage_directories (collection,
- EVOLUTION_GALVIEWSDIR "/tasks/",
+ EVOLUTION_DATADIR "/evolution/views/tasks/",
dir);
g_free (dir);
@@ -747,9 +749,9 @@ e_tasks_setup_view_menus (ETasks *tasks, BonoboUIComponent *uic)
EVOLUTION_ETSPECDIR "/e-calendar-table.etspec");
factory = gal_view_factory_etable_new (spec);
- g_object_unref (spec);
+ gtk_object_unref (GTK_OBJECT (spec));
gal_view_collection_add_factory (collection, factory);
- g_object_unref (factory);
+ gtk_object_unref (GTK_OBJECT (factory));
/* Load the collection and create the menus */
@@ -760,7 +762,8 @@ e_tasks_setup_view_menus (ETasks *tasks, BonoboUIComponent *uic)
priv->view_menus = gal_view_menus_new (priv->view_instance);
gal_view_menus_apply (priv->view_menus, uic, NULL);
- g_signal_connect (priv->view_instance, "display_view", G_CALLBACK (display_view_cb), tasks);
+ gtk_signal_connect (GTK_OBJECT (priv->view_instance), "display_view",
+ GTK_SIGNAL_FUNC (display_view_cb), tasks);
display_view_cb (priv->view_instance, gal_view_instance_get_current_view (priv->view_instance), tasks);
}
@@ -787,10 +790,10 @@ e_tasks_discard_view_menus (ETasks *tasks)
g_assert (priv->view_instance != NULL);
g_assert (priv->view_menus != NULL);
- g_object_unref (priv->view_instance);
+ gtk_object_unref (GTK_OBJECT (priv->view_instance));
priv->view_instance = NULL;
- g_object_unref (priv->view_menus);
+ gtk_object_unref (GTK_OBJECT (priv->view_menus));
priv->view_menus = NULL;
}
diff --git a/calendar/gui/e-week-view.c b/calendar/gui/e-week-view.c
index 06d3dfb906..b526e8b9a1 100644
--- a/calendar/gui/e-week-view.c
+++ b/calendar/gui/e-week-view.c
@@ -39,11 +39,13 @@
#include <gtk/gtkvscrollbar.h>
#include <gtk/gtkwindow.h>
#include <gtk/gtkmain.h>
+#include <libgnome/gnome-defs.h>
+#include <libgnome/gnome-i18n.h>
#include <libgnome/gnome-i18n.h>
#include <libgnome/gnome-exec.h>
#include <libgnome/gnome-util.h>
#include <gdk-pixbuf/gdk-pixbuf.h>
-#include <libgnomecanvas/gnome-canvas-pixbuf.h>
+#include <gdk-pixbuf/gnome-canvas-pixbuf.h>
#include <gal/e-text/e-text.h>
#include <gal/widgets/e-canvas-utils.h>
#include <gal/widgets/e-gui-utils.h>
@@ -73,7 +75,10 @@
#include "art/timezone-16.xpm"
#include "art/jump.xpm"
-#define E_WEEK_VIEW_SMALL_FONT_PTSIZE 7
+#define E_WEEK_VIEW_SMALL_FONT \
+ "-adobe-utopia-regular-r-normal-*-*-100-*-*-p-*-iso8859-*"
+#define E_WEEK_VIEW_SMALL_FONT_FALLBACK \
+ "-adobe-helvetica-medium-r-normal-*-*-80-*-*-p-*-iso8859-*"
#define E_WEEK_VIEW_JUMP_BUTTON_WIDTH 16
#define E_WEEK_VIEW_JUMP_BUTTON_HEIGHT 8
@@ -113,6 +118,8 @@ static gint e_week_view_focus_out (GtkWidget *widget,
GdkEventFocus *event);
static gint e_week_view_expose_event (GtkWidget *widget,
GdkEventExpose *event);
+static void e_week_view_draw (GtkWidget *widget,
+ GdkRectangle *area);
static void e_week_view_draw_shadow (EWeekView *week_view);
static gboolean e_week_view_on_button_press (GtkWidget *widget,
@@ -239,8 +246,32 @@ static gboolean e_week_view_layout_timeout_cb (gpointer data);
static GtkTableClass *parent_class;
static GdkAtom clipboard_atom = GDK_NONE;
-E_MAKE_TYPE (e_week_view, "EWeekView", EWeekView, e_week_view_class_init,
- e_week_view_init, GTK_TYPE_TABLE);
+
+GtkType
+e_week_view_get_type (void)
+{
+ static GtkType e_week_view_type = 0;
+
+ if (!e_week_view_type){
+ GtkTypeInfo e_week_view_info = {
+ "EWeekView",
+ sizeof (EWeekView),
+ sizeof (EWeekViewClass),
+ (GtkClassInitFunc) e_week_view_class_init,
+ (GtkObjectInitFunc) e_week_view_init,
+ NULL, /* reserved 1 */
+ NULL, /* reserved 2 */
+ (GtkClassInitFunc) NULL
+ };
+
+ parent_class = gtk_type_class (GTK_TYPE_TABLE);
+ e_week_view_type = gtk_type_unique (GTK_TYPE_TABLE,
+ &e_week_view_info);
+ }
+
+ return e_week_view_type;
+}
+
static void
e_week_view_class_init (EWeekViewClass *class)
@@ -248,18 +279,19 @@ e_week_view_class_init (EWeekViewClass *class)
GtkObjectClass *object_class;
GtkWidgetClass *widget_class;
- parent_class = g_type_class_peek_parent (class);
object_class = (GtkObjectClass *) class;
widget_class = (GtkWidgetClass *) class;
e_week_view_signals[SELECTION_CHANGED] =
gtk_signal_new ("selection_changed",
GTK_RUN_LAST,
- G_TYPE_FROM_CLASS (object_class),
+ object_class->type,
GTK_SIGNAL_OFFSET (EWeekViewClass, selection_changed),
gtk_marshal_NONE__NONE,
GTK_TYPE_NONE, 0);
+ gtk_object_class_add_signals (object_class, e_week_view_signals, LAST_SIGNAL);
+
/* Method override */
object_class->destroy = e_week_view_destroy;
@@ -271,6 +303,7 @@ e_week_view_class_init (EWeekViewClass *class)
widget_class->focus_out_event = e_week_view_focus_out;
widget_class->key_press_event = e_week_view_key_press;
widget_class->expose_event = e_week_view_expose_event;
+ widget_class->draw = e_week_view_draw;
class->selection_changed = NULL;
@@ -333,11 +366,11 @@ e_week_view_init (EWeekView *week_view)
/* Create the small font. */
week_view->use_small_font = TRUE;
-
- week_view->small_font_desc =
- pango_font_description_copy (gtk_widget_get_style (GTK_WIDGET (week_view))->font_desc);
- pango_font_description_set_size (week_view->small_font_desc,
- E_WEEK_VIEW_SMALL_FONT_PTSIZE * PANGO_SCALE);
+ week_view->small_font = gdk_font_load (E_WEEK_VIEW_SMALL_FONT);
+ if (!week_view->small_font)
+ week_view->small_font = gdk_font_load (E_WEEK_VIEW_SMALL_FONT_FALLBACK);
+ if (!week_view->small_font)
+ week_view->use_small_font = FALSE;
/* String to use in 12-hour time format for times in the morning. */
week_view->am_string = _("am");
@@ -379,12 +412,18 @@ e_week_view_init (EWeekView *week_view)
"EWeekViewMainItem::week_view", week_view,
NULL);
- g_signal_connect_after (week_view->main_canvas, "button_press_event",
- G_CALLBACK (e_week_view_on_button_press), week_view);
- g_signal_connect_after (week_view->main_canvas, "button_release_event",
- G_CALLBACK (e_week_view_on_button_release), week_view);
- g_signal_connect_after (week_view->main_canvas, "motion_notify_event",
- G_CALLBACK (e_week_view_on_motion), week_view);
+ gtk_signal_connect_after (GTK_OBJECT (week_view->main_canvas),
+ "button_press_event",
+ GTK_SIGNAL_FUNC (e_week_view_on_button_press),
+ week_view);
+ gtk_signal_connect_after (GTK_OBJECT (week_view->main_canvas),
+ "button_release_event",
+ GTK_SIGNAL_FUNC (e_week_view_on_button_release),
+ week_view);
+ gtk_signal_connect_after (GTK_OBJECT (week_view->main_canvas),
+ "motion_notify_event",
+ GTK_SIGNAL_FUNC (e_week_view_on_motion),
+ week_view);
/* Create the buttons to jump to each days. */
pixbuf = gdk_pixbuf_new_from_xpm_data ((const char**) jump_xpm);
@@ -396,8 +435,10 @@ e_week_view_init (EWeekView *week_view)
"GnomeCanvasPixbuf::pixbuf", pixbuf,
NULL);
- g_signal_connect (week_view->jump_buttons[i], "event",
- G_CALLBACK (e_week_view_on_jump_button_event), week_view);
+ gtk_signal_connect (GTK_OBJECT (week_view->jump_buttons[i]),
+ "event",
+ GTK_SIGNAL_FUNC (e_week_view_on_jump_button_event),
+ week_view);
}
gdk_pixbuf_unref (pixbuf);
@@ -406,7 +447,7 @@ e_week_view_init (EWeekView *week_view)
*/
adjustment = gtk_adjustment_new (0, -52, 52, 1, 1, 1);
gtk_signal_connect (adjustment, "value_changed",
- G_CALLBACK (e_week_view_on_adjustment_changed),
+ GTK_SIGNAL_FUNC (e_week_view_on_adjustment_changed),
week_view);
week_view->vscrollbar = gtk_vscrollbar_new (GTK_ADJUSTMENT (adjustment));
@@ -426,16 +467,22 @@ e_week_view_init (EWeekView *week_view)
clipboard_atom,
GDK_SELECTION_TYPE_STRING,
0);
-
- g_signal_connect (week_view->invisible, "selection_get",
- G_CALLBACK (selection_get), (gpointer) week_view);
- g_signal_connect (week_view->invisible, "selection_clear_event",
- G_CALLBACK (selection_clear_event), (gpointer) week_view);
- g_signal_connect (week_view->invisible, "selection_received",
- G_CALLBACK (selection_received), (gpointer) week_view);
- g_signal_connect (week_view->invisible, "destroy",
- G_CALLBACK (invisible_destroyed), (gpointer) week_view);
-
+ gtk_signal_connect (GTK_OBJECT (week_view->invisible),
+ "selection_get",
+ GTK_SIGNAL_FUNC (selection_get),
+ (gpointer) week_view);
+ gtk_signal_connect (GTK_OBJECT (week_view->invisible),
+ "selection_clear_event",
+ GTK_SIGNAL_FUNC (selection_clear_event),
+ (gpointer) week_view);
+ gtk_signal_connect (GTK_OBJECT (week_view->invisible),
+ "selection_received",
+ GTK_SIGNAL_FUNC (selection_received),
+ (gpointer) week_view);
+ gtk_signal_connect (GTK_OBJECT (week_view->invisible),
+ "destroy",
+ GTK_SIGNAL_FUNC (invisible_destroyed),
+ (gpointer) week_view);
week_view->clipboard_selection = NULL;
week_view->activity = NULL;
@@ -453,7 +500,7 @@ e_week_view_new (void)
{
GtkWidget *week_view;
- week_view = GTK_WIDGET (g_object_new (e_week_view_get_type (), NULL));
+ week_view = GTK_WIDGET (gtk_type_new (e_week_view_get_type ()));
return week_view;
}
@@ -473,8 +520,8 @@ e_week_view_destroy (GtkObject *object)
week_view->events = NULL;
if (week_view->client) {
- g_signal_handlers_disconnect_matched (week_view->client, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, week_view);
- g_object_unref (week_view->client);
+ gtk_signal_disconnect_by_data (GTK_OBJECT (week_view->client), week_view);
+ gtk_object_unref (GTK_OBJECT (week_view->client));
week_view->client = NULL;
}
@@ -484,15 +531,14 @@ e_week_view_destroy (GtkObject *object)
}
if (week_view->query) {
- g_signal_handlers_disconnect_matched (week_view->query, G_SIGNAL_MATCH_DATA,
- 0, 0, NULL, NULL, week_view);
- g_object_unref (week_view->query);
+ gtk_signal_disconnect_by_data (GTK_OBJECT (week_view->query), week_view);
+ gtk_object_unref (GTK_OBJECT (week_view->query));
week_view->query = NULL;
}
- if (week_view->small_font_desc) {
- pango_font_description_free (week_view->small_font_desc);
- week_view->small_font_desc = NULL;
+ if (week_view->small_font) {
+ gdk_font_unref (week_view->small_font);
+ week_view->small_font = NULL;
}
if (week_view->default_category) {
@@ -512,7 +558,7 @@ e_week_view_destroy (GtkObject *object)
}
if (week_view->activity) {
- g_object_unref (week_view->activity);
+ gtk_object_unref (GTK_OBJECT (week_view->activity));
week_view->activity = NULL;
}
@@ -596,6 +642,7 @@ e_week_view_unrealize (GtkWidget *widget)
{
EWeekView *week_view;
GdkColormap *colormap;
+ gint i;
week_view = E_WEEK_VIEW (widget);
@@ -603,7 +650,8 @@ e_week_view_unrealize (GtkWidget *widget)
week_view->main_gc = NULL;
colormap = gtk_widget_get_colormap (widget);
- gdk_colormap_free_colors (colormap, week_view->colors, E_WEEK_VIEW_COLOR_LAST);
+ for (i = 0; i < E_WEEK_VIEW_COLOR_LAST; i++)
+ gdk_colors_free (colormap, &week_view->colors[i].pixel, 1, 0);
gdk_pixmap_unref (week_view->reminder_icon);
week_view->reminder_icon = NULL;
@@ -614,60 +662,25 @@ e_week_view_unrealize (GtkWidget *widget)
(*GTK_WIDGET_CLASS (parent_class)->unrealize)(widget);
}
-static gint
-get_string_width (PangoLayout *layout, const gchar *string)
-{
- gint width;
-
- pango_layout_set_text (layout, string, -1);
- pango_layout_get_pixel_size (layout, &width, NULL);
- return width;
-}
-
-/* FIXME: This is also needed in e-day-view-time-item.c. We should probably use
- * pango's approximation function, but it needs a language tag. Find out how to
- * get one of those properly. */
-static gint
-get_digit_width (PangoLayout *layout)
-{
- gint digit;
- gint max_digit_width = 1;
-
- for (digit = '0'; digit <= '9'; digit++) {
- gchar digit_char;
- gint digit_width;
-
- digit_char = digit;
-
- pango_layout_set_text (layout, &digit_char, 1);
- pango_layout_get_pixel_size (layout, &digit_width, NULL);
-
- max_digit_width = MAX (max_digit_width, digit_width);
- }
-
- return max_digit_width;
-}
static void
e_week_view_style_set (GtkWidget *widget,
- GtkStyle *previous_style)
+ GtkStyle *previous_style)
{
EWeekView *week_view;
+ EWeekViewEventSpan *span;
GdkFont *font;
- GtkStyle *style;
gint day, day_width, max_day_width, max_abbr_day_width;
gint month, month_width, max_month_width, max_abbr_month_width;
+ gint span_num;
GDate date;
gchar buffer[128];
- PangoLayout *layout;
if (GTK_WIDGET_CLASS (parent_class)->style_set)
(*GTK_WIDGET_CLASS (parent_class)->style_set)(widget, previous_style);
week_view = E_WEEK_VIEW (widget);
- style = gtk_widget_get_style (widget);
- font = gtk_style_get_font (style);
- layout = gtk_widget_create_pango_layout (widget, NULL);
+ font = widget->style->font;
/* Recalculate the height of each row based on the font size. */
week_view->row_height = font->ascent + font->descent + E_WEEK_VIEW_EVENT_BORDER_HEIGHT * 2 + E_WEEK_VIEW_EVENT_TEXT_Y_PAD * 2;
@@ -675,8 +688,8 @@ e_week_view_style_set (GtkWidget *widget,
/* Check that the small font is smaller than the default font.
If it isn't, we won't use it. */
- if (week_view->small_font_desc) {
- if (font->ascent + font->descent <= E_WEEK_VIEW_SMALL_FONT_PTSIZE)
+ if (week_view->small_font) {
+ if (font->ascent + font->descent <= week_view->small_font->ascent + week_view->small_font->descent)
week_view->use_small_font = FALSE;
}
@@ -693,12 +706,12 @@ e_week_view_style_set (GtkWidget *widget,
max_abbr_day_width = 0;
for (day = 0; day < 7; day++) {
g_date_strftime (buffer, 128, "%A", &date);
- day_width = get_string_width (layout, buffer);
+ day_width = gdk_string_width (font, buffer);
week_view->day_widths[day] = day_width;
max_day_width = MAX (max_day_width, day_width);
g_date_strftime (buffer, 128, "%a", &date);
- day_width = get_string_width (layout, buffer);
+ day_width = gdk_string_width (font, buffer);
week_view->abbr_day_widths[day] = day_width;
max_abbr_day_width = MAX (max_abbr_day_width, day_width);
@@ -711,36 +724,32 @@ e_week_view_style_set (GtkWidget *widget,
g_date_set_month (&date, month + 1);
g_date_strftime (buffer, 128, "%B", &date);
- month_width = get_string_width (layout, buffer);
+ month_width = gdk_string_width (font, buffer);
week_view->month_widths[month] = month_width;
max_month_width = MAX (max_month_width, month_width);
g_date_strftime (buffer, 128, "%b", &date);
- month_width = get_string_width (layout, buffer);
+ month_width = gdk_string_width (font, buffer);
week_view->abbr_month_widths[month] = month_width;
max_abbr_month_width = MAX (max_abbr_month_width, month_width);
}
- week_view->space_width = get_string_width (layout, " ");
- week_view->colon_width = get_string_width (layout, ":");
- week_view->slash_width = get_string_width (layout, "/");
- week_view->digit_width = get_digit_width (layout);
- if (week_view->small_font_desc) {
- pango_layout_set_font_description (layout, week_view->small_font_desc);
- week_view->small_digit_width = get_digit_width (layout);
- pango_layout_set_font_description (layout, style->font_desc);
- }
+ week_view->space_width = gdk_string_width (font, " ");
+ week_view->colon_width = gdk_string_width (font, ":");
+ week_view->slash_width = gdk_string_width (font, "/");
+ week_view->digit_width = gdk_string_width (font, "5");
+ if (week_view->small_font)
+ week_view->small_digit_width = gdk_string_width (week_view->small_font, "5");
week_view->max_day_width = max_day_width;
week_view->max_abbr_day_width = max_abbr_day_width;
week_view->max_month_width = max_month_width;
week_view->max_abbr_month_width = max_abbr_month_width;
- week_view->am_string_width = get_string_width (layout,
+ week_view->am_string_width = gdk_string_width (font,
week_view->am_string);
- week_view->pm_string_width = get_string_width (layout,
+ week_view->pm_string_width = gdk_string_width (font,
week_view->pm_string);
-#if 0
/* Set the font of all the EText items. */
if (week_view->spans) {
for (span_num = 0; span_num < week_view->spans->len;
@@ -753,9 +762,6 @@ e_week_view_style_set (GtkWidget *widget,
NULL);
}
}
-#endif
-
- g_object_unref (layout);
}
@@ -806,7 +812,6 @@ e_week_view_recalc_cell_sizes (EWeekView *week_view)
gfloat canvas_width, canvas_height, offset;
gint row, col;
GtkWidget *widget;
- GtkStyle *style;
GdkFont *font;
gint width, height, time_width;
@@ -855,13 +860,11 @@ e_week_view_recalc_cell_sizes (EWeekView *week_view)
/* If the font hasn't been set yet just return. */
widget = GTK_WIDGET (week_view);
- style = gtk_widget_get_style (widget);
- if (!style)
- return;
- font = gtk_style_get_font (style);
- if (!font)
+ if (!widget->style || ! widget->style->font)
return;
+ font = widget->style->font;
+
/* Calculate the number of rows of events in each cell, for the large
cells and the compressed weekend cells. */
if (week_view->multi_week_view) {
@@ -894,7 +897,7 @@ e_week_view_recalc_cell_sizes (EWeekView *week_view)
time_width = e_week_view_get_time_string_width (week_view);
week_view->time_format = E_WEEK_VIEW_TIME_NONE;
- if (week_view->use_small_font && week_view->small_font_desc) {
+ if (week_view->use_small_font && week_view->small_font) {
if (week_view->show_event_end_times
&& width / 2 > time_width * 2 + E_WEEK_VIEW_EVENT_TIME_SPACING)
week_view->time_format = E_WEEK_VIEW_TIME_BOTH_SMALL_MIN;
@@ -965,6 +968,22 @@ e_week_view_expose_event (GtkWidget *widget,
return FALSE;
}
+
+static void
+e_week_view_draw (GtkWidget *widget,
+ GdkRectangle *area)
+{
+ EWeekView *week_view;
+
+ week_view = E_WEEK_VIEW (widget);
+
+ e_week_view_draw_shadow (week_view);
+
+ if (GTK_WIDGET_CLASS (parent_class)->draw)
+ (*GTK_WIDGET_CLASS (parent_class)->draw)(widget, area);
+}
+
+
static void
e_week_view_draw_shadow (EWeekView *week_view)
{
@@ -1077,7 +1096,7 @@ query_obj_updated_cb (CalQuery *query, const char *uid,
g_print ("updated object's dates unchanged\n");
#endif
e_week_view_foreach_event_with_uid (week_view, uid, e_week_view_update_event_cb, comp);
- g_object_unref (comp);
+ gtk_object_unref (GTK_OBJECT (comp));
gtk_widget_queue_draw (week_view->main_canvas);
return;
}
@@ -1102,7 +1121,7 @@ query_obj_updated_cb (CalQuery *query, const char *uid,
cal_client_resolve_tzid_cb, week_view->client,
week_view->zone);
- g_object_unref (comp);
+ gtk_object_unref (GTK_OBJECT (comp));
e_week_view_queue_layout (week_view);
}
@@ -1208,9 +1227,8 @@ update_query (EWeekView *week_view)
week_view->query = NULL;
if (old_query) {
- g_signal_handlers_disconnect_matched (old_query, G_SIGNAL_MATCH_DATA,
- 0, 0, NULL, NULL, week_view);
- g_object_unref (old_query);
+ gtk_signal_disconnect_by_data (GTK_OBJECT (old_query), week_view);
+ gtk_object_unref (GTK_OBJECT (old_query));
}
g_assert (week_view->sexp != NULL);
@@ -1229,14 +1247,14 @@ update_query (EWeekView *week_view)
return;
}
- g_signal_connect (week_view->query, "obj_updated",
- G_CALLBACK (query_obj_updated_cb), week_view);
- g_signal_connect (week_view->query, "obj_removed",
- G_CALLBACK (query_obj_removed_cb), week_view);
- g_signal_connect (week_view->query, "query_done",
- G_CALLBACK (query_query_done_cb), week_view);
- g_signal_connect (week_view->query, "eval_error",
- G_CALLBACK (query_eval_error_cb), week_view);
+ gtk_signal_connect (GTK_OBJECT (week_view->query), "obj_updated",
+ GTK_SIGNAL_FUNC (query_obj_updated_cb), week_view);
+ gtk_signal_connect (GTK_OBJECT (week_view->query), "obj_removed",
+ GTK_SIGNAL_FUNC (query_obj_removed_cb), week_view);
+ gtk_signal_connect (GTK_OBJECT (week_view->query), "query_done",
+ GTK_SIGNAL_FUNC (query_query_done_cb), week_view);
+ gtk_signal_connect (GTK_OBJECT (week_view->query), "eval_error",
+ GTK_SIGNAL_FUNC (query_eval_error_cb), week_view);
}
/* Callback used when the calendar client finishes opening */
@@ -1274,11 +1292,11 @@ e_week_view_set_cal_client (EWeekView *week_view,
g_return_if_fail (IS_CAL_CLIENT (client));
if (client)
- g_object_ref (client);
+ gtk_object_ref (GTK_OBJECT (client));
if (week_view->client) {
- g_signal_handlers_disconnect_matched (week_view->client, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, week_view);
- g_object_unref (week_view->client);
+ gtk_signal_disconnect_by_data (GTK_OBJECT (week_view->client), week_view);
+ gtk_object_unref (GTK_OBJECT (week_view->client));
}
week_view->client = client;
@@ -1287,8 +1305,8 @@ e_week_view_set_cal_client (EWeekView *week_view,
if (cal_client_get_load_state (week_view->client) == CAL_CLIENT_LOAD_LOADED)
update_query (week_view);
else
- g_signal_connect (week_view->client, "cal_opened",
- G_CALLBACK (cal_opened_cb), week_view);
+ gtk_signal_connect (GTK_OBJECT (week_view->client), "cal_opened",
+ GTK_SIGNAL_FUNC (cal_opened_cb), week_view);
}
}
@@ -1988,9 +2006,9 @@ e_week_view_update_event_cb (EWeekView *week_view,
event = &g_array_index (week_view->events, EWeekViewEvent, event_num);
- g_object_unref (event->comp);
+ gtk_object_unref (GTK_OBJECT (event->comp));
event->comp = comp;
- g_object_ref (comp);
+ gtk_object_ref (GTK_OBJECT (comp));
for (span_num = 0; span_num < event->num_spans; span_num++) {
span = &g_array_index (week_view->spans, EWeekViewEventSpan,
@@ -2075,7 +2093,7 @@ e_week_view_remove_event_cb (EWeekView *week_view,
}
}
- g_object_unref (event->comp);
+ gtk_object_unref (GTK_OBJECT (event->comp));
g_array_remove_index (week_view->events, event_num);
week_view->events_need_layout = TRUE;
@@ -2420,7 +2438,7 @@ e_week_view_free_events (EWeekView *week_view)
for (event_num = 0; event_num < week_view->events->len; event_num++) {
event = &g_array_index (week_view->events, EWeekViewEvent,
event_num);
- g_object_unref (event->comp);
+ gtk_object_unref (GTK_OBJECT (event->comp));
}
g_array_set_size (week_view->events, 0);
@@ -2487,7 +2505,7 @@ e_week_view_add_event (CalComponent *comp,
week_view->zone);
event.comp = comp;
- g_object_ref (event.comp);
+ gtk_object_ref (GTK_OBJECT (event.comp));
event.start = start;
event.end = end;
event.spans_index = 0;
@@ -2649,7 +2667,7 @@ e_week_view_reshape_event_span (EWeekView *week_view,
span = &g_array_index (week_view->spans, EWeekViewEventSpan,
event->spans_index + span_num);
comp = event->comp;
- font = gtk_style_get_font (gtk_widget_get_style (GTK_WIDGET (week_view)));
+ font = GTK_WIDGET (week_view)->style->font;
one_day_event = e_week_view_is_one_day_event (week_view, event_num);
@@ -2721,20 +2739,20 @@ e_week_view_reshape_event_span (EWeekView *week_view,
span->text_item =
gnome_canvas_item_new (GNOME_CANVAS_GROUP (GNOME_CANVAS (week_view->main_canvas)->root),
e_text_get_type (),
-#if 0
- "font_gdk", font,
-#endif
+ "font_gdk", GTK_WIDGET (week_view)->style->font,
"anchor", GTK_ANCHOR_NW,
"clip", TRUE,
+#if 0
"max_lines", 1,
+#endif
"editable", TRUE,
"text", text.value ? text.value : "",
"use_ellipsis", TRUE,
"fill_color_rgba", GNOME_CANVAS_COLOR(0, 0, 0),
NULL);
- g_signal_connect (span->text_item, "event",
- G_CALLBACK (e_week_view_on_text_item_event),
- week_view);
+ gtk_signal_connect (GTK_OBJECT (span->text_item), "event",
+ GTK_SIGNAL_FUNC (e_week_view_on_text_item_event),
+ week_view);
}
/* Calculate the position of the text item.
@@ -2805,7 +2823,9 @@ e_week_view_reshape_event_span (EWeekView *week_view,
/* Get the width of the text of the event. This is a
bit of a hack. It would be better if EText could
tell us this. */
- g_object_get (G_OBJECT (span->text_item), "text", &text, NULL);
+ gtk_object_get (GTK_OBJECT (span->text_item),
+ "text", &text,
+ NULL);
text_width = 0;
if (text) {
/* It should only have one line of text in it.
@@ -2957,12 +2977,14 @@ e_week_view_start_editing_event (EWeekView *week_view,
e_canvas_item_grab_focus (span->text_item, TRUE);
/* Try to move the cursor to the end of the text. */
- g_object_get (G_OBJECT (span->text_item), "event_processor", &event_processor, NULL);
+ gtk_object_get (GTK_OBJECT (span->text_item),
+ "event_processor", &event_processor,
+ NULL);
if (event_processor) {
command.action = E_TEP_MOVE;
command.position = E_TEP_END_OF_BUFFER;
- g_signal_emit_by_name (event_processor,
- "command", &command);
+ gtk_signal_emit_by_name (GTK_OBJECT (event_processor),
+ "command", &command);
}
}
@@ -3004,7 +3026,9 @@ cancel_editing (EWeekView *week_view)
/* Reset the text to what was in the component */
cal_component_get_summary (event->comp, &summary);
- g_object_set (G_OBJECT (span->text_item), "text", summary.value ? summary.value : "", NULL);
+ gtk_object_set (GTK_OBJECT (span->text_item),
+ "text", summary.value ? summary.value : "",
+ NULL);
/* Stop editing */
e_week_view_stop_editing_event (week_view);
@@ -3014,7 +3038,7 @@ cancel_editing (EWeekView *week_view)
* a pointer to a boolean; will set it to TRUE.
*/
static void
-comp_destroy_cb (gpointer data, GObject *deadbeef)
+comp_destroy_cb (GtkObject *object, gpointer data)
{
gboolean *destroyed;
@@ -3077,17 +3101,19 @@ e_week_view_on_text_item_event (GnomeCanvasItem *item,
if (gdkevent->button.button == 3) {
EWeekViewEvent *e;
gboolean destroyed;
+ int id;
e = &g_array_index (week_view->events, EWeekViewEvent, event_num);
destroyed = FALSE;
- g_object_weak_ref ((GObject *) e->comp, comp_destroy_cb, &destroyed);
+ id = gtk_signal_connect (GTK_OBJECT (e->comp), "destroy",
+ GTK_SIGNAL_FUNC (comp_destroy_cb), &destroyed);
if (!GTK_WIDGET_HAS_FOCUS (week_view))
gtk_widget_grab_focus (GTK_WIDGET (week_view));
if (!destroyed) {
- g_object_weak_unref ((GObject *) e->comp, comp_destroy_cb, &destroyed);
+ gtk_signal_disconnect (GTK_OBJECT (e->comp), id);
e_week_view_set_selected_time_range_visible (week_view, e->start, e->end);
@@ -3226,7 +3252,9 @@ e_week_view_on_editing_stopped (EWeekView *week_view,
if (!uid)
return;
- g_object_get (G_OBJECT (span->text_item), "text", &text, NULL);
+ gtk_object_get (GTK_OBJECT (span->text_item),
+ "text", &text,
+ NULL);
g_assert (text != NULL);
if (string_is_empty (text) && !cal_comp_is_on_server (event->comp, week_view->client)) {
@@ -3457,7 +3485,7 @@ e_week_view_key_press (GtkWidget *widget, GdkEventKey *event)
if (initial_text)
g_free (initial_text);
- g_object_unref (comp);
+ gtk_object_unref (GTK_OBJECT (comp));
return TRUE;
}
@@ -3504,60 +3532,60 @@ enum {
};
static EPopupMenu main_items [] = {
- E_POPUP_ITEM (N_("New _Appointment..."), GTK_SIGNAL_FUNC (e_week_view_on_new_appointment), MASK_EDITABLE),
- E_POPUP_ITEM (N_("New All Day _Event"), GTK_SIGNAL_FUNC (e_week_view_on_new_event), MASK_EDITABLE),
- E_POPUP_ITEM (N_("New Meeting"), GTK_SIGNAL_FUNC (e_week_view_on_new_meeting), MASK_EDITABLE),
- E_POPUP_ITEM (N_("New Task"), GTK_SIGNAL_FUNC (e_week_view_on_new_task), MASK_EDITABLE),
+ E_POPUP_ITEM (N_("New _Appointment..."), e_week_view_on_new_appointment, MASK_EDITABLE),
+ E_POPUP_ITEM (N_("New All Day _Event"), e_week_view_on_new_event, MASK_EDITABLE),
+ E_POPUP_ITEM (N_("New Meeting"), e_week_view_on_new_meeting, MASK_EDITABLE),
+ E_POPUP_ITEM (N_("New Task"), e_week_view_on_new_task, MASK_EDITABLE),
E_POPUP_SEPARATOR,
- E_POPUP_ITEM (N_("_Print..."), GTK_SIGNAL_FUNC (e_week_view_on_print), 0),
+ E_POPUP_ITEM (N_("_Print..."), e_week_view_on_print, 0),
E_POPUP_SEPARATOR,
- E_POPUP_ITEM (N_("_Paste"), GTK_SIGNAL_FUNC (e_week_view_on_paste), MASK_EDITABLE),
+ E_POPUP_ITEM (N_("_Paste"), e_week_view_on_paste, MASK_EDITABLE),
E_POPUP_SEPARATOR,
E_POPUP_SUBMENU (N_("Current View"), NULL, 0),
- E_POPUP_ITEM (N_("Go to _Today"), GTK_SIGNAL_FUNC (e_week_view_on_goto_today), 0),
- E_POPUP_ITEM (N_("_Go to Date..."), GTK_SIGNAL_FUNC (e_week_view_on_goto_date), 0),
+ E_POPUP_ITEM (N_("Go to _Today"), e_week_view_on_goto_today, 0),
+ E_POPUP_ITEM (N_("_Go to Date..."), e_week_view_on_goto_date, 0),
E_POPUP_SEPARATOR,
- E_POPUP_ITEM (N_("_Publish Free/Busy Information"), GTK_SIGNAL_FUNC (e_week_view_on_publish), 0),
+ E_POPUP_ITEM (N_("_Publish Free/Busy Information"), e_week_view_on_publish, 0),
E_POPUP_SEPARATOR,
- E_POPUP_ITEM (N_("_Settings..."), GTK_SIGNAL_FUNC (e_week_view_on_settings), 0),
+ E_POPUP_ITEM (N_("_Settings..."), e_week_view_on_settings, 0),
E_POPUP_TERMINATOR
};
static EPopupMenu child_items [] = {
- E_POPUP_ITEM (N_("_Open"), GTK_SIGNAL_FUNC (e_week_view_on_edit_appointment), MASK_EDITING),
- E_POPUP_ITEM (N_("_Save As..."), GTK_SIGNAL_FUNC (e_week_view_on_save_as), MASK_EDITING),
- E_POPUP_ITEM (N_("_Print..."), GTK_SIGNAL_FUNC (e_week_view_on_print_event), MASK_EDITING),
+ E_POPUP_ITEM (N_("_Open"), e_week_view_on_edit_appointment, MASK_EDITING),
+ E_POPUP_ITEM (N_("_Save As..."), e_week_view_on_save_as, MASK_EDITING),
+ E_POPUP_ITEM (N_("_Print..."), e_week_view_on_print_event, MASK_EDITING),
/* Only show this separator if one of the above is shown. */
E_POPUP_SEPARATOR,
- E_POPUP_ITEM (N_("C_ut"), GTK_SIGNAL_FUNC (e_week_view_on_cut), MASK_EDITING | MASK_EDITABLE | MASK_MEETING_ORGANIZER),
- E_POPUP_ITEM (N_("_Copy"), GTK_SIGNAL_FUNC (e_week_view_on_copy), MASK_EDITING | MASK_MEETING_ORGANIZER),
- E_POPUP_ITEM (N_("_Paste"), GTK_SIGNAL_FUNC (e_week_view_on_paste), MASK_EDITABLE),
+ E_POPUP_ITEM (N_("C_ut"), e_week_view_on_cut, MASK_EDITING | MASK_EDITABLE | MASK_MEETING_ORGANIZER),
+ E_POPUP_ITEM (N_("_Copy"), e_week_view_on_copy, MASK_EDITING | MASK_MEETING_ORGANIZER),
+ E_POPUP_ITEM (N_("_Paste"), e_week_view_on_paste, MASK_EDITABLE),
E_POPUP_SEPARATOR,
- E_POPUP_ITEM (N_("_Schedule Meeting..."), GTK_SIGNAL_FUNC (e_week_view_on_meeting), MASK_EDITABLE | MASK_EDITING | MASK_MEETING),
- E_POPUP_ITEM (N_("_Forward as iCalendar..."), GTK_SIGNAL_FUNC (e_week_view_on_forward), MASK_EDITING),
+ E_POPUP_ITEM (N_("_Schedule Meeting..."), e_week_view_on_meeting, MASK_EDITABLE | MASK_EDITING | MASK_MEETING),
+ E_POPUP_ITEM (N_("_Forward as iCalendar..."), e_week_view_on_forward, MASK_EDITING),
E_POPUP_SEPARATOR,
- E_POPUP_ITEM (N_("_Delete"), GTK_SIGNAL_FUNC (e_week_view_on_delete_appointment), MASK_EDITABLE | MASK_SINGLE | MASK_EDITING),
- E_POPUP_ITEM (N_("Make this Occurrence _Movable"), GTK_SIGNAL_FUNC (e_week_view_on_unrecur_appointment), MASK_RECURRING | MASK_EDITING | MASK_EDITABLE | MASK_INSTANCE),
- E_POPUP_ITEM (N_("Delete this _Occurrence"), GTK_SIGNAL_FUNC (e_week_view_on_delete_occurrence), MASK_RECURRING | MASK_EDITING | MASK_EDITABLE),
- E_POPUP_ITEM (N_("Delete _All Occurrences"), GTK_SIGNAL_FUNC (e_week_view_on_delete_appointment), MASK_RECURRING | MASK_EDITING | MASK_EDITABLE),
+ E_POPUP_ITEM (N_("_Delete"), e_week_view_on_delete_appointment, MASK_EDITABLE | MASK_SINGLE | MASK_EDITING),
+ E_POPUP_ITEM (N_("Make this Occurrence _Movable"), e_week_view_on_unrecur_appointment, MASK_RECURRING | MASK_EDITING | MASK_EDITABLE | MASK_INSTANCE),
+ E_POPUP_ITEM (N_("Delete this _Occurrence"), e_week_view_on_delete_occurrence, MASK_RECURRING | MASK_EDITING | MASK_EDITABLE),
+ E_POPUP_ITEM (N_("Delete _All Occurrences"), e_week_view_on_delete_appointment, MASK_RECURRING | MASK_EDITING | MASK_EDITABLE),
E_POPUP_TERMINATOR
};
@@ -3629,7 +3657,8 @@ e_week_view_show_popup_menu (EWeekView *week_view,
week_view->popup_event_num = event_num;
popup = e_popup_menu_create (context_menu, disable_mask, hide_mask, week_view);
- g_signal_connect (popup, "selection-done", G_CALLBACK (free_view_popup), week_view);
+ gtk_signal_connect (GTK_OBJECT (popup), "selection-done",
+ GTK_SIGNAL_FUNC (free_view_popup), week_view);
e_popup_menu (popup, (GdkEvent *) bevent);
}
@@ -3854,7 +3883,7 @@ e_week_view_on_publish (GtkWidget *widget, gpointer data)
itip_send_comp (CAL_COMPONENT_METHOD_PUBLISH, comp,
week_view->client, NULL);
- g_object_unref (comp);
+ gtk_object_unref (GTK_OBJECT (comp));
}
g_list_free (comp_list);
@@ -3905,7 +3934,7 @@ e_week_view_on_delete_occurrence (GtkWidget *widget, gpointer data)
if (cal_client_update_object (week_view->client, comp) != CAL_CLIENT_RESULT_SUCCESS)
g_message ("e_week_view_on_delete_occurrence(): Could not update the object!");
- g_object_unref (comp);
+ gtk_object_unref (GTK_OBJECT (comp));
}
@@ -4085,12 +4114,12 @@ e_week_view_on_unrecur_appointment (GtkWidget *widget, gpointer data)
if (cal_client_update_object (week_view->client, comp) != CAL_CLIENT_RESULT_SUCCESS)
g_message ("e_week_view_on_unrecur_appointment(): Could not update the object!");
- g_object_unref (comp);
+ gtk_object_unref (GTK_OBJECT (comp));
if (cal_client_update_object (week_view->client, new_comp) != CAL_CLIENT_RESULT_SUCCESS)
g_message ("e_week_view_on_unrecur_appointment(): Could not update the object!");
- g_object_unref (new_comp);
+ gtk_object_unref (GTK_OBJECT (new_comp));
}
@@ -4157,7 +4186,7 @@ e_week_view_get_time_string_width (EWeekView *week_view)
{
gint time_width;
- if (week_view->use_small_font && week_view->small_font_desc)
+ if (week_view->use_small_font && week_view->small_font)
time_width = week_view->digit_width * 2
+ week_view->small_digit_width * 2;
else
@@ -4292,7 +4321,7 @@ selection_received (GtkWidget *invisible,
cal_client_update_object (week_view->client, comp);
g_free (uid);
- g_object_unref (comp);
+ gtk_object_unref (GTK_OBJECT (comp));
}
subcomp = icalcomponent_get_next_component (
icalcomp, ICAL_ANY_COMPONENT);
@@ -4334,7 +4363,7 @@ selection_received (GtkWidget *invisible,
itip_send_comp (CAL_COMPONENT_METHOD_REQUEST, comp, week_view->client, NULL);
g_free (uid);
- g_object_unref (comp);
+ gtk_object_unref (GTK_OBJECT (comp));
}
e_week_view_set_status_message (week_view, NULL);
@@ -4414,7 +4443,7 @@ e_week_view_set_status_message (EWeekView *week_view, const char *message)
if (!message || !*message) {
if (week_view->activity) {
- g_object_unref (week_view->activity);
+ gtk_object_unref (GTK_OBJECT (week_view->activity));
week_view->activity = NULL;
}
}
@@ -4423,7 +4452,7 @@ e_week_view_set_status_message (EWeekView *week_view, const char *message)
char *client_id = g_strdup_printf ("%p", week_view);
if (progress_icon[0] == NULL)
- progress_icon[0] = gdk_pixbuf_new_from_file (EVOLUTION_IMAGESDIR "/" EVOLUTION_CALENDAR_PROGRESS_IMAGE, NULL);
+ progress_icon[0] = gdk_pixbuf_new_from_file (EVOLUTION_IMAGESDIR "/" EVOLUTION_CALENDAR_PROGRESS_IMAGE);
week_view->activity = evolution_activity_client_new (
global_shell_client, client_id,
progress_icon, message, TRUE, &display);
diff --git a/calendar/gui/gnome-cal.c b/calendar/gui/gnome-cal.c
index da2dde2948..a0bed50fc3 100644
--- a/calendar/gui/gnome-cal.c
+++ b/calendar/gui/gnome-cal.c
@@ -29,11 +29,15 @@
#include <sys/wait.h>
#include <fcntl.h>
#include <glib.h>
+#include <libgnome/gnome-defs.h>
#include <libgnome/gnome-i18n.h>
#include <libgnome/gnome-util.h>
#include <libgnomeui/gnome-dialog.h>
#include <libgnomeui/gnome-dialog-util.h>
+#include <liboaf/liboaf.h>
#include <bonobo/bonobo-exception.h>
+#include <gal/e-paned/e-hpaned.h>
+#include <gal/e-paned/e-vpaned.h>
#include "e-util/e-url.h"
#include <cal-util/timeutil.h>
#include "widgets/menus/gal-view-menus.h"
@@ -45,7 +49,7 @@
#include "e-week-view.h"
#include "evolution-calendar.h"
#include "gnome-cal.h"
-#include "calendar-component.h"
+#include "component-factory.h"
#include "cal-search-bar.h"
#include "calendar-commands.h"
#include "calendar-config.h"
@@ -194,8 +198,28 @@ static GtkVBoxClass *parent_class;
-E_MAKE_TYPE (gnome_calendar, "GnomeCalendar", GnomeCalendar, gnome_calendar_class_init,
- gnome_calendar_init, GTK_TYPE_VBOX);
+GtkType
+gnome_calendar_get_type (void)
+{
+ static GtkType gnome_calendar_type = 0;
+
+ if (!gnome_calendar_type) {
+ static const GtkTypeInfo gnome_calendar_info = {
+ "GnomeCalendar",
+ sizeof (GnomeCalendar),
+ sizeof (GnomeCalendarClass),
+ (GtkClassInitFunc) gnome_calendar_class_init,
+ (GtkObjectInitFunc) gnome_calendar_init,
+ NULL, /* reserved_1 */
+ NULL, /* reserved_2 */
+ (GtkClassInitFunc) NULL
+ };
+
+ gnome_calendar_type = gtk_type_unique (GTK_TYPE_VBOX, &gnome_calendar_info);
+ }
+
+ return gnome_calendar_type;
+}
/* Class initialization function for the gnome calendar */
static void
@@ -205,12 +229,12 @@ gnome_calendar_class_init (GnomeCalendarClass *class)
object_class = (GtkObjectClass *) class;
- parent_class = g_type_class_peek_parent (class);
+ parent_class = gtk_type_class (GTK_TYPE_VBOX);
gnome_calendar_signals[DATES_SHOWN_CHANGED] =
gtk_signal_new ("dates_shown_changed",
GTK_RUN_LAST,
- G_TYPE_FROM_CLASS (object_class),
+ object_class->type,
GTK_SIGNAL_OFFSET (GnomeCalendarClass,
dates_shown_changed),
gtk_marshal_NONE__NONE,
@@ -219,7 +243,7 @@ gnome_calendar_class_init (GnomeCalendarClass *class)
gnome_calendar_signals[CALENDAR_SELECTION_CHANGED] =
gtk_signal_new ("calendar_selection_changed",
GTK_RUN_LAST,
- G_TYPE_FROM_CLASS (object_class),
+ object_class->type,
GTK_SIGNAL_OFFSET (GnomeCalendarClass, calendar_selection_changed),
gtk_marshal_NONE__NONE,
GTK_TYPE_NONE, 0);
@@ -227,7 +251,7 @@ gnome_calendar_class_init (GnomeCalendarClass *class)
gnome_calendar_signals[TASKPAD_SELECTION_CHANGED] =
gtk_signal_new ("taskpad_selection_changed",
GTK_RUN_LAST,
- G_TYPE_FROM_CLASS (object_class),
+ object_class->type,
GTK_SIGNAL_OFFSET (GnomeCalendarClass, taskpad_selection_changed),
gtk_marshal_NONE__NONE,
GTK_TYPE_NONE, 0);
@@ -235,7 +259,7 @@ gnome_calendar_class_init (GnomeCalendarClass *class)
gnome_calendar_signals[CALENDAR_FOCUS_CHANGE] =
gtk_signal_new ("calendar_focus_change",
GTK_RUN_FIRST,
- G_TYPE_FROM_CLASS (object_class),
+ object_class->type,
GTK_SIGNAL_OFFSET (GnomeCalendarClass, calendar_focus_change),
gtk_marshal_NONE__BOOL,
GTK_TYPE_NONE, 1,
@@ -244,12 +268,16 @@ gnome_calendar_class_init (GnomeCalendarClass *class)
gnome_calendar_signals[TASKPAD_FOCUS_CHANGE] =
gtk_signal_new ("taskpad_focus_change",
GTK_RUN_FIRST,
- G_TYPE_FROM_CLASS (object_class),
+ object_class->type,
GTK_SIGNAL_OFFSET (GnomeCalendarClass, taskpad_focus_change),
gtk_marshal_NONE__BOOL,
GTK_TYPE_NONE, 1,
GTK_TYPE_BOOL);
+ gtk_object_class_add_signals (object_class,
+ gnome_calendar_signals,
+ LAST_SIGNAL);
+
object_class->destroy = gnome_calendar_destroy;
class->dates_shown_changed = NULL;
@@ -303,9 +331,9 @@ dn_query_obj_updated_cb (CalQuery *query, const char *uid,
return;
}
- tag_calendar_by_comp (priv->date_navigator, comp, priv->client, NULL,
+ tag_calendar_by_comp (priv->date_navigator, comp, priv->client, NULL,
FALSE, TRUE);
- g_object_unref (comp);
+ gtk_object_unref (GTK_OBJECT (comp));
}
/* Callback used when the calendar query reports of a removed object */
@@ -511,9 +539,8 @@ update_query (GnomeCalendar *gcal)
priv->dn_query = NULL;
if (old_query) {
- g_signal_handlers_disconnect_matched (old_query, G_SIGNAL_MATCH_DATA,
- 0, 0, NULL, NULL, gcal);
- g_object_unref (old_query);
+ gtk_signal_disconnect_by_data (GTK_OBJECT (old_query), gcal);
+ gtk_object_unref (GTK_OBJECT (old_query));
}
g_assert (priv->sexp != NULL);
@@ -530,14 +557,14 @@ update_query (GnomeCalendar *gcal)
return;
}
- g_signal_connect (priv->dn_query, "obj_updated",
- G_CALLBACK (dn_query_obj_updated_cb), gcal);
- g_signal_connect (priv->dn_query, "obj_removed",
- G_CALLBACK (dn_query_obj_removed_cb), gcal);
- g_signal_connect (priv->dn_query, "query_done",
- G_CALLBACK (dn_query_query_done_cb), gcal);
- g_signal_connect (priv->dn_query, "eval_error",
- G_CALLBACK (dn_query_eval_error_cb), gcal);
+ gtk_signal_connect (GTK_OBJECT (priv->dn_query), "obj_updated",
+ GTK_SIGNAL_FUNC (dn_query_obj_updated_cb), gcal);
+ gtk_signal_connect (GTK_OBJECT (priv->dn_query), "obj_removed",
+ GTK_SIGNAL_FUNC (dn_query_obj_removed_cb), gcal);
+ gtk_signal_connect (GTK_OBJECT (priv->dn_query), "query_done",
+ GTK_SIGNAL_FUNC (dn_query_query_done_cb), gcal);
+ gtk_signal_connect (GTK_OBJECT (priv->dn_query), "eval_error",
+ GTK_SIGNAL_FUNC (dn_query_eval_error_cb), gcal);
}
/**
@@ -689,25 +716,25 @@ calendar_focus_change_cb (GtkWidget *widget, GdkEventFocus *event, gpointer data
static void
connect_day_view_focus (GnomeCalendar *gcal, EDayView *dv)
{
- g_signal_connect (dv->top_canvas, "focus_in_event",
- G_CALLBACK (calendar_focus_change_cb), gcal);
- g_signal_connect (dv->top_canvas, "focus_out_event",
- G_CALLBACK (calendar_focus_change_cb), gcal);
+ gtk_signal_connect (GTK_OBJECT (dv->top_canvas), "focus_in_event",
+ GTK_SIGNAL_FUNC (calendar_focus_change_cb), gcal);
+ gtk_signal_connect (GTK_OBJECT (dv->top_canvas), "focus_out_event",
+ GTK_SIGNAL_FUNC (calendar_focus_change_cb), gcal);
- g_signal_connect (dv->main_canvas, "focus_in_event",
- G_CALLBACK (calendar_focus_change_cb), gcal);
- g_signal_connect (dv->main_canvas, "focus_out_event",
- G_CALLBACK (calendar_focus_change_cb), gcal);
+ gtk_signal_connect (GTK_OBJECT (dv->main_canvas), "focus_in_event",
+ GTK_SIGNAL_FUNC (calendar_focus_change_cb), gcal);
+ gtk_signal_connect (GTK_OBJECT (dv->main_canvas), "focus_out_event",
+ GTK_SIGNAL_FUNC (calendar_focus_change_cb), gcal);
}
/* Connects to the focus change signals of a week view widget */
static void
connect_week_view_focus (GnomeCalendar *gcal, EWeekView *wv)
{
- g_signal_connect (wv->main_canvas, "focus_in_event",
- G_CALLBACK (calendar_focus_change_cb), gcal);
- g_signal_connect (wv->main_canvas, "focus_out_event",
- G_CALLBACK (calendar_focus_change_cb), gcal);
+ gtk_signal_connect (GTK_OBJECT (wv->main_canvas), "focus_in_event",
+ GTK_SIGNAL_FUNC (calendar_focus_change_cb), gcal);
+ gtk_signal_connect (GTK_OBJECT (wv->main_canvas), "focus_out_event",
+ GTK_SIGNAL_FUNC (calendar_focus_change_cb), gcal);
}
/* Callback used when the selection in the taskpad table changes. We just proxy
@@ -737,17 +764,17 @@ setup_widgets (GnomeCalendar *gcal)
priv = gcal->priv;
priv->search_bar = cal_search_bar_new ();
- g_signal_connect (priv->search_bar, "sexp_changed",
- G_CALLBACK (search_bar_sexp_changed_cb), gcal);
- g_signal_connect (priv->search_bar, "category_changed",
- G_CALLBACK (search_bar_category_changed_cb), gcal);
+ gtk_signal_connect (GTK_OBJECT (priv->search_bar), "sexp_changed",
+ GTK_SIGNAL_FUNC (search_bar_sexp_changed_cb), gcal);
+ gtk_signal_connect (GTK_OBJECT (priv->search_bar), "category_changed",
+ GTK_SIGNAL_FUNC (search_bar_category_changed_cb), gcal);
gtk_widget_show (priv->search_bar);
gtk_box_pack_start (GTK_BOX (gcal), priv->search_bar, FALSE, FALSE, 0);
/* The main HPaned, with the notebook of calendar views on the left
and the ECalendar and ToDo list on the right. */
- priv->hpane = gtk_hpaned_new ();
+ priv->hpane = e_hpaned_new ();
gtk_widget_show (priv->hpane);
gtk_box_pack_start (GTK_BOX (gcal), priv->hpane, TRUE, TRUE, 0);
@@ -756,12 +783,12 @@ setup_widgets (GnomeCalendar *gcal)
gtk_notebook_set_show_border (GTK_NOTEBOOK (priv->notebook), FALSE);
gtk_notebook_set_show_tabs (GTK_NOTEBOOK (priv->notebook), FALSE);
gtk_widget_show (priv->notebook);
- gtk_paned_pack1 (GTK_PANED (priv->hpane), priv->notebook, TRUE, TRUE);
+ e_paned_pack1 (E_PANED (priv->hpane), priv->notebook, TRUE, TRUE);
/* The VPaned widget, to contain the GtkCalendar & ToDo list. */
- priv->vpane = gtk_vpaned_new ();
+ priv->vpane = e_vpaned_new ();
gtk_widget_show (priv->vpane);
- gtk_paned_pack2 (GTK_PANED (priv->hpane), priv->vpane, FALSE, TRUE);
+ e_paned_pack2 (E_PANED (priv->hpane), priv->vpane, FALSE, TRUE);
/* The ECalendar. */
w = e_calendar_new ();
@@ -773,22 +800,30 @@ setup_widgets (GnomeCalendar *gcal)
(ECalendarItemGetTimeCallback) get_current_time,
gcal, NULL);
- gtk_paned_pack1 (GTK_PANED (priv->vpane), w, FALSE, TRUE);
- g_signal_connect (priv->date_navigator, "style_set",
- G_CALLBACK (gnome_calendar_on_date_navigator_style_set), gcal);
- g_signal_connect_after (priv->date_navigator, "size_allocate",
- G_CALLBACK (gnome_calendar_on_date_navigator_size_allocate), gcal);
- g_signal_connect (priv->date_navigator->calitem, "selection_changed",
- G_CALLBACK (gnome_calendar_on_date_navigator_selection_changed), gcal);
- g_signal_connect (priv->date_navigator->calitem, "date_range_changed",
- G_CALLBACK (gnome_calendar_on_date_navigator_date_range_changed), gcal);
+ e_paned_pack1 (E_PANED (priv->vpane), w, FALSE, TRUE);
+ gtk_signal_connect (GTK_OBJECT (priv->date_navigator),
+ "style_set",
+ GTK_SIGNAL_FUNC (gnome_calendar_on_date_navigator_style_set),
+ gcal);
+ gtk_signal_connect_after (GTK_OBJECT (priv->date_navigator),
+ "size_allocate",
+ (GtkSignalFunc) gnome_calendar_on_date_navigator_size_allocate,
+ gcal);
+ gtk_signal_connect (GTK_OBJECT (priv->date_navigator->calitem),
+ "selection_changed",
+ (GtkSignalFunc) gnome_calendar_on_date_navigator_selection_changed,
+ gcal);
+ gtk_signal_connect (GTK_OBJECT (priv->date_navigator->calitem),
+ "date_range_changed",
+ GTK_SIGNAL_FUNC (gnome_calendar_on_date_navigator_date_range_changed),
+ gcal);
/* The ToDo list. */
priv->todo = e_calendar_table_new ();
calendar_config_configure_e_calendar_table (E_CALENDAR_TABLE (priv->todo));
model = e_calendar_table_get_model (E_CALENDAR_TABLE (priv->todo));
calendar_model_set_new_comp_vtype (model, CAL_COMPONENT_TODO);
- gtk_paned_pack2 (GTK_PANED (priv->vpane), priv->todo, TRUE, TRUE);
+ e_paned_pack2 (E_PANED (priv->vpane), priv->todo, TRUE, TRUE);
gtk_widget_show (priv->todo);
filename = g_strdup_printf ("%s/config/TaskPad", evolution_dir);
@@ -796,13 +831,13 @@ setup_widgets (GnomeCalendar *gcal)
g_free (filename);
etable = e_calendar_table_get_table (E_CALENDAR_TABLE (priv->todo));
- g_signal_connect (etable->table_canvas, "focus_in_event",
- G_CALLBACK (table_canvas_focus_change_cb), gcal);
- g_signal_connect (etable->table_canvas, "focus_out_event",
- G_CALLBACK (table_canvas_focus_change_cb), gcal);
+ gtk_signal_connect (GTK_OBJECT (etable->table_canvas), "focus_in_event",
+ GTK_SIGNAL_FUNC (table_canvas_focus_change_cb), gcal);
+ gtk_signal_connect (GTK_OBJECT (etable->table_canvas), "focus_out_event",
+ GTK_SIGNAL_FUNC (table_canvas_focus_change_cb), gcal);
- g_signal_connect (etable, "selection_change",
- G_CALLBACK (table_selection_change_cb), gcal);
+ gtk_signal_connect (GTK_OBJECT (etable), "selection_change",
+ GTK_SIGNAL_FUNC (table_selection_change_cb), gcal);
/* The Day View. */
priv->day_view = e_day_view_new ();
@@ -810,8 +845,8 @@ setup_widgets (GnomeCalendar *gcal)
gtk_widget_show (priv->day_view);
gtk_notebook_append_page (GTK_NOTEBOOK (priv->notebook),
priv->day_view, gtk_label_new (""));
- g_signal_connect (priv->day_view, "selection_changed",
- G_CALLBACK (view_selection_changed_cb), gcal);
+ gtk_signal_connect (GTK_OBJECT (priv->day_view), "selection_changed",
+ GTK_SIGNAL_FUNC (view_selection_changed_cb), gcal);
connect_day_view_focus (gcal, E_DAY_VIEW (priv->day_view));
@@ -824,8 +859,8 @@ setup_widgets (GnomeCalendar *gcal)
gtk_widget_show (priv->work_week_view);
gtk_notebook_append_page (GTK_NOTEBOOK (priv->notebook),
priv->work_week_view, gtk_label_new (""));
- g_signal_connect (priv->work_week_view, "selection_changed",
- G_CALLBACK (view_selection_changed_cb), gcal);
+ gtk_signal_connect (GTK_OBJECT (priv->work_week_view), "selection_changed",
+ GTK_SIGNAL_FUNC (view_selection_changed_cb), gcal);
connect_day_view_focus (gcal, E_DAY_VIEW (priv->work_week_view));
@@ -835,8 +870,8 @@ setup_widgets (GnomeCalendar *gcal)
gtk_widget_show (priv->week_view);
gtk_notebook_append_page (GTK_NOTEBOOK (priv->notebook),
priv->week_view, gtk_label_new (""));
- g_signal_connect (priv->week_view, "selection_changed",
- G_CALLBACK (view_selection_changed_cb), gcal);
+ gtk_signal_connect (GTK_OBJECT (priv->week_view), "selection_changed",
+ GTK_SIGNAL_FUNC (view_selection_changed_cb), gcal);
connect_week_view_focus (gcal, E_WEEK_VIEW (priv->week_view));
@@ -847,8 +882,8 @@ setup_widgets (GnomeCalendar *gcal)
gtk_widget_show (priv->month_view);
gtk_notebook_append_page (GTK_NOTEBOOK (priv->notebook),
priv->month_view, gtk_label_new (""));
- g_signal_connect (priv->month_view, "selection_changed",
- G_CALLBACK (view_selection_changed_cb), gcal);
+ gtk_signal_connect (GTK_OBJECT (priv->month_view), "selection_changed",
+ GTK_SIGNAL_FUNC (view_selection_changed_cb), gcal);
connect_week_view_focus (gcal, E_WEEK_VIEW (priv->month_view));
@@ -925,9 +960,8 @@ gnome_calendar_destroy (GtkObject *object)
g_free (filename);
if (priv->dn_query) {
- g_signal_handlers_disconnect_matched (priv->dn_query, G_SIGNAL_MATCH_DATA,
- 0, 0, NULL, NULL, gcal);
- g_object_unref (priv->dn_query);
+ gtk_signal_disconnect_by_data (GTK_OBJECT (priv->dn_query), gcal);
+ gtk_object_unref (GTK_OBJECT (priv->dn_query));
priv->dn_query = NULL;
}
@@ -937,26 +971,24 @@ gnome_calendar_destroy (GtkObject *object)
}
if (priv->client) {
- g_signal_handlers_disconnect_matched (priv->client, G_SIGNAL_MATCH_DATA,
- 0, 0, NULL, NULL, gcal);
- g_object_unref (priv->client);
+ gtk_signal_disconnect_by_data (GTK_OBJECT (priv->client), gcal);
+ gtk_object_unref (GTK_OBJECT (priv->client));
priv->client = NULL;
}
if (priv->task_pad_client) {
- g_signal_handlers_disconnect_matched (priv->task_pad_client, G_SIGNAL_MATCH_DATA,
- 0, 0, NULL, NULL, gcal);
- g_object_unref (priv->task_pad_client);
+ gtk_signal_disconnect_by_data (GTK_OBJECT (priv->task_pad_client), gcal);
+ gtk_object_unref (GTK_OBJECT (priv->task_pad_client));
priv->task_pad_client = NULL;
}
if (priv->view_instance) {
- g_object_unref (priv->view_instance);
+ gtk_object_unref (GTK_OBJECT (priv->view_instance));
priv->view_instance = NULL;
}
if (priv->view_menus) {
- g_object_unref (priv->view_menus);
+ gtk_object_unref (GTK_OBJECT (priv->view_menus));
priv->view_menus = NULL;
}
@@ -1244,8 +1276,7 @@ set_view (GnomeCalendar *gcal, GnomeCalendarViewType view_type,
updating = TRUE;
gtk_notebook_set_page (GTK_NOTEBOOK (priv->notebook), (int) view_type);
- if (priv->view_instance)
- gal_view_instance_set_current_view_id (priv->view_instance, view_id);
+ gal_view_instance_set_current_view_id (priv->view_instance, view_id);
updating = FALSE;
if (grab_focus)
@@ -1256,9 +1287,9 @@ set_view (GnomeCalendar *gcal, GnomeCalendarViewType view_type,
/* For the week & month views we want the selection in the date
navigator to be rounded to the nearest week when the arrow buttons
are pressed to move to the previous/next month. */
- g_object_set (G_OBJECT (priv->date_navigator->calitem),
- "round_selection_when_moving", round_selection,
- NULL);
+ gtk_object_set (GTK_OBJECT (priv->date_navigator->calitem),
+ "round_selection_when_moving", round_selection,
+ NULL);
}
/**
@@ -1340,9 +1371,9 @@ gnome_calendar_setup_view_menus (GnomeCalendar *gcal, BonoboUIComponent *uic)
gal_view_collection_set_title (collection, _("Calendar"));
- path = gnome_util_prepend_user_home ("/evolution/views/calendar/");
+ path = gnome_util_prepend_user_home ("/evolution/views/calendar/");
gal_view_collection_set_storage_directories (collection,
- EVOLUTION_GALVIEWSDIR "/calendar/",
+ EVOLUTION_DATADIR "/evolution/views/calendar/",
path);
g_free (path);
@@ -1350,26 +1381,25 @@ gnome_calendar_setup_view_menus (GnomeCalendar *gcal, BonoboUIComponent *uic)
factory = calendar_view_factory_new (GNOME_CAL_DAY_VIEW);
gal_view_collection_add_factory (collection, GAL_VIEW_FACTORY (factory));
- g_object_unref (factory);
+ gtk_object_unref (GTK_OBJECT (factory));
factory = calendar_view_factory_new (GNOME_CAL_WORK_WEEK_VIEW);
gal_view_collection_add_factory (collection, GAL_VIEW_FACTORY (factory));
- g_object_unref (factory);
+ gtk_object_unref (GTK_OBJECT (factory));
factory = calendar_view_factory_new (GNOME_CAL_WEEK_VIEW);
gal_view_collection_add_factory (collection, GAL_VIEW_FACTORY (factory));
- g_object_unref (factory);
+ gtk_object_unref (GTK_OBJECT (factory));
factory = calendar_view_factory_new (GNOME_CAL_MONTH_VIEW);
gal_view_collection_add_factory (collection, GAL_VIEW_FACTORY (factory));
- g_object_unref (factory);
+ gtk_object_unref (GTK_OBJECT (factory));
/* Load the collection and create the menus */
gal_view_collection_load (collection);
}
- g_print ("Making GAL view instance.\n");
priv->view_instance = gal_view_instance_new (collection, cal_client_get_uri (priv->client));
priv->view_menus = gal_view_menus_new (priv->view_instance);
@@ -1377,8 +1407,8 @@ gnome_calendar_setup_view_menus (GnomeCalendar *gcal, BonoboUIComponent *uic)
gal_view_menus_apply (priv->view_menus, uic, NULL);
gnome_calendar_set_view (gcal, priv->current_view_type, TRUE, FALSE);
- g_signal_connect (priv->view_instance, "display_view",
- G_CALLBACK (display_view_cb), gcal);
+ gtk_signal_connect (GTK_OBJECT (priv->view_instance), "display_view",
+ GTK_SIGNAL_FUNC (display_view_cb), gcal);
display_view_cb (priv->view_instance, gal_view_instance_get_current_view (priv->view_instance), gcal);
}
@@ -1404,10 +1434,10 @@ gnome_calendar_discard_view_menus (GnomeCalendar *gcal)
g_assert (priv->view_instance != NULL);
g_assert (priv->view_menus != NULL);
- g_object_unref (priv->view_instance);
+ gtk_object_unref (GTK_OBJECT (priv->view_instance));
priv->view_instance = NULL;
- g_object_unref (priv->view_menus);
+ gtk_object_unref (GTK_OBJECT (priv->view_menus));
priv->view_menus = NULL;
}
@@ -1457,10 +1487,10 @@ gnome_calendar_set_pane_positions (GnomeCalendar *gcal)
e_calendar_get_border_size (priv->date_navigator,
&top_border, &bottom_border,
&left_border, &right_border);
- g_object_get (G_OBJECT (priv->date_navigator->calitem),
- "row_height", &row_height,
- "column_width", &col_width,
- NULL);
+ gtk_object_get (GTK_OBJECT (priv->date_navigator->calitem),
+ "row_height", &row_height,
+ "column_width", &col_width,
+ NULL);
if (priv->current_view_type == GNOME_CAL_MONTH_VIEW && !priv->range_selected) {
right_pane_width = priv->hpane_pos_month_view;
@@ -1483,8 +1513,8 @@ gnome_calendar_set_pane_positions (GnomeCalendar *gcal)
top_pane_height = (top_pane_height * (row_height + top_border + bottom_border)
+ 0.5);
- gtk_paned_set_position (GTK_PANED (priv->hpane), -1);
- gtk_paned_set_position (GTK_PANED (priv->vpane), -1);
+ e_paned_set_position (E_PANED (priv->hpane), -1);
+ e_paned_set_position (E_PANED (priv->vpane), -1);
/* We add one to each dimension since we can't use 0. */
@@ -1751,26 +1781,19 @@ backend_died_cb (CalClient *client, gpointer data)
priv = gcal->priv;
uristr = get_uri_without_password (cal_client_get_uri (priv->client));
+
if (client == priv->client) {
message = g_strdup_printf (_("The calendar backend for\n%s\n has crashed. "
"You will have to restart Evolution in order "
"to use it again"),
uristr);
- e_day_view_set_status_message (E_DAY_VIEW (priv->day_view), NULL);
- e_day_view_set_status_message (E_DAY_VIEW (priv->work_week_view), NULL);
- e_week_view_set_status_message (E_WEEK_VIEW (priv->week_view), NULL);
- e_week_view_set_status_message (E_WEEK_VIEW (priv->month_view), NULL);
} else if (client == priv->task_pad_client) {
message = g_strdup_printf (_("The task backend for\n%s\n has crashed. "
"You will have to restart Evolution in order "
"to use it again"),
uristr);
- calendar_model_set_status_message (
- e_calendar_table_get_model (E_CALENDAR_TABLE (priv->todo)), NULL);
- } else {
- message = NULL;
+ } else
g_assert_not_reached ();
- }
gnome_error_dialog_parented (message, GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (gcal))));
g_free (message);
@@ -1796,14 +1819,14 @@ gnome_calendar_construct (GnomeCalendar *gcal)
if (!priv->client)
return NULL;
- g_signal_connect (priv->client, "cal_opened",
- G_CALLBACK (client_cal_opened_cb), gcal);
- g_signal_connect (priv->client, "backend_error",
- G_CALLBACK (backend_error_cb), gcal);
- g_signal_connect (priv->client, "categories_changed",
- G_CALLBACK (client_categories_changed_cb), gcal);
- g_signal_connect (priv->client, "backend_died",
- G_CALLBACK (backend_died_cb), gcal);
+ gtk_signal_connect (GTK_OBJECT (priv->client), "cal_opened",
+ GTK_SIGNAL_FUNC (client_cal_opened_cb), gcal);
+ gtk_signal_connect (GTK_OBJECT (priv->client), "backend_error",
+ GTK_SIGNAL_FUNC (backend_error_cb), gcal);
+ gtk_signal_connect (GTK_OBJECT (priv->client), "categories_changed",
+ GTK_SIGNAL_FUNC (client_categories_changed_cb), gcal);
+ gtk_signal_connect (GTK_OBJECT (priv->client), "backend_died",
+ GTK_SIGNAL_FUNC (backend_died_cb), gcal);
e_day_view_set_cal_client (E_DAY_VIEW (priv->day_view),
priv->client);
@@ -1821,14 +1844,14 @@ gnome_calendar_construct (GnomeCalendar *gcal)
if (!priv->task_pad_client)
return NULL;
- g_signal_connect (priv->task_pad_client, "cal_opened",
- G_CALLBACK (client_cal_opened_cb), gcal);
- g_signal_connect (priv->task_pad_client, "backend_error",
- G_CALLBACK (backend_error_cb), gcal);
- g_signal_connect (priv->task_pad_client, "categories_changed",
- G_CALLBACK (client_categories_changed_cb), gcal);
- g_signal_connect (priv->task_pad_client, "backend_died",
- G_CALLBACK (backend_died_cb), gcal);
+ gtk_signal_connect (GTK_OBJECT (priv->task_pad_client), "cal_opened",
+ GTK_SIGNAL_FUNC (client_cal_opened_cb), gcal);
+ gtk_signal_connect (GTK_OBJECT (priv->task_pad_client), "backend_error",
+ GTK_SIGNAL_FUNC (backend_error_cb), gcal);
+ gtk_signal_connect (GTK_OBJECT (priv->task_pad_client), "categories_changed",
+ GTK_SIGNAL_FUNC (client_categories_changed_cb), gcal);
+ gtk_signal_connect (GTK_OBJECT (priv->task_pad_client), "backend_died",
+ GTK_SIGNAL_FUNC (backend_died_cb), gcal);
model = e_calendar_table_get_model (E_CALENDAR_TABLE (priv->todo));
g_assert (model != NULL);
@@ -1850,11 +1873,11 @@ gnome_calendar_new (void)
{
GnomeCalendar *gcal;
- gcal = g_object_new (gnome_calendar_get_type (), NULL);
+ gcal = gtk_type_new (gnome_calendar_get_type ());
if (!gnome_calendar_construct (gcal)) {
g_message ("gnome_calendar_new(): Could not construct the calendar GUI");
- g_object_unref (gcal);
+ gtk_object_unref (GTK_OBJECT (gcal));
return NULL;
}
@@ -1924,7 +1947,7 @@ add_alarms (const char *uri)
/* Activate the alarm notification service */
CORBA_exception_init (&ev);
- an = bonobo_activation_activate_from_id ("OAFIID:GNOME_Evolution_Calendar_AlarmNotify", 0, NULL, &ev);
+ an = oaf_activate_from_id ("OAFIID:GNOME_Evolution_Calendar_AlarmNotify", 0, NULL, &ev);
if (BONOBO_EX (&ev)) {
g_warning ("add_alarms(): Could not activate the alarm notification service: %s",
@@ -1969,7 +1992,7 @@ gnome_calendar_open (GnomeCalendar *gcal, const char *str_uri)
EUri *uri;
char *message;
char *real_uri;
- char *urinopwd;
+ char *uri_nopwd;
g_return_val_if_fail (gcal != NULL, FALSE);
g_return_val_if_fail (GNOME_IS_CALENDAR (gcal), FALSE);
@@ -1991,14 +2014,14 @@ gnome_calendar_open (GnomeCalendar *gcal, const char *str_uri)
else
real_uri = g_strdup (str_uri);
- urinopwd = get_uri_without_password (real_uri);
- message = g_strdup_printf (_("Opening calendar at %s"), urinopwd);
- g_free (urinopwd);
+ uri_nopwd = get_uri_without_password (real_uri);
+ message = g_strdup_printf (_("Opening calendar at %s"), uri_nopwd);
+ g_free (uri_nopwd);
e_week_view_set_status_message (E_WEEK_VIEW (priv->week_view), message);
g_free (message);
if (!cal_client_open_calendar (priv->client, real_uri, FALSE)) {
- g_message ("gnome_calendar_open(): Could not issue the request to open the calendar folder");
+ g_message ("gnome_calendar_open(): Could not issue the request");
g_free (real_uri);
e_uri_free (uri);
e_week_view_set_status_message (E_WEEK_VIEW (priv->week_view), NULL);
@@ -2041,7 +2064,7 @@ gnome_calendar_open (GnomeCalendar *gcal, const char *str_uri)
e_uri_free (uri);
if (!success) {
- g_message ("gnome_calendar_open(): Could not issue the request to open the tasks folder");
+ g_message ("gnome_calendar_open(): Could not issue the request");
calendar_model_set_status_message (
e_calendar_table_get_model (E_CALENDAR_TABLE (priv->todo)), NULL);
return FALSE;
@@ -2084,9 +2107,9 @@ gnome_calendar_update_config_settings (GnomeCalendar *gcal,
week_start_day = (week_start_day + 6) % 7;
e_day_view_set_week_start_day (E_DAY_VIEW (priv->day_view),
- week_start_day);
+ week_start_day);
e_day_view_set_week_start_day (E_DAY_VIEW (priv->work_week_view),
- week_start_day);
+ week_start_day);
e_week_view_set_week_start_day (E_WEEK_VIEW (priv->week_view),
week_start_day);
e_week_view_set_week_start_day (E_WEEK_VIEW (priv->month_view),
@@ -2324,7 +2347,7 @@ gnome_calendar_new_appointment_for (GnomeCalendar *cal,
cal_component_commit_sequence (comp);
gnome_calendar_edit_object (cal, comp, meeting);
- g_object_unref (comp);
+ gtk_object_unref (GTK_OBJECT (comp));
}
/**
@@ -2374,7 +2397,7 @@ gnome_calendar_new_task (GnomeCalendar *gcal)
cal_component_set_categories (comp, category);
comp_editor_edit_comp (COMP_EDITOR (tedit), comp);
- g_object_unref (comp);
+ gtk_object_unref (GTK_OBJECT (comp));
comp_editor_focus (COMP_EDITOR (tedit));
}
@@ -2650,10 +2673,10 @@ gnome_calendar_update_paned_quanta (GnomeCalendar *gcal)
e_calendar_get_border_size (priv->date_navigator,
&top_border, &bottom_border,
&left_border, &right_border);
- g_object_get (G_OBJECT (priv->date_navigator->calitem),
- "row_height", &row_height,
- "column_width", &col_width,
- NULL);
+ gtk_object_get (GTK_OBJECT (priv->date_navigator->calitem),
+ "row_height", &row_height,
+ "column_width", &col_width,
+ NULL);
/* The EPaned quantum feature works better if we add on the calendar
borders to the quantum size. Otherwise if you shrink the date
@@ -2667,9 +2690,13 @@ gnome_calendar_update_paned_quanta (GnomeCalendar *gcal)
months as will fit. But for that to work nicely the EPaned should
resize the widgets as the bar is dragged. Otherwise the user has
to mess around to get the number of months that they want. */
-#if 0
- g_object_set (G_OBJECT (priv->hpane), "quantum", (guint) col_width, NULL);
- g_object_set (G_OBJECT (priv->vpane), "quantum", (guint) row_height, NULL);
+#if 1
+ gtk_object_set (GTK_OBJECT (priv->hpane),
+ "quantum", (guint) col_width,
+ NULL);
+ gtk_object_set (GTK_OBJECT (priv->vpane),
+ "quantum", (guint) row_height,
+ NULL);
#endif
gnome_calendar_set_pane_positions (gcal);
@@ -2693,10 +2720,10 @@ gnome_calendar_on_date_navigator_size_allocate (GtkWidget *widget,
e_calendar_get_border_size (priv->date_navigator,
&top_border, &bottom_border,
&left_border, &right_border);
- g_object_get (G_OBJECT (priv->date_navigator->calitem),
- "row_height", &row_height,
- "column_width", &col_width,
- NULL);
+ gtk_object_get (GTK_OBJECT (priv->date_navigator->calitem),
+ "row_height", &row_height,
+ "column_width", &col_width,
+ NULL);
/* We subtract one from each dimension since we added 1 in
set_view(). */
diff --git a/calendar/gui/itip-control-factory.c b/calendar/gui/itip-control-factory.c
new file mode 100644
index 0000000000..a6fb081b47
--- /dev/null
+++ b/calendar/gui/itip-control-factory.c
@@ -0,0 +1,282 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+/* Evolution calendar - Control for displaying iTIP mail messages
+ *
+ * Copyright (C) 2000 Ximian, Inc.
+ * Copyright (C) 2000 Ximian, Inc.
+ *
+ * Author: Jesse Pavel <jpavel@ximian.com>
+ *
+ * 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.
+ */
+
+#include <config.h>
+#include <glib.h>
+#include <gtk/gtkobject.h>
+#include <gtk/gtkwidget.h>
+#include <bonobo/bonobo-generic-factory.h>
+#include <bonobo/bonobo-control.h>
+#include <bonobo/bonobo-property-bag.h>
+#include <bonobo/bonobo-persist-stream.h>
+#include <bonobo/bonobo-stream-client.h>
+#include <bonobo/bonobo-context.h>
+#include <bonobo/bonobo-exception.h>
+#include <ical.h>
+
+#include "e-itip-control.h"
+#include "itip-control-factory.h"
+
+extern gchar *evolution_dir;
+
+enum E_ITIP_BONOBO_ARGS {
+ FROM_ADDRESS_ARG_ID,
+ VIEW_ONLY_ARG_ID
+};
+
+/*
+ * Bonobo::PersistStream
+ *
+ * These two functions implement the Bonobo::PersistStream load and
+ * save methods which allow data to be loaded into and out of the
+ * BonoboObject.
+ */
+
+static char *
+stream_read (Bonobo_Stream stream)
+{
+ Bonobo_Stream_iobuf *buffer;
+ CORBA_Environment ev;
+ gchar *data = NULL;
+ gint length = 0;
+
+ CORBA_exception_init (&ev);
+ do {
+#define READ_CHUNK_SIZE 65536
+ Bonobo_Stream_read (stream, READ_CHUNK_SIZE,
+ &buffer, &ev);
+
+ if (BONOBO_EX (&ev)) {
+ CORBA_exception_free (&ev);
+ return NULL;
+ }
+
+ if (buffer->_length <= 0)
+ break;
+
+ data = g_realloc (data, length + buffer->_length + 1);
+ memcpy (data + length, buffer->_buffer, buffer->_length);
+ length += buffer->_length;
+ data[length] = '\0';
+
+ CORBA_free (buffer);
+#undef READ_CHUNK_SIZE
+ } while (1);
+
+ CORBA_free (buffer);
+ CORBA_exception_free (&ev);
+
+ if (data == NULL)
+ data = g_strdup("");
+
+ return data;
+} /* stream_read */
+
+/*
+ * This function implements the Bonobo::PersistStream:load method.
+ */
+typedef struct {
+ EItipControl *itip;
+ char *text;
+} idle_data;
+
+static gboolean
+set_data_idle_cb (gpointer data)
+{
+ idle_data *id = data;
+
+ e_itip_control_set_data (id->itip, id->text);
+ gtk_object_unref (GTK_OBJECT (id->itip));
+ g_free (id->text);
+ g_free (id);
+
+ return FALSE;
+}
+
+static void
+pstream_load (BonoboPersistStream *ps, const Bonobo_Stream stream,
+ Bonobo_Persist_ContentType type, void *data,
+ CORBA_Environment *ev)
+{
+ EItipControl *itip = data;
+ idle_data *id;
+
+ if (type && g_strcasecmp (type, "text/calendar") != 0 &&
+ g_strcasecmp (type, "text/x-calendar") != 0) {
+ bonobo_exception_set (ev, ex_Bonobo_Persist_WrongDataType);
+ return;
+ }
+
+ id = g_new0 (idle_data, 1);
+ if ((id->text = stream_read (stream)) == NULL) {
+ bonobo_exception_set (ev, ex_Bonobo_Persist_FileNotFound);
+ g_free (id);
+ return;
+ }
+ gtk_object_ref (GTK_OBJECT (itip));
+ id->itip = itip;
+
+ g_idle_add (set_data_idle_cb, id);
+}
+/*
+ * This function implements the Bonobo::PersistStream:save method.
+ */
+static void
+pstream_save (BonoboPersistStream *ps, const Bonobo_Stream stream,
+ Bonobo_Persist_ContentType type, void *data,
+ CORBA_Environment *ev)
+{
+ EItipControl *itip = data;
+ gchar *text;
+ gint len;
+
+ if (type && g_strcasecmp (type, "text/calendar") != 0 &&
+ g_strcasecmp (type, "text/x-calendar") != 0) {
+ bonobo_exception_set (ev, ex_Bonobo_Persist_WrongDataType);
+ return;
+ }
+
+ text = e_itip_control_get_data (itip);
+ len = e_itip_control_get_data_size (itip);
+
+ bonobo_stream_client_write (stream, text, len, ev);
+ g_free (text);
+} /* pstream_save */
+
+static CORBA_long
+pstream_get_max_size (BonoboPersistStream *ps, void *data,
+ CORBA_Environment *ev)
+{
+ EItipControl *itip = data;
+ gint len;
+
+ len = e_itip_control_get_data_size (itip);
+
+ if (len > 0)
+ return len;
+
+ return 0L;
+}
+
+static Bonobo_Persist_ContentTypeList *
+pstream_get_content_types (BonoboPersistStream *ps, void *closure,
+ CORBA_Environment *ev)
+{
+ return bonobo_persist_generate_content_types (2, "text/calendar", "text/x-calendar");
+}
+
+static void
+get_prop (BonoboPropertyBag *bag,
+ BonoboArg *arg,
+ guint arg_id,
+ CORBA_Environment *ev,
+ gpointer user_data)
+{
+ EItipControl *itip = user_data;
+
+ switch (arg_id) {
+ case FROM_ADDRESS_ARG_ID:
+ BONOBO_ARG_SET_STRING (arg, e_itip_control_get_from_address (itip));
+ break;
+ case VIEW_ONLY_ARG_ID:
+ BONOBO_ARG_SET_BOOLEAN (arg, e_itip_control_get_view_only (itip));
+ break;
+ }
+}
+
+static void
+set_prop ( BonoboPropertyBag *bag,
+ const BonoboArg *arg,
+ guint arg_id,
+ CORBA_Environment *ev,
+ gpointer user_data)
+{
+ EItipControl *itip = user_data;
+
+ switch (arg_id) {
+ case FROM_ADDRESS_ARG_ID:
+ e_itip_control_set_from_address (itip, BONOBO_ARG_GET_STRING (arg));
+ break;
+ case VIEW_ONLY_ARG_ID:
+ e_itip_control_set_view_only (itip, BONOBO_ARG_GET_BOOLEAN (arg));
+ break;
+ }
+}
+
+
+static BonoboObject *
+itip_control_factory (BonoboGenericFactory *Factory, void *closure)
+{
+ BonoboControl *control;
+ BonoboPropertyBag *prop_bag;
+ BonoboPersistStream *stream;
+ GtkWidget *itip;
+
+ itip = e_itip_control_new ();
+ gtk_widget_show (itip);
+ control = bonobo_control_new (itip);
+
+ /* create a property bag */
+ prop_bag = bonobo_property_bag_new (get_prop, set_prop, itip);
+ bonobo_property_bag_add (prop_bag, "from_address", FROM_ADDRESS_ARG_ID, BONOBO_ARG_STRING, NULL,
+ "from_address", 0 );
+ bonobo_property_bag_add (prop_bag, "view_only", VIEW_ONLY_ARG_ID, BONOBO_ARG_BOOLEAN, NULL,
+ "view_only", 0 );
+
+ bonobo_control_set_properties (control, prop_bag);
+ bonobo_object_unref (BONOBO_OBJECT (prop_bag));
+
+ bonobo_control_set_automerge (control, TRUE);
+
+ stream = bonobo_persist_stream_new (pstream_load, pstream_save,
+ pstream_get_max_size,
+ pstream_get_content_types,
+ itip);
+
+ if (stream == NULL) {
+ bonobo_object_unref (BONOBO_OBJECT (control));
+ return NULL;
+ }
+
+ bonobo_object_add_interface (BONOBO_OBJECT (control),
+ BONOBO_OBJECT (stream));
+
+ return BONOBO_OBJECT (control);
+}
+
+void
+itip_control_factory_init (void)
+{
+ static BonoboGenericFactory *factory = NULL;
+
+ if (factory != NULL)
+ return;
+
+ factory = bonobo_generic_factory_new (
+ "OAFIID:GNOME_Evolution_Calendar_iTip_ControlFactory",
+ itip_control_factory, NULL);
+ bonobo_running_context_auto_exit_unref (BONOBO_OBJECT (factory));;
+
+ if (factory == NULL)
+ g_error ("I could not register an iTip control factory.");
+}
+
diff --git a/calendar/gui/itip-utils.c b/calendar/gui/itip-utils.c
index be94e9fe87..7deb5568f5 100644
--- a/calendar/gui/itip-utils.c
+++ b/calendar/gui/itip-utils.c
@@ -26,15 +26,20 @@
#include <bonobo/bonobo-exception.h>
#include <bonobo/bonobo-object.h>
+#include <bonobo/bonobo-object-client.h>
#include <bonobo/bonobo-moniker-util.h>
+#include <bonobo-conf/bonobo-config-database.h>
+#include <libgnome/gnome-defs.h>
#include <libgnome/gnome-i18n.h>
#include <gtk/gtkwidget.h>
+#include <gal/widgets/e-gui-utils.h>
#include <gal/widgets/e-unicode.h>
+#include <gal/util/e-unicode-i18n.h>
#include <gal/util/e-util.h>
#include <ical.h>
#include <Evolution-Composer.h>
-#include <e-util/e-dialog-utils.h>
#include <e-util/e-time-utils.h>
+#include <e-util/e-config-listener.h>
#include <cal-util/timeutil.h>
#include <cal-util/cal-util.h>
#include "calendar-config.h"
@@ -64,49 +69,130 @@ static icalproperty_method itip_methods_enum[] = {
ICAL_METHOD_DECLINECOUNTER,
};
-static EAccountList *accounts = NULL;
+static EConfigListener *config = NULL;
-EAccountList *
+static ItipAddress *
+get_address (long num)
+{
+ ItipAddress *a;
+ gchar *path;
+
+ a = g_new0 (ItipAddress, 1);
+
+ /* get the identity info */
+ path = g_strdup_printf ("/Mail/Accounts/identity_name_%ld", num);
+ a->name = e_config_listener_get_string_with_default (config, path, NULL, NULL);
+ g_free (path);
+
+ path = g_strdup_printf ("/Mail/Accounts/identity_address_%ld", num);
+ a->address = e_config_listener_get_string_with_default (config, path, NULL, NULL);
+ a->address = g_strstrip (a->address);
+ g_free (path);
+
+ a->full = g_strdup_printf ("%s <%s>", a->name, a->address);
+
+ return a;
+}
+
+GList *
itip_addresses_get (void)
{
- if (accounts == NULL)
- accounts = e_account_list_new(gconf_client_get_default());
+ GList *addresses = NULL;
+ glong len, def, i;
- return accounts;
+ if (config == NULL)
+ config = e_config_listener_new ();
+
+ len = e_config_listener_get_long_with_default (config, "/Mail/Accounts/num", 0, NULL);
+ def = e_config_listener_get_long_with_default (config, "/Mail/Accounts/default_account", 0, NULL);
+
+ for (i = 0; i < len; i++) {
+ ItipAddress *a;
+
+ a = get_address (i);
+ if (i == def)
+ a->default_address = TRUE;
+
+ addresses = g_list_append (addresses, a);
+ }
+
+ return addresses;
}
-EAccount *
+ItipAddress *
itip_addresses_get_default (void)
{
- return (EAccount *)e_account_list_get_default(itip_addresses_get());
+ ItipAddress *a;
+ glong def;
+
+ if (config == NULL)
+ config = e_config_listener_new ();
+
+ def = e_config_listener_get_long_with_default (config, "/Mail/Accounts/default_account", 0, NULL);
+
+ a = get_address (def);
+ a->default_address = TRUE;
+
+ return a;
+}
+
+void
+itip_address_free (ItipAddress *address)
+{
+ g_free (address->name);
+ g_free (address->address);
+ g_free (address->full);
+ g_free (address);
+}
+
+void
+itip_addresses_free (GList *addresses)
+{
+ GList *l;
+
+ for (l = addresses; l != NULL; l = l->next) {
+ ItipAddress *a = l->data;
+ itip_address_free (a);
+ }
+ g_list_free (addresses);
}
gboolean
itip_organizer_is_user (CalComponent *comp, CalClient *client)
{
CalComponentOrganizer organizer;
+ GList *addresses, *l;
const char *strip;
gboolean user_org = FALSE;
-
+
if (!cal_component_has_organizer (comp))
return FALSE;
cal_component_get_organizer (comp, &organizer);
if (organizer.value != NULL) {
- strip = itip_strip_mailto (organizer.value);
-
- if (cal_client_get_static_capability (client, "organizer-not-email-address")) {
- const char *email;
-
- email = cal_client_get_cal_address (client);
- if (email && !g_strcasecmp (email, strip))
- return TRUE;
-
- return FALSE;
- }
-
- user_org = e_account_list_find(itip_addresses_get(), E_ACCOUNT_FIND_ID_ADDRESS, strip) != NULL;
+ strip = itip_strip_mailto (organizer.value);
+
+ if (cal_client_get_static_capability (client, "organizer-not-email-address")) {
+ const char *email;
+
+ email = cal_client_get_cal_address (client);
+ if (email && !g_strcasecmp (email, strip))
+ return TRUE;
+
+ return FALSE;
+ }
+
+ addresses = itip_addresses_get ();
+ for (l = addresses; l != NULL; l = l->next) {
+ ItipAddress *a = l->data;
+
+ if (!g_strcasecmp (a->address, strip)) {
+ user_org = TRUE;
+ break;
+ }
+ }
+ itip_addresses_free (addresses);
}
return user_org;
@@ -116,6 +202,7 @@ gboolean
itip_sentby_is_user (CalComponent *comp)
{
CalComponentOrganizer organizer;
+ GList *addresses, *l;
const char *strip;
gboolean user_sentby = FALSE;
@@ -125,7 +212,17 @@ itip_sentby_is_user (CalComponent *comp)
cal_component_get_organizer (comp, &organizer);
if (organizer.sentby != NULL) {
strip = itip_strip_mailto (organizer.sentby);
- user_sentby = e_account_list_find(itip_addresses_get(), E_ACCOUNT_FIND_ID_ADDRESS, strip) != NULL;
+
+ addresses = itip_addresses_get ();
+ for (l = addresses; l != NULL; l = l->next) {
+ ItipAddress *a = l->data;
+
+ if (!g_strcasecmp (a->address, strip)) {
+ user_sentby = TRUE;
+ break;
+ }
+ }
+ itip_addresses_free (addresses);
}
return user_sentby;
@@ -258,7 +355,7 @@ comp_from (CalComponentItipMethod method, CalComponent *comp)
case CAL_COMPONENT_METHOD_ADD:
cal_component_get_organizer (comp, &organizer);
if (organizer.value == NULL) {
- e_notice (NULL, GTK_MESSAGE_ERROR,
+ e_notice (NULL, GNOME_MESSAGE_BOX_ERROR,
_("An organizer must be set."));
return NULL;
}
@@ -293,7 +390,7 @@ comp_to_list (CalComponentItipMethod method, CalComponent *comp, GList *users)
cal_component_get_attendee_list (comp, &attendees);
len = g_slist_length (attendees);
if (len <= 0) {
- e_notice (NULL, GTK_MESSAGE_ERROR,
+ e_notice (NULL, GNOME_MESSAGE_BOX_ERROR,
_("At least one attendee is necessary"));
cal_component_free_attendee_list (attendees);
return NULL;
@@ -303,22 +400,13 @@ comp_to_list (CalComponentItipMethod method, CalComponent *comp, GList *users)
to_list->_maximum = len;
to_list->_length = 0;
to_list->_buffer = CORBA_sequence_GNOME_Evolution_Composer_Recipient_allocbuf (len);
-
- cal_component_get_organizer (comp, &organizer);
- if (organizer.value == NULL) {
- e_notice (NULL, GTK_MESSAGE_ERROR,
- _("An organizer must be set."));
- return NULL;
- }
-
+
for (l = attendees; l != NULL; l = l->next) {
CalComponentAttendee *att = l->data;
if (users_has_attendee (users, att->value))
continue;
- else if (!g_strcasecmp (att->value, organizer.value))
- continue;
-
+
recipient = &(to_list->_buffer[to_list->_length]);
if (att->cn)
recipient->name = CORBA_string_dup (att->cn);
@@ -338,7 +426,7 @@ comp_to_list (CalComponentItipMethod method, CalComponent *comp, GList *users)
case CAL_COMPONENT_METHOD_DECLINECOUNTER:
cal_component_get_organizer (comp, &organizer);
if (organizer.value == NULL) {
- e_notice (NULL, GTK_MESSAGE_ERROR,
+ e_notice (NULL, GNOME_MESSAGE_BOX_ERROR,
_("An organizer must be set."));
return NULL;
}
@@ -382,15 +470,15 @@ comp_subject (CalComponentItipMethod method, CalComponent *comp)
else {
switch (cal_component_get_vtype (comp)) {
case CAL_COMPONENT_EVENT:
- description = _("Event information");
+ description = U_("Event information");
case CAL_COMPONENT_TODO:
- description = _("Task information");
+ description = U_("Task information");
case CAL_COMPONENT_JOURNAL:
- description = _("Journal information");
+ description = U_("Journal information");
case CAL_COMPONENT_FREEBUSY:
- description = _("Free/Busy information");
+ description = U_("Free/Busy information");
default:
- description = _("Calendar information");
+ description = U_("Calendar information");
}
}
@@ -410,13 +498,13 @@ comp_subject (CalComponentItipMethod method, CalComponent *comp)
switch (a->status) {
case ICAL_PARTSTAT_ACCEPTED:
- prefix = _("Accepted");
+ prefix = U_("Accepted");
break;
case ICAL_PARTSTAT_TENTATIVE:
- prefix = _("Tentatively Accepted");
+ prefix = U_("Tentatively Accepted");
break;
case ICAL_PARTSTAT_DECLINED:
- prefix = _("Declined");
+ prefix = U_("Declined");
break;
default:
break;
@@ -426,23 +514,23 @@ comp_subject (CalComponentItipMethod method, CalComponent *comp)
break;
case CAL_COMPONENT_METHOD_ADD:
- prefix = _("Updated");
+ prefix = U_("Updated");
break;
case CAL_COMPONENT_METHOD_CANCEL:
- prefix = _("Cancel");
+ prefix = U_("Cancel");
break;
case CAL_COMPONENT_METHOD_REFRESH:
- prefix = _("Refresh");
+ prefix = U_("Refresh");
break;
case CAL_COMPONENT_METHOD_COUNTER:
- prefix = _("Counter-proposal");
+ prefix = U_("Counter-proposal");
break;
case CAL_COMPONENT_METHOD_DECLINECOUNTER:
- prefix = _("Declined");
+ prefix = U_("Declined");
break;
default:
@@ -491,11 +579,11 @@ comp_description (CalComponent *comp)
switch (cal_component_get_vtype (comp)) {
case CAL_COMPONENT_EVENT:
- return CORBA_string_dup (_("Event information"));
+ return CORBA_string_dup (U_("Event information"));
case CAL_COMPONENT_TODO:
- return CORBA_string_dup (_("Task information"));
+ return CORBA_string_dup (U_("Task information"));
case CAL_COMPONENT_JOURNAL:
- return CORBA_string_dup (_("Journal information"));
+ return CORBA_string_dup (U_("Journal information"));
case CAL_COMPONENT_FREEBUSY:
cal_component_get_dtstart (comp, &dt);
if (dt.value)
@@ -510,18 +598,18 @@ comp_description (CalComponent *comp)
if (start != NULL && end != NULL) {
char *tmp, *tmp_utf;
tmp = g_strdup_printf (_("Free/Busy information (%s to %s)"), start, end);
- tmp_utf = g_locale_to_utf8 (tmp, -1, NULL, NULL, NULL);
+ tmp_utf = e_utf8_from_locale_string (tmp);
description = CORBA_string_dup (tmp_utf);
g_free (tmp_utf);
g_free (tmp);
} else {
- description = CORBA_string_dup (_("Free/Busy information"));
+ description = CORBA_string_dup (U_("Free/Busy information"));
}
g_free (start);
g_free (end);
return description;
default:
- return CORBA_string_dup (_("iCalendar information"));
+ return CORBA_string_dup (U_("iCalendar information"));
}
}
@@ -547,7 +635,7 @@ comp_server_send (CalComponentItipMethod method, CalComponent *comp, CalClient *
retval = TRUE;
} else if (result == CAL_CLIENT_SEND_BUSY) {
- e_notice (NULL, GTK_MESSAGE_ERROR, error_msg);
+ e_notice (NULL, GNOME_MESSAGE_BOX_ERROR, error_msg);
retval = FALSE;
}
@@ -561,11 +649,13 @@ static gboolean
comp_limit_attendees (CalComponent *comp)
{
icalcomponent *icomp;
+ GList *addresses;
icalproperty *prop;
gboolean found = FALSE, match = FALSE;
GSList *l, *list = NULL;
icomp = cal_component_get_icalcomponent (comp);
+ addresses = itip_addresses_get ();
for (prop = icalcomponent_get_first_property (icomp, ICAL_ATTENDEE_PROPERTY);
prop != NULL;
@@ -574,6 +664,7 @@ comp_limit_attendees (CalComponent *comp)
icalvalue *value;
const char *attendee;
char *text;
+ GList *l;
/* If we've already found something, just erase the rest */
if (found) {
@@ -589,7 +680,12 @@ comp_limit_attendees (CalComponent *comp)
text = g_strdup (itip_strip_mailto (attendee));
text = g_strstrip (text);
- found = match = e_account_list_find(itip_addresses_get(), E_ACCOUNT_FIND_ID_ADDRESS, text) != NULL;
+ for (l = addresses; l != NULL; l = l->next) {
+ ItipAddress *a = l->data;
+
+ if (!g_strcasecmp (a->address, text))
+ found = match = TRUE;
+ }
g_free (text);
if (!match)
@@ -605,6 +701,8 @@ comp_limit_attendees (CalComponent *comp)
}
g_slist_free (list);
+ itip_addresses_free (addresses);
+
return found;
}
@@ -615,25 +713,25 @@ comp_sentby (CalComponent *comp, CalClient *client)
cal_component_get_organizer (comp, &organizer);
if (!organizer.value) {
- EAccount *a = itip_addresses_get_default ();
+ ItipAddress *a = itip_addresses_get_default ();
- organizer.value = g_strdup_printf ("MAILTO:%s", a->id->address);
+ organizer.value = g_strdup_printf ("MAILTO:%s", a->address);
organizer.sentby = NULL;
- organizer.cn = a->id->name;
+ organizer.cn = a->name;
organizer.language = NULL;
cal_component_set_organizer (comp, &organizer);
g_free ((char *) organizer.value);
- g_object_unref(a);
+ itip_address_free (a);
return;
}
if (!itip_organizer_is_user (comp, client) && !itip_sentby_is_user (comp)) {
- EAccount *a = itip_addresses_get_default ();
+ ItipAddress *a = itip_addresses_get_default ();
organizer.value = g_strdup (organizer.value);
- organizer.sentby = g_strdup_printf ("MAILTO:%s", a->id->address);
+ organizer.sentby = g_strdup_printf ("MAILTO:%s", a->address);
organizer.cn = g_strdup (organizer.cn);
organizer.language = g_strdup (organizer.language);
@@ -643,7 +741,7 @@ comp_sentby (CalComponent *comp, CalClient *client)
g_free ((char *)organizer.sentby);
g_free ((char *)organizer.cn);
g_free ((char *)organizer.language);
- g_object_unref(a);
+ itip_address_free (a);
}
}
static CalComponent *
@@ -668,7 +766,7 @@ comp_minimal (CalComponent *comp, gboolean attendee)
cal_component_set_attendee_list (clone, attendees);
if (!comp_limit_attendees (clone)) {
- e_notice (NULL, GTK_MESSAGE_ERROR,
+ e_notice (NULL, GNOME_MESSAGE_BOX_ERROR,
_("You must be an attendee of the event."));
goto error;
}
@@ -719,7 +817,7 @@ comp_minimal (CalComponent *comp, gboolean attendee)
return clone;
error:
- g_object_unref (clone);
+ gtk_object_unref (GTK_OBJECT (clone));
return NULL;
}
@@ -804,7 +902,7 @@ comp_compliant (CalComponentItipMethod method, CalComponent *comp, CalClient *cl
case CAL_COMPONENT_METHOD_REFRESH:
/* Need to remove almost everything */
temp_clone = comp_minimal (clone, TRUE);
- g_object_unref (clone);
+ gtk_object_unref (GTK_OBJECT (clone));
clone = temp_clone;
break;
case CAL_COMPONENT_METHOD_COUNTER:
@@ -812,7 +910,7 @@ comp_compliant (CalComponentItipMethod method, CalComponent *comp, CalClient *cl
case CAL_COMPONENT_METHOD_DECLINECOUNTER:
/* Need to remove almost everything */
temp_clone = comp_minimal (clone, FALSE);
- g_object_unref (clone);
+ gtk_object_unref (GTK_OBJECT (clone));
clone = temp_clone;
break;
default:
@@ -826,7 +924,8 @@ gboolean
itip_send_comp (CalComponentItipMethod method, CalComponent *send_comp,
CalClient *client, icalcomponent *zones)
{
- CORBA_Object *composer_server;
+ BonoboObjectClient *bonobo_server;
+ GNOME_Evolution_Composer composer_server;
CalComponent *comp = NULL;
icalcomponent *top_level = NULL;
GList *users;
@@ -843,12 +942,9 @@ itip_send_comp (CalComponentItipMethod method, CalComponent *send_comp,
CORBA_exception_init (&ev);
/* Obtain an object reference for the Composer. */
- composer_server = bonobo_activation_activate_from_id (GNOME_EVOLUTION_COMPOSER_OAFIID, 0, NULL, &ev);
- if (BONOBO_EX (&ev)) {
- g_warning ("Could not activate composer: %s", bonobo_exception_get_text (&ev));
- CORBA_exception_free (&ev);
- return FALSE;
- }
+ bonobo_server = bonobo_object_activate (GNOME_EVOLUTION_COMPOSER_OAFIID, 0);
+ g_return_val_if_fail (bonobo_server != NULL, FALSE);
+ composer_server = BONOBO_OBJREF (bonobo_server);
/* Give the server a chance to manipulate the comp */
if (method != CAL_COMPONENT_METHOD_PUBLISH) {
@@ -884,9 +980,8 @@ itip_send_comp (CalComponentItipMethod method, CalComponent *send_comp,
/* Set recipients, subject */
GNOME_Evolution_Composer_setHeaders (composer_server, from, to_list, cc_list, bcc_list, subject, &ev);
- if (BONOBO_EX (&ev)) {
- g_warning ("Unable to set composer headers while sending iTip message: %s",
- bonobo_exception_get_text (&ev));
+ if (BONOBO_EX (&ev)) {
+ g_warning ("Unable to set composer headers while sending iTip message");
goto cleanup;
}
@@ -950,7 +1045,7 @@ itip_send_comp (CalComponentItipMethod method, CalComponent *send_comp,
CORBA_exception_free (&ev);
if (comp != NULL)
- g_object_unref (comp);
+ gtk_object_unref (GTK_OBJECT (comp));
if (top_level != NULL)
icalcomponent_free (top_level);
diff --git a/calendar/gui/itip-utils.h b/calendar/gui/itip-utils.h
index c73f11673c..e4826d6a56 100644
--- a/calendar/gui/itip-utils.h
+++ b/calendar/gui/itip-utils.h
@@ -7,7 +7,6 @@
#include <glib.h>
#include <cal-client/cal-client.h>
#include <cal-util/cal-component.h>
-#include <e-util/e-account-list.h>
typedef enum {
CAL_COMPONENT_METHOD_PUBLISH,
@@ -20,8 +19,18 @@ typedef enum {
CAL_COMPONENT_METHOD_DECLINECOUNTER
} CalComponentItipMethod;
-EAccountList *itip_addresses_get (void);
-EAccount *itip_addresses_get_default (void);
+typedef struct {
+ gchar *name;
+ gchar *address;
+ gchar *full;
+
+ gboolean default_address;
+} ItipAddress;
+
+GList *itip_addresses_get (void);
+ItipAddress *itip_addresses_get_default (void);
+void itip_address_free (ItipAddress *address);
+void itip_addresses_free (GList *addresses);
gboolean itip_organizer_is_user (CalComponent *comp, CalClient *client);
gboolean itip_sentby_is_user (CalComponent *comp);
diff --git a/calendar/gui/misc.c b/calendar/gui/misc.c
index e286442a89..950b2d7320 100644
--- a/calendar/gui/misc.c
+++ b/calendar/gui/misc.c
@@ -77,4 +77,4 @@ get_uri_without_password (const char *full_uri)
e_uri_free (uri);
return uristr;
- }
+}
diff --git a/calendar/pcs/cal-backend-file.c b/calendar/pcs/cal-backend-file.c
index d11df6d076..9e67b47895 100644
--- a/calendar/pcs/cal-backend-file.c
+++ b/calendar/pcs/cal-backend-file.c
@@ -21,11 +21,9 @@
*/
#include <config.h>
-#include <string.h>
-#include <unistd.h>
+#include <gtk/gtksignal.h>
#include <bonobo/bonobo-exception.h>
#include <bonobo/bonobo-moniker-util.h>
-#include <libgnome/gnome-i18n.h>
#include <libgnomevfs/gnome-vfs.h>
#include "e-util/e-dbhash.h"
#include "cal-util/cal-recur.h"
@@ -35,11 +33,23 @@
+/* A category that exists in some of the objects of the calendar */
+typedef struct {
+ /* Category name, also used as the key in the categories hash table */
+ char *name;
+
+ /* Number of objects that have this category */
+ int refcount;
+} Category;
+
/* Private part of the CalBackendFile structure */
struct _CalBackendFilePrivate {
/* URI where the calendar data is stored */
char *uri;
+ /* List of Cal objects with their listeners */
+ GList *clients;
+
/* Toplevel VCALENDAR component */
icalcomponent *icalcomp;
@@ -59,8 +69,12 @@ struct _CalBackendFilePrivate {
GList *todos;
GList *journals;
+ /* Hash table of live categories, and a temporary hash of removed categories */
+ GHashTable *categories;
+ GHashTable *removed_categories;
+
/* Config database handle for free/busy organizer information */
- EConfigListener *config_listener;
+ Bonobo_ConfigDatabase db;
/* Idle handler for saving the calendar when it is dirty */
guint idle_id;
@@ -73,9 +87,8 @@ struct _CalBackendFilePrivate {
static void cal_backend_file_class_init (CalBackendFileClass *class);
-static void cal_backend_file_init (CalBackendFile *cbfile, CalBackendFileClass *class);
-static void cal_backend_file_dispose (GObject *object);
-static void cal_backend_file_finalize (GObject *object);
+static void cal_backend_file_init (CalBackendFile *cbfile);
+static void cal_backend_file_destroy (GtkObject *object);
static const char *cal_backend_file_get_uri (CalBackend *backend);
static gboolean cal_backend_file_is_read_only (CalBackend *backend);
@@ -96,6 +109,7 @@ static void cal_backend_file_set_mode (CalBackend *backend, CalMode mode);
static int cal_backend_file_get_n_objects (CalBackend *backend, CalObjType type);
static char *cal_backend_file_get_default_object (CalBackend *backend, CalObjType type);
+static char *cal_backend_file_get_object (CalBackend *backend, const char *uid);
static CalComponent *cal_backend_file_get_object_component (CalBackend *backend, const char *uid);
static char *cal_backend_file_get_timezone_object (CalBackend *backend, const char *tzid);
static GList *cal_backend_file_get_uids (CalBackend *backend, CalObjType type);
@@ -127,6 +141,9 @@ static icaltimezone* cal_backend_file_get_default_timezone (CalBackend *backend)
static gboolean cal_backend_file_set_default_timezone (CalBackend *backend,
const char *tzid);
+static void notify_categories_changed (CalBackendFile *cbfile);
+static void notify_error (CalBackendFile *cbfile, const char *message);
+
static CalBackendClass *parent_class;
@@ -140,24 +157,24 @@ static CalBackendClass *parent_class;
*
* Return value: The type ID of the #CalBackendFile class.
**/
-GType
+GtkType
cal_backend_file_get_type (void)
{
- static GType cal_backend_file_type = 0;
+ static GtkType cal_backend_file_type = 0;
if (!cal_backend_file_type) {
- static GTypeInfo info = {
- sizeof (CalBackendFileClass),
- (GBaseInitFunc) NULL,
- (GBaseFinalizeFunc) NULL,
- (GClassInitFunc) cal_backend_file_class_init,
- NULL, NULL,
- sizeof (CalBackendFile),
- 0,
- (GInstanceInitFunc) cal_backend_file_init
- };
- cal_backend_file_type = g_type_register_static (CAL_BACKEND_TYPE,
- "CalBackendFile", &info, 0);
+ static const GtkTypeInfo cal_backend_file_info = {
+ "CalBackendFile",
+ sizeof (CalBackendFile),
+ sizeof (CalBackendFileClass),
+ (GtkClassInitFunc) cal_backend_file_class_init,
+ (GtkObjectInitFunc) cal_backend_file_init,
+ NULL, /* reserved_1 */
+ NULL, /* reserved_2 */
+ (GtkClassInitFunc) NULL
+ };
+
+ cal_backend_file_type = gtk_type_unique (CAL_BACKEND_TYPE, &cal_backend_file_info);
}
return cal_backend_file_type;
@@ -167,30 +184,30 @@ cal_backend_file_get_type (void)
static void
cal_backend_file_class_init (CalBackendFileClass *class)
{
- GObjectClass *object_class;
+ GtkObjectClass *object_class;
CalBackendClass *backend_class;
- object_class = (GObjectClass *) class;
+ object_class = (GtkObjectClass *) class;
backend_class = (CalBackendClass *) class;
- parent_class = (CalBackendClass *) g_type_class_peek_parent (class);
+ parent_class = gtk_type_class (CAL_BACKEND_TYPE);
- object_class->dispose = cal_backend_file_dispose;
- object_class->finalize = cal_backend_file_finalize;
+ object_class->destroy = cal_backend_file_destroy;
backend_class->get_uri = cal_backend_file_get_uri;
backend_class->is_read_only = cal_backend_file_is_read_only;
backend_class->get_cal_address = cal_backend_file_get_cal_address;
- backend_class->get_alarm_email_address = cal_backend_file_get_alarm_email_address;
- backend_class->get_ldap_attribute = cal_backend_file_get_ldap_attribute;
- backend_class->get_static_capabilities = cal_backend_file_get_static_capabilities;
+ backend_class->get_alarm_email_address = cal_backend_file_get_alarm_email_address;
+ backend_class->get_ldap_attribute = cal_backend_file_get_ldap_attribute;
+ backend_class->get_static_capabilities = cal_backend_file_get_static_capabilities;
backend_class->open = cal_backend_file_open;
backend_class->is_loaded = cal_backend_file_is_loaded;
backend_class->get_query = cal_backend_file_get_query;
backend_class->get_mode = cal_backend_file_get_mode;
backend_class->set_mode = cal_backend_file_set_mode;
backend_class->get_n_objects = cal_backend_file_get_n_objects;
- backend_class->get_default_object = cal_backend_file_get_default_object;
+ backend_class->get_default_object = cal_backend_file_get_default_object;
+ backend_class->get_object = cal_backend_file_get_object;
backend_class->get_object_component = cal_backend_file_get_object_component;
backend_class->get_timezone_object = cal_backend_file_get_timezone_object;
backend_class->get_uids = cal_backend_file_get_uids;
@@ -208,9 +225,33 @@ cal_backend_file_class_init (CalBackendFileClass *class)
backend_class->set_default_timezone = cal_backend_file_set_default_timezone;
}
+static Bonobo_ConfigDatabase
+load_db (void)
+{
+ Bonobo_ConfigDatabase db = CORBA_OBJECT_NIL;
+ CORBA_Environment ev;
+
+ CORBA_exception_init (&ev);
+
+ db = bonobo_get_object ("wombat:", "Bonobo/ConfigDatabase", &ev);
+
+ if (BONOBO_EX (&ev))
+ db = CORBA_OBJECT_NIL;
+
+ CORBA_exception_free (&ev);
+
+ return db;
+}
+
+static void
+cal_added_cb (CalBackend *backend, gpointer user_data)
+{
+ notify_categories_changed (CAL_BACKEND_FILE (backend));
+}
+
/* Object initialization function for the file backend */
static void
-cal_backend_file_init (CalBackendFile *cbfile, CalBackendFileClass *class)
+cal_backend_file_init (CalBackendFile *cbfile)
{
CalBackendFilePrivate *priv;
@@ -224,10 +265,16 @@ cal_backend_file_init (CalBackendFile *cbfile, CalBackendFileClass *class)
priv->todos = NULL;
priv->journals = NULL;
+ priv->categories = g_hash_table_new (g_str_hash, g_str_equal);
+ priv->removed_categories = g_hash_table_new (g_str_hash, g_str_equal);
+
/* The timezone defaults to UTC. */
priv->default_zone = icaltimezone_get_utc_timezone ();
- priv->config_listener = e_config_listener_new ();
+ priv->db = load_db ();
+
+ gtk_signal_connect (GTK_OBJECT (cbfile), "cal_added",
+ GTK_SIGNAL_FUNC (cal_added_cb), NULL);
}
/* g_hash_table_foreach() callback to destroy a CalComponent */
@@ -237,7 +284,7 @@ free_cal_component (gpointer key, gpointer value, gpointer data)
CalComponent *comp;
comp = CAL_COMPONENT (value);
- g_object_unref (comp);
+ gtk_object_unref (GTK_OBJECT (comp));
}
/* Saves the calendar data */
@@ -258,13 +305,13 @@ save (CalBackendFile *cbfile)
uri = gnome_vfs_uri_new (priv->uri);
if (!uri)
- goto error_malformed_uri;
+ goto error;
/* save calendar to backup file */
tmp = gnome_vfs_uri_to_string (uri, GNOME_VFS_URI_HIDE_NONE);
if (!tmp) {
gnome_vfs_uri_unref (uri);
- goto error_malformed_uri;
+ goto error;
}
backup_uristr = g_strconcat (tmp, "~", NULL);
@@ -275,7 +322,7 @@ save (CalBackendFile *cbfile)
if (!backup_uri) {
gnome_vfs_uri_unref (uri);
- goto error_malformed_uri;
+ goto error;
}
result = gnome_vfs_create_uri (&handle, backup_uri,
@@ -305,27 +352,40 @@ save (CalBackendFile *cbfile)
goto error;
return;
-
- error_malformed_uri:
- cal_backend_notify_error (CAL_BACKEND (cbfile),
- _("Can't save calendar data: Malformed URI."));
- return;
-
+
error:
- cal_backend_notify_error (CAL_BACKEND (cbfile), gnome_vfs_result_to_string (result));
+ notify_error (cbfile, gnome_vfs_result_to_string (result));
return;
}
-/* Dispose handler for the file backend */
+/* Used from g_hash_table_foreach(), frees a Category structure */
+static void
+free_category_cb (gpointer key, gpointer value, gpointer data)
+{
+ Category *c;
+
+ c = value;
+ g_free (c->name);
+ g_free (c);
+}
+
+/* Destroy handler for the file backend */
static void
-cal_backend_file_dispose (GObject *object)
+cal_backend_file_destroy (GtkObject *object)
{
CalBackendFile *cbfile;
CalBackendFilePrivate *priv;
+ GList *clients;
+
+ g_return_if_fail (object != NULL);
+ g_return_if_fail (IS_CAL_BACKEND_FILE (object));
cbfile = CAL_BACKEND_FILE (object);
priv = cbfile->priv;
+ clients = CAL_BACKEND (cbfile)->clients;
+ g_assert (clients == NULL);
+
/* Save if necessary */
if (priv->idle_id != 0) {
@@ -334,6 +394,13 @@ cal_backend_file_dispose (GObject *object)
priv->idle_id = 0;
}
+ /* Clean up */
+
+ if (priv->uri) {
+ g_free (priv->uri);
+ priv->uri = NULL;
+ }
+
if (priv->comp_uid_hash) {
g_hash_table_foreach (priv->comp_uid_hash,
free_cal_component, NULL);
@@ -348,45 +415,27 @@ cal_backend_file_dispose (GObject *object)
priv->todos = NULL;
priv->journals = NULL;
+ g_hash_table_foreach (priv->categories, free_category_cb, NULL);
+ g_hash_table_destroy (priv->categories);
+ priv->categories = NULL;
+
+ g_hash_table_foreach (priv->removed_categories, free_category_cb, NULL);
+ g_hash_table_destroy (priv->removed_categories);
+ priv->removed_categories = NULL;
+
if (priv->icalcomp) {
icalcomponent_free (priv->icalcomp);
priv->icalcomp = NULL;
}
- if (priv->config_listener) {
- g_object_unref (priv->config_listener);
- priv->config_listener = NULL;
- }
-
- if (G_OBJECT_CLASS (parent_class)->dispose)
- (* G_OBJECT_CLASS (parent_class)->dispose) (object);
-}
-
-/* Finalize handler for the file backend */
-static void
-cal_backend_file_finalize (GObject *object)
-{
- CalBackendFile *cbfile;
- CalBackendFilePrivate *priv;
-
- g_return_if_fail (object != NULL);
- g_return_if_fail (IS_CAL_BACKEND_FILE (object));
-
- cbfile = CAL_BACKEND_FILE (object);
- priv = cbfile->priv;
-
- /* Clean up */
-
- if (priv->uri) {
- g_free (priv->uri);
- priv->uri = NULL;
- }
-
+ bonobo_object_release_unref (priv->db, NULL);
+ priv->db = CORBA_OBJECT_NIL;
+
g_free (priv);
cbfile->priv = NULL;
- if (G_OBJECT_CLASS (parent_class)->finalize)
- (* G_OBJECT_CLASS (parent_class)->finalize) (object);
+ if (GTK_OBJECT_CLASS (parent_class)->destroy)
+ (* GTK_OBJECT_CLASS (parent_class)->destroy) (object);
}
@@ -444,24 +493,71 @@ cal_backend_file_get_cal_address (CalBackend *backend)
}
static const char *
-cal_backend_file_get_ldap_attribute (CalBackend *backend)
+cal_backend_file_get_alarm_email_address (CalBackend *backend)
{
+ /* A file backend has no particular email address associated
+ * with it (although that would be a useful feature some day).
+ */
return NULL;
}
static const char *
-cal_backend_file_get_alarm_email_address (CalBackend *backend)
+cal_backend_file_get_ldap_attribute (CalBackend *backend)
{
- /* A file backend has no particular email address associated
- * with it (although that would be a useful feature some day).
- */
return NULL;
}
static const char *
cal_backend_file_get_static_capabilities (CalBackend *backend)
{
- return "no-email-alarms";
+ return "no-email-alarms";
+}
+
+/* Used from g_hash_table_foreach(), adds a category name to the sequence */
+static void
+add_category_cb (gpointer key, gpointer value, gpointer data)
+{
+ Category *c;
+ GNOME_Evolution_Calendar_StringSeq *seq;
+
+ c = value;
+ seq = data;
+
+ seq->_buffer[seq->_length] = CORBA_string_dup (c->name);
+ seq->_length++;
+}
+
+/* Notifies the clients with the current list of categories */
+static void
+notify_categories_changed (CalBackendFile *cbfile)
+{
+ CalBackendFilePrivate *priv;
+ GNOME_Evolution_Calendar_StringSeq *seq;
+ GList *l;
+
+ priv = cbfile->priv;
+
+ /* Build the sequence of category names */
+
+ seq = GNOME_Evolution_Calendar_StringSeq__alloc ();
+ seq->_length = 0;
+ seq->_maximum = g_hash_table_size (priv->categories);
+ seq->_buffer = CORBA_sequence_CORBA_string_allocbuf (seq->_maximum);
+ CORBA_sequence_set_release (seq, TRUE);
+
+ g_hash_table_foreach (priv->categories, add_category_cb, seq);
+ g_assert (seq->_length == seq->_maximum);
+
+ /* Notify the clients */
+
+ for (l = CAL_BACKEND (cbfile)->clients; l; l = l->next) {
+ Cal *cal;
+
+ cal = CAL (l->data);
+ cal_notify_categories_changed (cal, seq);
+ }
+
+ CORBA_free (seq);
}
/* Idle handler; we save the calendar since it is dirty */
@@ -526,6 +622,68 @@ check_dup_uid (CalBackendFile *cbfile, CalComponent *comp)
mark_dirty (cbfile);
}
+/* Updates the hash table of categories by adding or removing those in the
+ * component.
+ */
+static void
+update_categories_from_comp (CalBackendFile *cbfile, CalComponent *comp, gboolean add)
+{
+ CalBackendFilePrivate *priv;
+ GSList *categories, *l;
+
+ priv = cbfile->priv;
+
+ cal_component_get_categories_list (comp, &categories);
+
+ for (l = categories; l; l = l->next) {
+ const char *name;
+ Category *c;
+
+ name = l->data;
+ c = g_hash_table_lookup (priv->categories, name);
+
+ if (add) {
+ /* Add the category to the set */
+ if (c)
+ c->refcount++;
+ else {
+ /* See if it was in the removed categories */
+
+ c = g_hash_table_lookup (priv->removed_categories, name);
+ if (c) {
+ /* Move it to the set of live categories */
+ g_assert (c->refcount == 0);
+ g_hash_table_remove (priv->removed_categories, c->name);
+
+ c->refcount = 1;
+ g_hash_table_insert (priv->categories, c->name, c);
+ } else {
+ /* Create a new category */
+ c = g_new (Category, 1);
+ c->name = g_strdup (name);
+ c->refcount = 1;
+
+ g_hash_table_insert (priv->categories, c->name, c);
+ }
+ }
+ } else {
+ /* Remove the category from the set --- it *must* have existed */
+
+ g_assert (c != NULL);
+ g_assert (c->refcount > 0);
+
+ c->refcount--;
+
+ if (c->refcount == 0) {
+ g_hash_table_remove (priv->categories, c->name);
+ g_hash_table_insert (priv->removed_categories, c->name, c);
+ }
+ }
+ }
+
+ cal_component_free_categories_list (categories);
+}
+
/* Tries to add an icalcomponent to the file backend. We only store the objects
* of the types we support; all others just remain in the toplevel component so
* that we don't lose them.
@@ -536,7 +694,6 @@ add_component (CalBackendFile *cbfile, CalComponent *comp, gboolean add_to_tople
CalBackendFilePrivate *priv;
GList **list;
const char *uid;
- GSList *categories;
priv = cbfile->priv;
@@ -579,9 +736,8 @@ add_component (CalBackendFile *cbfile, CalComponent *comp, gboolean add_to_tople
}
/* Update the set of categories */
- cal_component_get_categories_list (comp, &categories);
- cal_backend_ref_categories (CAL_BACKEND (cbfile), categories);
- cal_component_free_categories_list (categories);
+
+ update_categories_from_comp (cbfile, comp, TRUE);
}
/* Removes a component from the backend's hash and lists. Does not perform
@@ -595,7 +751,6 @@ remove_component (CalBackendFile *cbfile, CalComponent *comp)
icalcomponent *icalcomp;
const char *uid;
GList **list, *l;
- GSList *categories;
priv = cbfile->priv;
@@ -637,11 +792,10 @@ remove_component (CalBackendFile *cbfile, CalComponent *comp)
g_list_free_1 (l);
/* Update the set of categories */
- cal_component_get_categories_list (comp, &categories);
- cal_backend_unref_categories (CAL_BACKEND (cbfile), categories);
- cal_component_free_categories_list (categories);
- g_object_unref (comp);
+ update_categories_from_comp (cbfile, comp, FALSE);
+
+ gtk_object_unref (GTK_OBJECT (comp));
}
/* Scans the toplevel VCALENDAR component and stores the objects it finds */
@@ -680,19 +834,53 @@ scan_vcalendar (CalBackendFile *cbfile)
}
}
+/* Callback used from icalparser_parse() */
+static char *
+get_line_fn (char *s, size_t size, void *data)
+{
+ FILE *file;
+
+ file = data;
+ return fgets (s, size, file);
+}
+
+/* Parses an open iCalendar file and returns a toplevel component with the contents */
+static icalcomponent *
+parse_file (FILE *file)
+{
+ icalparser *parser;
+ icalcomponent *icalcomp;
+
+ parser = icalparser_new ();
+ icalparser_set_gen_data (parser, file);
+
+ icalcomp = icalparser_parse (parser, get_line_fn);
+ icalparser_free (parser);
+
+ return icalcomp;
+}
+
/* Parses an open iCalendar file and loads it into the backend */
static CalBackendOpenStatus
-open_cal (CalBackendFile *cbfile, const char *uristr)
+open_cal (CalBackendFile *cbfile, const char *uristr, FILE *file)
{
CalBackendFilePrivate *priv;
icalcomponent *icalcomp;
priv = cbfile->priv;
- icalcomp = cal_util_parse_ics_file (uristr);
- if (!icalcomp)
+ icalcomp = parse_file (file);
+
+ if (fclose (file) != 0) {
+ if (icalcomp)
+ icalcomponent_free (icalcomp);
+
return CAL_BACKEND_OPEN_ERROR;
+ }
+ if (!icalcomp)
+ return CAL_BACKEND_OPEN_ERROR;
+
/* FIXME: should we try to demangle XROOT components and
* individual components as well?
*/
@@ -738,6 +926,7 @@ cal_backend_file_open (CalBackend *backend, const char *uristr, gboolean only_if
{
CalBackendFile *cbfile;
CalBackendFilePrivate *priv;
+ FILE *file;
char *str_uri;
GnomeVFSURI *uri;
CalBackendOpenStatus status;
@@ -772,8 +961,11 @@ cal_backend_file_open (CalBackend *backend, const char *uristr, gboolean only_if
return CAL_BACKEND_OPEN_ERROR;
}
- if (access (str_uri, R_OK) == 0)
- status = open_cal (cbfile, str_uri);
+ /* Load! */
+ file = fopen (str_uri, "r");
+
+ if (file)
+ status = open_cal (cbfile, str_uri, file);
else {
if (only_if_exists)
status = CAL_BACKEND_OPEN_NOT_FOUND;
@@ -826,13 +1018,31 @@ cal_backend_file_get_mode (CalBackend *backend)
return CAL_MODE_LOCAL;
}
+static void
+notify_mode (CalBackendFile *cbfile,
+ GNOME_Evolution_Calendar_Listener_SetModeStatus status,
+ GNOME_Evolution_Calendar_CalMode mode)
+{
+ CalBackendFilePrivate *priv;
+ GList *l;
+
+ priv = cbfile->priv;
+
+ for (l = CAL_BACKEND (cbfile)->clients; l; l = l->next) {
+ Cal *cal;
+
+ cal = CAL (l->data);
+ cal_notify_mode (cal, status, mode);
+ }
+}
+
/* Set_mode handler for the file backend */
static void
cal_backend_file_set_mode (CalBackend *backend, CalMode mode)
{
- cal_backend_notify_mode (backend,
- GNOME_Evolution_Calendar_Listener_MODE_NOT_SUPPORTED,
- GNOME_Evolution_Calendar_MODE_LOCAL);
+ notify_mode (CAL_BACKEND_FILE (backend),
+ GNOME_Evolution_Calendar_Listener_MODE_NOT_SUPPORTED,
+ GNOME_Evolution_Calendar_MODE_LOCAL);
}
@@ -863,41 +1073,66 @@ cal_backend_file_get_n_objects (CalBackend *backend, CalObjType type)
return n;
}
+/* Get_object handler for the file backend */
static char *
cal_backend_file_get_default_object (CalBackend *backend, CalObjType type)
{
- CalBackendFile *cbfile;
- CalBackendFilePrivate *priv;
- CalComponent *comp;
- char *calobj;
-
- cbfile = CAL_BACKEND_FILE (backend);
- priv = cbfile->priv;
-
- comp = cal_component_new ();
-
- switch (type) {
- case CALOBJ_TYPE_EVENT:
- cal_component_set_new_vtype (comp, CAL_COMPONENT_EVENT);
- break;
- case CALOBJ_TYPE_TODO:
- cal_component_set_new_vtype (comp, CAL_COMPONENT_TODO);
- break;
- case CALOBJ_TYPE_JOURNAL:
- cal_component_set_new_vtype (comp, CAL_COMPONENT_JOURNAL);
- break;
- default:
- g_object_unref (comp);
- return NULL;
- }
-
- calobj = cal_component_get_as_string (comp);
- g_object_unref (comp);
-
- return calobj;
+ CalBackendFile *cbfile;
+ CalBackendFilePrivate *priv;
+ CalComponent *comp;
+ char *calobj;
+
+ cbfile = CAL_BACKEND_FILE (backend);
+ priv = cbfile->priv;
+
+ comp = cal_component_new ();
+
+ switch (type) {
+ case CALOBJ_TYPE_EVENT:
+ cal_component_set_new_vtype (comp, CAL_COMPONENT_EVENT);
+ break;
+ case CALOBJ_TYPE_TODO:
+ cal_component_set_new_vtype (comp, CAL_COMPONENT_TODO);
+ break;
+ case CALOBJ_TYPE_JOURNAL:
+ cal_component_set_new_vtype (comp, CAL_COMPONENT_JOURNAL);
+ break;
+ default:
+ gtk_object_unref (GTK_OBJECT (comp));
+ return NULL;
+ }
+
+ calobj = cal_component_get_as_string (comp);
+ gtk_object_unref (GTK_OBJECT (comp));
+
+ return calobj;
}
-/* Get_object_component handler for the file backend */
+/* Get_object handler for the file backend */
+static char *
+cal_backend_file_get_object (CalBackend *backend, const char *uid)
+{
+ CalBackendFile *cbfile;
+ CalBackendFilePrivate *priv;
+ CalComponent *comp;
+
+ cbfile = CAL_BACKEND_FILE (backend);
+ priv = cbfile->priv;
+
+ g_return_val_if_fail (uid != NULL, NULL);
+
+ g_return_val_if_fail (priv->icalcomp != NULL, NULL);
+ g_assert (priv->comp_uid_hash != NULL);
+
+ comp = lookup_component (cbfile, uid);
+
+ if (!comp)
+ return NULL;
+
+ return cal_component_get_as_string (comp);
+}
+
+/* Get_object handler for the file backend */
static CalComponent *
cal_backend_file_get_object_component (CalBackend *backend, const char *uid)
{
@@ -915,7 +1150,7 @@ cal_backend_file_get_object_component (CalBackend *backend, const char *uid)
return lookup_component (cbfile, uid);
}
-/* Get_timezone_object handler for the file backend */
+/* Get_object handler for the file backend */
static char *
cal_backend_file_get_timezone_object (CalBackend *backend, const char *tzid)
{
@@ -1238,7 +1473,7 @@ cal_backend_file_get_free_busy (CalBackend *backend, GList *users, time_t start,
g_return_val_if_fail (start <= end, NULL);
if (users == NULL) {
- if (cal_backend_mail_account_get_default (priv->config_listener, &address, &name)) {
+ if (cal_backend_mail_account_get_default (priv->db, &address, &name)) {
vfb = create_user_free_busy (cbfile, address, name, start, end);
calobj = icalcomponent_as_ical_string (vfb);
obj_list = g_list_append (obj_list, g_strdup (calobj));
@@ -1249,7 +1484,7 @@ cal_backend_file_get_free_busy (CalBackend *backend, GList *users, time_t start,
} else {
for (l = users; l != NULL; l = l->next ) {
address = l->data;
- if (cal_backend_mail_account_is_valid (priv->config_listener, address, &name)) {
+ if (cal_backend_mail_account_is_valid (priv->db, address, &name)) {
vfb = create_user_free_busy (cbfile, address, name, start, end);
calobj = icalcomponent_as_ical_string (vfb);
obj_list = g_list_append (obj_list, g_strdup (calobj));
@@ -1297,7 +1532,7 @@ cal_backend_file_compute_changes_foreach_key (const char *key, gpointer data)
be_data->change_ids = g_list_prepend (be_data->change_ids, g_strdup (key));
g_free (calobj);
- g_object_unref (comp);
+ gtk_object_unref (GTK_OBJECT (comp));
}
}
@@ -1520,6 +1755,88 @@ cal_backend_file_get_alarms_for_object (CalBackend *backend, const char *uid,
return corba_alarms;
}
+/* Notifies a backend's clients that an object was updated */
+static void
+notify_update (CalBackendFile *cbfile, const char *uid)
+{
+ CalBackendFilePrivate *priv;
+ GList *l;
+
+ priv = cbfile->priv;
+
+ cal_backend_obj_updated (CAL_BACKEND (cbfile), uid);
+
+ for (l = CAL_BACKEND (cbfile)->clients; l; l = l->next) {
+ Cal *cal;
+
+ cal = CAL (l->data);
+ cal_notify_update (cal, uid);
+ }
+}
+
+/* Notifies a backend's clients that an object was removed */
+static void
+notify_remove (CalBackendFile *cbfile, const char *uid)
+{
+ CalBackendFilePrivate *priv;
+ GList *l;
+
+ priv = cbfile->priv;
+
+ cal_backend_obj_removed (CAL_BACKEND (cbfile), uid);
+
+ for (l = CAL_BACKEND (cbfile)->clients; l; l = l->next) {
+ Cal *cal;
+
+ cal = CAL (l->data);
+ cal_notify_remove (cal, uid);
+ }
+}
+
+/* Notifies a backend's clients that an error has occurred */
+static void
+notify_error (CalBackendFile *cbfile, const char *message)
+{
+ CalBackendFilePrivate *priv;
+ GList *l;
+
+ priv = cbfile->priv;
+
+ for (l = CAL_BACKEND (cbfile)->clients; l; l = l->next) {
+ Cal *cal;
+
+ cal = CAL (l->data);
+ cal_notify_error (cal, message);
+ }
+}
+
+/* Used from g_hash_table_foreach_remove(); removes and frees a category */
+static gboolean
+remove_category_cb (gpointer key, gpointer value, gpointer data)
+{
+ Category *c;
+
+ c = value;
+ g_free (c->name);
+ g_free (c);
+
+ return TRUE;
+}
+
+/* Clears the table of removed categories */
+static void
+clean_removed_categories (CalBackendFile *cbfile)
+{
+ CalBackendFilePrivate *priv;
+
+ priv = cbfile->priv;
+
+ g_hash_table_foreach_remove (priv->removed_categories,
+ remove_category_cb,
+ NULL);
+}
+
+
/* Creates a CalComponent for the given icalcomponent and adds it to our
cache. Note that the icalcomponent is not added to the toplevel
icalcomponent here. That needs to be done elsewhere. It returns the uid
@@ -1536,14 +1853,14 @@ cal_backend_file_update_object (CalBackendFile *cbfile,
/* Create a CalComponent wrapper for the icalcomponent. */
comp = cal_component_new ();
if (!cal_component_set_icalcomponent (comp, icalcomp)) {
- g_object_unref (comp);
+ gtk_object_unref (GTK_OBJECT (comp));
return NULL;
}
/* Get the UID, and check it isn't empty. */
cal_component_get_uid (comp, &comp_uid);
if (!comp_uid || !comp_uid[0]) {
- g_object_unref (comp);
+ gtk_object_unref (GTK_OBJECT (comp));
return NULL;
}
@@ -1599,6 +1916,7 @@ cal_backend_file_update_objects (CalBackend *backend, const char *calobj, CalObj
icalcomponent *toplevel_comp, *icalcomp = NULL;
icalcomponent_kind kind;
icalproperty_method method;
+ int old_n_categories, new_n_categories;
icalcomponent *subcomp;
CalBackendResult retval = CAL_BACKEND_RESULT_SUCCESS;
GList *updated_uids = NULL, *removed_uids = NULL, *elem;
@@ -1635,6 +1953,13 @@ cal_backend_file_update_objects (CalBackend *backend, const char *calobj, CalObj
method = icalcomponent_get_method (toplevel_comp);
+ /* The list of removed categories must be empty because we are about to
+ * start a new scanning process.
+ */
+ g_assert (g_hash_table_size (priv->removed_categories) == 0);
+
+ old_n_categories = g_hash_table_size (priv->categories);
+
/* Step throught the VEVENT/VTODOs being added, create CalComponents
for them, and add them to our cache. */
subcomp = icalcomponent_get_first_component (toplevel_comp,
@@ -1672,6 +1997,8 @@ cal_backend_file_update_objects (CalBackend *backend, const char *calobj, CalObj
resolving any conflicting TZIDs. */
icalcomponent_merge_component (priv->icalcomp, toplevel_comp);
+ new_n_categories = g_hash_table_size (priv->categories);
+
mark_dirty (cbfile);
/* Now emit notification signals for all of the added components.
@@ -1679,18 +2006,24 @@ cal_backend_file_update_objects (CalBackend *backend, const char *calobj, CalObj
stable state before emitting signals. */
for (elem = updated_uids; elem; elem = elem->next) {
char *comp_uid = elem->data;
- cal_backend_notify_update (backend, comp_uid);
+ notify_update (cbfile, comp_uid);
g_free (comp_uid);
}
g_list_free (updated_uids);
for (elem = removed_uids; elem; elem = elem->next) {
char *comp_uid = elem->data;
- cal_backend_notify_remove (backend, comp_uid);
+ notify_remove (cbfile, comp_uid);
g_free (comp_uid);
}
g_list_free (removed_uids);
+ if (old_n_categories != new_n_categories ||
+ g_hash_table_size (priv->removed_categories) != 0) {
+ clean_removed_categories (cbfile);
+ notify_categories_changed (cbfile);
+ }
+
return retval;
}
@@ -1714,11 +2047,21 @@ cal_backend_file_remove_object (CalBackend *backend, const char *uid, CalObjModT
if (!comp)
return CAL_BACKEND_RESULT_NOT_FOUND;
+ /* The list of removed categories must be empty because we are about to
+ * start a new scanning process.
+ */
+ g_assert (g_hash_table_size (priv->removed_categories) == 0);
+
remove_component (cbfile, comp);
mark_dirty (cbfile);
- cal_backend_notify_remove (backend, uid);
+ notify_remove (cbfile, uid);
+
+ if (g_hash_table_size (priv->removed_categories) != 0) {
+ clean_removed_categories (cbfile);
+ notify_categories_changed (cbfile);
+ }
return CAL_BACKEND_RESULT_SUCCESS;
}
diff --git a/calendar/pcs/cal-backend.c b/calendar/pcs/cal-backend.c
index 765d873f79..e074f09bc2 100644
--- a/calendar/pcs/cal-backend.c
+++ b/calendar/pcs/cal-backend.c
@@ -23,38 +23,17 @@
*/
#include <config.h>
-#include <libxml/parser.h>
-#include <libxml/parserInternals.h>
-#include <libxml/xmlmemory.h>
+#include <gtk/gtkobject.h>
+#include <gtk/gtksignal.h>
+#include <gnome-xml/parser.h>
+#include <gnome-xml/parserInternals.h>
+#include <gnome-xml/xmlmemory.h>
#include "cal-backend.h"
#include "libversit/vcc.h"
-/* A category that exists in some of the objects of the calendar */
-typedef struct {
- /* Category name, also used as the key in the categories hash table */
- char *name;
-
- /* Number of objects that have this category */
- int refcount;
-} CalBackendCategory;
-
-/* Private part of the CalBackend structure */
-struct _CalBackendPrivate {
- /* List of Cal objects with their listeners */
- GList *clients;
-
- /* Hash table of live categories, temporary hash of
- * added/removed categories, and idle handler for sending
- * category_changed.
- */
- GHashTable *categories;
- GHashTable *changed_categories;
- guint category_idle_id;
-};
-
/* Signal IDs */
enum {
LAST_CLIENT_GONE,
@@ -64,19 +43,12 @@ enum {
OBJ_REMOVED,
LAST_SIGNAL
};
-static guint cal_backend_signals[LAST_SIGNAL];
static void cal_backend_class_init (CalBackendClass *class);
-static void cal_backend_init (CalBackend *backend);
-static void cal_backend_finalize (GObject *object);
-
-static char *get_object (CalBackend *backend, const char *uid);
-
-static void notify_categories_changed (CalBackend *backend);
-#define CLASS(backend) (CAL_BACKEND_CLASS (G_OBJECT_GET_CLASS (backend)))
+static guint cal_backend_signals[LAST_SIGNAL];
-static GObjectClass *parent_class;
+#define CLASS(backend) (CAL_BACKEND_CLASS (GTK_OBJECT (backend)->klass))
@@ -89,23 +61,25 @@ static GObjectClass *parent_class;
*
* Return value: The type ID of the #CalBackend class.
**/
-GType
+GtkType
cal_backend_get_type (void)
{
- static GType cal_backend_type = 0;
+ static GtkType cal_backend_type = 0;
if (!cal_backend_type) {
- static GTypeInfo info = {
- sizeof (CalBackendClass),
- (GBaseInitFunc) NULL,
- (GBaseFinalizeFunc) NULL,
- (GClassInitFunc) cal_backend_class_init,
- NULL, NULL,
- sizeof (CalBackend),
- 0,
- (GInstanceInitFunc) cal_backend_init,
- };
- cal_backend_type = g_type_register_static (G_TYPE_OBJECT, "CalBackend", &info, 0);
+ static const GtkTypeInfo cal_backend_info = {
+ "CalBackend",
+ sizeof (CalBackend),
+ sizeof (CalBackendClass),
+ (GtkClassInitFunc) cal_backend_class_init,
+ (GtkObjectInitFunc) NULL,
+ NULL, /* reserved_1 */
+ NULL, /* reserved_2 */
+ (GtkClassInitFunc) NULL
+ };
+
+ cal_backend_type =
+ gtk_type_unique (GTK_TYPE_OBJECT, &cal_backend_info);
}
return cal_backend_type;
@@ -115,58 +89,51 @@ cal_backend_get_type (void)
static void
cal_backend_class_init (CalBackendClass *class)
{
- GObjectClass *object_class;
-
- parent_class = (GObjectClass *) g_type_class_peek_parent (class);
+ GtkObjectClass *object_class;
- object_class = (GObjectClass *) class;
+ object_class = (GtkObjectClass *) class;
cal_backend_signals[LAST_CLIENT_GONE] =
- g_signal_new ("last_client_gone",
- G_TYPE_FROM_CLASS (class),
- G_SIGNAL_RUN_FIRST,
- G_STRUCT_OFFSET (CalBackendClass, last_client_gone),
- NULL, NULL,
- g_cclosure_marshal_VOID__VOID,
- G_TYPE_NONE, 0);
+ gtk_signal_new ("last_client_gone",
+ GTK_RUN_FIRST,
+ object_class->type,
+ GTK_SIGNAL_OFFSET (CalBackendClass, last_client_gone),
+ gtk_marshal_NONE__NONE,
+ GTK_TYPE_NONE, 0);
cal_backend_signals[CAL_ADDED] =
- g_signal_new ("cal_added",
- G_TYPE_FROM_CLASS (class),
- G_SIGNAL_RUN_FIRST,
- G_STRUCT_OFFSET (CalBackendClass, cal_added),
- NULL, NULL,
- g_cclosure_marshal_VOID__POINTER,
- G_TYPE_NONE, 1,
- G_TYPE_POINTER);
+ gtk_signal_new ("cal_added",
+ GTK_RUN_FIRST,
+ object_class->type,
+ GTK_SIGNAL_OFFSET (CalBackendClass, cal_added),
+ gtk_marshal_NONE__POINTER,
+ GTK_TYPE_NONE, 1,
+ GTK_TYPE_POINTER);
cal_backend_signals[OPENED] =
- g_signal_new ("opened",
- G_TYPE_FROM_CLASS (class),
- G_SIGNAL_RUN_FIRST,
- G_STRUCT_OFFSET (CalBackendClass, opened),
- NULL, NULL,
- g_cclosure_marshal_VOID__ENUM,
- G_TYPE_NONE, 1,
- G_TYPE_ENUM);
+ gtk_signal_new ("opened",
+ GTK_RUN_FIRST,
+ object_class->type,
+ GTK_SIGNAL_OFFSET (CalBackendClass, opened),
+ gtk_marshal_NONE__ENUM,
+ GTK_TYPE_NONE, 1,
+ GTK_TYPE_ENUM);
cal_backend_signals[OBJ_UPDATED] =
- g_signal_new ("obj_updated",
- G_TYPE_FROM_CLASS (class),
- G_SIGNAL_RUN_FIRST,
- G_STRUCT_OFFSET (CalBackendClass, obj_updated),
- NULL, NULL,
- g_cclosure_marshal_VOID__STRING,
- G_TYPE_NONE, 1,
- G_TYPE_STRING);
+ gtk_signal_new ("obj_updated",
+ GTK_RUN_FIRST,
+ object_class->type,
+ GTK_SIGNAL_OFFSET (CalBackendClass, obj_updated),
+ gtk_marshal_NONE__STRING,
+ GTK_TYPE_NONE, 1,
+ GTK_TYPE_STRING);
cal_backend_signals[OBJ_REMOVED] =
- g_signal_new ("obj_removed",
- G_TYPE_FROM_CLASS (class),
- G_SIGNAL_RUN_FIRST,
- G_STRUCT_OFFSET (CalBackendClass, obj_removed),
- NULL, NULL,
- g_cclosure_marshal_VOID__STRING,
- G_TYPE_NONE, 1,
- G_TYPE_STRING);
+ gtk_signal_new ("obj_removed",
+ GTK_RUN_FIRST,
+ object_class->type,
+ GTK_SIGNAL_OFFSET (CalBackendClass, obj_removed),
+ gtk_marshal_NONE__STRING,
+ GTK_TYPE_NONE, 1,
+ GTK_TYPE_STRING);
- object_class->finalize = cal_backend_finalize;
+ gtk_object_class_add_signals (object_class, cal_backend_signals, LAST_SIGNAL);
class->last_client_gone = NULL;
class->opened = NULL;
@@ -184,7 +151,7 @@ cal_backend_class_init (CalBackendClass *class)
class->get_mode = NULL;
class->set_mode = NULL;
class->get_n_objects = NULL;
- class->get_object = get_object;
+ class->get_object = NULL;
class->get_object_component = NULL;
class->get_timezone_object = NULL;
class->get_uids = NULL;
@@ -198,51 +165,6 @@ cal_backend_class_init (CalBackendClass *class)
class->send_object = NULL;
}
-/* Object initialization func for the calendar backend */
-void
-cal_backend_init (CalBackend *backend)
-{
- CalBackendPrivate *priv;
-
- priv = g_new0 (CalBackendPrivate, 1);
- backend->priv = priv;
-
- priv->categories = g_hash_table_new (g_str_hash, g_str_equal);
- priv->changed_categories = g_hash_table_new (g_str_hash, g_str_equal);
-}
-
-/* Used from g_hash_table_foreach(), frees a CalBackendCategory structure */
-static void
-free_category_cb (gpointer key, gpointer value, gpointer data)
-{
- CalBackendCategory *c = value;
-
- g_free (c->name);
- g_free (c);
-}
-
-void
-cal_backend_finalize (GObject *object)
-{
- CalBackend *backend = (CalBackend *)object;
- CalBackendPrivate *priv;
-
- priv = backend->priv;
-
- g_assert (priv->clients == NULL);
-
- g_hash_table_foreach (priv->categories, free_category_cb, NULL);
- g_hash_table_destroy (priv->categories);
-
- g_hash_table_foreach (priv->changed_categories, free_category_cb, NULL);
- g_hash_table_destroy (priv->changed_categories);
-
- if (priv->category_idle_id)
- g_source_remove (priv->category_idle_id);
-
- G_OBJECT_CLASS (parent_class)->finalize (object);
-}
-
/**
@@ -315,17 +237,37 @@ cal_backend_get_static_capabilities (CalBackend *backend)
/* Callback used when a Cal is destroyed */
static void
-cal_destroy_cb (gpointer data, GObject *where_cal_was)
+cal_destroy_cb (GtkObject *object, gpointer data)
{
- CalBackend *backend = CAL_BACKEND (data);
- CalBackendPrivate *priv = backend->priv;
+ Cal *cal;
+ Cal *lcal;
+ CalBackend *backend;
+ GList *l;
+
+ cal = CAL (object);
+
+ backend = CAL_BACKEND (data);
+
+ /* Find the cal in the list of clients */
- priv->clients = g_list_remove (priv->clients, where_cal_was);
+ for (l = backend->clients; l; l = l->next) {
+ lcal = CAL (l->data);
+
+ if (lcal == cal)
+ break;
+ }
+
+ g_assert (l != NULL);
+
+ /* Disconnect */
+
+ backend->clients = g_list_remove_link (backend->clients, l);
+ g_list_free_1 (l);
/* When all clients go away, notify the parent factory about it so that
* it may decide whether to kill the backend or not.
*/
- if (!priv->clients)
+ if (!backend->clients)
cal_backend_last_client_gone (backend);
}
@@ -340,25 +282,22 @@ cal_destroy_cb (gpointer data, GObject *where_cal_was)
void
cal_backend_add_cal (CalBackend *backend, Cal *cal)
{
- CalBackendPrivate *priv = backend->priv;
-
g_return_if_fail (backend != NULL);
g_return_if_fail (IS_CAL_BACKEND (backend));
g_return_if_fail (IS_CAL (cal));
- /* we do not keep a (strong) reference to the Cal since the
- * Calendar user agent owns it */
- g_object_weak_ref (G_OBJECT (cal), cal_destroy_cb, backend);
+ /* we do not keep a reference to the Cal since the Calendar
+ * user agent owns it */
+ gtk_signal_connect (GTK_OBJECT (cal), "destroy",
+ GTK_SIGNAL_FUNC (cal_destroy_cb),
+ backend);
- priv->clients = g_list_prepend (priv->clients, cal);
-
- /* Tell the new client about the list of categories.
- * (Ends up telling all the other clients too, but *shrug*.)
- */
- notify_categories_changed (backend);
+ backend->clients = g_list_prepend (backend->clients, cal);
/* notify backend that a new Cal has been added */
- g_signal_emit (backend, cal_backend_signals[CAL_ADDED], 0, cal);
+ gtk_signal_emit (GTK_OBJECT (backend),
+ cal_backend_signals[CAL_ADDED],
+ cal);
}
/**
@@ -520,19 +459,6 @@ cal_backend_get_n_objects (CalBackend *backend, CalObjType type)
return (* CLASS (backend)->get_n_objects) (backend, type);
}
-/* Default cal_backend_get_object implementation */
-static char *
-get_object (CalBackend *backend, const char *uid)
-{
- CalComponent *comp;
-
- comp = cal_backend_get_object_component (backend, uid);
- if (!comp)
- return NULL;
-
- return cal_component_get_as_string (comp);
-}
-
char *
cal_backend_get_default_object (CalBackend *backend, CalObjType type)
{
@@ -894,7 +820,7 @@ cal_backend_last_client_gone (CalBackend *backend)
g_return_if_fail (backend != NULL);
g_return_if_fail (IS_CAL_BACKEND (backend));
- g_signal_emit (G_OBJECT (backend), cal_backend_signals[LAST_CLIENT_GONE], 0);
+ gtk_signal_emit (GTK_OBJECT (backend), cal_backend_signals[LAST_CLIENT_GONE]);
}
/**
@@ -911,8 +837,8 @@ cal_backend_opened (CalBackend *backend, CalBackendOpenStatus status)
g_return_if_fail (backend != NULL);
g_return_if_fail (IS_CAL_BACKEND (backend));
- g_signal_emit (G_OBJECT (backend), cal_backend_signals[OPENED],
- 0, status);
+ gtk_signal_emit (GTK_OBJECT (backend), cal_backend_signals[OPENED],
+ status);
}
/**
@@ -930,8 +856,8 @@ cal_backend_obj_updated (CalBackend *backend, const char *uid)
g_return_if_fail (IS_CAL_BACKEND (backend));
g_return_if_fail (uid != NULL);
- g_signal_emit (G_OBJECT (backend), cal_backend_signals[OBJ_UPDATED],
- 0, uid);
+ gtk_signal_emit (GTK_OBJECT (backend), cal_backend_signals[OBJ_UPDATED],
+ uid);
}
/**
@@ -949,8 +875,8 @@ cal_backend_obj_removed (CalBackend *backend, const char *uid)
g_return_if_fail (IS_CAL_BACKEND (backend));
g_return_if_fail (uid != NULL);
- g_signal_emit (G_OBJECT (backend), cal_backend_signals[OBJ_REMOVED],
- 0, uid);
+ gtk_signal_emit (GTK_OBJECT (backend), cal_backend_signals[OBJ_REMOVED],
+ uid);
}
@@ -1019,228 +945,3 @@ cal_backend_set_default_timezone (CalBackend *backend, const char *tzid)
return (* CLASS (backend)->set_default_timezone) (backend, tzid);
}
-
-/**
- * cal_backend_notify_mode:
- * @backend: A calendar backend.
- * @status: Status of the mode set
- * @mode: the current mode
- *
- * Notifies each of the backend's listeners about the results of a
- * setMode call.
- **/
-void
-cal_backend_notify_mode (CalBackend *backend,
- GNOME_Evolution_Calendar_Listener_SetModeStatus status,
- GNOME_Evolution_Calendar_CalMode mode)
-{
- CalBackendPrivate *priv = backend->priv;
- GList *l;
-
- for (l = priv->clients; l; l = l->next)
- cal_notify_mode (l->data, status, mode);
-}
-
-/**
- * cal_backend_notify_update:
- * @backend: A calendar backend.
- * @uid: UID of object that was updated.
- *
- * Notifies each of the backend's listeners about an update to a
- * calendar object.
- **/
-void
-cal_backend_notify_update (CalBackend *backend, const char *uid)
-{
- CalBackendPrivate *priv = backend->priv;
- GList *l;
-
- cal_backend_obj_updated (backend, uid);
- for (l = priv->clients; l; l = l->next)
- cal_notify_update (l->data, uid);
-}
-
-/**
- * cal_backend_notify_remove:
- * @backend: A calendar backend.
- * @uid: UID of object that was removed.
- *
- * Notifies each of the backend's listeners about a calendar object
- * that was removed.
- **/
-void
-cal_backend_notify_remove (CalBackend *backend, const char *uid)
-{
- CalBackendPrivate *priv = backend->priv;
- GList *l;
-
- cal_backend_obj_removed (backend, uid);
- for (l = priv->clients; l; l = l->next)
- cal_notify_remove (l->data, uid);
-}
-
-/**
- * cal_backend_notify_error:
- * @backend: A calendar backend.
- * @message: Error message
- *
- * Notifies each of the backend's listeners about an error
- **/
-void
-cal_backend_notify_error (CalBackend *backend, const char *message)
-{
- CalBackendPrivate *priv = backend->priv;
- GList *l;
-
- for (l = priv->clients; l; l = l->next)
- cal_notify_error (l->data, message);
-}
-
-static void
-add_category_cb (gpointer name, gpointer category, gpointer data)
-{
- GNOME_Evolution_Calendar_StringSeq *seq = data;
-
- seq->_buffer[seq->_length++] = CORBA_string_dup (name);
-}
-
-static void
-notify_categories_changed (CalBackend *backend)
-{
- CalBackendPrivate *priv = backend->priv;
- GNOME_Evolution_Calendar_StringSeq *seq;
- GList *l;
-
- /* Build the sequence of category names */
- seq = GNOME_Evolution_Calendar_StringSeq__alloc ();
- seq->_length = 0;
- seq->_maximum = g_hash_table_size (priv->categories);
- seq->_buffer = CORBA_sequence_CORBA_string_allocbuf (seq->_maximum);
- CORBA_sequence_set_release (seq, TRUE);
-
- g_hash_table_foreach (priv->categories, add_category_cb, seq);
-
- /* Notify the clients */
- for (l = priv->clients; l; l = l->next)
- cal_notify_categories_changed (l->data, seq);
-
- CORBA_free (seq);
-}
-
-static gboolean
-prune_changed_categories (gpointer key, gpointer value, gpointer data)
-{
- CalBackendCategory *category = value;
-
- if (!category->refcount) {
- g_free (category->name);
- g_free (category);
- }
- return TRUE;
-}
-
-static gboolean
-idle_notify_categories_changed (gpointer data)
-{
- CalBackend *backend = CAL_BACKEND (data);
- CalBackendPrivate *priv = backend->priv;
-
- if (g_hash_table_size (priv->changed_categories)) {
- notify_categories_changed (backend);
- g_hash_table_foreach_remove (priv->changed_categories, prune_changed_categories, NULL);
- }
- return FALSE;
-}
-
-/**
- * cal_backend_ref_categories:
- * @backend: A calendar backend
- * @categories: a list of categories
- *
- * Adds 1 to the refcount of each of the named categories. If any of
- * the categories are new, clients will be notified of the updated
- * category list at idle time.
- **/
-void
-cal_backend_ref_categories (CalBackend *backend, GSList *categories)
-{
- CalBackendPrivate *priv;
- CalBackendCategory *c;
- const char *name;
-
- priv = backend->priv;
-
- while (categories) {
- name = categories->data;
- c = g_hash_table_lookup (priv->categories, name);
-
- if (c)
- c->refcount++;
- else {
- /* See if it was recently removed */
-
- c = g_hash_table_lookup (priv->changed_categories, name);
- if (c && c->refcount == 0) {
- /* Move it back to the set of live categories */
- g_hash_table_remove (priv->changed_categories, c->name);
-
- c->refcount = 1;
- g_hash_table_insert (priv->categories, c->name, c);
- } else {
- /* Create a new category */
- c = g_new (CalBackendCategory, 1);
- c->name = g_strdup (name);
- c->refcount = 1;
- g_hash_table_insert (priv->changed_categories, c->name, c);
- }
- }
-
- categories = categories->next;
- }
-
- if (g_hash_table_size (priv->changed_categories) &&
- !priv->category_idle_id)
- priv->category_idle_id = g_idle_add (idle_notify_categories_changed, backend);
-}
-
-/**
- * cal_backend_unref_categories:
- * @backend: A calendar backend
- * @categories: a list of categories
- *
- * Subtracts 1 from the refcount of each of the named categories. If
- * any of the refcounts go down to 0, clients will be notified of the
- * updated category list at idle time.
- **/
-void
-cal_backend_unref_categories (CalBackend *backend, GSList *categories)
-{
- CalBackendPrivate *priv;
- CalBackendCategory *c;
- const char *name;
-
- priv = backend->priv;
-
- while (categories) {
- name = categories->data;
- c = g_hash_table_lookup (priv->categories, name);
-
- if (c) {
- g_assert (c != NULL);
- g_assert (c->refcount > 0);
-
- c->refcount--;
-
- if (c->refcount == 0) {
- g_hash_table_remove (priv->categories, c->name);
- g_hash_table_insert (priv->changed_categories, c->name, c);
- }
- }
-
- categories = categories->next;
- }
-
- if (g_hash_table_size (priv->changed_categories) &&
- !priv->category_idle_id)
- priv->category_idle_id = g_idle_add (idle_notify_categories_changed, backend);
-}
diff --git a/calendar/pcs/cal-backend.h b/calendar/pcs/cal-backend.h
index 962b468fc3..04c3c71f5f 100644
--- a/calendar/pcs/cal-backend.h
+++ b/calendar/pcs/cal-backend.h
@@ -24,6 +24,7 @@
#ifndef CAL_BACKEND_H
#define CAL_BACKEND_H
+#include <libgnome/gnome-defs.h>
#include <cal-util/cal-util.h>
#include <cal-util/cal-component.h>
#include "pcs/evolution-calendar.h"
@@ -31,16 +32,16 @@
#include "pcs/cal.h"
#include "pcs/query.h"
-G_BEGIN_DECLS
+BEGIN_GNOME_DECLS
#define CAL_BACKEND_TYPE (cal_backend_get_type ())
-#define CAL_BACKEND(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CAL_BACKEND_TYPE, CalBackend))
-#define CAL_BACKEND_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CAL_BACKEND_TYPE, \
+#define CAL_BACKEND(obj) (GTK_CHECK_CAST ((obj), CAL_BACKEND_TYPE, CalBackend))
+#define CAL_BACKEND_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), CAL_BACKEND_TYPE, \
CalBackendClass))
-#define IS_CAL_BACKEND(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CAL_BACKEND_TYPE))
-#define IS_CAL_BACKEND_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CAL_BACKEND_TYPE))
+#define IS_CAL_BACKEND(obj) (GTK_CHECK_TYPE ((obj), CAL_BACKEND_TYPE))
+#define IS_CAL_BACKEND_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), CAL_BACKEND_TYPE))
/* Open status values */
typedef enum {
@@ -73,16 +74,13 @@ typedef enum {
CAL_BACKEND_GET_ALARMS_INVALID_RANGE
} CalBackendGetAlarmsForObjectResult;
-typedef struct _CalBackendPrivate CalBackendPrivate;
-
struct _CalBackend {
- GObject object;
-
- CalBackendPrivate *priv;
+ GtkObject object;
+ GList *clients;
};
struct _CalBackendClass {
- GObjectClass parent_class;
+ GtkObjectClass parent_class;
/* Notification signals */
void (* last_client_gone) (CalBackend *backend);
@@ -152,7 +150,7 @@ struct _CalBackendClass {
gboolean (* set_default_timezone) (CalBackend *backend, const char *tzid);
};
-GType cal_backend_get_type (void);
+GtkType cal_backend_get_type (void);
const char *cal_backend_get_uri (CalBackend *backend);
@@ -227,17 +225,8 @@ void cal_backend_opened (CalBackend *backend, CalBackendOpenStatus status);
void cal_backend_obj_updated (CalBackend *backend, const char *uid);
void cal_backend_obj_removed (CalBackend *backend, const char *uid);
-void cal_backend_notify_mode (CalBackend *backend,
- GNOME_Evolution_Calendar_Listener_SetModeStatus status,
- GNOME_Evolution_Calendar_CalMode mode);
-void cal_backend_notify_update (CalBackend *backend, const char *uid);
-void cal_backend_notify_remove (CalBackend *backend, const char *uid);
-void cal_backend_notify_error (CalBackend *backend, const char *message);
-void cal_backend_ref_categories (CalBackend *backend, GSList *categories);
-void cal_backend_unref_categories (CalBackend *backend, GSList *categories);
-
-G_END_DECLS
+END_GNOME_DECLS
#endif
diff --git a/calendar/pcs/cal.c b/calendar/pcs/cal.c
index bd6ffb4b38..c955dd0bb3 100644
--- a/calendar/pcs/cal.c
+++ b/calendar/pcs/cal.c
@@ -28,9 +28,9 @@
#include "query.h"
#include "Evolution-Wombat.h"
-#define PARENT_TYPE BONOBO_TYPE_OBJECT
+#define PARENT_TYPE BONOBO_X_OBJECT_TYPE
-static BonoboObjectClass *parent_class;
+static BonoboXObjectClass *parent_class;
/* Private part of the Cal structure */
struct _CalPrivate {
@@ -64,10 +64,10 @@ impl_Cal_get_uri (PortableServer_Servant servant,
return str_uri_copy;
}
-/* Cal::isReadOnly method */
+/* Cal::is_read_only method */
static CORBA_boolean
-impl_Cal_isReadOnly (PortableServer_Servant servant,
- CORBA_Environment *ev)
+impl_Cal_is_read_only (PortableServer_Servant servant,
+ CORBA_Environment *ev)
{
Cal *cal;
CalPrivate *priv;
@@ -78,10 +78,10 @@ impl_Cal_isReadOnly (PortableServer_Servant servant,
return cal_backend_is_read_only (priv->backend);
}
-/* Cal::getEmailAddress method */
+/* Cal::get_cal_address method */
static CORBA_char *
-impl_Cal_getCalAddress (PortableServer_Servant servant,
- CORBA_Environment *ev)
+impl_Cal_get_cal_address (PortableServer_Servant servant,
+ CORBA_Environment *ev)
{
Cal *cal;
CalPrivate *priv;
@@ -104,8 +104,8 @@ impl_Cal_getCalAddress (PortableServer_Servant servant,
/* Cal::get_alarm_email_address method */
static CORBA_char *
-impl_Cal_getAlarmEmailAddress (PortableServer_Servant servant,
- CORBA_Environment *ev)
+impl_Cal_get_alarm_email_address (PortableServer_Servant servant,
+ CORBA_Environment *ev)
{
Cal *cal;
CalPrivate *priv;
@@ -128,8 +128,8 @@ impl_Cal_getAlarmEmailAddress (PortableServer_Servant servant,
/* Cal::get_ldap_attribute method */
static CORBA_char *
-impl_Cal_getLdapAttribute (PortableServer_Servant servant,
- CORBA_Environment *ev)
+impl_Cal_get_ldap_attribute (PortableServer_Servant servant,
+ CORBA_Environment *ev)
{
Cal *cal;
CalPrivate *priv;
@@ -152,8 +152,8 @@ impl_Cal_getLdapAttribute (PortableServer_Servant servant,
/* Cal::getSchedulingInformation method */
static CORBA_char *
-impl_Cal_getStaticCapabilities (PortableServer_Servant servant,
- CORBA_Environment *ev)
+impl_Cal_get_static_capabilities (PortableServer_Servant servant,
+ CORBA_Environment *ev)
{
Cal *cal;
CalPrivate *priv;
@@ -180,11 +180,10 @@ uncorba_obj_type (GNOME_Evolution_Calendar_CalObjType type)
| ((type & GNOME_Evolution_Calendar_TYPE_JOURNAL) ? CALOBJ_TYPE_JOURNAL : 0));
}
-/* Cal::setMode method */
static void
-impl_Cal_setMode (PortableServer_Servant servant,
- GNOME_Evolution_Calendar_CalMode mode,
- CORBA_Environment *ev)
+impl_Cal_set_mode (PortableServer_Servant servant,
+ GNOME_Evolution_Calendar_CalMode mode,
+ CORBA_Environment *ev)
{
Cal *cal;
CalPrivate *priv;
@@ -195,11 +194,11 @@ impl_Cal_setMode (PortableServer_Servant servant,
cal_backend_set_mode (priv->backend, mode);
}
-/* Cal::countObjects method */
+/* Cal::get_n_objects method */
static CORBA_long
-impl_Cal_countObjects (PortableServer_Servant servant,
- GNOME_Evolution_Calendar_CalObjType type,
- CORBA_Environment *ev)
+impl_Cal_get_n_objects (PortableServer_Servant servant,
+ GNOME_Evolution_Calendar_CalObjType type,
+ CORBA_Environment *ev)
{
Cal *cal;
CalPrivate *priv;
@@ -214,32 +213,33 @@ impl_Cal_countObjects (PortableServer_Servant servant,
return n;
}
+/* Cal::get_object method */
static GNOME_Evolution_Calendar_CalObj
-impl_Cal_getDefaultObject (PortableServer_Servant servant,
- GNOME_Evolution_Calendar_CalObjType type,
- CORBA_Environment *ev)
+impl_Cal_get_default_object (PortableServer_Servant servant,
+ GNOME_Evolution_Calendar_CalObjType type,
+ CORBA_Environment *ev)
{
- Cal *cal;
- CalPrivate *priv;
- GNOME_Evolution_Calendar_CalObj calobj_copy;
- char *calobj;
-
-
- cal = CAL (bonobo_object_from_servant (servant));
- priv = cal->priv;
-
- calobj = cal_backend_get_default_object (priv->backend, type);
- calobj_copy = CORBA_string_dup (calobj);
- g_free (calobj);
-
- return calobj_copy;
+ Cal *cal;
+ CalPrivate *priv;
+ GNOME_Evolution_Calendar_CalObj calobj_copy;
+ char *calobj;
+
+
+ cal = CAL (bonobo_object_from_servant (servant));
+ priv = cal->priv;
+
+ calobj = cal_backend_get_default_object (priv->backend, type);
+ calobj_copy = CORBA_string_dup (calobj);
+ g_free (calobj);
+
+ return calobj_copy;
}
-/* Cal::getObject method */
+/* Cal::get_object method */
static GNOME_Evolution_Calendar_CalObj
-impl_Cal_getObject (PortableServer_Servant servant,
- const CORBA_char *uid,
- CORBA_Environment *ev)
+impl_Cal_get_object (PortableServer_Servant servant,
+ const GNOME_Evolution_Calendar_CalObjUID uid,
+ CORBA_Environment *ev)
{
Cal *cal;
CalPrivate *priv;
@@ -289,11 +289,11 @@ build_uid_seq (GList *uids)
return seq;
}
-/* Cal::getUIDs method */
+/* Cal::get_uids method */
static GNOME_Evolution_Calendar_CalObjUIDSeq *
-impl_Cal_getUIDs (PortableServer_Servant servant,
- GNOME_Evolution_Calendar_CalObjType type,
- CORBA_Environment *ev)
+impl_Cal_get_uids (PortableServer_Servant servant,
+ GNOME_Evolution_Calendar_CalObjType type,
+ CORBA_Environment *ev)
{
Cal *cal;
CalPrivate *priv;
@@ -314,12 +314,12 @@ impl_Cal_getUIDs (PortableServer_Servant servant,
return seq;
}
-/* Cal::getChanges method */
+/* Cal::get_changes method */
static GNOME_Evolution_Calendar_CalObjChangeSeq *
-impl_Cal_getChanges (PortableServer_Servant servant,
- GNOME_Evolution_Calendar_CalObjType type,
- const CORBA_char *change_id,
- CORBA_Environment *ev)
+impl_Cal_get_changes (PortableServer_Servant servant,
+ GNOME_Evolution_Calendar_CalObjType type,
+ const CORBA_char *change_id,
+ CORBA_Environment *ev)
{
Cal *cal;
CalPrivate *priv;
@@ -333,13 +333,13 @@ impl_Cal_getChanges (PortableServer_Servant servant,
return cal_backend_get_changes (priv->backend, t, change_id);
}
-/* Cal::getObjectsInRange method */
+/* Cal::get_objects_in_range method */
static GNOME_Evolution_Calendar_CalObjUIDSeq *
-impl_Cal_getObjectsInRange (PortableServer_Servant servant,
- GNOME_Evolution_Calendar_CalObjType type,
- GNOME_Evolution_Calendar_Time_t start,
- GNOME_Evolution_Calendar_Time_t end,
- CORBA_Environment *ev)
+impl_Cal_get_objects_in_range (PortableServer_Servant servant,
+ GNOME_Evolution_Calendar_CalObjType type,
+ GNOME_Evolution_Calendar_Time_t start,
+ GNOME_Evolution_Calendar_Time_t end,
+ CORBA_Environment *ev)
{
Cal *cal;
CalPrivate *priv;
@@ -395,13 +395,13 @@ build_fb_seq (GList *obj_list)
return seq;
}
-/* Cal::getFreeBusy method */
+/* Cal::get_free_busy method */
static GNOME_Evolution_Calendar_CalObjSeq *
-impl_Cal_getFreeBusy (PortableServer_Servant servant,
- const GNOME_Evolution_Calendar_UserList *user_list,
- const GNOME_Evolution_Calendar_Time_t start,
- const GNOME_Evolution_Calendar_Time_t end,
- CORBA_Environment *ev)
+impl_Cal_get_free_busy (PortableServer_Servant servant,
+ const GNOME_Evolution_Calendar_UserList *user_list,
+ const GNOME_Evolution_Calendar_Time_t start,
+ const GNOME_Evolution_Calendar_Time_t end,
+ CORBA_Environment *ev)
{
Cal *cal;
CalPrivate *priv;
@@ -440,12 +440,12 @@ impl_Cal_getFreeBusy (PortableServer_Servant servant,
return seq;
}
-/* Cal::getAlarmsInRange method */
+/* Cal::get_alarms_in_range method */
static GNOME_Evolution_Calendar_CalComponentAlarmsSeq *
-impl_Cal_getAlarmsInRange (PortableServer_Servant servant,
- GNOME_Evolution_Calendar_Time_t start,
- GNOME_Evolution_Calendar_Time_t end,
- CORBA_Environment *ev)
+impl_Cal_get_alarms_in_range (PortableServer_Servant servant,
+ GNOME_Evolution_Calendar_Time_t start,
+ GNOME_Evolution_Calendar_Time_t end,
+ CORBA_Environment *ev)
{
Cal *cal;
CalPrivate *priv;
@@ -473,13 +473,13 @@ impl_Cal_getAlarmsInRange (PortableServer_Servant servant,
return seq;
}
-/* Cal::getAlarmsForObject method */
+/* Cal::get_alarms_for_object method */
static GNOME_Evolution_Calendar_CalComponentAlarms *
-impl_Cal_getAlarmsForObject (PortableServer_Servant servant,
- const CORBA_char *uid,
- GNOME_Evolution_Calendar_Time_t start,
- GNOME_Evolution_Calendar_Time_t end,
- CORBA_Environment * ev)
+impl_Cal_get_alarms_for_object (PortableServer_Servant servant,
+ const GNOME_Evolution_Calendar_CalObjUID uid,
+ GNOME_Evolution_Calendar_Time_t start,
+ GNOME_Evolution_Calendar_Time_t end,
+ CORBA_Environment * ev)
{
Cal *cal;
CalPrivate *priv;
@@ -513,12 +513,12 @@ impl_Cal_getAlarmsForObject (PortableServer_Servant servant,
}
}
-/* Cal::updateObjects method */
+/* Cal::update_objects method */
static void
-impl_Cal_updateObjects (PortableServer_Servant servant,
- const CORBA_char *calobj,
- const GNOME_Evolution_Calendar_CalObjModType mod,
- CORBA_Environment *ev)
+impl_Cal_update_objects (PortableServer_Servant servant,
+ const GNOME_Evolution_Calendar_CalObj calobj,
+ const GNOME_Evolution_Calendar_CalObjModType mod,
+ CORBA_Environment *ev)
{
Cal *cal;
CalPrivate *priv;
@@ -543,12 +543,12 @@ impl_Cal_updateObjects (PortableServer_Servant servant,
}
}
-/* Cal::removeObject method */
+/* Cal::remove_object method */
static void
-impl_Cal_removeObject (PortableServer_Servant servant,
- const CORBA_char *uid,
- const GNOME_Evolution_Calendar_CalObjModType mod,
- CORBA_Environment *ev)
+impl_Cal_remove_object (PortableServer_Servant servant,
+ const GNOME_Evolution_Calendar_CalObjUID uid,
+ const GNOME_Evolution_Calendar_CalObjModType mod,
+ CORBA_Environment *ev)
{
Cal *cal;
CalPrivate *priv;
@@ -573,12 +573,12 @@ impl_Cal_removeObject (PortableServer_Servant servant,
}
}
-/* Cal::sendObject method */
+/* Cal::send_object method */
static GNOME_Evolution_Calendar_CalObj
-impl_Cal_sendObject (PortableServer_Servant servant,
- const CORBA_char *calobj,
- GNOME_Evolution_Calendar_UserList **user_list,
- CORBA_Environment *ev)
+impl_Cal_send_object (PortableServer_Servant servant,
+ const GNOME_Evolution_Calendar_CalObj calobj,
+ GNOME_Evolution_Calendar_UserList **user_list,
+ CORBA_Environment *ev)
{
Cal *cal;
CalPrivate *priv;
@@ -622,10 +622,10 @@ impl_Cal_sendObject (PortableServer_Servant servant,
/* Cal::getQuery implementation */
static GNOME_Evolution_Calendar_Query
-impl_Cal_getQuery (PortableServer_Servant servant,
- const CORBA_char *sexp,
- GNOME_Evolution_Calendar_QueryListener ql,
- CORBA_Environment *ev)
+impl_Cal_get_query (PortableServer_Servant servant,
+ const CORBA_char *sexp,
+ GNOME_Evolution_Calendar_QueryListener ql,
+ CORBA_Environment *ev)
{
Cal *cal;
CalPrivate *priv;
@@ -645,7 +645,6 @@ impl_Cal_getQuery (PortableServer_Servant servant,
CORBA_exception_init (&ev2);
query_copy = CORBA_Object_duplicate (BONOBO_OBJREF (query), &ev2);
if (BONOBO_EX (&ev2)) {
- bonobo_object_unref (query);
CORBA_exception_free (&ev2);
g_message ("Cal_get_query(): Could not duplicate the query reference");
bonobo_exception_set (ev, ex_GNOME_Evolution_Calendar_Cal_CouldNotCreate);
@@ -657,11 +656,11 @@ impl_Cal_getQuery (PortableServer_Servant servant,
return query_copy;
}
-/* Cal::setDefaultTimezone method */
+/* Cal::set_default_timezone method */
static void
-impl_Cal_setDefaultTimezone (PortableServer_Servant servant,
- const CORBA_char *tzid,
- CORBA_Environment *ev)
+impl_Cal_set_default_timezone (PortableServer_Servant servant,
+ const GNOME_Evolution_Calendar_CalTimezoneObjUID tzid,
+ CORBA_Environment *ev)
{
Cal *cal;
CalPrivate *priv;
@@ -677,11 +676,11 @@ impl_Cal_setDefaultTimezone (PortableServer_Servant servant,
}
}
-/* Cal::getTimezoneObject method */
+/* Cal::get_timezone_object method */
static GNOME_Evolution_Calendar_CalObj
-impl_Cal_getTimezoneObject (PortableServer_Servant servant,
- const CORBA_char *tzid,
- CORBA_Environment *ev)
+impl_Cal_get_timezone_object (PortableServer_Servant servant,
+ const GNOME_Evolution_Calendar_CalTimezoneObjUID tzid,
+ CORBA_Environment *ev)
{
Cal *cal;
CalPrivate *priv;
@@ -780,7 +779,7 @@ cal_new (CalBackend *backend, GNOME_Evolution_Calendar_Listener listener)
g_return_val_if_fail (backend != NULL, NULL);
g_return_val_if_fail (IS_CAL_BACKEND (backend), NULL);
- cal = CAL (g_object_new (CAL_TYPE, NULL));
+ cal = CAL (gtk_type_new (CAL_TYPE));
retval = cal_construct (cal, backend, listener);
if (!retval) {
@@ -794,7 +793,7 @@ cal_new (CalBackend *backend, GNOME_Evolution_Calendar_Listener listener)
/* Destroy handler for the calendar */
static void
-cal_finalize (GObject *object)
+cal_destroy (GtkObject *object)
{
Cal *cal;
CalPrivate *priv;
@@ -818,8 +817,8 @@ cal_finalize (GObject *object)
g_free (priv);
- if (G_OBJECT_CLASS (parent_class)->finalize)
- (* G_OBJECT_CLASS (parent_class)->finalize) (object);
+ if (GTK_OBJECT_CLASS (parent_class)->destroy)
+ (* GTK_OBJECT_CLASS (parent_class)->destroy) (object);
}
@@ -828,43 +827,43 @@ cal_finalize (GObject *object)
static void
cal_class_init (CalClass *klass)
{
- GObjectClass *object_class = (GObjectClass *) klass;
+ GtkObjectClass *object_class = (GtkObjectClass *) klass;
POA_GNOME_Evolution_Calendar_Cal__epv *epv = &klass->epv;
- parent_class = g_type_class_peek_parent (klass);
+ parent_class = gtk_type_class (PARENT_TYPE);
/* Class method overrides */
- object_class->finalize = cal_finalize;
+ object_class->destroy = cal_destroy;
/* Epv methods */
epv->_get_uri = impl_Cal_get_uri;
- epv->isReadOnly = impl_Cal_isReadOnly;
- epv->getCalAddress = impl_Cal_getCalAddress;
- epv->getAlarmEmailAddress = impl_Cal_getAlarmEmailAddress;
- epv->getLdapAttribute = impl_Cal_getLdapAttribute;
- epv->getStaticCapabilities = impl_Cal_getStaticCapabilities;
- epv->setMode = impl_Cal_setMode;
- epv->countObjects = impl_Cal_countObjects;
- epv->getDefaultObject = impl_Cal_getDefaultObject;
- epv->getObject = impl_Cal_getObject;
- epv->setDefaultTimezone = impl_Cal_setDefaultTimezone;
- epv->getTimezoneObject = impl_Cal_getTimezoneObject;
- epv->getUIDs = impl_Cal_getUIDs;
- epv->getChanges = impl_Cal_getChanges;
- epv->getObjectsInRange = impl_Cal_getObjectsInRange;
- epv->getFreeBusy = impl_Cal_getFreeBusy;
- epv->getAlarmsInRange = impl_Cal_getAlarmsInRange;
- epv->getAlarmsForObject = impl_Cal_getAlarmsForObject;
- epv->updateObjects = impl_Cal_updateObjects;
- epv->removeObject = impl_Cal_removeObject;
- epv->sendObject = impl_Cal_sendObject;
- epv->getQuery = impl_Cal_getQuery;
+ epv->isReadOnly = impl_Cal_is_read_only;
+ epv->getCalAddress = impl_Cal_get_cal_address;
+ epv->getAlarmEmailAddress = impl_Cal_get_alarm_email_address;
+ epv->getLdapAttribute = impl_Cal_get_ldap_attribute;
+ epv->getStaticCapabilities = impl_Cal_get_static_capabilities;
+ epv->setMode = impl_Cal_set_mode;
+ epv->countObjects = impl_Cal_get_n_objects;
+ epv->getDefaultObject = impl_Cal_get_default_object;
+ epv->getObject = impl_Cal_get_object;
+ epv->setDefaultTimezone = impl_Cal_set_default_timezone;
+ epv->getTimezoneObject = impl_Cal_get_timezone_object;
+ epv->getUIDs = impl_Cal_get_uids;
+ epv->getChanges = impl_Cal_get_changes;
+ epv->getObjectsInRange = impl_Cal_get_objects_in_range;
+ epv->getFreeBusy = impl_Cal_get_free_busy;
+ epv->getAlarmsInRange = impl_Cal_get_alarms_in_range;
+ epv->getAlarmsForObject = impl_Cal_get_alarms_for_object;
+ epv->updateObjects = impl_Cal_update_objects;
+ epv->removeObject = impl_Cal_remove_object;
+ epv->sendObject = impl_Cal_send_object;
+ epv->getQuery = impl_Cal_get_query;
}
/* Object initialization function for the calendar */
static void
-cal_init (Cal *cal, CalClass *klass)
+cal_init (Cal *cal)
{
CalPrivate *priv;
@@ -874,7 +873,7 @@ cal_init (Cal *cal, CalClass *klass)
priv->listener = CORBA_OBJECT_NIL;
}
-BONOBO_TYPE_FUNC_FULL (Cal, GNOME_Evolution_Calendar_Cal, PARENT_TYPE, cal);
+BONOBO_X_TYPE_FUNC_FULL (Cal, GNOME_Evolution_Calendar_Cal, PARENT_TYPE, cal);
/**
* cal_notify_mode:
diff --git a/camel/ChangeLog b/camel/ChangeLog
index a7022b0cc7..5b1d2fef82 100644
--- a/camel/ChangeLog
+++ b/camel/ChangeLog
@@ -1,56 +1,8 @@
-2003-03-31 Jeffrey Stedfast <fejj@ximian.com>
+2003-03-28 Jeffrey Stedfast <fejj@ximian.com>
- * camel-mime-filter-enriched.c (enriched_to_html): Use strncasecmp
- for matching the nofill and /nofill tags. Also fixed to handle
- enriched tags that require <param> tags.
-
-2003-03-28 Not Zed <NotZed@Ximian.com>
-
- * providers/local/camel-spool-store.c (get_folder): remove unused
- var.
-
- * providers/imap/camel-imap-utils.c (imap_parse_list_response):
- moved an unused var to the #if 0'd out block.
-
- * providers/imap/camel-imap-store.c
- (parse_list_response_as_folder_info): remove unused vars.
-
- * camel-index-control.c (main): deifne camel_init() before using
- it.
-
- * camel-vee-store.c (vee_get_folder): removed unused var.
-
- * camel-stream-mem.c (stream_write): warning -> fixme.
-
- * camel-stream-filter.c (_CamelStreamFilterPrivate): Add a ; to
- the end of the struct definition.
-
- * camel-store.c (camel_store_delete_folder): remove unused var.
- (camel_store_rename_folder): "
- (camel_store_unsubscribe_folder): "
-
- * camel-mime-part.c (write_to_stream): Changed warning into a
- TODO.
- (construct_from_parser): removed warning, the code was fixed.
-
- * camel-mime-message.c (construct_from_parser): Remove the
- warning, the code was fixed.
-
- * camel-mime-filter-enriched.c (camel_mime_filter_enriched_new):
- Remove unused var.
-
- * camel-medium.c (camel_medium_get_header): Removed warning, and
- changed docs to reflect it.
-
- * camel-gpg-context.c (gpg_ctx_parse_status): handle MODE_EXPORT
- as a noop (warning).
-
- * camel-folder.c (get_message_user_tag): changed a warning into a
- fixme (its not that important).
- (camel_folder_get_message_user_tag): "
-
- * camel-data-cache.c (data_cache_finalise): removed unused vars.
- (data_cache_expire): "
+ * camel-sasl-gssapi.c (gssapi_challenge): If we are using the
+ heimdal krb5 implementation, don't free outbuf ever. Seems to
+ segfault if we do.
2003-03-27 Jeffrey Stedfast <fejj@ximian.com>
@@ -59,143 +11,27 @@
release the outbuf gss_buffer_t since it shouldn't be set. Also
g_free (str) when we are done with it.
- * camel-mime-utils.c (header_encode_phrase_merge_words): When we
- remove a node from the list, make sure to g_list_free_1().
- (header_encode_phrase_merge_words): Don't use
- CAMEL_FOLD_PREENCODED as the upper-bound for merged-word length if
- the merged-word will not be an rfc2047 encoded word. Instead, use
- CAMEL_FOLD_SIZE-8 (which is the value we use in other places for
- determining upper-bound lengths). Solves bug #38659.
-
-2003-03-27 Dan Winship <danw@ximian.com>
-
- * camel-url.c (append_url_encoded): Like camel_url_encode, but
- works directly on an existing GString.
- (camel_url_to_string, output_param): Use it.
- (camel_url_encode): Likewise. Remove "escape_unsafe" arg since the
- "unsafe" chars are the ones that should *always* be escaped, and
- the places we were passing FALSE were wrong.
- (camel_url_decode): replace with a new version
-
- * camel-file-utils.c (camel_file_util_safe_filename): Remove extra
- arg to camel_url_encode.
-
- * tests/misc/url.c (main): Add tests of basic URL parsing and
- unparsing
-
-2003-03-28 Not Zed <NotZed@Ximian.com>
-
- *
- camel-mime-part-utils.c (simple_data_wrapper_construct_from_parser):
- Do a more thorough check for html marked as text/plain. Check
- that the text starts with <html or <!doctype. More complete fix
- for #16817.
-
2003-03-26 Jeffrey Stedfast <fejj@ximian.com>
* camel-sasl-gssapi.c (camel_sasl_gssapi_finalize): Pass in the
- addresses of the second args to the delete/release functions.
+ address of the second args to the delete/release functions. Also
+ #define gss_nt_service_name when using heimdal.
-2003-03-27 Not Zed <NotZed@Ximian.com>
-
- * camel-object.c (camel_object_bag_list): Ignore whether or not
- the bag is currently reserved. We'll miss the new potential
- object, but only 1. Should address #40103.
-
-2003-03-25 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-service.c (camel_gethostbyaddr): Don't use setv when we
- don't need the stdarg interface.
- (camel_gethostbyname): Same.
+2003-03-25 Rodney Dawes <dobey@ximian.com>
+ * camel-sasl-gssapi.c: #include <gssapi.h> for heimdal, fixed CFLAGS
+
2003-03-24 Jeffrey Stedfast <fejj@ximian.com>
- * camel-folder-search.c (search_user_tag): This expression can
- never return an array. We must always return a string value.
-
-2003-03-24 Timo Sirainen <tss@iki.fi>
-
- * camel-imap-command.c (imap_read_untagged) Integer overflow fix.
- If server sent a huge literal length, only a few bytes of memory
- was allocated to it, but server could write as much data there as
- it wanted.
-
-2003-03-21 Jeffrey Stedfast <fejj@ximian.com>
-
- Camel part of the fix for Lewing's bug #39204. Second half of the
- patch should also fix it so that text/plain parts that are
- detected as being text/html are rendered as html (not that I agree
- with this mind you, but corporate customers want this "feature").
-
- * camel-mime-part-utils.c
- (simple_data_wrapper_construct_from_parser): If the part is
- text/html and doesn't have a charset and we are able to find a
- charset in the meta tags of the html content, set the charset
- param on the content-type.
- (camel_mime_part_construct_content_from_parser): After setting the
- content object on the mime part, re-set the content-type of the
- content object back to the one from the parser (as it may contain
- changes from the original - see changes made to the ct in
- simple_data_wrapper_construct_from_parser for details).
-
-2003-03-21 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-tcp-stream-ssl.c (camel_certdb_nss_cert_get): continue
- reading the cert file until we've read it all or get a non-EINTR
- errno.
-
-2003-03-21 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-sasl-gssapi.c: #include <com_err.h> instead of
- #include <et/com_err.h>
+ * camel-sasl-gssapi.c: We don't want to #include <et/com_err.h",
+ we want to #include <com_err.h> instead.
+ #include <heimdal/gssapi.h> in the heimdal case.
2003-03-20 Jeffrey Stedfast <fejj@ximian.com>
* camel-sasl.c: Plug in GSSAPI support.
- * camel-sasl-gssapi.[c,h]: Various fixes to make it compile (fixed
- type-o's mostly).
-
-2003-03-20 Dan Winship <danw@ximian.com>
-
- Handle raw 8-bit From data "correctly". (The same way we handle
- raw 8-bit Subject data.)
-
- * camel-mime-utils.c (header_decode_mailbox): Take a charset arg
- and pass it to header_decode_string.
- (header_decode_address): Take a charset arg and pass it to
- header_decode_mailbox.
- (header_mailbox_decode): Likewise.
- (header_address_decode): Take a charset arg and pass it to
- header_decode_address.
-
- * camel-folder-summary.c (summary_format_address): Take a charset
- arg and pass to header_address_decode.
- (message_info_new, camel_message_info_new_from_header): Pass
- charset to summary_format_address
-
- * camel-internet-address.c (internet_decode): Update for
- header_address_decode change. (Unfortunately we don't have a
- charset to pass here.)
-
- * camel-mime-message.c (camel_mime_message_build_mbox_from): Move
- this here from camel-mbox-summary since the same functionality is
- needed by evolution-mail too (and update for header_address_decode
- change)
-
- * providers/local/camel-mbox-summary.c
- (camel_mbox_summary_build_from): Moved to CamelMimeMessage
-
-2003-03-17 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-mime-part.c (process_header): Removed unused variable left
- over from my previous fix.
-
- * providers/smtp/camel-smtp-transport.c (smtp_send_to): Don't pass
- 'has_8bit_parts' to smtp_data() anymore.
- (smtp_data): No longer takes 'has_8bit_parts' argument. Ignore
- whether or not the message has 8bit parts when deciding what the
- required encoding type we need to enforce. Fixes bug #39744.
+ * camel-sasl-gssapi.[c,h]: New source files implementing GSSAPI.
2003-03-13 Jeffrey Stedfast <fejj@ximian.com>
@@ -210,160 +46,12 @@
mailer uses "@@@%d" as a fake content-id value for parts without
content-ids) and don't allow for invalid content-type chars.
-2003-03-13 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-folder.c (get_uids): Don't add bogus uids to the uid
- array. Might fix bug #38868 (it's the only way I can figure that
- camel_folder_get_message_info() could possibly return NULL for the
- Outbox folder).
-
-2003-03-12 Not Zed <NotZed@Ximian.com>
-
- * camel-object.c (remove_bag): removed, it was double-freeing the
- key.
- (save_object): Just save the object in an array.
- (camel_object_bag_destroy): first save the object bag's objects in
- a list, then remove them one at a time from the bag since we can't
- remove hash table entries while we're in a foreach (PITA glib
- shit). For #39486.
- (camel_object_bag_*): killed some warnings.
-
-2003-03-09 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-url-scanner.c (camel_url_addrspec_end): Doh! If inptr ==
- pos + 1, then return FALSE (before it was checking for inptr ==
- pos, but it will never be pos).
-
-2003-03-07 Not Zed <NotZed@Ximian.com>
-
- * camel-vee-folder.c (vee_search_by_expression): handle a null
- return from search_by_expression, for bug #33786.
-
-2003-03-06 Jeffrey Stedfast <fejj@ximian.com>
-
- * providers/imap/camel-imap-utils.c (imap_next_word):
- s/g_strncasecmp/strncasecmp/g
-
- * camel-iconv.c: Updated to be an exact copy of e-iconv (except
- names changed). We don't use this yet, but we may in the future.
-
- * camel-url.c (camel_url_new_with_base): Here too.
-
- * camel-sasl-kerberos4.c (krb4_challenge): Use camel_strdown()
- here instead of g_strdown() since the latter has been deprecated.
-
- * providers/imap/camel-imap-utils.c (imap_parse_body): Use
- camel_strdown() since g_ascii_strdown() does not do what we
- thought.
-
- * providers/imap/camel-imap-store.c:
- s/strstrcase/camel_strstrcase/g
-
- * providers/imap/camel-imap-folder.c (do_append):
- s/strstrcase/camel_strstrcase/
- (handle_copyuid): Same.
-
- * string-utils.c (camel_strdown): New function because the
- g_ascii_strdown interface sucks.
- (camel_strstrcase): Renamed from strstrcase.
-
-2003-03-06 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-text-index.c (camel_utf8_next): Same as below.
-
- * camel-search-private.c (camel_utf8_getc): Updated since not all
- platforms/compiles support __inline__.
-
-2003-03-06 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-mime-part.c (camel_mime_part_get_encoding): Get rid of the
- const return - it mismatches the prototype and we don't need it
- anyway. Fixes bug #39173.
-
-2003-03-06 Jeffrey Stedfast <fejj@ximian.com>
-
- Fixes for bug #39170
-
- * camel-store-summary.c (camel_store_info_set_string): Remove
- return keyword.
-
- * camel-session.c (camel_session_thread_msg_free): Remove return
- keyword.
- (camel_session_thread_wait): Same.
-
- * camel-index.c (camel_index_cursor_reset): Remove return keyword.
-
-2003-03-06 Jeffrey Stedfast <fejj@ximian.com>
-
- Fixes for bug #39168
-
- * providers/local/camel-spool-summary.c: Get rid of the empty
- private struct.
-
- * providers/local/camel-mbox-summary.c: Get rid of the empty
- private struct.
-
- * camel-vee-store.c: Get rid of the empty private struct.
-
- * camel-mime-filter-from.c: Get rid of the empty private struct.
-
2003-03-05 Jeffrey Stedfast <fejj@ximian.com>
* providers/sendmail/camel-sendmail-transport.c
(sendmail_send_to): Add a CRLF filter to the output stream to
convert any CRLF sequences into plain old line-feeds to work
- around a bug in some local transport programs.
-
-2003-03-04 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-object.h: s/class/klass in one place so that the header is
- c++-safe.
-
-2003-03-03 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-tcp-stream-openssl.c (camel_tcp_stream_ssl_new): Updated
- to use the new API from a fe commits ago for the NSS stream. This
- is just to make it compile, but does not update the behaviour to
- act like the NSS stream. Note that people shouldn't be using
- OpenSSL anyway.
- (camel_tcp_stream_ssl_new_raw): Same.
-
- * camel-process.[c,h]: New source file containing convenience
- functions for process creation/termination mainly for use with
- Pipe filters but should be usable for anything we want.
-
- * camel-io.[c,h]: New source files implementing read/write system
- calls with proper error checking and cancellation
- (ie. StreamFs::read/write and CamelTcpStreamRaw::read/write). No
- sense duplicating the same code over and over. Now I can use this
- same code easily in other i/o code (such as Pipe filters and gpg
- code?).
-
-2003-03-03 Not Zed <NotZed@Ximian.com>
-
- * camel-store.c (camel_store_unsubscribe_folder): Do similar
- folder != NULL checking as for delete_folder before passing a NULL
- to object_bag_remove.
-
-2003-02-28 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-http-stream.c (http_connect): Here too.
-
- * providers/smtp/camel-smtp-transport.c (connect_to_server): Same
- as IMAP and POP.
-
- * providers/imap/camel-imap-store.c (connect_to_server): Same as
- the POP3 code.
-
- * providers/pop3/camel-pop3-store.c (connect_to_server): Pass in
- appropriate flags for camel_tcp_stream_ssl_new*() functions.
-
- * camel-tcp-stream-ssl.c (enable_ssl): Not all ssl/tls streams
- will want to allow each of SSLv2, SSLv3 and TLSv1 so use flags to
- decide which to enable/disable.
- (camel_tcp_stream_ssl_new): Now takes a flags argument to mask out
- which SSL/TLS versions the stream should be compatable with.
- (camel_tcp_stream_ssl_new_raw): Same.
+ around a bug in some local transport programs. Fixes bug #39138.
2003-02-27 Jeffrey Stedfast <fejj@ximian.com>
@@ -381,388 +69,28 @@
\n before the boundary really belongs to the boundary anyway) so
#if 0 this code out for now.
-2003-02-27 Not Zed <NotZed@Ximian.com>
-
- * camel-multipart-signed.c: Undo jeff's changes.
-
- * providers/local/camel-spool-store.c (scan_dir): Fix a paste-o in
- the object_bag_get key.
-
-2003-02-26 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-multipart-signed.c: Updated to use g_alloca instead of
- alloca so that we can skip all the #ifdef checks and skip checking
- for alloca in configure.in and all that foo.
-
- * camel-store.c (camel_store_delete_folder): Make sure the folder
- is non-NULL before trying to remove it from the store's
- object-bag.
-
-2003-02-25 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-mime-part-utils.c
- (simple_data_wrapper_construct_from_parser): canonicalise the
- charset name (if it is an iso charset) so that our strncasecmp to
- see if it is an iso-8859-# charset will be guarenteed to work on
- all systems.
- (canon_charset_name): New function to return the canonical iso
- charset name.
- (simple_data_wrapper_construct_from_parser): If the charset is
- NULL *or* the charset == "us-ascii" then check that it is 7bit
- clean to decide if it is rawtext (we did not check the case where
- charset was "us-ascii" before).
-
-2003-02-25 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-mime-message.c: Same as the ones below.
-
- * camel-mime-part.c: Reverted back to pre-camel-iconv
-
- * camel-filter-search.c: Same as below.
-
- * camel-folder-summary.c: Reverted back to pre-camel-iconv
-
- * camel.c (camel_init): Reverted to pre-camel-iconv
-
- * camel-charset-map.c (camel_charset_locale_name): Removed (part
- of the revert).
- (camel_charset_canonical_name): Same.
-
- * camel-mime-filter-charset.c: Revert back to using e_iconv from GAL.
-
- * camel-mime-part-utils.c: Revert back to using e_iconv from GAL.
-
- * camel-mime-utils.c: Revert back to using e_iconv from GAL.
-
- * camel-sasl-digest-md5.c: Revert back to using e-iconv from GAL.
-
-2003-02-24 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-charset-map.c (camel_charset_canonical_name): g_alloca
- (strlen (charset) + 1) so we don't overflow the buffer.
-
- * providers/pop3/camel-pop3-stream.c (stream_write): Don't write
- the passwd, fixes "bug" #38601.
-
- * camel-iconv.c: Make bucket->refcount 31 bits and bucket->used 1
- bit instead of having each use their own 32bit int.
- (iconv_cache_bucket_expire): Use g_iconv_close() here, missed this
- before.
- (camel_iconv): Might as well call g_iconv here even though it just
- calls iconv directly.
-
-2003-02-21 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-iconv.c (camel_iconv_charset_name): New function...back
- from the depths of hell from whence it came originally. Turns out
- that g_iconv_open() is lame and can't handle all the stuff we used
- to handle in e_iconv_charset_name().
- (camel_iconv_open): Use camel_iconv_charset_name() on the to/from
- charsets rather than camel_charset_canonical_name(). Now maybe
- g_iconv_open will work for charsets such as "ks_c_5601-1987".
-
- * providers/pop3/camel-pop3-store.c (pop3_connect): Reget the
- capabilities after a successful authentication.
-
- * providers/pop3/camel-pop3-engine.c (get_capabilities): If we are
- in the TRANSACTION state and CAPA did not list UIDL as a supported
- command, try checking for it the hard way.
-
-2003-02-23 Jeffrey Stedfast <fejj@ximian.com>
-
- * providers/smtp/camel-smtp-transport.c (smtp_data): Do it the
- same way we just made the sendmail code do it.
-
- * providers/sendmail/camel-sendmail-transport.c
- (sendmail_send_to): My last change but in a better way.
-
2003-02-22 Jeffrey Stedfast <fejj@ximian.com>
- * providers/smtp/camel-smtp-transport.c (smtp_data): Remove all
- Bcc headers before sending to the smtp server.
-
* providers/sendmail/camel-sendmail-transport.c
(sendmail_send_to): Remove all Bcc headers before sending to
- sendmail.
-
-2003-02-20 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel.c (camel_init): Call camel_iconv_init().
- (camel_shutdown): Call camel_iconv_shutdown().
-
- * camel-sasl-digest-md5.c (digest_response): Updated to use
- camel-iconv and the new camel-charset-map functions.
-
- * camel-mime-utils.c: Updated to use camel-iconv and the new
- camel-charset-map functions.
-
- * camel-mime-part-utils.c (check_html_charset): Use
- camel_charset_canonical_name() instead of e_iconv_charset_name()
- which is longer available.
- (convert_buffer): Use camel-iconv.
- (simple_data_wrapper_construct_from_parser): Since
- camel_charset_iso_to_windows() returns the charset in it's
- canonical format, no need to re-canonicalise it.
-
- * camel-mime-part.c (process_header): Use
- camel_charset_canonical_name() instead of e_iconv_charset_name()
- which is longer available.
-
- * camel-mime-message.c (process_header): Use
- camel_charset_canonical_name() instead of e_iconv_charset_name()
- which is longer available.
-
- * camel-mime-filter-charset.c: Use camel-iconv.
-
- * camel-folder-summary.c (message_info_new): Use
- camel_charset_canonical_name() instead of e_iconv_charset_name()
- which is longer available.
- (content_info_new): Use camel_charset_locale_name().
- (camel_message_info_new_from_header): Same as message_info_new().
-
- * camel-search-private.c: Use g_alloca() instead of alloca().
-
- * camel-filter-search.c (check_header): Use
- camel_charset_canonical_name() instead of e_iconv_charset_name()
- which is longer available.
-
- * camel-charset-map.c (camel_charset_locale_name): New function,
- replaces e_iconv_locale_charset().
- (camel_charset_canonical_name): New function, similar to
- e_iconv_charset_name() but instead of returning the iconv-friendly
- name, it returns the canonical name. (g_iconv will do the
- iconv-friendly name conversions for us).
-
-2003-02-20 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-filter-search.c (run_command): Redirect program's stdout
- and stderr to /dev/null
-
- * camel-filter-driver.c (pipe_to_system): Redirect the program's
- stderr to /dev/null
- (pipe_to_system): Write the pipe to a mem stream and use the mem
- stream in the parser. Also, when setting an exception get the
- errno from the parser so we can give more info about the error to
- the user.
+ sendmail and restore them after it has been sent.
2003-02-19 Jeffrey Stedfast <fejj@ximian.com>
* camel-tcp-stream-ssl.c (stream_connect): Fixed a type-o in the
ENABLE_IPv6 ifdef section.
-2003-02-19 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-filter-driver.c (pipe_message): New filter action that
- pipes the message source to the user-program and reads back the
- modified message and replaces driver->priv->message with the new
- message object.
- (do_copy): Check p->modified to make sure the message hasn't been
- modified by the pipe-message action - if it has been modified,
- default to the slower camel_folder_append_message() way of
- copying.
- (do_move): Same.
- (pipe_to_system): Set p->modified to TRUE if the user-program gave
- us back a message stream and we were able to parse it.
- (camel_filter_driver_filter_message): If the message has been
- modified, always use camel_folder_append_message() when appending
- it to the default folder.
-
2003-02-14 Jeffrey Stedfast <fejj@ximian.com>
* camel-folder-search.c: Added a (get-size ) function to fix bug
#38073.
(search_get_size): Implemented.
-2003-02-14 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-url-scanner.c (url_scanner_table_init): Mark chars with
- the high-bit set as CTRL chars.
- (camel_url_web_end): If the char before the start of the url is an
- open-brace, watch out for the matching close-brace.
- (camel_url_file_end): Same.
-
-2003-02-14 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-smime-context.c (smime_get_password): Same as the gpg and
- pkcs7 contexts.
-
- * camel-sasl-popb4smtp.c (popb4smtp_challenge): Updated for
- camel_session_get_password().
-
- * camel-pkcs7-context.c (get_password): Same as the gpg code.
-
- * camel-gpg-context.c (gpg_ctx_parse_status): Updated for
- camel_session_get_password().
-
- * providers/smtp/camel-smtp-transport.c (smtp_connect): No need to
- set USER_CANCEL exception here as it is done by
- camel_session_get_password(). Also updated for the new
- get_password() API change.
-
- * providers/imap/camel-imap-store.c (imap_auth_loop): Updated for
- camel_session_get_password() changes. We don't need to play the
- "bad passwd" game here too, do we? Bah, probably should but I
- don't feel like it for now. Maybe when we rewrite the IMAP
- provider.
-
- * camel-session.c (camel_session_get_password): Now takes a
- 'reprompt' argument that will force user-input to be given even if
- we have the passwd cached.
-
- * providers/pop3/camel-pop3-store.c (pop3_connect): Instead of
- uncaching the passwd after we receive a -ERR from the POP server,
- set 'reprompt' to TRUE to force user-input for the next password
- prompt (ie, make sure the front-end knows not to just return the
- cached value). The front-end can then decide to fill-in the
- user-input field with the last passwd that the user supplied.
- (pop3_try_authenticate): Now takes a reprompt argument which we
- pass into camel_session_get_password().
-
-2003-02-05 Dan Winship <danw@ximian.com>
-
- * Makefile.am (libcamelincludedir): Define in terms of
- privincludedir.
- (camellibexecdir): Define in terms of privlibexecdir
- (libcamel_la_LDFLAGS): Remove -rpath. (automake will add that)
-
- * providers/imap/Makefile.am (libcamelimapincludedir): Define in
- terms of privincludedir.
- (INCLUDES): Remove -I$(includedir)
- * providers/local/Makefile.am: Likewise
- * providers/nntp/Makefile.am: Likewise
- * providers/pop3/Makefile.am: Likewise
- * providers/sendmail/Makefile.am: Likewise
- * providers/smtp/Makefile.am: Likewise
-
-2003-02-04 Not Zed <NotZed@Ximian.com>
-
- * camel-object.c (camel_object_bag_new): Init bag->owner to 0.
-
-2003-01-31 Not Zed <NotZed@Ximian.com>
-
- * camel-object.c (camel_object_bag_*): Changed to use a posix
- semaphore instead of a condition variable + flag to reserve the
- object bag because e_mutex_cond is broken.
-
-2003-02-04 Jeffrey Stedfast <fejj@ximian.com>
-
- * providers/imap/camel-imap-utils.c (imap_parse_body): Use
- g_ascii_strdown() instead of g_strdown, since g_strdown is
- deprecated.
- (imap_parse_body): Same.
-
- * providers/imap/camel-imap-folder.c (decode_internaldate): Use
- strncasecmp() here too.
- (parse_fetch_response): And here.
- (camel_imap_folder_selected): Here too.
-
- * providers/imap/camel-imap-utils.c (imap_namespace_decode): Use
- strncasecmp() instead of g_strncasecmp() because the latter is
- deprecated.
-
- * providers/imap/camel-imap-store.c (imap_get_capability): Again here.
- (hash_folder_name): Here too.
- (compare_folder_name): And here.
- (get_folder_online): Again.
- (get_folder_offline): And again.
-
- * providers/imap/camel-imap-folder.c (camel_imap_folder_selected):
- Same as below again.
-
- * providers/imap/camel-imap-command.c (camel_imap_response_free):
- Same as below.
-
- * providers/smtp/camel-smtp-transport.c (smtp_data): Use
- strcasecmp() because g_strcasecmp() is deprecated.
-
- * camel-url.c (camel_url_new_with_base): Use g_ascii_strdown()
- instead of g_strdown, since g_strdown is deprecated.
-
-2003-01-28 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-sasl-gssapi.c (gssapi_challenge): Pass in some default
- flags to gss_init_sec_context() (these default flags are defined
- as a MUST in rfc1964).
-
-2003-01-22 Hans Petter Jansson <hpj@ximan.com>
-
- * Makefile.am: $(libexec) -> $(libexecdir)
-
-2003-01-22 Ettore Perazzoli <ettore@ximian.com>
-
- * providers/imap/Makefile.am (libcamelimapincludedir): Update to
- the new $(BASE_VERSION)-versioned path.
- * providers/smtp/Makefile.am (libcamelsmtpincludedir): Likewise.
- * providers/sendmail/Makefile.am (libcamelsendmailincludedir):
- Likewise.
- * providers/pop3/Makefile.am (libcamelpop3includedir): Likewise.
- * providers/nntp/Makefile.am (libcamelnntpincludedir): Likewise.
- * providers/local/Makefile.am (libcamellocalincludedir): Likewise.
-
- * camel-lock-client.c (camel_lock_helper_init): Use
- CAMEL_LIBEXECDIR instead of CAMEL_SBINDIR to find
- camel-lock-helper.
-
- * Makefile.am: Install camel-lock-helper and camel-index-control
- in $(libexec)/evolution/$(BASE_VERSION)/camel. Install
- libcamel.la in $privlibdir.
- (install-exec-hook): Update for the new location of
- camel-lock-helper.
- (libcamelincludedir): Version using $(BASE_VERSION).
- (INCLUDES): Define CAMEL_LIBEXECDIR.
-
-2003-01-21 Jeffrey Stedfast <fejj@ximian.com>
+2003-01-06 Jeffrey Stedfast <fejj@ximian.com>
* camel-mime-filter-canon.c (complete): Set the backbuflen to 0 so
that calling us again won't re-flush the same data.
-2003-01-17 Larry Ewing <lewing@ximian.com>
-
- * camel-mime-filter-enriched.c (enriched_to_html): only grow the
- buffer when we are out of space.
-
-2003-01-14 Not Zed <NotZed@Ximian.com>
-
- * camel-mime-parser.c (folder_scan_step): If we have no
- content-type header, set it to text/plain explcitly, rather than
- NULL, because some code doesn't handle NULL.
-
-2003-01-14 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-sasl-gssapi.[c,h]: New source files implementing the
- GSSAPI SASL mechanism.
-
-2003-01-13 Not Zed <NotZed@Ximian.com>
-
- * camel-mime-filter-tohtml.c: fix header include order.
-
- * camel-object.c (camel_object_bag_reserve): Add an assert to
- check we're not trying to reserve the bag more than once in a
- given thread.
- (camel_object_bag_list): If we have reserved the bag, dont try and
- cond wait. Fixes a deadlock.
-
- * camel-mime-filter-tohtml.c (writeln): Read the characters as
- utf8, rather than as 8 bit bytes. Remove the PRESERVE_8BIT as it
- has no meaning. Also change the default logic slightly so that 8
- bit or greater characters are properly converted to entities.
-
- * camel-utf8.c (camel_utf8_getc_limit): new function, gets a utf8
- char, bounded by an end pointer.
-
-2003-01-07 Dan Winship <danw@ximian.com>
-
- * camel-provider.h (CamelProvider): add a "translation_domain"
- field. (NULL for all providers in the camel source tree itself).
-
- * camel-session.c (register_provider): Translate provider strings
- in the correct domain
-
-2003-01-06 Not Zed <NotZed@Ximian.com>
-
- * camel-store.c (store_sync): init local exception before doing
- anything. fixes a crash.
-
2003-01-04 Jeffrey Stedfast <fejj@ximian.com>
* providers/smtp/camel-smtp-transport.c (smtp_send_to): Instead of
@@ -770,51 +98,6 @@
(recipients) != 0 since it is illegal for recipients to be NULL
(camel_transport_send_to already checks this).
-2002-12-17 Jeffrey Stedfast <fejj@ximian.com>
-
- * providers/imap/camel-imap-utils.c: Replace calls to
- g_string_sprintfa() with g_string_append_printf() since the former
- seems to have been deprecated.
-
- * providers/imap/camel-imap-search.c: Same.
-
- * providers/imap/camel-imap-folder.c: Here too.
-
- * providers/local/camel-mbox-summary.c: And here.
-
- * providers/local/camel-local-summary.c: Replace
- g_string_sprintf() with g_string_printf().
-
- * camel-data-cache.c (data_cache_expire): Replace
- g_string_sprintf() with g_string_printf().
-
- * camel-url.c: Replace calls to g_string_sprintfa() with
- g_string_append_printf() since the former seems to have been
- deprecated.
-
- * camel-service.c: Same.
-
- * camel-mime-utils.c: Here too.
-
-2002-12-16 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-mime-part-utils.c
- (simple_data_wrapper_construct_from_parser): Detect text/html
- parts that were marked as text/plain and re-tag them as text/html
- parts. Note: currently just checks if the first non-lwsp char is a
- '<' - but we might need to be smarter about this? *sigh* Stupid
- Windows mailers.
-
- * camel-mime-filter-tohtml.c (camel_text_to_html): New convenience
- function to replace calls to e_text_to_html() in the
- mailer/composer etc.
-
- * camel.h: #include some headers we had forgotten to add
- previously, also added camel-mime-filter-enriched.h.
-
- * camel-mime-filter-enriched.[c,h]: New stream filter to convert
- text/enriched and text/richtext into HTML.
-
2002-12-15 Jeffrey Stedfast <fejj@ximian.com>
* camel-multipart-signed.c (camel_multipart_signed_verify): Don't
@@ -822,119 +105,12 @@
raw data we received (all we want to do is convert o the canonical
CRLF format).
-2002-12-10 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-mime-filter-tohtml.c (html_convert): Use camel-url-scanner
- instead of regex.
-
-2002-12-09 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-url-scanner.c (camel_url_addrspec_end): Fixed to not be
- fooled in the case where the address is followed immediately by a
- period.
- (camel_url_web_end): Made more robust.
- (camel_url_scanner_scan): Oops. We need to set the match->pattern
- string pointer to the correct pattern before executing the
- start/end methods (as some of them rely on this info).
-
-2002-12-09 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-url-scanner.c: New code to scan for patterns (used only
- for url pattern matching atm, but we may find other uses for this
- and thus rename it? I dunno). Uses ETrie.
-
-2002-12-07 Not Zed <NotZed@Ximian.com>
-
- * camel-data-cache.c (data_cache_init): Use a bag instead of a
- hashtable to track the cache streams.
- (data_cache_finalise): Same.
- (free_busy): No longer needed.
- (data_cache_expire): use bag instead of hashtable.
- (stream_finalised): No longer required.
- (camel_data_cache_add): objectbagise
- (camel_data_cache_get): "
- (camel_data_cache_remove): "
- (data_cache_path): Set the now expired date before running expiry,
- so it plays better with multiple threads. Still a couple of
- harmless races.
-
-2002-12-06 Not Zed <NotZed@Ximian.com>
-
- * providers/local/camel-spool-store.c (scan_dir): folders ->
- object bag.
- (get_folder_info_mbox): folders -> object bag.
-
- * providers/local/camel-mh-store.c (folder_info_new): folders ->
- object bag.
-
- * providers/local/camel-maildir-store.c (scan_dir): folders ->
- object bag.
-
- * providers/local/camel-local-store.c (rename_folder): folders ->
- object bag.
-
- * camel-private.h (CamelStorePrivate): Remove 'cache' lock,
- handled by the objectbag.
-
- * providers/imap/camel-imap-store.c (copy_folder): Removed.
- (imap_store_refresh_folders): folders -> object bag.
- (get_folder_counts): folders -> object bag.
-
- * camel-vee-store.c (vee_get_folder): changes for folders
- objectbag.
- (vee_get_folder_info): Change to use folders objectbag. Also,
- dont refresh the base folder if we're in FAST mode.
- (build_info): Removed, no longer needed.
- (vee_rename_folder): Fixed for folders objectbag.
-
- * camel-store.c (camel_store_init): init the folders objectbag.
- (camel_store_finalize): Destroy the folders object bag.
- (folder_matches):
- (folder_finalize): Removed, now handled implicitly by the
- objectbag.
- (camel_store_get_folder): object bag changes.
- (camel_store_delete_folder): "
- (get_subfolders): Removed, now handled without a callback.
- (camel_store_rename_folder): Changed to use object bag of folders.
- (trash_add_folder): Removed.
- (init_trash): use folders object bag.
- (copy_folder_cache):
- (sync_folder): Removed, no longer needed. Weird arsed code anyway.
- (store_sync): Use folder object bag instead of hashtable.
- (camel_store_unsubscribe_folder): "
- (camel_store_init): remove cache_lock init, no longer used.
- (camel_store_finalize): Same for cleanup.
-
-2002-12-05 Not Zed <NotZed@Ximian.com>
-
- * camel-store.h (struct _CamelStore): change folders from a
- hashtable into a CamelObjectBag.
-
- * camel-object.c (camel_object_ref): Use type_lock instead of
- class lock for ref counting.
- (camel_object_unref): Use type_lock instead of class lock for
- unref.
- (camel_object_unref): If the object is 'bagged', then also look
- hooks, and remove it from any bags.
- (camel_object_bag_new):
- (camel_object_bag_destroy):
- (camel_object_bag_add):
- (camel_object_bag_get):
- (camel_object_bag_remove_unlocked):
- (camel_object_bag_list):
- (camel_object_bag_abort):
- (camel_object_bag_remove): New functions to implement a utility
- object which can manage a 'bag' of weakly ref'd children in an
- atomic & threadsafe way.
-
-2002-12-04 Jeffrey Stedfast <fejj@ximian.com>
+2002-12-03 Jeffrey Stedfast <fejj@ximian.com>
* providers/imap/camel-imap-store-summary.c
(camel_imap_store_summary_add_from_full): Properly handle the case
where the namespace is "". Fixes bug #34975
-2002-12-03 Jeffrey Stedfast <fejj@ximian.com>
-
* broken-date-parser.c (get_tzone): Fixed to not get false
positives when the token is shorter than the actual timezone
string (but matches the first little bit of it).
@@ -942,36 +118,24 @@
token is a special char (such as a '-') that is also used as a
token delimiter.
-2002-11-21 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-tcp-stream-ssl.c (stream_read): Use the new
- camel_operation_cancel_prfd() function to get the cancellation fd
- so we can poll on it for cancellation stuff.
- (stream_write): Same.
-
2002-11-22 Not Zed <NotZed@Ximian.com>
* camel-operation.c (camel_operation_cancel_prfd): Implement, gets
a nspr pr filedesc to poll/wait on
(struct _CamelOperation): include a pr filedesc.
-2002-11-21 Not Zed <NotZed@Ximian.com>
+2002-11-21 Jeffrey Stedfast <fejj@ximian.com>
- * providers/imap/camel-imap-store-summary.c
- (camel_imap_store_summary_namespace_find_path): If we have a
- namespace of "", then always match any path.
- (camel_imap_store_summary_namespace_find_full): Same, for full
- names. Should address #33309 & friends.
+ * camel-tcp-stream-ssl.c (stream_read): Use the new
+ camel_operation_cancel_prfd() function to get the cancellation fd
+ so we can poll on it for cancellation stuff.
+ (stream_write): Same.
2002-11-19 Radek Doulik <rodo@ximian.com>
* camel-mime-filter-tohtml.c (html_convert): added
CAMEL_MIME_FILTER_TOHTML_PRESERVE_8BIT flag
-2002-11-18 Rodney Dawes <dobey@ximian.com>
-
- * tests/*/Makefile.am: Removed $(GNOME_LIBDIR) and $(GNOMEUI_LIBS)
-
2002-11-15 Jeffrey Stedfast <fejj@ximian.com>
* providers/imap/camel-imap-store.c (imap_connect_online): If the
@@ -980,255 +144,6 @@
not returned in the response or if the folder flags contain
\NoSelect, subscribe to INBOX and then try LSUB again.
-2002-11-11 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-mime-filter-tohtml.c (html_convert): Rewritten. Much much
- much cleaner implementation now, though uses malloc/free more
- often than I'd like.
-
-2002-11-11 Jeffrey Stedfast <fejj@ximian.com>
-
- * providers/imap/camel-imap-folder.c (get_message_simple): Use
- g_strerror when setting an exception string (we need it to be in
- UTF-8).
-
- * providers/pop3/camel-pop3-store.c (pop3_try_authenticate): Use
- g_strerror when setting an exception string (we need it to be in
- UTF-8).
-
- * providers/pop3/camel-pop3-folder.c (pop3_refresh_info): Use
- g_strerror when setting an exception string (we need it to be in
- UTF-8).
- (pop3_get_message): Same.
-
- * providers/local/camel-spool-summary.c (spool_summary_sync_full):
- Use g_strerror when setting an exception string (we need it to be
- in UTF-8).
- (spool_summary_check): Here too.
-
- * providers/local/camel-spool-store.c (construct): Use g_strerror
- when setting an exception string (we need it to be in UTF-8).
- (get_folder): Same.
- (scan_dir): Here too.
-
- * providers/local/camel-spool-folder.c (spool_lock): Use
- g_strerror when setting an exception string (we need it to be in
- UTF-8).
-
- * providers/local/camel-mh-summary.c (mh_summary_check): Use
- g_strerror when setting an exception string (we need it to be in
- UTF-8).
-
- * providers/local/camel-mh-store.c (delete_folder): Use g_strerror
- when setting an exception string (we need it to be in UTF-8).
-
- * providers/local/camel-mbox-summary.c (summary_update): Use
- g_strerror when setting an exception string (we need it to be in
- UTF-8).
- (mbox_summary_sync_full): Here too.
- (mbox_summary_sync_quick): Same.
- (mbox_summary_sync): Also here.
- (camel_mbox_summary_sync_mbox): Again here.
-
- * providers/local/camel-mbox-folder.c (mbox_lock): Use g_strerror
- when setting an exception string (we need it to be in UTF-8).
- (mbox_append_message): Same.
- (mbox_get_message): Here too.
-
- * providers/local/camel-maildir-summary.c (maildir_summary_load):
- Use g_strerror when setting an exception string (we need it to be
- in UTF-8).
- (maildir_summary_check): Same.
-
- * providers/local/camel-maildir-store.c (get_folder): Use
- g_strerror when setting an exception string (we need it to be in
- UTF-8).
- (delete_folder): Same.
- (delete_folder): Here too.
-
- * providers/local/camel-local-summary.c (local_summary_sync): Use
- g_strerror when setting an exception string (we need it to be in
- UTF-8).
-
- * providers/local/camel-local-store.c (get_folder): Use g_strerror
- when setting an exception string (we need it to be in UTF-8).
- (create_folder): Same.
- (xrename): Here too.
- (rename_folder): And here.
- (delete_folder): Also here.
-
- * camel-provider.c (camel_provider_init): For debugging printfs,
- we want to use normal strerror (we want locale charset, not
- UTF-8).
-
- * camel-movemail.c (camel_movemail): Use g_strerror when setting
- an exception string (we need it to be in UTF-8).
- (movemail_external): Same.
- (camel_movemail_copy_file): Here too.
- (camel_movemail_solaris): Also here.
-
- * camel-mime-utils.c (rfc2047_decode_word): For debugging printfs,
- we want to use normal strerror (we want locale charset, not
- UTF-8).
- (header_encode_param): Same.
-
- * camel-mime-part-utils.c (convert_buffer): For debugging printfs,
- we want to use normal strerror (we want locale charset, not
- UTF-8).
-
- * camel-lock-client.c (camel_lock_helper_init): Use g_strerror
- when setting an exception string (we need it to be in UTF-8).
-
- * camel-data-cache.c (camel_data_cache_remove): Use g_strerror
- when setting an exception string (we need it to be in UTF-8).
-
- * camel-tcp-stream-raw.c (flaky_tcp_write): For debugging printfs,
- we want to use normal strerror (we want locale charset, not
- UTF-8).
- (flaky_tcp_read): Same.
-
- * camel-gpg-context.c (gpg_ctx_op_step): For debugging printfs, we
- want to use normal strerror (we want locale charset, not UTF-8).
-
- * camel-service.c (camel_gethostbyname): Use g_strerror when
- setting an exception string (we need it to be in UTF-8).
-
- * camel-lock.c (camel_lock_dot): Use g_strerror when setting an
- exception string (we need it to be in UTF-8).
- (camel_lock_fcntl): Same.
-
-2002-11-07 Not Zed <NotZed@Ximian.com>
-
- * camel-mime-part.c (camel_mime_part_set_content_type): constify
- the content_type.
-
-2002-11-07 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-i18n.h: Added.
-
- * camel-object.h: #include camel-i18n.h instead of gnome-i18n.h
-
- * camel-lock.c: Same.
-
-2002-11-07 Rodrigo Moya <rodrigo@ximian.com>
-
- * camel-object.h: removed gnome-defs.h, it does not exist.
-
-2002-11-05 Not Zed <NotZed@Ximian.com>
-
- * Makefile.am (camel_lock_helper_LDADD): Created temporary link
- list, we need to link with something for gettext.
-
- * camel.h: Remove gstring-util.h and hash-table-utils.h.
-
- * camel-text-index.c:
- (text_index_normalise): Changed for g_utf8_strdown api change.
-
- * camel-search-private.c:
- * camel-mime-utils.c:
- * camel-mime-part-utils.c:
- * camel-html-parser.c:
- * camel-charset-map.c: Include glib/gunicode.h from glib instead
- of gal.
-
- * camel-filter-driver.c: Remove include of gtk/gtk.h, should never
- have been there.
-
-2002-11-01 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-mime-utils.c (g_string_append_len): Removed. Glib2 has
- this function.
-
- * providers/local/camel-local-store.c (delete_folder): Use
- g_path_get_basename instead of g_strdup (g_basename (filename)).
-
- * camel-uid-cache.c (camel_uid_cache_new): Use g_path_get_dirname
- since g_dirname has been deprecated.
-
-2002-10-31 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-gpg-context.c (camel_gpg_context_class_init): Set the
- virtual method pointers to the import/export methods.
- (camel_gpg_context_init): Set the key_protocol string.
- (gpg_hash_to_id): Handle 2 more hash types.
- (gpg_id_to_hash): Same.
- (gpg_ctx_op_step): Slight fixes to support import/export.
- (gpg_ctx_parse_status): Fix to hack around the fact that importing
- keys doesn't write to stdout.
- (gpg_import_keys): Implemented.
- (gpg_export_keys): Implemented.
-
- * camel-cipher-context.c (camel_cipher_context_class_init): Hook
- up default virtual methods for import/export.
- (camel_cipher_import_keys): Implemented.
- (camel_cipher_export_keys): Implemented.
-
-2002-10-31 Jeffrey Stedfast <fejj@ximian.com>
-
- * Makefile.am: Removed hash-table-utils.[c,h] from the build.
-
- * hash-table-utils.[c,h]: Removed.
-
- * string-util.c: Imported g_strcase[hash,equal] into here so we
- can remove hash-table-utils.[c,h].
-
- * camel-medium.c: Removed #include "hash-table-utils.h"
-
- * camel-mime-message.c: Same here.
-
- * camel-mime-part.c: And here.
-
- * camel-session.c: Here too.
-
- * providers/imap/camel-imap-store-summary.c: #include
- string-utils.h instead of hash-table-utils.h
-
- * camel-charset-map.c: Same.
-
- * camel-folder-summary.c: Here too.
-
- * camel-provider.c: Again here.
-
- * camel-store-summary.c: And again...
-
-2002-10-31 Jeffrey Stedfast <fejj@ximian.com>
-
- Remove a ton of useless snot.
-
- * Makefile.am: Remove gstring-util.[c,h] from the build.
-
- * gstring-util.[c,h]: Removed.
-
- * string-utils.c (string_equal_for_glist): Removed.
- (string_split): Removed.
- (string_trim): Removed.
- (string_prefix): Removed.
- (string_unquote): Removed.
- (strip): Removed.
-
- * hash-table-utils.c (g_hash_table_generic_free): Removed.
-
- g_str[n]casecmp functions are deprecated in glib2.
-
- * string-utils.c (strstrcase): Use strncasecmp instead of
- g_strncasecmp.
-
- * hash-table-utils.c (g_strcase_equal): Use strcasecmp
- instead of g_strcasecmp.
-
- * camel-smime-utils.c (camel_smime_is_smime_v3_signed): Same.
- (camel_smime_is_smime_v3_encrypted): Here too.
-
- * camel-sasl-digest-md5.c (decode_data_type): And here.
- (parse_server_challenge): Again here.
-
- * camel-pgp-mime.c (camel_pgp_mime_is_rfc2015_signed): Same.
- (camel_pgp_mime_is_rfc2015_encrypted): Same
-
- * camel-mime-part-utils.c (check_html_charset): Here too.
-
- * camel-folder-summary.c (camel_system_flag): Same.
-
2002-10-25 Jeffrey Stedfast <fejj@ximian.com>
* camel-gpg-context.c (gpg_ctx_parse_status): Don't prematurely
@@ -1589,7 +504,7 @@
* camel-filter-search.c (camel_filter_search_match): Take new
session arg. Update callers.
(symbols[]): changed get-source to header-source
- (header_source): Changed from get_source. Now a boolean, returns
+ (header_source): Chagned from get_source. Now a boolean, returns
true if source matches one of the arguments. Uses the provider
url comparison directly for accurate checking. Makes 'filter on
source' work.
@@ -1810,7 +725,7 @@
* tests/misc/utf7.c: some utf7/utf8 tests.
- * providers/imap/camel-imap-utils.c (imap_mailbox_encode): Changed
+ * providers/imap/camel-imap-utils.c (imap_mailbox_encode): Chagned
to use camel_utf8_utf7 code.
(imap_mailbox_decode): As above, using camel_utf8_utf7. 'UTF-7'
isn't a widely support iconv() codeset, and besides the new code
@@ -1975,7 +890,7 @@
2002-08-19 Peter Williams <peterw@ximian.com>
Plug some large leaks in the indexing code.
-
+
* camel-mime-filter-index.c (camel_mime_filter_index_set_index): Unref
the old index if necessary.
@@ -3552,7 +2467,7 @@
<prez@magick.tm> to make camel only use literals if it needs to
for simple strings. Changed slightly to use imap_is_atom() and
more consistent formatting.
- * providers/imap/camel-imap-utils.c (imap_is_atom): Changed from
+ providers/imap/camel-imap-utils.c (imap_is_atom): Chagned from
imap_needs_quoting().
** Merged in camel-object2 branch. Simpler camelobject
@@ -5203,7 +4118,7 @@
(get_message_simple): Here too.
(add_message_from_data): And here.
-2001-11-14 Not Zed <NotZed@Ximian.com>
+2001-11-14 <NotZed@Ximian.com>
* camel-vee-folder.c (folder_changed_remove_uid): Use the uid
rather than vuid for unmatched. Also add the uid to unmatched if
@@ -5328,7 +4243,7 @@
since we'll just waste time in there mallocing left and right only
to arrive at the single response line "* BYE" again :-)
-2001-11-13 Not Zed <NotZed@Ximian.com>
+2001-11-13 <NotZed@Ximian.com>
* camel-filter-search.c (get_source): If we have no source string,
then use undefined, which should always evaluate to FALSE. Fix
@@ -5345,7 +4260,7 @@
pipe()'s fail, clean up any pipes that may have succeeded. Also
close the password fds.
-2001-11-09 Not Zed <NotZed@Ximian.com>
+2001-11-09 <NotZed@Ximian.com>
* providers/imap/camel-imap-store.c (imap_auth_loop): If we get a
user cancel and that causes us to fail to authenticate, abort
@@ -5394,13 +4309,13 @@
that we don't get 2 threads trying to read from our stream at the
same time.
-2001-11-01 Not Zed <NotZed@Ximian.com>
+2001-11-01 <NotZed@Ximian.com>
* camel-vee-folder.c (folder_changed_change): Move all searching
operations outside of any locks except subfolder lock, same as
build_folder. Fix for #14294.
-2001-10-31 Not Zed <NotZed@Ximian.com>
+2001-10-31 <NotZed@Ximian.com>
* providers/local/camel-spool-folder.c (spool_get_message): Same
as below.
@@ -5429,7 +4344,7 @@
(folder_scan_init_with_fd): Setup errno depeding on ok/failure.
(folder_scan_init_with_stream): Same.
-2001-10-30 Not Zed <NotZed@Ximian.com>
+2001-10-30 <NotZed@Ximian.com>
* camel-operation.c (camel_operation_new): Dont setup cancel_fd.
(camel_operation_cancel_fd): If cancel_fd not created, set it up.
@@ -5464,7 +4379,7 @@
* camel-mime-part.c (free_headers): Fix this to match get_headers.
-2001-10-30 Not Zed <NotZed@Ximian.com>
+2001-10-30 <NotZed@Ximian.com>
* providers/local/camel-local-store.c (rename_folder): Dont try to
move ibex if we have none.
@@ -5477,7 +4392,7 @@
* camel-mime-utils.c (camel_mime_utils_init): Removed unused
variable.
-2001-10-30 Not Zed <NotZed@Ximian.com>
+2001-10-30 <NotZed@Ximian.com>
* camel-mime-utils.c (header_decode_mailbox): w(x) out some warnings.
@@ -5512,7 +4427,7 @@
* camel-stream-buffer.h: Removed CAMEL_STREAM_BUFFER_NEWLINE since
it never got used anywhere and it isn't supported anyway.
-2001-10-30 Not Zed <NotZed@Ximian.com>
+2001-10-30 <NotZed@Ximian.com>
* providers/imap/camel-imap-store.c
(parse_list_response_as_folder_info): If we get an empty name,
@@ -5524,7 +4439,7 @@
imap_get_message): Set an X-Evolution-Source header on the
returned message so replies come from the right identity.
-2001-10-29 Not Zed <NotZed@Ximian.com>
+2001-10-29 <NotZed@Ximian.com>
* camel-vee-folder.c (folder_changed_change): If we're not going
to search on a changed uid, make sure we change out copy still.
@@ -5568,7 +4483,7 @@
is being connected and thinks it's online, but the session is
offline, then mark the service offline as well. Fixes 13683.
-2001-10-29 Not Zed <NotZed@Ximian.com>
+2001-10-29 <NotZed@Ximian.com>
* camel-mime-utils.c: Turn off w() -> warnings.
@@ -5590,7 +4505,7 @@
* camel-store.c (get_subfolders): Fix the 'is this a matching
folder or subfolder' logic.
-2001-10-28 Not Zed <NotZed@Ximian.com>
+2001-10-28 <NotZed@Ximian.com>
* providers/local/camel-local-store.c (rename_folder): Changed to
call ibex_move to rename it internally.
@@ -5611,7 +4526,7 @@
0. Still seems to be a bug in select() if it's telling us the
socket is ready for data when it really isn't but oh well.
-2001-10-28 Not Zed <NotZed@Ximian.com>
+2001-10-28 <NotZed@Ximian.com>
* providers/local/camel-local-folder.c
(camel_local_folder_construct): Use path not protocol as the path
@@ -5627,7 +4542,7 @@
camelfolders before emitting the folderchanged event (otherwise
vstore fails to pick up change.
-2001-10-27 Not Zed <NotZed@Ximian.com>
+2001-10-27 <NotZed@Ximian.com>
* camel-store.c (camel_store_init): Always use a default dir_sep
of '/'.
@@ -5644,7 +4559,7 @@
* providers/local/camel-local-folder.c (local_rename): Implement
local rename of folder objects.
-2001-10-26 Not Zed <NotZed@Ximian.com>
+2001-10-26 <NotZed@Ximian.com>
* camel-vee-folder.c (camel_vee_folder_class_init): Hook into
rename function.
@@ -5695,7 +4610,7 @@
reading from it and get no data from it since it is already at the
EOS. This may fix bug #12943.
-2001-10-25 Not Zed <NotZed@Ximian.com>
+2001-10-25 <NotZed@Ximian.com>
* camel-search-private.c (utf8_get): Remove the stupid warning
that should never have been there in the first place.
@@ -5712,7 +4627,7 @@
* camel-mime-filter-charset.c (reset, complete, filter): "
-2001-10-24 Not Zed <NotZed@Ximian.com>
+2001-10-24 <NotZed@Ximian.com>
* camel-mime-filter-basic.c (complete): For qp decoding, if the
data isn't really qp encoded, we could possible grow the buffer by
@@ -5743,11 +4658,11 @@
* camel-mime-utils.c (mail_list_magic): Remove an extra * in one
of the regexps that glibc apparently doesn't mind but bsd does.
-2001-10-23 Not Zed <NotZed@Ximian.com>
+2001-10-23 <NotZed@Ximian.com>
* providers/local/camel-mbox-summary.c: made d(x) x recompile again.
-2001-10-22 Not Zed <NotZed@Ximian.com>
+2001-10-22 <NotZed@Ximian.com>
* providers/local/camel-spool-summary.c (summary_rebuild): No, use
Storing, as the other code does :p
@@ -5765,7 +4680,7 @@
kludging around a inline-pgp signed part, do some charset
conversion to protect any 8bit text.
-2001-10-22 Not Zed <NotZed@Ximian.com>
+2001-10-22 <NotZed@Ximian.com>
* camel-filter-search.c, camel-folder-search.c (check_header): Use
search_type_mlist for mailing list searches.
@@ -5819,7 +4734,7 @@
* camel-store.c (camel_folder_info_build): Updated comments to
make the code a bit more clear.
-2001-10-21 Not Zed <NotZed@Ximian.com>
+2001-10-21 <NotZed@Ximian.com>
* camel-store.c (CS_CLASS): Dont do the macro stuff - basically so
you can actually debug calls.
@@ -5829,7 +4744,7 @@
vuid, since its alloca'd now.
(folder_changed_change): Kill a compile warning.
-2001-10-20 Not Zed <NotZed@Ximian.com>
+2001-10-20 <NotZed@Ximian.com>
* camel-folder.c (move_messages_to): If no exception supplied, use
a local one.
@@ -5841,7 +4756,7 @@
destination folder is the vfolder source folder, then
set_message_flags on it.
-2001-10-19 Not Zed <NotZed@Ximian.com>
+2001-10-19 <NotZed@Ximian.com>
* camel-session.c (register_provider): When registering provider,
translate all strings.
@@ -5885,7 +4800,7 @@
is x-unknown or some other x- charset, always set the rawtext bit
to TRUE.
-2001-10-18 Not Zed <NotZed@Ximian.com>
+2001-10-18 <NotZed@Ximian.com>
* camel-store.c (camel_store_unsubscribe_folder): If we are
unsubscribing from a folder we have loaded, set the folder
@@ -5916,7 +4831,7 @@
Cyrus imapd workaround...instead of checking to see if info->flags
== FLAGGED, just check to see if it contains any IMAP flags.
-2001-10-17 Not Zed <NotZed@Ximian.com>
+2001-10-17 <NotZed@Ximian.com>
* providers/local/camel-maildir-folder.c
(camel_maildir_folder_new): Use '.' as the inbox name for filter
@@ -5947,7 +4862,7 @@
* camel-filter-driver.c (do_copy): Add an optimization for when
destination folder is the same as the source folder.
-2001-10-17 Not Zed <NotZed@Ximian.com>
+2001-10-17 <NotZed@Ximian.com>
* providers/imap/camel-imap-store.c (get_folder_info_online):
(parse_list_response_as_folder_info): Patch from Danw, Use unread
@@ -5987,7 +4902,7 @@
parent directory exists before trying to open the filename, if it
doesn't, create it.
-2001-10-16 Not Zed <NotZed@Ximian.com>
+2001-10-16 <NotZed@Ximian.com>
* camel-mime-utils.c (header_address_decode): If no content, dont
try and decode further and spit meaningless warnings.
@@ -6025,7 +4940,7 @@
filter, it was completely broken - instead remove the header and
set it again after we send.
-2001-10-12 Not Zed <NotZed@Ximian.com>
+2001-10-12 <NotZed@Ximian.com>
* camel-vee-folder.c (camel_vee_folder_remove_folder): Unhook from
all events before removing folder.
@@ -6034,7 +4949,7 @@
(subfolder_deleted): When the folder is deleted, remove it from
the vfolder automagically.
-2001-10-11 Not Zed <NotZed@Ximian.com>
+2001-10-11 <NotZed@Ximian.com>
* camel-vee-folder.c (vee_search_by_uids): convert the uids list
to a subset appropriate for each subfolder before trying to search
@@ -6057,7 +4972,7 @@
* camel-tcp-stream-ssl.c (ssl_bad_cert): Hack around the fact that
adding a cert to nss's certdb seems to not work.
-2001-10-10 Not Zed <NotZed@Ximian.com>
+2001-10-10 <NotZed@Ximian.com>
* camel-vee-folder.c (vee_sync): Only re-build the folder if we're
expunging. Also only clear out the changed folders list if we're
@@ -6068,12 +4983,12 @@
* camel-charset-map.c (camel_charset_map_init): Added a hack for
Solaris systems.
-2001-10-10 Not Zed <NotZed@Ximian.com>
+2001-10-10 <NotZed@Ximian.com>
* providers/local/camel-maildir-store.c (scan_dir): oops, we want
get_unread_message_count, not get_message_count!
-2001-10-09 Not Zed <NotZed@Ximian.com>
+2001-10-09 <NotZed@Ximian.com>
* camel-service.c (camel_service_disconnect): Duplicate connect
code that unregisters a cancel op if we created one.
@@ -6156,7 +5071,7 @@
uu encoder.
(uuencode_step): New function to uuencode a block of data.
-2001-10-05 Not Zed <NotZed@Ximian.com>
+2001-10-05 <NotZed@Ximian.com>
* providers/imap/camel-imap-store.c (subscribe_folder): Use a
folder_subscribed event rather than a folder_created one.
@@ -6202,7 +5117,7 @@
(subscribe_folder): Here too.
(unsubscribe_folder): And here.
-2001-10-05 Not Zed <NotZed@Ximian.com>
+2001-10-05 <NotZed@Ximian.com>
* camel-mime-utils.c (header_decode_mailbox): Try harder to get
broken names out of addresses. Unencoded ,'s in names will still
@@ -6211,7 +5126,7 @@
past a '.', even if we can't decode the next part. Fix for some
annoying bug #.
-2001-10-04 Not Zed <NotZed@Ximian.com>
+2001-10-04 <NotZed@Ximian.com>
* camel-store.c (camel_store_delete_folder): Change the order of
execution slightly. We delete the folder first, then call the
@@ -6224,7 +5139,7 @@
* camel-service.c (camel_service_connect): Unregister the
operation before unreffing it.
-2001-10-03 Not Zed <NotZed@Ximian.com>
+2001-10-03 <NotZed@Ximian.com>
* providers/imap/camel-imap-folder.c (camel_imap_folder_changed):
Remove now unused 'recents' array/freeing func.
@@ -6287,7 +5202,7 @@
* camel-tcp-stream-ssl.c (ssl_bad_cert): Import the certificate if
the user accepts it.
-2001-10-02 Not Zed <NotZed@Ximian.com>
+2001-10-02 <NotZed@Ximian.com>
* providers/local/camel-local-provider.c (local_url_hash,
local_url_equal): for hashing/comparing local url's, we ignore
@@ -6325,7 +5240,7 @@
conversion fails, for whatever reason, retry using the user's
locale charset.
-2001-10-02 Not Zed <NotZed@Ximian.com>
+2001-10-02 <NotZed@Ximian.com>
* providers/local/camel-maildir-store.c (get_folder_info): Go back
to using the store url's path, not the toplevel_dir thing.
@@ -6467,7 +5382,7 @@
* providers/imap/camel-imap-folder.c (get_content): and one that
doesn't
-2001-09-27 Not Zed <NotZed@Ximian.com>
+2001-09-27 <NotZed@Ximian.com>
* camel-service.c (camel_service_connect): Dont re-register the
connect_op if we got it by calling 'operation_registered', which
@@ -6529,7 +5444,7 @@
* camel-operation.c (camel_operation_registered): Deal with the
possibility that there's no registered op.
-2001-09-26 Not Zed <NotZed@Ximian.com>
+2001-09-26 <NotZed@Ximian.com>
* camel-filter-driver.c (camel_filter_driver_filter_message): If
we get a search error, just abort, dont try and fall back and copy
@@ -6562,7 +5477,7 @@
* camel-pgp-mime.c (camel_pgp_mime_is_rfc2015_signed): block out
some code if ENABLE_PEDANTIC_PGPMIME is not defined.
-2001-09-26 Not Zed <NotZed@Ximian.com>
+2001-09-26 <NotZed@Ximian.com>
* camel-vee-store.c: Emptied VeeStorePrivate, member wasn't used.
@@ -6606,7 +5521,7 @@
* Makefile.am (camel-lock-helper): Add $(EXEEXT) for Automake 1.5
compatibility.
-2001-09-25 Not Zed <NotZed@Ximian.com>
+2001-09-25 <NotZed@Ximian.com>
* camel-folder.c (get_unread_message_count): Only unref info if we
got it.
@@ -6640,7 +5555,7 @@
Fixes at least ximian 8593, and probably 6024 and maybe 10366,
at least for OpenSSL. There may be a parallel NSS bug?
-2001-09-25 Not Zed <NotZed@Ximian.com>
+2001-09-25 <NotZed@Ximian.com>
* camel-stream-buffer.c (stream_write_all): A "safe write"
function that always writes out all data asked of it, till
@@ -6648,7 +5563,7 @@
(stream_write): Rewritten. What was i on when i wrote that
originally, how did it ever work with tcp streams ...
-2001-09-24 Not Zed <NotZed@Ximian.com>
+2001-09-24 <NotZed@Ximian.com>
* camel-folder.c (append_message): Set the exception to
FOLDER_INVALID rather than making out it worked. A fix for #7025.
@@ -6718,7 +5633,7 @@
(pgp_encrypt): And here.
(pgp_decrypt): Here too.
-2001-09-21 Not Zed <NotZed@Ximian.com>
+2001-09-21 <NotZed@Ximian.com>
* camel-store.c (create_folder): Set the exception if
create_folder isn't implemented.
@@ -6730,7 +5645,7 @@
break folder creation (returning nodes from the root path when it
shouldn't be?).
-2001-09-21 Not Zed <NotZed@Ximian.com>
+2001-09-21 <NotZed@Ximian.com>
* camel-vee-store.c (vee_get_folder_info): Force a refresh of
vfolders before storing their count. This essentially makes
@@ -6750,7 +5665,7 @@
(vee_refresh_info): Refresh folder, re-run queries on any changed
folders.
-2001-09-20 Not Zed <NotZed@Ximian.com>
+2001-09-20 <NotZed@Ximian.com>
* camel-folder-summary.c (camel_folder_summary_header_load): New
function to just load the summary. Not much use yet, until unread
@@ -6844,7 +5759,7 @@
`data' isn't a CamelService...cuz it's not supposed to be! It's a
CamelTcpStreamSSL object...doh!
-2001-09-19 Not Zed <NotZed@Ximian.com>
+2001-09-19 <NotZed@Ximian.com>
* General cleanup of camel debug printfs.
@@ -6861,14 +5776,14 @@
* camel-mime-utils.c: Match mailing-list header List-Owner.
-2001-09-18 Not Zed <NotZed@Ximian.com>
+2001-09-18 <NotZed@Ximian.com>
* camel-vee-store.c (vee_get_folder): Fix the uri genereated for
the folderinfo for the folder_created event.
* camel-store.h: Added 'total' to CamelFolderInfo.
-2000-09-18 Not Zed <NotZed@Ximian.com>
+2000-09-18 <NotZed@Ximian.com>
* providers/local/camel-maildir-folder.c
(camel_maildir_folder_new): If filter inbox is set on the store,
@@ -6955,7 +5870,7 @@
session_thread_queue, session_thread_wait): default implementation
of session threads stuff.
-2001-09-17 Not Zed <NotZed@Ximian.com>
+2001-09-17 <NotZed@Ximian.com>
* camel-folder.c (camel_folder_change_info_recent_uid): New
function to add a 'recent' uid to the change info.
@@ -7010,7 +5925,7 @@
URI of a folder.
(get_uri): Default implementation.
-2001-09-14 Not Zed <NotZed@Ximian.com>
+2001-09-14 <NotZed@Ximian.com>
* camel-vee-folder.c (camel_vee_folder_set_folders): New function,
set the complete list of folders on a vfolder, all at once.
@@ -7029,7 +5944,7 @@
* camel-store.h: Add a new flags CAMEL_STORE_VTRASH -> store
supports vtrash.
-2001-09-13 Not Zed <NotZed@Ximian.com>
+2001-09-13 <NotZed@Ximian.com>
* camel-vee-store.c (vee_get_folder_info): Implement.
(build_info): Used to build a folder record from the folders
@@ -7056,7 +5971,7 @@
name?query syntax to setup vfolder, but set the expression
directly. Also fixes a small memleak.
-2001-09-12 Not Zed <NotZed@Ximian.com>
+2001-09-12 <NotZed@Ximian.com>
* camel-store.c (camel_store_delete_folder): Fixed warnings with a
cast.
@@ -7125,7 +6040,7 @@
* camel-filter-driver.c (camel_filter_driver_filter_mbox): free
the source url in the nonfailure case.
-2001-09-12 Not Zed <NotZed@Ximian.com>
+2001-09-12 <NotZed@Ximian.com>
* camel-folder-search.h: Change the 'not' virtual method from an
immediate e-sexp function to a non-immediate one, which is what it
@@ -7142,7 +6057,7 @@
* camel-filter-driver.c (camel_filter_driver_filter_mbox): Unref
the message info.
-2001-09-10 Not Zed <NotZed@Ximian.com>
+2001-09-10 <NotZed@Ximian.com>
* providers/local/camel-maildir-store.c (get_folder_info): Pass in
a hashtalbe used for finding visited nodes.
@@ -7169,7 +6084,7 @@
* camel-charset-map.c (camel_charset_to_iconv): Get rid of the
g_warning, we no longer really need that.
-2001-09-10 Not Zed <NotZed@Ximian.com>
+2001-09-10 <NotZed@Ximian.com>
* providers/imap/camel-imap-store.c (camel_imap_msg_new): Forgot
to return the newly allocated msg.
@@ -7216,7 +6131,7 @@
(camel_mime_part_construct_content_from_parser): Reuse the
original boundary instead of generating our own.
-2001-09-06 Not Zed <NotZed@Ximian.com>
+2001-09-06 <NotZed@Ximian.com>
* providers/imap/camel-imap-folder.c (filter_proc): Thread
function to perform filtering.
@@ -7796,7 +6711,7 @@
2001-07-31 Not Zed <NotZed@Ximian.com>
- * camel-folder.c (camel_folder_init): Changed mutexes to
+ * camel-folder.c (camel_folder_init): Chagned mutexes to
e_mutexes, folder lock recursive. This fixes the imap filtering
bug, or at least some cases of it.
(camel_folder_finalize): Free mutexes.
@@ -9972,7 +8887,7 @@
* providers/smtp/camel-smtp-provider.c: Same
* providers/smtp/camel-smtp-transport.c: #ifdef HAVE_CONFIG_H, mark
strings for translations.
-
+
2001-03-29 Dan Winship <danw@ximian.com>
* camel-url.c (camel_url_to_string): change "gboolean show_passwd"
@@ -10009,7 +8924,7 @@
* camel-search-private.c: #include <config.h>
* camel-vee-folder.c: Mark string for translation.
* providers/local/camel-mbox-summary.c: #include <config.h>
-
+
2001-04-03 Dan Winship <danw@ximian.com>
* providers/imap/camel-imap-folder.c (imap_sync): If we don't
@@ -10597,7 +9512,7 @@
2001-03-16 Kjartan Maraas <kmaraas@gnome.org>
* providers/pop3/camel-pop3-folder.c: Added #include <config.h>
-
+
2001-03-16 Dan Winship <danw@ximian.com>
* camel-mime-utils.c (header_msgid_generate): Don't use
@@ -11863,7 +10778,7 @@
2001-01-19 Kjartan Maraas <kmaraas@gnome.org>
* providers/smtp/camel-smtp-provider.c: Mark strings for translation.
-
+
2001-01-19 Not Zed <NotZed@Ximian.com>
* camel-filter-driver.c (report_status): Add a percentage complete
@@ -11912,7 +10827,7 @@
New smtp error-code to string mapping function.
(smtp_connect): Use the new error->string function for reporting
useful errors.
- (smtp_helo): Same. Also use a case-insensitive strstr for 8BITMIME
+ (smtp_helo): Same. Also use a case-insensitive strstr for 8BITMIEM
as it seems Exchange sends back lowercase for that one single SMTP
extension. Everything else is uppercase. I'm seeing a lack of love
for that extension by Microsoft dudes...
@@ -14619,7 +13534,7 @@
* camel-charset-map.c, camel-charset-map-private.h: synced all charsets
with ones found in libunicode. Just include more "iso/*.h" and rebuild
...private.h with this.
-
+
2000-10-31 Dan Winship <danw@helixcode.com>
* camel-service.c (service_disconnect): Add a new argument, clean,
@@ -14733,7 +13648,7 @@
Content-type parameters when the quoting is mandatory, and deal
with embedded quotes/backslashes when quoting.
-2000-10-27 JPR <jpr@helixcode.com>
+2000-10-27 <jpr@helixcode.com>
* providers/pop3/Makefile.am: Tidy up build
@@ -14747,7 +13662,7 @@
2000-10-26 Kjartan Maraas <kmaraas@gnome.org>
* camel-exceptions-list.def: Add newline to kill warnings.
-
+
2000-10-25 Dan Winship <danw@helixcode.com>
* providers/imap/camel-imap-store.c (get_folder_info): Fix folder
@@ -16844,6 +15759,7 @@
* providers/imap/camel-imap-folder.c:
(summary_get_internal): Same as above.
+
2000-07-27 Jeffrey Stedfast <fejj@helixcode.com>
@@ -18781,6 +17697,7 @@
* camel-mime-part.c (camel_mime_part_set_content): Change
camel_data_wrapper_new to camel_simple_data_wrapper_new.
+
2000-05-17 Darin Adler <darin@eazel.com>
@@ -18919,12 +17836,12 @@
* camel-mime-message.c (finalize): Free message_uid.
(finalize): Free the recipients hashtable.
-2000-05-11 NotZed <notzed@helixcode.com>
+2000-05-11 <notzed@helixcode.com>
* camel-folder-summary.c (camel_folder_summary_finalise): Free
summary items and charset filters.
-2000-05-10 NotZed <notzed@helixcode.com>
+2000-05-10 <notzed@helixcode.com>
* camel-folder-summary.c (camel_folder_summary_finalise): Don't
free stuff in p, after we've free'd p.
@@ -19120,7 +18037,7 @@
* providers/smtp/camel-smtp-provider.c: Note in the description
that this provider is not yet tested.
-2000-05-08 NotZed <notzed@helixcode.com>
+2000-05-08 <notzed@helixcode.com>
* camel-mime-part.c (write_to_stream): Free the filter stream when
done.
@@ -19181,7 +18098,7 @@
returns, and automagically translates 'From ' into '>From' as
necessary.
-2000-05-07 NotZed <notzed@helixcode.com>
+2000-05-07 <notzed@helixcode.com>
* camel-mime-filter.c (filter_run): Oops, forgot to add the
backlen to the pre-buffer (*poof*).
@@ -19208,7 +18125,7 @@
(camel_mbox_summary_load): Removed some fo that checking, it needs
more code to work reliably.
-2000-05-07 NotZed <notzed@helixcode.com>
+2000-05-07 <notzed@helixcode.com>
* providers/mbox/camel-mbox-summary.c (camel_mbox_summary_load):
Set the size and mtime of the mbox we indexed once done.
@@ -19275,7 +18192,7 @@
Commented out some memory profiling stuff.
-2000-05-05 NotZed <notzed@helixcode.com>
+2000-05-05 <notzed@helixcode.com>
* camel-mime-utils.c (header_decode_mailbox): Plug a memory leak.
(header_decode_text): Fixed memory leaks with g_string_append().
@@ -19283,7 +18200,7 @@
glib api is so awful ...
(header_content_type_decode): More memory leaks.
-2000-05-05 NotZed <notzed@helixcode.com>
+2000-05-05 <notzed@helixcode.com>
* camel-mime-parser.c (folder_scan_init_with_fd): Make sure we
init the end of buffer sentinal!
@@ -19466,7 +18383,7 @@
(header_append): Also move the header-start tracking stuff here.
Could be a static function to save code.
-2000-05-02 NotZed <notzed@helixcode.com>
+2000-05-02 <notzed@helixcode.com>
* camel-mime-part-utils.c
(simple_data_wrapper_construct_from_parser): Dont use autofill on
@@ -21375,17 +20292,20 @@
* camel-stream-b64.[ch] :
b64 encoding/decoding is now implemented as
a stream.
+
2000-02-21 bertrand <Bertrand.Guiheneuf@aful.org>
* camel-seekable-substream.c (_reemit_parent_signal):
emit "data_available" when parent stream emits it.
+
2000-02-21 NotZed <NotZed@HelixCode.com>
* providers/mbox/Makefile.am: Uh, fixed LIBADD again. What was
there was never ever going to work, wasn't it tested?
+
2000-02-21 Dan Winship <danw@helixcode.com>
* camel-session.h: (struct _CamelSession): Add authenticator.
diff --git a/camel/Makefile.am b/camel/Makefile.am
index 7055630273..c79045cdfe 100644
--- a/camel/Makefile.am
+++ b/camel/Makefile.am
@@ -1,22 +1,20 @@
## Process this file with automake to produce Makefile.in
-SUBDIRS = . providers tests
+SUBDIRS = providers tests
-libcamelincludedir = $(privincludedir)/camel
+libcamelincludedir = $(includedir)/camel
-camellibexecdir = $(privlibexecdir)/camel
-camellibexec_PROGRAMS = camel-lock-helper camel-index-control
+sbin_PROGRAMS = camel-lock-helper camel-index-control
-privlib_LTLIBRARIES = libcamel.la
+lib_LTLIBRARIES = libcamel.la
noinst_LTLIBRARIES = libcamel-static.la
INCLUDES = -I.. -I$(srcdir)/.. \
-I$(top_srcdir)/intl \
-I$(top_srcdir)/e-util \
- -DCAMEL_LIBEXECDIR=\""$(camellibexecdir)"\" \
+ -DCAMEL_SBINDIR=\""$(sbindir)"\" \
-DCAMEL_PROVIDERDIR=\""$(camel_providerdir)"\" \
-DG_LOG_DOMAIN=\"camel\" \
- -DG_DISABLE_DEPRECATED \
$(CAMEL_CFLAGS)
libcamel_la_SOURCES = \
@@ -55,9 +53,9 @@ libcamel_la_SOURCES = \
camel-mime-filter-bestenc.c \
camel-mime-filter-basic.c \
camel-mime-filter-charset.c \
+ camel-mime-filter-chomp.c \
camel-mime-filter-canon.c \
camel-mime-filter-crlf.c \
- camel-mime-filter-enriched.c \
camel-mime-filter-from.c \
camel-mime-filter-html.c \
camel-mime-filter-tohtml.c \
@@ -112,12 +110,13 @@ libcamel_la_SOURCES = \
camel-transport.c \
camel-uid-cache.c \
camel-url.c \
- camel-url-scanner.c \
camel-utf8.c \
camel-vee-folder.c \
camel-vee-store.c \
camel-vtrash-folder.c \
camel.c \
+ gstring-util.c \
+ hash-table-utils.c \
string-utils.c
libcamelinclude_HEADERS = \
@@ -150,16 +149,15 @@ libcamelinclude_HEADERS = \
camel-http-stream.h \
camel-index.h \
camel-internet-address.h \
- camel-i18n.h \
camel-lock.h \
camel-lock-client.h \
camel-medium.h \
camel-mime-filter-bestenc.h \
camel-mime-filter-basic.h \
camel-mime-filter-charset.h \
+ camel-mime-filter-chomp.h \
camel-mime-filter-canon.h \
camel-mime-filter-crlf.h \
- camel-mime-filter-enriched.h \
camel-mime-filter-from.h \
camel-mime-filter-html.h \
camel-mime-filter-tohtml.h \
@@ -213,15 +211,16 @@ libcamelinclude_HEADERS = \
camel-types.h \
camel-uid-cache.h \
camel-url.h \
- camel-url-scanner.h \
camel-utf8.h \
camel-vee-folder.h \
camel-vee-store.h \
camel-vtrash-folder.h \
camel.h \
+ gstring-util.h \
+ hash-table-utils.h \
string-utils.h
-libcamel_la_LDFLAGS = -version-info 0:0:0
+libcamel_la_LDFLAGS = -version-info 0:0:0 -rpath $(libdir)
libcamel_la_LIBADD = \
$(top_builddir)/e-util/libeutil.la \
@@ -237,24 +236,19 @@ camel_lock_helper_SOURCES = \
camel-lock.c \
camel-lock.h
-# NOTE: This needs to be cleaned up, it shouldn't link with all this crap,
-# because it might be setuid.
-camel_lock_helper_LDADD = \
- $(libcamel_la_LIBADD)
-
camel_index_control_SOURCES = \
camel-index-control.c
camel_index_control_LDADD = \
$(libcamel_la_LIBADD) \
- libcamel.la
-# $(EVOLUTION_MAIL_LIBS)
+ libcamel.la \
+ $(EVOLUTION_MAIL_LIBS)
install-exec-hook:
@if test -n "$(CAMEL_LOCK_HELPER_USER)"; then \
if test `whoami` = root ; then \
- chown $(CAMEL_LOCK_HELPER_USER) $(DESTDIR)$(camellibexecdir)/camel-lock-helper ; \
- chmod u+s $(DESTDIR)$(camellibexecdir)/camel-lock-helper ; \
+ chown $(CAMEL_LOCK_HELPER_USER) $(DESTDIR)$(sbindir)/camel-lock-helper ; \
+ chmod u+s $(DESTDIR)$(sbindir)/camel-lock-helper ; \
else \
echo '*** WARNING ***' ; \
echo "Camel will not be able to open mbox files until you perform the following steps:" ; \
@@ -268,14 +262,14 @@ install-exec-hook:
fi
@if test -n "$(CAMEL_LOCK_HELPER_GROUP)"; then \
if test `whoami` = root ; then \
- chgrp $(CAMEL_LOCK_HELPER_GROUP) $(DESTDIR)$(camellibexecdir)/camel-lock-helper ; \
- chmod g+s $(DESTDIR)$(camellibexecdir)/camel-lock-helper ; \
+ chgrp $(CAMEL_LOCK_HELPER_GROUP) $(DESTDIR)$(sbindir)/camel-lock-helper ; \
+ chmod g+s $(DESTDIR)$(sbindir)/camel-lock-helper ; \
else \
echo '*** WARNING ***' ; \
echo "Camel will not be able to open mbox files until you perform the following steps:" ; \
echo " 1. Become root" ; \
- echo " 2. chgrp $(CAMEL_LOCK_HELPER_GROUP) $(DESTDIR)$(camellibexecdir)/camel-lock-helper" ; \
- echo " 3. chmod g+s $(DESTDIR)$(camellibexecdir)/camel-lock-helper" ; \
+ echo " 2. chgrp $(CAMEL_LOCK_HELPER_GROUP) $(DESTDIR)$(sbindir)/camel-lock-helper" ; \
+ echo " 3. chmod g+s $(DESTDIR)$(sbindir)/camel-lock-helper" ; \
echo '*** WARNING ***' ; \
fi \
else \
diff --git a/camel/camel-filter-search.c b/camel/camel-filter-search.c
index 627b7ad78b..62747dcf17 100644
--- a/camel/camel-filter-search.c
+++ b/camel/camel-filter-search.c
@@ -42,10 +42,15 @@
#include <signal.h>
#include <sys/wait.h>
-#include <e-util/e-sexp.h>
+
+#ifdef HAVE_ALLOCA_H
+#include <alloca.h>
+#endif
#include <gal/util/e-iconv.h>
+#include "e-util/e-sexp.h"
+
#include "camel-mime-message.h"
#include "camel-provider.h"
#include "camel-session.h"
@@ -162,10 +167,8 @@ check_header (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterMess
type = CAMEL_SEARCH_TYPE_ADDRESS_ENCODED;
else {
ct = camel_mime_part_get_content_type (CAMEL_MIME_PART (message));
- if (ct) {
- charset = header_content_type_param (ct, "charset");
- charset = e_iconv_charset_name (charset);
- }
+ if (ct)
+ charset = e_iconv_charset_name(header_content_type_param(ct, "charset"));
}
}
@@ -516,22 +519,18 @@ run_command (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterMessa
if (!(pid = fork ())) {
/* child process */
GPtrArray *args;
- int maxfd, fd, i;
-
- fd = open ("/dev/null", O_WRONLY);
+ int maxfd, i;
- if (dup2 (in_fds[0], STDIN_FILENO) < 0 ||
- dup2 (fd, STDOUT_FILENO) < 0 ||
- dup2 (fd, STDERR_FILENO) < 0)
+ if (dup2 (in_fds[0], STDIN_FILENO) < 0)
_exit (255);
setsid ();
maxfd = sysconf (_SC_OPEN_MAX);
if (maxfd > 0) {
- for (fd = 0; fd < maxfd; fd++) {
- if (fd != STDIN_FILENO && fd != STDOUT_FILENO && fd != STDERR_FILENO)
- close (fd);
+ for (i = 0; i < maxfd; i++) {
+ if (i != STDIN_FILENO && i != STDOUT_FILENO && i != STDERR_FILENO)
+ close (i);
}
}
@@ -548,7 +547,7 @@ run_command (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterMessa
_exit (255);
} else if (pid < 0) {
camel_exception_setv (fms->ex, CAMEL_EXCEPTION_SYSTEM,
- _("Failed to create create child process '%s': %s"),
+ _("Failed to create child process '%s': %s"),
argv[0]->value.string, g_strerror (errno));
return -1;
}
diff --git a/camel/camel-folder-search.c b/camel/camel-folder-search.c
index 00315fafdc..ef6dfc8564 100644
--- a/camel/camel-folder-search.c
+++ b/camel/camel-folder-search.c
@@ -1052,20 +1052,25 @@ search_system_flag (struct _ESExp *f, int argc, struct _ESExpResult **argv, Came
return r;
}
-static ESExpResult *
-search_user_tag(struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFolderSearch *search)
+static ESExpResult *search_user_tag(struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFolderSearch *search)
{
- const char *value = NULL;
ESExpResult *r;
-
+
r(printf("executing user-tag\n"));
-
- if (argc == 1)
- value = camel_tag_get (&search->current->user_tags, argv[0]->value.string);
-
- r = e_sexp_result_new(f, ESEXP_RES_STRING);
- r->value.string = g_strdup (value ? value : "");
-
+
+ /* are we inside a match-all? */
+ if (search->current) {
+ const char *value = NULL;
+ if (argc == 1) {
+ value = camel_tag_get(&search->current->user_tags, argv[0]->value.string);
+ }
+ r = e_sexp_result_new(f, ESEXP_RES_STRING);
+ r->value.string = g_strdup(value?value:"");
+ } else {
+ r = e_sexp_result_new(f, ESEXP_RES_ARRAY_PTR);
+ r->value.ptrarray = g_ptr_array_new();
+ }
+
return r;
}
diff --git a/camel/camel-mime-filter-canon.c b/camel/camel-mime-filter-canon.c
index 43337ae856..80b1b4aeb8 100644
--- a/camel/camel-mime-filter-canon.c
+++ b/camel/camel-mime-filter-canon.c
@@ -197,10 +197,6 @@ complete(CamelMimeFilter *f, char *in, size_t len, size_t prespace, char **out,
}
#if 0
- /* Note: #if 0'd out because we do not want to add a
- * \r\n for PGP/MIME verification if it isn't there in
- * the original content stream */
-
/* check end of line canonicalisation */
if (o>starto) {
if (flags & CAMEL_MIME_FILTER_CANON_CRLF) {
@@ -211,7 +207,7 @@ complete(CamelMimeFilter *f, char *in, size_t len, size_t prespace, char **out,
o--;
}
}
-
+
/* and always finish with an eol */
*o++ = '\n';
#endif
diff --git a/camel/camel-mime-filter-tohtml.c b/camel/camel-mime-filter-tohtml.c
index 60c4686824..b638a315b4 100644
--- a/camel/camel-mime-filter-tohtml.c
+++ b/camel/camel-mime-filter-tohtml.c
@@ -27,37 +27,15 @@
#include <stdio.h>
#include <string.h>
+#include <ctype.h>
-#include "camel-url-scanner.h"
#include "camel-mime-filter-tohtml.h"
-#include "camel-utf8.h"
#define d(x)
-#define CONVERT_WEB_URLS CAMEL_MIME_FILTER_TOHTML_CONVERT_URLS
-#define CONVERT_ADDRSPEC CAMEL_MIME_FILTER_TOHTML_CONVERT_ADDRESSES
-
-static struct {
- unsigned int mask;
- urlpattern_t pattern;
-} patterns[] = {
- { CONVERT_WEB_URLS, { "file://", "", camel_url_file_start, camel_url_file_end } },
- { CONVERT_WEB_URLS, { "ftp://", "", camel_url_web_start, camel_url_web_end } },
- { CONVERT_WEB_URLS, { "http://", "", camel_url_web_start, camel_url_web_end } },
- { CONVERT_WEB_URLS, { "https://", "", camel_url_web_start, camel_url_web_end } },
- { CONVERT_WEB_URLS, { "news://", "", camel_url_web_start, camel_url_web_end } },
- { CONVERT_WEB_URLS, { "nntp://", "", camel_url_web_start, camel_url_web_end } },
- { CONVERT_WEB_URLS, { "telnet://", "", camel_url_web_start, camel_url_web_end } },
- { CONVERT_WEB_URLS, { "www.", "http://", camel_url_web_start, camel_url_web_end } },
- { CONVERT_WEB_URLS, { "ftp.", "ftp://", camel_url_web_start, camel_url_web_end } },
- { CONVERT_ADDRSPEC, { "@", "mailto:", camel_url_addrspec_start, camel_url_addrspec_end } },
-};
-
-#define NUM_URL_PATTERNS (sizeof (patterns) / sizeof (patterns[0]))
-
static void camel_mime_filter_tohtml_class_init (CamelMimeFilterToHTMLClass *klass);
-static void camel_mime_filter_tohtml_init (CamelMimeFilterToHTML *filter);
-static void camel_mime_filter_tohtml_finalize (CamelObject *obj);
+static void camel_mime_filter_tohtml_init (CamelObject *o);
+static void camel_mime_filter_tohtml_finalize (CamelObject *o);
static CamelMimeFilterClass *camel_mime_filter_tohtml_parent;
@@ -82,22 +60,15 @@ camel_mime_filter_tohtml_get_type (void)
}
static void
-camel_mime_filter_tohtml_finalize (CamelObject *obj)
+camel_mime_filter_tohtml_finalize (CamelObject *o)
{
- CamelMimeFilterToHTML *filter = (CamelMimeFilterToHTML *) obj;
-
- camel_url_scanner_free (filter->scanner);
+ ;
}
static void
-camel_mime_filter_tohtml_init (CamelMimeFilterToHTML *filter)
+camel_mime_filter_tohtml_init (CamelObject *o)
{
- filter->scanner = camel_url_scanner_new ();
-
- filter->flags = 0;
- filter->colour = 0;
- filter->column = 0;
- filter->pre_open = FALSE;
+ ;
}
@@ -118,97 +89,188 @@ check_size (CamelMimeFilter *filter, char *outptr, char **outend, size_t len)
return filter->outbuf + offset;
}
-static int
-citation_depth (const char *in)
+
+static unsigned short special_chars[128] = {
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 7, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 7, 4, 3, 0, 0, 0, 0, 7, 3, 7, 0, 0, 7, 12, 12, 1,
+ 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 5, 7, 3, 0, 7, 4,
+ 1, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
+ 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 3, 7, 3, 0, 4,
+ 7, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
+ 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 0, 7, 4, 0, 0,
+};
+
+
+#define IS_NON_ADDR (1 << 0)
+#define IS_NON_URL (1 << 1)
+#define IS_GARBAGE (1 << 2)
+#define IS_DOMAIN (1 << 3)
+
+#define NON_EMAIL_CHARS "()<>@,;:\\\"/[]`'|\n\t "
+#define NON_URL_CHARS "()<>,;\\\"[]`'|\n\t "
+#define TRAILING_URL_GARBAGE ",.!?;:>)}\\`'-_|\n\t "
+
+#define is_addr_char(c) ((unsigned char) (c) < 128 && !(special_chars[(unsigned char) (c)] & IS_NON_ADDR))
+#define is_url_char(c) ((unsigned char) (c) < 128 && !(special_chars[(unsigned char) (c)] & IS_NON_URL))
+#define is_trailing_garbage(c) ((unsigned char) (c) > 127 || (special_chars[(unsigned char) (c)] & IS_GARBAGE))
+#define is_domain_name_char(c) ((unsigned char) (c) < 128 && (special_chars[(unsigned char) (c)] & IS_DOMAIN))
+
+
+#if 0
+static void
+table_init (void)
{
- register const char *inptr = in;
- int depth = 1;
+ int max, ch, i;
+ char *c;
+
+ memset (special_chars, 0, sizeof (special_chars));
+ for (c = NON_EMAIL_CHARS; *c; c++)
+ special_chars[(int) *c] |= IS_NON_ADDR;
+ for (c = NON_URL_CHARS; *c; c++)
+ special_chars[(int) *c] |= IS_NON_URL;
+ for (c = TRAILING_URL_GARBAGE; *c; c++)
+ special_chars[(int) *c] |= IS_GARBAGE;
+
+#define is_ascii_alpha(c) (((c) >= 'A' && (c) <= 'Z') || ((c) >= 'a' && (c) <= 'z'))
+
+ for (ch = 0; ch < 128; ch++) {
+ if (is_ascii_alpha (ch) || isdigit (ch) || ch == '.' || ch == '-')
+ special_chars[ch] |= IS_DOMAIN;
+ }
- if (*inptr++ != '>')
- return 0;
+ max = sizeof (special_chars) / sizeof (special_chars[0]);
+ printf ("static unsigned short special_chars[%d] = {", max);
+ for (i = 0; i < max; i++) {
+ if (i % 16 == 0)
+ printf ("\n\t");
+ printf ("%3d,", special_chars[i]);
+ }
+ printf ("\n};\n");
+}
+#endif
+
+static char *
+url_extract (char **in, int inlen, gboolean check, gboolean *backup)
+{
+ unsigned char *inptr, *inend, *p;
+ char *url;
- /* check that it isn't an escaped From line */
- if (!strncmp (inptr, "From", 4))
- return 0;
+ inptr = (unsigned char *) *in;
+ inend = inptr + inlen;
- while (*inptr != '\n') {
- if (*inptr == ' ')
- inptr++;
-
- if (*inptr++ != '>')
- break;
-
- depth++;
+ while (inptr < inend && is_url_char (*inptr))
+ inptr++;
+
+ if ((char *) inptr == *in)
+ return NULL;
+
+ /* back up if we probably went too far. */
+ while (inptr > (unsigned char *) *in && is_trailing_garbage (*(inptr - 1)))
+ inptr--;
+
+ if (check) {
+ /* make sure we weren't fooled. */
+ p = memchr (*in, ':', (char *) inptr - *in);
+ if (!p)
+ return NULL;
}
- return depth;
+ if (inptr == inend && backup) {
+ *backup = TRUE;
+ return NULL;
+ }
+
+ url = g_strndup (*in, (char *) inptr - *in);
+ *in = inptr;
+
+ return url;
}
static char *
-writeln (CamelMimeFilter *filter, const char *in, const char *inend, char *outptr, char **outend)
+email_address_extract (char **in, char *inend, char *start, char **outptr, gboolean *backup)
{
- CamelMimeFilterToHTML *html = (CamelMimeFilterToHTML *) filter;
- const char *inptr = in;
-
- while (inptr < inend) {
- guint32 u;
+ char *addr, *pre, *end, *dot;
+
+ /* *in points to the '@'. Look backward for a valid local-part */
+ pre = *in;
+ while (pre - 1 >= start && is_addr_char (*(pre - 1)))
+ pre--;
+
+ if (pre == *in)
+ return NULL;
+
+ /* Now look forward for a valid domain part */
+ for (end = *in + 1, dot = NULL; end < inend && is_domain_name_char (*end); end++) {
+ if (*end == '.' && !dot)
+ dot = end;
+ }
+
+ if (end >= inend && backup) {
+ *backup = TRUE;
+ *outptr -= (*in - pre);
+ *in = pre;
+ return NULL;
+ }
+
+ if (!dot)
+ return NULL;
+
+ /* Remove trailing garbage */
+ while (end > *in && is_trailing_garbage (*(end - 1)))
+ end--;
+ if (dot > end)
+ return NULL;
+
+ addr = g_strndup (pre, end - pre);
+ *outptr -= (*in - pre);
+ *in = end;
+
+ return addr;
+}
- outptr = check_size (filter, outptr, outend, 16);
+static gboolean
+is_citation (char *inptr, char *inend, gboolean saw_citation, gboolean *backup)
+{
+ if (*inptr != '>')
+ return FALSE;
+
+ if (inend - inptr >= 6) {
+ /* make sure this isn't just mbox From-magling... */
+ if (strncmp (inptr, ">From ", 6) != 0)
+ return TRUE;
+ } else if (backup) {
+ /* we don't have enough data to tell, so return */
+ *backup = TRUE;
+ return saw_citation;
+ }
+
+ /* if the previous line was a citation, then say this one is too */
+ if (saw_citation)
+ return TRUE;
+
+ /* otherwise it was just an isolated ">From " line */
+ return FALSE;
+}
- u = camel_utf8_getc_limit ((const unsigned char **) &inptr, inend);
- switch (u) {
- case 0xffff:
- g_warning("Truncated utf8 buffer");
- return outptr;
- case '<':
- outptr = g_stpcpy (outptr, "&lt;");
- html->column++;
- break;
- case '>':
- outptr = g_stpcpy (outptr, "&gt;");
- html->column++;
- break;
- case '&':
- outptr = g_stpcpy (outptr, "&amp;");
- html->column++;
- break;
- case '"':
- outptr = g_stpcpy (outptr, "&quot;");
- html->column++;
- break;
- case '\t':
- if (html->flags & (CAMEL_MIME_FILTER_TOHTML_CONVERT_SPACES)) {
- do {
- outptr = check_size (filter, outptr, outend, 7);
- outptr = g_stpcpy (outptr, "&nbsp;");
- html->column++;
- } while (html->column % 8);
- break;
- }
- /* otherwise, FALL THROUGH */
- case ' ':
- if (html->flags & CAMEL_MIME_FILTER_TOHTML_CONVERT_SPACES
- && ((inptr == (in + 1) || *inptr == ' ' || *inptr == '\t'))) {
- outptr = g_stpcpy (outptr, "&nbsp;");
- html->column++;
- break;
- }
- /* otherwise, FALL THROUGH */
- default:
- if (u >= 20 && u <0x80)
- *outptr++ = u;
- else {
- if (html->flags & CAMEL_MIME_FILTER_TOHTML_ESCAPE_8BIT)
- *outptr++ = '?';
- else
- outptr += sprintf(outptr, "&#%u;", u);
- }
- html->column++;
- break;
- }
+static gboolean
+is_protocol (char *inptr, char *inend, gboolean *backup)
+{
+ if (inend - inptr >= 8) {
+ if (!strncasecmp (inptr, "http://", 7) ||
+ !strncasecmp (inptr, "https://", 8) ||
+ !strncasecmp (inptr, "ftp://", 6) ||
+ !strncasecmp (inptr, "nntp://", 7) ||
+ !strncasecmp (inptr, "mailto:", 7) ||
+ !strncasecmp (inptr, "news:", 5) ||
+ !strncasecmp (inptr, "file:", 5))
+ return TRUE;
+ } else if (backup) {
+ *backup = TRUE;
+ return FALSE;
}
- return outptr;
+ return FALSE;
}
static void
@@ -216,128 +278,193 @@ html_convert (CamelMimeFilter *filter, char *in, size_t inlen, size_t prespace,
char **out, size_t *outlen, size_t *outprespace, gboolean flush)
{
CamelMimeFilterToHTML *html = (CamelMimeFilterToHTML *) filter;
- register char *inptr, *outptr;
- char *start, *outend;
- const char *inend;
- int depth;
+ char *inptr, *inend, *outptr, *outend, *start;
+ gboolean backup = FALSE;
camel_mime_filter_set_size (filter, inlen * 2 + 6, FALSE);
- inptr = in;
+ inptr = start = in;
inend = in + inlen;
outptr = filter->outbuf;
outend = filter->outbuf + filter->outsize;
if (html->flags & CAMEL_MIME_FILTER_TOHTML_PRE && !html->pre_open) {
- outptr = g_stpcpy (outptr, "<pre>");
+ outptr += sprintf (outptr, "%s", "<pre>");
html->pre_open = TRUE;
}
- start = inptr;
- while (inptr < inend && *inptr != '\n')
- inptr++;
-
while (inptr < inend) {
- html->column = 0;
- depth = 0;
+ unsigned char u;
- if (html->flags & CAMEL_MIME_FILTER_TOHTML_MARK_CITATION) {
- if ((depth = citation_depth (start)) > 0) {
- char font[25];
-
- /* FIXME: we could easily support multiple colour depths here */
-
- g_snprintf (font, 25, "<font color=\"#%06x\">", html->colour);
-
- outptr = check_size (filter, outptr, &outend, 25);
- outptr = g_stpcpy (outptr, font);
- } else if (*start == '>') {
- /* >From line */
- start++;
+ if (html->flags & CAMEL_MIME_FILTER_TOHTML_MARK_CITATION && html->column == 0) {
+ html->saw_citation = is_citation (inptr, inend, html->saw_citation,
+ flush ? &backup : NULL);
+ if (backup)
+ break;
+
+ if (html->saw_citation) {
+ if (!html->coloured) {
+ char font[25];
+
+ g_snprintf (font, 25, "<font color=\"#%06x\">", html->colour);
+
+ outptr = check_size (filter, outptr, &outend, 25);
+ outptr += sprintf (outptr, "%s", font);
+ html->coloured = TRUE;
+ }
+ } else if (html->coloured) {
+ outptr = check_size (filter, outptr, &outend, 10);
+ outptr += sprintf (outptr, "%s", "</font>");
+ html->coloured = FALSE;
}
- } else if (html->flags & CAMEL_MIME_FILTER_TOHTML_CITE) {
+
+ /* display mbox-mangled ">From " as "From " */
+ if (*inptr == '>' && !html->saw_citation)
+ inptr++;
+ } else if (html->flags & CAMEL_MIME_FILTER_TOHTML_CITE && html->column == 0) {
outptr = check_size (filter, outptr, &outend, 6);
- outptr = g_stpcpy (outptr, "&gt; ");
- html->column += 2;
+ outptr += sprintf (outptr, "%s", "&gt; ");
}
-#define CONVERT_URLS (CAMEL_MIME_FILTER_TOHTML_CONVERT_URLS | CAMEL_MIME_FILTER_TOHTML_CONVERT_ADDRESSES)
- if (html->flags & CONVERT_URLS) {
- size_t matchlen, buflen, len;
- urlmatch_t match;
-
- len = inptr - start;
+ if (html->flags & CAMEL_MIME_FILTER_TOHTML_CONVERT_URLS && isalpha ((int) *inptr)) {
+ char *refurl = NULL, *dispurl = NULL;
- do {
- if (camel_url_scanner_scan (html->scanner, start, len, &match)) {
- /* write out anything before the first regex match */
- outptr = writeln (filter, start, start + match.um_so,
- outptr, &outend);
-
- start += match.um_so;
- len -= match.um_so;
-
- matchlen = match.um_eo - match.um_so;
-
- buflen = 20 + strlen (match.prefix) + matchlen + matchlen;
- outptr = check_size (filter, outptr, &outend, buflen);
-
- /* write out the href tag */
- outptr = g_stpcpy (outptr, "<a href=\"");
- outptr = g_stpcpy (outptr, match.prefix);
- memcpy (outptr, start, matchlen);
- outptr += matchlen;
- outptr = g_stpcpy (outptr, "\">");
-
- /* now write the matched string */
- memcpy (outptr, start, matchlen);
- html->column += matchlen;
- outptr += matchlen;
- start += matchlen;
- len -= matchlen;
-
- /* close the href tag */
- outptr = g_stpcpy (outptr, "</a>");
- } else {
- /* nothing matched so write out the remainder of this line buffer */
- outptr = writeln (filter, start, start + len, outptr, &outend);
+ if (is_protocol (inptr, inend, flush ? &backup : NULL)) {
+ dispurl = url_extract (&inptr, inend - inptr, TRUE,
+ flush ? &backup : NULL);
+ if (backup)
break;
+
+ if (dispurl)
+ refurl = g_strdup (dispurl);
+ } else {
+ if (backup)
+ break;
+
+ if (!strncasecmp (inptr, "www.", 4) && ((unsigned char) inptr[4]) < 0x80
+ && isalnum ((int) inptr[4])) {
+ dispurl = url_extract (&inptr, inend - inptr, FALSE,
+ flush ? &backup : NULL);
+ if (backup)
+ break;
+
+ if (dispurl)
+ refurl = g_strdup_printf ("http://%s", dispurl);
}
- } while (len > 0);
- } else {
- outptr = writeln (filter, start, inptr, outptr, &outend);
- }
-
- if ((html->flags & CAMEL_MIME_FILTER_TOHTML_MARK_CITATION) && depth > 0) {
- outptr = check_size (filter, outptr, &outend, 8);
- outptr = g_stpcpy (outptr, "</font>");
+ }
+
+ if (dispurl) {
+ outptr = check_size (filter, outptr, &outend,
+ strlen (refurl) +
+ strlen (dispurl) + 15);
+ outptr += sprintf (outptr, "<a href=\"%s\">%s</a>",
+ refurl, dispurl);
+ html->column += strlen (dispurl);
+ g_free (refurl);
+ g_free (dispurl);
+ }
+
+ if (inptr >= inend)
+ break;
}
- if (html->flags & CAMEL_MIME_FILTER_TOHTML_CONVERT_NL) {
- outptr = check_size (filter, outptr, &outend, 5);
- outptr = g_stpcpy (outptr, "<br>");
+ if (*inptr == '@' && (html->flags & CAMEL_MIME_FILTER_TOHTML_CONVERT_ADDRESSES)) {
+ char *addr, *outaddr;
+
+ addr = email_address_extract (&inptr, inend, start, &outptr,
+ flush ? &backup : NULL);
+ if (backup)
+ break;
+
+ if (addr) {
+ outaddr = g_strdup_printf ("<a href=\"mailto:%s\">%s</a>",
+ addr, addr);
+ outptr = check_size (filter, outptr, &outend, strlen (outaddr));
+ outptr += sprintf (outptr, "%s", outaddr);
+ html->column += strlen (addr);
+ g_free (addr);
+ g_free (outaddr);
+ }
}
- *outptr++ = '\n';
+ outptr = check_size (filter, outptr, &outend, 32);
- start = ++inptr;
- while (inptr < inend && *inptr != '\n')
- inptr++;
+ switch ((u = (unsigned char) *inptr++)) {
+ case '<':
+ outptr += sprintf (outptr, "%s", "&lt;");
+ html->column++;
+ break;
+
+ case '>':
+ outptr += sprintf (outptr, "%s", "&gt;");
+ html->column++;
+ break;
+
+ case '&':
+ outptr += sprintf (outptr, "%s", "&amp;");
+ html->column++;
+ break;
+
+ case '"':
+ outptr += sprintf (outptr, "%s", "&quot;");
+ html->column++;
+ break;
+
+ case '\n':
+ if (html->flags & CAMEL_MIME_FILTER_TOHTML_CONVERT_NL)
+ outptr += sprintf (outptr, "%s", "<br>");
+
+ *outptr++ = '\n';
+ start = inptr;
+ html->column = 0;
+ break;
+
+ case '\t':
+ if (html->flags & (CAMEL_MIME_FILTER_TOHTML_CONVERT_SPACES)) {
+ do {
+ outptr = check_size (filter, outptr, &outend, 7);
+ outptr += sprintf (outptr, "%s", "&nbsp;");
+ html->column++;
+ } while (html->column % 8);
+ break;
+ }
+ /* otherwise, FALL THROUGH */
+
+ case ' ':
+ if (html->flags & CAMEL_MIME_FILTER_TOHTML_CONVERT_SPACES) {
+ if (inptr == in || (inptr < inend && (*(inptr + 1) == ' ' ||
+ *(inptr + 1) == '\t' ||
+ *(inptr - 1) == '\n'))) {
+ outptr += sprintf (outptr, "%s", "&nbsp;");
+ html->column++;
+ break;
+ }
+ }
+ /* otherwise, FALL THROUGH */
+
+ default:
+ if ((u >= 0x20 && u < 0x80) ||
+ (u == '\r' || u == '\t') || html->flags & CAMEL_MIME_FILTER_TOHTML_PRESERVE_8BIT) {
+ /* Default case, just copy. */
+ *outptr++ = (char) u;
+ } else {
+ if (html->flags & CAMEL_MIME_FILTER_TOHTML_ESCAPE_8BIT)
+ *outptr++ = '?';
+ else
+ outptr += g_snprintf (outptr, 9, "&#%d;", (int) u);
+ }
+ html->column++;
+ break;
+ }
}
- if (flush) {
- /* flush the rest of our input buffer */
- if (start < inend)
- outptr = writeln (filter, start, inend, outptr, &outend);
-
- if (html->pre_open) {
- /* close the pre-tag */
- outptr = check_size (filter, outptr, &outend, 10);
- outptr = g_stpcpy (outptr, "</pre>");
- }
- } else if (start < inend) {
- /* backup */
- camel_mime_filter_backup (filter, start, (unsigned) (inend - start));
+ if (inptr < inend)
+ camel_mime_filter_backup (filter, inptr, inend - inptr);
+
+ if (flush && html->pre_open) {
+ outptr = check_size (filter, outptr, &outend, 10);
+ outptr += sprintf (outptr, "%s", "</pre>");
+ html->pre_open = FALSE;
}
*out = filter->outbuf;
@@ -366,6 +493,8 @@ filter_reset (CamelMimeFilter *filter)
html->column = 0;
html->pre_open = FALSE;
+ html->saw_citation = FALSE;
+ html->coloured = FALSE;
}
static void
@@ -394,39 +523,11 @@ CamelMimeFilter *
camel_mime_filter_tohtml_new (guint32 flags, guint32 colour)
{
CamelMimeFilterToHTML *new;
- int i;
new = CAMEL_MIME_FILTER_TOHTML (camel_object_new (camel_mime_filter_tohtml_get_type ()));
new->flags = flags;
new->colour = colour;
- for (i = 0; i < NUM_URL_PATTERNS; i++) {
- if (patterns[i].mask & flags)
- camel_url_scanner_add (new->scanner, &patterns[i].pattern);
- }
-
return CAMEL_MIME_FILTER (new);
}
-
-
-char *
-camel_text_to_html (const char *in, guint32 flags, guint32 colour)
-{
- CamelMimeFilter *filter;
- size_t outlen, outpre;
- char *outbuf;
-
- g_return_val_if_fail (in != NULL, NULL);
-
- filter = camel_mime_filter_tohtml_new (flags, colour);
-
- camel_mime_filter_complete (filter, (char *) in, strlen (in), 0,
- &outbuf, &outlen, &outpre);
-
- outbuf = g_strndup (outbuf, outlen);
-
- camel_object_unref (filter);
-
- return outbuf;
-}
diff --git a/camel/camel-mime-filter-tohtml.h b/camel/camel-mime-filter-tohtml.h
index de8690a1e0..a37c02ae3c 100644
--- a/camel/camel-mime-filter-tohtml.h
+++ b/camel/camel-mime-filter-tohtml.h
@@ -44,7 +44,6 @@ extern "C" {
#define CAMEL_MIME_FILTER_TOHTML_ESCAPE_8BIT (1 << 6)
#define CAMEL_MIME_FILTER_TOHTML_CITE (1 << 7)
#define CAMEL_MIME_FILTER_TOHTML_PRESERVE_8BIT (1 << 8)
-#define CAMEL_MIME_FILTER_TOHTML_FORMAT_FLOWED (1 << 9)
typedef struct _CamelMimeFilterToHTMLClass CamelMimeFilterToHTMLClass;
typedef struct _CamelMimeFilterToHTML CamelMimeFilterToHTML;
@@ -52,13 +51,13 @@ typedef struct _CamelMimeFilterToHTML CamelMimeFilterToHTML;
struct _CamelMimeFilterToHTML {
CamelMimeFilter parent;
- struct _CamelUrlScanner *scanner;
-
guint32 flags;
guint32 colour;
- guint32 column : 31;
- guint32 pre_open : 1;
+ guint32 column : 29;
+ guint32 pre_open : 1;
+ guint32 saw_citation : 1;
+ guint32 coloured : 1;
};
struct _CamelMimeFilterToHTMLClass {
@@ -70,11 +69,6 @@ CamelType camel_mime_filter_tohtml_get_type (void);
CamelMimeFilter *camel_mime_filter_tohtml_new (guint32 flags, guint32 colour);
-
-/* utility functions to replace e_text_to_html shit */
-
-char *camel_text_to_html (const char *in, guint32 flags, guint32 colour);
-
#ifdef __cplusplus
}
#endif /* __cplusplus */
diff --git a/camel/camel-mime-part.c b/camel/camel-mime-part.c
index 78cdb9c6b7..e041846551 100644
--- a/camel/camel-mime-part.c
+++ b/camel/camel-mime-part.c
@@ -29,10 +29,12 @@
#include <string.h>
#include <stdio.h>
#include <ctype.h>
+
#include <errno.h>
#include <gal/util/e-iconv.h>
+#include "hash-table-utils.h"
#include "camel-mime-parser.h"
#include "camel-stream-mem.h"
#include "camel-stream-filter.h"
@@ -211,7 +213,7 @@ process_header(CamelMedium *medium, const char *header_name, const char *header_
{
CamelMimePart *mime_part = CAMEL_MIME_PART (medium);
CamelHeaderType header_type;
- const char *charset;
+ const char *charset, *p;
char *text;
/* Try to parse the header pair. If it corresponds to something */
@@ -222,10 +224,9 @@ process_header(CamelMedium *medium, const char *header_name, const char *header_
switch (header_type) {
case HEADER_DESCRIPTION: /* raw header->utf8 conversion */
g_free (mime_part->description);
- if (mime_part->content_type) {
- charset = header_content_type_param (mime_part->content_type, "charset");
- charset = e_iconv_charset_name (charset);
- } else
+ if (mime_part->content_type)
+ charset = e_iconv_charset_name(header_content_type_param(mime_part->content_type, "charset"));
+ else
charset = NULL;
mime_part->description = g_strstrip (header_decode_string (header_value, charset));
break;
@@ -488,7 +489,7 @@ camel_mime_part_set_encoding (CamelMimePart *mime_part,
"Content-Transfer-Encoding", text);
}
-CamelMimePartEncodingType
+const CamelMimePartEncodingType
camel_mime_part_get_encoding (CamelMimePart *mime_part)
{
return mime_part->encoding;
@@ -517,7 +518,7 @@ camel_mime_part_get_content_languages (CamelMimePart *mime_part)
/* **** Content-Type: */
void
-camel_mime_part_set_content_type (CamelMimePart *mime_part, const gchar *content_type)
+camel_mime_part_set_content_type (CamelMimePart *mime_part, gchar *content_type)
{
camel_medium_set_header (CAMEL_MEDIUM (mime_part),
"Content-Type", content_type);
@@ -632,8 +633,11 @@ write_to_stream(CamelDataWrapper *data_wrapper, CamelStream *stream)
d(printf("mime_part::write_to_stream\n"));
/* FIXME: something needs to be done about this ... */
- /* TODO: content-languages header? */
-
+ /* FIXME: need to count these bytes too */
+#ifndef NO_WARNINGS
+#warning content-languages should be stored as a header
+#endif
+
if (mp->headers) {
struct _header_raw *h = mp->headers;
char *val;
@@ -797,6 +801,10 @@ construct_from_parser(CamelMimePart *dw, CamelMimeParser *mp)
}
d(printf("mime_part::construct_from_parser() leaving\n"));
+#ifndef NO_WARNINGS
+#warning "Need to work out how to detect a (fatally) bad parse in the parser"
+#endif
+
err = camel_mime_parser_errno(mp);
if (err != 0) {
errno = err;
diff --git a/camel/camel-mime-utils.c b/camel/camel-mime-utils.c
index 6ba498ffa9..257c1574fc 100644
--- a/camel/camel-mime-utils.c
+++ b/camel/camel-mime-utils.c
@@ -39,6 +39,8 @@
#define MAXHOSTNAMELEN 1024
#endif
+#include <iconv.h>
+
#include <time.h>
#include <ctype.h>
@@ -46,8 +48,9 @@
#include <regex.h>
#include <glib.h>
+#include <gal/unicode/gunicode.h>
#include <gal/util/e-iconv.h>
-#include <e-util/e-time-utils.h>
+#include "e-time-utils.h"
#include "camel-mime-utils.h"
#include "camel-charset-map.h"
@@ -1011,7 +1014,7 @@ rfc2047_decode_word(const char *in, size_t len)
d(printf("found ?, encoding is '%c'\n", inptr[0]));
inptr++;
tmplen = inend-inptr-2;
- decword = g_alloca (tmplen); /* this will always be more-than-enough room */
+ decword = alloca(tmplen); /* this will always be more-than-enough room */
switch(toupper(inptr[0])) {
case 'Q':
inlen = quoted_decode(inptr+2, tmplen, decword);
@@ -1032,7 +1035,7 @@ rfc2047_decode_word(const char *in, size_t len)
if (inlen > 0) {
/* yuck, all this snot is to setup iconv! */
tmplen = inptr - in - 3;
- encname = g_alloca (tmplen + 1);
+ encname = alloca (tmplen + 1);
memcpy (encname, in + 2, tmplen);
encname[tmplen] = '\0';
@@ -1053,7 +1056,7 @@ rfc2047_decode_word(const char *in, size_t len)
inbuf = decword;
outlen = inlen * 6 + 16;
- outbase = g_alloca (outlen);
+ outbase = alloca (outlen);
outbuf = outbase;
retry:
@@ -1068,7 +1071,7 @@ rfc2047_decode_word(const char *in, size_t len)
e_iconv_close (ic);
} else {
w(g_warning ("Cannot decode charset, header display may be corrupt: %s: %s",
- charset, strerror (errno)));
+ charset, g_strerror (errno)));
if (!retried) {
charset = e_iconv_locale_charset ();
@@ -1090,6 +1093,18 @@ rfc2047_decode_word(const char *in, size_t len)
return decoded;
}
+/* grrr, glib should have this ! */
+static GString *
+g_string_append_len(GString *st, const char *s, size_t l)
+{
+ char *tmp;
+
+ tmp = alloca(l+1);
+ tmp[l]=0;
+ memcpy(tmp, s, l);
+ return g_string_append(st, tmp);
+}
+
/* ok, a lot of mailers are BROKEN, and send iso-latin1 encoded
headers, when they should just be sticking to US-ASCII
according to the rfc's. Anyway, since the conversion to utf-8
@@ -1126,17 +1141,17 @@ append_8bit (GString *out, const char *inbuf, size_t inlen, const char *charset)
outlen = inlen * 6 + 16;
outbuf = outbase = g_malloc(outlen);
- if (e_iconv (ic, &inbuf, &inlen, &outbuf, &outlen) == (size_t) -1) {
- w(g_warning("Conversion to '%s' failed: %s", charset, strerror (errno)));
+ if (e_iconv(ic, &inbuf, &inlen, &outbuf, &outlen) == (size_t) -1) {
+ w(g_warning("Conversion to '%s' failed: %s", charset, strerror(errno)));
g_free(outbase);
- e_iconv_close (ic);
+ e_iconv_close(ic);
return FALSE;
}
*outbuf = 0;
g_string_append(out, outbase);
g_free(outbase);
- e_iconv_close (ic);
+ e_iconv_close(ic);
return TRUE;
@@ -1149,10 +1164,10 @@ header_decode_text (const char *in, size_t inlen, const char *default_charset)
GString *out;
const char *inptr, *inend, *start, *chunk, *locale_charset;
char *dword = NULL;
-
- locale_charset = e_iconv_locale_charset ();
-
- out = g_string_new ("");
+
+ locale_charset = e_iconv_locale_charset();
+
+ out = g_string_new("");
inptr = in;
inend = inptr + inlen;
chunk = NULL;
@@ -1223,11 +1238,11 @@ rfc2047_encode_word(GString *outstring, const char *in, size_t len, const char *
/* convert utf8->encoding */
bufflen = len * 6 + 16;
- buffer = g_alloca (bufflen);
+ buffer = alloca (bufflen);
inlen = len;
inptr = in;
- ascii = g_alloca (bufflen);
+ ascii = alloca (bufflen);
if (strcasecmp (type, "UTF-8") != 0)
ic = e_iconv_open (type, "UTF-8");
@@ -1279,12 +1294,12 @@ rfc2047_encode_word(GString *outstring, const char *in, size_t len, const char *
convlen = MIN(inlen, CAMEL_FOLD_PREENCODED);
p = inptr;
if (e_iconv (ic, &inptr, &convlen, &out, &outlen) == (size_t) -1) {
- w(g_warning("Conversion problem: conversion truncated: %s", strerror (errno)));
+ w(g_warning("Conversion problem: conversion truncated: %s", strerror(errno)));
/* blah, we include it anyway, better than infinite loop ... */
inptr = p + convlen;
} else {
/* make sure we flush out any shift state */
- e_iconv (ic, NULL, 0, &out, &outlen);
+ e_iconv(ic, NULL, 0, &out, &outlen);
}
inlen -= (inptr - p);
}
@@ -1309,7 +1324,7 @@ rfc2047_encode_word(GString *outstring, const char *in, size_t len, const char *
}
if (ic != (iconv_t) -1)
- e_iconv_close (ic);
+ e_iconv_close(ic);
}
@@ -1561,8 +1576,6 @@ header_encode_phrase_get_words (const unsigned char *in)
return words;
}
-#define MERGED_WORD_LT_FOLDLEN(wordlen, type) ((type) == WORD_2047 ? (wordlen) < CAMEL_FOLD_PREENCODED : (wordlen) < (CAMEL_FOLD_SIZE - 8))
-
static gboolean
header_encode_phrase_merge_words (GList **wordsp)
{
@@ -1580,15 +1593,13 @@ header_encode_phrase_merge_words (GList **wordsp)
next = nextl->data;
/* merge nodes of the same type AND we are not creating too long a string */
if (word_types_compatable (word->type, next->type)) {
- if (MERGED_WORD_LT_FOLDLEN (next->end - word->start, MAX (word->type, next->type))) {
+ if (next->end - word->start < CAMEL_FOLD_PREENCODED) {
/* the resulting word type is the MAX of the 2 types */
word->type = MAX(word->type, next->type);
word->end = next->end;
words = g_list_remove_link (words, nextl);
- g_list_free_1 (nextl);
g_free (next);
-
nextl = g_list_next (wordl);
merged = TRUE;
@@ -2338,7 +2349,7 @@ header_decode_addrspec(const char **in)
*/
static struct _header_address *
-header_decode_mailbox(const char **in, const char *charset)
+header_decode_mailbox(const char **in)
{
const char *inptr = *in;
char *pre;
@@ -2360,7 +2371,7 @@ header_decode_mailbox(const char **in, const char *charset)
char *text, *last;
/* perform internationalised decoding, and append */
- text = header_decode_string (pre, charset);
+ text = header_decode_string (pre, NULL);
g_string_append (name, text);
last = pre;
g_free(text);
@@ -2462,7 +2473,7 @@ header_decode_mailbox(const char **in, const char *charset)
g_string_append_c(addr, *inptr);
/* check for address is encoded word ... */
- text = header_decode_string(addr->str, charset);
+ text = header_decode_string(addr->str, NULL);
if (name == NULL) {
name = addr;
addr = g_string_new("");
@@ -2518,7 +2529,7 @@ header_decode_mailbox(const char **in, const char *charset)
if (comend > comstart) {
d(printf(" looking at subset '%.*s'\n", comend-comstart, comstart));
tmp = g_strndup (comstart, comend-comstart);
- text = header_decode_string (tmp, charset);
+ text = header_decode_string (tmp, NULL);
name = g_string_new (text);
g_free (tmp);
g_free (text);
@@ -2541,7 +2552,7 @@ header_decode_mailbox(const char **in, const char *charset)
}
static struct _header_address *
-header_decode_address(const char **in, const char *charset)
+header_decode_address(const char **in)
{
const char *inptr = *in;
char *pre;
@@ -2566,7 +2577,7 @@ header_decode_address(const char **in, const char *charset)
if (*inptr != ';') {
int go = TRUE;
do {
- member = header_decode_mailbox(&inptr, charset);
+ member = header_decode_mailbox(&inptr);
if (member)
header_address_add_member(addr, member);
header_decode_lwsp(&inptr);
@@ -2585,7 +2596,7 @@ header_decode_address(const char **in, const char *charset)
}
*in = inptr;
} else {
- addr = header_decode_mailbox(in, charset);
+ addr = header_decode_mailbox(in);
}
g_string_free(group, TRUE);
@@ -2811,16 +2822,16 @@ header_references_dup(const struct _header_references *list)
}
struct _header_address *
-header_mailbox_decode(const char *in, const char *charset)
+header_mailbox_decode(const char *in)
{
if (in == NULL)
return NULL;
- return header_decode_mailbox(&in, charset);
+ return header_decode_mailbox(&in);
}
struct _header_address *
-header_address_decode(const char *in, const char *charset)
+header_address_decode(const char *in)
{
const char *inptr = in, *last;
struct _header_address *list = NULL, *addr;
@@ -2836,7 +2847,7 @@ header_address_decode(const char *in, const char *charset)
do {
last = inptr;
- addr = header_decode_address(&inptr, charset);
+ addr = header_decode_address(&inptr);
if (addr)
header_address_list_append(&list, addr);
header_decode_lwsp(&inptr);
@@ -3055,7 +3066,7 @@ header_encode_param (const unsigned char *in, gboolean *encoded)
inbuf = in;
if (e_iconv (cd, &inbuf, &inleft, &outptr, &outleft) == (size_t) -1) {
- w(g_warning ("Conversion problem: conversion truncated: %s", strerror (errno)));
+ w(g_warning ("Conversion problem: conversion truncated: %s", g_strerror (errno)));
} else {
e_iconv (cd, NULL, 0, &outptr, &outleft);
}
@@ -3068,7 +3079,7 @@ header_encode_param (const unsigned char *in, gboolean *encoded)
/* FIXME: set the 'language' as well, assuming we can get that info...? */
out = g_string_new ("");
- g_string_append_printf (out, "%s''", charset);
+ g_string_sprintfa (out, "%s''", charset);
while (inptr < inend) {
unsigned char c = *inptr++;
@@ -3076,9 +3087,9 @@ header_encode_param (const unsigned char *in, gboolean *encoded)
/* FIXME: make sure that '\'', '*', and ';' are also encoded */
if (c > 127) {
- g_string_append_printf (out, "%%%c%c", tohex[(c >> 4) & 0xf], tohex[c & 0xf]);
+ g_string_sprintfa (out, "%%%c%c", tohex[(c >> 4) & 0xf], tohex[c & 0xf]);
} else if (is_lwsp (c) || !(camel_mime_special_table[c] & IS_ESAFE)) {
- g_string_append_printf (out, "%%%c%c", tohex[(c >> 4) & 0xf], tohex[c & 0xf]);
+ g_string_sprintfa (out, "%%%c%c", tohex[(c >> 4) & 0xf], tohex[c & 0xf]);
} else {
g_string_append_c (out, c);
}
@@ -3165,7 +3176,7 @@ header_param_list_format_append (GString *out, struct _header_param *p)
used = 0;
}
- g_string_append_printf (out, "%s*%d%s=", p->name, i++, encoded ? "*" : "");
+ g_string_sprintfa (out, "%s*%d%s=", p->name, i++, encoded ? "*" : "");
if (encoded || !quote)
g_string_append_len (out, inptr, ptr - inptr);
else
@@ -3178,7 +3189,7 @@ header_param_list_format_append (GString *out, struct _header_param *p)
inptr = ptr;
}
} else {
- g_string_append_printf (out, "%s%s=", p->name, encoded ? "*" : "");
+ g_string_sprintfa (out, "%s%s=", p->name, encoded ? "*" : "");
if (encoded || !quote)
g_string_append (out, value);
@@ -3264,32 +3275,31 @@ header_content_type_dump(struct _header_content_type *ct)
}
char *
-header_content_type_format (struct _header_content_type *ct)
+header_content_type_format(struct _header_content_type *ct)
{
GString *out;
char *ret;
-
- if (ct == NULL)
+
+ if (ct==NULL)
return NULL;
-
- out = g_string_new ("");
+
+ out = g_string_new("");
if (ct->type == NULL) {
- g_string_append_printf (out, "text/plain");
- w(g_warning ("Content-Type with no main type"));
+ g_string_sprintfa(out, "text/plain");
+ w(g_warning("Content-Type with no main type"));
} else if (ct->subtype == NULL) {
- w(g_warning ("Content-Type with no sub type: %s", ct->type));
- if (!strcasecmp (ct->type, "multipart"))
- g_string_append_printf (out, "%s/mixed", ct->type);
+ w(g_warning("Content-Type with no sub type: %s", ct->type));
+ if (!strcasecmp(ct->type, "multipart"))
+ g_string_sprintfa(out, "%s/mixed", ct->type);
else
- g_string_append_printf (out, "%s", ct->type);
+ g_string_sprintfa(out, "%s", ct->type);
} else {
- g_string_append_printf (out, "%s/%s", ct->type, ct->subtype);
+ g_string_sprintfa(out, "%s/%s", ct->type, ct->subtype);
}
- header_param_list_format_append (out, ct->params);
-
+ header_param_list_format_append(out, ct->params);
+
ret = out->str;
- g_string_free (out, FALSE);
-
+ g_string_free(out, FALSE);
return ret;
}
@@ -3617,7 +3627,7 @@ header_raw_append_parse(struct _header_raw **list, const char *header, int offse
printf("Invalid header line: '%s'\n", header);
return;
}
- name = g_alloca (fieldlen + 1);
+ name = alloca(fieldlen+1);
memcpy(name, header, fieldlen);
name[fieldlen] = 0;
@@ -4002,10 +4012,10 @@ void header_address_list_clear(struct _header_address **l)
/* if encode is true, then the result is suitable for mailing, otherwise
the result is suitable for display only (and may not even be re-parsable) */
static void
-header_address_list_encode_append (GString *out, int encode, struct _header_address *a)
+header_address_list_encode_append(GString *out, int encode, struct _header_address *a)
{
char *text;
-
+
while (a) {
switch (a->type) {
case HEADER_ADDRESS_NAME:
@@ -4014,65 +4024,64 @@ header_address_list_encode_append (GString *out, int encode, struct _header_addr
else
text = a->name;
if (text && *text)
- g_string_append_printf (out, "%s <%s>", text, a->v.addr);
+ g_string_sprintfa(out, "%s <%s>", text, a->v.addr);
else
- g_string_append (out, a->v.addr);
+ g_string_append(out, a->v.addr);
if (encode)
- g_free (text);
+ g_free(text);
break;
case HEADER_ADDRESS_GROUP:
if (encode)
- text = header_encode_phrase (a->name);
+ text = header_encode_phrase(a->name);
else
text = a->name;
- g_string_append_printf (out, "%s: ", text);
- header_address_list_encode_append (out, encode, a->v.members);
- g_string_append_printf (out, ";");
+ g_string_sprintfa(out, "%s: ", text);
+ header_address_list_encode_append(out, encode, a->v.members);
+ g_string_sprintfa(out, ";");
if (encode)
- g_free (text);
+ g_free(text);
break;
default:
- g_warning ("Invalid address type");
+ g_warning("Invalid address type");
break;
}
a = a->next;
if (a)
- g_string_append (out, ", ");
+ g_string_append(out, ", ");
}
}
char *
-header_address_list_encode (struct _header_address *a)
+header_address_list_encode(struct _header_address *a)
{
GString *out;
char *ret;
-
+
if (a == NULL)
return NULL;
-
- out = g_string_new ("");
- header_address_list_encode_append (out, TRUE, a);
+
+ out = g_string_new("");
+
+ header_address_list_encode_append(out, TRUE, a);
ret = out->str;
- g_string_free (out, FALSE);
-
+ g_string_free(out, FALSE);
return ret;
}
char *
-header_address_list_format (struct _header_address *a)
+header_address_list_format(struct _header_address *a)
{
GString *out;
char *ret;
-
+
if (a == NULL)
return NULL;
-
- out = g_string_new ("");
-
- header_address_list_encode_append (out, FALSE, a);
+
+ out = g_string_new("");
+
+ header_address_list_encode_append(out, FALSE, a);
ret = out->str;
- g_string_free (out, FALSE);
-
+ g_string_free(out, FALSE);
return ret;
}
diff --git a/camel/camel-mime-utils.h b/camel/camel-mime-utils.h
index b949ffcf98..303f29be07 100644
--- a/camel/camel-mime-utils.h
+++ b/camel/camel-mime-utils.h
@@ -111,8 +111,8 @@ void header_address_list_append_list(struct _header_address **l, struct _header_
void header_address_list_append(struct _header_address **, struct _header_address *);
void header_address_list_clear(struct _header_address **);
-struct _header_address *header_address_decode(const char *in, const char *charset);
-struct _header_address *header_mailbox_decode(const char *in, const char *charset);
+struct _header_address *header_address_decode(const char *in);
+struct _header_address *header_mailbox_decode(const char *in);
/* for mailing */
char *header_address_list_encode(struct _header_address *a);
/* for display */
diff --git a/camel/camel-multipart-signed.c b/camel/camel-multipart-signed.c
index 79252c85d0..9bf7054b87 100644
--- a/camel/camel-multipart-signed.c
+++ b/camel/camel-multipart-signed.c
@@ -24,10 +24,6 @@
#include <config.h>
#endif
-#ifdef HAVE_ALLOCA_H
-#include <alloca.h>
-#endif
-
#include <stdio.h>
#include <string.h>
@@ -47,6 +43,7 @@
#include "camel-stream-filter.h"
#include "camel-seekable-substream.h"
+#include "camel-mime-filter-chomp.h"
#include "camel-mime-filter-crlf.h"
#include "camel-mime-filter-canon.h"
diff --git a/camel/camel-sasl-gssapi.c b/camel/camel-sasl-gssapi.c
index 9faa1d8091..4f15c43821 100644
--- a/camel/camel-sasl-gssapi.c
+++ b/camel/camel-sasl-gssapi.c
@@ -264,7 +264,9 @@ gssapi_challenge (CamelSasl *sasl, GByteArray *token, CamelException *ex)
challenge = g_byte_array_new ();
g_byte_array_append (challenge, outbuf.value, outbuf.length);
+#ifndef HAVE_HEIMDAL_KRB5
gss_release_buffer (&minor, &outbuf);
+#endif
break;
case GSSAPI_STATE_COMPLETE:
if (token == NULL) {
@@ -285,7 +287,9 @@ gssapi_challenge (CamelSasl *sasl, GByteArray *token, CamelException *ex)
if (outbuf.length < 4) {
camel_exception_set (ex, CAMEL_EXCEPTION_SERVICE_CANT_AUTHENTICATE,
_("Bad authentication response from server."));
+#ifndef HAVE_HEIMDAL_KRB5
gss_release_buffer (&minor, &outbuf);
+#endif
return NULL;
}
@@ -302,7 +306,10 @@ gssapi_challenge (CamelSasl *sasl, GByteArray *token, CamelException *ex)
memcpy (inbuf.value, outbuf.value, 4);
str[0] = DESIRED_SECURITY_LAYER;
memcpy (str + 4, sasl->service->url->user, inbuf.length - 4);
+
+#ifndef HAVE_HEIMDAL_KRB5
gss_release_buffer (&minor, &outbuf);
+#endif
major = gss_wrap (&minor, priv->ctx, FALSE, qop, &inbuf, &conf_state, &outbuf);
if (major != GSS_S_COMPLETE) {
@@ -314,7 +321,10 @@ gssapi_challenge (CamelSasl *sasl, GByteArray *token, CamelException *ex)
g_free (str);
challenge = g_byte_array_new ();
g_byte_array_append (challenge, outbuf.value, outbuf.length);
+
+#ifndef HAVE_HEIMDAL_KRB5
gss_release_buffer (&minor, &outbuf);
+#endif
priv->state = GSSAPI_STATE_AUTHENTICATED;
diff --git a/camel/camel-stream-filter.c b/camel/camel-stream-filter.c
index e17fcb8377..5330dfadb7 100644
--- a/camel/camel-stream-filter.c
+++ b/camel/camel-stream-filter.c
@@ -51,7 +51,7 @@ struct _CamelStreamFilterPrivate {
size_t filteredlen;
int last_was_read:1; /* was the last op read or write? */
- int flushed:1; /* were the filters flushed? */
+ int flushed:1 /* were the filters flushed? */
};
#define READ_PAD (128) /* bytes padded before buffer */
@@ -376,7 +376,7 @@ do_eos (CamelStream *stream)
{
CamelStreamFilter *filter = (CamelStreamFilter *)stream;
struct _CamelStreamFilterPrivate *p = _PRIVATE(filter);
-
+
if (p->filteredlen > 0)
return FALSE;
diff --git a/camel/camel-tcp-stream-ssl.c b/camel/camel-tcp-stream-ssl.c
index 3a3f234544..f2491d48d4 100644
--- a/camel/camel-tcp-stream-ssl.c
+++ b/camel/camel-tcp-stream-ssl.c
@@ -89,7 +89,6 @@ struct _CamelTcpStreamSSLPrivate {
CamelService *service;
char *expected_host;
gboolean ssl_mode;
- guint32 flags;
};
static void
@@ -161,7 +160,6 @@ camel_tcp_stream_ssl_get_type (void)
* camel_tcp_stream_ssl_new:
* @service: camel service
* @expected_host: host that the stream is expected to connect with.
- * @flags: ENABLE_SSL2, ENABLE_SSL3 and/or ENABLE_TLS
*
* Since the SSL certificate authenticator may need to prompt the
* user, a CamelService is needed. @expected_host is needed as a
@@ -170,7 +168,7 @@ camel_tcp_stream_ssl_get_type (void)
* Return value: a ssl stream (in ssl mode)
**/
CamelStream *
-camel_tcp_stream_ssl_new (CamelService *service, const char *expected_host, guint32 flags)
+camel_tcp_stream_ssl_new (CamelService *service, const char *expected_host)
{
CamelTcpStreamSSL *stream;
@@ -179,7 +177,6 @@ camel_tcp_stream_ssl_new (CamelService *service, const char *expected_host, guin
stream->priv->service = service;
stream->priv->expected_host = g_strdup (expected_host);
stream->priv->ssl_mode = TRUE;
- stream->priv->flags = flags;
return CAMEL_STREAM (stream);
}
@@ -189,7 +186,6 @@ camel_tcp_stream_ssl_new (CamelService *service, const char *expected_host, guin
* camel_tcp_stream_ssl_new_raw:
* @service: camel service
* @expected_host: host that the stream is expected to connect with.
- * @flags: ENABLE_SSL2, ENABLE_SSL3 and/or ENABLE_TLS
*
* Since the SSL certificate authenticator may need to prompt the
* user, a CamelService is needed. @expected_host is needed as a
@@ -198,7 +194,7 @@ camel_tcp_stream_ssl_new (CamelService *service, const char *expected_host, guin
* Return value: a ssl-capable stream (in non ssl mode)
**/
CamelStream *
-camel_tcp_stream_ssl_new_raw (CamelService *service, const char *expected_host, guint32 flags)
+camel_tcp_stream_ssl_new_raw (CamelService *service, const char *expected_host)
{
CamelTcpStreamSSL *stream;
@@ -207,7 +203,6 @@ camel_tcp_stream_ssl_new_raw (CamelService *service, const char *expected_host,
stream->priv->service = service;
stream->priv->expected_host = g_strdup (expected_host);
stream->priv->ssl_mode = FALSE;
- stream->priv->flags = flags;
return CAMEL_STREAM (stream);
}
@@ -630,49 +625,37 @@ camel_certdb_nss_cert_get(CamelCertDB *certdb, CERTCertificate *cert)
{
char *fingerprint, *path;
CamelCert *ccert;
- struct stat st;
- size_t nread;
- ssize_t n;
int fd;
-
- fingerprint = cert_fingerprint (cert);
- ccert = camel_certdb_get_cert (certdb, fingerprint);
+ ssize_t len;
+ struct stat st;
+
+ fingerprint = cert_fingerprint(cert);
+ ccert = camel_certdb_get_cert(certdb, fingerprint);
if (ccert == NULL) {
- g_free (fingerprint);
+ g_free(fingerprint);
return ccert;
}
-
+
if (ccert->rawcert == NULL) {
- path = g_strdup_printf ("%s/.camel_certs/%s", getenv ("HOME"), fingerprint);
- if (stat (path, &st) == -1
- || (fd = open (path, O_RDONLY)) == -1) {
- g_warning ("could not load cert %s: %s", path, strerror (errno));
- g_free (fingerprint);
- g_free (path);
- camel_cert_set_trust (certdb, ccert, CAMEL_CERT_TRUST_UNKNOWN);
- camel_certdb_touch (certdb);
-
+ path = g_strdup_printf("%s/.camel_certs/%s", getenv("HOME"), fingerprint);
+ if (stat(path, &st) == -1
+ || (fd = open(path, O_RDONLY)) == -1) {
+ g_warning("could not load cert %s: %s", path, strerror(errno));
+ g_free(fingerprint);
+ g_free(path);
+ camel_cert_set_trust(certdb, ccert, CAMEL_CERT_TRUST_UNKNOWN);
+ camel_certdb_touch(certdb);
+
return ccert;
}
g_free(path);
- ccert->rawcert = g_byte_array_new ();
- g_byte_array_set_size (ccert->rawcert, st.st_size);
-
- nread = 0;
- do {
- do {
- n = read (fd, ccert->rawcert->data + nread, st.st_size - nread);
- } while (n == -1 && errno == EINTR);
-
- if (n > 0)
- nread += n;
- } while (nread < st.st_size && n != -1);
-
- close (fd);
-
- if (nread != st.st_size) {
- g_warning ("cert size read truncated %s: %d != %ld", path, nread, st.st_size);
+ ccert->rawcert = g_byte_array_new();
+ g_byte_array_set_size(ccert->rawcert, st.st_size);
+ len = read(fd, ccert->rawcert->data, st.st_size);
+ close(fd);
+ if (len != st.st_size) {
+ g_warning("cert size read truncated %s: %d != %ld", path, len, st.st_size);
g_byte_array_free(ccert->rawcert, TRUE);
ccert->rawcert = NULL;
g_free(fingerprint);
@@ -728,12 +711,11 @@ camel_certdb_nss_cert_set(CamelCertDB *certdb, CamelCert *ccert, CERTCertificate
struct stat st;
fingerprint = ccert->fingerprint;
-
+
if (ccert->rawcert == NULL)
- ccert->rawcert = g_byte_array_new ();
-
- g_byte_array_set_size (ccert->rawcert, cert->derCert.len);
- memcpy (ccert->rawcert->data, cert->derCert.data, cert->derCert.len);
+ ccert->rawcert = g_byte_array_new();
+ g_byte_array_set_size(ccert->rawcert, cert->derCert.len);
+ memcpy(ccert->rawcert->data, cert->derCert.data, cert->derCert.len);
dir = g_strdup_printf ("%s/.camel_certs", getenv ("HOME"));
if (stat (dir, &st) == -1 && mkdir (dir, 0700) == -1) {
@@ -745,19 +727,19 @@ camel_certdb_nss_cert_set(CamelCertDB *certdb, CamelCert *ccert, CERTCertificate
path = g_strdup_printf ("%s/%s", dir, fingerprint);
g_free (dir);
- stream = camel_stream_fs_new_with_name (path, O_WRONLY | O_CREAT | O_TRUNC, 0600);
+ stream = camel_stream_fs_new_with_name(path, O_WRONLY|O_CREAT|O_TRUNC, 0600);
if (stream != NULL) {
- if (camel_stream_write (stream, ccert->rawcert->data, ccert->rawcert->len) == -1) {
- g_warning ("Could not save cert: %s: %s", path, strerror (errno));
- unlink (path);
+ if (camel_stream_write(stream, ccert->rawcert->data, ccert->rawcert->len) != ccert->rawcert->len) {
+ g_warning("Could not save cert: %s: %s", path, strerror(errno));
+ unlink(path);
}
- camel_stream_close (stream);
- camel_object_unref (stream);
+ camel_stream_close(stream);
+ camel_object_unref(stream);
} else {
- g_warning ("Could not save cert: %s: %s", path, strerror (errno));
+ g_warning("Could not save cert: %s: %s", path, strerror(errno));
}
- g_free (path);
+ g_free(path);
}
@@ -996,19 +978,6 @@ enable_ssl (CamelTcpStreamSSL *ssl, PRFileDesc *fd)
return NULL;
SSL_OptionSet (ssl_fd, SSL_SECURITY, PR_TRUE);
- if (ssl->priv->flags & CAMEL_TCP_STREAM_SSL_ENABLE_SSL2)
- SSL_OptionSet (ssl_fd, SSL_ENABLE_SSL2, PR_TRUE);
- else
- SSL_OptionSet (ssl_fd, SSL_ENABLE_SSL2, PR_FALSE);
- if (ssl->priv->flags & CAMEL_TCP_STREAM_SSL_ENABLE_SSL3)
- SSL_OptionSet (ssl_fd, SSL_ENABLE_SSL3, PR_TRUE);
- else
- SSL_OptionSet (ssl_fd, SSL_ENABLE_SSL3, PR_FALSE);
- if (ssl->priv->flags & CAMEL_TCP_STREAM_SSL_ENABLE_TLS)
- SSL_OptionSet (ssl_fd, SSL_ENABLE_TLS, PR_TRUE);
- else
- SSL_OptionSet (ssl_fd, SSL_ENABLE_TLS, PR_FALSE);
-
SSL_SetURL (ssl_fd, ssl->priv->expected_host);
/*SSL_GetClientAuthDataHook (sslSocket, ssl_get_client_auth, (void *) certNickname);*/
diff --git a/camel/providers/imap/camel-imap-store-summary.c b/camel/providers/imap/camel-imap-store-summary.c
index 5ba3f955e2..63444f44c3 100644
--- a/camel/providers/imap/camel-imap-store-summary.c
+++ b/camel/providers/imap/camel-imap-store-summary.c
@@ -32,7 +32,7 @@
#include "camel-file-utils.h"
-#include "string-utils.h"
+#include "hash-table-utils.h"
#include "e-util/md5-utils.h"
#include "e-util/e-memory.h"
@@ -366,7 +366,7 @@ CamelImapStoreNamespace *camel_imap_store_summary_namespace_new(CamelImapStoreSu
CamelImapStoreNamespace *ns;
char *p;
int len;
-
+
ns = g_malloc0(sizeof(*ns));
ns->full_name = g_strdup(full_name);
len = strlen(ns->full_name)-1;
diff --git a/camel/providers/imap/camel-imap-store.c b/camel/providers/imap/camel-imap-store.c
index 7004b7d6a7..0fba62fe36 100644
--- a/camel/providers/imap/camel-imap-store.c
+++ b/camel/providers/imap/camel-imap-store.c
@@ -519,7 +519,7 @@ imap_get_capability (CamelService *service, CamelException *ex)
continue;
}
for (i = 0; capabilities[i].name; i++) {
- if (strcasecmp (capa, capabilities[i].name) == 0) {
+ if (g_strcasecmp (capa, capabilities[i].name) == 0) {
store->capabilities |= capabilities[i].flag;
break;
}
@@ -544,9 +544,6 @@ enum {
USE_SSL_WHEN_POSSIBLE
};
-#define SSL_PORT_FLAGS (CAMEL_TCP_STREAM_SSL_ENABLE_SSL2 | CAMEL_TCP_STREAM_SSL_ENABLE_SSL3)
-#define STARTTLS_FLAGS (CAMEL_TCP_STREAM_SSL_ENABLE_TLS)
-
static gboolean
connect_to_server (CamelService *service, int ssl_mode, int try_starttls, CamelException *ex)
{
@@ -566,11 +563,11 @@ connect_to_server (CamelService *service, int ssl_mode, int try_starttls, CamelE
#ifdef HAVE_SSL
if (ssl_mode != USE_SSL_NEVER) {
- if (try_starttls) {
- tcp_stream = camel_tcp_stream_ssl_new_raw (service, service->url->host, STARTTLS_FLAGS);
- } else {
+ if (try_starttls)
+ tcp_stream = camel_tcp_stream_ssl_new_raw (service, service->url->host);
+ else {
port = service->url->port ? service->url->port : 993;
- tcp_stream = camel_tcp_stream_ssl_new (service, service->url->host, SSL_PORT_FLAGS);
+ tcp_stream = camel_tcp_stream_ssl_new (service, service->url->host);
}
} else {
tcp_stream = camel_tcp_stream_raw_new ();
@@ -909,8 +906,8 @@ imap_forget_folder (CamelImapStore *imap_store, const char *folder_name, CamelEx
if (cache)
camel_imap_message_cache_clear (cache);
- camel_object_unref (cache);
- camel_object_unref (summary);
+ camel_object_unref (CAMEL_OBJECT (cache));
+ camel_object_unref (CAMEL_OBJECT (summary));
unlink (summary_file);
g_free (summary_file);
@@ -954,6 +951,13 @@ imap_check_folder_still_extant (CamelImapStore *imap_store, const char *full_nam
return TRUE;
}
+static void
+copy_folder(char *key, CamelFolder *folder, GPtrArray *out)
+{
+ g_ptr_array_add(out, folder);
+ camel_object_ref((CamelObject *)folder);
+}
+
/* This is a little 'hack' to avoid the deadlock conditions that would otherwise
ensue when calling camel_folder_refresh_info from inside a lock */
/* NB: on second thougts this is probably not entirely safe, but it'll do for now */
@@ -968,7 +972,10 @@ imap_store_refresh_folders (CamelImapStore *store, CamelException *ex)
GPtrArray *folders;
int i;
- folders = camel_object_bag_list(CAMEL_STORE (store)->folders);
+ folders = g_ptr_array_new();
+ CAMEL_STORE_LOCK(store, cache_lock);
+ g_hash_table_foreach (CAMEL_STORE (store)->folders, (GHFunc)copy_folder, folders);
+ CAMEL_STORE_UNLOCK(store, cache_lock);
for (i = 0; i <folders->len; i++) {
CamelFolder *folder = folders->pdata[i];
@@ -985,12 +992,12 @@ imap_store_refresh_folders (CamelImapStore *store, CamelException *ex)
* after being offline */
namedup = g_strdup (folder->full_name);
- camel_object_unref(folder);
+ camel_object_unref((CamelObject *)folder);
imap_folder_effectively_unsubscribed (store, namedup, ex);
imap_forget_folder (store, namedup, ex);
g_free (namedup);
} else
- camel_object_unref(folder);
+ camel_object_unref((CamelObject *)folder);
}
g_ptr_array_free (folders, TRUE);
@@ -1097,7 +1104,8 @@ imap_auth_loop (CamelService *service, CamelException *ex)
while (!authenticated) {
if (errbuf) {
/* We need to un-cache the password before prompting again */
- camel_session_forget_password (session, service, "password", ex);
+ camel_session_forget_password (
+ session, service, "password", ex);
g_free (service->url->passwd);
service->url->passwd = NULL;
}
@@ -1111,8 +1119,9 @@ imap_auth_loop (CamelService *service, CamelException *ex)
service->url->user,
service->url->host);
service->url->passwd =
- camel_session_get_password (session, prompt, FALSE, TRUE,
- service, "password", ex);
+ camel_session_get_password (
+ session, prompt, TRUE,
+ service, "password", ex);
g_free (prompt);
g_free (errbuf);
errbuf = NULL;
@@ -1202,7 +1211,7 @@ imap_connect_online (CamelService *service, CamelException *ex)
imap_namespaces_destroy (namespaces);
/* end new code */
- name = camel_strstrcase (result, "NAMESPACE ((");
+ name = strstrcase (result, "NAMESPACE ((");
if (name) {
char *sep;
@@ -1471,7 +1480,7 @@ imap_noop (CamelStore *store, CamelException *ex)
static guint
hash_folder_name (gconstpointer key)
{
- if (strcasecmp (key, "INBOX") == 0)
+ if (g_strcasecmp (key, "INBOX") == 0)
return g_str_hash ("INBOX");
else
return g_str_hash (key);
@@ -1482,9 +1491,9 @@ compare_folder_name (gconstpointer a, gconstpointer b)
{
gconstpointer aname = a, bname = b;
- if (strcasecmp (a, "INBOX") == 0)
+ if (g_strcasecmp (a, "INBOX") == 0)
aname = "INBOX";
- if (strcasecmp (b, "INBOX") == 0)
+ if (g_strcasecmp (b, "INBOX") == 0)
bname = "INBOX";
return g_str_equal (aname, bname);
}
@@ -1528,7 +1537,7 @@ get_folder_status (CamelImapStore *imap_store, const char *folder_name, const ch
if (!status)
return -1;
- p = camel_strstrcase (status, type);
+ p = strstrcase (status, type);
if (p)
out = strtoul (p + strlen (type), NULL, 10);
else
@@ -1550,7 +1559,7 @@ get_folder_online (CamelStore *store, const char *folder_name,
if (!camel_imap_store_connected (imap_store, ex))
return NULL;
- if (!strcasecmp (folder_name, "INBOX"))
+ if (!g_strcasecmp (folder_name, "INBOX"))
folder_name = "INBOX";
/* Lock around the whole lot to check/create atomically */
@@ -1626,7 +1635,7 @@ get_folder_offline (CamelStore *store, const char *folder_name,
!camel_service_connect (CAMEL_SERVICE (store), ex))
return NULL;
- if (!strcasecmp (folder_name, "INBOX"))
+ if (!g_strcasecmp (folder_name, "INBOX"))
folder_name = "INBOX";
storage_path = g_strdup_printf("%s/folders", imap_store->storage_path);
@@ -1951,8 +1960,8 @@ parse_list_response_as_folder_info (CamelImapStore *imap_store,
const char *response)
{
CamelFolderInfo *fi;
- int flags;
- char sep, *dir;
+ int flags, i;
+ char sep, *dir, *name = NULL, *path;
CamelURL *url;
CamelImapStoreInfo *si;
guint32 newflags;
@@ -2189,25 +2198,30 @@ get_folder_counts(CamelImapStore *imap_store, CamelFolderInfo *fi, CamelExceptio
} else {
fi->unread_message_count = get_folder_status (imap_store, fi->full_name, "UNSEEN");
/* if we have this folder open, and the unread count has changed, update */
- folder = camel_object_bag_get(CAMEL_STORE(imap_store)->folders, fi->full_name);
- if (folder && fi->unread_message_count != camel_folder_get_unread_message_count(folder)) {
+ CAMEL_STORE_LOCK(imap_store, cache_lock);
+ folder = g_hash_table_lookup(CAMEL_STORE(imap_store)->folders, fi->full_name);
+ if (folder && fi->unread_message_count != camel_folder_get_unread_message_count(folder))
+ camel_object_ref(folder);
+ else
+ folder = NULL;
+ CAMEL_STORE_UNLOCK(imap_store, cache_lock);
+ if (folder) {
CAMEL_FOLDER_CLASS (CAMEL_OBJECT_GET_CLASS(folder))->refresh_info(folder, ex);
fi->unread_message_count = camel_folder_get_unread_message_count(folder);
- }
- if (folder)
camel_object_unref(folder);
-
+ }
}
CAMEL_SERVICE_UNLOCK (imap_store, connect_lock);
} else {
/* since its cheap, get it if they're open */
- folder = camel_object_bag_get(CAMEL_STORE(imap_store)->folders, fi->full_name);
- if (folder) {
+ CAMEL_STORE_LOCK(imap_store, cache_lock);
+ folder = g_hash_table_lookup(CAMEL_STORE(imap_store)->folders, fi->full_name);
+ if (folder)
fi->unread_message_count = camel_folder_get_unread_message_count(folder);
- camel_object_unref(folder);
- } else
+ else
fi->unread_message_count = -1;
+ CAMEL_STORE_UNLOCK(imap_store, cache_lock);
}
if (fi->child)
diff --git a/camel/providers/sendmail/camel-sendmail-transport.c b/camel/providers/sendmail/camel-sendmail-transport.c
index 863daf1bca..f7059198b0 100644
--- a/camel/providers/sendmail/camel-sendmail-transport.c
+++ b/camel/providers/sendmail/camel-sendmail-transport.c
@@ -189,8 +189,6 @@ sendmail_send_to (CamelTransport *transport, CamelMimeMessage *message,
/* Parent process. Write the message out. */
close (fd[0]);
out = camel_stream_fs_new_with_fd (fd[1]);
-
- /* workaround for lame sendmail implementations that can't handle CRLF eoln sequences */
filter = camel_stream_filter_new_with_stream (out);
crlf = camel_mime_filter_crlf_new (CAMEL_MIME_FILTER_CRLF_DECODE, CAMEL_MIME_FILTER_CRLF_MODE_CRLF_ONLY);
camel_stream_filter_add (filter, crlf);
diff --git a/camel/providers/smtp/camel-smtp-transport.c b/camel/providers/smtp/camel-smtp-transport.c
index 86caa635dc..bfe9737d40 100644
--- a/camel/providers/smtp/camel-smtp-transport.c
+++ b/camel/providers/smtp/camel-smtp-transport.c
@@ -81,7 +81,8 @@ static gboolean smtp_auth (CamelSmtpTransport *transport, const char *mech, Came
static gboolean smtp_mail (CamelSmtpTransport *transport, const char *sender,
gboolean has_8bit_parts, CamelException *ex);
static gboolean smtp_rcpt (CamelSmtpTransport *transport, const char *recipient, CamelException *ex);
-static gboolean smtp_data (CamelSmtpTransport *transport, CamelMimeMessage *message, CamelException *ex);
+static gboolean smtp_data (CamelSmtpTransport *transport, CamelMimeMessage *message,
+ gboolean has_8bit_parts, CamelException *ex);
static gboolean smtp_rset (CamelSmtpTransport *transport, CamelException *ex);
static gboolean smtp_quit (CamelSmtpTransport *transport, CamelException *ex);
@@ -227,9 +228,6 @@ smtp_error_string (int error)
}
}
-#define SSL_PORT_FLAGS (CAMEL_TCP_STREAM_SSL_ENABLE_SSL2 | CAMEL_TCP_STREAM_SSL_ENABLE_SSL3)
-#define STARTTLS_FLAGS (CAMEL_TCP_STREAM_SSL_ENABLE_TLS)
-
static gboolean
connect_to_server (CamelService *service, int try_starttls, CamelException *ex)
{
@@ -254,11 +252,11 @@ connect_to_server (CamelService *service, int try_starttls, CamelException *ex)
#ifdef HAVE_SSL
if (transport->flags & CAMEL_SMTP_TRANSPORT_USE_SSL) {
- if (try_starttls) {
- tcp_stream = camel_tcp_stream_ssl_new_raw (service, service->url->host, STARTTLS_FLAGS);
- } else {
+ if (try_starttls)
+ tcp_stream = camel_tcp_stream_ssl_new_raw (service, service->url->host);
+ else {
port = service->url->port ? service->url->port : 465;
- tcp_stream = camel_tcp_stream_ssl_new (service, service->url->host, SSL_PORT_FLAGS);
+ tcp_stream = camel_tcp_stream_ssl_new (service, service->url->host);
}
} else {
tcp_stream = camel_tcp_stream_raw_new ();
@@ -501,7 +499,7 @@ smtp_connect (CamelService *service, CamelException *ex)
while (!authenticated) {
if (errbuf) {
/* We need to un-cache the password before prompting again */
- camel_session_forget_password (session, service, "password", NULL);
+ camel_session_forget_password (session, service, "password", ex);
g_free (service->url->passwd);
service->url->passwd = NULL;
}
@@ -513,7 +511,7 @@ smtp_connect (CamelService *service, CamelException *ex)
errbuf ? errbuf : "", service->url->user,
service->url->host);
- service->url->passwd = camel_session_get_password (session, prompt, FALSE, TRUE,
+ service->url->passwd = camel_session_get_password (session, prompt, TRUE,
service, "password", ex);
g_free (prompt);
@@ -521,6 +519,8 @@ smtp_connect (CamelService *service, CamelException *ex)
errbuf = NULL;
if (!service->url->passwd) {
+ camel_exception_set (ex, CAMEL_EXCEPTION_USER_CANCEL,
+ _("You didn't enter a password."));
camel_service_disconnect (service, TRUE, NULL);
return FALSE;
}
@@ -721,7 +721,10 @@ smtp_send_to (CamelTransport *transport, CamelMimeMessage *message,
}
}
- if (!smtp_data (smtp_transport, message, ex)) {
+ /* passing in has_8bit_parts saves time as we don't have to
+ recurse through the message all over again if the user is
+ not sending 8bit mime parts */
+ if (!smtp_data (smtp_transport, message, has_8bit_parts, ex)) {
camel_operation_end (NULL);
return FALSE;
}
@@ -1218,23 +1221,26 @@ smtp_rcpt (CamelSmtpTransport *transport, const char *recipient, CamelException
}
static gboolean
-smtp_data (CamelSmtpTransport *transport, CamelMimeMessage *message, CamelException *ex)
+smtp_data (CamelSmtpTransport *transport, CamelMimeMessage *message, gboolean has_8bit_parts, CamelException *ex)
{
CamelBestencEncoding enctype = CAMEL_BESTENC_8BIT;
- struct _header_raw *header, *savedbcc, *n, *tail;
char *cmdbuf, *respbuf = NULL;
CamelStreamFilter *filtered_stream;
CamelMimeFilter *crlffilter;
+ struct _header_raw *header;
+ GSList *h, *bcc = NULL;
int ret;
- /* If the server doesn't support 8BITMIME, set our required encoding to be 7bit */
- if (!(transport->flags & CAMEL_SMTP_TRANSPORT_8BITMIME))
+ /* if the message contains 8bit/binary mime parts and the server
+ doesn't support it, set our required encoding to be 7bit */
+ if (has_8bit_parts && !(transport->flags & CAMEL_SMTP_TRANSPORT_8BITMIME))
enctype = CAMEL_BESTENC_7BIT;
/* FIXME: should we get the best charset too?? */
- /* Changes the encoding of all mime parts to fit within our required
- encoding type and also force any text parts with long lines (longer
- than 998 octets) to wrap by QP or base64 encoding them. */
+ /* Changes the encoding of any 8bit/binary mime parts to fit
+ within our required encoding type and also force any text
+ parts with long lines (longer than 998 octets) to wrap by
+ QP or base64 encoding them. */
camel_mime_message_set_best_encoding (message, CAMEL_BESTENC_GET_ENCODING, enctype);
cmdbuf = g_strdup ("DATA\r\n");
@@ -1278,30 +1284,29 @@ smtp_data (CamelSmtpTransport *transport, CamelMimeMessage *message, CamelExcept
camel_stream_filter_add (filtered_stream, CAMEL_MIME_FILTER (crlffilter));
camel_object_unref (CAMEL_OBJECT (crlffilter));
- /* unlink the bcc headers */
- savedbcc = NULL;
- tail = (struct _header_raw *) &savedbcc;
-
- header = (struct _header_raw *) &CAMEL_MIME_PART (message)->headers;
- n = header->next;
- while (n != NULL) {
- if (!strcasecmp (n->name, "Bcc")) {
- header->next = n->next;
- tail->next = n;
- n->next = NULL;
- tail = n;
- } else {
- header = n;
- }
-
- n = header->next;
+ /* copy and remove the bcc headers */
+ header = CAMEL_MIME_PART (message)->headers;
+ while (header) {
+ if (!g_strcasecmp (header->name, "Bcc"))
+ bcc = g_slist_append (bcc, g_strdup (header->value));
+ header = header->next;
}
+ camel_medium_remove_header (CAMEL_MEDIUM (message), "Bcc");
+
/* write the message */
ret = camel_data_wrapper_write_to_stream (CAMEL_DATA_WRAPPER (message), CAMEL_STREAM (filtered_stream));
- /* restore the bcc headers */
- header->next = savedbcc;
+ /* add the bcc headers back */
+ if (bcc) {
+ h = bcc;
+ while (h) {
+ camel_medium_add_header (CAMEL_MEDIUM (message), "Bcc", h->data);
+ g_free (h->data);
+ h = h->next;
+ }
+ g_slist_free (bcc);
+ }
if (ret == -1) {
camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
diff --git a/composer/ChangeLog b/composer/ChangeLog
index d3be02a563..7b4a65570b 100644
--- a/composer/ChangeLog
+++ b/composer/ChangeLog
@@ -1,526 +1,31 @@
-2003-03-31 Jeffrey Stedfast <fejj@ximian.com>
-
- * e-msg-composer-attachment.glade: Convert to libglade-2's format.
-
- * e-msg-composer.c (set_editor_signature): E_MSG_COMPOSER_HDRS
- (composer->hdrs)->account->id can never be NULL anymore.
-
-2003-03-25 Dan Winship <danw@ximian.com>
-
- * e-msg-composer.c: Update for e_notice move
-
-2003-03-20 Jeffrey Stedfast <fejj@ximian.com>
-
- Fixes for bug #39813
-
- * e-msg-composer.c (composer_finalise): Don't unregister the
- signature event handler here.
- (destroy): Unregister it here instead.
-
-2003-03-19 Jeffrey Stedfast <fejj@ximian.com>
-
- * e-msg-composer.c (add_attachments_handle_mime_part): Change the
- logic to attach text parts when appropriate.
- (map_default_cb): Grab the focus of the To entry widget. Fixes bug
- #39800. Fixes another #warning too.
-
-2003-03-18 Jeffrey Stedfast <fejj@ximian.com>
-
- * e-msg-composer.c (do_exit): e_msg_composer_hdrs_get_subject()
- now returns const so don't g_free() it :-)
- (map_default_cb): Same as above. Also, the subject entry no longer
- derives from GnomeCanvas so eliminate the now unneeded casting to
- grab the focus of the subject widget.
- (e_msg_composer_get_subject): Return a const char * now.
-
- * e-msg-composer-hdrs.c (create_headers): Make the subject entry
- into a GtkEntry so we don't have to worry about i18n and other
- EEntry bugs anymore. Fixes numerous bugs (including #39924).
- (e_msg_composer_hdrs_set_subject): Use gtk_entry_set_text().
- (e_msg_composer_hdrs_to_message_internal):
- e_msg_composer_hdrs_get_subject() now returns const.
- (e_msg_composer_hdrs_get_subject): Return a const char *.
- (entry_changed): e_msg_composer_hdrs_get_subject() now returns
- const.
-
-2003-03-13 Jeffrey Stedfast <fejj@ximian.com>
-
- * e-msg-composer.c (create_composer): Default the composer's title
- to "Create a message". Fixes bug #39696.
-
-2003-03-11 Jeffrey Stedfast <fejj@ximian.com>
-
- * e-msg-composer-attachment-bar.c: Use GnomeIconList instead of
- EIconList so we don't have to maintain an exact copy/paste of
- GnomeIconList ourselves. I don't udnerstand why we ever did.
-
- * e-icon-list.[c,h]: Removed.
-
-2003-03-11 Not Zed <NotZed@Ximian.com>
-
- * evolution-composer.c (evolution_composer_new): add
- send_cb/save_draft_cb arguments.
- (impl_Composer_send): use the local send_cb.
- (evolution_composer_init): dont init send, save-draft signals
- here.
- (evolution_composer_new): init signals here, fix params to
- composer_construct().
- (evolution_composer_factory_init): remove, part of mailer now.
- (factory_fn): same.
- (finalise): disconnect from callbacks first.
-
- * evolution-composer.h: add send_cb/save_draft_cb to composer object.
-
-2003-03-10 Not Zed <NotZed@Ximian.com>
-
- * evolution-composer.c (finalise): from destroy.
- (evolution_composer_class_init): gtkobject->gobject stuff.
- (evolution_composer_new): remove old redundant stuff.
-
-2003-03-04 Jeffrey Stedfast <fejj@ximian.com>
-
- * e-msg-composer.c (composer_get_default_charset_setting): Don't
- allow the returned charset to be NULL.
- (get_file_content): Make sure there is buffered data before trying
- to convert it to UTF-8.
-
-2003-03-04 Not Zed <NotZed@Ximian.com>
-
- * e-msg-composer-hdrs.c (destroy): disconnect any signal handlers
- on the accounts object. For bug #37873.
-
-2003-02-25 Jeffrey Stedfast <fejj@ximian.com>
-
- * e-msg-composer.c: Same as below.
-
- * e-msg-composer-attachment-bar.c: Go back to using
- e_iconv_charset_name().
-
-2003-02-24 Jeffrey Stedfast <fejj@ximian.com>
-
- * e-msg-composer.c (drag_data_received): Make sure the url is !=
- NULL? I can't think of anything else in this code that could
- possibly cause bug #38382.
-
- * e-msg-composer-attachment-bar.c (pixbuf_for_mime_type): Fixed a
- memory leak.
-
-2003-02-22 Jeffrey Stedfast <fejj@ximian.com>
-
- * e-msg-composer.c (e_msg_composer_set_send_html): Don't save the
- HTML format setting to gconf. This option menu is meant for a
- per-essage setting (ie. once the composer closes, the next
- composer will again use the default and not what the user chose
- last time).
-
-2003-02-21 Dan Winship <danw@ximian.com>
-
- * Makefile.am: build libcomposer as a shared library so it can be
- linked into libevolution-mail.so without portability problems
-
-2003-02-20 Jeffrey Stedfast <fejj@ximian.com>
-
- * e-msg-composer.c (composer_get_default_charset_setting): Same as
- below.
-
- * e-msg-composer-attachment-bar.c (get_default_charset): Use
- camel_charset_canonical_name() rather than e_iconv_charset_name()
- as the latter will be removed shortly.
-
-2003-02-18 Jeffrey Stedfast <fejj@ximian.com>
-
- * e-msg-composer-hdrs.c (e_msg_composer_hdrs_set_from_account):
- default_account is now a string value, not an int.
- (create_from_optionmenu): Same.
- (header_new_recipient): Use g_signal_connect_data() instead of the
- now deprecated gtk_signal_connect_full().
-
-2003-02-06 Dan Winship <danw@ximian.com>
-
- * Makefile.am: clean up
-
- * e-msg-composer.c (autosave_manager_query_load_orphans): #include
- string.h
- (menu_file_send_cb): s/gtk_signal_emit/g_signal_emit/
-
- * e-msg-composer-attachment.c: #include string.h
- (e_msg_composer_attachment_edit): s/E_GLADEDIR/EVOLUTION_GLADEDIR
-
- * e-msg-composer-attachment-bar.c: #include string.h
- (pixbuf_for_mime_type): s/ICONSDIR/IMAGESDIR/
-
- * e-msg-composer-hdrs.c: #include string.h
-
- * e-msg-composer-select-file.c (run_selector): Remove unused var
-
- * evolution-composer.c: #include string.h
- (evolution_composer_init): Remove unused var
-
- * listener.c: #include string.h
- (listener_new): Remove unused var
-
-2003-02-05 Jeffrey Stedfast <fejj@ximian.com>
-
- * e-msg-composer.c (e_msg_composer_new_from_url): Split out the
- mailto handling code from here so we can use it in the drag-n-drop
- code too.
- (drag_data_received): If we find a mailto: url in the
- text/uri-list drop, pass that off to handle_mailto() so it can
- fill in the fields for us.
-
-2003-02-03 Jeffrey Stedfast <fejj@ximian.com>
-
- * e-msg-composer-attachment.c: Just use
- gnome_vfs_get_mime_type_from_name().
-
-2003-02-01 Jeffrey Stedfast <fejj@ximian.com>
-
- * e-msg-composer-attachment.c (update_mime_type): Give
- gnome_vfs_get_uri_from_local_path a full path.
-
-2003-01-27 Jeffrey Stedfast <fejj@ximian.com>
-
- * e-msg-composer.c (e_msg_composer_new_from_url): If the subject
- or body components of the mailto url are not in UTF-8, convert
- them to UTF-8.
-
- * e-msg-composer-attachment.c (update_mime_type): Fixed a #warning
- by converting the filename into a uri before passing it into
- gnome_vfs_get_mime_type() since that function really needs a uri.
-
-2003-01-22 Jeffrey Stedfast <fejj@ximian.com>
-
- * e-msg-composer-hdrs.c (init): Get the list of accounts here and
- ref the account-list.
- (destroy): Unref the accounts list here.
- (create_from_optionmenu): Connect to the added/changed/removed
- account-list signals here.
- (account_added_cb): New callback function that adds the newly
- added account to the from-dropdown menu.
- (account_changed_cb): New callback that changes the label for the
- account that got changed in the dropdown menu.
- (account_removed_cb): Removes the account from the from dropdown
- menu.
-
-2003-01-24 Ettore Perazzoli <ettore@ximian.com>
-
- * Makefile.am (iconsdir): Remove, this is now defined in
- configure.in.
-
-2003-01-23 Jeffrey Stedfast <fejj@ximian.com>
-
- * e-msg-composer.c (e_msg_composer_load_config): Load the view
- menu states from gconf.
- (e_msg_composer_set_send_html): Save the setting via gconf instead
- of bonobo-config.
- (e_msg_composer_set_view_from): Same.
- (e_msg_composer_set_view_replyto): Here too.
- (e_msg_composer_set_view_cc): Again here.
- (e_msg_composer_set_view_bcc): And finally here.
- (setup_ui): Fixed a #warning - use gconf instead of bonobo-conf.
- (destroy): No need to sync/destroy the bonobo-conf db, we don't
- use it anymore.
-
-2003-01-16 Ettore Perazzoli <ettore@ximian.com>
-
- * e-msg-composer.c (setup_ui): Get evolution-message-composer.xml
- from EVOLUTION_UI_DIRECTORY.
-
- * Makefile.am (gladedir): Version it using $(BASE_VERSION).
- (iconsdir): Likewise.
- (libcomposerincludedir): Removed.
-
-2003-01-17 Jeffrey Stedfast <fejj@ximian.com>
-
- * evolution-composer.c (impl_Composer_set_headers): Updated to use
- EAccountList and iterators.
- (evolution_composer_init): Updated to use EAccount.
-
- * e-msg-composer.c (from_changed_cb): Updated to use the EAccount
- object.
- (e_msg_composer_new_with_message): Same.
- (e_msg_composer_get_preferred_account): Updated to return an
- EAccount object.
- (set_editor_signature): Updated to use an EAccountIdentity pointer.
- (get_signature_html): Same.
-
- * e-msg-composer-hdrs.c (create_from_optionmenu): Updated to use
- EAccount and EAccountList foo.
- (destroy): Same here.
- (e_msg_composer_hdrs_set_from_account): Here too.
- (e_msg_composer_hdrs_get_from): Updated.
-
-2003-01-16 Jeffrey Stedfast <fejj@ximian.com>
-
- * e-msg-composer.c (signature_cb): mail_config_get_signature_list
- now returns a GSList.
- (setup_signatures_menu): Same.
- (set_signature_gui): Here too.
-
-2003-01-14 Ettore Perazzoli <ettore@ximian.com>
-
- * e-msg-composer.c (do_exit): Make dialog HIG compliant
- [Discard/Cancel/Save].
-
-2003-01-09 Chris Toshok <toshok@ximian.com>
-
- * e-msg-composer-hdrs.c (e_msg_composer_hdrs_set_to): don't pass
- NULL to bonobo_widget_set_property.
- (e_msg_composer_hdrs_set_cc): same.
- (e_msg_composer_hdrs_set_bcc): same.
-
-2003-01-09 Chris Toshok <toshok@ximian.com>
-
- * e-msg-composer-hdrs.c (e_msg_composer_hdrs_new): need to
- ref/sink "new" so that the g_object_unref doesn't spew a warning.
-
-2003-01-08 Ettore Perazzoli <ettore@ximian.com>
-
- * Makefile.am: Icons are now in $(datadir)/evolution/images
- instead of $(datadir)/images/evolution.
-
-2003-01-08 Jeffrey Stedfast <fejj@ximian.com>
-
- * e-msg-composer-hdrs.c (create_from_optionmenu): Use gconf to get
- the default account index.
- (e_msg_composer_hdrs_set_from_account): Same.
-
-2003-01-07 Jeffrey Stedfast <fejj@ximian.com>
-
- * e-msg-composer-attachment-bar.c (get_default_charset): New
- convenience function.
- (attach_to_multipart): Use get_default_charset().
-
- * e-msg-composer.c (composer_get_default_charset): Convenience
- function.
- (get_file_content): Use the convenience function to get the
- default charset setting.
- (best_charset): Same.
- (e_msg_composer_new): Use gconf to get the send_html setting.
- (e_msg_composer_new_post): Same.
-
-2003-01-06 Dan Winship <danw@ximian.com>
-
- * Makefile.am: Remove idldir definition. (It's defined in
- configure.in now)
-
-2002-12-16 Jeffrey Stedfast <fejj@ximian.com>
-
- * e-msg-composer.c (get_signature_html): Use camel_text_to_html().
- (e_msg_composer_new_from_url): Same.
-
- * evolution-composer.c (impl_Composer_set_body): Use
- camel_text_to_html().
-
2002-12-07 Jeffrey Stedfast <fejj@ximian.com>
Fix for bug #33295
- * e-msg-composer-attachment.c: Change the parent_class to a
- GObjectClass pointer instead of a GtkObjectClass pointer.
- (e_msg_composer_attachment_edit): Ref the attachment object so
- that if the attachment is removed while it is still being edited,
- the attachment object will still exist and therefor foil the
- user's attempt to make Evolution crash when they close the
- properties dialog for this attachment.
+ * e-msg-composer-attachment.c (e_msg_composer_attachment_edit):
+ Ref the attachment object so that if the attachment is removed
+ while it is still being edited, the attachment object will still
+ exist and therefor foil the user's attempt to make Evolution crash
+ when they close the properties dialog for this attachment.
(close_cb): Unref the attachment object.
-2002-12-03 Jeffrey Stedfast <fejj@ximian.com>
-
- * e-msg-composer.c (message_rfc822_dnd): Get rid of the unused
- exception variable.
+2002-12-05 Ettore Perazzoli <ettore@ximian.com>
-2002-11-27 Not Zed <NotZed@Ximian.com>
+ [Patch from Chris Lahey <clahey@ximian.com>.]
- * e-msg-composer.c (save): removed warning about e_notice. its
- used too much, its here to stay.
-
- * *.[ch]: run fix.sh over everything.
+ * evolution-composer.c (factory_fn): Do not return a composer if
+ the mailer isn't ready.
2002-12-01 Jeffrey Stedfast <fejj@ximian.com>
- * e-msg-composer.c: s/g_str[n]casecmp/str[n]casecmp
-
-2002-11-26 Not Zed <NotZed@Ximian.com>
-
- * e-msg-composer.c (composer_finalise): properly chain finalise.
-
-2002-11-25 Not Zed <NotZed@Ximian.com>
-
- * e-msg-composer-attachment-bar.c (init): Remove the window size
- setting.
- (e_msg_composer_attachment_bar_new): Move the window size setting
- here. Also set icon width based on 15 approximate characters, so
- the icon text is more readable.
-
-2002-11-22 Not Zed <NotZed@Ximian.com>
-
- * e-msg-composer-select-file.c: rewrote most of this. Just use
- gtkfileselection directly, no e-file-selector, much
- smaller/simpler.
-
-2002-11-21 Not Zed <NotZed@Ximian.com>
-
- * e-msg-composer-attachment-bar.c (remove_attachment): fix
- g_signal_emit params, detail in wrong spot.
- (add_common): Same.
-
- * e-icon-list.c (icon_new_from_pixbuf): remove the
- 'use_broken_event_handling' set.
- (emit_select): Add detail to signal emit.
- (text_changed): Same.
-
- * e-msg-composer.c (subject_changed_cb): Duh! dont free subject &
- simplify logic a little.
-
-2002-11-20 Not Zed <NotZed@Ximian.com>
-
- * e-msg-composer-hdrs.c (entry_changed): duh, emit the signal
- using an initialised value(!).
+ * e-msg-composer.c (e_msg_composer_new_with_message): Make sure to
+ save References and In-Reply-To headers. Fixes bug #32932.
2002-11-19 Radek Doulik <rodo@ximian.com>
* e-msg-composer.c (e_msg_composer_get_sig_file_content): use
CAMEL_MIME_FILTER_TOHTML_PRESERVE_8BIT flag
-2002-11-19 Not Zed <NotZed@Ximian.com>
-
- * e-msg-composer-attachment-bar.c (add_from_file): dont unref
- after destroy. duh.
-
- * e-msg-composer-hdrs.c (e_msg_composer_hdrs_set_to): Add type
- code to set_property call.
- (e_msg_composer_hdrs_set_cc): "
- (e_msg_composer_hdrs_set_bcc): "
- (e_msg_composer_hdrs_get_to): Do the same for get_property calls.
- (init): ref/sink the tooltip object.
- (e_msg_composer_hdrs_get_type): fix return type.
-
- * e-msg-composer.c (GNOME_GTKHTML_EDITOR_CONTROL_ID): we want
- version 3.0 not 1.1.
- (create_composer): Add type code to set property call.
- (autosave_manager_query_load_orphans): my bad, we dont unref
- dialog's once we've destroyed 'em.
- (build_message): "
- (get_file_content): "
- (save): "
- (do_exit): "
- (composer_dispose): moved the autosave shutdown here.
-
-2002-11-18 Not Zed <NotZed@Ximian.com>
-
- * e-msg-composer.c (create_composer): Remove check for
- gtk_main_level(). as far as i can tell it serves no real purpose,
- and i think gtkmain is now redundant.
- (e_msg_composer_new_with_message): Same here.
- (destroy): moved some stuff into finalise, and made destroy
- mulitcall safe.
-
-2002-11-13 Ettore Perazzoli <ettore@ximian.com>
-
- * listener.h: Removed {BEGIN,END}_GNOME_DECLS.
-
- * e-msg-composer-select-file.c: Do not #include
- <libgnome/gnome-defs.h>.
- * e-msg-composer.c: Likewise.
- * listener.h: Likewise.
-
-2002-11-13 Not Zed <NotZed@Ximian.com>
-
- * e-msg-composer.c (setup_ui): bonobo api changes.
-
- * e-icon-list.c (e_icon_list_new): Use the right object_new method.
-
- * e-icon-list.h: get rid of BEGIN/END_GNOME_DECLS stuff.
-
-2002-11-11 Jeffrey Stedfast <fejj@ximian.com>
-
- * e-msg-composer-attachment-bar.c: Remove some unused ehaders and
- ones that cause compilation failures (such as gnome-defs.h).
-
- * e-icon-list.h: Same.
-
-2002-11-08 Not Zed <NotZed@Ximian.com>
-
- * listener.c: Fix bonobo object setup.
-
- * e-msg-composer-hdrs.c: Remove oaf stuff, fix destroy to be
- multi-call safe.
-
- * e-msg-composer-attachment.c (e_msg_composer_attachment_new):
- Remove utf8 from locale conversions, & glib api changes.
- (ok_cb): "
-
- * e-msg-composer-attachment-bar.c (add_from_file): gtk message
- dialog.
- (pixbuf_for_mime_type): glib,gnome-vfs api changes.
- (init): Estimate the icon_height based on the pango font
- description size, this is probably not correct.
- (properties_cb):
- (remove_cb): Changed signature for gnomeui callbacks.
- (popup_icon_context_menu):
- (popup_context_menu): popup_menu api change
- (destroy): Protect from multiple calls.
- (e_msg_composer_attachment_bar_new): Remove push/pop
- visual/colormap stuff.
-
- * composer-marshal.list: The list of marshallers used by the
- composer.
-
- * Makefile.am (composer-marshal.h): Added composer marshal builder.
-
- * evolution-composer.c (class_init): bonobo object epv setup change.
- (factory_fn): Fix changes to factory callback.
-
- * e-icon-list.c: (icon_get_height): Use bounding box to calc
- height.
- (icon_event): drop gtk_selection_extended.
- (e_icon_list_remove): "
- (select_icon):
- (unselect_icon): "
-
- * e-msg-composer.c (autosave_save_draft): Dup fd rather than poke
- camel_stream_fd's data. Also, use camel_stream_close() rather
- than flush.
- (autosave_manager_query_load_orphans): Port to gtk dialog.
- (autosave_query_cb): Removed, redundant.
- (save): Port to gtkdialog.
- (prepare_engine): Fix bonobo-object-client code.
- (get_file_content): gtk dialog
- (do_exit): gtk dialog.
- (setup_signatures_menu): dump gtkutf8 stuff.
- (marshal_NONE__NONE_INT): What WAS jeff thinking? Removed :)
- (class_init): g object setup.
- (e_msg_composer_get_type): "
- (create_composer): remove bonobo_window_construct, use create
- property instead. g_signal stuff. bonobo stuff.
- (is_special_header): Use ascii_strncasecmp
- (e_msg_composer_set_pending_body): gtk->g_object_get/set_data.
- (e_msg_composer_set_body): use ascii_strncasecmp
- (e_msg_composer_add_inline_image_from_mime_part): make cid const.
- (autosave_manager_register):
- (autosave_manager_unregister): Use g_path_get_basename() & account
- for differences.
- (composer_shutdown): rename to finalise/etc.
- (class_init): Use object:finalize instead of shutdown.
- (e_msg_composer_set_body): Use _() rather than U_().
- (build_message): gtk dialog.
-
-2002-11-06 Not Zed <NotZed@Ximian.com>
-
- * e-msg-composer-attachment-bar.c (pixbuf_for_mime_type): Add
- error return to gdk_pixbuf_new_from_file().
-
-2002-11-01 Jeffrey Stedfast <fejj@ximian.com>
-
- * e-msg-composer.c (e_msg_composer_new_from_url): Add support for
- an attach option in the mailto: url.
-
-2002-10-29 Jeffrey Stedfast <fejj@ximian.com>
-
- * e-msg-composer.c (e_msg_composer_new_with_message): Make sure to
- save References and In-Reply-To headers. Fixes bug #32932.
-
2002-10-26 Jeffrey Stedfast <fejj@ximian.com>
* e-msg-composer-attachment-bar.c (attach_to_multipart): Don't set
diff --git a/composer/e-msg-composer-attachment.c b/composer/e-msg-composer-attachment.c
index 2be55b1f69..5da1bf6068 100644
--- a/composer/e-msg-composer-attachment.c
+++ b/composer/e-msg-composer-attachment.c
@@ -23,22 +23,20 @@
/* This is the object representing an email attachment. It is implemented as a
- GObject to make it easier for the application to handle it. For example,
+ GtkObject to make it easier for the application to handle it. For example,
the "changed" signal is emitted whenever something changes in the
attachment. Also, this contains the code to let users edit the
attachment manually. */
#include <sys/stat.h>
-#include <string.h>
#include <errno.h>
-#include <camel/camel.h>
#include <gtk/gtknotebook.h>
#include <gtk/gtktogglebutton.h>
+#include <camel/camel.h>
+#include <gal/widgets/e-unicode.h>
#include <libgnomevfs/gnome-vfs-mime.h>
-#include "e-util/e-mktemp.h"
-
#include "e-msg-composer.h"
#include "e-msg-composer-attachment.h"
@@ -49,30 +47,28 @@ enum {
};
static guint signals[LAST_SIGNAL] = { 0 };
-static GObjectClass *parent_class = NULL;
+static GtkObjectClass *parent_class = NULL;
static void
changed (EMsgComposerAttachment *attachment)
{
- g_signal_emit (attachment, signals[CHANGED], 0);
+ gtk_signal_emit (GTK_OBJECT (attachment), signals[CHANGED]);
}
/* GtkObject methods. */
static void
-finalise(GObject *object)
+destroy (GtkObject *object)
{
EMsgComposerAttachment *attachment;
-
+
attachment = E_MSG_COMPOSER_ATTACHMENT (object);
- camel_object_unref (attachment->body);
+ camel_object_unref (CAMEL_OBJECT (attachment->body));
if (attachment->pixbuf_cache != NULL)
- g_object_unref (attachment->pixbuf_cache);
-
- G_OBJECT_CLASS (parent_class)->finalize (object);
+ gdk_pixbuf_unref (attachment->pixbuf_cache);
}
@@ -81,6 +77,7 @@ finalise(GObject *object)
static void
real_changed (EMsgComposerAttachment *msg_composer_attachment)
{
+ g_return_if_fail (msg_composer_attachment != NULL);
g_return_if_fail (E_IS_MSG_COMPOSER_ATTACHMENT (msg_composer_attachment));
}
@@ -88,22 +85,27 @@ real_changed (EMsgComposerAttachment *msg_composer_attachment)
static void
class_init (EMsgComposerAttachmentClass *klass)
{
- GObjectClass *object_class;
-
- object_class = (GObjectClass*) klass;
- parent_class = g_type_class_ref (G_TYPE_OBJECT);
-
- object_class->finalize = finalise;
+ GtkObjectClass *object_class;
+
+ object_class = (GtkObjectClass*) klass;
+
+ parent_class = gtk_type_class (gtk_object_get_type ());
+
+ object_class->destroy = destroy;
+
+ signals[CHANGED] = gtk_signal_new ("changed",
+ GTK_RUN_FIRST,
+ object_class->type,
+ GTK_SIGNAL_OFFSET
+ (EMsgComposerAttachmentClass,
+ changed),
+ gtk_marshal_NONE__NONE,
+ GTK_TYPE_NONE, 0);
+
+
+ gtk_object_class_add_signals (object_class, signals, LAST_SIGNAL);
+
klass->changed = real_changed;
-
- signals[CHANGED] = g_signal_new ("changed",
- E_TYPE_MSG_COMPOSER_ATTACHMENT,
- G_SIGNAL_RUN_FIRST,
- G_STRUCT_OFFSET (EMsgComposerAttachmentClass, changed),
- NULL,
- NULL,
- g_cclosure_marshal_VOID__VOID,
- G_TYPE_NONE, 0);
}
static void
@@ -115,27 +117,26 @@ init (EMsgComposerAttachment *msg_composer_attachment)
msg_composer_attachment->pixbuf_cache = NULL;
}
-GType
+GtkType
e_msg_composer_attachment_get_type (void)
{
- static GType type = 0;
-
+ static GtkType type = 0;
+
if (type == 0) {
- static const GTypeInfo info = {
- sizeof (EMsgComposerAttachmentClass),
- NULL,
- NULL,
- (GClassInitFunc) class_init,
- NULL,
- NULL,
+ static const GtkTypeInfo info = {
+ "EMsgComposerAttachment",
sizeof (EMsgComposerAttachment),
- 0,
- (GInstanceInitFunc) init,
+ sizeof (EMsgComposerAttachmentClass),
+ (GtkClassInitFunc) class_init,
+ (GtkObjectInitFunc) init,
+ /* reserved_1 */ NULL,
+ /* reserved_2 */ NULL,
+ (GtkClassInitFunc) NULL,
};
-
- type = g_type_register_static (G_TYPE_OBJECT, "EMsgComposerAttachment", &info, 0);
+
+ type = gtk_type_unique (gtk_object_get_type (), &info);
}
-
+
return type;
}
@@ -204,21 +205,21 @@ e_msg_composer_attachment_new (const char *file_name,
} else
camel_data_wrapper_set_mime_type (wrapper, "application/octet-stream");
- camel_object_unref (stream);
+ camel_object_unref (CAMEL_OBJECT (stream));
part = camel_mime_part_new ();
camel_medium_set_content_object (CAMEL_MEDIUM (part), wrapper);
- camel_object_unref (wrapper);
+ camel_object_unref (CAMEL_OBJECT (wrapper));
camel_mime_part_set_disposition (part, disposition);
- filename = g_path_get_basename(file_name);
+ filename = e_utf8_from_locale_string (g_basename (file_name));
camel_mime_part_set_filename (part, filename);
g_free (filename);
#if 0
/* Note: Outlook 2002 is broken with respect to Content-Ids on
non-multipart/related parts, so as an interoperability
- workaround, don't set a Content-Id on these parts. Fixes
+ workwaround, don't set a Content-Id on these parts. Fixes
bug #10032 */
/* set the Content-Id */
content_id = header_msgid_generate ();
@@ -226,7 +227,7 @@ e_msg_composer_attachment_new (const char *file_name,
g_free (content_id);
#endif
- new = g_object_new (E_TYPE_MSG_COMPOSER_ATTACHMENT, NULL);
+ new = gtk_type_new (e_msg_composer_attachment_get_type ());
new->editor_gui = NULL;
new->body = part;
new->size = statbuf.st_size;
@@ -268,7 +269,7 @@ e_msg_composer_attachment_new_from_mime_part (CamelMimePart *part)
camel_object_unref (stream);
- new = g_object_new (E_TYPE_MSG_COMPOSER_ATTACHMENT, NULL);
+ new = gtk_type_new (e_msg_composer_attachment_get_type ());
new->editor_gui = NULL;
new->body = mime_part;
new->guessed_type = FALSE;
@@ -280,14 +281,15 @@ e_msg_composer_attachment_new_from_mime_part (CamelMimePart *part)
/* The attachment property dialog. */
-typedef struct {
+struct _DialogData {
GtkWidget *dialog;
GtkEntry *file_name_entry;
GtkEntry *description_entry;
GtkEntry *mime_type_entry;
GtkToggleButton *disposition_checkbox;
EMsgComposerAttachment *attachment;
-} DialogData;
+};
+typedef struct _DialogData DialogData;
static void
destroy_dialog_data (DialogData *data)
@@ -304,38 +306,45 @@ destroy_dialog_data (DialogData *data)
static void
update_mime_type (DialogData *data)
{
- const char *filename, *mime_type;
-
+ const gchar *mime_type;
+ gchar *file_name;
+
if (!data->attachment->guessed_type)
return;
-
- filename = gtk_entry_get_text (data->file_name_entry);
- if (filename) {
- if ((mime_type = gnome_vfs_mime_type_from_name (filename)))
- gtk_entry_set_text (data->mime_type_entry, mime_type);
- }
+
+ file_name = e_utf8_gtk_entry_get_text (data->file_name_entry);
+ mime_type = gnome_vfs_mime_type_from_name_or_default (file_name, NULL);
+ g_free (file_name);
+
+ if (mime_type)
+ e_utf8_gtk_entry_set_text (data->mime_type_entry, mime_type);
}
static void
-set_entry (GladeXML *xml, const char *widget_name, const char *value)
+set_entry (GladeXML *xml,
+ const gchar *widget_name,
+ const gchar *value)
{
GtkEntry *entry;
-
+
entry = GTK_ENTRY (glade_xml_get_widget (xml, widget_name));
if (entry == NULL)
g_warning ("Entry for `%s' not found.", widget_name);
else
- gtk_entry_set_text (entry, value ? value : "");
+ e_utf8_gtk_entry_set_text (entry, value ? value : "");
}
static void
-connect_widget (GladeXML *gui, const char *name, const char *signal_name,
- GCallback func, gpointer data)
+connect_widget (GladeXML *gui,
+ const gchar *name,
+ const gchar *signal_name,
+ GtkSignalFunc func,
+ gpointer data)
{
GtkWidget *widget;
-
+
widget = glade_xml_get_widget (gui, name);
- g_signal_connect (widget, signal_name, func, data);
+ gtk_signal_connect (GTK_OBJECT (widget), signal_name, func, data);
}
static void
@@ -348,10 +357,10 @@ close_cb (GtkWidget *widget, gpointer data)
attachment = dialog_data->attachment;
gtk_widget_destroy (dialog_data->dialog);
- g_object_unref (attachment->editor_gui);
+ gtk_object_unref (GTK_OBJECT (attachment->editor_gui));
attachment->editor_gui = NULL;
- g_object_unref (attachment);
+ gtk_object_unref (GTK_OBJECT (attachment));
destroy_dialog_data (dialog_data);
}
@@ -361,21 +370,25 @@ ok_cb (GtkWidget *widget, gpointer data)
{
DialogData *dialog_data;
EMsgComposerAttachment *attachment;
- const char *str;
+ char *str;
dialog_data = (DialogData *) data;
attachment = dialog_data->attachment;
- str = gtk_entry_get_text (dialog_data->file_name_entry);
+ str = e_utf8_gtk_entry_get_text (dialog_data->file_name_entry);
camel_mime_part_set_filename (attachment->body, str);
+ g_free (str);
- str = gtk_entry_get_text (dialog_data->description_entry);
+ str = e_utf8_gtk_entry_get_text (dialog_data->description_entry);
camel_mime_part_set_description (attachment->body, str);
+ g_free (str);
- str = gtk_entry_get_text (dialog_data->mime_type_entry);
+ str = e_utf8_gtk_entry_get_text (dialog_data->mime_type_entry);
camel_mime_part_set_content_type (attachment->body, str);
- camel_data_wrapper_set_mime_type(camel_medium_get_content_object(CAMEL_MEDIUM (attachment->body)), str);
+ camel_data_wrapper_set_mime_type (
+ camel_medium_get_content_object (CAMEL_MEDIUM (attachment->body)), str);
+ g_free (str);
switch (gtk_toggle_button_get_active (dialog_data->disposition_checkbox)) {
case 0:
@@ -394,7 +407,9 @@ ok_cb (GtkWidget *widget, gpointer data)
}
static void
-file_name_focus_out_cb (GtkWidget *widget, GdkEventFocus *event, gpointer data)
+file_name_focus_out_cb (GtkWidget *widget,
+ GdkEventFocus *event,
+ gpointer data)
{
DialogData *dialog_data;
@@ -404,15 +419,15 @@ file_name_focus_out_cb (GtkWidget *widget, GdkEventFocus *event, gpointer data)
void
-e_msg_composer_attachment_edit (EMsgComposerAttachment *attachment, GtkWidget *parent)
+e_msg_composer_attachment_edit (EMsgComposerAttachment *attachment,
+ GtkWidget *parent)
{
CamelContentType *content_type;
- const char *disposition;
DialogData *dialog_data;
+ const char *disposition;
GladeXML *editor_gui;
char *type;
- g_return_if_fail (attachment != NULL);
g_return_if_fail (E_IS_MSG_COMPOSER_ATTACHMENT (attachment));
if (attachment->editor_gui != NULL) {
@@ -424,8 +439,8 @@ e_msg_composer_attachment_edit (EMsgComposerAttachment *attachment, GtkWidget *p
return;
}
- editor_gui = glade_xml_new (EVOLUTION_GLADEDIR "/e-msg-composer-attachment.glade",
- NULL, NULL);
+ editor_gui = glade_xml_new (E_GLADEDIR "/e-msg-composer-attachment.glade",
+ NULL);
if (editor_gui == NULL) {
g_warning ("Cannot load `e-msg-composer-attachment.glade'");
return;
@@ -438,8 +453,8 @@ e_msg_composer_attachment_edit (EMsgComposerAttachment *attachment, GtkWidget *p
GTK_WINDOW (gtk_widget_get_toplevel (parent)));
dialog_data = g_new (DialogData, 1);
- g_object_ref (attachment);
dialog_data->attachment = attachment;
+ gtk_object_ref (GTK_OBJECT (attachment));
dialog_data->dialog = glade_xml_get_widget (editor_gui, "dialog");
dialog_data->file_name_entry = GTK_ENTRY (
glade_xml_get_widget (editor_gui, "file_name_entry"));
@@ -461,19 +476,18 @@ e_msg_composer_attachment_edit (EMsgComposerAttachment *attachment, GtkWidget *p
disposition = camel_mime_part_get_disposition (attachment->body);
gtk_toggle_button_set_active (dialog_data->disposition_checkbox,
- disposition && !g_ascii_strcasecmp (disposition, "inline"));
+ disposition && !g_strcasecmp (disposition, "inline"));
- connect_widget (editor_gui, "ok_button", "clicked", (GCallback)ok_cb, dialog_data);
- connect_widget (editor_gui, "close_button", "clicked", (GCallback)close_cb, dialog_data);
+ connect_widget (editor_gui, "ok_button", "clicked", ok_cb, dialog_data);
+ connect_widget (editor_gui, "close_button", "clicked", close_cb, dialog_data);
connect_widget (editor_gui, "file_name_entry", "focus_out_event",
- (GCallback)file_name_focus_out_cb, dialog_data);
+ file_name_focus_out_cb, dialog_data);
-#warning "signal connect while alive"
/* make sure that when the composer gets hidden/closed that our windows also close */
parent = gtk_widget_get_toplevel (parent);
- gtk_signal_connect_while_alive (GTK_OBJECT (parent), "destroy", (GCallback)close_cb, dialog_data,
+ gtk_signal_connect_while_alive (GTK_OBJECT (parent), "destroy", close_cb, dialog_data,
GTK_OBJECT (dialog_data->dialog));
- gtk_signal_connect_while_alive (GTK_OBJECT (parent), "hide", (GCallback)close_cb, dialog_data,
+ gtk_signal_connect_while_alive (GTK_OBJECT (parent), "hide", close_cb, dialog_data,
GTK_OBJECT (dialog_data->dialog));
}
diff --git a/composer/e-msg-composer.c b/composer/e-msg-composer.c
index 5c649e9a6c..e788d85353 100644
--- a/composer/e-msg-composer.c
+++ b/composer/e-msg-composer.c
@@ -41,7 +41,8 @@
#include <config.h>
#endif
-#include <string.h>
+#include <errno.h>
+#include <ctype.h>
#include <stdlib.h>
#include <dirent.h>
#include <sys/time.h>
@@ -49,49 +50,54 @@
#include <sys/stat.h>
#include <sys/wait.h>
#include <unistd.h>
-#include <errno.h>
-#include <ctype.h>
#include <gtk/gtkoptionmenu.h>
-#include <gtk/gtkscrolledwindow.h>
-
-#include <gconf/gconf.h>
-#include <gconf/gconf-client.h>
+#include <gal/unicode/gunicode.h>
+#include <gal/util/e-unicode-i18n.h>
+#include <gal/widgets/e-unicode.h>
+#include <libgnome/gnome-defs.h>
#include <libgnome/gnome-exec.h>
+#include <libgnomeui/gnome-app.h>
#include <libgnomeui/gnome-uidefs.h>
+#include <libgnomeui/gnome-dialog.h>
+#include <libgnomeui/gnome-dialog-util.h>
+#include <libgnomeui/gnome-stock.h>
#include <libgnomeui/gnome-window-icon.h>
#include <bonobo/bonobo-exception.h>
#include <bonobo/bonobo-moniker-util.h>
+#include <bonobo/bonobo-object-client.h>
#include <bonobo/bonobo-stream-memory.h>
#include <bonobo/bonobo-ui-util.h>
#include <bonobo/bonobo-widget.h>
#include <libgnomevfs/gnome-vfs.h>
-#include <gtkhtml/htmlselection.h>
-
#include <glade/glade.h>
-#include <gal/util/e-iconv.h>
+#include <gal/widgets/e-gui-utils.h>
+#include <gal/widgets/e-scroll-frame.h>
#include <gal/e-text/e-entry.h>
-#include "e-util/e-dialog-utils.h"
+#include <gtkhtml/gtkhtml.h>
+#include <gtkhtml/htmlselection.h>
+
#include "widgets/misc/e-charset-picker.h"
#include "camel/camel.h"
#include "camel/camel-charset-map.h"
#include "camel/camel-session.h"
-#include "mail/mail-callbacks.h"
+#include "mail/mail.h"
#include "mail/mail-crypto.h"
-#include "mail/mail-format.h"
#include "mail/mail-tools.h"
#include "mail/mail-ops.h"
#include "mail/mail-mt.h"
#include "mail/mail-session.h"
+#include "e-util/e-html-utils.h"
+
#include "e-msg-composer.h"
#include "e-msg-composer-attachment-bar.h"
#include "e-msg-composer-hdrs.h"
@@ -102,7 +108,7 @@
#include "Editor.h"
#include "listener.h"
-#define GNOME_GTKHTML_EDITOR_CONTROL_ID "OAFIID:GNOME_GtkHTML_Editor:3.0"
+#define GNOME_GTKHTML_EDITOR_CONTROL_ID "OAFIID:GNOME_GtkHTML_Editor:1.1"
#define d(x) x
@@ -143,8 +149,6 @@ static GSList *all_composers = NULL;
/* local prototypes */
static GList *add_recipients (GList *list, const char *recips, gboolean decode);
-static void handle_mailto (EMsgComposer *composer, const char *mailto);
-
static void message_rfc822_dnd (EMsgComposer *composer, CamelStream *stream);
/* used by e_msg_composer_add_message_attachments() */
@@ -184,7 +188,7 @@ get_text (Bonobo_PersistStream persist, char *format)
stream_mem = BONOBO_STREAM_MEM (stream);
text = g_byte_array_new ();
g_byte_array_append (text, stream_mem->buffer, stream_mem->pos);
- bonobo_object_unref (BONOBO_OBJECT (stream));
+ bonobo_object_unref (BONOBO_OBJECT(stream));
return text;
}
@@ -231,25 +235,6 @@ best_encoding (GByteArray *buf, const char *charset)
}
static const char *
-composer_get_default_charset_setting (void)
-{
- GConfClient *gconf;
- const char *charset;
- char *buf;
-
- gconf = gconf_client_get_default ();
- buf = gconf_client_get_string (gconf, "/apps/evolution/mail/composer/charset", NULL);
-
- if (buf == NULL)
- buf = gconf_client_get_string (gconf, "/apps/evolution/mail/format/charset", NULL);
-
- charset = e_iconv_charset_name (buf);
- g_free (buf);
-
- return charset ? charset : "us-ascii";
-}
-
-static const char *
best_charset (GByteArray *buf, const char *default_charset, CamelMimePartEncodingType *encoding)
{
const char *charset;
@@ -266,7 +251,7 @@ best_charset (GByteArray *buf, const char *default_charset, CamelMimePartEncodin
return charset;
/* Now try the user's default charset from the mail config */
- charset = composer_get_default_charset_setting ();
+ charset = mail_config_get_default_charset ();
*encoding = best_encoding (buf, charset);
if (*encoding != -1)
return charset;
@@ -277,7 +262,6 @@ best_charset (GByteArray *buf, const char *default_charset, CamelMimePartEncodin
*encoding = CAMEL_MIME_PART_ENCODING_7BIT;
else
*encoding = best_encoding (buf, charset);
-
return charset;
}
@@ -358,7 +342,7 @@ build_message (EMsgComposer *composer, gboolean save_html_object_data)
/* evil kludgy hack for Redirect */
if (composer->redirect) {
e_msg_composer_hdrs_to_redirect (hdrs, composer->redirect);
- camel_object_ref (composer->redirect);
+ camel_object_ref (CAMEL_OBJECT (composer->redirect));
return composer->redirect;
}
@@ -399,7 +383,7 @@ build_message (EMsgComposer *composer, gboolean save_html_object_data)
plain = camel_data_wrapper_new ();
stream = camel_stream_mem_new_with_byte_array (data);
camel_data_wrapper_construct_from_stream (plain, stream);
- camel_object_unref (stream);
+ camel_object_unref (CAMEL_OBJECT (stream));
camel_data_wrapper_set_mime_type_field (plain, type);
header_content_type_unref (type);
@@ -419,14 +403,14 @@ build_message (EMsgComposer *composer, gboolean save_html_object_data)
if (!data) {
/* The component has probably died */
- camel_object_unref (new);
- camel_object_unref (plain);
+ camel_object_unref (CAMEL_OBJECT (new));
+ camel_object_unref (CAMEL_OBJECT (plain));
return NULL;
}
html = camel_data_wrapper_new ();
stream = camel_stream_mem_new_with_byte_array (data);
camel_data_wrapper_construct_from_stream (html, stream);
- camel_object_unref (stream);
+ camel_object_unref (CAMEL_OBJECT (stream));
camel_data_wrapper_set_mime_type (html, "text/html; charset=utf-8");
/* Build the multipart/alternative */
@@ -437,16 +421,16 @@ build_message (EMsgComposer *composer, gboolean save_html_object_data)
part = camel_mime_part_new ();
camel_medium_set_content_object (CAMEL_MEDIUM (part), plain);
- camel_object_unref (plain);
+ camel_object_unref (CAMEL_OBJECT (plain));
camel_mime_part_set_encoding (part, plain_encoding);
camel_multipart_add_part (body, part);
- camel_object_unref (part);
+ camel_object_unref (CAMEL_OBJECT (part));
part = camel_mime_part_new ();
camel_medium_set_content_object (CAMEL_MEDIUM (part), html);
- camel_object_unref (html);
+ camel_object_unref (CAMEL_OBJECT (html));
camel_multipart_add_part (body, part);
- camel_object_unref (part);
+ camel_object_unref (CAMEL_OBJECT (part));
/* If there are inlined images, construct a
* multipart/related containing the
@@ -463,9 +447,9 @@ build_message (EMsgComposer *composer, gboolean save_html_object_data)
part = camel_mime_part_new ();
camel_medium_set_content_object (CAMEL_MEDIUM (part), CAMEL_DATA_WRAPPER (body));
- camel_object_unref (body);
+ camel_object_unref (CAMEL_OBJECT (body));
camel_multipart_add_part (html_with_images, part);
- camel_object_unref (part);
+ camel_object_unref (CAMEL_OBJECT (part));
add_inlined_images (composer, html_with_images);
clear_current_images (composer);
@@ -491,9 +475,9 @@ build_message (EMsgComposer *composer, gboolean save_html_object_data)
camel_medium_set_content_object (CAMEL_MEDIUM (part), current);
if (current == plain)
camel_mime_part_set_encoding (part, plain_encoding);
- camel_object_unref (current);
+ camel_object_unref (CAMEL_OBJECT (current));
camel_multipart_add_part (multipart, part);
- camel_object_unref (part);
+ camel_object_unref (CAMEL_OBJECT (part));
e_msg_composer_attachment_bar_to_multipart (attachment_bar, multipart, composer->charset);
@@ -516,7 +500,7 @@ build_message (EMsgComposer *composer, gboolean save_html_object_data)
camel_medium_set_content_object (CAMEL_MEDIUM (part), current);
if (current == plain)
camel_mime_part_set_encoding (part, plain_encoding);
- camel_object_unref (current);
+ camel_object_unref (CAMEL_OBJECT (current));
if (composer->pgp_sign) {
CamelInternetAddress *from = NULL;
@@ -647,14 +631,14 @@ build_message (EMsgComposer *composer, gboolean save_html_object_data)
}
current = camel_medium_get_content_object (CAMEL_MEDIUM (part));
- camel_object_ref (current);
- camel_object_unref (part);
+ camel_object_ref (CAMEL_OBJECT (current));
+ camel_object_unref (CAMEL_OBJECT (part));
}
camel_medium_set_content_object (CAMEL_MEDIUM (new), current);
if (current == plain)
camel_mime_part_set_encoding (CAMEL_MIME_PART (new), plain_encoding);
- camel_object_unref (current);
+ camel_object_unref (CAMEL_OBJECT (current));
#if defined (HAVE_NSS) && defined (SMIME_SUPPORTED)
if (composer->smime_sign) {
@@ -675,12 +659,12 @@ build_message (EMsgComposer *composer, gboolean save_html_object_data)
smime_mesg = mail_crypto_smime_sign (new, certname, TRUE, TRUE, &ex);
if (from)
- camel_object_unref (from);
+ camel_object_unref (CAMEL_OBJECT (from));
if (camel_exception_is_set (&ex))
goto exception;
- camel_object_unref (new);
+ camel_object_unref (CAMEL_OBJECT (new));
new = smime_mesg;
}
@@ -709,7 +693,7 @@ build_message (EMsgComposer *composer, gboolean save_html_object_data)
g_ptr_array_add (recipients, g_strdup (address));
if (from)
- camel_object_unref (addr);
+ camel_object_unref (CAMEL_OBJECT (addr));
}
addr = camel_mime_message_get_recipients (new, CAMEL_RECIPIENT_TYPE_TO);
@@ -738,7 +722,7 @@ build_message (EMsgComposer *composer, gboolean save_html_object_data)
smime_mesg = mail_crypto_smime_encrypt (new, address, recipients, &ex);
- camel_object_unref (from);
+ camel_object_unref (CAMEL_OBJECT (from));
for (i = 0; i < recipients->len; i++)
g_free (recipients->pdata[i]);
@@ -747,7 +731,7 @@ build_message (EMsgComposer *composer, gboolean save_html_object_data)
if (camel_exception_is_set (&ex))
goto exception;
- camel_object_unref (new);
+ camel_object_unref (CAMEL_OBJECT (new));
new = smime_mesg;
}
@@ -766,19 +750,16 @@ build_message (EMsgComposer *composer, gboolean save_html_object_data)
exception:
if (part != CAMEL_MIME_PART (new))
- camel_object_unref (part);
+ camel_object_unref (CAMEL_OBJECT (part));
- camel_object_unref (new);
+ camel_object_unref (CAMEL_OBJECT (new));
if (camel_exception_is_set (&ex)) {
GtkWidget *dialog;
-
- dialog = gtk_message_dialog_new(GTK_WINDOW(composer),
- GTK_DIALOG_MODAL|GTK_DIALOG_DESTROY_WITH_PARENT,
- GTK_MESSAGE_ERROR, GTK_BUTTONS_OK,
- "%s", camel_exception_get_description (&ex));
- gtk_dialog_run(GTK_DIALOG(dialog));
- gtk_widget_destroy(dialog);
+
+ dialog = gnome_error_dialog_parented (camel_exception_get_description (&ex),
+ GTK_WINDOW (composer));
+ gnome_dialog_run_and_close (GNOME_DIALOG (dialog));
camel_exception_clear (&ex);
}
@@ -800,16 +781,13 @@ get_file_content (EMsgComposer *composer, const char *file_name, gboolean want_h
fd = open (file_name, O_RDONLY);
if (fd == -1) {
+ char *msg;
+
if (warn) {
- GtkWidget *dialog;
-
- dialog = gtk_message_dialog_new(GTK_WINDOW(composer),
- GTK_DIALOG_MODAL|GTK_DIALOG_DESTROY_WITH_PARENT,
- GTK_MESSAGE_ERROR, GTK_BUTTONS_OK,
- _("Error while reading file %s:\n%s"),
- file_name, g_strerror (errno));
- gtk_dialog_run(GTK_DIALOG(dialog));
- gtk_widget_destroy(dialog);
+ msg = g_strdup_printf (_("Error while reading file %s:\n%s"),
+ file_name, g_strerror (errno));
+ gnome_error_dialog (msg);
+ g_free (msg);
}
return g_strdup ("");
}
@@ -839,7 +817,7 @@ get_file_content (EMsgComposer *composer, const char *file_name, gboolean want_h
signature file that is in his/her locale charset. If it's not in UTF-8 and not in
the charset the composer is in (or their default mail charset) then fuck it,
there's nothing we can do. */
- if (buffer->len && !g_utf8_validate (buffer->data, buffer->len, NULL)) {
+ if (!g_utf8_validate (buffer->data, buffer->len, NULL)) {
stream = (CamelStream *) memstream;
memstream = (CamelStreamMem *) camel_stream_mem_new ();
camel_stream_mem_set_byte_array (memstream, g_byte_array_new ());
@@ -847,7 +825,7 @@ get_file_content (EMsgComposer *composer, const char *file_name, gboolean want_h
filtered_stream = camel_stream_filter_new_with_stream (stream);
camel_object_unref (stream);
- charset = composer ? composer->charset : composer_get_default_charset_setting ();
+ charset = composer ? composer->charset : mail_config_get_default_charset ();
charenc = (CamelMimeFilter *) camel_mime_filter_charset_new_convert (charset, "utf-8");
camel_stream_filter_add (filtered_stream, charenc);
camel_object_unref (charenc);
@@ -888,8 +866,8 @@ prepare_engine (EMsgComposer *composer)
/* printf ("prepare_engine\n"); */
CORBA_exception_init (&ev);
- composer->editor_engine = (GNOME_GtkHTML_Editor_Engine) Bonobo_Unknown_queryInterface
- (bonobo_widget_get_objref (BONOBO_WIDGET (composer->editor)), "IDL:GNOME/GtkHTML/Editor/Engine:1.0", &ev);
+ composer->editor_engine = (GNOME_GtkHTML_Editor_Engine) bonobo_object_client_query_interface
+ (bonobo_widget_get_server (BONOBO_WIDGET (composer->editor)), "IDL:GNOME/GtkHTML/Editor/Engine:1.0", &ev);
if ((composer->editor_engine != CORBA_OBJECT_NIL) && (ev._major == CORBA_NO_EXCEPTION)) {
/* printf ("trying set listener\n"); */
@@ -1013,29 +991,27 @@ decode_signature_name (const gchar *name)
return dname;
}
-#define CONVERT_SPACES CAMEL_MIME_FILTER_TOHTML_CONVERT_SPACES
-
-static char *
+static gchar *
get_signature_html (EMsgComposer *composer)
{
gboolean format_html = FALSE;
char *text = NULL, *html = NULL, *sig_file = NULL, *script = NULL;
-
+
if (composer->signature) {
sig_file = composer->signature->filename;
format_html = composer->signature->html;
script = composer->signature->script;
} else if (composer->auto_signature) {
- EAccountIdentity *id;
- char *organization;
- char *address;
- char *name;
-
+ MailConfigIdentity *id;
+ gchar *address;
+ gchar *name;
+ gchar *organization;
+
id = E_MSG_COMPOSER_HDRS (composer->hdrs)->account->id;
- address = id->address ? camel_text_to_html (id->address, CONVERT_SPACES, 0) : NULL;
- name = id->name ? camel_text_to_html (id->name, CONVERT_SPACES, 0) : NULL;
- organization = id->organization ? camel_text_to_html (id->organization, CONVERT_SPACES, 0) : NULL;
-
+ address = id->address ? e_text_to_html (id->address, E_TEXT_TO_HTML_CONVERT_SPACES) : NULL;
+ name = id->name ? e_text_to_html (id->name, E_TEXT_TO_HTML_CONVERT_SPACES) : NULL;
+ organization = id->organization ? e_text_to_html (id->organization, E_TEXT_TO_HTML_CONVERT_SPACES) : NULL;
+
text = g_strdup_printf ("-- <BR>%s%s%s%s%s%s%s%s",
name ? name : "",
(address && *address) ? " &lt;<A HREF=\"mailto:" : "",
@@ -1124,6 +1100,22 @@ set_editor_text (EMsgComposer *composer, const char *text)
bonobo_object_unref (BONOBO_OBJECT (stream));
}
+static void
+set_config (EMsgComposer *composer, char *key, int val)
+{
+ char *full_key;
+
+ if (composer->config_db == CORBA_OBJECT_NIL)
+ return;
+
+ full_key = g_strconcat ("/Mail/Composer/", key, NULL);
+
+ bonobo_config_set_long (composer->config_db, full_key, val, NULL);
+
+ g_free (full_key);
+}
+
+
/* Commands. */
static void
@@ -1131,10 +1123,10 @@ show_attachments (EMsgComposer *composer,
gboolean show)
{
if (show) {
- gtk_widget_show (composer->attachment_scrolled_window);
+ gtk_widget_show (composer->attachment_scroll_frame);
gtk_widget_show (composer->attachment_bar);
} else {
- gtk_widget_hide (composer->attachment_scrolled_window);
+ gtk_widget_hide (composer->attachment_scroll_frame);
gtk_widget_hide (composer->attachment_bar);
}
@@ -1163,18 +1155,25 @@ save (EMsgComposer *composer, const char *file_name)
/* check to see if we already have the file */
if ((fd = open (my_file_name, O_RDONLY | O_CREAT | O_EXCL, 0777)) == -1) {
- GtkWidget *dialog;
- int resp;
-
- dialog = gtk_message_dialog_new(GTK_WINDOW(composer),
- GTK_DIALOG_MODAL|GTK_DIALOG_DESTROY_WITH_PARENT,
- GTK_MESSAGE_QUESTION, GTK_BUTTONS_YES_NO,
- _("File exists, overwrite?"));
- resp = gtk_dialog_run(GTK_DIALOG(dialog));
- gtk_widget_destroy(dialog);
- if (resp != GTK_RESPONSE_YES) {
- g_free(my_file_name);
+ GtkWidget *dialog, *label;
+
+ dialog = gnome_dialog_new (_("Warning!"),
+ GNOME_STOCK_BUTTON_YES,
+ GNOME_STOCK_BUTTON_NO,
+ NULL);
+ label = gtk_label_new (_("File exists, overwrite?"));
+ gtk_widget_show (label);
+ gtk_box_pack_start (GTK_BOX (GNOME_DIALOG (dialog)->vbox), label, TRUE, TRUE, 0);
+
+ switch (gnome_dialog_run_and_close (GNOME_DIALOG (dialog))) {
+ case -1:
+ gtk_widget_destroy (dialog);
+ return;
+ case 1:
return;
+ default:
+ /* ie, the user hit "Yes" so just continue as normal */
+ break;
}
} else
close (fd);
@@ -1184,11 +1183,8 @@ save (EMsgComposer *composer, const char *file_name)
Bonobo_PersistFile_save (composer->persist_file_interface, my_file_name, &ev);
if (ev._major != CORBA_NO_EXCEPTION) {
- char *tmp = g_path_get_basename(my_file_name);
-
- e_notice (composer, GTK_MESSAGE_ERROR,
- _("Error saving file: %s"), tmp);
- g_free(tmp);
+ e_notice (GTK_WINDOW (composer), GNOME_MESSAGE_BOX_ERROR,
+ _("Error saving file: %s"), g_basename (my_file_name));
} else
GNOME_GtkHTML_Editor_Engine_runCommand (composer->editor_engine, "saved", &ev);
@@ -1206,13 +1202,9 @@ load (EMsgComposer *composer, const char *file_name)
Bonobo_PersistFile_load (composer->persist_file_interface, file_name, &ev);
- if (ev._major != CORBA_NO_EXCEPTION) {
- char *tmp = g_path_get_basename(file_name);
-
- e_notice (composer, GTK_MESSAGE_ERROR,
- _("Error loading file: %s"), tmp);
- g_free(tmp);
- }
+ if (ev._major != CORBA_NO_EXCEPTION)
+ e_notice (GTK_WINDOW (composer), GNOME_MESSAGE_BOX_ERROR,
+ _("Error loading file: %s"), g_basename (file_name));
CORBA_exception_free (&ev);
}
@@ -1237,14 +1229,14 @@ autosave_save_draft (EMsgComposer *composer)
CamelMimeMessage *message;
CamelStream *stream;
char *file;
- int fd, camelfd;
+ int fd;
gboolean success = TRUE;
fd = composer->autosave_fd;
file = composer->autosave_file;
if (fd == -1) {
- e_notice (composer, GTK_MESSAGE_ERROR,
+ e_notice (GTK_WINDOW (composer), GNOME_MESSAGE_BOX_ERROR,
_("Error accessing file: %s"), file);
return FALSE;
}
@@ -1252,47 +1244,40 @@ autosave_save_draft (EMsgComposer *composer)
message = e_msg_composer_get_message_draft (composer);
if (message == NULL) {
- e_notice (composer, GTK_MESSAGE_ERROR,
+ e_notice (GTK_WINDOW (composer), GNOME_MESSAGE_BOX_ERROR,
_("Unable to retrieve message from editor"));
return FALSE;
}
if (lseek (fd, (off_t)0, SEEK_SET) == -1) {
- camel_object_unref (message);
- e_notice (composer, GTK_MESSAGE_ERROR,
+ camel_object_unref (CAMEL_OBJECT (message));
+ e_notice (GTK_WINDOW (composer), GNOME_MESSAGE_BOX_ERROR,
_("Unable to seek on file: %s\n%s"), file, g_strerror (errno));
return FALSE;
}
if (ftruncate (fd, (off_t)0) == -1) {
- camel_object_unref (message);
- e_notice (composer, GTK_MESSAGE_ERROR,
+ camel_object_unref (CAMEL_OBJECT (message));
+ e_notice (GTK_WINDOW (composer), GNOME_MESSAGE_BOX_ERROR,
_("Unable to truncate file: %s\n%s"), file, g_strerror (errno));
return FALSE;
}
-
- /* dup the fd because we dont want camel to close it when done */
- camelfd = dup(fd);
- if (fd == -1) {
- camel_object_unref (message);
- e_notice (composer, GTK_MESSAGE_ERROR,
- _("Unable to copy file descriptor: %s\n%s"), file, g_strerror (errno));
- return FALSE;
- }
/* this does an lseek so we don't have to */
- stream = camel_stream_fs_new_with_fd (camelfd);
+ stream = camel_stream_fs_new_with_fd (fd);
if (camel_data_wrapper_write_to_stream (CAMEL_DATA_WRAPPER (message), stream) == -1
- || camel_stream_close (CAMEL_STREAM (stream)) == -1) {
- e_notice (composer, GTK_MESSAGE_ERROR,
+ || camel_stream_flush (CAMEL_STREAM (stream)) == -1) {
+ e_notice (GTK_WINDOW (composer), GNOME_MESSAGE_BOX_ERROR,
_("Error autosaving message: %s\n %s"), file, strerror(errno));
success = FALSE;
}
- camel_object_unref (stream);
+ /* set the fd to -1 in the stream so camel doesn't close it we want to keep it open */
+ CAMEL_STREAM_FS (stream)->fd = -1;
+ camel_object_unref (CAMEL_OBJECT (stream));
- camel_object_unref (message);
+ camel_object_unref (CAMEL_OBJECT (message));
return success;
}
@@ -1321,13 +1306,13 @@ autosave_load_draft (const char *filename)
if (composer) {
autosave_save_draft (composer);
- g_signal_connect (GTK_OBJECT (composer), "send",
- G_CALLBACK (composer_send_cb), NULL);
+ gtk_signal_connect (GTK_OBJECT (composer), "send",
+ GTK_SIGNAL_FUNC (composer_send_cb), NULL);
gtk_widget_show (GTK_WIDGET (composer));
}
- camel_object_unref (stream);
+ camel_object_unref ((CamelObject *)stream);
return composer;
}
@@ -1338,8 +1323,17 @@ autosave_is_owned (AutosaveManager *am, const char *file)
}
static void
+autosave_query_cb (gint reply, gpointer data)
+{
+ int *yes = data;
+
+ *yes = !reply;
+}
+
+static void
autosave_manager_query_load_orphans (AutosaveManager *am, EMsgComposer *composer)
{
+ GtkWidget *dialog;
DIR *dir;
struct dirent *d;
GSList *match = NULL;
@@ -1362,7 +1356,7 @@ autosave_manager_query_load_orphans (AutosaveManager *am, EMsgComposer *composer
* check if the file has any length, It is a valid case if it doesn't
* so we simply don't ask then.
*/
- if (stat (filename, &st) == -1 || st.st_size == 0) {
+ if (stat (filename, &st) < 0 || st.st_size == 0) {
unlink (filename);
g_free (filename);
continue;
@@ -1374,15 +1368,11 @@ autosave_manager_query_load_orphans (AutosaveManager *am, EMsgComposer *composer
closedir (dir);
if (match != NULL) {
- GtkWidget *dialog;
-
- dialog = gtk_message_dialog_new(GTK_WINDOW(composer),
- GTK_DIALOG_MODAL|GTK_DIALOG_DESTROY_WITH_PARENT,
- GTK_MESSAGE_ERROR, GTK_BUTTONS_YES_NO,
- _("Ximian Evolution has found unsaved files from a previous session.\n"
- "Would you like to try to recover them?"));
- load = gtk_dialog_run(GTK_DIALOG(dialog)) == GTK_RESPONSE_YES;
- gtk_widget_destroy(dialog);
+ dialog = gnome_question_dialog_parented (_("Ximian Evolution has found unsaved files from a previous session.\n"
+ "Would you like to try to recover them?"),
+ autosave_query_cb, &load, GTK_WINDOW (composer));
+
+ gnome_dialog_run_and_close (GNOME_DIALOG (dialog));
}
while (match != NULL) {
@@ -1472,7 +1462,7 @@ autosave_manager_register (AutosaveManager *am, EMsgComposer *composer)
g_return_if_fail (composer != NULL);
if (autosave_init_file (composer)) {
- key = g_path_get_basename (composer->autosave_file);
+ key = g_basename (composer->autosave_file);
g_hash_table_insert (am->table, key, composer);
if (am->ask) {
/* keep recursion out of our bedrooms. */
@@ -1487,18 +1477,10 @@ autosave_manager_register (AutosaveManager *am, EMsgComposer *composer)
static void
autosave_manager_unregister (AutosaveManager *am, EMsgComposer *composer)
{
- char *key, *oldkey;
- void *olddata;
-
if (!composer->autosave_file)
return;
- key = g_path_get_basename(composer->autosave_file);
- if (g_hash_table_lookup_extended(am->table, key, (void **)&oldkey, &olddata)) {
- g_hash_table_remove(am->table, oldkey);
- g_free(oldkey);
- g_free(key);
- }
+ g_hash_table_remove (am->table, g_basename (composer->autosave_file));
/* only remove the file if we can successfully save it */
/* FIXME this test could probably be more efficient */
@@ -1516,7 +1498,7 @@ autosave_manager_unregister (AutosaveManager *am, EMsgComposer *composer)
static void
menu_file_save_draft_cb (BonoboUIComponent *uic, void *data, const char *path)
{
- g_signal_emit (data, signals[SAVE_DRAFT], 0, FALSE);
+ gtk_signal_emit (GTK_OBJECT (data), signals[SAVE_DRAFT], FALSE);
e_msg_composer_unset_changed (E_MSG_COMPOSER (data));
}
@@ -1525,7 +1507,7 @@ menu_file_save_draft_cb (BonoboUIComponent *uic, void *data, const char *path)
static void
do_exit (EMsgComposer *composer)
{
- const char *subject;
+ char *subject, *subject_utf8, *label;
GtkWidget *dialog;
int button;
@@ -1536,36 +1518,38 @@ do_exit (EMsgComposer *composer)
gdk_window_raise (GTK_WIDGET (composer)->window);
- subject = e_msg_composer_hdrs_get_subject (E_MSG_COMPOSER_HDRS (composer->hdrs));
+ subject_utf8 = e_msg_composer_hdrs_get_subject (E_MSG_COMPOSER_HDRS (composer->hdrs));
+ subject = e_utf8_to_locale_string (subject_utf8);
+ g_free (subject_utf8);
+
+ label = g_strdup_printf (_("The message \"%s\" has not been sent.\n\nDo you wish to save your changes?"), subject);
+ g_free (subject);
+
+ dialog = gnome_message_box_new (label, GNOME_MESSAGE_BOX_QUESTION,
+ GNOME_STOCK_BUTTON_YES, /* Save */
+ GNOME_STOCK_BUTTON_NO, /* Don't save */
+ GNOME_STOCK_BUTTON_CANCEL, /* Cancel */
+ NULL);
- dialog = gtk_message_dialog_new (GTK_WINDOW (composer),
- GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT,
- GTK_MESSAGE_ERROR, GTK_BUTTONS_NONE,
- _("The message \"%s\" has not been sent.\n\n"
- "Do you wish to save your changes?"),
- subject);
+ g_free (label);
- gtk_dialog_add_buttons (GTK_DIALOG (dialog),
- _("_Discard Changes"), GTK_RESPONSE_NO,
- GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
- GTK_STOCK_SAVE, GTK_RESPONSE_YES,
- NULL);
gtk_window_set_title (GTK_WINDOW (dialog), _("Warning: Modified Message"));
- gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_YES);
- button = gtk_dialog_run (GTK_DIALOG (dialog));
- gtk_widget_destroy (dialog);
+ gnome_dialog_set_parent (GNOME_DIALOG (dialog), GTK_WINDOW (composer));
+ gnome_dialog_set_default (GNOME_DIALOG (dialog), 0);
+ button = gnome_dialog_run_and_close (GNOME_DIALOG (dialog));
switch (button) {
- case GTK_RESPONSE_YES:
+ case 0:
/* Save */
- g_signal_emit (GTK_OBJECT (composer), signals[SAVE_DRAFT], 0, TRUE);
+ gtk_signal_emit (GTK_OBJECT (composer), signals[SAVE_DRAFT], TRUE);
e_msg_composer_unset_changed (composer);
break;
- case GTK_RESPONSE_NO:
+ case 1:
/* Don't save */
gtk_widget_destroy (GTK_WIDGET (composer));
break;
- case GTK_RESPONSE_CANCEL:
+ default:
+ /* Cancel */
break;
}
}
@@ -1632,7 +1616,7 @@ menu_file_send_cb (BonoboUIComponent *uic,
void *data,
const char *path)
{
- g_signal_emit (GTK_OBJECT (data), signals[SEND], 0);
+ gtk_signal_emit (GTK_OBJECT (data), signals[SEND]);
}
static void
@@ -1901,7 +1885,7 @@ signature_cb (GtkWidget *w, EMsgComposer *composer)
composer->signature = NULL;
composer->auto_signature = TRUE;
} else {
- composer->signature = g_slist_nth_data (mail_config_get_signature_list (), idx - 2);
+ composer->signature = g_list_nth_data (mail_config_get_signature_list (), idx - 2);
composer->auto_signature = FALSE;
}
if (old_sig != composer->signature || old_auto != composer->auto_signature)
@@ -1969,31 +1953,36 @@ sig_select_item (EMsgComposer *composer)
static void
setup_signatures_menu (EMsgComposer *composer)
{
+ GList *l, *list;
+ gint len = 0;
GtkWidget *menu;
GtkWidget *mi;
- GSList *node;
#define ADD(x) \
mi = (x ? gtk_menu_item_new_with_label (x) : gtk_menu_item_new ()); \
gtk_widget_show (mi); \
- gtk_menu_shell_append(GTK_MENU_SHELL(menu), mi);
+ gtk_menu_append (GTK_MENU (menu), mi);
menu = gtk_menu_new ();
ADD (_("None"));
ADD (_("Autogenerated"));
- node = mail_config_get_signature_list ();
- while (node != NULL) {
- ADD (((MailConfigSignature *) node->data)->name);
- node = node->next;
- }
+ list = mail_config_get_signature_list ();
+ if (list)
+ for (l = list; l; len ++, l = l->next) {
+ gchar *gtk_str;
+
+ gtk_str = e_utf8_to_gtk_string (menu, ((MailConfigSignature *)l->data)->name);
+ ADD (gtk_str);
+ g_free (gtk_str);
+ }
#undef ADD
-
+
gtk_widget_show (menu);
gtk_option_menu_set_menu (GTK_OPTION_MENU (composer->sig_omenu), menu);
sig_select_item (composer);
-
- g_signal_connect (menu, "selection-done", (GCallback)signature_cb, composer);
+
+ gtk_signal_connect (GTK_OBJECT (menu), "selection-done", signature_cb, composer);
}
static void
@@ -2002,28 +1991,28 @@ setup_ui (EMsgComposer *composer)
BonoboUIContainer *container;
char *default_charset;
gboolean hide_smime;
- GConfClient *gconf;
-
- container = bonobo_window_get_ui_container (BONOBO_WINDOW (composer));
+ container = bonobo_ui_container_new ();
+ bonobo_ui_container_set_win (container, BONOBO_WINDOW (composer));
+
composer->uic = bonobo_ui_component_new_default ();
- /* FIXME: handle bonobo exceptions */
- bonobo_ui_component_set_container (composer->uic, bonobo_object_corba_objref (BONOBO_OBJECT (container)), NULL);
+ bonobo_ui_component_set_container (composer->uic, bonobo_object_corba_objref (BONOBO_OBJECT (container)));
bonobo_ui_component_add_verb_list_with_data (composer->uic, verbs, composer);
bonobo_ui_component_freeze (composer->uic, NULL);
bonobo_ui_util_set_ui (composer->uic, EVOLUTION_DATADIR,
- EVOLUTION_UIDIR "/evolution-message-composer.xml",
- "evolution-message-composer", NULL);
+ "evolution-message-composer.xml",
+ "evolution-message-composer");
e_pixmaps_update (composer->uic, pixcache);
/* Populate the Charset Encoding menu and default it to whatever the user
chose as his default charset in the mailer */
- gconf = gconf_client_get_default ();
- default_charset = gconf_client_get_string (gconf, "/apps/evolution/mail/composer/charset", NULL);
+ default_charset = bonobo_config_get_string (composer->config_db,
+ "/Mail/Format/default_charset",
+ NULL);
e_charset_picker_bonobo_ui_populate (composer->uic, "/menu/Edit/EncodingPlaceholder",
default_charset,
menu_changed_charset_cb,
@@ -2159,7 +2148,12 @@ subject_changed_cb (EMsgComposerHdrs *hdrs,
composer = E_MSG_COMPOSER (data);
- gtk_window_set_title (GTK_WINDOW (composer), subject[0] ? subject : _("Compose a message"));
+ if (strlen (subject))
+ gtk_window_set_title (GTK_WINDOW (composer), subject);
+ else
+ gtk_window_set_title (GTK_WINDOW (composer),
+ _("Compose a message"));
+ g_free (subject);
}
static void
@@ -2224,7 +2218,7 @@ update_auto_recipients (EMsgComposerHdrs *hdrs, int mode, const char *auto_addrs
}
}
- camel_object_unref (iaddr);
+ camel_object_unref (CAMEL_OBJECT (iaddr));
}
switch (mode) {
@@ -2286,12 +2280,12 @@ from_changed_cb (EMsgComposerHdrs *hdrs, void *data)
composer = E_MSG_COMPOSER (data);
if (hdrs->account) {
- EAccount *account = hdrs->account;
+ const MailConfigAccount *account = hdrs->account;
e_msg_composer_set_pgp_sign (composer,
account->pgp_always_sign &&
(!account->pgp_no_imip_sign || !composer->mime_type ||
- strncasecmp (composer->mime_type, "text/calendar", 13) != 0));
+ g_strncasecmp (composer->mime_type, "text/calendar", 13) != 0));
e_msg_composer_set_smime_sign (composer, account->smime_always_sign);
update_auto_recipients (hdrs, UPDATE_AUTO_CC, account->always_cc ? account->cc_addrs : NULL);
update_auto_recipients (hdrs, UPDATE_AUTO_BCC, account->always_bcc ? account->bcc_addrs : NULL);
@@ -2305,54 +2299,20 @@ from_changed_cb (EMsgComposerHdrs *hdrs, void *data)
}
-/* GObject methods. */
-
-static void
-composer_finalise (GObject *object)
-{
- EMsgComposer *composer;
-
- composer = E_MSG_COMPOSER (object);
-
- if (composer->extra_hdr_names) {
- int i;
-
- for (i = 0; i < composer->extra_hdr_names->len; i++) {
- g_free (composer->extra_hdr_names->pdata[i]);
- g_free (composer->extra_hdr_values->pdata[i]);
- }
- g_ptr_array_free (composer->extra_hdr_names, TRUE);
- g_ptr_array_free (composer->extra_hdr_values, TRUE);
- }
-
- e_msg_composer_clear_inlined_table (composer);
- g_hash_table_destroy (composer->inline_images);
- g_hash_table_destroy (composer->inline_images_by_url);
-
- g_free (composer->charset);
- g_free (composer->mime_type);
- g_free (composer->mime_body);
-
- if (composer->redirect)
- camel_object_unref (composer->redirect);
-
- if (G_OBJECT_CLASS (parent_class)->finalize != NULL)
- (* G_OBJECT_CLASS (parent_class)->finalize) (object);
-}
+/* GtkObject methods. */
static void
-composer_dispose(GObject *object)
+composer_shutdown (GtkObject *object)
{
/* When destroy() is called, the contents of the window
* (including the remote editor control) will already have
* been destroyed, so we have to do this here.
*/
autosave_manager_unregister (am, E_MSG_COMPOSER (object));
- if (G_OBJECT_CLASS (parent_class)->dispose != NULL)
- (* G_OBJECT_CLASS (parent_class)->dispose) (object);
+ if (GTK_OBJECT_CLASS (parent_class)->shutdown != NULL)
+ (* GTK_OBJECT_CLASS (parent_class)->shutdown) (object);
}
-/* GtkObject methods */
static void
destroy (GtkObject *object)
{
@@ -2361,51 +2321,71 @@ destroy (GtkObject *object)
composer = E_MSG_COMPOSER (object);
+ mail_config_signature_unregister_client ((MailConfigSignatureClient) sig_event_client, composer);
+
CORBA_exception_init (&ev);
- if (composer->uic) {
- bonobo_object_unref (BONOBO_OBJECT (composer->uic));
- composer->uic = NULL;
+ if (composer->config_db) {
+ Bonobo_ConfigDatabase_sync (composer->config_db, &ev);
+ bonobo_object_release_unref (composer->config_db, NULL);
}
+ composer->config_db = NULL;
+
+ if (composer->uic)
+ bonobo_object_unref (BONOBO_OBJECT (composer->uic));
+ composer->uic = NULL;
/* FIXME? I assume the Bonobo widget will get destroyed
normally? */
- if (composer->address_dialog != NULL) {
+ if (composer->address_dialog != NULL)
gtk_widget_destroy (composer->address_dialog);
- composer->address_dialog = NULL;
- }
- if (composer->hdrs != NULL) {
+ if (composer->hdrs != NULL)
gtk_widget_destroy (composer->hdrs);
- composer->hdrs = NULL;
+
+ if (composer->extra_hdr_names) {
+ int i;
+
+ for (i = 0; i < composer->extra_hdr_names->len; i++) {
+ g_free (composer->extra_hdr_names->pdata[i]);
+ g_free (composer->extra_hdr_values->pdata[i]);
+ }
+ g_ptr_array_free (composer->extra_hdr_names, TRUE);
+ g_ptr_array_free (composer->extra_hdr_values, TRUE);
}
+ e_msg_composer_clear_inlined_table (composer);
+ g_hash_table_destroy (composer->inline_images);
+ g_hash_table_destroy (composer->inline_images_by_url);
+
+ g_free (composer->charset);
+ g_free (composer->mime_type);
+ g_free (composer->mime_body);
+
+ CORBA_exception_init (&ev);
+
if (composer->persist_stream_interface != CORBA_OBJECT_NIL) {
Bonobo_Unknown_unref (composer->persist_stream_interface, &ev);
CORBA_Object_release (composer->persist_stream_interface, &ev);
- composer->persist_stream_interface = CORBA_OBJECT_NIL;
}
if (composer->persist_file_interface != CORBA_OBJECT_NIL) {
Bonobo_Unknown_unref (composer->persist_file_interface, &ev);
CORBA_Object_release (composer->persist_file_interface, &ev);
- composer->persist_file_interface = CORBA_OBJECT_NIL;
}
if (composer->editor_engine != CORBA_OBJECT_NIL) {
Bonobo_Unknown_unref (composer->editor_engine, &ev);
CORBA_Object_release (composer->editor_engine, &ev);
- composer->editor_engine = CORBA_OBJECT_NIL;
}
CORBA_exception_free (&ev);
- if (composer->editor_listener) {
- bonobo_object_unref (composer->editor_listener);
- composer->editor_listener = NULL;
- }
+ if (composer->redirect)
+ camel_object_unref (CAMEL_OBJECT (composer->redirect));
- mail_config_signature_unregister_client ((MailConfigSignatureClient) sig_event_client, composer);
+ if (composer->editor_listener)
+ bonobo_object_unref (composer->editor_listener);
if (GTK_OBJECT_CLASS (parent_class)->destroy != NULL)
(* GTK_OBJECT_CLASS (parent_class)->destroy) (object);
@@ -2427,18 +2407,21 @@ static void
message_rfc822_dnd (EMsgComposer *composer, CamelStream *stream)
{
CamelMimeParser *mp;
+ CamelException *ex;
mp = camel_mime_parser_new ();
camel_mime_parser_scan_from (mp, TRUE);
camel_mime_parser_init_with_stream (mp, stream);
+ ex = camel_exception_new ();
+
while (camel_mime_parser_step (mp, 0, 0) == HSCAN_FROM) {
CamelMimeMessage *message;
CamelMimePart *part;
message = camel_mime_message_new ();
if (camel_mime_part_construct_from_parser (CAMEL_MIME_PART (message), mp) == -1) {
- camel_object_unref (message);
+ camel_object_unref (CAMEL_OBJECT (message));
break;
}
@@ -2449,14 +2432,16 @@ message_rfc822_dnd (EMsgComposer *composer, CamelStream *stream)
camel_mime_part_set_content_type (part, "message/rfc822");
e_msg_composer_attachment_bar_attach_mime_part (E_MSG_COMPOSER_ATTACHMENT_BAR (composer->attachment_bar),
part);
- camel_object_unref (message);
- camel_object_unref (part);
+ camel_object_unref (CAMEL_OBJECT (message));
+ camel_object_unref (CAMEL_OBJECT (part));
+ camel_exception_clear (ex);
/* skip over the FROM_END state */
camel_mime_parser_step (mp, 0, 0);
}
- camel_object_unref (mp);
+ camel_object_unref (CAMEL_OBJECT (mp));
+ camel_exception_free (ex);
}
static void
@@ -2464,7 +2449,7 @@ drag_data_received (EMsgComposer *composer, GdkDragContext *context,
int x, int y, GtkSelectionData *selection,
guint info, guint time)
{
- char *tmp, *str, *filename, **urls;
+ char *tmp, *filename, **filenames;
CamelMimePart *mime_part;
CamelStream *stream;
CamelURL *url;
@@ -2479,40 +2464,31 @@ drag_data_received (EMsgComposer *composer, GdkDragContext *context,
camel_stream_reset (stream);
message_rfc822_dnd (composer, stream);
- camel_object_unref (stream);
+ camel_object_unref (CAMEL_OBJECT (stream));
break;
case DND_TYPE_TEXT_URI_LIST:
d(printf ("dropping a text/uri-list\n"));
tmp = g_strndup (selection->data, selection->length);
- urls = g_strsplit (tmp, "\n", 0);
+ filenames = g_strsplit (tmp, "\n", 0);
g_free (tmp);
- for (i = 0; urls[i] != NULL; i++) {
- str = g_strstrip (urls[i]);
+ for (i = 0; filenames[i] != NULL; i++) {
+ filename = g_strstrip (filenames[i]);
- if (!strncasecmp (str, "mailto:", 7)) {
- handle_mailto (composer, str);
- g_free (str);
- } else {
- url = camel_url_new (str, NULL);
- g_free (str);
-
- if (url == NULL)
- continue;
-
- filename = url->path;
- url->path = NULL;
- camel_url_free (url);
-
- e_msg_composer_attachment_bar_attach
- (E_MSG_COMPOSER_ATTACHMENT_BAR (composer->attachment_bar),
- filename);
-
- g_free (filename);
- }
+ url = camel_url_new (filename, NULL);
+ g_free (filename);
+ filename = url->path;
+ url->path = NULL;
+ camel_url_free (url);
+
+ e_msg_composer_attachment_bar_attach
+ (E_MSG_COMPOSER_ATTACHMENT_BAR (composer->attachment_bar),
+ filename);
+
+ g_free (filename);
}
- g_free (urls);
+ g_free (filenames);
break;
case DND_TYPE_TEXT_VCARD:
d(printf ("dropping a text/x-vcard\n"));
@@ -2525,49 +2501,58 @@ drag_data_received (EMsgComposer *composer, GdkDragContext *context,
(E_MSG_COMPOSER_ATTACHMENT_BAR (composer->attachment_bar),
mime_part);
- camel_object_unref (mime_part);
+ camel_object_unref (CAMEL_OBJECT (mime_part));
default:
d(printf ("dropping an unknown\n"));
break;
}
}
+typedef void (*GtkSignal_NONE__NONE_INT) (GtkObject *, int, gpointer);
+
+static void marshal_NONE__NONE_INT (GtkObject *object, GtkSignalFunc func,
+ gpointer func_data, GtkArg *args)
+{
+ GtkSignal_NONE__NONE_INT rfunc;
+
+ rfunc = (GtkSignal_NONE__NONE_INT) func;
+ (*rfunc)(object, GTK_VALUE_INT (args[0]), func_data);
+}
+
+
static void
class_init (EMsgComposerClass *klass)
{
GtkObjectClass *object_class;
GtkWidgetClass *widget_class;
- GObjectClass *gobject_class;
-
- gobject_class = G_OBJECT_CLASS(klass);
+
object_class = GTK_OBJECT_CLASS (klass);
widget_class = GTK_WIDGET_CLASS (klass);
- gobject_class->finalize = composer_finalise;
- gobject_class->dispose = composer_dispose;
+ object_class->shutdown = composer_shutdown;
object_class->destroy = destroy;
+
widget_class->delete_event = delete_event;
- parent_class = g_type_class_ref(bonobo_window_get_type ());
+ parent_class = gtk_type_class (bonobo_window_get_type ());
signals[SEND] =
- g_signal_new ("send",
- E_TYPE_MSG_COMPOSER,
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (EMsgComposerClass, send),
- NULL, NULL,
- g_cclosure_marshal_VOID__VOID,
- G_TYPE_NONE, 0);
+ gtk_signal_new ("send",
+ GTK_RUN_LAST,
+ object_class->type,
+ GTK_SIGNAL_OFFSET (EMsgComposerClass, send),
+ gtk_marshal_NONE__NONE,
+ GTK_TYPE_NONE, 0);
signals[SAVE_DRAFT] =
- g_signal_new ("save-draft",
- E_TYPE_MSG_COMPOSER,
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (EMsgComposerClass, save_draft),
- NULL, NULL,
- g_cclosure_marshal_VOID__BOOLEAN,
- G_TYPE_NONE,
- 1, G_TYPE_BOOLEAN);
+ gtk_signal_new ("save-draft",
+ GTK_RUN_LAST,
+ object_class->type,
+ GTK_SIGNAL_OFFSET (EMsgComposerClass, save_draft),
+ marshal_NONE__NONE_INT,
+ GTK_TYPE_NONE, 1, GTK_TYPE_INT);
+
+ gtk_object_class_add_signals (object_class, signals, LAST_SIGNAL);
}
static void
@@ -2584,7 +2569,7 @@ init (EMsgComposer *composer)
composer->address_dialog = NULL;
composer->attachment_bar = NULL;
- composer->attachment_scrolled_window = NULL;
+ composer->attachment_scroll_frame = NULL;
composer->persist_file_interface = CORBA_OBJECT_NIL;
composer->persist_stream_interface = CORBA_OBJECT_NIL;
@@ -2616,42 +2601,60 @@ init (EMsgComposer *composer)
GtkType
e_msg_composer_get_type (void)
{
- static GType type = 0;
+ static GtkType type = 0;
if (type == 0) {
- static const GTypeInfo info = {
- sizeof (EMsgComposerClass),
- NULL, NULL,
- (GClassInitFunc) class_init,
- NULL, NULL,
+ static const GtkTypeInfo info = {
+ "EMsgComposer",
sizeof (EMsgComposer),
- 0,
- (GInstanceInitFunc) init,
+ sizeof (EMsgComposerClass),
+ (GtkClassInitFunc) class_init,
+ (GtkObjectInitFunc) init,
+ /* reserved_1 */ NULL,
+ /* reserved_2 */ NULL,
+ (GtkClassInitFunc) NULL,
};
- type = g_type_register_static (bonobo_window_get_type (), "EMsgComposer", &info, 0);
+ type = gtk_type_unique (bonobo_window_get_type (), &info);
}
return type;
}
static void
+load_from_config_db (EMsgComposer *composer)
+{
+ Bonobo_ConfigDatabase db = composer->config_db;
+
+ composer->view_from = bonobo_config_get_long_with_default (
+ db, "Mail/Composer/ViewFrom", 1, NULL);
+ composer->view_replyto = bonobo_config_get_long_with_default (
+ db, "Mail/Composer/ViewReplyTo", 0, NULL);
+ composer->view_cc = bonobo_config_get_long_with_default (
+ db, "Mail/Composer/ViewCC", 1, NULL);
+ composer->view_bcc = bonobo_config_get_long_with_default (
+ db, "Mail/Composer/ViewBCC", 0, NULL);
+ composer->view_subject = bonobo_config_get_long_with_default (
+ db, "Mail/Composer/ViewSubject", 1, NULL);
+}
+
+static void
e_msg_composer_load_config (EMsgComposer *composer)
{
- GConfClient *gconf;
+ Bonobo_ConfigDatabase db;
+ CORBA_Environment ev;
+
+ CORBA_exception_init (&ev);
- gconf = gconf_client_get_default ();
+ db = bonobo_get_object ("wombat:", "Bonobo/ConfigDatabase", &ev);
- composer->view_from = gconf_client_get_bool (
- gconf, "/apps/evolution/mail/composer/view/From", NULL);
- composer->view_replyto = gconf_client_get_bool (
- gconf, "/apps/evolution/mail/composer/view/ReplyTo", NULL);
- composer->view_cc = gconf_client_get_bool (
- gconf, "/apps/evolution/mail/composer/view/Cc", NULL);
- composer->view_bcc = gconf_client_get_bool (
- gconf, "/apps/evolution/mail/composer/view/Bcc", NULL);
- composer->view_subject = gconf_client_get_bool (
- gconf, "/apps/evolution/mail/composer/view/Subject", NULL);
+ if (ev._major == CORBA_NO_EXCEPTION && db != CORBA_OBJECT_NIL){
+ composer->config_db = db;
+ load_from_config_db (composer);
+ } else
+ composer->config_db = CORBA_OBJECT_NIL;
+
+ CORBA_exception_free (&ev);
}
static int
@@ -2685,22 +2688,21 @@ static void
map_default_cb (EMsgComposer *composer, gpointer user_data)
{
GtkWidget *to;
- BonoboControlFrame *cf;
- Bonobo_PropertyBag pb = CORBA_OBJECT_NIL;
- CORBA_Environment ev;
- const char *subject;
+ BonoboControlFrame *cf;
+ Bonobo_PropertyBag pb = CORBA_OBJECT_NIL;
char *text;
+ CORBA_Environment ev;
/* If the 'To:' field is empty, focus it (This is ridiculously complicated) */
to = e_msg_composer_hdrs_get_to_entry (E_MSG_COMPOSER_HDRS (composer->hdrs));
- cf = bonobo_widget_get_control_frame (BONOBO_WIDGET (to));
- pb = bonobo_control_frame_get_control_property_bag (cf, NULL);
- text = bonobo_pbclient_get_string (pb, "text", NULL);
+ cf = bonobo_widget_get_control_frame (BONOBO_WIDGET (to));
+ pb = bonobo_control_frame_get_control_property_bag (cf, NULL);
+ text = bonobo_property_bag_client_get_value_string (pb, "text", NULL);
bonobo_object_release_unref (pb, NULL);
if (!text || text[0] == '\0') {
- gtk_widget_grab_focus (to);
+ bonobo_control_frame_focus_child (cf, GTK_DIR_TAB_FORWARD);
g_free (text);
return;
}
@@ -2708,15 +2710,17 @@ map_default_cb (EMsgComposer *composer, gpointer user_data)
/* If not, check the subject field */
- subject = e_msg_composer_hdrs_get_subject (E_MSG_COMPOSER_HDRS (composer->hdrs));
+ text = e_msg_composer_hdrs_get_subject (E_MSG_COMPOSER_HDRS (composer->hdrs));
- if (!subject || subject[0] == '\0') {
+ if (!text || text[0] == '\0') {
GtkWidget *widget;
widget = e_msg_composer_hdrs_get_subject_entry (E_MSG_COMPOSER_HDRS (composer->hdrs));
- gtk_widget_grab_focus (widget);
+ gtk_widget_grab_focus (GTK_WIDGET (E_ENTRY (widget)->canvas));
+ g_free (text);
return;
}
+ g_free (text);
/* Jump to the editor as a last resort. */
@@ -2738,11 +2742,11 @@ composer_key_pressed (GtkWidget *widget, GdkEventKey *event, gpointer user_data)
{
if (event->keyval == GDK_Escape) {
do_exit (E_MSG_COMPOSER (widget));
-
- g_signal_stop_emission_by_name (widget, "key-press-event");
+
+ gtk_signal_emit_stop_by_name (GTK_OBJECT (widget), "key-press-event");
return TRUE; /* Handled. */
}
-
+
return FALSE; /* Not handled. */
}
@@ -2751,32 +2755,34 @@ create_composer (int visible_mask)
{
EMsgComposer *composer;
GtkWidget *vbox;
- Bonobo_Unknown editor_server;
- CORBA_Environment ev;
+ BonoboObject *editor_server;
int vis;
- composer = g_object_new (E_TYPE_MSG_COMPOSER, "win_name", _("Compose a message"), NULL);
- gtk_window_set_title ((GtkWindow *) composer, _("Compose a message"));
+ g_return_val_if_fail (gtk_main_level () > 0, NULL);
+
+ composer = gtk_type_new (E_TYPE_MSG_COMPOSER);
all_composers = g_slist_prepend (all_composers, composer);
- g_signal_connect (composer, "key-press-event",
- G_CALLBACK (composer_key_pressed),
- NULL);
- g_signal_connect (composer, "destroy",
- G_CALLBACK (msg_composer_destroy_notify),
- NULL);
+ gtk_signal_connect (GTK_OBJECT (composer), "key-press-event",
+ GTK_SIGNAL_FUNC (composer_key_pressed),
+ NULL);
+ gtk_signal_connect (GTK_OBJECT (composer), "destroy",
+ GTK_SIGNAL_FUNC (msg_composer_destroy_notify),
+ NULL);
gtk_window_set_default_size (GTK_WINDOW (composer),
DEFAULT_WIDTH, DEFAULT_HEIGHT);
gnome_window_icon_set_from_file (GTK_WINDOW (composer), EVOLUTION_DATADIR
"/images/evolution/compose-message.png");
+ bonobo_window_construct (BONOBO_WINDOW (composer), "e-msg-composer",
+ _("Compose a message"));
/* DND support */
gtk_drag_dest_set (GTK_WIDGET (composer), GTK_DEST_DEFAULT_ALL,
drop_types, num_drop_types, GDK_ACTION_COPY);
- g_signal_connect (composer, "drag_data_received",
- G_CALLBACK (drag_data_received), NULL);
+ gtk_signal_connect (GTK_OBJECT (composer), "drag_data_received",
+ GTK_SIGNAL_FUNC (drag_data_received), NULL);
e_msg_composer_load_config (composer);
setup_ui (composer);
@@ -2796,12 +2802,12 @@ create_composer (int visible_mask)
}
gtk_box_pack_start (GTK_BOX (vbox), composer->hdrs, FALSE, FALSE, 0);
- g_signal_connect (composer->hdrs, "subject_changed",
- G_CALLBACK (subject_changed_cb), composer);
- g_signal_connect (composer->hdrs, "hdrs_changed",
- G_CALLBACK (hdrs_changed_cb), composer);
- g_signal_connect (composer->hdrs, "from_changed",
- G_CALLBACK (from_changed_cb), composer);
+ gtk_signal_connect (GTK_OBJECT (composer->hdrs), "subject_changed",
+ GTK_SIGNAL_FUNC (subject_changed_cb), composer);
+ gtk_signal_connect (GTK_OBJECT (composer->hdrs), "hdrs_changed",
+ GTK_SIGNAL_FUNC (hdrs_changed_cb), composer);
+ gtk_signal_connect (GTK_OBJECT (composer->hdrs), "from_changed",
+ GTK_SIGNAL_FUNC (from_changed_cb), composer);
gtk_widget_show (composer->hdrs);
prepare_signatures_menu (composer);
@@ -2825,40 +2831,37 @@ create_composer (int visible_mask)
/* let the editor know which mode we are in */
bonobo_widget_set_property (BONOBO_WIDGET (composer->editor),
- "FormatHTML", TC_CORBA_boolean, composer->send_html,
+ "FormatHTML", composer->send_html,
NULL);
- editor_server = bonobo_widget_get_objref (BONOBO_WIDGET (composer->editor));
+ editor_server = BONOBO_OBJECT (bonobo_widget_get_server (BONOBO_WIDGET (composer->editor)));
- /* FIXME: handle exceptions */
- CORBA_exception_init (&ev);
composer->persist_file_interface
- = Bonobo_Unknown_queryInterface (editor_server, "IDL:Bonobo/PersistFile:1.0", &ev);
+ = bonobo_object_query_interface (editor_server, "IDL:Bonobo/PersistFile:1.0");
composer->persist_stream_interface
- = Bonobo_Unknown_queryInterface (editor_server, "IDL:Bonobo/PersistStream:1.0", &ev);
- CORBA_exception_free (&ev);
+ = bonobo_object_query_interface (editor_server, "IDL:Bonobo/PersistStream:1.0");
gtk_box_pack_start (GTK_BOX (vbox), composer->editor, TRUE, TRUE, 0);
/* Attachment editor, wrapped into an EScrollFrame. We don't
show it for now. */
- composer->attachment_scrolled_window = gtk_scrolled_window_new (NULL, NULL);
- gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (composer->attachment_scrolled_window),
- GTK_SHADOW_IN);
- gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (composer->attachment_scrolled_window),
- GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
+ composer->attachment_scroll_frame = e_scroll_frame_new (NULL, NULL);
+ e_scroll_frame_set_shadow_type (E_SCROLL_FRAME (composer->attachment_scroll_frame),
+ GTK_SHADOW_IN);
+ e_scroll_frame_set_policy (E_SCROLL_FRAME (composer->attachment_scroll_frame),
+ GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
composer->attachment_bar = e_msg_composer_attachment_bar_new (NULL);
GTK_WIDGET_SET_FLAGS (composer->attachment_bar, GTK_CAN_FOCUS);
- gtk_container_add (GTK_CONTAINER (composer->attachment_scrolled_window),
+ gtk_container_add (GTK_CONTAINER (composer->attachment_scroll_frame),
composer->attachment_bar);
gtk_box_pack_start (GTK_BOX (vbox),
- composer->attachment_scrolled_window,
+ composer->attachment_scroll_frame,
FALSE, FALSE, GNOME_PAD_SMALL);
- g_signal_connect (composer->attachment_bar, "changed",
- G_CALLBACK (attachment_bar_changed_cb), composer);
+ gtk_signal_connect (GTK_OBJECT (composer->attachment_bar), "changed",
+ GTK_SIGNAL_FUNC (attachment_bar_changed_cb), composer);
bonobo_window_set_contents (BONOBO_WINDOW (composer), vbox);
gtk_widget_show (vbox);
@@ -2881,11 +2884,11 @@ create_composer (int visible_mask)
return NULL;
}
- g_signal_connect (composer, "map", (GCallback) map_default_cb, NULL);
+ gtk_signal_connect (GTK_OBJECT (composer), "map", map_default_cb, NULL);
- if (am == NULL)
+ if (am == NULL) {
am = autosave_manager_new ();
-
+ }
autosave_manager_register (am, composer);
return composer;
@@ -2894,21 +2897,19 @@ create_composer (int visible_mask)
static void
set_editor_signature (EMsgComposer *composer)
{
- EAccountIdentity *id;
- GSList *signatures;
-
/* printf ("set_editor_signature\n"); */
- id = E_MSG_COMPOSER_HDRS (composer->hdrs)->account->id;
-
- signatures = mail_config_get_signature_list ();
-
- composer->signature = g_slist_nth_data (signatures, id->def_signature);
- composer->auto_signature = id->auto_signature;
-
- /* printf ("auto: %d\n", id->auto_signature); */
-
- sig_select_item (composer);
-
+ if (E_MSG_COMPOSER_HDRS (composer->hdrs)->account->id) {
+ MailConfigIdentity *id;
+
+ id = E_MSG_COMPOSER_HDRS (composer->hdrs)->account->id;
+
+ composer->signature = id->def_signature;
+ composer->auto_signature = id->auto_signature;
+
+ /* printf ("auto: %d\n", id->auto_signature); */
+
+ sig_select_item (composer);
+ }
/* printf ("set_editor_signature end\n"); */
}
@@ -2923,16 +2924,11 @@ set_editor_signature (EMsgComposer *composer)
EMsgComposer *
e_msg_composer_new (void)
{
- gboolean send_html;
- GConfClient *gconf;
EMsgComposer *new;
- gconf = gconf_client_get_default ();
- send_html = gconf_client_get_bool (gconf, "/apps/evolution/mail/composer/send_html", NULL);
-
new = create_composer (E_MSG_COMPOSER_VISIBLE_MASK_MAIL);
if (new) {
- e_msg_composer_set_send_html (new, send_html);
+ e_msg_composer_set_send_html (new, mail_config_get_send_html ());
set_editor_text (new, "");
set_editor_signature (new);
}
@@ -2951,16 +2947,11 @@ e_msg_composer_new (void)
EMsgComposer *
e_msg_composer_new_post (void)
{
- gboolean send_html;
- GConfClient *gconf;
EMsgComposer *new;
- gconf = gconf_client_get_default ();
- send_html = gconf_client_get_bool (gconf, "/apps/evolution/mail/composer/send_html", NULL);
-
new = create_composer (E_MSG_COMPOSER_VISIBLE_MASK_POST);
if (new) {
- e_msg_composer_set_send_html (new, send_html);
+ e_msg_composer_set_send_html (new, mail_config_get_send_html ());
set_editor_text (new, "");
set_editor_signature (new);
}
@@ -2976,10 +2967,10 @@ is_special_header (const char *hdr_name)
1. it's not a X-* header or
2. it's an X-Evolution* header
*/
- if (strncasecmp (hdr_name, "X-", 2))
+ if (g_strncasecmp (hdr_name, "X-", 2))
return TRUE;
- if (!strncasecmp (hdr_name, "X-Evolution", 11))
+ if (!g_strncasecmp (hdr_name, "X-Evolution", 11))
return TRUE;
/* we can keep all other X-* headers */
@@ -2992,9 +2983,9 @@ e_msg_composer_set_pending_body (EMsgComposer *composer, char *text)
{
char *old;
- old = g_object_get_data ((GObject *) composer, "body:text");
+ old = gtk_object_get_data (GTK_OBJECT (composer), "body:text");
g_free (old);
- g_object_set_data ((GObject *) composer, "body:text", text);
+ gtk_object_set_data (GTK_OBJECT (composer), "body:text", text);
}
static void
@@ -3002,12 +2993,12 @@ e_msg_composer_flush_pending_body (EMsgComposer *composer, gboolean apply)
{
char *body;
- body = g_object_get_data ((GObject *) composer, "body:text");
+ body = gtk_object_get_data (GTK_OBJECT (composer), "body:text");
if (body) {
if (apply)
set_editor_text (composer, body);
- g_object_set_data ((GObject *) composer, "body:text", NULL);
+ gtk_object_set_data (GTK_OBJECT (composer), "body:text", NULL);
g_free (body);
}
}
@@ -3024,23 +3015,21 @@ add_attachments_handle_mime_part (EMsgComposer *composer, CamelMimePart *mime_pa
if (CAMEL_IS_MULTIPART (wrapper)) {
/* another layer of multipartness... */
- add_attachments_from_multipart (composer, (CamelMultipart *) wrapper, just_inlines, depth + 1);
- } else if (CAMEL_IS_MIME_MESSAGE (wrapper)) {
- e_msg_composer_attach (composer, mime_part);
+ CamelMultipart *mpart;
+
+ mpart = CAMEL_MULTIPART (wrapper);
+
+ add_attachments_from_multipart (composer, mpart, just_inlines, depth + 1);
+ } else if (header_content_type_is (content_type, "text", "*")) {
+ /* do nothing */
+ } else if (header_content_type_is (content_type, "message", "*")) {
+ /* do nothing */
} else if (just_inlines) {
if (camel_mime_part_get_content_id (mime_part) ||
camel_mime_part_get_content_location (mime_part))
e_msg_composer_add_inline_image_from_mime_part (composer, mime_part);
} else {
- if (header_content_type_is (content_type, "text", "*")) {
- const char *disposition;
-
- disposition = camel_mime_part_get_disposition (mime_part);
- if (disposition && !strcasecmp (disposition, "attachment"))
- e_msg_composer_attach (composer, mime_part);
- } else {
- e_msg_composer_attach (composer, mime_part);
- }
+ e_msg_composer_attach (composer, mime_part);
}
}
@@ -3085,11 +3074,16 @@ e_msg_composer_add_message_attachments (EMsgComposer *composer, CamelMimeMessage
CamelDataWrapper *wrapper;
wrapper = camel_medium_get_content_object (CAMEL_MEDIUM (message));
- if (!CAMEL_IS_MULTIPART (wrapper))
- return;
-
- /* there must be attachments... */
- add_attachments_from_multipart (composer, (CamelMultipart *) wrapper, just_inlines, 0);
+ if (CAMEL_IS_MULTIPART (wrapper)) {
+ /* there must be attachments... */
+ CamelMultipart *multipart;
+
+ multipart = CAMEL_MULTIPART (wrapper);
+
+ add_attachments_from_multipart (composer, multipart, just_inlines, 0);
+ } else {
+ /* do nothing... */
+ }
}
@@ -3132,7 +3126,9 @@ handle_multipart_signed (EMsgComposer *composer, CamelMultipart *multipart, int
} else if (header_content_type_is (content_type, "text", "*")) {
char *text;
- if ((text = mail_get_message_body (content, FALSE, FALSE)))
+ text = mail_get_message_body (content, FALSE, FALSE);
+
+ if (text)
e_msg_composer_set_pending_body (composer, text);
} else {
e_msg_composer_attach (composer, mime_part);
@@ -3189,7 +3185,9 @@ handle_multipart_encrypted (EMsgComposer *composer, CamelMultipart *multipart, i
} else if (header_content_type_is (content_type, "text", "*")) {
char *text;
- if ((text = mail_get_message_body (content, FALSE, FALSE)))
+ text = mail_get_message_body (content, FALSE, FALSE);
+
+ if (text)
e_msg_composer_set_pending_body (composer, text);
} else {
e_msg_composer_attach (composer, mime_part);
@@ -3250,7 +3248,9 @@ handle_multipart_alternative (EMsgComposer *composer, CamelMultipart *multipart,
char *text;
contents = camel_medium_get_content_object (CAMEL_MEDIUM (text_part));
- if ((text = mail_get_message_body (contents, FALSE, FALSE)))
+ text = mail_get_message_body (contents, FALSE, FALSE);
+
+ if (text)
e_msg_composer_set_pending_body (composer, text);
}
}
@@ -3322,9 +3322,9 @@ set_signature_gui (EMsgComposer *composer)
str = GNOME_GtkHTML_Editor_Engine_getParagraphData (composer->editor_engine, "signature_name", &ev);
if (ev._major == CORBA_NO_EXCEPTION && str) {
if (!strncmp (str, "name:", 5)) {
- GSList *list = NULL;
- char *decoded_signature_name = decode_signature_name (str + 5);
-
+ GList *list = NULL;
+ gchar *decoded_signature_name = decode_signature_name (str + 5);
+
list = mail_config_get_signature_list ();
if (list && decoded_signature_name)
for (; list; list = list->next) {
@@ -3368,18 +3368,20 @@ e_msg_composer_new_with_message (CamelMimeMessage *message)
{
const CamelInternetAddress *to, *cc, *bcc;
GList *To = NULL, *Cc = NULL, *Bcc = NULL;
+ const MailConfigAccount *account = NULL;
const char *format, *subject, *postto;
EDestination **Tov, **Ccv, **Bccv;
GHashTable *auto_cc, *auto_bcc;
CamelContentType *content_type;
struct _header_raw *headers;
CamelDataWrapper *content;
- EAccount *account = NULL;
char *account_name;
EMsgComposer *new;
XEvolution *xev;
int len, i;
+ g_return_val_if_fail (gtk_main_level () > 0, NULL);
+
postto = camel_medium_get_header (CAMEL_MEDIUM (message), "X-Evolution-PostTo");
new = create_composer (postto ? E_MSG_COMPOSER_VISIBLE_MASK_POST : E_MSG_COMPOSER_VISIBLE_MASK_MAIL);
@@ -3518,7 +3520,7 @@ e_msg_composer_new_with_message (CamelMimeMessage *message)
while (*format && isspace ((unsigned) *format))
format++;
- if (!strcasecmp (format, "text/html"))
+ if (!g_strcasecmp (format, "text/html"))
e_msg_composer_set_send_html (new, TRUE);
else
e_msg_composer_set_send_html (new, FALSE);
@@ -3615,7 +3617,7 @@ e_msg_composer_new_redirect (CamelMimeMessage *message, const char *resent_from)
subject = camel_mime_message_get_subject (message);
composer->redirect = message;
- camel_object_ref (message);
+ camel_object_ref (CAMEL_OBJECT (message));
e_msg_composer_set_headers (composer, resent_from, NULL, NULL, NULL, subject);
@@ -3651,20 +3653,33 @@ add_recipients (GList *list, const char *recips, gboolean decode)
return list;
}
-static void
-handle_mailto (EMsgComposer *composer, const char *mailto)
+/**
+ * e_msg_composer_new_from_url:
+ * @url: a mailto URL
+ *
+ * Create a new message composer widget, and fill in fields as
+ * defined by the provided URL.
+ **/
+EMsgComposer *
+e_msg_composer_new_from_url (const char *url_in)
{
+ EMsgComposer *composer;
EMsgComposerHdrs *hdrs;
GList *to = NULL, *cc = NULL, *bcc = NULL;
EDestination **tov, **ccv, **bccv;
char *subject = NULL, *body = NULL;
const char *p, *header;
- size_t nread, nwritten;
char *content;
int len, clen;
+ g_return_val_if_fail (g_strncasecmp (url_in, "mailto:", 7) == 0, NULL);
+
+ composer = e_msg_composer_new ();
+ if (!composer)
+ return NULL;
+
/* Parse recipients (everything after ':' until '?' or eos). */
- p = mailto + 7;
+ p = url_in + 7;
len = strcspn (p, "?");
if (len) {
content = g_strndup (p, len);
@@ -3692,42 +3707,20 @@ handle_mailto (EMsgComposer *composer, const char *mailto)
content = g_strndup (p, clen);
camel_url_decode (content);
- if (!strncasecmp (header, "to", len)) {
+ if (!g_strncasecmp (header, "to", len)) {
to = add_recipients (to, content, FALSE);
- } else if (!strncasecmp (header, "cc", len)) {
+ } else if (!g_strncasecmp (header, "cc", len)) {
cc = add_recipients (cc, content, FALSE);
- } else if (!strncasecmp (header, "bcc", len)) {
+ } else if (!g_strncasecmp (header, "bcc", len)) {
bcc = add_recipients (bcc, content, FALSE);
- } else if (!strncasecmp (header, "subject", len)) {
+ } else if (!g_strncasecmp (header, "subject", len)) {
g_free (subject);
- if (g_utf8_validate (content, -1, NULL)) {
- subject = content;
- content = NULL;
- } else {
- subject = g_locale_to_utf8 (content, clen, &nread,
- &nwritten, NULL);
- if (subject) {
- subject = g_realloc (subject, nwritten + 1);
- subject[nwritten] = '\0';
- }
- }
- } else if (!strncasecmp (header, "body", len)) {
+ subject = g_strdup (content);
+ } else if (!g_strncasecmp (header, "body", len)) {
g_free (body);
- if (g_utf8_validate (content, -1, NULL)) {
- body = content;
- content = NULL;
- } else {
- body = g_locale_to_utf8 (content, clen, &nread,
- &nwritten, NULL);
- if (body) {
- body = g_realloc (body, nwritten + 1);
- body[nwritten] = '\0';
- }
- }
- } else if (!strncasecmp (header, "attach", len)) {
- e_msg_composer_attachment_bar_attach (E_MSG_COMPOSER_ATTACHMENT_BAR (composer->attachment_bar), content);
+ body = g_strdup (content);
} else {
- /* add an arbitrary header? */
+ /* add an arbitrary header */
e_msg_composer_add_header (composer, header, content);
}
@@ -3768,31 +3761,10 @@ handle_mailto (EMsgComposer *composer, const char *mailto)
if (body) {
char *htmlbody;
- htmlbody = camel_text_to_html (body, CAMEL_MIME_FILTER_TOHTML_PRE, 0);
+ htmlbody = e_text_to_html (body, E_TEXT_TO_HTML_PRE);
set_editor_text (composer, htmlbody);
g_free (htmlbody);
}
-}
-
-/**
- * e_msg_composer_new_from_url:
- * @url: a mailto URL
- *
- * Create a new message composer widget, and fill in fields as
- * defined by the provided URL.
- **/
-EMsgComposer *
-e_msg_composer_new_from_url (const char *url)
-{
- EMsgComposer *composer;
-
- g_return_val_if_fail (strncasecmp (url, "mailto:", 7) == 0, NULL);
-
- composer = e_msg_composer_new ();
- if (!composer)
- return NULL;
-
- handle_mailto (composer, url);
return composer;
}
@@ -3885,9 +3857,9 @@ e_msg_composer_set_body (EMsgComposer *composer, const char *body,
{
g_return_if_fail (E_IS_MSG_COMPOSER (composer));
- set_editor_text (composer, _("<b>(The composer contains a non-text "
- "message body, which cannot be "
- "edited.)<b>"));
+ set_editor_text (composer, U_("<b>(The composer contains a non-text "
+ "message body, which cannot be "
+ "edited.)<b>"));
e_msg_composer_set_send_html (composer, FALSE);
disable_editor (composer);
@@ -3896,7 +3868,7 @@ e_msg_composer_set_body (EMsgComposer *composer, const char *body,
g_free (composer->mime_type);
composer->mime_type = g_strdup (mime_type);
- if (g_ascii_strncasecmp (composer->mime_type, "text/calendar", 13) == 0) {
+ if (g_strncasecmp (composer->mime_type, "text/calendar", 13) == 0) {
EMsgComposerHdrs *hdrs = E_MSG_COMPOSER_HDRS (composer->hdrs);
if (hdrs->account && hdrs->account->pgp_no_imip_sign)
e_msg_composer_set_pgp_sign (composer, FALSE);
@@ -3962,7 +3934,7 @@ CamelMimePart *
e_msg_composer_add_inline_image_from_file (EMsgComposer *composer,
const char *file_name)
{
- char *mime_type, *cid, *url, *name;
+ char *mime_type, *cid, *url;
CamelStream *stream;
CamelDataWrapper *wrapper;
CamelMimePart *part;
@@ -3986,13 +3958,11 @@ e_msg_composer_add_inline_image_from_file (EMsgComposer *composer,
part = camel_mime_part_new ();
camel_medium_set_content_object (CAMEL_MEDIUM (part), wrapper);
- camel_object_unref (wrapper);
+ camel_object_unref (CAMEL_OBJECT (wrapper));
cid = header_msgid_generate ();
camel_mime_part_set_content_id (part, cid);
- name = g_path_get_basename(file_name);
- camel_mime_part_set_filename (part, name);
- g_free(name);
+ camel_mime_part_set_filename (part, g_basename (file_name));
camel_mime_part_set_encoding (part, CAMEL_MIME_PART_ENCODING_BASE64);
url = g_strdup_printf ("file:%s", file_name);
@@ -4018,18 +3988,18 @@ void
e_msg_composer_add_inline_image_from_mime_part (EMsgComposer *composer,
CamelMimePart *part)
{
- char *url;
- const char *location, *cid;
-
- cid = camel_mime_part_get_content_id (part);
+ char *cid, *url;
+ const char *location;
+
+ cid = (char *)camel_mime_part_get_content_id (part);
if (!cid) {
camel_mime_part_set_content_id (part, NULL);
- cid = camel_mime_part_get_content_id (part);
+ cid = (char *)camel_mime_part_get_content_id (part);
}
url = g_strdup_printf ("cid:%s", cid);
g_hash_table_insert (composer->inline_images, url, part);
- camel_object_ref (part);
+ camel_object_ref (CAMEL_OBJECT (part));
location = camel_mime_part_get_content_location (part);
if (location) {
@@ -4062,7 +4032,7 @@ CamelMimeMessage *
e_msg_composer_get_message_draft (EMsgComposer *composer)
{
CamelMimeMessage *msg;
- EAccount *account;
+ const MailConfigAccount *account;
gboolean old_send_html;
gboolean old_pgp_sign;
gboolean old_pgp_encrypt;
@@ -4191,7 +4161,6 @@ e_msg_composer_set_send_html (EMsgComposer *composer,
if (composer->send_html && send_html)
return;
-
if (!composer->send_html && !send_html)
return;
@@ -4199,17 +4168,15 @@ e_msg_composer_set_send_html (EMsgComposer *composer,
CORBA_exception_init (&ev);
GNOME_GtkHTML_Editor_Engine_runCommand (composer->editor_engine, "block-redraw", &ev);
- CORBA_exception_free (&ev);
-
- bonobo_ui_component_set_prop (composer->uic, "/commands/FormatHtml",
- "state", composer->send_html ? "1" : "0", NULL);
+ bonobo_ui_component_set_prop (
+ composer->uic, "/commands/FormatHtml",
+ "state", composer->send_html ? "1" : "0", NULL);
/* let the editor know which mode we are in */
- bonobo_widget_set_property (BONOBO_WIDGET (composer->editor),
- "FormatHTML", TC_CORBA_boolean,
+ bonobo_widget_set_property (BONOBO_WIDGET (composer->editor), "FormatHTML",
composer->send_html, NULL);
- CORBA_exception_init (&ev);
+ set_config (composer, "FormatHTML", composer->send_html);
GNOME_GtkHTML_Editor_Engine_runCommand (composer->editor_engine, "unblock-redraw", &ev);
CORBA_exception_free (&ev);
}
@@ -4238,7 +4205,7 @@ e_msg_composer_get_send_html (EMsgComposer *composer)
*
* Returns the user-specified account (from field).
*/
-EAccount *
+const MailConfigAccount *
e_msg_composer_get_preferred_account (EMsgComposer *composer)
{
EMsgComposerHdrs *hdrs;
@@ -4442,8 +4409,6 @@ e_msg_composer_get_view_from (EMsgComposer *composer)
void
e_msg_composer_set_view_from (EMsgComposer *composer, gboolean view_from)
{
- GConfClient *gconf;
-
g_return_if_fail (E_IS_MSG_COMPOSER (composer));
if ((composer->view_from && view_from) ||
@@ -4451,14 +4416,13 @@ e_msg_composer_set_view_from (EMsgComposer *composer, gboolean view_from)
return;
composer->view_from = view_from;
- bonobo_ui_component_set_prop (composer->uic, "/commands/ViewFrom",
- "state", composer->view_from ? "1" : "0", NULL);
-
- gconf = gconf_client_get_default ();
- gconf_client_set_bool (gconf, "/apps/evolution/mail/composer/view/From", view_from, NULL);
-
- e_msg_composer_hdrs_set_visible (E_MSG_COMPOSER_HDRS (composer->hdrs),
- e_msg_composer_get_visible_flags (composer));
+ bonobo_ui_component_set_prop (
+ composer->uic, "/commands/ViewFrom",
+ "state", composer->view_from ? "1" : "0", NULL);
+ set_config (composer, "ViewFrom", composer->view_from);
+ e_msg_composer_hdrs_set_visible
+ (E_MSG_COMPOSER_HDRS (composer->hdrs),
+ e_msg_composer_get_visible_flags (composer));
}
@@ -4489,8 +4453,6 @@ e_msg_composer_get_view_replyto (EMsgComposer *composer)
void
e_msg_composer_set_view_replyto (EMsgComposer *composer, gboolean view_replyto)
{
- GConfClient *gconf;
-
g_return_if_fail (E_IS_MSG_COMPOSER (composer));
if ((composer->view_replyto && view_replyto) ||
@@ -4498,14 +4460,13 @@ e_msg_composer_set_view_replyto (EMsgComposer *composer, gboolean view_replyto)
return;
composer->view_replyto = view_replyto;
- bonobo_ui_component_set_prop (composer->uic, "/commands/ViewReplyTo",
- "state", composer->view_replyto ? "1" : "0", NULL);
-
- gconf = gconf_client_get_default ();
- gconf_client_set_bool (gconf, "/apps/evolution/mail/composer/view/ReplyTo", view_replyto, NULL);
-
- e_msg_composer_hdrs_set_visible (E_MSG_COMPOSER_HDRS (composer->hdrs),
- e_msg_composer_get_visible_flags (composer));
+ bonobo_ui_component_set_prop (
+ composer->uic, "/commands/ViewReplyTo",
+ "state", composer->view_replyto ? "1" : "0", NULL);
+ set_config (composer, "ViewReplyTo", composer->view_replyto);
+ e_msg_composer_hdrs_set_visible
+ (E_MSG_COMPOSER_HDRS (composer->hdrs),
+ e_msg_composer_get_visible_flags (composer));
}
@@ -4536,8 +4497,6 @@ e_msg_composer_get_view_cc (EMsgComposer *composer)
void
e_msg_composer_set_view_cc (EMsgComposer *composer, gboolean view_cc)
{
- GConfClient *gconf;
-
g_return_if_fail (E_IS_MSG_COMPOSER (composer));
if ((composer->view_cc && view_cc) ||
@@ -4545,14 +4504,13 @@ e_msg_composer_set_view_cc (EMsgComposer *composer, gboolean view_cc)
return;
composer->view_cc = view_cc;
- bonobo_ui_component_set_prop (composer->uic, "/commands/ViewCC",
- "state", composer->view_cc ? "1" : "0", NULL);
-
- gconf = gconf_client_get_default ();
- gconf_client_set_bool (gconf, "/apps/evolution/mail/composer/view/Cc", view_cc, NULL);
-
- e_msg_composer_hdrs_set_visible (E_MSG_COMPOSER_HDRS (composer->hdrs),
- e_msg_composer_get_visible_flags (composer));
+ bonobo_ui_component_set_prop (
+ composer->uic, "/commands/ViewCC",
+ "state", composer->view_cc ? "1" : "0", NULL);
+ set_config (composer, "ViewCC", composer->view_cc);
+ e_msg_composer_hdrs_set_visible
+ (E_MSG_COMPOSER_HDRS (composer->hdrs),
+ e_msg_composer_get_visible_flags (composer));
}
@@ -4583,8 +4541,6 @@ e_msg_composer_get_view_bcc (EMsgComposer *composer)
void
e_msg_composer_set_view_bcc (EMsgComposer *composer, gboolean view_bcc)
{
- GConfClient *gconf;
-
g_return_if_fail (E_IS_MSG_COMPOSER (composer));
if ((composer->view_bcc && view_bcc) ||
@@ -4592,14 +4548,13 @@ e_msg_composer_set_view_bcc (EMsgComposer *composer, gboolean view_bcc)
return;
composer->view_bcc = view_bcc;
- bonobo_ui_component_set_prop (composer->uic, "/commands/ViewBCC",
- "state", composer->view_bcc ? "1" : "0", NULL);
-
- gconf = gconf_client_get_default ();
- gconf_client_set_bool (gconf, "/apps/evolution/mail/composer/view/Bcc", view_bcc, NULL);
-
- e_msg_composer_hdrs_set_visible (E_MSG_COMPOSER_HDRS (composer->hdrs),
- e_msg_composer_get_visible_flags (composer));
+ bonobo_ui_component_set_prop (
+ composer->uic, "/commands/ViewBCC",
+ "state", composer->view_bcc ? "1" : "0", NULL);
+ set_config (composer, "ViewBCC", composer->view_bcc);
+ e_msg_composer_hdrs_set_visible
+ (E_MSG_COMPOSER_HDRS (composer->hdrs),
+ e_msg_composer_get_visible_flags (composer));
}
@@ -4635,12 +4590,12 @@ e_msg_composer_get_bcc (EMsgComposer *composer)
return composer->hdrs ? e_msg_composer_hdrs_get_bcc (E_MSG_COMPOSER_HDRS (composer->hdrs)) : NULL;
}
-const char *
+char *
e_msg_composer_get_subject (EMsgComposer *composer)
{
g_return_val_if_fail (E_IS_MSG_COMPOSER (composer), NULL);
- return composer->hdrs ? e_msg_composer_hdrs_get_subject (E_MSG_COMPOSER_HDRS (composer->hdrs)) : NULL;
+ return composer->hdrs ? e_msg_composer_hdrs_get_subject(E_MSG_COMPOSER_HDRS (composer->hdrs)) : NULL;
}
diff --git a/composer/evolution-composer.c b/composer/evolution-composer.c
index b5c7630de8..d816a6d897 100644
--- a/composer/evolution-composer.c
+++ b/composer/evolution-composer.c
@@ -25,7 +25,6 @@
#include <config.h>
#endif
-#include <string.h>
#include <gtk/gtksignal.h>
#include <bonobo/bonobo-item-handler.h>
#include <bonobo/bonobo-generic-factory.h>
@@ -34,19 +33,19 @@
#include <camel/camel.h>
#include "evolution-composer.h"
#include "mail/mail-config.h"
+#include "mail/mail-session.h"
+#include "e-util/e-html-utils.h"
#define PARENT_TYPE BONOBO_OBJECT_TYPE
static BonoboObjectClass *parent_class = NULL;
-struct _EvolutionComposerPrivate {
- int send_id;
- int save_draft_id;
-
- void (*send_cb) (EMsgComposer *, gpointer);
- void (*save_draft_cb) (EMsgComposer *, int, gpointer);
-};
+static void (*send_cb) (EMsgComposer *, gpointer);
+static void (*save_draft_cb) (EMsgComposer *, int, gpointer);
/* CORBA interface implementation. */
+
+static POA_GNOME_Evolution_Composer__vepv Composer_vepv;
+
static EDestination **
corba_recipientlist_to_destv (const GNOME_Evolution_Composer_RecipientList *cl)
{
@@ -86,42 +85,32 @@ impl_Composer_set_headers (PortableServer_Servant servant,
BonoboObject *bonobo_object;
EvolutionComposer *composer;
EDestination **tov, **ccv, **bccv;
- EAccountList *accounts;
- EAccount *account;
- EIterator *iter;
- int found = 0;
-
+ const MailConfigAccount *account;
+ const GSList *accounts;
+
bonobo_object = bonobo_object_from_servant (servant);
composer = EVOLUTION_COMPOSER (bonobo_object);
-
+
account = mail_config_get_account_by_name (from);
if (!account) {
accounts = mail_config_get_accounts ();
- iter = e_list_get_iterator ((EList *) accounts);
- while (e_iterator_is_valid (iter)) {
- account = (EAccount *) e_iterator_get (iter);
-
- if (!strcasecmp (account->id->address, from)) {
- found = TRUE;
+ while (accounts) {
+ account = accounts->data;
+ if (!g_strcasecmp (account->id->address, from))
break;
- }
-
- e_iterator_next (iter);
+ accounts = accounts->next;
}
-
- g_object_unref (iter);
-
- if (!found)
+ if (!accounts)
account = mail_config_get_default_account ();
}
-
+
tov = corba_recipientlist_to_destv (to);
ccv = corba_recipientlist_to_destv (cc);
bccv = corba_recipientlist_to_destv (bcc);
e_msg_composer_set_headers (composer->composer, account->name,
tov, ccv, bccv, subject);
-
+
e_destination_freev (tov);
e_destination_freev (ccv);
e_destination_freev (bccv);
@@ -156,12 +145,11 @@ impl_Composer_set_body (PortableServer_Servant servant,
bonobo_object = bonobo_object_from_servant (servant);
composer = EVOLUTION_COMPOSER (bonobo_object);
- if (!strcasecmp (mime_type, "text/plain")) {
- char *htmlbody = camel_text_to_html (body, CAMEL_MIME_FILTER_TOHTML_PRE, 0);
-
+ if (!g_strcasecmp (mime_type, "text/plain")) {
+ char *htmlbody = e_text_to_html (body, E_TEXT_TO_HTML_PRE);
e_msg_composer_set_body_text (composer->composer, htmlbody);
g_free (htmlbody);
- } else if (!strcasecmp (mime_type, "text/html"))
+ } else if (!g_strcasecmp (mime_type, "text/html"))
e_msg_composer_set_body_text (composer->composer, body);
else
e_msg_composer_set_body (composer->composer, body, mime_type);
@@ -185,7 +173,7 @@ impl_Composer_attach_MIME (PortableServer_Servant servant,
attachment = camel_mime_part_new ();
status = camel_data_wrapper_construct_from_stream (
CAMEL_DATA_WRAPPER (attachment), mem_stream);
- camel_object_unref (mem_stream);
+ camel_object_unref (CAMEL_OBJECT (mem_stream));
if (status == -1) {
CORBA_exception_set (ev, CORBA_USER_EXCEPTION,
@@ -226,7 +214,7 @@ impl_Composer_attach_data (PortableServer_Servant servant,
"inline" : "attachment");
e_msg_composer_attach (composer->composer, attachment);
- camel_object_unref (attachment);
+ camel_object_unref (CAMEL_OBJECT (attachment));
}
static void
@@ -252,7 +240,7 @@ impl_Composer_send (PortableServer_Servant servant,
bonobo_object = bonobo_object_from_servant (servant);
composer = EVOLUTION_COMPOSER (bonobo_object);
- composer->priv->send_cb (composer->composer, NULL);
+ send_cb (composer->composer, NULL);
}
POA_GNOME_Evolution_Composer__epv *
@@ -273,56 +261,45 @@ evolution_composer_get_epv (void)
}
-/* GObject stuff */
+/* GtkObject stuff */
static void
-finalise (GObject *object)
+destroy (GtkObject *object)
{
EvolutionComposer *composer = EVOLUTION_COMPOSER (object);
- struct _EvolutionComposerPrivate *p = composer->priv;
-
- g_signal_handler_disconnect(composer->composer, p->send_id);
- g_signal_handler_disconnect(composer->composer, p->save_draft_id);
- g_free(p);
- if (composer->composer) {
- g_object_unref(composer->composer);
- composer->composer = NULL;
- }
+ if (composer->composer)
+ gtk_object_unref (GTK_OBJECT (composer->composer));
- G_OBJECT_CLASS (parent_class)->finalize (object);
+ GTK_OBJECT_CLASS (parent_class)->destroy (object);
}
static void
-evolution_composer_class_init (EvolutionComposerClass *klass)
+class_init (EvolutionComposerClass *klass)
{
- GObjectClass *object_class;
- POA_GNOME_Evolution_Composer__epv *epv;
-
- object_class = G_OBJECT_CLASS (klass);
- object_class->finalize = finalise;
+ GtkObjectClass *object_class;
- parent_class = g_type_class_ref(bonobo_object_get_type ());
+ object_class = GTK_OBJECT_CLASS (klass);
+ object_class->destroy = destroy;
- epv = &klass->epv;
+ parent_class = gtk_type_class (bonobo_object_get_type ());
- epv->setHeaders = impl_Composer_set_headers;
- epv->setMultipartType = impl_Composer_set_multipart_type;
- epv->setBody = impl_Composer_set_body;
- epv->attachMIME = impl_Composer_attach_MIME;
- epv->attachData = impl_Composer_attach_data;
- epv->show = impl_Composer_show;
- epv->send = impl_Composer_send;
+ Composer_vepv.Bonobo_Unknown_epv = bonobo_object_get_epv ();
+ Composer_vepv.GNOME_Evolution_Composer_epv = evolution_composer_get_epv ();
}
static void
-evolution_composer_init (EvolutionComposer *composer)
+init (EvolutionComposer *composer)
{
- EAccount *account;
-
- account = mail_config_get_default_account ();
+ const MailConfigAccount *account;
+
+ account = mail_config_get_default_account ();
composer->composer = e_msg_composer_new ();
- composer->priv = g_malloc0(sizeof(*composer->priv));
+
+ gtk_signal_connect (GTK_OBJECT (composer->composer), "send",
+ GTK_SIGNAL_FUNC (send_cb), NULL);
+ gtk_signal_connect (GTK_OBJECT (composer->composer), "save-draft",
+ GTK_SIGNAL_FUNC (save_draft_cb), NULL);
}
#if 0
@@ -369,7 +346,7 @@ evolution_composer_construct (EvolutionComposer *composer,
g_return_if_fail (EVOLUTION_IS_COMPOSER (composer));
g_return_if_fail (corba_object != CORBA_OBJECT_NIL);
- /*bonobo_object_construct (BONOBO_OBJECT (composer), corba_object);*/
+ bonobo_object_construct (BONOBO_OBJECT (composer), corba_object);
item_handler = BONOBO_OBJECT (
bonobo_item_handler_new (NULL, get_object, composer));
@@ -377,21 +354,66 @@ evolution_composer_construct (EvolutionComposer *composer,
}
EvolutionComposer *
-evolution_composer_new (void (*send) (EMsgComposer *, gpointer),
- void (*save_draft) (EMsgComposer *, int, gpointer))
+evolution_composer_new (void)
{
EvolutionComposer *new;
- struct _EvolutionComposerPrivate *p;
+ POA_GNOME_Evolution_Composer *servant;
+ CORBA_Environment ev;
+ GNOME_Evolution_Composer corba_object;
+
+ servant = (POA_GNOME_Evolution_Composer *) g_new0 (BonoboObjectServant, 1);
+ servant->vepv = &Composer_vepv;
+
+ CORBA_exception_init (&ev);
+ POA_GNOME_Evolution_Composer__init ((PortableServer_Servant) servant, &ev);
+ if (ev._major != CORBA_NO_EXCEPTION) {
+ g_free (servant);
+ CORBA_exception_free (&ev);
+ return NULL;
+ }
+ CORBA_exception_free (&ev);
- new = g_object_new(EVOLUTION_TYPE_COMPOSER, NULL);
- evolution_composer_construct (new, bonobo_object_corba_objref((BonoboObject *)new));
- p = new->priv;
- p->send_cb = send;
- p->save_draft_cb = save_draft;
- p->send_id = g_signal_connect (new->composer, "send", G_CALLBACK (send), NULL);
- p->save_draft_id = g_signal_connect (new->composer, "save-draft", G_CALLBACK (save_draft), NULL);
+ new = gtk_type_new (evolution_composer_get_type ());
+ corba_object = bonobo_object_activate_servant (BONOBO_OBJECT (new),
+ servant);
+ evolution_composer_construct (new, corba_object);
return new;
}
-BONOBO_TYPE_FUNC_FULL(EvolutionComposer, GNOME_Evolution_Composer, BONOBO_TYPE_OBJECT, evolution_composer)
+E_MAKE_TYPE (evolution_composer, "EvolutionComposer", EvolutionComposer, class_init, init, PARENT_TYPE)
+
+
+#define GNOME_EVOLUTION_MAIL_COMPOSER_FACTORY_ID "OAFIID:GNOME_Evolution_Mail_ComposerFactory"
+
+static BonoboObject *
+factory_fn (BonoboGenericFactory *factory, void *closure)
+{
+ if (!mail_config_is_configured ()) {
+ e_notice (NULL, GNOME_MESSAGE_BOX_ERROR,
+ _("Could not create composer window, because you "
+ "have not yet\nconfigured any identities in the "
+ "mail component."));
+ return NULL;
+ }
+ if (! (session && mail_session_get_interactive ())) {
+ /* Don't return a composer if mailer isn't ready. */
+ return NULL;
+ }
+ return BONOBO_OBJECT (evolution_composer_new ());
+}
+
+void
+evolution_composer_factory_init (void (*send) (EMsgComposer *, gpointer),
+ void (*save_draft) (EMsgComposer *, int, gpointer))
+{
+ if (bonobo_generic_factory_new (GNOME_EVOLUTION_MAIL_COMPOSER_FACTORY_ID,
+ factory_fn, NULL) == NULL) {
+ e_notice (NULL, GNOME_MESSAGE_BOX_ERROR,
+ _("Cannot initialize the Evolution composer."));
+ exit (1);
+ }
+
+ send_cb = send;
+ save_draft_cb = save_draft;
+}
diff --git a/configure.in b/configure.in
index 8766b12bde..dcc5e1de94 100644
--- a/configure.in
+++ b/configure.in
@@ -1,14 +1,56 @@
# Process this file with autoconf to produce a configure script.
-AC_PREREQ(2.52)
+AC_INIT(camel)
+AM_CONFIG_HEADER(config.h)
-AC_INIT(evolution, 1.3.1.99, http://bugzilla.ximian.com/enter_bug.cgi?product=Evolution)
-AC_CONFIG_SRCDIR(README)
-AM_INIT_AUTOMAKE(AC_PACKAGE_NAME, AC_PACKAGE_VERSION)
+if test -f libversit/CVS/Repository; then
+ case `cat libversit/CVS/Repository` in
+ gnome-pim*)
+ echo ""
+ echo "ERROR: CVS working directory is out of date"
+ echo "Please do:"
+ echo " rm -rf libversit"
+ echo " cvs update -d libversit"
+ echo " automake libversit/Makefile"
+ echo "and try again. We apologize for the inconvenience"
+ exit 1
+ ;;
+ esac
+fi
-AM_CONFIG_HEADER(config.h)
+EVOLUTION_MAJOR_VERSION=1
+EVOLUTION_MINOR_VERSION=2
+EVOLUTION_MICRO_VERSION=4
+EVOLUTION_NANO_VERSION=0
+VERSION=$EVOLUTION_MAJOR_VERSION.$EVOLUTION_MINOR_VERSION.$EVOLUTION_MICRO_VERSION
+PACKAGE=evolution
+
+AM_INIT_AUTOMAKE($PACKAGE, $VERSION)
+AC_SUBST(VERSION)
AC_CANONICAL_HOST
-AC_DEFINE_UNQUOTED(VERSION_COMMENT, "(Preview Release)", [Define if you want a comment appended to the version number])
+
+AC_DEFINE_UNQUOTED(VERSION_COMMENT, "")
+
+SCROLLKEEPER_REQUIRED=0.1.4
+AC_SUBST(SCROLLKEEPER_REQUIRED)
+
+dnl Check for scrollkeeper
+AC_PATH_PROG(SCROLLKEEPER_CONFIG, scrollkeeper-config,no)
+if test x$SCROLLKEEPER_CONFIG = xno; then
+ AC_MSG_ERROR(Couldn't find scrollkeeper-config -- please install the scrollkeeper package)
+fi
+SCROLLKEEPER_LOCALSTATE_DIR=`scrollkeeper-config --pkglocalstatedir`
+AC_SUBST(SCROLLKEEPER_LOCALSTATE_DIR)
+
+dnl Test whether jw is installed
+AC_PATH_PROG(JW,jw,no)
+if test x$JW = xno; then
+ HAVE_JW="no"
+else
+ HAVE_JW="yes"
+fi
+AM_CONDITIONAL(HAVE_JW, test "x$HAVE_JW" = "xyes")
+AC_SUBST(HAVE_JW)
dnl Initialize maintainer mode
AM_MAINTAINER_MODE
@@ -16,7 +58,6 @@ AM_MAINTAINER_MODE
AC_ISC_POSIX
AC_PROG_CC
AC_PROG_CPP
-AC_C_INLINE
AM_PROG_LEX
AC_PROG_YACC
case $YACC in
@@ -30,33 +71,17 @@ AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_MAKE_SET
-dnl Test whether jw is installed
-AC_PATH_PROG(JW,jw,no)
-if test x$JW = xno; then
- HAVE_JW="no"
-else
- HAVE_JW="yes"
-fi
-AM_CONDITIONAL(HAVE_JW, test "x$HAVE_JW" = "xyes")
-AC_SUBST(HAVE_JW)
-
-dnl I18N stuff
-AC_PROG_INTLTOOL
-
-ALL_LINGUAS="am az bg ca cs da de el en_AU en_GB es et eu fi fr ga gl hu it ja ko lt lv nl nn no pl pt pt_BR ro ru sk sl sv tr uk vi zh_CN zh_TW"
-AM_GLIB_GNU_GETTEXT
-
-GETTEXT_PACKAGE=evolution-1.4
-AC_SUBST(GETTEXT_PACKAGE)
-AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE", [Package name for gettext])
-
-localedir='$(prefix)/$(DATADIRNAME)/locale'
-AC_SUBST(localedir)
+dnl Initialize xml-i18n-tools
+AM_PROG_XML_I18N_TOOLS
dnl Initialize libtool
AM_PROG_LIBTOOL
-dnl alloca()
+AM_ACLOCAL_INCLUDE(macros)
+GNOME_INIT()
+GNOME_COMPILE_WARNINGS
+GNOME_X_CHECKS
+EVO_CHECK_LIB(gnome-libs, gnome, 1.2.9)
AC_CHECK_HEADERS(alloca.h)
dnl check for socklen_t (in Unix98)
@@ -68,10 +93,15 @@ AC_TRY_COMPILE([#include <sys/socket.h>
int accept (int, struct sockaddr *, size_t *);
],[],[
AC_MSG_RESULT(size_t)
-AC_DEFINE(socklen_t,size_t,[Define to appropriate type if socklen_t is not defined])], [
+AC_DEFINE(socklen_t,size_t)], [
AC_MSG_RESULT(int)
AC_DEFINE(socklen_t,int)])])
+ALL_LINGUAS="az bg ca cs da de el en_AU en_GB es et eu fi fr ga gl hu it ja ko lt lv nl nn no pl pt pt_BR ro ru sk sl sv tr uk vi zh_CN zh_TW"
+AM_GNOME_GETTEXT
+localedir='$(prefix)/$(DATADIRNAME)/locale'
+AC_SUBST(localedir)
+
dnl
dnl Purify support
dnl
@@ -81,7 +111,7 @@ dnl
dnl system mail stuff
dnl
AC_PATH_PROG(SENDMAIL, sendmail, /usr/sbin/sendmail, /usr/sbin:/usr/lib)
-AC_DEFINE_UNQUOTED(SENDMAIL_PATH, "$SENDMAIL", [Path to a sendmail binary, or equivalent])
+AC_DEFINE_UNQUOTED(SENDMAIL_PATH, "$SENDMAIL")
AC_MSG_CHECKING(system mail directory)
if test -d /var/mail -a '!' -h /var/mail ; then
@@ -89,7 +119,7 @@ if test -d /var/mail -a '!' -h /var/mail ; then
else
system_mail_dir=/var/spool/mail
fi
-AC_DEFINE_UNQUOTED(SYSTEM_MAIL_DIR, "$system_mail_dir", [Directory local mail is delivered to])
+AC_DEFINE_UNQUOTED(SYSTEM_MAIL_DIR, "$system_mail_dir")
case `ls -ld $system_mail_dir 2>&1 | awk '{print $1;}'` in
d??????rw?)
@@ -133,7 +163,7 @@ AC_CACHE_CHECK(for tm_gmtoff in struct tm, ac_cv_struct_tm_gmtoff,
tm.tm_gmtoff = 1;
], ac_cv_struct_tm_gmtoff=yes, ac_cv_struct_tm_gmtoff=no))
if test $ac_cv_struct_tm_gmtoff = yes; then
- AC_DEFINE(HAVE_TM_GMTOFF, 1, [Define if struct tm has a tm_gmtoff member])
+ AC_DEFINE(HAVE_TM_GMTOFF)
else
AC_CACHE_CHECK(for timezone variable, ac_cv_var_timezone,
AC_TRY_COMPILE([
@@ -142,7 +172,7 @@ else
timezone = 1;
], ac_cv_var_timezone=yes, ac_cv_var_timezone=no))
if test $ac_cv_var_timezone = yes; then
- AC_DEFINE(HAVE_TIMEZONE, 1, [Define if libc defines a timezone variable])
+ AC_DEFINE(HAVE_TIMEZONE)
AC_CACHE_CHECK(for altzone variable, ac_cv_var_altzone,
AC_TRY_COMPILE([
#include <time.h>
@@ -150,7 +180,7 @@ else
altzone = 1;
], ac_cv_var_altzone=yes, ac_cv_var_altzone=no))
if test $ac_cv_var_altzone = yes; then
- AC_DEFINE(HAVE_ALTZONE, 1, [Define if libc defines an altzone variable])
+ AC_DEFINE(HAVE_ALTZONE)
fi
else
AC_ERROR(unable to find a way to determine timezone)
@@ -180,7 +210,7 @@ AC_CACHE_CHECK([if ctime_r wants three arguments], ac_cv_ctime_r_three_args,
])
if test x"$ac_cv_ctime_r_three_args" = xyes ; then
- AC_DEFINE(CTIME_R_THREE_ARGS, 1, [Solaris-style ctime_r])
+ AC_DEFINE(CTIME_R_THREE_ARGS)
fi
dnl **************************************************
@@ -213,7 +243,7 @@ AC_CACHE_CHECK([if gethostbyname_r wants five arguments], ac_cv_gethostbyname_r_
])])
if test "x$ac_cv_gethostbyname_r_five_args" = "xyes" ; then
- AC_DEFINE(GETHOSTBYNAME_R_FIVE_ARGS, 1, [Solaris-style gethostbyname_r])
+ AC_DEFINE(GETHOSTBYNAME_R_FIVE_ARGS)
fi
dnl **************************************************
@@ -246,7 +276,7 @@ AC_CACHE_CHECK([if gethostbyaddr_r wants seven arguments], ac_cv_gethostbyaddr_r
])])
if test "x$ac_cv_gethostbyaddr_r_seven_args" = "xyes" ; then
- AC_DEFINE(GETHOSTBYADDR_R_SEVEN_ARGS, 1, [Solaris-style gethostbyaddr_r])
+ AC_DEFINE(GETHOSTBYADDR_R_SEVEN_ARGS)
fi
@@ -281,9 +311,8 @@ AC_CACHE_CHECK([if system has necessary structs and functions for IPv6 support],
else
msg_ipv6=no
fi
-
if test "x$enable_ipv6" = "xyes"; then
- AC_DEFINE(ENABLE_IPv6,1,[Enable IPv6 support])
+ AC_DEFINE(ENABLE_IPv6)
fi
AM_CONDITIONAL(ENABLE_IPv6, test "x$enable_ipv6" = "xyes")
@@ -301,9 +330,9 @@ evolution_db_version_minor=1
evolution_db_version_patch=17
evolution_db_version=${evolution_db_version_major}.${evolution_db_version_minor}.${evolution_db_version_patch}
-AC_DEFINE_UNQUOTED(EVOLUTION_DB_VERSION_MAJOR,$evolution_db_version_major,[la])
-AC_DEFINE_UNQUOTED(EVOLUTION_DB_VERSION_MINOR,$evolution_db_version_minor,[la])
-AC_DEFINE_UNQUOTED(EVOLUTION_DB_VERSION_PATCH,$evolution_db_version_patch,[la])
+AC_DEFINE_UNQUOTED(EVOLUTION_DB_VERSION_MAJOR,$evolution_db_version_major)
+AC_DEFINE_UNQUOTED(EVOLUTION_DB_VERSION_MINOR,$evolution_db_version_minor)
+AC_DEFINE_UNQUOTED(EVOLUTION_DB_VERSION_PATCH,$evolution_db_version_patch)
AC_ARG_WITH(db3, [ --with-db3=PREFIX Location of db3],
@@ -438,39 +467,39 @@ dnl **************************************************
AC_ARG_ENABLE(nntp,
[ --enable-nntp=[no/yes] Attempt to compile incomplete, unsupported NNTP code],,enable_nntp=no)
if test "x$enable_nntp" = "xyes"; then
- AC_DEFINE(ENABLE_NNTP,1,[Don't try this at home])
+ AC_DEFINE(ENABLE_NNTP)
msg_nntp=yes
else
msg_nntp=no
fi
AM_CONDITIONAL(ENABLE_NNTP, test x$enable_nntp = xyes)
-
dnl **************************************************
dnl * Posix thread support
dnl **************************************************
-dnl GLIB_CONFIG=${GLIB_CONFIG-glib-config}
-dnl GNOME_PTHREAD_CHECK
+dnl Hah! Threads are no longer an option
+dnl AC_ARG_WITH(threads, [ --with-threads Include thread support],[
+dnl FIXME: support more thread types, pth at least
+
+GLIB_CONFIG=${GLIB_CONFIG-glib-config}
+GNOME_PTHREAD_CHECK
-dnl if test "x$PTHREAD_LIB" = "x" ; then
-dnl AC_MSG_ERROR([POSIX threads are currently required for Evolution])
-dnl fi
+if test "x$PTHREAD_LIB" = "x" ; then
+ AC_MSG_ERROR([POSIX threads are currently required for Evolution])
+fi
dnl
dnl Notice that this is a hack, and we wont be able to use this forever, but
dnl at least for some time
dnl
-EVO_PTHREAD_CHECK
-
-THREADS_LIBS="$PTHREAD_LIB"
-THREADS_CFLAGS="$PTHREAD_CFLAGS"
+THREADS_LIBS="$PTHREAD_LIB `$GLIB_CONFIG --libs gthread`"
+THREADS_CFLAGS="`$GLIB_CONFIG --cflags gthread`"
AC_SUBST(THREADS_LIBS)
AC_SUBST(THREADS_CFLAGS)
-AC_DEFINE(ENABLE_THREADS,1,[Required])
-
+AC_DEFINE(ENABLE_THREADS)
dnl **************************************************
dnl * File locking
@@ -479,7 +508,7 @@ dnl **************************************************
AC_ARG_ENABLE(dot-locking,
[ --enable-dot-locking=[yes/no] Enable support for locking mail files with dot locking],,enable_dot_locking=yes)
if test "x$enable_dot_locking" = "xyes"; then
- AC_DEFINE(USE_DOT,1,[Define to use dot locking for mbox files])
+ AC_DEFINE(USE_DOT)
msg_dot=yes
else
msg_dot=no
@@ -488,18 +517,17 @@ fi
AC_ARG_ENABLE(file-locking,
[ --enable-file-locking=[fcntl/flock/no] Enable support for locking mail files with file locking],,enable_file_locking=fcntl)
if test "x$enable_file_locking" = "xfcntl"; then
- AC_DEFINE(USE_FCNTL,1,[Define to use fcntl locking for mbox files])
+ AC_DEFINE(USE_FCNTL)
msg_file=fcntl
else
if test "x$enable_file_locking" = "xflock"; then
- AC_DEFINE(USE_FLOCK,1,[Define to use flock locking for mbox files])
+ AC_DEFINE(USE_FLOCK)
msg_file=flock
else
msg_file=no
fi
fi
-
dnl **************************************************
dnl * sendmail operation
dnl **************************************************
@@ -513,22 +541,58 @@ AC_ARG_WITH(broken-spool,
[ --with-broken-spool=[yes/no] Using SunOS/Solaris sendmail which has a broken spool format],,with_broken_spool=${with_broken_spool:=no})
if test "x$with_broken_spool" = "xyes"; then
- AC_DEFINE(HAVE_BROKEN_SPOOL,1,[Define if mail delivered to the system mail directory is in broken Content-Length format])
+ AC_DEFINE(HAVE_BROKEN_SPOOL)
fi
AC_MSG_RESULT($with_broken_spool)
+dnl ***************************************************************
+dnl Whether to build shlib components (instead of out-of-proc ones)
+dnl ***************************************************************
+
+AC_ARG_ENABLE(shlib-components,
+ [ --enable-shlib-components Enable building of some of the components as shared libs],
+ enable_shlib_components=yes,enable_shlib_components=no)
+
+AM_CONDITIONAL(ENABLE_SHLIB_COMPONENTS, test "x$enable_shlib_components" = "xyes")
+
+if test "x$enable_shlib_components" = "xyes" ; then
+ OAF_SHLIB_TYPE="shlib"
+ OAF_SHLIB_PREFIX="lib"
+ OAF_SHLIB_SUFFIX=".so"
+else
+ OAF_SHLIB_TYPE="exe"
+ OAF_SHLIB_PREFIX=""
+ OAF_SHLIB_SUFFIX=""
+fi
-dnl *********
-dnl Libraries
-dnl *********
+AC_SUBST(OAF_SHLIB_TYPE)
+AC_SUBST(OAF_SHLIB_PREFIX)
+AC_SUBST(OAF_SHLIB_SUFFIX)
-PKG_CHECK_MODULES(GTKHTML, libgtkhtml-3.0)
+dnl ***************
+dnl GNOME Libraries
+dnl ***************
+EVO_CHECK_LIB(Bonobo, bonobox, 1.0.3)
+EVO_CHECK_LIB(OAF, oaf, 0.6.10)
+EVO_CHECK_LIB(libglade, libglade, 0.14)
+EVO_CHECK_LIB(gdk-pixbuf with GNOME canvas support, gnomecanvaspixbuf, 0.18.0)
+EVO_CHECK_LIB(GNOME-VFS, vfs, 1.0.5)
+EVO_CHECK_LIB(libxml, xml, 1.8.17, 2.0)
+EVO_CHECK_LIB(bonobo-conf, bonobo_conf, 0.11)
+
+EVO_CHECK_LIB(GAL, gal, 0.22)
+PKG_CHECK_MODULES(GTKHTML, gtkhtml-1.1 >= 1.1.7)
AC_SUBST(GTKHTML_CFLAGS)
AC_SUBST(GTKHTML_LIBS)
-GTKHTML_DATADIR=`$PKG_CONFIG --variable gtkhtml_datadir libgtkhtml-3.0`
+GTKHTML_DATADIR=`$PKG_CONFIG --variable gtkhtml_datadir gtkhtml-1.1`
AC_SUBST(GTKHTML_DATADIR)
+EVO_CHECK_LIB(Libsoup, soup, 0.7)
+AM_PATH_GCONF(1.0,,,gconf gconf-gtk)
+if test "x$GCONF_CFLAGS" = "x" ; then
+ AC_MSG_ERROR(Evolution requires GConf to be installed)
+fi
dnl ******************************
dnl Pilot checking
@@ -536,12 +600,12 @@ dnl ******************************
AC_ARG_ENABLE(pilot-conduits,
[ --enable-pilot-conduits=[no/yes] Enable support for building pilot conduits.],,enable_pilot_conduits=no)
if test "x$enable_pilot_conduits" = "xyes"; then
- PKG_CHECK_MODULES(GNOME_PILOT, gnome-pilot-2.0)
+ GNOME_PILOT_CHECK
CFLAGS_save="$CFLAGS"
- CFLAGS="$CFLAGS $GNOME_PILOT_CFLAGS"
+ CFLAGS="$CFLAGS $PISOCK_CFLAGS"
LDFLAGS_save="$LDFLAGS"
- LDFLAGS="$LDFLAGS $GNOME_PILOT_LIBS"
+ LDFLAGS="$LDFLAGS $PISOCK_LIBS"
AC_CACHE_CHECK([if pilot-link handles UTF-8 conversions], ac_cv_pilot_link_utf8, AC_TRY_RUN([
@@ -556,7 +620,7 @@ int main (int argc, char **argv)
char *pstring;
if (convert_ToPilotChar ("UTF-8", utf8, utf8_real_len, &pstring) == -1)
- exit (1);
+ exit (1);
exit (0);
}
@@ -575,8 +639,6 @@ if test x$enable_pilot_conduits = xyes; then
else
msg_pilot=no
fi
-AC_SUBST(GNOME_PILOT_CFLAGS)
-AC_SUBST(GNOME_PILOT_LIBS)
dnl ********
dnl Kerberos
@@ -585,7 +647,7 @@ AC_ARG_WITH(krb5, [ --with-krb5=PREFIX Location of Kerberos 5 libs/include
AC_ARG_WITH(krb4, [ --with-krb4=PREFIX Location of Kerberos 4 libs/includes], with_krb4="$withval", with_krb4="no")
msg_krb5="no"
-if test "x${with_krb5}" != "xno"; then
+if test "x$with_krb5" != "xno"; then
LDFLAGS_save="$LDFLAGS"
mitlibs="-lkrb5 -lk5crypto -lcom_err -lgssapi_krb5"
@@ -601,15 +663,15 @@ if test "x${with_krb5}" != "xno"; then
LDFLAGS="$LDFLAGS_save"
])
if test "$ac_cv_lib_kerberos5" != "no"; then
- AC_DEFINE(HAVE_KRB5,1,[Define if you have Krb5])
+ AC_DEFINE(HAVE_KRB5)
if test "$ac_cv_lib_kerberos5" == "$mitlibs"; then
- AC_DEFINE(HAVE_MIT_KRB5,1,[Define if you have MIT Krb5])
KRB5_CFLAGS="-I$with_krb5/include"
msg_krb5="yes (MIT)"
+ AC_DEFINE(HAVE_MIT_KRB5)
else
- AC_DEFINE(HAVE_HEIMDAL_KRB5,1,[Define if you have Heimdal])
KRB5_CFLAGS="-I$with_krb5/include/heimdal"
msg_krb5="yes (Heimdal)"
+ AC_DEFINE(HAVE_HEIMDAL_KRB5)
fi
KRB5_LDFLAGS="-L$with_krb5/lib $ac_cv_lib_kerberos5"
fi
@@ -647,7 +709,7 @@ if test "x${with_krb4}" != "xno"; then
])
LDFLAGS="$LDFLAGS_save"
if test "$ac_cv_lib_kerberos4" != "no"; then
- AC_DEFINE(HAVE_KRB4,1,[Define if you have Krb4])
+ AC_DEFINE(HAVE_KRB4)
msg_krb4="yes"
if test -f "$with_krb4/include/krb.h" -o -f "$with_krb4/include/port-sockets.h"; then
KRB4_CFLAGS="-I$with_krb4/include"
@@ -661,7 +723,7 @@ if test "x${with_krb4}" != "xno"; then
CFLAGS="$CFLAGS $KRB4_CFLAGS"
AC_TRY_COMPILE([#include "krb.h"
int krb_sendauth;
- ],[return 0],[AC_DEFINE(NEED_KRB_SENDAUTH_PROTO,1,[Need krb_sendauth proto])],)
+ ],[return 0],[AC_DEFINE(NEED_KRB_SENDAUTH_PROTO)],)
CFLAGS="$CFLAGS_save"
fi
else
@@ -681,7 +743,7 @@ dnl ==========================
AC_ARG_ENABLE(pedantic-pgp-mime,
[ --enable-pedantic-pgp-mime=[no/yes] Enable pedantic PGP/MIME handling (not recommended)],,enable_pedantic_pgp_mime=no)
if test "x$enable_pedantic_pgp_mime" = "xyes"; then
- AC_DEFINE(ENABLE_PEDANTIC_PGPMIME,1,[Probably don't want this])
+ AC_DEFINE(ENABLE_PEDANTIC_PGPMIME)
fi
@@ -693,7 +755,7 @@ dnl needed by Camel (SSL and S/MIME).
dnl
dnl The Evolution security extensions are only built if these libraries are found
dnl ********************************************************************************
-msg_ssl="no"
+msg_ssl=no
dnl these 2 enable's are inverses of each other
AC_ARG_ENABLE(nss, [ --enable-nss=[yes,no,static] Attempt to use Mozilla libnss for SSL support.],
@@ -708,203 +770,169 @@ dnl User wants to override nss with OpenSSL
AC_MSG_WARN([OpenSSL enabled, disabling NSS.])
fi
-AC_ARG_WITH(nspr-includes, [ --with-nspr-includes=PREFIX Location of Mozilla nspr4 includes.],
- with_nspr_includes="$withval")
-
-AC_ARG_WITH(nspr-libs, [ --with-nspr-libs=PREFIX Location of Mozilla nspr4 libs.],
- with_nspr_libs="$withval")
-
-AC_ARG_WITH(nss-includes, [ --with-nss-includes=PREFIX Location of Mozilla nss3 includes.],
- with_nss_includes="$withval")
-
-AC_ARG_WITH(nss-libs, [ --with-nss-libs=PREFIX Location of Mozilla nss3 libs.],
- with_nss_libs="$withval")
-
if test "x${enable_nss}" = "xyes" || test "x${enable_nss}" = "xstatic"; then
- if test -n "${with_nspr_includes}" || test -n "${with_nspr_libs}" || test -n "${with_nss_includes}" || test -n "${with_nss_libs}" || test "x${enable_nss}" = "xstatic"; then
-dnl If the user specifies --with-foo or --enable-nss=static, then we have to do this manually
- check_manually="yes"
+ AC_ARG_WITH(nspr-includes, [ --with-nspr-includes=PREFIX Location of NSPR header files.],
+ with_nspr_includes="$withval", with_nspr_includes="/usr/include/nspr")
+ have_nspr_includes="no"
+ if test "x${with_nspr_includes}" != "xno"; then
+ CPPFLAGS_save="$CPPFLAGS"
+
+ AC_MSG_CHECKING(for Mozilla nspr4 includes in $with_nspr_includes)
+ AC_MSG_RESULT("")
+
+ CPPFLAGS="$CPPFLAGS -I$with_nspr_includes"
+ AC_CHECK_HEADERS(nspr.h prio.h, [ moz_nspr_includes="yes" ])
+ CPPFLAGS="$CPPFLAGS_save"
+
+ if test "x{$moz_nspr_includes}" != "xno" -a "x{$moz_nspr_includes}" != "x" ; then
+ have_nspr_includes="yes"
+ NSPR_CFLAGS="-I$with_nspr_includes"
+ fi
else
- check_manually="no"
+ AC_MSG_CHECKING(for Mozilla nspr4 includes)
+ AC_MSG_RESULT(no)
fi
- if test "x${check_manually}" = "xno"; then
- PKG_CHECK_MODULES(NSS, mozilla-nss, have_nss="yes")
- if test "x${have_nss}" = "xyes"; then
- msg_ssl="yes (Mozilla NSS)"
- mozilla_nspr="mozilla-nspr"
- mozilla_nss="mozilla-nss"
- AC_DEFINE(HAVE_NSS,1,[Define if you have NSS])
- AC_DEFINE(HAVE_SSL,1,[Define if you have a supported SSL library])
- MANUAL_NSPR_CFLAGS=""
- MANUAL_NSPR_LIBS=""
- MANUAL_NSS_CFLAGS=""
- MANUAL_NSS_LIBS=""
+ AC_ARG_WITH(nspr-libs, [ --with-nspr-libs=PREFIX Location of Mozilla nspr4 libs.],
+ with_nspr_libs="$withval")
+ have_nspr_libs="no"
+ if test "x${with_nspr_libs}" != "xno" -a "x${have_nspr_includes}" != "xno"; then
+ CFLAGS_save="$CFLAGS"
+ LDFLAGS_save="$LDFLAGS"
+
+ if test "$enable_nss" = "static"; then
+ if test -z "${with_nspr_libs}"; then
+ AC_MSG_ERROR([Static linkage requested, but path to nspr libraries not set]
+ [Please specify the path to libnspr4.a]
+ [Example: --with-nspr-libs=/usr/lib])
+ else
+ nsprlibs="-ldl $with_nspr_libs/libplc4.a $with_nspr_libs/libplds4.a $with_nspr_libs/libnspr4.a $PTHREAD_LIB"
+ fi
else
- check_manually="yes"
+ nsprlibs="-ldl -lplc4 -lplds4 -lnspr4 $PTHREAD_LIB"
fi
- fi
-
- if test "x${check_manually}" = "xyes"; then
- mozilla_nss=""
- have_nspr_includes="no"
- if test "x${with_nspr_includes}" != "xno"; then
- CPPFLAGS_save="$CPPFLAGS"
-
- AC_MSG_CHECKING(for Mozilla nspr4 includes in $with_nspr_includes)
- AC_MSG_RESULT("")
-
- CPPFLAGS="$CPPFLAGS -I$with_nspr_includes"
- AC_CHECK_HEADERS(nspr.h prio.h, [ moz_nspr_includes="yes" ])
- CPPFLAGS="$CPPFLAGS_save"
-
- if test "x{$moz_nspr_includes}" != "xno" -a "x{$moz_nspr_includes}" != "x" ; then
- have_nspr_includes="yes"
- MANUAL_NSPR_CFLAGS="-I$with_nspr_includes"
+
+ AC_CACHE_CHECK([for Mozilla nspr libraries], moz_nspr_libs,
+ [
+ LIBS_save="$LIBS"
+ CFLAGS="$CFLAGS $NSPR_CFLAGS"
+
+ if test "x${with_nspr_libs}" != "x"; then
+ LIBS="$nsprlibs"
+ LDFLAGS="$LDFLAGS -L$with_nspr_libs"
+ else
+ LIBS="$nsprlibs"
+ LDFLAGS="$LDFLAGS"
fi
+
+ AC_TRY_LINK_FUNC(PR_Init, moz_nspr_libs="yes", moz_nspr_libs="no")
+ CFLAGS="$CFLAGS_save"
+ LDFLAGS="$LDFLAGS_save"
+ LIBS="$LIBS_save"
+ ])
+ if test "x$moz_nspr_libs" != "xno"; then
+ have_nspr_libs="yes"
+ NSPR_LDFLAGS="-L$with_nspr_libs $nsprlibs"
else
- AC_MSG_CHECKING(for Mozilla nspr4 includes)
- AC_MSG_RESULT(no)
+ NSPR_CLFAGS=""
fi
+ else
+ AC_MSG_CHECKING(for Mozilla nspr4 libraries)
+ AC_MSG_RESULT(no)
+ fi
+
+ AC_ARG_WITH(nss-includes, [ --with-nss-includes=PREFIX Location of NSS3 headers.],
+ with_nss_includes="$withval", with_nss_includes="/usr/include/moznss")
+ if test "x${with_nss_includes}" != "xno" -a "x${have_nspr_libs}" != "xno"; then
+ CPPFLAGS_save="$CPPFLAGS"
- have_nspr_libs="no"
- if test "x${with_nspr_libs}" != "xno" -a "x${have_nspr_includes}" != "xno"; then
- CFLAGS_save="$CFLAGS"
- LDFLAGS_save="$LDFLAGS"
-
- if test "$enable_nss" = "static"; then
- if test -z "${with_nspr_libs}"; then
- AC_MSG_ERROR([Static linkage requested, but path to nspr libraries not set.]
-[Please specify the path to libnspr4.a]
-[Example: --with-nspr-libs=/usr/lib])
- else
- nsprlibs="-ldl $with_nspr_libs/libplc4.a $with_nspr_libs/libplds4.a $with_nspr_libs/libnspr4.a $PTHREAD_LIB"
- fi
- else
- nsprlibs="-ldl -lplc4 -lplds4 -lnspr4 $PTHREAD_LIB"
- fi
-
- AC_CACHE_CHECK([for Mozilla nspr libraries], moz_nspr_libs,
- [
- LIBS_save="$LIBS"
- CFLAGS="$CFLAGS $MANUAL_NSPR_CFLAGS"
-
- if test "x${with_nspr_libs}" != "x"; then
- LIBS="$nsprlibs"
- LDFLAGS="$LDFLAGS -L$with_nspr_libs"
- else
- LIBS="$nsprlibs"
- LDFLAGS="$LDFLAGS"
- fi
-
- AC_TRY_LINK_FUNC(PR_Init, moz_nspr_libs="yes", moz_nspr_libs="no")
- CFLAGS="$CFLAGS_save"
- LDFLAGS="$LDFLAGS_save"
- LIBS="$LIBS_save"
- ])
- if test "x$moz_nspr_libs" != "xno"; then
- have_nspr_libs="yes"
- MANUAL_NSPR_LIBS="-L$with_nspr_libs $nsprlibs"
- else
- MANUAL_NSPR_CLFAGS=""
- fi
- else
- AC_MSG_CHECKING(for Mozilla nspr4 libraries)
- AC_MSG_RESULT(no)
+ AC_MSG_CHECKING(for Mozilla nss3 includes in $with_nss_includes)
+ AC_MSG_RESULT("")
+
+ if test "x${with_nspr_includes}" != "x"; then
+ CPPFLAGS="$CPPFLAGS -I$with_nspr_includes -I$with_nss_includes"
+ else
+ CPPFLAGS="$CPPFLAGS -I$with_nss_includes"
fi
+
+ AC_CHECK_HEADERS(nss.h ssl.h smime.h,
+ [ have_nss_includes="yes" ],
+ [ have_nss_includes="no" ])
+
+ CPPFLAGS="$CPPFLAGS_save"
- if test "x${with_nss_includes}" != "xno" -a "x${have_nspr_libs}" != "xno"; then
- CPPFLAGS_save="$CPPFLAGS"
-
- AC_MSG_CHECKING(for Mozilla nss3 includes in $with_nss_includes)
- AC_MSG_RESULT("")
-
- if test "x${with_nspr_includes}" != "x"; then
- CPPFLAGS="$CPPFLAGS -I$with_nspr_includes -I$with_nss_includes"
- else
- CPPFLAGS="$CPPFLAGS -I$with_nss_includes"
- fi
-
- AC_CHECK_HEADERS(nss.h ssl.h smime.h,
- [ have_nss_includes="yes" ],
- [ have_nss_includes="no" ])
-
- CPPFLAGS="$CPPFLAGS_save"
-
- if test "x${have_nss_includes}" = "xyes"; then
- have_nss_includes="yes"
- MANUAL_NSS_CFLAGS="-I$with_nss_includes"
- else
- MANUAL_NSPR_CFLAGS=""
- MANUAL_NSPR_LIBS=""
- fi
+ if test "x${have_nss_includes}" = xyes ; then
+ have_nss_includes="yes"
+ NSS_CFLAGS="-I$with_nss_includes"
else
- AC_MSG_CHECKING(for Mozilla nss3 includes)
- AC_MSG_RESULT(no)
+ NSPR_CFLAGS=""
+ NSPR_LDFLAGS=""
fi
-
- if test "x${with_nss_libs}" != "xno" -a "x${have_nss_includes}" != "xno"; then
- LDFLAGS_save="$LDFLAGS"
-
- if test "$enable_nss" = "static"; then
- if test -z "${with_nss_libs}"; then
- AC_MSG_ERROR([Static linkage requested, but path to nss libraries not set.]
-[Please specify the path to libnss3.a]
-[Example: --with-nspr-libs=/usr/lib/mozilla])
- else
- nsslibs="-ldb1 $with_nss_libs/libnssckfw.a $with_nss_libs/libasn1.a $with_nss_libs/libcrmf.a $with_nss_libs/libswfci.a $with_nss_libs/libjar.a $with_nss_libs/libpkcs12.a $with_nss_libs/libpkcs7.a $with_nss_libs/libpki1.a $with_nss_libs/libsmime.a $with_nss_libs/libssl.a $with_nss_libs/libnss.a $with_nss_libs/libpk11wrap.a $with_nss_libs/libsoftokn.a $with_nss_libs/libfreebl.a $with_nss_libs/libnsspki.a $with_nss_libs/libnssdev.a $with_nss_libs/libcryptohi.a $with_nss_libs/libcerthi.a $with_nss_libs/libcertdb.a $with_nss_libs/libsecutil.a $with_nss_libs/libnssb.a"
- case "$host" in
- *solaris*)
- nsslibs="$nsslibs $with_nss_libs/libfreebl.a"
- ;;
- esac
- fi
- else
- nsslibs="-lssl3 -lsmime3 -lnss3 -lsoftokn3"
- fi
-
- AC_CACHE_CHECK([for Mozilla nss libraries], moz_nss_libs,
- [
- LIBS_save="$LIBS"
+ else
+ AC_MSG_CHECKING(for Mozilla nss3 includes)
+ AC_MSG_RESULT(no)
+ fi
+
+ AC_ARG_WITH(nss-libs, [ --with-nss-libs=PREFIX Location of Mozilla nss3 libs.],
+ with_nss_libs="$withval")
+ if test "x${with_nss_libs}" != "xno" -a "x${have_nss_includes}" != "xno"; then
+ LDFLAGS_save="$LDFLAGS"
+
+ if test "$enable_nss" = "static"; then
+ if test -z "${with_nss_libs}"; then
+ AC_MSG_ERROR([Static linkage requested, but path to nss libraries not set]
+ [Please specify the path to libnss3.a]
+ [Example: --with-nspr-libs=/usr/lib/mozilla])
+ else
+ nsslibs="-ldb1 $with_nss_libs/libnssckfw.a $with_nss_libs/libasn1.a $with_nss_libs/libcrmf.a $with_nss_libs/libswfci.a $with_nss_libs/libjar.a $with_nss_libs/libpkcs12.a $with_nss_libs/libpkcs7.a $with_nss_libs/libpki1.a $with_nss_libs/libsmime.a $with_nss_libs/libssl.a $with_nss_libs/libnss.a $with_nss_libs/libpk11wrap.a $with_nss_libs/libsoftokn.a $with_nss_libs/libfreebl.a $with_nss_libs/libnsspki.a $with_nss_libs/libnssdev.a $with_nss_libs/libcryptohi.a $with_nss_libs/libcerthi.a $with_nss_libs/libcertdb.a $with_nss_libs/libsecutil.a $with_nss_libs/libnssb.a"
+ case "$host" in
+ *solaris*)
+ nsslibs="$nsslibs $with_nss_libs/libfreebl.a"
+ ;;
+ esac
+ fi
+ else
+ nsslibs="-lssl3 -lsmime3 -lnss3 -lsoftokn3"
+ fi
+
+ AC_CACHE_CHECK([for Mozilla nss libraries], moz_nss_libs,
+ [
+ LIBS_save="$LIBS"
+ LDFLAGS="$LDFLAGS -L$with_nspr_libs $nsprlibs -L$with_nss_libs $nsslibs"
+ LIBS="$nsslibs $nsprlibs"
+ AC_TRY_LINK_FUNC(NSS_Init, moz_nss_libs="yes", moz_nss_libs="no")
+ if test "$moz_nss_libs" = no; then
+ nsslibs="-lssl3 -lsmime3 -lnss3 -lsoftokn3"
LDFLAGS="$LDFLAGS -L$with_nspr_libs $nsprlibs -L$with_nss_libs $nsslibs"
- LIBS="$nsslibs $nsprlibs"
- AC_TRY_LINK_FUNC(NSS_Init, moz_nss_libs="yes", moz_nss_libs="no")
- if test "$moz_nss_libs" = no; then
- nsslibs="-lssl3 -lsmime3 -lnss3 -lsoftokn3"
- LDFLAGS="$LDFLAGS -L$with_nspr_libs $nsprlibs -L$with_nss_libs $nsslibs"
- AC_TRY_LINK_FUNC(NSS_Init, moz_nss_libs="yes", moz_nss_libs="no")
- fi
- LDFLAGS="$LDFLAGS_save"
- LIBS="$LIBS_save"
- ])
- if test "$moz_nss_libs" != no; then
- AC_DEFINE(HAVE_NSS)
- AC_DEFINE(HAVE_SSL)
- if test "$enable_nss" = "static"; then
- msg_ssl="yes (Mozilla NSS:static)"
- else
- msg_ssl="yes (Mozilla NSS)"
- fi # static_nss
- MANUAL_NSS_LIBS="-L$with_nss_libs $nsslibs"
- else
- MANUAL_NSS_CFLAGS=""
- MANUAL_NSPR_CFLAGS=""
- MANUAL_NSPR_LIBS=""
+ AC_TRY_LINK_FUNC(NSS_Init, moz_nss_libs="yes", moz_nss_libs="no")
fi
+ LDFLAGS="$LDFLAGS_save"
+ LIBS="$LIBS_save"
+ ])
+ if test "$moz_nss_libs" != no; then
+ AC_DEFINE(HAVE_NSS)
+ AC_DEFINE(HAVE_SSL)
+ if test "$enable_nss" = "static"; then
+ msg_ssl="yes (Mozilla NSS:static)"
+ else
+ msg_ssl="yes (Mozilla NSS)"
+ fi # static_nss
+ NSS_LDFLAGS="-L$with_nss_libs $nsslibs"
else
- AC_MSG_CHECKING(for Mozilla nss libraries)
- AC_MSG_RESULT(no)
+ NSS_CFLAGS=""
+ NSPR_CFLAGS=""
+ NSPR_LDFLAGS=""
fi
-
- MANUAL_NSS_CFLAGS="$MANUAL_NSPR_CFLAGS $MANUAL_NSS_CFLAGS"
- MANUAL_NSS_LIBS="$MANUAL_NSPR_LIBS $MANUAL_NSS_LIBS"
+ else
+ AC_MSG_CHECKING(for Mozilla nss libraries)
+ AC_MSG_RESULT(no)
fi
fi
-AC_SUBST(MANUAL_NSPR_CFLAGS)
-AC_SUBST(MANUAL_NSPR_LIBS)
-AC_SUBST(MANUAL_NSS_CFLAGS)
-AC_SUBST(MANUAL_NSS_LIBS)
+AC_SUBST(NSPR_CFLAGS)
+AC_SUBST(NSPR_LDFLAGS)
+AC_SUBST(NSS_CFLAGS)
+AC_SUBST(NSS_LDFLAGS)
dnl ******************
dnl CDE dtappintegrate
@@ -944,14 +972,12 @@ if test -z "$KILL_PROCESS_CMD" ; then
AC_MSG_RESULT(none)
else
AC_MSG_RESULT($KILL_PROCESS_CMD)
- AC_DEFINE_UNQUOTED([KILL_PROCESS_CMD], "$KILL_PROCESS_CMD", [Command to kill processes by name])
+ AC_DEFINE_UNQUOTED(KILL_PROCESS_CMD, "$KILL_PROCESS_CMD")
fi
dnl ****************************************************
dnl GNOME_PREFIX is is needed by shell/evolution-nognome
dnl ****************************************************
-dnl
-dnl FIXME this doesn't work with GNOME 2.
GNOME_PREFIX="`gnome-config --prefix`"
AC_SUBST(GNOME_PREFIX)
@@ -1005,7 +1031,7 @@ if test "$msg_ssl" = "no" -a "x${enable_openssl}" != "xno"; then
LDFLAGS="$LDFLAGS_save"
])
if test "x${openssl_libs}" != "xno"; then
- AC_DEFINE(HAVE_OPENSSL,1,[Define if you have OpenSSL])
+ AC_DEFINE(HAVE_OPENSSL)
AC_DEFINE(HAVE_SSL)
msg_ssl="yes (OpenSSL)"
OPENSSL_LDFLAGS="$with_openssl_libs -lssl -lcrypto $DL_LDFLAGS"
@@ -1029,175 +1055,117 @@ dnl *************************
dnl CFLAGS and LIBS and stuff
dnl *************************
-GNOME_COMPILE_WARNINGS(yes)
-CFLAGS="$CFLAGS $WARN_CFLAGS"
-
-AM_PATH_ORBIT2
-
-AC_MSG_CHECKING(for CORBA include paths)
-IDL_INCLUDES="-I "`pkg-config --variable=idldir libbonobo-2.0`" -I "`pkg-config --variable=idldir bonobo-activation-2.0`
-AC_MSG_RESULT($IDL_INCLUDES)
-AC_SUBST(IDL_INCLUDES)
-
-AM_PATH_GLIB_2_0
-
dnl Utility macro to set compiler flags for a specific lib.
AC_DEFUN(EVO_SET_COMPILE_FLAGS, [
deps="$2"
extra_cflags="$3"
extra_libs="$4"
- PKG_CHECK_MODULES(EVOLUTION, $deps)
- $1_CFLAGS="$EVOLUTION_CFLAGS \$(WERROR) $extra_cflags"
- $1_LIBS="$EVOLUTION_LIBS $extra_libs"
+ $1_CFLAGS="\$(WERROR) `gnome-config --cflags $deps` $extra_cflags"
+ $1_LIBS="`gnome-config --libs $deps` $extra_libs"
])
dnl --- Flags to get all the GNOME stuff
-dnl --- We require at least this version of GAL.
-GAL_VERSION=1.99.2
-AC_SUBST(GAL_VERSION)
+FULL_GNOME_DEPS="bonobo_conf bonobox_print gal gdk_pixbuf gnomecanvaspixbuf gnomeui libglade oaf vfs"
-FULL_GNOME_DEPS="libbonoboui-2.0 gnome-vfs-2.0 libgnomeui-2.0 libglade-2.0 libgnomecanvas-2.0 libxml-2.0 gconf-2.0 gal-2.0 >= $GAL_VERSION"
-
-EVO_SET_COMPILE_FLAGS(GNOME_FULL, $FULL_GNOME_DEPS)
+EVO_SET_COMPILE_FLAGS(GNOME_FULL, $FULL_GNOME_DEPS, ${GTKHTML_CFLAGS}, ${GTKHTML_LIBS})
AC_SUBST(GNOME_FULL_CFLAGS)
AC_SUBST(GNOME_FULL_LIBS)
dnl --- Flags for the various libraries we build
-EVO_SET_COMPILE_FLAGS(CAMEL, glib-2.0 gthread-2.0 gal-2.0 >= $GAL_VERSION $mozilla_nss,
- $THREADS_CFLAGS $KRB4_CFLAGS $KRB5_CFLAGS $MANUAL_NSS_CFLAGS $OPENSSL_CFLAGS,
- $THREADS_LIBS $KRB4_LDFLAGS $KRB5_LDFLAGS $MANUAL_NSS_LIBS $OPENSSL_LDFLAGS)
+EVO_SET_COMPILE_FLAGS(CAMEL, gal xml,
+ $THREADS_CFLAGS $KRB4_CFLAGS $KRB5_CFLAGS $NSS_CFLAGS $NSPR_CFLAGS $OPENSSL_CFLAGS,
+ $THREADS_LIBS $KRB4_LDFLAGS $KRB5_LDFLAGS $NSS_LDFLAGS $NSPR_LDFLAGS $OPENSSL_LDFLAGS)
AC_SUBST(CAMEL_CFLAGS)
AC_SUBST(CAMEL_LIBS)
-EVO_SET_COMPILE_FLAGS(E_NAME, libgnomeui-2.0 libbonoboui-2.0 gal-2.0 >= $GAL_VERSION)
+EVO_SET_COMPILE_FLAGS(E_NAME, bonobox gal oaf)
AC_SUBST(E_NAME_CFLAGS)
AC_SUBST(E_NAME_LIBS)
-EVO_SET_COMPILE_FLAGS(E_UTIL, gthread-2.0 gconf-2.0 libxml-2.0 libbonoboui-2.0 libglade-2.0 gal-2.0 >= $GAL_VERSION libgnomeui-2.0 libgnome-2.0 libgnomecanvas-2.0 soup-2.0 $mozilla_nspr, $THREADS_CFLAGS $MANUAL_NSPR_CFLAGS, $THREADS_LIBS $MANUAL_NSPR_LIBS)
+EVO_SET_COMPILE_FLAGS(E_UTIL, bonobox gal oaf libglade bonobo_conf soup,
+ $GCONF_CFLAGS $THREADS_CFLAGS $NSPR_CFLAGS,
+ $GCONF_LIBS $THREADS_LIBS $NSPR_LDFLAGS)
AC_SUBST(E_UTIL_CFLAGS)
AC_SUBST(E_UTIL_LIBS)
-dnl
-dnl EVO_SET_COMPILE_FLAGS(E_WIDGETS, bonobo_conf bonobox_print gdk_pixbuf gnomecanvaspixbuf gnomeui libglade oaf vfs)
-dnl AC_SUBST(E_WIDGETS_CFLAGS)
-dnl AC_SUBST(E_WIDGETS_LIBS)
-dnl
-EVO_SET_COMPILE_FLAGS(IMPORTERS, gconf-2.0 libglade-2.0 libbonoboui-2.0 libgnomeui-2.0)
+EVO_SET_COMPILE_FLAGS(E_WIDGETS, bonobo_conf bonobox_print gdk_pixbuf gnomecanvaspixbuf gnomeui libglade oaf vfs)
+AC_SUBST(E_WIDGETS_CFLAGS)
+AC_SUBST(E_WIDGETS_LIBS)
+
+EVO_SET_COMPILE_FLAGS(IMPORTERS, bonobo_conf bonobox_print gdk_pixbuf gnomecanvaspixbuf gnomeui libglade oaf vfs)
AC_SUBST(IMPORTERS_CFLAGS)
AC_SUBST(IMPORTERS_LIBS)
-EVO_SET_COMPILE_FLAGS(LIBFILTER, libgnome-2.0 libgnomeui-2.0 libglade-2.0 libxml-2.0 gconf-2.0 gal-2.0 >= $GAL_VERSION)
+dnl libibex is now deprecated
+dnl EVO_SET_COMPILE_FLAGS(LIBIBEX, bonobo_conf bonobox_print gal gdk_pixbuf gnomecanvaspixbuf gnomeui libglade oaf vfs,
+dnl $THREADS_CFLAGS, $THREADS_LIBS)
+dnl AC_SUBST(LIBIBEX_CFLAGS)
+dnl AC_SUBST(LIBIBEX_LIBS)
+
+EVO_SET_COMPILE_FLAGS(LIBFILTER, bonobo gal gdk_pixbuf gnomecanvaspixbuf gnomeui libglade)
AC_SUBST(LIBFILTER_CFLAGS)
AC_SUBST(LIBFILTER_LIBS)
dnl --- evolution (shell) flags
-EVO_SET_COMPILE_FLAGS(SHELL, libgnome-2.0 libgnomeui-2.0 libbonoboui-2.0 gal-2.0 >= $GAL_VERSION libglade-2.0 gnome-vfs-2.0 libgtkhtml-3.0)
+EVO_SET_COMPILE_FLAGS(SHELL, bonobo_conf bonobox_print gal gdk_pixbuf gnomecanvaspixbuf gnomeui libglade oaf vfs, ${GTKHTML_CFLAGS}, ${GTKHTML_LIBS})
AC_SUBST(SHELL_CFLAGS)
AC_SUBST(SHELL_LIBS)
dnl --- evolution-addressbook flags
-EVOLUTION_ADDRESSBOOK_DEPS="gconf-2.0 libbonoboui-2.0 libglade-2.0 gal-2.0 >= $GAL_VERSION libgnomeui-2.0 libgnome-2.0 libgnomecanvas-2.0 gnome-vfs-2.0 libgnomeprintui-2.2"
+EVOLUTION_ADDRESSBOOK_DEPS="bonobo_conf bonobox_print gal gdk_pixbuf gnomecanvaspixbuf gnomeui libglade oaf vfs"
-EVO_SET_COMPILE_FLAGS(EVOLUTION_ADDRESSBOOK, $EVOLUTION_ADDRESSBOOK_DEPS)
+EVO_SET_COMPILE_FLAGS(EVOLUTION_ADDRESSBOOK, $EVOLUTION_ADDRESSBOOK_DEPS, ${GTKHTML_CFLAGS}, ${GTKHTML_LIBS})
AC_SUBST(EVOLUTION_ADDRESSBOOK_CFLAGS)
AC_SUBST(EVOLUTION_ADDRESSBOOK_LIBS)
-if test x$enable_pilot_conduits = xyes; then
-EVO_SET_COMPILE_FLAGS(EVOLUTION_ADDRESSBOOK_CONDUIT, gnome-pilot-2.0 $EVOLUTION_ADDRESSBOOK_DEPS)
+EVO_SET_COMPILE_FLAGS(EVOLUTION_ADDRESSBOOK_CONDUIT, gpilot $EVOLUTION_ADDRESSBOOK_DEPS, $PISOCK_CFLAGS)
AC_SUBST(EVOLUTION_ADDRESSBOOK_CONDUIT_CFLAGS)
AC_SUBST(EVOLUTION_ADDRESSBOOK_CONDUIT_LIBS)
-fi
dnl -- evolution-executive-summary flags
-EVO_SET_COMPILE_FLAGS(EVOLUTION_EXECUTIVE_SUMMARY, libbonoboui-2.0 libbonoboui-2.0 gal-2.0 >= $GAL_VERSION libgnomeui-2.0 libglade-2.0 libgnomeprint-2.2 libgnomeprintui-2.2 soup-2.0 libgtkhtml-3.0)
+EVO_SET_COMPILE_FLAGS(EVOLUTION_EXECUTIVE_SUMMARY,
+ bonobo_conf bonobox bonobox_print gal gdk_pixbuf gnomecanvaspixbuf gnomeui libglade oaf soup vfs, ${GTKHTML_CFLAGS}, ${GTKHTML_LIBS})
AC_SUBST(EVOLUTION_EXECUTIVE_SUMMARY_CFLAGS)
AC_SUBST(EVOLUTION_EXECUTIVE_SUMMARY_LIBS)
dnl --- evolution-calendar flags
-EVO_SET_COMPILE_FLAGS(EVOLUTION_CALENDAR, libgnome-2.0 libgnomeui-2.0 libbonoboui-2.0 gal-2.0 >= $GAL_VERSION libglade-2.0 gnome-vfs-2.0 libgnomeprint-2.2 libgnomeprintui-2.2 libgtkhtml-3.0, ${GTKHTML_CFLAGS}, ${GTKHTML_LIBS})
+EVOLUTION_CALENDAR_DEPS="bonobo_conf bonobox bonobox_print gal gdk_pixbuf gnomecanvaspixbuf gnomeui libglade oaf vfs"
+
+EVO_SET_COMPILE_FLAGS(EVOLUTION_CALENDAR, $EVOLUTION_CALENDAR_DEPS, ${GTKHTML_CFLAGS}, ${GTKHTML_LIBS})
AC_SUBST(EVOLUTION_CALENDAR_CFLAGS)
AC_SUBST(EVOLUTION_CALENDAR_LIBS)
-if test x$enable_pilot_conduits = xyes; then
-EVO_SET_COMPILE_FLAGS(EVOLUTION_CALENDAR_CONDUIT, gnome-pilot-2.0 $EVOLUTION_CALENDAR_DEPS)
+EVO_SET_COMPILE_FLAGS(EVOLUTION_CALENDAR_CONDUIT, gpilot $EVOLUTION_CALENDAR_DEPS, $PISOCK_CFLAGS)
AC_SUBST(EVOLUTION_CALENDAR_CONDUIT_CFLAGS)
AC_SUBST(EVOLUTION_CALENDAR_CONDUIT_LIBS)
-fi
dnl --- evolution-mail flags
-EVO_SET_COMPILE_FLAGS(EVOLUTION_MAIL, libgnome-2.0 libgnomeui-2.0 libbonoboui-2.0 gal-2.0 >= $GAL_VERSION libglade-2.0 gnome-vfs-module-2.0 soup-2.0 libgnomeprint-2.2 libgnomeprintui-2.2 libgtkhtml-3.0 libxml-2.0 bonobo-activation-2.0 gthread-2.0 gconf-2.0 $mozilla_nss)
-AC_SUBST(EVOLUTION_MAIL_CFLAGS)
-AC_SUBST(EVOLUTION_MAIL_LIBS)
-
-dnl -- wombat flags
-
-EVO_SET_COMPILE_FLAGS(WOMBAT, gal-2.0 libgnome-2.0, $LDAP_CFLAGS, $LDAP_LIBS)
-AC_SUBST(WOMBAT_CFLAGS)
-AC_SUBST(WOMBAT_LIBS)
-
-dnl *******************
-dnl Special directories
-dnl *******************
-
-dnl --- If you add something here, consider whether or not you also
-dnl --- need to add it to one or more .pc.in files (for Connector,
-dnl --- etc)
-
-BASE_VERSION=`echo $VERSION | awk -F. '{print $1 "." $2;}'`
-AC_SUBST(BASE_VERSION)
-AC_DEFINE_UNQUOTED(BASE_VERSION, "$BASE_VERSION", [Base version (Major.Minor)])
+dnl ******************************
+dnl Versioned library files
+dnl ******************************
-privlibdir='${libdir}'/evolution/$BASE_VERSION
+privlibdir='$(pkglibdir)/'$EVOLUTION_MAJOR_VERSION.$EVOLUTION_MINOR_VERSION
AC_SUBST(privlibdir)
-privlibexecdir='${libexecdir}'/evolution/$BASE_VERSION
-AC_SUBST(privlibexecdir)
-
-privdatadir='${datadir}'/evolution/$BASE_VERSION
-AC_SUBST(privdatadir)
-
-privincludedir='${includedir}'/evolution-$BASE_VERSION
-AC_SUBST(privincludedir)
-
camel_providerdir="$privlibdir/camel-providers"
AC_SUBST(camel_providerdir)
-componentdir="$privlibdir/components"
-AC_SUBST(componentdir)
-
-idldir="$datadir/idl/evolution-$BASE_VERSION"
-AC_SUBST(idldir)
-
-serverdir="$libdir/bonobo/servers"
-AC_SUBST(serverdir)
-
-evolutionuidir="$privdatadir/ui"
-AC_SUBST(evolutionuidir)
-
-imagesdir="$privdatadir/images"
-AC_SUBST(imagesdir)
-
-buttonsdir="$privdatadir/images/buttons"
-AC_SUBST(buttonsdir)
-
-soundsdir="$privdatadir/sounds"
-AC_SUBST(soundsdir)
-
-gladedir="$privdatadir/glade"
-AC_SUBST(gladedir)
+EVO_SET_COMPILE_FLAGS(EVOLUTION_MAIL, $FULL_GNOME_DEPS soup, $GCONF_CFLAGS $THREADS_CFLAGS ${GTKHTML_CFLAGS}, $GCONF_LIBS $THREADS_LIBS ${GTKHTML_LIBS})
+AC_SUBST(EVOLUTION_MAIL_CFLAGS)
+AC_SUBST(EVOLUTION_MAIL_LIBS)
-etspecdir="$privdatadir/etspec"
-AC_SUBST(etspecdir)
+dnl -- wombat flags
-viewsdir="$privdatadir/views"
-AC_SUBST(viewsdir)
+EVO_SET_COMPILE_FLAGS(WOMBAT, $FULL_GNOME_DEPS, $LDAP_CFLAGS, $LDAP_LIBS)
+AC_SUBST(WOMBAT_CFLAGS)
+AC_SUBST(WOMBAT_LIBS)
##################################################
# Check for gtk-doc.
@@ -1243,17 +1211,11 @@ fi
AM_CONDITIONAL(ENABLE_GTK_DOC, test x$enable_gtk_doc = xyes)
-dnl ***********
-dnl GConf stuff
-dnl ***********
-AC_PATH_PROG(GCONFTOOL, gconftool-2, no)
-AM_GCONF_SOURCE_2
-
dnl ******************
dnl Sub-version number
dnl ******************
AC_ARG_WITH(sub-version, [ --with-sub-version=VERSION Specify a sub-version string])
-AC_DEFINE_UNQUOTED(SUB_VERSION, "$with_sub_version", [Version substring, for packagers])
+AC_DEFINE_UNQUOTED(SUB_VERSION, "$with_sub_version")
dnl ********************
dnl KDE applnk directory
@@ -1265,11 +1227,13 @@ if test x"$with_kde_applnk_path" != x"no"; then
with_kde_applnk_path="$prefix/share/applnk"
fi
if test -d "$with_kde_applnk_path" ; then
+ AC_DEFINE(HAVE_KDE_APPLNK)
KDE_APPLNK_DIR="$with_kde_applnk_path"
else
AC_PATH_PROG(KDECONFIG, kde-config)
if test -n "$KDECONFIG"; then
KDE_APPLNK_DIR=`$KDECONFIG --expandvars --install apps`
+ AC_DEFINE(HAVE_KDE_APPLNK)
else
KDE_APPLNK_DIR=""
fi
@@ -1281,20 +1245,36 @@ AM_CONDITIONAL(HAVE_KDE_APPLNK, test x"$KDE_APPLNK_DIR" != x)
AC_SUBST(KDE_APPLNK_DIR)
dnl ******************************
+dnl foo for *Conf.sh.in
+dnl ******************************
+
+EVOLUTION_LIBDIR="-L${libdir}"
+EVOLUTION_DATADIR="${datadir}"
+EVOLUTION_INCLUDEDIR="-I${includedir}/evolution"
+CAMEL_INCLUDEDIR="-I${includedir}"
+
+AC_SUBST(EVOLUTION_LIBDIR)
+AC_SUBST(EVOLUTION_DATADIR)
+AC_SUBST(EVOLUTION_INCLUDEDIR)
+AC_SUBST(CAMEL_INCLUDEDIR)
+
+dnl ******************************
dnl Makefiles
dnl ******************************
-export privlibdir
-export privincludedir
-export privdatadir
AC_CONFIG_SUBDIRS(libical)
EVOLUTION_DIR=`(cd $srcdir; pwd)`
AC_SUBST(EVOLUTION_DIR)
-AC_OUTPUT([ po/Makefile.in
+AC_OUTPUT([
Makefile
addressbook/Makefile
+addressbook/backend/Makefile
+addressbook/backend/ebook/Makefile
+addressbook/backend/idl/Makefile
+addressbook/backend/pas/Makefile
+addressbook/conduit/Makefile
addressbook/gui/Makefile
addressbook/gui/component/Makefile
addressbook/gui/component/select-names/Makefile
@@ -1303,13 +1283,20 @@ addressbook/gui/contact-list-editor/Makefile
addressbook/gui/merging/Makefile
addressbook/gui/search/Makefile
addressbook/gui/widgets/Makefile
-addressbook/backend/Makefile
-addressbook/backend/ebook/Makefile
-addressbook/backend/pas/Makefile
-addressbook/backend/idl/Makefile
-addressbook/conduit/Makefile
addressbook/printing/Makefile
art/Makefile
+calendar/Makefile
+calendar/cal-client/Makefile
+calendar/cal-util/Makefile
+calendar/conduits/Makefile
+calendar/conduits/calendar/Makefile
+calendar/conduits/todo/Makefile
+calendar/gui/Makefile
+calendar/gui/alarm-notify/Makefile
+calendar/gui/dialogs/Makefile
+calendar/idl/Makefile
+calendar/importers/Makefile
+calendar/pcs/Makefile
camel/Makefile
camel/providers/Makefile
camel/providers/imap/Makefile
@@ -1326,6 +1313,7 @@ camel/tests/mime-filter/Makefile
camel/tests/misc/Makefile
camel/tests/smime/Makefile
camel/tests/stream/Makefile
+composer/Makefile
data/Makefile
data/cde_app_root/Makefile
data/cde_app_root/dt/Makefile
@@ -1348,17 +1336,33 @@ default_user/local/Outbox/Makefile
default_user/local/Sent/Makefile
default_user/local/Tasks/Makefile
default_user/local/Trash/Makefile
+doc/Makefile
+doc/devel/Makefile
+doc/devel/calendar/Makefile
+doc/devel/calendar/cal-client/Makefile
+doc/devel/calendar/cal-util/Makefile
e-util/Makefile
e-util/ename/Makefile
filter/Makefile
help/Makefile
help/C/Makefile
+help/no/Makefile
+importers/Makefile
+intl/Makefile
libversit/Makefile
+libwombat/Makefile
+macros/Makefile
+mail/Makefile
+mail/importers/Makefile
+my-evolution/Makefile
+omf-install/Makefile
+po/Makefile.in
shell/Makefile
shell/evolution-nognome
shell/glade/Makefile
shell/importer/Makefile
-my-evolution/Makefile
+sounds/Makefile
+tools/Makefile
ui/Makefile
views/Makefile
views/addressbook/Makefile
@@ -1370,27 +1374,8 @@ widgets/e-timezone-dialog/Makefile
widgets/menus/Makefile
widgets/misc/Makefile
wombat/Makefile
-libwombat/Makefile
-calendar/Makefile
-calendar/importers/Makefile
-calendar/idl/Makefile
-calendar/cal-util/Makefile
-calendar/cal-client/Makefile
-calendar/conduits/Makefile
-calendar/conduits/todo/Makefile
-calendar/conduits/calendar/Makefile
-calendar/pcs/Makefile
-calendar/gui/Makefile
-calendar/gui/alarm-notify/Makefile
-calendar/gui/dialogs/Makefile
-composer/Makefile
-mail/Makefile
-mail/importers/Makefile
-tools/Makefile
-evolution-shell.pc
-evolution-addressbook.pc
-evolution-calendar.pc
-camel.pc
+
+my-evolution/GNOME_Evolution_Summary.oaf.in
])
if test "x$with_sub_version" != "x"; then
@@ -1415,16 +1400,26 @@ echo "\
IPv6 support: $msg_ipv6
Dot Locking: $msg_dot
File Locking: $msg_file
- Gtk-doc: $enable_gtk_doc"
+ Gtk-doc: $enable_gtk_doc
+ Shlib components: $enable_shlib_components"
if test x$enable_gtk_doc = xyes; then
echo "
- Programming documentation files will be built automatically.
-"
+ Programming documentation files will be built automatically."
else
echo "
Programming documentation files will not be built.
You may want to install the gtk-doc package
- so that you will get the Evolution Developer's Guide.
+ so that you will get the Evolution Developer's Guide."
+fi
+
+if test "x$enable_shlib_components" = "xyes" ; then
+ echo "
+ *** Warning, shlib components are currently broken.
+ *** Enabling this option will probably cause Evolution to not
+ *** work correctly.
+"
+else
+ echo "
"
fi
diff --git a/default_user/ChangeLog b/default_user/ChangeLog
index e9f2e585e6..308f92bdcd 100644
--- a/default_user/ChangeLog
+++ b/default_user/ChangeLog
@@ -2,34 +2,7 @@
* Makefile.am (install-data-hook): mkdir views and subdirs
-2003-03-10 Ettore Perazzoli <ettore@ximian.com>
-
- * local/Calendar/calendar.ics: New.
- * local/Calendar/tasks.ics: New.
-
-2003-02-06 Dan Winship <danw@ximian.com>
-
- * Makefile.am: Use privdatadir
- * local/Trash/Makefile.am: Likewise.
- * local/Tasks/Makefile.am: Likewise.
- * local/Sent/Makefile.am: Likewise.
- * local/Outbox/Makefile.am: Likewise.
- * local/Inbox/Makefile.am: Likewise.
- * local/Drafts/Makefile.am: Likewise.
- * local/Contacts/Makefile.am: Likewise.
- * local/Calendar/Makefile.am: Likewise.
-
-2003-01-22 Ettore Perazzoli <ettore@ximian.com>
-
- * Makefile.am: Version using $(BASE_VERSION).
- * local/Trash/Makefile.am: Likewise.
- * local/Tasks/Makefile.am: Likewise.
- * local/Sent/Makefile.am: Likewise.
- * local/Outbox/Makefile.am: Likewise.
- * local/Inbox/Makefile.am: Likewise.
- * local/Drafts/Makefile.am: Likewise.
- * local/Contacts/Makefile.am: Likewise.
- * local/Calendar/Makefile.am: Likewise.
+2003-01-20 Ettore Perazzoli <ettore@ximian.com>
* Makefile.am (instal-data-hook): Use $(DESTDIR); patch from Max
Horn <max@quendi.de>.
diff --git a/default_user/Makefile.am b/default_user/Makefile.am
index 55f58aa7c4..967c2033e9 100644
--- a/default_user/Makefile.am
+++ b/default_user/Makefile.am
@@ -1,6 +1,6 @@
SUBDIRS = local
-defaultdir = $(privdatadir)/default_user
+defaultdir = $(datadir)/evolution/default_user
default_DATA = addressbook-sources.xml searches.xml vfolders.xml
EXTRA_DIST = $(default_DATA)
diff --git a/doc/devel/calendar/cal-client/evolution-cal-client-decl.txt b/doc/devel/calendar/cal-client/evolution-cal-client-decl.txt
index 68bfef1c1a..81a7935805 100644
--- a/doc/devel/calendar/cal-client/evolution-cal-client-decl.txt
+++ b/doc/devel/calendar/cal-client/evolution-cal-client-decl.txt
@@ -172,11 +172,41 @@ CalClient *client
CalClient *client
</FUNCTION>
<FUNCTION>
-<NAME>cal_client_get_email_address</NAME>
+<NAME>cal_client_get_cal_address</NAME>
<RETURNS>const char *</RETURNS>
CalClient *client
</FUNCTION>
<FUNCTION>
+<NAME>cal_client_get_alarm_email_address</NAME>
+<RETURNS>const char *</RETURNS>
+CalClient *client
+</FUNCTION>
+<FUNCTION>
+<NAME>cal_client_get_ldap_attribute</NAME>
+<RETURNS>const char *</RETURNS>
+CalClient *client
+</FUNCTION>
+<FUNCTION>
+<NAME>cal_client_get_one_alarm_only</NAME>
+<RETURNS>gboolean </RETURNS>
+CalClient *client
+</FUNCTION>
+<FUNCTION>
+<NAME>cal_client_get_organizer_must_attend</NAME>
+<RETURNS>gboolean </RETURNS>
+CalClient *client
+</FUNCTION>
+<FUNCTION>
+<NAME>cal_client_get_save_schedules</NAME>
+<RETURNS>gboolean </RETURNS>
+CalClient *client
+</FUNCTION>
+<FUNCTION>
+<NAME>cal_client_get_static_capability</NAME>
+<RETURNS>gboolean </RETURNS>
+CalClient *client, const char *cap
+</FUNCTION>
+<FUNCTION>
<NAME>cal_client_set_mode</NAME>
<RETURNS>gboolean </RETURNS>
CalClient *client, CalMode mode
@@ -187,6 +217,11 @@ CalClient *client, CalMode mode
CalClient *client, CalObjType type
</FUNCTION>
<FUNCTION>
+<NAME>cal_client_get_default_object</NAME>
+<RETURNS>CalClientGetStatus </RETURNS>
+CalClient *client,CalObjType type,CalComponent **comp
+</FUNCTION>
+<FUNCTION>
<NAME>cal_client_get_object</NAME>
<RETURNS>CalClientGetStatus </RETURNS>
CalClient *client,const char *uid,CalComponent **comp
@@ -242,6 +277,11 @@ CalClient *client, const char *uid,time_t start, time_t end,CalComponentAlarms *
CalClient *client, CalComponent *comp
</FUNCTION>
<FUNCTION>
+<NAME>cal_client_update_object_with_mod</NAME>
+<RETURNS>CalClientResult </RETURNS>
+CalClient *client, CalComponent *comp, CalObjModType mod
+</FUNCTION>
+<FUNCTION>
<NAME>cal_client_update_objects</NAME>
<RETURNS>CalClientResult </RETURNS>
CalClient *client, icalcomponent *icalcomp
@@ -252,6 +292,11 @@ CalClient *client, icalcomponent *icalcomp
CalClient *client, const char *uid
</FUNCTION>
<FUNCTION>
+<NAME>cal_client_remove_object_with_mod</NAME>
+<RETURNS>CalClientResult </RETURNS>
+CalClient *client, const char *uid, CalObjModType mod
+</FUNCTION>
+<FUNCTION>
<NAME>cal_client_send_object</NAME>
<RETURNS>CalClientSendResult </RETURNS>
CalClient *client, icalcomponent *icalcomp,icalcomponent **new_icalcomp, GList **users,char error_msg[256]
diff --git a/doc/devel/calendar/cal-util/evolution-cal-util-decl.txt b/doc/devel/calendar/cal-util/evolution-cal-util-decl.txt
index af91e3f9cb..3e50cb0ee0 100644
--- a/doc/devel/calendar/cal-util/evolution-cal-util-decl.txt
+++ b/doc/devel/calendar/cal-util/evolution-cal-util-decl.txt
@@ -525,6 +525,11 @@ CalComponent *comp
CalComponent *comp
</FUNCTION>
<FUNCTION>
+<NAME>cal_component_is_instance</NAME>
+<RETURNS>gboolean </RETURNS>
+CalComponent *comp
+</FUNCTION>
+<FUNCTION>
<NAME>cal_component_get_sequence</NAME>
<RETURNS>void </RETURNS>
CalComponent *comp, int **sequence
@@ -615,6 +620,11 @@ GSList *categ_list
CalComponentDateTime *dt
</FUNCTION>
<FUNCTION>
+<NAME>cal_component_free_range</NAME>
+<RETURNS>void </RETURNS>
+CalComponentRange *range
+</FUNCTION>
+<FUNCTION>
<NAME>cal_component_free_exdate_list</NAME>
<RETURNS>void </RETURNS>
GSList *exdate_list
@@ -838,6 +848,21 @@ CalComponentAlarm *alarm, CalAlarmTrigger *trigger
CalComponentAlarm *alarm, CalAlarmTrigger trigger
</FUNCTION>
<FUNCTION>
+<NAME>cal_component_alarm_get_attendee_list</NAME>
+<RETURNS>void </RETURNS>
+CalComponentAlarm *alarm, GSList **attendee_list
+</FUNCTION>
+<FUNCTION>
+<NAME>cal_component_alarm_set_attendee_list</NAME>
+<RETURNS>void </RETURNS>
+CalComponentAlarm *alarm, GSList *attendee_list
+</FUNCTION>
+<FUNCTION>
+<NAME>cal_component_alarm_has_attendees</NAME>
+<RETURNS>gboolean </RETURNS>
+CalComponentAlarm *alarm
+</FUNCTION>
+<FUNCTION>
<NAME>cal_component_alarm_get_icalcomponent</NAME>
<RETURNS>icalcomponent *</RETURNS>
CalComponentAlarm *alarm
@@ -884,6 +909,15 @@ typedef enum {
} CalObjType;
</ENUM>
<ENUM>
+<NAME>CalObjModType</NAME>
+typedef enum {
+ CALOBJ_MOD_THIS = 1 << 0,
+ CALOBJ_MOD_THISANDPRIOR = 1 << 1,
+ CALOBJ_MOD_THISANDFUTURE = 1 << 2,
+ CALOBJ_MOD_ALL = 0x07
+} CalObjModType;
+</ENUM>
+<ENUM>
<NAME>CalMode</NAME>
typedef enum {
CAL_MODE_INVALID = -1,
@@ -905,12 +939,12 @@ void
<FUNCTION>
<NAME>cal_util_generate_alarms_for_comp</NAME>
<RETURNS>CalComponentAlarms *</RETURNS>
-CalComponent *comp,time_t start,time_t end,CalRecurResolveTimezoneFn resolve_tzid,gpointer user_data,icaltimezone *default_timezone
+CalComponent *comp,time_t start,time_t end,CalAlarmAction *omit,CalRecurResolveTimezoneFn resolve_tzid,gpointer user_data,icaltimezone *default_timezone
</FUNCTION>
<FUNCTION>
<NAME>cal_util_generate_alarms_for_list</NAME>
<RETURNS>int </RETURNS>
-GList *comps,time_t start,time_t end,GSList **comp_alarms,CalRecurResolveTimezoneFn resolve_tzid,gpointer user_data,icaltimezone *default_timezone
+GList *comps,time_t start,time_t end,CalAlarmAction *omit,GSList **comp_alarms,CalRecurResolveTimezoneFn resolve_tzid,gpointer user_data,icaltimezone *default_timezone
</FUNCTION>
<FUNCTION>
<NAME>cal_util_resolve_tzid</NAME>
diff --git a/doc/devel/executive-summary/evolution-services.hierarchy b/doc/devel/executive-summary/evolution-services.hierarchy
deleted file mode 100644
index 37559d819d..0000000000
--- a/doc/devel/executive-summary/evolution-services.hierarchy
+++ /dev/null
@@ -1,7 +0,0 @@
-GtkObject
- BonoboObject
- ExecutiveSummaryComponent
- ExecutiveSummaryComponentFactory
- Handle to remote Bonobo::Unknown
- ExecutiveSummaryComponentFactoryClient
- ExecutiveSummaryHtmlView
diff --git a/doc/devel/importer/evolution-shell-importer.hierarchy b/doc/devel/importer/evolution-shell-importer.hierarchy
deleted file mode 100644
index c46ebdf782..0000000000
--- a/doc/devel/importer/evolution-shell-importer.hierarchy
+++ /dev/null
@@ -1,7 +0,0 @@
-GtkObject
- BonoboObject
- BonoboXObject
- EvolutionImporter
- EvolutionImporterListener
- Handle to remote Bonobo::Unknown
- EvolutionImporterClient
diff --git a/e-util/ChangeLog b/e-util/ChangeLog
index 4b024cedec..30eff14bf4 100644
--- a/e-util/ChangeLog
+++ b/e-util/ChangeLog
@@ -1,335 +1,55 @@
-2003-03-31 Chris Toshok <toshok@ximian.com>
+2003-03-05 Rodney Dawes <dobey@ximian.com>
- * ename/test-ename-western.c (do_name): print "" if the value is
- NULL.
- (main): add a couple of utf8 test cases (that still use western
- orderings).
-
- * ename/e-name-western.c (e_name_western_str_count_words):
- utf8-ize this.
- (e_name_western_cleanup_string): same.
- (e_name_western_get_words_at_idx): same.
- (e_name_western_get_one_prefix_at_str): same.
- (e_name_western_get_prefix_at_str): same.
- (e_name_western_extract_first): same.
- (e_name_western_extract_middle): same.
- (e_name_western_extract_nickname): same.
- (e_name_western_extract_last): same.
- (e_name_western_get_preceding_word): same.
- (e_name_western_get_suffix_at_str_end): same.
- (e_name_western_detect_backwards): same.
- (e_name_western_reorder_asshole): same.
- (FINISH_CHECK_MIDDLE_NAME_FOR_CONJUNCTION): same.
- (e_name_western_fixup): same.
- (e_name_western_parse): validate the string and truncate it if
- need be.
-
-2003-03-27 JP Rosevear <jpr@ximian.com>
-
- * e-account-list.c (e_account_list_find): guard against NULL keys
-
-2003-03-25 Dan Winship <danw@ximian.com>
-
- * e-dialog-utils.c (e_notice): Move this here from gal. Use
- e_dialog_set_transient_for so it DTRT for out-of-proc components.
- (e_notice_with_xid): Like e_notice but with an X Window ID as the
- parent window
- (e_gnome_dialog_set_parent): Remove this, since it was marked
- deprecated and only used in one place.
- (e_file_dialog_save): Make this use GtkMessageDialog instead of
- GnomeDialog
- (e_dialog_set_transient_for_xid): #ifdef out gtk 2.2 api usage
-
-2003-03-25 Not Zed <NotZed@Ximian.com>
-
- * e-meta.c (meta_filename): fix a typo & some missing headers.
-
-2003-03-24 Dan Winship <danw@ximian.com>
-
- * e-dialog-utils.c (e_dialog_set_transient_for,
- e_dialog_set_transient_for_xid): Rename, rewrite, make them
- actually work.
-
-2003-03-25 Not Zed <NotZed@Ximian.com>
-
- * Makefile.am: Added e-meta.[ch] to libeutil
-
- * e-meta.[ch]: simple api to implement meta-data for keyed
- objects.
-
-2003-03-20 Jeffrey Stedfast <fejj@ximian.com>
-
- * e-trie.c (e_trie_search): If the gunichar is 0xfffe, just skip
- processing it. Maybe this will fix bug #39900.
- (trie_utf8_getc): Removed unused labels to shutup the compiler.
-
-2003-03-19 Jeffrey Stedfast <fejj@ximian.com>
-
- * e-sexp.h: Fix ESExpClass to never be an empty struct. Also make
- ESExp optionally a subclass of GObject rather than GtkObject (not
- that we'll probably ever make it so, but for completeness sake?).
-
-2003-03-18 Jeffrey Stedfast <fejj@ximian.com>
-
- * e-trie.c (trie_utf8_getc): Don't use __inline__ as it is not
- always defined.
-
-2003-03-13 Dan Winship <danw@ximian.com>
-
- * ename/e-address-western.c (e_address_western_parse): When
- declaring a line to be part of "extended" because we don't know
- what else to call it, keep the preceding "\n" so that the address
- still looks the same when we reassemble the pieces later. Fixes
- handling of non-US addresses
-
-2003-03-12 Dan Winship <danw@ximian.com>
-
- * e-xml-hash-utils.c (e_xml_to_hash): Update for a libxml2 change
- that was making this code g_warn a lot
-
-2003-03-06 Ettore Perazzoli <ettore@ximian.com>
-
- * e-request.c (e_request_string): Make the entry activate the
- default response in the dialog.
-
-2003-03-03 Rodney Dawes <dobey@ximian.com>
-
- * e-proxy.c: Use gnome2 proxy settings
+ * e-proxy.c: Don't append trailing slash to paths for dir_exists calls
-2003-03-02 Rodney Dawes <dobey@ximian.com>
+2003-02-14 Rodney Dawes <dobey@ximian.com>
- * e-pilot-util.c: s/gnome-xml/libxml/
+ * e-proxy.c: Fixed a typo dir_exits should be dir_exists
-2003-02-27 JP Rosevear <jpr@ximian.com>
-
- * Makefile.am: include gnome-pilot cflags
-
-2003-02-23 Jeffrey Stedfast <fejj@ximian.com>
-
- * e-account-list.c (gconf_accounts_changed): 'uid' should not be
- const.
-
-2003-02-20 Not Zed <NotZed@Ximian.com>
-
- * e-account-list.c (e_account_list_get_default): helper to get the
- dfault account.
- (e_account_list_set_default): helper to set the default account.
- (e_account_list_find): Helper to find accounts based on differnet
- key types.
- (e_account_list_add): helper to add account + emit added event.
- (e_account_list_change): helper to emit changed event.
- (e_account_list_remove): herlper to remove account + emit changed event.
-
-2003-02-22 Hans Petter Jansson <hpj@ximian.com>
-
- * e-categories-config.c (e_categories_config_open_dialog_for_entry):
- A result of 0 no longer indicates success; GTK_RESPONSE_OK does.
-
-2003-02-17 Chris Toshok <toshok@ximian.com>
-
- * e-account-list.c (gconf_accounts_changed): fix memleak - free
- uid.
-
-2003-02-11 Not Zed <NotZed@Ximian.com>
-
- * e-trie.c (trie_utf8_getc): Instead of simply ignoring bad chars,
- return the sentinal invalid char 0xfffe, so that we properly track
- the start of sequences.
-
-2003-02-10 Ettore Perazzoli <ettore@ximian.com>
-
- * Makefile.am (libeutil_static_la_DEPENDENCIES): Make
- libeutil-static.la depend on libeutil.la so that parallel
- compilations work; building them at the same time confuses
- libtool.
- (e-util-marshal.h, e-util-marshal.c): Use different tmp files so
- these rules can happen in parallel.
-
-2003-02-05 Dan Winship <danw@ximian.com>
-
- * Makefile.am (eutilincludedir, etc): define in terms of
- privincludedir.
-
- * ename/Makefile.am (libenameincludedir): Likewise
-
- * e-account.c: Fix warnings
- * e-account-list.c: Likewise
- * e-config-listener.c: Likewise
- * e-gui-utils.c: Likewise.
- * e-lang-utils.c: Likewise
- * e-msgport.c: Likewise
- * e-passwords.c: Likewise
-
- * e-categories-config.c
- (e_categories_config_open_dialog_for_entry): Use g_object_get/_set
- rather than gtk_
-
- * e-url.c (e_uri_new): Use g_ascii_strdown instead of deprecated
- g_strdown.
-
-2003-01-27 Ettore Perazzoli <ettore@ximian.com>
-
- * e-request.c (e_request_string): Port to GtkDialog. Strdup the
- text returned by GtkEntry after destroying the dialog, not before.
- Use gtk_editable_select_region() instead of
- gtk_entry_select_region(). Add a little bit of padding to make it
- look less crampy and set a default width.
-
- * e-dialog-utils.h (e_gnome_dialog_set_parent): Declare only if
- GNOME_DISABLE_DEPRECATED is not #defined.
- (e_gnome_warning_dialog_parented): Likewise.
- (e_gnome_ok_cancel_dialog_parented): Likewise.
-
-2003-01-26 Chris Toshok <toshok@ximian.com>
-
- * e-pilot-settings.c (e_pilot_settings_new): ref/sink the pilot
- settings to clear up that gtk warning.
-
-2003-01-25 Chris Toshok <toshok@ximian.com>
-
- * e-pilot-map.c (e_pilot_map_read): g_file_exists -> g_file_test.
- (e_pilot_map_write): don't use doc->root.
-
-2003-01-25 Chris Toshok <toshok@ximian.com>
-
- * e-pilot-settings.[ch]: GObjectify this.
-
-2003-01-24 Hans Petter Jansson <hpj@ximian.com>
-
- * e-categories-config.c (initialize_categories_config): Enable
- getting the categories master list from wombat.
- (e_categories_config_open_dialog_for_entry): It's now a GtkDialog.
-
-2003-01-22 Ettore Perazzoli <ettore@ximian.com>
-
- * Makefile.am (eutilincludedir): Version using $(BASE_VERSION).
- (econdincludedir): Likewise.
- (edb3includedir): Likewise.
- (imagesdir): Likewise.
-
- * ename/Makefile.am: Install libename in $(privlibdir) and
- $(includedir)/evolution-$(BASE_VERSION)/ename.
-
-2003-01-17 Jeffrey Stedfast <fejj@ximian.com>
-
- * e-account-list.c: Changed signal names to use - instead of _
- like the rest of Gtk2.
-
- * e-account.c (e_account_import): New function that is basically
- the old account_copy().
-
-2003-01-17 Dan Winship <danw@ximian.com>
-
- * e-xml-hash-utils.c: New, sort of from evolution-recurid-branch.
-
-2003-01-16 Dan Winship <danw@ximian.com>
-
- * e-account.c: New class, based on MailConfigAccount, for
- describing an evolution (mail) account.
-
- * e-account-list.c: New class for tracking the list of configured
- accounts. (Also uses some code from mail-config.)
-
- * e-list.c (e_list_construct, e_list_remove): New
-
-2003-01-14 Ettore Perazzoli <ettore@ximian.com>
-
- * e-dialog-utils.c: Do not #include <e-bonobo-widget.h>.
- (e_set_dialog_parent): Remove the BonoboWidget handling stuff (it
- doesn't really work anyways).
-
-2003-01-14 Ettore Perazzoli <ettore@ximian.com>
+2003-02-11 Rodney Dawes <dobey@ximian.com>
- * Makefile.am (eutilinclude_HEADERS): Add e-dialog-utils.h.
-
-2003-01-09 Chris Toshok <toshok@ximian.com>
-
- * e-gui-utils.c (e_create_image_widget): change this to use
- GtkImage instead of GnomeCanvas.
-
-2003-01-08 Ettore Perazzoli <ettore@ximian.com>
-
- * Makefile.am: Images are now in $(datadir)/evolution/images
- instead of $(datadir)/images/evolution.
-
-2003-01-07 Dan Winship <danw@ximian.com>
-
- * e-config-listener.c (e_config_listener_remove_value): New.
+ * e-proxy.c (set_proxy): Priority use of gnome2 proxy settings if
+ they are set, as we are most likely running under gnome2.
+
+2003-02-05 JP Rosevear <jpr@ximian.com>
- * e-passwords.c (e_passwords_get_password): Don't look at the
- passwords hash until calling e_passwords_init().
+ * e-xml-hash-utils.[hc]: back port from main line
-2003-01-06 Dan Winship <danw@ximian.com>
+ * Makefile.am: build back ported files
- * e-html-utils.c: Add this back: Connector needs it, and there's
- no reason for addressbook and calendar to be using camel to get
- this functionality.
+2003-02-04 Ettore Perazzoli <ettore@ximian.com>
- * Makefile.am (libeutil_la_SOURCES): re-add e-html-utils
+ * Makefile.am: Build e-pilot-settings into libeconduit if !
+ ENABLE_PILOT_CONDUITS, so we avoid doing a non-portable "ar cru"
+ without any object files [fails on OS X, reported by Max Horn
+ <max@quendi.de>].
-2003-01-02 Jeffrey Stedfast <fejj@ximian.com>
+2003-01-24 Kjartan Maraas <kmaraas@gnome.org>
- A bunch of fixes to make e-util build with -DG_DISABLE_DEPRECATED
- and -DGTK_DISABLE_DEPRECATED.
+ * e-categories-config.c: Fix #include <config.h>
+ * e-component-listener.c: Same
+ * e-config-listener.c: Here too.
+ * e-dialog-utils.c: And here.
+ * e-html-utils.c: And here.
+ * e-pilot-settings.h: And remove it here.
-2003-01-02 Ettore Perazzoli <ettore@ximian.com>
+2003-01-10 JP Rosevear <jpr@ximian.com>
- * e-gtk-utils.c (e_signal_connect_full_while_alive): Get to
- compile.
- (e_signal_connect_while_alive): Like.
+ * e-xml-utils.[hc]: various xml utility routines
-2002-12-19 Ettore Perazzoli <ettore@ximian.com>
+ * e-xmlhash.[hc]: new files to manage an xml hash on disk
- * e-gtk-utils.c (e_signal_connect_while_alive): New.
- (e_signal_connect_full_while_alive): Renamed from
- e_gtk_signal_connect_full_while_alive().
+ * Makefile.am: Build new files
-2002-12-16 Jeffrey Stedfast <fejj@ximian.com>
+2002-12-10 JP Rosevear <jpr@ximian.com>
- * e-html-utils.[c,h]: Removed. Back to the fiery depths of hell
- from whence ye came!
+ * e-config-listener.c (e_config_listener_remove_dir): Fix warning
2002-12-10 Rodrigo Moya <rodrigo@ximian.com>
- * e-config-listener.[ch] (e_config_listener_remove_dir): new
- function.
-
-2002-12-09 Jeffrey Stedfast <fejj@ximian.com>
-
- * e-trie.c: New implementation of an Aho-Corasick trie.
-
-2002-12-09 Chris Toshok <toshok@ximian.com>
-
- * e-passwords.h: track changes to api (e_passwords_init is gone,
- and several functions take the component name as an arg.)
-
- * e-passwords.c (e_passwords_init): make this static, and allow
- multiple calls. Also, it no longer takes the component name.
- (e_passwords_shutdown): make this deal with the case where
- e_passwords_init wasn't called (no hashtable), and it no longer
- needs to free component_name.
- (e_passwords_forget_passwords): call e_passwords_init.
- (e_passwords_clear_component_passwords): take component_name as an
- arg, and call e_passwords_init.
- (password_path): take component_name as an arg.
- (e_passwords_remember_password): same, and call e_passwords_init.
- (e_passwords_forget_password): same.
- (e_passwords_get_password): same.
- (e_passwords_add_password): call e_passwords_init.
- (e_passwords_ask_password): take component_name as an arg.
-
-2002-12-07 Not Zed <NotZed@Ximian.com>
-
- * e-msgport.c (e_mutex_cond_wait): Allow an e-mutex to be used
- with standard condition variables.
-
-2002-12-06 Chris Toshok <toshok@ximian.com>
-
- * e-categories-master-list-wombat.c (ecmlw_load): change to a more
- gconf-like path (with underscores, etc.)
- (ecmlw_save): same.
-
-2002-11-26 Dan Winship <danw@ximian.com>
+ * e-config-listener.[ch] (e_config_listener_remove_dir): new function.
+
+2002-11-25 Dan Winship <danw@ximian.com>
* e-lang-utils.c (e_get_language_list): If the language is
something like "fr_FR", return both "fr_FR" and "fr" in the list.
@@ -347,142 +67,6 @@
(e_msgport_get): skim off a notify byte on the pr pipe if set.
(): Include config.h, and nspr stuff if HAVE_NSS is set.
-2002-11-13 Ettore Perazzoli <ettore@ximian.com>
-
- * e-config-listener.c (e_config_listener_get_string_with_default):
- Make sure we don't use a string value from a GConfValue that got
- freed.
-
-2002-11-12 Chris Toshok <toshok@ximian.com>
-
- * Makefile.am
- (eutilinclude_HEADERS): add e-password.h
- (libeutil_la_SOURCES): add e-password.c
-
- * e-passwords.[ch]: port this to gnome2's gnome-config-private.
-
-2002-11-11 Ettore Perazzoli <ettore@ximian.com>
-
- * e-config-listener.c (add_key): g_strdup() the value in the case
- of a string value.
-
-2002-11-11 Jeffrey Stedfast <fejj@ximian.com>
-
- * Makefile.am: Re-add e-proxy.c to the build.
-
-2002-11-08 Chris Toshok <toshok@ximian.com>
-
- * Makefile.am (eutilinclude_HEADERS): add e-categories-config.h
- and e-categories-master-list-wombat.h
- (libeutil_la_SOURCES): add e-categories-master-list-wombat.c
-
- * e-categories-master-list-wombat.[ch]: port work.
-
-2002-11-07 JP Rosevear <jpr@ximian.com>
-
- * e-categories-config.c (e_categories_config_get_icon_for): pass
- extra pixbuf param
-
- * e-categories-config.h: use G_*_DECLS
-
- * e-dialog-utils.c (save_ok): update g_file_test params
-
- * Makefile.am: Compile some additional files
-
-2002-11-06 Chris Toshok <toshok@ximian.com>
-
- * e-config-listener.c (e_config_listener_set_boolean): init err to
- NULL so if there isn't an error we aren't left with an unitialized
- GError. Fixes crash.
- (e_config_listener_set_float): same.
- (e_config_listener_set_long): same.
- (e_config_listener_set_string): same.
-
-2002-11-05 Rodrigo Moya <rodrigo@ximian.com>
-
- * e-component-listener.[ch]: ported to GObject.
-
- * Makefile.am: re-enabled e-component-listener.[ch]
-
-2002-11-03 Rodrigo Moya <rodrigo@ximian.com>
-
- * e-config-listener.[ch] (e_config_listener_get_boolean,
- e_config_listener_get_float, e_config_listener_get_long,
- e_config_listener_get_string): new simpler functions, without
- a default value.
-
-2002-11-03 Ettore Perazzoli <ettore@ximian.com>
-
- * e-config-listener.c (e_config_listener_get_float_with_default):
- Removed unused variable.
- (e_config_listener_get_long_with_default): Likewise.
- (e_config_listener_get_string_with_default): Likewise.
-
- * Makefile.am: Compile e-config-listener.[ch].
-
-2002-11-02 Chris Toshok <toshok@ximian.com>
-
- * Makefile.am: add marshal building stuff, add e-util-marshal.c to
- SOURCES, and add e-util-marshal.list to EXTRA_DIST.
-
- * e-util-marshal.list: add marshallers for e-util.
-
- * e-list.c: convert to GObject.
-
- * e-list.h: convert to GObject.
-
- * e-iterator.c: convert to GObject.
-
- * e-iterator.h: convert to GObject.
-
- * e-list-iterator.c: convert to GObject.
-
- * e-list-iterator.h: convert to GObject.
-
- * .cvsignore: ignore e-util-marshal.[ch]
-
-2002-11-02 Ettore Perazzoli <ettore@ximian.com>
-
- * ename/Makefile.am (INCLUDES): Removed -I$(includedir).
-
- * ename/test-ename-western-gtk.c: #include
- <libgnomeui/gnome-ui-init.h> instead of <libgnomeui/gnome-init.h>.
- (create_window): Added GTK_SIGNAL_FUNC() cast.
- (main): Use gnome_program_init().
-
- * e-db3-utils.c: Do not #include <libgnome/gnome-defs.h>.
-
- * e-request.c: Do not #include <libgnomeui/gnome-stock.h>.
-
- * e-memory.c (e_memchunk_clean): Replace GSearchFunc with
- GCompareFunc.
-
- * e-iterator.c (e_iterator_class_init): GTK2-ified.
- (ECI_CLASS): Likewise.
-
- * e-html-utils.c: Do not #include <gal/unicode/gunicode.h>.
-
- * e-gui-utils.c: Don't #include <libgnome/gnome-defs.h>.
- (e_create_image_widget): Pass NULL to gdk_pixbuf_new_from_file()
- for the error arg.
-
- * e-corba-utils.h: #include <orbit/orbit.h> instead of
- <orb/orbit.h>.
-
- * Makefile.am: Removed bonobo-factory-util.c,
- bonobo-factory-util.h, e-categories-master-list-wombat.h,
- e-categories-master-list-wombat.c, e-dialog-utils.c,
- e-dialog-utils.h, e-proxy.c e-proxy.h for now.
-
-2002-11-02 Rodrigo Moya <rodrigo@ximian.com>
-
- * e-config-listener.[ch]: ported to GConf and GObject.
-
-2002-11-01 Rodrigo Moya <rodrigo@ximian.com>
-
- * e-config-listener.[ch]:
- * e-component-listener.[ch]: compilation fixes for GNOME 2 porting.
-
2002-10-24 Rodrigo Moya <rodrigo@ximian.com>
Fixes #32764
diff --git a/e-util/Makefile.am b/e-util/Makefile.am
index 74bf6978d7..ed912cab03 100644
--- a/e-util/Makefile.am
+++ b/e-util/Makefile.am
@@ -1,28 +1,27 @@
SUBDIRS = . ename
-eutilincludedir = $(privincludedir)/e-util
-econdincludedir = $(privincludedir)/e-conduit
-edb3includedir = $(privincludedir)/e-db3util
+imagesdir = $(datadir)/images/evolution
+
+eutilincludedir = $(includedir)/evolution/e-util
+econdincludedir = $(includedir)/evolution/e-conduit
+edb3includedir = $(includedir)/evolution/e-db3util
INCLUDES = \
-I$(top_srcdir) \
-DEVOLUTION_IMAGES=\""$(imagesdir)"\" \
-DEVOLUTION_CATEGORY_ICONS=\""$(imagesdir)/categories"\" \
-DG_LOG_DOMAIN=\"e-utils\" \
- -DG_DISABLE_DEPRECATED \
- -DGTK_DISABLE_DEPRECATED \
$(DB3_CFLAGS) \
- $(GNOME_PILOT_CFLAGS) \
+ $(PISOCK_CFLAGS) \
$(E_UTIL_CFLAGS)
privlib_LTLIBRARIES = libeutil.la libedb3util.la libeconduit.la
noinst_LTLIBRARIES = libeutil-static.la libeconduit-static.la
eutilinclude_HEADERS = \
- e-account-list.h \
- e-account.h \
- e-categories-config.h \
+ e-bonobo-factory-util.h \
e-categories-master-list-wombat.h \
+ e-categories-config.h \
e-component-listener.h \
e-config-listener.h \
e-corba-utils.h \
@@ -37,7 +36,6 @@ eutilinclude_HEADERS = \
e-list-iterator.h \
e-list.h \
e-memory.h \
- e-meta.h \
e-mktemp.h \
e-msgport.h \
e-passwords.h \
@@ -46,17 +44,15 @@ eutilinclude_HEADERS = \
e-request.h \
e-sexp.h \
e-time-utils.h \
- e-trie.h \
e-url.h \
e-xml-hash-utils.h \
md5-utils.h
libeutil_la_SOURCES = \
$(eutilinclude_HEADERS) \
- e-account-list.c \
- e-account.c \
- e-categories-config.c \
+ e-bonobo-factory-util.c \
e-categories-master-list-wombat.c \
+ e-categories-config.c \
e-component-listener.c \
e-config-listener.c \
e-corba-utils.c \
@@ -71,7 +67,6 @@ libeutil_la_SOURCES = \
e-list-iterator.c \
e-list.c \
e-memory.c \
- e-meta.c \
e-mktemp.c \
e-msgport.c \
e-passwords.c \
@@ -80,39 +75,15 @@ libeutil_la_SOURCES = \
e-request.c \
e-sexp.c \
e-time-utils.c \
- e-trie.c \
e-url.c \
- e-util-marshal.c \
e-xml-hash-utils.c \
md5-utils.c
-# GLib marshalling cruft
-
-e-util-marshal.h: e-util-marshal.list
- ( @GLIB_GENMARSHAL@ --prefix=e_util_marshal e-util-marshal.list --header > e-util-marshal.h.tmp \
- && mv e-util-marshal.h.tmp e-util-marshal.h ) \
- || ( rm -f e-util-marshal.h.tmp && exit 1 )
-
-e-util-marshal.c: e-util-marshal.h
- ( @GLIB_GENMARSHAL@ --prefix=e_util_marshal e-util-marshal.list --body > e-util-marshal.c.tmp \
- && mv e-util-marshal.c.tmp e-util-marshal.c ) \
- || ( rm -f e-util-marshal.c.tmp && exit 1 )
-
-MARSHAL_GENERATED = e-util-marshal.c e-util-marshal.h
-
-
-# FIXME TODO
-# e-passwords.c
-# bonobo-factory-util.[ch]
-
libeutil_la_LIBADD = $(E_UTIL_LIBS)
libeutil_static_la_SOURCES = $(libeutil_la_SOURCES)
libeutil_static_la_LIBADD = $(libeutil_la_LIBADD)
libeutil_static_la_LDFLAGS = -all-static
-# Make sure libeutil.la and libeutil-static.la are not built in
-# parallel when using a parallel make; libtool can't handle that.
-libeutil_static_la_DEPENDENCIES = libeutil.la
econdinclude_HEADERS = \
e-pilot-map.h \
@@ -128,7 +99,7 @@ pilot_sources = \
if ENABLE_PILOT_CONDUITS
pilot_compile = $(pilot_sources)
else
-pilot_compile =
+pilot_compile = e-pilot-settings.c e-pilot-settings.h
endif
libeconduit_la_SOURCES = $(pilot_compile)
@@ -136,7 +107,7 @@ libeconduit_la_SOURCES = $(pilot_compile)
libeconduit_static_la_SOURCES = $(libeconduit_la_SOURCES)
libeconduit_static_la_LDFLAGS = -all-static
-EXTRA_DIST = $(pilot_sources) e-util-marshal.list
+EXTRA_DIST = $(pilot_sources)
edb3include_HEADERS = \
e-db3-utils.h \
@@ -146,6 +117,3 @@ libedb3util_la_SOURCES = \
$(edb3include_HEADERS) \
e-db3-utils.c \
e-dbhash.c
-
-BUILT_SOURCES = $(MARSHAL_GENERATED)
-CLEANFILES = $(BUILT_SOURCES)
diff --git a/e-util/e-bit-array.c b/e-util/e-bit-array.c
deleted file mode 100644
index 2a79e1bab2..0000000000
--- a/e-util/e-bit-array.c
+++ /dev/null
@@ -1,429 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-bit-array.c
- * Copyright 2000, 2001, Ximian, Inc.
- *
- * Authors:
- * Chris Lahey <clahey@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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 <gtk/gtksignal.h>
-#include "e-bit-array.h"
-#include "gal/util/e-util.h"
-
-#define PARENT_TYPE G_TYPE_OBJECT
-
-#define ONES ((guint32) 0xffffffff)
-
-#define BOX(n) ((n) / 32)
-#define OFFSET(n) (31 - ((n) % 32))
-#define BITMASK(n) ((guint32)(((guint32) 0x1) << OFFSET((n))))
-#define BITMASK_LEFT(n) ((((n) % 32) == 0) ? 0 : (ONES << (32 - ((n) % 32))))
-#define BITMASK_RIGHT(n) ((guint32)(((guint32) ONES) >> ((n) % 32)))
-
-static GObjectClass *parent_class;
-
-static void
-e_bit_array_insert_real(EBitArray *eba, int row)
-{
- int box;
- int i;
- if(eba->bit_count >= 0) {
- /* Add another word if needed. */
- if ((eba->bit_count & 0x1f) == 0) {
- eba->data = g_renew(guint32, eba->data, (eba->bit_count >> 5) + 1);
- eba->data[eba->bit_count >> 5] = 0;
- }
-
- /* The box is the word that our row is in. */
- box = BOX(row);
- /* Shift all words to the right of our box right one bit. */
- for (i = eba->bit_count >> 5; i > box; i--) {
- eba->data[i] = (eba->data[i] >> 1) | (eba->data[i - 1] << 31);
- }
-
- /* Shift right half of box one bit to the right. */
- eba->data[box] = (eba->data[box] & BITMASK_LEFT(row)) | ((eba->data[box] & BITMASK_RIGHT(row)) >> 1);
- eba->bit_count ++;
- }
-}
-
-static void
-e_bit_array_delete_real(EBitArray *eba, int row, gboolean move_selection_mode)
-{
- int box;
- int i;
- int last;
- int selected = FALSE;
- if(eba->bit_count >= 0) {
- guint32 bitmask;
- box = row >> 5;
- last = eba->bit_count >> 5;
-
- /* Build bitmasks for the left and right half of the box */
- bitmask = BITMASK_RIGHT(row) >> 1;
- if (move_selection_mode)
- selected = e_bit_array_value_at(eba, row);
- /* Shift right half of box one bit to the left. */
- eba->data[box] = (eba->data[box] & BITMASK_LEFT(row))| ((eba->data[box] & bitmask) << 1);
-
- /* Shift all words to the right of our box left one bit. */
- if (box < last) {
- eba->data[box] &= eba->data[box + 1] >> 31;
-
- for (i = box + 1; i < last; i++) {
- eba->data[i] = (eba->data[i] << 1) | (eba->data[i + 1] >> 31);
- }
- /* this over-runs our memory! */
- /*eba->data[i] = eba->data[i] << 1; */
- }
- eba->bit_count --;
- /* Remove the last word if not needed. */
- if ((eba->bit_count & 0x1f) == 0) {
- eba->data = g_renew(guint32, eba->data, eba->bit_count >> 5);
- }
- if (move_selection_mode && selected) {
- e_bit_array_select_single_row (eba, row > 0 ? row - 1 : 0);
- }
- }
-}
-
-/* FIXME : Improve efficiency here. */
-void
-e_bit_array_delete(EBitArray *eba, int row, int count)
-{
- int i;
- for (i = 0; i < count; i++)
- e_bit_array_delete_real(eba, row, FALSE);
-}
-
-/* FIXME : Improve efficiency here. */
-void
-e_bit_array_delete_single_mode(EBitArray *eba, int row, int count)
-{
- int i;
- for (i = 0; i < count; i++)
- e_bit_array_delete_real(eba, row, TRUE);
-}
-
-/* FIXME : Improve efficiency here. */
-void
-e_bit_array_insert(EBitArray *eba, int row, int count)
-{
- int i;
- for (i = 0; i < count; i++)
- e_bit_array_insert_real(eba, row);
-}
-
-/* FIXME: Implement this more efficiently. */
-void
-e_bit_array_move_row(EBitArray *eba, int old_row, int new_row)
-{
- e_bit_array_delete_real(eba, old_row, FALSE);
- e_bit_array_insert_real(eba, new_row);
-}
-
-static void
-eba_dispose (GObject *object)
-{
- EBitArray *eba;
-
- eba = E_BIT_ARRAY (object);
-
- if (eba->data)
- g_free(eba->data);
- eba->data = NULL;
-
- if (G_OBJECT_CLASS (parent_class)->dispose)
- (* G_OBJECT_CLASS (parent_class)->dispose) (object);
-}
-
-/**
- * e_selection_model_is_row_selected
- * @selection: #EBitArray to check
- * @n: The row to check
- *
- * This routine calculates whether the given row is selected.
- *
- * Returns: %TRUE if the given row is selected
- */
-gboolean
-e_bit_array_value_at (EBitArray *eba,
- gint n)
-{
- if (eba->bit_count < n || eba->bit_count == 0)
- return 0;
- else
- return (eba->data[BOX(n)] >> OFFSET(n)) & 0x1;
-}
-
-/**
- * e_selection_model_foreach
- * @selection: #EBitArray to traverse
- * @callback: The callback function to call back.
- * @closure: The closure
- *
- * This routine calls the given callback function once for each
- * selected row, passing closure as the closure.
- */
-void
-e_bit_array_foreach (EBitArray *eba,
- EForeachFunc callback,
- gpointer closure)
-{
- int i;
- int last = (eba->bit_count + 31) / 32;
- for (i = 0; i < last; i++) {
- if (eba->data[i]) {
- int j;
- guint32 value = eba->data[i];
- for (j = 0; j < 32; j++) {
- if (value & 0x80000000) {
- callback(i * 32 + j, closure);
- }
- value <<= 1;
- }
- }
- }
-}
-
-/**
- * e_selection_model_clear
- * @selection: #EBitArray to clear
- *
- * This routine clears the selection to no rows selected.
- */
-void
-e_bit_array_clear(EBitArray *eba)
-{
- g_free(eba->data);
- eba->data = NULL;
- eba->bit_count = 0;
-}
-
-#define PART(x,n) (((x) & (0x01010101 << n)) >> n)
-#define SECTION(x, n) (((x) >> (n * 8)) & 0xff)
-
-/**
- * e_selection_model_selected_count
- * @selection: #EBitArray to count
- *
- * This routine calculates the number of rows selected.
- *
- * Returns: The number of rows selected in the given model.
- */
-gint
-e_bit_array_selected_count (EBitArray *eba)
-{
- gint count;
- int i;
- int last;
-
- if (!eba->data)
- return 0;
-
- count = 0;
-
- last = BOX(eba->bit_count - 1);
-
- for (i = 0; i <= last; i++) {
- int j;
- guint32 thiscount = 0;
- for (j = 0; j < 8; j++)
- thiscount += PART(eba->data[i], j);
- for (j = 0; j < 4; j++)
- count += SECTION(thiscount, j);
- }
-
- return count;
-}
-
-/**
- * e_selection_model_select_all
- * @selection: #EBitArray to select all
- *
- * This routine selects all the rows in the given
- * #EBitArray.
- */
-void
-e_bit_array_select_all (EBitArray *eba)
-{
- int i;
-
- if (!eba->data)
- eba->data = g_new0 (guint32, (eba->bit_count + 31) / 32);
-
- for (i = 0; i < (eba->bit_count + 31) / 32; i ++) {
- eba->data[i] = ONES;
- }
-
- /* need to zero out the bits corresponding to the rows not
- selected in the last full 32 bit mask */
- if (eba->bit_count % 32) {
- int unselected_mask = 0;
- int num_unselected_in_last_byte = 32 - eba->bit_count % 32;
-
- for (i = 0; i < num_unselected_in_last_byte; i ++)
- unselected_mask |= 1 << i;
-
- eba->data[(eba->bit_count + 31) / 32 - 1] &= ~unselected_mask;
- }
-}
-
-/**
- * e_selection_model_invert_selection
- * @selection: #EBitArray to invert
- *
- * This routine inverts all the rows in the given
- * #EBitArray.
- */
-void
-e_bit_array_invert_selection (EBitArray *eba)
-{
- int i;
-
- if (!eba->data)
- eba->data = g_new0 (guint32, (eba->bit_count + 31) / 32);
-
- for (i = 0; i < (eba->bit_count + 31) / 32; i ++) {
- eba->data[i] = ~eba->data[i];
- }
-}
-
-int
-e_bit_array_bit_count (EBitArray *eba)
-{
- return eba->bit_count;
-}
-
-gboolean
-e_bit_array_cross_and (EBitArray *eba)
-{
- int i;
- for (i = 0; i < eba->bit_count / 32; i++) {
- if (eba->data[i] != ONES)
- return FALSE;
- }
- if ((eba->bit_count % 32) && ((eba->data[i] & BITMASK_LEFT(eba->bit_count)) != BITMASK_LEFT(eba->bit_count)))
- return FALSE;
- return TRUE;
-}
-
-gboolean
-e_bit_array_cross_or (EBitArray *eba)
-{
- int i;
- for (i = 0; i < eba->bit_count / 32; i++) {
- if (eba->data[i] != 0)
- return TRUE;
- }
- if ((eba->bit_count % 32) && ((eba->data[i] & BITMASK_LEFT(eba->bit_count)) != 0))
- return TRUE;
- return FALSE;
-}
-
-#define OPERATE(object, i,mask,grow) ((grow) ? (((object)->data[(i)]) |= ((guint32) ~(mask))) : (((object)->data[(i)]) &= (mask)))
-
-void
-e_bit_array_change_one_row(EBitArray *eba, int row, gboolean grow)
-{
- int i;
- i = BOX(row);
-
- OPERATE(eba, i, ~BITMASK(row), grow);
-}
-
-void
-e_bit_array_change_range(EBitArray *eba, int start, int end, gboolean grow)
-{
- int i, last;
- if (start != end) {
- i = BOX(start);
- last = BOX(end);
-
- if (i == last) {
- OPERATE(eba, i, BITMASK_LEFT(start) | BITMASK_RIGHT(end), grow);
- } else {
- OPERATE(eba, i, BITMASK_LEFT(start), grow);
- if (grow)
- for (i ++; i < last; i++)
- eba->data[i] = ONES;
- else
- for (i ++; i < last; i++)
- eba->data[i] = 0;
- OPERATE(eba, i, BITMASK_RIGHT(end), grow);
- }
- }
-}
-
-void
-e_bit_array_select_single_row (EBitArray *eba, int row)
-{
- int i;
- for (i = 0; i < ((eba->bit_count + 31) / 32); i++) {
- if (!((i == BOX(row) && eba->data[i] == BITMASK(row)) ||
- (i != BOX(row) && eba->data[i] == 0))) {
- g_free(eba->data);
- eba->data = g_new0(guint32, (eba->bit_count + 31) / 32);
- eba->data[BOX(row)] = BITMASK(row);
-
- break;
- }
- }
-}
-
-void
-e_bit_array_toggle_single_row (EBitArray *eba, int row)
-{
- if (eba->data[BOX(row)] & BITMASK(row))
- eba->data[BOX(row)] &= ~BITMASK(row);
- else
- eba->data[BOX(row)] |= BITMASK(row);
-}
-
-
-static void
-e_bit_array_init (EBitArray *eba)
-{
- eba->data = NULL;
- eba->bit_count = 0;
-}
-
-static void
-e_bit_array_class_init (EBitArrayClass *klass)
-{
- GObjectClass *object_class;
-
- parent_class = g_type_class_ref (PARENT_TYPE);
-
- object_class = G_OBJECT_CLASS(klass);
-
- object_class->dispose = eba_dispose;
-}
-
-E_MAKE_TYPE(e_bit_array, "EBitArray", EBitArray,
- e_bit_array_class_init, e_bit_array_init, PARENT_TYPE)
-
-EBitArray *
-e_bit_array_new (int count)
-{
- EBitArray *eba = g_object_new (E_BIT_ARRAY_TYPE, NULL);
- eba->bit_count = count;
- eba->data = g_new0(guint32, (eba->bit_count + 31) / 32);
- return eba;
-}
diff --git a/e-util/e-bit-array.h b/e-util/e-bit-array.h
deleted file mode 100644
index ebfe644da6..0000000000
--- a/e-util/e-bit-array.h
+++ /dev/null
@@ -1,104 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-bit-array.h
- * Copyright 2000, 2001, Ximian, Inc.
- *
- * Authors:
- * Chris Lahey <clahey@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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.
- */
-
-#ifndef _E_BIT_ARRAY_H_
-#define _E_BIT_ARRAY_H_
-
-#include <glib-object.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
-
-#define E_BIT_ARRAY_TYPE (e_bit_array_get_type ())
-#define E_BIT_ARRAY(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), E_BIT_ARRAY_TYPE, EBitArray))
-#define E_BIT_ARRAY_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), E_BIT_ARRAY_TYPE, EBitArrayClass))
-#define E_IS_BIT_ARRAY(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), E_BIT_ARRAY_TYPE))
-#define E_IS_BIT_ARRAY_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), E_BIT_ARRAY_TYPE))
-
-#ifndef _E_FOREACH_FUNC_H_
-#define _E_FOREACH_FUNC_H_
-typedef void (*EForeachFunc) (int model_row,
- gpointer closure);
-#endif
-
-typedef struct {
- GObject base;
-
- gint bit_count;
- guint32 *data;
-} EBitArray;
-
-typedef struct {
- GObjectClass parent_class;
-} EBitArrayClass;
-
-
-GType e_bit_array_get_type (void);
-EBitArray *e_bit_array_new (int count);
-
-gboolean e_bit_array_value_at (EBitArray *selection,
- gint n);
-void e_bit_array_foreach (EBitArray *selection,
- EForeachFunc callback,
- gpointer closure);
-void e_bit_array_clear (EBitArray *selection);
-gint e_bit_array_selected_count (EBitArray *selection);
-void e_bit_array_select_all (EBitArray *selection);
-void e_bit_array_invert_selection (EBitArray *selection);
-int e_bit_array_bit_count (EBitArray *selection);
-void e_bit_array_change_one_row (EBitArray *selection,
- int row,
- gboolean grow);
-void e_bit_array_change_range (EBitArray *selection,
- int start,
- int end,
- gboolean grow);
-void e_bit_array_select_single_row (EBitArray *eba,
- int row);
-void e_bit_array_toggle_single_row (EBitArray *eba,
- int row);
-
-void e_bit_array_insert (EBitArray *esm,
- int row,
- int count);
-void e_bit_array_delete (EBitArray *esm,
- int row,
- int count);
-void e_bit_array_delete_single_mode (EBitArray *esm,
- int row,
- int count);
-void e_bit_array_move_row (EBitArray *esm,
- int old_row,
- int new_row);
-gint e_bit_array_bit_count (EBitArray *esm);
-
-gboolean e_bit_array_cross_and (EBitArray *esm);
-gboolean e_bit_array_cross_or (EBitArray *esm);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-
-#endif /* _E_BIT_ARRAY_H_ */
diff --git a/e-util/e-categories-config.c b/e-util/e-categories-config.c
index e5e4c0592e..0317103d72 100644
--- a/e-util/e-categories-config.c
+++ b/e-util/e-categories-config.c
@@ -8,10 +8,15 @@
* Copyright 2001, Ximian, Inc.
*/
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
#include <string.h>
#include <libgnomeui/gnome-dialog.h>
#include <libgnome/gnome-i18n.h>
#include <gdk-pixbuf/gdk-pixbuf.h>
+#include <gal/widgets/e-unicode.h>
#include <gal/widgets/e-categories.h>
#include "e-categories-config.h"
#include "e-categories-master-list-wombat.h"
@@ -102,7 +107,7 @@ e_categories_config_get_icon_for (const char *category, GdkPixmap **pixmap, GdkB
/* load the icon in our list */
pixbuf = g_hash_table_lookup (icons_table, icon_file);
if (!pixbuf) {
- pixbuf = gdk_pixbuf_new_from_file (icon_file, NULL);
+ pixbuf = gdk_pixbuf_new_from_file (icon_file);
if (!pixbuf) {
*pixmap = NULL;
if (mask != NULL)
@@ -173,30 +178,34 @@ e_categories_config_set_icon_for (const char *category, const char *icon_file)
void
e_categories_config_open_dialog_for_entry (GtkEntry *entry)
{
- GtkDialog *dialog;
- const char *text;
char *categories;
+ GnomeDialog *dialog;
int result;
-
+
g_return_if_fail (entry != NULL);
g_return_if_fail (GTK_IS_ENTRY (entry));
-
+
if (!initialized)
initialize_categories_config ();
-
- text = gtk_entry_get_text (GTK_ENTRY (entry));
- dialog = GTK_DIALOG (e_categories_new (text));
-
- g_object_set (dialog, "ecml", ecmlw, NULL);
-
+
+ categories = e_utf8_gtk_entry_get_text (GTK_ENTRY (entry));
+ dialog = GNOME_DIALOG (e_categories_new (categories));
+
+ gtk_object_set (GTK_OBJECT (dialog),
+ "ecml", ecmlw,
+ NULL);
+
/* run the dialog */
- result = gtk_dialog_run (dialog);
-
- if (result == GTK_RESPONSE_OK) {
- g_object_get (dialog, "categories", &categories, NULL);
- gtk_entry_set_text (GTK_ENTRY (entry), categories);
+ result = gnome_dialog_run (dialog);
+ g_free (categories);
+
+ if (result == 0) {
+ gtk_object_get (GTK_OBJECT (dialog),
+ "categories", &categories,
+ NULL);
+ e_utf8_gtk_entry_set_text (GTK_ENTRY (entry), categories);
g_free (categories);
}
-
+
gtk_object_destroy (GTK_OBJECT (dialog));
}
diff --git a/e-util/e-component-listener.c b/e-util/e-component-listener.c
index e3cb3c6e1f..6db67dc270 100644
--- a/e-util/e-component-listener.c
+++ b/e-util/e-component-listener.c
@@ -8,8 +8,14 @@
* Copyright 2002, Ximian, Inc.
*/
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <gtk/gtksignal.h>
#include <bonobo/bonobo-exception.h>
#include <bonobo/bonobo-object.h>
+#include <gal/util/e-util.h>
#include "e-component-listener.h"
#include <libgnome/gnome-i18n.h>
@@ -23,10 +29,10 @@ struct _EComponentListenerPrivate {
};
static void e_component_listener_class_init (EComponentListenerClass *klass);
-static void e_component_listener_init (EComponentListener *cl, EComponentListenerClass *klass);
-static void e_component_listener_finalize (GObject *object);
+static void e_component_listener_init (EComponentListener *cl);
+static void e_component_listener_destroy (GtkObject *object);
-static GObjectClass *parent_class = NULL;
+static GtkObjectClass *parent_class = NULL;
enum {
COMPONENT_DIED,
@@ -38,25 +44,25 @@ static guint comp_listener_signals[LAST_SIGNAL];
static void
e_component_listener_class_init (EComponentListenerClass *klass)
{
- GObjectClass *object_class = G_OBJECT_CLASS (klass);
+ GtkObjectClass *object_class = GTK_OBJECT_CLASS (klass);
- parent_class = g_type_class_peek_parent (klass);
+ parent_class = gtk_type_class (PARENT_TYPE);
- object_class->finalize = e_component_listener_finalize;
+ object_class->destroy = e_component_listener_destroy;
klass->component_died = NULL;
comp_listener_signals[COMPONENT_DIED] =
- g_signal_new ("component_died",
- G_TYPE_FROM_CLASS (klass),
- G_SIGNAL_RUN_FIRST,
- G_STRUCT_OFFSET (EComponentListenerClass, component_died),
- NULL, NULL,
- g_cclosure_marshal_VOID__VOID,
- G_TYPE_NONE, 0);
+ gtk_signal_new ("component_died",
+ GTK_RUN_FIRST,
+ object_class->type,
+ GTK_SIGNAL_OFFSET (EComponentListenerClass, component_died),
+ gtk_marshal_NONE__NONE,
+ GTK_TYPE_NONE, 0);
+ gtk_object_class_add_signals (object_class, comp_listener_signals, LAST_SIGNAL);
}
static void
-e_component_listener_init (EComponentListener *cl, EComponentListenerClass *klass)
+e_component_listener_init (EComponentListener *cl)
{
/* allocate internal structure */
cl->priv = g_new (EComponentListenerPrivate, 1);
@@ -66,7 +72,7 @@ e_component_listener_init (EComponentListener *cl, EComponentListenerClass *klas
}
static void
-e_component_listener_finalize (GObject *object)
+e_component_listener_destroy (GtkObject *object)
{
EComponentListener *cl = (EComponentListener *) object;
@@ -83,27 +89,28 @@ e_component_listener_finalize (GObject *object)
g_free (cl->priv);
cl->priv = NULL;
- if (G_OBJECT_CLASS (parent_class)->finalize)
- (* G_OBJECT_CLASS (parent_class)->finalize) (object);
+ if (GTK_OBJECT_CLASS (parent_class)->destroy)
+ (* GTK_OBJECT_CLASS (parent_class)->destroy) (object);
}
-GType
+GtkType
e_component_listener_get_type (void)
{
- static GType type = 0;
+ static GtkType type = 0;
if (!type) {
- static GTypeInfo info = {
- sizeof (EComponentListenerClass),
- (GBaseInitFunc) NULL,
- (GBaseFinalizeFunc) NULL,
- (GClassInitFunc) e_component_listener_class_init,
- NULL, NULL,
- sizeof (EComponentListener),
- 0,
- (GInstanceInitFunc) e_component_listener_init
- };
- type = g_type_register_static (G_TYPE_OBJECT, "EComponentListener", &info, 0);
+ static const GtkTypeInfo info = {
+ "EComponentListener",
+ sizeof (EComponentListener),
+ sizeof (EComponentListenerClass),
+ (GtkClassInitFunc) e_component_listener_class_init,
+ (GtkObjectInitFunc) e_component_listener_init,
+ NULL, /* reserved_1 */
+ NULL, /* reserved_2 */
+ (GtkClassInitFunc) NULL
+ };
+
+ type = gtk_type_unique (PARENT_TYPE, &info);
}
return type;
@@ -129,28 +136,26 @@ ping_component_callback (gpointer user_data)
"CORBA object is nil or not"));
goto out;
}
+ CORBA_exception_free (&ev);
if (is_nil)
goto out;
- alive = bonobo_unknown_ping (cl->priv->component, &ev);
- if (alive) {
- CORBA_exception_free (&ev);
+ alive = bonobo_unknown_ping (cl->priv->component);
+ if (alive)
return TRUE;
- }
out:
/* the component has died, so we notify and close the timeout */
- CORBA_exception_free (&ev);
/* we ref the object just in case it gets destroyed in the callbacks */
- g_object_ref (G_OBJECT (cl));
- g_signal_emit (G_OBJECT (cl), comp_listener_signals[COMPONENT_DIED], 0);
+ gtk_object_ref (GTK_OBJECT (cl));
+ gtk_signal_emit (GTK_OBJECT (cl), comp_listener_signals[COMPONENT_DIED]);
cl->priv->component = CORBA_OBJECT_NIL;
cl->priv->ping_timeout_id = -1;
- g_object_unref (G_OBJECT (cl));
+ gtk_object_unref (GTK_OBJECT (cl));
return FALSE;
}
@@ -181,7 +186,7 @@ e_component_listener_new (Bonobo_Unknown comp, int ping_delay)
{
EComponentListener *cl;
- cl = g_object_new (E_COMPONENT_LISTENER_TYPE, NULL);
+ cl = gtk_type_new (E_COMPONENT_LISTENER_TYPE);
cl->priv->component = comp;
/* set up the timeout function */
diff --git a/e-util/e-config-listener.c b/e-util/e-config-listener.c
index 19c40b1dba..cfd2b52eba 100644
--- a/e-util/e-config-listener.c
+++ b/e-util/e-config-listener.c
@@ -8,17 +8,25 @@
* Copyright 2002, Ximian, Inc.
*/
-#include <string.h>
-#include <gconf/gconf-client.h>
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <gtk/gtksignal.h>
+#include <gtk/gtktypeutils.h>
+#include <bonobo/bonobo-exception.h>
+#include <bonobo/bonobo-event-source.h>
+#include <bonobo/bonobo-moniker-util.h>
+#include <bonobo/bonobo-object.h>
#include "e-config-listener.h"
-#define PARENT_TYPE G_TYPE_OBJECT
+#define PARENT_TYPE GTK_TYPE_OBJECT
typedef struct {
EConfigListener *cl;
- guint lid;
+ Bonobo_EventSource_ListenerId lid;
char *key;
- GConfValueType type;
+ GtkFundamentalType type;
union {
gboolean v_bool;
float v_float;
@@ -29,15 +37,15 @@ typedef struct {
} KeyData;
struct _EConfigListenerPrivate {
- GConfClient *db;
+ Bonobo_ConfigDatabase db;
GHashTable *keys;
};
static void e_config_listener_class_init (EConfigListenerClass *klass);
-static void e_config_listener_init (EConfigListener *cl, EConfigListenerClass *klass);
-static void e_config_listener_finalize (GObject *object);
+static void e_config_listener_init (EConfigListener *cl);
+static void e_config_listener_destroy (GtkObject *object);
-static GObjectClass *parent_class = NULL;
+static GtkObjectClass *parent_class = NULL;
enum {
KEY_CHANGED,
@@ -49,35 +57,41 @@ static guint config_listener_signals[LAST_SIGNAL];
static void
e_config_listener_class_init (EConfigListenerClass *klass)
{
- GObjectClass *object_class = G_OBJECT_CLASS (klass);
+ GtkObjectClass *object_class = GTK_OBJECT_CLASS (klass);
- parent_class = g_type_class_peek_parent (klass);
+ parent_class = gtk_type_class (PARENT_TYPE);
- object_class->finalize = e_config_listener_finalize;
+ object_class->destroy = e_config_listener_destroy;
klass->key_changed = NULL;
config_listener_signals[KEY_CHANGED] =
- g_signal_new ("key_changed",
- G_TYPE_FROM_CLASS (klass),
- G_SIGNAL_RUN_FIRST,
- G_STRUCT_OFFSET (EConfigListenerClass, key_changed),
- NULL, NULL,
- g_cclosure_marshal_VOID__STRING,
- G_TYPE_NONE, 1, G_TYPE_STRING);
-
- /* make sure GConf is initialized */
- if (!gconf_is_initialized ())
- gconf_init (0, NULL, NULL);
+ gtk_signal_new ("key_changed",
+ GTK_RUN_FIRST,
+ object_class->type,
+ GTK_SIGNAL_OFFSET (EConfigListenerClass, key_changed),
+ gtk_marshal_NONE__STRING,
+ GTK_TYPE_NONE, 1, GTK_TYPE_STRING);
+ gtk_object_class_add_signals (object_class, config_listener_signals, LAST_SIGNAL);
}
static void
-e_config_listener_init (EConfigListener *cl, EConfigListenerClass *klass)
+e_config_listener_init (EConfigListener *cl)
{
+ CORBA_Environment ev;
+
/* allocate internal structure */
cl->priv = g_new0 (EConfigListenerPrivate, 1);
cl->priv->keys = g_hash_table_new (g_str_hash, g_str_equal);
- cl->priv->db = gconf_client_get_default ();
+
+ /* activate the configuration database */
+ CORBA_exception_init (&ev);
+ cl->priv->db = bonobo_get_object ("wombat:", "Bonobo/ConfigDatabase", &ev);
+
+ if (BONOBO_EX (&ev) || cl->priv->db == CORBA_OBJECT_NIL) {
+ CORBA_exception_free (&ev);
+ cl->priv->db = CORBA_OBJECT_NIL;
+ }
}
static void
@@ -87,11 +101,11 @@ free_key_hash (gpointer key, gpointer value, gpointer user_data)
g_return_if_fail (kd != NULL);
- gconf_client_notify_remove (kd->cl->priv->db, kd->lid);
+ bonobo_event_source_client_remove_listener (kd->cl->priv->db, kd->lid, NULL);
g_free (kd->key);
switch (kd->type) {
- case GCONF_VALUE_STRING :
+ case GTK_TYPE_STRING :
g_free (kd->value.v_str);
break;
default :
@@ -102,7 +116,7 @@ free_key_hash (gpointer key, gpointer value, gpointer user_data)
}
static void
-e_config_listener_finalize (GObject *object)
+e_config_listener_destroy (GtkObject *object)
{
EConfigListener *cl = (EConfigListener *) object;
@@ -112,36 +126,36 @@ e_config_listener_finalize (GObject *object)
g_hash_table_destroy (cl->priv->keys);
cl->priv->keys = NULL;
- if (cl->priv->db != NULL) {
- g_object_unref (G_OBJECT (cl->priv->db));
- cl->priv->db = NULL;
+ if (cl->priv->db != CORBA_OBJECT_NIL) {
+ bonobo_object_release_unref (cl->priv->db, NULL);
+ cl->priv->db = CORBA_OBJECT_NIL;
}
g_free (cl->priv);
cl->priv = NULL;
- if (G_OBJECT_CLASS (parent_class)->finalize)
- (* G_OBJECT_CLASS (parent_class)->finalize) (object);
+ if (GTK_OBJECT_CLASS (parent_class)->destroy)
+ (* GTK_OBJECT_CLASS (parent_class)->destroy) (object);
}
-GType
+GtkType
e_config_listener_get_type (void)
{
- static GType type = 0;
+ static GtkType type = 0;
if (!type) {
- static const GTypeInfo info = {
- sizeof (EConfigListenerClass),
- (GBaseInitFunc) NULL,
- (GBaseFinalizeFunc) NULL,
- (GClassInitFunc) e_config_listener_class_init,
- NULL,
- NULL,
- sizeof (EConfigListener),
- 0,
- (GInstanceInitFunc) e_config_listener_init
- };
- type = g_type_register_static (PARENT_TYPE, "EConfigListener", &info, 0);
+ static const GtkTypeInfo info = {
+ "EConfigListener",
+ sizeof (EConfigListener),
+ sizeof (EConfigListenerClass),
+ (GtkClassInitFunc) e_config_listener_class_init,
+ (GtkObjectInitFunc) e_config_listener_init,
+ NULL, /* reserved_1 */
+ NULL, /* reserved_2 */
+ (GtkClassInitFunc) NULL
+ };
+
+ type = gtk_type_unique (PARENT_TYPE, &info);
}
return type;
@@ -162,49 +176,53 @@ e_config_listener_new (void)
{
EConfigListener *cl;
- cl = g_object_new (E_CONFIG_LISTENER_TYPE, NULL);
+ cl = gtk_type_new (E_CONFIG_LISTENER_TYPE);
return cl;
}
static void
-property_change_cb (GConfEngine *engine,
- guint cnxn_id,
- GConfEntry *entry,
+property_change_cb (BonoboListener *listener,
+ char *event_name,
+ CORBA_any *any,
+ CORBA_Environment *ev,
gpointer user_data)
{
KeyData *kd = (KeyData *) user_data;
- g_return_if_fail (entry != NULL);
+ g_return_if_fail (any != NULL);
g_return_if_fail (kd != NULL);
/* free previous value */
- if (kd->type == GCONF_VALUE_STRING)
+ if (kd->type == GTK_TYPE_STRING)
g_free (kd->value.v_str);
/* set new value */
- if (entry->value->type == GCONF_VALUE_BOOL) {
- kd->type = GCONF_VALUE_BOOL;
- kd->value.v_bool = gconf_value_get_bool (entry->value);
- } else if (entry->value->type == GCONF_VALUE_FLOAT) {
- kd->type = GCONF_VALUE_FLOAT;
- kd->value.v_float = gconf_value_get_float (entry->value);
- } else if (entry->value->type == GCONF_VALUE_INT) {
- kd->type = GCONF_VALUE_INT;
- kd->value.v_long = gconf_value_get_int (entry->value);
- } else if (entry->value->type == GCONF_VALUE_STRING) {
- kd->type = GCONF_VALUE_STRING;
- kd->value.v_str = g_strdup (gconf_value_get_string (entry->value));
+ if (bonobo_arg_type_is_equal (any->_type, BONOBO_ARG_BOOLEAN, NULL)) {
+ kd->type = GTK_TYPE_BOOL;
+ kd->value.v_bool = BONOBO_ARG_GET_BOOLEAN (any);
+ } else if (bonobo_arg_type_is_equal (any->_type, BONOBO_ARG_FLOAT, NULL)) {
+ kd->type = GTK_TYPE_FLOAT;
+ kd->value.v_float = BONOBO_ARG_GET_FLOAT (any);
+ } else if (bonobo_arg_type_is_equal (any->_type, BONOBO_ARG_LONG, NULL)) {
+ kd->type = GTK_TYPE_LONG;
+ kd->value.v_long = BONOBO_ARG_GET_LONG (any);
+ } else if (bonobo_arg_type_is_equal (any->_type, BONOBO_ARG_STRING, NULL)) {
+ kd->type = GTK_TYPE_STRING;
+ kd->value.v_str = g_strdup (BONOBO_ARG_GET_STRING (any));
} else
return;
- g_signal_emit (G_OBJECT (kd->cl), config_listener_signals[KEY_CHANGED], 0, kd->key);
+ gtk_signal_emit (GTK_OBJECT (kd->cl), config_listener_signals[KEY_CHANGED], kd->key);
}
static KeyData *
-add_key (EConfigListener *cl, const char *key, GConfValueType type,
+add_key (EConfigListener *cl, const char *key, GtkFundamentalType type,
gpointer value, gboolean used_default)
{
KeyData *kd;
+ char *event_name;
+ char *ch;
+ CORBA_Environment ev;
/* add the key to our hash table */
kd = g_new0 (KeyData, 1);
@@ -212,17 +230,17 @@ add_key (EConfigListener *cl, const char *key, GConfValueType type,
kd->key = g_strdup (key);
kd->type = type;
switch (type) {
- case GCONF_VALUE_BOOL :
+ case GTK_TYPE_BOOL :
memcpy (&kd->value.v_bool, value, sizeof (gboolean));
break;
- case GCONF_VALUE_FLOAT :
+ case GTK_TYPE_FLOAT :
memcpy (&kd->value.v_float, value, sizeof (float));
break;
- case GCONF_VALUE_INT :
+ case GTK_TYPE_LONG :
memcpy (&kd->value.v_long, value, sizeof (long));
break;
- case GCONF_VALUE_STRING :
- kd->value.v_str = g_strdup ((const char *) value);
+ case GTK_TYPE_STRING :
+ kd->value.v_str = (char *) value;
break;
default :
break;
@@ -231,20 +249,31 @@ add_key (EConfigListener *cl, const char *key, GConfValueType type,
kd->used_default = used_default;
/* add the listener for changes */
- gconf_client_add_dir (cl->priv->db, key, GCONF_CLIENT_PRELOAD_NONE, NULL);
- kd->lid = gconf_client_notify_add (cl->priv->db, key,
- (GConfClientNotifyFunc) property_change_cb,
- kd, NULL, NULL);
+ event_name = g_strdup_printf ("=Bonobo/ConfigDatabase:change%s",
+ kd->key);
+ ch = strrchr (event_name, '/');
+ if (ch)
+ *ch = ':';
+
+ CORBA_exception_init (&ev);
+ kd->lid = bonobo_event_source_client_add_listener (
+ cl->priv->db,
+ property_change_cb,
+ event_name,
+ &ev, kd);
+ if (BONOBO_EX (&ev)) {
+ CORBA_exception_free (&ev);
+ g_free (event_name);
+ free_key_hash (kd->key, kd, NULL);
+ return NULL;
+ }
g_hash_table_insert (cl->priv->keys, kd->key, kd);
- return kd;
-}
+ CORBA_exception_free (&ev);
+ g_free (event_name);
-gboolean
-e_config_listener_get_boolean (EConfigListener *cl, const char *key)
-{
- return e_config_listener_get_boolean_with_default (cl, key, FALSE, NULL);
+ return kd;
}
gboolean
@@ -253,9 +282,9 @@ e_config_listener_get_boolean_with_default (EConfigListener *cl,
gboolean def,
gboolean *used_default)
{
- GConfValue *conf_value;
gboolean value;
KeyData *kd;
+ gboolean d;
gpointer orig_key, orig_value;
g_return_val_if_fail (E_IS_CONFIG_LISTENER (cl), FALSE);
@@ -264,26 +293,16 @@ e_config_listener_get_boolean_with_default (EConfigListener *cl,
/* search for the key in our hash table */
if (!g_hash_table_lookup_extended (cl->priv->keys, key, &orig_key, &orig_value)) {
/* not found, so retrieve it from the configuration database */
- conf_value = gconf_client_get (cl->priv->db, key, NULL);
- if (conf_value) {
- value = gconf_value_get_bool (conf_value);
- kd = add_key (cl, key, GCONF_VALUE_BOOL, &value, FALSE);
- gconf_value_free (conf_value);
-
- if (used_default != NULL)
- *used_default = FALSE;
- } else {
- value = def;
- kd = add_key (cl, key, GCONF_VALUE_BOOL, &def, TRUE);
+ value = bonobo_config_get_boolean_with_default (cl->priv->db, key, def, &d);
+ kd = add_key (cl, key, GTK_TYPE_BOOL, &value, d);
- if (used_default != NULL)
- *used_default = TRUE;
- }
+ if (used_default != NULL)
+ *used_default = d;
} else {
kd = (KeyData *) orig_value;
g_assert (kd != NULL);
- if (kd->type == GCONF_VALUE_BOOL) {
+ if (kd->type == GTK_TYPE_BOOL) {
value = kd->value.v_bool;
if (used_default != NULL)
*used_default = kd->used_default;
@@ -295,20 +314,14 @@ e_config_listener_get_boolean_with_default (EConfigListener *cl,
}
float
-e_config_listener_get_float (EConfigListener *cl, const char *key)
-{
- return e_config_listener_get_float_with_default (cl, key, 0.0, NULL);
-}
-
-float
e_config_listener_get_float_with_default (EConfigListener *cl,
const char *key,
float def,
gboolean *used_default)
{
- GConfValue *conf_value;
float value;
KeyData *kd;
+ gboolean d;
gpointer orig_key, orig_value;
g_return_val_if_fail (E_IS_CONFIG_LISTENER (cl), -1);
@@ -317,26 +330,16 @@ e_config_listener_get_float_with_default (EConfigListener *cl,
/* search for the key in our hash table */
if (!g_hash_table_lookup_extended (cl->priv->keys, key, &orig_key, &orig_value)) {
/* not found, so retrieve it from the configuration database */
- conf_value = gconf_client_get (cl->priv->db, key, NULL);
- if (conf_value) {
- value = gconf_value_get_float (conf_value);
- kd = add_key (cl, key, GCONF_VALUE_FLOAT, &value, FALSE);
- gconf_value_free (conf_value);
-
- if (used_default != NULL)
- *used_default = FALSE;
- } else {
- value = def;
- kd = add_key (cl, key, GCONF_VALUE_FLOAT, &def, TRUE);
+ value = bonobo_config_get_float_with_default (cl->priv->db, key, def, &d);
+ kd = add_key (cl, key, GTK_TYPE_FLOAT, &value, d);
- if (used_default != NULL)
- *used_default = TRUE;
- }
+ if (used_default != NULL)
+ *used_default = d;
} else {
kd = (KeyData *) orig_value;
g_assert (kd != NULL);
- if (kd->type == GCONF_VALUE_FLOAT) {
+ if (kd->type == GTK_TYPE_FLOAT) {
value = kd->value.v_float;
if (used_default != NULL)
*used_default = kd->used_default;
@@ -348,20 +351,14 @@ e_config_listener_get_float_with_default (EConfigListener *cl,
}
long
-e_config_listener_get_long (EConfigListener *cl, const char *key)
-{
- return e_config_listener_get_long_with_default (cl, key, 0, NULL);
-}
-
-long
e_config_listener_get_long_with_default (EConfigListener *cl,
const char *key,
long def,
gboolean *used_default)
{
- GConfValue *conf_value;
long value;
KeyData *kd;
+ gboolean d;
gpointer orig_key, orig_value;
g_return_val_if_fail (E_IS_CONFIG_LISTENER (cl), -1);
@@ -370,26 +367,16 @@ e_config_listener_get_long_with_default (EConfigListener *cl,
/* search for the key in our hash table */
if (!g_hash_table_lookup_extended (cl->priv->keys, key, &orig_key, &orig_value)) {
/* not found, so retrieve it from the configuration database */
- conf_value = gconf_client_get (cl->priv->db, key, NULL);
- if (conf_value) {
- value = gconf_value_get_int (conf_value);
- kd = add_key (cl, key, GCONF_VALUE_INT, &value, FALSE);
- gconf_value_free (conf_value);
-
- if (used_default != NULL)
- *used_default = FALSE;
- } else {
- value = def;
- kd = add_key (cl, key, GCONF_VALUE_INT, &def, TRUE);
+ value = bonobo_config_get_long_with_default (cl->priv->db, key, def, &d);
+ kd = add_key (cl, key, GTK_TYPE_LONG, &value, d);
- if (used_default != NULL)
- *used_default = TRUE;
- }
+ if (used_default != NULL)
+ *used_default = d;
} else {
kd = (KeyData *) orig_value;
g_assert (kd != NULL);
- if (kd->type == GCONF_VALUE_INT) {
+ if (kd->type == GTK_TYPE_LONG) {
value = kd->value.v_long;
if (used_default != NULL)
*used_default = kd->used_default;
@@ -401,20 +388,14 @@ e_config_listener_get_long_with_default (EConfigListener *cl,
}
char *
-e_config_listener_get_string (EConfigListener *cl, const char *key)
-{
- return e_config_listener_get_string_with_default (cl, key, NULL, NULL);
-}
-
-char *
e_config_listener_get_string_with_default (EConfigListener *cl,
const char *key,
const char *def,
gboolean *used_default)
{
- GConfValue *conf_value;
char *str;
KeyData *kd;
+ gboolean d;
gpointer orig_key, orig_value;
g_return_val_if_fail (E_IS_CONFIG_LISTENER (cl), NULL);
@@ -423,41 +404,34 @@ e_config_listener_get_string_with_default (EConfigListener *cl,
/* search for the key in our hash table */
if (!g_hash_table_lookup_extended (cl->priv->keys, key, &orig_key, &orig_value)) {
/* not found, so retrieve it from the configuration database */
- conf_value = gconf_client_get (cl->priv->db, key, NULL);
- if (conf_value) {
- str = g_strdup (gconf_value_get_string (conf_value));
- kd = add_key (cl, key, GCONF_VALUE_STRING, (gpointer) str, FALSE);
- gconf_value_free (conf_value);
-
- if (used_default != NULL)
- *used_default = FALSE;
- } else {
- str = g_strdup (def);
- kd = add_key (cl, key, GCONF_VALUE_STRING, (gpointer) str, TRUE);
+ str = bonobo_config_get_string_with_default (cl->priv->db, key, (char *) def, &d);
+ if (str) {
+ kd = add_key (cl, key, GTK_TYPE_STRING, (gpointer) str, d);
if (used_default != NULL)
- *used_default = TRUE;
- }
+ *used_default = d;
+ } else
+ return NULL;
} else {
kd = (KeyData *) orig_value;
g_assert (kd != NULL);
- if (kd->type == GCONF_VALUE_STRING) {
- str = g_strdup (kd->value.v_str);
+ if (kd->type == GTK_TYPE_STRING) {
+ str = kd->value.v_str;
if (used_default != NULL)
*used_default = kd->used_default;
} else
return NULL;
}
- return str;
+ return g_strdup (str);
}
void
e_config_listener_set_boolean (EConfigListener *cl, const char *key, gboolean value)
{
+ CORBA_Environment ev;
KeyData *kd;
- GError *err = NULL;
g_return_if_fail (E_IS_CONFIG_LISTENER (cl));
g_return_if_fail (key != NULL);
@@ -466,23 +440,26 @@ e_config_listener_set_boolean (EConfigListener *cl, const char *key, gboolean va
if (value == e_config_listener_get_boolean_with_default (cl, key, 0, NULL))
return;
- gconf_client_set_bool (cl->priv->db, key, value, &err);
- if (err) {
- g_warning ("e_config_listener_set_bool: %s", err->message);
- g_error_free (err);
- } else {
+ CORBA_exception_init (&ev);
+
+ bonobo_config_set_boolean (cl->priv->db, key, value, &ev);
+ if (BONOBO_EX (&ev))
+ g_warning ("Cannot save config key %s -- %s", key, BONOBO_EX_ID (&ev));
+ else {
/* update the internal copy */
kd = g_hash_table_lookup (cl->priv->keys, key);
if (kd)
kd->value.v_bool = value;
}
+
+ CORBA_exception_free (&ev);
}
void
e_config_listener_set_float (EConfigListener *cl, const char *key, float value)
{
+ CORBA_Environment ev;
KeyData *kd;
- GError *err = NULL;
g_return_if_fail (E_IS_CONFIG_LISTENER (cl));
g_return_if_fail (key != NULL);
@@ -491,23 +468,26 @@ e_config_listener_set_float (EConfigListener *cl, const char *key, float value)
if (value == e_config_listener_get_float_with_default (cl, key, 0, NULL))
return;
- gconf_client_set_float (cl->priv->db, key, value, &err);
- if (err) {
- g_warning ("e_config_listener_set_float: %s", err->message);
- g_error_free (err);
- } else {
+ CORBA_exception_init (&ev);
+
+ bonobo_config_set_float (cl->priv->db, key, value, &ev);
+ if (BONOBO_EX (&ev))
+ g_warning ("Cannot save config key %s -- %s", key, BONOBO_EX_ID (&ev));
+ else {
/* update the internal copy */
kd = g_hash_table_lookup (cl->priv->keys, key);
if (kd)
kd->value.v_float = value;
}
+
+ CORBA_exception_free (&ev);
}
void
e_config_listener_set_long (EConfigListener *cl, const char *key, long value)
{
+ CORBA_Environment ev;
KeyData *kd;
- GError *err = NULL;
g_return_if_fail (E_IS_CONFIG_LISTENER (cl));
g_return_if_fail (key != NULL);
@@ -516,24 +496,27 @@ e_config_listener_set_long (EConfigListener *cl, const char *key, long value)
if (value == e_config_listener_get_long_with_default (cl, key, 0, NULL))
return;
- gconf_client_set_int (cl->priv->db, key, value, &err);
- if (err) {
- g_warning ("e_config_listener_set_long: %s", err->message);
- g_error_free (err);
- } else {
+ CORBA_exception_init (&ev);
+
+ bonobo_config_set_long (cl->priv->db, key, value, &ev);
+ if (BONOBO_EX (&ev))
+ g_warning ("Cannot save config key %s -- %s", key, BONOBO_EX_ID (&ev));
+ else {
/* update the internal copy */
kd = g_hash_table_lookup (cl->priv->keys, key);
if (kd)
kd->value.v_long = value;
}
+
+ CORBA_exception_free (&ev);
}
void
e_config_listener_set_string (EConfigListener *cl, const char *key, const char *value)
{
+ CORBA_Environment ev;
char *s1, *s2;
KeyData *kd;
- GError *err = NULL;
g_return_if_fail (E_IS_CONFIG_LISTENER (cl));
g_return_if_fail (key != NULL);
@@ -548,11 +531,12 @@ e_config_listener_set_string (EConfigListener *cl, const char *key, const char *
g_free (s2);
- gconf_client_set_string (cl->priv->db, key, value, &err);
- if (err) {
- g_warning ("e_config_listener_set_bool: %s", err->message);
- g_error_free (err);
- } else {
+ CORBA_exception_init (&ev);
+
+ bonobo_config_set_string (cl->priv->db, key, value, &ev);
+ if (BONOBO_EX (&ev))
+ g_warning ("Cannot save config key %s -- %s", key, BONOBO_EX_ID (&ev));
+ else {
/* update the internal copy */
kd = g_hash_table_lookup (cl->priv->keys, key);
if (kd) {
@@ -560,48 +544,30 @@ e_config_listener_set_string (EConfigListener *cl, const char *key, const char *
kd->value.v_str = g_strdup (value);
}
}
+
+ CORBA_exception_free (&ev);
}
void
-e_config_listener_remove_value (EConfigListener *cl, const char *key)
+e_config_listener_remove_dir (EConfigListener *cl, const char *dir)
{
- gpointer orig_key, orig_value;
+ CORBA_Environment ev;
g_return_if_fail (E_IS_CONFIG_LISTENER (cl));
- g_return_if_fail (key != NULL);
-
- if (g_hash_table_lookup_extended (cl->priv->keys, key, &orig_key, &orig_value)) {
- KeyData *kd = orig_value;
-
- g_hash_table_remove (cl->priv->keys, key);
- g_free (kd->key);
- if (kd->type == GCONF_VALUE_STRING)
- g_free (kd->value.v_str);
- gconf_client_notify_remove (cl->priv->db, kd->lid);
+ g_return_if_fail (dir != NULL);
- g_free (kd);
+ CORBA_exception_init (&ev);
+ Bonobo_ConfigDatabase_removeDir (cl->priv->db, dir, &ev);
+ if (BONOBO_EX (&ev)) {
+ g_warning ("Cannot remove config dir %s -- %s", dir, BONOBO_EX_ID (&ev));
}
- gconf_client_unset (cl->priv->db, key, NULL);
+ CORBA_exception_free (&ev);
}
-void
-e_config_listener_remove_dir (EConfigListener *cl, const char *dir)
+Bonobo_ConfigDatabase
+e_config_listener_get_db (EConfigListener *cl)
{
- GSList *slist, *iter;
- const gchar *key;
-
- g_return_if_fail (E_IS_CONFIG_LISTENER (cl));
- g_return_if_fail (dir != NULL);
-
- slist = gconf_client_all_entries (cl->priv->db, dir, NULL);
- for (iter = slist; iter != NULL; iter = iter->next) {
- GConfEntry *entry = iter->data;
-
- key = gconf_entry_get_key (entry);
- gconf_client_unset (cl->priv->db, key, NULL);
- gconf_entry_free (entry);
- }
-
- g_slist_free (slist);
+ g_return_val_if_fail (E_IS_CONFIG_LISTENER (cl), CORBA_OBJECT_NIL);
+ return cl->priv->db;
}
diff --git a/e-util/e-config-listener.h b/e-util/e-config-listener.h
index 9b331a7c8a..a393350ce4 100644
--- a/e-util/e-config-listener.h
+++ b/e-util/e-config-listener.h
@@ -11,48 +11,46 @@
#ifndef __E_CONFIG_LISTENER_H__
#define __E_CONFIG_LISTENER_H__
-#include <glib-object.h>
+#include <gtk/gtkobject.h>
+#include <libgnome/gnome-defs.h>
+#include <bonobo-conf/bonobo-config-database.h>
-G_BEGIN_DECLS
+BEGIN_GNOME_DECLS
#define E_CONFIG_LISTENER_TYPE (e_config_listener_get_type ())
-#define E_CONFIG_LISTENER(o) (G_TYPE_CHECK_INSTANCECAST ((o), E_CONFIG_LISTENER_TYPE, EConfigListener))
-#define E_CONFIG_LISTENER_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), E_CONFIG_LISTENER_TYPE, EConfigListenerClass))
-#define E_IS_CONFIG_LISTENER(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), E_CONFIG_LISTENER_TYPE))
-#define E_IS_CONFIG_LISTENER_CLASS(k) (GT_TYPE_CHECK_CLASS_TYPE ((k), E_CONFIG_LISTENER_TYPE))
+#define E_CONFIG_LISTENER(o) (GTK_CHECK_CAST ((o), E_CONFIG_LISTENER_TYPE, EConfigListener))
+#define E_CONFIG_LISTENER_CLASS(k) (GTK_CHECK_CLASS_CAST((k), E_CONFIG_LISTENER_TYPE, EConfigListenerClass))
+#define E_IS_CONFIG_LISTENER(o) (GTK_CHECK_TYPE ((o), E_CONFIG_LISTENER_TYPE))
+#define E_IS_CONFIG_LISTENER_CLASS(k) (GTK_CHECK_CLASS_TYPE ((k), E_CONFIG_LISTENER_TYPE))
typedef struct _EConfigListenerPrivate EConfigListenerPrivate;
typedef struct {
- GObject object;
+ GtkObject object;
EConfigListenerPrivate *priv;
} EConfigListener;
typedef struct {
- GObjectClass parent_class;
+ GtkObjectClass parent_class;
void (* key_changed) (EConfigListener *cl, const char *key);
} EConfigListenerClass;
-GType e_config_listener_get_type (void);
+GtkType e_config_listener_get_type (void);
EConfigListener *e_config_listener_new (void);
-gboolean e_config_listener_get_boolean (EConfigListener *cl, const char *key);
gboolean e_config_listener_get_boolean_with_default (EConfigListener *cl,
const char *key,
gboolean def,
gboolean *used_default);
-float e_config_listener_get_float (EConfigListener *cl, const char *key);
float e_config_listener_get_float_with_default (EConfigListener *cl,
const char *key,
float def,
gboolean *used_default);
-long e_config_listener_get_long (EConfigListener *cl, const char *key);
long e_config_listener_get_long_with_default (EConfigListener *cl,
const char *key,
long def,
gboolean *used_default);
-char *e_config_listener_get_string (EConfigListener *cl, const char *key);
char *e_config_listener_get_string_with_default (EConfigListener *cl,
const char *key,
const char *def,
@@ -70,11 +68,10 @@ void e_config_listener_set_string (EConfigListener *cl,
const char *key,
const char *value);
-void e_config_listener_remove_value (EConfigListener *cl,
- const char *key);
-void e_config_listener_remove_dir (EConfigListener *cl,
- const char *dir);
+void e_config_listener_remove_dir (EConfigListener *cl, const char *dir);
-G_END_DECLS
+Bonobo_ConfigDatabase e_config_listener_get_db (EConfigListener *cl);
+
+END_GNOME_DECLS
#endif
diff --git a/e-util/e-dialog-utils.c b/e-util/e-dialog-utils.c
index a37519297e..bf51a63914 100644
--- a/e-util/e-dialog-utils.c
+++ b/e-util/e-dialog-utils.c
@@ -22,239 +22,230 @@
* Ettore Perazzoli <ettore@ximian.com>
*/
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
#include "e-dialog-utils.h"
+#include "widgets/misc/e-bonobo-widget.h"
+
#include <gdk/gdkx.h>
+#include <gdk/gdkprivate.h>
+#include <gdk/gdk.h>
-#include <gtk/gtkfilesel.h>
#include <gtk/gtkmain.h>
-#include <gtk/gtkplug.h>
+#include <gtk/gtksignal.h>
+#include <gtk/gtkfilesel.h>
+#include <libgnome/gnome-defs.h>
#include <libgnome/gnome-i18n.h>
#include <libgnome/gnome-util.h>
+#include <libgnomeui/gnome-dialog-util.h>
+#include <libgnomeui/gnome-uidefs.h>
+
+#include <bonobo/bonobo-control.h>
+#include <bonobo/bonobo-property-bag.h>
-/**
- * e_notice:
- * @parent: the dialog's parent window, or %NULL
- * @type: the type of dialog (%GTK_MESSAGE_INFO, %GTK_MESSAGE_WARNING,
- * or %GTK_MESSAGE_ERROR)
- * @format: printf-style format string, followed by arguments
- *
- * Convenience function to show a dialog with a message and an "OK"
- * button.
- **/
-void
-e_notice (gpointer parent, GtkMessageType type, const char *format, ...)
+#define TRANSIENT_DATA_ID "e-dialog:transient"
+
+
+static void
+transient_realize_callback (GtkWidget *widget)
{
- GtkWidget *dialog;
- va_list args;
- char *str;
-
- va_start (args, format);
- str = g_strdup_vprintf (format, args);
- dialog = gtk_message_dialog_new (NULL,
- GTK_DIALOG_DESTROY_WITH_PARENT,
- type,
- GTK_BUTTONS_OK,
- "%s",
- str);
- va_end (args);
- g_free (str);
-
- if (parent)
- e_dialog_set_transient_for (GTK_WINDOW (dialog), parent);
- gtk_dialog_run (GTK_DIALOG (dialog));
- gtk_widget_destroy (dialog);
+ GdkWindow *window;
+
+ window = gtk_object_get_data (GTK_OBJECT (widget), TRANSIENT_DATA_ID);
+ g_assert (window != NULL);
+
+ gdk_window_set_transient_for (GTK_WIDGET (widget)->window, window);
}
-/**
- * e_notice_with_xid:
- * @parent: the dialog's parent window, or %NULL
- * @type: the type of dialog (%GTK_MESSAGE_INFO, %GTK_MESSAGE_WARNING,
- * or %GTK_MESSAGE_ERROR)
- * @format: printf-style format string, followed by arguments
- *
- * Like e_notice(), but takes a GdkNativeWindow for the parent
- * window argument.
- **/
-void
-e_notice_with_xid (GdkNativeWindow parent, GtkMessageType type, const char *format, ...)
+static void
+transient_unrealize_callback (GtkWidget *widget)
{
- GtkWidget *dialog;
- va_list args;
- char *str;
-
- va_start (args, format);
- str = g_strdup_vprintf (format, args);
- dialog = gtk_message_dialog_new (NULL,
- GTK_DIALOG_DESTROY_WITH_PARENT,
- type,
- GTK_BUTTONS_OK,
- "%s",
- str);
- va_end (args);
- g_free (str);
+ GdkWindow *window;
+
+ window = gtk_object_get_data (GTK_OBJECT (widget), TRANSIENT_DATA_ID);
+ g_assert (window != NULL);
+
+ gdk_property_delete (window, gdk_atom_intern ("WM_TRANSIENT_FOR", FALSE));
+}
+
+static void
+transient_destroy_callback (GtkWidget *widget)
+{
+ GdkWindow *window;
- if (parent)
- e_dialog_set_transient_for_xid (GTK_WINDOW (dialog), parent);
- gtk_dialog_run (GTK_DIALOG (dialog));
- gtk_widget_destroy (dialog);
+ window = gtk_object_get_data (GTK_OBJECT (widget), "transient");
+ if (window != NULL)
+ gdk_window_unref (window);
}
-
-/* Tests whether or not an X Window is being managed by the
- * window manager.
- */
-static gboolean
-window_is_wm_toplevel (Display *display, Window window)
+static void
+set_transient_for_gdk (GtkWindow *window,
+ GdkWindow *parent)
{
- static Atom WM_STATE = None;
- unsigned long nitems, after;
- unsigned char *data = NULL;
- Atom type = None;
- int format;
-
- if (!WM_STATE)
- WM_STATE = XInternAtom (display, "WM_STATE", False);
-
- if (XGetWindowProperty (display, window, WM_STATE, 0, 0, False,
- AnyPropertyType, &type, &format,
- &nitems, &after, &data) == Success) {
- if (data)
- XFree((char*)data);
- if (type)
- return TRUE;
+ g_return_if_fail (window != NULL);
+ g_return_if_fail (gtk_object_get_data (GTK_OBJECT (window), TRANSIENT_DATA_ID) == NULL);
+
+ /* if the parent window doesn't exist anymore,
+ * something is probably about to go very wrong,
+ * but at least let's not segfault here. */
+
+ if (parent == NULL) {
+ g_warning ("set_transient_for_gdk: uhoh, parent of window %p is NULL", window);
+ return;
}
- return FALSE;
+
+ gdk_window_ref (parent); /* FIXME? */
+
+ gtk_object_set_data (GTK_OBJECT (window), TRANSIENT_DATA_ID, parent);
+
+ if (GTK_WIDGET_REALIZED (window))
+ gdk_window_set_transient_for (GTK_WIDGET (window)->window, parent);
+
+ gtk_signal_connect (GTK_OBJECT (window), "realize",
+ GTK_SIGNAL_FUNC (transient_realize_callback), NULL);
+
+ gtk_signal_connect (GTK_OBJECT (window), "unrealize",
+ GTK_SIGNAL_FUNC (transient_unrealize_callback), NULL);
+
+ gtk_signal_connect (GTK_OBJECT (window), "destroy",
+ GTK_SIGNAL_FUNC (transient_destroy_callback), NULL);
}
+
/**
- * e_dialog_set_transient_for:
- * @dialog: a dialog window
- * @parent_widget: the parent for @dialog
+ * e_set_dialog_parent:
+ * @dialog:
+ * @parent_widget:
*
- * This sets the parent for @dialog to be @parent_widget. Unlike
- * gtk_window_set_transient_for(), this doesn't need @parent_widget to
- * be the actual toplevel, and also works if @parent_widget is
- * embedded as a Bonobo control by an out-of-process container.
- * @parent_widget must already be realized before calling this
- * function, but @dialog does not need to be.
+ * This sets the parent for @dialog to be @parent_widget. Unlike
+ * gtk_window_set_parent(), this doesn't need @parent_widget to be the actual
+ * toplevel, and also works if @parent_widget is been embedded as a Bonobo
+ * control by an out-of-process container.
**/
void
-e_dialog_set_transient_for (GtkWindow *dialog,
- GtkWidget *parent_widget)
+e_set_dialog_parent (GtkWindow *dialog,
+ GtkWidget *parent_widget)
{
+ Bonobo_PropertyBag property_bag;
GtkWidget *toplevel;
- Window parent, root_ret, *children;
- unsigned int numchildren;
- Display *display;
- Status status;
+ GdkWindow *gdk_window;
+ CORBA_char *id;
+ guint32 xid;
+ g_return_if_fail (dialog != NULL);
g_return_if_fail (GTK_IS_WINDOW (dialog));
+ g_return_if_fail (parent_widget != NULL);
g_return_if_fail (GTK_IS_WIDGET (parent_widget));
toplevel = gtk_widget_get_toplevel (parent_widget);
if (toplevel == NULL)
return;
- if (!GTK_IS_PLUG (toplevel)) {
- gtk_window_set_transient_for (GTK_WINDOW (dialog),
- GTK_WINDOW (toplevel));
+ if (! BONOBO_IS_CONTROL (toplevel)) {
+ if (GTK_IS_WINDOW (toplevel))
+ gtk_window_set_transient_for (dialog, GTK_WINDOW (toplevel));
return;
}
- /* Find the top-level windowmanager-managed X Window */
- display = GDK_WINDOW_XDISPLAY (parent_widget->window);
- parent = GDK_WINDOW_XID (parent_widget->window);
+ property_bag = bonobo_control_get_ambient_properties (BONOBO_CONTROL (toplevel), NULL);
+ if (property_bag == CORBA_OBJECT_NIL)
+ return;
- while (parent && !window_is_wm_toplevel (display, parent)) {
- status = XQueryTree (display, parent, &root_ret,
- &parent, &children, &numchildren);
- if (status != 0)
- XFree (children);
- }
+ id = bonobo_property_bag_client_get_value_string (property_bag, E_BONOBO_WIDGET_TOPLEVEL_PROPERTY_ID, NULL);
+ if (id == NULL)
+ return;
- e_dialog_set_transient_for_xid (dialog, parent);
-}
+ xid = strtol (id, NULL, 10);
-static void
-dialog_realized (GtkWindow *dialog, gpointer xid)
-{
- e_dialog_set_transient_for_xid (dialog, (GdkNativeWindow)xid);
+ gdk_window = gdk_window_foreign_new (xid);
+ set_transient_for_gdk (dialog, gdk_window);
}
/**
- * e_dialog_set_transient_for_xid:
- * @dialog: a dialog window
- * @xid: the X Window parent
+ * e_set_dialog_parent_from_xid:
+ * @dialog:
+ * @xid:
*
- * Like e_dialog_set_transient_for(), but use an XID to specify the
- * parent window.
+ * Like %e_set_dialog_parent_from_xid, but use an XID to specify the parent
+ * window.
**/
void
-e_dialog_set_transient_for_xid (GtkWindow *dialog,
- GdkNativeWindow xid)
+e_set_dialog_parent_from_xid (GtkWindow *dialog,
+ Window xid)
{
-#ifdef GDK_MULTIHEAD_SAFE
- GdkDisplay *display;
-#endif
- GdkWindow *parent;
-
+ g_return_if_fail (dialog != NULL);
g_return_if_fail (GTK_IS_WINDOW (dialog));
- if (!GTK_WIDGET_REALIZED (dialog)) {
- g_signal_connect (dialog, "realize",
- G_CALLBACK (dialog_realized),
- (gpointer) xid);
- return;
- }
+ set_transient_for_gdk (dialog, gdk_window_foreign_new (xid));
+}
-#ifdef GDK_MULTIHEAD_SAFE
- display = gdk_drawable_get_display (GDK_DRAWABLE (GTK_WIDGET (dialog)->window));
- parent = gdk_window_lookup_for_display (display, xid);
- if (!parent)
- parent = gdk_window_foreign_new_for_display (display, xid);
-#else
- parent = gdk_window_lookup (xid);
- if (!parent)
- parent = gdk_window_foreign_new (xid);
-#endif
- g_return_if_fail (parent != NULL);
+static void
+e_gnome_dialog_parent_destroyed (GtkWidget *parent, GtkWidget *dialog)
+{
+ gnome_dialog_close (GNOME_DIALOG (dialog));
+}
- gdk_window_set_transient_for (GTK_WIDGET (dialog)->window, parent);
+void
+e_gnome_dialog_set_parent (GnomeDialog *dialog, GtkWindow *parent)
+{
+ gnome_dialog_set_parent (dialog, parent);
+ gtk_signal_connect_while_alive (GTK_OBJECT (parent), "destroy",
+ e_gnome_dialog_parent_destroyed,
+ dialog, GTK_OBJECT (dialog));
}
+GtkWidget *
+e_gnome_warning_dialog_parented (const char *warning, GtkWindow *parent)
+{
+ GtkWidget *dialog;
+
+ dialog = gnome_warning_dialog_parented (warning, parent);
+ gtk_signal_connect_while_alive (GTK_OBJECT (parent), "destroy",
+ e_gnome_dialog_parent_destroyed, dialog, GTK_OBJECT(dialog));
+
+ return dialog;
+}
+
+GtkWidget *
+e_gnome_ok_cancel_dialog_parented (const char *message, GnomeReplyCallback callback,
+ gpointer data, GtkWindow *parent)
+{
+ GtkWidget *dialog;
+
+ dialog = gnome_ok_cancel_dialog_parented (message, callback, data, parent);
+ gtk_signal_connect_while_alive (GTK_OBJECT (parent), "destroy",
+ e_gnome_dialog_parent_destroyed, dialog, GTK_OBJECT(dialog));
+
+ return dialog;
+}
-
static void
save_ok (GtkWidget *widget, gpointer data)
{
GtkWidget *fs;
char **filename = data;
- const char *path;
- int btn = GTK_RESPONSE_YES;
-
+ char *path;
+ int btn = GNOME_YES;
+
fs = gtk_widget_get_toplevel (widget);
path = gtk_file_selection_get_filename (GTK_FILE_SELECTION (fs));
-
- if (g_file_test (path, G_FILE_TEST_IS_REGULAR)) {
+
+ if (g_file_test (path, G_FILE_TEST_ISFILE)) {
GtkWidget *dlg;
-
- dlg = gtk_message_dialog_new (GTK_WINDOW (fs), 0,
- GTK_MESSAGE_QUESTION,
- GTK_BUTTONS_YES_NO,
- _("A file by that name already exists.\n"
- "Overwrite it?"));
- gtk_window_set_title (GTK_WINDOW (dlg), _("Overwrite file?"));
-
- btn = gtk_dialog_run (GTK_DIALOG (dlg));
- gtk_widget_destroy (dlg);
+
+ dlg = gnome_question_dialog_modal (_("A file by that name already exists.\n"
+ "Overwrite it?"), NULL, NULL);
+ btn = gnome_dialog_run_and_close (GNOME_DIALOG (dlg));
}
-
- if (btn == GTK_RESPONSE_YES)
+
+ if (btn == GNOME_YES)
*filename = g_strdup (path);
-
+
gtk_main_quit ();
}
@@ -263,21 +254,23 @@ e_file_dialog_save (const char *title)
{
GtkFileSelection *fs;
char *path, *filename = NULL;
-
+
fs = GTK_FILE_SELECTION (gtk_file_selection_new (title));
path = g_strdup_printf ("%s/", g_get_home_dir ());
gtk_file_selection_set_filename (fs, path);
g_free (path);
- g_signal_connect (fs->ok_button, "clicked", G_CALLBACK (save_ok), &filename);
- g_signal_connect (fs->cancel_button, "clicked", G_CALLBACK (gtk_main_quit), NULL);
+ gtk_signal_connect (GTK_OBJECT (fs->ok_button), "clicked",
+ GTK_SIGNAL_FUNC (save_ok), &filename);
+ gtk_signal_connect (GTK_OBJECT (fs->cancel_button), "clicked",
+ GTK_SIGNAL_FUNC (gtk_main_quit), NULL);
gtk_widget_show (GTK_WIDGET (fs));
gtk_grab_add (GTK_WIDGET (fs));
gtk_main ();
gtk_widget_destroy (GTK_WIDGET (fs));
-
+
return filename;
}
diff --git a/e-util/e-html-utils.c b/e-util/e-html-utils.c
index 12aee18d2b..ef3a7ca2bf 100644
--- a/e-util/e-html-utils.c
+++ b/e-util/e-html-utils.c
@@ -18,10 +18,15 @@
* Boston, MA 02111-1307, USA.
*/
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
#include <ctype.h>
#include <stdio.h>
#include <string.h>
#include <glib.h>
+#include <gal/unicode/gunicode.h>
#include "e-html-utils.h"
diff --git a/e-util/e-i18n.h b/e-util/e-i18n.h
deleted file mode 100644
index 2bc8b93a04..0000000000
--- a/e-util/e-i18n.h
+++ /dev/null
@@ -1,75 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-i18n.h
- * Copyright 2000, 2001, Ximian, Inc.
- *
- * Authors:
- * Chris Lahey <clahey@ximian.com>
- *
- * Copied from gnome-i18nP.h, because this header is typically not installed
- *
- * This file has to be included before any file from the GNOME libraries
- * to have this override the definitions that are pulled from the gnome-i18n.h
- *
- * the difference is that gnome-i18n.h is used for applications, and this is
- * used by libraries (because libraries have to use dcgettext instead of
- * gettext and they need to provide the translation domain, unlike apps).
- *
- * So you can just put this after you include config.h
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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.
- */
-
-#ifndef __E_I18N_H__
-#define __E_I18N_H__
-
-#include <libgnome/gnome-i18n.h>
-
-G_BEGIN_DECLS
-
-#ifdef ENABLE_NLS
- /* this function is defined in e-util.c */
- extern char *e_gettext (const char *msgid);
-# undef _
-# ifdef GNOME_EXPLICIT_TRANSLATION_DOMAIN
-# define _(String) dgettext (GNOME_EXPLICIT_TRANSLATION_DOMAIN, String)
-/* No parentheses allowed here since that breaks string concatenation. */
-# define E_I18N_DOMAIN GNOME_EXPLICIT_TRANSLATION_DOMAIN
-# else
-# define _(String) dgettext (PACKAGE, String)
-/* No parentheses allowed here since that breaks string concatenation. */
-# define E_I18N_DOMAIN PACKAGE
-# endif
-# ifdef gettext_noop
-# define N_(String) gettext_noop (String)
-# else
-# define N_(String) (String)
-# endif
-#else
-/* Stubs that do something close enough. */
-# define textdomain(String) (String)
-# define gettext(String) (String)
-# define dgettext(Domain,Message) (Message)
-# define dcgettext(Domain,Message,Type) (Message)
-# define bindtextdomain(Domain,Directory) (Domain)
-# define _(String) (String)
-# define N_(String) (String)
-/* No parentheses allowed here since that breaks string concatenation. */
-# define E_I18N_DOMAIN ""
-#endif
-
-G_END_DECLS
-
-#endif /* __E_I18N_H__ */
diff --git a/e-util/e-iconv.c b/e-util/e-iconv.c
deleted file mode 100644
index 9c33209012..0000000000
--- a/e-util/e-iconv.c
+++ /dev/null
@@ -1,610 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-iconv.c
- * Copyright 2000, 2001, Ximian, Inc.
- *
- * Authors:
- * Michael Zucchi <notzed@ximian.com>
- * Jeffery Stedfast <fejj@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <errno.h>
-
-#include <glib.h>
-#include "e-iconv.h"
-
-#include <locale.h>
-
-#ifdef HAVE_CODESET
-#include <langinfo.h>
-#endif
-
-#include "iconv-detect.h"
-
-#define cd(x)
-
-#ifdef G_THREADS_ENABLED
-static GStaticMutex lock = G_STATIC_MUTEX_INIT;
-#define LOCK() g_static_mutex_lock(&lock)
-#define UNLOCK() g_static_mutex_unlock(&lock)
-#else
-#define LOCK()
-#define UNLOCK()
-#endif
-
-typedef struct _EDListNode {
- struct _EDListNode *next;
- struct _EDListNode *prev;
-} EDListNode;
-
-typedef struct _EDList {
- struct _EDListNode *head;
- struct _EDListNode *tail;
- struct _EDListNode *tailpred;
-} EDList;
-
-#define E_DLIST_INITIALISER(l) { (EDListNode *)&l.tail, 0, (EDListNode *)&l.head }
-
-struct _iconv_cache_node {
- struct _iconv_cache_node *next;
- struct _iconv_cache_node *prev;
-
- struct _iconv_cache *parent;
-
- int busy;
- iconv_t ip;
-};
-
-struct _iconv_cache {
- struct _iconv_cache *next;
- struct _iconv_cache *prev;
-
- char *conv;
-
- EDList open; /* stores iconv_cache_nodes, busy ones up front */
-};
-
-#define E_ICONV_CACHE_SIZE (16)
-
-static EDList iconv_cache_list;
-static GHashTable *iconv_cache;
-static GHashTable *iconv_cache_open;
-static unsigned int iconv_cache_size = 0;
-
-static GHashTable *iconv_charsets = NULL;
-static char *locale_charset = NULL;
-static char *locale_lang = NULL;
-
-struct {
- char *charset;
- char *iconv_name;
-} known_iconv_charsets[] = {
-#if 0
- /* charset name, iconv-friendly charset name */
- { "iso-8859-1", "iso-8859-1" },
- { "iso8859-1", "iso-8859-1" },
- /* the above mostly serves as an example for iso-style charsets,
- but we have code that will populate the iso-*'s if/when they
- show up in e_iconv_charset_name() so I'm
- not going to bother putting them all in here... */
- { "windows-cp1251", "cp1251" },
- { "windows-1251", "cp1251" },
- { "cp1251", "cp1251" },
- /* the above mostly serves as an example for windows-style
- charsets, but we have code that will parse and convert them
- to their cp#### equivalents if/when they show up in
- e_iconv_charset_name() so I'm not going to bother
- putting them all in here either... */
-#endif
- /* charset name (lowercase!), iconv-friendly name (sometimes case sensitive) */
- { "utf-8", "UTF-8" },
-
- /* 10646 is a special case, its usually UCS-2 big endian */
- /* This might need some checking but should be ok for solaris/linux */
- { "iso-10646-1", "UCS-2BE" },
- { "iso_10646-1", "UCS-2BE" },
- { "iso10646-1", "UCS-2BE" },
- { "iso-10646", "UCS-2BE" },
- { "iso_10646", "UCS-2BE" },
- { "iso10646", "UCS-2BE" },
-
- { "ks_c_5601-1987", "EUC-KR" },
-
- /* FIXME: Japanese/Korean/Chinese stuff needs checking */
- { "euckr-0", "EUC-KR" },
- { "5601", "EUC-KR" },
- { "big5-0", "BIG5" },
- { "big5.eten-0", "BIG5" },
- { "big5hkscs-0", "BIG5HKCS" },
- { "gb2312-0", "gb2312" },
- { "gb2312.1980-0", "gb2312" },
- { "gb-2312", "gb2312" },
- { "gb18030-0", "gb18030" },
- { "gbk-0", "GBK" },
-
- { "eucjp-0", "eucJP" },
- { "ujis-0", "ujis" },
- { "jisx0208.1983-0","SJIS" },
- { "jisx0212.1990-0","SJIS" },
- { "pck", "SJIS" },
- { NULL, NULL }
-};
-
-
-
-/* Another copy of this trivial list implementation
- Why? This stuff gets called a lot (potentially), should run fast,
- and g_list's are f@@#$ed up to make this a hassle */
-static void e_dlist_init(EDList *v)
-{
- v->head = (EDListNode *)&v->tail;
- v->tail = 0;
- v->tailpred = (EDListNode *)&v->head;
-}
-
-static EDListNode *e_dlist_addhead(EDList *l, EDListNode *n)
-{
- n->next = l->head;
- n->prev = (EDListNode *)&l->head;
- l->head->prev = n;
- l->head = n;
- return n;
-}
-
-static EDListNode *e_dlist_addtail(EDList *l, EDListNode *n)
-{
- n->next = (EDListNode *)&l->tail;
- n->prev = l->tailpred;
- l->tailpred->next = n;
- l->tailpred = n;
- return n;
-}
-
-static EDListNode *e_dlist_remove(EDListNode *n)
-{
- n->next->prev = n->prev;
- n->prev->next = n->next;
- return n;
-}
-
-
-/* fucking glib... */
-static const char *
-e_strdown (char *str)
-{
- register char *s = str;
-
- while (*s) {
- if (*s >= 'A' && *s <= 'Z')
- *s += 0x20;
- s++;
- }
-
- return str;
-}
-
-static const char *
-e_strup (char *str)
-{
- register char *s = str;
-
- while (*s) {
- if (*s >= 'a' && *s <= 'z')
- *s -= 0x20;
- s++;
- }
-
- return str;
-}
-
-
-static void
-locale_parse_lang (const char *locale)
-{
- char *codeset, *lang;
-
- if ((codeset = strchr (locale, '.')))
- lang = g_strndup (locale, codeset - locale);
- else
- lang = g_strdup (locale);
-
- /* validate the language */
- if (strlen (lang) >= 2) {
- if (lang[2] == '-' || lang[2] == '_') {
- /* canonicalise the lang */
- e_strdown (lang);
-
- /* validate the country code */
- if (strlen (lang + 3) > 2) {
- /* invalid country code */
- lang[2] = '\0';
- } else {
- lang[2] = '-';
- e_strup (lang + 3);
- }
- } else if (lang[2] != '\0') {
- /* invalid language */
- g_free (lang);
- lang = NULL;
- }
-
- locale_lang = lang;
- } else {
- /* invalid language */
- locale_lang = NULL;
- g_free (lang);
- }
-}
-
-/* NOTE: Owns the lock on return if keep is TRUE ! */
-static void
-e_iconv_init(int keep)
-{
- char *from, *to, *locale;
- int i;
-
- LOCK();
-
- if (iconv_charsets != NULL) {
- if (!keep)
- UNLOCK();
- return;
- }
-
- iconv_charsets = g_hash_table_new(g_str_hash, g_str_equal);
-
- for (i = 0; known_iconv_charsets[i].charset != NULL; i++) {
- from = g_strdup(known_iconv_charsets[i].charset);
- to = g_strdup(known_iconv_charsets[i].iconv_name);
- e_strdown (from);
- g_hash_table_insert(iconv_charsets, from, to);
- }
-
- e_dlist_init(&iconv_cache_list);
- iconv_cache = g_hash_table_new(g_str_hash, g_str_equal);
- iconv_cache_open = g_hash_table_new(NULL, NULL);
-
- locale = setlocale (LC_ALL, NULL);
-
- if (!locale || !strcmp (locale, "C") || !strcmp (locale, "POSIX")) {
- /* The locale "C" or "POSIX" is a portable locale; its
- * LC_CTYPE part corresponds to the 7-bit ASCII character
- * set.
- */
-
- locale_charset = NULL;
- locale_lang = NULL;
- } else {
-#ifdef HAVE_CODESET
- locale_charset = g_strdup (nl_langinfo (CODESET));
- e_strdown (locale_charset);
-#else
- /* A locale name is typically of the form language[_terri-
- * tory][.codeset][@modifier], where language is an ISO 639
- * language code, territory is an ISO 3166 country code, and
- * codeset is a character set or encoding identifier like
- * ISO-8859-1 or UTF-8.
- */
- char *codeset, *p;
-
- codeset = strchr (locale, '.');
- if (codeset) {
- codeset++;
-
- /* ; is a hack for debian systems and / is a hack for Solaris systems */
- for (p = codeset; *p && !strchr ("@;/", *p); p++);
- locale_charset = g_strndup (codeset, p - codeset);
- e_strdown (locale_charset);
- } else {
- /* charset unknown */
- locale_charset = NULL;
- }
-#endif
-
- /* parse the locale lang */
- locale_parse_lang (locale);
-
- }
-
- if (!keep)
- UNLOCK();
-}
-
-const char *e_iconv_charset_name(const char *charset)
-{
- char *name, *ret, *tmp;
-
- if (charset == NULL)
- return NULL;
-
- name = g_alloca (strlen (charset) + 1);
- strcpy (name, charset);
- e_strdown (name);
-
- e_iconv_init(TRUE);
- ret = g_hash_table_lookup(iconv_charsets, name);
- if (ret != NULL) {
- UNLOCK();
- return ret;
- }
-
- /* Unknown, try canonicalise some basic charset types to something that should work */
- if (strncmp(name, "iso", 3) == 0) {
- /* Convert iso-nnnn-n or isonnnn-n or iso_nnnn-n to iso-nnnn-n or isonnnn-n */
- int iso, codepage;
- char *p;
-
- tmp = name + 3;
- if (*tmp == '-' || *tmp == '_')
- tmp++;
-
- iso = strtoul (tmp, &p, 10);
-
- if (iso == 10646) {
- /* they all become ICONV_10646 */
- ret = g_strdup (ICONV_10646);
- } else {
- tmp = p;
- if (*tmp == '-' || *tmp == '_')
- tmp++;
-
- codepage = strtoul (tmp, &p, 10);
-
- if (p > tmp) {
- /* codepage is numeric */
-#ifdef __aix__
- if (codepage == 13)
- ret = g_strdup ("IBM-921");
- else
-#endif /* __aix__ */
- ret = g_strdup_printf (ICONV_ISO_D_FORMAT, iso, codepage);
- } else {
- /* codepage is a string - probably iso-2022-jp or something */
- ret = g_strdup_printf (ICONV_ISO_S_FORMAT, iso, p);
- }
- }
- } else if (strncmp(name, "windows-", 8) == 0) {
- /* Convert windows-nnnnn or windows-cpnnnnn to cpnnnn */
- tmp = name+8;
- if (!strncmp(tmp, "cp", 2))
- tmp+=2;
- ret = g_strdup_printf("CP%s", tmp);
- } else if (strncmp(name, "microsoft-", 10) == 0) {
- /* Convert microsoft-nnnnn or microsoft-cpnnnnn to cpnnnn */
- tmp = name+10;
- if (!strncmp(tmp, "cp", 2))
- tmp+=2;
- ret = g_strdup_printf("CP%s", tmp);
- } else {
- /* Just assume its ok enough as is, case and all */
- ret = g_strdup(charset);
- }
-
- g_hash_table_insert(iconv_charsets, g_strdup(name), ret);
- UNLOCK();
-
- return ret;
-}
-
-static void
-flush_entry(struct _iconv_cache *ic)
-{
- struct _iconv_cache_node *in, *nn;
-
- in = (struct _iconv_cache_node *)ic->open.head;
- nn = in->next;
- while (nn) {
- if (in->ip != (iconv_t)-1) {
- g_hash_table_remove(iconv_cache_open, in->ip);
- iconv_close(in->ip);
- }
- g_free(in);
- in = nn;
- nn = in->next;
- }
- g_free(ic->conv);
- g_free(ic);
-}
-
-/* This should run pretty quick, its called a lot */
-iconv_t e_iconv_open(const char *oto, const char *ofrom)
-{
- const char *to, *from;
- char *tofrom;
- struct _iconv_cache *ic;
- struct _iconv_cache_node *in;
- int errnosav;
- iconv_t ip;
-
- if (oto == NULL || ofrom == NULL) {
- errno = EINVAL;
- return (iconv_t) -1;
- }
-
- to = e_iconv_charset_name (oto);
- from = e_iconv_charset_name (ofrom);
- tofrom = g_alloca (strlen (to) + strlen (from) + 2);
- sprintf(tofrom, "%s%%%s", to, from);
-
- LOCK();
-
- ic = g_hash_table_lookup(iconv_cache, tofrom);
- if (ic) {
- e_dlist_remove((EDListNode *)ic);
- } else {
- struct _iconv_cache *last = (struct _iconv_cache *)iconv_cache_list.tailpred;
- struct _iconv_cache *prev;
-
- prev = last->prev;
- while (prev && iconv_cache_size > E_ICONV_CACHE_SIZE) {
- in = (struct _iconv_cache_node *)last->open.head;
- if (in->next && !in->busy) {
- cd(printf("Flushing iconv converter '%s'\n", last->conv));
- e_dlist_remove((EDListNode *)last);
- g_hash_table_remove(iconv_cache, last->conv);
- flush_entry(last);
- iconv_cache_size--;
- }
- last = prev;
- prev = last->prev;
- }
-
- iconv_cache_size++;
-
- ic = g_malloc(sizeof(*ic));
- e_dlist_init(&ic->open);
- ic->conv = g_strdup(tofrom);
- g_hash_table_insert(iconv_cache, ic->conv, ic);
-
- cd(printf("Creating iconv converter '%s'\n", ic->conv));
- }
- e_dlist_addhead(&iconv_cache_list, (EDListNode *)ic);
-
- /* If we have a free iconv, use it */
- in = (struct _iconv_cache_node *)ic->open.tailpred;
- if (in->prev && !in->busy) {
- cd(printf("using existing iconv converter '%s'\n", ic->conv));
- ip = in->ip;
- if (ip != (iconv_t)-1) {
- /* work around some broken iconv implementations
- * that die if the length arguments are NULL
- */
- size_t buggy_iconv_len = 0;
- char *buggy_iconv_buf = NULL;
-
- /* resets the converter */
- iconv(ip, &buggy_iconv_buf, &buggy_iconv_len, &buggy_iconv_buf, &buggy_iconv_len);
- in->busy = TRUE;
- e_dlist_remove((EDListNode *)in);
- e_dlist_addhead(&ic->open, (EDListNode *)in);
- }
- } else {
- cd(printf("creating new iconv converter '%s'\n", ic->conv));
- ip = iconv_open(to, from);
- in = g_malloc(sizeof(*in));
- in->ip = ip;
- in->parent = ic;
- e_dlist_addhead(&ic->open, (EDListNode *)in);
- if (ip != (iconv_t)-1) {
- g_hash_table_insert(iconv_cache_open, ip, in);
- in->busy = TRUE;
- } else {
- errnosav = errno;
- g_warning("Could not open converter for '%s' to '%s' charset", from, to);
- in->busy = FALSE;
- errno = errnosav;
- }
- }
-
- UNLOCK();
-
- return ip;
-}
-
-size_t e_iconv(iconv_t cd, const char **inbuf, size_t *inbytesleft, char ** outbuf, size_t *outbytesleft)
-{
- return iconv(cd, (char **) inbuf, inbytesleft, outbuf, outbytesleft);
-}
-
-void
-e_iconv_close(iconv_t ip)
-{
- struct _iconv_cache_node *in;
-
- if (ip == (iconv_t)-1)
- return;
-
- LOCK();
- in = g_hash_table_lookup(iconv_cache_open, ip);
- if (in) {
- cd(printf("closing iconv converter '%s'\n", in->parent->conv));
- e_dlist_remove((EDListNode *)in);
- in->busy = FALSE;
- e_dlist_addtail(&in->parent->open, (EDListNode *)in);
- } else {
- g_warning("trying to close iconv i dont know about: %p", ip);
- iconv_close(ip);
- }
- UNLOCK();
-
-}
-
-const char *e_iconv_locale_charset(void)
-{
- e_iconv_init(FALSE);
-
- return locale_charset;
-}
-
-
-const char *
-e_iconv_locale_language (void)
-{
- e_iconv_init (FALSE);
-
- return locale_lang;
-}
-
-/* map CJKR charsets to their language code */
-/* NOTE: only support charset names that will be returned by
- * e_iconv_charset_name() so that we don't have to keep track of all
- * the aliases too. */
-static struct {
- char *charset;
- char *lang;
-} cjkr_lang_map[] = {
- { "Big5", "zh" },
- { "BIG5HKCS", "zh" },
- { "gb2312", "zh" },
- { "gb18030", "zh" },
- { "gbk", "zh" },
- { "euc-tw", "zh" },
- { "iso-2022-jp", "ja" },
- { "sjis", "ja" },
- { "ujis", "ja" },
- { "eucJP", "ja" },
- { "euc-jp", "ja" },
- { "euc-kr", "ko" },
- { "koi8-r", "ru" },
- { "koi8-u", "uk" }
-};
-
-#define NUM_CJKR_LANGS (sizeof (cjkr_lang_map) / sizeof (cjkr_lang_map[0]))
-
-const char *
-e_iconv_charset_language (const char *charset)
-{
- int i;
-
- if (!charset)
- return NULL;
-
- charset = e_iconv_charset_name (charset);
- for (i = 0; i < NUM_CJKR_LANGS; i++) {
- if (!strcasecmp (cjkr_lang_map[i].charset, charset))
- return cjkr_lang_map[i].lang;
- }
-
- return NULL;
-}
diff --git a/e-util/e-iconv.h b/e-util/e-iconv.h
deleted file mode 100644
index 14b93853d5..0000000000
--- a/e-util/e-iconv.h
+++ /dev/null
@@ -1,49 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-iconv.h
- * Copyright 2000, 2001, Ximian, Inc.
- *
- * Authors:
- * Michael Zucchi <notzed@ximian.com>
- * Jeffrey Stedfast <fejj@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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.
- */
-
-#ifndef _E_ICONV_H_
-#define _E_ICONV_H_
-
-#include <iconv.h>
-
-#ifdef __cplusplus
-extern "C" {
-#pragma }
-#endif /* __cplusplus */
-
-const char *e_iconv_charset_name(const char *charset);
-iconv_t e_iconv_open(const char *oto, const char *ofrom);
-size_t e_iconv(iconv_t cd, const char **inbuf, size_t *inbytesleft, char ** outbuf, size_t *outbytesleft);
-void e_iconv_close(iconv_t ip);
-const char *e_iconv_locale_charset(void);
-
-/* languages */
-const char *e_iconv_locale_language (void);
-const char *e_iconv_charset_language (const char *charset);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* !_E_ICONV_H_ */
diff --git a/e-util/e-lang-utils.c b/e-util/e-lang-utils.c
index 564b4a353d..649a8cc887 100644
--- a/e-util/e-lang-utils.c
+++ b/e-util/e-lang-utils.c
@@ -35,6 +35,7 @@ e_get_language_list (void)
GSList *list = NULL;
const char *env;
const char *p;
+ char *lang;
env = g_getenv ("LANGUAGE");
if (env == NULL) {
diff --git a/e-util/e-msgport.c b/e-util/e-msgport.c
index 03c12c8847..34a6391ad7 100644
--- a/e-util/e-msgport.c
+++ b/e-util/e-msgport.c
@@ -906,27 +906,6 @@ void e_mutex_assert_locked(EMutex *m)
pthread_mutex_unlock(&m->mutex);
}
-int e_mutex_cond_wait(void *vcond, EMutex *m)
-{
- int ret;
- pthread_cond_t *cond = vcond;
-
- switch(m->type) {
- case E_MUTEX_SIMPLE:
- return pthread_cond_wait(cond, &m->mutex);
- case E_MUTEX_REC:
- if (pthread_mutex_lock(&m->mutex) == -1)
- return -1;
- g_assert(m->owner == pthread_self());
- ret = pthread_cond_wait(cond, &m->mutex);
- g_assert(m->owner == pthread_self());
- pthread_mutex_unlock(&m->mutex);
- return ret;
- default:
- g_return_val_if_reached(-1);
- }
-}
-
#ifdef STANDALONE
EMsgPort *server_port;
diff --git a/e-util/e-msgport.h b/e-util/e-msgport.h
index 8d4e0c20f7..6fc01efb14 100644
--- a/e-util/e-msgport.h
+++ b/e-util/e-msgport.h
@@ -82,7 +82,5 @@ int e_mutex_destroy(EMutex *m);
int e_mutex_lock(EMutex *m);
int e_mutex_unlock(EMutex *m);
void e_mutex_assert_locked(EMutex *m);
-/* this uses pthread cond's */
-int e_mutex_cond_wait(void *cond, EMutex *m);
#endif
diff --git a/e-util/e-pilot-settings.h b/e-util/e-pilot-settings.h
index 908f9e1836..6fe5eedc52 100644
--- a/e-util/e-pilot-settings.h
+++ b/e-util/e-pilot-settings.h
@@ -24,11 +24,7 @@
#ifndef _E_PILOT_SETTINGS_H_
#define _E_PILOT_SETTINGS_H_
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <gtk/gtk.h>
+#include <gnome.h>
#ifdef __cplusplus
extern "C" {
@@ -36,10 +32,10 @@ extern "C" {
#endif /* __cplusplus */
#define E_TYPE_PILOT_SETTINGS (e_pilot_settings_get_type ())
-#define E_PILOT_SETTINGS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), E_TYPE_PILOT_SETTINGS, EPilotSettings))
-#define E_PILOT_SETTINGS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), E_TYPE_PILOT_SETTINGS, EPilotSettingsClass))
-#define E_IS_PILOT_SETTINGS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), E_TYPE_PILOT_SETTINGS))
-#define E_IS_PILOT_SETTINGS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), E_TYPE_PILOT_SETTINGS))
+#define E_PILOT_SETTINGS(obj) (GTK_CHECK_CAST ((obj), E_TYPE_PILOT_SETTINGS, EPilotSettings))
+#define E_PILOT_SETTINGS_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), E_TYPE_PILOT_SETTINGS, EPilotSettingsClass))
+#define E_IS_PILOT_SETTINGS(obj) (GTK_CHECK_TYPE ((obj), E_TYPE_PILOT_SETTINGS))
+#define E_IS_PILOT_SETTINGS_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((obj), E_TYPE_PILOT_SETTINGS))
typedef struct _EPilotSettings EPilotSettings;
@@ -60,7 +56,7 @@ struct _EPilotSettingsClass {
};
-GType e_pilot_settings_get_type (void);
+GtkType e_pilot_settings_get_type (void);
GtkWidget *e_pilot_settings_new (void);
gboolean e_pilot_settings_get_secret (EPilotSettings *ps);
diff --git a/e-util/e-proxy.c b/e-util/e-proxy.c
index f47231c84c..8fbabd28e3 100644
--- a/e-util/e-proxy.c
+++ b/e-util/e-proxy.c
@@ -41,20 +41,40 @@ set_proxy (GConfClient *client)
char *proxy_server, *proxy_user, *proxy_pw, *uri;
gboolean use_auth, use_proxy;
int proxy_port;
-
- use_proxy = gconf_client_get_bool (client, "/system/http_proxy/use_http_proxy", NULL);
+ gboolean new_proxy_exists;
+
+ new_proxy_exists = gconf_client_dir_exists (client, "/system/http_proxy", NULL);
+
+ if (new_proxy_exists) {
+ use_proxy = gconf_client_get_bool (client, "/system/http_proxy/use_http_proxy", NULL);
+ } else {
+ use_proxy = gconf_client_get_bool (client, "/system/gnome-vfs/use-http-proxy", NULL);
+ }
+
if (use_proxy == FALSE) {
return;
}
+
+ if (new_proxy_exists) {
+ proxy_server = gconf_client_get_string (client, "/system/http_proxy/host", NULL);
+ proxy_port = gconf_client_get_int (client, "/system/http_proxy/port", NULL);
+
+ use_auth = gconf_client_get_bool (client, "/system/http_proxy/use_authentication", NULL);
+ } else {
+ proxy_server = gconf_client_get_string (client, "/system/gnome-vfs/http-proxy-host", NULL);
+ proxy_port = gconf_client_get_int (client, "/system/gnome-vfs/http-proxy-port", NULL);
- proxy_server = gconf_client_get_string (client, "/system/http_proxy/host", NULL);
- proxy_port = gconf_client_get_int (client, "/system/http_proxy/port", NULL);
-
- use_auth = gconf_client_get_bool (client, "/system/http_proxy/use_authentication", NULL);
+ use_auth = gconf_client_get_bool (client, "/system/gnome-vfs/use-http-proxy-authorization", NULL);
+ }
+
if (use_auth == TRUE) {
- proxy_user = gconf_client_get_string (client, "/system/http_proxy/authentication_user", NULL);
- proxy_pw = gconf_client_get_string (client, "/system/http_proxy/authentication_password", NULL);
-
+ if (new_proxy_exists) {
+ proxy_user = gconf_client_get_string (client, "/system/http_proxy/authentication_user", NULL);
+ proxy_pw = gconf_client_get_string (client, "/system/http_proxy/authentication_password", NULL);
+ } else {
+ proxy_user = gconf_client_get_string (client, "/system/gnome-vfs/http-proxy-authorization-user", NULL);
+ proxy_pw = gconf_client_get_string (client, "/system/gnome-vfs/http-proxy-authorization-password", NULL);
+ }
uri = g_strdup_printf ("http://%s:%s@%s:%d", proxy_user, proxy_pw, proxy_server, proxy_port);
} else {
uri = g_strdup_printf ("http://%s:%d", proxy_server, proxy_port);
@@ -77,7 +97,8 @@ void
e_proxy_init ()
{
GConfClient *client;
-
+ gboolean new_proxy_exists;
+
/* We get the gnome-vfs proxy keys here
set soup up to use the proxy,
and listen to any changes */
@@ -85,12 +106,22 @@ e_proxy_init ()
if (!(client = gconf_client_get_default ()))
return;
+ new_proxy_exists = gconf_client_dir_exists (client, "/system/http_proxy", NULL);
+
/* Listen to the changes in the gnome-vfs path */
- gconf_client_add_dir (client, "/system/http_proxy",
- GCONF_CLIENT_PRELOAD_ONELEVEL, NULL);
-
- gconf_client_notify_add (client, "/system/http_proxy/",
- proxy_setting_changed, NULL, NULL, NULL);
+ if (new_proxy_exists) {
+ gconf_client_add_dir (client, "/system/http_proxy",
+ GCONF_CLIENT_PRELOAD_ONELEVEL, NULL);
+ gconf_client_notify_add (client, "/system/http_proxy/",
+ proxy_setting_changed, NULL,
+ NULL, NULL);
+ } else {
+ gconf_client_add_dir (client, "/system/gnome-vfs",
+ GCONF_CLIENT_PRELOAD_ONELEVEL, NULL);
+ gconf_client_notify_add (client, "/system/gnome-vfs/",
+ proxy_setting_changed, NULL,
+ NULL, NULL);
+ }
set_proxy (client);
}
diff --git a/e-util/e-sorter-array.c b/e-util/e-sorter-array.c
deleted file mode 100644
index ab1e748d9a..0000000000
--- a/e-util/e-sorter-array.c
+++ /dev/null
@@ -1,259 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-sorter-array.c
- * Copyright 2000, 2001, Ximian, Inc.
- *
- * Authors:
- * Chris Lahey <clahey@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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 <stdlib.h>
-#include <string.h>
-#include "gal/util/e-util.h"
-#include "e-sorter-array.h"
-
-#define d(x)
-
-#define PARENT_TYPE E_SORTER_TYPE
-
-#define INCREMENT_AMOUNT 100
-
-static ESorterClass *parent_class;
-
-static void esa_sort (ESorterArray *esa);
-static void esa_backsort (ESorterArray *esa);
-
-static gint esa_model_to_sorted (ESorter *sorter, int row);
-static gint esa_sorted_to_model (ESorter *sorter, int row);
-static void esa_get_model_to_sorted_array (ESorter *sorter, int **array, int *count);
-static void esa_get_sorted_to_model_array (ESorter *sorter, int **array, int *count);
-static gboolean esa_needs_sorting (ESorter *esa);
-
-#define ESA_NEEDS_SORTING(esa) (((ESorterArray *) (esa))->compare != NULL)
-
-static int
-esort_callback(const void *data1, const void *data2, gpointer user_data)
-{
- ESorterArray *esa = user_data;
- int ret_val;
- int int1, int2;
-
- int1 = *(int *)data1;
- int2 = *(int *)data2;
-
- ret_val = esa->compare (int1, int2, esa->closure);
- if (ret_val != 0)
- return ret_val;
-
- if (int1 < int2)
- return -1;
- if (int1 > int2)
- return 1;
- return 0;
-}
-
-static void
-esa_sort(ESorterArray *esa)
-{
- int rows;
- int i;
-
- if (esa->sorted)
- return;
-
- rows = esa->rows;
-
- esa->sorted = g_new(int, rows);
- for (i = 0; i < rows; i++)
- esa->sorted[i] = i;
-
- if (esa->compare)
- e_sort (esa->sorted, rows, sizeof(int), esort_callback, esa);
-}
-
-static void
-esa_backsort(ESorterArray *esa)
-{
- int i, rows;
-
- if (esa->backsorted)
- return;
-
- esa_sort(esa);
-
- rows = esa->rows;
-
- esa->backsorted = g_new0(int, rows);
-
- for (i = 0; i < rows; i++) {
- esa->backsorted[esa->sorted[i]] = i;
- }
-}
-
-
-static gint
-esa_model_to_sorted (ESorter *es, int row)
-{
- ESorterArray *esa = E_SORTER_ARRAY(es);
-
- g_return_val_if_fail(row >= 0, -1);
- g_return_val_if_fail(row < esa->rows, -1);
-
- if (ESA_NEEDS_SORTING(es))
- esa_backsort(esa);
-
- if (esa->backsorted)
- return esa->backsorted[row];
- else
- return row;
-}
-
-static gint
-esa_sorted_to_model (ESorter *es, int row)
-{
- ESorterArray *esa = (ESorterArray *) es;
-
- g_return_val_if_fail(row >= 0, -1);
- g_return_val_if_fail(row < esa->rows, -1);
-
- if (ESA_NEEDS_SORTING(es))
- esa_sort(esa);
-
- if (esa->sorted)
- return esa->sorted[row];
- else
- return row;
-}
-
-static void
-esa_get_model_to_sorted_array (ESorter *es, int **array, int *count)
-{
- ESorterArray *esa = E_SORTER_ARRAY(es);
- if (array || count) {
- esa_backsort(esa);
-
- if (array)
- *array = esa->backsorted;
- if (count)
- *count = esa->rows;
- }
-}
-
-static void
-esa_get_sorted_to_model_array (ESorter *es, int **array, int *count)
-{
- ESorterArray *esa = E_SORTER_ARRAY(es);
- if (array || count) {
- esa_sort(esa);
-
- if (array)
- *array = esa->sorted;
- if (count)
- *count = esa->rows;
- }
-}
-
-static gboolean
-esa_needs_sorting(ESorter *es)
-{
- ESorterArray *esa = E_SORTER_ARRAY(es);
- return esa->compare != NULL;
-}
-
-void
-e_sorter_array_clean(ESorterArray *esa)
-{
- g_free(esa->sorted);
- esa->sorted = NULL;
-
- g_free(esa->backsorted);
- esa->backsorted = NULL;
-}
-
-void
-e_sorter_array_set_count (ESorterArray *esa, int count)
-{
- e_sorter_array_clean (esa);
- esa->rows = count;
-}
-
-void
-e_sorter_array_append (ESorterArray *esa, int count)
-{
- int i;
- g_free(esa->backsorted);
- esa->backsorted = NULL;
-
- if (esa->sorted) {
- esa->sorted = g_renew(int, esa->sorted, esa->rows + count);
- for (i = 0; i < count; i++) {
- int value = esa->rows;
- size_t pos;
- e_bsearch (&value, esa->sorted, esa->rows, sizeof (int), esort_callback, esa, &pos, NULL);
- memmove (esa->sorted + pos + 1, esa->sorted + pos, sizeof (int) * (esa->rows - pos));
- esa->sorted[pos] = value;
- esa->rows ++;
- }
- } else {
- esa->rows += count;
- }
-}
-
-ESorterArray *
-e_sorter_array_construct (ESorterArray *esa,
- ECompareRowsFunc compare,
- gpointer closure)
-{
- esa->compare = compare;
- esa->closure = closure;
- return esa;
-}
-
-ESorterArray *
-e_sorter_array_new (ECompareRowsFunc compare, gpointer closure)
-{
- ESorterArray *esa = g_object_new (E_SORTER_ARRAY_TYPE, NULL);
-
- return e_sorter_array_construct (esa, compare, closure);
-}
-
-static void
-esa_class_init (ESorterArrayClass *klass)
-{
- ESorterClass *sorter_class = E_SORTER_CLASS(klass);
-
- parent_class = g_type_class_ref (PARENT_TYPE);
-
- sorter_class->model_to_sorted = esa_model_to_sorted ;
- sorter_class->sorted_to_model = esa_sorted_to_model ;
- sorter_class->get_model_to_sorted_array = esa_get_model_to_sorted_array ;
- sorter_class->get_sorted_to_model_array = esa_get_sorted_to_model_array ;
- sorter_class->needs_sorting = esa_needs_sorting ;
-}
-
-static void
-esa_init (ESorterArray *esa)
-{
- esa->rows = 0;
- esa->compare = NULL;
- esa->closure = NULL;
- esa->sorted = NULL;
- esa->backsorted = NULL;
-}
-
-E_MAKE_TYPE(e_sorter_array, "ESorterArray", ESorterArray, esa_class_init, esa_init, PARENT_TYPE)
diff --git a/e-util/e-sorter-array.h b/e-util/e-sorter-array.h
deleted file mode 100644
index 227e437443..0000000000
--- a/e-util/e-sorter-array.h
+++ /dev/null
@@ -1,77 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-sorter-array.h
- * Copyright 2000, 2001, Ximian, Inc.
- *
- * Authors:
- * Chris Lahey <clahey@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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.
- */
-
-#ifndef _E_SORTER_ARRAY_H_
-#define _E_SORTER_ARRAY_H_
-
-#include <glib.h>
-#include <glib-object.h>
-#include <gal/util/e-sorter.h>
-
-G_BEGIN_DECLS
-
-#define E_SORTER_ARRAY_TYPE (e_sorter_array_get_type ())
-#define E_SORTER_ARRAY(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), E_SORTER_ARRAY_TYPE, ESorterArray))
-#define E_SORTER_ARRAY_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), E_SORTER_ARRAY_TYPE, ESorterArrayClass))
-#define E_IS_SORTER_ARRAY(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), E_SORTER_ARRAY_TYPE))
-#define E_IS_SORTER_ARRAY_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), E_SORTER_ARRAY_TYPE))
-
-#ifndef _E_COMPARE_ROWS_FUNC_H_
-#define _E_COMPARE_ROWS_FUNC_H_
-typedef int (*ECompareRowsFunc) (int row1,
- int row2,
- gpointer closure);
-#endif
-
-typedef struct {
- ESorter base;
-
- ECompareRowsFunc compare;
- gpointer closure;
-
- /* If needs_sorting is 0, then model_to_sorted and sorted_to_model are no-ops. */
- int *sorted;
- int *backsorted;
-
- int rows;
-} ESorterArray;
-
-typedef struct {
- ESorterClass parent_class;
-} ESorterArrayClass;
-
-GType e_sorter_array_get_type (void);
-ESorterArray *e_sorter_array_construct (ESorterArray *sorter,
- ECompareRowsFunc compare,
- gpointer closure);
-ESorterArray *e_sorter_array_new (ECompareRowsFunc compare,
- gpointer closure);
-void e_sorter_array_clean (ESorterArray *esa);
-void e_sorter_array_set_count (ESorterArray *esa,
- int count);
-void e_sorter_array_append (ESorterArray *esa,
- int count);
-
-G_END_DECLS
-
-#endif /* _E_SORTER_ARRAY_H_ */
diff --git a/e-util/e-sorter.c b/e-util/e-sorter.c
deleted file mode 100644
index adee6d0d98..0000000000
--- a/e-util/e-sorter.c
+++ /dev/null
@@ -1,153 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-sorter.c
- * Copyright 2000, 2001, Ximian, Inc.
- *
- * Authors:
- * Chris Lahey <clahey@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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 <stdlib.h>
-#include <string.h>
-#include "gal/util/e-util.h"
-#include "e-sorter.h"
-
-#define d(x)
-
-#define PARENT_TYPE G_TYPE_OBJECT
-
-static GObjectClass *parent_class;
-
-static gint es_model_to_sorted (ESorter *es, int row);
-static gint es_sorted_to_model (ESorter *es, int row);
-static void es_get_model_to_sorted_array (ESorter *es, int **array, int *count);
-static void es_get_sorted_to_model_array (ESorter *es, int **array, int *count);
-static gboolean es_needs_sorting(ESorter *es);
-
-static void
-es_class_init (ESorterClass *klass)
-{
- parent_class = g_type_class_ref (PARENT_TYPE);
-
- klass->model_to_sorted = es_model_to_sorted;
- klass->sorted_to_model = es_sorted_to_model;
- klass->get_model_to_sorted_array = es_get_model_to_sorted_array;
- klass->get_sorted_to_model_array = es_get_sorted_to_model_array;
- klass->needs_sorting = es_needs_sorting;
-}
-
-static void
-es_init (ESorter *es)
-{
-}
-
-E_MAKE_TYPE(e_sorter, "ESorter", ESorter, es_class_init, es_init, PARENT_TYPE)
-
-ESorter *
-e_sorter_new (void)
-{
- ESorter *es = g_object_new (E_SORTER_TYPE, NULL);
-
- return es;
-}
-
-
-static gint
-es_model_to_sorted (ESorter *es, int row)
-{
- return row;
-}
-
-static gint
-es_sorted_to_model (ESorter *es, int row)
-{
- return row;
-}
-
-
-static void
-es_get_model_to_sorted_array (ESorter *es, int **array, int *count)
-{
-}
-
-static void
-es_get_sorted_to_model_array (ESorter *es, int **array, int *count)
-{
-}
-
-
-static gboolean
-es_needs_sorting(ESorter *es)
-{
- return FALSE;
-}
-
-gint
-e_sorter_model_to_sorted (ESorter *es, int row)
-{
- g_return_val_if_fail(es != NULL, -1);
- g_return_val_if_fail(row >= 0, -1);
-
- if (E_SORTER_GET_CLASS(es)->model_to_sorted)
- return E_SORTER_GET_CLASS(es)->model_to_sorted (es, row);
- else
- return -1;
-}
-
-gint
-e_sorter_sorted_to_model (ESorter *es, int row)
-{
- g_return_val_if_fail(es != NULL, -1);
- g_return_val_if_fail(row >= 0, -1);
-
- if (E_SORTER_GET_CLASS(es)->sorted_to_model)
- return E_SORTER_GET_CLASS(es)->sorted_to_model (es, row);
- else
- return -1;
-}
-
-
-void
-e_sorter_get_model_to_sorted_array (ESorter *es, int **array, int *count)
-{
- g_return_if_fail(es != NULL);
-
- if (E_SORTER_GET_CLASS(es)->get_model_to_sorted_array)
- E_SORTER_GET_CLASS(es)->get_model_to_sorted_array (es, array, count);
-}
-
-void
-e_sorter_get_sorted_to_model_array (ESorter *es, int **array, int *count)
-{
- g_return_if_fail(es != NULL);
-
- if (E_SORTER_GET_CLASS(es)->get_sorted_to_model_array)
- E_SORTER_GET_CLASS(es)->get_sorted_to_model_array (es, array, count);
-}
-
-
-gboolean
-e_sorter_needs_sorting(ESorter *es)
-{
- g_return_val_if_fail (es != NULL, FALSE);
-
- if (E_SORTER_GET_CLASS(es)->needs_sorting)
- return E_SORTER_GET_CLASS(es)->needs_sorting (es);
- else
- return FALSE;
-}
diff --git a/e-util/e-sorter.h b/e-util/e-sorter.h
deleted file mode 100644
index a70c2bd2d7..0000000000
--- a/e-util/e-sorter.h
+++ /dev/null
@@ -1,82 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-sorter.h
- * Copyright 2000, 2001, Ximian, Inc.
- *
- * Authors:
- * Chris Lahey <clahey@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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.
- */
-
-#ifndef _E_SORTER_H_
-#define _E_SORTER_H_
-
-#include <glib-object.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
-
-#define E_SORTER_TYPE (e_sorter_get_type ())
-#define E_SORTER(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), E_SORTER_TYPE, ESorter))
-#define E_SORTER_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), E_SORTER_TYPE, ESorterClass))
-#define E_IS_SORTER(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), E_SORTER_TYPE))
-#define E_IS_SORTER_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), E_SORTER_TYPE))
-#define E_SORTER_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), E_SORTER_TYPE, ESorterClass))
-
-typedef struct {
- GObject base;
-} ESorter;
-
-typedef struct {
- GObjectClass parent_class;
- gint (*model_to_sorted) (ESorter *sorter,
- int row);
- gint (*sorted_to_model) (ESorter *sorter,
- int row);
-
- void (*get_model_to_sorted_array) (ESorter *sorter,
- int **array,
- int *count);
- void (*get_sorted_to_model_array) (ESorter *sorter,
- int **array,
- int *count);
-
- gboolean (*needs_sorting) (ESorter *sorter);
-} ESorterClass;
-
-GType e_sorter_get_type (void);
-ESorter *e_sorter_new (void);
-
-gint e_sorter_model_to_sorted (ESorter *sorter,
- int row);
-gint e_sorter_sorted_to_model (ESorter *sorter,
- int row);
-
-void e_sorter_get_model_to_sorted_array (ESorter *sorter,
- int **array,
- int *count);
-void e_sorter_get_sorted_to_model_array (ESorter *sorter,
- int **array,
- int *count);
-
-gboolean e_sorter_needs_sorting (ESorter *sorter);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* _E_SORTER_H_ */
diff --git a/e-util/e-text-event-processor-emacs-like.c b/e-util/e-text-event-processor-emacs-like.c
deleted file mode 100644
index 9cda8f1677..0000000000
--- a/e-util/e-text-event-processor-emacs-like.c
+++ /dev/null
@@ -1,489 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-text-event-processor-emacs-like.c
- * Copyright 2000, 2001, Ximian, Inc.
- *
- * Authors:
- * Chris Lahey <clahey@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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 <string.h>
-#include <gdk/gdkkeysyms.h>
-#include <gal/util/e-util.h>
-#include "e-text-event-processor-emacs-like.h"
-
-static void e_text_event_processor_emacs_like_init (ETextEventProcessorEmacsLike *card);
-static void e_text_event_processor_emacs_like_class_init (ETextEventProcessorEmacsLikeClass *klass);
-static gint e_text_event_processor_emacs_like_event (ETextEventProcessor *tep, ETextEventProcessorEvent *event);
-
-#define PARENT_TYPE E_TEXT_EVENT_PROCESSOR_TYPE
-static ETextEventProcessorClass *parent_class = NULL;
-
-/* The arguments we take */
-enum {
- ARG_0
-};
-
-static const ETextEventProcessorCommand control_keys[26] =
-{
- { E_TEP_START_OF_LINE, E_TEP_MOVE, 0, "" }, /* a */
- { E_TEP_BACKWARD_CHARACTER, E_TEP_MOVE, 0, "" }, /* b */
- { E_TEP_SELECTION, E_TEP_COPY, 0, "" }, /* c */
- { E_TEP_FORWARD_CHARACTER, E_TEP_DELETE, 0, "" }, /* d */
- { E_TEP_END_OF_LINE, E_TEP_MOVE, 0, "" }, /* e */
- { E_TEP_FORWARD_CHARACTER, E_TEP_MOVE, 0, "" }, /* f */
- { E_TEP_SELECTION, E_TEP_NOP, 0, "" }, /* g */
- { E_TEP_BACKWARD_CHARACTER, E_TEP_DELETE, 0, "" }, /* h */
- { E_TEP_SELECTION, E_TEP_NOP, 0, "" }, /* i */
- { E_TEP_SELECTION, E_TEP_NOP, 0, "" }, /* j */
- { E_TEP_END_OF_LINE, E_TEP_DELETE, 0, "" }, /* k */
- { E_TEP_SELECTION, E_TEP_NOP, 0, "" }, /* l */
- { E_TEP_SELECTION, E_TEP_NOP, 0, "" }, /* m */
- { E_TEP_FORWARD_LINE, E_TEP_MOVE, 0, "" }, /* n */
- { E_TEP_SELECTION, E_TEP_NOP, 0, "" }, /* o */
- { E_TEP_BACKWARD_LINE, E_TEP_MOVE, 0, "" }, /* p */
- { E_TEP_SELECTION, E_TEP_NOP, 0, "" }, /* q */
- { E_TEP_SELECTION, E_TEP_NOP, 0, "" }, /* r */
- { E_TEP_SELECTION, E_TEP_NOP, 0, "" }, /* s */
- { E_TEP_SELECTION, E_TEP_NOP, 0, "" }, /* t */
- { E_TEP_START_OF_LINE, E_TEP_DELETE, 0, "" }, /* u */
- { E_TEP_SELECTION, E_TEP_PASTE, 0, "" }, /* v */
- { E_TEP_SELECTION, E_TEP_NOP, 0, "" }, /* w */
- { E_TEP_SELECTION, E_TEP_DELETE, 0, "" }, /* x */
- { E_TEP_SELECTION, E_TEP_PASTE, 0, "" }, /* y */
- { E_TEP_SELECTION, E_TEP_NOP, 0, "" } /* z */
-};
-
-static const ETextEventProcessorCommand alt_keys[26] =
-{
- { E_TEP_SELECTION, E_TEP_NOP, 0, "" }, /* a */
- { E_TEP_BACKWARD_WORD, E_TEP_MOVE, 0, "" }, /* b */
- { E_TEP_SELECTION, E_TEP_CAPS, E_TEP_CAPS_TITLE, "" },/* c */
- { E_TEP_FORWARD_WORD, E_TEP_DELETE, 0, "" }, /* d */
- { E_TEP_SELECTION, E_TEP_NOP, 0, "" }, /* e */
- { E_TEP_FORWARD_WORD, E_TEP_MOVE, 0, "" }, /* f */
- { E_TEP_SELECTION, E_TEP_NOP, 0, "" }, /* g */
- { E_TEP_SELECTION, E_TEP_NOP, 0, "" }, /* h */
- { E_TEP_SELECTION, E_TEP_NOP, 0, "" }, /* i */
- { E_TEP_SELECTION, E_TEP_NOP, 0, "" }, /* j */
- { E_TEP_SELECTION, E_TEP_NOP, 0, "" }, /* k */
- { E_TEP_SELECTION, E_TEP_CAPS, E_TEP_CAPS_LOWER, "" }, /* l */
- { E_TEP_SELECTION, E_TEP_NOP, 0, "" }, /* m */
- { E_TEP_SELECTION, E_TEP_NOP, 0, "" }, /* n */
- { E_TEP_SELECTION, E_TEP_NOP, 0, "" }, /* o */
- { E_TEP_SELECTION, E_TEP_NOP, 0, "" }, /* p */
- { E_TEP_SELECTION, E_TEP_NOP, 0, "" }, /* q */
- { E_TEP_SELECTION, E_TEP_NOP, 0, "" }, /* r */
- { E_TEP_SELECTION, E_TEP_NOP, 0, "" }, /* s */
- { E_TEP_SELECTION, E_TEP_NOP, 0, "" }, /* t */
- { E_TEP_SELECTION, E_TEP_CAPS, E_TEP_CAPS_UPPER, "" }, /* u */
- { E_TEP_SELECTION, E_TEP_NOP, 0, "" }, /* v */
- { E_TEP_SELECTION, E_TEP_NOP, 0, "" }, /* w */
- { E_TEP_SELECTION, E_TEP_NOP, 0, "" }, /* x */
- { E_TEP_SELECTION, E_TEP_NOP, 0, "" }, /* y */
- { E_TEP_SELECTION, E_TEP_NOP, 0, "" } /* z */
-
-};
-
-E_MAKE_TYPE (e_text_event_processor_emacs_like,
- "ETextEventProcessorEmacsLike",
- ETextEventProcessorEmacsLike,
- e_text_event_processor_emacs_like_class_init,
- e_text_event_processor_emacs_like_init,
- PARENT_TYPE)
-
-static void
-e_text_event_processor_emacs_like_class_init (ETextEventProcessorEmacsLikeClass *klass)
-{
- ETextEventProcessorClass *processor_class;
-
- processor_class = (ETextEventProcessorClass*) klass;
-
- parent_class = g_type_class_ref (PARENT_TYPE);
-
- processor_class->event = e_text_event_processor_emacs_like_event;
-}
-
-static void
-e_text_event_processor_emacs_like_init (ETextEventProcessorEmacsLike *tep)
-{
-}
-
-static gint
-e_text_event_processor_emacs_like_event (ETextEventProcessor *tep, ETextEventProcessorEvent *event)
-{
- ETextEventProcessorCommand command;
- ETextEventProcessorEmacsLike *tep_el = E_TEXT_EVENT_PROCESSOR_EMACS_LIKE(tep);
- command.action = E_TEP_NOP;
- switch (event->type) {
- case GDK_BUTTON_PRESS:
- if (event->button.button == 1) {
- command.action = E_TEP_GRAB;
- command.time = event->button.time;
- g_signal_emit_by_name (tep, "command", &command);
- if (event->button.state & GDK_SHIFT_MASK)
- command.action = E_TEP_SELECT;
- else
- command.action = E_TEP_MOVE;
- command.position = E_TEP_VALUE;
- command.value = event->button.position;
- command.time = event->button.time;
- tep_el->mouse_down = TRUE;
- }
- break;
- case GDK_2BUTTON_PRESS:
- if (event->button.button == 1) {
- command.action = E_TEP_SELECT;
- command.position = E_TEP_SELECT_WORD;
- command.time = event->button.time;
- }
- break;
- case GDK_3BUTTON_PRESS:
- if (event->button.button == 1) {
- command.action = E_TEP_SELECT;
- command.position = E_TEP_SELECT_ALL;
- command.time = event->button.time;
- }
- break;
- case GDK_BUTTON_RELEASE:
- if (event->button.button == 1) {
- command.action = E_TEP_UNGRAB;
- command.time = event->button.time;
- tep_el->mouse_down = FALSE;
- } else if (event->button.button == 2) {
- command.action = E_TEP_MOVE;
- command.position = E_TEP_VALUE;
- command.value = event->button.position;
- command.time = event->button.time;
- g_signal_emit_by_name (tep, "command", &command);
-
- command.action = E_TEP_GET_SELECTION;
- command.position = E_TEP_SELECTION;
- command.value = 0;
- command.time = event->button.time;
- }
- break;
- case GDK_MOTION_NOTIFY:
- if (tep_el->mouse_down) {
- command.action = E_TEP_SELECT;
- command.position = E_TEP_VALUE;
- command.time = event->motion.time;
- command.value = event->motion.position;
- }
- break;
- case GDK_KEY_PRESS:
- {
- ETextEventProcessorEventKey key = event->key;
- command.time = event->key.time;
- if (key.state & GDK_SHIFT_MASK)
- command.action = E_TEP_SELECT;
- else
- command.action = E_TEP_MOVE;
- switch(key.keyval) {
- case GDK_Home:
- case GDK_KP_Home:
- if (key.state & GDK_CONTROL_MASK)
- command.position = E_TEP_START_OF_BUFFER;
- else
- command.position = E_TEP_START_OF_LINE;
- break;
- case GDK_End:
- case GDK_KP_End:
- if (key.state & GDK_CONTROL_MASK)
- command.position = E_TEP_END_OF_BUFFER;
- else
- command.position = E_TEP_END_OF_LINE;
- break;
- case GDK_Page_Up:
- case GDK_KP_Page_Up: command.position = E_TEP_BACKWARD_PAGE; break;
-
- case GDK_Page_Down:
- case GDK_KP_Page_Down: command.position = E_TEP_FORWARD_PAGE; break;
- /* CUA has Ctrl-Up/Ctrl-Down as paragraph up down */
- case GDK_Up:
- case GDK_KP_Up: command.position = E_TEP_BACKWARD_LINE; break;
-
- case GDK_Down:
- case GDK_KP_Down: command.position = E_TEP_FORWARD_LINE; break;
-
- case GDK_Left:
- case GDK_KP_Left:
- if (key.state & GDK_CONTROL_MASK)
- command.position = E_TEP_BACKWARD_WORD;
- else
- command.position = E_TEP_BACKWARD_CHARACTER;
- break;
- case GDK_Right:
- case GDK_KP_Right:
- if (key.state & GDK_CONTROL_MASK)
- command.position = E_TEP_FORWARD_WORD;
- else
- command.position = E_TEP_FORWARD_CHARACTER;
- break;
-
- case GDK_BackSpace:
- command.action = E_TEP_DELETE;
- if (key.state & GDK_CONTROL_MASK)
- command.position = E_TEP_BACKWARD_WORD;
- else
- command.position = E_TEP_BACKWARD_CHARACTER;
- break;
- case GDK_Clear:
- command.action = E_TEP_DELETE;
- command.position = E_TEP_END_OF_LINE;
- break;
- case GDK_Insert:
- case GDK_KP_Insert:
- if (key.state & GDK_SHIFT_MASK) {
- command.action = E_TEP_PASTE;
- command.position = E_TEP_SELECTION;
- } else if (key.state & GDK_CONTROL_MASK) {
- command.action = E_TEP_COPY;
- command.position = E_TEP_SELECTION;
- } else {
- /* gtk_toggle_insert(text) -- IMPLEMENT -- FIXME */
- }
- break;
- case GDK_Delete:
- case GDK_KP_Delete:
- if (key.state & GDK_CONTROL_MASK){
- command.action = E_TEP_DELETE;
- command.position = E_TEP_FORWARD_WORD;
- } else if (key.state & GDK_SHIFT_MASK) {
- command.action = E_TEP_COPY;
- command.position = E_TEP_SELECTION;
- g_signal_emit_by_name (tep, "command", &command);
-
- command.action = E_TEP_DELETE;
- command.position = E_TEP_SELECTION;
- } else {
- command.action = E_TEP_DELETE;
- command.position = E_TEP_FORWARD_CHARACTER;
- }
- break;
- case GDK_Tab:
- case GDK_KP_Tab:
- case GDK_ISO_Left_Tab:
- case GDK_3270_BackTab:
- /* Don't insert literally */
- command.action = E_TEP_NOP;
- command.position = E_TEP_SELECTION;
- break;
- case GDK_Return:
- case GDK_KP_Enter:
- if (tep->allow_newlines) {
- if (key.state & GDK_CONTROL_MASK) {
- command.action = E_TEP_ACTIVATE;
- command.position = E_TEP_SELECTION;
- } else {
- command.action = E_TEP_INSERT;
- command.position = E_TEP_SELECTION;
- command.value = 1;
- command.string = "\n";
- }
- } else {
- if (key.state & GDK_CONTROL_MASK) {
- command.action = E_TEP_NOP;
- command.position = E_TEP_SELECTION;
- } else {
- command.action = E_TEP_ACTIVATE;
- command.position = E_TEP_SELECTION;
- }
- }
- break;
- case GDK_Escape:
- /* Don't insert literally */
- command.action = E_TEP_NOP;
- command.position = E_TEP_SELECTION;
- break;
-
- case GDK_KP_Space:
- command.action = E_TEP_INSERT;
- command.position = E_TEP_SELECTION;
- command.value = 1;
- command.string = " ";
- break;
- case GDK_KP_Equal:
- command.action = E_TEP_INSERT;
- command.position = E_TEP_SELECTION;
- command.value = 1;
- command.string = "=";
- break;
- case GDK_KP_Multiply:
- command.action = E_TEP_INSERT;
- command.position = E_TEP_SELECTION;
- command.value = 1;
- command.string = "*";
- break;
- case GDK_KP_Add:
- command.action = E_TEP_INSERT;
- command.position = E_TEP_SELECTION;
- command.value = 1;
- command.string = "+";
- break;
- case GDK_KP_Subtract:
- command.action = E_TEP_INSERT;
- command.position = E_TEP_SELECTION;
- command.value = 1;
- command.string = "-";
- break;
- case GDK_KP_Decimal:
- command.action = E_TEP_INSERT;
- command.position = E_TEP_SELECTION;
- command.value = 1;
- command.string = ".";
- break;
- case GDK_KP_Divide:
- command.action = E_TEP_INSERT;
- command.position = E_TEP_SELECTION;
- command.value = 1;
- command.string = "/";
- break;
- case GDK_KP_0:
- command.action = E_TEP_INSERT;
- command.position = E_TEP_SELECTION;
- command.value = 1;
- command.string = "0";
- break;
- case GDK_KP_1:
- command.action = E_TEP_INSERT;
- command.position = E_TEP_SELECTION;
- command.value = 1;
- command.string = "1";
- break;
- case GDK_KP_2:
- command.action = E_TEP_INSERT;
- command.position = E_TEP_SELECTION;
- command.value = 1;
- command.string = "2";
- break;
- case GDK_KP_3:
- command.action = E_TEP_INSERT;
- command.position = E_TEP_SELECTION;
- command.value = 1;
- command.string = "3";
- break;
- case GDK_KP_4:
- command.action = E_TEP_INSERT;
- command.position = E_TEP_SELECTION;
- command.value = 1;
- command.string = "4";
- break;
- case GDK_KP_5:
- command.action = E_TEP_INSERT;
- command.position = E_TEP_SELECTION;
- command.value = 1;
- command.string = "5";
- break;
- case GDK_KP_6:
- command.action = E_TEP_INSERT;
- command.position = E_TEP_SELECTION;
- command.value = 1;
- command.string = "6";
- break;
- case GDK_KP_7:
- command.action = E_TEP_INSERT;
- command.position = E_TEP_SELECTION;
- command.value = 1;
- command.string = "7";
- break;
- case GDK_KP_8:
- command.action = E_TEP_INSERT;
- command.position = E_TEP_SELECTION;
- command.value = 1;
- command.string = "8";
- break;
- case GDK_KP_9:
- command.action = E_TEP_INSERT;
- command.position = E_TEP_SELECTION;
- command.value = 1;
- command.string = "9";
- break;
-
- default:
- if ((key.state & GDK_CONTROL_MASK) && !(key.state & GDK_MOD1_MASK)) {
- if ((key.keyval >= 'A') && (key.keyval <= 'Z'))
- key.keyval -= 'A' - 'a';
-
- if ((key.keyval >= 'a') && (key.keyval <= 'z')) {
- command.position = control_keys[(int) (key.keyval - 'a')].position;
- if (control_keys[(int) (key.keyval - 'a')].action != E_TEP_MOVE)
- command.action = control_keys[(int) (key.keyval - 'a')].action;
- command.value = control_keys[(int) (key.keyval - 'a')].value;
- command.string = control_keys[(int) (key.keyval - 'a')].string;
- }
-
- if (key.keyval == 'x') {
- command.action = E_TEP_COPY;
- command.position = E_TEP_SELECTION;
- g_signal_emit_by_name (tep, "command", &command);
-
- command.action = E_TEP_DELETE;
- command.position = E_TEP_SELECTION;
- }
-
- break;
- } else if ((key.state & GDK_MOD1_MASK) && !(key.state & GDK_CONTROL_MASK)) {
- if ((key.keyval >= 'A') && (key.keyval <= 'Z'))
- key.keyval -= 'A' - 'a';
-
- if ((key.keyval >= 'a') && (key.keyval <= 'z')) {
- command.position = alt_keys[(int) (key.keyval - 'a')].position;
- if (alt_keys[(int) (key.keyval - 'a')].action != E_TEP_MOVE)
- command.action = alt_keys[(int) (key.keyval - 'a')].action;
- command.value = alt_keys[(int) (key.keyval - 'a')].value;
- command.string = alt_keys[(int) (key.keyval - 'a')].string;
- }
- } else if (!(key.state & GDK_MOD1_MASK) && !(key.state & GDK_CONTROL_MASK) && key.length > 0) {
- if (key.keyval >= GDK_KP_0 && key.keyval <= GDK_KP_9) {
- key.keyval = '0';
- key.string = "0";
- }
- command.action = E_TEP_INSERT;
- command.position = E_TEP_SELECTION;
- command.value = strlen(key.string);
- command.string = key.string;
-
- } else {
- command.action = E_TEP_NOP;
- }
- }
- break;
- case GDK_KEY_RELEASE:
- command.time = event->key.time;
- command.action = E_TEP_NOP;
- break;
- default:
- command.action = E_TEP_NOP;
- break;
- }
- }
- if (command.action != E_TEP_NOP) {
- g_signal_emit_by_name (tep, "command", &command);
- return 1;
- }
- else
- return 0;
-}
-
-ETextEventProcessor *
-e_text_event_processor_emacs_like_new (void)
-{
- ETextEventProcessorEmacsLike *retval = g_object_new (E_TEXT_EVENT_PROCESSOR_EMACS_LIKE_TYPE, NULL);
- return E_TEXT_EVENT_PROCESSOR (retval);
-}
-
diff --git a/e-util/e-text-event-processor-emacs-like.h b/e-util/e-text-event-processor-emacs-like.h
deleted file mode 100644
index 1fd74dacfe..0000000000
--- a/e-util/e-text-event-processor-emacs-like.h
+++ /dev/null
@@ -1,70 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-text-event-processor-emacs-like.h
- * Copyright 2000, 2001, Ximian, Inc.
- *
- * Authors:
- * Chris Lahey <clahey@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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.
- */
-
-#ifndef __E_TEXT_EVENT_PROCESSOR_EMACS_LIKE_H__
-#define __E_TEXT_EVENT_PROCESSOR_EMACS_LIKE_H__
-
-#include <gal/util/e-text-event-processor.h>
-
-#ifdef __cplusplus
-extern "C" {
-#pragma }
-#endif /* __cplusplus */
-
-/* ETextEventProcessorEmacsLike - Turns events on a text widget into commands. Uses an emacs-ish interface.
- *
- */
-
-#define E_TEXT_EVENT_PROCESSOR_EMACS_LIKE_TYPE (e_text_event_processor_emacs_like_get_type ())
-#define E_TEXT_EVENT_PROCESSOR_EMACS_LIKE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), E_TEXT_EVENT_PROCESSOR_EMACS_LIKE_TYPE, ETextEventProcessorEmacsLike))
-#define E_TEXT_EVENT_PROCESSOR_EMACS_LIKE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), E_TEXT_EVENT_PROCESSOR_EMACS_LIKE_TYPE, ETextEventProcessorEmacsLikeClass))
-#define E_IS_TEXT_EVENT_PROCESSOR_EMACS_LIKE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), E_TEXT_EVENT_PROCESSOR_EMACS_LIKE_TYPE))
-#define E_IS_TEXT_EVENT_PROCESSOR_EMACS_LIKE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), E_TEXT_EVENT_PROCESSOR_EMACS_LIKE_TYPE))
-
-
-typedef struct _ETextEventProcessorEmacsLike ETextEventProcessorEmacsLike;
-typedef struct _ETextEventProcessorEmacsLikeClass ETextEventProcessorEmacsLikeClass;
-
-struct _ETextEventProcessorEmacsLike
-{
- ETextEventProcessor parent;
-
- /* object specific fields */
- guint mouse_down : 1;
-};
-
-struct _ETextEventProcessorEmacsLikeClass
-{
- ETextEventProcessorClass parent_class;
-};
-
-
-GType e_text_event_processor_emacs_like_get_type (void);
-ETextEventProcessor *e_text_event_processor_emacs_like_new (void);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-
-#endif /* __E_TEXT_EVENT_PROCESSOR_EMACS_LIKE_H__ */
diff --git a/e-util/e-text-event-processor-types.h b/e-util/e-text-event-processor-types.h
deleted file mode 100644
index 5cb3f198d7..0000000000
--- a/e-util/e-text-event-processor-types.h
+++ /dev/null
@@ -1,132 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-text-event-processor-types.h
- * Copyright 2000, 2001, Ximian, Inc.
- *
- * Authors:
- * Chris Lahey <clahey@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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.
- */
-
-#ifndef __E_TEXT_EVENT_PROCESSOR_TYPES_H__
-#define __E_TEXT_EVENT_PROCESSOR_TYPES_H__
-
-#include <glib/gmacros.h>
-
-G_BEGIN_DECLS
-
-#include <gdk/gdkevents.h>
-
-typedef union _ETextEventProcessorEvent ETextEventProcessorEvent;
-
-typedef enum {
- E_TEP_VALUE,
- E_TEP_SELECTION,
-
- E_TEP_START_OF_BUFFER,
- E_TEP_END_OF_BUFFER,
-
- E_TEP_START_OF_LINE,
- E_TEP_END_OF_LINE,
-
- E_TEP_FORWARD_CHARACTER,
- E_TEP_BACKWARD_CHARACTER,
-
- E_TEP_FORWARD_WORD,
- E_TEP_BACKWARD_WORD,
-
- E_TEP_FORWARD_LINE,
- E_TEP_BACKWARD_LINE,
-
- E_TEP_FORWARD_PARAGRAPH,
- E_TEP_BACKWARD_PARAGRAPH,
-
- E_TEP_FORWARD_PAGE,
- E_TEP_BACKWARD_PAGE,
-
- E_TEP_SELECT_WORD,
- E_TEP_SELECT_ALL
-
-} ETextEventProcessorCommandPosition;
-
-typedef enum {
- E_TEP_MOVE,
- E_TEP_SELECT,
- E_TEP_DELETE,
- E_TEP_INSERT,
-
- E_TEP_CAPS,
-
- E_TEP_COPY,
- E_TEP_PASTE,
- E_TEP_GET_SELECTION,
- E_TEP_SET_SELECT_BY_WORD,
- E_TEP_ACTIVATE,
-
- E_TEP_GRAB,
- E_TEP_UNGRAB,
-
- E_TEP_NOP
-} ETextEventProcessorCommandAction;
-
-typedef struct {
- ETextEventProcessorCommandPosition position;
- ETextEventProcessorCommandAction action;
- int value;
- char *string;
- guint32 time;
-} ETextEventProcessorCommand;
-
-typedef struct {
- GdkEventType type;
- guint32 time;
- guint state;
- guint button;
- gint position;
-} ETextEventProcessorEventButton;
-
-typedef struct {
- GdkEventType type;
- guint32 time;
- guint state;
- guint keyval;
- gint length;
- gchar *string;
-} ETextEventProcessorEventKey;
-
-typedef struct {
- GdkEventType type;
- guint32 time;
- guint state;
- gint position;
-} ETextEventProcessorEventMotion;
-
-union _ETextEventProcessorEvent {
- GdkEventType type;
- ETextEventProcessorEventButton button;
- ETextEventProcessorEventKey key;
- ETextEventProcessorEventMotion motion;
-};
-
-typedef enum _ETextEventProcessorCaps {
- E_TEP_CAPS_UPPER,
- E_TEP_CAPS_LOWER,
- E_TEP_CAPS_TITLE
-} ETextEventProcessorCaps;
-
-G_END_DECLS
-
-#endif /* __E_TEXT_EVENT_PROCESSOR_TYPES_H__ */
diff --git a/e-util/e-text-event-processor.c b/e-util/e-text-event-processor.c
deleted file mode 100644
index 6b974d894e..0000000000
--- a/e-util/e-text-event-processor.c
+++ /dev/null
@@ -1,148 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-text-event-processor.c
- * Copyright 2000, 2001, Ximian, Inc.
- *
- * Authors:
- * Chris Lahey <clahey@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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 "e-text-event-processor.h"
-#include <gal/util/e-util.h>
-#include <gal/util/e-i18n.h>
-#include "gal/util/e-marshal.h"
-
-static void e_text_event_processor_init (ETextEventProcessor *card);
-static void e_text_event_processor_class_init (ETextEventProcessorClass *klass);
-
-static void e_text_event_processor_set_property (GObject *object,
- guint prop_id,
- const GValue *value,
- GParamSpec *pspec);
-static void e_text_event_processor_get_property (GObject *object,
- guint prop_id,
- GValue *value,
- GParamSpec *pspec);
-
-#define PARENT_TYPE G_TYPE_OBJECT
-static GObjectClass *parent_class = NULL;
-
-/* The arguments we take */
-enum {
- PROP_0,
- PROP_ALLOW_NEWLINES
-};
-
-enum {
- E_TEP_EVENT,
- E_TEP_LAST_SIGNAL
-};
-
-static guint e_tep_signals[E_TEP_LAST_SIGNAL] = { 0 };
-
-E_MAKE_TYPE (e_text_event_processor,
- "ETextEventProcessor",
- ETextEventProcessor,
- e_text_event_processor_class_init,
- e_text_event_processor_init,
- PARENT_TYPE)
-
-static void
-e_text_event_processor_class_init (ETextEventProcessorClass *klass)
-{
- GObjectClass *object_class;
-
- object_class = (GObjectClass*) klass;
-
- parent_class = g_type_class_ref (PARENT_TYPE);
-
- object_class->set_property = e_text_event_processor_set_property;
- object_class->get_property = e_text_event_processor_get_property;
-
- e_tep_signals[E_TEP_EVENT] =
- g_signal_new ("command",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (ETextEventProcessorClass, command),
- NULL, NULL,
- e_marshal_NONE__POINTER,
- G_TYPE_NONE, 1,
- G_TYPE_POINTER);
-
- g_object_class_install_property (object_class, PROP_ALLOW_NEWLINES,
- g_param_spec_boolean ("allow_newlines",
- _( "Allow newlines" ),
- _( "Allow newlines" ),
- FALSE,
- G_PARAM_READWRITE));
-
- klass->event = NULL;
- klass->command = NULL;
-
-}
-
-static void
-e_text_event_processor_init (ETextEventProcessor *tep)
-{
- tep->allow_newlines = TRUE;
-}
-
-gint
-e_text_event_processor_handle_event (ETextEventProcessor *tep, ETextEventProcessorEvent *event)
-{
- if (E_TEXT_EVENT_PROCESSOR_GET_CLASS(tep)->event)
- return E_TEXT_EVENT_PROCESSOR_GET_CLASS(tep)->event(tep, event);
- else
- return 0;
-}
-
-/* Set_arg handler for the text item */
-static void
-e_text_event_processor_set_property (GObject *object,
- guint prop_id,
- const GValue *value,
- GParamSpec *pspec)
-{
- ETextEventProcessor *tep = E_TEXT_EVENT_PROCESSOR (object);
-
- switch (prop_id) {
- case PROP_ALLOW_NEWLINES:
- tep->allow_newlines = g_value_get_boolean (value);
- break;
- default:
- return;
- }
-}
-
-/* Get_arg handler for the text item */
-static void
-e_text_event_processor_get_property (GObject *object,
- guint prop_id,
- GValue *value,
- GParamSpec *pspec)
-{
- ETextEventProcessor *tep = E_TEXT_EVENT_PROCESSOR (object);
-
- switch (prop_id) {
- case PROP_ALLOW_NEWLINES:
- g_value_set_boolean (value, tep->allow_newlines);
- break;
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
- break;
- }
-}
diff --git a/e-util/e-text-event-processor.h b/e-util/e-text-event-processor.h
deleted file mode 100644
index 21f2550fde..0000000000
--- a/e-util/e-text-event-processor.h
+++ /dev/null
@@ -1,77 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-text-event-processor.h
- * Copyright 2000, 2001, Ximian, Inc.
- *
- * Authors:
- * Chris Lahey <clahey@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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.
- */
-
-#ifndef __E_TEXT_EVENT_PROCESSOR_H__
-#define __E_TEXT_EVENT_PROCESSOR_H__
-
-#include <glib.h>
-#include <gtk/gtkobject.h>
-#include <gal/util/e-text-event-processor-types.h>
-
-#ifdef __cplusplus
-extern "C" {
-#pragma }
-#endif /* __cplusplus */
-
-/* ETextEventProcessor - Turns events on a text widget into commands.
- *
- */
-
-#define E_TEXT_EVENT_PROCESSOR_TYPE (e_text_event_processor_get_type ())
-#define E_TEXT_EVENT_PROCESSOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), E_TEXT_EVENT_PROCESSOR_TYPE, ETextEventProcessor))
-#define E_TEXT_EVENT_PROCESSOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), E_TEXT_EVENT_PROCESSOR_TYPE, ETextEventProcessorClass))
-#define E_IS_TEXT_EVENT_PROCESSOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), E_TEXT_EVENT_PROCESSOR_TYPE))
-#define E_IS_TEXT_EVENT_PROCESSOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), E_TEXT_EVENT_PROCESSOR_TYPE))
-#define E_TEXT_EVENT_PROCESSOR_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), E_TEXT_EVENT_PROCESSOR_TYPE, ETextEventProcessorClass))
-typedef struct _ETextEventProcessor ETextEventProcessor;
-typedef struct _ETextEventProcessorClass ETextEventProcessorClass;
-
-struct _ETextEventProcessor
-{
- GObject parent;
-
- /* object specific fields */
- guint allow_newlines : 1;
-};
-
-struct _ETextEventProcessorClass
-{
- GtkObjectClass parent_class;
-
- /* signals */
- void (* command) (ETextEventProcessor *tep, ETextEventProcessorCommand *command);
-
- /* virtual functions */
- gint (* event) (ETextEventProcessor *tep, ETextEventProcessorEvent *event);
-};
-
-
-GType e_text_event_processor_get_type (void);
-gint e_text_event_processor_handle_event (ETextEventProcessor *tep, ETextEventProcessorEvent *event);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-
-#endif /* __E_TEXT_EVENT_PROCESSOR_H__ */
diff --git a/e-util/e-util.c b/e-util/e-util.c
deleted file mode 100644
index 4e3584a059..0000000000
--- a/e-util/e-util.c
+++ /dev/null
@@ -1,1150 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-util.c
- * Copyright 2000, 2001, Ximian, Inc.
- *
- * Authors:
- * Chris Lahey <clahey@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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 "e-util.h"
-#include "e-i18n.h"
-
-#include <glib.h>
-#include <gtk/gtkobject.h>
-#include <errno.h>
-#include <fcntl.h>
-#include <unistd.h>
-#include <ctype.h>
-#include <sys/stat.h>
-#include <string.h>
-#include <locale.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <time.h>
-#include <libgnome/gnome-util.h>
-#include <math.h>
-
-#if 0
-#include <libgnomevfs/gnome-vfs.h>
-#endif
-
-int
-g_str_compare (const void *x, const void *y)
-{
- if (x == NULL || y == NULL) {
- if (x == y)
- return 0;
- else
- return x ? -1 : 1;
- }
-
- return strcmp (x, y);
-}
-
-int
-g_collate_compare (const void *x, const void *y)
-{
- if (x == NULL || y == NULL) {
- if (x == y)
- return 0;
- else
- return x ? -1 : 1;
- }
-
- return g_utf8_collate (x, y);
-}
-
-int
-g_int_compare (const void *x, const void *y)
-{
- if (GPOINTER_TO_INT (x) < GPOINTER_TO_INT (y))
- return -1;
- else if (GPOINTER_TO_INT (x) == GPOINTER_TO_INT (y))
- return 0;
- else
- return 1;
-}
-
-char *
-e_strdup_strip(const char *string)
-{
- int i;
- int length = 0;
- int initial = 0;
- for ( i = 0; string[i]; i++ ) {
- if (initial == i && isspace((unsigned char) string[i])) {
- initial ++;
- }
- if (!isspace((unsigned char) string[i])) {
- length = i - initial + 1;
- }
- }
- return g_strndup(string + initial, length);
-}
-
-void
-e_free_object_list (GList *list)
-{
- GList *p;
-
- for (p = list; p != NULL; p = p->next)
- g_object_unref (p->data);
-
- g_list_free (list);
-}
-
-void
-e_free_object_slist (GSList *list)
-{
- GSList *p;
-
- for (p = list; p != NULL; p = p->next)
- g_object_unref (p->data);
-
- g_slist_free (list);
-}
-
-void
-e_free_string_list (GList *list)
-{
- GList *p;
-
- for (p = list; p != NULL; p = p->next)
- g_free (p->data);
-
- g_list_free (list);
-}
-
-void
-e_free_string_slist (GSList *list)
-{
- GSList *p;
-
- for (p = list; p != NULL; p = p->next)
- g_free (p->data);
- g_slist_free (list);
-}
-
-#define BUFF_SIZE 1024
-
-char *
-e_read_file(const char *filename)
-{
- int fd;
- char buffer[BUFF_SIZE];
- GList *list = NULL, *list_iterator;
- GList *lengths = NULL, *lengths_iterator;
- int length = 0;
- int bytes;
- char *ret_val;
-
- fd = open(filename, O_RDONLY);
- if (fd == -1)
- return NULL;
- bytes = read(fd, buffer, BUFF_SIZE);
- while (bytes) {
- if (bytes > 0) {
- char *temp = g_malloc(bytes);
- memcpy (temp, buffer, bytes);
- list = g_list_prepend(list, temp);
- lengths = g_list_prepend(lengths, GINT_TO_POINTER(bytes));
- length += bytes;
- } else {
- if (errno != EINTR) {
- close(fd);
- g_list_foreach(list, (GFunc) g_free, NULL);
- g_list_free(list);
- g_list_free(lengths);
- return NULL;
- }
- }
- bytes = read(fd, buffer, BUFF_SIZE);
- }
- ret_val = g_new(char, length + 1);
- ret_val[length] = 0;
- lengths_iterator = lengths;
- list_iterator = list;
- for ( ; list_iterator; list_iterator = list_iterator->next, lengths_iterator = lengths_iterator->next) {
- int this_length = GPOINTER_TO_INT(lengths_iterator->data);
- length -= this_length;
- memcpy(ret_val + length, list_iterator->data, this_length);
- }
- close(fd);
- g_list_foreach(list, (GFunc) g_free, NULL);
- g_list_free(list);
- g_list_free(lengths);
- return ret_val;
-}
-
-gint
-e_write_file(const char *filename, const char *data, int flags)
-{
- int fd;
- int length = strlen(data);
- int bytes;
- fd = open(filename, flags | O_WRONLY, 0666);
- if (fd == -1)
- return errno;
- while (length > 0) {
- bytes = write(fd, data, length);
- if (bytes > 0) {
- length -= bytes;
- data += bytes;
- } else {
- if (errno != EINTR && errno != EAGAIN) {
- int save_errno = errno;
- close(fd);
- return save_errno;
- }
- }
- }
- if (close(fd) != 0) {
- return errno;
- }
- return 0;
-}
-
-gint
-e_write_file_mkstemp(char *filename, const char *data)
-{
- int fd;
- int length = strlen(data);
- int bytes;
- fd = mkstemp (filename);
- if (fd == -1)
- return errno;
- while (length > 0) {
- bytes = write(fd, data, length);
- if (bytes > 0) {
- length -= bytes;
- data += bytes;
- } else {
- if (errno != EINTR && errno != EAGAIN) {
- int save_errno = errno;
- close(fd);
- return save_errno;
- }
- }
- }
- if (close(fd) != 0) {
- return errno;
- }
- return 0;
-}
-
-/**
- * e_mkdir_hier:
- * @path: a directory path
- * @mode: a mode, as for mkdir(2)
- *
- * This creates the named directory with the given @mode, creating
- * any necessary intermediate directories (with the same @mode).
- *
- * Return value: 0 on success, -1 on error, in which case errno will
- * be set as for mkdir(2).
- **/
-int
-e_mkdir_hier(const char *path, mode_t mode)
-{
- char *copy, *p;
-
- if (path[0] == '/') {
- p = copy = g_strdup (path);
- } else {
- gchar *current_dir = g_get_current_dir();
- p = copy = g_concat_dir_and_file (current_dir, path);
- }
-
- do {
- p = strchr (p + 1, '/');
- if (p)
- *p = '\0';
- if (access (copy, F_OK) == -1) {
- if (mkdir (copy, mode) == -1) {
- g_free (copy);
- return -1;
- }
- }
- if (p)
- *p = '/';
- } while (p);
-
- g_free (copy);
- return 0;
-}
-
-#if 0
-char *
-e_read_uri(const char *uri)
-{
- GnomeVFSHandle *handle;
- GList *list = NULL, *list_iterator;
- GList *lengths = NULL, *lengths_iterator;
- gchar buffer[1025];
- gchar *ret_val;
- int length = 0;
- GnomeVFSFileSize bytes;
-
- gnome_vfs_open(&handle, uri, GNOME_VFS_OPEN_READ);
-
- gnome_vfs_read(handle, buffer, 1024, &bytes);
- while (bytes) {
- if (bytes) {
- char *temp = g_malloc(bytes);
- memcpy (temp, buffer, bytes);
- list = g_list_prepend(list, temp);
- lengths = g_list_prepend(lengths, GINT_TO_POINTER((gint) bytes));
- length += bytes;
- }
- gnome_vfs_read(handle, buffer, 1024, &bytes);
- }
-
- ret_val = g_new(char, length + 1);
- ret_val[length] = 0;
- lengths_iterator = lengths;
- list_iterator = list;
- for ( ; list_iterator; list_iterator = list_iterator->next, lengths_iterator = lengths_iterator->next) {
- int this_length = GPOINTER_TO_INT(lengths_iterator->data);
- length -= this_length;
- memcpy(ret_val + length, list_iterator->data, this_length);
- }
- gnome_vfs_close(handle);
- g_list_foreach(list, (GFunc) g_free, NULL);
- g_list_free(list);
- g_list_free(lengths);
- return ret_val;
-}
-#endif
-
-/* Include build marshalers */
-
-#include "e-marshal.h"
-#include "e-marshal.c"
-
-gchar**
-e_strsplit (const gchar *string,
- const gchar *delimiter,
- gint max_tokens)
-{
- GSList *string_list = NULL, *slist;
- gchar **str_array, *s;
- guint i, n = 1;
-
- g_return_val_if_fail (string != NULL, NULL);
- g_return_val_if_fail (delimiter != NULL, NULL);
-
- if (max_tokens < 1)
- max_tokens = G_MAXINT;
-
- s = strstr (string, delimiter);
- if (s)
- {
- guint delimiter_len = strlen (delimiter);
-
- do
- {
- guint len;
- gchar *new_string;
-
- len = s - string;
- new_string = g_new (gchar, len + 1);
- strncpy (new_string, string, len);
- new_string[len] = 0;
- string_list = g_slist_prepend (string_list, new_string);
- n++;
- string = s + delimiter_len;
- s = strstr (string, delimiter);
- }
- while (--max_tokens && s);
- }
-
- n++;
- string_list = g_slist_prepend (string_list, g_strdup (string));
-
- str_array = g_new (gchar*, n);
-
- i = n - 1;
-
- str_array[i--] = NULL;
- for (slist = string_list; slist; slist = slist->next)
- str_array[i--] = slist->data;
-
- g_slist_free (string_list);
-
- return str_array;
-}
-
-gchar *
-e_strstrcase (const gchar *haystack, const gchar *needle)
-{
- /* find the needle in the haystack neglecting case */
- const gchar *ptr;
- guint len;
-
- g_return_val_if_fail (haystack != NULL, NULL);
- g_return_val_if_fail (needle != NULL, NULL);
-
- len = strlen(needle);
- if (len > strlen(haystack))
- return NULL;
-
- if (len == 0)
- return (gchar *) haystack;
-
- for (ptr = haystack; *(ptr + len - 1) != '\0'; ptr++)
- if (!g_strncasecmp (ptr, needle, len))
- return (gchar *) ptr;
-
- return NULL;
-}
-
-/* This only makes a filename safe for usage as a filename. It still may have shell meta-characters in it. */
-void
-e_filename_make_safe (gchar *string)
-{
- gchar *p;
-
- g_return_if_fail (string != NULL);
-
- for (p = string; *p; p++) {
- if (!isprint ((unsigned char)*p) || strchr (" /'\"`&();|<>${}!", *p))
- *p = '_';
- }
-}
-
-static gint
-epow10 (gint number) {
- gint value;
-
- for (value = 1; number > 0; number --) {
- value *= 10;
- }
- return value;
-}
-
-gchar *
-e_format_number (gint number)
-{
- GList *iterator, *list = NULL;
- struct lconv *locality;
- gint char_length = 0;
- gint group_count = 0;
- guchar *grouping;
- int last_count = 3;
- int divider;
- char *value;
- char *value_iterator;
-
- locality = localeconv();
- grouping = locality->grouping;
- while (number) {
- char *group;
- switch (*grouping) {
- default:
- last_count = *grouping;
- grouping++;
- case 0:
- divider = epow10(last_count);
- if (number >= divider) {
- group = g_strdup_printf("%0*d", last_count, number % divider);
- } else {
- group = g_strdup_printf("%d", number % divider);
- }
- number /= divider;
- break;
- case CHAR_MAX:
- group = g_strdup_printf("%d", number);
- number = 0;
- break;
- }
- char_length += strlen(group);
- list = g_list_prepend(list, group);
- group_count ++;
- }
-
- if (list) {
- value = g_new(char, 1 + char_length + (group_count - 1) * strlen(locality->thousands_sep));
-
- iterator = list;
- value_iterator = value;
-
- strcpy(value_iterator, iterator->data);
- value_iterator += strlen(iterator->data);
- for (iterator = iterator->next; iterator; iterator = iterator->next) {
- strcpy(value_iterator, locality->thousands_sep);
- value_iterator += strlen(locality->thousands_sep);
-
- strcpy(value_iterator, iterator->data);
- value_iterator += strlen(iterator->data);
- }
- e_free_string_list (list);
- return value;
- } else {
- return g_strdup("0");
- }
-}
-
-static gchar *
-do_format_number_as_float (double number)
-{
- GList *iterator, *list = NULL;
- struct lconv *locality;
- gint char_length = 0;
- gint group_count = 0;
- guchar *grouping;
- int last_count = 3;
- int divider;
- char *value;
- char *value_iterator;
- double fractional;
-
- locality = localeconv();
- grouping = locality->grouping;
- while (number >= 1.0) {
- char *group;
- switch (*grouping) {
- default:
- last_count = *grouping;
- grouping++;
- /* Fall through */
- case 0:
- divider = epow10(last_count);
- number /= divider;
- fractional = modf (number, &number);
- fractional *= divider;
- fractional = floor (fractional);
-
- if (number >= 1.0) {
- group = g_strdup_printf("%0*d", last_count, (int) fractional);
- } else {
- group = g_strdup_printf("%d", (int) fractional);
- }
- break;
- case CHAR_MAX:
- divider = epow10(last_count);
- number /= divider;
- fractional = modf (number, &number);
- fractional *= divider;
- fractional = floor (fractional);
-
- while (number >= 1.0) {
- group = g_strdup_printf("%0*d", last_count, (int) fractional);
-
- char_length += strlen(group);
- list = g_list_prepend(list, group);
- group_count ++;
-
- divider = epow10(last_count);
- number /= divider;
- fractional = modf (number, &number);
- fractional *= divider;
- fractional = floor (fractional);
- }
-
- group = g_strdup_printf("%d", (int) fractional);
- break;
- }
- char_length += strlen(group);
- list = g_list_prepend(list, group);
- group_count ++;
- }
-
- if (list) {
- value = g_new(char, 1 + char_length + (group_count - 1) * strlen(locality->thousands_sep));
-
- iterator = list;
- value_iterator = value;
-
- strcpy(value_iterator, iterator->data);
- value_iterator += strlen(iterator->data);
- for (iterator = iterator->next; iterator; iterator = iterator->next) {
- strcpy(value_iterator, locality->thousands_sep);
- value_iterator += strlen(locality->thousands_sep);
-
- strcpy(value_iterator, iterator->data);
- value_iterator += strlen(iterator->data);
- }
- e_free_string_list (list);
- return value;
- } else {
- return g_strdup("0");
- }
-}
-
-gchar *
-e_format_number_float (gfloat number)
-{
- gfloat int_part;
- gint fraction;
- struct lconv *locality;
- gchar *str_intpart;
- gchar *decimal_point;
- gchar *str_fraction;
- gchar *value;
-
- locality = localeconv();
-
- int_part = floor (number);
- str_intpart = do_format_number_as_float ((double) int_part);
-
- if (!strcmp(locality->mon_decimal_point, "")) {
- decimal_point = ".";
- }
- else {
- decimal_point = locality->mon_decimal_point;
- }
-
- fraction = (int) ((number - int_part) * 100);
-
- if (fraction == 0) {
- str_fraction = g_strdup ("00");
- } else {
- str_fraction = g_strdup_printf ("%02d", fraction);
- }
-
- value = g_strconcat (str_intpart, decimal_point, str_fraction, NULL);
-
- g_free (str_intpart);
- g_free (str_fraction);
-
- return value;
-}
-
-gboolean
-e_create_directory (gchar *directory)
-{
- gint ret_val = e_mkdir_hier (directory, 0777);
- if (ret_val == -1)
- return FALSE;
- else
- return TRUE;
-}
-
-
-/* Perform a binary search for key in base which has nmemb elements
- of size bytes each. The comparisons are done by (*compare)(). */
-void e_bsearch (const void *key,
- const void *base,
- size_t nmemb,
- size_t size,
- ESortCompareFunc compare,
- gpointer closure,
- size_t *start,
- size_t *end)
-{
- size_t l, u, idx;
- const void *p;
- int comparison;
- if (!(start || end))
- return;
-
- l = 0;
- u = nmemb;
- while (l < u) {
- idx = (l + u) / 2;
- p = (void *) (((const char *) base) + (idx * size));
- comparison = (*compare) (key, p, closure);
- if (comparison < 0)
- u = idx;
- else if (comparison > 0)
- l = idx + 1;
- else {
- size_t lsave, usave;
- lsave = l;
- usave = u;
- if (start) {
- while (l < u) {
- idx = (l + u) / 2;
- p = (void *) (((const char *) base) + (idx * size));
- comparison = (*compare) (key, p, closure);
- if (comparison <= 0)
- u = idx;
- else
- l = idx + 1;
- }
- *start = l;
-
- l = lsave;
- u = usave;
- }
- if (end) {
- while (l < u) {
- idx = (l + u) / 2;
- p = (void *) (((const char *) base) + (idx * size));
- comparison = (*compare) (key, p, closure);
- if (comparison < 0)
- u = idx;
- else
- l = idx + 1;
- }
- *end = l;
- }
- return;
- }
- }
-
- if (start)
- *start = l;
- if (end)
- *end = l;
-}
-
-static gpointer closure_closure;
-static ESortCompareFunc compare_closure;
-
-static int
-qsort_callback(const void *data1, const void *data2)
-{
- return (*compare_closure) (data1, data2, closure_closure);
-}
-
-/* Forget it. We're just going to use qsort. I lost the need for a stable sort. */
-void
-e_sort (void *base,
- size_t nmemb,
- size_t size,
- ESortCompareFunc compare,
- gpointer closure)
-{
- closure_closure = closure;
- compare_closure = compare;
- qsort(base, nmemb, size, qsort_callback);
-#if 0
- void *base_copy;
- int i;
- base_copy = g_malloc(nmemb * size);
-
- for (i = 0; i < nmemb; i++) {
- int position;
- e_bsearch(base + (i * size), base_copy, i, size, compare, closure, NULL, &position);
- memmove(base_copy + (position + 1) * size, base_copy + position * size, (i - position) * size);
- memcpy(base_copy + position * size, base + i * size, size);
- }
- memcpy(base, base_copy, nmemb * size);
- g_free(base_copy);
-#endif
-}
-
-size_t e_strftime(char *s, size_t max, const char *fmt, const struct tm *tm)
-{
-#ifdef HAVE_LKSTRFTIME
- return strftime(s, max, fmt, tm);
-#else
- char *c, *ffmt, *ff;
- size_t ret;
-
- ffmt = g_strdup(fmt);
- ff = ffmt;
- while ((c = strstr(ff, "%l")) != NULL) {
- c[1] = 'I';
- ff = c;
- }
-
- ff = fmt;
- while ((c = strstr(ff, "%k")) != NULL) {
- c[1] = 'H';
- ff = c;
- }
-
- ret = strftime(s, max, ffmt, tm);
- g_free(ffmt);
- return ret;
-#endif
-}
-
-
-/**
- * Function to do a last minute fixup of the AM/PM stuff if the locale
- * and gettext haven't done it right. Most English speaking countries
- * except the USA use the 24 hour clock (UK, Australia etc). However
- * since they are English nobody bothers to write a language
- * translation (gettext) file. So the locale turns off the AM/PM, but
- * gettext does not turn on the 24 hour clock. Leaving a mess.
- *
- * This routine checks if AM/PM are defined in the locale, if not it
- * forces the use of the 24 hour clock.
- *
- * The function itself is a front end on strftime and takes exactly
- * the same arguments.
- *
- * TODO: Actually remove the '%p' from the fixed up string so that
- * there isn't a stray space.
- **/
-
-size_t e_strftime_fix_am_pm(char *s, size_t max, const char *fmt, const struct tm *tm)
-{
- char buf[10];
- char *sp;
- char *ffmt;
- size_t ret;
-
- if (strstr(fmt, "%p")==NULL && strstr(fmt, "%P")==NULL) {
- /* No AM/PM involved - can use the fmt string directly */
- ret=e_strftime(s, max, fmt, tm);
- } else {
- /* Get the AM/PM symbol from the locale */
- e_strftime (buf, 10, "%p", tm);
-
- if (buf[0]) {
- /**
- * AM/PM have been defined in the locale
- * so we can use the fmt string directly
- **/
- ret=e_strftime(s, max, fmt, tm);
- } else {
- /**
- * No AM/PM defined by locale
- * must change to 24 hour clock
- **/
- ffmt=g_strdup(fmt);
- for (sp=ffmt; (sp=strstr(sp, "%l")); sp++) {
- /**
- * Maybe this should be 'k', but I have never
- * seen a 24 clock actually use that format
- **/
- sp[1]='H';
- }
- for (sp=ffmt; (sp=strstr(sp, "%I")); sp++) {
- sp[1]='H';
- }
- ret=e_strftime(s, max, ffmt, tm);
- g_free(ffmt);
- }
- }
- return(ret);
-}
-
-/**
- * e_flexible_strtod:
- * @nptr: the string to convert to a numeric value.
- * @endptr: if non-NULL, it returns the character after
- * the last character used in the conversion.
- *
- * Converts a string to a gdouble value. This function detects
- * strings either in the standard C locale or in the current locale.
- *
- * This function is typically used when reading configuration files or
- * other non-user input that should not be locale dependent, but may
- * have been in the past. To handle input from the user you should
- * normally use the locale-sensitive system strtod function.
- *
- * To convert from a double to a string in a locale-insensitive way, use
- * @g_ascii_dtostr.
- *
- * Return value: the gdouble value.
- **/
-gdouble
-e_flexible_strtod (const gchar *nptr,
- gchar **endptr)
-{
- gchar *fail_pos;
- gdouble val;
- struct lconv *locale_data;
- const char *decimal_point;
- int decimal_point_len;
- const char *p, *decimal_point_pos;
- const char *end = NULL; /* Silence gcc */
- char *copy, *c;
-
- g_return_val_if_fail (nptr != NULL, 0);
-
- fail_pos = NULL;
-
- locale_data = localeconv ();
- decimal_point = locale_data->decimal_point;
- decimal_point_len = strlen (decimal_point);
-
- g_assert (decimal_point_len != 0);
-
- decimal_point_pos = NULL;
- if (!strcmp (decimal_point, "."))
- return strtod (nptr, endptr);
-
- p = nptr;
-
- /* Skip leading space */
- while (isspace ((guchar)*p))
- p++;
-
- /* Skip leading optional sign */
- if (*p == '+' || *p == '-')
- p++;
-
- if (p[0] == '0' &&
- (p[1] == 'x' || p[1] == 'X')) {
- p += 2;
- /* HEX - find the (optional) decimal point */
-
- while (isxdigit ((guchar)*p))
- p++;
-
- if (*p == '.') {
- decimal_point_pos = p++;
-
- while (isxdigit ((guchar)*p))
- p++;
-
- if (*p == 'p' || *p == 'P')
- p++;
- if (*p == '+' || *p == '-')
- p++;
- while (isdigit ((guchar)*p))
- p++;
- end = p;
- } else if (strncmp (p, decimal_point, decimal_point_len) == 0) {
- return strtod (nptr, endptr);
- }
- } else {
- while (isdigit ((guchar)*p))
- p++;
-
- if (*p == '.') {
- decimal_point_pos = p++;
-
- while (isdigit ((guchar)*p))
- p++;
-
- if (*p == 'e' || *p == 'E')
- p++;
- if (*p == '+' || *p == '-')
- p++;
- while (isdigit ((guchar)*p))
- p++;
- end = p;
- } else if (strncmp (p, decimal_point, decimal_point_len) == 0) {
- return strtod (nptr, endptr);
- }
- }
- /* For the other cases, we need not convert the decimal point */
-
- if (!decimal_point_pos)
- return strtod (nptr, endptr);
-
- /* We need to convert the '.' to the locale specific decimal point */
- copy = g_malloc (end - nptr + 1 + decimal_point_len);
-
- c = copy;
- memcpy (c, nptr, decimal_point_pos - nptr);
- c += decimal_point_pos - nptr;
- memcpy (c, decimal_point, decimal_point_len);
- c += decimal_point_len;
- memcpy (c, decimal_point_pos + 1, end - (decimal_point_pos + 1));
- c += end - (decimal_point_pos + 1);
- *c = 0;
-
- val = strtod (copy, &fail_pos);
-
- if (fail_pos) {
- if (fail_pos > decimal_point_pos)
- fail_pos = (char *)nptr + (fail_pos - copy) - (decimal_point_len - 1);
- else
- fail_pos = (char *)nptr + (fail_pos - copy);
- }
-
- g_free (copy);
-
- if (endptr)
- *endptr = fail_pos;
-
- return val;
-}
-
-/**
- * e_ascii_dtostr:
- * @buffer: A buffer to place the resulting string in
- * @buf_len: The length of the buffer.
- * @format: The printf-style format to use for the
- * code to use for converting.
- * @d: The double to convert
- *
- * Converts a double to a string, using the '.' as
- * decimal_point. To format the number you pass in
- * a printf-style formating string. Allowed conversion
- * specifiers are eEfFgG.
- *
- * If you want to generates enough precision that converting
- * the string back using @g_strtod gives the same machine-number
- * (on machines with IEEE compatible 64bit doubles) use the format
- * string "%.17g". If you do this it is guaranteed that the size
- * of the resulting string will never be larger than
- * @G_ASCII_DTOSTR_BUF_SIZE bytes.
- *
- * Return value: The pointer to the buffer with the converted string.
- **/
-gchar *
-e_ascii_dtostr (gchar *buffer,
- gint buf_len,
- const gchar *format,
- gdouble d)
-{
- struct lconv *locale_data;
- const char *decimal_point;
- int decimal_point_len;
- gchar *p;
- int rest_len;
- gchar format_char;
-
- g_return_val_if_fail (buffer != NULL, NULL);
- g_return_val_if_fail (format[0] == '%', NULL);
- g_return_val_if_fail (strpbrk (format + 1, "'l%") == NULL, NULL);
-
- format_char = format[strlen (format) - 1];
-
- g_return_val_if_fail (format_char == 'e' || format_char == 'E' ||
- format_char == 'f' || format_char == 'F' ||
- format_char == 'g' || format_char == 'G',
- NULL);
-
- if (format[0] != '%')
- return NULL;
-
- if (strpbrk (format + 1, "'l%"))
- return NULL;
-
- if (!(format_char == 'e' || format_char == 'E' ||
- format_char == 'f' || format_char == 'F' ||
- format_char == 'g' || format_char == 'G'))
- return NULL;
-
-
- g_snprintf (buffer, buf_len, format, d);
-
- locale_data = localeconv ();
- decimal_point = locale_data->decimal_point;
- decimal_point_len = strlen (decimal_point);
-
- g_assert (decimal_point_len != 0);
-
- if (strcmp (decimal_point, ".")) {
- p = buffer;
-
- if (*p == '+' || *p == '-')
- p++;
-
- while (isdigit ((guchar)*p))
- p++;
-
- if (strncmp (p, decimal_point, decimal_point_len) == 0) {
- *p = '.';
- p++;
- if (decimal_point_len > 1) {
- rest_len = strlen (p + (decimal_point_len-1));
- memmove (p, p + (decimal_point_len-1),
- rest_len);
- p[rest_len] = 0;
- }
- }
- }
-
- return buffer;
-}
-
-gchar *
-e_strdup_append_strings (gchar *first_string, ...)
-{
- gchar *buffer;
- gchar *current;
- gint length;
- va_list args1;
- va_list args2;
- char *v_string;
- int v_int;
-
- va_start (args1, first_string);
- G_VA_COPY (args2, args1);
-
- length = 0;
-
- v_string = first_string;
- while (v_string) {
- v_int = va_arg (args1, int);
- if (v_int >= 0)
- length += v_int;
- else
- length += strlen (v_string);
- v_string = va_arg (args1, char *);
- }
-
- buffer = g_new (char, length + 1);
- current = buffer;
-
- v_string = first_string;
- while (v_string) {
- v_int = va_arg (args2, int);
- if (v_int < 0) {
- int i;
- for (i = 0; v_string[i]; i++) {
- *(current++) = v_string[i];
- }
- } else {
- int i;
- for (i = 0; v_string[i] && i < v_int; i++) {
- *(current++) = v_string[i];
- }
- }
- v_string = va_arg (args2, char *);
- }
- *(current++) = 0;
-
- va_end (args1);
- va_end (args2);
-
- return buffer;
-}
-
-gchar **
-e_strdupv (const gchar **str_array)
-{
- if (str_array) {
- gint i;
- gchar **retval;
-
- i = 0;
- while (str_array[i])
- i++;
-
- retval = g_new (gchar*, i + 1);
-
- i = 0;
- while (str_array[i]) {
- retval[i] = g_strdup (str_array[i]);
- i++;
- }
- retval[i] = NULL;
-
- return retval;
- } else {
- return NULL;
- }
-}
-
-char *
-e_gettext (const char *msgid)
-{
- static gboolean initialized = FALSE;
-
- if (!initialized) {
- bindtextdomain (GETTEXT_PACKAGE, GNOMELOCALEDIR);
- bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
- initialized = TRUE;
- }
-
- return dgettext (GETTEXT_PACKAGE, msgid);
-}
-
diff --git a/e-util/e-util.h b/e-util/e-util.h
deleted file mode 100644
index 2937265f6b..0000000000
--- a/e-util/e-util.h
+++ /dev/null
@@ -1,221 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-util.h
- * Copyright 2000, 2001, Ximian, Inc.
- *
- * Authors:
- * Chris Lahey <clahey@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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.
- */
-
-#ifndef _E_UTIL_H_
-#define _E_UTIL_H_
-
-#include <sys/types.h>
-#include <glib-object.h>
-#include <limits.h>
-
-#ifdef __cplusplus
-extern "C" {
-#pragma }
-#endif /* __cplusplus */
-
-#include <gal/util/e-marshal.h>
-
-#define E_MAKE_TYPE(l,str,t,ci,i,parent) \
-GType l##_get_type(void)\
-{\
- static GType type = 0; \
- if (!type){ \
- static GTypeInfo const object_info = { \
- sizeof (t##Class), \
- \
- (GBaseInitFunc) NULL, \
- (GBaseFinalizeFunc) NULL, \
- \
- (GClassInitFunc) ci, \
- (GClassFinalizeFunc) NULL, \
- NULL, /* class_data */ \
- \
- sizeof (t), \
- 0, /* n_preallocs */ \
- (GInstanceInitFunc) i, \
- }; \
- type = g_type_register_static (parent, str, &object_info, 0); \
- } \
- return type; \
-}
-
-
-#define E_MAKE_X_TYPE(l,str,t,ci,i,parent,poa_init,offset) \
-GtkType l##_get_type(void) \
-{ \
- static GtkType type = 0; \
- if (!type){ \
- GTypeInfo info = { \
- sizeof (t##Class), \
- \
- (GBaseInitFunc) NULL, \
- (GBaseFinalizeFunc) NULL, \
- \
- (GClassInitFunc) ci, \
- (GClassFinalizeFunc) NULL, \
- \
- NULL, /* class_data */ \
- \
- sizeof (t), \
- 0, /* n_preallocs */ \
- (GInstanceInitFunc) i, \
- }; \
- type = bonobo_x_type_unique ( \
- parent, poa_init, NULL, \
- offset, &info, str); \
- } \
- return type; \
-}
-
-#define GET_STRING_ARRAY_FROM_ELLIPSIS(labels, first_string) \
- { \
- va_list args; \
- int i; \
- char *s; \
- \
- va_start (args, (first_string)); \
- \
- i = 0; \
- for (s = (first_string); s; s = va_arg (args, char *)) \
- i++; \
- va_end (args); \
- \
- (labels) = g_new (char *, i + 1); \
- \
- va_start (args, (first_string)); \
- i = 0; \
- for (s = (first_string); s; s = va_arg (args, char *)) \
- (labels)[i++] = s; \
- \
- va_end (args); \
- (labels)[i] = NULL; \
- }
-
-
-#define GET_DUPLICATED_STRING_ARRAY_FROM_ELLIPSIS(labels, first_string) \
- { \
- int i; \
- GET_STRING_ARRAY_FROM_ELLIPSIS ((labels), (first_string)); \
- for (i = 0; labels[i]; i++) \
- labels[i] = g_strdup (labels[i]); \
- }
-
-
-#if 0
-# define E_OBJECT_CLASS_ADD_SIGNALS(oc,sigs,last) \
- gtk_object_class_add_signals (oc, sigs, last)
-# define E_OBJECT_CLASS_TYPE(oc) (oc)->type
-#else
-# define E_OBJECT_CLASS_ADD_SIGNALS(oc,sigs,last)
-# define E_OBJECT_CLASS_TYPE(oc) G_TYPE_FROM_CLASS (oc)
-#endif
-
-
-typedef enum {
- E_FOCUS_NONE,
- E_FOCUS_CURRENT,
- E_FOCUS_START,
- E_FOCUS_END
-} EFocus;
-int g_str_compare (const void *x,
- const void *y);
-int g_collate_compare (const void *x,
- const void *y);
-int g_int_compare (const void *x,
- const void *y);
-char *e_strdup_strip (const char *string);
-void e_free_object_list (GList *list);
-void e_free_object_slist (GSList *list);
-void e_free_string_list (GList *list);
-void e_free_string_slist (GSList *list);
-char *e_read_file (const char *filename);
-int e_write_file (const char *filename,
- const char *data,
- int flags);
-int e_write_file_mkstemp (char *filename,
- const char *data);
-int e_mkdir_hier (const char *path,
- mode_t mode);
-
-gchar **e_strsplit (const gchar *string,
- const gchar *delimiter,
- gint max_tokens);
-gchar *e_strstrcase (const gchar *haystack,
- const gchar *needle);
-/* This only makes a filename safe for usage as a filename. It still may have shell meta-characters in it. */
-void e_filename_make_safe (gchar *string);
-gchar *e_format_number (gint number);
-gchar *e_format_number_float (gfloat number);
-gboolean e_create_directory (gchar *directory);
-gchar **e_strdupv (const gchar **str_array);
-
-
-typedef int (*ESortCompareFunc) (const void *first,
- const void *second,
- gpointer closure);
-void e_sort (void *base,
- size_t nmemb,
- size_t size,
- ESortCompareFunc compare,
- gpointer closure);
-void e_bsearch (const void *key,
- const void *base,
- size_t nmemb,
- size_t size,
- ESortCompareFunc compare,
- gpointer closure,
- size_t *start,
- size_t *end);
-size_t e_strftime_fix_am_pm (char *s,
- size_t max,
- const char *fmt,
- const struct tm *tm);
-
-size_t e_strftime (char *s,
- size_t max,
- const char *fmt,
- const struct tm *tm);
-
-/* String to/from double conversion functions */
-gdouble e_flexible_strtod (const gchar *nptr,
- gchar **endptr);
-
-/* 29 bytes should enough for all possible values that
- * g_ascii_dtostr can produce with the %.17g format.
- * Then add 10 for good measure */
-#define E_ASCII_DTOSTR_BUF_SIZE (DBL_DIG + 12 + 10)
-gchar *e_ascii_dtostr (gchar *buffer,
- gint buf_len,
- const gchar *format,
- gdouble d);
-
-/* Alternating char * and int arguments with a NULL char * to end.
- Less than 0 for the int means copy the whole string. */
-gchar *e_strdup_append_strings (gchar *first_string,
- ...);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* _E_UTIL_H_ */
diff --git a/e-util/e-xml-hash-utils.c b/e-util/e-xml-hash-utils.c
index e82d5ab237..efb29f5fb6 100644
--- a/e-util/e-xml-hash-utils.c
+++ b/e-util/e-xml-hash-utils.c
@@ -38,7 +38,7 @@ e_xml_to_hash (xmlDoc *doc, EXmlHashType type)
root = xmlDocGetRootElement (doc);
for (node = root->xmlChildrenNode; node; node = node->next) {
- if (node->name == NULL || node->type != XML_ELEMENT_NODE)
+ if (node->name == NULL)
continue;
if (type == E_XML_HASH_TYPE_OBJECT_UID &&
diff --git a/e-util/e-xml-utils.c b/e-util/e-xml-utils.c
deleted file mode 100644
index 437934be65..0000000000
--- a/e-util/e-xml-utils.c
+++ /dev/null
@@ -1,502 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-xml-utils.c
- * Copyright 2000, 2001, Ximian, Inc.
- *
- * Authors:
- * Chris Lahey <clahey@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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.
- */
-
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include "e-xml-utils.h"
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <locale.h>
-#include <unistd.h>
-#include <fcntl.h>
-#include <errno.h>
-#include <math.h>
-#include <string.h>
-#include <libxml/parser.h>
-#include <libxml/xmlmemory.h>
-
-#include "gal/util/e-i18n.h"
-#include "gal/util/e-util.h"
-
-xmlNode *
-e_xml_get_child_by_name (const xmlNode *parent, const xmlChar *child_name)
-{
- xmlNode *child;
-
- g_return_val_if_fail (parent != NULL, NULL);
- g_return_val_if_fail (child_name != NULL, NULL);
-
- for (child = parent->xmlChildrenNode; child != NULL; child = child->next) {
- if (xmlStrcmp (child->name, child_name) == 0) {
- return child;
- }
- }
- return NULL;
-}
-
-/* Returns the first child with the name child_name and the "lang"
- * attribute that matches the current LC_MESSAGES, or else, the first
- * child with the name child_name and no "lang" attribute.
- */
-xmlNode *
-e_xml_get_child_by_name_by_lang (const xmlNode *parent,
- const xmlChar *child_name,
- const gchar *lang)
-{
- xmlNode *child;
- /* This is the default version of the string. */
- xmlNode *C = NULL;
-
- g_return_val_if_fail (parent != NULL, NULL);
- g_return_val_if_fail (child_name != NULL, NULL);
-
- if (lang == NULL) {
-#ifdef HAVE_LC_MESSAGES
- lang = setlocale (LC_MESSAGES, NULL);
-#else
- lang = setlocale (LC_CTYPE, NULL);
-#endif
- }
- for (child = parent->xmlChildrenNode; child != NULL; child = child->next) {
- if (xmlStrcmp (child->name, child_name) == 0) {
- xmlChar *this_lang = xmlGetProp (child, "lang");
- if (this_lang == NULL) {
- C = child;
- } else if (xmlStrcmp(this_lang, "lang") == 0) {
- return child;
- }
- }
- }
- return C;
-}
-
-static xmlNode *
-e_xml_get_child_by_name_by_lang_list_with_score (const xmlNode *parent,
- const gchar *name,
- const GList *lang_list,
- gint *best_lang_score)
-{
- xmlNodePtr best_node = NULL, node;
-
- for (node = parent->xmlChildrenNode; node != NULL; node = node->next) {
- xmlChar *lang;
-
- if (node->name == NULL || strcmp (node->name, name) != 0) {
- continue;
- }
- lang = xmlGetProp (node, "xml:lang");
- if (lang != NULL) {
- const GList *l;
- gint i;
-
- for (l = lang_list, i = 0;
- l != NULL && i < *best_lang_score;
- l = l->next, i++) {
- if (strcmp ((gchar *) l->data, lang) == 0) {
- best_node = node;
- *best_lang_score = i;
- }
- }
- } else {
- if (best_node == NULL) {
- best_node = node;
- }
- }
- xmlFree (lang);
- if (*best_lang_score == 0) {
- return best_node;
- }
- }
-
- return best_node;
-}
-
-/*
- * e_xml_get_child_by_name_by_lang_list:
- *
- */
-xmlNode *
-e_xml_get_child_by_name_by_lang_list (const xmlNode *parent,
- const gchar *name,
- const GList *lang_list)
-{
- gint best_lang_score = INT_MAX;
-
- g_return_val_if_fail (parent != NULL, NULL);
- g_return_val_if_fail (name != NULL, NULL);
-
- if (lang_list == NULL) {
- lang_list = gnome_i18n_get_language_list ("LC_MESSAGES");
- }
- return e_xml_get_child_by_name_by_lang_list_with_score
- (parent,name,
- lang_list,
- &best_lang_score);
-}
-
-/*
- * e_xml_get_child_by_name_no_lang
- *
- */
-xmlNode *
-e_xml_get_child_by_name_no_lang (const xmlNode *parent, const gchar *name)
-{
- xmlNodePtr node;
-
- g_return_val_if_fail (parent != NULL, NULL);
- g_return_val_if_fail (name != NULL, NULL);
-
- for (node = parent->xmlChildrenNode; node != NULL; node = node->next) {
- xmlChar *lang;
-
- if (node->name == NULL || strcmp (node->name, name) != 0) {
- continue;
- }
- lang = xmlGetProp (node, "xml:lang");
- if (lang == NULL) {
- return node;
- }
- xmlFree (lang);
- }
-
- return NULL;
-}
-
-gint
-e_xml_get_integer_prop_by_name (const xmlNode *parent, const xmlChar *prop_name)
-{
- g_return_val_if_fail (parent != NULL, 0);
- g_return_val_if_fail (prop_name != NULL, 0);
-
- return e_xml_get_integer_prop_by_name_with_default (parent, prop_name, 0);
-}
-
-gint
-e_xml_get_integer_prop_by_name_with_default (const xmlNode *parent,
- const xmlChar *prop_name,
- gint def)
-{
- xmlChar *prop;
- gint ret_val = def;
-
- g_return_val_if_fail (parent != NULL, 0);
- g_return_val_if_fail (prop_name != NULL, 0);
-
- prop = xmlGetProp ((xmlNode *) parent, prop_name);
- if (prop != NULL) {
- (void) sscanf (prop, "%d", &ret_val);
- xmlFree (prop);
- }
- return ret_val;
-}
-
-void
-e_xml_set_integer_prop_by_name (xmlNode *parent,
- const xmlChar *prop_name,
- gint value)
-{
- gchar *valuestr;
-
- g_return_if_fail (parent != NULL);
- g_return_if_fail (prop_name != NULL);
-
- valuestr = g_strdup_printf ("%d", value);
- xmlSetProp (parent, prop_name, valuestr);
- g_free (valuestr);
-}
-
-guint
-e_xml_get_uint_prop_by_name (const xmlNode *parent, const xmlChar *prop_name)
-{
- g_return_val_if_fail (parent != NULL, 0);
- g_return_val_if_fail (prop_name != NULL, 0);
-
- return e_xml_get_uint_prop_by_name_with_default (parent, prop_name, 0);
-}
-
-guint
-e_xml_get_uint_prop_by_name_with_default (const xmlNode *parent,
- const xmlChar *prop_name,
- guint def)
-{
- xmlChar *prop;
- guint ret_val = def;
-
- g_return_val_if_fail (parent != NULL, 0);
- g_return_val_if_fail (prop_name != NULL, 0);
-
- prop = xmlGetProp ((xmlNode *) parent, prop_name);
- if (prop != NULL) {
- (void) sscanf (prop, "%u", &ret_val);
- xmlFree (prop);
- }
- return ret_val;
-}
-
-void
-e_xml_set_uint_prop_by_name (xmlNode *parent,
- const xmlChar *prop_name,
- guint value)
-{
- gchar *valuestr;
-
- g_return_if_fail (parent != NULL);
- g_return_if_fail (prop_name != NULL);
-
- valuestr = g_strdup_printf ("%u", value);
- xmlSetProp (parent, prop_name, valuestr);
- g_free (valuestr);
-}
-
-gboolean
-e_xml_get_bool_prop_by_name (const xmlNode *parent,
- const xmlChar *prop_name)
-{
- g_return_val_if_fail (parent != NULL, 0);
- g_return_val_if_fail (prop_name != NULL, 0);
-
- return e_xml_get_bool_prop_by_name_with_default (parent,
- prop_name,
- FALSE);
-}
-
-gboolean
-e_xml_get_bool_prop_by_name_with_default(const xmlNode *parent,
- const xmlChar *prop_name,
- gboolean def)
-{
- xmlChar *prop;
- gboolean ret_val = def;
-
- g_return_val_if_fail (parent != NULL, 0);
- g_return_val_if_fail (prop_name != NULL, 0);
-
- prop = xmlGetProp ((xmlNode *) parent, prop_name);
- if (prop != NULL) {
- if (g_strcasecmp (prop, "true") == 0) {
- ret_val = TRUE;
- } else if (g_strcasecmp (prop, "false") == 0) {
- ret_val = FALSE;
- }
- xmlFree(prop);
- }
- return ret_val;
-}
-
-void
-e_xml_set_bool_prop_by_name (xmlNode *parent, const xmlChar *prop_name, gboolean value)
-{
- g_return_if_fail (parent != NULL);
- g_return_if_fail (prop_name != NULL);
-
- if (value) {
- xmlSetProp (parent, prop_name, "true");
- } else {
- xmlSetProp (parent, prop_name, "false");
- }
-}
-
-gdouble
-e_xml_get_double_prop_by_name (const xmlNode *parent, const xmlChar *prop_name)
-{
- g_return_val_if_fail (parent != NULL, 0);
- g_return_val_if_fail (prop_name != NULL, 0);
-
- return e_xml_get_double_prop_by_name_with_default (parent, prop_name, 0.0);
-}
-
-gdouble
-e_xml_get_double_prop_by_name_with_default (const xmlNode *parent, const xmlChar *prop_name, gdouble def)
-{
- xmlChar *prop;
- gdouble ret_val = def;
-
- g_return_val_if_fail (parent != NULL, 0);
- g_return_val_if_fail (prop_name != NULL, 0);
-
- prop = xmlGetProp ((xmlNode *) parent, prop_name);
- if (prop != NULL) {
- ret_val = e_flexible_strtod (prop, NULL);
- xmlFree (prop);
- }
- return ret_val;
-}
-
-void
-e_xml_set_double_prop_by_name(xmlNode *parent, const xmlChar *prop_name, gdouble value)
-{
- char buffer[E_ASCII_DTOSTR_BUF_SIZE];
- char *format;
-
- g_return_if_fail (parent != NULL);
- g_return_if_fail (prop_name != NULL);
-
- if (fabs (value) < 1e9 && fabs (value) > 1e-5) {
- format = g_strdup_printf ("%%.%df", DBL_DIG);
- } else {
- format = g_strdup_printf ("%%.%dg", DBL_DIG);
- }
- e_ascii_dtostr (buffer, sizeof (buffer), format, value);
- g_free (format);
-
- xmlSetProp (parent, prop_name, buffer);
-}
-
-gchar *
-e_xml_get_string_prop_by_name (const xmlNode *parent, const xmlChar *prop_name)
-{
- g_return_val_if_fail (parent != NULL, 0);
- g_return_val_if_fail (prop_name != NULL, 0);
-
- return e_xml_get_string_prop_by_name_with_default (parent, prop_name, NULL);
-}
-
-gchar *
-e_xml_get_string_prop_by_name_with_default (const xmlNode *parent, const xmlChar *prop_name, const gchar *def)
-{
- xmlChar *prop;
- gchar *ret_val;
-
- g_return_val_if_fail (parent != NULL, 0);
- g_return_val_if_fail (prop_name != NULL, 0);
-
- prop = xmlGetProp ((xmlNode *) parent, prop_name);
- if (prop != NULL) {
- ret_val = g_strdup (prop);
- xmlFree (prop);
- } else {
- ret_val = g_strdup (def);
- }
- return ret_val;
-}
-
-void
-e_xml_set_string_prop_by_name (xmlNode *parent, const xmlChar *prop_name, const gchar *value)
-{
- g_return_if_fail (parent != NULL);
- g_return_if_fail (prop_name != NULL);
-
- if (value != NULL) {
- xmlSetProp (parent, prop_name, value);
- }
-}
-
-gchar *
-e_xml_get_translated_string_prop_by_name (const xmlNode *parent, const xmlChar *prop_name)
-{
- xmlChar *prop;
- gchar *ret_val = NULL;
- gchar *combined_name;
-
- g_return_val_if_fail (parent != NULL, 0);
- g_return_val_if_fail (prop_name != NULL, 0);
-
- prop = xmlGetProp ((xmlNode *) parent, prop_name);
- if (prop != NULL) {
- ret_val = g_strdup (prop);
- xmlFree (prop);
- return ret_val;
- }
-
- combined_name = g_strdup_printf("_%s", prop_name);
- prop = xmlGetProp ((xmlNode *) parent, combined_name);
- if (prop != NULL) {
- ret_val = g_strdup (gettext(prop));
- xmlFree (prop);
- }
- g_free(combined_name);
-
- return ret_val;
-}
-
-
-int
-e_xml_save_file (const char *filename, xmlDocPtr doc)
-{
- char *filesave, *slash, *xmlbuf;
- size_t n, written = 0;
- int ret, fd, size;
- int errnosave;
- ssize_t w;
-
- filesave = alloca (strlen (filename) + 5);
- slash = strrchr (filename, '/');
- if (slash)
- sprintf (filesave, "%.*s.#%s", slash - filename + 1, filename, slash + 1);
- else
- sprintf (filesave, ".#%s", filename);
-
- fd = open (filesave, O_WRONLY | O_CREAT | O_TRUNC, 0600);
- if (fd == -1)
- return -1;
-
- xmlDocDumpFormatMemory (doc, (xmlChar **) &xmlbuf, &size, TRUE);
- if (size <= 0) {
- close (fd);
- unlink (filesave);
- errno = ENOMEM;
- return -1;
- }
-
- n = (size_t) size;
- do {
- do {
- w = write (fd, xmlbuf + written, n - written);
- } while (w == -1 && errno == EINTR);
-
- if (w > 0)
- written += w;
- } while (w != -1 && written < n);
-
- xmlFree (xmlbuf);
-
- if (written < n || fsync (fd) == -1) {
- errnosave = errno;
- close (fd);
- unlink (filesave);
- errno = errnosave;
- return -1;
- }
-
- while ((ret = close (fd)) == -1 && errno == EINTR)
- ;
-
- if (ret == -1)
- return -1;
-
- if (rename (filesave, filename) == -1) {
- errnosave = errno;
- unlink (filesave);
- errno = errnosave;
- return -1;
- }
-
- return 0;
-}
diff --git a/e-util/e-xml-utils.h b/e-util/e-xml-utils.h
deleted file mode 100644
index 6c39ee6f79..0000000000
--- a/e-util/e-xml-utils.h
+++ /dev/null
@@ -1,101 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-xml-utils.h
- * Copyright 2000, 2001, Ximian, Inc.
- *
- * Authors:
- * Chris Lahey <clahey@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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.
- */
-
-#ifndef __E_XML_UTILS__
-#define __E_XML_UTILS__
-
-#include <glib.h>
-#include <libxml/tree.h>
-
-G_BEGIN_DECLS
-
-xmlNode *e_xml_get_child_by_name (const xmlNode *parent,
- const xmlChar *child_name);
-/* lang set to NULL means use the current locale. */
-xmlNode *e_xml_get_child_by_name_by_lang (const xmlNode *parent,
- const xmlChar *child_name,
- const gchar *lang);
-/* lang_list set to NULL means use the current locale. */
-xmlNode *e_xml_get_child_by_name_by_lang_list (const xmlNode *parent,
- const gchar *name,
- const GList *lang_list);
-xmlNode *e_xml_get_child_by_name_no_lang (const xmlNode *parent,
- const gchar *name);
-
-
-gint e_xml_get_integer_prop_by_name (const xmlNode *parent,
- const xmlChar *prop_name);
-gint e_xml_get_integer_prop_by_name_with_default (const xmlNode *parent,
- const xmlChar *prop_name,
- gint def);
-void e_xml_set_integer_prop_by_name (xmlNode *parent,
- const xmlChar *prop_name,
- gint value);
-
-
-guint e_xml_get_uint_prop_by_name (const xmlNode *parent,
- const xmlChar *prop_name);
-guint e_xml_get_uint_prop_by_name_with_default (const xmlNode *parent,
- const xmlChar *prop_name,
- guint def);
-void e_xml_set_uint_prop_by_name (xmlNode *parent,
- const xmlChar *prop_name,
- guint value);
-
-
-gboolean e_xml_get_bool_prop_by_name (const xmlNode *parent,
- const xmlChar *prop_name);
-gboolean e_xml_get_bool_prop_by_name_with_default (const xmlNode *parent,
- const xmlChar *prop_name,
- gboolean def);
-void e_xml_set_bool_prop_by_name (xmlNode *parent,
- const xmlChar *prop_name,
- gboolean value);
-
-gdouble e_xml_get_double_prop_by_name (const xmlNode *parent,
- const xmlChar *prop_name);
-gdouble e_xml_get_double_prop_by_name_with_default (const xmlNode *parent,
- const xmlChar *prop_name,
- gdouble def);
-void e_xml_set_double_prop_by_name ( xmlNode *parent,
- const xmlChar *prop_name,
- gdouble value);
-
-
-gchar *e_xml_get_string_prop_by_name (const xmlNode *parent,
- const xmlChar *prop_name);
-gchar *e_xml_get_string_prop_by_name_with_default (const xmlNode *parent,
- const xmlChar *prop_name,
- const gchar *def);
-void e_xml_set_string_prop_by_name (xmlNode *parent,
- const xmlChar *prop_name,
- const gchar *value);
-
-gchar *e_xml_get_translated_string_prop_by_name (const xmlNode *parent,
- const xmlChar *prop_name);
-
-int e_xml_save_file (const char *filename, xmlDocPtr doc);
-
-G_END_DECLS
-
-#endif /* __E_XML_UTILS__ */
diff --git a/filter/ChangeLog b/filter/ChangeLog
index fecaf39274..28c3cf5812 100644
--- a/filter/ChangeLog
+++ b/filter/ChangeLog
@@ -1,334 +1,3 @@
-2003-03-28 Not Zed <NotZed@Ximian.com>
-
- * filter-datespec.c (button_clicked): cast warning.
-
-2003-03-26 Jeffrey Stedfast <fejj@ximian.com>
-
- * filter-file.c (xml_decode): Loop over child nodes here too in
- order to not be affected by libxml2 crack.
-
- * filter-source.c (xml_decode): Fixed to disreguard libxml2 crack.
- (get_widget): Use strcmp instead of e_url_equal().
-
-2003-03-20 Dan Winship <danw@ximian.com>
-
- * filter-datespec.c (timespans, set_button): Change the strings in
- the timespans array from "second" / "seconds" to "1 second ago" /
- "%d seconds ago", etc, and update the code in set_button that uses
- them. Fixes #36245, translation clash between the "second" here
- and the one in the calendar (where it's used as "2nd").
- (button_clicked): Fix this so we don't get stuck inside
- gtk_dialog_run's main loop forever.
-
-2003-03-20 Jeffrey Stedfast <fejj@ximian.com>
-
- * rule-editor.c (rule_editor_set_sensitive): Don't return here -
- this is a void function.
- (rule_editor_set_source): Same.
-
-2003-03-18 Not Zed <NotZed@Ximian.com>
-
- * rule-context.c (new_rule_response): use the same code as in
- filter-rule to enforce unique names for all rules/vfolders.
-
-2003-03-17 Jeffrey Stedfast <fejj@ximian.com>
-
- * rule-editor.c (rule_editor_construct): Set the default window
- size to something reasonable (350x400?). Fixes bug #39808.
-
- * vfolder-rule.c (source_remove): Fixed to work properly. Fixes
- bug #39654.
-
- * rule-editor.c (rule_editor_construct): Always add a Cancel
- button here, but if !enable_undo - make the response id
- GTK_RESPONSE_CANCEL rather than GTK_RESPONSE_REJECT (which does
- undo). This mimics the behaviour that was done in the mail/ code
- previously. Fixes bug #39809.
-
-2003-03-11 Not Zed <NotZed@Ximian.com>
-
- * rule-context.c (revert): go to the proper level of child node
- before looking for rule sets, fix for #39165 to make 'cancel' work.
-
-2003-03-06 Jeffrey Stedfast <fejj@ximian.com>
-
- Fixes for bug #39170
-
- * filter-element.c (filter_element_xml_create): Remove return
- keyword.
- (filter_element_build_code): Same.
- (filter_element_format_sexp): Here too.
-
-2003-02-20 Not Zed <NotZed@Ximian.com>
-
- * filter-source.c (filter_source_get_sources): Change to use
- EAccountList, etc.
-
-2003-02-12 Jeffrey Stedfast <fejj@ximian.com>
-
- * vfolder-rule.c (source_add): Get rid of the need for the
- GTK_WIDGET_DESTROYED() check.
-
-2003-02-07 Jeffrey Stedfast <fejj@ximian.com>
-
- * filter-editor.c (filter_editor_new): Use g_object_new()
- instead of gtk_type_new().
-
- * vfolder-editor.c (vfolder_editor_new): Use g_object_new()
- instead of gtk_type_new().
-
- * score-editor.c (score_editor_new): Use g_object_new() instead of
- gtk_type_new().
-
- * rule-editor.c (rule_editor_new): Use g_object_new() instead of
- gtk_type_new().
- (rule_add): Use gtk_window_set_resizable() instead of the
- deprecated gtk_window_set_policy().
- (rule_edit): Same here.
- (rule_editor_construct): Here too.
-
- * rule-context.c (rule_context_add_rule_gui): Use
- gtk_window_set_resizable() instead of the deprecated
- gtk_window_set_policy().
-
-2003-02-05 Dan Winship <danw@ximian.com>
-
- * Makefile.am (gladedir): Defined in configure.in now
- (filterdir): Define using privdatadir
-
-2003-01-22 Ettore Perazzoli <ettore@ximian.com>
-
- * Makefile.am (gladedir): Version using $(BASE_VERSION).
- (filterdir): Likewise.
-
-2003-01-15 Not Zed <NotZed@Ximian.com>
-
- * vfolder-rule.c (get_widget): dont re-use 'widget', its the
- return value!
-
-2003-01-15 Jeffrey Stedfast <fejj@ximian.com>
-
- * rule-context.c (save): Back to using e_xml_save_file().
-
-2003-01-14 Ettore Perazzoli <ettore@ximian.com>
-
- * rule-editor.c (rule_add): Change dialog from OK/Cancel to
- Cancel/OK to match HIG.
- (rule_edit): Likewise.
- (rule_editor_construct): Likewise.
-
- * rule-context.c (rule_context_add_rule_gui): Change dialog from
- OK/Cancel to Cancel/OK to match HIG.
-
- * filter-datespec.c (button_clicked): Change dialog from OK/Cancel
- to Cancel/OK to match HIG.
-
-2003-01-03 Jeffrey Stedfast <fejj@ximian.com>
-
- * rule-editor.c (add_editor_response): Scroll to the newly added
- row. Fixes bug #3725.
- (rule_delete): Scroll to the selected row.
- (rule_move): After moving the row, re-select it and then scroll to
- make sure that it is still visible. Fixes bug #7800.
-
-2003-01-02 Jeffrey Stedfast <fejj@ximian.com>
-
- Fixed to build with -DG_DISABLE_DEPRECATED and
- -DGTK_DISABLE_DEPRECATED
-
-2002-12-12 Jeffrey Stedfast <fejj@ximian.com>
-
- * rule-editor.c (cursor_changed): Use an easier method for getting
- the iter.
-
-2002-12-12 Jeffrey Stedfast <fejj@ximian.com>
-
- * vfolder-rule.c (vfolder_editor_sourcelist_new): New custom
- function for creating the source_list widget.
- (get_widget): Removed the source_list creation code.
-
- * rule-editor.c (rule_editor_construct): Listen to row-activated
- for double-click events. Also, removed the model creation code out
- of here.
- (rule_editor_treeview_new): Moved the treeview and model creation
- code into here instead, and made the glade widgets into custom
- widgets.
-
-2002-11-26 Not Zed <NotZed@Ximian.com>
-
- * vfolder-rule.c (get_widget): Add a textcellrenderer to display
- the folders.
- (get_widget): Remove FIXME which was wrong.
-
- * filter-rule.c (filter_rule_validate): FILTER_RULE_CLASS ->
- _GET_CLASS
-
- * rule-context.c (rule_context_save): RULE_CONTEXT_CLASS ->
- RULE_CONTEXT_GET_CLASS
- (rule_context_revert): "
-
- * *.[ch]: Ran fix.sh over all files.
-
- * rule-editor.c (rule_add): widget:set_parent ->
- window:set_transient_for
- (editor_response): renamed from editor_clicked, handle gtk dialog
- response codes.
- (rule_edit): connect to response rather than clicked.
- (rule_editor_construct): Setup a text column in the tree view.
- Not sure if this can be handled via glade.
-
-2002-11-20 Jeffrey Stedfast <fejj@ximian.com>
-
- * filter-label.c (xml_create): gconfify.
-
-2002-11-18 Jeffrey Stedfast <fejj@ximian.com>
-
- * rule-editor.c: Updated to use GtkTreeView.
-
- * vfolder-rule.c: Same.
-
-2002-11-13 Not Zed <NotZed@Ximian.com>
-
- * rule-context.c (load): Get the root node properly.
-
- * rule-editor.c (rule_add): cast g_object_weak_ref
- (rule_edit): "
-
- * all: xml2 node change - childs->children. Also, ignore 'text'
- nodes while scanning tree.
-
- * rule-context.h: gnome-xml->libxml.
-
- * filter-element.h: gnome-xml->libxml
-
- * vfolder-rule.c (source_add): comment out gtk_destroyed check.
-
- * filter-label.c: Added back some of the guts. Might not work but
- some of the code uses it :-/. Gives u a fixed set of non-editable
- labels.
-
-2002-11-08 Jeffrey Stedfast <fejj@ximian.com>
-
- * rule-editor.c (rule_edit): Use weak_ref instead of connecting to
- "destroy".
- (rule_add): Same.
-
-2002-11-07 Jeffrey Stedfast <fejj@ximian.com>
-
- * vfolder-rule.c (validate): Use a GtkDialog instead of a
- GnomeDialog for reporting errors.
-
- * rule-editor.c (rule_add): Use a GtkDialog instead of
- GnomeDialog.
- (rule_edit): Same.
- (add_editor_response): Use a GtkMessageDialog for the error
- reporting instead of a GnomeDialog.
- (edit_editor_response): Same.
-
- * rule-context.c (rule_context_add_rule_gui): Use a GtkDialog
- instead of a GnomeDialog.
-
- * filter-rule.c (validate): Use GtkDialog instead of GnomeDialog
- here.
-
- * filter-input.c (validate): Use GtkDialog instead of GnomeDialog
- here.
-
- * filter-folder.c (validate): Use GtkDialog instead of GnomeDialog
- here.
-
- * filter-file.c (validate): Use GtkDialog instead of GnomeDialog
- here.
-
- * rule-editor.c: Subclass GtkDialog instead of GnomeDialog.
-
- * filter-datespec.c (validate): Use GtkDialog instead of
- GnomeDialog.
- (button_clicked): Same.
-
-2002-11-06 Jeffrey Stedfast <fejj@ximian.com>
-
- * filter-label.c (xml_create): Deleted most of the internals until
- we devise a gconf schema and redesign how we want to do this. It
- didn't work correctly for 1.2 anyway.
-
- * filter.glade: Converted to the glade-2 format.
-
-2002-11-05 Jeffrey Stedfast <fejj@ximian.com>
-
- * filter-filter.c: Ported.
-
- * filter-source.c (get_widget): Don't use e_utf8_to_gtk_string.
-
- * filter-option.c (xml_create): Don't use e_utf8_xml1_decode.
-
- * filter-input.c (xml_encode): Don't use e_utf8_xml1_encode.
- (xml_decode): Don't use e_utf8_xml1_decode.
- (entry_changed): Don't use e_utf8_gtk_entry_get_text.
- (get_widget): Don't use e_utf8_gtk_entry_set_text.
-
- * filter-file.c (xml_encode): Don't use e_utf8_xml1_encode shit.
- (xml_decode): Don't use e_utf8_xml1_decode.
- (entry_changed): Don't use e_utf8_gtk_entry_get_text.
- (get_widget): Don't use e_utf8_gtk_entry_set_text.
-
-2002-11-05 Jeffrey Stedfast <fejj@ximian.com>
-
- * vfolder-rule.c: Ported.
-
- * vfolder-editor.c: Ported.
-
- * vfolder-context.c: Ported.
-
-2002-11-05 Jeffrey Stedfast <fejj@ximian.com>
-
- * filter-rule.c: Ported.
-
- * score-rule.c: Ported.
-
- * score-editor.c: Ported. Again, thise code seems to be unused.
-
- * score-context.c: Ported. Although it seems this code isn't
- really used anywhere?
-
-2002-11-04 Jeffrey Stedfast <fejj@ximian.com>
-
- * filter-part.c: Ported.
-
- * filter-editor.c: Also ported.
-
- * rule-editor.c: Ported to gtk2 and removed unnecessary e_utf8 snot.
-
-2002-11-02 Jeffrey Stedfast <fejj@ximian.com>
-
- * filter-context.c: Ported this too.
-
- * rule-context.c: Ported to glib2/GObject.
-
-2002-11-01 Jeffrey Stedfast <fejj@ximian.com>
-
- * filter-element.c: Ported to GObject.
-
- * filter-input.c: Same.
-
- * filter-code.c: This too.
-
- * filter-colour.c: And this.
-
- * filter-datespec.c: You guessed it.
-
- * filter-file.c: And again...
-
- * filter-folder.c: Wheee! This is fun...
-
- * filter-int.c: Gee, I wonder...
-
- * filter-label.c: Also ported.
-
- * filter-option.c: Yep, this too.
-
- * filter-source.c: And finally this one.
-
2002-10-30 Dan Winship <danw@ximian.com>
* rule-editor.c (rule_add): Adjust default rule editor size to
diff --git a/filter/rule-editor.c b/filter/rule-editor.c
index 3fe268ac61..fac6f47476 100644
--- a/filter/rule-editor.c
+++ b/filter/rule-editor.c
@@ -1,10 +1,8 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
/*
- * Copyright (C) 2000-2002 Ximian Inc.
+ * Copyright (C) 2000 Ximian Inc.
*
* Authors: Not Zed <notzed@lostzed.mmc.com.au>
* Jeffrey Stedfast <fejj@ximian.com>
- *
* 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.
@@ -20,32 +18,39 @@
* Boston, MA 02111-1307, USA.
*/
-
-#ifdef HAVE_CONFIG_H
#include <config.h>
-#endif
-
-/* for getenv only, remove when getenv need removed */
-#include <stdlib.h>
+#include <glib.h>
+#include <gtk/gtkframe.h>
+#include <libgnome/gnome-defs.h>
#include <libgnome/gnome-i18n.h>
-
+#include <libgnomeui/gnome-stock.h>
+#include <libgnomeui/gnome-dialog.h>
+#include <libgnomeui/gnome-dialog-util.h>
+#include <glade/glade.h>
+#include <gal/widgets/e-unicode.h>
+#include <gal/util/e-unicode-i18n.h>
#include "rule-editor.h"
+#include "rule-context.h"
+#include "filter-rule.h"
+
+/* for getenv only, remove when getenv need removed */
+#include <stdlib.h>
-static int enable_undo = 0;
+static int enable_undo;
-void rule_editor_add_undo (RuleEditor *re, int type, FilterRule *rule, int rank, int newrank);
-void rule_editor_play_undo (RuleEditor *re);
+void rule_editor_add_undo(RuleEditor *re, int type, FilterRule *rule, int rank, int newrank);
+void rule_editor_play_undo(RuleEditor *re);
#define d(x) x
-static void set_source (RuleEditor *re, const char *source);
-static void set_sensitive (RuleEditor *re);
-static FilterRule *create_rule (RuleEditor *re);
+static void set_source(RuleEditor *re, const char *source);
+static void set_sensitive(RuleEditor *re);
+static FilterRule *create_rule(RuleEditor *re);
-static void rule_editor_class_init (RuleEditorClass *klass);
-static void rule_editor_init (RuleEditor *re);
-static void rule_editor_finalise (GObject *obj);
+static void rule_editor_class_init(RuleEditorClass *class);
+static void rule_editor_init (RuleEditor *gspaper);
+static void rule_editor_finalise (GtkObject *obj);
static void rule_editor_destroy (GtkObject *obj);
#define _PRIVATE(x)(((RuleEditor *)(x))->priv)
@@ -63,77 +68,84 @@ struct _RuleEditorPrivate {
GtkButton *buttons[BUTTON_LAST];
};
-static GtkDialogClass *parent_class = NULL;
+static GnomeDialogClass *parent_class;
+
+enum {
+ LAST_SIGNAL
+};
+static guint signals[LAST_SIGNAL] = { 0 };
-GtkType
-rule_editor_get_type (void)
+guint
+rule_editor_get_type(void)
{
- static GtkType type = 0;
+ static guint type = 0;
if (!type) {
- static const GTypeInfo info = {
- sizeof (RuleEditorClass),
- NULL, /* base_class_init */
- NULL, /* base_class_finalize */
- (GClassInitFunc) rule_editor_class_init,
- NULL, /* class_finalize */
- NULL, /* class_data */
+ GtkTypeInfo type_info = {
+ "RuleEditor",
sizeof (RuleEditor),
- 0, /* n_preallocs */
- (GInstanceInitFunc) rule_editor_init,
+ sizeof (RuleEditorClass),
+ (GtkClassInitFunc) rule_editor_class_init,
+ (GtkObjectInitFunc) rule_editor_init,
+ (GtkArgSetFunc) NULL,
+ (GtkArgGetFunc) NULL
};
-
+
/* TODO: Remove when it works (or never will) */
- enable_undo = getenv ("EVOLUTION_RULE_UNDO") != NULL;
-
- type = g_type_register_static (gtk_dialog_get_type (), "RuleEditor", &info, 0);
+ enable_undo = getenv("EVOLUTION_RULE_UNDO") != NULL;
+
+ type = gtk_type_unique (gnome_dialog_get_type (), &type_info);
}
return type;
}
static void
-rule_editor_class_init (RuleEditorClass *klass)
+rule_editor_class_init (RuleEditorClass *class)
{
- GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
- GtkObjectClass *object_class = (GtkObjectClass *) klass;
+ GtkObjectClass *object_class;
- parent_class = g_type_class_ref(gtk_dialog_get_type ());
+ object_class = (GtkObjectClass *)class;
+ parent_class = gtk_type_class(gnome_dialog_get_type());
- gobject_class->finalize = rule_editor_finalise;
+ object_class->finalize = rule_editor_finalise;
object_class->destroy = rule_editor_destroy;
/* override methods */
- klass->set_source = set_source;
- klass->set_sensitive = set_sensitive;
- klass->create_rule = create_rule;
+ class->set_source = set_source;
+ class->set_sensitive = set_sensitive;
+ class->create_rule = create_rule;
+
+ /* signals */
+
+ gtk_object_class_add_signals (object_class, signals, LAST_SIGNAL);
}
static void
-rule_editor_init (RuleEditor *re)
+rule_editor_init (RuleEditor *o)
{
- re->priv = g_malloc0 (sizeof (*re->priv));
+ o->priv = g_malloc0 (sizeof (*o->priv));
}
static void
-rule_editor_finalise (GObject *obj)
+rule_editor_finalise (GtkObject *obj)
{
RuleEditor *re = (RuleEditor *)obj;
RuleEditorUndo *undo, *next;
-
- g_object_unref (re->context);
+
+ gtk_object_unref (GTK_OBJECT (re->context));
g_free (re->priv);
-
+
undo = re->undo_log;
while (undo) {
next = undo->next;
- g_object_unref (undo->rule);
- g_free (undo);
+ gtk_object_unref((GtkObject *)undo->rule);
+ g_free(undo);
undo = next;
}
- G_OBJECT_CLASS (parent_class)->finalize (obj);
+ ((GtkObjectClass *)(parent_class))->finalize (obj);
}
static void
@@ -141,10 +153,8 @@ rule_editor_destroy (GtkObject *obj)
{
RuleEditor *re = (RuleEditor *) obj;
- if (re->dialog) {
+ if (re->dialog)
gtk_widget_destroy (GTK_WIDGET (re->dialog));
- re->dialog = NULL;
- }
((GtkObjectClass *)(parent_class))->destroy (obj);
}
@@ -157,42 +167,42 @@ rule_editor_destroy (GtkObject *obj)
* Return value: A new #RuleEditor object.
**/
RuleEditor *
-rule_editor_new (RuleContext *rc, const char *source)
+rule_editor_new (RuleContext *f, const char *source)
{
- RuleEditor *re = (RuleEditor *) g_object_new (RULE_TYPE_EDITOR, NULL);
GladeXML *gui;
+ RuleEditor *o = (RuleEditor *)gtk_type_new (rule_editor_get_type ());
GtkWidget *w;
- gui = glade_xml_new (FILTER_GLADEDIR "/filter.glade", "rule_editor", NULL);
- rule_editor_construct (re, rc, gui, source);
+ gui = glade_xml_new (FILTER_GLADEDIR "/filter.glade", "rule_editor");
+ rule_editor_construct (o, f, gui, source);
w = glade_xml_get_widget (gui, "rule_frame");
- gtk_frame_set_label ((GtkFrame *) w, _("Rules"));
+ gtk_frame_set_label ((GtkFrame *)w, _("Rules"));
- g_object_unref (gui);
+ gtk_object_unref (GTK_OBJECT (gui));
- return re;
+ return o;
}
/* used internally by implementations if required */
void
rule_editor_set_sensitive (RuleEditor *re)
{
- RULE_EDITOR_GET_CLASS (re)->set_sensitive (re);
+ return ((RuleEditorClass *)((GtkObject *)re)->klass)->set_sensitive(re);
}
/* used internally by implementations */
void
rule_editor_set_source (RuleEditor *re, const char *source)
{
- RULE_EDITOR_GET_CLASS (re)->set_source (re, source);
+ return ((RuleEditorClass *)((GtkObject *)re)->klass)->set_source(re, source);
}
/* factory method for "add" button */
FilterRule *
rule_editor_create_rule (RuleEditor *re)
{
- return RULE_EDITOR_GET_CLASS (re)->create_rule (re);
+ return ((RuleEditorClass *)((GtkObject *)re)->klass)->create_rule(re);
}
static FilterRule *
@@ -209,65 +219,69 @@ create_rule (RuleEditor *re)
}
static void
-editor_destroy (RuleEditor *re, GObject *deadbeef)
+add_editor_clicked (GtkWidget *dialog, int button, RuleEditor *re)
{
- if (re->edit) {
- g_object_unref (re->edit);
- re->edit = NULL;
- }
-
- re->dialog = NULL;
-
- gtk_widget_set_sensitive (GTK_WIDGET (re), TRUE);
- rule_editor_set_sensitive (re);
-}
+ GtkWidget *item;
+ GList *l = NULL;
+ char *string;
-static void
-add_editor_response (GtkWidget *dialog, int button, RuleEditor *re)
-{
- GtkTreeSelection *selection;
- GtkTreePath *path;
- GtkTreeIter iter;
-
- if (button == GTK_RESPONSE_ACCEPT) {
+ switch (button) {
+ case 0:
if (!filter_rule_validate (re->edit)) {
/* no need to popup a dialog because the validate code does that. */
return;
}
-
- if (rule_context_find_rule (re->context, re->edit->name, re->edit->source)) {
- dialog = gtk_message_dialog_new ((GtkWindow *) dialog, GTK_DIALOG_DESTROY_WITH_PARENT,
- GTK_MESSAGE_ERROR, GTK_BUTTONS_CLOSE,
- _("Rule name '%s' is not unique, choose another."),
- re->edit->name);
-
- gtk_dialog_run ((GtkDialog *) dialog);
- gtk_widget_destroy (dialog);
-
+
+ if (rule_context_find_rule(re->context, re->edit->name, re->edit->source)) {
+ GtkWidget *dialog;
+ char *what;
+
+ what = g_strdup_printf(_("Rule name '%s' is not unique, choose another"), re->edit->name);
+ dialog = gnome_ok_dialog (what);
+ g_free(what);
+ gnome_dialog_run_and_close (GNOME_DIALOG (dialog));
+
return;
}
- g_object_ref (re->edit);
+ gtk_object_ref (GTK_OBJECT (re->edit));
+ string = e_utf8_to_gtk_string (GTK_WIDGET (re->list), re->edit->name);
+ item = gtk_list_item_new_with_label (string);
+ g_free (string);
+
+ gtk_object_set_data (GTK_OBJECT (item), "rule", re->edit);
+ gtk_widget_show (item);
- gtk_list_store_append (re->model, &iter);
- gtk_list_store_set (re->model, &iter, 0, re->edit->name, 1, re->edit, -1);
- selection = gtk_tree_view_get_selection (re->list);
- gtk_tree_selection_select_iter (selection, &iter);
+ l = g_list_append (l, GTK_LIST_ITEM (item));
- /* scroll to the newly added row */
- path = gtk_tree_model_get_path ((GtkTreeModel *) re->model, &iter);
- gtk_tree_view_scroll_to_cell (re->list, path, NULL, TRUE, 1.0, 0.0);
- gtk_tree_path_free (path);
+ gtk_list_append_items (re->list, l);
+ gtk_list_select_child (re->list, item);
re->current = re->edit;
rule_context_add_rule (re->context, re->current);
+
+ gtk_object_ref((GtkObject *)re->current);
+ rule_editor_add_undo(re, RULE_EDITOR_LOG_ADD, re->current, rule_context_get_rank_rule (re->context, re->current, re->current->source), 0);
+ case 1:
+ default:
+ gnome_dialog_close (GNOME_DIALOG (dialog));
+ case -1:
+ if (re->edit) {
+ gtk_object_unref (GTK_OBJECT (re->edit));
+ re->edit = NULL;
+ }
+
+ re->dialog = NULL;
- g_object_ref (re->current);
- rule_editor_add_undo (re, RULE_EDITOR_LOG_ADD, re->current,
- rule_context_get_rank_rule (re->context, re->current, re->current->source), 0);
+ gtk_widget_set_sensitive (GTK_WIDGET (re), TRUE);
+ rule_editor_set_sensitive (re);
}
-
- gtk_widget_destroy (dialog);
+}
+
+static void
+add_editor_destroyed(GtkWidget *w, RuleEditor *re)
+{
+ add_editor_clicked(w, -1, re);
}
static void
@@ -282,73 +296,82 @@ rule_add (GtkWidget *widget, RuleEditor *re)
filter_rule_set_source (re->edit, re->source);
rules = filter_rule_get_widget (re->edit, re->context);
- re->dialog = gtk_dialog_new ();
- gtk_dialog_add_buttons ((GtkDialog *) re->dialog,
- GTK_STOCK_CANCEL, GTK_RESPONSE_REJECT,
- GTK_STOCK_OK, GTK_RESPONSE_ACCEPT,
- NULL);
+ re->dialog = gnome_dialog_new (_("Add Rule"),
+ GNOME_STOCK_BUTTON_OK,
+ GNOME_STOCK_BUTTON_CANCEL,
+ NULL);
- gtk_window_set_title ((GtkWindow *) re->dialog, _("Add Rule"));
gtk_window_set_default_size (GTK_WINDOW (re->dialog), 650, 400);
- gtk_window_set_resizable (GTK_WINDOW (re->dialog), TRUE);
- gtk_window_set_transient_for ((GtkWindow *) re->dialog, (GtkWindow *) re);
-
- gtk_box_pack_start (GTK_BOX (GTK_DIALOG (re->dialog)->vbox), rules, TRUE, TRUE, 0);
-
- g_signal_connect (re->dialog, "response", G_CALLBACK (add_editor_response), re);
- g_object_weak_ref ((GObject *) re->dialog, (GWeakNotify) editor_destroy, re);
-
+ gtk_window_set_policy (GTK_WINDOW (re->dialog), FALSE, TRUE, FALSE);
+ gtk_widget_set_parent_window (GTK_WIDGET (re->dialog), GTK_WIDGET (re)->window);
+ gtk_box_pack_start (GTK_BOX (GNOME_DIALOG (re->dialog)->vbox), rules, TRUE, TRUE, 0);
+ gtk_signal_connect (GTK_OBJECT (re->dialog), "clicked", add_editor_clicked, re);
+ gtk_signal_connect (GTK_OBJECT (re->dialog), "destroy", add_editor_destroyed, re);
gtk_widget_set_sensitive (GTK_WIDGET (re), FALSE);
gtk_widget_show (re->dialog);
}
static void
-edit_editor_response (GtkWidget *dialog, int button, RuleEditor *re)
+edit_editor_clicked (GtkWidget *dialog, int button, RuleEditor *re)
{
- FilterRule *rule;
- GtkTreePath *path;
- GtkTreeIter iter;
+ GtkWidget *item;
+ char *string;
int pos;
-
- if (button == GTK_RESPONSE_ACCEPT) {
+ struct _FilterRule *rule;
+
+ switch (button) {
+ case 0:
if (!filter_rule_validate (re->edit)) {
/* no need to popup a dialog because the validate code does that. */
return;
}
-
- rule = rule_context_find_rule (re->context, re->edit->name, re->edit->source);
+
+ rule = rule_context_find_rule(re->context, re->edit->name, re->edit->source);
if (rule != NULL && rule != re->current) {
- dialog = gtk_message_dialog_new ((GtkWindow *) dialog,
- GTK_DIALOG_DESTROY_WITH_PARENT,
- GTK_MESSAGE_ERROR, GTK_BUTTONS_CLOSE,
- _("Rule name '%s' is not unique, choose another."),
- re->edit->name);
-
- gtk_dialog_run ((GtkDialog *) dialog);
- gtk_widget_destroy (dialog);
-
+ GtkWidget *dialog;
+ char *what;
+
+ what = g_strdup_printf(_("Rule name '%s' is not unique, choose another"), re->edit->name);
+ dialog = gnome_ok_dialog (what);
+ g_free(what);
+ gnome_dialog_run_and_close (GNOME_DIALOG (dialog));
+
return;
}
pos = rule_context_get_rank_rule (re->context, re->current, re->source);
if (pos != -1) {
- path = gtk_tree_path_new ();
- gtk_tree_path_append_index (path, pos);
- gtk_tree_model_get_iter (GTK_TREE_MODEL (re->model), &iter, path);
- gtk_tree_path_free (path);
-
- gtk_list_store_set (re->model, &iter, 0, re->edit->name, -1);
-
- rule_editor_add_undo (re, RULE_EDITOR_LOG_EDIT, filter_rule_clone (re->current),
- pos, 0);
-
+ item = g_list_nth_data (GTK_LIST (re->list)->children, pos);
+ string = e_utf8_to_gtk_string (GTK_WIDGET (item), re->edit->name);
+ gtk_label_set_text (GTK_LABEL (GTK_BIN (item)->child), string);
+ g_free (string);
+
+ rule_editor_add_undo(re, RULE_EDITOR_LOG_EDIT, filter_rule_clone(re->current), pos, 0);
+
/* replace the old rule with the new rule */
filter_rule_copy (re->current, re->edit);
}
+ case 1:
+ default:
+ gnome_dialog_close (GNOME_DIALOG (dialog));
+ case -1:
+ if (re->edit) {
+ gtk_object_unref (GTK_OBJECT (re->edit));
+ re->edit = NULL;
+ }
+
+ re->dialog = NULL;
+
+ gtk_widget_set_sensitive (GTK_WIDGET (re), TRUE);
+ rule_editor_set_sensitive (re);
}
-
- gtk_widget_destroy (dialog);
+}
+
+static void
+edit_editor_destroyed(GtkWidget *w, RuleEditor *re)
+{
+ edit_editor_clicked(w, -1, re);
}
static void
@@ -362,22 +385,17 @@ rule_edit (GtkWidget *widget, RuleEditor *re)
re->edit = filter_rule_clone (re->current);
rules = filter_rule_get_widget (re->edit, re->context);
-
- re->dialog = gtk_dialog_new ();
- gtk_dialog_add_buttons ((GtkDialog *) re->dialog,
- GTK_STOCK_CANCEL, GTK_RESPONSE_REJECT,
- GTK_STOCK_OK, GTK_RESPONSE_ACCEPT,
- NULL);
-
- gtk_window_set_title ((GtkWindow *) re->dialog, _("Edit Rule"));
- gtk_window_set_default_size (GTK_WINDOW (re->dialog), 650, 400);
- gtk_window_set_resizable (GTK_WINDOW (re->dialog), TRUE);
- gtk_widget_set_parent_window (GTK_WIDGET (re->dialog), GTK_WIDGET (re)->window);
-
- gtk_box_pack_start (GTK_BOX (GTK_DIALOG (re->dialog)->vbox), rules, TRUE, TRUE, 0);
-
- g_signal_connect (re->dialog, "response", G_CALLBACK (edit_editor_response), re);
- g_object_weak_ref ((GObject *) re->dialog, (GWeakNotify) editor_destroy, re);
+ re->dialog = gnome_dialog_new (_("Edit Rule"),
+ GNOME_STOCK_BUTTON_OK,
+ GNOME_STOCK_BUTTON_CANCEL,
+ NULL);
+
+ gnome_dialog_set_parent (GNOME_DIALOG (re->dialog), GTK_WINDOW (re));
+ gtk_window_set_default_size (GTK_WINDOW (re->dialog), 600, 400);
+ gtk_window_set_policy (GTK_WINDOW (re->dialog), FALSE, TRUE, FALSE);
+ gtk_box_pack_start (GTK_BOX (GNOME_DIALOG (re->dialog)->vbox), rules, TRUE, TRUE, 0);
+ gtk_signal_connect (GTK_OBJECT (re->dialog), "clicked", edit_editor_clicked, re);
+ gtk_signal_connect (GTK_OBJECT (re->dialog), "destroy", edit_editor_destroyed, re);
gtk_widget_set_sensitive (GTK_WIDGET (re), FALSE);
@@ -387,47 +405,32 @@ rule_edit (GtkWidget *widget, RuleEditor *re)
static void
rule_delete (GtkWidget *widget, RuleEditor *re)
{
- GtkTreeSelection *selection;
- GtkTreePath *path;
- GtkTreeIter iter;
- int pos, len;
+ int pos;
+ GList *l;
+ GtkListItem *item;
d(printf ("delete rule\n"));
pos = rule_context_get_rank_rule (re->context, re->current, re->source);
if (pos != -1) {
+ int len;
+
rule_context_remove_rule (re->context, re->current);
- path = gtk_tree_path_new ();
- gtk_tree_path_append_index (path, pos);
- gtk_tree_model_get_iter (GTK_TREE_MODEL (re->model), &iter, path);
- gtk_list_store_remove (re->model, &iter);
- gtk_tree_path_free (path);
+ item = g_list_nth_data (GTK_LIST (re->list)->children, pos);
+ l = g_list_append (NULL, item);
+ gtk_list_remove_items (re->list, l);
+ g_list_free (l);
- rule_editor_add_undo (re, RULE_EDITOR_LOG_REMOVE, re->current,
- rule_context_get_rank_rule (re->context, re->current, re->current->source), 0);
+ rule_editor_add_undo(re, RULE_EDITOR_LOG_REMOVE, re->current, rule_context_get_rank_rule(re->context, re->current, re->current->source), 0);
#if 0
- g_object_unref (re->current);
+ gtk_object_unref (GTK_OBJECT (re->current));
#endif
re->current = NULL;
/* now select the next rule */
- len = gtk_tree_model_iter_n_children (GTK_TREE_MODEL (re->model), NULL);
+ len = g_list_length (GTK_LIST (re->list)->children);
pos = pos >= len ? len - 1 : pos;
-
- if (pos >= 0) {
- path = gtk_tree_path_new ();
- gtk_tree_path_append_index (path, pos);
- gtk_tree_model_get_iter (GTK_TREE_MODEL (re->model), &iter, path);
- gtk_tree_path_free (path);
-
- selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (re->list));
- gtk_tree_selection_select_iter (selection, &iter);
-
- /* scroll to the selected row */
- path = gtk_tree_model_get_path ((GtkTreeModel *) re->model, &iter);
- gtk_tree_view_scroll_to_cell (re->list, path, NULL, FALSE, 0.0, 0.0);
- gtk_tree_path_free (path);
- }
+ gtk_list_select_item (GTK_LIST (re->list), pos);
}
rule_editor_set_sensitive (re);
@@ -436,41 +439,20 @@ rule_delete (GtkWidget *widget, RuleEditor *re)
static void
rule_move (RuleEditor *re, int from, int to)
{
- GtkTreeSelection *selection;
- GtkTreePath *path;
- GtkTreeIter iter;
- FilterRule *rule;
-
- g_object_ref (re->current);
- rule_editor_add_undo (re, RULE_EDITOR_LOG_RANK, re->current,
- rule_context_get_rank_rule (re->context, re->current, re->current->source), to);
+ GList *l;
+ GtkListItem *item;
+
+ gtk_object_ref((GtkObject *)re->current);
+ rule_editor_add_undo(re, RULE_EDITOR_LOG_RANK, re->current, rule_context_get_rank_rule(re->context, re->current, re->current->source), to);
d(printf ("moving %d to %d\n", from, to));
rule_context_rank_rule (re->context, re->current, to);
- path = gtk_tree_path_new ();
- gtk_tree_path_append_index (path, from);
- gtk_tree_model_get_iter (GTK_TREE_MODEL (re->model), &iter, path);
- gtk_tree_path_free (path);
-
- gtk_tree_model_get (GTK_TREE_MODEL (re->model), &iter, 1, &rule, -1);
- g_assert (rule != NULL);
-
- /* remove and then re-insert the row at the new location */
- gtk_list_store_remove (re->model, &iter);
- gtk_list_store_insert (re->model, &iter, to);
-
- /* set the data on the row */
- gtk_list_store_set (re->model, &iter, 0, rule->name, 1, rule, -1);
-
- /* select the row */
- selection = gtk_tree_view_get_selection (re->list);
- gtk_tree_selection_select_iter (selection, &iter);
-
- /* scroll to the selected row */
- path = gtk_tree_model_get_path ((GtkTreeModel *) re->model, &iter);
- gtk_tree_view_scroll_to_cell (re->list, path, NULL, FALSE, 0.0, 0.0);
- gtk_tree_path_free (path);
+ item = g_list_nth_data (re->list->children, from);
+ l = g_list_append (NULL, item);
+ gtk_list_remove_items_no_unref (re->list, l);
+ gtk_list_insert_items (re->list, l, to);
+ gtk_list_select_child (re->list, GTK_WIDGET (item));
rule_editor_set_sensitive (re);
}
@@ -501,11 +483,11 @@ static struct {
char *name;
GtkSignalFunc func;
} edit_buttons[] = {
- { "rule_add", G_CALLBACK (rule_add) },
- { "rule_edit", G_CALLBACK (rule_edit) },
- { "rule_delete", G_CALLBACK (rule_delete) },
- { "rule_up", G_CALLBACK (rule_up) },
- { "rule_down", G_CALLBACK (rule_down) },
+ { "rule_add", rule_add },
+ { "rule_edit", rule_edit },
+ { "rule_delete", rule_delete },
+ { "rule_up", rule_up },
+ { "rule_down", rule_down },
};
static void
@@ -514,7 +496,7 @@ set_sensitive (RuleEditor *re)
FilterRule *rule = NULL;
int index = -1, count = 0;
- while ((rule = rule_context_next_rule (re->context, rule, re->source))) {
+ while ((rule = rule_context_next_rule(re->context, rule, re->source))) {
if (rule == re->current)
index = count;
count++;
@@ -532,44 +514,47 @@ set_sensitive (RuleEditor *re)
static void
-cursor_changed (GtkTreeView *treeview, RuleEditor *re)
+select_rule (GtkWidget *w, GtkWidget *child, RuleEditor *re)
{
- GtkTreeSelection *selection;
- GtkTreeModel *model;
- GtkTreeIter iter;
+ re->current = gtk_object_get_data (GTK_OBJECT (child), "rule");
- selection = gtk_tree_view_get_selection (re->list);
- if (gtk_tree_selection_get_selected (selection, &model, &iter)) {
- gtk_tree_model_get (GTK_TREE_MODEL (re->model), &iter, 1, &re->current, -1);
-
- g_assert (re->current);
-
- rule_editor_set_sensitive (re);
- }
+ g_assert (re->current);
+
+ rule_editor_set_sensitive (re);
}
-static void
-double_click (GtkTreeView *treeview, GtkTreePath *path, GtkTreeViewColumn *column, RuleEditor *re)
+static gboolean
+double_click (GtkWidget *widget, GdkEventButton *event, RuleEditor *re)
{
- if (re->current)
- rule_edit ((GtkWidget *) treeview, re);
+ if (re->current && event->type == GDK_2BUTTON_PRESS)
+ rule_edit (widget, re);
+
+ return TRUE;
}
static void
set_source (RuleEditor *re, const char *source)
{
FilterRule *rule = NULL;
- GtkTreeIter iter;
+ GList *newitems = NULL;
- gtk_list_store_clear (re->model);
+ gtk_list_clear_items(GTK_LIST(re->list), 0, -1);
- d(printf("Checking for rules that are of type %s\n", source ? source : "<nil>"));
- while ((rule = rule_context_next_rule (re->context, rule, source)) != NULL) {
- d(printf("Adding row '%s'\n", rule->name));
- gtk_list_store_append (re->model, &iter);
- gtk_list_store_set (re->model, &iter, 0, rule->name, 1, rule, -1);
+ d(printf("Checking for rules that are of type %s\n", source?source:"<nil>"));
+ while ((rule = rule_context_next_rule(re->context, rule, source)) != NULL) {
+ GtkWidget *item;
+ char *s;
+
+ d(printf(" hit %s(%s)\n", rule->name, source?source:"<nil>"));
+ s = e_utf8_to_gtk_string (GTK_WIDGET (re->list), rule->name);
+ item = gtk_list_item_new_with_label (s);
+ g_free (s);
+ gtk_object_set_data (GTK_OBJECT (item), "rule", rule);
+ gtk_widget_show (GTK_WIDGET (item));
+ newitems = g_list_append (newitems, item);
}
+ gtk_list_append_items (re->list, newitems);
g_free (re->source);
re->source = g_strdup (source);
re->current = NULL;
@@ -577,30 +562,30 @@ set_source (RuleEditor *re, const char *source)
}
void
-rule_editor_add_undo (RuleEditor *re, int type, FilterRule *rule, int rank, int newrank)
+rule_editor_add_undo(RuleEditor *re, int type, FilterRule *rule, int rank, int newrank)
{
RuleEditorUndo *undo;
-
+
if (!re->undo_active && enable_undo) {
- undo = g_malloc0 (sizeof (*undo));
+ undo = g_malloc0(sizeof(*undo));
undo->rule = rule;
undo->type = type;
undo->rank = rank;
undo->newrank = newrank;
-
+
undo->next = re->undo_log;
re->undo_log = undo;
} else {
- g_object_unref (rule);
+ gtk_object_unref((GtkObject *)rule);
}
}
void
-rule_editor_play_undo (RuleEditor *re)
+rule_editor_play_undo(RuleEditor *re)
{
RuleEditorUndo *undo, *next;
FilterRule *rule;
-
+
re->undo_active = TRUE;
undo = re->undo_log;
re->undo_log = NULL;
@@ -608,101 +593,62 @@ rule_editor_play_undo (RuleEditor *re)
next = undo->next;
switch (undo->type) {
case RULE_EDITOR_LOG_EDIT:
- d(printf ("Undoing edit on rule '%s'\n", undo->rule->name));
- rule = rule_context_find_rank_rule (re->context, undo->rank, undo->rule->source);
+ printf("Undoing edit on rule '%s'\n", undo->rule->name);
+ rule = rule_context_find_rank_rule(re->context, undo->rank, undo->rule->source);
if (rule) {
- d(printf (" name was '%s'\n", rule->name));
- filter_rule_copy (rule, undo->rule);
- d(printf (" name is '%s'\n", rule->name));
+ printf(" name was '%s'\n", rule->name);
+ filter_rule_copy(rule, undo->rule);
+ printf(" name is '%s'\n", rule->name);
} else {
- g_warning ("Could not find the right rule to undo against?");
+ g_warning("Could not find the right rule to undo against?\n");
}
break;
case RULE_EDITOR_LOG_ADD:
- d(printf ("Undoing add on rule '%s'\n", undo->rule->name));
- rule = rule_context_find_rank_rule (re->context, undo->rank, undo->rule->source);
+ printf("Undoing add on rule '%s'\n", undo->rule->name);
+ rule = rule_context_find_rank_rule(re->context, undo->rank, undo->rule->source);
if (rule)
- rule_context_remove_rule (re->context, rule);
+ rule_context_remove_rule(re->context, rule);
break;
case RULE_EDITOR_LOG_REMOVE:
- d(printf ("Undoing remove on rule '%s'\n", undo->rule->name));
- g_object_ref (undo->rule);
- rule_context_add_rule (re->context, undo->rule);
- rule_context_rank_rule (re->context, undo->rule, undo->rank);
+ printf("Undoing remove on rule '%s'\n", undo->rule->name);
+ gtk_object_ref((GtkObject *)undo->rule);
+ rule_context_add_rule(re->context, undo->rule);
+ rule_context_rank_rule(re->context, undo->rule, undo->rank);
break;
case RULE_EDITOR_LOG_RANK:
- rule = rule_context_find_rank_rule (re->context, undo->newrank, undo->rule->source);
+ rule = rule_context_find_rank_rule(re->context, undo->newrank, undo->rule->source);
if (rule)
- rule_context_rank_rule (re->context, rule, undo->rank);
+ rule_context_rank_rule(re->context, rule, undo->rank);
break;
}
-
- g_object_unref (undo->rule);
- g_free (undo);
+ gtk_object_unref((GtkObject *)undo->rule);
+ g_free(undo);
undo = next;
}
re->undo_active = FALSE;
}
static void
-editor_response (GtkWidget *dialog, int button, RuleEditor *re)
+editor_clicked (GtkWidget *dialog, int button, RuleEditor *re)
{
- if (button == GTK_RESPONSE_REJECT) {
+ if (button != 0) {
if (enable_undo)
- rule_editor_play_undo (re);
+ rule_editor_play_undo(re);
else {
RuleEditorUndo *undo, *next;
-
+
undo = re->undo_log;
re->undo_log = 0;
while (undo) {
next = undo->next;
- g_object_unref (undo->rule);
- g_free (undo);
+ gtk_object_unref((GtkObject *)undo->rule);
+ g_free(undo);
undo = next;
}
}
}
}
-GtkWidget *rule_editor_treeview_new (char *widget_name, char *string1, char *string2,
- int int1, int int2);
-
-GtkWidget *
-rule_editor_treeview_new (char *widget_name, char *string1, char *string2, int int1, int int2)
-{
- GtkWidget *table, *scrolled;
- GtkTreeSelection *selection;
- GtkCellRenderer *renderer;
- GtkListStore *model;
-
- scrolled = gtk_scrolled_window_new (NULL, NULL);
- gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled),
- GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
-
- model = gtk_list_store_new (2, G_TYPE_STRING, G_TYPE_POINTER);
- table = gtk_tree_view_new_with_model ((GtkTreeModel *) model);
- gtk_tree_view_set_headers_visible ((GtkTreeView *) table, FALSE);
-
- renderer = gtk_cell_renderer_text_new ();
- gtk_tree_view_insert_column_with_attributes ((GtkTreeView *) table, -1,
- _("Rule name"), renderer,
- "text", 0, NULL);
-
- selection = gtk_tree_view_get_selection ((GtkTreeView *) table);
- gtk_tree_selection_set_mode (selection, GTK_SELECTION_SINGLE);
-
- gtk_container_add (GTK_CONTAINER (scrolled), table);
-
- g_object_set_data ((GObject *) scrolled, "table", table);
- g_object_set_data ((GObject *) scrolled, "model", model);
-
- gtk_widget_show (scrolled);
- gtk_widget_show (table);
-
- return scrolled;
-}
-
void
rule_editor_construct (RuleEditor *re, RuleContext *context, GladeXML *gui, const char *source)
{
@@ -710,38 +656,29 @@ rule_editor_construct (RuleEditor *re, RuleContext *context, GladeXML *gui, cons
int i;
re->context = context;
- g_object_ref (context);
+ gtk_object_ref (GTK_OBJECT (context));
- gtk_window_set_resizable ((GtkWindow *) re, TRUE);
- gtk_window_set_default_size ((GtkWindow *) re, 350, 400);
+ gtk_window_set_policy (GTK_WINDOW (re), FALSE, TRUE, FALSE);
w = glade_xml_get_widget (gui, "rule_editor");
- gtk_box_pack_start (GTK_BOX (GTK_DIALOG (re)->vbox), w, TRUE, TRUE, 0);
+ gtk_box_pack_start (GTK_BOX (GNOME_DIALOG (re)->vbox), w, TRUE, TRUE, 0);
for (i = 0; i < BUTTON_LAST; i++) {
- re->priv->buttons[i] = (GtkButton *) w = glade_xml_get_widget (gui, edit_buttons[i].name);
- g_signal_connect (w, "clicked", edit_buttons[i].func, re);
+ re->priv->buttons[i] = (GtkButton *)w = glade_xml_get_widget (gui, edit_buttons[i].name);
+ gtk_signal_connect (GTK_OBJECT (w), "clicked", edit_buttons[i].func, re);
}
- w = glade_xml_get_widget (gui, "rule_list");
- re->list = (GtkTreeView *) g_object_get_data ((GObject *) w, "table");
- re->model = (GtkListStore *) g_object_get_data ((GObject *) w, "model");
-
- g_signal_connect (re->list, "cursor-changed", G_CALLBACK (cursor_changed), re);
- g_signal_connect (re->list, "row-activated", G_CALLBACK (double_click), re);
-
- g_signal_connect (re, "response", G_CALLBACK (editor_response), re);
+ re->list = (GtkList *) w = glade_xml_get_widget(gui, "rule_list");
+ gtk_signal_connect (GTK_OBJECT (w), "select_child", select_rule, re);
+ gtk_signal_connect (GTK_OBJECT (w), "button_press_event",
+ GTK_SIGNAL_FUNC (double_click), re);
+
+ gtk_signal_connect (GTK_OBJECT (re), "clicked", editor_clicked, re);
rule_editor_set_source (re, source);
-
+
if (enable_undo) {
- gtk_dialog_add_buttons ((GtkDialog *) re,
- GTK_STOCK_CANCEL, GTK_RESPONSE_REJECT,
- GTK_STOCK_OK, GTK_RESPONSE_ACCEPT,
- NULL);
- } else {
- gtk_dialog_add_buttons ((GtkDialog *) re,
- GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
- GTK_STOCK_OK, GTK_RESPONSE_ACCEPT,
- NULL);
- }
+ gnome_dialog_append_buttons (GNOME_DIALOG (re), GNOME_STOCK_BUTTON_OK,
+ GNOME_STOCK_BUTTON_CANCEL, NULL);
+ } else
+ gnome_dialog_append_buttons (GNOME_DIALOG (re), GNOME_STOCK_BUTTON_OK, NULL);
}
diff --git a/filter/vfolder-rule.c b/filter/vfolder-rule.c
index efd58b68a9..a521bbb1c0 100644
--- a/filter/vfolder-rule.c
+++ b/filter/vfolder-rule.c
@@ -1,9 +1,8 @@
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
/*
- * Copyright (C) 2000-2002 Ximian Inc.
+ * Copyright (C) 2000 Ximian Inc.
*
* Author: Not Zed <notzed@lostzed.mmc.com.au>
- * Jeffrey Stedfast <fejj@ximian.com>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of version 2 of the GNU General Public
@@ -20,16 +19,18 @@
* Boston, MA 02111-1307, USA.
*/
-
-#ifdef HAVE_CONFIG_H
#include <config.h>
-#endif
-
-#include <string.h>
-#include <gtk/gtk.h>
-#include <glade/glade.h>
+#include <glib.h>
+#include <gtk/gtkbox.h>
+#include <gtk/gtklist.h>
+#include <gtk/gtkoptionmenu.h>
+#include <libgnome/gnome-defs.h>
#include <libgnome/gnome-i18n.h>
+#include <libgnomeui/gnome-dialog.h>
+#include <libgnomeui/gnome-dialog-util.h>
+#include <glade/glade.h>
+#include <gal/widgets/e-unicode.h>
#include "vfolder-context.h"
#include "vfolder-rule.h"
@@ -37,83 +38,85 @@
#define d(x) x
-static int validate(FilterRule *);
+static gint validate(FilterRule *);
static int vfolder_eq(FilterRule *fr, FilterRule *cm);
static xmlNodePtr xml_encode(FilterRule *);
-static int xml_decode(FilterRule *, xmlNodePtr, RuleContext *f);
+static int xml_decode(FilterRule *, xmlNodePtr, struct _RuleContext *f);
static void rule_copy (FilterRule *dest, FilterRule *src);
/*static void build_code(FilterRule *, GString *out);*/
-static GtkWidget *get_widget(FilterRule *fr, RuleContext *f);
+static GtkWidget *get_widget(FilterRule *fr, struct _RuleContext *f);
extern EvolutionShellClient *global_shell_client;
-static void vfolder_rule_class_init (VfolderRuleClass *klass);
-static void vfolder_rule_init (VfolderRule *vr);
-static void vfolder_rule_finalise (GObject *obj);
+static void vfolder_rule_class_init (VfolderRuleClass *class);
+static void vfolder_rule_init (VfolderRule *gspaper);
+static void vfolder_rule_finalise (GtkObject *obj);
+#define _PRIVATE(x) (((VfolderRule *)(x))->priv)
-static FilterRuleClass *parent_class = NULL;
+struct _VfolderRulePrivate {
+};
+static FilterRuleClass *parent_class;
-GType
+guint
vfolder_rule_get_type (void)
{
- static GType type = 0;
+ static guint type = 0;
if (!type) {
- static const GTypeInfo info = {
- sizeof (VfolderRuleClass),
- NULL, /* base_class_init */
- NULL, /* base_class_finalize */
- (GClassInitFunc) vfolder_rule_class_init,
- NULL, /* class_finalize */
- NULL, /* class_data */
- sizeof (VfolderRule),
- 0, /* n_preallocs */
- (GInstanceInitFunc) vfolder_rule_init,
+ GtkTypeInfo type_info = {
+ "VfolderRule",
+ sizeof(VfolderRule),
+ sizeof(VfolderRuleClass),
+ (GtkClassInitFunc)vfolder_rule_class_init,
+ (GtkObjectInitFunc)vfolder_rule_init,
+ (GtkArgSetFunc)NULL,
+ (GtkArgGetFunc)NULL
};
- type = g_type_register_static (FILTER_TYPE_RULE, "VfolderRule", &info, 0);
+ type = gtk_type_unique(filter_rule_get_type (), &type_info);
}
return type;
}
static void
-vfolder_rule_class_init (VfolderRuleClass *klass)
+vfolder_rule_class_init (VfolderRuleClass *class)
{
- GObjectClass *object_class = G_OBJECT_CLASS (klass);
- FilterRuleClass *fr_class = (FilterRuleClass *) klass;
-
- parent_class = g_type_class_ref (FILTER_TYPE_RULE);
+ GtkObjectClass *object_class;
+ FilterRuleClass *filter_rule = (FilterRuleClass *)class;
+ object_class = (GtkObjectClass *)class;
+ parent_class = gtk_type_class(filter_rule_get_type ());
+
object_class->finalize = vfolder_rule_finalise;
-
+
/* override methods */
- fr_class->validate = validate;
- fr_class->eq = vfolder_eq;
- fr_class->xml_encode = xml_encode;
- fr_class->xml_decode = xml_decode;
- fr_class->copy = rule_copy;
- /*fr_class->build_code = build_code;*/
- fr_class->get_widget = get_widget;
+ filter_rule->validate = validate;
+ filter_rule->eq = vfolder_eq;
+ filter_rule->xml_encode = xml_encode;
+ filter_rule->xml_decode = xml_decode;
+ filter_rule->copy = rule_copy;
+ /*filter_rule->build_code = build_code;*/
+ filter_rule->get_widget = get_widget;
}
static void
-vfolder_rule_init (VfolderRule *vr)
+vfolder_rule_init (VfolderRule *o)
{
- ;
+ o->priv = g_malloc0(sizeof(*o->priv));
}
static void
-vfolder_rule_finalise (GObject *obj)
+vfolder_rule_finalise(GtkObject *obj)
{
- VfolderRule *vr = (VfolderRule *) obj;
+ VfolderRule *o = (VfolderRule *)obj;
- g_list_foreach (vr->sources, (GFunc) g_free, NULL);
- g_list_free (vr->sources);
+ g_list_foreach (o->sources, (GFunc) g_free, NULL);
+ g_list_free (o->sources);
- G_OBJECT_CLASS (parent_class)->finalize (obj);
+ ((GtkObjectClass *)(parent_class))->finalize(obj);
}
/**
@@ -126,35 +129,35 @@ vfolder_rule_finalise (GObject *obj)
VfolderRule *
vfolder_rule_new (void)
{
- return (VfolderRule *) g_object_new (VFOLDER_TYPE_RULE, NULL, NULL);
+ VfolderRule *o = (VfolderRule *)gtk_type_new(vfolder_rule_get_type ());
+ return o;
}
void
vfolder_rule_add_source (VfolderRule *vr, const char *uri)
{
- g_assert (IS_VFOLDER_RULE (vr));
-
- vr->sources = g_list_append (vr->sources, g_strdup (uri));
-
- filter_rule_emit_changed ((FilterRule *) vr);
+ g_assert(IS_VFOLDER_RULE(vr));
+
+ vr->sources = g_list_append(vr->sources, g_strdup(uri));
+
+ filter_rule_emit_changed((FilterRule *)vr);
}
const char *
vfolder_rule_find_source (VfolderRule *vr, const char *uri)
{
GList *l;
-
- g_assert (IS_VFOLDER_RULE (vr));
-
+
+ g_assert(IS_VFOLDER_RULE(vr));
+
/* only does a simple string or address comparison, should
probably do a decoded url comparison */
l = vr->sources;
while (l) {
- if (l->data == uri || !strcmp (l->data, uri))
+ if (l->data == uri || !strcmp(l->data, uri))
return l->data;
- l = l->next;
+ l = g_list_next(l);
}
-
return NULL;
}
@@ -162,14 +165,14 @@ void
vfolder_rule_remove_source (VfolderRule *vr, const char *uri)
{
char *found;
-
- g_assert (IS_VFOLDER_RULE (vr));
-
- found = (char *) vfolder_rule_find_source (vr, uri);
+
+ g_assert(IS_VFOLDER_RULE(vr));
+
+ found = (char *)vfolder_rule_find_source(vr, uri);
if (found) {
- vr->sources = g_list_remove (vr->sources, found);
- g_free (found);
- filter_rule_emit_changed ((FilterRule *) vr);
+ vr->sources = g_list_remove(vr->sources, found);
+ g_free(found);
+ filter_rule_emit_changed((FilterRule *)vr);
}
}
@@ -177,24 +180,22 @@ const char *
vfolder_rule_next_source (VfolderRule *vr, const char *last)
{
GList *node;
-
+
if (last == NULL) {
node = vr->sources;
} else {
- node = g_list_find (vr->sources, (char *) last);
+ node = g_list_find(vr->sources, (char *)last);
if (node == NULL)
node = vr->sources;
else
- node = g_list_next (node);
+ node = g_list_next(node);
}
-
if (node)
- return (const char *) node->data;
-
+ return (const char *)node->data;
return NULL;
}
-static int
+static gint
validate (FilterRule *fr)
{
GtkWidget *dialog;
@@ -202,13 +203,8 @@ validate (FilterRule *fr)
g_return_val_if_fail (fr != NULL, FALSE);
if (!fr->name || !*fr->name) {
- /* FIXME: set a aprent window? */
- dialog = gtk_message_dialog_new (NULL, GTK_DIALOG_DESTROY_WITH_PARENT,
- GTK_MESSAGE_ERROR, GTK_BUTTONS_CLOSE,
- "%s", _("You must name this vfolder."));
-
- gtk_dialog_run ((GtkDialog *) dialog);
- gtk_widget_destroy (dialog);
+ dialog = gnome_ok_dialog (_("You must name this vfolder."));
+ gnome_dialog_run_and_close (GNOME_DIALOG (dialog));
return 0;
}
@@ -216,62 +212,59 @@ validate (FilterRule *fr)
/* We have to have at least one source set in the "specific" case.
Do not translate this string! */
if (fr->source && !strcmp (fr->source, "specific") && VFOLDER_RULE (fr)->sources == NULL) {
- /* FIXME: set a parent window? */
- dialog = gtk_message_dialog_new (NULL, GTK_DIALOG_DESTROY_WITH_PARENT,
- GTK_MESSAGE_ERROR, GTK_BUTTONS_CLOSE,
- "%s", _("You need to to specify at least one folder as a source."));
-
- gtk_dialog_run ((GtkDialog *) dialog);
- gtk_widget_destroy (dialog);
-
+ dialog = gnome_ok_dialog (_("You need to specify at least one folder as a source."));
+ gnome_dialog_run_and_close (GNOME_DIALOG (dialog));
+
return 0;
}
- return FILTER_RULE_CLASS (parent_class)->validate (fr);
+ if (FILTER_RULE_CLASS (parent_class)->validate)
+ return FILTER_RULE_CLASS (parent_class)->validate (fr);
+
+ return 1;
}
static int
-list_eq (GList *al, GList *bl)
+list_eq(GList *al, GList *bl)
{
int truth = TRUE;
-
+
while (truth && al && bl) {
char *a = al->data, *b = bl->data;
-
- truth = strcmp (a, b) == 0;
+
+ truth = strcmp(a, b) == 0;
al = al->next;
bl = bl->next;
}
-
+
return truth && al == NULL && bl == NULL;
}
static int
-vfolder_eq (FilterRule *fr, FilterRule *cm)
+vfolder_eq(FilterRule *fr, FilterRule *cm)
{
- return FILTER_RULE_CLASS (parent_class)->eq (fr, cm)
- && list_eq (((VfolderRule *) fr)->sources, ((VfolderRule *) cm)->sources);
+ return ((FilterRuleClass *)(parent_class))->eq(fr, cm)
+ && list_eq(((VfolderRule *)fr)->sources, ((VfolderRule *)cm)->sources);
}
static xmlNodePtr
xml_encode (FilterRule *fr)
{
- VfolderRule *vr = (VfolderRule *) fr;
xmlNodePtr node, set, work;
GList *l;
-
- node = FILTER_RULE_CLASS (parent_class)->xml_encode (fr);
+ VfolderRule *vr = (VfolderRule *)fr;
+
+ node = ((FilterRuleClass *)(parent_class))->xml_encode(fr);
g_assert(node != NULL);
- set = xmlNewNode (NULL, "sources");
- xmlAddChild (node, set);
+ set = xmlNewNode(NULL, "sources");
+ xmlAddChild(node, set);
l = vr->sources;
while (l) {
- work = xmlNewNode (NULL, "folder");
- xmlSetProp (work, "uri", l->data);
- xmlAddChild (set, work);
- l = l->next;
+ work = xmlNewNode(NULL, "folder");
+ xmlSetProp(work, "uri", l->data);
+ xmlAddChild(set, work);
+ l = g_list_next(l);
}
-
return node;
}
@@ -283,20 +276,20 @@ xml_decode (FilterRule *fr, xmlNodePtr node, struct _RuleContext *f)
VfolderRule *vr = (VfolderRule *)fr;
char *uri;
- result = FILTER_RULE_CLASS (parent_class)->xml_decode (fr, node, f);
+ result = ((FilterRuleClass *)(parent_class))->xml_decode(fr, node, f);
if (result != 0)
return result;
-
- set = node->children;
+
+ set = node->childs;
while (set) {
- if (!strcmp (set->name, "sources")) {
- work = set->children;
+ if (!strcmp(set->name, "sources")) {
+ work = set->childs;
while (work) {
- if (!strcmp (work->name, "folder")) {
- uri = xmlGetProp (work, "uri");
+ if (!strcmp(work->name, "folder")) {
+ uri = xmlGetProp(work, "uri");
if (uri) {
- vr->sources = g_list_append (vr->sources, g_strdup (uri));
- xmlFree (uri);
+ vr->sources = g_list_append(vr->sources, g_strdup(uri));
+ xmlFree(uri);
}
}
work = work->next;
@@ -330,7 +323,7 @@ rule_copy (FilterRule *dest, FilterRule *src)
node = node->next;
}
- FILTER_RULE_CLASS (parent_class)->copy (dest, src);
+ ((FilterRuleClass *)(parent_class))->copy (dest, src);
}
@@ -341,11 +334,10 @@ enum {
};
struct _source_data {
- RuleContext *rc;
+ RuleContext *f;
VfolderRule *vr;
const char *current;
- GtkListStore *model;
- GtkTreeView *list;
+ GtkList *list;
GtkButton *buttons[BUTTON_LAST];
};
@@ -356,164 +348,100 @@ static struct {
char *name;
GtkSignalFunc func;
} edit_buttons[] = {
- { "source_add", G_CALLBACK (source_add) },
- { "source_remove", G_CALLBACK (source_remove) },
+ { "source_add", source_add },
+ { "source_remove", source_remove },
};
static void
-set_sensitive (struct _source_data *data)
+set_sensitive(struct _source_data *data)
{
- gtk_widget_set_sensitive ((GtkWidget *) data->buttons[BUTTON_ADD], TRUE);
- gtk_widget_set_sensitive ((GtkWidget *) data->buttons[BUTTON_REMOVE], data->current != NULL);
+ gtk_widget_set_sensitive((GtkWidget *)data->buttons[BUTTON_ADD], TRUE);
+ gtk_widget_set_sensitive((GtkWidget *)data->buttons[BUTTON_REMOVE], data->current != NULL);
}
static void
-select_source (GtkWidget *list, struct _source_data *data)
+select_source(GtkWidget *w, GtkWidget *child, struct _source_data *data)
{
- GtkTreeViewColumn *column;
- GtkTreePath *path;
- GtkTreeIter iter;
-
- gtk_tree_view_get_cursor (data->list, &path, &column);
- gtk_tree_model_get_iter (GTK_TREE_MODEL (data->model), &iter, path);
- gtk_tree_path_free (path);
-
- gtk_tree_model_get (GTK_TREE_MODEL (data->model), &iter, 0, &data->current, -1);
-
- set_sensitive (data);
+ data->current = gtk_object_get_data((GtkObject *)child, "source");
+ set_sensitive(data);
}
static void
-select_source_with (GtkWidget *widget, struct _source_data *data)
+select_source_with(GtkWidget *w, struct _source_data *data)
{
- char *source = g_object_get_data ((GObject *) widget, "source");
-
- filter_rule_set_source ((FilterRule *) data->vr, source);
+ char *source = gtk_object_get_data((GtkObject *)w, "source");
+
+ filter_rule_set_source((FilterRule *)data->vr, source);
}
static void
-source_add (GtkWidget *widget, struct _source_data *data)
+source_add(GtkWidget *widget, struct _source_data *data)
{
static const char *allowed_types[] = { "mail/*", NULL };
GNOME_Evolution_Folder *folder;
- GtkTreeSelection *selection;
- GtkWidget *window;
- GtkTreeIter iter;
- char *uri;
-
- window = gtk_widget_get_toplevel (widget);
- gtk_widget_set_sensitive (window, FALSE);
-
- evolution_shell_client_user_select_folder (global_shell_client, GTK_WINDOW (window),
- _("Select Folder"), "", allowed_types, &folder);
-
- gtk_widget_set_sensitive (window, TRUE);
-
+ char *def, *uri;
+ GtkListItem *item;
+ GList *l;
+ gchar *s;
+
+ gtk_widget_set_sensitive(widget, FALSE);
+ def = "";
+ evolution_shell_client_user_select_folder (global_shell_client,
+ GTK_WINDOW (gtk_widget_get_toplevel (widget)),
+ _("Select Folder"),
+ def, allowed_types, &folder);
+
+ if (GTK_OBJECT_DESTROYED(widget)) {
+ if (folder)
+ CORBA_free (folder);
+ return;
+ }
+
+ gtk_widget_set_sensitive(widget, TRUE);
+
if (folder) {
uri = g_strdup (folder->physicalUri);
- data->vr->sources = g_list_append (data->vr->sources, uri);
-
- gtk_list_store_append (data->model, &iter);
- gtk_list_store_set (data->model, &iter, 0, uri, -1);
- selection = gtk_tree_view_get_selection (data->list);
- gtk_tree_selection_select_iter (selection, &iter);
+ data->vr->sources = g_list_append(data->vr->sources, uri);
+
+ l = NULL;
+ s = e_utf8_to_gtk_string ((GtkWidget *) data->list, uri);
+ item = (GtkListItem *)gtk_list_item_new_with_label (s);
+ g_free (s);
+ gtk_object_set_data((GtkObject *)item, "source", uri);
+ gtk_widget_show((GtkWidget *)item);
+ l = g_list_append(NULL, item);
+ gtk_list_append_items(data->list, l);
+ gtk_list_select_child(data->list, (GtkWidget *)item);
data->current = uri;
}
-
CORBA_free (folder);
- set_sensitive (data);
+ set_sensitive(data);
}
static void
-source_remove (GtkWidget *widget, struct _source_data *data)
+source_remove(GtkWidget *widget, struct _source_data *data)
{
- GtkTreeSelection *selection;
const char *source;
- GtkTreePath *path;
- GtkTreeIter iter;
int index = 0;
- int n;
-
- selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (data->list));
-
+ GList *l;
+ GtkListItem *item;
+
source = NULL;
- while ((source = vfolder_rule_next_source (data->vr, source))) {
- path = gtk_tree_path_new ();
- gtk_tree_path_append_index (path, index);
-
- if (gtk_tree_selection_path_is_selected (selection, path)) {
- gtk_tree_model_get_iter (GTK_TREE_MODEL (data->model), &iter, path);
-
- vfolder_rule_remove_source (data->vr, source);
- gtk_list_store_remove (data->model, &iter);
- gtk_tree_path_free (path);
-
- /* now select the next rule */
- n = gtk_tree_model_iter_n_children (GTK_TREE_MODEL (data->model), NULL);
- index = index >= n ? n - 1 : index;
-
- if (index >= 0) {
- path = gtk_tree_path_new ();
- gtk_tree_path_append_index (path, index);
- gtk_tree_model_get_iter (GTK_TREE_MODEL (data->model), &iter, path);
- gtk_tree_path_free (path);
-
- gtk_tree_selection_select_iter (selection, &iter);
- gtk_tree_model_get (GTK_TREE_MODEL (data->model), &iter, 0, &data->current, -1);
- } else {
- data->current = NULL;
- }
-
+ while ((source = vfolder_rule_next_source(data->vr, source))) {
+ if (data->current == source) {
+ vfolder_rule_remove_source(data->vr, source);
+ item = g_list_nth_data(data->list->children, index);
+ l = g_list_append(NULL, item);
+ gtk_list_remove_items(data->list, l);
+ g_list_free(l);
+ data->current = NULL;
break;
}
-
index++;
- gtk_tree_path_free (path);
}
-
- set_sensitive (data);
+ set_sensitive(data);
}
-
-GtkWidget *vfolder_editor_sourcelist_new (char *widget_name, char *string1, char *string2,
- int int1, int int2);
-
-GtkWidget *
-vfolder_editor_sourcelist_new (char *widget_name, char *string1, char *string2, int int1, int int2)
-{
- GtkWidget *table, *scrolled;
- GtkTreeSelection *selection;
- GtkCellRenderer *renderer;
- GtkListStore *model;
-
- scrolled = gtk_scrolled_window_new (NULL, NULL);
- gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled),
- GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
-
- model = gtk_list_store_new (1, G_TYPE_STRING);
- table = gtk_tree_view_new_with_model ((GtkTreeModel *) model);
- gtk_tree_view_set_headers_visible ((GtkTreeView *) table, FALSE);
-
- renderer = gtk_cell_renderer_text_new ();
- gtk_tree_view_insert_column_with_attributes ((GtkTreeView *) table, -1,
- _("VFolder source"), renderer,
- "text", 0, NULL);
-
- selection = gtk_tree_view_get_selection ((GtkTreeView *) table);
- gtk_tree_selection_set_mode (selection, GTK_SELECTION_SINGLE);
-
- gtk_container_add (GTK_CONTAINER (scrolled), table);
-
- g_object_set_data ((GObject *) scrolled, "table", table);
- g_object_set_data ((GObject *) scrolled, "model", model);
-
- gtk_widget_show (scrolled);
- gtk_widget_show (table);
-
- return scrolled;
-}
-
-
/* DO NOT internationalise these strings */
const char *source_names[] = {
"specific",
@@ -523,78 +451,80 @@ const char *source_names[] = {
};
static GtkWidget *
-get_widget (FilterRule *fr, RuleContext *rc)
+get_widget(FilterRule *fr, struct _RuleContext *f)
{
- VfolderRule *vr = (VfolderRule *) fr;
- GtkWidget *widget, *frame, *list;
- struct _source_data *data;
- GtkOptionMenu *omenu;
- const char *source;
- GtkTreeIter iter;
+ GtkWidget *widget, *frame, *w;
GladeXML *gui;
+ const char *source;
+ VfolderRule *vr = (VfolderRule *)fr;
+ struct _source_data *data;
int i, row;
GList *l;
- widget = FILTER_RULE_CLASS (parent_class)->get_widget (fr, rc);
+ widget = ((FilterRuleClass *)(parent_class))->get_widget (fr, f);
data = g_malloc0 (sizeof (*data));
- data->rc = rc;
+ data->f = f;
data->vr = vr;
- gui = glade_xml_new (FILTER_GLADEDIR "/filter.glade", "vfolder_source_frame", NULL);
+ gui = glade_xml_new (FILTER_GLADEDIR "/filter.glade", "vfolder_source_frame");
frame = glade_xml_get_widget (gui, "vfolder_source_frame");
-
- g_object_set_data_full ((GObject *) frame, "data", data, g_free);
+
+ gtk_object_set_data_full (GTK_OBJECT (frame), "data", data, g_free);
for (i = 0; i < BUTTON_LAST; i++) {
- data->buttons[i] = (GtkButton *) glade_xml_get_widget (gui, edit_buttons[i].name);
- g_signal_connect (data->buttons[i], "clicked", edit_buttons[i].func, data);
+ data->buttons[i] = (GtkButton *)w = glade_xml_get_widget (gui, edit_buttons[i].name);
+ gtk_signal_connect (GTK_OBJECT (w), "clicked", edit_buttons[i].func, data);
}
- list = glade_xml_get_widget (gui, "source_list");
- data->list = (GtkTreeView *) g_object_get_data ((GObject *) list, "table");
- data->model = (GtkListStore *) g_object_get_data ((GObject *) list, "model");
-
+ w = glade_xml_get_widget (gui, "source_list");
+ data->list = (GtkList *)w;
+ l = NULL;
source = NULL;
while ((source = vfolder_rule_next_source (vr, source))) {
- gtk_list_store_append (data->model, &iter);
- gtk_list_store_set (data->model, &iter, 0, source, -1);
+ GtkListItem *item;
+
+ gchar *s = e_utf8_to_gtk_string (GTK_WIDGET (data->list), source);
+ item = (GtkListItem *)gtk_list_item_new_with_label (s);
+ g_free (s);
+ gtk_object_set_data (GTK_OBJECT (item), "source", (void *)source);
+ gtk_widget_show (GTK_WIDGET (item));
+ l = g_list_append (l, item);
}
+ gtk_list_append_items (data->list, l);
+ gtk_signal_connect (GTK_OBJECT (w), "select_child", select_source, data);
- g_signal_connect (data->list, "cursor-changed", G_CALLBACK (select_source), data);
-
- omenu = (GtkOptionMenu *) glade_xml_get_widget (gui, "source_option");
- l = GTK_MENU_SHELL (omenu->menu)->children;
+ w = glade_xml_get_widget (gui, "source_option");
+ l = GTK_MENU_SHELL (GTK_OPTION_MENU (w)->menu)->children;
i = 0;
row = 0;
while (l) {
- GtkWidget *item = GTK_WIDGET (l->data);
+ GtkWidget *b = GTK_WIDGET (l->data);
/* make sure that the glade is in sync with the source list! */
if (i < sizeof (source_names) / sizeof (source_names[0])) {
- g_object_set_data ((GObject *) item, "source", (char *) source_names[i]);
+ gtk_object_set_data (GTK_OBJECT (b), "source", (char *)source_names[i]);
if (fr->source && strcmp (source_names[i], fr->source) == 0) {
row = i;
}
} else {
g_warning ("Glade file " FILTER_GLADEDIR "/filter.glade out of sync with editor code");
}
-
- g_signal_connect (item, "activate", G_CALLBACK (select_source_with), data);
+ gtk_signal_connect (GTK_OBJECT (b), "activate", select_source_with, data);
i++;
l = l->next;
}
- gtk_option_menu_set_history (omenu, row);
+ gtk_option_menu_set_history (GTK_OPTION_MENU (w), row);
if (fr->source == NULL)
- filter_rule_set_source (fr, (char *) source_names[row]);
+ filter_rule_set_source (fr, (char *)source_names[row]);
set_sensitive (data);
-
- g_object_unref (gui);
-
+
gtk_box_pack_start (GTK_BOX (widget), frame, TRUE, TRUE, 3);
+ gtk_object_unref (GTK_OBJECT (gui));
+
return widget;
}
diff --git a/help/C/Makefile.am b/help/C/Makefile.am
index d5713d895c..3e13cdce11 100644
--- a/help/C/Makefile.am
+++ b/help/C/Makefile.am
@@ -29,30 +29,28 @@ figs = \
figures/small_desktop.png \
figures/summary.png \
figures/vfolder-createrule-fig.png
-figdir = figures
-docname = evolution-1.4
-lang = C
-omffile = evolution-1.4-C.omf
-entities = \
- apx-authors.xml \
- apx-bugs.xml \
- apx-fdl.xml \
- apx-gloss.xml \
- apx-gpl.xml \
- config-prefs.xml \
- config-sync.xml \
- legal.xml \
- menuref.xml \
- preface.xml \
- usage-calendar.xml \
- usage-contact.xml \
- usage-exec-summary.xml \
- usage-exchange.xml \
- usage-mail-org.xml \
- usage-mail.xml \
- usage-mainwindow.xml \
- usage-print.xml \
- usage-sync.xml
-include $(top_srcdir)/help/xmldocs.make
+docname = evolution
+lang = C
+omffile = evolution-C.omf
+sgml_ents = \
+ apx-authors.sgml \
+ apx-bugs.sgml \
+ apx-gloss.sgml \
+ apx-fdl.sgml \
+ apx-gpl.sgml \
+ config-prefs.sgml \
+ config-sync.sgml \
+ menuref.sgml \
+ preface.sgml \
+ usage-calendar.sgml \
+ usage-contact.sgml \
+ usage-exec-summary.sgml \
+ usage-exchange.sgml \
+ usage-mail-org.sgml \
+ usage-mail.sgml \
+ usage-mainwindow.sgml \
+ usage-print.sgml \
+ usage-sync.sgml
+include $(top_srcdir)/help/sgmldocs.make
dist-hook: app-dist-hook
diff --git a/help/C/apx-authors.sgml b/help/C/apx-authors.sgml
new file mode 100644
index 0000000000..a09e849b73
--- /dev/null
+++ b/help/C/apx-authors.sgml
@@ -0,0 +1,74 @@
+ <appendix id="authors">
+ <title>Authors</title>
+ <para>
+ <application>Evolution</application> was written by the Ximian
+ Evolution team and numerous other dedicated GNOME programmers.
+ You can see their names by selecting <menuchoice>
+ <guimenu>Help</guimenu> <guimenuitem>About</guimenuitem>
+ </menuchoice> from any Evolution window.
+ </para>
+ <para>
+ The <application>Evolution</application> code owes a great debt
+ to the <application>GNOME-pim</application> and
+ <application>GNOME-Calendar</application> applications, and to
+ <application>KHTMLW</application>. The developers of
+ <application>Evolution</application> acknowledge the efforts
+ and contributions of all who worked on those projects.
+ </para>
+
+ <para>
+ Ximian would like to thank everyone who helped out with the bug
+ tracking process, particularly Miles Lane, and also the staff of
+ El Pelon Taqueria, on Peterborough St. in Boston, for
+ sustenance.
+ </para>
+
+ <para>
+ For more information please visit the
+ <application>Evolution</application> <ulink
+ url="http://www.ximian.com/products/evolution/"
+ type="http">Web page</ulink>. Please send all comments,
+ suggestions, and bug reports to the <ulink
+ url="http://bugzilla.ximian.com" type="http">Ximian bug tracking
+ database</ulink>. Instructions for submitting bug reports can be
+ found on-line at the same location. You can also use the GNOME
+ bug report tool, <command>bug-buddy</command>, to submit your
+ defect reports.
+ </para>
+ <para>
+ This manual was written by Aaron Weber
+ (<email>aaron@ximian.com</email>), Kevin Breit
+ (<email>mrproper@ximian.com</email>) Duncan Mak
+ (<email>duncan@ximian.com</email>) and Ettore Perazzoli
+ (<email>ettore@ximian.com</email>) with the help of the
+ application programmers and the GNOME Documentation Project.
+ Please file comments and suggestions for this manual as bugs in
+ the Ximian bug tracking system. If you contributed to this
+ project but do not see your name here, please contact Aaron
+ Weber (<email>aaron@ximian.com</email>) and he'll list you. The
+ list of translators, in particular, is lacking numerous
+ contributors.
+ </para>
+ <para>
+ This product has been translated into many languages. Some of
+ the translators are listed here:
+ <itemizedlist>
+ <listitem><para>
+ Daniel Persson for .se
+ </para></listitem>
+
+ <listitem><para>
+ Hector Garcia Alvarez for .es
+ </para></listitem>
+
+ <listitem><para>
+ Kjartan Maraas for .no
+ </para></listitem>
+ </itemizedlist>
+ </para>
+ </appendix>
+
+
+
+
+
diff --git a/help/C/apx-fdl.sgml b/help/C/apx-fdl.sgml
new file mode 100644
index 0000000000..4af2a495fa
--- /dev/null
+++ b/help/C/apx-fdl.sgml
@@ -0,0 +1,667 @@
+<!--
+ The GNU Free Documentation License 1.1 in DocBook
+ Markup by Eric Baudais <baudais@okstate.edu>
+ Maintained by the GNOME Documentation Project
+ http://developer.gnome.org/projects/gdp
+ Version: 1.0.1
+ Last Modified: Nov 16, 2000
+-->
+
+<appendix id="apx-fdl">
+ <appendixinfo>
+ <releaseinfo>
+ Version 1.1, March 2000
+ </releaseinfo>
+ <copyright>
+ <year>2000</year><holder>Free Software Foundation, Inc.</holder>
+ </copyright>
+ <legalnotice id="fdl-legalnotice">
+ <para>
+ <address>Free Software Foundation, Inc. <street>59 Temple Place,
+ Suite 330</street>, <city>Boston</city>, <state>MA</state>
+ <postcode>02111-1307</postcode> <country>USA</country></address>
+ Everyone is permitted to copy and distribute verbatim copies of this
+ license document, but changing it is not allowed.
+ </para>
+ </legalnotice>
+ </appendixinfo>
+ <title>GNU Free Documentation License</title>
+
+ <sect1 id="fdl-preamble">
+ <title>0. PREAMBLE</title>
+ <para>
+ The purpose of this License is to make a manual, textbook, or
+ other written document <quote>free</quote> in the sense of
+ freedom: to assure everyone the effective freedom to copy and
+ redistribute it, with or without modifying it, either
+ commercially or noncommercially. Secondarily, this License
+ preserves for the author and publisher a way to get credit for
+ their work, while not being considered responsible for
+ modifications made by others.
+ </para>
+
+ <para>
+ This License is a kind of <quote>copyleft</quote>, which means
+ that derivative works of the document must themselves be free in
+ the same sense. It complements the GNU General Public License,
+ which is a copyleft license designed for free software.
+ </para>
+
+ <para>
+ We have designed this License in order to use it for manuals for
+ free software, because free software needs free documentation: a
+ free program should come with manuals providing the same
+ freedoms that the software does. But this License is not limited
+ to software manuals; it can be used for any textual work,
+ regardless of subject matter or whether it is published as a
+ printed book. We recommend this License principally for works
+ whose purpose is instruction or reference.
+ </para>
+ </sect1>
+ <sect1 id="fdl-section1">
+ <title>1. APPLICABILITY AND DEFINITIONS</title>
+ <para id="fdl-document">
+ This License applies to any manual or other work that contains a
+ notice placed by the copyright holder saying it can be
+ distributed under the terms of this License. The
+ <quote>Document</quote>, below, refers to any such manual or
+ work. Any member of the public is a licensee, and is addressed
+ as <quote>you</quote>.
+ </para>
+
+ <para id="fdl-modified">
+ A <quote>Modified Version</quote> of the Document means any work
+ containing the Document or a portion of it, either copied
+ verbatim, or with modifications and/or translated into another
+ language.
+ </para>
+
+ <para id="fdl-secondary">
+ A <quote>Secondary Section</quote> is a named appendix or a
+ front-matter section of the <link
+ linkend="fdl-document">Document</link> that deals exclusively
+ with the relationship of the publishers or authors of the
+ Document to the Document's overall subject (or to related
+ matters) and contains nothing that could fall directly within
+ that overall subject. (For example, if the Document is in part a
+ textbook of mathematics, a Secondary Section may not explain any
+ mathematics.) The relationship could be a matter of historical
+ connection with the subject or with related matters, or of
+ legal, commercial, philosophical, ethical or political position
+ regarding them.
+ </para>
+
+ <para id="fdl-invariant">
+ The <quote>Invariant Sections</quote> are certain <link
+ linkend="fdl-secondary"> Secondary Sections</link> whose titles
+ are designated, as being those of Invariant Sections, in the
+ notice that says that the <link
+ linkend="fdl-document">Document</link> is released under this
+ License.
+ </para>
+
+ <para id="fdl-cover-texts">
+ The <quote>Cover Texts</quote> are certain short passages of
+ text that are listed, as Front-Cover Texts or Back-Cover Texts,
+ in the notice that says that the <link
+ linkend="fdl-document">Document</link> is released under this
+ License.
+ </para>
+
+ <para id="fdl-transparent">
+ A <quote>Transparent</quote> copy of the <link
+ linkend="fdl-document"> Document</link> means a machine-readable
+ copy, represented in a format whose specification is available
+ to the general public, whose contents can be viewed and edited
+ directly and straightforwardly with generic text editors or (for
+ images composed of pixels) generic paint programs or (for
+ drawings) some widely available drawing editor, and that is
+ suitable for input to text formatters or for automatic
+ translation to a variety of formats suitable for input to text
+ formatters. A copy made in an otherwise Transparent file format
+ whose markup has been designed to thwart or discourage
+ subsequent modification by readers is not Transparent. A copy
+ that is not <quote>Transparent</quote> is called
+ <quote>Opaque</quote>.
+ </para>
+
+ <para>
+ Examples of suitable formats for Transparent copies include
+ plain ASCII without markup, Texinfo input format, LaTeX input
+ format, SGML or XML using a publicly available DTD, and
+ standard-conforming simple HTML designed for human
+ modification. Opaque formats include PostScript, PDF,
+ proprietary formats that can be read and edited only by
+ proprietary word processors, SGML or XML for which the DTD
+ and/or processing tools are not generally available, and the
+ machine-generated HTML produced by some word processors for
+ output purposes only.
+ </para>
+
+ <para id="fdl-title-page">
+ The <quote>Title Page</quote> means, for a printed book, the
+ title page itself, plus such following pages as are needed to
+ hold, legibly, the material this License requires to appear in
+ the title page. For works in formats which do not have any title
+ page as such, <quote>Title Page</quote> means the text near the
+ most prominent appearance of the work's title, preceding the
+ beginning of the body of the text.
+ </para>
+ </sect1>
+
+ <sect1 id="fdl-section2">
+ <title>2. VERBATIM COPYING</title>
+ <para>
+ You may copy and distribute the <link
+ linkend="fdl-document">Document</link> in any medium, either
+ commercially or noncommercially, provided that this License, the
+ copyright notices, and the license notice saying this License
+ applies to the Document are reproduced in all copies, and that
+ you add no other conditions whatsoever to those of this
+ License. You may not use technical measures to obstruct or
+ control the reading or further copying of the copies you make or
+ distribute. However, you may accept compensation in exchange for
+ copies. If you distribute a large enough number of copies you
+ must also follow the conditions in <link
+ linkend="fdl-section3">section 3</link>.
+ </para>
+
+ <para>
+ You may also lend copies, under the same conditions stated
+ above, and you may publicly display copies.
+ </para>
+ </sect1>
+
+ <sect1 id="fdl-section3">
+ <title>3. COPYING IN QUANTITY</title>
+ <para>
+ If you publish printed copies of the <link
+ linkend="fdl-document">Document</link> numbering more than 100,
+ and the Document's license notice requires <link
+ linkend="fdl-cover-texts">Cover Texts</link>, you must enclose
+ the copies in covers that carry, clearly and legibly, all these
+ Cover Texts: Front-Cover Texts on the front cover, and
+ Back-Cover Texts on the back cover. Both covers must also
+ clearly and legibly identify you as the publisher of these
+ copies. The front cover must present the full title with all
+ words of the title equally prominent and visible. You may add
+ other material on the covers in addition. Copying with changes
+ limited to the covers, as long as they preserve the title of the
+ <link linkend="fdl-document">Document</link> and satisfy these
+ conditions, can be treated as verbatim copying in other
+ respects.
+ </para>
+
+ <para>
+ If the required texts for either cover are too voluminous to fit
+ legibly, you should put the first ones listed (as many as fit
+ reasonably) on the actual cover, and continue the rest onto
+ adjacent pages.
+ </para>
+
+ <para>
+ If you publish or distribute <link
+ linkend="fdl-transparent">Opaque</link> copies of the <link
+ linkend="fdl-document">Document</link> numbering more than 100,
+ you must either include a machine-readable <link
+ linkend="fdl-transparent">Transparent</link> copy along with
+ each Opaque copy, or state in or with each Opaque copy a
+ publicly-accessible computer-network location containing a
+ complete Transparent copy of the Document, free of added
+ material, which the general network-using public has access to
+ download anonymously at no charge using public-standard network
+ protocols. If you use the latter option, you must take
+ reasonably prudent steps, when you begin distribution of Opaque
+ copies in quantity, to ensure that this Transparent copy will
+ remain thus accessible at the stated location until at least one
+ year after the last time you distribute an Opaque copy (directly
+ or through your agents or retailers) of that edition to the
+ public.
+ </para>
+
+ <para>
+ It is requested, but not required, that you contact the authors
+ of the <link linkend="fdl-document">Document</link> well before
+ redistributing any large number of copies, to give them a chance
+ to provide you with an updated version of the Document.
+ </para>
+ </sect1>
+
+ <sect1 id="fdl-section4">
+ <title>4. MODIFICATIONS</title>
+ <para>
+ You may copy and distribute a <link
+ linkend="fdl-modified">Modified Version</link> of the <link
+ linkend="fdl-document">Document</link> under the conditions of
+ sections <link linkend="fdl-section2">2</link> and <link
+ linkend="fdl-section3">3</link> above, provided that you release
+ the Modified Version under precisely this License, with the
+ Modified Version filling the role of the Document, thus
+ licensing distribution and modification of the Modified Version
+ to whoever possesses a copy of it. In addition, you must do
+ these things in the Modified Version:
+ </para>
+
+ <itemizedlist mark="opencircle">
+ <listitem>
+ <formalpara>
+ <title>A</title>
+ <para>
+ Use in the <link linkend="fdl-title-page">Title
+ Page</link> (and on the covers, if any) a title distinct
+ from that of the <link
+ linkend="fdl-document">Document</link>, and from those of
+ previous versions (which should, if there were any, be
+ listed in the History section of the Document). You may
+ use the same title as a previous version if the original
+ publisher of that version gives permission.
+ </para>
+ </formalpara>
+ </listitem>
+
+ <listitem>
+ <formalpara>
+ <title>B</title>
+ <para>
+ List on the <link linkend="fdl-title-page">Title
+ Page</link>, as authors, one or more persons or entities
+ responsible for authorship of the modifications in the
+ <link linkend="fdl-modified">Modified Version</link>,
+ together with at least five of the principal authors of
+ the <link linkend="fdl-document">Document</link> (all of
+ its principal authors, if it has less than five).
+ </para>
+ </formalpara>
+ </listitem>
+
+ <listitem>
+ <formalpara>
+ <title>C</title>
+ <para>
+ State on the <link linkend="fdl-title-page">Title
+ Page</link> the name of the publisher of the <link
+ linkend="fdl-modified">Modified Version</link>, as the
+ publisher.
+ </para>
+ </formalpara>
+ </listitem>
+
+ <listitem>
+ <formalpara>
+ <title>D</title>
+ <para>
+ Preserve all the copyright notices of the <link
+ linkend="fdl-document">Document</link>.
+ </para>
+ </formalpara>
+ </listitem>
+
+ <listitem>
+ <formalpara>
+ <title>E</title>
+ <para>
+ Add an appropriate copyright notice for your modifications
+ adjacent to the other copyright notices.
+ </para>
+ </formalpara>
+ </listitem>
+
+ <listitem>
+ <formalpara>
+ <title>F</title>
+ <para>
+ Include, immediately after the copyright notices, a
+ license notice giving the public permission to use the
+ <link linkend="fdl-modified">Modified Version</link> under
+ the terms of this License, in the form shown in the
+ Addendum below.
+ </para>
+ </formalpara>
+ </listitem>
+
+ <listitem>
+ <formalpara>
+ <title>G</title>
+ <para>
+ Preserve in that license notice the full lists of <link
+ linkend="fdl-invariant"> Invariant Sections</link> and
+ required <link linkend="fdl-cover-texts">Cover
+ Texts</link> given in the <link
+ linkend="fdl-document">Document's</link> license notice.
+ </para>
+ </formalpara>
+ </listitem>
+
+ <listitem>
+ <formalpara>
+ <title>H</title>
+ <para>
+ Include an unaltered copy of this License.
+ </para>
+ </formalpara>
+ </listitem>
+
+ <listitem>
+ <formalpara>
+ <title>I</title>
+ <para>
+ Preserve the section entitled <quote>History</quote>, and
+ its title, and add to it an item stating at least the
+ title, year, new authors, and publisher of the <link
+ linkend="fdl-modified">Modified Version </link>as given on
+ the <link linkend="fdl-title-page">Title Page</link>. If
+ there is no section entitled <quote>History</quote> in the
+ <link linkend="fdl-document">Document</link>, create one
+ stating the title, year, authors, and publisher of the
+ Document as given on its Title Page, then add an item
+ describing the Modified Version as stated in the previous
+ sentence.
+ </para>
+ </formalpara>
+ </listitem>
+
+ <listitem>
+ <formalpara>
+ <title>J</title>
+ <para>
+ Preserve the network location, if any, given in the <link
+ linkend="fdl-document">Document</link> for public access
+ to a <link linkend="fdl-transparent">Transparent</link>
+ copy of the Document, and likewise the network locations
+ given in the Document for previous versions it was based
+ on. These may be placed in the <quote>History</quote>
+ section. You may omit a network location for a work that
+ was published at least four years before the Document
+ itself, or if the original publisher of the version it
+ refers to gives permission.
+ </para>
+ </formalpara>
+ </listitem>
+
+ <listitem>
+ <formalpara>
+ <title>K</title>
+ <para>
+ In any section entitled <quote>Acknowledgements</quote> or
+ <quote>Dedications</quote>, preserve the section's title,
+ and preserve in the section all the substance and tone of
+ each of the contributor acknowledgements and/or
+ dedications given therein.
+ </para>
+ </formalpara>
+ </listitem>
+
+ <listitem>
+ <formalpara>
+ <title>L</title>
+ <para>
+ Preserve all the <link linkend="fdl-invariant">Invariant
+ Sections</link> of the <link
+ linkend="fdl-document">Document</link>, unaltered in their
+ text and in their titles. Section numbers or the
+ equivalent are not considered part of the section titles.
+ </para>
+ </formalpara>
+ </listitem>
+
+ <listitem>
+ <formalpara>
+ <title>M</title>
+ <para>
+ Delete any section entitled
+ <quote>Endorsements</quote>. Such a section may not be
+ included in the <link linkend="fdl-modified">Modified
+ Version</link>.
+ </para>
+ </formalpara>
+ </listitem>
+
+ <listitem>
+ <formalpara>
+ <title>N</title>
+ <para>
+ Do not retitle any existing section as
+ <quote>Endorsements</quote> or to conflict in title with
+ any <link linkend="fdl-invariant">Invariant
+ Section</link>.
+ </para>
+ </formalpara>
+ </listitem>
+ </itemizedlist>
+
+ <para>
+ If the <link linkend="fdl-modified">Modified Version</link>
+ includes new front-matter sections or appendices that qualify as
+ <link linkend="fdl-secondary">Secondary Sections</link> and
+ contain no material copied from the Document, you may at your
+ option designate some or all of these sections as invariant. To
+ do this, add their titles to the list of <link
+ linkend="fdl-invariant">Invariant Sections</link> in the
+ Modified Version's license notice. These titles must be
+ distinct from any other section titles.
+ </para>
+
+ <para>
+ You may add a section entitled <quote>Endorsements</quote>,
+ provided it contains nothing but endorsements of your <link
+ linkend="fdl-modified">Modified Version</link> by various
+ parties--for example, statements of peer review or that the text
+ has been approved by an organization as the authoritative
+ definition of a standard.
+ </para>
+
+ <para>
+ You may add a passage of up to five words as a <link
+ linkend="fdl-cover-texts">Front-Cover Text</link>, and a passage
+ of up to 25 words as a <link
+ linkend="fdl-cover-texts">Back-Cover Text</link>, to the end of
+ the list of <link linkend="fdl-cover-texts">Cover Texts</link>
+ in the <link linkend="fdl-modified">Modified Version</link>.
+ Only one passage of Front-Cover Text and one of Back-Cover Text
+ may be added by (or through arrangements made by) any one
+ entity. If the <link linkend="fdl-document">Document</link>
+ already includes a cover text for the same cover, previously
+ added by you or by arrangement made by the same entity you are
+ acting on behalf of, you may not add another; but you may
+ replace the old one, on explicit permission from the previous
+ publisher that added the old one.
+ </para>
+
+ <para>
+ The author(s) and publisher(s) of the <link
+ linkend="fdl-document">Document</link> do not by this License
+ give permission to use their names for publicity for or to
+ assert or imply endorsement of any <link
+ linkend="fdl-modified">Modified Version </link>.
+ </para>
+ </sect1>
+
+ <sect1 id="fdl-section5">
+ <title>5. COMBINING DOCUMENTS</title>
+ <para>
+ You may combine the <link linkend="fdl-document">Document</link>
+ with other documents released under this License, under the
+ terms defined in <link linkend="fdl-section4">section 4</link>
+ above for modified versions, provided that you include in the
+ combination all of the <link linkend="fdl-invariant">Invariant
+ Sections</link> of all of the original documents, unmodified,
+ and list them all as Invariant Sections of your combined work in
+ its license notice.
+ </para>
+
+ <para>
+ The combined work need only contain one copy of this License,
+ and multiple identical <link linkend="fdl-invariant">Invariant
+ Sections</link> may be replaced with a single copy. If there are
+ multiple Invariant Sections with the same name but different
+ contents, make the title of each such section unique by adding
+ at the end of it, in parentheses, the name of the original
+ author or publisher of that section if known, or else a unique
+ number. Make the same adjustment to the section titles in the
+ list of Invariant Sections in the license notice of the combined
+ work.
+ </para>
+
+ <para>
+ In the combination, you must combine any sections entitled
+ <quote>History</quote> in the various original documents,
+ forming one section entitled <quote>History</quote>; likewise
+ combine any sections entitled <quote>Acknowledgements</quote>,
+ and any sections entitled <quote>Dedications</quote>. You must
+ delete all sections entitled <quote>Endorsements.</quote>
+ </para>
+ </sect1>
+
+ <sect1 id="fdl-section6">
+ <title>6. COLLECTIONS OF DOCUMENTS</title>
+ <para>
+ You may make a collection consisting of the <link
+ linkend="fdl-document">Document</link> and other documents
+ released under this License, and replace the individual copies
+ of this License in the various documents with a single copy that
+ is included in the collection, provided that you follow the
+ rules of this License for verbatim copying of each of the
+ documents in all other respects.
+ </para>
+
+ <para>
+ You may extract a single document from such a collection, and
+ dispbibute it individually under this License, provided you
+ insert a copy of this License into the extracted document, and
+ follow this License in all other respects regarding verbatim
+ copying of that document.
+ </para>
+ </sect1>
+
+ <sect1 id="fdl-section7">
+ <title>7. AGGREGATION WITH INDEPENDENT WORKS</title>
+ <para>
+ A compilation of the <link
+ linkend="fdl-document">Document</link> or its derivatives with
+ other separate and independent documents or works, in or on a
+ volume of a storage or distribution medium, does not as a whole
+ count as a <link linkend="fdl-modified">Modified Version</link>
+ of the Document, provided no compilation copyright is claimed
+ for the compilation. Such a compilation is called an
+ <quote>aggregate</quote>, and this License does not apply to the
+ other self-contained works thus compiled with the Document , on
+ account of their being thus compiled, if they are not themselves
+ derivative works of the Document. If the <link
+ linkend="fdl-cover-texts">Cover Text</link> requirement of <link
+ linkend="fdl-section3">section 3</link> is applicable to these
+ copies of the Document, then if the Document is less than one
+ quarter of the entire aggregate, the Document's Cover Texts may
+ be placed on covers that surround only the Document within the
+ aggregate. Otherwise they must appear on covers around the whole
+ aggregate.
+ </para>
+ </sect1>
+
+ <sect1 id="fdl-section8">
+ <title>8. TRANSLATION</title>
+ <para>
+ Translation is considered a kind of modification, so you may
+ distribute translations of the <link
+ linkend="fdl-document">Document</link> under the terms of <link
+ linkend="fdl-section4">section 4</link>. Replacing <link
+ linkend="fdl-invariant"> Invariant Sections</link> with
+ translations requires special permission from their copyright
+ holders, but you may include translations of some or all
+ Invariant Sections in addition to the original versions of these
+ Invariant Sections. You may include a translation of this
+ License provided that you also include the original English
+ version of this License. In case of a disagreement between the
+ translation and the original English version of this License,
+ the original English version will prevail.
+ </para>
+ </sect1>
+
+ <sect1 id="fdl-section9">
+ <title>9. TERMINATION</title>
+ <para>
+ You may not copy, modify, sublicense, or distribute the <link
+ linkend="fdl-document">Document</link> except as expressly
+ provided for under this License. Any other attempt to copy,
+ modify, sublicense or distribute the Document is void, and will
+ automatically terminate your rights under this License. However,
+ parties who have received copies, or rights, from you under this
+ License will not have their licenses terminated so long as such
+ parties remain in full compliance.
+ </para>
+ </sect1>
+
+ <sect1 id="fdl-section10">
+ <title>10. FUTURE REVISIONS OF THIS LICENSE</title>
+ <para>
+ The <ulink type="http"
+ url="http://www.gnu.org/fsf/fsf.html">Free Software
+ Foundation</ulink> may publish new, revised versions of the GNU
+ Free Documentation License from time to time. Such new versions
+ will be similar in spirit to the present version, but may differ
+ in detail to address new problems or concerns. See <ulink
+ type="http"
+ url="http://www.gnu.org/copyleft">http://www.gnu.org/copyleft/</ulink>.
+ </para>
+
+ <para>
+ Each version of the License is given a distinguishing version
+ number. If the <link linkend="fdl-document">Document</link>
+ specifies that a particular numbered version of this License
+ <quote>or any later version</quote> applies to it, you have the
+ option of following the terms and conditions either of that
+ specified version or of any later version that has been
+ published (not as a draft) by the Free Software Foundation. If
+ the Document does not specify a version number of this License,
+ you may choose any version ever published (not as a draft) by
+ the Free Software Foundation.
+ </para>
+ </sect1>
+
+ <sect1 id="fdl-using">
+ <title>Addendum</title>
+ <para>
+ To use this License in a document you have written, include a copy of
+ the License in the document and put the following copyright and
+ license notices just after the title page:
+ </para>
+
+ <blockquote>
+ <para>
+ Copyright YEAR YOUR NAME.
+ </para>
+ <para>
+ Permission is granted to copy, distribute and/or modify this
+ document under the terms of the GNU Free Documentation
+ License, Version 1.1 or any later version published by the
+ Free Software Foundation; with the <link
+ linkend="fdl-invariant">Invariant Sections</link> being LIST
+ THEIR TITLES, with the <link
+ linkend="fdl-cover-texts">Front-Cover Texts</link> being LIST,
+ and with the <link linkend="fdl-cover-texts">Back-Cover
+ Texts</link> being LIST. A copy of the license is included in
+ the section entitled <quote>GNU Free Documentation
+ License</quote>.
+ </para>
+ </blockquote>
+
+ <para>
+ If you have no <link linkend="fdl-invariant">Invariant
+ Sections</link>, write <quote>with no Invariant Sections</quote>
+ instead of saying which ones are invariant. If you have no
+ <link linkend="fdl-cover-texts">Front-Cover Texts</link>, write
+ <quote>no Front-Cover Texts</quote> instead of
+ <quote>Front-Cover Texts being LIST</quote>; likewise for <link
+ linkend="fdl-cover-texts">Back-Cover Texts</link>.
+ </para>
+
+ <para>
+ If your document contains nontrivial examples of program code,
+ we recommend releasing these examples in parallel under your
+ choice of free software license, such as the <ulink type="http"
+ url="http://www.gnu.org/copyleft/gpl.html"> GNU General Public
+ License</ulink>, to permit their use in free software.
+ </para>
+ </sect1>
+</appendix>
+
+
diff --git a/help/C/apx-gloss.sgml b/help/C/apx-gloss.sgml
new file mode 100644
index 0000000000..36ed4ef41c
--- /dev/null
+++ b/help/C/apx-gloss.sgml
@@ -0,0 +1,480 @@
+<glossary id="apx-gloss">
+
+ <title>Glossary</title>
+
+ <glossentry id="assistant">
+ <glossterm>Assistant:</glossterm>
+ <glossdef>
+ <para>
+ A tool which guides a user through a series of steps, usually
+ to configure or set up a program. Equivalent to "Wizard" and
+ "Druid."
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id="attachment">
+ <glossterm>Attachment:</glossterm>
+ <glossdef>
+ <para>
+ Any file sent along with an email. Attachments may be embedded in
+ a message or appended to it.
+ </para>
+ </glossdef>
+ </glossentry>
+
+<glossentry id="automatic-indexing">
+ <glossterm>Automatic Indexing:</glossterm>
+ <glossdef>
+ <para>
+ Pre-fetching procedure that allows
+ <application>Evolution</application> to refer to data quickly.
+ It enables faster searches and decreases memory usage for
+ data displays.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id="bcc">
+ <glossterm>Bcc (Blind Carbon Copy):</glossterm>
+ <glossdef>
+ <para>
+ A way of addressing a message. Bcc is used to send a group of
+ people an e-mail, while hiding their names and addresses from each
+ other.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id="cc">
+ <glossterm>Cc (Carbon Copy):</glossterm>
+ <glossdef>
+ <para>
+ Carbon-copies are used to send a 3rd party a copy of the e-mail,
+ so they an keep up to date on a conversation, without being in the
+ To: list.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id="conduit">
+ <glossterm>Conduit:</glossterm>
+ <glossdef>
+ <para>
+ A small application which controls
+ the transfer of data between a handheld device and a desktop
+ computer.
+ </para>
+ </glossdef>
+ </glossentry>
+
+
+ <glossentry id="druid">
+ <glossterm>Druid:</glossterm>
+ <glossdef>
+ <para>
+ See "Assistant."
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id="evolution">
+ <glossterm>Evolution:</glossterm>
+ <glossdef>
+ <para>
+ <application>Evolution</application> is the <acronym> GNOME
+ </acronym> groupware application.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id="execute">
+ <glossterm>Execute:</glossterm>
+ <glossdef>
+ <para>
+ To run a program. Any file that can be run is called an
+ executable. <application>Evolution</application> can download
+ executable attachments, but before they can be run, the files must
+ be marked as executable with a shell or file manager. This
+ security precaution prevents the automatic or accidental execution
+ of malicious programs. For more information on executables and file
+ permissions, see the documentation for your file manager or shell.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id="expunge">
+ <glossterm>Expunge:</glossterm>
+ <glossdef>
+ <para>
+ When messages are marked for deletion, they remain till they are expunged.
+ When a message is expunged, it is permanently deleted, as long as it was
+ marked for deletion.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id="filetree">
+ <glossterm>File Tree:</glossterm>
+ <glossdef>
+ <para>
+ A way of describing a group of files on a computer. With the
+ perversity typical of computer (and especially Unix and Linux)
+ nomenclature, the top of the tree is called the root directory,
+ and denoted by <filename>/</filename>.
+ The rest of the "branches" spread downward from the root. Don't
+ confuse the root directory with the root
+ account, or root's home directory, normally
+ <filename>/root</filename>.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id="filter">
+ <glossterm>Filter:</glossterm>
+ <glossdef>
+ <para>
+ Within <application>Evolution</application>, a filter is a method
+ of sorting mail automatically when it's downloaded. You can create filters to perform
+ one or more actions on a message that meets any (or all) of a wide
+ range of criteria.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id="forward">
+ <glossterm>Forward:</glossterm>
+ <glossdef>
+ <para>
+ If you get a message intended for someone else, you can use
+ message forwarding to send it on to the right person.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id="groupware">
+ <glossterm>Groupware:</glossterm>
+ <glossdef>
+ <para>
+ Groupware is a term describing an application which helps groups
+ of people work together. Typically, a groupware application will
+ have several productivity features built into one program,
+ including: email, calendar, and addressbook tools.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id="html">
+ <glossterm>HTML:</glossterm>
+ <glossdef>
+ <para>
+ Hyper-text Markup Language (<acronym>HTML</acronym>) is a language
+ for describing page layout in electronic documents like web pages,
+ help files, and email messages. HTML can be used in email and
+ news posts to insert images and apply text treatments.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id="hot-key">
+ <glossterm>Hot Key:</glossterm>
+ <glossdef>
+ <para>
+ Hot-keys are keyboard combinations used to do actions on a
+ computer instead of using the mouse.
+ Hot-keys can speed up computer usage.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id="ical">
+ <glossterm>iCal:</glossterm>
+ <glossdef>
+ <para>
+ <application>iCal</application> is the program which
+ <application>Evolution</application> uses to manage the calendar
+ section.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id="imap">
+ <glossterm>IMAP:</glossterm>
+ <glossdef>
+ <para>
+ Depending upon whom you ask, IMAP stands for the Internet Mail
+ Access Protocol, or the Interim Mail Access Protocol. It allows access to email which is typically (although
+ not always) stored remotely on a server rather than on a local
+ hard disk. Often contrasted with <glossterm>POP:</glossterm>.
+ This will not be on the test.
+ </para>
+ </glossdef>
+ </glossentry>
+
+
+ <glossentry id="inline">
+ <glossterm>Inline:</glossterm>
+ <glossdef>
+ <para>
+ Displayed as part of a message or other document, rather than
+ attached as a separate file. Contrast with <glossterm
+ linkend="attachment">Attachment:</glossterm>.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id="ldap">
+ <glossterm>LDAP:</glossterm>
+ <glossdef>
+ <para>
+ LDAP, the Lightweight Directory Access Protocol, allows a client
+ to search through a large database of addresses, phone numbers,
+ and people stored on a server.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id="mail-client">
+ <glossterm>Mail Client:</glossterm>
+ <glossdef>
+ <para>
+ A mail client is the application with which a person reads and
+ sends e-mail. Its counterparts are the various types of mail
+ servers, which handle user authentication and direct messages from
+ sender to recipient.
+ </para>
+ </glossdef>
+ </glossentry>
+
+
+ <glossentry id="minicard">
+ <glossterm>Minicard:</glossterm>
+ <glossdef>
+ <para>
+ A format for the display of contact data. Similar in appearance
+ to a small business card.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id="nautilus">
+ <glossterm>Nautilus:</glossterm>
+ <glossdef>
+ <para>
+ <application>Nautilus</application> is the next generation file
+ manager for <acronym>GNOME</acronym>.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id="pop">
+ <glossterm>POP:</glossterm>
+ <glossdef>
+ <para>
+ POP, the Post Office Protocol, is a mechanism for email
+ transport. In contrast to IMAP, it is used only to get mail from
+ a server and store it locally on your hard disk.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id="protocol">
+ <glossterm>Protocol:</glossterm>
+ <glossdef>
+ <para>
+ An agreed-upon method of communication, especially one for
+ sending particular types of information between computer systems.
+ Examples include POP (Post Office Protocol), for email, and HTTP
+ (HypterText Transfer Protocol), for web pages.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id="postscript">
+ <glossterm>Postscript:</glossterm>
+ <glossdef>
+ <para>
+ A standard document publishing format. Many printers read raw
+ Postscript, making Postscript quite versatile.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id="public-key-encryption">
+ <glossterm>Public Key Encryption:</glossterm>
+ <glossdef>
+ <para>
+ A strong encryption method that uses a set of two "keys," one of
+ which is made public, and one of which is kept private. Data
+ encrypted using the public key can only be decrypted using the
+ private key. The longer the keys, the more difficult it is to
+ break the encryption.
+ </para>
+ </glossdef>
+ </glossentry>
+
+
+
+ <glossentry id="regular-expression">
+ <glossterm>Regular Expression:</glossterm>
+ <glossdef>
+ <para>
+ A regular expression, or "regex", is a way of describing a
+ string of text using metacharacters or wild-card symbols. For
+ example, the statement <userinput>fly.*so[au]p</userinput> means
+ "any phrase beginning with 'fly' and ending in 'soup' or
+ 'soap'". If you searched for that expression, you'd find both
+ "fly in my soup" and "fly in my soap." There's not room here to
+ go into depth, but if you want, have a look at the documentation
+ for the <command>grep</command> command by opening a command
+ line and typing in <command>man grep</command>.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id="script">
+ <glossterm>Script:</glossterm>
+ <glossdef>
+ <para>
+ A program written in an interpreted (rather than compiled)
+ language. Often used as a synonym for "macro," to denote a series
+ of pre-recorded commands or actions within an application. Often
+ times, accomplish repetitive and tedious tasks, to save the
+ user time.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id="search-base">
+ <glossterm>Search Base:</glossterm>
+ <glossdef>
+ <para>
+ LDAP can break contact lists into many groups. The Search
+ Base tells LDAP the top group to use. How much of the Search
+ Base that is searched is set by the <glossterm
+ linkend="search-scope">Search Scope</glossterm> option.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id="search-scope">
+ <glossterm>Search Scope:</glossterm>
+ <glossdef>
+ <para>
+ Search Scope states how much of the <glossterm
+ linkend="search-base">Search Base</glossterm> to search.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id="sendmail">
+ <glossterm>Sendmail:</glossterm>
+ <glossdef>
+ <para>
+ As its name implies, <application>sendmail</application> is a
+ program which sends mail. <application>Evolution</application>
+ can use it instead of <glossterm>SMTP:</glossterm>; some people
+ prefer it because it offers more flexibility, but is more
+ difficult to set up.
+ </para>
+ </glossdef>
+ </glossentry>
+
+
+ <glossentry id="shortcut-bar">
+ <glossterm>Shortcut Bar:</glossterm>
+ <glossdef>
+ <para>
+ A portion of <application>Evolution</application> which offers
+ users fast access to the most frequently used portions of the
+ application.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id="signature">
+ <glossterm>Signature:</glossterm>
+ <glossdef>
+ <para>
+ In email terms, a signature is a piece of text placed at the end
+ of every email sent, similar to a hand-written signature at the bottom
+ of a written letter. A signature can be anything from a favorite
+ quotation to a link to a web page; courtesy dictates that it be
+ fewer than four lines long.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id="SMTP">
+ <glossterm>SMTP:</glossterm>
+ <glossdef>
+ <para>
+ This is the most common way of transporting mail messages from
+ the client's computer (you) to the server. SMTP stands for
+ Simple Mail Transfer Protocol.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id="tooltip">
+ <glossterm>Tool-Tip:</glossterm>
+ <glossdef>
+ <para>
+ A small box of explanatory text which appears when the mouse
+ pointer is held motionless over a button or other interface
+ element.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id="virus">
+ <glossterm>Virus:</glossterm>
+ <glossdef>
+ <para>
+ A program which inserts itself into other files or programs and
+ which, when executed, spreads to more programs and other
+ computers. A virus can cause substantial damage by clogging
+ networks or disk drives, deleting files, or opening security
+ holes.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id="vcard">
+ <glossterm>VCard:</glossterm>
+ <glossdef>
+ <para>
+ A file format for the exchange of contact information. When you
+ get an address card attached to an email, it's probably in VCard
+ format. Not to be confused with <glossterm
+ linkend="vfolder">vFolder:</glossterm>.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id="vfolder">
+ <glossterm>vFolder:</glossterm>
+ <glossdef>
+ <para>
+ An email organization tool. vFolders allows you to create a folder
+ that contains the results of a complex search. vFolder contents are
+ are updated dynamically.
+ </para>
+ </glossdef>
+ </glossentry>
+
+</glossary>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/help/C/apx-gpl.sgml b/help/C/apx-gpl.sgml
new file mode 100644
index 0000000000..8404e9ff3c
--- /dev/null
+++ b/help/C/apx-gpl.sgml
@@ -0,0 +1,417 @@
+<appendix id="apx-gpl">
+<title>GNU General Public License</title>
+<para>
+Copyright (c) 2000 Free Software Foundation, Inc.
+ <address>Free Software Foundation, Inc.
+ <street>59 Temple Place, Suite 330</street>,
+ <city>Boston</city>,
+ <state>MA</state> <postcode>02111-1307</postcode>
+ <country>USA</country>
+ </address>.
+ </para>
+
+<para>
+This is version 2
+</para>
+
+ <para>
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+ </para>
+
+
+ <sect1 id="preamble">
+ <title>Preamble</title>
+
+ <para>
+ The licenses for most software are designed to take away your
+ freedom to share and change it. By contrast, the GNU General Public
+ License is intended to guarantee your freedom to share and change
+ free software - to make sure the software is free for all its users.
+ This General Public License applies to most of the Free Software
+ Foundation's software and to any other program whose authors commit
+ to using it. (Some other Free Software Foundation software is covered
+ by the GNU Library General Public License instead.) You can apply it
+ to your programs, too.
+ </para>
+
+ <para>
+ When we speak of free software, we are referring to freedom, not price.
+ Our General Public Licenses are designed to make sure that you have the
+ freedom to distribute copies of free software (and charge for this
+ service if you wish), that you receive source code or can get it if you
+ want it, that you can change the software or use pieces of it in new free
+ programs; and that you know you can do these things.
+ </para>
+
+ <para>
+ To protect your rights, we need to make restrictions that forbid anyone
+ to deny you these rights or to ask you to surrender the rights. These
+ restrictions translate to certain responsibilities for you if you distribute
+ copies of the software, or if you modify it.
+ </para>
+
+ <para>
+ For example, if you distribute copies of such a program, whether gratis or
+ for a fee, you must give the recipients all the rights that you have. You
+ must make sure that they, too, receive or can get the source code. And you
+ must show them these terms so they know their rights.
+ </para>
+
+ <para>
+ We protect your rights with two steps:
+
+ <orderedlist numeration="arabic">
+ <listitem>
+ <para>
+ copyright the software, and
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ offer you this license which gives you legal permission to copy,
+ distribute and/or modify the software.
+ </para>
+ </listitem>
+ </orderedlist>
+ </para>
+
+ <para>
+ Also, for each author's protection and ours, we want to make certain that
+ everyone understands that there is no warranty for this free software. If
+ the software is modified by someone else and passed on, we want its
+ recipients to know that what they have is not the original, so that any
+ problems introduced by others will not reflect on the original authors'
+ reputations.
+ </para>
+
+ <para>
+ Finally, any free program is threatened constantly by software patents.
+ We wish to avoid the danger that redistributors of a free program will
+ individually obtain patent licenses, in effect making the program
+ proprietary. To prevent this, we have made it clear that any patent must be
+ licensed for everyone's free use or not licensed at all.
+ </para>
+
+ <para>
+ The precise terms and conditions for copying, distribution and modification
+ follow.
+ </para>
+
+ </sect1>
+
+ <sect1 id="terms">
+ <title>TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION</title>
+
+ <sect2 id="sect0">
+ <title>Section 0</title>
+ <para>
+ This License applies to any program or other work which contains a notice
+ placed by the copyright holder saying it may be distributed under the terms
+ of this General Public License. The "Program", below, refers to any such
+ program or work, and a <quote>work based on the Program</quote> means either
+ the Program or any derivative work under copyright law: that is to say, a
+ work containing the Program or a portion of it, either verbatim or with
+ modifications and/or translated into another language. (Hereinafter, translation
+ is included without limitation in the term <quote>modification</quote>.) Each
+ licensee is addressed as <quote>you</quote>.
+ </para>
+
+ <para>
+ Activities other than copying, distribution and modification are not covered by
+ this License; they are outside its scope. The act of running the Program is not
+ restricted, and the output from the Program is covered only if its contents
+ constitute a work based on the Program (independent of having been made by running
+ the Program). Whether that is true depends on what the Program does.
+ </para>
+ </sect2>
+
+ <sect2 id="sect1">
+ <title>Section 1</title>
+ <para>
+ You may copy and distribute verbatim copies of the Program's source code as you
+ receive it, in any medium, provided that you conspicuously and appropriately
+ publish on each copy an appropriate copyright notice and disclaimer of warranty;
+ keep intact all the notices that refer to this License and to the absence of any
+ warranty; and give any other recipients of the Program a copy of this License
+ along with the Program.
+ </para>
+
+ <para>
+ You may charge a fee for the physical act of transferring a copy, and you may at
+ your option offer warranty protection in exchange for a fee.
+ </para>
+ </sect2>
+
+ <sect2 id="sect2">
+ <title>Section 2</title>
+ <para>
+ You may modify your copy or copies of the Program or any portion of it, thus
+ forming a work based on the Program, and copy and distribute such modifications
+ or work under the terms of <link linkend="sect1">Section 1</link> above, provided
+ that you also meet all of these conditions:
+
+ <orderedlist numeration="loweralpha">
+ <listitem>
+ <para>
+ You must cause the modified files to carry prominent notices stating that
+ you changed the files and the date of any change.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ You must cause any work that you distribute or publish, that in whole or
+ in part contains or is derived from the Program or any part thereof, to be
+ licensed as a whole at no charge to all third parties under the terms of
+ this License.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ If the modified program normally reads commands interactively when run, you
+ must cause it, when started running for such interactive use in the most
+ ordinary way, to print or display an announcement including an appropriate
+ copyright notice and a notice that there is no warranty (or else, saying
+ that you provide a warranty) and that users may redistribute the program
+ under these conditions, and telling the user how to view a copy of this
+ License.
+
+ <note>
+ <title>Exception:</title>
+ <para>
+ If the Program itself is interactive but does not normally print such an
+ announcement, your work based on the Program is not required to print an
+ announcement.)
+ </para>
+ </note>
+
+ </para>
+ </listitem>
+ </orderedlist>
+ </para>
+
+ <para>
+ These requirements apply to the modified work as a whole. If identifiable sections
+ of that work are not derived from the Program, and can be reasonably considered
+ independent and separate works in themselves, then this License, and its terms,
+ do not apply to those sections when you distribute them as separate works. But when
+ you distribute the same sections as part of a whole which is a work based on the
+ Program, the distribution of the whole must be on the terms of this License, whose
+ permissions for other licensees extend to the entire whole, and thus to each and
+ every part regardless of who wrote it.
+ </para>
+
+ <para>
+ Thus, it is not the intent of this section to claim rights or contest your rights
+ to work written entirely by you; rather, the intent is to exercise the right to control
+ the distribution of derivative or collective works based on the Program.
+ </para>
+
+ <para>
+ In addition, mere aggregation of another work not based on the Program with the Program
+ (or with a work based on the Program) on a volume of a storage or distribution medium
+ does not bring the other work under the scope of this License.
+ </para>
+ </sect2>
+
+ <sect2 id="sect3">
+ <title>Section 3</title>
+
+ <para>
+ You may copy and distribute the Program (or a work based on it, under
+ <link linkend="sect2">Section 2</link> in object code or executable form under the terms of
+ <link linkend="sect1">Sections 1</link> and <link linkend="sect2">2</link> above provided that
+ you also do one of the following:
+
+ <orderedlist numeration="loweralpha">
+ <listitem>
+ <para>
+ Accompany it with the complete corresponding machine-readable source code, which
+
+ must be distributed under the terms of Sections 1 and 2 above on a medium
+ customarily used for software interchange; or,
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Accompany it with a written offer, valid for at least three years, to give any
+ third party, for a charge no more than your cost of physically performing source
+ distribution, a complete machine-readable copy of the corresponding source code,
+ to be distributed under the terms of Sections and above on a medium customarily
+ used for software interchange; or,
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Accompany it with the information you received as to the offer to distribute
+ corresponding source code. (This alternative is allowed only for noncommercial
+ distribution and only if you received the program in object code or executable form
+ with such an offer, in accord with Subsection b above.)
+ </para>
+ </listitem>
+ </orderedlist>
+ </para>
+
+ <para>
+ The source code for a work means the preferred form of the work for making modifications
+ to it. For an executable work, complete source code means all the source code for all modules
+ it contains, plus any associated interface definition files, plus the scripts used to control
+ compilation and installation of the executable. However, as a special exception, the source
+ code distributed need not include anything that is normally distributed (in either source or
+ binary form) with the major components (compiler, kernel, and so on) of the operating system
+ on which the executable runs, unless that component itself accompanies the executable.
+ </para>
+
+ <para>
+ If distribution of executable or object code is made by offering access to copy from a
+ designated place, then offering equivalent access to copy the source code from the same place
+ counts as distribution of the source code, even though third parties are not compelled to
+ copy the source along with the object code.
+ </para>
+ </sect2>
+
+ <sect2 id="sect4">
+ <title>Section 4</title>
+
+ <para>
+ You may not copy, modify, sublicense, or distribute the Program except as expressly provided
+ under this License. Any attempt otherwise to copy, modify, sublicense or distribute the
+ Program is void, and will automatically terminate your rights under this License. However,
+ parties who have received copies, or rights, from you under this License will not have their
+ licenses terminated so long as such parties remain in full compliance.
+ </para>
+ </sect2>
+
+ <sect2 id="sect5">
+ <title>Section 5</title>
+
+ <para>
+ You are not required to accept this License, since you have not signed it. However, nothing
+ else grants you permission to modify or distribute the Program or its derivative works.
+ These actions are prohibited by law if you do not accept this License. Therefore, by modifying
+ or distributing the Program (or any work based on the Program), you indicate your acceptance
+ of this License to do so, and all its terms and conditions for copying, distributing or
+ modifying the Program or works based on it.
+ </para>
+ </sect2>
+
+ <sect2 id="sect6">
+ <title>Section 6</title>
+
+ <para>
+ Each time you redistribute the Program (or any work based on the Program), the recipient
+ automatically receives a license from the original licensor to copy, distribute or modify
+ the Program subject to these terms and conditions. You may not impose any further restrictions
+ on the recipients' exercise of the rights granted herein. You are not responsible for enforcing
+ compliance by third parties to this License.
+ </para>
+ </sect2>
+
+ <sect2 id="sect7">
+ <title>Section 7</title>
+
+ <para>
+ If, as a consequence of a court judgment or allegation of patent infringement or for any other
+ reason (not limited to patent issues), conditions are imposed on you (whether by court order,
+ agreement or otherwise) that contradict the conditions of this License, they do not excuse you
+ from the conditions of this License. If you cannot distribute so as to satisfy simultaneously
+ your obligations under this License and any other pertinent obligations, then as a consequence
+ you may not distribute the Program at all. For example, if a patent license would not permit
+ royalty-free redistribution of the Program by all those who receive copies directly or
+ indirectly through you, then the only way you could satisfy both it and this License would be
+ to refrain entirely from distribution of the Program.
+ </para>
+
+ <para>
+ If any portion of this section is held invalid or unenforceable under any particular circumstance,
+ the balance of the section is intended to apply and the section as a whole is intended to apply
+ in other circumstances.
+ </para>
+
+ <para>
+ It is not the purpose of this section to induce you to infringe any patents or other property
+ right claims or to contest validity of any such claims; this section has the sole purpose of
+ protecting the integrity of the free software distribution system, which is implemented by public
+ license practices. Many people have made generous contributions to the wide range of software
+ distributed through that system in reliance on consistent application of that system; it is up
+ to the author/donor to decide if he or she is willing to distribute software through any other
+ system and a licensee cannot impose that choice.
+ </para>
+
+ <para>
+ This section is intended to make thoroughly clear what is believed to be a consequence of the
+ rest of this License.
+ </para>
+ </sect2>
+
+ <sect2 id="sect8">
+ <title>Section 8</title>
+
+ <para>
+ If the distribution and/or use of the Program is restricted in certain countries either by patents
+ or by copyrighted interfaces, the original copyright holder who places the Program under this License
+ may add an explicit geographical distribution limitation excluding those countries, so that
+ distribution is permitted only in or among countries not thus excluded. In such case, this License
+ incorporates the limitation as if written in the body of this License.
+ </para>
+ </sect2>
+
+ <sect2 id="sect9">
+ <title>Section 9</title>
+
+ <para>
+ The Free Software Foundation may publish revised and/or new versions of the General Public License
+ from time to time. Such new versions will be similar in spirit to the present version, but may differ
+ in detail to address new problems or concerns.
+ </para>
+
+ <para>
+ Each version is given a distinguishing version number. If the Program specifies a version number of
+ this License which applies to it and "any later version", you have the option of following the terms
+ and conditions either of that version or of any later version published by the Free Software
+ Foundation. If the Program does not specify a version number of this License, you may choose any
+ version ever published by the Free Software Foundation.
+ </para>
+ </sect2>
+
+ <sect2 id="sect10">
+ <title>Section 10</title>
+
+ <para>
+ If you wish to incorporate parts of the Program into other free programs whose distribution
+ conditions are different, write to the author to ask for permission. For software which is copyrighted
+ by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions
+ for this. Our decision will be guided by the two goals of preserving the free status of all
+ derivatives of our free software and of promoting the sharing and reuse of software generally.
+ </para>
+ </sect2>
+
+ <sect2 id="sect11">
+ <title>NO WARRANTY</title>
+ <subtitle>Section 11</subtitle>
+
+ <para>
+ BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT
+ PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
+ OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED,
+ INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
+ PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+ </para>
+ </sect2>
+
+ <sect2 id="sect12">
+ <title>Section 12</title>
+
+ <para>
+ IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR
+ ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU
+ FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
+ USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED
+ INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH
+ ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
+ DAMAGES.
+ </para>
+ </sect2>
+ </sect1>
+ </appendix> \ No newline at end of file
diff --git a/help/C/config-prefs.sgml b/help/C/config-prefs.sgml
new file mode 100644
index 0000000000..a608dea6f6
--- /dev/null
+++ b/help/C/config-prefs.sgml
@@ -0,0 +1,936 @@
+<!--
+<!DOCTYPE Chapter PUBLIC "-//GNOME//DTD DocBook PNG Variant V1.1//EN">
+-->
+<chapter id="config-prefs">
+
+ <title>Advanced Configuration</title>
+ <para>
+ Perhaps your mail server has changed names. Perhaps you've
+ grown tired of a certain layout for your appointments.
+ Whatever the reason, you want to change your
+ <application>Evolution</application> settings. This chapter
+ will tell you how to do just that.
+ </para>
+ <para>
+ Evolution 1.2 brings with it a redesigned comprehensive
+ settings window that you can open by choosing <menuchoice>
+ <guimenu>Tools</guimenu>
+ <guimenuitem>Configure</guimenuitem></menuchoice>, no matter
+ where you are in Evolution. On the left half of the settings
+ window is a column, similar to the Evolution shortcut bar,
+ which lets you choose which portion of Evolution to
+ customize. The right half of the window is where you'll make
+ your actual changes.
+ </para>
+
+
+ <!-- ==============Figure===================== -->
+ <figure id="config-prefs-mail-fig">
+ <title>Changing Mail Settings</title>
+ <screenshot>
+ <screeninfo>Changing Mail Settings</screeninfo>
+ <mediaobject><imageobject><imagedata fileref="figures/config-mail" format="png" srccredit="Aaron Weber">
+ </imageobject></mediaobject>
+ </screenshot>
+ </figure>
+ <!-- ==============End of Figure================-->
+
+ <para>
+ There are eight items you can customize. From top to bottom, they
+ are:
+ <variablelist>
+ <varlistentry>
+ <term>Mail Accounts</term>
+ <listitem>
+ <para>
+ Here, add or change information about your email
+ accounts: the servers to which you connect, the way you
+ download mail, your password authentication mode, and so
+ forth. This is the most complex item in the list, and is
+ covered in <xref linkend="config-prefs-mail-identity">.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term>Folder Settings</term>
+ <listitem>
+ <para>
+ Here, you can choose the default folders for various
+ components of Evolution, the folders that will be cached
+ locally when you go to offline mode, and the folders that
+ Evolution will use when it is searching for
+ autocompletion information as you address a mail.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term>Mail Preferences</term>
+ <listitem>
+ <para>
+ These are overall mail reading preferences: display
+ settings, notification options, security, and so
+ forth. These are covered in <xref
+ linkend="config-prefs-mail-display">.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term>Composer Preferences</term>
+ <listitem>
+ <para>
+ Settings for the way that you use the mail composer:
+ shortcuts, signatures, spelling, and so forth. One fun
+ feature here is the ability to substitute graphical
+ smiley-faces for "emoticons" such as :) that many people
+ use in email. This tool is covered in <xref
+ linkend="config-prefs-mail-composer">.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term>Calendar and Tasks</term>
+ <listitem>
+ <para>
+ Here, you can set the way the calendar behaves, including
+ your time zone and the length of your work-week.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term>Directory Servers</term>
+ <listitem>
+ <para>
+ If you want to use a shared directory server (LDAP
+ server), this is the place to set it up.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term>Font Preferences</term>
+ <listitem>
+ <para>
+ Choose the fonts that Evolution will use to display email
+ here.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term>Summary Preferences</term>
+ <listitem>
+ <para>
+ Set the mail folders, news feeds, schedule summary
+ length, and weather locations to be displayed here. For
+ news feeds, enter the web address of any RDF file.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ </variablelist>
+
+ </para>
+
+ <sect1 id="config-prefs-mail">
+ <title>Mail Settings</title>
+ <para>
+ The first few tools, with the exception of the folder tool,
+ cover mail tasks:
+ </para>
+
+ <sect2 id="config-prefs-mail-identity">
+ <title>Working with Mail Accounts</title>
+ <para>
+ <application>Ximian Evolution</application> allows you to
+ maintain multiple accounts, or identities. This is useful
+ want to keep personal and professional email separate, or if
+ you wear several hats at work. When you are writing an email
+ message, you can which account to use by selecting from the
+ drop-down list next to the <guilabel>From</guilabel> entry in
+ the message composer.
+ </para>
+
+ <para>
+ Clicking <guibutton>Get Mail</guibutton> will refresh any
+ IMAP, <filename>mh</filename>, or
+ <filename>mbox</filename> listings
+ and check and download mail from all POP servers. In other
+ words, <guibutton>Get Mail</guibutton> gets your mail, no
+ matter how many sources you have, or what types they are. If
+ you don't want to check mail for a given account, select it
+ in the <guilabel>Accounts</guilabel> tab and click the
+ <guibutton>Disable</guibutton> button.
+ </para>
+
+ <para>
+ To add a new account, simply click <guibutton>Add</guibutton>
+ to open the mail configuration assistant. To alter an
+ existing identity, select it in the
+ <interface>Preferences</interface> window, and then click
+ <guibutton>Edit</guibutton> to open the account editor
+ dialog.
+ </para>
+
+ <para>
+ The account editor dialog has six sections:
+ <variablelist>
+
+ <varlistentry>
+ <term>Identity:</term>
+ <listitem>
+ <para>
+ Here, enter the name,
+ email address, and other identifying information for the
+ account.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>Receiving Mail</term>
+ <listitem>
+ <para>
+ Here, select the way you will be getting mail: you may
+ download mail from a server (<glossterm
+ linkend="pop">POP</glossterm>), read and keep it on the
+ server (Microsoft Exchange or <glossterm
+ linkend="imap">IMAP</glossterm>), or read it from files
+ that already exist on your desktop computer. If you use
+ a server, it may permit or require you to use a Secure
+ Socket Layer (SSL) connection. To turn SSL connections
+ on, just click the <guibutton>Use Secure Connection
+ (SSL)</guibutton> button.
+
+<note id="config-arbitrary-port">
+<title>Specifying Port Numbers</title>
+<para>
+Your system administrator may ask you to connect to a specific port on
+a mail server. To specify which port you use, just type a colon and
+the port number after the server name. For example, to connect to port
+143 on the server smtp.omniport.com, you would enter
+as
+<userinput>
+smtp.omniport.com:143
+</userinput> as the server name.
+</para>
+</note>
+
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>Receiving Options</term>
+ <listitem>
+ <para>
+ Here, decide whether you'd like to check for mail
+ automatically and how often, as well as other message
+ retrieval options.
+
+ <variablelist>
+ <varlistentry>
+ <term>If you chose POP:</term>
+ <listitem>
+ <para>
+ <itemizedlist>
+ <listitem>
+ <para>Checking for new mail: If you would
+ like <application>Evolution</application>
+ to check for new mail automatically,
+ check the box and select a frequency in
+ minutes.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ Message Storage: If you'd like to store
+ copies of your mail on the server, check
+ this option.
+ </para>
+ </listitem>
+
+
+ <listitem>
+ <para>Store Store status headers in
+ Elm/Pine/Mutt format: If you would like to
+ use the X-Status header format used by the
+ mail clients Elm, Pine, and Mutt, select
+ this option. This option is useful if you
+ plan to check your mail with those clients
+ from time to time.
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term>If you chose Microsoft Exchange:</term>
+ <listitem>
+ <para>
+
+ <itemizedlist> <listitem>
+ <para>Checking for new mail: If you would like
+ <application>Evolution</application> to check for new mail
+ automatically, check the box and select a frequency in
+ minutes.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>Exchange Server: If your active directory user name
+ is different from your Exchange mail user name, check this
+ box and enter your mail username here.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>Create a Global Address List folder: If you would
+ like to have a separate folder for the Active Directory's
+ Global Address List, leave this box checked. </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ Active Directory Server Name: In most organizations,
+ the Active Directory server will be different from
+ the Exchange mail server. If so, check the box and
+ enter the Active Directory server name here.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>Limit number of Responses: Select a maximum number
+ of results for an address search. A maximum number of
+ results limits the load on your system and on your network.
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term>If you chose IMAP:</term>
+ <listitem>
+ <para>
+
+ <itemizedlist>
+ <listitem>
+ <para>Checking for new mail: If you would like
+ <application>Evolution</application> to check for new mail
+ automatically, check the box and select a frequency in
+ minutes.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>If you want <application>Evolution</application>
+ to check for new messages in <emphasis>all</emphasis> your
+ IMAP folders, make sure the <guilabel>Check for new
+ messages in all folders</guilabel> box is selected.</para>
+ </listitem>
+
+ <listitem>
+ <para>Show only subscribed folders: Check this box if you
+ have more folders in your IMAP view than you want to
+ read.</para>
+ </listitem>
+
+ <listitem>
+ <para>
+ Override server-supplied namespace: If you like, enter a
+ specific directory where your server stores mail for
+ you. Typical values are "mail" and "Mail." For more
+ information about how to use IMAP mail, see <xref
+ linkend="usage-mail-subscriptions">.</para>
+ </listitem>
+
+ <listitem>
+ <para>Apply filters to new messages in INBOX on this
+ server: If you'd like your filters to work on this account
+ as well as on locally downloaded mail, check this box.</para>
+ </listitem>
+
+ <listitem>
+ <para>Store Store status headers in Elm/Pine/Mutt format:
+ If you would like to use the X-Status header format used
+ by the mail clients Elm, Pine, and Mutt, select this
+ option. This option is useful if you plan to check your
+ mail with those clients from time to time.
+ </para>
+ </listitem>
+
+ </itemizedlist>
+ </para>
+ </listitem>
+ </varlistentry>
+
+
+ </variablelist>
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>Sending Mail</term>
+ <listitem>
+ <para>
+ In this section, you will choose and configure a method
+ for sending mail. You may choose <glossterm
+ linkend="smtp">SMTP</glossterm>, Microsoft Exchange (if
+ you have purchased the Ximian Connector for Microsoft
+ Exchange) or <glossterm
+ linkend="sendmail">sendmail</glossterm>.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>Special Folders</term>
+ <listitem>
+ <para>
+ Here, you can decide where this account will store the
+ messages that it has sent, and the messages that you
+ save as drafts.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>Security</term>
+ <listitem>
+ <para>
+ In this section, you will set the security options for
+ this account. Enter your PGP Key ID and decide how
+ frequently to encrypt and sign your messages. You can
+ learn more about PGP and encryption in <xref
+ linkend="encryption">.
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </para>
+ </sect2>
+
+
+ <sect2 id="config-prefs-mail-display">
+ <title>Mail Display Options</title>
+ <para>
+ In this tab you can decide how you would like
+ <application>Ximian Evolution</application> to display your
+ mail: how to display citations, how long to wait before
+ marking a message as read, and so forth.
+ </para>
+ <para>
+ This is also where you can decide how you would like
+ <application>Ximian Evolution</application> to handle inline
+ images in HTML mail that you get. There is a detailed
+ discussion of the issues surrounding these options in <xref
+ linkend="usage-mail-getnsend-get-attach-html">.
+ </para>
+ <para>
+ To change the font which <application>Ximian
+ Evolution</application> uses to display mail, do the
+ following:
+ <orderedlist numeration="arabic">
+ <listitem>
+ <para>
+ Open the Evolution preferences dialog by selecting
+ <menuchoice> <guimenu>Tools</guimenu>
+ <guimenuitem>Settings</guimenuitem> </menuchoice>.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Select the <guilabel>Font Settings</guilabel> portion of the
+ settings dialog.
+ </para>
+ </listitem>
+ <listitem>
+ <para>Choose the font and font size you would like to use.
+ </para>
+ </listitem>
+ </orderedlist>
+ </para>
+ </sect2>
+
+ <sect2 id="config-prefs-mail-composer">
+ <title>Message Composer Preferences</title>
+ <para>
+ There are three whole tabs of settings you can change for the
+ message composer. The General tab covers shortcuts and
+ assorted behavior, and the other two control signatures and
+ spell checking. In the General tab, you can set:
+
+ <variablelist>
+
+ <varlistentry>
+ <term>Shortcuts Type</term>
+ <listitem>
+ <para>
+ Choose a keyboard shortcut scheme: do you prefer
+ keyboard shortcuts similar to those of Microsoft
+ Windows, XEmacs, or Emacs?
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term>Default Behavior</term>
+ <listitem>
+ <para>
+ Choose how you will normally forward and reply
+ messages, what character set they will use, whether
+ they will be in HTML, and whether that HTML can
+ contain smiley face images.
+ </para>
+ </listitem>
+ </varlistentry>
+
+
+ <varlistentry>
+ <term>Alerts</term>
+ <listitem>
+ <para>
+ There are two optional alerts here:
+ <variablelist>
+ <varlistentry>
+ <term>Prompt when sending messages with an empty subject</term>
+ <listitem>
+ <para>
+ The composer will warn you if you try to send a
+ message without a subject.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term>Prompt when sending messages with only Bcc recipients defined</term>
+ <listitem>
+ <para>
+ The composer will warn you if you try to send a
+ message that has only <guilabel>Bcc</guilabel>
+ recipients. This is important because some mail
+ servers will fail to honor blind carbon copy if you
+ do not have at least one recipient that is visible to
+ all readers.
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </para>
+
+ <para>
+ The signature editor is new for Evolution 1.2. It allows you
+ to create several different signatures in plain text or in
+ HTML, and to specify which of them will be added to emails
+ you create in the message composer. If you prefer to use an
+ alternate signature or none at all, you can select it from
+ the mail composer itself.
+ </para>
+ <para>
+ In the spell-checking tool, you can set spelling options,
+ including the language or languages you will use. Note that you
+ must install the gnome-spell package, available through Red
+ Carpet, for spell-checking to be available in
+ Evolution. Alternate dictionaries are also available through
+ Red Carpet and are detected automatically if you have installed
+ them.
+ </para>
+ </sect2>
+
+
+<!-- NOT FOR 1.0, see usage-mail.sgml
+ <sect1 id="config-prefs-news">
+ <title>News Servers</title>
+ <para>
+ Newsgroups are so much like mailing lists that there's no
+ reason not to keep them right next to your mail. When you
+ first select the <guilabel>News Servers</guilabel> tab,
+ you will see a blank box with the three familiar buttons
+ on the right: <guibutton>Add</guibutton>,
+ <guibutton>Edit</guibutton>, and
+ <guibutton>Delete</guibutton>.
+ </para>
+ <para>
+ Click <guibutton>Add</guibutton> to add a news server; you
+ will be prompted for its name. Enter the name, click
+ <guibutton>OK</guibutton>, and you're done. You can have
+ as many news servers as you like, of course. News servers
+ will appear next to your IMAP servers in the
+ <interface>folder bar</interface>.
+ </para>
+ </sect2>
+-->
+ </sect1>
+
+ <sect1 id="config-prefs-cal">
+ <title>Calendar and Task List Settings</title>
+ <para>
+ The calendar configuration tool has two tabs
+ <guilabel>General</guilabel> and
+ <guilabel>Display</guilabel>, and is illustrated in <xref
+ linkend="config-prefs-cal-fig">.
+
+ <!-- ==============Figure===================== -->
+ <figure id="config-prefs-cal-fig">
+ <title>Calendar Preferences Dialog</title>
+ <screenshot>
+ <screeninfo>Calendar Configuration</screeninfo>
+ <mediaobject><imageobject><imagedata fileref="figures/config-cal" format="png" srccredit="Aaron Weber">
+ </imageobject></mediaobject>
+ </screenshot>
+ </figure>
+ <!-- ==============End of Figure================-->
+ </para>
+
+ <para>
+ The <guilabel>General</guilabel> tab lets you set the
+ following:
+ <variablelist>
+ <varlistentry>
+ <term>Time zone</term>
+ <listitem>
+ <para>
+ The city you're located in, to judge your time zone.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>Time format</term>
+ <listitem>
+ <para>You may choose between twelve-hour (AM/PM) and
+ twenty-four hour time formats here by clicking the
+ appropriate radio button.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>Work Week</term>
+ <listitem>
+ <para>
+ When does your work day start, and when does it end?
+ In the day and week views,
+ <application>Evolution</application> displays all the
+ hours in the range you select here, even if there are
+ no appointments for those times. Of course, you can
+ still schedule an appointment outside of these hours,
+ and if you do, the display will be extended to show
+ it.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>First day of the week</term>
+ <listitem>
+ <para>You can set weeks to start on Sunday or on Monday.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>Start of day</term>
+ <listitem>
+ <para>
+ Says what time of the day your weekday starts. This
+ will show all times till the end of the day,
+ regardless of there is an appointment during the time
+ period.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>End of day</term>
+ <listitem>
+ <para>
+ Sets the time the day ends at.
+ </para>
+ </listitem>
+ </varlistentry>
+
+
+ <varlistentry>
+ <term>Alerts</term>
+ <listitem>
+ <para>
+ If you'd like to be warned before you delete any
+ appointment, or to have a reminder automatically
+ appear for each event, select the check boxes here.
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </para>
+
+ <para>
+ The <interface>Display</interface> section lets you choose how
+ your appointments and tasks will appear in your calendar.
+ </para>
+ <para>The display properties you can set are:
+
+ <variablelist>
+ <varlistentry>
+ <term>Time divisions</term>
+ <listitem>
+ <para>
+ Sets the increments shown on the daily view in the
+ calendar. You can set this to be anywhere from five
+ minutes to an hour, in five minute increments.</para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term>Show appointment end times in week and month views</term>
+ <listitem>
+ <para>
+ If there is space,
+ <application>Evolution</application> will show the end
+ times in the week and month views for each
+ appointment.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>Compress weekends in month view</term>
+ <listitem>
+ <para>
+ If checked, your weekends will be shown in one box,
+ instead of one for each day in the month view.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term>Show week numbers in date navigator</term>
+ <listitem>
+ <para>
+ This will show the week numbers next to the respective
+ weeks in the calendar.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term>Tasks due today</term>
+ <listitem>
+ <para>
+ Configures what color to set your tasks that are due
+ today to.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>Overdue tasks</term>
+ <listitem>
+ <para>
+ Choose the color for overdue tasks.
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </para>
+ </sect1>
+ <sect1 id="config-prefs-contact">
+ <title>Managing the Addressbook</title>
+ <para>
+ Addressbook settings are limited to the usage and
+ configuration of directory servers (LDAP and
+ Exchange). Contact folders for the mailer's autocompletion
+ feature are set in the Folders tool above, and all other
+ addressbook controls are available in the addressbook window
+ itself.
+ </para>
+
+ <sect2 id="config-prefs-contact-ldap-add">
+ <title>Adding Directory Servers</title>
+ <para>
+ To add a new <glossterm linkend="ldap">LDAP</glossterm> server
+ to your available contact folders:
+ <orderedlist numeration="arabic">
+ <listitem>
+ <para>
+ Select
+ <menuchoice>
+ <guimenu>Tools</guimenu>
+ <guimenuitem>Settings</guimenuitem>
+ </menuchoice>
+ and then click the <guilabel>Directory
+ Servers</guilabel> button in the settings dialog that appears.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Click the <guibutton>Add</guibutton> button on the right
+ side to open a Directory Server addition assistant.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Enter the information requested by the assistant:
+ <variablelist>
+
+ <varlistentry>
+ <term>Server name</term>
+ <listitem>
+ <para>
+ Address of the server where the addressbook is located.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>Login Method</term>
+ <listitem>
+ <para>
+ Specify whether your login is anonymous, using
+ an email address, or a "distinguished name." If
+ the login is not anonymous, enter the login name
+ required by the server.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>Port</term>
+ <listitem>
+ <para>
+ The internet port
+ <application>Evolution</application> connects to
+ in order to access the LDAP database. This is
+ normally 389.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>Use SSL/TLS</term>
+ <listitem>
+ <para>
+ SSL and TLS are security mechanisms. If you
+ select <guilabel>Always</guilabel>, Evolution
+ will not connect unless
+ secure connections are available. The default value is
+ <guilabel>Whenever Possible</guilabel>, which uses
+ secure connections if they are available,
+ but does not cause failure if they are not.
+ </para>
+ </listitem>
+ </varlistentry>
+
+
+ <varlistentry>
+ <term><glossterm linkend="search-base">Search base</glossterm></term>
+ <listitem>
+ <para>
+ The base entry to use for all your searches.
+ Contact your administrator for information about
+ the correct settings.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><glossterm linkend="search-scope">Search scope</glossterm></term>
+ <listitem>
+ <para>
+ How broad the search is in the directory. The
+ following options are available:
+ <variablelist>
+ <varlistentry>
+ <term>One</term>
+ <listitem>
+ <para>
+ Searches the Search Base and one entry
+ below it.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>Sub</term>
+ <listitem>
+ <para>
+ Searches the Search Base and all entries
+ below it.
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term>Timeout Limit</term>
+ <listitem>
+ <para>
+ This is the maximum time Evolution will attempt to
+ download data from the server before giving up.
+ </para>
+ </listitem>
+ </varlistentry>
+
+
+ <varlistentry>
+ <term>Download Limit</term>
+ <listitem>
+ <para>
+ Set the maximum number of results for a given
+ search. Most servers refuse to send more than
+ 500, but you can set the number lower if you
+ want to shorten downloads for very broad
+ searches.
+ </para>
+ </listitem>
+ </varlistentry>
+
+
+ <varlistentry>
+ <term>Display name</term>
+ <listitem>
+ <para>
+ The name that you see on the screen. This could
+ be anything you wish.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ </variablelist>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Click <guibutton>OK</guibutton>.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Click <guibutton>OK</guibutton> to permanently make
+ changes or <guibutton>Apply</guibutton> to temporarily
+ set the changes.
+ </para>
+ </listitem>
+ </orderedlist>
+
+
+<!-- Finish this example:
+
+ <example id="ldap-config-example">
+ <title>LDAP Configuration</title>
+ <para>
+ Rich works at omniport.net and needs to access the
+ company's LDAP server so that he can look up the email
+ addresses of his co-workers.
+ </para>
+ <para>
+ He uses his email address, rich@omniport.net,
+ </para>
+ <para>
+ His Server Name is: ldap.wemakechips.com
+ </para>
+ </example>
+-->
+ </para>
+ </sect2>
+ </sect1>
+</chapter> \ No newline at end of file
diff --git a/help/C/config-sync.sgml b/help/C/config-sync.sgml
new file mode 100644
index 0000000000..6a6503a670
--- /dev/null
+++ b/help/C/config-sync.sgml
@@ -0,0 +1,138 @@
+ <chapter id="config-sync">
+ <title>Setting up your synchronization system</title>
+ <para>
+ Synchronization presents you with two issues you'll need to
+ address.
+ <simplelist>
+ <member>
+ Your computer needs to recognize and access your handheld.
+ At this time, <application>Ximian Evolution</application> only
+ supports Palm-OS devices like the Palm Pilot and the
+ Handspring Visor.
+ </member>
+ <member>
+ You should decide what sort of synchronization behavior you
+ want.
+ </member>
+ </simplelist>
+ </para>
+
+ <para>
+ If you haven't used a handheld device with your computer
+ before, you'll need to run the GNOME <application>Control
+ Center</application> by selecting
+ <menuchoice><guimenu>System</guimenu><guimenuitem>Settings</guimenuitem></menuchoice>,
+ and make sure that <application>Pilot Link</application> is
+ properly configured. You will need to make sure that you have
+ read and write permissions on the device, which is normally
+ /dev/pilot. If that does not work, check /dev/ttyS0 if you have
+ a serial connection, or /dev/ttyUSB0 for a USB connection. You
+ can do this by becoming root and running the command:
+ <userinput>chmod 777 /dev/ttyUSB0</userinput>.
+ </para>
+ <para>
+ Once your computer and your Palm-OS device are talking happily
+ to each other, select the <glossterm
+ linkend="conduit">conduits</glossterm> you want under the
+ <guilabel>Pilot Conduits</guilabel> section of the Control
+ Center. You may use conduits to synchronize data with several
+ applications; the <application>Ximian Evolution</application>
+ conduits are labeled <guilabel>EAddress</guilabel>, for the
+ contacts in your addressbook, <guilabel>ECalendar</guilabel>,
+ for your calendar, and <guilabel>ETodo</guilabel>, for your
+ task list.
+ </para>
+ <para>
+ To enable a conduit, click the
+ <guibutton>Enable</guibutton> to enable it, and click
+ <guibutton>Settings</guibutton> to change what it will do when
+ activated. Your options may vary depending on the conduit,
+ but typically they will be:
+
+ <variablelist>
+ <varlistentry>
+ <term>Disabled:</term>
+ <listitem>
+ <para>
+ Do nothing.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term>Synchronize:</term>
+ <listitem>
+ <para>
+ Copy new data from the computer to the handheld, and
+ from the handheld to the computer. Remove items
+ that were on both systems but have been deleted on
+ one.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term>Copy From Pilot:</term>
+ <listitem>
+ <para>
+ If there is any new data on the the handheld device,
+ copy it to the computer.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term>Copy To Pilot:</term>
+ <listitem>
+ <para>
+ Copy new data from the computer to the handheld.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term>Merge From Pilot:</term>
+ <listitem>
+ <para>
+ Copy new data from the handheld to the computer, and
+ remove any information from the computer that has
+ been deleted on the handheld.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term>Merge To Pilot:</term>
+ <listitem>
+ <para>
+ Copy new data from the computer to the handheld, and
+ remove any information from the handheld that has
+ been deleted on the computer.
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </para>
+
+ <para>
+ Select the behavior you want for each conduit you choose to use.
+ If you're not sure, go ahead and stick with
+ <guilabel>Synchronize</guilabel>. Then, put your handheld on
+ its cradle and press the HotSync button.
+ </para>
+ <para>
+ <tip>
+ <title>Data Loss Prevention</title>
+ <para>
+ It's always a good idea to make a backup. To do that,
+ make a copy of the <filename>evolution</filename>
+ directory inside your home directory.
+ </para>
+ </tip>
+ </para>
+
+ </chapter>
+
+
+
+
diff --git a/help/C/evolution-C.omf b/help/C/evolution-C.omf
new file mode 100644
index 0000000000..348238680f
--- /dev/null
+++ b/help/C/evolution-C.omf
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>
+<!DOCTYPE omf PUBLIC "-//OMF//DTD Scrollkeeper OMF Variant V1.0//EN" "http://scrollkeeper.sourceforge.net/dtds/scrollkeeper-omf-1.0/scrollkeeper-omf.dtd">
+<omf>
+ <resource>
+ <creator>
+ Ximian, Inc.
+ </creator>
+ <title>
+ Evolution Manual
+ </title>
+ <date>2002</date>
+ <subject category="GNOME|Applications"/>
+ <format mime="text/html"/>
+ <identifier url="index.html"/>
+ <language code="C"/>
+ <relation seriesid="6a2207d8-8aa4-11d6-8cb4-f0bb5a765891"/>
+ </resource>
+</omf>
diff --git a/help/C/evolution.sgml b/help/C/evolution.sgml
new file mode 100644
index 0000000000..5b199c0fae
--- /dev/null
+++ b/help/C/evolution.sgml
@@ -0,0 +1,111 @@
+<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook V4.1//EN"[
+
+<!ENTITY PREFACE SYSTEM "preface.sgml">
+<!ENTITY USAGE-MAINWINDOW SYSTEM "usage-mainwindow.sgml">
+<!ENTITY USAGE-EXEC-SUMMARY SYSTEM "usage-exec-summary.sgml">
+<!ENTITY USAGE-MAIL SYSTEM "usage-mail.sgml">
+<!ENTITY USAGE-MAIL-ORG SYSTEM "usage-mail-org.sgml">
+<!ENTITY USAGE-CONTACT SYSTEM "usage-contact.sgml">
+<!ENTITY USAGE-CALENDAR SYSTEM "usage-calendar.sgml">
+<!ENTITY USAGE-EXCHANGE SYSTEM "usage-exchange.sgml">
+<!ENTITY USAGE-SYNC SYSTEM "usage-sync.sgml">
+<!ENTITY USAGE-PRINT SYSTEM "usage-print.sgml">
+<!ENTITY CONFIG-PREFS SYSTEM "config-prefs.sgml">
+<!ENTITY CONFIG-SYNC SYSTEM "config-sync.sgml">
+<!ENTITY MENUREF SYSTEM "menuref.sgml">
+<!ENTITY APX-GLOSS SYSTEM "apx-gloss.sgml">
+<!ENTITY APX-COMMON-TASKS SYSTEM "apx-common-tasks.sgml">
+<!ENTITY APX-BUGS SYSTEM "apx-bugs.sgml">
+<!ENTITY APX-AUTHORS SYSTEM "apx-authors.sgml">
+<!ENTITY APX-FDL SYSTEM "apx-fdl.sgml">
+<!ENTITY APX-GPL SYSTEM "apx-gpl.sgml">
+
+]>
+
+
+<!-- Almost every chapter is an entity. Files, Chapter id's, and
+entity names correspond. APX is for appendix. -->
+
+<book id="index">
+ <bookinfo>
+ <title>A User's Guide to Ximian Evolution</title>
+ <authorgroup>
+ <author><firstname>Aaron</firstname><surname>Weber</surname></author>
+ <author><firstname>Kevin</firstname><surname>Breit</surname></author>
+ <author><firstname>Ettore</firstname><surname>Perazzoli</surname></author>
+ <author><firstname>Duncan</firstname><surname>Mak</surname></author>
+ </authorgroup>
+ <copyright>
+ <year>2000-2002</year>
+ <holder>Ximian, Inc.</holder>
+ </copyright>
+
+ <legalnotice id="legalnotice">
+ <para>
+ See the preface for legal information regarding the GNU
+ General Public License and Free Documentation License.
+ </para>
+ </legalnotice>
+
+ <releaseinfo>
+ This is version 1.2 of the Ximian Evolution manual. It describes
+ version 1.2 of the Ximian Evolution groupware suite.
+ </releaseinfo>
+
+ </bookinfo>
+
+ &PREFACE;
+
+ <part id="usage">
+ <title>Getting Started with Ximian Evolution</title>
+ <partintro>
+ <para>
+ Part one of the <application>Ximian Evolution</application> manual
+ describes how to use <application>Ximian Evolution</application> for
+ email, contact management, and appointment and task
+ scheduling. You'll find as you go along that there's more
+ than one way to do things, and you can pick whichever method
+ you like best.
+ </para>
+ </partintro>
+
+ &USAGE-MAINWINDOW;
+ &USAGE-EXEC-SUMMARY;
+ &USAGE-MAIL;
+ &USAGE-MAIL-ORG;
+ &USAGE-CONTACT;
+ &USAGE-CALENDAR;
+ &USAGE-EXCHANGE;
+ &USAGE-SYNC;
+ &USAGE-PRINT;
+ </part>
+ <part id="config">
+ <title>Configuring and Managing Ximian Evolution</title>
+ <partintro>
+ <para>
+ <application>Ximian Evolution</application> is highly
+ configurable. Usually, when developers say that, they mean
+ that they didn't test it out thoroughly and have left it to
+ other programmers to "configure" themselves a working
+ system. In the case of <application>Ximian
+ Evolution</application>, "configurable" means that, while you
+ can expect the program to work perfectly well with the default
+ settings, it's also easy to alter its behavior in a wide
+ variety of ways, so that it fits your needs exactly. This
+ part of the book will describe that process, from the quickest
+ glimpse of the Setup Assistant to an in-depth guide to obscure
+ preferences settings.
+ </para>
+ </partintro>
+
+ &CONFIG-PREFS;
+ &CONFIG-SYNC;
+ </part>
+
+ &MENUREF;
+ &APX-GLOSS;
+ &APX-BUGS;
+ &APX-AUTHORS;
+ &APX-FDL;
+ &APX-GPL;
+</book> \ No newline at end of file
diff --git a/help/C/preface.sgml b/help/C/preface.sgml
new file mode 100644
index 0000000000..8de709bde8
--- /dev/null
+++ b/help/C/preface.sgml
@@ -0,0 +1,412 @@
+ <preface id="introduction">
+ <title>Introduction</title>
+
+ <para>
+ Welcome to the users guide for Ximian Evolution and Ximian
+ Connector for Microsoft Exchange 2000. This section of the
+ manual will tell you a bit about what you've got waiting for
+ you. First, however, we have some legal information.
+ </para>
+
+ <sect1 id="actual-legal-info">
+ <title>Legal Information and Licensing</title>
+ <para>
+ Permission is granted to copy, distribute and/or modify this
+ document under the terms of the GNU Free Documentation
+ License, Version 1.1 or any later version published by the
+ Free Software Foundation with no Invariant Sections, no
+ Front-Cover Texts, and no Back-Cover Texts. You will find a
+ copy of the <citetitle>GNU Free Documentation
+ License</citetitle> attached to this manual in <xref
+ linkend="apx-fdl">. You may also obtain a copy of the
+ license from the Free Software Foundation by visiting <ulink
+ type="http" url="http://www.fsf.org">their Web site</ulink>
+ or by writing to: Free Software Foundation, Inc., 59 Temple
+ Place - Suite 330, Boston, MA 02111-1307, USA.
+ </para>
+
+ <para>
+ The actual application Ximian Evolution is covered by the GNU
+ General Public License (GPL), and its source code is
+ available from the GNOME cvs repository at <ulink
+ url="http://cvs.gnome.org">cvs.gnome.org</ulink>. You will
+ find a copy of the GPL attached to this document in <xref
+ linkend="apx-gpl">. You may also obtain a copy of the license
+ from the Free Software Foundation by visiting <ulink
+ type="http" url="http://www.fsf.org">their Web site</ulink>
+ or by writing to: Free Software Foundation, Inc., 59 Temple
+ Place - Suite 330, Boston, MA 02111-1307, USA.
+ </para>
+
+ <para>
+ Ximian Connector for Microsoft Exchange 2000 is not Free
+ Software. There are certain restrictions on its usage, and it
+ may not be redistributed. Before downloading it you must
+ agree to the terms of license, which will be (or have been)
+ presented to you upon download. You may review the terms of
+ license for Ximian Connector at <ulink
+ url="http://support.ximian.com/q?92">http://support.ximian.com/q?92</ulink>.
+ </para>
+ </sect1>
+
+ <sect1 id="organization">
+ <title>How This Book is Organized</title>
+ <para>
+ This book is divided into two parts, with several
+ appendices. The first part is a <link linkend="usage">guided
+ tour</link>, which will explain how to use
+ <application>Evolution</application>. If you are new to
+ <application>Evolution</application> or to groupware in
+ general, this section is for you. The second section, covering
+ <link linkend="config">configuration</link>, is targeted at
+ more advanced users, but anyone who wants to change the way
+ <application>Evolution</application> looks or acts can benefit
+ from reading it.
+ </para>
+ </sect1>
+
+ <sect1 id="typography">
+ <title>Typographical Conventions</title>
+ <para>
+ In this book, we'll mark some words with special typography:
+ <simplelist>
+ <member><application>Applications</application></member>
+ <member><command>Commands</command> you type at the command line</member>
+ <member><guilabel>Labels</guilabel> for buttons and other portions of the graphical interface</member>
+
+ <member> Menu selections look like this:
+ <menuchoice>
+ <guimenu>Menu</guimenu>
+ <guisubmenu>Submenu</guisubmenu>
+ <guimenuitem>Menu Item</guimenuitem>
+ </menuchoice>
+ </member>
+ <member><guibutton>Buttons</guibutton> you can
+ click</member> <member><userinput>Anything you type
+ in</userinput></member> <member><computeroutput>Text
+ output from a computer</computeroutput></member>
+ <member><glossterm linkend="apx-gloss">Words</glossterm>
+ that are defined in the <xref linkend="apx-gloss">.</member>
+ </simplelist>
+</para>
+<para>
+We'll provide assorted bits of additional information in tips set off from the rest of the book, as well.
+
+ <tip id="example-tip">
+ <title>Tip</title>
+ <para>
+ Tips and bits of extra information will look like
+ this.
+ </para>
+ </tip>
+</para>
+
+<para>
+Examples are also set off from the rest of the text. They look like this:
+
+ <example>
+ <title>Example Example</title>
+ <para>
+ This is what an example looks like. We'll provide
+ examples for some of the more complicated tasks you
+ might be performing.
+ </para>
+ </example>
+</para>
+<para>
+Lastly, we'll have warnings, in cases where you should be careful:
+
+ <warning id="example-warning">
+ <title>Example Warning</title>
+ <para>
+ This is what a warning looks like. If there's a chance
+ you'll run into trouble, we'll warn you beforehand.
+ </para>
+ </warning>
+ </para>
+ </sect1>
+
+
+ <sect1 id="other-help">
+ <title>Additional Help Sources</title>
+ <para>
+ You can find additional help in three places. For information
+ about command-line options, open a terminal window and type
+ <command> man evolution</command> or <command>evolution
+ --help</command>. For support, late-breaking news, and errata,
+ visit the Ximian support center at <ulink
+ url="http://support.ximian.com">support.ximian.com</ulink>.
+ </para>
+ </sect1>
+
+ <sect1 id="whats-new-in-one-two">
+ <title>What's New in Evolution 1.2</title>
+ <para>
+ If you're already familiar with Ximian Evolution 1.0, our new
+ version has a lot to add. Here are some of the new and
+ changed features. Ximian Connector for Microsoft Exchange also
+ has new features, which are covered in "new-in-connector-one-two">.
+ <variablelist>
+ <varlistentry>
+ <term>Evolution Settings Interface</term>
+ <listitem>
+ <para>
+ The preferences dialogs have been completely
+ overhauled. There is now a single configuration dialog
+ window for all components of the program, and you can
+ access it from anywhere. To change your preferences,
+ select
+ <menuchoice>
+ <guimenu>
+ Tools
+ </guimenu>
+ <guimenuitem>
+ Preferences
+ </guimenuitem>
+ </menuchoice>. Detailed help for the preferences
+ dialogs has been added to <xref
+ linkend="config-prefs">.
+ </para>
+ </listitem>
+ </varlistentry>
+
+
+ <varlistentry>
+ <term>Mail Composer Autocomplete</term>
+ <listitem>
+ <para>
+ Email addresses in the message composer can now work
+ with LDAP address books. Add your LDAP address book to
+ the list of folders searched for address completion in
+ the <guilabel>Folder Settings</guilabel> section of
+ the Settings dialog.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term>Performance Improvements</term>
+ <listitem>
+ <para>
+ Startup time has decreased, POP server interactions
+ are more efficient, and indexing of locally cached
+ mail is now faster.
+ </para>
+ </listitem>
+ </varlistentry>
+
+
+ <varlistentry>
+ <term>Mail Composer HTML Improvements</term>
+ <listitem>
+ <para>
+ Pasting into the mail composer from another message
+ or from a web page preserves the HTML formatting of
+ the source document. Multiple levels of reply
+ quotation in messages are clearer and use a vertical
+ blue line on the left side to indicate quotation. Text
+ "smileys" are now automatically converted to small
+ images displaying the appropriate emotion. You can
+ turn this option off in the
+ <guilabel>Composer</guilabel> section of the Settings
+ dialog.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term>Signature Editor</term>
+ <listitem>
+ <para>
+ There is now a signature editor, which can be used to
+ create plain text or HTML signatures.
+ click the the <guilabel>Signatures</guilabel> tab in
+ the Composer Settings section of the Evolution
+ Settings window.
+ </para>
+ </listitem>
+ </varlistentry>
+
+
+ <varlistentry>
+ <term>Keyboard Navigation Overhaul</term>
+ <listitem>
+ <para>
+ All unmodified letter keys have changed function-- the
+ <keycap>N</keycap> and <keycap>P</keycap> keys, for
+ example, no longer take you to the next you to the
+ next or previous message. Pressing a letter will now
+ take you to the nearest message whose data in the sort
+ column begins with that letter. That is, if you press
+ N and you are sorting your list by sender, you will
+ move to a message from Nadine. If you are sorting by
+ subject, you'll move to the message about
+ nectarines. This should also work in the folder list
+ for folder navigation.
+ </para>
+ <para>
+ This means that the old single letter shortcuts have
+ changed as well. The new shortcuts:
+ <simplelist>
+ <member>
+ <keycap>,</keycap> (comma) and <keycap>.</keycap>
+ (period) are now the keyboard shortcuts for Next
+ and Previous unread messages. You can also use the
+ square brackets <keycap>]</keycap> and
+ <keycap>[</keycap>.
+ </member>
+ <member>
+ <keycap>`</keycap> (backtick) toggles
+ the message preview pane.
+ </member>
+ </simplelist>
+ Shortcuts that use the <keycap>Control</keycap> key
+ have not changed.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term>Added Functionality for the "New" Button</term>
+ <listitem>
+ <para>
+ The <guibutton>New</guibutton> now has a menu next to
+ it. As in Evolution 1.0, you can click the button once
+ to get a new item for the Evolution tool you're
+ using. However, if you click the small arrow menu to
+ the right of the button, you will find a menu that
+ allows you to create new items for the rest of
+ Evolution: All day appointments, regular appointments,
+ tasks and meetings for the calendar; mail messages for
+ the mail tool; and contacts and contact lists for the
+ address book.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term>Import Tool Now Imports Netscape Filters</term>
+ <listitem>
+ <para>
+ You can now import your filters, as well as your email
+ messages, from the Netscape mail client.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term>Folder Naming Internationalization</term>
+ <listitem>
+ <para>
+ You can now use Unicode (UTF-8) characters in the
+ names for IMAP folders.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term>Executive Summary now Reads IMAP</term>
+ <listitem>
+ <para>
+ The Executive Summary tool in Evolution now displays
+ email messages in IMAP as well as local mail folders.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term>Filters and vFolders Notice Moved or Missing Folders</term>
+ <listitem>
+ <para>
+ vFolders and filters now notice if you move or delete
+ a folder that they use.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term>vFolder "Original Location" Feature</term>
+ <listitem>
+ <para>
+ vFolders can now display the actual folder location
+ for each message they contain. To do so, right click
+ on the column headers in the message list of any
+ vFolder, select <guimenuitem>Add a
+ Column</guimenuitem>, and drag the <guibutton>Original
+ Location</guibutton> item into position.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term>New Criteria and Actions</term>
+ <listitem>
+ <para>
+ There are many new filter criteria and actions,
+ including additional message flags such as Flag for
+ Followup.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term>Folder Selection for Offline Mode</term>
+ <listitem>
+ <para>
+ You may now select which network folders which will be
+ cached locally when you go into Offline mode. This
+ setting may be changed from the Folders section of the
+ Evolution Settings window.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term>Redirect (Bounce) Feature Added</term>
+ <listitem>
+ <para>
+ This feature is also sometimes known as "Bounce" or
+ "Resend." To resend a message with all its headers
+ instead of merely forwarding it, select the message and
+ choose
+ <menuchoice>
+ <guimenu>
+ Actions
+ </guimenu>
+ <guisubmenu>
+ Forward
+ </guisubmenu>
+ <guimenuitem>
+ Redirect
+ </guimenuitem>
+ </menuchoice>.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term>Digest-mode Display of Forwarded Messages</term>
+ <listitem>
+ <para>
+ Messages that contain multiple forwarded messages are
+ now displayed as a digest rather than inline or as a
+ series of attachments.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term>New Mail Notification</term>
+ <listitem>
+ <para>
+ When new mail arrives, you may opt to have Evolution
+ beep or play a sound file that you specify.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ </variablelist>
+ </para>
+ </sect1>
+</preface>
+
diff --git a/help/C/usage-contact.sgml b/help/C/usage-contact.sgml
new file mode 100644
index 0000000000..a28dd936e9
--- /dev/null
+++ b/help/C/usage-contact.sgml
@@ -0,0 +1,571 @@
+<!--
+<!DOCTYPE Chapter PUBLIC "-//GNOME//DTD DocBook PNG Variant V1.1//EN">
+-->
+
+<chapter id="usage-contact">
+ <title>Working with Your Contacts</title>
+ <para>
+ This chapter will show you how to use the
+ <application>Evolution</application> addressbook to organize
+ any amount of contact information, share addresses over a
+ network, and several ways to save time with everyday tasks. To
+ learn about configuring the addressbook, see <xref
+ linkend="config-prefs-contact">. You can import contacts from
+ other contact management tools with the Import tool by
+ selecting
+ <menuchoice><guimenu>File</guimenu><guimenuitem>Import</guimenuitem></menuchoice>,
+ or by mailing them to yourself as vCard attachments.
+ </para>
+
+ <para>
+ The toolbar for the addressbook is quite simple.
+ <itemizedlist>
+ <listitem><para>
+ Click <guibutton>New Contact</guibutton> to create a new card, or double-click
+ in a blank space in the contact list.
+ </para></listitem>
+
+ <listitem><para>
+ Click <guibutton>New List</guibutton> to create a new card, or double-click
+ in a blank space in the contact list.
+ </para></listitem>
+
+ <listitem><para> The <guiicon>printer</guiicon> icon sends one
+ or more of your cards to the printer. </para></listitem>
+
+ <listitem><para> The <guiicon>stop sign</guiicon> icon stops loading
+ contact data from the network. This button is only
+ relevant if you are looking at contact information on a
+ network. </para></listitem>
+ </itemizedlist>
+ </para>
+
+ <para>
+ Your contact information fills the rest of the display. Move
+ through the cards alphabetically with the buttons and the
+ scrollbar to the right of the window. Of course, if you have
+ more than a few people listed, you'll want some way of finding
+ them more quickly, which is why there's a search feature.
+ </para>
+
+ <sect1 id="usage-contact-cards">
+ <title>The Contact Editor</title>
+ <para>
+ To delete a contact:
+ <orderedlist numeration="arabic">
+ <listitem>
+ <para>
+ Click once on the contact.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Press the <guibutton>Delete</guibutton> button.
+ </para>
+ </listitem>
+ </orderedlist>
+ </para>
+ <para>
+ If you want to add or change cards, you'll use the contact
+ editor. To change a card that already exists, double click on
+ it to open the contact editor window. If you want to create a new
+ card, clicking the <guibutton>New</guibutton> button in the
+ toolbar will open the same window, with blank entry boxes for
+ you to fill in.
+ </para>
+
+ <para>
+ The contact editor window has two tabs,
+ <guilabel>General</guilabel>, for basic contact information, and
+ <guilabel>Details</guilabel>, for a more specific description of
+ the person. In addition, it contains a <guimenu>File</guimenu>
+ menu and a toolbar with three items: <guilabel>Save and
+ Close</guilabel>, <guilabel>Print</guilabel>, and
+ <guilabel>Delete</guilabel>.
+ </para>
+
+ <figure id="usage-contact-editor-fig">
+ <title>Evolution Contact Editor</title>
+ <screenshot>
+ <screeninfo>Evolution Contact Editor</screeninfo>
+ <mediaobject><imageobject><imagedata
+ fileref="figures/contact-editor" format="png" srccredit="Aaron
+ Weber">
+ </imageobject></mediaobject>
+ </screenshot>
+ </figure>
+
+ <para> The <guilabel>General</guilabel> tab has seven sections,
+ each with an icon: a face, for name and company; a telephone
+ for phone numbers; an envelope for email address; a globe for
+ web page address; a house for postal address; a file folder
+ for contacts, and a briefcase for categories.
+ </para>
+ <para>
+ <variablelist>
+
+ <varlistentry>
+ <term>Full Name</term>
+ <listitem>
+ <para>
+ The <guilabel>Full Name</guilabel> field has two
+ major features:
+ <itemizedlist>
+ <listitem>
+ <para>
+ You can enter a name into the <guibutton>Full
+ Name</guibutton> field, but you can also click the
+ <guibutton>Full Name</guibutton> button to bring
+ up a small dialog box with a few text boxes
+ <variablelist>
+ <varlistentry>
+ <term><guilabel>Title: </guilabel></term>
+ <listitem> <para>
+ Enter an honorific or select one from the menu.
+ </para></listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><guilabel>First: </guilabel></term>
+ <listitem> <para>
+ Enter the first, or given, name.
+ </para></listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><guilabel>Middle: </guilabel></term>
+ <listitem> <para>
+ Enter the middle name or initial, if any.
+ </para></listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><guilabel>Last: </guilabel></term>
+ <listitem> <para>
+ Enter the last name (surname).
+ </para></listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><guilabel>Suffix: </guilabel></term>
+ <listitem> <para>
+ Enter suffixes such as "Jr." or "III."
+ </para></listitem>
+ </varlistentry>
+ </variablelist>
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+ <para>
+ The <guilabel>Full Name</guilabel> field also
+ interacts with the <guilabel>File As</guilabel>
+ box to help you organize your contacts.
+ </para>
+ <para>
+ To see how it works, type a name in the
+ <guilabel>Full Name</guilabel> field. As an example,
+ we'll use the Ximian mascot, <userinput>Rupert
+ T. Monkey</userinput>. You'll notice that the
+ <guilabel>File As</guilabel> field also fills in,
+ but in reverse: <computeroutput>Monkey,
+ Rupert</computeroutput>. You can pick
+ <computeroutput>Rupert Monkey </computeroutput> from
+ the drop-down, or type in your own, such as
+ <userinput> T. Rupert Monkey </userinput>.
+ </para>
+ <tip>
+ <title>Filing Suggestion</title>
+ <para>
+ Don't enter something entirely different from the
+ actual name, since you might forget that you've filed
+ Rupert's information under "F" for "Fictitious Ximian
+ Employee."
+ </para>
+ </tip>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>Multiple Values for Fields:</term>
+ <listitem>
+ <para>
+ If you click on the downward pointing triangle buttons
+ next to the <guilabel>Primary Email</guilabel> field,
+ you can also choose <guilabel>Email 2</guilabel> and
+ <guilabel>Email 3</guilabel>. Although the contact
+ editor will only display one of those at any given
+ time, <application>Evolution</application> will store
+ them all. Entries that have information in them have
+ a check mark next to them. The buttons next to the
+ telephone and postal address fields work in the same
+ way.
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </para>
+ <para>
+ The last item in the <guilabel>General</guilabel> tab is the
+ <guilabel>Categories</guilabel> organization tool; for
+ information on that, read <xref
+ linkend="usage-contact-organize">.
+ </para>
+ <para>
+ The <guilabel>Details</guilabel> tab is much simpler:
+ <itemizedlist>
+ <listitem>
+ <para>
+ The briefcase - Describes the person's professional life
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ The face - Describes the person's personal life
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ The globe - Miscellanious notes
+ </para>
+ </listitem>
+ </itemizedlist>
+
+ <tip>
+ <title>Contact Shortcuts</title>
+ <para>
+ You can add cards from within an email message or calendar
+ appointment. While looking at an email, right-click on
+ any email address or message, and choose
+ <guimenuitem>Create Card for this Address</guimenuitem> or
+ <guimenuitem>Create Card for this Sender</guimenuitem>
+ from the menu.
+ </para>
+ </tip>
+ </para>
+ </sect1>
+
+ <sect1 id="contact-search">
+ <title>Searching for Contacts</title>
+ <para>
+ <application>Evolution</application> allows searching through contacts
+ quickly and easily.
+ </para>
+ <para>
+ To search through contacts:
+ <orderedlist numeration="arabic">
+ <listitem>
+ <para>
+ Select your search focus in the search bar.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Enter your query.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Press return to search.
+ </para>
+ </listitem>
+ </orderedlist>
+ </para>
+ <para>
+ To perform a complex search through your contacts:
+ <orderedlist numeration="arabic">
+ <listitem>
+ <para>
+ Open
+ <menuchoice>
+ <guimenu>Tools</guimenu>
+ <guimenuitem>Search for contacts</guimenuitem>
+ </menuchoice>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Name the rule in the <guilabel>Rule Name</guilabel> field.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Setup your criteria information in the <guilabel>If</guilabel> section.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ If you want to add more criteria, click the <guibutton>Add
+ Criterion</guibutton> button.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Click <guibutton>Search</guibutton>.
+ </para>
+ </listitem>
+ </orderedlist>
+ </para>
+ <para>
+ To show all your contacts, select <guibutton>Show All</guibutton> in the
+ <guilabel>Search Bar</guilabel> or search with an empty query.
+ </para>
+
+ </sect1>
+
+ <sect1 id="usage-contact-organize">
+ <title>Organizing your Addressbook</title>
+ <para>
+ Organizing your addressbook is a lot like organizing your
+ mail. You can have folders and searches the same way you can
+ with mail, but the addressbook does not allow Virtual Folders. It
+ does, however, allow each card to fall under several
+ categories, and allow you to create your own categories. To
+ learn about categories, read <xref
+ linkend="usage-contact-organize-group-category">.
+ </para>
+
+<!-- UNIMPLEMENTED FEATURE
+ <para>
+ Another useful <application>Evolution</application> feature is
+ its ability to recognize when people live or work together. If
+ several people in your addressbook share an address, and you
+ change the address for one of them,
+ <application>Evolution</application> will ask you if you wish to
+ change the address for all of them, or just for one.
+ </para>
+-->
+
+ <sect2 id="usage-contact-organize-group">
+ <title>Groups of contacts</title>
+ <para>
+ <application>Evolution</application> offers two ways for you
+ to organize your cards. The first way is to use folders;
+ this works the same way mail folders do. For more
+ flexibility, you can also mark contacts as elements of
+ different categories. To better integrate with email tools,
+ you can also create lists of contacts that you can send mail
+ to as a single person.
+ </para>
+
+ <sect3 id="usage-contact-organize-group-folder">
+ <title>Grouping with Folders</title>
+ <para>
+ The simplest way to group address cards is to use folders.
+ By default, cards start in the
+ <guilabel>Contacts</guilabel> folder. If you've read <xref
+ linkend="usage-mainwindow"> then you already know that you
+ can create a new folder by selecting
+ <menuchoice>
+ <guimenu>File</guimenu>
+ <guisubmenu>New</guisubmenu>
+ <guimenuitem>Folder</guimenuitem>
+ </menuchoice>
+ and that you can put new folders anywhere you like. Just
+ like with mail, cards must be in a card folder, and no card
+ can be in two places at once. If you want more
+ flexibility, try <xref
+ linkend="usage-contact-organize-group-category">.
+ </para>
+ <para>
+ To put a card into a folder, just drag it there from the
+ folder view. Remember that contact cards can only go in
+ contact folders, just like mail can only go in mail folders,
+ and calendars in calendar folders.
+ </para>
+ </sect3>
+
+ <sect3 id="usage-contact-organize-group-category">
+ <title>Grouping with Categories</title>
+ <para>
+ The other way to group cards is to mark them as belonging
+ to different categories.
+ That means that you
+ can mark a card as being in several categories or no
+ category at all. For example, I put my friend Matthew's
+ card in the "Business" category, because he works with me,
+ the "Friends" category, because he's also my friend, and
+ the "Frequent" category, because I call him all the time
+ and can never remember his phone number.
+ </para>
+ <para>
+ To mark a card as belonging to a category, click the
+ <guibutton>Categories</guibutton> button at the lower
+ right. From the dialog box that appears, you can check as
+ many or as few categories as you like.
+ </para>
+
+ <!-- Feature Not Implemented
+ <para>
+
+ If the master list of categories doesn't suit you, you can
+ add your own. Just enter the new category's name in the
+ text box, then click <guibutton>Categories</guibutton> and
+ choose <guilabel>Add to Master List</guilabel> in the
+ window that appears.
+ </para>
+ -->
+
+ </sect3>
+
+ <sect3 id="usage-contact-organize-group-list">
+ <title>Creating a List of Contacts</title>
+ <para>
+ To create a list of contacts:
+
+ <orderedlist numeration="arabic">
+ <listitem>
+ <para>
+ Open the list creation dialog box by clicking the
+ <guibutton>New List</guibutton> button or selecting
+ <menuchoice>
+ <guimenu>
+ File
+ </guimenu>
+ <guisubmenu>
+ New
+ </guisubmenu>
+ <guimenuitem>
+ Contact List
+ </guimenuitem>
+ </menuchoice>.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ Enter a name for the list.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Enter names or email addresses of contacts, or just
+ drag contacts from the main window into the list.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ Choose whether you would like to hide the email
+ addresses when you send a message to the list.
+ Unless it is a very small list, it is recommended
+ that you leave the addresses hidden. This is the
+ same thing as using the "Bcc:" feature discussed in
+ <xref linkend="usage-mail-getnsend-send-to-types">.
+ </para>
+ </listitem>
+
+ </orderedlist>
+ </para>
+ <para>
+ When you are done, click <guibutton>OK</guibutton>. The
+ list will appear as a contact card, which you can use as
+ you would any other. That includes emailing the list to
+ another person, and, of course, sending email to the list.
+ </para>
+ <para>
+ To mail the list, open a new email and type the name you
+ chose for the list. Ximian Evolution will address the
+ message to the entire list when you send it. You can also
+ right-click on the list's address card in the Addressbook
+ and select <guimenuitem>Send Message to List</guimenuitem>.
+ </para>
+ <para>
+ Ximian Evolution cannot store contact lists on Exchange
+ servers.
+ </para>
+
+ </sect3>
+ </sect2>
+ </sect1>
+
+ <sect1 id="usage-contact-sharing">
+ <title>LDAP: Shared Addressbooks on a Network</title>
+
+ <para>
+ The <glossterm linkend="ldap">LDAP</glossterm> protocol was
+ created to let users share contact information over a network by
+ sharing access to a central address book. LDAP allows a company
+ to maintain a shared set of contact information for a company or
+ department. Many companies keep a common LDAP address book for
+ all their employees or for client contacts.
+ </para>
+
+ <para>
+ To learn how to add a remote directory to your available
+ contact folders, see <xref linkend="config-prefs-contact">.
+ Once you have a LDAP connection, the network contacts folder or
+ folders will appear inside the <guilabel>External
+ Directories</guilabel> folder in the folder bar. It will work
+ exactly like a local folder of cards, with the following
+ exceptions:
+ <itemizedlist>
+
+ <listitem>
+ <para>
+ Network folders are only available when you are
+ connected to the network. If you use a laptop or have a
+ modem connection, you may wish to copy or cache the
+ network directory. You do this by dragging and dropping
+ your desired contacts into the local contacts list.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ To prevent excess network traffic,
+ <application>Evolution</application> will not normally
+ load the contents of LDAP folders immediately upon
+ opening. You must click <guilabel>Display
+ All</guilabel> before LDAP folder cards will be loaded
+ from the network. You can change this behavior in the
+ <interface>Contact Preferences</interface> window.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ You cannot add, delete, or alter cards on the LDAP
+ server. If you need to change information there, you
+ will need to speak to your system administrator
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+ <sect2 id="usage-contact-sharing-setup">
+ <title>Configuring Evolution to use LDAP</title>
+ <para>
+ For information about setting up
+ <application>Evolution</application> to use LDAP, please refer
+ to <xref linkend="config-prefs-contact-ldap-add" />
+ </para>
+ </sect2>
+ </sect1>
+
+ <sect1 id="contact-automation-basic">
+ <title>Send me a Card: Adding New Cards Quickly</title>
+ <para>
+ As noted before, when you get information about a person in
+ the mail or in a calendar entry, you can add it to an address
+ card. To do so, right click on any email address or email
+ message, and select <guimenuitem>Add Address
+ Card</guimenuitem> from the menu that appears.
+ <application> Evolution</application> can also add cards from a
+ hand-held device during HotSync operation. For more
+ information about that, see <xref linkend="usage-sync">.
+ </para>
+ </sect1>
+
+<!-- Unimplemented features:
+ <para>
+ You can also use the addressbook to print postal addresses
+ on mailing labels. Future versions of
+ <application>Evolution</application> will allow you to you
+ export a group of cards to a spreadsheet, database, or word
+ processor so you can print address labels or prepare large
+ mailings.
+ </para>
+ <para>
+ Need a map or directions? Click <guibutton>MapIt</guibutton> from
+ within the addressbook, and <application>Evolution</application>
+ will map the address for you online.
+ </para>
+ -->
+</chapter>
+
+
+
diff --git a/help/C/usage-exchange.sgml b/help/C/usage-exchange.sgml
new file mode 100644
index 0000000000..1f4a765ea9
--- /dev/null
+++ b/help/C/usage-exchange.sgml
@@ -0,0 +1,748 @@
+ <chapter id="usage-exchange">
+ <title>The Ximian Connector for Microsoft Exchange</title>
+ <para>
+ The Ximian Connector for Microsoft Exchange allows Ximian
+ Evolution clients to access accounts on Microsoft Exchange 2000
+ servers. It is available through Ximian Red Carpet in its own
+ channel, but cannot be used without a license file. The license
+ file may be purchased from the Ximian online store at <ulink
+ url="http://store.ximian.com">store.ximian.com</ulink>. Unlike the
+ regular Ximian Evolution client, the Ximian Connector for
+ Microsoft Exchange is proprietary software and source code is not
+ available.
+ </para>
+
+ <warning id="licensing">
+ <title>Requirements</title>
+ <para>
+ Ximian Connector works only with Exchange 2000, and requires
+ that Outlook Web Access be enabled. Each user will need a
+ valid Microsoft Exchange 2000 server account, including license.
+ </para>
+ </warning>
+
+<sect1 id="new-in-connector-one-two">
+<title>What's New in Connector 1.2</title>
+ <para>
+ Ximian Connector 1.2 has added some of the most frequently
+ requested features of Microsoft Exchange clients, including Public
+ Folder access and calendar delegation.
+ </para>
+
+ <variablelist>
+ <varlistentry>
+ <term>Preferences Dialogs</term>
+ <listitem>
+ <para>
+ The preferences dialogs have been completely overhauled for
+ Evolution and Connector 1.2. Select
+ <menuchoice><guimenu>Tools</guimenu><guimenuitem>Preferences</guimenuitem></menuchoice>
+ from the main Evolution window to change your settings.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term>Public Folders, Posting, and Delegation</term>
+ <listitem>
+ <para>
+ Public folders, posting to folders, and delegation
+ functions have been added. You may now set permissions on
+ folders to which you have appropriate access, and view the
+ folders of other users who have granted you permission to
+ view them.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term>Flag for Followup</term>
+ <listitem>
+ <para>
+ Flag for Followup now works properly in both Outlook and
+ Evolution, even when set in one and read in the other.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term>Improved vFolder Support</term>
+ <listitem>
+ <para>
+ vFolders now function better with Exchange accounts.
+ </para>
+ </listitem>
+ </varlistentry>
+
+
+ <varlistentry>
+ <term>Notes</term>
+ <listitem>
+ <para>
+ The "Notes" and "Journal" folders in Exchange accounts are now readable, and you can drag items into them from other folders. Creating new Notes or Journal entries is not yet supported.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term>Direct Booking</term>
+ <listitem>
+ <para>
+ When creating a meeting request, resources such as rooms
+ and equipment can be checked and reserved without waiting
+ for a reply.
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+</sect1>
+
+ <sect1 id="features">
+ <title>Connector Features</title>
+ <para>
+ In addition to the features listed above, <application>Ximian
+ Connector</application> supports the following basic
+ <application>Microsoft Exchange</application> features:
+ <itemizedlist>
+ <listitem>
+ <para>
+ General
+ </para>
+ <variablelist>
+ <varlistentry>
+ <term>Remote <application>Exchange</application> Information Store</term>
+ <listitem>
+ <para>
+ Allows you to access mail, address book (including
+ Global Address List folder), and calendars, and task
+ folders on an <application>Exchange
+ 2000</application> server from
+ <application>Evolution</application>.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term>Palm synchronization</term>
+ <listitem>
+ <para>
+ Supported for Contacts and Calendars on Exchange.
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </listitem>
+ <listitem>
+ <para>
+ Mail
+ </para>
+ <variablelist>
+ <varlistentry>
+ <term>Viewing Mail in <application>Exchange</application>Folder</term>
+ <listitem>
+ <para></para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>Sending Email via Exchange Protocols</term>
+ <listitem>
+ <para>
+ You may use the Microsoft Exchange mail transport
+ protocol to send email. Make sure that the address
+ you have entered as your email address is exactly
+ the one that the Exchange server has on file. This
+ may be "yourname@exchange-server.ximian.com" rather
+ than "yourname@ximian.com.a"
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </listitem>
+ <listitem>
+ <para>
+ Calendar
+ </para>
+ <variablelist>
+ <varlistentry>
+ <term>Meeting Request/Proposal</term>
+ <listitem>
+ <para>
+ Allows <application>Evolution</application> users to
+ schedule meetings and view attendee availability for
+ other users (<application>Evolution</application> or
+ <application>Outlook</application> users) on
+ <application>Exchange</application>.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>Adding iCalendar Meeting Requests to Calendar</term>
+ <listitem>
+ <para>
+ If you receive an iCalendar meeting request and add it
+ to your calendar, it will be saved to your
+ <application>Exchange</application> calendar.
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </listitem>
+ <listitem>
+ <para>
+ Contacts
+ </para>
+ <variablelist>
+ <varlistentry>
+ <term>Address Completion</term>
+ <listitem>
+ <para>
+ Supported for your <application>Exchange</application>
+ Contacts folder. Not yet supported for the Global
+ Address List.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>Adding vCards to Address Book</term>
+ <listitem>
+ <para>
+ If you receive a VCard attachment and click
+ <guibutton>Save in Address Book</guibutton>, it will
+ be saved to your <application>Exchange</application>address book.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>New Address Book entries can be created on
+ <application>Exchange</application> from received email
+ messages with a single click</term>
+ <listitem>
+ <para>
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </listitem>
+</itemizedlist>
+</para>
+
+<para>
+There are, however, some features which are not available:
+<itemizedlist>
+ <listitem>
+ <para>
+ Work Offline (disconnected mode).
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ "Recall Message" function.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Creation of an automatic "out-of-office" reply
+ messages.
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+ </sect1>
+ <sect1 id="install">
+ <title>Installing the Connector</title>
+ <para>
+ To install the Ximian Connector, run Ximian Red Carpet by
+ selecting <menuchoice><guimenu>System</guimenu><guimenuitem>Get
+ Software</guimenuitem></menuchoice>. Subscribe to the Ximian
+ Connector for Microsoft Exchange channel, select the Ximian
+ Connector for Microsoft
+ <application>Exchange</application>2000, and click the
+ <guibutton>Install</guibutton> button. You can also install
+ the Connector by downloading the individual packages from
+ ftp.ximian.com if you wish.
+ </para>
+ <para>
+ Once you have installed the software, you will also need to
+ install a license file. The license file is the verification
+ that you have paid for a license to use the Ximian
+ Connector. You can get the license file from the the Ximian
+ online store at <ulink
+ url="http://store.ximian.com">store.ximian.com</ulink>. You
+ will need a browser with strong (128-bit or greater) encryption
+ to access the store. When you purchase a Ximian Connector
+ license, the store will mail you the license file with
+ instructions for installation. Once installed, the license file
+ unlocks the Ximian Connector functionality and you may connect
+ to an <application>Exchange</application>server.
+ </para>
+ </sect1>
+
+ <sect1 id="configure">
+ <title>Configuration</title>
+ <para>
+ Once you have installed the Connector, you need to set up access
+ for your <application>Exchange</application>account on both the
+ <application>Exchange</application>server and within Evolution.
+ </para>
+
+ <sect2 id="config-server">
+ <title>Exchange Server Configuration</title>
+ <para>
+ Check with your system administrator to ensure that:
+ <itemizedlist>
+ <listitem>
+ <para>
+ You have a valid account on the <application>Exchange</application>server.
+ </para>
+ </listitem>
+ <listitem>
+ <para> You are permitted to access the account with
+ WebDAV. This is the default setting for the
+ <application>Exchange</application>server, so unless
+ your system administrator has specifically turned it
+ off, no changes should be necessary.
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+ <para>
+ The Ximian website knowledge base, at <ulink type="http"
+ url="http://support.ximian.com">support.ximian.com</ulink>,
+ has additional information about checking to make sure that
+ your <application>Exchange</application>server will accept
+ connections from Ximian Evolution.
+ </para>
+ </sect2>
+
+ <sect2 id="config-client">
+ <title>Evolution Settings for Connecting to an <application>Exchange</application>Server</title>
+ <para>
+
+ Once you know that your server is ready for you to connect, start
+ Ximian Evolution and select
+ <menuchoice>
+ <guimenu>Tools</guimenu>
+ <guimenuitem>Mail Settings</guimenuitem>
+ </menuchoice>
+ from any mail view.
+ </para>
+ <sect3 id="config-exchange-new-account">
+ <title>Creating a New Exchange Account</title>
+
+
+ <para>
+ If you would like to create a new account for your Exchange
+ server, click the <guibutton>Add</guibutton> button in the
+ accounts list. The account creation assistant will guide you
+ through the process, which is also described in <xref
+ linkend="usage-mainwindow-starting">. If you're not sure
+ about any of the information you need, just ask your system
+ administrator.
+ </para>
+ <variablelist>
+ <varlistentry>
+ <term>Identity</term>
+ <listitem>
+ <para>Enter your name and email address. If you wish,
+ you may add your organization and the location of your
+ signature file. Only your name and email address are
+ required.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term>Receiving Mail</term>
+ <listitem>
+ <para>
+ In this step, you'll enter information about the way
+ you check mail:
+ <orderedlist>
+ <listitem>
+ <para>
+ First, select <guilabel>Microsoft
+ Exchange</guilabel> as your server type.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Enter the name of your Exchange email server, and
+ the user name you would use to log in to a
+ Windows workstation in your organization.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ If you wish, select the box labeled
+ <guilabel>Use secure connection
+ (SSL)</guilabel>, to take advantage of a more
+ secure connection method. This may allow you to
+ connect to the server from outside your
+ firewall.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ If you would like
+ <application>Evolution</application> to
+ remember your password, check the box labeled
+ <guilabel>Remember this password</guilabel>.
+ </para>
+ </listitem>
+ </orderedlist>
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term>Receiving Mail, Step Two</term>
+ <listitem>
+ <para>There are a few additional options in this step:
+ <orderedlist>
+ <listitem>
+ <para>
+ Checking for New Mail: If you would like to
+ check for new mail automatically, click the
+ checkbox and enter an interval in minutes.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Exchange Server: If your Exchange mailbox name
+ is different from your Windows name, enter your
+ mailbox name here.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Override Outlook Web Access Path: In most cases,
+ the URL for web access is
+ "http://server.company.com/exchange." If your
+ system has a path that is not "exchange," check
+ the box and enter the custom path here.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ Active Directory: If you would like to use the
+ Global Address List (GAL), check the box
+ labeled <guilabel>Create a Global Address
+ List folder</guilabel> and enter the name
+ of the directory server. To avoid strain
+ on the server, the maximum number of
+ responses to any Active Directory query has
+ been set to 500. If you would like to
+ change that, you may do so here as well.
+ </para>
+ </listitem>
+ </orderedlist>
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term>Sending Mail</term>
+ <listitem>
+ <para>Select <guilabel>Microsoft Exchange</guilabel> as
+ your email sending method. There is nothing else to do
+ in this step.</para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term>Account Management</term>
+ <listitem>
+ <para>Enter a name that you will use to remember this
+ account. "Exchange Account" is a good suggestion. Note
+ that you cannot have two accounts with the same name.
+ If you'd like to make this your default account for
+ sending email, check the <guilabel>Make this my default
+ account</guilabel> box.</para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ <para>
+ You're done. Click <guibutton>Finish</guibutton> and
+ <guibutton>OK</guibutton>, then quit
+ <application>Evolution</application> and start it again. Now
+ you're ready to get to work on the Exchange server.
+ </para>
+
+ <figure>
+ <title>Creating an Exchange Account, Step One: Identity</title>
+ <screenshot>
+ <screeninfo>Creating an Exchange Account, Step One: Identity</screeninfo>
+ <mediaobject><imageobject>
+ <imagedata format="png" fileref="figures/exchange-identity" srccredit="Aaron Weber">
+ </imageobject></mediaobject>
+ </screenshot>
+ </figure>
+
+ <figure>
+ <title>Creating an Exchange Account, Step Two: Receiving Mail</title>
+ <screenshot>
+ <screeninfo>Creating an Exchange Account, Step Two: Receiving Mail</screeninfo>
+ <mediaobject><imageobject>
+ <imagedata format="png" fileref="figures/exchange-receive" srccredit="Aaron Weber">
+ </imageobject></mediaobject>
+ </screenshot>
+ </figure>
+
+ <figure>
+ <title>Creating an Exchange Account, Step Three: Mail Options</title>
+ <screenshot>
+ <screeninfo>Creating an Exchange Account, Step Three: Mail Options</screeninfo>
+ <mediaobject><imageobject>
+ <imagedata format="png" fileref="figures/exchange-receive-options" srccredit="Aaron Weber">
+ </imageobject></mediaobject>
+ </screenshot>
+ </figure>
+
+
+ </sect3>
+
+ <sect3 id="config-exchange-existing-account">
+ <title>Changing an Existing Account to Work with Exchange</title>
+ <para>
+ If you have an existing email account, and want to convert it
+ to use for Exchange, select the account you want to convert
+ and click the <guibutton>Edit</guibutton> button. You'll want
+ to change settings in the following tabs of the account
+ dialog:
+ </para>
+ <variablelist>
+ <varlistentry>
+ <term>Identity</term>
+ <listitem>
+ <para>
+ If your email address will change because you are moving
+ to a new server, then change it in this tab. Otherwise,
+ move to the next tab.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>Receiving Mail</term>
+ <listitem>
+ <para>
+ Select <guilabel>Microsoft Exchange</guilabel> as your
+ server type. Enter your name of your server next to
+ <guilabel>Host</guilabel>, and the user name for your
+ account next to <guilabel>Username</guilabel>. If your
+ server supports SSL (Secure Socket Layer) encryption, it
+ you can check the <guilabel>Use SSL</guilabel> box to
+ take advantage of more secure data transfers.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>Receiving Options</term>
+ <listitem>
+ <para>
+ Here, tab, you'll find some additional settings:
+ <variablelist>
+ <varlistentry>
+ <term>Checking for New Mail</term>
+ <listitem>
+ <para>
+ Select whether you would like to check for
+ mail automatically, and if so, how often.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>Mailbox Name and Web Access Path</term>
+ <listitem>
+ <para>
+ If your Exchange server requires you to use a
+ different mailbox name from the name you use to
+ log in, select the second check-box and enter
+ the mailbox name. Check with your system
+ administrator to be sure.
+ </para>
+ <para>
+ In most cases, the URL for web access is
+ "http://server.company.com/exchange." If your
+ system has a path that is not "exchange," check
+ the box and enter the custom path here.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>Active Directory</term>
+ <listitem>
+ <para>
+ If you would like to use the Global Address
+ List (GAL) maintained on your Exchange server,
+ click the tab labeled <guilabel>Receiving
+ Options</guilabel> and check the box labeled
+ <guilabel>Create a Global Address List
+ folder</guilabel>. The GAL is maintained by
+ your system administrator and you cannot add,
+ change, or remove items from it using Ximian
+ Evolution. However, you can use it to invite
+ people to meetings and to look up addresses and
+ other information. In many organizations, the
+ GAL is stored on a different server from email.
+ If this is the case, you should also specify
+ the directory server name here.
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>Sending Mail</term>
+ <listitem>
+ <para>
+ If you will use your Exchange server to send as well as
+ receive mail, select <guilabel>Microsoft
+ Exchange</guilabel> as your server type, and enter the
+ server name as the <guilabel>Host</guilabel>.
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ <para>
+
+ Once you have made those changes, click the
+ <guibutton>OK</guibutton> button.
+ </para>
+ <para>
+ Then, quit <application>Evolution</application> and start it
+ up again. Changes to the Ximian Connector accounts
+ configuration are not active until you have restarted the
+ application.
+ </para>
+ </sect3>
+ </sect2>
+ </sect1>
+
+ <sect1 id="access">
+ <title>Accessing the <application>Exchange</application>Server</title>
+ <para>
+ Like IMAP and LDAP data, information for
+ <application>Exchange</application>accounts is stored on the
+ server, not on your desktop computer. This means that you can
+ access it from multiple locations. It also means that your
+ Microsoft <application>Exchange</application>account information
+ is in a separate folder tree from the <guilabel>Local</guilabel>
+ tree in your folder bar. You'll see it below the local tree,
+ with the name you gave the account. If you have multiple
+ accounts, you will have multiple folder trees.
+ </para>
+ <para>
+ Click on any of the folder tree items to visit them; you may
+ have to enter your server password. You can now create contact
+ cards, send and receive email as you would normally. If there
+ are items in your local calendar or addressbook that you'd like
+ to add to your <application>Exchange</application>stores, you
+ can copy and paste them over, or just drag items from one folder
+ to another as you would with two local stores.
+ </para>
+
+ <note id="save-to-local-or-exchange">
+ <title>Saving Attached Addresses and Appointments</title>
+ <para>
+ If you are using both an Exchange account and a local mail
+ account, you should be aware that whenever you save an email
+ address or appointment from an email message, it will be
+ saved in your Exchange contacts list or calendar, rather
+ than in your local account. The same is true of
+ synchronization with Palm-OS devices: tasks, appointments,
+ and addresses from your Palm-OS device will be synchronized
+ with those in the Exchange folders rather than local
+ folders.
+ </para>
+ </note>
+
+ <tip id="gal-empty">
+ <title>The Global Address List Is Empty At First</title>
+ <para>
+ To avoid unnecessary strain on the server, the GAL will
+ appear empty until you have searched for something in it.
+ If you want to display all the cards in the list, click in
+ the search box and press <keycap>Enter</keycap>. This
+ enters a blank search: since every card contains a blank in
+ it, every card will appear.
+ </para>
+ </tip>
+ </sect1>
+ <sect1 id="full-advantage">
+ <title>Taking Full Advantage of the Exchange Server When Scheduling Appointments</title>
+ <para>
+ When you schedule a meeting with your calendar on the
+ <application>Exchange</application>server, you can check when
+ other local Exchange users are busy according to their
+ <application>Exchange</application>calendars. To do so:
+ </para>
+ <figure>
+ <title>Scheduling With Free/Busy Information</title>
+ <screenshot>
+ <screeninfo>Using the Free/Busy Feature</screeninfo>
+ <mediaobject><imageobject>
+ <imagedata format="png" fileref="figures/schedule" srccredit="Aaron Weber">
+ </imageobject></mediaobject>
+ </screenshot>
+ </figure>
+
+ <note id="reminders-in-exchange">
+ <title>Reminders In Exchange</title>
+ <para>
+ Reminders for appointments in your Exchange calendar will
+ not work until you have run Evolution at least once after
+ logging in. This is different from locally stored reminders,
+ which will work from the moment you log in, regardless of
+ whether you have run Evolution in the session.
+ </para>
+ </note>
+ <orderedlist numeration="arabic">
+ <listitem>
+ <para>
+ Open a new appointment in the calendar.
+ </para>
+ </listitem>
+ <listitem>
+ <para> Choose <menuchoice> <guimenu>Actions</guimenu>
+ <guimenuitem>Schedule Meeting</guimenuitem>
+ </menuchoice> in the meeting editor window.
+ </para>
+ </listitem>
+ <listitem>
+ <para> Add attendees, either by entering their email
+ addresses into the list, or by clicking the
+ <guibutton>Invite Others</guibutton> button. If you choose
+ to so, it's best to use the Global Address List (GAL).
+ Choose the GAL from the drop-down list of address sources
+ at the top of the dialog box.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Choose <guilabel>Options</guilabel> and then
+ <guilabel>Update Free/Busy</guilabel> to check participant
+ schedules and, if possible, update the meeting in all
+ participants' calendars.
+ </para>
+ </listitem>
+ </orderedlist>
+ <tip id="autopick">
+ <title>Using Autopick to Adjust Meeting Times</title>
+ <para>
+ If meeting attendees are not available during the times you
+ have scheduled a meeting, you can "nudge" the meeting forward
+ or backward to the nearest available time. To do so, just
+ click the arrows to the left or right of the
+ <guilabel>Autopick</guilabel> button. The autopick tool will
+ move the meeting to the nearest time during which all
+ attendees are available. If you aren't satisfied with those
+ results, you can drag the edges of the meeting time to the
+ hours that you want to select.
+ </para>
+ </tip>
+ </sect1>
+</chapter>
+
diff --git a/help/C/usage-mail-org.sgml b/help/C/usage-mail-org.sgml
new file mode 100644
index 0000000000..459f3ad80c
--- /dev/null
+++ b/help/C/usage-mail-org.sgml
@@ -0,0 +1,1129 @@
+<chapter id="usage-mail-organize">
+ <title>Organizing and Managing your Email</title>
+ <para>
+ Even if you only get a few email messages a day, you probably
+ want to sort and organize them. When you get a hundred a day
+ and you want to refer to a message you received six weeks ago,
+ you <emphasis>need</emphasis> to sort and organize them.
+ Fortunately, <application>Ximian Evolution</application> has the tools
+ to help you do it.
+ </para>
+
+ <sect1 id="importing-mail-and-settings">
+ <title>Importing Your Old Email and Settings</title>
+ <para>
+ <application>Evolution</application> allows you to import old
+ email and data so that you don't need to worry about losing your
+ old information.
+ </para>
+ <sect2 id="importing-mail">
+ <title>Importing Email</title>
+ <para>
+ <application>Ximian Evolution</application> can import the
+ following types of files:
+ <variablelist>
+ <varlistentry>
+ <term>VCard (.vcf, gcrd):</term>
+ <listitem>
+ <para>
+ The addressbook format used by the GNOME, KDE, and
+ many other contact management applications. You
+ should be able to export to VCard format from any
+ address book application.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term>iCalendar (.ics):</term>
+ <listitem>
+ <para>
+ A format for storing calendar files. iCalendar is used by
+ PalmOS based handhelds, Ximian
+ <application>Evolution</application>, and Microsoft
+ <application>Outlook</application>.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term>Microsoft Outlook Express 4 (.mbx):</term>
+ <listitem>
+ <para>
+ Email file format used by Microsoft Outlook Express
+ 4. For other versions of Microsoft Outlook and Outlook Express, see
+ the workaround described in the note below.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term>MBox (mbox):</term>
+ <listitem>
+ <para>
+ The email box format used by Mozilla, Netscape,
+ Ximian Evolution, Eudora, and many other email clients.
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </para>
+ <para>
+ To import your old email:
+ <orderedlist numeration="arabic">
+ <listitem>
+ <para>
+ Click <menuchoice><guimenu>File</guimenu><guimenuitem>Import</guimenuitem></menuchoice>.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Click <guibutton>Next</guibutton> after reading the Welcome screen.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Select <guibutton>Import a single file</guibutton>.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Find the file that you wish to import into <application>Evolution</application>.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Click <guibutton>Import</guibutton>
+ </para>
+ </listitem>
+ </orderedlist>
+ </para>
+ </sect2>
+ <sect2 id="importing-preferences">
+ <title>Importing Preferences</title>
+ <para>
+ <application>Evolution</application> can import all your old
+ mail, contacts, and other information from other applications,
+ making your transition to <application>Evolution</application>
+ easy.
+ </para>
+ <para>
+ To import your old information:
+ <orderedlist numeration="arabic">
+ <listitem>
+ <para>
+ Click <menuchoice><guimenu>File</guimenu><guimenuitem>Import</guimenuitem></menuchoice>.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Click <guibutton>Next</guibutton> after reading the Welcome screen.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Select <guibutton>Import data and settings from older programs</guibutton>.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ The left-most column shows the application which your
+ information will be imported from. You then select
+ checkboxes on each component to import different
+ properties of each application.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Click <guibutton>Next</guibutton>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Click <guibutton>Import</guibutton>
+ </para>
+ </listitem>
+ </orderedlist>
+ </para>
+
+ <para>
+ <note>
+ <title>Microsoft Outlook and Outlook Express Users</title>
+ <para>
+ Microsoft Outlook, and versions of Outlook Express after
+ version 4, use proprietary formats that <application>Ximian
+ Evolution</application> cannot read or import. For contacts,
+ you may have to email them to yourself and import them that
+ way. For email, there is a simpler workaround:
+ <orderedlist numeration="arabic">
+
+ <listitem>
+ <para>
+ While using Windows, import the files into Mozilla Mail (or
+ another mailer, such as Netscape or Eudora, that uses the
+ standard mbox format).
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ Copy the files to the system or partition you use for
+ <application>Ximian Evolution</application>.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ Use the <application>Ximian Evolution</application> import
+ tool to import the files. There's more information about
+ why this works, and how, at the Ximian support website.
+ </para>
+ </listitem>
+ </orderedlist>
+ </para>
+ </note>
+
+ <note>
+ <title>Netscape Users</title>
+ <para>
+ Before importing mail from Netscape, make sure you select
+ <menuchoice><guimenu>File</guimenu><guimenuitem>Compact All
+ Folders</guimenuitem></menuchoice>. If you don't,
+ <application>Ximian Evolution</application> will import and undelete
+ the messages in your Trash folders.
+ </para>
+ </note>
+
+ </para>
+
+ </sect2>
+ </sect1>
+ <sect1 id="usage-mail-organize-columns">
+ <title>Sorting Mail with Column Headers</title>
+ <para>
+ By default, the message list has columns with the following
+ headings: an envelope icon indicating whether you have read
+ or replied to a message, an exclamation point indicating priority, and the
+ <guilabel>From</guilabel>, <guilabel>Subject</guilabel>, and
+ <guilabel>Date</guilabel> fields. You can change their order
+ and remove them by dragging and dropping them.
+
+ To add columns:
+ <orderedlist numeration="arabic">
+ <listitem>
+ <para>
+ Right click on the column header
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Click <guimenuitem>Add a Column</guimenuitem>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Click and drag a column you want into a space between
+ existing column headers. A red arrow will show you where
+ the column will be placed.
+ </para>
+ </listitem>
+ </orderedlist>
+ </para>
+ <para>
+ Right-click on one of the column headers to get a list of
+ options:
+ <variablelist>
+ <varlistentry>
+ <term><guimenuitem>Sort Ascending</guimenuitem>:</term>
+ <listitem><para>
+ Sorts the messages top to bottom.
+ </para></listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><guimenuitem>Sort Descending</guimenuitem>:</term>
+ <listitem><para>
+ Sorts the messages bottom to top.
+ </para></listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><guimenuitem>Group By this Field</guimenuitem>:</term>
+ <listitem><para>
+ Groups messages instead of sorting them. This makes each contact
+ with identical properties in the specified field to be placed in
+ its own group and physically separated from others.
+ </para></listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><guimenuitem>Remove this
+ Column</guimenuitem>:</term>
+ <listitem>
+ <para>
+ Remove this column from the display. You can also remove
+ columns by dragging the header off the list and
+ letting it drop.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><guimenuitem>Field
+ Chooser</guimenuitem>:</term> <listitem><para>
+ When you choose this item, a list
+ of column headers will appear; just drag and drop them into
+ place between two existing headers. A red arrow will
+ appear to show you where you're about to put the
+ column.
+ </para></listitem>
+ </varlistentry>
+ </variablelist>
+ </para>
+ </sect1>
+
+ <sect1 id="usage-mail-organize-folders">
+ <title>Getting Organized with Folders</title>
+ <para>
+ <application>Ximian Evolution</application> keeps mail, as well as
+ address cards and calendars, in folders. You start out with a
+ few mail folders, such as <guilabel>Inbox</guilabel>,
+ <guilabel>Outbox</guilabel>, and <guilabel>Drafts</guilabel>,
+ but you can create as many as you like. Create new folders by
+ selecting <guisubmenu>New</guisubmenu> and then
+ <guimenuitem>Folder</guimenuitem> from the
+ <guimenu>File</guimenu> menu.
+ <application>Ximian Evolution</application> will as you for the name
+ and the type of the folder, and will provide you with a folder
+ tree so you can pick where it goes.
+ </para>
+ <para>
+ When you click <guibutton>OK</guibutton>, your new folder will
+ appear in the <interface>folder view</interface>. You can
+ then put messages in it by dragging and dropping them, or by
+ using the <guibutton>Move</guibutton> button in the
+ toolbar. If you want to move several messages at once, click
+ on the ones you want to move while holding down the
+ <keycap>Ctrl</keycap> key, or use <keycap>Shift</keycap> to
+ select a range of messages. If you create a filter with the
+ <interface>filter assistant</interface>, you can have mail
+ filed automatically.
+ </para>
+
+ <warning id="imap-subfolders">
+ <title>Subfolders in IMAP</title>
+ <para>
+ The INBOX folder on most IMAP servers cannot contain both
+ subfolders and messages. When you create additional folders
+ on your IMAP mail server, branch them from the root of the
+ IMAP account's folder, tree, not from INBOX. If you create
+ subfolders in your INBOX folder, you will lose the ability
+ to read messages that exist in your INBOX until you move the
+ folders out of the way.
+ </para>
+ </warning>
+
+ </sect1>
+
+ <sect1 id="usage-mail-organize-search">
+ <title>Searching for Messages</title>
+ <para>
+ Most mail clients can search through your messages for you,
+ but <application>Ximian Evolution</application> does it faster. You
+ can search through just the message subjects, just the message
+ body, or both body and subject.
+ </para>
+ <para>
+ To start searching, enter a word or phrase in the text area
+ right below the toolbar, and choose a search type:
+ <variablelist>
+ <varlistentry>
+ <term><guilabel>Body or subject contains</guilabel>:</term>
+ <listitem>
+ <para>
+ This will search message subjects and the messages
+ themselves for the word or phrase you've entered in
+ the search field.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term> <guilabel>Body contains</guilabel>:</term>
+ <listitem>
+ <para>
+ This will search only in message text, not the subject
+ lines.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><guilabel>Subject contains:</guilabel></term>
+ <listitem>
+ <para>
+ This will show you messages where the search text is
+ in the subject line. It will not search in the
+ message body.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><guilabel>Body does not contain:</guilabel></term>
+ <listitem>
+ <para>
+ This finds every email message that does not have the
+ search text in the message body. It will still show
+ messages that have the search text in the subject
+ line, if it is not also in the body.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><guilabel>Subject does not contain:</guilabel></term>
+ <listitem>
+ <para>
+ This finds every mail whose subject does not contain
+ the search text.
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+
+ When you've entered your search phrase, press
+ <keycap>Enter</keycap>. <application>Ximian Evolution</application>
+ will show your search results in the message list.
+ </para>
+
+ <para>
+ If you think you'll want to return to a search again, you can
+ save it as a virtual folder by selecting <guilabel>Store
+ Search as vFolder</guilabel>.
+ </para>
+
+ <para>
+ When you're done with the search, go back to seeing all your
+ messages by choosing <guimenuitem>Show All</guimenuitem> from
+ the <guilabel>Search</guilabel> drop-down box. If you're
+ sneaky, just enter a blank search: since every message has at
+ least one space in it, you'll see every message in the
+ folder.
+ </para>
+
+ <para>
+ If you'd like to perform a more complex search, open the
+ advanced search dialog by selecting
+ <guilabel>Advanced...</guilabel> from the
+ <guilabel>Search</guilabel> drop-down menu. Then, create your
+ search criteria (each with the same options you saw in the
+ regular search bar), and decide whether you want to find
+ messages that match all of them, or messages that match even
+ one. Then, click <guibutton>Search</guibutton> to go and find
+ those messages.
+ </para>
+
+ <para>
+ You'll see a similar approach to sorting messages when you
+ create filters and vFolders in the next few sections.
+ </para>
+
+ </sect1>
+
+ <sect1 id="usage-mail-organize-filters">
+ <title>Create Rules to Automatically Organize Mail</title>
+ <para>
+ Filters work very much like the mail room in a large company.
+ Their purpose is to bundle, sort, and distribute mail to the
+ various folders. In addition, you can have multiple filters
+ performing multiple actions that may effect the same message
+ in several ways. For example, your filters could put copies
+ of one message into multiple folders, or keep a copy and send
+ one to another person as well, and it can do that quickly. Of
+ course, it's also faster and more flexible than an actual
+ person with a pile of envelopes.
+ </para>
+
+
+ <tip id="easy-filter">
+ <title>Quick Filter Creation</title>
+ <para>
+ There is an easy shortcut for fast filter or vFolder
+ creation. Right-click on the message in the message
+ list, and select one of the items under the
+ <guimenuitem>Create Rule from Message</guimenuitem>
+ submenu.
+ </para>
+ </tip>
+
+ <sect2 id="usage-mail-org-filters-new">
+ <title>Making New Filters</title>
+ <para>
+ To create a new filter:
+ <orderedlist numeration="arabic">
+ <listitem>
+ <para>
+ Click
+ <menuchoice>
+ <guimenu>Tools</guimenu>
+ <guimenuitem>Filters</guimenuitem>
+ </menuchoice>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Press the <guibutton>Add</guibutton> button.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Name your filter in the <guilabel>Rule name</guilabel> field.
+ For each filter criterion, you must first select
+ which of the following parts of the message you want the filter to
+ examine:
+
+ <itemizedlist>
+ <listitem><para>
+ Sender - The sender's address.
+ </para></listitem>
+
+
+ <listitem><para>
+ Recipients - The recipients of the message.
+ </para></listitem>
+
+ <listitem><para>
+ Subject - The subject line of the message.
+ </para></listitem>
+
+ <listitem><para>
+ Specific Header - The filter can look at any header you
+ want, even obscure or custom ones. Enter the header name
+ in the first text box, and put your search text in the
+ second one.
+
+
+ <note id="multiple-repeated-headers">
+ <title>Repeated Headers</title>
+ <para>
+ If a message uses a header more than once, Evolution will
+ pay attention only to the first instance, even if the
+ message defines the header differently the second
+ time. For example, if a message declares the Resent-From:
+ header as "engineering@rupertcorp.com" and then restates
+ it as "marketing@rupertcorp.com," Evolution will filter as
+ though the second declaration had not occurred. To filter
+ on messages that use headers multiple times, use a regular
+ expression.
+ </para>
+ </note>
+
+ </para></listitem>
+
+ <listitem><para>
+ Message Body - Search in the actual text of the message.
+ </para></listitem>
+
+ <listitem>
+ <para>
+ Expression - For programmers only: match a message according to an
+ expression you write in the Scheme language, used to
+ define filters in <application>Ximian Evolution</application>.
+ </para>
+
+<para>
+
+ <note id="lots-of-filters">
+ <title>What if Multiple Filters Match One Message?</title>
+ <para>
+ If you have several filters that match a single message,
+ they will all be applied to the message, in order, unless
+ one of the filters has the action <guibutton>Stop
+ Processing</guibutton>. If you use that action in a
+ filter, the messages that it affects will not be touched
+ by other filters.
+ </para>
+ </note>
+</para>
+ </listitem>
+
+
+
+ <listitem><para> Date sent - Filter messages according to the date on
+ which they were sent: First, choose the conditions you
+ want a message to meet &mdash; <guilabel>before</guilabel>
+ a given time, <guilabel>after</guilabel> it, and so forth.
+ Then, choose the time. The filter will compare the
+ message's time-stamp to the system clock when the filter
+ is run, or to a specific time and date you choose from a
+ calendar. You can even have it look for messages within a
+ range of time relative to the filter &mdash; perhaps you're
+ looking for messages less than two days old.
+ </para></listitem>
+
+ <listitem><para>
+ Date Received - This works the same way as the <guilabel>Date Sent</guilabel>
+ option, except that it compares the time you got the message
+ with the dates you specify.
+ </para></listitem>
+
+ <listitem><para>
+ Score - Emails have a standard priority range from -3 (least
+ important) to 3 (most important). You can have filters set the
+ priority of messages you receive, and then have other filters
+ applied only to those messages which have a certain priority.
+ </para></listitem>
+
+ <listitem>
+ <para>
+ Size (kb) - Sorts based on the size of the message in kilobytes.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ Status - Filters according to the status of a message, such as
+ 'New'.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ Attachments - Create a filter based on whether or not you
+ have an attachment in the email.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ Mailing List - Filter based on the mailing list it came from.
+ </para>
+ <note>
+ <title>How Does Filtering on Mailing Lists Work?</title>
+ <para>
+ Filtering on mailing list actually looks for a
+ specific mailing-list header called the
+ <computeroutput>X-BeenThere</computeroutput>
+ header, used to identify mailing lists or other
+ redistributors of mail.
+ </para>
+ </note>
+ </listitem>
+
+ <listitem>
+ <para>
+ Regex Match - If you know your way around a
+ <glossterm
+ linkend="regular-expression">regex</glossterm>, or
+ regular expression, put your knowledge to use
+ here.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ Source Account - Filter messages according the server you got them from.
+ You can enter a URL or choose one from the drop-down
+ list. This ability is only relevant if you use more
+ than one mail source.
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Select the criterion for the condition. If you want multiple
+ criteria for this filter, press <guibutton>Add
+ criterion</guibutton> and repeat the previous step.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Select the actions for the filter in the <guilabel>Then</guilabel>
+ section. You can select any of the following options.
+ <itemizedlist>
+ <listitem><para>
+ Move to Folder - If you select this item, <application>Ximian Evolution</application>
+ will put the messages into a folder you specify. Click the
+ <guibutton>&lt;click here to select a folder&gt;</guibutton> button
+ to select a folder.
+ </para></listitem>
+
+ <listitem><para>
+ Copy to Folder - If you select this item, <application>Ximian Evolution</application>
+ will put the messages into a folder you specify. Click the
+ <guibutton>&lt;click here to select a folder&gt;</guibutton> button
+ to select a folder.
+ </para></listitem>
+
+ <listitem><para>
+ Forward to Address - Select this, enter an address, and the addressee will
+ get a copy of the message.
+ </para></listitem>
+
+ <listitem><para>
+ Delete - Marks the message for deletion. You can still get the message
+ back, at least until you <guimenuitem>Expunge</guimenuitem> your
+ mail yourself.
+ </para></listitem>
+
+ <listitem><para>
+ Stop Processing - Select this if you want to tell all other filters to ignore
+ this message, because whatever you've done with it so far
+ is plenty.
+ </para></listitem>
+
+ <listitem><para>
+ Assign Color - Select this item, and <application>Ximian Evolution</application>
+ will mark the message with whatever color you please.
+ </para></listitem>
+
+ <listitem><para>
+ Assign Score - If you know that all mail with
+ "important" somewhere in the message body line is
+ important, you can give it a high priority score. In a subsequent filter you can
+ then arrange your messages by their priority score.
+ </para></listitem>
+ </itemizedlist>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Set Status - If you want to add multiple actions for this filter, press
+ <guibutton>Add action</guibutton> and repeat the previous step.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Press <guibutton>OK</guibutton>.
+ </para>
+ </listitem>
+ </orderedlist>
+ </para>
+
+ <note id="when-filters-go-wrong">
+ <title>When Are Filters Applied?</title>
+ <para>
+ If you move mail from your server into your local system
+ using POP mail, filters are applied to incoming mail every
+ time you check for mail.
+ </para>
+ <para>
+ If you store your mail on the mail server and check your
+ mail with IMAP, filters are applied to the INBOX when you
+ open it. In some cases, you will see a number of unread
+ messages in the INBOX, click the INBOX, and then have the
+ messages move elsewhere as they are filtered out.
+ </para>
+ <para>
+ If you use Ximian Connector to store your mail on an
+ Exchange server, filters are not applied until you open
+ your INBOX folder and select
+ <menuchoice><guimenu>Actions</guimenu><guimenuitem>Apply
+ Filters</guimenuitem></menuchoice> or press
+ <keycombo><keycap>Ctrl</keycap><keycap>Y</keycap></keycombo>
+ </para>
+ </note>
+ <example id="filter-example">
+ <title>Using a Filter to Avoid Spam</title>
+ <para>
+ A good deal of bulk mail is eventually tagged with the
+ <computeroutput>Precedence: Bulk</computeroutput> header at
+ one point or another. Not all of it is, of course, and
+ there are "good" messages (mailing lists you subscribe to,
+ for example) that are also considered "Bulk" mail.
+ However, if you filter out all the mail with that header,
+ you'll catch a lot of the mail you don't want to get.
+ </para>
+
+
+ <para>
+ To catch them and automatically mark them for deletion, do
+ the following:
+ <orderedlist>
+
+ <listitem><para>
+ Select <menuchoice><guimenu>Tools</guimenu><guimenuitem>Filters</guimenuitem></menuchoice>.
+ </para></listitem>
+
+ <listitem><para>
+ Click <guibutton>New</guibutton>.
+ </para></listitem>
+
+ <listitem><para>
+ Set the first part of your search criteria to look in a <guilabel>Specific header</guilabel>.
+ </para></listitem>
+
+ <listitem><para>
+ Enter <userinput>Precedence</userinput> as the name of the header.
+ </para></listitem>
+
+ <listitem><para>
+ Choose <guilabel>contains</guilabel> at the second drop-down box.
+ </para></listitem>
+
+ <listitem><para>
+ Enter <userinput>Bulk</userinput> as the content to search for.
+ You're now working with all email that has the word "Bulk" in the
+ "Precedence" header.
+ </para></listitem>
+
+ <listitem><para>
+ For actions, select "Move to Folder" and choose the
+ folder where you'd like to place bulk mail.
+ </para></listitem>
+
+ <listitem><para> If you like, add another action and
+ choose <guilabel>Delete</guilabel>.
+ </para></listitem>
+
+ <listitem><para>
+ Click OK. You're done.
+ </para></listitem>
+ </orderedlist>
+ </para>
+ </example>
+ </sect2>
+
+
+
+ <sect2 id="filters-edit">
+ <title>Editing Filters</title>
+ <para>
+ To edit a filter:
+ <orderedlist numeration="arabic">
+ <listitem>
+ <para>
+ Select
+ <menuchoice>
+ <guimenu>Tools</guimenu>
+ <guimenuitem>Filters</guimenuitem>
+ </menuchoice>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Select the filter in the <guilabel>Filter Rules</guilabel> section
+ and press <guibutton>Edit</guibutton>.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Change the desired settings.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Press <guibutton>OK</guibutton> in the filter editor window.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Press <guibutton>OK</guibutton> in the filter manager window.
+ </para>
+ </listitem>
+ </orderedlist>
+ </para>
+ </sect2>
+
+ <sect2 id="filters-deleting">
+ <title>Deleting Filters</title>
+ <para>
+ To delete a filter:
+ <orderedlist numeration="arabic">
+ <listitem>
+ <para>
+ Select
+ <menuchoice>
+ <guimenu>Tools</guimenu>
+ <guimenu>Filters</guimenu>
+ </menuchoice>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Select the filter and press <guibutton>Delete</guibutton>.
+ </para>
+ </listitem>
+ </orderedlist>
+ </para>
+ <para>
+ <note>
+ <title>Changing Folder Names and Filters</title>
+ <para>
+ <itemizedlist>
+ <listitem>
+ <para>
+ Incoming email that your filters don't move goes
+ into the Inbox; outgoing mail that they don't move
+ ends up in the Sent folder. So be sure to change
+ the filters that go with it.
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+ </note>
+ </para>
+ </sect2>
+ </sect1>
+
+ <sect1 id="usage-mail-organize-vfolders">
+ <title>Getting Really Organized with vFolders</title>
+ <para>
+ If filters aren't flexible enough for you, or you find
+ yourself performing the same search again and again, consider
+ a vFolder. vFolders, or virtual folders, are an advanced way
+ of viewing your email messages within
+ <application>Ximian Evolution</application>. If you get a lot of
+ mail or often forget where you put messages, vFolders
+ can help you stay on top of things.
+ </para>
+ <para>
+ A vFolder is really a hybrid of all the other organizational
+ tools: it looks like a folder, it acts like a search, and you
+ set it up like a filter. In other words, while a conventional
+ folder actually contains messages, a vFolder is a view of
+ messages that may be in several different folders. The
+ messages it contains are determined on the fly using a set of
+ criteria you choose in advance.
+ </para>
+
+ <para>
+ As messages that meet the vFolder criteria arrive or are
+ deleted, <application>Ximian Evolution</application> will
+ automatically place them in and remove them from the
+ vFolder contents list. When you delete a message, it gets
+ erased from the folder in which it actually exists, as well as
+ any vFolders which display it.
+ </para>
+
+ <para>
+ Imagine a business trying to keep track of mail from hundreds
+ of vendors and clients, or a university with overlapping and
+ changing groups of faculty, staff, administrators and
+ students. The more mail you need to organize, the less you
+ can afford the sort of confusion that stems from an
+ organizational system that's not flexible enough. vFolders
+ make for better organization because they can accept
+ overlapping groups in a way that regular folders and filing
+ systems can't.
+ </para>
+
+
+ <note id="unmatched-vfolder">
+ <title>The "Unmatched" vFolder</title>
+ <para>
+ The Unmatched vFolder is the mirror of all your other
+ vFolders: it displays whatever messages are not matched by
+ other vFolders.
+ </para>
+ <para>
+ If you use remote email storage like IMAP or Microsoft
+ Exchange, and have created vFolders to search through them,
+ the Unmatched vFolder will follow your lead, and search the
+ remote folders as well. If you do not create any vFolders that
+ search in remote mail stores, the Unmatched vFolder will not
+ search in them either.
+ </para>
+ </note>
+
+
+ <example id="usage-mail-organize-vFolders-ex">
+ <title>Using Folders, Searches, and vFolders</title>
+ <para>
+ To organize his mailbox, Jim sets up a virtual folder for emails from
+ his friend and co-worker Anna. He has another one for messages that
+ have ximian.com in the address and <application>Ximian Evolution</application> in the subject line, so he
+ can keep a record of what people from work send him about
+ <application>evolution</application>. If Anna sends him a message about
+ anything other than <application>Ximian Evolution</application>, it only shows up in the "Anna" folder.
+ When Anna sends him mail about the user interface for
+ <application>evolution</application>, he can see that message both in
+ the "Anna" vFolder and in the "Internal Evolution Discussion"
+ vFolder.
+ </para>
+ </example>
+
+ <!-- (INSERT SCREENSHOT HERE: vFolders in action) -->
+
+ <sect2 id="vfolder-create">
+ <title>Creating vFolders</title>
+ <para>
+ To create a vFolder:
+ <orderedlist numeration="arabic">
+ <listitem>
+ <para>
+ <menuchoice>
+ <guimenu>Tools</guimenu>
+ <guimenuitem>vFolder Editor</guimenuitem>
+ </menuchoice>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Click <guibutton>Add</guibutton>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Name your vFolder in the <guilabel>Rule name</guilabel> field.
+
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Select your search criteria. For each criterion, you
+ must first select which of the following parts of the
+ message you want the search to examine:
+ <itemizedlist>
+ <listitem><para>
+ Sender - The sender's address.
+ </para></listitem>
+
+
+ <listitem><para>
+ Recipients - The recipients of the message.
+ </para></listitem>
+
+ <listitem><para>
+ Subject - The subject line of the message.
+ </para></listitem>
+
+ <listitem><para>
+ Specific Header - The vFolder can look at any header you
+ want, even obscure or custom ones. Enter the header name
+ in the first text box, and put your search text in the
+ second one.
+ </para></listitem>
+
+ <listitem><para>
+ Message Body - Search in the actual text of the message.
+ </para></listitem>
+
+ <listitem>
+ <para>
+ Expression - For programmers only: match a message according to an
+ expression you write in the Scheme language, used to
+ define vFolders in <application>Ximian Evolution</application>.
+ </para>
+ </listitem>
+
+ <listitem><para> Date sent - Search messages according to the date on
+ which they were sent: First, choose the conditions you
+ want a message to meet &mdash; <guilabel>before</guilabel>
+ a given time, <guilabel>after</guilabel> it, and so forth.
+ Then, choose the time. The vFolder will compare the
+ message's time-stamp to the system clock when the filter
+ is run, or to a specific time and date you choose from a
+ calendar. You can even have it look for messages within a
+ range of time relative to the filter &mdash; perhaps you're
+ looking for messages less than two days old.
+ </para></listitem>
+
+ <listitem><para>
+ Date Received - This works the same way as the <guilabel>Date Sent</guilabel>
+ option, except that it compares the time you got the message
+ with the dates you specify.
+ </para></listitem>
+
+ <listitem><para>
+ Score - Emails have a standard priority range from -3 (least
+ important) to 3 (most important). You can have vFolders set the
+ priority of messages you receive, and then have other
+ vFolders
+ applied only to those messages which have a certain priority.
+ </para></listitem>
+
+ <listitem>
+ <para>
+ Size (kb) - Sorts based on the size of the message in kilobytes.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ Status - Searches according to the status of a message, such as
+ 'New'.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ Attachments - Create a vFolder based on whether or not you have an
+ attachment in the email.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ Mailing List - Search based on the mailing list it came from.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ Source Account - Search messages according the server you got them from.
+ You can enter a URL or choose one from the drop-down
+ list. This ability is only relevant if you use more
+ than one mail source.
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Select the folder sources. You can select:
+ <itemizedlist>
+ <listitem>
+ <para>
+ Specific folders only
+ <note>
+ <para>
+ If you select specific folders only, you need to specify the
+ source folders in the box below.
+ </para>
+ </note>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ All local folders
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ With all active remote folders
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ With all local and active folders
+ </para>
+ </listitem>
+ </itemizedlist>
+
+ </para>
+ </listitem>
+ </orderedlist>
+ </para>
+ <para>
+ Remote folders are considered active if you are connected to the
+ server; you must be connected to your mail server for the vFolder to
+ include any messages from that source.
+ </para>
+ <para>
+ <figure id="usage-mail-vfolder-fig-createrule">
+ <title>Selecting a vFolder Rule</title>
+ <screenshot>
+ <screeninfo>Creating a vFolder Rule</screeninfo>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="figures/vfolder-createrule-fig" format="PNG"
+ srccredit="Aaron Weber">
+ </imageobject>
+ </mediaobject>
+ </screenshot>
+ </figure>
+ </para>
+ </sect2>
+ </sect1>
+</chapter>
diff --git a/help/C/usage-mail.sgml b/help/C/usage-mail.sgml
new file mode 100644
index 0000000000..c71bd92a3f
--- /dev/null
+++ b/help/C/usage-mail.sgml
@@ -0,0 +1,2209 @@
+<chapter id="usage-mail">
+ <title>Using Evolution for Email</title>
+ <para>
+ This chapter, and <xref linkend="usage-mail-organize">, will
+ provide you with an in-depth guide to the capabilities of
+ Evolution as a mail client. For information about how to set up
+ your mail account, see <xref linkend="config-prefs-mail">.
+ </para>
+
+ <note>
+ <title>If you use IMAP Mail</title>
+ <para>
+ If you chose IMAP mail during the setup process, you must
+ subscribe to your mail folders before you can read mail in
+ them. Read <xref linkend="usage-mail-subscriptions"> to find out
+ how.
+ </para>
+ </note>
+
+
+ <sect1 id="usage-mail-getnsend-read">
+ <title>Reading Mail</title>
+ <para>
+ Start the mail client by clicking on the
+ <guibutton>Inbox</guibutton> icon in the shortcut bar, or by
+ selecting a mail folder in the folder bar. To read a message,
+ select it in the message list; if you'd like to see it in its
+ own window, double-click on it or press
+ <keycombo action="simul">
+ <keycap>Ctrl</keycap>
+ <keycap>O</keycap>
+ </keycombo>.
+ </para>
+
+ <tip id="spaceandbs">
+ <title>Reading Mail with the Keyboard</title>
+ <para>
+ You can click the space bar to page down while you're reading
+ an email, and press backspace to page up in an email. This
+ may help to make reading your email faster.
+ </para>
+ </tip>
+
+ <sect2 id="usage-mail-listorder">
+ <title>Sorting the message list</title>
+ <para>
+ <application>Evolution</application> helps you work by letting you sort
+ your email. To sort by sender, subject, or date, click
+ on the bars with those labels at the top of the message
+ list. The direction of the arrow next to the label indicates
+ the direction of the sort, and if you click again, you'll
+ sort them in reverse order. For example, click once on
+ <guilabel>Date</guilabel> to sort messages by date from
+ oldest to newest. Click again, and
+ <application>Evolution</application> sorts the list from
+ newest to oldest. You can also right-click on the message
+ header bars to get a set of sorting options, and add or
+ remove columns from the message list. You can find detailed
+ instructions on how to customize your message display
+ columns in <xref linkend="usage-mail-organize-columns">.
+ </para>
+
+ <tip id="view-headers">
+ <title>Email Headers</title>
+ <para>
+ To look at the complete headers for email messages, select
+ <menuchoice><guimenu>View</guimenu><guisubmenu>Message
+ Display</guisubmenu><guimenuitem>Show Full
+ Headers</guimenuitem></menuchoice>. To see absolutely every
+ bit, choose
+ <menuchoice><guimenu>View</guimenu><guisubmenu>Message
+ Display</guisubmenu><guimenuitem>Show Email Source
+ </guimenuitem></menuchoice>.
+ </para>
+ </tip>
+
+ <para>
+ You can also choose a threaded message view. Select
+ <menuchoice>
+ <guimenu>View</guimenu>
+ <guimenuitem>Threaded</guimenuitem>
+ </menuchoice>
+ to turn the threaded view on or off. When you select this option,
+ <application>Evolution</application> groups the replies to a
+ message with the original, so you can follow the thread of a
+ conversation from one message to the next.
+ </para>
+ <figure>
+ <title>Threaded Mail View</title>
+ <screenshot>
+ <screeninfo>Threaded Mail View</screeninfo>
+ <mediaobject><imageobject>
+ <imagedata format="png" fileref="figures/mail-threaded" srccredit="Aaron Weber">
+ </imageobject></mediaobject>
+ </screenshot>
+ </figure>
+
+ </sect2>
+
+ <sect2 id="usage-mail-getnsend-delete">
+ <title>Deleting Mail</title>
+ <para>
+ Once you've read your mail, you may want to get rid of
+ it.
+ To delete a message:
+ <orderedlist numeration="arabic">
+ <listitem>
+ <para>
+ Click the message to select it
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Press delete button or right click on the message and
+ choose <guilabel>Delete</guilabel>.
+ </para>
+ <note>
+ <title>Why do I still see deleted mail?</title>
+ <para>
+ When you press <guibutton>Delete</guibutton> or click
+ the trash button, your mail isn't actually deleted,
+ but is marked for deletion. Your email is not gone
+ until you have expunged it. When you "Expunge" a
+ folder, you remove all the mail that you have marked
+ for deletion.
+ </para>
+ <para>
+ If you don't like this behavior, select
+ <menuchoice><guimenu>View</guimenu><guimenuitem>Hide
+ Deleted Messages</guimenuitem></menuchoice>. Then,
+ you will only see deleted messages when you look in
+ your <guilabel>Trash</guilabel> folder.
+ </para>
+ </note>
+ </listitem>
+ <listitem>
+ <para>
+ Click
+ <menuchoice>
+ <guimenu>Actions</guimenu>
+ <guimenuitem>Expunge</guimenuitem>
+ </menuchoice>
+ or press
+ <keycombo action="simul">
+ <keycap>Ctrl</keycap>
+ <keycap>E</keycap>
+ </keycombo>
+ </para>
+ </listitem>
+ </orderedlist>
+ </para>
+ <note>
+ <title>Trash is Actually a vFolder?</title>
+ <para>
+ Both local and IMAP Trash folders are actually vFolders that
+ display all messages you have marked for later deletion.
+ For more information about vFolders, see <xref
+ linkend="usage-mail-organize-vfolders">. Since emptying
+ your trash expunges the messages in your Trash folder,
+ choosing <menuchoice> <guimenu>Actions</guimenu>
+ <guimenuitem>Empty Trash</guimenuitem> </menuchoice> is the
+ same as expunging deleted mail from <emphasis>all</emphasis>
+ your folders.
+ </para>
+ <para>
+ This is not, however, true for the Trash folder on Exchange
+ servers, which behaves just the same as it would in
+ Outlook. That is to say, the Trash folder on an Exchange
+ server is a normal folder with actual messages in it.
+ </para>
+ </note>
+ </sect2>
+ <sect2 id="usage-mail-getnsend-undelete">
+ <title>Undeleting Messages</title>
+ <para>
+ To undelete a message:
+ <orderedlist numeration="arabic">
+ <listitem>
+ <para>
+ Select a message you have marked for deletion.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Press <keycombo
+ action="simul"><keycap>Ctrl</keycap><keycap>U</keycap>
+ </keycombo>
+ or choose
+ <menuchoice>
+ <guimenu>Edit</guimenu>
+ <guimenuitem>Undelete</guimenuitem>
+ </menuchoice>
+
+ </para>
+ <note>
+ <title>What does Undelete actually do?</title>
+ <para>
+ If you have marked a message for deletion, undeleting
+ it will unmark it, and the message will be removed
+ from the Trash folder. However, it can't bring back
+ messages that have been expunged.
+ </para>
+ </note>
+ </listitem>
+ </orderedlist>
+ </para>
+ </sect2>
+ </sect1>
+
+ <sect1 id="usage-mail-getnsend-get">
+ <title>Checking for New Mail</title>
+ <para>
+ Now that you've had a look around the
+ <interface>Inbox</interface>, it's time to check for new mail.
+ Click <guibutton>Get Mail</guibutton> in the toolbar to check
+ your mail. If you haven't entered any mail settings yet, the
+ <interface>setup assistant</interface> will ask you for the
+ information it needs to check your email.
+ </para>
+ <para>
+ The assistant will give you several dialog boxes where you configure:
+ <itemizedlist>
+ <listitem>
+ <para>
+ your personal information
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ your outgoing email server information
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ your mail account identity name
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+ <para>
+ To check your email, press the <guibutton>Check Mail</guibutton>
+ button. If this is your first time checking mail, or you
+ haven't asked <application>Evolution</application> to store your
+ password, you'll be prompted for the password. Enter your
+ password and your email will be downloaded.
+ </para>
+ <note id="badmailsettings">
+ <title>Can't Check Mail?</title>
+ <para>
+ If you get an error message instead of mail, you probably need
+ to check your network settings. To learn how to do that, have
+ a look at <xref linkend="config-prefs-mail">, or ask your
+ system administrator.
+ </para>
+ </note>
+
+
+
+ <tip>
+ <title>Sharing Mailboxes with Other Mail Programs</title>
+ <para>
+ If you want to use <application>Evolution</application>
+ and another email client, such as
+ <application>Mutt</application>, at the same time,
+ here's how:
+ <orderedlist numeration="arabic">
+ <listitem>
+ <para>
+ Download your mail in the other application as
+ you would normally.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ In <application>Evolution</application>
+ <menuchoice><guimenu>Tools</guimenu><guimenuitem>Mail
+ Settings</guimenuitem></menuchoice>, and pick the account
+ you'd like to use to share mail. You may want to
+ create a new account just for this source of
+ mail.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Under the <guilabel>Receiving Mail</guilabel>
+ tab, select the type of mail file that your
+ other mail application uses, and then enter the
+ full path to that file.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Click the <guibutton>OK</guibutton> button.
+ </para>
+ </listitem>
+ </orderedlist>
+ </para>
+ </tip>
+
+
+<!-- NOT FOR 1.0
+ <sect2 id="usage-mail-getnsend-get-news">
+ <title>Using Evolution for News</title>
+ <para>
+ Newsgroups are so similar to email that there's no reason not
+ to read them side by side. If you want to do that, add a
+ news source to your configuration (see <xref
+ linkend="config-prefs-network-news">). The news server will
+ appear as a remote server, and will look quite similar to an
+ IMAP folder. When you click <guibutton>Get Mail</guibutton>,
+ <application>Evolution</application> will also check for news
+ messages.
+ </para>
+ </sect2>
+-->
+
+ <sect2 id="usage-mail-getnsend-get-attach">
+ <title>Working with Attachments and HTML Mail</title>
+ <para>
+ If someone sends you an <glossterm linkend="attachment">attachment</glossterm>,
+ a file attached to an email,
+ <application>Evolution</application> will display the file
+ at the bottom of the message to which it's attached. Text,
+ including HTML formatting and embedded images, will appear
+ as part of the message, rather than at the end of the
+ message as an attachment.
+ </para>
+
+ <sect3 id="usage-mail-getnsend-get-attach-actions">
+ <title>Saving or Opening Attachments</title>
+ <para>
+ If you get an attachment with an email message,
+ <application>Ximian Evolution</application> can help you save
+ it or open it with the appropriate applications.
+ </para>
+ <para>
+ To save an attachment to disk:
+ <orderedlist numeration="arabic">
+ <listitem>
+ <para>
+ Click the downward pointing arrow on the attachment icon
+ and select <guimenuitem>Save to Disk</guimenuitem>.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Choose a location and name for the file.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Click <guibutton>OK</guibutton>.
+ </para>
+ </listitem>
+ </orderedlist>
+ </para>
+
+ <para>
+ To Open an Attachment in a Program:
+ <orderedlist numeration="arabic">
+ <listitem>
+ <para>
+ Open the mail message with the attachment you want to read.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Click the arrow next the attachment icon.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Select the program you'd like to use. It will start up
+ and open the document.
+ </para>
+ </listitem>
+ </orderedlist>
+ </para>
+ <para>
+ </para>
+ </sect3>
+
+ <sect3 id="usage-mail-getnsend-get-attach-html">
+ <title>Inline Images in HTML Mail</title>
+ <para>
+ When someone sends you HTML mail that includes an image in
+ the body of the message (for example, the welcome message in your
+ Inbox when you first start <application>Ximian
+ Evolution</application>) <application>Evolution</application>
+ will display the image inside the message. You can create
+ messages like this by using the
+ <menuchoice><guimenu>Insert</guimenu><guimenuitem>Image</guimenuitem></menuchoice>
+ tool in the message composer.
+ </para>
+
+ <para>
+ If the image isn't included in the message, but is, instead,
+ a link to an image, <application>Evolution</application> can
+ download the image from the Internet for you. However,
+ <application>Evolution</application> will not display the
+ image unless you ask it to. This is because remotely hosted
+ images can be slow to load and display, and can even be used
+ by spammers to track who reads their email. Having images
+ not load automatically helps protect your privacy.
+ </para>
+ <para>
+ If you want the images to load for one message, select
+ <menuchoice>
+ <guimenu>View</guimenu>
+ <guisubmenu>Message Display</guisubmenu>
+ <guimenuitem>Load Images</guimenuitem>
+ </menuchoice>.
+
+ If you want <application>Ximian Evolution</application> to
+ load remotely hosted images more often, go to the
+ <guilabel>Display</guilabel> tab of the
+ <menuchoice>
+ <guimenu>Tools</guimenu>
+ <guimenuitem>Mail Settings</guimenuitem>
+ </menuchoice> dialog.
+ </para>
+ <note id="http-proxy">
+ <title>Loading Images from the Net through an HTTP Proxy</title>
+ <para>
+ If you use an HTTP proxy,
+ <application>Evolution</application> must be able to find
+ it through the <systemitem>gnome-vfs</systemitem> subsystem
+ before it can load images from the Internet. This is also
+ the case if you wish to access weather and news information
+ through the Summary tool. You can tell the GNOME Virtual
+ File System about your HTTP proxy in one of two ways:
+ <variablelist>
+ <varlistentry>
+ <term>Configure it with Nautilus</term>
+ <listitem>
+ <para>
+ <orderedlist numeration="arabic">
+ <listitem>
+ <para>
+ Open a Nautilus window
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Select <menuchoice>
+ <guimenu>Preferences</guimenu>
+ <guimenuitem>Edit Preferences</guimenuitem>
+ </menuchoice>.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Go to the <guilabel>Navigation</guilabel> tab.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Click the <guilabel>Use HTTP Proxy</guilabel>
+ checkbox and enter the location of your HTTP
+ proxy in the <guilabel>Location</guilabel> field.
+ </para>
+ </listitem>
+ </orderedlist>
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>Configure it with the gconftool command</term>
+ <listitem>
+ <para>
+ <orderedlist numeration="arabic">
+ <listitem>
+ <para>
+ Open a terminal.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Enter the command
+ <command>
+ gconftool --type=bool --set /system/gnome-vfs/use-http-proxy "TRUE"
+ </command>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Enter the command
+ <command>
+ gconftool --type=string --set /system/gnome-vfs/http-proxy-host "your-proxy-url"
+ </command>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Enter the command
+ <command>
+ gconftool --type=int --set /system/gnome-vfs/http-proxy-port "8080"
+ </command>
+ </para>
+ </listitem>
+ </orderedlist>
+ </para>
+ <para>
+ For more information about the gconftool command,
+ read the gconftool man page.
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </para>
+ </note>
+ </sect3>
+ </sect2>
+ </sect1>
+
+ <sect1 id="usage-mail-getnsend-send">
+ <title>Composing New Email Messages</title>
+ <para>
+ You can start writing a new email message by selecting
+ <menuchoice> <guimenu>File</guimenu>
+ <guisubmenu>New</guisubmenu> <guimenuitem>
+ Mail Message</guimenuitem></menuchoice>, or by pressing the
+ <guibutton>Compose</guibutton> button in the Inbox toolbar.
+ When you do so, the <interface>New Message</interface> window
+ will open, as shown in <xref
+ linkend="usage-mail-newmsg-fig">.
+ </para>
+
+<!-- ==============Figure=================================== -->
+ <figure id="usage-mail-newmsg-fig">
+ <title>New Message Window</title>
+ <screenshot>
+ <screeninfo>Evolution Main Window</screeninfo>
+ <mediaobject><imageobject><imagedata fileref="figures/newmsg" format="png" srccredit="Aaron Weber">
+ </imageobject></mediaobject>
+ </screenshot>
+ </figure>
+<!-- ==============End of Figure=================================== -->
+
+ <para>
+ Enter an address in the <guilabel>To:</guilabel> field. If you
+ wish, enter a subject in the <guilabel>Subject:</guilabel>, and
+ a message in the box at the bottom of the window.
+ Once you have written your message, press
+ <guibutton>Send</guibutton>.
+ </para>
+
+ <sect2 id="usage-mail-getnsend-send-delay">
+ <title>Sending Composed Messages Later</title>
+ <para>
+ <application>Evolution</application> will send mail
+ immediately unless you tell it to do otherwise by selecting
+ <menuchoice> <guimenu>File</guimenu> <guimenuitem>Send
+ Later</guimenuitem></menuchoice>. This will add your
+ messages to the <guilabel>Outbox</guilabel> queue. The
+ "Send Later" feature is particularly useful if you use a
+ modem to connect to the Internet and pay per-minute
+ charges: you can remain offline until you need to send
+ mail, then connect and send all your mail at once. Mail in
+ the Outbox is sent when you click
+ <guibutton>Send/Receive</guibutton> in the main window.
+ </para>
+ <para>
+ To learn more about how you can specify message queue and
+ filter behavior, see <xref linkend="config-prefs-mail">.
+ </para>
+
+ <para>
+ You can also choose to save messages as drafts or as text
+ files. Your options are:
+ <itemizedlist>
+ <listitem><para>
+ Choose
+ <menuchoice>
+ <guimenu>File</guimenu>
+ <guimenuitem>Save Draft</guimenuitem>
+ </menuchoice>
+ to store your messages in the drafts folder for later
+ revision.
+ </para></listitem>
+
+ <listitem><para>
+ If you'd like to have the message sent later, you
+ can choose <guimenuitem>Send Later</guimenuitem>. That way,
+ the message will be added to the queue, and you can send a
+ batch of messages all at once.
+ </para></listitem>
+
+ <listitem><para>
+ If you prefer to save your message as a text file,
+ choose <guimenuitem>Save As</guimenuitem> and then choose a
+ file name.
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+ </sect2>
+
+ <sect2 id="usage-mail-getnsend-offline">
+ <title>Working Offline</title>
+ <para>
+ Offline mode is a tool designed for use with a dialup
+ connection or for laptop users who do not have a network
+ connection at all times. It allows you to cache messages
+ for reference while you are not connected to the
+ network, and to compose messages and leave them in your
+ Outbox to be sent the next time you connect to the network.
+ </para>
+ <para>
+ Select
+ <menuchoice><guimenu>File</guimenu><guimenuitem>Work
+ Offline</guimenuitem></menuchoice> to have
+ <application>Ximian Evolution</application> disconnect
+ from the Internet while you work. When you want to
+ reconnect, choose
+ <menuchoice><guimenu>File</guimenu><guimenuitem>Work
+ Online</guimenuitem></menuchoice>. Alternatively, you
+ can click the connection button at the bottom left side
+ of the window.
+ </para>
+ <para>
+ If you use POP mail, all your messages will be
+ available to you, because they are stored locally. If
+ you use IMAP or Exchange mail, messages are stored
+ remotely, so availability is a little different.
+ </para>
+ <para>
+ Messages that you have read are cached and stored
+ locally; all read messages will be available to you
+ even if you are offline. Unread messages will be
+ downloaded and saved for offline use if they are in a
+ folder that you have marked as an Offline Folder. To
+ mark a folder for offline use, select
+ <menuchoice><guimenu>Settings</guimenu>
+ <guimenuitem>Preferences</guimenuitem></menuchoice> and
+ then click the <guilabel>Folders</guilabel> icon. In
+ the <guilabel>Offline Folders</guilabel> tab, click the
+ check-box next to the folders that you would like to
+ use while you are offline. Then, when you select
+ <guimenuitem>Go Offline</guimenuitem>, Evolution will
+ fetch their contents and store them for later
+ reference.
+ </para>
+ </sect2>
+ <sect2 id="usage-mail-getnsend-send-compose">
+ <title>More About Mail Composition</title>
+ <para>
+ In the next few sections, you'll see how
+ <application>Evolution</application> handles advanced email
+ features, including large recipient lists, attachments, and
+ forwarding.
+ </para>
+ <sect3 id="usage-mail-getnsend-send-attach">
+ <title>Attachments</title>
+ <para>
+ To attach a file to your email:
+ <orderedlist numeration="arabic">
+ <listitem>
+ <para>
+ Push the attach button in the composer toolbar
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Select the file you want to attach
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Press <guibutton>OK</guibutton>
+ </para>
+ </listitem>
+ </orderedlist>
+ </para>
+ <para>
+ You can drag a file from your desktop into the composer window to
+ attach it as well.
+ </para>
+ <para>
+ To hide the display of files you've attached to the
+ message, select <menuchoice>
+ <guimenu>View</guimenu> <guimenuitem>Hide
+ Attachments</guimenuitem> </menuchoice>; to show them
+ again, choose <guimenuitem>Show Attachments</guimenuitem>.
+ </para>
+ <para>
+ When you send the message, a copy of the attached file
+ will go with it. Be aware that big attachments can take a
+ long time to download.
+ </para>
+ </sect3>
+
+ <sect3 id="usage-mail-getnsend-send-to-types">
+ <title>Specifying Recipients for Email</title>
+ <para>
+ <application>Evolution</application>, like most email
+ programs, recognizes three types of addressee: primary
+ recipients, secondary recipients, and hidden ("blind")
+ recipients.
+ </para>
+ <para>
+ The simplest way to direct a message is to put the email
+ address or addresses in the <guilabel>To:</guilabel>
+ field, which denotes primary recipients. To send mail to
+ more than one or two people, you can use the
+ <guilabel>Cc:</guilabel> field.
+ </para>
+ <para>
+ Hearkening back to the dark ages when people used
+ typewriters and there were no copy machines, "Cc" stands
+ for "Carbon Copy." Use it whenever you want to share a
+ message you've written to someone else.
+ </para>
+ <para>
+ <guilabel>Bcc:</guilabel> is a little more complex. You
+ use it like <guilabel>Cc:</guilabel>, but people on the
+ <guilabel>Bcc:</guilabel> list are hidden from the other
+ recipients of the message. Use it to send mail to large
+ groups of people, especially if they don't know each other
+ or if privacy is a concern. If your <guilabel>Bcc:</guilabel> field is absent, click
+ <menuchoice>
+ <guimenu>View</guimenu>
+ <guimenuitem>Bcc Field</guimenuitem>
+ </menuchoice>.
+
+ </para>
+
+ <para>
+ If you frequently write email to the same groups of people,
+ you can create address lists in the Contact Manager, and
+ then send them mail as though they had a single address.
+ To learn how to do that, read <xref
+ linkend="usage-contact-organize-group-list">.
+ </para>
+
+ <tip id="reply-to-per-mail">
+ <title>Setting Reply-to On a Per-Mail Basis</title>
+ <para>
+ <application>Evolution</application> has the ability to
+ let you specify the Reply-To in an email. Using this, you
+ can setup a special Reply-To for an email. To do this:
+ <orderedlist numeration="arabic">
+ <listitem>
+ <para>
+ Open a composer window
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Open the Reply-To field by selecting
+ <menuchoice>
+ <guimenu>View</guimenu>
+ <guimenuitem>Reply To</guimenuitem>
+ </menuchoice>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Enter the address you wish to have be the
+ Reply-To address in the new Reply-To field.
+ </para>
+ </listitem>
+ </orderedlist>
+ </para>
+ </tip>
+ </sect3>
+
+ <sect3 id="usage-mail-getnsend-send-to">
+ <title>Choosing Recipients Quickly</title>
+ <para>
+ If you have created address cards in the contact manager,
+ you can also enter nicknames or other portions of address
+ data, and <application>Evolution</application> will offer a
+ drop down list of possible address completions from your
+ address book. If you enter a name or nickname that can go
+ with more than one card, Evolution will open a dialog box to
+ ask you which person you meant.
+
+<!-- Also, <application>Evolution</application> will add a
+ domain to any unqualified addresses. By default, this is
+ your domain, but you can choose which one mail preferences
+ dialog. NOTE: Bug filed on this: it's not available now,
+ but may be in the future.
+-->
+
+ </para>
+
+ <para>
+ Alternately, you can click on the
+ <guibutton>To:</guibutton>, <guibutton>Cc:</guibutton>, or
+ <guibutton>Bcc:</guibutton> buttons to get a list --
+ potentially a very long one -- of the email addresses
+ in your contact manager. Select addresses and click on
+ the arrows to move them into the appropriate address
+ columns.
+ </para>
+ <para>
+ For more information about using email together with the
+ contact manager and the calendar, see <xref
+ linkend="contact-automation-basic"> and <xref
+ linkend="usage-calendar-apts">.
+ </para>
+ </sect3>
+ </sect2>
+
+ <sect2 id="usage-mail-getnsend-send-reply">
+ <title>Replying to Email Messages</title>
+ <para>
+ To reply to a message, press the
+ <guibutton>Reply:</guibutton> button while it is selected,
+ or choose <guimenuitem>Reply to Sender:</guimenuitem> from
+ the message's right-click menu. That will open the
+ <interface>message composer</interface>. The
+ <guilabel>To:</guilabel> and <guilabel>Subject:</guilabel>
+ fields will already be filled, although you can alter them
+ if you wish. In addition, the full text of the old message
+ is inserted into the new message, either grey (for
+ HTML display) or with the &gt; character before each line
+ (in plain text mode), to indicate that it's part of the
+ previous message. People often intersperse their message
+ with the quoted material as shown in <xref
+ linkend="usage-mail-getnsend-reply-fig">.
+
+ <!-- ==============Figure=================================== -->
+ <figure id="usage-mail-getnsend-reply-fig">
+ <title>Reply Message Window</title>
+ <screenshot>
+ <screeninfo>Evolution Main Window</screeninfo>
+ <mediaobject><imageobject><imagedata fileref="figures/replymsg" format="png" srccredit="Aaron Weber">
+ </imageobject></mediaobject>
+ </screenshot>
+ </figure>
+<!-- ==============End of Figure=================================== -->
+ </para>
+ <para>
+ If you're reading a message with several recipients, you may
+ wish to use <guibutton>Reply to All</guibutton> instead of
+ <guibutton>Reply</guibutton>. If there are large numbers
+ of people in the <guilabel>Cc:</guilabel> or
+ <guilabel>To:</guilabel> fields, this can save substantial
+ amounts of time.
+ <example>
+ <title>Using the Reply to All feature</title>
+ <para>
+ Susan sends an email to a client and sends copies to Tim
+ and to an internal company mailing list of co-workers.
+ If Tim wants to make a comment for all of them to read,
+ he uses <guibutton>Reply to All</guibutton>, but if he
+ just wants to tell Susan that he agrees with her, he
+ uses <guibutton>Reply</guibutton>. Note that his reply
+ will not reach anyone that Susan put on her
+ <guilabel>Bcc</guilabel> list, since that list is not
+ shared with anyone.
+ </para>
+ </example>
+ </para>
+ <para>
+ If you're subscribed to a mailing list, and want your reply
+ to go just to the list, rather than to the sender, choose
+ <guibutton>Reply to List</guibutton> instead of
+ <guibutton>Reply</guibutton> or <guibutton>Reply to
+ All</guibutton>.
+ <note>
+ <title>What is a Mailing List?</title>
+ <para>
+ Mailing Lists are one of the most popular tools for
+ group collaboration on the Internet. Here's how they work:
+ <simplelist>
+ <member>
+ Someone sends a message to a single address, like
+ <email>evolution@ximian.com</email>.
+ </member>
+ <member>
+ That address belongs to a program that distributes
+ the message to a list of recipients.
+ </member>
+ </simplelist>
+ The mail management program lets individuals subscribe
+ to or unsubscribe from the list at will, without
+ requiring the message writers to remember the addresses
+ of every recipient.
+ </para>
+ <para>
+ Mailing list servers can also let network administrators
+ control mail flow, list membership, and even moderate
+ the content of mailing lists.
+ </para>
+ </note>
+ </para>
+ </sect2>
+
+ <sect2 id="usage-mail-getnsend-send-find">
+ <title>Searching and Replacing with the Composer</title>
+ <para>
+ You are probably familiar with search and replace features
+ in any sort of text-editing software, and if you come from
+ a Linux or Unix background, you may know what
+ <guimenuitem>Find Regex</guimenuitem> does. If you aren't
+ among the lucky who already know, here's a quick rundown of
+ the automated text searching features that the message
+ composer makes available to you.
+ </para>
+ <para>
+ <variablelist>
+ <varlistentry>
+ <term><guimenuitem>Find:</guimenuitem></term>
+ <listitem><para> Enter a word or phrase, and
+ <application>Evolution</application> will find it
+ in your message.
+ </para></listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><guimenuitem>Find Regex:</guimenuitem></term>
+ <listitem>
+ <para>
+ Find a regex, also called a
+ <glossterm linkend="regular-expression">regular
+ expression</glossterm>, in your composer window.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><guimenuitem>Find Again:</guimenuitem></term>
+ <listitem><para>
+ Select this item to repeat the last search you performed.
+ </para></listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><guimenuitem>Replace:</guimenuitem></term>
+ <listitem><para>
+ Find a word or phrase, and replace it with
+ something else.
+ </para></listitem>
+ </varlistentry>
+
+ </variablelist>
+ </para>
+
+ <para>
+ For all of these menu items, you can choose whether or not
+ to <guilabel>Search Backwards</guilabel> in the document
+ from the point where your cursor is. For all but the
+ regular expression search (which doesn't need it), you are
+ offered a check box to determine whether the search is to
+ be <guilabel>Case Sensitive</guilabel> when it determines
+ a match.
+ </para>
+ </sect2>
+
+ <sect2 id="usage-mail-getnsend-send-html">
+ <title>Enhance your email with HTML</title>
+ <para>
+ Normally, you can't set text styles or insert pictures in
+ emails, which is why email is often regarded as
+ uncommunicative and cold, and why people often resort to
+ using far too many exclamation points to convey their
+ feelings. However, most newer email programs can display
+ images and text styles as well as basic alignment and
+ paragraph formatting. They do this with <glossterm
+ linkend="html">HTML</glossterm>, just like web pages do.
+ </para>
+ <note>
+ <title>HTML Mail is not a Default Setting</title>
+ <para>
+ Some people do not have HTML-capable mail clients, or
+ prefer not to receive HTML-enhanced mail because it is
+ slower to download and display. Because some people may
+ prefer not to get HTML mail,
+ <application>Evolution</application> sends plain text
+ unless you explicitly ask for HTML.
+ </para>
+ </note>
+
+ <para> You can change the format of an email message between
+ plain text and HTML by choosing <menuchoice>
+ <guimenu>Format</guimenu> <guimenuitem>
+ HTML</guimenuitem></menuchoice>.
+ </para>
+ <para>
+ To send all your mail as HTML by default, set your mail
+ format preferences in the mail configuration dialog. See
+ <xref linkend="config-prefs-mail-composer"> for more
+ information.
+ </para>
+ <para>
+ HTML formatting tools are located in the toolbar just above
+ the space where you'll actually compose the message, and
+ they also appear in the <guimenu>Insert</guimenu> and
+ <guimenu>Format</guimenu> menus.
+ </para>
+ <para>
+ The icons in the toolbar are explained in <glossterm
+ linkend="tooltip">tool-tips</glossterm>, which appear when
+ you hold your mouse over the buttons. The buttons fall
+ into four categories:
+ <variablelist>
+ <varlistentry>
+ <term>Headers and lists:</term>
+ <listitem>
+ <para>
+ At the left edge of the toolbar, you can choose
+ <guilabel>Normal</guilabel> for a default text style
+ or <guilabel>Header 1</guilabel> through
+ <guilabel>Header 6</guilabel> for varying sizes of
+ header from large (1) to tiny (6). Other styles
+ include <guilabel>preformat</guilabel>, to use the HTML
+ tag for preformatted blocks of text, and three types
+ of bullet points for the highly
+ organized.
+ </para>
+ <tip>
+ <title>Using Bullets to Make Your Email More
+ Attractive</title>
+ <para>
+ Often times, people use asterisks instead of real bullets.
+ Not only do asterisks look nicer, but
+ <application>Evolution</application> will word wrap for you,
+ which makes your text looks nicer.
+ </para>
+ </tip>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>Text style:</term>
+ <listitem>
+ <para>
+ Use these buttons to determine the way your letters
+ look. If you have text selected, the style will
+ apply to the selected text. If you do not have text
+ selected, the style will apply to whatever you type
+ next. The buttons are:
+ <itemizedlist mark="none">
+ <listitem><para>Push <guibutton>B</guibutton> for bold text</para></listitem>
+ <listitem><para>Push <guibutton>I</guibutton> for italics</para></listitem>
+ <listitem><para>Push <guibutton>U</guibutton> to underline</para></listitem>
+ <listitem><para>Push <guibutton>S</guibutton> for a strikethrough.</para></listitem>
+ </itemizedlist>
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>Alignment:</term>
+ <listitem>
+ <para>
+ Located next to the text style buttons, these three
+ paragraph icons should be familiar to users of most
+ word processing software. The leftmost button will
+ make your text aligned to the left, the center
+ button, centered, and the right hand button,
+ aligned on the right side.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term>Indentation rules:</term>
+ <listitem>
+ <para>
+ The button with the arrow pointing left will reduce
+ a paragraph's indentation, and the right arrow will
+ increase its indentation.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term>Color Selection:</term>
+ <listitem>
+ <para>
+ At the far right is the color section tool. The
+ colored box displays the current text color; to
+ choose a new one, click the arrow button just to the
+ right. If you have text selected, the color will
+ apply to the selected text. If you do not have text
+ selected, the color will apply to whatever you type
+ next. You can select a background color or image by
+ right-clicking on the message background and
+ selecting <guilabel>Page</guilabel>.
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </para>
+ <para>
+ The <guimenu>Insert</guimenu> gives you opinions which let you
+ spruce up your email to make it more interesting:
+ <variablelist>
+ <varlistentry>
+ <term><guimenuitem>Link:</guimenuitem></term>
+ <listitem>
+ <para>
+ Lets you link some text to a website. Use this tool to put hyperlinks in your HTML
+ messages. If you don't want special link text, you can just enter the address
+ directly, and <application>Evolution</application>
+ will recognize it as a link. To add a link:
+ <orderedlist numeration="arabic">
+ <listitem>
+ <para>
+ Select the text you wish to link from.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Right click on the text and click on <guibutton>Link</guibutton>.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Put the URL you want to use in the <guilabel>URL</guilabel> field.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Click <guibutton>OK</guibutton>.
+ </para>
+ </listitem>
+ </orderedlist>
+ </para>
+ <note>
+ <para>
+ If you're typing a web page address to be automatically formatted, keep in mind that a space terminates the link.
+ </para>
+ </note>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><guimenuitem>Image:</guimenuitem></term>
+ <listitem>
+ <para>
+ Lets you put an image alongside text.
+ </para>
+ <para>
+ To insert an image into your email:
+ <orderedlist numeration="arabic">
+ <listitem>
+ <para>
+ Open a new email by clicking <guibutton>New Message</guibutton>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Make sure that you have the
+ <menuchoice>
+ <guimenu>Format</guimenu>
+ <guimenuitem>HTML</guimenuitem>
+ </menuchoice>
+ selector checked.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Click the <guibutton>Insert Image</guibutton> button in the toolbar, or select
+ <menuchoice>
+ <guimenu>Insert</guimenu>
+ <guimenuitem>Image</guimenuitem>
+ </menuchoice>.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Choose your image by clicking the <guibutton>Browse</guibutton> button.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Press <guibutton>Insert</guibutton> to insert the image.
+ </para>
+ </listitem>
+ </orderedlist>
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><guimenuitem>Rule:</guimenuitem></term>
+ <listitem>
+ <para>
+ Inserts a horizontal line into the text to help divide two
+ sections.
+ </para>
+ <para>
+ To insert a rule:
+ <orderedlist numeration="arabic">
+ <listitem>
+ <para>
+ Open a new email by clicking <guibutton>New Message</guibutton>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Make sure that you have the
+ <menuchoice>
+ <guimenu>Format</guimenu>
+ <guimenuitem>HTML</guimenuitem>
+ </menuchoice>
+ selector checked.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Click the <guibutton>Rule</guibutton> button in the <guilabel>Toolbar</guilabel>.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Select the type of rule. You can use a plain
+ line, a 3D line, or a yellow line with flowers.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Choose the size of the line, as a percentage of the width of the email window.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ Choose the alignment and style. For the plain
+ line, you can choose the thickness of the line,
+ and whether it will be shaded, or solid. For the
+ other types, you can only choose alignment.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ Click <guibutton>Insert</guibutton> to insert the rule.
+ </para>
+ </listitem>
+ </orderedlist>
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>Table:</term>
+ <listitem>
+ <para>
+ Inserts a table into the text to help divide two
+ sections.
+ </para>
+ <para>
+ To insert a rule:
+ <orderedlist numeration="arabic">
+ <listitem>
+ <para>
+ Open a new email by clicking <guibutton>New Message</guibutton>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Make sure that you have the
+ <menuchoice>
+ <guimenu>Format</guimenu>
+ <guimenuitem>HTML</guimenuitem>
+ </menuchoice>
+ selector checked.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Click the <guibutton>Table</guibutton> button in the <guilabel>Toolbar</guilabel>.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Select the <guibutton>Template</guibutton> you wish to use. Each template has a slightly different feel and layout.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ If you so desire, you may change the other options such as: number of rows, columns, spacing of each cell, and more.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Click the <guibutton>Insert</guibutton> button.
+ </para>
+ </listitem>
+ </orderedlist>
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ To add a hyperlink to your HTML message:
+ <orderedlist numeration="arabic">
+ <listitem>
+ <para>
+ Select the text you want to display as a link.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Right click on text and select
+ <guimenuitem>Link</guimenuitem>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Enter the address you wish to link to in the
+ <guilabel>URL</guilabel> field.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Press <guibutton>OK</guibutton>.
+ </para>
+ </listitem>
+ </orderedlist>
+ </para>
+
+ <para>
+ To add an image to your HTML message:
+ <orderedlist numeration="arabic">
+ <listitem>
+ <para>
+ Select
+ <menuchoice>
+ <guimenu>Insert</guimenu>
+ <guimenuitem>Image</guimenuitem>
+ </menuchoice>.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Click <guibutton>Browse</guibutton> to select the image
+ you want to include in your email.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ Along the right side of the window, choose the alignment,
+ border, and other attributes of the image. If you change
+ the size attributes, the image will be shrunk or stretched
+ to fit the size you have chosen.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ If you would like to make the image a clickable link,
+ enter a URL in the <guilabel>Link</guilabel> tab of the
+ window.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ When you are finished, press
+ <guibutton>Insert</guibutton> to include the image in
+ your message.
+ </para>
+ </listitem>
+ </orderedlist>
+ </para>
+ <para>
+ You can insert an image into the background of your message by
+ right-clicking on the message background and selecting
+ <guimenuitem>Page</guimenuitem>. From that dialog, you may
+ also select background color and set other general options
+ about the HTML message you are composing.
+ </para>
+ <sect3 id="html-templates">
+ <title>HTML Templates</title>
+ <para>
+ <application>Evolution</application> not only allows you to
+ decorate your email with HTML text and graphics, but
+ provides you with prebuilt templates for you to use when
+ making these improvements. You can use these to emphasize a
+ point or frame an image in an attractive manner.
+ </para>
+ <para>
+ To include a template into your HTML based email:
+ <orderedlist numeration="arabic">
+ <listitem>
+ <para>
+ Create a new email by clicking <guibutton>New Message</guibutton>.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Make sure that the
+ <menuchoice>
+ <guimenu>
+ Format
+ </guimenu>
+ <guimenuitem>
+ HTML
+ </guimenuitem>
+ </menuchoice>
+ selector is checked.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Click the <guibutton>HTML Template</guibutton> button in the
+ <guilabel>Toolbar</guilabel> or select
+ <menuchoice>
+ <guimenu>
+ Insert
+ </guimenu>
+ <guimenuitem>
+ HTML Template
+ </guimenuitem>
+ </menuchoice>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Select the template type in the
+ <guilabel>Template</guilabel> selection box. Your
+ options are <guilabel>Note</guilabel> and
+ <guilabel>Image Frame</guilabel>.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Set the size and alignment of the HTML template.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ Click <guibutton>Insert</guibutton> to insert it where the
+ cursor is.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Click on the text in the template, and enter the text
+ you want to use.
+ </para>
+ <para>
+ If you have selected an image frame template,
+ right-click on the image and select
+ <guimenuitem>Image</guimenuitem> to select the image
+ you want to place in the frame.
+ </para>
+ </listitem>
+ </orderedlist>
+ </para>
+ </sect3>
+ <sect3 id="composer-tables">
+ <title>Tables in Email</title>
+ <para>
+ <application>Evolution</application> allows you to put
+ tables in your HTML email to help organize your thoughts.
+ These tables are a simplified version of what you might find
+ in a spreadsheet program like
+ <application>Gnumeric</application>.
+ </para>
+ <para>
+ To include a table in your email:
+ <orderedlist numeration="arabic">
+ <listitem>
+ <para>
+ Create a new email by clicking <guibutton>New Message</guibutton>.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Make sure you have the
+ <menuchoice>
+ <guimenu>
+ Format
+ </guimenu>
+ <guimenuitem>
+ HTML
+ </guimenuitem>
+ </menuchoice>
+ selector checked.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ Select
+ <menuchoice>
+ <guimenu>
+ Insert
+ </guimenu>
+ <guimenuitem>
+ Table
+ </guimenuitem>
+ </menuchoice>
+ or click the <guiicon>Table</guiicon> button in the
+ toolbar.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ Select the template, or style, you want to use for the
+ table.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Set the number of rows and columns you want.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Click the <guibutton>Insert</guibutton> button.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Click in a cell and type to insert text into the table.
+ </para>
+ </listitem>
+ </orderedlist>
+ </para>
+ <para>
+ You can also edit a table after creation. Just right-click
+ on it and select <guimenuitem>Table</guimenuitem> to open
+ the table editing window again. Or, you can select items
+ from the <guimenu>Table Delete</guimenu> and <guimenu>Table
+ Insert</guimenu> menus.
+ </para>
+
+ <para>
+ <tip id="table-tip">
+ <title>Deleting an Entire Table</title>
+ <para>
+ You can delete an entire table by right-clicking on
+ a table or other HTML object in a message, and selecting
+ <menuchoice>
+ <guimenu>Table Delete</guimenu>
+ <guimenuitem>Table</guimenuitem> </menuchoice>. In an
+ HMTL message, your signature, templates, and image
+ inclusions all have tables around them, and you can remove
+ them completely and quickly with this shortcut.
+ </para>
+ </tip>
+ </para>
+
+ </sect3>
+ </sect2>
+
+ <sect2 id="usage-mail-getnsend-fwd">
+ <title>Forwarding Mail</title>
+ <para>
+ The post office forwards your mail for you when you change
+ addresses, and you can forward a letter if it comes to you by mistake.
+ The email <guilabel>Forward</guilabel> button
+ works in much the same way. It's particularly useful if you
+ have received a message and you think someone else would
+ like to see it. You can forward a message as an attachment
+ to a new message (this is the default) or
+ you can send it <glossterm linkend="inline">inline</glossterm> as a quoted
+ portion of the message you are sending. Attachment
+ forwarding is best if you want to send the full, unaltered
+ message on to someone else. Inline forwarding is best if
+ you want to send portions of a message, or if you have a
+ large number of comments on different sections of the
+ message you are forwarding. Remember to note from whom the
+ message came, and where, if at all, you have removed or
+ altered content.
+ </para>
+ <para>
+ To forward a message you are reading, press
+ <guibutton>Forward</guibutton> on the toolbar, or select
+ <menuchoice> <guimenu>Message</guimenu>
+ <guimenuitem>Forward</guimenuitem> </menuchoice>. If you
+ prefer to forward the message <glossterm linkend="inline">inline</glossterm>
+ instead of attached, select <menuchoice>
+ <guimenu>Message</guimenu> <guimenuitem>Forward
+ Inline</guimenuitem> </menuchoice> from the menu. Choose an
+ addressee as you would when sending a new message; the
+ subject will already be entered, but you can alter it.
+ Enter your comments on the message in the
+ <interface>composition frame</interface>, and press
+ <guibutton>Send</guibutton>.
+ </para>
+ </sect2>
+
+ <sect2 id="usage-mail-getnsend-ettiquette">
+ <title>Seven Tips for Email Courtesy</title>
+ <para>
+
+ <itemizedlist>
+
+ <listitem>
+ <para>
+ Don't send spam or forward chain mail. If you must,
+ watch out for hoaxes and urban legends, and make sure
+ the message doesn't have multiple layers of
+ greater-than signs, (&gt;) indicating multiple layers
+ of careless in-line forwarding.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ Always begin and close with a salutation. Say "please"
+ and "thank you," just like you do in real life. You
+ can keep your pleasantries short, but be pleasant!
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ WRITING IN CAPITAL LETTERS MEANS YOU'RE SHOUTING!
+ Don't write a whole message in capital letters. It
+ hurts people's ears.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ Check your spelling and use complete sentences. By
+ default, <application>Evolution</application> will put
+ a red line beneath words it doesn't recognize, as you
+ type them.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ Don't send nasty emails (flames). If you get one,
+ don't write back.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ When you reply or forward, include just enough of
+ the previous message to provide context: not too
+ much, not too little.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ Don't send spam.
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+ </sect2>
+ <sect2 id="fancy-mail">
+ <title>Making Your Email More Fancy</title>
+ <para>
+ <application>Evolution</application> can do a lot with email
+ by utilizing the HTML features. Making an email functional
+ and visually attractive can be challenging. The following
+ section provides tips to make your mail functional, while
+ being more visually attractive than ever.
+ </para>
+ <sect3 id="sections-bolded-title">
+ <title>Sections Outlined in Bold</title>
+ <para>
+ Indented sections are a great way to categorize and group
+ your thoughts together. Below is an example of indented
+ text with headings to help separate your thoughts into the
+ proper sections:
+ <figure>
+ <title>Indented Text with Headlines</title>
+ <screenshot>
+ <screeninfo></screeninfo>
+ <graphic format="png" fileref="figures/outline" srccredit="Kevin Breit">
+ </screenshot>
+ </figure>
+ </para>
+ <para>
+ This message is not only more attractive, but more
+ informative. Each section is broken down into subsections.
+ The title for each section is in bold text, with the
+ following content indented.
+ </para>
+ <para>
+ You may want to increase the size of your section headlines
+ instead of merely putting them in bold. Header size 4 is
+ often the best choice, since it is not too large. You can
+ change your text to size 4 by selecting it and pressing
+ Ctrl+4. You can set your text to the normal text size by
+ hitting Ctrl+0.
+ </para>
+ </sect3>
+ <sect3 id="bulleted-lists">
+ <title>Bulleted Lists</title>
+ <para>
+ Select the <guimenuitem>Bulleted List</guimenuitem> option
+ from the text style drop-down box to begin making a bulleted
+ list. <application>Evolution</application> will handle the
+ word wrap and indentation for you. If you prefer to send
+ the message in plain text, you can still write it up in
+ HTML, and <application>Evolution</application> will convert
+ to a well-formed plain-text bulleted list, using asterisks
+ instead of HTML bullets.
+ </para>
+ </sect3>
+ <sect3 id="inline-images">
+ <title>Images In Your Email</title>
+ <para>
+ Images can help people to understand your point. You can
+ even use a HTML Picture Frame Template in
+ <application>Evolution</application>, which looks very
+ attractive and sets your image off from the rest of your
+ message with a border and caption.
+ </para>
+ <para>
+ If you do choose to use images, try to keep them narrow. If
+ your images are wider than 400 pixels, the image may not fit
+ in the whole email window, making it hard for your reader to
+ read the email and view the image. Consider using a smaller
+ version ("thumbnail") of your image, and offering a link to
+ the larger version your readers can view in a web browser if
+ they want.
+ <figure>
+ <title>Images in an email</title>
+ <screenshot>
+ <screeninfo></screeninfo>
+ <graphic format="png" fileref="figures/small_desktop" srccredit="Kevin Breit">
+ </screenshot>
+ </figure>
+ </para>
+ </sect3>
+ <sect3 id="color-suggestions">
+ <title>Coloring Your Text</title>
+ <para>
+ Colors can help bring words or sentences out for emphasis. You
+ should choose your colors carefully though, as the wrong color
+ can be distracting. Some good colors to use would be:
+ <itemizedlist>
+ <listitem>
+ <para>
+ Light brown
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Dull purple
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Dark red
+ </para>
+ </listitem>
+ </itemizedlist>
+ <!-- Include a screenshot -->
+ Notice how these colors are similar saturation <!-- Confirm I am using the right word -->
+ </para>
+ <para>
+ Happy mailing!
+ </para>
+ </sect3>
+ </sect2>
+ </sect1>
+ <sect1 id="rsvp-stuff">
+ <title>RSVPs in Mail</title>
+ <para>
+ If you create an event in the calendar component, you can then
+ send invitations to the attendee list through the
+ <application>Ximian Evolution</application> email tool. The
+ invitation card is sent as an attachment in iCal format.
+ </para>
+ <para>
+ If you click on the attachment button and click the
+ <guibutton>View Inline</guibutton>, <application>Ximian
+ Evolution</application> will show you information about the
+ meeting, and let you respond to the meeting in several ways.
+ Select the response that you would like, and then click the
+ <guibutton>OK</guibutton> button.
+ </para>
+ <para>
+ Your options are:
+ <variablelist>
+ <varlistentry>
+ <term>Accept:</term>
+ <listitem>
+ <para>
+ Select this entry if you will attend the meeting. When you
+ click the <guibutton>OK</guibutton> button, the meeting will
+ be entered into your calendar.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term>Tentatively Accept:</term>
+ <listitem>
+ <para>
+ Select this entry if you will probably attend the meeting.
+ When you click the <guibutton>OK</guibutton> button, the
+ meeting will be entered into your calendar, but marked as
+ tentative.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term>Decline:</term>
+ <listitem>
+ <para>
+ Select this item if you will be unable to attend the
+ meeting. The meeting will not be entered into your calendar
+ when you click the <guibutton>OK</guibutton>, although your
+ response will be sent to the meeting host if you have
+ checked the <guilabel>RSVP</guilabel> box.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term>RSVP:</term>
+ <listitem>
+ <para>
+ Check this box if you would like your response sent to
+ the meeting organizers.
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </para>
+ </sect1>
+
+ <sect1 id="usage-mail-subscriptions">
+ <title>Subscription Management</title>
+ <para>
+ Since IMAP folders exist on the server, and opening them or
+ checking them takes time, you need fine-grained control over the
+ way that you use IMAP folders. That's why
+ <application>Evolution</application> has an IMAP subscriptions
+ manager. If you prefer to have every mail folder displayed, you
+ can select that option as well. However, if you'd like to choose
+ specific items in your mailbox, and exclude others, you can use
+ the subscription management tool to do that.
+ </para>
+ <para>
+ Here's how:
+ <orderedlist numeration="arabic">
+
+ <listitem>
+ <para>
+ Select
+ <menuchoice><guimenu>Tools</guimenu><guimenuitem>Subscribe
+ to Folders</guimenuitem></menuchoice>.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ If you have accounts on multiple IMAP servers, select the
+ server where you'd like to manage your
+ subscriptions. <application>Evolution</application> will
+ display a list of available files and folders.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ Select a file or folder by clicking on it. You will want
+ to select at least the <guilabel>INBOX</guilabel>
+ folder. Depending upon the way your IMAP server is
+ configured, the list of available files may include
+ non-mail folders. If it does, you can ignore them.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ Click the <guibutton>Subscribe</guibutton> to add it to
+ the subscribed list.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ When you have subscribed to the folders you want, close
+ the window.
+ </para>
+ </listitem>
+ </orderedlist>
+ </para>
+ </sect1>
+
+ <sect1 id="encryption">
+ <title>Encryption</title>
+ <sect2 id="encryption-whatis">
+ <title>What is Encryption?</title>
+ <para>
+ Encryption is an ancient method of keeping information safe
+ from prying eyes. <application>Evolution</application> helps
+ you you protect your privacy by using
+ <application>gpg</application>, an implementation of strong
+ <glossterm linkend="public-key-encryption">Public Key
+ Encryption.</glossterm>
+ </para>
+
+ <note id="pub-priv">
+ <title>Public Key? Private Key? What is the difference?</title>
+ <para>
+ GPG uses two keys: public and private. You can give your
+ public key to anyone you want to receive
+ encrypted messages, or put it on a public key server so
+ that people can look it up before contacting you.
+ <emphasis>Never give your private key to anyone,
+ ever</emphasis>. Your private key lets you decrypt any
+ message encrypted with your public key.
+ </para>
+ </note>
+
+ <para>
+ Using encryption takes a bit of forethought. When you send a
+ message that is encrypted, you must encrypt it using your
+ intended recipient's public key. To <emphasis>get</emphasis>
+ an encrypted message, you must make sure that the sender has
+ your public key in advance. For signing messages, it's
+ reversed: you encrypt the signature with your private key, so
+ only your public key can unlock it. When you send it, the
+ recipient gets your public key and unlocks the signature,
+ verifying your identity.
+ </para>
+
+ <para>
+ You can use encryption in two different ways:
+ <simplelist>
+ <member>
+ Encrypt the entire message, so that nobody but the recipient can read it.
+ </member>
+ <member>
+ Attach an encrypted signature to a plain text message, so
+ that the recipient can read the message without decrypting
+ it, and only needs decryption to verify the sender's
+ identity.
+ </member>
+ </simplelist>
+ </para>
+
+ <example>
+ <title>Sending an Encrypted Message</title>
+ <para>
+ Kevin wants to send an encrypted message to his friend
+ Rachel. He looks up her public key on a general key
+ server, and then tells
+ <application>Evolution</application> to encrypt the
+ message. The message now reads "@#$23ui7yr87#@!48970fsd."
+ When the information gets to Rachel, she decrypts it using
+ her private key, and it appears as plain text for her to
+ read.
+ </para>
+ </example>
+ <tip id="always-sign">
+ <title>Always Sign</title>
+ <para>
+ You can set <application>Evolution</application> to always sign your email messages:
+ <orderedlist numeration="arabic">
+ <listitem>
+ <para>
+ Open your account preferences.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Open the <guilabel>Security</guilabel> tab.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Click the <guibutton>Always sign outgoing messages when using this account</guibutton> button.
+ </para>
+ </listitem>
+ </orderedlist>
+ </para>
+ </tip>
+ </sect2>
+
+
+
+ <sect2 id="encryption-keygen">
+ <title>Making Encryption Keys</title>
+ <para>
+ Before you can get or send encrypted mail, you need to
+ generate your public and private keys with GPG. Here's how:
+ </para>
+ <tip>
+ <title>GPG Versions</title>
+ <para>
+ This manual covers version 1.0.6 of GPG. If your version is
+ different, this may not be entirely accurate. You may find
+ out your version number by typing in: <command>gpg
+ --version</command>.
+ </para>
+ </tip>
+ <para>
+ <orderedlist numeration="arabic">
+ <listitem>
+ <para>
+ Open a terminal and type <command>gpg --gen-key</command>.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ Choose the default algorithm, "DSA and ElGamal."
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ Choose a key length. The default, 1024 bits, should be
+ long enough.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ Decide if you want your key to expire automatically, and if so, when.
+ </para>
+ </listitem>
+
+
+ <listitem>
+ <para>
+ Enter your name, email address, and any additional
+ personal information you think is appropriate. Do not
+ falsify this information, because it will be needed to
+ verify your identity later on.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ Next, enter your passphrase. It does not have to be the
+ same as your email password or your login password. In
+ fact, it probably shouldn't. Don't forget it. If you lose
+ it, your keys will be useless and you will be unable to
+ decrypt messages sent to you with those keys.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ Now, GPG will generate your keys. This may take awhile,
+ so feel free to do something else while it's
+ happening. In fact, using your computer for something
+ else actually helps to generate better keys, because it
+ increases the randomness in the key generation seeds.
+ </para>
+ </listitem>
+ </orderedlist>
+ </para>
+ <para>
+ Once the keys are generated, you can view your key information
+ by typing <command>gpg --list-keys</command>. You should see
+ something similar to this:
+ <programlisting>
+ /home/you/.gnupg/pubring.gpg
+ ----------------------------
+ pub 1024D/32j38dk2 2001-06-20 you &lt;you@your-address.com&gt;
+ sub 1024g/289sklj3 2001-06-20 [expires: 2002-11-14]
+ </programlisting>
+ </para>
+ <para>
+ GPG will create one list, or keyring, for your public keys
+ and one for your private keys. All the public keys you know
+ are stored in the file
+ <filename>~/.gnupg/pubring.gpg</filename>. If you want to
+ give other people your key, send them that file.
+ </para>
+ <para>
+ If you wish, you can upload your keys to a key server. Here's
+ how:
+ <orderedlist>
+ <listitem>
+ <para>
+ Check your public key ID with <command>gpg
+--list-keys</command>. It will be the string after 1024D on the line
+beginning with "pub." In this example, it's 32j38dk2.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Enter the command <command>gpg --send-keys --keyserver
+wwwkeys.pgp.net 32j38dk2</command>. Substitute your key ID for
+32j38dk2. You will need your password to do this.
+ </para>
+ </listitem>
+ </orderedlist>
+
+ <note id="why-keyserver">
+ <title>Why Use a Key Server?</title>
+ <para>
+ Key servers store your public keys for you so that your
+ friends can decrypt your messages. If you choose not to
+ use a key server, you can manually send your people public
+ key, include it in your signature file, or put it on your
+ own web page. However, it's easier to publish them once,
+ and then let people download them from the server when
+ they want.
+ </para>
+ <para>
+ If you don't have a key you need to unlock or encrypt a
+ message, you can have your encryption tool set to look it
+ up automatically. If it can't find the key, then you'll
+ get an error message.
+ </para>
+ </note>
+
+ </para>
+ </sect2>
+
+ <sect2 id="encrypt-getting-key">
+ <title>Getting and Using Public Keys</title>
+ <para>
+ To encrypt a message to your someone else you'll need to use
+ their public key in combination with your private key.
+ <application>Evolution</application> does that for you, but
+ you still need to get their key and add it to your keyring.
+ </para>
+ <para>
+ To get public keys from a public key server, enter the
+ command:
+ <command>
+ gpg --recv-keys --keyserver wwwkeys.pgp.net keyid
+ </command>, substituting "keyid" for your recipient's ID. You
+ will need to type in your password, and then their ID will
+ automatically be added to your keyring. When you send mail to
+ them, <application>Evolution</application> will allow you to
+ encrypt your messages.
+ </para>
+ <para>
+ If someone sends you their public key directly, save it as a
+ plain text file and enter the command <command>gpg
+ filename</command>. This will add it to your keyring.
+ </para>
+ </sect2>
+
+ <sect2 id="encrypt-evo-integ">
+ <title>Setting up Evolution's Encryption</title>
+ <para>
+ You'll need to open
+ <menuchoice>
+ <guimenu>Tools</guimenu>
+ <guimenuitem>Settings</guimenuitem>
+ </menuchoice>
+ and select the <guilabel>Mail Accounts</guilabel> button, then
+ select the account you want to use securely, and click the
+ <guibutton>Edit</guibutton> button. Then, select the
+ <guilabel>Security</guilabel> tab in the account dialog. In the
+ <guilabel>Security</guilabel> tab is a section labeled
+ <guilabel>Pretty Good Privacy</guilabel>. Enter your key ID
+ and click <guibutton>OK</guibutton>. Your key is now
+ integrated into your identity in
+ <application>Evolution</application>.
+ </para>
+ <note>
+ <title>What is my Key ID again?</title>
+ <para>
+ <application>Evolution</application> requires that you know your key ID. If you don't remember it, you can find it by typing <command>gpg --list-keys</command> in a console window. Your key ID will be an eight character string with random numbers and letters.
+ </para>
+ </note>
+ </sect2>
+
+ <sect2 id="encrypt-sending">
+ <title>Sending Encrypted Messages</title>
+ <para>
+ As you know, you can use encryption to hide the entire
+ message, or just to verify your signature. Once you've
+ generated your public and private keys, and have the public
+ keys of the people to whom you want to send mail, here's what
+ to do:
+ </para>
+ </sect2>
+
+ <sect2 id="sign-msg">
+ <title>Signing a Message</title>
+ <para>
+ To sign a message, choose:
+ <menuchoice>
+ <guimenu>Security</guimenu>
+ <guimenuitem>PGP Sign</guimenuitem>
+ </menuchoice>
+ . You will be prompted for your PGP password. Once you enter it,
+ click <guibutton>OK</guibutton> and your message will be signed.
+ </para>
+ </sect2>
+
+ <sect2 id="encrypt-msg">
+ <title>Encrypting a Message</title>
+ <para>
+ Encrypting a message is very similar to signing a message.
+ Just choose the menu item
+ <menuchoice>
+ <guimenu>Security</guimenu>
+ <guimenuitem>PGP Encrypt</guimenuitem>
+ </menuchoice>
+ </para>
+ </sect2>
+ <sect2 id="unencrypting">
+ <title>Unencrypting a Received Message</title>
+ <para>
+ If you get an encrypted message, you will need to decrypt it
+ before you read it. Remember, the sender has to have your
+ public key before they can send you an encrypted message.
+ </para>
+ <para>
+ When you view the message,
+ <application>Evolution</application> will ask you for your
+ PGP password. Enter it, and the message will be displayed
+ properly.
+ </para>
+ </sect2>
+ </sect1>
+</chapter>
diff --git a/help/C/usage-mainwindow.sgml b/help/C/usage-mainwindow.sgml
new file mode 100644
index 0000000000..d513154fc1
--- /dev/null
+++ b/help/C/usage-mainwindow.sgml
@@ -0,0 +1,1509 @@
+<chapter id="usage-mainwindow">
+
+ <title>Getting Started with Ximian Evolution</title>
+
+ <sect1 id="what">
+ <title>What is Ximian Evolution, and What Can It Do for Me?</title>
+ <para>
+ Information is useless unless it's organized and accessible;
+ it's hardly even worth the name if you can't look at it and be
+ <emphasis>informed</emphasis>. The goal of
+ <application>Ximian Evolution</application> is to make the
+ tasks of storing, organizing, and retrieving your personal
+ information easier, so you can work and communicate with
+ others. That is, it's a highly evolved <glossterm
+ linkend="groupware">groupware</glossterm> program, an integral
+ part of the Internet-connected desktop.
+ </para>
+ <para>
+ In other words, <application>Ximian Evolution</application> is
+ a tool to help you get your work done.
+ </para>
+ <para>
+ <application>Ximian Evolution</application> is Free Software.
+ The program and its source code are released under the terms
+ of the <xref linkend="apx-gpl"> (GPL) and the documentation
+ falls under the <xref linkend="apx-fdl"> (FDL). For more
+ information about the GPL and the FDL, visit the Free Software
+ Foundation's website at <ulink
+ url="http://www.fsf.org">http://www.fsf.org</ulink>.
+ </para>
+
+ <para>
+ <application>Ximian Evolution</application> can help you work in a
+ group by handling email, address and other contact
+ information, and one or more calendars. It can do that on one
+ or several computers, connected directly or over a network,
+ for one person or for large groups.
+ </para>
+
+ <para>
+ With <application>Ximian Evolution</application>, you can
+ accomplish your most common daily tasks faster. For example, it
+ takes only one or two clicks to enter an appointment or an
+ address card sent to you by email, or to send email to a contact
+ or appointment. <application>Ximian Evolution</application>
+ makes displays faster and more efficient, so searches are faster
+ and memory usage is lower. People who get lots of mail will
+ appreciate advanced features like <link
+ linkend="usage-mail-organize-vFolders"><trademark>VFolders</trademark></link>,
+ which let you save searches as though they were ordinary mail
+ folders.
+ </para>
+ </sect1>
+
+ <sect1 id="usage-mainwindow-starting">
+ <title>The First Time you Start Ximian Evolution</title>
+ <para>
+ To start <application>Ximian Evolution</application>, do either
+ of the following:
+ <itemizedlist>
+ <listitem>
+ <para>
+ Select <menuchoice><guimenu>Programs</guimenu>
+ <guimenuitem>Evolution</guimenuitem> </menuchoice> from your
+ menu panel.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ Type <command>evolution</command> at the command line.
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+
+ <para>
+ <note>
+ <title>Command Line Options</title>
+ <para>
+ Evolution has a number of command-line options that you may
+ wish to make use of. You can find the full list by running
+ the commands <userinput>man evolution</userinput> or
+ <userinput>evolution --help</userinput>. The most
+ important ones are:
+ <itemizedlist>
+ <listitem>
+ <para>
+ To start Evolution in offline mode: <userinput>evolution --offline</userinput>
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ To start Evolution and begin composing a message to the email address you name: <userinput>evolution mailto:joe@somewhere.net</userinput>
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ To make your web browser use Evolution as the default email client, enter <userinput>evolution "%s"</userinput> as the email handler in your web browser or in the GNOME Control Center.
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+ </note>
+ </para>
+ <para>
+ The first time you run the program, it will create a directory
+ called <filename>evolution</filename> in your home directory,
+ where it will store all of its local data. Then, it will open a
+ first-run assistant to help you set up mail accounts and import
+ data from other applications.
+ </para>
+ <para>
+ Using the first-run assistant will take approximately two to
+ five minutes.
+ </para>
+
+ <sect2 id="first-step">
+ <title>Defining Your Identity</title>
+ <para>
+ The Identity window is the first step in the assistant. Here,
+ you will enter some basic personal information. You can
+ define multiple identities later on with the
+ <menuchoice><guimenu>Tools</guimenu>
+ <guimenuitem>Configure</guimenuitem></menuchoice> tool and
+ clicking the <guibutton>Mail Accounts</guibutton> button.
+ <itemizedlist>
+ <listitem>
+ <para>
+ Full Name: Your full name (Example: John Doe).
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Email Address: Your email address (Example: john@doe.com)
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Organization: The company where you work, or the
+ organization you represent when you send email
+ (optional).
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+ </sect2>
+
+ <sect2 id="second-step">
+ <title>Receiving Email</title>
+ <para>
+ The <guilabel>Receiving Email</guilabel> lets you determine
+ which you will get your email.
+ <itemizedlist>
+ <listitem>
+ <para>
+ Server Type: There are numerous types of servers
+ from which <application>Ximian Evolution</application>
+ can fetch your mail. Ask your system administrator if
+ you're not sure which of the following are available to
+ you:
+ <itemizedlist>
+
+ <listitem>
+ <para>
+ POP: Downloads your email to your hard disk for
+ permanent storage.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Microsoft Exchange: Available only if you have
+ purchased the Ximian Connector for Microsoft
+ Exchange, this will allow you to connect to a
+ Microsoft Exchange 2000 server, which stores
+ email, calendar, and contact information on the
+ server.
+ </para>
+ </listitem>
+
+
+ <listitem>
+ <para>
+ IMAP: Keeps the email on your server so you can
+ access your email from multiple systems.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ Standard Unix mbox spools: If you want
+ to read and store mail in the mail spool on your
+ local system, choose this option. You'll need to
+ provide the path to the mail spool
+ you want to use.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ Maildir format mail directories: If you download
+ your mail using qmail or another maildir-style
+ program, you'll want to use this option. You'll need
+ to provide the path to the mail directory you want to
+ use.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ MH format mail directories: If you download your
+ mail using mh or another MH-style program, you'll
+ want to use this option. You'll need to provide
+ the path to the mail directory you want to use.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ Local Delivery: Choose this option if you want to
+ move mail from the spool and store it in your home
+ directory. If you would rather leave mail in your
+ system's spool files, choose the
+ <guimenuitem>Standard Unix mbox
+ spools</guimenuitem> option instead. You'll need
+ to provide the path to the mail spool you want to
+ use.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ Directory Tree of mbox files: If you wish to use a
+ directory tree full of mbox files, select this
+ option and enter the directory you wish to
+ use. This option is useful if you wish to use pine
+ or other email clients at the same time as
+ Evolution, while storing mail on your local system
+ in mbox format.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ None: Select this if you do not plan to
+ check mail with this account.
+ </para>
+ </listitem>
+ </itemizedlist>
+
+ </para>
+ </listitem>
+ </itemizedlist>
+</para>
+ <para>
+ If you selected POP, Microsoft Exchange, or IMAP as your mail
+ server, you'll need to enter some more information:
+
+ <itemizedlist>
+ <listitem>
+ <para>The host name of your mail server. Ask
+ your system administrator if you're not
+ sure.</para>
+ </listitem>
+
+ <listitem>
+ <para>The username for the account on that
+ system. </para>
+ </listitem>
+
+ <listitem>
+ <para>Whether you want to use a secure (SSL)
+ connection. If your server supports it, it's
+ best to enable this security option.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>The authentication options supported by
+ your server. If you're not sure, click the
+ <guilabel>Check for supported types</guilabel>
+ button or ask your system administrator.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>Whether you'd like Evolution to remember
+ your password.
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+ <para>
+ <tip id="exchange-info">
+ <title>Ximian Evolution Talk to Microsoft Exchange?</title>
+ <para>
+ If you have purchased Ximian Connector for Microsoft
+ Exchange, you can access Microsoft Exchange 2000 servers
+ natively. If you do not have the Connector, or if you use
+ an older version of Microsoft Exchange, talk to your system
+ administrator about access to standard protocol services
+ like POP and IMAP.
+ </para>
+ </tip>
+</para>
+ </sect2>
+ <sect2 id="more-mail-options">
+ <title>More Mail Configuration Options</title>
+ <para>
+ There are more extensive options for mail preferences,
+ especially if you've chosen POP, Microsoft Exchange, or IMAP
+ as incoming mail server type. If you want to set these
+ options after you've created the account, you can select
+ <menuchoice><guimenu>Tools</guimenu> <guimenuitem>Configure
+ </guimenuitem></menuchoice>, click the <guibutton>Mail
+ Accounts</guibutton> button. Then, select the account you want
+ to change and click <guibutton>Edit</guibutton>. See <xref
+ linkend="config-prefs-mail"> for details.
+ </para>
+ <variablelist>
+ <varlistentry>
+ <term>If you chose POP mail:</term>
+ <listitem><para>
+ <itemizedlist>
+ <listitem>
+ <para>Checking for new mail: If you would like
+ <application>Evolution</application> to check for new mail
+ automatically, check the box and select a frequency in
+ minutes.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ Message Storage: If you'd like to store copies of your
+ mail on the server, check this option.
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>If you chose Microsoft Exchange:</term>
+ <listitem><para>
+ <itemizedlist> <listitem>
+ <para>Checking for new mail: If you would like
+ <application>Evolution</application> to check for new mail
+ automatically, check the box and select a frequency in
+ minutes.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>Mailbox Name is Different from Login Name: If your active directory user name
+ is different from your Exchange mailbox name, check this
+ box and enter your mailbox name here.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Override Outlook Web Access Path: In most cases,
+ the URL for web access is
+ "http://server.company.com/exchange." If your
+ system has a path that is not "exchange," check
+ the box and enter the custom path here.
+ </para>
+ </listitem>
+ <listitem>
+ <para>Create a Global Address List folder: If you want to
+ use your organization's Active Directory or Global Address
+ List, leave this box checked. </para>
+ </listitem>
+ <listitem>
+ <para>
+ Active Directory Server Name: Enter the Active Directory
+ server name here.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>Limit number of Responses: Select a maximum number
+ of results for an address search. A maximum number of
+ results limits the load on your system and on your network.
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>If you chose IMAP:</term>
+ <listitem>
+ <para>
+ <itemizedlist>
+ <listitem>
+ <para>Checking for new mail: If you would like
+ <application>Evolution</application> to check for new mail
+ automatically, check the box and select a frequency in
+ minutes.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>If you want <application>Evolution</application>
+ to check for new messages in <emphasis>all</emphasis> your
+ IMAP folders, make sure the <guilabel>Check for new
+ messages in all folders</guilabel> box is selected.</para>
+ </listitem>
+
+ <listitem>
+ <para>Show only subscribed folders: Check this box if you
+ have more folders in your IMAP view than you want to
+ read.</para>
+ </listitem>
+
+ <listitem>
+ <para>
+ Override server-supplied namespace: If you like, enter a
+ specific directory where your server stores mail for
+ you. Typical values are "mail" and "Mail." For more
+ information about how to use IMAP mail, see <xref
+ linkend="usage-mail-subscriptions">.</para>
+ </listitem>
+
+ <listitem>
+ <para>Apply filters to new messages in INBOX on this
+ server: If you'd like your filters to work on this account
+ as well as on locally downloaded mail, check this box.</para>
+ </listitem>
+ </itemizedlist>
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+
+ <note id="imap-namespace">
+ <title>What's an IMAP Namespace?</title>
+ <para>
+ For IMAP mail servers, your sysadmin may provide
+ you with a specific namespace, the directory on
+ where your server stores mail for you. If you
+ check your IMAP mail and your folder list includes
+ files that don't look like mail folders, you
+ probably need to change your mail
+ namespace. Typical values are "mail" and "Mail."
+ If you prefer, you can choose to subscribe to
+ individual mail folders one at a time. For more
+ information about how to use IMAP mail, see <xref
+ linkend="usage-mail-subscriptions">.
+ </para>
+ </note>
+
+ </sect2>
+
+ <sect2 id="third-step">
+ <title>Sending Email</title>
+ <para>
+ The <guilabel>Sending Email</guilabel> step lets you configure sending
+ email.
+ <itemizedlist>
+ <listitem>
+ <para>
+ Server Type: There are numerous server types that
+ <application>Ximian Evolution</application> supports for sending your
+ mail.
+ <itemizedlist>
+ <listitem>
+ <para>
+ SMTP: Sends mail directly from your system.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ Microsoft Exchange: Sends mail through a Microsoft
+ Exchange server using the Microsoft Exchange 2000
+ protocol. Available only if you have are using the
+ Ximian Connector for Microsoft Exchange. You must
+ have a valid license key purchased from <ulink
+ url="http://store.ximian.com">store.ximian.com</ulink>.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ Sendmail: Uses the Sendmail program to send mail
+ from your system. Sendmail is more flexible, but
+ is not as easy to configure, so you should only
+ select this option if you know how to set up a
+ Sendmail service.
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Host: If you chose <guilabel>SMTP</guilabel> or
+ <guilabel>Microsoft Exchange</guilabel>, enter the
+ server's name or IP address here.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Server requires authentication: If your server
+ requires you to enter a password to send mail, check
+ this box.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Authentication Type: Unless you've been told otherwise,
+ your best bet is to leave this set at
+ <guilabel>Password</guilabel>. If you're not sure, ask
+ your system administrator or ISP, or have
+ <application>Ximian Evolution</application> check for
+ you by clicking <guibutton>Check for supported
+ types</guibutton>.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Username: The account name you use when you login to
+ check your email. Normally, this is the part of your
+ email address before the '@' character. For Exchange
+ servers, it is the username you would use to log in to a
+ Windows workstation at your company.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Remember Password: If you prefer to not enter
+ your password every time you check email, press this
+ button.
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+ </sect2>
+
+ <sect2 id="fourth-step">
+ <title>Importing Mail (Optional)</title>
+ <para>
+ If <application>Ximian Evolution</application> finds mail or
+ address files from another application, it will offer to
+ import them. If you're not sure which file format your mail
+ program uses, ask your system administrator. If you want, you
+ can skip this step and return to it at a later time by
+ selecting
+ <menuchoice><guimenu>File</guimenu><guimenuitem>Import</guimenuitem></menuchoice>.
+ </para>
+ <para>
+ <application>Ximian Evolution</application> can import the following types of
+ files:
+ <variablelist>
+ <varlistentry>
+ <term>VCard (.vcf, gcrd):</term>
+ <listitem>
+ <para>
+ The addressbook format used by the GNOME, KDE, and
+ many other contact management applications. You
+ should be able to export to VCard format from any
+ address book application.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term>Microsoft Outlook Express 4 (.mbx):</term>
+ <listitem>
+ <para>
+ Email file format used by Microsoft Outlook Express
+4. For other versions of Microsoft Outlook and Outlook Express, see
+the workaround described in the note below.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term>MBox (mbox):</term>
+ <listitem>
+ <para>
+ The email box format used by Mozilla, Netscape,
+ Ximian Evolution, Eudora, and many other email clients.
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+</para>
+<para>
+ <note>
+ <title>Microsoft Outlook and Outlook Express Users</title>
+ <para>
+ Microsoft Outlook, and versions of Outlook Express after
+ version 4, use proprietary formats that <application>Ximian
+ Evolution</application> cannot read or import. For contacts,
+ you may have to email them to yourself and import them that
+ way. For email, there is a simpler workaround:
+ <orderedlist numeration="arabic">
+
+ <listitem>
+ <para>
+ While using Windows, import the files into Mozilla Mail (or
+ another mailer, such as Netscape or Eudora, that uses the
+ standard mbox format).
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ Copy the files to the system or partition you use for
+ <application>Ximian Evolution</application>.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ Use the <application>Ximian Evolution</application> import
+ tool to import the files. There's more information about
+ why this works, and how, at the Ximian <ulink
+ url="http://support.ximian.com">support website.</ulink>
+ </para>
+ </listitem>
+ </orderedlist>
+ </para>
+ </note>
+
+ <note>
+ <title>Netscape Users</title>
+ <para>
+ Before importing mail from Netscape, make sure you select
+ <menuchoice><guimenu>File</guimenu><guimenuitem>Compact All
+ Folders</guimenuitem></menuchoice>. If you don't,
+ <application>Ximian Evolution</application> will import and undelete
+ the messages in your Trash folders.
+ </para>
+ </note>
+
+ </para>
+
+ <tip>
+ <title>Exporting Files From Ximian Evolution</title>
+ <para>
+ Ximian Evolution uses standard file types for all its information,
+ so you should have no trouble taking your information
+ elsewhere if you want.
+ </para>
+ <para>
+ For mail, that's <filename>mbox</filename>, for calendar,
+ <filename>iCal</filename>, and for the address book, vCards
+ in a <filename>.db3</filename> database.
+ </para>
+ </tip>
+ </sect2>
+ </sect1>
+
+ <sect1 id="importing-mail-from-clients">
+ <title>Importing Mail from Other Mail Clients</title>
+ <para>
+ Chances are, you already have your email in another mail program
+ and don't want to lose the information. The following section
+ describes how to import mail from specific mail clients.
+ </para>
+ <sect2 id="mutt">
+ <title>Importing Mail from mutt</title>
+ <para>
+ <application>mutt</application> is a text-based mail client
+ which is shipped with many Linux and Unix distributions.
+ <application>mutt</application> uses the standard mbox,
+ maildir, and MH file formats, which makes importing your mail
+ into <application>Evolution</application> easy. By default,
+ <application>mutt</application> uses the mbox file format.
+ <orderedlist numeration="arabic">
+ <listitem>
+ <para>
+ Open <application>Ximian Evolution</application>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Click
+ <menuchoice>
+ <guimenu>File</guimenu>
+ <guimenuitem>Import</guimenuitem>
+ </menuchoice>
+ or press
+ <keycombo action="simul">
+ <keycap>Ctrl</keycap>
+ <keycap>I</keycap>
+ </keycombo>.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Click <guibutton>Next</guibutton>.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Select <guibutton>Import a Single File</guibutton>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Click <guibutton>Browse</guibutton> and select the file
+ you would like to import from. By default, your email
+ is stored in <filename>~/mbox</filename> for the mbox
+ format and <filename
+ class="directory">~/Maildir</filename> for the Maildir format.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ When prompted for what folder in
+ <application>Evolution</application> to import to,
+ select a folder. You can also create a new folder and
+ drop it in there.
+ </para>
+ </listitem>
+ </orderedlist>
+ </para>
+ </sect2>
+ <sect2 id="kmail">
+ <title>Importing Mail from KMail</title>
+ <para>
+ KMail is the mail client which is shipped with the KDE desktop
+ environment. KMail uses the standard mbox file format, which
+ means that importing your mail into
+ <application>Evolution</application> is easy.
+ <orderedlist numeration="arabic">
+ <listitem>
+ <para>
+ Open <application>Ximian Evolution</application>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Click
+ <menuchoice>
+ <guimenu>File</guimenu>
+ <guimenuitem>Import</guimenuitem>
+ </menuchoice>
+ or press
+ <keycombo action="simul">
+ <keycap>Ctrl</keycap>
+ <keycap>I</keycap>
+ </keycombo>.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Click <guibutton>Next</guibutton>.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Select <guibutton>Import a Single File</guibutton>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Click <guibutton>Browse</guibutton> and select the file
+ you would like to import from. By default, KMail stores
+ its information in the Mail directory of your home
+ directory.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ When prompted for what folder in
+ <application>Evolution</application> to import to,
+ select a folder. You can also create a new folder and
+ drop it in there.
+ </para>
+ </listitem>
+ </orderedlist>
+ </para>
+ </sect2>
+ </sect1>
+
+ <sect1 id="ui-intro">
+ <title>What's What in Ximian Evolution</title>
+ <para>
+ Now that you've gotten the first-run configuration out of the
+ way, you're ready to get down to work. Here's a quick
+ explanation of what's going on in your main
+ <application>Ximian Evolution</application> window.
+ </para>
+
+ <figure id="preface-basic-interface">
+ <title>The Ximian Evolution Main Window</title>
+ <screenshot>
+ <screeninfo>Inbox</screeninfo>
+ <mediaobject><imageobject><imagedata
+ fileref="figures/mainwindow-pic" format="png" srccredit="Kevin
+ Breit"> </imageobject></mediaobject>
+ </screenshot>
+ </figure>
+
+ <para>
+ <inlinemediaobject><imageobject><imagedata fileref="figures/full-1" format="png"></imageobject></inlinemediaobject>
+ <guilabel>Menu Bar</guilabel>
+ </para>
+
+ <para>
+ The <guilabel>menu bar</guilabel> gives you access to nearly all the
+ features that can be found in <application>Ximian Evolution</application>.
+ </para>
+
+ <para>
+ <inlinemediaobject><imageobject><imagedata fileref="figures/full-2" format="png"></imageobject></inlinemediaobject>
+ <guilabel>Toolbar</guilabel>
+ </para>
+
+ <para>
+ The <guilabel>Toolbar</guilabel> gives you fast and easy access to the
+ most used features in each component.
+ </para>
+
+ <para>
+ <inlinemediaobject><imageobject><imagedata fileref="figures/full-3" format="png"></imageobject></inlinemediaobject>
+ <guilabel>Shortcut Bar</guilabel>
+ </para>
+
+ <para>
+ The <guilabel>Shortcut Bar</guilabel> lets you go to your favorite
+ components with the click of a click of a button.
+ </para>
+
+ <para>
+ <inlinemediaobject><imageobject><imagedata fileref="figures/full-4" format="png"></imageobject></inlinemediaobject>
+ <guilabel>Status Bar</guilabel>
+ </para>
+
+ <para>
+ Periodically, <application>Ximian Evolution</application> will need to quietly
+ display a message, or tell you the progress of a task. This most
+ often happens when you're checking or sending email. These progress
+ queues are shown here, in the <guilabel>Status Bar</guilabel>.
+ </para>
+
+ <para>
+ <inlinemediaobject><imageobject><imagedata fileref="figures/full-5" format="png"></imageobject></inlinemediaobject>
+ <guilabel>Search Tool</guilabel>
+ </para>
+
+ <para>
+ The <guilabel>Search Tool</guilabel> lets you search through your email
+ with precision so you can easily find what you're looking for.
+ </para>
+
+
+ <sect2 id="usage-mainwindow-shortcutbar">
+ <title>The Shortcut Bar</title>
+ <para>
+ <application>Ximian Evolution</application>'s most important job is
+ to give you access to your information and help you use it
+ quickly. One way it does that is through the
+ <interface>shortcut bar</interface>, the column on the left
+ hand side of the main window. The large buttons with names
+ like <guilabel>Inbox</guilabel> and
+ <guilabel>Contacts</guilabel> are the shortcuts, and you can
+ select different groups of shortcuts by clicking the
+ rectangular group buttons.
+ </para>
+ <para>
+ Take a look at the <guilabel>Shortcut Bar</guilabel>
+ The shortcut buttons in that category are:
+
+ <variablelist>
+ <varlistentry>
+ <term> <guibutton>Summary</guibutton>:</term>
+ <listitem>
+ <para>
+ Start your day here. The Ximian Evolution
+ <guilabel>Summary</guilabel> gives you a quick
+ summary of new or important messages, daily
+ appointments and urgent tasks. You can customize
+ its appearance and content, and use it to access
+ Ximian Evolution services.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term> <guibutton>Inbox</guibutton>:</term>
+ <listitem>
+ <para>
+ Click the <guibutton>Inbox</guibutton> button to start
+ reading your mail. Your Inbox is also where you can
+ access Ximian Evolution's tools to filter, sort, organize, and
+ search your mail.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><guibutton>Calendar</guibutton>:</term>
+ <listitem>
+ <para>
+ The Calendar can store your appointments and task lists
+ for you. Connected to a network, you can use it to keep
+ a group of people on schedule and up to date.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><guibutton>Tasks</guibutton>:</term>
+ <listitem>
+ <para>
+ A full-size view of your calendar's task pad.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><guibutton>Contacts</guibutton>:</term>
+ <listitem>
+ <para>
+ The Addressbook holds contacts, with address, phone, and
+ other personal information. Like calendar information,
+ contact data can be synchronized with hand-held devices
+ and shared over a network.
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </para>
+ </sect2>
+ <sect2 id="usage-mainwindow-folderbar">
+ <title>Folders and The Folder Bar</title>
+ <para>
+ The <interface>folder bar</interface> is a more comprehensive
+ way to view the information you've stored with
+ <application>Ximian Evolution</application>. It displays all your
+ appointments, address cards, and email in a tree that's a lot
+ like a <glossterm linkend="filetree">file
+ tree</glossterm>-- it starts small at the top, and branches
+ downward. On most computers, there will be three or four
+ folders at the base. First, of course, is the
+ <guilabel>Summary</guilabel>, a customizable summary of your
+ information. Below that are your <guilabel>Local
+ Folders</guilabel>, which hold all the
+ <application>Ximian Evolution</application> data that's stored on your
+ computer. After that are your network servers: <glossterm
+ linkend="ldap">LDAP</glossterm> servers that host shared contact
+ directories, and <glossterm linkend="imap">IMAP</glossterm> mail
+ folders to which you subscribe. Lastly, there are
+ <guilabel>vFolders</guilabel>, or virtual folders, discussed in
+ <xref linkend="usage-mail-organize-vfolders">,
+ </para>
+ <para>
+
+ A typical <guilabel>Local</guilabel> folder contains the following folders:
+ <itemizedlist>
+ <listitem>
+ <para>
+ <guilabel>Calendar</guilabel>, for appointments and
+ event listings.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <guilabel>Contacts</guilabel>, for address cards.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <guilabel>Drafts</guilabel>, for messages you started and didn't finish.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <guilabel>Inbox</guilabel>, for incoming mail.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ <guilabel>Outbox</guilabel>, for messages you have written
+ but not yet sent. This will be empty unless you use
+ <application>Ximian Evolution</application> while offline.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ <guilabel>Sent</guilabel>, for sent mail.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ <guilabel>Trash</guilabel>, a vFolder view of all the
+ messages you have marked for deletion but not yet
+ <glossterm linkend="expunge">expunged</glossterm>.
+ </para>
+ </listitem>
+ </itemizedlist>
+
+ </para>
+ <tip id="foldertips">
+ <title>Navigating without the Folder Bar or the Shortcut Bar</title>
+ <para>
+ You don't need the folder bar or the shortcut bar to move
+ around the main window. You can use the <keycap>Tab</keycap>
+ key to switch from one part of the window to another. When
+ you hide the folder bar, there is a menu on the left side of
+ the window just below the toolbar to move about the folder
+ tree, even with the folder and shortcut bars hidden.
+ </para>
+ </tip>
+
+ <para>
+ If you get large volumes of mail, you'll want more folders than
+ just your Inbox. To create a new folder:
+ <orderedlist numeration="arabic">
+ <listitem>
+ <para>
+ Select
+ <menuchoice> <guimenu>File</guimenu>
+ <guisubmenu>New</guisubmenu>
+ <guimenuitem>Folder</guimenuitem></menuchoice>
+ <keycombo action="simul">
+ <keycap>Shift</keycap>
+ <keycap>Ctrl</keycap>
+ <keycap>E</keycap>
+ </keycombo>.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Select the name of the folder in the <guilabel>Folder
+ Name</guilabel> field.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Select the folder type. The available options are.
+ <itemizedlist>
+ <listitem>
+ <para>
+ Calendar
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Contacts
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Mail
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Tasks
+ </para>
+ </listitem>
+ </itemizedlist>
+
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Choose the location of the new folder.
+ </para>
+ </listitem>
+ </orderedlist>
+ </para>
+
+ <sect3 id="subfolders">
+ <title>Subfolders</title>
+ <para>
+ <application>Ximian Evolution</application> lets you nest folders
+ inside of each other, so that you can have a detailed
+ organizational system.
+ </para>
+
+ <note>
+ <title>Folders Have Limits</title>
+ <para>
+ Calendars must go in calendar folders, mail in mail
+ folders, and contacts in contact folders.
+ </para>
+ </note>
+
+ <para>
+ Right-clicking will bring up a menu for just about anything in
+ <application>Ximian Evolution</application>. If you right-click on a
+ folder, you'll have a menu with the following options:
+ <itemizedlist>
+ <listitem><para><guimenuitem>View</guimenuitem>, to view the folder. </para></listitem>
+ <listitem><para><guimenuitem>Open in New Window</guimenuitem> to view the folder in another window. </para></listitem>
+ <listitem><para><guimenuitem>Move</guimenuitem>, to move the folder to another location. </para></listitem>
+ <listitem><para><guimenuitem>Copy</guimenuitem>, to duplicate the folder. </para></listitem>
+ <listitem><para><guimenuitem>Delete</guimenuitem>, to delete the folder and all its contents. </para></listitem>
+ <listitem><para><guimenuitem>Rename</guimenuitem>, to change its name. </para></listitem>
+ <listitem><para><guimenuitem>Create New Folder</guimenuitem>, to create another folder in the same location. </para></listitem>
+ <listitem><para><guimenuitem>Add to Shortcut Bar</guimenuitem>, to add the folder to your shortcut bar. </para></listitem>
+ <listitem><para><guimenuitem>Properties</guimenuitem>, to view or change the folder properties. </para></listitem>
+ </itemizedlist>
+ </para>
+ <para>
+ You can also rearrange folders and messages by dragging and
+ dropping them.
+ </para>
+
+ <para>
+ Any time new mail arrives in a mail folder, that folder
+ label is displayed in bold text, along with the number of
+ new messages in that folder.
+ </para>
+ </sect3>
+ </sect2>
+
+ <sect2 id="usage-mainwindow-menubar">
+ <title>The Menu Bar</title>
+ <para>
+ The <interface>menu bar</interface>'s contents will always
+ provide all the possible actions for any given view of your
+ data. If you're looking at your Inbox, most of the menu items
+ will relate to mail; some will relate to other components of
+ <application>Ximian Evolution</application> and some, especially those
+ in the <guimenu>File Menu</guimenu> will relate to the
+ application as a whole.
+ </para>
+ <para>
+ <variablelist>
+ <varlistentry>
+ <term> <guimenu>File</guimenu>:</term>
+
+ <listitem><para> Anything related to a file or to the
+ operations of the application generally falls under this
+ menu: creating things, saving them to disk, printing them,
+ and quitting the program itself. </para></listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term> <guimenu>Edit</guimenu>:</term>
+ <listitem><para>
+ The <guimenu>Edit</guimenu> menu holds
+ useful tools that help you edit text and move it around.
+ </para></listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term> <guimenu>View</guimenu>:</term>
+ <listitem><para>
+ This menu lets you decide how <application>Ximian Evolution</application>
+ should look. Some of the features control the appearance of
+ <application>Ximian Evolution</application> as a whole, and others
+ the way a particular kind of information appears.
+ </para></listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term> <guimenu>Actions</guimenu>:</term>
+ <listitem><para>
+ Holds actions which maybe applied to a message. Normally,
+ if there is only one target for the action -- for
+ example, replying to a message -- you can find it in
+ the <guimenu>Actions</guimenu> menu.
+ </para></listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term> <guimenu>Tools</guimenu>:</term>
+ <listitem><para>
+ Tools for configuring, changing, and
+ setting up go here. For mail, that means things like
+ and the
+ <guimenuitem>Virtual Folder Editor</guimenuitem>. For the
+ <interface>Calendar</interface> and the <interface>Contact
+ Manager</interface>, it's color, network, and layout
+ configuration.
+ </para></listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term> <guimenu>Help</guimenu>:</term>
+ <listitem><para>
+ Select among these items to open the
+ <application>Help Browser</application>
+ and read the <application>Ximian Evolution</application> manual.
+ </para></listitem>
+ </varlistentry>
+ </variablelist>
+ </para>
+
+ <para>
+ Once you've familiarized yourself with the <interface>main
+ window</interface> you can start doing things with it. We'll
+ start with the <guilabel>Summary</guilabel>, which provides a
+ quick overview of your <application>Ximian
+ Evolution</application> information.
+ </para>
+ </sect2>
+ <sect2 id="basics-summary">
+ <title>Introducing the Summary</title>
+ <para>
+ The Ximian Evolution Summary provides you with a quick
+ run-down of important information: your appointments for a
+ given day, how much new mail you have, headlines from
+ selected news services, and so forth. To see the Summary,
+ click on the <guibutton>Summary</guibutton> button in the
+ shortcut bar, or select the <guilabel>Summary</guilabel>
+ folder in the folder bar.
+ </para>
+
+ <para>
+<figure>
+ <title>The Evolution Summary</title>
+
+<screenshot>
+<graphic format="png" fileref="figures/summary" srccredit="Kevin Breit">
+</screenshot>
+</figure>
+ </para>
+
+<para>
+<inlinemediaobject><imageobject><imagedata fileref="figures/full-1" format="png"></imageobject></inlinemediaobject> <guilabel>Weather Summary</guilabel>
+</para>
+<para>
+Shows you the latest weather updates from hundreds of cities around the world.
+</para>
+<para>
+<inlinemediaobject><imageobject><imagedata fileref="figures/full-2" format="png"></imageobject></inlinemediaobject> <guilabel>News Feeds</guilabel>
+</para>
+<para>
+Displays up to the minute news from your favorite websites.
+</para>
+<para>
+<inlinemediaobject><imageobject><imagedata fileref="figures/full-3" format="png"></imageobject></inlinemediaobject> <guilabel>Mail Summary</guilabel>
+</para>
+<para>
+Shows you how many email messages you have in your selected folders, waiting to be read.
+</para>
+<para>
+<inlinemediaobject><imageobject><imagedata fileref="figures/full-4" format="png"></imageobject></inlinemediaobject> <guilabel>Calendar Summary</guilabel>
+</para>
+<para>
+Shows you your calendar.
+</para>
+<para>
+<inlinemediaobject><imageobject><imagedata fileref="figures/full-5" format="png"></imageobject></inlinemediaobject> <guilabel>Tasks</guilabel>
+</para>
+<para>
+Shows your pending tasks
+</para>
+
+
+ <para>
+ To add additional services to your Summary, or to edit the
+ existing services, select
+ <menuchoice>
+ <guimenu>Tools</guimenu>
+ <guimenuitem>Configure</guimenuitem> </menuchoice> and click
+ the <guibutton>Summary Settings</guibutton> button.
+ </para>
+
+ </sect2>
+
+ <sect2 id="basics-mail">
+ <title>Introducing Email</title>
+ <para>
+ <application>Ximian Evolution</application> email is like other
+ email programs in several ways:
+ <itemizedlist>
+ <listitem>
+ <para>
+ It can sort and organize your mail in a wide variety of
+ ways with folders, searches, and filters.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ It can send and receive mail in HTML or as plain text,
+ and makes it easy to send and receive multiple file
+ attachments.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ It supports multiple mail sources, including <glossterm
+ linkend="imap">IMAP</glossterm>, <glossterm
+ linkend="pop">POP3</glossterm>, and local
+ <filename>mbox</filename> or <filename>mh</filename>
+ spools and files created by other mail programs.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ It lets you guard your privacy with encryption.
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+ <para>
+ However, <application>Ximian Evolution</application> has some
+ important differences. First, it's built to handle very large
+ amounts of mail. Both the <link
+ linkend="usage-mail-organize-filters">filtering</link> and
+ <link linkend="usage-mail-organize-search">searching</link>
+ functions were built for speed and efficiency on large volumes
+ of mail. There's also the <application>Ximian Evolution</application>
+ <link linkend="usage-mail-organize-vFolders">vFolder</link>,
+ an advanced organizational feature not found in mainstream
+ mail clients. If you get a lot of mail, or if you keep every
+ message you get in case you need to refer to it later, you'll
+ find this feature especially useful.
+ </para>
+ <para>
+ Here's what the mailer looks like:
+
+ <!-- ==============Figure=================================== -->
+
+ <figure id="usage-mail-intro-fig">
+ <title>Ximian Evolution Mail</title>
+ <screenshot>
+ <screeninfo>Inbox</screeninfo>
+ <mediaobject><imageobject><imagedata fileref="figures/mail-inbox" format="png" srccredit="Kevin Breit">
+ </imageobject></mediaobject>
+ </screenshot>
+ </figure>
+<!-- ==============End of Figure============================== -->
+</para>
+ <para>
+ <inlinemediaobject><imageobject><imagedata fileref="figures/full-1"
+ format="png"></imageobject></inlinemediaobject> <guilabel>Email
+ Viewer</guilabel>
+ </para>
+
+ <para>
+ This is where your email is displayed.
+ </para>
+
+ <para>
+ <inlinemediaobject><imageobject><imagedata fileref="figures/full-2"
+ format="png"></imageobject></inlinemediaobject> <guilabel>Message List</guilabel>
+ </para>
+
+ <para>
+ The <guilabel>Message List</guilabel> displays all the emails
+ that you have. This includes all your read, unread, and email
+ that is flagged to be deleted.
+ </para>
+
+ <para>
+ If you find the <interface>view pane</interface> too small, you can resize
+ the pane, enlarge the whole window, or double-click on the
+ message in the <interface>message list</interface> to have it
+ open in a new window. To change the sizes of a pane, just click
+ and hold on the divider between the two panes. Then you can drag
+ up and down to select the size of the panes.
+
+</para>
+<para> Just like with folders, you can right-click on messages in the
+ message list and get a menu of possible actions: you can move,
+ delete, or undelete them, and create filters or vFolders based
+ on them.
+ </para>
+ <para>
+ Most of the mail-related actions you'll want to perform are
+ listed in the <guimenu>Message</guimenu> menu in the menu bar.
+ The most frequently used ones, like
+ <guimenuitem>Reply</guimenuitem> and
+ <guimenuitem>Forward</guimenuitem>, also appear as buttons in
+ the toolbar. Almost all of them are also located in the
+ right-click menu and as keyboard shortcuts, which tend to be
+ faster once you get the hang of them. You can choose
+ whichever way you like best; the idea is that the software
+ should work the way you want, rather than making you work the
+ way the it does.
+ </para>
+
+ <para>
+ For an in-depth guide to the email capabilities of Ximian
+ Evolution, read <xref linkend="usage-mail">.
+ </para>
+ </sect2>
+ <sect2 id="basics-calendar">
+ <title>Introducing the Calendar</title>
+ <para>
+ To begin using the calendar, select
+ <guibutton>Calendar</guibutton> from the <interface>shortcut
+ bar</interface>. By default, the calendar starts showing
+ today's schedule on a ruled background. At the upper right,
+ there's a monthly calendar you can use to switch days. Below
+ that, there's a <guilabel>Task</guilabel> pad, where you can
+ keep a list of tasks separate from your calendar appointments.
+ The day view in the calendar looks like this:
+
+ <!-- ============== Figure ============================= -->
+ <figure id="usage-calendar-fig">
+ <title>Ximian Evolution Calendar View</title>
+ <screenshot>
+ <screeninfo>Ximian Evolution Contact Manager Window</screeninfo>
+ <mediaobject><imageobject><imagedata fileref="figures/calendar" format="png" srccredit="Aaron Weber">
+ </imageobject></mediaobject>
+ </screenshot>
+ </figure>
+ <!-- ============== End of Figure ============================= -->
+
+ </para>
+
+ <para>
+ <inlinemediaobject><imageobject><imagedata fileref="figures/full-1"
+ format="png"></imageobject></inlinemediaobject> <guilabel>Appointment
+ List</guilabel>
+ </para>
+
+ <para>
+ The <guilabel>Appointment List</guilabel> is responsible for showing you all of
+ your scheduled appointments, whether they are all day appointments or simply one time
+ appointments that last a half an hour.
+ </para>
+
+ <para>
+ <inlinemediaobject><imageobject><imagedata fileref="figures/full-2" format="png"></imageobject></inlinemediaobject>
+ <guilabel>Task List</guilabel>
+ </para>
+
+ <para>
+ The <guilabel>Task List</guilabel> compliments the
+ <guilabel>Appointment List </guilabel> as it keeps track of
+ tasks which don't have a time associated with them. Tasks can
+ have complex notes associated with them, and you can also note
+ their completeness on a percentage scale.
+ </para>
+
+ <para>
+ <inlinemediaobject><imageobject><imagedata fileref="figures/full-3" format="png"></imageobject></inlinemediaobject>
+ <guilabel>Calendar Window</guilabel>
+ </para>
+
+ <para>
+ The <guilabel>Calendar Window</guilabel> has a graphical representation of
+ the calendar, so you can select what days to view in the <guilabel>Appointment
+ List</guilabel>.
+ </para>
+
+ <para>
+ For more information about the calendar
+ read <xref linkend="usage-calendar">.
+ </para>
+
+ </sect2>
+ <sect2 id="basics-contacts">
+ <title>Introducing the Address Book</title>
+ <para>
+ The <application>Ximian Evolution</application> address book
+ can handle all of the functions of an address book, phone
+ book, or Rolodex. Of course, it's a lot easier to update
+ <application>Ximian Evolution</application> than it is to
+ change an actual paper book. <application>Ximian
+ Evolution</application> also allows easy synchronization with
+ hand-held devices and functions with <glossterm
+ linkend="ldap">LDAP</glossterm> directories on a network.
+ </para>
+ <para>
+ Another advantage of the <application>Ximian Evolution</application>
+ address book is its integration with the rest of the
+ application. For example, you can create an address card from
+ an email just by right-clicking on the sender's email address.
+ </para>
+ <para>
+ To open your address book, click on
+ <guibutton>Contacts</guibutton> in the shortcut bar, or select
+ one of your contacts folders from the folder bar. <xref
+ linkend="usage-contact-fig"> shows the address book in all its
+ organizational glory. By default, the address book shows all
+ your cards in alphabetical order, in a <glossterm
+ linkend="minicard">minicard</glossterm> view. You can select
+ other views from the <guimenu>View</guimenu> menu, and adjust
+ the width of the columns by clicking and dragging the gray
+ column dividers.
+ </para>
+ <para>
+ The address book looks like this:
+
+ <figure id="usage-contact-fig">
+ <title>Ximian Evolution Contact Interface</title>
+ <screenshot>
+ <screeninfo>Ximian Evolution Contact List Window</screeninfo>
+ <mediaobject><imageobject><imagedata fileref="figures/contact" format="png" srccredit="Kevin Breit">
+ </imageobject></mediaobject>
+ </screenshot>
+ </figure>
+ </para>
+ <para>
+ <inlinemediaobject><imageobject><imagedata fileref="figures/full-1"
+ format="png"></imageobject></inlinemediaobject> <guilabel>Contact
+ List</guilabel>
+ </para>
+ <para>
+ The <guilabel>Contact List</guilabel> lists your contacts.
+ </para>
+ <para>
+ For detailed instructions on how to use the address book,
+ read <xref linkend="usage-contact">.
+ </para>
+ </sect2>
+ </sect1>
+</chapter> \ No newline at end of file
diff --git a/help/ChangeLog b/help/ChangeLog
index aa6697817b..45bf1c5fd9 100644
--- a/help/ChangeLog
+++ b/help/ChangeLog
@@ -1,123 +1,48 @@
-2003-03-27 Ettore Perazzoli <ettore@ximian.com>
-
- * Makefile.am (EXTRA_DIST): Ooops, add omf.make.
-
-2003-03-26 Ettore Perazzoli <ettore@ximian.com>
-
- * C/evolution-1.4-C.omf: Renamed from evolution-C.omf.
- * C/evolution-1.4.xml: Renamed from evolution.xml.
-
- * Makefile.am (SUBDIRS): Remove "no" for now.
-
- * xmldocs.make: Updated to most recent version on GNOME CVS.
-
- * C/Makefile.am (docname): Add version.
- (omffile): Likewise.
-
-2003-03-19 Aaron Weber <aaron@ximian.com>
-
- * Makefile.am: s/sgml/xml/ (DOH)
-
-2003-02-19 Aaron Weber <aaron@ximian.com>
-
- * C/preface.xml: add a couple "expert tips" that don't really go
- anywhere else.
-
-
-2003-02-18 Aaron Weber <aaron@ximian.com>
-
- * C/usage-exchange.xml: replaced image, updated for 1.2 layout
- (different order, mostly). Changed name of a section for better
- clarity; this may cause filenames to differ in future builds.
-
- * C/figures/exchange-receive-options.png: updated image.
-
-2003-02-04 Aaron Weber <aaron@ximian.com>
-
- * C/apx-authors.xml: thx to Baris, adjust phrasing in assorted
- places. tiny fixes, basically.
-
-2003-01-30 Aaron Weber <aaron@ximian.com>
-
- * C/usage-mainwindow.xml: updates from Baris Cicek.
-
2003-01-15 Aaron Weber <aaron@ximian.com>
- * C/usage-mainwindow.xml: Change links from ghelp links to internal apx-fdl or apx-gpl
-
- * es/evolution.sgml: s/gnome-help/ghelp
+ * C/usage-mainwindow.sgml: Change links from ghelp links to internal apx-fdl or apx-gpl
- * es/preface.sgml: s/gnome-help/ghelp
+ * es/preface.sgml: s/gnome-help/ghelp/
-2003-01-11 Aaron Weber <aaron@ximian.com>
-
- * C/usage-mail.xml: "Send Later" feature changed for 1.2 and I
- didn't notice. Shame on me.
+ * es/evolution.sgml: s/gnome-help/ghelp/
2002-12-16 Aaron Weber <aaron@ximian.com>
- * C/config-sync.xml: spelling/typos
+ * C/config-sync.sgml: spelling/typos
- * C/usage-exchange.xml: spelling/typos
+ * C/usage-exchange.sgml: spelling/typos
- * C/usage-mail.xml: spelling/typos
+ * C/usage-mail.sgml: spelling/typos
+
- * C/usage-mainwindow.xml: spelling/typos
+ * C/usage-mainwindow.sgml: spelling/typos
2002-12-10 Aaron Weber <aaron@ximian.com>
- * C/config-prefs.xml: change directory server description.
-
- * C/preface.xml: typo (bug 35362, "Resend" instead of "Redirect).
- This whole section will need to be redone at some point.
+ * C/config-prefs.sgml: change directory server description.
-2002-12-06 Aaron Weber <aaron@ximian.com>
- * C/usage-mail-org.xml: add spam filtering help.
+ * C/preface.sgml: change word from "Resend" to "redirect".
+
+ * C/config-prefs.sgml: rm "base" option for search scope dropdown.
2002-11-19 Aaron Weber <aaron@ximian.com>
- * C/config-prefs.xml: fix typo as per bug 34152
-
- * C/legal.xml: redo tags for legalnotice ordering. open/close for
- actual preface is in evolution.xml and the LEGAL entity
- (legal.xml) is now part of the preface. the legalnotice tag itself
- merely says "hey, go look at the preface, legal info is there due
- to rendering issues."
+ * C/apx-authors.sgml: update URL.
- * C/apx-gpl.xml: new file. GPL!
-
- * C/Makefile.am: New file: apx-gpl.xml. Re-alphabetize the files
- listed as entities, and make the \'s line up so it looks pretty.
+ * C/config-prefs.sgml: typo
- * C/preface.xml: redo tags for legalnotice ordering. open/close
- for actual preface is in evolution.xml and the LEGAL entity
- (legal.xml) is now part of the preface.
+ * C/apx-gpl.sgml: add gpl/fdl files.
+ * C/apx-fdl.sgml new file (add fdl). These two are good to have with Evo in case it's shipped without other GNOME software.
+ * C/Makefile.am: added the two new files.
- * C/evolution.xml: reorder, add GPL, put legalnotice inside
- preface. Put actual <preface> tags in this file, so that the
- preface could consist of sect1s which are the &LEGAL; and
- &PREFACE; entities.
-
-2002-11-11 Aaron Weber <aaron@ximian.com>
-
- * C/config-prefs.xml: fix bug 27336, which is about how the Search
- Base option description is wrong.
-
-2002-11-04 Aaron Weber <aaron@ximian.com>
-
- * C/*.sgml: All sgml files replaced with xml files. XML files
- validated. Two new XML files-- apx-fdl.xml and legal.xml
-
- * C/evolution-C.omf: Altered to fit the GDP template. This may now
- work with the GNOME 2.0 DTD, although I could be wrong.
+2002-11-12 Frederic Crozat <fcrozat@mandrakesoft.com>
- * sgmldocs.make: removed and replaced with xmldocs.make. This will
- break all translations until they are also ported to XML. I will
- probably begin doing that tomorrow, since it's just markup and not
- language stuff.
+ reviewed by: Ettore
- * C/Makefile.am: added two files
+ * C/evolution-C.omf:
+ * no/evolution-no.omf:
+ fixe compliance with OMF V1.0 DTD (needed for scrollkeeper >= 0.3)
2002-10-22 Aaron Weber <aaron@ximian.com>
@@ -2032,4 +1957,4 @@
2000-02-25 Federico Mena Quintero <federico@helixcode.com>
- * calendar.sgml: New file for the Evolution calendaring white paper. \ No newline at end of file
+ * calendar.sgml: New file for the Evolution calendaring white paper.
diff --git a/help/devel/executive-summary/evolution-services.hierarchy b/help/devel/executive-summary/evolution-services.hierarchy
deleted file mode 100644
index 37559d819d..0000000000
--- a/help/devel/executive-summary/evolution-services.hierarchy
+++ /dev/null
@@ -1,7 +0,0 @@
-GtkObject
- BonoboObject
- ExecutiveSummaryComponent
- ExecutiveSummaryComponentFactory
- Handle to remote Bonobo::Unknown
- ExecutiveSummaryComponentFactoryClient
- ExecutiveSummaryHtmlView
diff --git a/help/devel/importer/evolution-shell-importer.hierarchy b/help/devel/importer/evolution-shell-importer.hierarchy
deleted file mode 100644
index c46ebdf782..0000000000
--- a/help/devel/importer/evolution-shell-importer.hierarchy
+++ /dev/null
@@ -1,7 +0,0 @@
-GtkObject
- BonoboObject
- BonoboXObject
- EvolutionImporter
- EvolutionImporterListener
- Handle to remote Bonobo::Unknown
- EvolutionImporterClient
diff --git a/help/no/evolution-no.omf b/help/no/evolution-no.omf
index 3f8c797af6..4d059a70c3 100644
--- a/help/no/evolution-no.omf
+++ b/help/no/evolution-no.omf
@@ -1,4 +1,5 @@
-<?xml version="1.0" standalone="no"?>
+<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>
+<!DOCTYPE omf PUBLIC "-//OMF//DTD Scrollkeeper OMF Variant V1.0//EN" "http://scrollkeeper.sourceforge.net/dtds/scrollkeeper-omf-1.0/scrollkeeper-omf.dtd">
<omf>
<resource>
<creator>
@@ -12,5 +13,6 @@
<format mime="text/sgml"/>
<identifier url="index.html"/>
<language code="no"/>
+ <relation seriesid="6a2207d8-8aa4-11d6-8cb4-f0bb5a765891"/>
</resource>
</omf>
diff --git a/libibex/TODO b/libibex/TODO
new file mode 100644
index 0000000000..a087c8d1f3
--- /dev/null
+++ b/libibex/TODO
@@ -0,0 +1,61 @@
+Stability
+---------
+* ibex_open should never crash, and should never return NULL without
+errno being set. Should check for errors when reading.
+
+
+Performance
+-----------
+* Profiling, keep thinking about data structures, etc.
+
+* Check memory usage
+
+* See if writing the "inverse image" of long ref streams helps
+compression without hurting performance now. (ie, if a word appears in
+more than half of the files, write out the list of files it _doesn't_
+appear in). (I tried this before, and it wasn't working well, but the
+file format and data structures have changed a lot.)
+
+* We could save a noticeable chunk of time if normalize_word computed
+the hash of the word and then we could pass that into
+g_hash_table_insert somehow.
+
+* Make a copy of the buffer to be indexed (or provide interface for
+caller to say ibex can munge the provided data) and then use that
+rather than constantly copying things. ?
+
+
+Functionality
+-------------
+* ibex file locking
+
+* specify file mode in ibex_open
+
+* ibex_find* need to normalize the search words... should this be done
+by the caller or by ibex_find?
+
+* Needs to be some way to do a secondary search after getting results
+back from ibex_find* (ie, for "foo near bar"). This either has to be
+done by ibex, or requires us to export the normalize interface.
+
+* Does there need to be an ibex_find_any, or is that easy enough for the
+caller to do?
+
+* utf8_trans needs to cover at least two more code pages. This is
+tricky because it's not clear whether some of the letters there should
+be translated to ASCII or left as UTF8. This requires some
+investigation.
+
+* ibex_index_* need to ignore HTML tags.
+ NAME = [A-Za-z][A-Za-z0-9.-]*
+ </?{NAME}(\s*{NAME}(\s*=\s*({NAME}|"[^"]*"|'[^']*')))*>
+ <!(--([^-]*|-[^-])--\s*)*>
+
+ ugh. ok, simplifying, we get:
+ <[^!](([^"'>]*("[^"]*"|'[^']*'))*> or
+ <!(--([^-]*|-[^-])--\s*)*>
+
+ which is still not simple. sigh.
+
+* ibex_index_* need to recognize and ignore "non-text". Particularly
+BinHex and uuencoding.
diff --git a/libical/ChangeLog b/libical/ChangeLog
index 8d9542b7a3..3ef79d9cce 100644
--- a/libical/ChangeLog
+++ b/libical/ChangeLog
@@ -1,6 +1,4 @@
-2003-03-17 Hans Petter Jansson <hpj@ximian.com>
-
- Part of fix for #34095
+2002-11-30 Hans Petter Jansson <hpj@ximian.com>
* scripts/mkderivedparameters.pl: Generate code to free old
string value when a new one is set.
@@ -9,41 +7,6 @@
Callers expect a temporary string, and thus won't free it, so
allocate returned memory from the temporary ring.
-2003-02-10 Ettore Perazzoli <ettore@ximian.com>
-
- * src/libical/Makefile.am (libical_static_la_DEPENDENCIES): Make
- libical-static.la depend on libical-evolution.la so they they are
- not built in parallel by a parallel make, since that would break
- libtool.
-
-2003-02-07 Christian Neumair <chris@gnome-de.org>
-
- * .cvsignore: Added missing files.
- * configure.in: Added AC_PREREQ as defined in ../configure.in.
-
-2003-02-06 Dan Winship <danw@ximian.com>
-
- * configure.in: AC_SUBST privlibdir, privincludedir, privdatadir
- (sent from ../configure). Add descriptions to AC_DEFINEs. Don't
- bother checking for python since we don't build it anyway.
-
- * acconfig.h: Gone
-
- * src/libical/Makefile.am: install library in privlibdir and
- headers under privincludedir. Look for zone files in privdatadir
-
- * src/libicalvcal/Makefile.am: install in privlibdir
-
- * zoneinfo/Makefile.am (zoneinfodatadir): define in terms of
- privdatadir
- (install-data-local): update
-
-2002-12-19 Joe Shaw <joe@ximian.com>
-
- * configure.in: Add AC_CONFIG_AUX_DIR(..) so it looks for ylwrap in
- the toplevel evolution directory and not our directory. Fixes the
- build for automake >= 1.5
-
2002-11-26 Rodrigo Moya <rodrigo@ximian.com>
* src/libical/icalyacc.y: added missing ';' for new bison to not
diff --git a/libical/src/libical/icalyacc.y b/libical/src/libical/icalyacc.y
index 51a03d6028..c656ad4981 100644
--- a/libical/src/libical/icalyacc.y
+++ b/libical/src/libical/icalyacc.y
@@ -6,7 +6,7 @@
DESCRIPTION:
- $Id: icalyacc.y,v 1.14 2002/11/27 00:33:20 rodrigo Exp $
+ $Id: icalyacc.y,v 1.13.6.1 2002/11/27 00:32:24 rodrigo Exp $
$Locker: $
(C) COPYRIGHT 1999 Eric Busboom
diff --git a/libical/src/libicalvcal/Makefile.am b/libical/src/libicalvcal/Makefile.am
index f9d8dd39d9..e8e8310941 100644
--- a/libical/src/libicalvcal/Makefile.am
+++ b/libical/src/libicalvcal/Makefile.am
@@ -1,4 +1,4 @@
-privlib_LTLIBRARIES = libicalvcal-evolution.la
+lib_LTLIBRARIES = libicalvcal-evolution.la
INCLUDES = \
-I$(top_builddir) \
@@ -19,7 +19,7 @@ libicalvcal_evolution_la_SOURCES = \
vcaltmp.h \
vcaltmp.c
-#libicalvcalincludedir = $(privincludedir)/libicalvcal
+#libicalvcalincludedir = $(includedir)/evolution/libicalvcal
#libicalvcalinclude_HEADERS = \
# icalvcal.h \
diff --git a/macros/ChangeLog b/macros/ChangeLog
index be94cbb4ec..40e2136767 100644
--- a/macros/ChangeLog
+++ b/macros/ChangeLog
@@ -1,13 +1,11 @@
-2003-03-20 Frederic Crozat <fcrozat@mandrakesoft.com>
+2003-01-07 Rodney Dawes <dobey@ximian.com>
- * autogen.sh: use GNOME2_DIR, not GNOME2_PATH which can be
- a ':' separated list.
+ * autogen.sh: Fall back to automake/aclocal if no -1.4 version exists
-2002-11-27 Stanislav Brabec <sbrabec@suse.cz>
-
- * gnome-pilot.m4: Added missing quotes:
- PISOCK_LIBS="-lpisock -lpisync"
+2002-12-09 JP Rosevear <jpr@ximian.com>
+ * gnome-pilot.m4: add quotes
+
2002-09-20 JP Rosevear <jpr@ximian.com>
* gnome-pilot.m4: fix problem where -lpisync was not linked in if
@@ -158,7 +156,7 @@
* gnome-pilot.m4: Revert my previous patch now that gnome-pim and
evolution are fixed to accomodate the change
-
+
2001-02-19 JP Rosevear <jpr@ximian.com>
* gnome-pilot.m4: AC_SUBST the PISOCK_LIBDIR var
@@ -288,7 +286,7 @@ Sun Apr 23 12:15:14 2000 George Lebl <jirka@5z.com>
use AC_LIBGTOP_CHECK_TYPE rather than AC_CHECK_TYPE.
2000-01-26 Dave Camp <campd@oit.edu>
-
+
* gnome-bonobo-check.m4 Include <bonobo.h> rather than
<bonobo/gnome-object.h>
@@ -317,10 +315,10 @@ Sun Apr 23 12:15:14 2000 George Lebl <jirka@5z.com>
* gnome-pilot.m4: Fix typo in PILOT_LINK_HOOK.
2000-01-15 Eskil Heyn Olsen <deity@eskil.dk>
-
+
* gnome-pilot.m4: PILOT_LINK_HOOK now check pilot-link version.
GNOME_PILOT_CHECK defaults to requiring 0.9.3.
-
+
2000-01-09 Martin Baulig <martin@home-of-linux.org>
* gnome-libgtop-check.m4: Applied patch from R. Bernstein
@@ -375,7 +373,7 @@ Sun Apr 23 12:15:14 2000 George Lebl <jirka@5z.com>
1999-09-01 Havoc Pennington <hp@pobox.com>
* gnome-xml-check.m4: If you're going to AC_PATH_PROG then use the
- prog you find :-)
+ prog you find :-)
1999-08-02 Peter Teichman <pat4@acpub.duke.edu>
@@ -573,7 +571,7 @@ Tue Feb 16 19:35:42 1999 Owen Taylor <otaylor@redhat.com>
* gnome-libgtop-check.m4: All parts of GNOME will now require
LibGTop >= 0.99.0 which is the latest version from CVS and
already feature-freezed for GNOME 1.0.
-
+
1998-12-09 Martin Baulig <martin@home-of-linux.org>
* aclocal-include.m4 (AM_ACLOCAL_INCLUDE): Make this work
@@ -643,7 +641,7 @@ Sat Dec 5 23:30:01 PST 1998 Manish Singh <yosh@gimp.org>
* gnome-libgtop-sysdeps.m4: We need to check for <net/if_var.h>
and conditionally include it before <net/if_isppp.h> in the code
that check for I4B to make it work on FreeBSD 3.0.
-
+
1998-10-25 Marius Vollmer <mvo@zagadka.ping.de>
* gnome-guile-checks.m4: Add GUILE_LIBS to LIBS when checking
@@ -665,7 +663,7 @@ Sat Dec 5 23:30:01 PST 1998 Manish Singh <yosh@gimp.org>
Gnorba info, if it is in a different location.
* Makefile.am (MACROS): Add gnome-gnorba-check.m4 to Makefile.
-
+
* gnome-gnorba-check.m4: New file.
1998-11-12 Raja R Harinath <harinath@cs.umn.edu>
@@ -706,7 +704,7 @@ Sat Dec 5 23:30:01 PST 1998 Manish Singh <yosh@gimp.org>
included in "link". Use "compile" instead of "info includedir". Do
not include "1.2" in error message when Guile can't be found at
all.
-
+
1998-10-11 Martin Baulig <martin@home-of-linux.org>
* gnome-libgtop-check.m4 (GNOME_INIT_LIBGTOP): Added optional
@@ -738,7 +736,7 @@ Sat Dec 5 23:30:01 PST 1998 Manish Singh <yosh@gimp.org>
* compiler-flags.m4 (--enable-warn-unused): New configure parameter
to add `-Wunused' to the warning flags.
-
+
1998-09-27 Martin Baulig <martin@home-of-linux.org>
* gnome-libgtop-check.m4: Make it require libgtop >= 0.26.2.
@@ -793,7 +791,7 @@ Sat Dec 5 23:30:01 PST 1998 Manish Singh <yosh@gimp.org>
* gnome-libgtop-check.m4 (GNOME_INIT_LIBGTOP): Make it work
with a brain-dead /bin/sh and a brain-dead /bin/test.
-
+
* gnome-libgtop-check.m4 (GNOME_INIT_LIBGTOP): Use `AC_MSG_WARN'
if LibGTop cannot be found and the `fail' argument is not given.
@@ -831,7 +829,7 @@ Sat Dec 5 23:30:01 PST 1998 Manish Singh <yosh@gimp.org>
* gnome-libgtop-check.m4: make it require libgtop >= 0.25.0.
Added (AC_SUBST): `LIBGTOP_MICRO_VERSION' and `LIBGTOP_EXTRA_LIBS'.
-
+
1998-08-17 Martin Baulig <martin@home-of-linux.org>
* gnome-libgtop-check.m4: Completely rewrote this file. It
@@ -978,7 +976,7 @@ Fri Jun 26 14:36:08 1998 Scott D. Heavner <sdh@po.cwru.edu>
This needs to be further cleaned up to only list what is
needed for gdiskfree.
* Makefile.am (MACROS): Add gnome-fileutils.m4.
-
+
1998-06-14 Martin Baulig <martin@home-of-linux.org>
* gnome-libgtop-sysdeps.m4 (LINUX_TABLE): New automake conditional;
@@ -996,7 +994,7 @@ Fri Jun 26 14:36:08 1998 Scott D. Heavner <sdh@po.cwru.edu>
* gnome-support.m4 (AC_PROG_AWK): Look for awk.
(CROSS_COMPILING): Remove conditional.
-
+
Wed Jun 10 14:19:39 EDT 1998 Gregory McLean <gregm@comstar.net>
* gnome-x-checks.m4: More tweeks to make building against gtk 1.0
@@ -1063,7 +1061,7 @@ Fri Apr 24 16:43:38 1998 Owen Taylor <otaylor@gtk.org>
ACLOCAL_FLAGS to aclocal. This allows, for instance,
ACLOCAL_FLAGS="-I /home/owen/share/aclocal/" autogen.sh
-
+
Sun Apr 19 01:35:53 EDT 1998 Gregory McLean <gregm@comstar.net>
* gnome-x-checks.m4: Updated the gtk check to check for 1.0.0.
@@ -1088,7 +1086,7 @@ Thu Mar 19 23:23:30 1998 Tom Tromey <tromey@cygnus.com>
* gnome.m4 (GNOME_INIT_HOOK): Provide a way to hook some code to
execute; Accept a probe mode.
-
+
(GNOME_INIT): Define in terms of GNOME_INIT_HOOK.
Thu Mar 19 00:17:46 1998 Tom Tromey <tromey@cygnus.com>
@@ -1177,7 +1175,7 @@ Fri Feb 27 10:05:34 1998 Tom Tromey <tromey@cygnus.com>
* gnome-x-checks.m4: Add `AC_DEFINE(HAVE_LIBSM)' if `-lSM' is
already part of `$x_libs'.
Move pthread check to new file.
-
+
Sat Feb 14 12:45:35 1998 Tom Tromey <tromey@cygnus.com>
* Makefile.am (macros.dep): Use single quotes, not double quotes.
@@ -1229,7 +1227,7 @@ Sat Feb 14 01:09:37 1998 Tom Tromey <tromey@cygnus.com>
here, and renamed macro to GNOME_CHECK_GNOME.
* gnome-x-checks.m4: Likewise, move and renaming AC_GNOME_X_CHECKS
to GNOME_X_CHECKS.
-
+
* aclocal-include.m4: New file. Defines AM_ACLOCAL_INCLUDE macro
to provide extra search directories to `aclocal'.
diff --git a/macros/autogen.sh b/macros/autogen.sh
index 6c45455e8b..2d344e20ea 100644
--- a/macros/autogen.sh
+++ b/macros/autogen.sh
@@ -3,9 +3,9 @@
DIE=0
-if [ -n "$GNOME2_DIR" ]; then
- ACLOCAL_FLAGS="-I $GNOME2_DIR/share/aclocal $ACLOCAL_FLAGS"
- PATH="$GNOME2_DIR/bin:$PATH"
+if [ -n "$GNOME2_PATH" ]; then
+ ACLOCAL_FLAGS="-I $GNOME2_PATH/share/aclocal $ACLOCAL_FLAGS"
+ PATH="$GNOME2_PATH/bin:$PATH"
export PATH
fi
@@ -69,7 +69,7 @@ fi
# }
#}
-(automake-1.4 --version) < /dev/null > /dev/null 2>&1 || {
+(automake-1.4 --version || automake --version) < /dev/null > /dev/null 2>&1 || {
echo
echo "**Error**: You must have \`automake' installed to compile $PKG_NAME."
echo "Get ftp://ftp.gnu.org/pub/gnu/automake-1.3.tar.gz"
@@ -80,7 +80,7 @@ fi
# if no automake, don't bother testing for aclocal
-test -n "$NO_AUTOMAKE" || (aclocal-1.4 --version) < /dev/null > /dev/null 2>&1 || {
+test -n "$NO_AUTOMAKE" || (aclocal-1.4 --version || aclocal --version) < /dev/null > /dev/null 2>&1 || {
echo
echo "**Error**: Missing \`aclocal'. The version of \`automake'"
echo "installed doesn't appear recent enough."
@@ -173,7 +173,7 @@ do
fi
fi
echo "Running aclocal-1.4 $aclocalinclude ..."
- aclocal-1.4 $aclocalinclude || {
+ aclocal-1.4 $aclocalinclude || aclocal $aclocalinclude || {
echo
echo "**Error**: aclocal-1.4 failed. This may mean that you have not"
echo "installed all of the packages you need, or you may need to"
@@ -189,6 +189,7 @@ do
fi
echo "Running automake-1.4 --gnu $am_opt ..."
automake-1.4 --add-missing --gnu $am_opt ||
+ automake --add-missing --gnu $am_opt ||
{ echo "**Error**: automake-1.4 failed."; exit 1; }
echo "Running autoconf ..."
autoconf || { echo "**Error**: autoconf failed."; exit 1; }
diff --git a/mail/ChangeLog b/mail/ChangeLog
index b6638c3e51..3daef220e2 100644
--- a/mail/ChangeLog
+++ b/mail/ChangeLog
@@ -1,554 +1,46 @@
-2003-04-01 Not Zed <NotZed@Ximian.com>
-
- * mail-display.c (mail_display_redisplay): if we're called and the
- idle handler is set, remove it, so we dont go and redisplay it
- again. Fixes #40522.
-
-2003-03-31 Jeffrey Stedfast <fejj@ximian.com>
-
- * mail-session.c: Properly init message_list. Fixed a type-o that
- initialized it to the password_list.
-
-2003-03-31 Not Zed <NotZed@Ximian.com>
-
- * mail-session.c (pass_response): need to check for config_service
- != NULL, not service != NULL before calling set_save_password.
- Fix for #40472.
-
-2003-03-28 Not Zed <NotZed@Ximian.com>
-
- * folder-browser-ui.c: include e-meta.h
-
- * folder-browser.c (on_right_click): remove unused var.
-
-2003-03-28 Jeffrey Stedfast <fejj@ximian.com>
-
- * subscribe-dialog.c (fe_check_for_children): Declare a prototype
- for this function prior to fe_got_children() so that
- fe_got_children() can call us.
-
-2003-03-26 Dan Winship <danw@ximian.com>
-
- * mail-format.c (write_address): remove extra arg to
- camel_url_encode
-
-2003-03-27 Not Zed <NotZed@Ximian.com>
-
- * folder-browser.c (folder_browser_gui_init): dont set the paned
- initial size here, but hook onto the realize signal.
- (paned_realised): set the paned size once we're realised. Fixes
- #37084, its a bit of a hack, but it seems to work.
-
-2003-03-26 Jeffrey Stedfast <fejj@ximian.com>
-
- Fixes bug #40074.
-
- * folder-browser-factory.c (control_deactivate): Save message-list
- state.
-
- * message-list.c (message_list_save_state): Save the various
- states.
-
-2003-03-26 Jeffrey Stedfast <fejj@ximian.com>
-
- Fixes for bug #39870
-
- * message-browser.c (transfer_msg_done): Close the
- message-browser. Since the message doesn't exist anymore, we
- should close it.
- (message_browser_delete): New callback to handle deletion in the
- message-browser window.
-
-2003-03-26 Jeffrey Stedfast <fejj@ximian.com>
-
- * subscribe-dialog.c (fe_got_children): If the CamelFolderInfo
- node doesn't have \NoInferriors set, then check for
- subfolders. Fixes bug #40314.
-
-2003-03-26 Not Zed <NotZed@Ximian.com>
-
- * mail-display.c (popup_window_destroy_cb): Undo jeff's patch
- below for #40275, the destroy timeout is already removed in
- popup_info_free. Unref the widget 'w' when we're done with it.
- (popup_info_free): Move everything in here to popup_window_destroy
- and remove, since nothing else uses it.
- (make_popup_window): Ref the widget so it doesn't go away before
- we're finished with it. Really fixes bug #40275/40188.
-
-2003-03-25 Jeffrey Stedfast <fejj@ximian.com>
-
- * mail-display.c (popup_window_destroy_cb): Remove the
- timeout. Should fix bug #40275.
-
- * subscribe-dialog.c: Remove search entry which never worked right
- (and can't work as users expect anyway, since we don't do
- namespace stripping). Fixes bug #40083.
- (ftree_node_new): Ignore \NoSelect as far as marking it
- "subscribable". Fixes bug #40124.
-
-2003-03-25 Dan Winship <danw@ximian.com>
-
- * mail-account-editor.c: Update for e_notice move
- (apply_changes): Pass a parent_window to e_notice
-
- * mail-account-gui.c: Update for e_notice move.
- (mail_account_gui_save): Pass a parent_window to e_notice
-
- * mail-callbacks.c: Update for e_notice move
- * mail-local.c: Likewise
- * mail-signature-editor.c: Likewise
- * mail-vfolder.c: Likewise
-
- * component-factory.c (interactive_cb): Update prototype
-
-2003-03-25 Not Zed <NotZed@Ximian.com>
-
- * mail-tools.c (meta_data_key): strdup the key before freeing the
- url as it is probably pointing there.
-
-2003-03-25 Not Zed <NotZed@Ximian.com>
-
- * component-factory.c (got_folder): remove a debug printf that
- made it in a commit.
-
- * folder-browser-ui.c (folder_browser_ui_add_global): Load
- per-folder setting of show_preview from meta data.
- (folder_browser_ui_add_list): Same, for thread_list.
-
- * mail-tools.c (mail_tool_get_meta_data)
- (mail_tool_delete_meta_data): helpers to lookup/delete meta data.
-
- * mail-config.c (mail_config_uri_deleted): delete the meta-data
- for the folder.
-
- * folder-browser.c (folder_browser_reload): dont reload the uri if
- we're in the process of loading it still.
- (folder_browser_new): load the folder meta data before loading the
- folder.
- (folder_browser_toggle_preview):
- (folder_browser_toggle_threads): save change to meta-data.
- (got_folder): Load the metadata if we have a folder to set, and
- the meta-data has changed from initislisation.
-
-2003-03-23 Chris Toshok <toshok@ximian.com>
-
- * mail-callbacks.c (ask_confirm_for_unwanted_html_mail): pass
- FALSE for e_destination_get_textrep's include_email arg.
-
-2003-03-21 Jeffrey Stedfast <fejj@ximian.com>
-
- * mail-format.c (mail_format_data_wrapper_write_to_stream):
- Default to the charset provied in the MimePart's Content-Type over
- that of the user's mailer charset. Fixes bug #39204.
-
-2003-03-21 Jeffrey Stedfast <fejj@ximian.com>
-
- * mail-composer-prefs.c (spell_load_values): "en_us" should not be
- translated. Fixes bug #40088.
-
-2003-03-21 Larry Ewing <lewing@ximian.com>
-
- * mail-display.c (pixbuf_gen_idle): remember to disconnect the
- destroy handler if whenever the loader is shut down.
-
-2003-03-20 Jeffrey Stedfast <fejj@ximian.com>
-
- * component-factory.c (owner_set_cb): Change the message_destroy
- callback to just gtk_widget_destroy. No need to have a callback
- simply to call this function.
- (warning_response): Removed (see above).
-
- * mail-composer-prefs.c (sig_add_script_response): Don't forget to
- add the signature to the signature list if it is a valid script.
-
- * mail-config.c (mail_config_signature_unregister_client): Make
- sure we can find the registered handler before trying to remove it
- from the list.
-
- * mail-session.c (do_user_message): Make the 5th argument to
- gtk_message_dialog_new() "%s" and move the m->prompt to arg 6 so
- that we are safe if the prompt string contains any %'s. Also
- connect to the response signal for the user_msg dialog and set the
- callback to gtk_widget_destroy so that the user can actually close
- the dialog. We also need to g_object_weak_ref() the dialog so that
- we can set the global message_dialog pointer back to NULL when it
- gets destroyed. Fixes bug #40043.
-
-2003-03-20 Dan Winship <danw@ximian.com>
-
- * mail-ops.c (build_from): Remove this since there's a function in
- CamelMimeMessage to do it now.
- (save_messages_save): Use camel_mime_message_build_mbox_from.
-
-2003-03-21 Not Zed <NotZed@Ximian.com>
-
- ** for mail part of bug #38461.
-
- * importers/evolution-outlook-importer.c (load_file_fn): dont pass
- in create flag to uri_to_folder, the folder must already exist.
-
- * importers/evolution-mbox-importer.c (folder_created_cb):
- Removed, we now force the caller to create the destination folder
- first.
- (load_file_fn): Dont try and create a folder if it doesn't exist.
- Also, use the uri directly as the destination uri, so we can
- import into any folder.
- (process_item_fn): If we dont have a folder, thats just an error,
- return BAD_FILE.
-
- * importers/netscape-importer.c (netscape_import_file): As below
- for elm_import_file.
- (import_next): similarly as for pine import_next.
- (importer_cb): just record result.
- (importer_timeout_fn): removed.
-
- * importers/pine-importer.c (import_next): Similar to below for
- the elm import_next.
- (pine_import_file): As below for elm_import_file.
- (importer_timeout_fn): removed.
- (importer_cb): just record the result, and exit.
- (import_next): change around to behave more like the elm importer,
- cleaning up when we're done.
-
- * importers/elm-importer.c (elm_import_file): Create the
- destination folder ourselves, dont pass it onto the mbox importer.
- Simplify logic, just do the import within a while loop, polling
- the g main loop as necessary, remove need for idle callbacks and
- other crap.
- (import_next): If elm_import_file fails, then just go straight to
- the next folder, stops it falling in a heap.
- (import_item_idle): removed.
- (importer_cb): just record result/exit.
-
- * mail-importer.c (mail_importer_create_folder): removed.
- (mail_importer_make_local_folder): new function to create a
- local-only folder from a path. It runs synchronously by using a
- recursive main loop.
- (folder_created_cb): callback for make_local_folder.
-
-2003-03-19 Jeffrey Stedfast <fejj@ximian.com>
-
- * mail-config-druid.c (mail_config_druid_new): Revert ettore's
- broken patch.
-
- * mail-search-dialogue.c: Removed - nothing uses this.
-
-2003-03-19 Ettore Perazzoli <ettore@ximian.com>
-
- * importers/GNOME_Evolution_Mail_Mbox_Importer.server.in.in:
- Replace "evolution:menu-name" prop with "evolution:menu_name".
- [#39692]
- * importers/GNOME_Evolution_Mail_Outlook_Importer.server.in.in:
- Likewise.
-
-2003-03-19 Ettore Perazzoli <ettore@ximian.com>
-
- * mail-config-druid.c (mail_config_druid_new): Give the druid the
- DIALOG hint. [#39741 and friends.]
-
-2003-03-19 Radek Doulik <rodo@ximian.com>
-
- * mail-composer-prefs.c (spell_load_values): changed default
- language to en_us instead of en
- (spell_language_button_press): new handler, ported from 1.2
- (spell_setup): use spell_language_enable and
- spell_language_button_press
-
-2003-03-18 Jeffrey Stedfast <fejj@ximian.com>
-
- * mail-callbacks.c (composer_get_message):
- e_msg_composer_get_subject() now returns a const char *, so update
- appropriately.
-
-2003-03-18 Larry Ewing <lewing@ximian.com>
-
- * mail-callbacks.c (do_mail_print): fix leak, cleanup variable
- name, and call gtk_window_set_transient_for with a parent that is
- actually a GtkWindow.
- (mark_as_unseen): use g_source_remove.
-
-2003-03-18 Jeffrey Stedfast <fejj@ximian.com>
-
- * mail-config-druid.c (mail_config_druid_new): Set the type hint
- to DIALOG so that Metacity shows this window on top. Fixes bug
- #39914.
-
-2003-03-18 Not Zed <NotZed@Ximian.com>
-
- * mail-vfolder.c (new_rule_clicked): validate rule & rule is
- unique. Workaround for #39464. Should this just use
- rule_context_add_rule_gui??
-
- * mail-search.c (mail_search_destroy): unhook from the html engine
- signals here, before we redisplay the message. Also make sure
- this processing only happens once. For #39759.
- (mail_search_finalise): dont unhook from signals here.
-
-2003-03-12 Not Zed <NotZed@Ximian.com>
-
- * mail-callbacks.c (expunge_folder): use a hack to find out if the
- message-list was focussed before we desensitise it.
- (expunged_folder): If the message-list was focussed before,
- re-grab the focus. For bug #29564.
-
-2003-03-17 Ettore Perazzoli <ettore@ximian.com>
-
- * mail-signature-editor.c (mail_signature_editor): Give the editor
- the GDK_WINDOW_TYPE_HINT_DIALOG hint. [#38926]
-
-2003-03-17 Jeffrey Stedfast <fejj@ximian.com>
-
- * mail-display.c (pixbuf_gen_idle): If we fail to load the pixbuf,
- don't use it (stops some g_warnings).
-
- Part of a fix for bug #39809
-
- * mail-vfolder.c (vfolder_edit): Don't add the cancel button here.
-
- * mail-callbacks.c (filter_edit): Don't add the cancel button here.
-
-2003-03-17 Jeffrey Stedfast <fejj@ximian.com>
+2003-03-14 Jeffrey Stedfast <fejj@ximian.com>
* mail-display.c (do_external_viewer): Lookup the handler for the
type. If we don't have a registered handler or if the registered
- handler is not meant to be handled via a bonobo component, don't
- use a bonobo component.
+ handler is not meant to be handled by a bonobo-component, don't
+ use a bonobo-component.
* mail-format.c (mail_lookup_handler): If we register a new
- handler that is to be handled by a bonobo component, set
+ handler that is to be handled by a bonobo-component, set
handler->is_bonobo to TRUE.
-2003-03-14 Dan Winship <danw@ximian.com>
-
- * component-factory.c (storage_connect, storage_connected): Update
- for EvolutionStorage change
-
-2003-03-12 Jeffrey Stedfast <fejj@ximian.com>
+2003-03-13 Jeffrey Stedfast <fejj@ximian.com>
- * mail-signature-editor.c (menu_file_save_cb): Rewritten to do the
- same as the composer's build_message() code.
-
-2003-03-11 Jeffrey Stedfast <fejj@ximian.com>
-
- * mail-accounts.c (account_add_clicked): Use
- gtk_window_set_transient_for() on the druid with the settings
- dialog as the parent window.
+ * mail-format.c (try_uudecoding): Don't use isspace() when looking
+ for the beginning of the filename, instead just check for ' ' and
+ '\t'. If the first non-blank location == eoln, then this is not a
+ valid uuencode line, so abort.
+ (handle_text_plain): Instead of using !g_strcasecmp (mime_type,
+ "text/plain") to see if the part is really text/plain, check
+ instead the ContentType on the CamelDataWrapper since mime_type
+ could be just the handler type. This will prevent uudecoding of
+ parts that are actually application/octet-stream which were
+ detected as text/plain by gnome-vfs.
2003-03-10 Jeffrey Stedfast <fejj@ximian.com>
- * mail-signature-editor.c (do_exit): Remove the yes/no
- buttons. Fixes bug #39382.
-
- * mail-accounts.c (account_able_toggled): New callback function to
- handle the checkbox getting toggled.
- (mail_accounts_treeview_new): Save the toggle renderer so we can
- later connect to it's toggled signal.
- (mail_accounts_tab_construct): Connect to the toggle-cell's
- toggled signal. Fixes bug #39325.
-
-2003-03-11 Not Zed <NotZed@Ximian.com>
-
- * mail-vfolder.c (vfolder_editor_response): Fix the response code,
- because some bastard changed the filter/* code and didn't fix the
- callers. Partial fix for #39165.
-
-2003-03-10 Not Zed <NotZed@Ximian.com>
-
- * Makefile.am (libevolution_mail_la_SOURCES): removed main.c from
- the build.
-
- * component-factory.c (component_factory_init): Remove, not used
- anymore, causes linking problems some places.
- (factory): Removed the debug printf. Added a case for the
- composer. Part of fixing #39256.
-
-2003-03-07 Jeffrey Stedfast <fejj@ximian.com>
-
- All this snot just to fix bug #38925 and an attempt to fix bug
- #38926 (but it seems no matter what I do, I can't work around the
- bonoboness/modality/whatever of the shell's preferences dialog).
-
- * mail-account-gui.c (sig_add_new_signature): Get the toplevel
- parent GtkWindow and pass that along to
- mail_composer_prefs_new_signature() so that window layering can be
- done correctly.
-
- * mail-composer-prefs.c (mail_composer_prefs_new_signature):
- Simplify. We don't want to add the signature to the list until
- after they have saved.
- (sig_edit_cb): Pass FALSE as the is_new argument to
- mail_signature_editor().
- (sig_event_client): Listen for signatures being added.
- (mail_composer_prefs_new_signature): Now takes a GtkWindow arg as
- the first arg rather than a MailComposerPrefs arg since we don't
- really need it to be a MailComposerPrefs object. We'd rather use
- the first arg as the parent GtkWindow so that we can set
- transience for the editor window.
-
- * mail-signature-editor.c (mail_signature_editor): Now takes a
- 'parent' argument (so we can set transient_for()) and a 'is_new'
- argument specifying whether the editor is editing a new signature
- or not. If it is, when the user saves, it will be added to the
- signature list. otherwise it won't.
- (sig_name_changed): Only use the mail_config_signature_set_name()
- interface if it is *not* a new signature.
- (menu_file_save_cb): If is_new, then save the signature to the
- config - otherwise do what we did before and set the modifications
- to it and emit the CHANGED event.
-
- * mail-config.c (mail_config_signature_new): Renamed from
- mail_config_signature_add(). We no longer immediately add the
- signature to the list of saved signatures.
- (mail_config_signature_add): New function which adds the signature
- and emits the SIG_ADDED event.
-
-2003-03-07 Jeffrey Stedfast <fejj@ximian.com>
-
- * mail-display.c (on_url_requested): If the part url is a text
- part, use mail_format_data_wrapper_write_to_stream(). This should
- fix bug #39204.
-
- * mail-format.c (mail_format_data_wrapper_write_to_stream): Make public.
-
-2003-03-06 Ettore Perazzoli <ettore@ximian.com>
-
- * mail-accounts.c (mail_accounts_treeview_new): Set the
- shadow_type of the scrlled window to GTK_SHADOW_IN.
-
-2003-03-06 Ettore Perazzoli <ettore@ximian.com>
-
- * mail-config.glade: Add some spacing to the buttons. [#38227]
-
-2003-03-06 Ettore Perazzoli <ettore@ximian.com>
-
- * importers/evolution-mbox-importer.c (IN): Use G_GNUC_FUNCTION
- instead of __FUNCTION__.
- (OUT): Likewise.
- * importers/netscape-importer.c (netscape_import_file): Likewise.
- * mail-send-recv.c (receive_done): Likewise.
- * mail-summary.c (SUMMARY_OUT): Likewise.
- (SUMMARY_IN): Likewise.
- (folder_changed_cb): Likewise.
- (message_changed_cb): Likewise.
-
-2003-03-06 Jeffrey Stedfast <fejj@ximian.com>
-
- * folder-browser-factory.c: #include <string.h>
-
- * e-searching-tokenizer.c (camel_utf8_getc): Don't use __inline__
- as not all platforms/compilers support this keyword.
- (g): Same.
-
-2003-03-06 Not Zed <NotZed@Ximian.com>
-
- * component-factory.c (owner_unset_cb): remove debug printf.
-
-2003-03-05 Not Zed <NotZed@Ximian.com>
-
- * component-factory.c (idle_quit): Removed old quit code.
- (owner_unset_cb): Make this call synchronous. Wont cover all
- cases but should be ok most of the time.
+ * mail-session.c (request_password): No need to convert the prompt
+ from Camel into UTF-8 (first, gtk widgets don't want UTF-8 and
+ second, the camel strings are already translated). Fixes bug
+ #36453.
2003-03-04 Jeffrey Stedfast <fejj@ximian.com>
- * mail-search.c: Prototype some functions to shut the compiler up.
-
- * mail-callbacks.c (composer_get_message): Go back to using
- e_destination_get_address() but use the camel-address parser on
- the strings to make sure they are non-empty. Fixes bug #37854.
-
-2003-03-03 Jeffrey Stedfast <fejj@ximian.com>
-
- * mail-signature-editor.c (menu_file_save_cb): Use 'filename' when
- creating the uri rather than using the uninitialised 'uri'
- variable to create itself. Fixes bug #38864.
-
-2003-03-03 Not Zed <NotZed@Ximian.com>
-
- * mail-session.c (do_user_message): Do the same as below for
- request_password, so we dont leave a mainloop lying around.
-
-2003-03-03 Jeffrey Stedfast <fejj@ximian.com>
-
- * mail-session.c (request_password): Don't connect to the response
- signal if we are in the main thread - instead just use the return
- value from gtk_dialog_run and then call pass_response() with the
- response value.
-
-2003-03-03 Not Zed <NotZed@Ximian.com>
-
- * subscribe-dialog.c (fe_got_children): Remove the
- e_tree_memory_sort_node, currently it crashes inside gal, the root
- node seems to get free'd under it.
-
-2003-02-26 Jeffrey Stedfast <fejj@ximian.com>
-
- * mail-preferences.c: Reverted back to using e-iconv
-
- * mail-composer-preferences.c: Same.
-
-2003-02-26 Dan Winship <danw@ximian.com>
-
- * GNOME_Evolution_Mail.server.in.in: add a repo_id and a priority
- level to the startup wizard
-
-2003-02-25 Jeffrey Stedfast <fejj@ximian.com>
-
- * mail-format.c: Reverted back to using e-iconv instead of
- camel-iconv.
-
-2003-02-25 Dan Winship <danw@ximian.com>
+ * mail-callbacks.c (composer_get_message): Revert my prior change
+ to this code as it prevented users from sending to
+ address-lists. Instead make the code decode the addresses from
+ e_destination_get_address() to make sure they contain a valid
+ address (or list of addresses). See bug #37854 for details.
- * mail-config-druid.c: Update for new EvolutionWizard interfaces.
-
-2003-02-25 Dan Winship <danw@ximian.com>
-
- * mail-config-druid.c: Redo this to not use the CORBA interfaces
- in the local case (in preparation for redoing the CORBA
- interfaces).
- (mail_config_druid_new): Remove unused "shell" arg
-
- * mail-account-gui.c (mail_account_gui_transport_complete): Don't
- crash if there's no transport selected at all.
- (mail_account_gui_new): Don't try to set cc_addrs/bcc_addrs if
- they're NULL.
-
- * mail-accounts.c (account_add_clicked): Don't need to pass shell
- to mail_config_druid_new.
-
- * mail-callbacks.c (configure_mail): Don't need to pass shell to
- mail_config_druid_new.
-
-2003-02-24 Jeffrey Stedfast <fejj@ximian.com>
-
- * mail-session.c (request_password): Make sure m->config_service
- is non-NULL before using m->config_service->save_passwd since PGP
- stuff will not have a config_service. Fixes bug #38149.
-
- * mail-account-gui.c (mail_account_gui_save):
- s/e_account_list_changed/e_account_list_change - otherwise we get
- an undefined symbol and we crash :-)
-
- * mail-composer-prefs.c (mail_composer_prefs_new_signature): Don't
- always append "[script]" to the signature name. Also cleaned up
- some memory leakage.
-
-2003-02-20 Not Zed <NotZed@Ximian.com>
-
- * mail-preferences.c (mail_preferences_apply): fix the g_snprintf
- stuff.
-
- * mail-config.c (mail_config_add_account): Use new
- e_account_list_add.
- (mail_config_remove_account): Use new e_account_list_remove.
- (mail_config_set_default_account): Similarly for
- e_account_list_set_default.
- (mail_config_get_default_account): Same for
- e_account_list_get_default.
- (mail_config_get_account_by_name): Use e_account_list_find.
+2003-02-23 Jeffrey Stedfast <fejj@ximian.com>
- * mail-account-gui.c (mail_account_gui_save): use new
- e_account_list_changed call instead of manual signalling.
+ * mail-format.c (write_text_header): Add
+ E_TEXT_TO_HTML_CONVERT_SPACES to the flags. Fixes bug #38499.
2003-02-23 Jeffrey Stedfast <fejj@ximian.com>
@@ -556,440 +48,21 @@
string rather than NULL to prevent a segfault on solaris. Fixes
bug #38418.
-2003-02-23 Jeffrey Stedfast <fejj@ximian.com>
-
- * mail-format.c (write_text_header): bitwise-or in
- CAMEL_MIME_FILTER_TOHTML_CONVERT_SPACES to fix bug #38499.
-
- * mail-search.c (mail_search_destroy): New overloaded virtual
- method, does what dialog_destroy_cb was trying to do.
- (mail_search_construct): Connect to the "response" signal rather
- than "clicked" to correspond to the GtkDialog API
- (instead og the old GnomeDialog API).
- (dialog_response_cb): Changed the function name and made it check
- button == GTK_RESPONSE_ACCEPT to search, any other button
- closes. Fixes bug #37947.
-
-2003-02-21 Hans Petter Jansson <hpj@ximian.com>
-
- * component-factory.c (factory): Don't try to get a FontPrefs control.
-
- * mail-config-factory.c (mail_config_control_factory_cb): Just return
- NULL if a FontPrefs control was requested.
-
- * mail-config.c (mail_config_get_default_account): If no accounts
- are defined, don't try to set the default account.
-
-2003-02-21 Dan Winship <danw@ximian.com>
-
- * Makefile.am (libevolution_mail_la_LIBADD): Remove libebook's
- dependencies.
-
- * importers/Makefile.am (libevolution_pine_importer_la_LIBADD):
- Likewise.
-
-2003-02-21 Dan Winship <danw@ximian.com>
-
- * mail-account-gui.c (mail_account_gui_build_extra_conf): Use
- tables instead of vboxes, so that groups of label/entry pairs (as
- in Connector's config page) can line up nicely.
-
- * mail-config.glade: Turn extra_vbox and extra_mailcheck_vbox into
- tables.
-
- * mail-config-druid.c (get_fn): s/extra_vbox/extra_table/
-
- * Makefile.am (libevolution_mail_la_LIBADD):
- s/libcomposer.a/libcomposer.la/
-
2003-02-20 Jeffrey Stedfast <fejj@ximian.com>
- * mail-callbacks.c (mark_all_as_seen): Use
- camel_folder_free_uids().
-
- * mail-format.c (write_headers): Use
- camel_charset_canonical_name() here instead of
- e_iconv_charset_name().
-
- * mail-preferences.c (mail_preferences_construct): Same as below.
- (mail_preferences_apply): Again here.
-
- * mail-composer-prefs.c (mail_composer_prefs_construct): Use
- camel_charset_locale_name() here instead of
- e_iconv_locale_charset().
- (mail_composer_prefs_apply): Same.
-
-2003-02-20 Dan Winship <danw@ximian.com>
-
- * Makefile.am (libevolution_mail_la_LIBADD):
- s/libemiscwidgets.a/libemiscwidgets.la/ and likewise for
- libefilterbar
+ * mail-callbacks.c (flag_messages): Revert a bogus patch that I
+ must have accidently committed?
2003-02-18 Jeffrey Stedfast <fejj@ximian.com>
- * mail-callbacks.c (mark_all_as_seen): Fixed a memory leak - make
- sure to free all uids.
-
- * mail-config.c (uri_to_key): Removed.
- (lookup_signature): Removed.
- (xml_get_int): Removed.
- (xml_get_bool): Removed.
- (mail_config_get_time_24hour): Removed.
-
- * evolution-mail.schemas: s/long/int/g and change default_account
- to be a string instead of an int.
-
- * mail-config.c (mail_config_get_default_account): default_account
- now uses the account uid, so change the code a bit to match uid
- strings rather than use an index.
- (mail_config_remove_account): Same here. simplifies the code a
- bunch.
- (mail_config_set_default_account): Here too.
-
- * folder-browser-ui.c (folder_browser_ui_setup_view_menus): Update
- the GalView path.
-
-2003-02-14 Jeffrey Stedfast <fejj@ximian.com>
-
- * mail-session.c (do_get_pass): Change the logic here
- slightly. Instead of only reprompting the user if the cache is
- empty, also reprompt the user if the backend is forcing a
- reprompt.
- (request_password): If we have a cached passwd string for the
- account, fill-in the GtkEntry box with that value by
- default. This, together with the camel changes, fixes the
- "Evolution forgets my POP passwd if it gets a -ERR response during
- the login phase" bug.
-
-2003-02-13 Jeffrey Stedfast <fejj@ximian.com>
-
- * e-searching-tokenizer.c: #include <stdio.h>
-
- * mail-config-factory.c: #include <string.h>
-
- * mail-config-druid.c (identity_prepare): Use
- gtk_editable_select_region() since gtk_entry_select_region() has
- been deprecated.
- (construct): Use gtk_window_set_resizable() instead of
- gtk_window_set_policy().
- (wizard_free): account_destroy() is no longer around, use
- g_object_unref() instead. (how did this even compile before?)
-
- * mail-account-gui.c (mail_account_gui_build_extra_conf): Use
- gtk_label_set_text_with_mnemonic() instead of
- gtk_label_parse_uline() as the latter has been deprecated.
-
-2003-02-12 Jeffrey Stedfast <fejj@ximian.com>
-
- * importers/netscape-importer.c: Removed unused variables.
-
- * importers/pine-importer.c: Removed unused variables.
- (parse_address): Removed - it's unused and we have CamelAddress
- available to us anyway.
-
- * importers/elm-importer.c: Removed unused variables.
-
- * importers/evolution-mbox-importer.c (load_file_fn): Removed an
- unused variable.
-
-2003-02-11 Jeffrey Stedfast <fejj@ximian.com>
-
- * mail-account-editor.c (construct): Use
- gtk_window_set_resizable() instead of gtk_window_set_policy().
-
- * mail-config.c: Fix a bunch of warnings.
- (mail_config_signature_write): Removed.
-
- * mail-callbacks.c: Removed unused variables.
-
- * mail-accounts.c (mail_accounts_tab_class_init): Register a
- destroy virtual method.
- (mail_accounts_tab_destroy): Set mail_display->destroyed = TRUE.
-
- * message-list.c (message_list_destroy): Set
- mail_display->destroyed = TRUE. This is a workaround for the
- GTK_OBJECT_DESTROYED() macro that we used to use before.
-
- * mail-display.c (mail_display_destroy): Set
- mail_display->destroyed = TRUE. This is a workaround for the
- GTK_OBJECT_DESTROYED() macro that we used to use before.
-
-2003-02-10 Jeffrey Stedfast <fejj@ximian.com>
-
- * message-list.c (build_tree): Use g_signal_emit() rather than
- gtk_signal_emit().
- (build_flat): Same here.
-
- * mail-signature-editor.c: #include <string.h>
-
- * mail-vfolder.c: #include <string.h>
-
- * mail-session.c: #include <string.h>
-
- * mail-search.c: #include <string.h>
-
- * mail-mt.c: #include <string.h>
-
- * mail-ops.c (save_part_save): Use strcasecmp() instead of
- g_strcasecmp().
-
- * mail-local.c: #include <string.h>
- (reconfigure_folder_reconfigured): Use a GtkDialog instead of
- gnome_error_dialog().
-
- * mail-format.c (find_preferred_alternative): Use g_ascii_strdown
- since g_strdown is deprecated.
- (fake_mime_part_from_data): Removed, no longer used it seems.
- (destroy_part): Also removed.
-
- * mail-display.c (make_popup_window): Replace call to
- gtk_window_set_polociy() with gtk_window_set_resizable() instead.
- (popup_size_allocate_cb): Use gtk_window_set_position() with
- GTK_WIN_POS_MOUSE instead of calculating the position to put it
- in.
-
-2003-02-10 Ettore Perazzoli <ettore@ximian.com>
-
- * importers/Makefile.am: Split the ORBit IDL compilation rules to
- work properly with parallel makes.
- (BUILT_SOURCES): Add this.
- (CLEANFILES): Add this.
-
- * Makefile.am: Split the ORBit IDL compilation rules to work
- properly with parallel makes.
- (BUILT_SOURCES): Add $(IDL_GENERATED) here.
- (CLEANFILES): Remove from here.
-
-2003-02-10 Rodney Dawes <dobey@ximian.com>
-
- * importers/Makefile.am: Add LDFLAGS to ported libs
-
-2003-02-10 Larry Ewing <lewing@ximian.com>
-
- * mail-display.c (save_url): look in the http cache for images
- when saving
- (image_save_as): remove random warning.
- (do_external_viewer): remove unused variable.
- (do_attachment_header): use g_ascii_strdown
-
-2003-02-07 Larry Ewing <lewing@ximian.com>
-
- * mail-display.c (save_data_cb): don't use random memory as a
- gconf client.
-
-2003-02-06 Chris Toshok <toshok@ximian.com>
-
- * importers/pine-importer.c (import_addressbook): track change to
- e_book_load_uri type.
-
-2003-02-06 Ettore Perazzoli <ettore@ximian.com>
-
- * folder-browser.c (on_right_click): Use
- e_auto_kill_popup_menu_on_selection_done() instead of
- e_auto_kill_popup_menu_on_hide().
-
-2003-02-06 Dan Winship <danw@ximian.com>
-
- * Makefile.am (INCLUDES): add EVOLUTION_PRIVDATADIR. Fix
- EVOLUTION_ICONSDIR
-
- * component-factory.c (owner_set_cb): Use EVOLUTION_PRIVDATADIR
- * mail-autofilter.c (filter_gui_add_from_message): Likewise
- (mail_filter_rename_uri): Likewise
- (mail_filter_delete_uri): Likewise
- * mail-callbacks.c (filter_edit): Likewise.
- * mail-search-dialogue.c (mail_search_dialogue_construct):
- Likewise
- * mail-session.c (main_get_filter_driver): Likewise
- * mail-summary.c (generate_folder_summaries): Likewise
- * mail-vfolder.c (vfolder_load_storage): Likewise
-
-2003-02-06 Dan Winship <danw@ximian.com>
-
- * Makefile.am: Remove *dir defs that are in configure.in now
- (INCLUDES): clean up using new *dir variables
- (libevolution_mail_la_LDFLAGS): remove -export-dynamic, add
- -module
-
- * main.c (main): s/PACKAGE/GETTEXT_PACKAGE/ in gettext init
-
- * importers/Makefile.am (INCLUDES): change EVOLUTION_DATADIR to
- EVOLUTION_PRIVDATADIR
-
- * importers/netscape-importer.c (netscape_import_filters): use
- EVOLUTION_PRIVDATADIR
-
-2003-02-06 Larry Ewing <lewing@ximian.com>
-
- * mail-session.c (pass_activate): add an activate handler to the
- entry so that hitting return will return an OK response.
-
-2003-02-05 Dan Winship <danw@ximian.com>
-
- * main.c (main): s/glade_gnome_init/glade_init/
-
-2003-02-05 Not Zed <NotZed@Ximian.com>
-
- * importers/netscape-importer.c: update from ../../importers/.
- (main): Removed.
- (mail_importer_module_init): Setup module init fn.
- (factory_fn): api changes.
- (is_dir_empty): deprecated changes, and clean up logic.
- (importer_cb): pulse progress bar, use idle function for
- processing next item.
- (import_next): Remove link before recursing, also fix memleak, and
- api changes.
- (netscape_import_file): dont release importer.
- (*): gconf'ify
-
- * importers/elm-importer.c (elm_factory_fn): Track the
- evolution_intelligent_importer, so we can unref it when done.
- (*): gconf'ify.
-
- * importers/pine-importer.c (parse_line): use gobject stuff rather
- than gtkobject.
- (import_addressfile): close down 'properly' when finished.
- (importer_timeout_fn): Do most processing decisions here, either
- from a timeout or idle function. This prevents us getting 1 stack
- frame per message and per folder. Close down properly also.
- (importer_cb): Add a timeout, ignore the callback, or add an idle
- function to process the next item.
- (pine_import_file): dont release the importer if we can't load it,
- its released elsewhere, i think.
- (import_addressfile): step the progress bar as we go.
- (factory_fn): Track the evolution_intelligent_importer, so we can
- unref when done.
- (*): gconf'ify
-
-2003-01-31 Not Zed <NotZed@Ximian.com>
-
- * importers/elm-importer.c (elm_can_import): g_file_exists ->
- lstat, and g_build_filename api changes.
-
- * importers/pine-importer.c: moved from
- ../../importers/pine-importer.c
- (factory_fn): oaf->bonobo_activation
- (mail_importer_module_init): setup factory.
- (main): Removed.
- (*): REemove bonobo config stuff.
- (factory_fn): destroy signal -> weak ref.
- (pine_destroy_cb): Fix signature for weak ref notify.
- (import_addressfile): use new glib filename stuff.
- (import_addressbook): same.
- (pine_can_import): and here.
- (import_next): and here.
- (scan_dir): and here
- (pine_create_structure): And here.
- (pine_can_import): g_file_exists -> lstat.
- (importer_cb): If there are more items, use an idle handler to
- drop back a few stack frames rather than recursing for each
- message.
- (import_next): unlink data from dir_list before recursing, and fix
- leak.
-
-2003-01-30 Not Zed <NotZed@Ximian.com>
-
- * importers/elm-importer.c (elm_destroy_cb): Change for weak ref
- setup.
- (elm_factory_fn): destroy -> weak ref.
-
-2003-01-29 Not Zed <NotZed@Ximian.com>
-
- * importers/elm-importer.c (importer_cb): Pass processItem off to
- an idle handler, so we dont blow our stacks. Also update to use
- progress_bar_pulse().
- (import_item_idle): Get the next message here instead.
- (import_next): Fix a glist leak. Unlink the file before we import
- it too. And close the dialogue and clean up when we've run out of
- folders to import.
-
-2003-01-17 Not Zed <NotZed@Ximian.com>
-
- * importers/elm-importer.c (elm_create_structure): use/free elmdir
- rather than double-free maildir.
-
-2003-01-16 Not Zed <NotZed@Ximian.com>
-
- * importers/elm-importer.c: update from ../importers/elm-importer.c
-
-2003-02-03 Jeffrey Stedfast <fejj@ximian.com>
-
- * message-list.c (mail_regen_list): Get the thread_subject setting
- here instead of in regen_list_regen since that function will be
- called in another thread and we can't make corba calls in anything
- but the main thread.
- (regen_list_regen): Don't make CORBA calls here! (shame on me).
-
- * mail-identify.c (mail_identify_mime_part): Just use
- gnome_vfs_get_mime_type_from_name() so we can forget all the crap
- I implemented before.
-
-2003-02-01 Jeffrey Stedfast <fejj@ximian.com>
-
- * mail-display.c (on_link_clicked): Pass in the *address* of the
- GError to gnome_url_show(), otherwise bad things happen :-)
-
-2003-01-31 Jeffrey Stedfast <fejj@ximian.com>
-
- * mail-config.c (mail_config_get_labels): New function to return a
- cached list of labels.
- (mail_config_get_label_color_by_name): New convenience function to
- search the cached labels.
- (mail_config_get_label_color_by_index): Same.
- (mail_config_init): Cache the labels and also listen for changes
- to them in the gconf db.
- (config_cache_labels): Internal function to cache the labels.
+ * mail-callbacks.c (mark_all_as_seen): Fixed a memory leak. We
+ need to free each individual uid string in the array, they aren't
+ const char *'s.
- * folder-browser.c (on_right_click): Fixed the label colours in
- the menu by using the cached linked list of labels.
-
- * mail-preferences.c (colorpicker_set_color): Now takes a string
- argument allowing us to get rid of converting a string into an rgb
- guint32 all over the place when trying to set defaults, since we
- now store colors in gconf as strings.
- (mail_preferences_construct): Use the cached labels (they are
- already parsed for us).
-
-2003-01-27 Jeffrey Stedfast <fejj@ximian.com>
-
- * component-factory.c (storage_remove_folder): Change
- strcmp(fi->path, path) to strcmp(fi->name, name) and now the
- execution takes the right path. My patch base on Callie's patch
- for bug #33525.
-
- * mail-identify.c (mail_identify_mime_part): Fixed a #warning by
- converting a local path into a file: uri before feeding it to
- gnome-vfs.
-
- * message-list.c (message_list_set_folder): Removed a FIXME that
- I've decided is no longer needed.
-
-2003-01-22 Jeffrey Stedfast <fejj@ximian.com>
-
- * mail-config.c (mail_config_add_account): Emit the account-added
- event.
- (mail_config_remove_account): Emit the account-removed event.
-
- * mail-account-gui.c (mail_account_gui_save): Emit the changed
- event on the account-list for the changed account.
-
-2003-01-24 Jeffrey Stedfast <fejj@ximian.com>
-
- * folder-browser-ui.c (folder_browser_ui_add_global): Set the
- paned_size here.
-
- * folder-browser.c (folder_browser_gui_init): Don't bother
- connecting to the hide-deleted, message-display-style, paned-size,
- nor show-preview gconf notifications anymore, since we can just
- set them when the view becomes active again in
- folder-browser-ui.c. Cuts down on extra overhead.
- (folder_browser_destroy): No need to disconnect from those
- notifications anymore either.
-
-2003-01-24 Ettore Perazzoli <ettore@ximian.com>
+2003-01-24 Not Zed <NotZed@Ximian.com>
- * Makefile.am (iconsdir): Remove, this is now defined in
- configure.in.
+ * mail-local.c (non_equal): We do actually need to check they are
+ file url's, otherwise, all file url's match.
2002-12-07 leon.zhang <leon.zhang@sun.com>
@@ -1009,636 +82,31 @@
send_to_url.
Fixes bug #35123 #35289
+
+2003-01-24 Antonio Xu <antonio.xu@sun.com>
-2003-01-24 Not Zed <NotZed@Ximian.com>
-
- * mail-local.c (non_equal): We do actually need to check they are
- file url's, otherwise, all url's match.
-
-2003-01-23 Rodney Dawes <dobey@ximian.com>
-
- * folder-browser.c (fb_resize_cb): Use button_release instead of
- size_allocate, and get the position from the Paned widget to prevent
- calling CORBA all the time for GConf stuff
-
-2003-01-23 Ettore Perazzoli <ettore@ximian.com>
-
- * Makefile.am (componentdir): Removed definition; this is now
- defined in configure.in.
-
-2003-01-22 Jeffrey Stedfast <fejj@ximian.com>
-
- * mail-config.c (mail_config_get_thread_list): Removed.
- (mail_config_set_thread_list): Removed.
- (mail_config_uri_renamed): No longer needs to change threaded
- state for each url either.
- (mail_config_write_on_exit): Updated.
-
- * folder-browser-ui.c (folder_browser_ui_add_list): Get the
- threaded state via gconf.
-
- * folder-browser.c (folder_browser_toggle_threads): Save the
- threaded state.
-
-2003-01-22 Ettore Perazzoli <ettore@ximian.com>
-
- * folder-browser-ui.c (folder_browser_ui_setup_view_menus): Use
- EVOLUTION_GALVIEWSDIR.
-
- * message-browser.c (set_bonobo_ui): Get
- evolution-mail-messagedisplay.xml from EVOLUTION_UIDIR.
-
- * mail-signature-editor.c (mail_signature_editor): Get
- evolution-signature-editor.xml from EVOLUTION_UIDIR.
-
- * folder-browser-ui.c (ui_add): Get the evoluiton-mail* XML files
- from EVOLUTION_UIDIR.
-
- * Makefile.am (INCLUDES): Define EVOLUTION_GALVIEWSDIR; update
- EVOLUTION_IMAGESDIR to include the $(BASE_VERSION).
- (gladedir): Version using $(BASE_VERSION).
- (etspecdir): Likewise.
- (iconsdir): Likewise.
- (buttonsdir): Likewise.
- (etspecdir): Likewise.
-
- * component-factory.c (owner_set_cb): Look for vfoldertypes.xml in
- the new version-aware location.
- * mail-summary.c (generate_folder_summaries): Likewise.
- * mail-search-dialogue.c (mail_search_dialogue_construct): Likewise.
- * mail-vfolder.c (vfolder_load_storage): Likewise.
-
- * mail-autofilter.c (filter_gui_add_from_message): Look for
- filtertypes.xml in the new version-aware location.
- (mail_filter_rename_uri): Likewise.
- (mail_filter_delete_uri): Likewise.
- * mail-session.c (main_get_filter_driver): Likewise.
- * mail-callbacks.c (filter_edit): Likewise.
-
-2003-01-22 Radek Doulik <rodo@ximian.com>
-
- * mail-callbacks.c (do_mail_print): put unrealized html widget
- into top level widget (gtk window) before realizing it
- destroy temporary widgets (w, html)
-
-2003-01-21 Jeffrey Stedfast <fejj@ximian.com>
-
- * mail-config.c (mail_config_remove_account): Don't unref the
- account object, e_list_remove() apparently handles this for us.
-
- * mail-accounts.c (account_delete_clicked): Don't unref the
- confirm dialog, it was already destroyed.
-
-2003-01-20 Jeffrey Stedfast <fejj@ximian.com>
-
- * evolution-mail.schemas: Default to hiding deleted
- messages. Fixes bug #35929.
-
- * mail-preferences.c (entry_changed): Removed.
- (toggle_button_toggled): Removed.
- (settings_changed): New callback that replaces the two above. No
- need to have multiple callback functions when the signature is the
- same.
-
- * folder-browser.c (folder_browser_toggle_hide_deleted): Don't
- !atoi (state) for the message_list_set_hidedeleted() call.
-
-2003-01-18 Larry Ewing <lewing@ximian.com>
-
- * mail-callbacks.c (save_msg_ok): e_question returns a boolean,
- don't test for a specific value.
-
- * mail-display.c (html_button_press_event): make the event
- handlers return FALSE so that gtkhtml can process the events.
- (on_link_clicked): call gnome_url_show with all its arguments so
- that it actually does something. Also pass news and nntp urls to
- gnome_url_show so that they can be handled properly.
-
-2003-01-17 Larry Ewing <lewing@ximian.com>
-
- * mail-format.c (handle_text_enriched): wrap eriched entries with
- a table so that they get proper indentation.
-
-2003-01-17 Jeffrey Stedfast <fejj@ximian.com>
-
- * mail-session.c (do_get_pass): Updated.
- (request_password): Same.
-
- * mail-send-recv.c (mail_send): Fixed to use EAccountService.
-
- * mail-config-druid.c (make_account): Updated to use EAccount and
- friends.
-
- * mail-account-gui.c (service_check_supported): Updated to use
- EAccountService.
- (mail_account_gui_new): Ref the account passed in and also update
- to use EAccount objects.
- (save_service): Updated to use an EAccountService.
- (add_new_store): Updated to use an EAccount.
- (mail_account_gui_save): Updated to use EAccounts.
- (setup_signatures): Updated because the new account->id->def_sig
- is now an int and not a structure pointer.
-
- * mail-account-editor.c (construct): Updated.
- (mail_account_editor_new): Now takes an EAccount object as an
- argument instead of a MailConfigAccount.
-
- * mail-crypto.c (mail_crypto_get_pgp_cipher_context): Updated to
- use EAccounts.
-
- * subscribe-dialog.c (populate_store_foreach): Removed.
- (populate_store_list): Can't use populate_store_foreach here
- because of the change to EAccountList so do it manually.
-
- * mail-vfolder.c (uri_is_ignore): Rewrote to use EAccountList and
- EIterator and all that fun.
-
- * mail-send-recv.c (build_dialogue): Updated to use EAccountList
- and EAccount object stuff. *ugh*
- (mail_send_receive): Here too.
- (mail_autoreceive_setup): Same.
-
- * mail-callbacks.c (check_send_configuration): Updated.
- (composer_get_message): Updated.
- (compose_msg): "
- (list_add_addresses): "
- (guess_me): "
- (guess_me_from_accounts): Same.
- (forward_get_composer): Here too.
- (mail_generate_reply): Same.
- (redirect_get_composer): "
- (empty_trash): And finally here.
-
- * mail-accounts.c (account_edit_clicked): Updated.
- (account_delete_clicked): Same.
- (account_default_clicked): Here too.
- (account_able_clicked): "
- (account_cursor_change): "
- (mail_accounts_load): Again here.
-
- * folder-browser.c (folder_browser_is_drafts): Updated to use
- EAccountList and EAccount stuff.
- (folder_browser_is_sent): Same.
-
- * component-factory.c (mail_load_storages): Updated to use
- EAccount and EAccountList stuff.
- (owner_set_cb): Same.
- (send_receive_cb): Here too.
-
- * mail-config.c: Rewritten to use EAccount and EAccountList
- objects.
-
-2003-01-16 Jeffrey Stedfast <fejj@ximian.com>
-
- * mail-config-druid.c (get_fn): Connect to the toggled event on
- the transport_needs_auth toggle button so if the user turns this
- off after having deleted the username field, the Next button
- becomes re-enabled. Fixes bug #36862.
-
-2003-01-16 Jeffrey Stedfast <fejj@ximian.com>
-
- * mail-composer-prefs.c (sig_fill_clist): Same as below.
-
- * mail-account-gui.c (sig_fill_options):
- mail_config_get_signature_list() now returns a GSList instead of a
- GList.
-
- * mail-config.c (signature_new_from_xml): New function to parse a
- signature xml blob into a MailConfigSignature structure.
- (config_read_signatures): Rewritten to use above function.
- (signature_to_xml): New function to write a signature to xml.
- (config_write_signatures_num): Removed.
- (config_write_signature): Removed.
- (config_write_signatures): Rewritten to use signature_to_xml and
- gconf.
-
-2003-01-16 Dan Winship <danw@ximian.com>
-
- * mail-config.h (MailConfigAccount): Add a UID field (to match
- EAccount), which never changes and can be used by gconf watchers
- to distinguish an account rename from a deletion and creation.
-
- * mail-config.c (account_copy): Create a new UID on the new
- account.
- (account_new_from_xml): Read the UID. (If it doesn't have one,
- make one.)
- (account_to_xml): Write the UID.
-
- * mail-config-druid.c (make_account): add a UID to each account
-
-2003-01-15 Not Zed <NotZed@Ximian.com>
-
- * mail-accounts.c (account_able_clicked): Change the
- enable/disable button when the state changes.
-
-2003-01-15 Jeffrey Stedfast <fejj@ximian.com>
-
- * mail-local.c (save_metainfo): Back to using e_xml_save_file().
-
-2003-01-14 Ettore Perazzoli <ettore@ximian.com>
-
- * message-tag-editor.c (message_tag_editor_init): Make dialog
- Cancel/OK to match HIG.
-
- * mail-signature-editor.c (do_exit): Make confirmation dialog
- Discard/Cancel/Save to match the HIG.
-
- * mail-composer-prefs.c (mail_composer_prefs_construct): Make
- dialog Cancel/OK to match HIG.
-
- * mail-account-editor.c (construct): Make the dialog
- Apply/Close/OK to match HIG.
-
-2003-01-14 Jeffrey Stedfast <fejj@ximian.com>
-
- * mail-account-gui.c (mail_account_gui_save): Call
- mail_config_save_accounts ().
-
- * mail-config.c (mail_config_save_accounts): New function to save
- accounts without having to re-load them.
-
-2003-01-14 Radek Doulik <rodo@ximian.com>
-
- * folder-browser.c (etree_key): use gtk_scrolled_window_*
- functions for mail_display->scroll
-
- * mail-display.c (mail_display_new): use gtk_scrolled_window_*
- functions
-
- * mail-display.h: use GtkScrolledWindow instead of EScrollFrame
-
-2003-01-14 Jeffrey Stedfast <fejj@ximian.com>
-
- * mail-display.c (pixmap_press): Change the user_data argument to
- be of type gpointer instead of EScrollFrame, since, well, it's not
- an EScrollFrame anymore.
-
-2003-01-14 Ettore Perazzoli <ettore@ximian.com>
-
- * Makefile.am (libevolution_mail_la_SOURCES): Add mail-format.h.
- (EXTRA_DIST): Add $(schema_DATA).
-
-2003-01-14 Rodney Dawes <dobey@ximian.com>
-
- * Makefile.am: Make the component be unversioned as a shlib
-
-2003-01-14 Rodney Dawes <dobey@ximian.com>
+ * component-factory.c (storage_remove_folder): Change
+ strcmp(fi->path, path) to strcmp(fi->name, name) and now the
+ execution takes the right path. My patch base on Callie's patch
+ for bug #33525.
- * folder-browser.c: Use GtkPaned instead of EPaned
-
2003-01-13 Jeffrey Stedfast <fejj@ximian.com>
- * mail-config.c (account_new_from_xml): Perform some sanity
- checking on the auto-check-timeout value.
-
* folder-browser.c (folder_browser_copy): Correctly create the
clipboard buffer by using a nul to delimit the uri and the list of
uids.
- * folder-browser-ui.c (folder_browser_ui_add_message): Check the
- state of message_style in gconf and set the menus accordingly.
-
- * folder-browser.c (folder_browser_destroy): Remove listener for
- message_style change notification.
- (folder_browser_gui_init): Connect a listener for changes to
- message_style.
-
- * mail-config.c (account_to_xml): Save the auto-check timeout
- value.
- (account_new_from_xml): Load the auto-check-timeout value.
-
-2003-01-13 Dan Winship <danw@ximian.com>
-
- * folder-info.c: s/BonoboXObject/BonoboObject/
-
- * mail-config.c: Likewise
-
- * mail-offline-handler.c: Likewise
-
-2003-01-13 Not Zed <NotZed@Ximian.com>
-
- * mail-mt.c (mail_msg_check_error): hook onto destroy to remove
- dialogue from active table.
- (error_response): Just destroy on any response, dont unref either.
-
-2003-01-11 Jeffrey Stedfast <fejj@ximian.com>
-
- * mail-format.c (mail_format_data_wrapper_write_to_stream):
- g_strdup the md->charset otherwise we'll get memory corruption
- later. This may be why non-usascii text is displaying incorrectly.
-
-2003-01-10 Jeffrey Stedfast <fejj@ximian.com>
-
- * folder-browser-ui.c (folder_browser_ui_add_list): We also need
- to call message_list_set_hidedeleted() here so that any
- deactivated folder controls will change to the currently set state
- when re-activated.
- (folder_browser_ui_add_global): Same for show_preview.
-
- * folder-browser.c (hide_deleted_changed): Don't call
- message_list_set_hidedeleted() here.
- (folder_browser_toggle_hide_deleted): Instead, call it here. This
- way we get a faster "response time". Also, this will make it so
- that not all folder controls will regen their message-list at the
- same time.
- (folder_browser_toggle_preview): Same idea as the hide-deleted
- changes.
- (show_preview_changed): See above.
-
- * mail-config-druid.c (make_account): Default the new account to
- enabled.
- (wizard_finish_cb): Don't set enabled here.
-
-2003-01-10 Jeffrey Stedfast <fejj@ximian.com>
-
- * folder-browser.c (hide_deleted_changed): New callback for when
- the HideDeleted state changes.
- (folder_browser_gui_init): Listen for changes to hide_deleted so
- we can update the menu state.
- (folder_browser_destroy): Remove the hide_deleted notify handler.
- (folder_browser_toggle_hide_deleted): When saving the setting,
- remember that it is !atoi (state) rather than atoi (state) because
- show vs hide. yea.
-
- * mail-session.c (main_get_filter_driver): notify-type is a int,
- not a bool. Duh.
-
-2003-01-10 Jeffrey Stedfast <fejj@ximian.com>
-
- * component-factory.c (factory): Updated for function rename.
-
- * mail-config-factory.c (mail_config_control_factory_cb):
- Namespaced the function name.
-
- * folder-browser-ui.c (folder_browser_ui_add_global): Don't add
- the listener for show_preview here, it was moved into
- folder-browser.c so we could detach the listener when the
- folder-browser is destroyed. Also prevents a listener being added
- multiple times (which was possible? before).
-
- * folder-browser.c (folder_browser_destroy): Remove the gconf
- notify handler for show_preview.
- (show_preview_changed): Moved here from folder-browser-ui.c
+2003-01-09 Jeffrey Stedfast <fejj@ximian.com>
* component-factory.c (storage_remove_folder): Fixed a situation
in which we could notify the shell listener twice.
-2003-01-10 Not Zed <NotZed@Ximian.com>
-
- * folder-browser.c (folder_browser_gui_init): Save the paned_size
- notify handle.
- (folder_browser_destroy): Remove gconf notify handler.
-
-2003-01-09 Chris Toshok <toshok@ximian.com>
-
- * mail-config-druid.c (wizard_finish_cb): enable the account
- before attempting to saving it.
-
- * mail-accounts.c (account_delete_clicked): need to show the
- buttons added to the dialog.
-
-2003-01-10 Not Zed <NotZed@Ximian.com>
-
- * mail-config.glade: Remove info.png from a couple of images, the
- image is set via code at runtime. Removes some annoying runtime
- warnings.
-
- * mail-send-recv.c (dialogue_response): dont unref the dialogue.
- (dialog_destroy_cb): null out the send_recv_dialogue after destroy.
- (build_dialogue): show the stop button
-
-2003-01-09 Chris Toshok <toshok@ximian.com>
-
- * folder-info.c (evolution_folder_info_notify_ready): pass bag to
- bonobo_pbclient_set_boolean.
-
-2003-01-09 Ettore Perazzoli <ettore@ximian.com>
-
- * component-factory.c (owner_set_cb): Don't call
- mail_config_register_factory() or
- evolution_mail_config_wizard_init().
-
-2003-01-09 Not Zed <NotZed@Ximian.com>
-
- * mail-config-druid.c: Added druidpagestart1 to the pages list.
- (construct): Change the limits on the page initialisation, and
- widget_show_all on the page rather than the content.
-
- * GNOME_Evolution_Mail.server.in.in: Make Mail a shlib component.
-
- * folder-info.c (evolution_folder_info_factory_init): Removed.
- (evolution_folder_info_factory_fn): renamed to evolution_folder_info_new().
-
- * mail-config-druid.c (evolution_mail_config_wizard_factory_fn):
- Renamed to evolution_mail_config_wizard_new().
- (evolution_mail_config_wizard_init): Removed.
-
- * mail-config-factory.c (mail_config_register_factory): Remove.
- (config_control_factory_cb): make this public.
-
- * Makefile.am: setup evolution-mail as a shared library.
-
- * component-factory.c (make_factory): implement the bonobo-plugin
- factory for shlib operation. Also, preliminary work to setup mailer-specific
- (factory): Implement the factory which starts various components.
-
- * mail-config.c (xml_get_prop): g_free->xmlFree
- (account_to_xml): copy xml memory to glib memory when adding the 0
- on the end of the string.
- (accounts_save): Use slightly different logic with appending to
- the tail of the list, we can't use the &node trick with gslists.
- (accounts_changed): Same here.
-
-2003-01-08 Ettore Perazzoli <ettore@ximian.com>
-
- * Makefile.am: Images are now in $(datadir)/evolution/images
- instead of $(datadir)/images/evolution.
-
-2003-01-08 Jeffrey Stedfast <fejj@ximian.com>
-
- * folder-browser-ui.c (folder_browser_ui_add_global): Call
- folder_browser_set_message_preview().
-
- * mail-config.c (mail_config_get_show_preview): Removed.
- (mail_config_set_show_preview): Removed.
-
- * folder-browser.c (folder_browser_toggle_preview): Simply set the
- gconf show_preview setting and let the code in folder-browser-ui.c
- detect it and update the UI.
-
- * folder-browser-ui.c (folder_browser_ui_add_global): Listen for
- changed events on the show_preview setting.
-
- * mail-config.c (mail_config_set_default_account): Save the
- setting via gconf.
- (mail_config_add_account): Immediately save the list of accounts.
- (mail_config_remove_account): Same.
- (mail_config_signature_run_script): g_free the charset value and
- use the composer's charset rather than the display charset.
- (mail_config_get_default_account_num): Removed.
-
-2003-01-07 Jeffrey Stedfast <fejj@ximian.com>
-
- * folder-browser.c (save_cursor_pos): Use gconf to get the paned
- size.
- (folder_browser_set_message_preview): Same.
- (folder_browser_toggle_hide_deleted): Use gconf to set the
- hide-deleted state.
- (folder_browser_set_message_display_style): Same but for the
- message_display_style.
- (fb_resize_cb): Save the paned_size via gconf.
- (paned_size_changed): Callback for when the paned_size gets
- changed. Change the folder-browser's paned size to the new
- setting.
- (folder_browser_gui_init): Listen to changes to the paned_size and
- also get the initial size from gconf.
-
- * message-list.c (message_list_set_folder): Use gconf.
- (regen_list_regen): Use gconf.
-
- * message-browser.c (transfer_msg_done): Use gconf to get the
- hide_deleted setting.
-
- * mail-account-gui.c (sig_add_new_signature): Use gconf.
-
- * folder-browser-ui.c (folder_browser_ui_add_list): Use gconf.
-
- * folder-browser.c (save_cursor_pos): Use gconf.
- (folder_browser_set_message_preview): Same.
- (folder_browser_toggle_hide_deleted): Here too.
- (folder_browser_set_message_display_style): And here.
- (folder_browser_gui_init): Here too.
- (done_message_selected): And here.
-
- * mail-config.c (mail_config_get_thread_subject): Removed.
- (mail_config_set_thread_subject): Removed.
- (mail_config_get_empty_trash_on_exit): Removed.
- (mail_config_set_empty_trash_on_exit): Removed.
- (mail_config_get_last_filesel_dir): Removed.
- (mail_config_set_last_filesel_dir): Removed.
- (mail_config_get_hide_deleted): Removed.
- (mail_config_set_hide_deleted): Removed.
- (mail_config_get_paned_size): Removed.
- (mail_config_set_paned_size): Removed.
- (mail_config_get_send_html): Removed.
- (mail_config_set_send_html): Removed.
- (mail_config_get_confirm_unwanted_html): Removed.
- (mail_config_set_confirm_unwanted_html): Removed.
- (mail_config_get_citation_highlight): Removed.
- (mail_config_set_citation_highlight): Removed.
- (mail_config_get_citation_color): Removed.
- (mail_config_set_citation_color): Removed.
- (mail_config_get_do_seen_timeout): Removed.
- (mail_config_set_do_seen_timeout): Removed.
- (mail_config_get_mark_as_seen_timeout): Removed.
- (mail_config_set_mark_as_seen_timeout): Removed.
- (mail_config_get_prompt_empty_subject): Removed.
- (mail_config_set_prompt_empty_subject): Removed.
- (mail_config_get_prompt_only_bcc): Removed.
- (mail_config_set_prompt_only_bcc): Removed.
- (mail_config_get_confirm_expunge): Removed.
- (mail_config_set_confirm_expunge): Removed.
- (mail_config_get_confirm_goto_next_folder): Removed.
- (mail_config_set_confirm_goto_next_folder): Removed.
- (mail_config_get_goto_next_folder): Removed.
- (mail_config_set_goto_next_folder): Removed.
- (mail_config_get_http_mode): Removed.
- (mail_config_set_http_mode): Removed.
- (mail_config_get_default_forward_style): Removed.
- (mail_config_set_default_forward_style): Removed.
- (mail_config_get_default_reply_style): Removed.
- (mail_config_set_default_reply_style): Removed.
- (mail_config_get_message_display_style): Removed.
- (mail_config_set_message_display_style): Removed.
- (mail_config_get_default_charset): Removed.
- (mail_config_set_default_charset): Removed.
- (mail_config_get_x_mailer_display_style): Removed.
- (mail_config_set_x_mailer_display_style): Removed.
-
- * subscribe-dialog.c (populate_store_list): Use the list of
- accounts. We can't get the list of sources anymore.
- (populate_store_foreach): Updated.
-
- * mail-callbacks.c (guess_me_from_accounts): Use account->enabled.
- (mail_generate_reply): Same.
- (empty_trash): Here too.
-
- * mail-accounts.c (account_delete_clicked): Use account->enabled
- rather than source->enabled.
- (account_able_clicked): Same.
- (account_cursor_change): Here too.
- (mail_accounts_load): And here.
-
- * component-factory.c (owner_unset_cb): Use gconf empty-on-exit
- settings.
- (mail_load_storages): Use account->enabled rather than
- account->source->enabled. The struct changed.
-
- * mail-composer-prefs.c (sig_add): Get the send_html pref from gconf.
-
- * message-tag-followup.c (target_date_new): Use gconf.
-
- * mail-config.c (mail_config_get_week_start_day): Removed.
-
- * mail-tools.c (mail_tool_quote_message): Use gconf here too, but
- we don't need to parse the colour - just use it as a raw string.
- (mail_tool_forward_message): Use gconf.
-
- * mail-format.c (mail_format_data_wrapper_write_to_stream): Use gconf.
- (write_headers): Use gconf.
- (handle_text_plain): Same.
-
- * mail-display.c (mail_text_write): Updated to use gconf and parse
- GdkColour strings.
- (on_url_requested): Updated to use gconf.
-
- * mail-callbacks.c (ask_confirm_for_unwanted_html_mail): Use gconf
- rather than the old mail-config APIs which will be removed.
- (ask_confirm_for_empty_subject): Same.
- (ask_confirm_for_only_bcc): Here too.
- (composer_get_message): And here.
- (create_msg_composer): Same.
- (transfer_msg_done): Again here.
- (delete_msg): Here too.
- (confirm_expunge): And finally here.
-
- * mail-config.c (mail_config_write): Use gconf.
- (mail_config_get_sources): Removed.
-
- * mail-account-gui.c (mail_account_gui_save): No need to save
- enabled-state anymore for a source.
-
- * mail-config-druid.c (wizard_finish_cb): Instead of setting
- account->source->enabled to TRUE, just set account->enabled to
- TRUE. The structures changed a bit.
-
- * mail-send-recv.c (mail_send_receive): Get the list of accounts
- instead of sources, and pass them along to build_dialogue. I'm
- trying to get rid of the mail_config_get_sources() api.
- (mail_autoreceive_setup): Here too.
-
- * mail-config.c (mail_config_get_filter_log): Removed.
- (mail_config_set_filter_log): Removed.
- (mail_config_get_filter_log_path): Removed.
- (mail_config_set_filter_log_path): Removed.
- (mail_config_get_new_mail_notify): Removed.
- (mail_config_set_new_mail_notify): Removed.
- (mail_config_get_new_mail_notify_sound_file): Removed.
- (mail_config_set_new_mail_notify_sound_file): Removed.
-
- * mail-session.c (main_get_filter_driver): Updated to use the
- gconf settings.
-
-2003-01-07 Dan Winship <danw@ximian.com>
-
- * mail-account-gui.c (mail_account_gui_auto_detect_extra_conf,
- mail_account_gui_build_extra_conf): Don't translate the conf
- strings. Camel already did it.
-
-2003-01-06 Dan Winship <danw@ximian.com>
+2003-01-16 Jeffrey Stedfast <fejj@ximian.com>
- * Makefile.am: remove idldir definition. (It's defined in
- configure.in now)
+ * mail-config-druid.c (get_fn): Connect to the toggled event on
+ the transport_needs_auth toggle button so if the user turns this
+ off after having deleted the username field, the Next button
+ becomes re-enabled. Fixes bug #36862.
2003-01-04 Jeffrey Stedfast <fejj@ximian.com>
@@ -1650,226 +118,7 @@
then the address is useless. This does all we can do mailer-side
for the recent "SMTP Problem" thread.
-2003-01-03 Jeffrey Stedfast <fejj@ximian.com>
-
- * mail-display.c: Fixed some build issues.
-
- * mail-search.c: Same.
-
- * mail-callbacks.c (save_draft_done): Use
- g_signal_handlers_disconnect_by_func().
- (manage_subscriptions): Use a weak_ref instead of connecting to
- the destroy event.
-
-2002-12-17 Jeffrey Stedfast <fejj@ximian.com>
-
- ...And a whole bunch more build fixes.
-
- * mail-vfolder.c (mail_vfolder_delete_uri): Don't use
- g_string_sprintfa() anymore since it is apparently deprecated.
-
- * mail-session.c (main_get_filter_driver): Don't use
- g_string_sprintfa() anymore since it is apparently deprecated.
-
- * mail-ops.c (build_from): Don't use g_string_sprintfa() anymore
- since it is apparently deprecated.
-
- * mail-callbacks.c (ask_confirm_for_unwanted_html_mail): Don't use
- g_string_sprintfa() anymore since it is apparently deprecated.
-
- * mail-autofilter.c: Don't use g_string_sprintfa() anymore since
- it is apparently deprecated.
-
- * folder-browser.c: Don't use g_string_sprintfa() anymore since it
- is apparently deprecated.
-
- * mail-search.c (mail_search_set_subject): Remove the unnecessary
- g_strdup()'age as well as fix a possible buffer overrun.
-
- * mail-local.c (mail_local_folder_construct): Use
- g_path_get_basename().
-
- * mail-config-druid.c (make_account): Don't use e_utf8_*
- functions.
-
-2002-12-16 Jeffrey Stedfast <fejj@ximian.com>
-
- * mail-format.c #define a STANDARD_ISSUE_TABLE_OPEN string used
- for wrapping textual message parts to keep them being fully-left
- justified.
- (mail_format_raw_message): Wrap the content with a table so that
- text isn't fully left-justified.
- (write_hr): Use it here too.
- (handle_text_plain): And finally here.
-
-2002-12-16 Jeffrey Stedfast <fejj@ximian.com>
-
- * mail-display.c (mail_error_printf): Use camel_text_to_html()
- instead of e_text_to_html().
- (mail_text_write): Write the content directly to gtkhtml through
- an html stream filter.
-
- * mail-format.c (attachment_header): Use camel_text_to_html()
- instead of e_text_to_html().
- (write_text_header): Same.
- (write_address): Here too.
- (mail_get_message_rfc822): And here.
- (mail_get_message_body): And finally here.
-
-2002-12-16 Jeffrey Stedfast <fejj@ximian.com>
-
- * mail-format.c (handle_text_plain): Re-implemented to use
- streams. Also no need to check for html since
- camel-mime-part-utils.c now does this for us and will re-tag the
- mime-type as text/html thus the UI can be completely ignorant of
- this process.
- (handle_text_plain_flowed): Removed.
- (write_one_text_plain_chunk): Removed.
- (try_uudecoding): Removed.
- (try_inline_binhex): Removed.
- (handle_text_enriched): Re-implemented to use streams too.
-
-2002-12-15 Jeffrey Stedfast <fejj@ximian.com>
-
- * mail-format.c (write_text_header): Change the order of the args
- to be consistant with other write functions.
- (write_date): Same.
- (write_field_row_begin): Here too.
- (write_headers): Here too.
- (write_one_text_plain_chunk): Don't strdup just to pass it to
- mail_text_write() so that it can dup it yet again into html text
- and dup it yet a 3rd time into a GByteArray. Instead just write it
- to gtkhtml.
- (handle_*): Fixed arguments to take a MailDisplayStream instead of
- a GtkHTML widget and a GtkHMLStream.
-
- * mail-display.c (mail_display_render): Create a MailDisplayStream
- to pass to mail_format_mime_message() and
- mail_format_raw_message().
-
- * mail-display-stream.[c,h]: New stream to replace
- mail-stream-gtkhtml.c
-
- * mail-stream-gtkhtml.[c,h]: Removed.
-
-2002-12-13 Jeffrey Stedfast <fejj@ximian.com>
-
- * mail-callbacks.c (check_send_configuration): Make sure the
- folder-browser is not NULL or we'll crash.
-
- * mail-preferences.c (mail_preferences_construct): Fix the colour
- code to get a guint32 rgb correctly (I think - can't test because
- the shell keeps crashing, yay).
-
- * message-tag-followup.c (construct): Don't re-use cell renderers
- - I'm not sure this is actually safe to do.
-
- * mail-session.c: Get rid of unneeded CamelObject casts.
- (user_message_response): Don't unref the dialog object after we've
- destroyed it.
-
- * mail-display.c (write_data_to_file): Don't unref the dialog
- object after we've destroyed it.
-
- * mail-callbacks.c: Same here.
-
- * component-factory.c: Here too.
-
- * message-tag-editor.c: Added MESSAGE_TAG_EDITOR_GET_CLASS macros.
-
-2002-12-12 Jeffrey Stedfast <fejj@ximian.com>
-
- * mail-accounts.c (mail_accounts_tab_construct): Setup
- double-click here.
-
-2002-12-12 Jeffrey Stedfast <fejj@ximian.com>
-
- * mail-accounts.c (account_delete_clicked): Get rid of the ETable
- #ifdef's - we won't ever be using ETable.
- (account_default_clicked): Same.
- (account_able_clicked): Here too.
- (mail_accounts_load): And here.
- (mail_accounts_treeview_new): Renamed from etable_new since we
- won't ever be using an etable.
- (mail_accounts_tab_construct): And finally here.
-
-2002-12-12 Not Zed <NotZed@Ximian.com>
-
- * folder-browser.c (my_folder_browser_init): cast a-warning a-way.
-
- * mail-composer-prefs.c (spell_setup): Terminate list_store_set
- with -1.
-
- * mail-accounts.c (mail_accounts_etable_new): clist -> gtktreeview
- stuff. Yes, this is not an etable.
- (mail_accounts_tab_construct): Same.
- (mail_accounts_load): Same.
- (account_cursor_change): Same.
- (account_able_clicked): And this.
- (account_default_clicked): Same.
- (account_delete_clicked): Guess?
- (account_edit_clicked): And here too.
-
-2002-12-11 Jeffrey Stedfast <fejj@ximian.com>
-
- * mail-format.c (mail_format_data_wrapper_write_to_stream): New
- function to handle a lot of the filtering/etc that was done in
- mail_format_get_data_wrapper_text(). This is the first step toward
- getting rid of e-text-to-html crap and using my tohtml stream
- filter instead.
- (mail_format_get_data_wrapper_text): Use the new function.
- (mail_format_raw_message): Use camel streams to write the content
- to gtkhtml rather than using get_data_wrapper_text() and then
- converting that to html and then writing it to the gtkhtml stream.
-
-2002-12-10 Not Zed <NotZed@Ximian.com>
-
- * mail-composer-prefs.c (mail_composer_prefs_construct): language
- is a treeview now. Not sure what to do with it yet, but get rid
- of one warning anyway.
- (mail_composer_prefs_construct): Same for sig_clist, but setup
- model.
- (sig_fill_clist): Change to use a gtktreeview instead of a clist.
- (sig_selection_changed): New method to handle signature selection
- changes with the new widgets.
- (sig_delete): clist -> treeview.
- (mail_composer_prefs_new_signature): Same.
- (sig_edit): ditto.
- (sig_current_sig): removed.
- (sig_row_unselect): Removed.
- (sig_row_select): Removed, now redundant.
- (spell_select_lang): Removed, redundant.
- (spell_set_ui_language): New implementation using list model more
- effectively.
- (spell_get_language_str): Same here.
- (spell_set_ui_language): Removed this too, merged into
- spell_set_ui, it was just wasting stack space.
- (spell_language_selection_changed): renemd from
- spell_language_select_row, converted to gtktreeview, etc.
- (spell_language_unselect_row): Removed.
- (spell_language_enable): Redone to use tree model.
- (spell_language_button_press): Removed, i dont think this is
- needed anymore.
- (spell_setup): dont hook onto redundant signals.
-
- * mail-config-factory.c (config_control_factory_cb): ignore
- mail-font-prefs in a different way (so we dont assert)
-
-2002-12-09 Chris Toshok <toshok@ximian.com>
-
- * mail-session.c (pass_response): pass "Mail" to e_passwords_*.
- (do_get_pass): same.
- (main_forget_password): same.
- (mail_session_get_password): same.
- (mail_session_remember_password): same.
- (mail_session_forget_password): same.
-
- * mail-config.c (mail_config_write_on_exit): pass "Mail" to
- e_passwords_*.
-
- * main.c (main): e_passwords_init is gone.
-
-2002-12-03 Jeffrey Stedfast <fejj@ximian.com>
+2002-12-02 Jeffrey Stedfast <fejj@ximian.com>
* mail-callbacks.c (guess_me_from_accounts): Use the same logic as
mail_generate_reply(). Fixes bug #34882
@@ -1883,236 +132,28 @@
retval from message_rfc822_dnd() rather than relying on an
exception, because one will not always necessarily be set. For
MESSAGE_RFC822, also use the retval from message_rfc822_dnd().
-
-2002-12-03 Not Zed <NotZed@Ximian.com>
-
- * folder-browser.c (folder_browser_finalise/destroy): frobbed
- around with these till it exits without crashing.
-
- * message-list.c (message_list_destroy): made a destroy
- handler again (was dispose). Frobbed around with this and
- finalise till it can destroy without crashing.
-
- * message-browser.c (message_browser_new): ref/sink the
- folderbrowser.
+ Based on preliminary work by Yuedong Du.
2002-11-25 Radek Doulik <rodo@ximian.com>
* mail-preferences.c (mail_preferences_construct): magic_check -->
magic_links_check
-2002-11-27 Not Zed <NotZed@Ximian.com>
-
- * message-tag-followup.c (construct): gnome_pixmap -> gtkimage.
- (construct): gtk_clist -> gtk_tree_view, setup columns. They dont
- size well :-/
- (message_tag_followup_append_message): Append using model, remove
- clist stuff.
- (construct): Show date edit (glade bugs?)
-
- * folder-browser.c (folder_browser_class_init): gtk_marshal -> g_cclosure_marshal
- (setup_popup_icons): gnome_pixmap -> gtk_image.
- (on_right_click): gtk_pixmap -> gtk_image.
-
- * mail-accounts.c (account_delete_clicked): removed #if 0'd out code.
-
- * mail-send-recv.c (receive_done): remove FIXME and extra unref.
-
- * mail-session.c (request_password): Removed #if 0'd out stuff.
-
- * mail-vfolder.c (new_rule_clicked): proper cast for g_object_get_data.
-
- * mail-local.c (reconfigure_response): cast for g_object_get_data.
-
- * mail-account-editor.c (construct): GNOME_DIALOG -> GTK_DIALOG.
-
- * *.[ch]: re-ran fix.sh for e_notice change
-
- * mail-callbacks.c (save_msg_ok): g_object_get_data +
- gtk_object_remove_no_notify -> g_object_steal_data.
- (find_socket): gtk_container_children ->
- gtk_container_get_children
- (edit_msg): gnome_*_dialog -> gtk_message_dialog.
- (resent_msg): "
- (search_msg): "
- (confirm_goto_next_folder): gtkmessagedialogised (even if not
- used).
- (confirm_expunge): gtkmessagedialogised
- (filter_edit): "
- (do_mail_print): e_notice -> gtk_message_dialog.
- (are_you_sure): removed e_gnome_ok_cancel_dialog crap, replaced
- with a gtk dialog.
- (are_you_sure): gtkmessagedialogised.
- (edit_msg_internal): Dont free uids array, are_you_sure() free's
- it.
- (resend_msg): Same.
- (check_send_configuration): Use e_notice for stuff. Sigh, here we
- go again ...!
- (e_question): A utility function to ask a question, potentially
- with 'dont ask again' as well.
- (configure_mail): use e_question to save code. Here we go again,
- again ...
- (ask_confirm_for_unwanted_html_mail): "
- (ask_confirm_for_only_bcc): "
- (ask_confirm_for_only_bcc): "
- (composer_get_message): Use e_notice.
- (composer_save_draft_cb): Use e_question
- (edit_msg): use e_notice, & change to an ERROR.
- (resend_msg): same.
- (save_msg_ok): Properly initialise ret to OK, and use e_question,
- and use access() to determine existance/write access rather than
- stat, display an error if we can't write to a file that exists,
- and print the filename in all dialogues.
- (confirm_goto_next_folder): Use e_question.
- (confirm_expunge): use e_question.
- (filter_edit): Use e_notice.
- (do_mail_print): use e_notice.
-
-2002-11-26 Not Zed <NotZed@Ximian.com>
-
- * mail-vfolder.c (vfolder_gui_add_rule): clicked->response signal
- for gtk dialogue.
- (new_rule_clicked): Dont unref after destroy (duh, idiot again).
- (edit_rule_response): Same here.
- (mail_vfolder_delete_uri): Connect response signal to
- gtk_widget_destroy directrly using g_signal_connect_swapped.
- (close_dialogue): Removed, as no longer needed.
-
- * message-list.c (get_normalised_string): Duh idiot, "un-fixed"
- the memleak i added.
-
- * mail-callbacks.c (composer_get_message): Set parent window in
- message dialogue & DESTROY_WITH_PARENT flag.
- (composer_save_draft_cb):
- (configure_mail):
- (check_send_configuration): Add DESTROY_WITH_PARENT flag to
- gtk_message_dialog's
- (local_configure_done): remove some unecessary/wrong casts.
- (empty_trash_expunged_cb): "
- (do_mail_print): use gtk_window_set_transient_for instead of
- e_dialog_set_parent.
-
-2002-11-26 Not Zed <NotZed@Ximian.com>
-
- * mail-account-editor.c (mail_account_editor_new):
- gtk_widget_set_parent_window -> gtk_window_set_transient_for.
-
- * mail-callbacks.c (composer_send_queued_cb): dont unref composer.
-
- * message-browser.c (message_browser_destroy): moved back from
- finalise.
-
-2002-11-25 Not Zed <NotZed@Ximian.com>
-
- * message-list.c (message_list_dispose): move saving tree state
- here.
- (message_list_finalise): And take it from here.
-
- * mail-display.c (mail_display_destroy): @#$@# gtk. changed this
- around a bit.
- (mail_display_init): Fix prototype, its a gobject.
- (mail_display_init): ref/sink the invisible gtkobject.
-
-2002-11-22 Not Zed <NotZed@Ximian.com>
-
- * mail-callbacks.c (ask_confirm_for_unwanted_html_mail): removed
- e_messagebox, and use gtk_message_dialog directly.
- (ask_confirm_for_empty_subject): and here.
- (ask_confirm_for_only_bcc): And here too.
- (msgbox_destroy_cb): Removed, since no longer needed.
-
2002-11-15 Harry Lu <harry.lu@sun.com>
* mail-display.c (write_data_to_file): Show file name when prompt
- to user for overwrite. Fixes bug #34180.
+ to user for overwrite.
-2002-11-21 Harry Lu <harry.lu@sun.com>
+2002-11-20 Harry Lu <harry.lu@sun.com>
- * mail-display.c (do_attachment_header): Enable dragging of all
+ * mail-display.c (do_attachment_header): Enable dragging of all
attachments. For bug #34327.
-2002-11-21 Jeffrey Stedfast <fejj@ximian.com>
-
- * mail-preferences.c (mail_preferences_construct): Since the
- GSList returned from gconf needs to be free'd by us, we don't need
- to strdup the values. Also make sure we don't leak the GSList
- itself.
- (mail_preferences_apply): Don't leak our GSList data.
-
-2002-08-30 Radek Doulik <rodo@ximian.com>
-
- * mail-display.c (mail_display_render): don't set margins for raw
- message view
-
- * mail-format.c (mail_format_raw_message): as below
- (handle_text_plain_flowed): as below
- (mail_format_raw_message): don't use data_urls
-
- * mail-display.c (mail_text_write): put text in iframe, so it has
- margins and should not be placed in table which changes wrapping
- behavior
-
-2002-11-20 Jeffrey Stedfast <fejj@ximian.com>
-
- * mail-composer-prefs.c (mail_composer_prefs_construct): gconfify.
- (mail_composer_prefs_apply): gconfify this also.
-
- * mail-preferences.c (mail_preferences_construct):
- gconf_client_get_string() probably returns an allocated buffer.
-
-2002-11-20 Not Zed <NotZed@Ximian.com>
-
- * importers/Makefile.am (%.server.in): provide a proper implicit
- rule for building .server.in from .server.in.in. The other one
- just copied the first target to all destinations(!).
-
- * importers/evolution-outlook-importer.c (outlook_factory_fn):
- destroy -> weak ref.
-
-2002-11-19 Jeffrey Stedfast <fejj@ximian.com>
-
- * mail-preferences.c (mail_preferences_apply): Save the settings
- via gconf.
- (mail_preferences_construct): Load the values from gconf.
-
2002-11-19 Radek Doulik <rodo@ximian.com>
* mail-composer-prefs.c (sig_load_preview): use
gtk_html_begin_content to specify utf-8
-2002-11-19 Not Zed <NotZed@Ximian.com>
-
- * importers/evolution-mbox-importer.c (mail_importer_module_init):
- fix warning message, outlook->mbox.
-
- * importers/Makefile.am: fix serverdir to point to
- $libdir/bonobo/servers.
-
- * mail-callbacks.c (addrbook_sender): add type to
- bonobo_widget_set_property.
-
- * mail-vfolder.c (vfolder_editor_response): dont unref after destroy.
-
- * mail-session.c (pass_response): dont unref aftrer destroy.
-
- * mail-local.c (reconfigure_response): dont unref after destroy.
-
- * mail-display.c (launch_cb): dont unref after destroy.
- (launch_cb): "
- (drag_data_get_cb): "
- (html_button_press_event): add type to bonobo_widget::set_property
-
- * mail-config.c (mail_config_check_service): dont unref after
- destroy.
-
- * component-factory.c (send_receive_cb): dont unref after destroy.
- (request_quit): "
-
- * mail-signature-editor.c (mail_signature_editor): Use version 3.0
- of gtkhtml editor interfaces.
- (do_exit): dont unref after destroy.
- (format_html_cb): Add type to bonobo_widget::set_property.
-
2002-11-18 Radek Doulik <rodo@ximian.com>
* mail-composer-prefs.c (spell_setup_check_options): check
@@ -2120,407 +161,13 @@
2002-11-18 Jeffrey Stedfast <fejj@ximian.com>
- * mail-accounts.c (mail_accounts_load): Specify the default
- account. Also, don't need to use e_utf8_to_gtk_string() here.
-
-2002-11-18 Not Zed <NotZed@Ximian.com>
-
- * Makefile.am (evolution_mail_LDADD): Added back
- libevolution-importer stuff.
- (SUBDIRS): Added back importers.
-
- * importers/evolution-mbox-importer.c (load_file_fn): build the
- uri without deprecated funcs.
- (load_file_fn): dont free/alloc a camel_exception for no obvious
- purpose.
- (mbox_factory_fn): use weak_ref rather than destroy.
- (importer_destroy_cb): fix signature for weak ref notify.
- (mbox_factory_fn): add cid param.
-
- * importers/*.[ch]: ran fix script over everything.
-
- * importers/*.server.in.in: Added bonobo activation files. Moved
- evolution-mail to @LIBEXEC@ as below.
-
- * importers/Makefile.am: oaf->bonobo activation stuff.
-
- * importers/evolution-outlook-importer.c (outlook_factory_fn): Add
- component id to callback.
-
-2002-11-15 Ettore Perazzoli <ettore@ximian.com>
-
- * Makefile.am: Add rules to substitute @LIBEXEC@ in
- GNOME_Evolution_Mail.server.in.in and install evolution-mail in
- $(libexecdir) instead of $(bindir).
+ * mail-accounts.c (mail_accounts_load): Specify which account is
+ the default account.
- * GNOME_Evolution_Mail.server.in.in: Replaced evolution-mail with
- @LIBEXECDIR@/evolution-mail.
-
-2002-11-15 Rodney Dawes <dobey@ximian.com>
-
- * component-factory.c: Use bonobo_main_quit instead of gtk
-
2002-11-15 Jeffrey Stedfast <fejj@ximian.com>
* mail-composer-prefs.c (sig_edit): Correctly spell Advanced.
-2002-11-15 Not Zed <NotZed@Ximian.com>
-
- * mail-summary.c (create_summary_view): weak notify -> ref.
-
- * mail-send-recv.c (build_dialogue): weak notify -> ref.
-
- * mail-accounts.c (account_edit_clicked): weak notify -> ref, i
- presume this is what jeff meant, 'cause it dont compile otherwise.
-
-2002-11-14 Jeffrey Stedfast <fejj@ximian.com>
-
- * mail-accounts.c (account_edit_clicked): Use g_object_weak_ref
- rather than connecting to destroy.
- (account_add_clicked): Same.
-
- * mail-callbacks.c (addrbook_sender): Make this use
- g_object_weak_notify also.
- (subscribe_dialog_destroy): Add NULL guards here since I think we
- really do want to connect to the "destroy" signal in the function
- that connects us to that signal.
-
- * mail-config-factory.c (config_control_factory_cb): Same.
-
- * mail-display.c (save_part): Here too.
- (make_popup_window): And here.
-
- * mail-send-recv.c (build_dialogue): Same here.
-
- * mail-summary.c (create_summary_view): Use g_object_weak_notify
- instead of connecting to the destroy signal.
-
-2002-11-14 Ettore Perazzoli <ettore@ximian.com>
-
- * component-factory.c (owner_set_cb): Want a (GWeakNotify) cast
- here, not (GWeakNotify *).
-
- * subscribe-dialog.c (fete_init): g_object_set() instead of
- gtk_object_set().
- (populate_store_list): Likewise.
- (menu_item_selected): g_object_get_data() instead of
- gtk_object_get_data().
-
- * message-list.c (message_list_create_extras): g_object_set()
- instead of gtk_object_set().
-
- * message-browser.c (message_browser_message_list_built):
- g_object_get_data() instead of gtk_object_get_data().
-
- * mail-vfolder.c (edit_rule_response): g_object_get_data() instead
- of gtk_object_get_data().
-
- * mail-summary.c (generate_folder_summaries): g_object_unref() the
- context instead of gtk_object_destroy().
-
- * mail-local.c (reconfigure_response): g_object_get_data() instead
- of gtk_object_get_data().
-
- * mail-display.c (pixbuf_gen_idle): g_object_unref() the GdkPixbuf
- loader instead of gtk_object_destroy().
- (pixbuf_gen_idle): Likewise.
- (embeddable_destroy_cb): Likewise.
-
- * mail-config-druid.c (mail_config_druid_destroy): No need to
- gtk_object_destroy() the GladeXML object.
- (construct): g_object_set() instead of gtk_object_set().
-
- * folder-browser.c (folder_browser_gui_init): g_object_get_data()
- instead of gtk_object_get_data().
-
-2002-11-14 Not Zed <NotZed@Ximian.com>
-
- * component-factory.c (create_view): shell client objref.
- (mail_add_storage): "
- (mail_remove_storage): "
-
-2002-11-13 Joe Shaw <joe@ximian.com>
-
- * Makefile.am: Remove a couple backslashes that were causing
- automake to complain, even though they were on lines that were
- -commented out-. Sigh.
-
-2002-11-13 Ettore Perazzoli <ettore@ximian.com>
-
- * folder-info.c (evolution_folder_info_factory_fn): Use
- g_object_new() instead of gtk_type_new().
- * folder-browser.c (folder_browser_new): Likewise.
- * mail-account-gui.c
- (mail_account_gui_folder_selector_button_new): Likewise.
- * mail-font-prefs.c (mail_font_prefs_new): Likewise.
-
-2002-11-13 Ettore Perazzoli <ettore@ximian.com>
-
- * mail-format.c: Do not #include <libgnome/gnome-defs.h>.
- * mail-importer.c: Likewise.
- * mail-mt.c: Likewise.
- * mail-ops.c: Likewise.
- * mail-search-dialogue.c: Likewise.
- * mail-session.c: Likewise.
- * mail-vfolder.c: Likewise.
- * message-tag-followup.c: Likewise.
- * main.c: Likewise, and <libgnomeui/gnome-init.h>.
-
- * mail-callbacks.c: Do not #include <libgnome/gnome-paper.h>.
- (do_mail_print): Remove the GnomePaper local variable.
-
-2002-11-13 Not Zed <NotZed@Ximian.com>
-
- * component-factory.c (owner_set_cb): destroy->weak ref.
- (owner_set_cb): shell client changes.
-
- * mail-signature-editor.c (mail_signature_editor): bonobo api changes.
-
- * mail-local.c (save_metainfo): go back to using xmlSaveFile.
-
- * Makefile.am: Removed libevolution-importer from mail.
-
-2002-11-13 Not Zed <NotZed@Ximian.com>
-
- * GNOME_Evolution_Mail.server.in.in: Added to cvs. Currently
- contains no configurable stuff, but maybe it will one day.
-
- * Makefile.am (server_DATA): change oaf stuff to server stuff for
- bonobo activation.
-
- * mail-preferences.c (mail_preferences_apply): handle const entry text.
-
- * mail-composer-prefs.c (url_requested): Fixed typo.
- (mail_composer_prefs_construct): gnomepixmap->gtkimage.
-
- * mail-callbacks.c (configure_mail): destroy dialogue before dealing
- with response.
- (mail_generate_reply): Fix a typo.
- (popup_listener_cb): fix prototype.
- (tag_editor_response): Handle gtk dialog response.
- (flag_for_followup): Change gnome dialog to gtk dialog stuff.
- (tag_editor_destroy_cb):
- (tag_editor_cancel):
- (tag_editor_ok): Removed, handled in _response().
- (filter_editor_response): renamed from _clicked, handle gtk
- dialogue signal.
- (filter_editor_destroy): Removed.
- (footer_info_new): gnome font api changes.
- (do_mail_print): port to gnome print 2.
-
- * mail-autofilter.c (mail_filter_delete_uri): message_dialog uses
- a specific button enum, not the stock ones.
-
- * mail-accounts.c (mail_accounts_tab_get_type): gobjectify.
- (account_delete_clicked): gdkdialogise.
-
- * mail-account-gui.c (mail_account_gui_setup): Hack around font
- metric determination code.
-
- * mail-account-editor.c (mail_account_editor_get_type):
- gobjectise.
- (mail_account_editor_new): ""
-
- * folder-info.c (evolution_folder_info_notify_ready): use pbclient
- interface.
-
- * folder-browser-factory.c (control_destroy_cb): fix a typo.
- (folder_browser_factory_new_control): More typos.
-
- * folder-browser.c (on_right_click): cast around const warning.
- (context_menu_position_func): fix for api change.
-
- * e-searching-tokenizer.c (e_searching_tokenizer_finalise):
- Changed from destroy since it only frees memory.
- (e_searching_tokenizer_get_type): glibify.
-
- * component-factory.c (request_quit): gtkdialogise.
- (send_receive_cb): "
- (create_component): gdk_pixbuf api.
- (component_factory_init): bonobo activation stuff.
- (warning_response): renamed from warning_clicked.
- (owner_set_cb): gtkdialogise.
-
-2002-11-12 Jeffrey Stedfast <fejj@ximian.com>
-
- * Makefile.am: Added files I've ported.
-
- * mail-config.c: Remove gnome-defs.h, this header no longer exists
- in GNOME2.
-
-2002-11-13 Not Zed <NotZed@Ximian.com>
-
- * Makefile.am: Commented out stuff that doesn't build yet. Also
- fixed idl build rule. importers still not built.
-
- * main.c (main): bonobactivationise. remove push visual/colormap.
- (main): no longer activate activation, let bonobo_init do it.
-
- * mail-signature-editor.c (menu_help): Change help api.
-
- * mail-session.c (user_message_destroy_noreply): removed. Not
- used?
-
- * mail-local.c (load_metainfo): xml root->children.
-
- * mail-format.c (g_string_append_len): Removed, it exists now.
-
-2002-11-12 Not Zed <NotZed@Ximian.com>
-
- * subscribe-dialog.c: gnome2ised, use gtkdialog.
- (subscribe_get_global_extras): use a weak ref rather than destroy
- signal.
-
- * message-tag-followup.c: gnome2ised.
-
- * message-tag-editor.c: gnome2ised & converted to gtkdialog.
-
- * message-list.c: gnome2ised.
- (message_list_finalise): From destroy method. maybe should be
- destroy still.
-
- * message-browser.c: port to gnome2
- (message_browser_finalise): renamed from destroy method.
-
- * mail-stream-gtkhtml.c: removed redundant
- camel_class_get_global_classfuncs() call.
-
- * mail-signature-editor.c: gtkdialogised, & bonobo api changes.
-
-
- * mail-search-dialogue.c: gtkdialogised.
-
- * mail-folder-cache.c: cleaned up camel ref/hook casts.
-
- * mail-composer-prefs.c (mail_composer_prefs_get_type): convert to
- gtype.
-
- * mail-font-prefs.c (mail_font_prefs_destroy): from finalise.
-
- * mail-config.c: s/bonobo_config/e_config_listener/ Added
- /apps/Evolution prefix to the evolution keys. Changed to use
- e_config_listener, etc.
- (mail_config_init): remove bonobo_config stuff.
- (mail_config_check_service): gtk dialogise.
- (check_response): from check_cancelled.
-
- * mail-config-druid.c (mail_config_druid_destroy): renamed from
- _finalize, turned into destroy handler.
- (construct): set type to toplevel, GTK_WINDOW_DIALOG no longer
- exists.
-
- * mail-config-factory.c (mail_config_register_factory): bonobo api
- changes.
-
- * mail-crypto.c (mail_crypto_get_pgp_cipher_context): cleaned up
- unref casts.
-
- * mail-display.c (write_data_to_file): gnome->gtkdialog.
- (on_link_clicked): use ascii_str*cmp on url.
- (save_part): g_path stuff.
- (launch_cb): gtk dialog.
- (pixmap_press): de-oafify.
- (pixbuf_for_mime_type): gnome-vfs api changes.
- (do_attachment_header): Change the pixmap to a gtkimage.
- (do_signature): "
- (pixbuf_gen_idle): "
- (do_attachment_header): ascii_str*cmp
- (do_attachment_header): gnome pixmap->gtkimage.
- (mail_display_destroy): protect against gtk mentalness.
- (html_button_press_event): ascii_str*cmp
- (drag_data_get_cb): added comment for translators of filename.
-
- * mail-format.c (component_supports): de-oafise.
- (is_anonymous): ascii_strncmp
- (attachment_header): remove utf8<>locale stuff, and gnomevfs api
- changes.
- (format_mime_part): fix g_strdown call.
- (write_field_row_begin): kill utf8->gtk stuff.
- (write_address): "
- (default_header_index): ascii_strcasecmp
- (handle_text_plain): "
- (handle_text_enriched): "
- (handle_multipart_encrypted): remove utf/gtk stuff.
- (handle_message_external_body): ascii_str*cmp
-
- * mail-identify.c (mail_identify_mime_part):
- (identify_by_magic): gnome vfs api changes.
-
- * mail-importer.c: Converted.
-
- * mail-local.c (load_metainfo): xml childs -> children.
- (mls_get_folder): g_strerror.
- (mls_delete_folder): g_strerror.
- (reconfigure_got_folder): Gnome->GtkDialog
- (reconfigure_response): from reconfigure_clicked.
-
- * mail-mt.c (mail_msg_check_error): gnome -> gtk dialog
- (error_response): renmae from error_gone. destroy widget on any
- response.
-
- * mail-offline-handler.c (impl_finalise): renamed from
- impl_destroy since thats what it should be anyway.
-
- * mail-ops.c: removed utf8 widget conversion & camel_object_un/ref
- casts.
-
- * mail-preferences.c (mail_preferences_get_type): glib2'ised.
-
- * mail-search.c (mail_search_finalise): renmaed from destroy &
- properly chain.
- (mail_search_get_type): glib2 & make gtkdialog parent.
- (entry_run_search): run search when entry activated. not sure if
- gtkdialog has anohter way to do this on an arbitrary widget.
-
- * mail-send-recv.c (dialogue_response): renamed from clicked. Use
- gtkdialog.
-
- * mail-session.c (request_password_deleted): removed, redundant.
- (pass_response): rename from pass_got, changed for gtkdialog.
- (user_message_destroy): Removed, redundant.
- (user_message_response): Renamed from user_message_clicked.
-
-2002-11-11 Not Zed <NotZed@Ximian.com>
-
- * mail-stream-gtkhtml.c (mail_stream_gtkhtml_class_init): dont use
- get_global_classfuncs, just get the type
-
- * mail-tools.c: converted gnome2 api's.
-
- * mail-vfolder.c (vfolder_editor_response): clicked->response.
- (vfolder_editor_destroy): Removed.
- (vfolder_edit): gtk dialog api
- (edit_rule_response): clicked->response.
- (vfolder_edit_rule): gnomedialog->gtkdialog.
- (vfolder_gui_add_rule): "
- (new_rule_clicked): clicked->response
-
-2002-11-11 Jeffrey Stedfast <fejj@ximian.com>
-
- * mail-callbacks.c: Half way ported. I'll finish the rest later.
-
- * mail-autofilter.c: Ported.
-
- * mail-account-gui.c: Ported.
-
- * mail-account-editor.c: Ported.
-
- * folder-browser-ui.c: Ported.
-
- * folder-browser-factory.c: Ported.
-
- * folder-browser.c: Ported.
-
- * e-searching-tokenizer.c: Roughly ported.
-
-2002-11-10 Jeffrey Stedfast <fejj@ximian.com>
-
- * *.glade: Converted to libglade-2's format.
-
-2002-11-08 Jeffrey Stedfast <fejj@ximian.com>
-
- * mail-composer-prefs.c: Ported.
-
2002-10-28 Jeffrey Stedfast <fejj@ximian.com>
* folder-browser.c (folder_browser_query_changed): No longer need
diff --git a/mail/component-factory.c b/mail/component-factory.c
index e7e25493c0..e512331bd2 100644
--- a/mail/component-factory.c
+++ b/mail/component-factory.c
@@ -20,28 +20,18 @@
* Boston, MA 02111-1307, USA.
*/
-
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
-#include <string.h>
-#include <signal.h>
-
-#include <gconf/gconf.h>
-#include <gconf/gconf-client.h>
-
-#include <camel/camel.h>
-
#include <bonobo/bonobo-generic-factory.h>
-#include <bonobo/bonobo-shlib-factory.h>
-
#include <gal/widgets/e-gui-utils.h>
+#include "camel.h"
+
#include "Evolution.h"
#include "evolution-storage.h"
#include "evolution-wizard.h"
-#include "evolution-composer.h"
#include "folder-browser-factory.h"
#include "evolution-shell-component.h"
@@ -51,8 +41,6 @@
#include "mail.h"
#include "mail-config.h"
#include "mail-config-factory.h"
-#include "mail-preferences.h"
-#include "mail-composer-prefs.h"
#include "mail-tools.h"
#include "mail-ops.h"
#include "mail-offline-handler.h"
@@ -159,7 +147,7 @@ create_view (EvolutionShellComponent *shell_component,
BonoboControl *control;
shell_client = evolution_shell_component_get_owner (shell_component);
- corba_shell = evolution_shell_client_corba_objref(shell_client);
+ corba_shell = bonobo_object_corba_objref (BONOBO_OBJECT (shell_client));
if (type_is_mail (folder_type)) {
const char *noselect;
@@ -167,14 +155,14 @@ create_view (EvolutionShellComponent *shell_component,
url = camel_url_new (physical_uri, NULL);
noselect = url ? camel_url_get_param (url, "noselect") : NULL;
- if (noselect && !strcasecmp (noselect, "yes"))
+ if (noselect && !g_strcasecmp (noselect, "yes"))
control = create_noselect_control ();
else
control = folder_browser_factory_new_control (physical_uri,
corba_shell);
camel_url_free (url);
} else if (type_is_vtrash (folder_type)) {
- if (!strncasecmp (physical_uri, "file:", 5))
+ if (!g_strncasecmp (physical_uri, "file:", 5))
control = folder_browser_factory_new_control ("vtrash:file:/", corba_shell);
else
control = folder_browser_factory_new_control (physical_uri, corba_shell);
@@ -353,7 +341,7 @@ xfer_folder (EvolutionShellComponent *shell_component,
if (remove && strcmp(src->protocol, dst->protocol) == 0) {
char *sname, *dname;
CamelStore *store;
-
+
if (src->fragment)
sname = src->fragment;
else {
@@ -362,7 +350,7 @@ xfer_folder (EvolutionShellComponent *shell_component,
else
sname = "";
}
-
+
if (dst->fragment)
dname = dst->fragment;
else {
@@ -371,11 +359,11 @@ xfer_folder (EvolutionShellComponent *shell_component,
else
dname = "";
}
-
+
store = camel_session_get_store(session, source_physical_uri, &ex);
if (store != NULL)
camel_store_rename_folder(store, sname, dname, &ex);
-
+
if (camel_exception_is_set(&ex))
GNOME_Evolution_ShellComponentListener_notifyResult (listener, GNOME_Evolution_ShellComponentListener_INVALID_URI, &ev);
else {
@@ -387,7 +375,7 @@ xfer_folder (EvolutionShellComponent *shell_component,
camel_object_unref((CamelObject *)store);
} else {
source = mail_tool_uri_to_folder (source_physical_uri, 0, &ex);
-
+
if (source) {
xfer_folder_data *xfd;
@@ -395,17 +383,17 @@ xfer_folder (EvolutionShellComponent *shell_component,
xfd->remove_source = remove_source;
xfd->source_uri = g_strdup (source_physical_uri);
xfd->listener = CORBA_Object_duplicate (listener, &ev);
-
+
uids = camel_folder_get_uids (source);
mail_transfer_messages (source, uids, remove_source, destination_physical_uri, CAMEL_STORE_FOLDER_CREATE, xfer_folder_done, xfd);
camel_object_unref (CAMEL_OBJECT (source));
} else
GNOME_Evolution_ShellComponentListener_notifyResult (listener, GNOME_Evolution_ShellComponentListener_INVALID_URI, &ev);
}
-
+
CORBA_exception_free (&ev);
camel_exception_clear (&ex);
-
+
camel_url_free(src);
camel_url_free(dst);
}
@@ -414,12 +402,13 @@ static void
configure_folder_popup(BonoboUIComponent *component, void *user_data, const char *cname)
{
char *uri = user_data;
-
+
+
if (strncmp(uri, "vfolder:", 8) == 0)
vfolder_edit_rule(uri);
else {
FolderBrowser *fb = folder_browser_factory_get_browser(uri);
-
+
if (fb)
configure_folder(component, fb, cname);
else
@@ -443,16 +432,14 @@ populate_folder_context_menu (EvolutionShellComponent *shell_component,
if (!type_is_mail (type))
return;
-
+
/* FIXME: handle other types */
-
+
/* the unmatched test is a bit of a hack but it works */
if ((strncmp(physical_uri, "vfolder:", 8) == 0
&& strstr(physical_uri, "#" CAMEL_UNMATCHED_NAME) == NULL)
|| strncmp(physical_uri, "file:", 5) == 0) {
- bonobo_ui_component_add_verb_full(uic, "ChangeFolderPropertiesPopUp",
- g_cclosure_new(G_CALLBACK(configure_folder_popup),
- g_strdup(physical_uri), (GClosureNotify)g_free));
+ bonobo_ui_component_add_verb_full(uic, "ChangeFolderPropertiesPopUp", configure_folder_popup, g_strdup(physical_uri), g_free);
bonobo_ui_component_set_translate (uic, EVOLUTION_SHELL_COMPONENT_POPUP_PLACEHOLDER, popup_xml, NULL);
}
}
@@ -466,9 +453,9 @@ unpopulate_folder_context_menu (EvolutionShellComponent *shell_component,
{
if (!type_is_mail (type))
return;
-
+
/* FIXME: handle other types */
-
+
/* the unmatched test is a bit of a hack but it works */
if ((strncmp(physical_uri, "vfolder:", 8) == 0
&& strstr(physical_uri, "#" CAMEL_UNMATCHED_NAME) == NULL)
@@ -506,7 +493,7 @@ destination_folder_handle_motion (EvolutionShellComponentDndDestinationFolder *f
url = camel_url_new (physical_uri, NULL);
noselect = url ? camel_url_get_param (url, "noselect") : NULL;
- if (noselect && !strcasecmp (noselect, "yes"))
+ if (noselect && !g_strcasecmp (noselect, "yes"))
/* uh, no way to say "illegal" */
*suggested_action_return = GNOME_Evolution_ShellComponentDnd_ACTION_DEFAULT;
else
@@ -536,7 +523,7 @@ message_rfc822_dnd (CamelFolder *dest, CamelStream *stream, CamelException *ex)
msg = camel_mime_message_new ();
if (camel_mime_part_construct_from_parser (CAMEL_MIME_PART (msg), mp) == -1) {
- camel_object_unref (msg);
+ camel_object_unref (CAMEL_OBJECT (msg));
handled = FALSE;
break;
}
@@ -544,7 +531,7 @@ message_rfc822_dnd (CamelFolder *dest, CamelStream *stream, CamelException *ex)
/* append the message to the folder... */
info = g_new0 (CamelMessageInfo, 1);
camel_folder_append_message (dest, msg, info, NULL, ex);
- camel_object_unref (msg);
+ camel_object_unref (CAMEL_OBJECT (msg));
if (camel_exception_is_set (ex)) {
handled = FALSE;
@@ -555,7 +542,7 @@ message_rfc822_dnd (CamelFolder *dest, CamelStream *stream, CamelException *ex)
camel_mime_parser_step (mp, 0, 0);
}
- camel_object_unref (mp);
+ camel_object_unref (CAMEL_OBJECT (mp));
return handled;
}
@@ -588,7 +575,7 @@ destination_folder_handle_drop (EvolutionShellComponentDndDestinationFolder *des
uri = camel_url_new (physical_uri, NULL);
noselect = uri ? camel_url_get_param (uri, "noselect") : NULL;
- if (noselect && !strcasecmp (noselect, "yes")) {
+ if (noselect && !g_strcasecmp (noselect, "yes")) {
camel_url_free (uri);
return FALSE;
}
@@ -640,8 +627,8 @@ destination_folder_handle_drop (EvolutionShellComponentDndDestinationFolder *des
stream = camel_stream_fs_new_with_fd (fd);
retval = message_rfc822_dnd (folder, stream, &ex);
- camel_object_unref (stream);
- camel_object_unref (folder);
+ camel_object_unref (CAMEL_OBJECT (stream));
+ camel_object_unref (CAMEL_OBJECT (folder));
if (action == GNOME_Evolution_ShellComponentDnd_ACTION_MOVE && retval)
unlink (url);
@@ -664,8 +651,8 @@ destination_folder_handle_drop (EvolutionShellComponentDndDestinationFolder *des
camel_stream_reset (stream);
retval = message_rfc822_dnd (folder, stream, &ex);
- camel_object_unref (stream);
- camel_object_unref (folder);
+ camel_object_unref (CAMEL_OBJECT (stream));
+ camel_object_unref (CAMEL_OBJECT (folder));
break;
case ACCEPTED_DND_TYPE_X_EVOLUTION_MESSAGE:
folder = mail_tools_x_evolution_message_parse (data->bytes._buffer,
@@ -679,7 +666,7 @@ destination_folder_handle_drop (EvolutionShellComponentDndDestinationFolder *des
action == GNOME_Evolution_ShellComponentDnd_ACTION_MOVE,
physical_uri, 0, NULL, NULL);
- camel_object_unref (folder);
+ camel_object_unref (CAMEL_OBJECT (folder));
break;
default:
break;
@@ -751,33 +738,40 @@ shell_client_destroy (GtkObject *object)
}
static void
+warning_clicked (GtkWidget *dialog, gpointer user_data)
+{
+ gtk_widget_destroy (dialog);
+}
+
+static void
owner_set_cb (EvolutionShellComponent *shell_component,
EvolutionShellClient *shell_client,
const char *evolution_homedir,
gpointer user_data)
{
GNOME_Evolution_Shell corba_shell;
- EAccountList *accounts;
+ const GSList *accounts;
int i;
/* FIXME: should we ref this? */
global_shell_client = shell_client;
- g_object_weak_ref ((GObject *) shell_client, (GWeakNotify) shell_client_destroy, NULL);
+ gtk_signal_connect (GTK_OBJECT (shell_client), "destroy",
+ shell_client_destroy, NULL);
evolution_dir = g_strdup (evolution_homedir);
mail_session_init ();
-
+
async_event = mail_async_event_new();
-
+
storages_hash = g_hash_table_new (NULL, NULL);
- corba_shell = evolution_shell_client_corba_objref (shell_client);
-
+ corba_shell = bonobo_object_corba_objref (BONOBO_OBJECT (shell_client));
+
for (i = 0; i < sizeof (standard_folders) / sizeof (standard_folders[0]); i++)
*standard_folders[i].uri = g_strdup_printf ("file://%s/local/%s", evolution_dir, standard_folders[i].name);
vfolder_load_storage(corba_shell);
-
+
accounts = mail_config_get_accounts ();
mail_load_storages (corba_shell, accounts);
@@ -790,15 +784,15 @@ owner_set_cb (EvolutionShellComponent *shell_component,
}
mail_autoreceive_setup ();
-
+
{
/* setup the global quick-search context */
char *user = g_strdup_printf ("%s/searches.xml", evolution_dir);
- char *system = g_strdup (EVOLUTION_PRIVDATADIR "/vfoldertypes.xml");
+ char *system = g_strdup (EVOLUTION_DATADIR "/evolution/vfoldertypes.xml");
search_context = rule_context_new ();
- g_object_set_data_full(G_OBJECT(search_context), "user", user, g_free);
- g_object_set_data_full(G_OBJECT(search_context), "system", system, g_free);
+ gtk_object_set_data_full (GTK_OBJECT (search_context), "user", user, g_free);
+ gtk_object_set_data_full (GTK_OBJECT (search_context), "system", system, g_free);
rule_context_add_part_set (search_context, "partset", filter_part_get_type (),
rule_context_add_part, rule_context_next_part);
@@ -809,16 +803,18 @@ owner_set_cb (EvolutionShellComponent *shell_component,
rule_context_load (search_context, system, user);
}
+ mail_config_register_factory (corba_shell);
+
if (mail_config_is_corrupt ()) {
GtkWidget *dialog;
- dialog = gtk_message_dialog_new (NULL, GTK_DIALOG_MODAL, GTK_MESSAGE_WARNING, GTK_BUTTONS_CLOSE,
- _("Some of your mail settings seem corrupt, "
- "please check that everything is in order."));
- g_signal_connect (dialog, "response", G_CALLBACK (gtk_widget_destroy), dialog);
+ dialog = gnome_warning_dialog (_("Some of your mail settings seem corrupt, "
+ "please check that everything is in order."));
+ gtk_signal_connect (GTK_OBJECT (dialog), "clicked", warning_clicked, NULL);
+ gtk_window_set_modal (GTK_WINDOW (dialog), TRUE);
gtk_widget_show (dialog);
}
-
+
/* Everything should be ready now */
evolution_folder_info_notify_ready ();
}
@@ -845,8 +841,7 @@ debug_cb (EvolutionShellComponent *shell_component, gpointer user_data)
}
static void
-interactive_cb (EvolutionShellComponent *shell_component, gboolean on,
- gulong new_view_xid, gpointer user_data)
+interactive_cb (EvolutionShellComponent *shell_component, gboolean on, gpointer user_data)
{
mail_session_set_interactive (on);
}
@@ -886,36 +881,67 @@ user_create_new_item_cb (EvolutionShellComponent *shell_component,
g_warning ("Don't know how to create item of type \"%s\"", id);
}
+static gboolean
+idle_quit (gpointer user_data)
+{
+ static int shutdown_vfolder = FALSE;
+ static int shutdown_shutdown = FALSE;
+
+ if (!shutdown_shutdown) {
+ if (e_thread_busy(NULL) || mail_msg_active(-1)) {
+ usleep(10000);
+ return TRUE;
+ }
+
+ if (!shutdown_vfolder) {
+ shutdown_vfolder = TRUE;
+ mail_vfolder_shutdown();
+ return TRUE;
+ }
+
+ if (mail_async_event_destroy(async_event) == -1)
+ return TRUE;
+
+ shutdown_shutdown = TRUE;
+ g_hash_table_foreach (storages_hash, free_storage, NULL);
+ g_hash_table_destroy (storages_hash);
+ storages_hash = NULL;
+ }
+
+ if (e_list_length (folder_browser_factory_get_control_list ()))
+ return TRUE;
+
+ gtk_main_quit ();
+
+ return FALSE;
+}
+
static void owner_unset_cb (EvolutionShellComponent *shell_component, gpointer user_data);
/* Table for signal handler setup/cleanup */
static struct {
char *sig;
- GCallback func;
+ GtkSignalFunc func;
int hand;
} shell_component_handlers[] = {
- { "owner_set", G_CALLBACK(owner_set_cb), },
- { "owner_unset", G_CALLBACK(owner_unset_cb), },
- { "debug", G_CALLBACK(debug_cb), },
- { "interactive", G_CALLBACK(interactive_cb) },
- { "destroy", G_CALLBACK(owner_unset_cb), },
- { "handle_external_uri", G_CALLBACK(handle_external_uri_cb), },
- { "user_create_new_item", G_CALLBACK(user_create_new_item_cb) }
+ { "owner_set", owner_set_cb, },
+ { "owner_unset", owner_unset_cb, },
+ { "debug", debug_cb, },
+ { "interactive", interactive_cb },
+ { "destroy", owner_unset_cb, },
+ { "handle_external_uri", handle_external_uri_cb, },
+ { "user_create_new_item", user_create_new_item_cb }
};
static void
owner_unset_cb (EvolutionShellComponent *shell_component, gpointer user_data)
{
- GConfClient *gconf;
- CORBA_Environment ev;
int i;
- EIterator *it;
-
- gconf = gconf_client_get_default ();
+
for (i=0;i<sizeof(shell_component_handlers)/sizeof(shell_component_handlers[0]);i++)
- g_signal_handler_disconnect((GtkObject *)shell_component, shell_component_handlers[i].hand);
+ gtk_signal_disconnect((GtkObject *)shell_component, shell_component_handlers[i].hand);
- if (gconf_client_get_bool (gconf, "/apps/evolution/mail/trash/empty_on_exit", NULL))
+ if (mail_config_get_empty_trash_on_exit ())
empty_trash (NULL, NULL, NULL);
unref_standard_folders ();
@@ -924,51 +950,10 @@ owner_unset_cb (EvolutionShellComponent *shell_component, gpointer user_data)
global_shell_client = NULL;
mail_session_set_interactive (FALSE);
- g_object_unref (search_context);
+ gtk_object_unref (GTK_OBJECT (search_context));
search_context = NULL;
-
- /* force de-activate of all controls, tho only one should be active anyway? */
- CORBA_exception_init(&ev);
- for (it = e_list_get_iterator(folder_browser_factory_get_control_list());
- e_iterator_is_valid(it);
- e_iterator_next(it)) {
- Bonobo_Control_activate(bonobo_object_corba_objref((BonoboObject *)e_iterator_get(it)),
- FALSE, &ev);
- }
- CORBA_exception_free(&ev);
-
- for (i= 0;i<3;i++) {
- /* need to flush any outstanding tasks before proceeding */
-
- /* NOTE!! This may cause a deadlock situation, if we were
- called from a deeper main loop than the top level
- - is there a way to detect this?
- - is this a very big problem?
- FIXME: should use semaphores or something to wait rather than polling */
- while (e_thread_busy(NULL) || mail_msg_active(-1)) {
- if (g_main_context_pending(NULL))
- g_main_context_iteration(NULL, TRUE);
- else
- usleep(100000);
- }
-
- switch(i) {
- case 0:
- mail_vfolder_shutdown();
- break;
- case 1:
- if (mail_async_event_destroy(async_event) == -1) {
- g_warning("Cannot destroy async event: would deadlock");
- g_warning(" system may be unstable at exit");
- }
- break;
- case 2:
- g_hash_table_foreach (storages_hash, free_storage, NULL);
- g_hash_table_destroy (storages_hash);
- storages_hash = NULL;
- break;
- }
- }
+
+ g_timeout_add(100, idle_quit, NULL);
}
static void
@@ -976,7 +961,7 @@ send_receive_cb (EvolutionShellComponent *shell_component,
gboolean show_dialog,
void *data)
{
- EAccount *account;
+ const MailConfigAccount *account;
/* FIXME: configure_mail() should be changed to work without a
FolderBrowser, and then we will be able to call configure_mail from
@@ -985,14 +970,13 @@ send_receive_cb (EvolutionShellComponent *shell_component,
return;
account = mail_config_get_default_account ();
- if (!account || !account->transport->url) {
+ if (!account || !account->transport) {
GtkWidget *dialog;
- dialog = gtk_message_dialog_new (NULL, 0, GTK_MESSAGE_ERROR, GTK_BUTTONS_CLOSE,
- _("You have not set a mail transport method"));
- gtk_dialog_run ((GtkDialog *) dialog);
- gtk_widget_destroy (dialog);
-
+ dialog = gnome_error_dialog (_("You have not set a mail transport method"));
+ gnome_dialog_set_close (GNOME_DIALOG (dialog), TRUE);
+ gtk_widget_show (dialog);
+
return;
}
@@ -1004,21 +988,25 @@ request_quit (EvolutionShellComponent *shell_component,
void *closure)
{
GtkWidget *dialog;
- int resp;
-
+
if (!e_msg_composer_request_close_all ())
return FALSE;
if (!outbox_folder || !camel_folder_get_message_count (outbox_folder))
return TRUE;
-
- dialog = gtk_message_dialog_new(NULL, 0, GTK_MESSAGE_INFO, GTK_BUTTONS_YES_NO,
- _("You have unsent messages, do you wish to quit anyway?"));
- gtk_dialog_set_default_response((GtkDialog *)dialog, GTK_RESPONSE_NO);
- resp = gtk_dialog_run((GtkDialog *)dialog);
- gtk_widget_destroy(dialog);
-
- return resp == GTK_RESPONSE_YES;
+
+ dialog = gnome_message_box_new (_("You have unsent messages, do you wish to quit anyway?"),
+ GNOME_MESSAGE_BOX_QUESTION,
+ GNOME_STOCK_BUTTON_YES, /* Quit */
+ GNOME_STOCK_BUTTON_NO, /* Don't quit */
+ NULL);
+
+ gtk_window_set_title (GTK_WINDOW (dialog), _("Warning: Unsent Messages"));
+ gnome_dialog_set_default (GNOME_DIALOG (dialog), 1);
+ if (gnome_dialog_run_and_close (GNOME_DIALOG (dialog)) == 0)
+ return TRUE;
+
+ return FALSE;
}
static BonoboObject *
@@ -1041,8 +1029,8 @@ create_component (void)
request_quit,
NULL);
- g_signal_connect((shell_component), "send_receive",
- G_CALLBACK (send_receive_cb), NULL);
+ gtk_signal_connect (GTK_OBJECT (shell_component), "send_receive",
+ GTK_SIGNAL_FUNC (send_receive_cb), NULL);
destination_interface = evolution_shell_component_dnd_destination_folder_new (destination_folder_handle_motion,
destination_folder_handle_drop,
@@ -1051,26 +1039,28 @@ create_component (void)
bonobo_object_add_interface (BONOBO_OBJECT (shell_component),
BONOBO_OBJECT (destination_interface));
- icon = gdk_pixbuf_new_from_file (EVOLUTION_ICONSDIR "/new-message.xpm", NULL);
+ evolution_mail_config_wizard_init ();
+
+ icon = gdk_pixbuf_new_from_file (EVOLUTION_ICONSDIR "/new-message.xpm");
evolution_shell_component_add_user_creatable_item (shell_component, "message",
_("New Mail Message"), _("_Mail Message"),
_("Compose a new mail message"),
"mail", 'm',
icon);
if (icon != NULL)
- g_object_unref (icon);
+ gdk_pixbuf_unref (icon);
- icon = gdk_pixbuf_new_from_file (EVOLUTION_ICONSDIR "/post-message-16.png", NULL);
+ icon = gdk_pixbuf_new_from_file (EVOLUTION_ICONSDIR "/post-message-16.png");
evolution_shell_component_add_user_creatable_item (shell_component, "post",
_("New Message Post"), _("_Post Message"),
_("Post a new mail message"),
"mail/public", 'p',
icon);
if (icon != NULL)
- g_object_unref (icon);
+ gdk_pixbuf_unref (icon);
for (i=0;i<sizeof(shell_component_handlers)/sizeof(shell_component_handlers[0]);i++) {
- shell_component_handlers[i].hand = g_signal_connect((shell_component),
+ shell_component_handlers[i].hand = gtk_signal_connect(GTK_OBJECT(shell_component),
shell_component_handlers[i].sig,
shell_component_handlers[i].func, NULL);
}
@@ -1081,6 +1071,36 @@ create_component (void)
return BONOBO_OBJECT (shell_component);
}
+void
+component_factory_init (void)
+{
+ BonoboObject *shell_component;
+ int result;
+
+ shell_component = create_component ();
+ result = oaf_active_server_register (COMPONENT_ID, bonobo_object_corba_objref (shell_component));
+ if (result == OAF_REG_ERROR) {
+ e_notice (NULL, GNOME_MESSAGE_BOX_ERROR,
+ _("Cannot initialize the Evolution mail component."));
+ exit (1);
+ } else if (result == OAF_REG_ALREADY_ACTIVE) {
+ g_warning ("evolution-mail is already running");
+ exit (1);
+ }
+
+ if (evolution_mail_config_factory_init () == FALSE) {
+ e_notice (NULL, GNOME_MESSAGE_BOX_ERROR,
+ _("Cannot initialize Evolution's mail config component."));
+ exit (1);
+ }
+
+ if (evolution_folder_info_factory_init () == FALSE) {
+ e_notice (NULL, GNOME_MESSAGE_BOX_ERROR,
+ _("Cannot initialize Evolution's folder info component."));
+ exit (1);
+ }
+}
+
static void
notify_listener (const Bonobo_Listener listener,
GNOME_Evolution_Storage_Result corba_result)
@@ -1259,19 +1279,20 @@ storage_remove_folder (EvolutionStorage *storage,
camel_url_free (url);
if (!fi) {
- notify_listener (listener, GNOME_Evolution_Storage_INVALID_URI);
camel_store_free_folder_info (store, root);
+ notify_listener (listener, GNOME_Evolution_Storage_INVALID_URI);
return;
}
storage_remove_folder_recursive (storage, store, fi, &ex);
- camel_store_free_folder_info (store, root);
if (camel_exception_is_set (&ex)) {
notify_listener_exception (listener, &ex);
camel_exception_clear (&ex);
} else {
notify_listener (listener, GNOME_Evolution_Storage_OK);
}
+
+ camel_store_free_folder_info (store, root);
}
static void
@@ -1313,20 +1334,24 @@ storage_xfer_folder (EvolutionStorage *storage,
}
static void
-storage_connected (CamelStore *store, CamelFolderInfo *info, void *listener)
+storage_connected (CamelStore *store, CamelFolderInfo *info, void *storage)
{
- notify_listener (listener, (info ? GNOME_Evolution_Storage_OK :
- GNOME_Evolution_Storage_GENERIC_ERROR));
+ if (!info) {
+ /* Let it know the connection failed by calling
+ * has_subfolders again.
+ */
+ evolution_storage_has_subfolders (storage, "/",
+ _("Connecting..."));
+ }
}
static void
storage_connect (EvolutionStorage *storage,
- const Bonobo_Listener listener,
const char *path,
CamelStore *store)
{
mail_note_store (CAMEL_STORE (store), storage, CORBA_OBJECT_NIL,
- storage_connected, listener);
+ storage_connected, storage);
}
static void
@@ -1337,10 +1362,10 @@ add_storage (const char *name, const char *uri, CamelService *store,
EvolutionStorageResult res;
storage = evolution_storage_new (name, FALSE);
- g_signal_connect(storage, "open_folder", G_CALLBACK(storage_connect), store);
- g_signal_connect(storage, "create_folder", G_CALLBACK(storage_create_folder), store);
- g_signal_connect(storage, "remove_folder", G_CALLBACK(storage_remove_folder), store);
- g_signal_connect(storage, "xfer_folder", G_CALLBACK(storage_xfer_folder), store);
+ gtk_signal_connect (GTK_OBJECT (storage), "open_folder", storage_connect, store);
+ gtk_signal_connect (GTK_OBJECT (storage), "create_folder", storage_create_folder, store);
+ gtk_signal_connect (GTK_OBJECT (storage), "remove_folder", storage_remove_folder, store);
+ gtk_signal_connect ((GtkObject *)storage, "xfer_folder", storage_xfer_folder, store);
res = evolution_storage_register_on_shell (storage, corba_shell);
@@ -1362,6 +1387,7 @@ add_storage (const char *name, const char *uri, CamelService *store,
}
}
+
void
mail_add_storage (CamelStore *store, const char *name, const char *uri)
{
@@ -1372,7 +1398,7 @@ mail_add_storage (CamelStore *store, const char *name, const char *uri)
g_return_if_fail (CAMEL_IS_STORE (store));
shell_client = evolution_shell_component_get_owner (shell_component);
- shell = evolution_shell_client_corba_objref (shell_client);
+ shell = bonobo_object_corba_objref (BONOBO_OBJECT (shell_client));
camel_exception_init (&ex);
@@ -1445,10 +1471,10 @@ mail_load_storage_by_uri (GNOME_Evolution_Shell shell, const char *uri, const ch
}
void
-mail_load_storages (GNOME_Evolution_Shell shell, EAccountList *accounts)
+mail_load_storages (GNOME_Evolution_Shell shell, const GSList *sources)
{
CamelException ex;
- EIterator *iter;
+ const GSList *iter;
camel_exception_init (&ex);
@@ -1457,23 +1483,22 @@ mail_load_storages (GNOME_Evolution_Shell shell, EAccountList *accounts)
* it.
*/
- iter = e_list_get_iterator ((EList *) accounts);
- while (e_iterator_is_valid (iter)) {
- EAccountService *service;
- EAccount *account;
- const char *name;
+ for (iter = sources; iter; iter = iter->next) {
+ const MailConfigAccount *account = NULL;
+ const MailConfigService *service = NULL;
+ char *name;
- account = (EAccount *) e_iterator_get (iter);
+ account = iter->data;
service = account->source;
name = account->name;
- if (account->enabled && service->url != NULL)
- mail_load_storage_by_uri (shell, service->url, name);
+ if (service == NULL || service->url == NULL || service->url[0] == '\0')
+ continue;
- e_iterator_next (iter);
+ /* don't auto-connect here; the shell will tell us to goOnline */
+ if (account->source->enabled)
+ mail_load_storage_by_uri (shell, service->url, name);
}
-
- g_object_unref (iter);
}
void
@@ -1532,7 +1557,7 @@ mail_remove_storage (CamelStore *store)
mail_note_store_remove(store);
shell_client = evolution_shell_component_get_owner (shell_component);
- corba_shell = evolution_shell_client_corba_objref(shell_client);
+ corba_shell = bonobo_object_corba_objref (BONOBO_OBJECT (shell_client));
evolution_storage_deregister_on_shell (storage, corba_shell);
@@ -1570,105 +1595,3 @@ mail_storages_foreach (GHFunc func, gpointer data)
{
g_hash_table_foreach (storages_hash, func, data);
}
-
-
-#define FACTORY_ID "OAFIID:GNOME_Evolution_Mail_ControlFactory"
-
-#define MAIL_CONFIG_IID "OAFIID:GNOME_Evolution_MailConfig"
-#define WIZARD_IID "OAFIID:GNOME_Evolution_Mail_Wizard"
-#define FOLDER_INFO_IID "OAFIID:GNOME_Evolution_FolderInfo"
-#define COMPOSER_IID "OAFIID:GNOME_Evolution_Mail_Composer"
-
-static BonoboObject *
-factory (BonoboGenericFactory *factory,
- const char *component_id,
- void *closure)
-{
- if (strcmp (component_id, COMPONENT_ID) == 0)
- return create_component();
- else if (strcmp(component_id, MAIL_CONFIG_IID) == 0)
- return (BonoboObject *)g_object_new (evolution_mail_config_get_type (), NULL);
- else if (strcmp(component_id, FOLDER_INFO_IID) == 0)
- return evolution_folder_info_new();
- else if (strcmp(component_id, WIZARD_IID) == 0)
- return evolution_mail_config_wizard_new();
-
-#warning "font prefs"
-#define MAIL_FONT_PREFS_CONTROL_ID "OAFIID:GNOME_Evolution_Mail_FontPrefs_ConfigControl"
-
- else if (strcmp (component_id, MAIL_ACCOUNTS_CONTROL_ID) == 0
- || strcmp (component_id, MAIL_PREFERENCES_CONTROL_ID) == 0
- || strcmp (component_id, MAIL_COMPOSER_PREFS_CONTROL_ID) == 0
- /* || strcmp (component_id, MAIL_FONT_PREFS_CONTROL_ID) == 0 */)
- return mail_config_control_factory_cb (factory, component_id, evolution_shell_client_corba_objref (global_shell_client));
- else if (strcmp(component_id, COMPOSER_IID) == 0)
- return (BonoboObject *)evolution_composer_new(composer_send_cb, composer_save_draft_cb);
-
- g_warning (FACTORY_ID ": Don't know what to do with %s", component_id);
- return NULL;
-}
-
-/* The GNOME SEGV handler will lose if it's not run from the main Gtk
- * thread. So if we crash in another thread, redirect the signal.
- */
-static void (*gnome_segv_handler) (int);
-
-static GStaticMutex segv_mutex = G_STATIC_MUTEX_INIT;
-
-static void
-segv_redirect (int sig)
-{
- if (pthread_self () == mail_gui_thread)
- gnome_segv_handler (sig);
- else {
- pthread_kill (mail_gui_thread, sig);
- /* We can't return from the signal handler or the
- * thread may SEGV again. But we can't pthread_exit,
- * because then the thread may get cleaned up before
- * bug-buddy can get a stack trace. So we block by
- * trying to lock a mutex we know is already locked.
- */
- g_static_mutex_lock (&segv_mutex);
- }
-}
-
-
-static Bonobo_Unknown
-make_factory (PortableServer_POA poa, const char *iid, gpointer impl_ptr, CORBA_Environment *ev)
-{
- struct sigaction sa, osa;
- static int init = 0;
-
- if (!init) {
- sigaction (SIGSEGV, NULL, &osa);
- if (osa.sa_handler != SIG_DFL) {
- sa.sa_flags = 0;
- sigemptyset (&sa.sa_mask);
- sa.sa_handler = segv_redirect;
- sigaction (SIGSEGV, &sa, NULL);
- sigaction (SIGBUS, &sa, NULL);
- sigaction (SIGFPE, &sa, NULL);
-
- sa.sa_handler = SIG_IGN;
- sigaction (SIGXFSZ, &sa, NULL);
- gnome_segv_handler = osa.sa_handler;
- g_static_mutex_lock (&segv_mutex);
- }
-
- /* init ? */
- mail_config_init ();
- mail_msg_init ();
- init = 1;
- }
-
- return bonobo_shlib_factory_std (FACTORY_ID, poa, impl_ptr, factory, NULL, ev);
-}
-
-static BonoboActivationPluginObject plugin_list[] = {
- {FACTORY_ID, make_factory},
- { NULL }
-};
-const BonoboActivationPlugin Bonobo_Plugin_info = {
- plugin_list, "Evolution Mail component factory"
-};
-
diff --git a/mail/folder-browser.c b/mail/folder-browser.c
index 0c9c44151e..aa4566eb5b 100644
--- a/mail/folder-browser.c
+++ b/mail/folder-browser.c
@@ -3,7 +3,7 @@
* Authors: Miguel De Icaza <miguel@ximian.com>
* Jeffrey Stedfast <fejj@ximian.com>
*
- * Copyright 2000-2003 Ximian, Inc. (www.ximian.com)
+ * Copyright 2000,2001 Ximian, Inc. (www.ximian.com)
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of version 2 of the GNU General Public
@@ -26,19 +26,17 @@
#include <config.h>
#endif
-#include <string.h>
#include <ctype.h>
#include <errno.h>
#include <gdk/gdkkeysyms.h>
#include <gtk/gtkinvisible.h>
+#include <gal/e-paned/e-vpaned.h>
#include <gal/e-table/e-table.h>
#include <gal/util/e-util.h>
#include <gal/widgets/e-gui-utils.h>
#include <gal/widgets/e-popup-menu.h>
-
-#include <gconf/gconf.h>
-#include <gconf/gconf-client.h>
+#include <gal/widgets/e-unicode.h>
#include <libgnomeui/gnome-dialog-util.h>
#include <libgnomeui/gnome-pixmap.h>
@@ -54,9 +52,9 @@
#include "filter/filter-input.h"
#include "filter/filter-label.h"
+#include "mail-search-dialogue.h"
#include "e-util/e-sexp.h"
#include "e-util/e-mktemp.h"
-#include "e-util/e-meta.h"
#include "folder-browser.h"
#include "e-searching-tokenizer.h"
#include "mail.h"
@@ -119,7 +117,7 @@ static const int num_paste_types = sizeof (paste_types) / sizeof (paste_types[0]
static GdkAtom clipboard_atom = GDK_NONE;
-static GtkTableClass *parent_class = NULL;
+static GtkObjectClass *folder_browser_parent_class;
enum {
FOLDER_LOADED,
@@ -130,44 +128,75 @@ enum {
static guint folder_browser_signals [LAST_SIGNAL] = {0, };
static void
-folder_browser_finalise (GObject *object)
+folder_browser_finalise (GtkObject *object)
{
FolderBrowser *folder_browser;
+ CORBA_Environment ev;
folder_browser = FOLDER_BROWSER (object);
-
+
+ CORBA_exception_init (&ev);
+
g_free (folder_browser->loading_uid);
g_free (folder_browser->pending_uid);
g_free (folder_browser->new_uid);
g_free (folder_browser->loaded_uid);
+ if (folder_browser->search_full)
+ gtk_object_unref (GTK_OBJECT (folder_browser->search_full));
+
+ if (folder_browser->sensitize_timeout_id)
+ g_source_remove (folder_browser->sensitize_timeout_id);
+
+ if (folder_browser->shell != CORBA_OBJECT_NIL) {
+ CORBA_Object_release (folder_browser->shell, &ev);
+ folder_browser->shell = CORBA_OBJECT_NIL;
+ }
+
+ if (folder_browser->shell_view != CORBA_OBJECT_NIL) {
+ CORBA_Object_release(folder_browser->shell_view, &ev);
+ folder_browser->shell_view = CORBA_OBJECT_NIL;
+ }
+
+ if (folder_browser->uicomp)
+ bonobo_object_unref (BONOBO_OBJECT (folder_browser->uicomp));
+
g_free (folder_browser->uri);
folder_browser->uri = NULL;
-
+
+ CORBA_exception_free (&ev);
+
+ if (folder_browser->view_instance) {
+ gtk_object_unref (GTK_OBJECT (folder_browser->view_instance));
+ folder_browser->view_instance = NULL;
+ }
+
+ if (folder_browser->view_menus) {
+ gtk_object_unref (GTK_OBJECT (folder_browser->view_menus));
+ folder_browser->view_menus = NULL;
+ }
+
+ gtk_object_unref (GTK_OBJECT (folder_browser->invisible));
+ folder_browser->invisible = NULL;
+
if (folder_browser->clipboard_selection)
g_byte_array_free (folder_browser->clipboard_selection, TRUE);
if (folder_browser->sensitise_state) {
- g_hash_table_destroy (folder_browser->sensitise_state);
+ g_hash_table_destroy(folder_browser->sensitise_state);
folder_browser->sensitise_state = NULL;
}
- G_OBJECT_CLASS (parent_class)->finalize (object);
+ folder_browser_parent_class->finalize (object);
}
static void
folder_browser_destroy (GtkObject *object)
{
FolderBrowser *folder_browser;
- CORBA_Environment ev;
- GConfClient *gconf;
folder_browser = FOLDER_BROWSER (object);
- gconf = gconf_client_get_default ();
-
- CORBA_exception_init (&ev);
-
if (folder_browser->seen_id != 0) {
gtk_timeout_remove (folder_browser->seen_id);
folder_browser->seen_id = 0;
@@ -187,52 +216,12 @@ folder_browser_destroy (GtkObject *object)
gtk_widget_destroy (GTK_WIDGET (folder_browser->mail_display));
folder_browser->mail_display = NULL;
}
-
- if (folder_browser->view_instance) {
- g_object_unref (folder_browser->view_instance);
- folder_browser->view_instance = NULL;
- }
-
- if (folder_browser->view_menus) {
- g_object_unref (folder_browser->view_menus);
- folder_browser->view_menus = NULL;
- }
/* wait for all outstanding async events against us */
mail_async_event_destroy (folder_browser->async_event);
-
- if (folder_browser->search_full) {
- g_object_unref (folder_browser->search_full);
- folder_browser->search_full = NULL;
- }
- if (folder_browser->sensitize_timeout_id) {
- g_source_remove (folder_browser->sensitize_timeout_id);
- folder_browser->sensitize_timeout_id = 0;
- }
-
- if (folder_browser->shell != CORBA_OBJECT_NIL) {
- CORBA_Object_release (folder_browser->shell, &ev);
- folder_browser->shell = CORBA_OBJECT_NIL;
- }
-
- if (folder_browser->shell_view != CORBA_OBJECT_NIL) {
- CORBA_Object_release (folder_browser->shell_view, &ev);
- folder_browser->shell_view = CORBA_OBJECT_NIL;
- }
-
- if (folder_browser->uicomp) {
- bonobo_object_unref (BONOBO_OBJECT (folder_browser->uicomp));
- folder_browser->uicomp = NULL;
- }
-
- if (folder_browser->invisible) {
- g_object_unref (folder_browser->invisible);
- folder_browser->invisible = NULL;
- }
-
if (folder_browser->get_id != -1) {
- mail_msg_cancel (folder_browser->get_id);
+ mail_msg_cancel(folder_browser->get_id);
folder_browser->get_id = -1;
}
@@ -242,45 +231,38 @@ folder_browser_destroy (GtkObject *object)
camel_object_unhook_event (CAMEL_OBJECT (folder_browser->folder), "message_changed",
folder_changed, folder_browser);
mail_sync_folder (folder_browser->folder, NULL, NULL);
- camel_object_unref (folder_browser->folder);
+ camel_object_unref (CAMEL_OBJECT (folder_browser->folder));
folder_browser->folder = NULL;
}
-
- CORBA_exception_free (&ev);
- GTK_OBJECT_CLASS (parent_class)->destroy (object);
+ folder_browser_parent_class->destroy (object);
}
static void
-folder_browser_class_init (FolderBrowserClass *klass)
+folder_browser_class_init (GtkObjectClass *object_class)
{
- GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
- GtkObjectClass *object_class = GTK_OBJECT_CLASS (klass);
-
- parent_class = g_type_class_ref(PARENT_TYPE);
-
object_class->destroy = folder_browser_destroy;
- gobject_class->finalize = folder_browser_finalise;
+ object_class->finalize = folder_browser_finalise;
+
+ folder_browser_parent_class = gtk_type_class (PARENT_TYPE);
folder_browser_signals[FOLDER_LOADED] =
- g_signal_new ("folder_loaded",
- FOLDER_BROWSER_TYPE,
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (FolderBrowserClass, folder_loaded),
- NULL,
- NULL,
- g_cclosure_marshal_VOID__STRING,
- G_TYPE_NONE, 1, G_TYPE_STRING);
+ gtk_signal_new ("folder_loaded",
+ GTK_RUN_LAST,
+ object_class->type,
+ GTK_SIGNAL_OFFSET (FolderBrowserClass, folder_loaded),
+ gtk_marshal_NONE__STRING,
+ GTK_TYPE_NONE, 1, GTK_TYPE_STRING);
folder_browser_signals[MESSAGE_LOADED] =
- g_signal_new ("message_loaded",
- FOLDER_BROWSER_TYPE,
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (FolderBrowserClass, message_loaded),
- NULL,
- NULL,
- g_cclosure_marshal_VOID__STRING,
- G_TYPE_NONE, 1, G_TYPE_STRING);
+ gtk_signal_new ("message_loaded",
+ GTK_RUN_LAST,
+ object_class->type,
+ GTK_SIGNAL_OFFSET (FolderBrowserClass, message_loaded),
+ gtk_marshal_NONE__STRING,
+ GTK_TYPE_NONE, 1, GTK_TYPE_STRING);
+
+ gtk_object_class_add_signals (object_class, folder_browser_signals, LAST_SIGNAL);
/* clipboard atom */
if (!clipboard_atom)
@@ -746,87 +728,84 @@ folder_browser_paste (GtkWidget *menuitem, FolderBrowser *fb)
/* all this crap so we can give the user a whoopee doo status bar */
static void
-update_status_bar (FolderBrowser *fb)
+update_status_bar(FolderBrowser *fb)
{
- extern CamelFolder *outbox_folder, *sent_folder;
CORBA_Environment ev;
int tmp, total;
GString *work;
-
+ extern CamelFolder *outbox_folder, *sent_folder;
+
if (fb->folder == NULL
|| fb->message_list == NULL
|| fb->shell_view == CORBA_OBJECT_NIL)
return;
-
- if (!fb->message_list->hidedeleted || !camel_folder_has_summary_capability (fb->folder)) {
- total = camel_folder_get_message_count (fb->folder);
+
+ if (!fb->message_list->hidedeleted || !camel_folder_has_summary_capability(fb->folder)) {
+ total = camel_folder_get_message_count(fb->folder);
} else {
- GPtrArray *sum = camel_folder_get_summary (fb->folder);
+ GPtrArray *sum = camel_folder_get_summary(fb->folder);
int i;
-
+
if (sum) {
total = 0;
- for (i = 0; i < sum->len; i++) {
+ for (i=0;i<sum->len;i++) {
CamelMessageInfo *info = sum->pdata[i];
if ((info->flags & CAMEL_MESSAGE_DELETED) == 0)
total++;
}
- camel_folder_free_summary (fb->folder, sum);
+ camel_folder_free_summary(fb->folder, sum);
} else {
- total = camel_folder_get_message_count (fb->folder);
+ total = camel_folder_get_message_count(fb->folder);
}
}
- work = g_string_new ("");
- g_string_append_printf (work, _("%d new"), camel_folder_get_unread_message_count (fb->folder));
- tmp = message_list_hidden (fb->message_list);
+ work = g_string_new("");
+ g_string_sprintfa(work, _("%d new"), camel_folder_get_unread_message_count(fb->folder));
+ tmp = message_list_hidden(fb->message_list);
if (0 < tmp && tmp < total) {
- g_string_append (work, _(", "));
+ g_string_append(work, _(", "));
if (tmp < total / 2)
- g_string_append_printf (work, _("%d hidden"), tmp);
+ g_string_sprintfa(work, _("%d hidden"), tmp);
else
- g_string_append_printf (work, _("%d visible"), total - tmp);
+ g_string_sprintfa(work, _("%d visible"), total - tmp);
}
- tmp = e_selection_model_selected_count (e_tree_get_selection_model (fb->message_list->tree));
+ tmp = e_selection_model_selected_count(e_tree_get_selection_model(fb->message_list->tree));
if (tmp) {
- g_string_append (work, _(", "));
- g_string_append_printf (work, _("%d selected"), tmp);
+ g_string_append(work, _(", "));
+ g_string_sprintfa(work, _("%d selected"), tmp);
}
- g_string_append (work, _(", "));
-
+ g_string_append(work, _(", "));
+
if (fb->folder == outbox_folder)
- g_string_append_printf (work, _("%d unsent"), total);
+ g_string_sprintfa(work, _("%d unsent"), total);
else if (fb->folder == sent_folder)
- g_string_append_printf (work, _("%d sent"), total);
+ g_string_sprintfa(work, _("%d sent"), total);
else
- g_string_append_printf (work, _("%d total"), total);
-
- CORBA_exception_init (&ev);
- GNOME_Evolution_ShellView_setFolderBarLabel (fb->shell_view, work->str, &ev);
- CORBA_exception_free (&ev);
-
+ g_string_sprintfa(work, _("%d total"), total);
+
+ CORBA_exception_init(&ev);
+ GNOME_Evolution_ShellView_setFolderBarLabel(fb->shell_view, work->str, &ev);
+ CORBA_exception_free(&ev);
+
if (fb->update_status_bar_idle_id != 0) {
g_source_remove (fb->update_status_bar_idle_id);
fb->update_status_bar_idle_id = 0;
}
-
- g_string_free (work, TRUE);
+
+ g_string_free(work, TRUE);
}
static gboolean
update_status_bar_idle_cb(gpointer data)
{
FolderBrowser *fb = data;
-
-#if 0
+
if (!GTK_OBJECT_DESTROYED (fb))
-#endif
update_status_bar (fb);
fb->update_status_bar_idle_id = 0;
- g_object_unref (fb);
-
+ gtk_object_unref (GTK_OBJECT (fb));
return FALSE;
}
@@ -834,7 +813,7 @@ static void
update_status_bar_idle(FolderBrowser *fb)
{
if (fb->update_status_bar_idle_id == 0) {
- g_object_ref (fb);
+ gtk_object_ref (GTK_OBJECT (fb));
fb->update_status_bar_idle_id = g_idle_add (update_status_bar_idle_cb, fb);
}
}
@@ -847,27 +826,24 @@ static void main_folder_changed(CamelObject *o, void *event_data, void *data)
return;
/* so some corba unref doesnt blow us away while we're busy */
- g_object_ref (fb);
- update_status_bar (fb);
+ gtk_object_ref((GtkObject *)fb);
+ update_status_bar(fb);
folder_browser_ui_scan_selection (fb);
- g_object_unref (fb);
+ gtk_object_unref((GtkObject *)fb);
}
-static void folder_changed (CamelObject *obj, void *event_data, void *user_data)
+static void folder_changed(CamelObject *o, void *event_data, void *data)
{
- FolderBrowser *fb = user_data;
+ FolderBrowser *fb = data;
- mail_async_event_emit (fb->async_event, MAIL_ASYNC_GUI,
- (MailAsyncFunc) main_folder_changed,
- obj, NULL, user_data);
+ mail_async_event_emit(fb->async_event, MAIL_ASYNC_GUI, (MailAsyncFunc)main_folder_changed, o, NULL, data);
}
static void
-got_folder (char *uri, CamelFolder *folder, void *user_data)
+got_folder (char *uri, CamelFolder *folder, void *data)
{
- FolderBrowser *fb = user_data;
- EMeta *meta;
-
+ FolderBrowser *fb = data;
+
fb->get_id = -1;
d(printf ("got folder '%s' = %p, previous folder was %p\n", uri, folder, fb->folder));
@@ -876,30 +852,16 @@ got_folder (char *uri, CamelFolder *folder, void *user_data)
goto done;
if (fb->folder) {
- camel_object_unhook_event (fb->folder, "folder_changed", folder_changed, fb);
- camel_object_unhook_event (fb->folder, "message_changed", folder_changed, fb);
- camel_object_unref (fb->folder);
- }
-
- if (folder) {
- fb->folder = folder;
- camel_object_ref (folder);
- meta = mail_tool_get_meta_data(fb->uri);
- if (meta != fb->meta) {
- g_object_unref(fb->meta);
- fb->meta = meta;
- } else {
- g_object_unref(meta);
- }
- } else {
- fb->folder = NULL;
- if (fb->meta) {
- g_object_unref(fb->meta);
- fb->meta = NULL;
- }
- goto done;
+ camel_object_unhook_event(fb->folder, "folder_changed", folder_changed, fb);
+ camel_object_unhook_event(fb->folder, "message_changed", folder_changed, fb);
+ camel_object_unref(fb->folder);
}
-
+
+ fb->folder = folder;
+ if (folder == NULL)
+ goto done;
+
+ camel_object_ref (CAMEL_OBJECT (folder));
gtk_widget_set_sensitive (GTK_WIDGET (fb->search), camel_folder_has_search_capability (folder));
message_list_set_folder (fb->message_list, folder,
@@ -923,8 +885,8 @@ got_folder (char *uri, CamelFolder *folder, void *user_data)
folder_browser_ui_set_selection_state (fb, FB_SELSTATE_NONE);
done:
- g_signal_emit (fb, folder_browser_signals[FOLDER_LOADED], 0, fb->uri);
- g_object_unref (fb);
+ gtk_signal_emit (GTK_OBJECT (fb), folder_browser_signals [FOLDER_LOADED], fb->uri);
+ gtk_object_unref (GTK_OBJECT (fb));
}
@@ -935,8 +897,8 @@ folder_browser_reload (FolderBrowser *fb)
if (fb->folder) {
mail_refresh_folder (fb->folder, NULL, NULL);
- } else if (fb->uri && fb->get_id == -1) {
- g_object_ref (fb);
+ } else if (fb->uri) {
+ gtk_object_ref (GTK_OBJECT (fb));
fb->get_id = mail_get_folder (fb->uri, 0, got_folder, fb, mail_thread_new);
}
}
@@ -954,7 +916,7 @@ folder_browser_set_folder (FolderBrowser *fb, CamelFolder *folder, const char *u
g_free (fb->uri);
fb->uri = g_strdup (uri);
- g_object_ref (fb);
+ gtk_object_ref (GTK_OBJECT (fb));
got_folder (NULL, folder, fb);
}
@@ -962,23 +924,23 @@ void
folder_browser_set_ui_component (FolderBrowser *fb, BonoboUIComponent *uicomp)
{
g_return_if_fail (IS_FOLDER_BROWSER (fb));
-
+
if (fb->sensitize_timeout_id) {
g_source_remove (fb->sensitize_timeout_id);
fb->sensitize_timeout_id = 0;
}
-
+
if (fb->sensitise_state) {
- g_hash_table_destroy (fb->sensitise_state);
+ g_hash_table_destroy(fb->sensitise_state);
fb->sensitise_state = NULL;
}
if (fb->uicomp)
bonobo_object_unref (BONOBO_OBJECT (fb->uicomp));
-
+
if (uicomp)
bonobo_object_ref (BONOBO_OBJECT (uicomp));
-
+
fb->uicomp = uicomp;
}
@@ -986,18 +948,18 @@ void
folder_browser_set_shell_view(FolderBrowser *fb, GNOME_Evolution_ShellView shell_view)
{
CORBA_Environment ev;
-
+
CORBA_exception_init(&ev);
if (fb->shell_view != CORBA_OBJECT_NIL)
- CORBA_Object_release (fb->shell_view, &ev);
- CORBA_exception_free (&ev);
-
- fb->shell_view = CORBA_Object_duplicate (shell_view, &ev);
- CORBA_exception_free (&ev);
+ CORBA_Object_release(fb->shell_view, &ev);
+ CORBA_exception_free(&ev);
+ fb->shell_view = CORBA_Object_duplicate(shell_view, &ev);
+ CORBA_exception_free(&ev);
+
/* small hack, at this point we've just been activated */
if (fb->shell_view != CORBA_OBJECT_NIL)
- update_status_bar (fb);
+ update_status_bar(fb);
}
extern CamelFolder *drafts_folder, *sent_folder, *outbox_folder;
@@ -1012,35 +974,26 @@ extern CamelFolder *drafts_folder, *sent_folder, *outbox_folder;
gboolean
folder_browser_is_drafts (FolderBrowser *fb)
{
- gboolean is_drafts = FALSE;
- EAccountList *accounts;
- EAccount *account;
- EIterator *iter;
+ const GSList *accounts;
+ MailConfigAccount *account;
g_return_val_if_fail (IS_FOLDER_BROWSER (fb), FALSE);
-
+
if (fb->uri == NULL || fb->folder == NULL)
return FALSE;
if (fb->folder == drafts_folder)
return TRUE;
-
+
accounts = mail_config_get_accounts ();
- iter = e_list_get_iterator ((EList *) accounts);
- while (e_iterator_is_valid (iter)) {
- account = (EAccount *) e_iterator_get (iter);
- if (account->drafts_folder_uri &&
- camel_store_uri_cmp (fb->folder->parent_store, account->drafts_folder_uri, fb->uri)) {
- is_drafts = TRUE;
- break;
- }
-
- e_iterator_next (iter);
+ while (accounts) {
+ account = accounts->data;
+ if (account->drafts_folder_uri && camel_store_uri_cmp(fb->folder->parent_store, account->drafts_folder_uri, fb->uri))
+ return TRUE;
+ accounts = accounts->next;
}
- g_object_unref (iter);
-
- return is_drafts;
+ return FALSE;
}
/**
@@ -1053,35 +1006,26 @@ folder_browser_is_drafts (FolderBrowser *fb)
gboolean
folder_browser_is_sent (FolderBrowser *fb)
{
- gboolean is_sent = FALSE;
- EAccountList *accounts;
- EAccount *account;
- EIterator *iter;
+ const GSList *accounts;
+ MailConfigAccount *account;
g_return_val_if_fail (IS_FOLDER_BROWSER (fb), FALSE);
-
+
if (fb->uri == NULL || fb->folder == NULL)
return FALSE;
-
+
if (fb->folder == sent_folder)
return TRUE;
accounts = mail_config_get_accounts ();
- iter = e_list_get_iterator ((EList *) accounts);
- while (e_iterator_is_valid (iter)) {
- account = (EAccount *) e_iterator_get (iter);
- if (account->sent_folder_uri &&
- camel_store_uri_cmp (fb->folder->parent_store, account->sent_folder_uri, fb->uri)) {
- is_sent = TRUE;
- break;
- }
-
- e_iterator_next (iter);
+ while (accounts) {
+ account = accounts->data;
+ if (account->sent_folder_uri && camel_store_uri_cmp(fb->folder->parent_store, account->sent_folder_uri, fb->uri))
+ return TRUE;
+ accounts = accounts->next;
}
- g_object_unref (iter);
-
- return is_sent;
+ return FALSE;
}
/**
@@ -1103,26 +1047,22 @@ save_cursor_pos (FolderBrowser *fb)
{
ETreePath node;
GtkAdjustment *adj;
- int row, y, height, paned_size;
- GConfClient *gconf;
-
+ int row, y, height;
+
node = e_tree_get_cursor (fb->message_list->tree);
if (!node)
return -1;
-
+
row = e_tree_row_of_node (fb->message_list->tree, node);
-
+
if (row == -1)
return 0;
-
+
e_tree_get_cell_geometry (fb->message_list->tree, row, 0,
NULL, &y, NULL, &height);
-
- gconf = gconf_client_get_default ();
- paned_size = gconf_client_get_int (gconf, "/apps/evolution/mail/display/paned_size", NULL);
-
- adj = gtk_scrolled_window_get_vadjustment (GTK_SCROLLED_WINDOW (fb->message_list));
- y += adj->value - ((paned_size - height) / 2);
+
+ adj = e_scroll_frame_get_vadjustment (E_SCROLL_FRAME (fb->message_list));
+ y += adj->value - ((mail_config_get_paned_size () - height) / 2);
return y;
}
@@ -1131,41 +1071,37 @@ static void
set_cursor_pos (FolderBrowser *fb, int y)
{
GtkAdjustment *adj;
-
+
if (y == -1)
return;
-
- adj = gtk_scrolled_window_get_vadjustment (GTK_SCROLLED_WINDOW (fb->message_list));
+
+ adj = e_scroll_frame_get_vadjustment (E_SCROLL_FRAME (fb->message_list));
gtk_adjustment_set_value (adj, (gfloat)y);
}
static gboolean do_message_selected(FolderBrowser *fb);
void
-folder_browser_set_message_preview (FolderBrowser *folder_browser, gboolean show_preview)
+folder_browser_set_message_preview (FolderBrowser *folder_browser, gboolean show_message_preview)
{
- GConfClient *gconf;
- int paned_size, y;
-
- if (folder_browser->preview_shown == show_preview
+ if (folder_browser->preview_shown == show_message_preview
|| folder_browser->message_list == NULL)
return;
-
- folder_browser->preview_shown = show_preview;
-
- gconf = gconf_client_get_default ();
- paned_size = gconf_client_get_int (gconf, "/apps/evolution/mail/display/paned_size", NULL);
-
- if (show_preview) {
+
+ folder_browser->preview_shown = show_message_preview;
+
+ if (show_message_preview) {
+ int y;
y = save_cursor_pos (folder_browser);
- gtk_paned_set_position (GTK_PANED (folder_browser->vpaned), paned_size);
+ e_paned_set_position (E_PANED (folder_browser->vpaned), mail_config_get_paned_size ());
gtk_widget_show (GTK_WIDGET (folder_browser->mail_display));
do_message_selected (folder_browser);
set_cursor_pos (folder_browser, y);
} else {
+ e_paned_set_position (E_PANED (folder_browser->vpaned), 10000);
gtk_widget_hide (GTK_WIDGET (folder_browser->mail_display));
mail_display_set_message (folder_browser->mail_display, NULL, NULL, NULL);
- folder_browser_ui_message_loaded (folder_browser);
+ folder_browser_ui_message_loaded(folder_browser);
}
}
@@ -1196,13 +1132,13 @@ folder_browser_search_menu_activated (ESearchBar *esb, int id, FolderBrowser *fb
if (efb->current_query) {
FilterRule *rule = vfolder_clone_rule(efb->current_query);
char *name, *text;
-
+
text = e_search_bar_get_text(esb);
name = g_strdup_printf("%s %s", rule->name, (text&&text[0])?text:"''");
- g_free (text);
+ g_free(text);
filter_rule_set_name(rule, name);
- g_free (name);
-
+ g_free(name);
+
filter_rule_set_source(rule, FILTER_SOURCE_INCOMING);
vfolder_rule_add_source((VfolderRule *)rule, fb->uri);
vfolder_gui_add_rule((VfolderRule *)rule);
@@ -1219,16 +1155,16 @@ folder_browser_config_search (EFilterBar *efb, FilterRule *rule, int id, const c
GList *partl;
struct _camel_search_words *words;
int i;
-
+
st = E_SEARCHING_TOKENIZER (fb->mail_display->html->engine->ht);
-
+
e_searching_tokenizer_set_secondary_search_string (st, NULL);
/* we scan the parts of a rule, and set all the types we know about to the query string */
partl = rule->parts;
while (partl) {
FilterPart *part = partl->data;
-
+
if (!strcmp(part->name, "subject")) {
FilterInput *input = (FilterInput *)filter_part_find_element(part, "subject");
if (input)
@@ -1237,11 +1173,12 @@ folder_browser_config_search (EFilterBar *efb, FilterRule *rule, int id, const c
FilterInput *input = (FilterInput *)filter_part_find_element(part, "word");
if (input)
filter_input_set_value(input, query);
-
+
words = camel_search_words_split(query);
for (i=0;i<words->len;i++)
e_searching_tokenizer_add_secondary_search_string (st, words->words[i]->word);
- camel_search_words_free (words);
+ camel_search_words_free(words);
+
} else if(!strcmp(part->name, "sender")) {
FilterInput *input = (FilterInput *)filter_part_find_element(part, "sender");
if (input)
@@ -1264,18 +1201,21 @@ static void
folder_browser_search_do_search (ESearchBar *esb, FolderBrowser *fb)
{
char *search_word;
-
+
if (fb->message_list == NULL)
return;
d(printf("do search\n"));
- g_object_get (esb, "query", &search_word, NULL);
-
+ gtk_object_get (GTK_OBJECT (esb),
+ "query", &search_word,
+ NULL);
+
message_list_set_search (fb->message_list, search_word);
d(printf("query is %s\n", search_word));
- g_free (search_word);
+ g_free(search_word);
+ return;
}
static void
@@ -1296,15 +1236,13 @@ folder_browser_toggle_preview (BonoboUIComponent *component,
gpointer user_data)
{
FolderBrowser *fb = user_data;
- gboolean bstate;
-
- if (type != Bonobo_UIComponent_STATE_CHANGED || fb->message_list == NULL)
+
+ if (type != Bonobo_UIComponent_STATE_CHANGED
+ || fb->message_list == NULL)
return;
- bstate = atoi(state);
- e_meta_set_bool(fb->meta, "show_preview", bstate);
- gconf_client_set_bool (gconf_client_get_default(), "/apps/evolution/mail/display/show_preview", bstate, NULL);
- folder_browser_set_message_preview (fb, bstate);
+ mail_config_set_show_preview (fb->uri, atoi (state));
+ folder_browser_set_message_preview (fb, atoi (state));
}
void
@@ -1316,19 +1254,17 @@ folder_browser_toggle_threads (BonoboUIComponent *component,
{
FolderBrowser *fb = user_data;
int prev_state;
- gboolean bstate;
-
- if (type != Bonobo_UIComponent_STATE_CHANGED || fb->message_list == NULL)
- return;
- bstate = atoi(state);
- e_meta_set_bool(fb->meta, "thread_list", bstate);
- gconf_client_set_bool (gconf_client_get_default (), "/apps/evolution/mail/display/thread_list", bstate, NULL);
- message_list_set_threaded (fb->message_list, bstate);
+ if (type != Bonobo_UIComponent_STATE_CHANGED
+ || fb->message_list == NULL)
+ return;
+ mail_config_set_thread_list (fb->uri, atoi (state));
+ message_list_set_threaded (fb->message_list, atoi (state));
+
prev_state = fb->selection_state;
fb->selection_state = FB_SELSTATE_UNDEFINED;
- folder_browser_ui_set_selection_state (fb, prev_state);
+ folder_browser_ui_set_selection_state (fb, prev_state);
}
void
@@ -1339,17 +1275,14 @@ folder_browser_toggle_hide_deleted (BonoboUIComponent *component,
gpointer user_data)
{
FolderBrowser *fb = user_data;
- GConfClient *gconf;
-
- if (type != Bonobo_UIComponent_STATE_CHANGED || fb->message_list == NULL)
+
+ if (type != Bonobo_UIComponent_STATE_CHANGED
+ || fb->message_list == NULL)
return;
-
- gconf = gconf_client_get_default ();
- gconf_client_set_bool (gconf, "/apps/evolution/mail/display/show_deleted",
- !atoi (state), NULL);
-
+
if (!(fb->folder && (fb->folder->folder_flags & CAMEL_FOLDER_IS_TRASH)))
- message_list_set_hidedeleted (fb->message_list, atoi (state));
+ mail_config_set_hide_deleted (atoi (state));
+ message_list_set_hidedeleted (fb->message_list, atoi (state));
}
void
@@ -1361,25 +1294,20 @@ folder_browser_set_message_display_style (BonoboUIComponent *component
{
extern char *message_display_styles[];
FolderBrowser *fb = user_data;
- GConfClient *gconf;
int i;
-
+
if (type != Bonobo_UIComponent_STATE_CHANGED
- || atoi (state) == 0
+ || atoi(state) == 0
|| fb->message_list == NULL)
return;
-
- gconf = gconf_client_get_default ();
-
- printf ("message display style: %s\n", path);
-
+
for (i = 0; i < MAIL_CONFIG_DISPLAY_MAX; i++) {
if (strstr (message_display_styles[i], path)) {
fb->mail_display->display_style = i;
mail_display_redisplay (fb->mail_display, TRUE);
-
+
if (fb->pref_master)
- gconf_client_set_int (gconf, "/apps/evolution/mail/display/message_style", i, NULL);
+ mail_config_set_message_display_style (i);
return;
}
}
@@ -1416,55 +1344,55 @@ vfolder_type_current(FolderBrowser *fb, int type)
{
GPtrArray *uids;
int i;
-
+
/* get uid */
- uids = g_ptr_array_new ();
- message_list_foreach (fb->message_list, enumerate_msg, uids);
-
+ uids = g_ptr_array_new();
+ message_list_foreach(fb->message_list, enumerate_msg, uids);
+
if (uids->len == 1)
- vfolder_type_uid (fb->folder, (char *)uids->pdata[0], fb->uri, type);
-
- for (i = 0; i < uids->len; i++)
- g_free (uids->pdata[i]);
- g_ptr_array_free (uids, TRUE);
+ vfolder_type_uid(fb->folder, (char *)uids->pdata[0], fb->uri, type);
+
+ for (i=0; i<uids->len; i++)
+ g_free(uids->pdata[i]);
+ g_ptr_array_free(uids, TRUE);
}
/* external api to vfolder/filter on X, based on current message */
-void vfolder_subject (GtkWidget *w, FolderBrowser *fb) { vfolder_type_current(fb, AUTO_SUBJECT); }
-void vfolder_sender (GtkWidget *w, FolderBrowser *fb) { vfolder_type_current(fb, AUTO_FROM); }
-void vfolder_recipient (GtkWidget *w, FolderBrowser *fb) { vfolder_type_current(fb, AUTO_TO); }
-void vfolder_mlist (GtkWidget *w, FolderBrowser *fb) { vfolder_type_current(fb, AUTO_MLIST); }
+void vfolder_subject(GtkWidget *w, FolderBrowser *fb) { vfolder_type_current(fb, AUTO_SUBJECT); }
+void vfolder_sender(GtkWidget *w, FolderBrowser *fb) { vfolder_type_current(fb, AUTO_FROM); }
+void vfolder_recipient(GtkWidget *w, FolderBrowser *fb) { vfolder_type_current(fb, AUTO_TO); }
+void vfolder_mlist(GtkWidget *w, FolderBrowser *fb) { vfolder_type_current(fb, AUTO_MLIST); }
-static void filter_type_uid (CamelFolder *folder, const char *uid, const char *source, int type);
+static void filter_type_uid(CamelFolder *folder, const char *uid, const char *source, int type);
static void
-filter_type_current (FolderBrowser *fb, int type)
+filter_type_current(FolderBrowser *fb, int type)
{
GPtrArray *uids;
int i;
const char *source;
-
+
if (folder_browser_is_sent (fb) || folder_browser_is_outbox (fb))
source = FILTER_SOURCE_OUTGOING;
else
source = FILTER_SOURCE_INCOMING;
-
+
/* get uid */
- uids = g_ptr_array_new ();
- message_list_foreach (fb->message_list, enumerate_msg, uids);
-
+ uids = g_ptr_array_new();
+ message_list_foreach(fb->message_list, enumerate_msg, uids);
+
if (uids->len == 1)
- filter_type_uid (fb->folder, (char *)uids->pdata[0], source, type);
-
- for (i = 0; i < uids->len; i++)
- g_free (uids->pdata[i]);
- g_ptr_array_free (uids, TRUE);
+ filter_type_uid(fb->folder, (char *)uids->pdata[0], source, type);
+
+ for (i=0; i<uids->len; i++)
+ g_free(uids->pdata[i]);
+ g_ptr_array_free(uids, TRUE);
}
-void filter_subject (GtkWidget *w, FolderBrowser *fb) { filter_type_current (fb, AUTO_SUBJECT); }
-void filter_sender (GtkWidget *w, FolderBrowser *fb) { filter_type_current (fb, AUTO_FROM); }
-void filter_recipient (GtkWidget *w, FolderBrowser *fb) { filter_type_current (fb, AUTO_TO); }
-void filter_mlist (GtkWidget *w, FolderBrowser *fb) { filter_type_current (fb, AUTO_MLIST); }
+void filter_subject(GtkWidget *w, FolderBrowser *fb) { filter_type_current(fb, AUTO_SUBJECT); }
+void filter_sender(GtkWidget *w, FolderBrowser *fb) { filter_type_current(fb, AUTO_FROM); }
+void filter_recipient(GtkWidget *w, FolderBrowser *fb) { filter_type_current(fb, AUTO_TO); }
+void filter_mlist(GtkWidget *w, FolderBrowser *fb) { filter_type_current(fb, AUTO_MLIST); }
/* ************************************************************ */
@@ -1479,14 +1407,14 @@ struct _filter_data {
};
static void
-filter_data_free (struct _filter_data *fdata)
+filter_data_free(struct _filter_data *fdata)
{
- g_free (fdata->uid);
- g_free (fdata->uri);
+ g_free(fdata->uid);
+ g_free(fdata->uri);
if (fdata->folder)
- camel_object_unref (fdata->folder);
- g_free (fdata->mlist);
- g_free (fdata);
+ camel_object_unref((CamelObject *)fdata->folder);
+ g_free(fdata->mlist);
+ g_free(fdata);
}
static void
@@ -1497,14 +1425,14 @@ vfolder_type_got_message(CamelFolder *folder, const char *uid, CamelMimeMessage
if (msg)
vfolder_gui_add_from_message(msg, data->type, data->uri);
- filter_data_free (data);
+ filter_data_free(data);
}
static void
vfolder_type_uid(CamelFolder *folder, const char *uid, const char *uri, int type)
{
struct _filter_data *data;
-
+
data = g_malloc0(sizeof(*data));
data->type = type;
data->uri = g_strdup(uri);
@@ -1520,18 +1448,18 @@ static void
filter_type_got_message(CamelFolder *folder, const char *uid, CamelMimeMessage *msg, void *d)
{
struct _filter_data *data = d;
-
+
if (msg)
filter_gui_add_from_message(msg, data->source, data->type);
-
- filter_data_free (data);
+
+ filter_data_free(data);
}
static void
filter_type_uid(CamelFolder *folder, const char *uid, const char *source, int type)
{
struct _filter_data *data;
-
+
data = g_malloc0(sizeof(*data));
data->type = type;
data->source = source;
@@ -1546,7 +1474,7 @@ static void filter_mlist_uid(GtkWidget *w, struct _filter_data *fdata) { filter
void
hide_none(GtkWidget *w, FolderBrowser *fb)
{
- message_list_hide_clear (fb->message_list);
+ message_list_hide_clear(fb->message_list);
}
void
@@ -1555,19 +1483,19 @@ hide_selected(GtkWidget *w, FolderBrowser *fb)
GPtrArray *uids;
int i;
- uids = g_ptr_array_new ();
- message_list_foreach (fb->message_list, enumerate_msg, uids);
- message_list_hide_uids (fb->message_list, uids);
- for (i = 0; i < uids->len; i++)
- g_free (uids->pdata[i]);
- g_ptr_array_free (uids, TRUE);
+ uids = g_ptr_array_new();
+ message_list_foreach(fb->message_list, enumerate_msg, uids);
+ message_list_hide_uids(fb->message_list, uids);
+ for (i=0; i<uids->len; i++)
+ g_free(uids->pdata[i]);
+ g_ptr_array_free(uids, TRUE);
}
void
hide_deleted(GtkWidget *w, FolderBrowser *fb)
{
MessageList *ml = fb->message_list;
-
+
message_list_hide_add(ml, "(match-all (system-flag \"deleted\"))", ML_HIDE_SAME, ML_HIDE_SAME);
}
@@ -1575,7 +1503,7 @@ void
hide_read(GtkWidget *w, FolderBrowser *fb)
{
MessageList *ml = fb->message_list;
-
+
message_list_hide_add(ml, "(match-all (system-flag \"seen\"))", ML_HIDE_SAME, ML_HIDE_SAME);
}
@@ -1612,17 +1540,17 @@ hide_subject(GtkWidget *w, FolderBrowser *fb)
{
const char *subject;
GString *expr;
-
+
if (fb->mail_display->current_message) {
subject = camel_mime_message_get_subject(fb->mail_display->current_message);
if (subject) {
subject = strip_re(subject);
if (subject && subject[0]) {
- expr = g_string_new ("(match-all (header-contains \"subject\" ");
- e_sexp_encode_string (expr, subject);
- g_string_append (expr, "))");
- message_list_hide_add (fb->message_list, expr->str, ML_HIDE_SAME, ML_HIDE_SAME);
- g_string_free (expr, TRUE);
+ expr = g_string_new("(match-all (header-contains \"subject\" ");
+ e_sexp_encode_string(expr, subject);
+ g_string_append(expr, "))");
+ message_list_hide_add(fb->message_list, expr->str, ML_HIDE_SAME, ML_HIDE_SAME);
+ g_string_free(expr, TRUE);
return;
}
}
@@ -1630,25 +1558,70 @@ hide_subject(GtkWidget *w, FolderBrowser *fb)
}
void
-hide_sender (GtkWidget *w, FolderBrowser *fb)
+hide_sender(GtkWidget *w, FolderBrowser *fb)
{
const CamelInternetAddress *from;
const char *real, *addr;
GString *expr;
-
+
if (fb->mail_display->current_message) {
- from = camel_mime_message_get_from (fb->mail_display->current_message);
- if (camel_internet_address_get (from, 0, &real, &addr)) {
- expr = g_string_new ("(match-all (header-contains \"from\" ");
- e_sexp_encode_string (expr, addr);
- g_string_append (expr, "))");
- message_list_hide_add (fb->message_list, expr->str, ML_HIDE_SAME, ML_HIDE_SAME);
- g_string_free (expr, TRUE);
+ from = camel_mime_message_get_from(fb->mail_display->current_message);
+ if (camel_internet_address_get(from, 0, &real, &addr)) {
+ expr = g_string_new("(match-all (header-contains \"from\" ");
+ e_sexp_encode_string(expr, addr);
+ g_string_append(expr, "))");
+ message_list_hide_add(fb->message_list, expr->str, ML_HIDE_SAME, ML_HIDE_SAME);
+ g_string_free(expr, TRUE);
return;
}
}
}
+#if 0
+struct _colour_data {
+ FolderBrowser *fb;
+ guint32 rgb;
+};
+
+#define COLOUR_NONE (~0)
+
+static void
+colourise_msg (GtkWidget *widget, gpointer user_data)
+{
+ struct _colour_data *data = user_data;
+ char *colour = NULL;
+ GPtrArray *uids;
+ int i;
+
+ if (data->rgb != COLOUR_NONE) {
+ colour = alloca (8);
+ sprintf (colour, "#%.2x%.2x%.2x", (data->rgb & 0xff0000) >> 16,
+ (data->rgb & 0xff00) >> 8, data->rgb & 0xff);
+ }
+
+ uids = g_ptr_array_new ();
+ message_list_foreach (data->fb->message_list, enumerate_msg, uids);
+ for (i = 0; i < uids->len; i++) {
+ camel_folder_set_message_user_tag (data->fb->folder, uids->pdata[i], "colour", colour);
+ }
+ g_ptr_array_free (uids, TRUE);
+}
+
+static void
+colour_closures_free (GPtrArray *closures)
+{
+ struct _colour_data *data;
+ int i;
+
+ for (i = 0; i < closures->len; i++) {
+ data = closures->pdata[i];
+ gtk_object_unref (GTK_OBJECT (data->fb));
+ g_free (data);
+ }
+ g_ptr_array_free (closures, TRUE);
+}
+#endif
+
struct _label_data {
FolderBrowser *fb;
const char *label;
@@ -1660,7 +1633,7 @@ set_msg_label (GtkWidget *widget, gpointer user_data)
struct _label_data *data = user_data;
GPtrArray *uids;
int i;
-
+
uids = g_ptr_array_new ();
message_list_foreach (data->fb->message_list, enumerate_msg, uids);
for (i = 0; i < uids->len; i++)
@@ -1676,7 +1649,7 @@ label_closures_free (GPtrArray *closures)
for (i = 0; i < closures->len; i++) {
data = closures->pdata[i];
- g_object_unref (data->fb);
+ gtk_object_unref (GTK_OBJECT (data->fb));
g_free (data);
}
g_ptr_array_free (closures, TRUE);
@@ -1726,67 +1699,67 @@ enum {
#define MLIST_FILTER (8)
static EPopupMenu filter_menu[] = {
- E_POPUP_ITEM_CC (N_("VFolder on _Subject"), G_CALLBACK (vfolder_subject_uid), NULL, SELECTION_SET),
- E_POPUP_ITEM_CC (N_("VFolder on Se_nder"), G_CALLBACK (vfolder_sender_uid), NULL, SELECTION_SET),
- E_POPUP_ITEM_CC (N_("VFolder on _Recipients"), G_CALLBACK (vfolder_recipient_uid), NULL, SELECTION_SET),
- E_POPUP_ITEM_CC (N_("VFolder on Mailing _List"), G_CALLBACK (vfolder_mlist_uid), NULL, SELECTION_SET | IS_MAILING_LIST),
+ E_POPUP_ITEM_CC (N_("VFolder on _Subject"), GTK_SIGNAL_FUNC (vfolder_subject_uid), NULL, SELECTION_SET),
+ E_POPUP_ITEM_CC (N_("VFolder on Se_nder"), GTK_SIGNAL_FUNC (vfolder_sender_uid), NULL, SELECTION_SET),
+ E_POPUP_ITEM_CC (N_("VFolder on _Recipients"), GTK_SIGNAL_FUNC (vfolder_recipient_uid), NULL, SELECTION_SET),
+ E_POPUP_ITEM_CC (N_("VFolder on Mailing _List"), GTK_SIGNAL_FUNC (vfolder_mlist_uid), NULL, SELECTION_SET | IS_MAILING_LIST),
E_POPUP_SEPARATOR,
- E_POPUP_ITEM_CC (N_("Filter on Sub_ject"), G_CALLBACK (filter_subject_uid), NULL, SELECTION_SET),
- E_POPUP_ITEM_CC (N_("Filter on Sen_der"), G_CALLBACK (filter_sender_uid), NULL, SELECTION_SET),
- E_POPUP_ITEM_CC (N_("Filter on Re_cipients"), G_CALLBACK (filter_recipient_uid), NULL, SELECTION_SET),
- E_POPUP_ITEM_CC (N_("Filter on _Mailing List"), G_CALLBACK (filter_mlist_uid), NULL, SELECTION_SET | IS_MAILING_LIST),
+ E_POPUP_ITEM_CC (N_("Filter on Sub_ject"), GTK_SIGNAL_FUNC (filter_subject_uid), NULL, SELECTION_SET),
+ E_POPUP_ITEM_CC (N_("Filter on Sen_der"), GTK_SIGNAL_FUNC (filter_sender_uid), NULL, SELECTION_SET),
+ E_POPUP_ITEM_CC (N_("Filter on Re_cipients"), GTK_SIGNAL_FUNC (filter_recipient_uid), NULL, SELECTION_SET),
+ E_POPUP_ITEM_CC (N_("Filter on _Mailing List"), GTK_SIGNAL_FUNC (filter_mlist_uid), NULL, SELECTION_SET | IS_MAILING_LIST),
E_POPUP_TERMINATOR
};
static EPopupMenu label_menu[] = {
- E_POPUP_PIXMAP_WIDGET_ITEM_CC (N_("None"), NULL, G_CALLBACK (set_msg_label), NULL, 0),
+ E_POPUP_PIXMAP_WIDGET_ITEM_CC (N_("None"), NULL, GTK_SIGNAL_FUNC (set_msg_label), NULL, 0),
E_POPUP_SEPARATOR,
- E_POPUP_PIXMAP_WIDGET_ITEM_CC (NULL, NULL, G_CALLBACK (set_msg_label), NULL, 0),
- E_POPUP_PIXMAP_WIDGET_ITEM_CC (NULL, NULL, G_CALLBACK (set_msg_label), NULL, 0),
- E_POPUP_PIXMAP_WIDGET_ITEM_CC (NULL, NULL, G_CALLBACK (set_msg_label), NULL, 0),
- E_POPUP_PIXMAP_WIDGET_ITEM_CC (NULL, NULL, G_CALLBACK (set_msg_label), NULL, 0),
- E_POPUP_PIXMAP_WIDGET_ITEM_CC (NULL, NULL, G_CALLBACK (set_msg_label), NULL, 0),
+ E_POPUP_PIXMAP_WIDGET_ITEM_CC (NULL, NULL, GTK_SIGNAL_FUNC (set_msg_label), NULL, 0),
+ E_POPUP_PIXMAP_WIDGET_ITEM_CC (NULL, NULL, GTK_SIGNAL_FUNC (set_msg_label), NULL, 0),
+ E_POPUP_PIXMAP_WIDGET_ITEM_CC (NULL, NULL, GTK_SIGNAL_FUNC (set_msg_label), NULL, 0),
+ E_POPUP_PIXMAP_WIDGET_ITEM_CC (NULL, NULL, GTK_SIGNAL_FUNC (set_msg_label), NULL, 0),
+ E_POPUP_PIXMAP_WIDGET_ITEM_CC (NULL, NULL, GTK_SIGNAL_FUNC (set_msg_label), NULL, 0),
E_POPUP_TERMINATOR
};
static EPopupMenu context_menu[] = {
- E_POPUP_ITEM (N_("_Open"), G_CALLBACK (open_msg), 0),
- E_POPUP_ITEM (N_("_Edit as New Message..."), G_CALLBACK (resend_msg), CAN_RESEND),
- E_POPUP_ITEM (N_("_Save As..."), G_CALLBACK (save_msg), 0),
- E_POPUP_ITEM (N_("_Print"), G_CALLBACK (print_msg), 0),
+ E_POPUP_ITEM (N_("_Open"), GTK_SIGNAL_FUNC (open_msg), 0),
+ E_POPUP_ITEM (N_("_Edit as New Message..."), GTK_SIGNAL_FUNC (resend_msg), CAN_RESEND),
+ E_POPUP_ITEM (N_("_Save As..."), GTK_SIGNAL_FUNC (save_msg), 0),
+ E_POPUP_ITEM (N_("_Print"), GTK_SIGNAL_FUNC (print_msg), 0),
E_POPUP_SEPARATOR,
- E_POPUP_ITEM (N_("_Reply to Sender"), G_CALLBACK (reply_to_sender), 0),
- E_POPUP_ITEM (N_("Reply to _List"), G_CALLBACK (reply_to_list), 0),
- E_POPUP_ITEM (N_("Reply to _All"), G_CALLBACK (reply_to_all), 0),
- E_POPUP_ITEM (N_("_Forward"), G_CALLBACK (forward), 0),
+ E_POPUP_ITEM (N_("_Reply to Sender"), GTK_SIGNAL_FUNC (reply_to_sender), 0),
+ E_POPUP_ITEM (N_("Reply to _List"), GTK_SIGNAL_FUNC (reply_to_list), 0),
+ E_POPUP_ITEM (N_("Reply to _All"), GTK_SIGNAL_FUNC (reply_to_all), 0),
+ E_POPUP_ITEM (N_("_Forward"), GTK_SIGNAL_FUNC (forward), 0),
E_POPUP_SEPARATOR,
- E_POPUP_ITEM (N_("Follo_w Up..."), G_CALLBACK (flag_for_followup), CAN_FLAG_FOR_FOLLOWUP),
- E_POPUP_ITEM (N_("Fla_g Completed"), G_CALLBACK (flag_followup_completed), CAN_FLAG_COMPLETED),
- E_POPUP_ITEM (N_("Cl_ear Flag"), G_CALLBACK (flag_followup_clear), CAN_CLEAR_FLAG),
+ E_POPUP_ITEM (N_("Follo_w Up..."), GTK_SIGNAL_FUNC (flag_for_followup), CAN_FLAG_FOR_FOLLOWUP),
+ E_POPUP_ITEM (N_("Fla_g Completed"), GTK_SIGNAL_FUNC (flag_followup_completed), CAN_FLAG_COMPLETED),
+ E_POPUP_ITEM (N_("Cl_ear Flag"), GTK_SIGNAL_FUNC (flag_followup_clear), CAN_CLEAR_FLAG),
/* separator here? */
- E_POPUP_ITEM (N_("Mar_k as Read"), G_CALLBACK (mark_as_seen_cb), CAN_MARK_READ),
- E_POPUP_ITEM (N_("Mark as _Unread"), G_CALLBACK (mark_as_unseen_cb), CAN_MARK_UNREAD),
- E_POPUP_ITEM (N_("Mark as _Important"), G_CALLBACK (mark_as_important_cb), CAN_MARK_IMPORTANT),
- E_POPUP_ITEM (N_("_Mark as Unimportant"), G_CALLBACK (mark_as_unimportant_cb), CAN_MARK_UNIMPORTANT),
+ E_POPUP_ITEM (N_("Mar_k as Read"), GTK_SIGNAL_FUNC (mark_as_seen_cb), CAN_MARK_READ),
+ E_POPUP_ITEM (N_("Mark as _Unread"), GTK_SIGNAL_FUNC (mark_as_unseen_cb), CAN_MARK_UNREAD),
+ E_POPUP_ITEM (N_("Mark as _Important"), GTK_SIGNAL_FUNC (mark_as_important_cb), CAN_MARK_IMPORTANT),
+ E_POPUP_ITEM (N_("_Mark as Unimportant"), GTK_SIGNAL_FUNC (mark_as_unimportant_cb), CAN_MARK_UNIMPORTANT),
E_POPUP_SEPARATOR,
- E_POPUP_ITEM (N_("_Delete"), G_CALLBACK (delete_msg), CAN_DELETE),
- E_POPUP_ITEM (N_("U_ndelete"), G_CALLBACK (undelete_msg), CAN_UNDELETE),
+ E_POPUP_ITEM (N_("_Delete"), GTK_SIGNAL_FUNC (delete_msg), CAN_DELETE),
+ E_POPUP_ITEM (N_("U_ndelete"), GTK_SIGNAL_FUNC (undelete_msg), CAN_UNDELETE),
E_POPUP_SEPARATOR,
- E_POPUP_ITEM (N_("Mo_ve to Folder..."), G_CALLBACK (move_msg_cb), 0),
- E_POPUP_ITEM (N_("_Copy to Folder..."), G_CALLBACK (copy_msg_cb), 0),
+ E_POPUP_ITEM (N_("Mo_ve to Folder..."), GTK_SIGNAL_FUNC (move_msg_cb), 0),
+ E_POPUP_ITEM (N_("_Copy to Folder..."), GTK_SIGNAL_FUNC (copy_msg_cb), 0),
E_POPUP_SEPARATOR,
@@ -1794,11 +1767,11 @@ static EPopupMenu context_menu[] = {
E_POPUP_SEPARATOR,
- E_POPUP_ITEM (N_("Add Sender to Address_book"), G_CALLBACK (addrbook_sender), SELECTION_SET | CAN_ADD_SENDER),
+ E_POPUP_ITEM (N_("Add Sender to Address_book"), GTK_SIGNAL_FUNC (addrbook_sender), SELECTION_SET | CAN_ADD_SENDER),
E_POPUP_SEPARATOR,
- E_POPUP_ITEM (N_("Appl_y Filters"), G_CALLBACK (apply_filters), 0),
+ E_POPUP_ITEM (N_("Appl_y Filters"), GTK_SIGNAL_FUNC (apply_filters), 0),
E_POPUP_SEPARATOR,
@@ -1849,7 +1822,7 @@ struct cmpf_data {
static void
context_menu_position_func (GtkMenu *menu, gint *x, gint *y,
- gboolean *push_in, gpointer user_data)
+ gpointer user_data)
{
int tx, ty, tw, th;
struct cmpf_data *closure = user_data;
@@ -1871,7 +1844,7 @@ setup_popup_icons (void)
char *filename;
filename = g_strdup_printf ("%s/%s", EVOLUTION_IMAGES, context_pixmaps[i]);
- context_menu[i].pixmap_widget = gtk_image_new_from_file (filename);
+ context_menu[i].pixmap_widget = gnome_pixmap_new_from_file (filename);
g_free (filename);
}
}
@@ -1881,15 +1854,14 @@ setup_popup_icons (void)
static int
on_right_click (ETree *tree, gint row, ETreePath path, gint col, GdkEvent *event, FolderBrowser *fb)
{
- struct _filter_data *fdata = NULL;
- GPtrArray *uids, *closures;
CamelMessageInfo *info;
- GSList *labels;
+ GPtrArray *uids, *closures;
int enable_mask = 0;
int hide_mask = 0;
+ int i;
char *mlist = NULL;
GtkMenu *menu;
- int i;
+ struct _filter_data *fdata = NULL;
if (!folder_browser_is_sent (fb)) {
enable_mask |= CAN_RESEND;
@@ -1954,7 +1926,7 @@ on_right_click (ETree *tree, gint row, ETreePath path, gint col, GdkEvent *event
fdata->mlist = g_strdup(mname);
/* Escape the mailing list name before showing it */
- mlist = g_alloca ((strlen (mname) * 2) + 1);
+ mlist = alloca ((strlen (mname) * 2) + 1);
p = mname;
o = mlist;
while ((c = *p++)) {
@@ -2071,44 +2043,43 @@ on_right_click (ETree *tree, gint row, ETreePath path, gint col, GdkEvent *event
closures = g_ptr_array_new ();
label_menu[0].closure = g_new (struct _label_data, 1);
g_ptr_array_add (closures, label_menu[0].closure);
- g_object_ref (fb);
+ gtk_object_ref (GTK_OBJECT (fb));
((struct _label_data *) label_menu[0].closure)->fb = fb;
((struct _label_data *) label_menu[0].closure)->label = NULL;
- i = 0;
- labels = mail_config_get_labels ();
- while (labels != NULL && i < 5) {
+ for (i = 0; i < filter_label_count(); i++) {
struct _label_data *closure;
- MailConfigLabel *label;
GdkPixmap *pixmap;
GdkColormap *map;
- GdkColor colour;
+ GdkColor color;
+ guint32 rgb;
GdkGC *gc;
- label = labels->data;
- gdk_color_parse (label->colour, &colour);
+ rgb = mail_config_get_label_color (i);
+
+ color.red = ((rgb & 0xff0000) >> 8) | 0xff;
+ color.green = (rgb & 0xff00) | 0xff;
+ color.blue = ((rgb & 0xff) << 8) | 0xff;
+
map = gdk_colormap_get_system ();
- gdk_color_alloc (map, &colour);
+ gdk_color_alloc (map, &color);
pixmap = gdk_pixmap_new (GTK_WIDGET (fb)->window, 16, 16, -1);
gc = gdk_gc_new (GTK_WIDGET (fb)->window);
- gdk_gc_set_foreground (gc, &colour);
+ gdk_gc_set_foreground (gc, &color);
gdk_draw_rectangle (pixmap, gc, TRUE, 0, 0, 16, 16);
gdk_gc_unref (gc);
closure = g_new (struct _label_data, 1);
- g_object_ref (fb);
+ gtk_object_ref (GTK_OBJECT (fb));
closure->fb = fb;
- closure->label = label->name;
+ closure->label = filter_label_label(i);
g_ptr_array_add (closures, closure);
- label_menu[i + 2].name = label->name;
- label_menu[i + 2].pixmap_widget = gtk_image_new_from_pixmap (pixmap, NULL);
+ label_menu[i + 2].name = e_utf8_to_locale_string (mail_config_get_label_name (i));
+ label_menu[i + 2].pixmap_widget = gtk_pixmap_new (pixmap, NULL);
label_menu[i + 2].closure = closure;
-
- i++;
- labels = labels->next;
}
setup_popup_icons ();
@@ -2117,12 +2088,14 @@ on_right_click (ETree *tree, gint row, ETreePath path, gint col, GdkEvent *event
filter_menu[i].closure = fdata;
menu = e_popup_menu_create (context_menu, enable_mask, hide_mask, fb);
- e_auto_kill_popup_menu_on_selection_done (menu);
+ e_auto_kill_popup_menu_on_hide (menu);
- g_object_set_data_full ((GObject *) menu, "label_closures", closures, (GtkDestroyNotify) label_closures_free);
+ gtk_object_set_data_full (GTK_OBJECT (menu), "label_closures",
+ closures, (GtkDestroyNotify) label_closures_free);
if (fdata)
- g_object_set_data_full ((GObject *) menu, "filter_data", fdata, (GtkDestroyNotify) filter_data_free);
+ gtk_object_set_data_full (GTK_OBJECT (menu), "filter_data",
+ fdata, (GtkDestroyNotify) filter_data_free);
if (event->type == GDK_KEY_PRESS) {
struct cmpf_data closure;
@@ -2140,6 +2113,11 @@ on_right_click (ETree *tree, gint row, ETreePath path, gint col, GdkEvent *event
g_free (filter_menu[MLIST_FILTER].name);
g_free (filter_menu[MLIST_VFOLDER].name);
+ /* free the label/colour menu */
+ for (i = 0; i < 5; i++) {
+ g_free (label_menu[i + 2].name);
+ }
+
return TRUE;
}
@@ -2222,13 +2200,13 @@ etree_key (ETree *tree, int row, ETreePath path, int col, GdkEvent *ev, FolderBr
{
GtkAdjustment *vadj;
gfloat page_size;
-
+
if ((ev->key.state & GDK_CONTROL_MASK) != 0)
return FALSE;
-
- vadj = gtk_scrolled_window_get_vadjustment (fb->mail_display->scroll);
+
+ vadj = e_scroll_frame_get_vadjustment (fb->mail_display->scroll);
page_size = vadj->page_size - vadj->step_increment;
-
+
switch (ev->key.keyval) {
case GDK_space:
/* Work around Ximian 4939 */
@@ -2255,7 +2233,7 @@ etree_key (ETree *tree, int row, ETreePath path, int col, GdkEvent *ev, FolderBr
default:
return on_key_press ((GtkWidget *)tree, (GdkEventKey *)ev, fb);
}
-
+
return TRUE;
}
@@ -2276,13 +2254,13 @@ on_selection_changed (GtkObject *obj, gpointer user_data)
{
FolderBrowser *fb = FOLDER_BROWSER (user_data);
FolderBrowserSelectionState state;
-
+
/* we can get this signal at strange times...
* if no uicomp, don't even bother */
-
+
if (fb->uicomp == NULL)
return;
-
+
switch (e_selection_model_selected_count (E_SELECTION_MODEL (obj))) {
case 0:
state = FB_SELSTATE_NONE;
@@ -2294,40 +2272,24 @@ on_selection_changed (GtkObject *obj, gpointer user_data)
state = FB_SELSTATE_MULTIPLE;
break;
}
-
+
folder_browser_ui_set_selection_state (fb, state);
-
- update_status_bar_idle (fb);
+
+ update_status_bar_idle(fb);
}
static void
-on_cursor_activated (ETree *tree, int row, ETreePath path, gpointer user_data)
-{
- on_selection_changed ((GtkObject *)tree, user_data);
-}
-
-static gboolean
-fb_resize_cb (GtkWidget *w, GdkEventButton *e, FolderBrowser *fb)
+on_cursor_activated(ETree *tree, int row, ETreePath path, gpointer user_data)
{
- GConfClient *gconf;
-
- gconf = gconf_client_get_default ();
-
- if (GTK_WIDGET_REALIZED (w) && fb->preview_shown)
- gconf_client_set_int (gconf, "/apps/evolution/mail/display/paned_size", gtk_paned_get_position (GTK_PANED (w)), NULL);
-
- return FALSE;
+ on_selection_changed((GtkObject *)tree, user_data);
}
-/* hack to get around the fact setting the paned size doesn't work */
static void
-paned_realised(GtkWidget *w, FolderBrowser *fb)
-{
- int size;
-
- size = gconf_client_get_int (gconf_client_get_default (), "/apps/evolution/mail/display/paned_size", NULL);
- gtk_paned_set_position (GTK_PANED (fb->vpaned), size);
+fb_resize_cb (GtkWidget *w, GtkAllocation *a, FolderBrowser *fb)
+{
+ if (GTK_WIDGET_REALIZED (w) && fb->preview_shown)
+ mail_config_set_paned_size (a->height);
}
static void
@@ -2335,10 +2297,9 @@ folder_browser_gui_init (FolderBrowser *fb)
{
extern RuleContext *search_context;
ESelectionModel *esm;
-
+
/* The panned container */
- fb->vpaned = gtk_vpaned_new ();
- g_signal_connect(fb->vpaned, "realize", G_CALLBACK(paned_realised), fb);
+ fb->vpaned = e_vpaned_new ();
gtk_widget_show (fb->vpaned);
gtk_table_attach (GTK_TABLE (fb), fb->vpaned,
@@ -2349,8 +2310,8 @@ folder_browser_gui_init (FolderBrowser *fb)
/* quick-search bar */
if (search_context) {
- const char *systemrules = g_object_get_data (G_OBJECT (search_context), "system");
- const char *userrules = g_object_get_data (G_OBJECT (search_context), "user");
+ const char *systemrules = gtk_object_get_data (GTK_OBJECT (search_context), "system");
+ const char *userrules = gtk_object_get_data (GTK_OBJECT (search_context), "user");
fb->search = e_filter_bar_new (search_context, systemrules, userrules,
folder_browser_config_search, fb);
@@ -2359,31 +2320,33 @@ folder_browser_gui_init (FolderBrowser *fb)
gtk_widget_show (GTK_WIDGET (fb->search));
- g_signal_connect (fb->search, "menu_activated",
- G_CALLBACK (folder_browser_search_menu_activated), fb);
- g_signal_connect (fb->search, "search_activated",
- G_CALLBACK (folder_browser_search_do_search), fb);
- g_signal_connect (fb->search, "query_changed",
- G_CALLBACK (folder_browser_query_changed), fb);
+ gtk_signal_connect (GTK_OBJECT (fb->search), "menu_activated",
+ GTK_SIGNAL_FUNC (folder_browser_search_menu_activated), fb);
+ gtk_signal_connect (GTK_OBJECT (fb->search), "search_activated",
+ GTK_SIGNAL_FUNC (folder_browser_search_do_search), fb);
+ gtk_signal_connect (GTK_OBJECT (fb->search), "query_changed",
+ GTK_SIGNAL_FUNC (folder_browser_query_changed), fb);
+
gtk_table_attach (GTK_TABLE (fb), GTK_WIDGET (fb->search),
0, 1, 0, 1,
GTK_FILL | GTK_EXPAND,
0,
0, 0);
-
+
esm = e_tree_get_selection_model (E_TREE (fb->message_list->tree));
- g_signal_connect (esm, "selection_changed", G_CALLBACK (on_selection_changed), fb);
- g_signal_connect (esm, "cursor_activated", G_CALLBACK (on_cursor_activated), fb);
+ gtk_signal_connect (GTK_OBJECT (esm), "selection_changed", on_selection_changed, fb);
+ gtk_signal_connect (GTK_OBJECT (esm), "cursor_activated", on_cursor_activated, fb);
fb->selection_state = FB_SELSTATE_NONE; /* default to none */
- gtk_paned_add1 (GTK_PANED (fb->vpaned), GTK_WIDGET (fb->message_list));
+ e_paned_add1 (E_PANED (fb->vpaned), GTK_WIDGET (fb->message_list));
gtk_widget_show (GTK_WIDGET (fb->message_list));
- fb->paned_resize_id = g_signal_connect (fb->vpaned, "button_release_event",
- G_CALLBACK (fb_resize_cb), fb);
-
- gtk_paned_add2 (GTK_PANED (fb->vpaned), GTK_WIDGET (fb->mail_display));
+ gtk_signal_connect (GTK_OBJECT (fb->message_list), "size_allocate",
+ GTK_SIGNAL_FUNC (fb_resize_cb), fb);
+
+ e_paned_add2 (E_PANED (fb->vpaned), GTK_WIDGET (fb->mail_display));
+ e_paned_set_position (E_PANED (fb->vpaned), mail_config_get_paned_size ());
gtk_widget_show (GTK_WIDGET (fb->mail_display));
gtk_widget_show (GTK_WIDGET (fb));
}
@@ -2395,8 +2358,7 @@ do_mark_seen (gpointer data)
FolderBrowser *fb = FOLDER_BROWSER (data);
if (fb->new_uid && fb->loaded_uid && !strcmp (fb->new_uid, fb->loaded_uid)) {
- camel_folder_set_message_flags (fb->folder, fb->new_uid,
- CAMEL_MESSAGE_SEEN, CAMEL_MESSAGE_SEEN);
+ camel_folder_set_message_flags (fb->folder, fb->new_uid, CAMEL_MESSAGE_SEEN, CAMEL_MESSAGE_SEEN);
}
return FALSE;
@@ -2410,24 +2372,18 @@ done_message_selected (CamelFolder *folder, const char *uid, CamelMimeMessage *m
{
FolderBrowser *fb = data;
CamelMessageInfo *info;
- GConfClient *gconf;
- int timeout;
-
- gconf = gconf_client_get_default ();
+ int timeout = mail_config_get_mark_as_seen_timeout ();
if (folder != fb->folder || fb->mail_display == NULL)
return;
- gconf = gconf_client_get_default ();
- timeout = gconf_client_get_int (gconf, "/apps/evolution/mail/display/mark_seen_timeout", NULL);
-
info = camel_folder_get_message_info (fb->folder, uid);
mail_display_set_message (fb->mail_display, (CamelMedium *) msg, fb->folder, info);
if (info)
camel_folder_free_message_info (fb->folder, info);
/* FIXME: should this signal be emitted here?? */
- g_signal_emit (fb, folder_browser_signals[MESSAGE_LOADED], 0, uid);
+ gtk_signal_emit (GTK_OBJECT (fb), folder_browser_signals [MESSAGE_LOADED], uid);
/* pain, if we have pending stuff, re-run */
if (fb->pending_uid) {
@@ -2449,7 +2405,7 @@ done_message_selected (CamelFolder *folder, const char *uid, CamelMimeMessage *m
if (fb->seen_id)
gtk_timeout_remove (fb->seen_id);
- if (msg && gconf_client_get_bool (gconf, "/apps/evolution/mail/display/mark_seen", NULL)) {
+ if (mail_config_get_do_seen_timeout () && msg) {
if (timeout > 0)
fb->seen_id = gtk_timeout_add (timeout, do_mark_seen, fb);
else
@@ -2502,7 +2458,7 @@ on_message_list_focus_in (GtkWidget *widget, GdkEventFocus *event, gpointer user
{
FolderBrowser *fb = (FolderBrowser *) user_data;
- d(printf ("got focus!\n"));
+ printf ("got focus!\n");
folder_browser_ui_message_list_focus (fb);
return FALSE;
@@ -2513,22 +2469,25 @@ on_message_list_focus_out (GtkWidget *widget, GdkEventFocus *event, gpointer use
{
FolderBrowser *fb = (FolderBrowser *) user_data;
- d(printf ("got unfocus!\n"));
+ printf ("got unfocus!\n");
folder_browser_ui_message_list_unfocus (fb);
return FALSE;
}
static void
-folder_browser_init (FolderBrowser *fb)
+folder_browser_init (GtkObject *object)
{
- fb->async_event = mail_async_event_new ();
+ FolderBrowser *fb = (FolderBrowser *)object;
+
+ fb->async_event = mail_async_event_new();
fb->get_id = -1;
}
static void
-my_folder_browser_init (FolderBrowser *fb)
+my_folder_browser_init (GtkObject *object)
{
+ FolderBrowser *fb = FOLDER_BROWSER (object);
int i;
fb->view_instance = NULL;
@@ -2550,58 +2509,62 @@ my_folder_browser_init (FolderBrowser *fb)
fb->preview_shown = TRUE;
- g_signal_connect (fb->mail_display->html, "key_press_event",
- G_CALLBACK (on_key_press), fb);
- g_signal_connect (fb->mail_display->html, "button_press_event",
- G_CALLBACK (html_button_press_event), fb);
+ gtk_signal_connect (GTK_OBJECT (fb->mail_display->html),
+ "key_press_event", GTK_SIGNAL_FUNC (on_key_press), fb);
+ gtk_signal_connect (GTK_OBJECT (fb->mail_display->html),
+ "button_press_event", GTK_SIGNAL_FUNC (html_button_press_event), fb);
- g_signal_connect (fb->message_list->tree, "key_press",
- G_CALLBACK (etree_key), fb);
+ gtk_signal_connect (GTK_OBJECT (fb->message_list->tree),
+ "key_press", GTK_SIGNAL_FUNC (etree_key), fb);
- g_signal_connect (fb->message_list->tree, "right_click",
- G_CALLBACK (on_right_click), fb);
+ gtk_signal_connect (GTK_OBJECT (fb->message_list->tree),
+ "right_click", GTK_SIGNAL_FUNC (on_right_click), fb);
- g_signal_connect (fb->message_list->tree, "double_click",
- G_CALLBACK (on_double_click), fb);
+ gtk_signal_connect (GTK_OBJECT (fb->message_list->tree),
+ "double_click", GTK_SIGNAL_FUNC (on_double_click), fb);
- g_signal_connect (fb->message_list, "focus_in_event",
- G_CALLBACK (on_message_list_focus_in), fb);
+ gtk_signal_connect (GTK_OBJECT (fb->message_list), "focus_in_event",
+ GTK_SIGNAL_FUNC (on_message_list_focus_in), fb);
- g_signal_connect (fb->message_list, "focus_out_event",
- G_CALLBACK (on_message_list_focus_out), fb);
+ gtk_signal_connect (GTK_OBJECT (fb->message_list), "focus_out_event",
+ GTK_SIGNAL_FUNC (on_message_list_focus_out), fb);
- g_signal_connect (fb->message_list, "message_selected",
- G_CALLBACK (on_message_selected), fb);
+ gtk_signal_connect (GTK_OBJECT (fb->message_list), "message_selected",
+ on_message_selected, fb);
/* drag & drop */
e_tree_drag_source_set (fb->message_list->tree, GDK_BUTTON1_MASK,
drag_types, num_drag_types, GDK_ACTION_MOVE | GDK_ACTION_COPY);
- g_signal_connect (fb->message_list->tree, "tree_drag_data_get",
- G_CALLBACK (message_list_drag_data_get), fb);
+ gtk_signal_connect (GTK_OBJECT (fb->message_list->tree), "tree_drag_data_get",
+ GTK_SIGNAL_FUNC (message_list_drag_data_get), fb);
e_tree_drag_dest_set (fb->message_list->tree, GTK_DEST_DEFAULT_ALL,
drag_types, num_drag_types, GDK_ACTION_MOVE | GDK_ACTION_COPY);
- g_signal_connect (fb->message_list->tree, "tree_drag_data_received",
- G_CALLBACK (message_list_drag_data_received), fb);
+ gtk_signal_connect (GTK_OBJECT (fb->message_list->tree), "tree_drag_data_received",
+ GTK_SIGNAL_FUNC (message_list_drag_data_received), fb);
/* cut, copy & paste */
fb->invisible = gtk_invisible_new ();
- g_object_ref (fb->invisible);
- gtk_object_sink ((GtkObject *) fb->invisible);
for (i = 0; i < num_paste_types; i++)
gtk_selection_add_target (fb->invisible, clipboard_atom,
paste_types[i].target,
paste_types[i].info);
- g_signal_connect (fb->invisible, "selection_get",
- G_CALLBACK (selection_get), fb);
- g_signal_connect (fb->invisible, "selection_clear_event",
- G_CALLBACK (selection_clear_event), fb);
- g_signal_connect (fb->invisible, "selection_received",
- G_CALLBACK (selection_received), fb);
+ gtk_signal_connect (GTK_OBJECT (fb->invisible),
+ "selection_get",
+ GTK_SIGNAL_FUNC (selection_get),
+ (gpointer) fb);
+ gtk_signal_connect (GTK_OBJECT (fb->invisible),
+ "selection_clear_event",
+ GTK_SIGNAL_FUNC (selection_clear_event),
+ (gpointer) fb);
+ gtk_signal_connect (GTK_OBJECT (fb->invisible),
+ "selection_received",
+ GTK_SIGNAL_FUNC (selection_received),
+ (gpointer) fb);
folder_browser_gui_init (fb);
}
@@ -2613,11 +2576,11 @@ folder_browser_new (const GNOME_Evolution_Shell shell, const char *uri)
FolderBrowser *folder_browser;
CORBA_exception_init (&ev);
-
- folder_browser = g_object_new (folder_browser_get_type (), NULL);
-
- my_folder_browser_init (folder_browser);
-
+
+ folder_browser = gtk_type_new (folder_browser_get_type ());
+
+ my_folder_browser_init (GTK_OBJECT (folder_browser));
+
folder_browser->shell = CORBA_Object_duplicate (shell, &ev);
if (ev._major != CORBA_NO_EXCEPTION) {
folder_browser->shell = CORBA_OBJECT_NIL;
@@ -2625,13 +2588,12 @@ folder_browser_new (const GNOME_Evolution_Shell shell, const char *uri)
CORBA_exception_free (&ev);
return NULL;
}
-
+
CORBA_exception_free (&ev);
if (uri) {
folder_browser->uri = g_strdup (uri);
- folder_browser->meta = mail_tool_get_meta_data(uri);
- g_object_ref (folder_browser);
+ gtk_object_ref (GTK_OBJECT (folder_browser));
folder_browser->get_id = mail_get_folder (folder_browser->uri, 0, got_folder,
folder_browser, mail_thread_new);
}
diff --git a/mail/mail-account-gui.c b/mail/mail-account-gui.c
index 1542de946d..a823ed63d8 100644
--- a/mail/mail-account-gui.c
+++ b/mail/mail-account-gui.c
@@ -30,11 +30,8 @@
#include <string.h>
#include <stdarg.h>
-#include <gconf/gconf.h>
-#include <gconf/gconf-client.h>
-
-#include <e-util/e-account-list.h>
-#include <e-util/e-dialog-utils.h>
+#include <gal/widgets/e-unicode.h>
+#include <gal/widgets/e-gui-utils.h>
#include "evolution-folder-selector-button.h"
#include "mail-account-gui.h"
@@ -51,7 +48,7 @@
extern char *default_drafts_folder_uri, *default_sent_folder_uri;
extern EvolutionShellClient *global_shell_client;
-static void save_service (MailAccountGuiService *gsvc, GHashTable *extra_conf, EAccountService *service);
+static void save_service (MailAccountGuiService *gsvc, GHashTable *extra_conf, MailConfigService *service);
static void service_changed (GtkEntry *entry, gpointer user_data);
struct {
@@ -107,7 +104,7 @@ get_focused_widget (GtkWidget *def, ...)
gboolean
mail_account_gui_identity_complete (MailAccountGui *gui, GtkWidget **incomplete)
{
- const char *text;
+ char *text;
text = gtk_entry_get_text (gui->full_name);
if (!text || !*text) {
@@ -155,7 +152,7 @@ service_complete (MailAccountGuiService *service, GHashTable *extra_config, GtkW
{
const CamelProvider *prov = service->provider;
GtkWidget *path;
- const char *text;
+ char *text;
if (!prov)
return TRUE;
@@ -225,8 +222,7 @@ mail_account_gui_auto_detect_extra_conf (MailAccountGui *gui)
GtkWidget *path;
CamelURL *url;
char *text;
- const char *tmp;
-
+
if (!prov)
return;
@@ -263,9 +259,9 @@ mail_account_gui_auto_detect_extra_conf (MailAccountGui *gui)
}
if (path && CAMEL_PROVIDER_ALLOWS (prov, CAMEL_URL_PART_PATH)) {
- tmp = gtk_entry_get_text (service->path);
- if (tmp && *tmp)
- camel_url_set_path (url, tmp);
+ text = gtk_entry_get_text (service->path);
+ if (text && *text)
+ camel_url_set_path (url, text);
}
camel_provider_auto_detect (prov, url, &auto_detected, NULL);
@@ -332,12 +328,6 @@ mail_account_gui_auto_detect_extra_conf (MailAccountGui *gui)
gboolean
mail_account_gui_transport_complete (MailAccountGui *gui, GtkWidget **incomplete)
{
- if (!gui->transport.provider) {
- if (incomplete)
- *incomplete = GTK_WIDGET (gui->transport.type);
- return FALSE;
- }
-
/* If it's both source and transport, there's nothing extra to
* configure on the transport page.
*/
@@ -372,7 +362,7 @@ mail_account_gui_transport_complete (MailAccountGui *gui, GtkWidget **incomplete
gboolean
mail_account_gui_management_complete (MailAccountGui *gui, GtkWidget **incomplete)
{
- const char *text;
+ char *text;
text = gtk_entry_get_text (gui->account_name);
if (text && *text)
@@ -392,7 +382,7 @@ service_authtype_changed (GtkWidget *widget, gpointer user_data)
CamelServiceAuthType *authtype;
service->authitem = widget;
- authtype = g_object_get_data ((GObject *) widget, "authtype");
+ authtype = gtk_object_get_data (GTK_OBJECT (widget), "authtype");
gtk_widget_set_sensitive (GTK_WIDGET (service->remember), authtype->need_password);
}
@@ -407,7 +397,7 @@ build_auth_menu (MailAccountGuiService *service, GList *all_authtypes,
GList *l, *s;
if (service->authitem)
- current = g_object_get_data ((GObject *) service->authitem, "authtype");
+ current = gtk_object_get_data (GTK_OBJECT (service->authitem), "authtype");
else
current = NULL;
@@ -435,10 +425,11 @@ build_auth_menu (MailAccountGuiService *service, GList *all_authtypes,
history = i;
}
- g_object_set_data ((GObject *) item, "authtype", authtype);
- g_signal_connect (item, "activate", G_CALLBACK (service_authtype_changed), service);
+ gtk_object_set_data (GTK_OBJECT (item), "authtype", authtype);
+ gtk_signal_connect (GTK_OBJECT (item), "activate",
+ service_authtype_changed, service);
- gtk_menu_shell_append(GTK_MENU_SHELL(menu), item);
+ gtk_menu_append (GTK_MENU (menu), item);
gtk_widget_show (item);
}
@@ -448,7 +439,7 @@ build_auth_menu (MailAccountGuiService *service, GList *all_authtypes,
if (first) {
gtk_option_menu_set_history (service->authtype, history);
- g_signal_emit_by_name (first, "activate");
+ gtk_signal_emit_by_name (GTK_OBJECT (first), "activate");
}
}
@@ -457,17 +448,18 @@ transport_provider_set_available (MailAccountGui *gui, CamelProvider *provider,
gboolean available)
{
GtkWidget *menuitem;
-
- menuitem = g_object_get_data ((GObject *) gui->transport.type, provider->protocol);
+
+ menuitem = gtk_object_get_data (GTK_OBJECT (gui->transport.type),
+ provider->protocol);
g_return_if_fail (menuitem != NULL);
-
gtk_widget_set_sensitive (menuitem, available);
-
+
if (available) {
- gpointer number = g_object_get_data ((GObject *) menuitem, "number");
-
- g_signal_emit_by_name (menuitem, "activate");
- gtk_option_menu_set_history (gui->transport.type, GPOINTER_TO_UINT (number));
+ gpointer number = gtk_object_get_data (GTK_OBJECT (menuitem), "number");
+
+ gtk_signal_emit_by_name (GTK_OBJECT (menuitem), "activate");
+ gtk_option_menu_set_history (gui->transport.type,
+ GPOINTER_TO_UINT (number));
}
}
@@ -478,7 +470,7 @@ source_type_changed (GtkWidget *widget, gpointer user_data)
GtkWidget *file_entry, *label, *frame, *dwidget = NULL;
CamelProvider *provider;
- provider = g_object_get_data ((GObject *) widget, "provider");
+ provider = gtk_object_get_data (GTK_OBJECT (widget), "provider");
/* If the previously-selected provider has a linked transport,
* disable it.
@@ -564,7 +556,7 @@ source_type_changed (GtkWidget *widget, gpointer user_data)
gtk_widget_hide (frame);
}
- g_signal_emit_by_name (gui->source.username, "changed");
+ gtk_signal_emit_by_name (GTK_OBJECT (gui->source.username), "changed");
if (dwidget)
gtk_widget_grab_focus (dwidget);
@@ -596,7 +588,7 @@ transport_type_changed (GtkWidget *widget, gpointer user_data)
CamelProvider *provider;
GtkWidget *label, *frame;
- provider = g_object_get_data ((GObject *) widget, "provider");
+ provider = gtk_object_get_data (GTK_OBJECT (widget), "provider");
gui->transport.provider = provider;
/* description */
@@ -659,7 +651,7 @@ transport_type_changed (GtkWidget *widget, gpointer user_data)
} else
gtk_widget_hide (frame);
- g_signal_emit_by_name (gui->transport.hostname, "changed");
+ gtk_signal_emit_by_name (GTK_OBJECT (gui->transport.hostname), "changed");
}
static void
@@ -675,12 +667,12 @@ static void
service_check_supported (GtkButton *button, gpointer user_data)
{
MailAccountGuiService *gsvc = user_data;
- EAccountService *service;
+ MailConfigService *service;
GList *authtypes = NULL;
GtkWidget *authitem;
GtkWidget *window;
- service = g_new0 (EAccountService, 1);
+ service = g_new0 (MailConfigService, 1);
/* This is sort of a hack, when checking for supported AUTH
types we don't want to use whatever authtype is selected
@@ -703,8 +695,7 @@ service_check_supported (GtkButton *button, gpointer user_data)
g_list_free (authtypes);
}
- g_free (service->url);
- g_free (service);
+ service_destroy (service);
}
@@ -725,7 +716,9 @@ setup_toggle (GtkWidget *widget, const char *depname, MailAccountGui *gui)
}
toggle = g_hash_table_lookup (gui->extra_config, depname);
- g_signal_connect (toggle, "toggled", G_CALLBACK (toggle_sensitivity), widget);
+ gtk_signal_connect (GTK_OBJECT (toggle), "toggled",
+ GTK_SIGNAL_FUNC (toggle_sensitivity),
+ widget);
toggle_sensitivity (toggle, widget);
}
@@ -733,14 +726,13 @@ void
mail_account_gui_build_extra_conf (MailAccountGui *gui, const char *url_string)
{
CamelURL *url;
- GtkWidget *mailcheck_frame, *mailcheck_hbox;
+ GtkWidget *mailcheck_frame, *main_vbox, *cur_vbox;
GtkWidget *hostname_label, *username_label, *path_label;
GtkWidget *hostname, *username, *path;
- GtkTable *main_table, *cur_table;
CamelProviderConfEntry *entries;
GList *children, *child;
char *name;
- int i, rows;
+ int i;
if (url_string)
url = camel_url_new (url_string, NULL);
@@ -748,52 +740,55 @@ mail_account_gui_build_extra_conf (MailAccountGui *gui, const char *url_string)
url = NULL;
hostname_label = glade_xml_get_widget (gui->xml, "source_host_label");
- gtk_label_set_text_with_mnemonic (GTK_LABEL (hostname_label), _("_Host:"));
+ gtk_label_parse_uline (GTK_LABEL (hostname_label), _("_Host:"));
hostname = glade_xml_get_widget (gui->xml, "source_host");
username_label = glade_xml_get_widget (gui->xml, "source_user_label");
- gtk_label_set_text_with_mnemonic (GTK_LABEL (username_label), _("User_name:"));
+ gtk_label_parse_uline (GTK_LABEL (username_label), _("User_name:"));
username = glade_xml_get_widget (gui->xml, "source_user");
path_label = glade_xml_get_widget (gui->xml, "source_path_label");
- gtk_label_set_text_with_mnemonic (GTK_LABEL (path_label), _("_Path:"));
+ gtk_label_parse_uline (GTK_LABEL (path_label), _("_Path:"));
path = glade_xml_get_widget (gui->xml, "source_path");
- /* Remove the contents of the extra_table except for the
- * mailcheck_frame.
- */
- main_table = (GtkTable *)glade_xml_get_widget (gui->xml, "extra_table");
+ main_vbox = glade_xml_get_widget (gui->xml, "extra_vbox");
+
mailcheck_frame = glade_xml_get_widget (gui->xml, "extra_mailcheck_frame");
- children = gtk_container_get_children (GTK_CONTAINER (main_table));
- for (child = children; child; child = child->next) {
- if (child->data != (gpointer)mailcheck_frame) {
- gtk_container_remove (GTK_CONTAINER (main_table),
- child->data);
+
+ /* Remove any additional mailcheck items. */
+ children = gtk_container_children (GTK_CONTAINER (mailcheck_frame));
+ if (children) {
+ cur_vbox = children->data;
+ g_list_free (children);
+ children = gtk_container_children (GTK_CONTAINER (cur_vbox));
+ for (child = children; child; child = child->next) {
+ if (child != children) {
+ gtk_container_remove (GTK_CONTAINER (cur_vbox),
+ child->data);
+ }
}
+ g_list_free (children);
}
- g_list_free (children);
- gtk_table_resize (main_table, 1, 2);
- /* Remove any additional mailcheck items. */
- cur_table = (GtkTable *)glade_xml_get_widget (gui->xml, "extra_mailcheck_table");
- mailcheck_hbox = glade_xml_get_widget (gui->xml, "extra_mailcheck_hbox");
- children = gtk_container_get_children (GTK_CONTAINER (cur_table));
+ /* Remove the contents of the extra_vbox except for the
+ * mailcheck_frame.
+ */
+ children = gtk_container_children (GTK_CONTAINER (main_vbox));
for (child = children; child; child = child->next) {
- if (child->data != (gpointer)mailcheck_hbox) {
- gtk_container_remove (GTK_CONTAINER (cur_table),
+ if (child != children) {
+ gtk_container_remove (GTK_CONTAINER (main_vbox),
child->data);
}
}
g_list_free (children);
- gtk_table_resize (cur_table, 1, 2);
-
+
if (!gui->source.provider) {
- gtk_widget_set_sensitive (GTK_WIDGET (main_table), FALSE);
+ gtk_widget_set_sensitive (main_vbox, FALSE);
if (url)
camel_url_free (url);
return;
} else
- gtk_widget_set_sensitive (GTK_WIDGET (main_table), TRUE);
+ gtk_widget_set_sensitive (main_vbox, TRUE);
/* Set up our hash table. */
if (gui->extra_config)
@@ -804,8 +799,7 @@ mail_account_gui_build_extra_conf (MailAccountGui *gui, const char *url_string)
if (!entries)
goto done;
- cur_table = main_table;
- rows = main_table->nrows;
+ cur_vbox = main_vbox;
for (i = 0; ; i++) {
switch (entries[i].type) {
case CAMEL_PROVIDER_CONF_SECTION_START:
@@ -813,27 +807,18 @@ mail_account_gui_build_extra_conf (MailAccountGui *gui, const char *url_string)
GtkWidget *frame;
if (entries[i].name && !strcmp (entries[i].name, "mailcheck"))
- cur_table = (GtkTable *)glade_xml_get_widget (gui->xml, "extra_mailcheck_table");
+ cur_vbox = glade_xml_get_widget (gui->xml, "extra_mailcheck_vbox");
else {
frame = gtk_frame_new (entries[i].text);
- gtk_container_set_border_width (GTK_CONTAINER (frame), 3);
- gtk_table_attach (main_table, frame, 0, 2,
- rows, rows + 1,
- GTK_EXPAND | GTK_FILL, 0, 0, 0);
-
- cur_table = (GtkTable *)gtk_table_new (0, 2, FALSE);
- rows = 0;
- gtk_table_set_row_spacings (cur_table, 4);
- gtk_table_set_col_spacings (cur_table, 8);
- gtk_container_set_border_width (GTK_CONTAINER (cur_table), 3);
-
- gtk_container_add (GTK_CONTAINER (frame), GTK_WIDGET (cur_table));
+ gtk_box_pack_start (GTK_BOX (main_vbox), frame, FALSE, FALSE, 0);
+ cur_vbox = gtk_vbox_new (FALSE, 4);
+ gtk_container_set_border_width (GTK_CONTAINER (cur_vbox), 4);
+ gtk_container_add (GTK_CONTAINER (frame), cur_vbox);
}
break;
}
case CAMEL_PROVIDER_CONF_SECTION_END:
- cur_table = main_table;
- rows = main_table->nrows;
+ cur_vbox = main_vbox;
break;
case CAMEL_PROVIDER_CONF_LABEL:
@@ -841,18 +826,15 @@ mail_account_gui_build_extra_conf (MailAccountGui *gui, const char *url_string)
GtkWidget *label;
if (!strcmp (entries[i].name, "username")) {
- gtk_label_set_text_with_mnemonic (GTK_LABEL (username_label), entries[i].text);
+ gtk_label_parse_uline (GTK_LABEL (username_label), _(entries[i].text));
} else if (!strcmp (entries[i].name, "hostname")) {
- gtk_label_set_text_with_mnemonic (GTK_LABEL (hostname_label), entries[i].text);
+ gtk_label_parse_uline (GTK_LABEL (hostname_label), _(entries[i].text));
} else if (!strcmp (entries[i].name, "path")) {
- gtk_label_set_text_with_mnemonic (GTK_LABEL (path_label), entries[i].text);
+ gtk_label_parse_uline (GTK_LABEL (path_label), _(entries[i].text));
} else {
/* make a new label */
- label = gtk_label_new (entries[i].text);
- gtk_table_resize (cur_table, cur_table->nrows + 1, 2);
- gtk_table_attach (cur_table, label, 0, 2, rows, rows + 1,
- GTK_EXPAND | GTK_FILL, 0, 0, 0);
- rows++;
+ label = gtk_label_new (_(entries[i].text));
+ gtk_box_pack_start (GTK_BOX (cur_vbox), label, FALSE, FALSE, 0);
}
}
break;
@@ -862,16 +844,13 @@ mail_account_gui_build_extra_conf (MailAccountGui *gui, const char *url_string)
GtkWidget *checkbox;
gboolean active;
- checkbox = gtk_check_button_new_with_label (entries[i].text);
+ checkbox = gtk_check_button_new_with_label (_(entries[i].text));
if (url)
active = camel_url_get_param (url, entries[i].name) != NULL;
else
active = atoi (entries[i].value);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (checkbox), active);
-
- gtk_table_attach (cur_table, checkbox, 0, 2, rows, rows + 1,
- GTK_EXPAND | GTK_FILL, 0, 0, 0);
- rows++;
+ gtk_box_pack_start (GTK_BOX (cur_vbox), checkbox, FALSE, FALSE, 0);
g_hash_table_insert (gui->extra_config, entries[i].name, checkbox);
if (entries[i].depname)
setup_toggle (checkbox, entries[i].depname, gui);
@@ -880,33 +859,32 @@ mail_account_gui_build_extra_conf (MailAccountGui *gui, const char *url_string)
case CAMEL_PROVIDER_CONF_ENTRY:
{
- GtkWidget *label, *entry;
+ GtkWidget *hbox, *label, *entry;
const char *text;
if (!strcmp (entries[i].name, "username")) {
- gtk_label_set_text_with_mnemonic (GTK_LABEL (username_label), entries[i].text);
+ gtk_label_parse_uline (GTK_LABEL (username_label), _(entries[i].text));
label = username_label;
entry = username;
} else if (!strcmp (entries[i].name, "hostname")) {
- gtk_label_set_text_with_mnemonic (GTK_LABEL (hostname_label), entries[i].text);
+ gtk_label_parse_uline (GTK_LABEL (hostname_label), _(entries[i].text));
label = hostname_label;
entry = hostname;
} else if (!strcmp (entries[i].name, "path")) {
- gtk_label_set_text_with_mnemonic (GTK_LABEL (path_label), entries[i].text);
+ gtk_label_parse_uline (GTK_LABEL (path_label), _(entries[i].text));
label = path_label;
entry = path;
} else {
/* make a new text entry with label */
- label = gtk_label_new (entries[i].text);
- gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.0);
+ hbox = gtk_hbox_new (FALSE, 8);
+ label = gtk_label_new (_(entries[i].text));
entry = gtk_entry_new ();
- g_hash_table_insert (gui->extra_config, entries[i].name, entry);
- gtk_table_attach (cur_table, label, 0, 1, rows, rows + 1,
- GTK_FILL, 0, 0, 0);
- gtk_table_attach (cur_table, entry, 1, 2, rows, rows + 1,
- GTK_EXPAND | GTK_FILL, 0, 0, 0);
- rows++;
+ gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0);
+ gtk_box_pack_end (GTK_BOX (hbox), entry, TRUE, TRUE, 0);
+
+ gtk_box_pack_start (GTK_BOX (cur_vbox), hbox, FALSE, FALSE, 0);
+ g_hash_table_insert (gui->extra_config, entries[i].name, entry);
}
if (url)
@@ -934,7 +912,7 @@ mail_account_gui_build_extra_conf (MailAccountGui *gui, const char *url_string)
gboolean enable;
/* FIXME: this is pretty fucked... */
- data = entries[i].text;
+ data = _(entries[i].text);
p = strstr (data, "%s");
g_return_if_fail (p != NULL);
@@ -974,9 +952,7 @@ mail_account_gui_build_extra_conf (MailAccountGui *gui, const char *url_string)
gtk_box_pack_start (GTK_BOX (hbox), spin, FALSE, FALSE, 0);
gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, TRUE, 4);
- gtk_table_attach (cur_table, hbox, 0, 2, rows, rows + 1,
- GTK_EXPAND | GTK_FILL, 0, 0, 0);
- rows++;
+ gtk_box_pack_start (GTK_BOX (cur_vbox), hbox, FALSE, FALSE, 0);
g_hash_table_insert (gui->extra_config, entries[i].name, checkbox);
name = g_strdup_printf ("%s_value", entries[i].name);
g_hash_table_insert (gui->extra_config, name, spin);
@@ -994,7 +970,7 @@ mail_account_gui_build_extra_conf (MailAccountGui *gui, const char *url_string)
}
done:
- gtk_widget_show_all (GTK_WIDGET (main_table));
+ gtk_widget_show_all (main_vbox);
if (url)
camel_url_free (url);
}
@@ -1090,11 +1066,11 @@ mail_account_gui_folder_selector_button_new (char *widget_name,
char *string1, char *string2,
int int1, int int2)
{
- return (GtkWidget *)g_object_new (EVOLUTION_TYPE_FOLDER_SELECTOR_BUTTON, NULL);
+ return (GtkWidget *)gtk_type_new (EVOLUTION_TYPE_FOLDER_SELECTOR_BUTTON);
}
static gboolean
-setup_service (MailAccountGuiService *gsvc, EAccountService *service)
+setup_service (MailAccountGuiService *gsvc, MailConfigService *service)
{
CamelURL *url = camel_url_new (service->url, NULL);
gboolean has_auth = FALSE;
@@ -1131,11 +1107,11 @@ setup_service (MailAccountGuiService *gsvc, EAccountService *service)
else if (!*use_ssl) /* old config code just used an empty string as the value */
use_ssl = "always";
- children = gtk_container_get_children(GTK_CONTAINER (gtk_option_menu_get_menu (gsvc->use_ssl)));
+ children = gtk_container_children (GTK_CONTAINER (gtk_option_menu_get_menu (gsvc->use_ssl)));
for (item = children, i = 0; item; item = item->next, i++) {
if (!strcmp (use_ssl, ssl_options[i].value)) {
gtk_option_menu_set_history (gsvc->use_ssl, i);
- g_signal_emit_by_name (item->data, "activate", gsvc);
+ gtk_signal_emit_by_name (item->data, "activate", gsvc);
break;
}
}
@@ -1146,14 +1122,14 @@ setup_service (MailAccountGuiService *gsvc, EAccountService *service)
CamelServiceAuthType *authtype;
int i;
- children = gtk_container_get_children(GTK_CONTAINER (gtk_option_menu_get_menu (gsvc->authtype)));
+ children = gtk_container_children (GTK_CONTAINER (gtk_option_menu_get_menu (gsvc->authtype)));
for (item = children, i = 0; item; item = item->next, i++) {
- authtype = g_object_get_data ((GObject *) item->data, "authtype");
+ authtype = gtk_object_get_data (item->data, "authtype");
if (!authtype)
continue;
if (!strcmp (authtype->authproto, url->authmech)) {
gtk_option_menu_set_history (gsvc->authtype, i);
- g_signal_emit_by_name (item->data, "activate");
+ gtk_signal_emit_by_name (item->data, "activate");
break;
}
}
@@ -1201,17 +1177,18 @@ construct_ssl_menu (MailAccountGuiService *service)
for (i = 0; i < num_ssl_options; i++) {
item = gtk_menu_item_new_with_label (_(ssl_options[i].label));
- g_object_set_data ((GObject *) item, "use_ssl", ssl_options[i].value);
- g_signal_connect (item, "activate", G_CALLBACK (ssl_option_activate), service);
+ gtk_object_set_data (GTK_OBJECT (item), "use_ssl", ssl_options[i].value);
+ gtk_signal_connect (GTK_OBJECT (item), "activate",
+ ssl_option_activate, service);
gtk_widget_show (item);
- gtk_menu_shell_append(GTK_MENU_SHELL(menu), item);
+ gtk_menu_append (GTK_MENU (menu), item);
}
gtk_option_menu_remove_menu (service->use_ssl);
gtk_option_menu_set_menu (service->use_ssl, menu);
gtk_option_menu_set_history (service->use_ssl, i - 1);
- g_signal_emit_by_name (item, "activate", service);
+ gtk_signal_emit_by_name (GTK_OBJECT (item), "activate", service);
}
static void
@@ -1240,7 +1217,7 @@ sig_fill_options (MailAccountGui *gui)
{
GtkWidget *menu;
GtkWidget *mi;
- GSList *l;
+ GList *l;
MailConfigSignature *sig;
menu = gtk_option_menu_get_menu (GTK_OPTION_MENU (gui->sig_option_menu));
@@ -1249,17 +1226,21 @@ sig_fill_options (MailAccountGui *gui)
clear_menu (menu);
else
menu = gtk_menu_new ();
-
- gtk_menu_shell_append(GTK_MENU_SHELL(menu), gtk_menu_item_new_with_label (_("None")));
- gtk_menu_shell_append(GTK_MENU_SHELL(menu), gtk_menu_item_new_with_label (_("Autogenerated")));
- /* gtk_menu_shell_append(GTK_MENU_SHELL(menu), gtk_menu_item_new_with_label (_("Random"))); */
+
+ gtk_menu_append (GTK_MENU (menu), gtk_menu_item_new_with_label (_("None")));
+ gtk_menu_append (GTK_MENU (menu), gtk_menu_item_new_with_label (_("Autogenerated")));
+ /* gtk_menu_append (GTK_MENU (menu), gtk_menu_item_new_with_label (_("Random"))); */
for (l = mail_config_get_signature_list (); l; l = l->next) {
+ gchar *utf8;
+
sig = l->data;
- mi = gtk_menu_item_new_with_label (sig->name);
- g_object_set_data ((GObject *) mi, "sig", sig);
+ utf8 = e_utf8_to_gtk_string (menu, sig->name);
+ mi = gtk_menu_item_new_with_label (utf8);
+ g_free (utf8);
+ gtk_object_set_data (GTK_OBJECT (mi), "sig", sig);
gtk_widget_show (mi);
- gtk_menu_shell_append(GTK_MENU_SHELL(menu), mi);
+ gtk_menu_append (GTK_MENU (menu), mi);
}
}
@@ -1272,7 +1253,7 @@ sig_changed (GtkWidget *w, MailAccountGui *gui)
active = gtk_menu_get_active (GTK_MENU (w));
index = g_list_index (GTK_MENU_SHELL (w)->children, active);
- gui->def_signature = (MailConfigSignature *) g_object_get_data(G_OBJECT(active), "sig");
+ gui->def_signature = (MailConfigSignature *) gtk_object_get_data (GTK_OBJECT (active), "sig");
gui->auto_signature = index == 1 ? TRUE : FALSE;
}
@@ -1281,28 +1262,18 @@ sig_switch_to_list (GtkWidget *w, MailAccountGui *gui)
{
gtk_window_set_transient_for (GTK_WINDOW (gtk_widget_get_toplevel (w)), NULL);
gdk_window_raise (GTK_WIDGET (gui->dialog)->window);
- gtk_notebook_set_current_page (GTK_NOTEBOOK (glade_xml_get_widget (gui->dialog->gui, "notebook")), 3);
+ gtk_notebook_set_page (GTK_NOTEBOOK (glade_xml_get_widget (gui->dialog->gui, "notebook")), 3);
}
static void
sig_add_new_signature (GtkWidget *w, MailAccountGui *gui)
{
- GConfClient *gconf;
- gboolean send_html;
- GtkWidget *parent;
-
if (!gui->dialog)
return;
sig_switch_to_list (w, gui);
- gconf = gconf_client_get_default ();
- send_html = gconf_client_get_bool (gconf, "/apps/evolution/mail/composer/send_html", NULL);
-
- parent = gtk_widget_get_toplevel (w);
- parent = GTK_WIDGET_TOPLEVEL (parent) ? parent : NULL;
-
- gui->def_signature = mail_composer_prefs_new_signature ((GtkWindow *) parent, send_html, NULL);
+ gui->def_signature = mail_composer_prefs_new_signature (NULL, mail_config_get_send_html (), NULL);
gui->auto_signature = FALSE;
gtk_option_menu_set_history (GTK_OPTION_MENU (gui->sig_option_menu), sig_gui_get_index (gui));
@@ -1311,13 +1282,7 @@ sig_add_new_signature (GtkWidget *w, MailAccountGui *gui)
static void
setup_signatures (MailAccountGui *gui)
{
- MailConfigSignature *sig;
- GSList *signatures;
-
- signatures = mail_config_get_signature_list ();
- sig = g_slist_nth_data (signatures, gui->account->id->def_signature);
-
- gui->def_signature = sig;
+ gui->def_signature = gui->account->id->def_signature;
gui->auto_signature = gui->account->id->auto_signature;
gtk_option_menu_set_history (GTK_OPTION_MENU (gui->sig_option_menu), sig_gui_get_index (gui));
}
@@ -1332,11 +1297,11 @@ sig_event_client (MailConfigSigEvent event, MailConfigSignature *sig, MailAccoun
d(printf ("accounts ADDED\n"));
mi = gtk_menu_item_new_with_label (sig->name);
- g_object_set_data ((GObject *) mi, "sig", sig);
+ gtk_object_set_data (GTK_OBJECT (mi), "sig", sig);
gtk_widget_show (mi);
menu = gtk_option_menu_get_menu (GTK_OPTION_MENU (gui->sig_option_menu));
- gtk_menu_shell_append(GTK_MENU_SHELL(menu), mi);
-
+ gtk_menu_append (GTK_MENU (menu), mi);
+
break;
}
case MAIL_CONFIG_SIG_EVENT_NAME_CHANGED: {
@@ -1351,9 +1316,8 @@ sig_event_client (MailConfigSigEvent event, MailConfigSignature *sig, MailAccoun
gtk_label_set_text (GTK_LABEL (GTK_BIN (mi)->child), sig->name);
gtk_option_menu_set_menu (GTK_OPTION_MENU (gui->sig_option_menu), menu);
gtk_widget_unref (menu);
- gtk_option_menu_set_history (GTK_OPTION_MENU (gui->sig_option_menu),
- sig_gui_get_index (gui));
-
+ gtk_option_menu_set_history (GTK_OPTION_MENU (gui->sig_option_menu), sig_gui_get_index (gui));
+
break;
}
case MAIL_CONFIG_SIG_EVENT_DELETED: {
@@ -1365,14 +1329,13 @@ sig_event_client (MailConfigSigEvent event, MailConfigSignature *sig, MailAccoun
if (sig == gui->def_signature) {
gui->def_signature = NULL;
gui->auto_signature = TRUE;
- gtk_option_menu_set_history (GTK_OPTION_MENU (gui->sig_option_menu),
- sig_gui_get_index (gui));
+ gtk_option_menu_set_history (GTK_OPTION_MENU (gui->sig_option_menu), sig_gui_get_index (gui));
}
-
+
menu = gtk_option_menu_get_menu (GTK_OPTION_MENU (gui->sig_option_menu));
mi = g_list_nth_data (GTK_MENU_SHELL (menu)->children, sig_get_index (sig));
gtk_container_remove (GTK_CONTAINER (menu), mi);
-
+
break;
}
default:
@@ -1385,11 +1348,10 @@ prepare_signatures (MailAccountGui *gui)
{
gui->sig_option_menu = glade_xml_get_widget (gui->xml, "sigOption");
sig_fill_options (gui);
- g_signal_connect (gtk_option_menu_get_menu (GTK_OPTION_MENU (gui->sig_option_menu)),
- "selection-done", G_CALLBACK(sig_changed), gui);
+ gtk_signal_connect (GTK_OBJECT (gtk_option_menu_get_menu (GTK_OPTION_MENU (gui->sig_option_menu))),
+ "selection-done", sig_changed, gui);
- glade_xml_signal_connect_data (gui->xml, "sigAddNewClicked",
- G_CALLBACK (sig_add_new_signature), gui);
+ glade_xml_signal_connect_data (gui->xml, "sigAddNewClicked", GTK_SIGNAL_FUNC (sig_add_new_signature), gui);
if (!gui->dialog) {
gtk_widget_hide (glade_xml_get_widget (gui->xml, "sigLabel"));
@@ -1401,24 +1363,22 @@ prepare_signatures (MailAccountGui *gui)
}
MailAccountGui *
-mail_account_gui_new (EAccount *account, MailAccountsTab *dialog)
+mail_account_gui_new (MailConfigAccount *account, MailAccountsTab *dialog)
{
const char *allowed_types[] = { "mail/*", NULL };
MailAccountGui *gui;
GtkWidget *button;
- g_object_ref (account);
-
gui = g_new0 (MailAccountGui, 1);
gui->account = account;
gui->dialog = dialog;
- gui->xml = glade_xml_new (EVOLUTION_GLADEDIR "/mail-config.glade", NULL, NULL);
+ gui->xml = glade_xml_new (EVOLUTION_GLADEDIR "/mail-config.glade", NULL);
/* Management */
gui->account_name = GTK_ENTRY (glade_xml_get_widget (gui->xml, "management_name"));
gui->default_account = GTK_TOGGLE_BUTTON (glade_xml_get_widget (gui->xml, "management_default"));
if (account->name)
- gtk_entry_set_text (gui->account_name, account->name);
+ e_utf8_gtk_entry_set_text (gui->account_name, account->name);
if (!mail_config_get_default_account ()
|| (account == mail_config_get_default_account ()))
gtk_toggle_button_set_active (gui->default_account, TRUE);
@@ -1431,30 +1391,32 @@ mail_account_gui_new (EAccount *account, MailAccountsTab *dialog)
prepare_signatures (gui);
- if (account->id->name)
- gtk_entry_set_text (gui->full_name, account->id->name);
- if (account->id->address)
- gtk_entry_set_text (gui->email_address, account->id->address);
- if (account->id->reply_to)
- gtk_entry_set_text (gui->reply_to, account->id->reply_to);
- if (account->id->organization)
- gtk_entry_set_text (gui->organization, account->id->organization);
-
- setup_signatures (gui);
+ if (account->id) {
+ if (account->id->name)
+ e_utf8_gtk_entry_set_text (gui->full_name, account->id->name);
+ if (account->id->address)
+ e_utf8_gtk_entry_set_text (gui->email_address, account->id->address);
+ if (account->id->reply_to)
+ e_utf8_gtk_entry_set_text (gui->reply_to, account->id->reply_to);
+ if (account->id->organization)
+ e_utf8_gtk_entry_set_text (gui->organization, account->id->organization);
+
+ setup_signatures (gui);
+ }
/* Source */
gui->source.provider_type = CAMEL_PROVIDER_STORE;
gui->source.type = GTK_OPTION_MENU (glade_xml_get_widget (gui->xml, "source_type_omenu"));
gui->source.description = GTK_LABEL (glade_xml_get_widget (gui->xml, "source_description"));
gui->source.hostname = GTK_ENTRY (glade_xml_get_widget (gui->xml, "source_host"));
- g_signal_connect (gui->source.hostname, "changed",
- G_CALLBACK (service_changed), &gui->source);
+ gtk_signal_connect (GTK_OBJECT (gui->source.hostname), "changed",
+ GTK_SIGNAL_FUNC (service_changed), &gui->source);
gui->source.username = GTK_ENTRY (glade_xml_get_widget (gui->xml, "source_user"));
- g_signal_connect (gui->source.username, "changed",
- G_CALLBACK (service_changed), &gui->source);
+ gtk_signal_connect (GTK_OBJECT (gui->source.username), "changed",
+ GTK_SIGNAL_FUNC (service_changed), &gui->source);
gui->source.path = GTK_ENTRY (glade_xml_get_widget (gui->xml, "source_path"));
- g_signal_connect (gui->source.path, "changed",
- G_CALLBACK (service_changed), &gui->source);
+ gtk_signal_connect (GTK_OBJECT (gui->source.path), "changed",
+ GTK_SIGNAL_FUNC (service_changed), &gui->source);
gui->source.ssl_hbox = glade_xml_get_widget (gui->xml, "source_ssl_hbox");
gui->source.use_ssl = GTK_OPTION_MENU (glade_xml_get_widget (gui->xml, "source_use_ssl"));
construct_ssl_menu (&gui->source);
@@ -1462,8 +1424,8 @@ mail_account_gui_new (EAccount *account, MailAccountsTab *dialog)
gui->source.authtype = GTK_OPTION_MENU (glade_xml_get_widget (gui->xml, "source_auth_omenu"));
gui->source.remember = GTK_TOGGLE_BUTTON (glade_xml_get_widget (gui->xml, "source_remember_password"));
gui->source.check_supported = GTK_BUTTON (glade_xml_get_widget (gui->xml, "source_check_supported"));
- g_signal_connect (gui->source.check_supported, "clicked",
- G_CALLBACK (service_check_supported), &gui->source);
+ gtk_signal_connect (GTK_OBJECT (gui->source.check_supported), "clicked",
+ GTK_SIGNAL_FUNC (service_check_supported), &gui->source);
gui->source_auto_check = GTK_TOGGLE_BUTTON (glade_xml_get_widget (gui->xml, "extra_auto_check"));
gui->source_auto_check_min = GTK_SPIN_BUTTON (glade_xml_get_widget (gui->xml, "extra_auto_check_min"));
@@ -1472,28 +1434,27 @@ mail_account_gui_new (EAccount *account, MailAccountsTab *dialog)
gui->transport.type = GTK_OPTION_MENU (glade_xml_get_widget (gui->xml, "transport_type_omenu"));
gui->transport.description = GTK_LABEL (glade_xml_get_widget (gui->xml, "transport_description"));
gui->transport.hostname = GTK_ENTRY (glade_xml_get_widget (gui->xml, "transport_host"));
- g_signal_connect (gui->transport.hostname, "changed",
- G_CALLBACK (service_changed), &gui->transport);
+ gtk_signal_connect (GTK_OBJECT (gui->transport.hostname), "changed",
+ GTK_SIGNAL_FUNC (service_changed), &gui->transport);
gui->transport.username = GTK_ENTRY (glade_xml_get_widget (gui->xml, "transport_user"));
- g_signal_connect (gui->transport.username, "changed",
- G_CALLBACK (service_changed), &gui->transport);
+ gtk_signal_connect (GTK_OBJECT (gui->transport.username), "changed",
+ GTK_SIGNAL_FUNC (service_changed), &gui->transport);
gui->transport.ssl_hbox = glade_xml_get_widget (gui->xml, "transport_ssl_hbox");
gui->transport.use_ssl = GTK_OPTION_MENU (glade_xml_get_widget (gui->xml, "transport_use_ssl"));
construct_ssl_menu (&gui->transport);
gui->transport.no_ssl = glade_xml_get_widget (gui->xml, "transport_ssl_disabled");
gui->transport_needs_auth = GTK_TOGGLE_BUTTON (glade_xml_get_widget (gui->xml, "transport_needs_auth"));
- g_signal_connect (gui->transport_needs_auth, "toggled",
- G_CALLBACK (transport_needs_auth_toggled), gui);
+ gtk_signal_connect (GTK_OBJECT (gui->transport_needs_auth), "toggled", transport_needs_auth_toggled, gui);
gui->transport.authtype = GTK_OPTION_MENU (glade_xml_get_widget (gui->xml, "transport_auth_omenu"));
gui->transport.remember = GTK_TOGGLE_BUTTON (glade_xml_get_widget (gui->xml, "transport_remember_password"));
gui->transport.check_supported = GTK_BUTTON (glade_xml_get_widget (gui->xml, "transport_check_supported"));
- g_signal_connect (gui->transport.check_supported, "clicked",
- G_CALLBACK (service_check_supported), &gui->transport);
+ gtk_signal_connect (GTK_OBJECT (gui->transport.check_supported), "clicked",
+ GTK_SIGNAL_FUNC (service_check_supported), &gui->transport);
/* Drafts folder */
gui->drafts_folder_button = GTK_BUTTON (glade_xml_get_widget (gui->xml, "drafts_button"));
- g_signal_connect (gui->drafts_folder_button, "selected",
- G_CALLBACK (folder_selected), &gui->drafts_folder_uri);
+ gtk_signal_connect (GTK_OBJECT (gui->drafts_folder_button), "selected",
+ GTK_SIGNAL_FUNC (folder_selected), &gui->drafts_folder_uri);
if (account->drafts_folder_uri)
gui->drafts_folder_uri = g_strdup (account->drafts_folder_uri);
else
@@ -1506,8 +1467,8 @@ mail_account_gui_new (EAccount *account, MailAccountsTab *dialog)
/* Sent folder */
gui->sent_folder_button = GTK_BUTTON (glade_xml_get_widget (gui->xml, "sent_button"));
- g_signal_connect (gui->sent_folder_button, "selected",
- G_CALLBACK (folder_selected), &gui->sent_folder_uri);
+ gtk_signal_connect (GTK_OBJECT (gui->sent_folder_button), "selected",
+ GTK_SIGNAL_FUNC (folder_selected), &gui->sent_folder_uri);
if (account->sent_folder_uri)
gui->sent_folder_uri = g_strdup (account->sent_folder_uri);
else
@@ -1520,26 +1481,25 @@ mail_account_gui_new (EAccount *account, MailAccountsTab *dialog)
/* Special Folders "Reset Defaults" button */
button = glade_xml_get_widget (gui->xml, "default_folders_button");
- g_signal_connect (button, "clicked", G_CALLBACK (default_folders_clicked), gui);
+ gtk_signal_connect (GTK_OBJECT (button), "clicked",
+ GTK_SIGNAL_FUNC (default_folders_clicked), gui);
/* Always Cc */
gui->always_cc = GTK_TOGGLE_BUTTON (glade_xml_get_widget (gui->xml, "always_cc"));
gtk_toggle_button_set_active (gui->always_cc, account->always_cc);
gui->cc_addrs = GTK_ENTRY (glade_xml_get_widget (gui->xml, "cc_addrs"));
- if (account->cc_addrs)
- gtk_entry_set_text (gui->cc_addrs, account->cc_addrs);
+ e_utf8_gtk_entry_set_text (gui->cc_addrs, account->cc_addrs);
/* Always Bcc */
gui->always_bcc = GTK_TOGGLE_BUTTON (glade_xml_get_widget (gui->xml, "always_bcc"));
gtk_toggle_button_set_active (gui->always_bcc, account->always_bcc);
gui->bcc_addrs = GTK_ENTRY (glade_xml_get_widget (gui->xml, "bcc_addrs"));
- if (account->bcc_addrs)
- gtk_entry_set_text (gui->bcc_addrs, account->bcc_addrs);
+ e_utf8_gtk_entry_set_text (gui->bcc_addrs, account->bcc_addrs);
/* Security */
gui->pgp_key = GTK_ENTRY (glade_xml_get_widget (gui->xml, "pgp_key"));
if (account->pgp_key)
- gtk_entry_set_text (gui->pgp_key, account->pgp_key);
+ e_utf8_gtk_entry_set_text (gui->pgp_key, account->pgp_key);
gui->pgp_encrypt_to_self = GTK_TOGGLE_BUTTON (glade_xml_get_widget (gui->xml, "pgp_encrypt_to_self"));
gtk_toggle_button_set_active (gui->pgp_encrypt_to_self, account->pgp_encrypt_to_self);
gui->pgp_always_sign = GTK_TOGGLE_BUTTON (glade_xml_get_widget (gui->xml, "pgp_always_sign"));
@@ -1552,7 +1512,7 @@ mail_account_gui_new (EAccount *account, MailAccountsTab *dialog)
#if defined (HAVE_NSS) && defined (SMIME_SUPPORTED)
gui->smime_key = GTK_ENTRY (glade_xml_get_widget (gui->xml, "smime_key"));
if (account->smime_key)
- gtk_entry_set_text (gui->smime_key, account->smime_key);
+ e_utf8_gtk_entry_set_text (gui->smime_key, account->smime_key);
gui->smime_encrypt_to_self = GTK_TOGGLE_BUTTON (glade_xml_get_widget (gui->xml, "smime_encrypt_to_self"));
gtk_toggle_button_set_active (gui->smime_encrypt_to_self, account->smime_encrypt_to_self);
gui->smime_always_sign = GTK_TOGGLE_BUTTON (glade_xml_get_widget (gui->xml, "smime_always_sign"));
@@ -1610,12 +1570,16 @@ mail_account_gui_setup (MailAccountGui *gui, GtkWidget *top)
item = NULL;
if (provider->object_types[CAMEL_PROVIDER_STORE] && provider->flags & CAMEL_PROVIDER_IS_SOURCE) {
item = gtk_menu_item_new_with_label (provider->name);
- g_object_set_data ((GObject *) gui->source.type, provider->protocol, item);
- g_object_set_data ((GObject *) item, "provider", provider);
- g_object_set_data ((GObject *) item, "number", GUINT_TO_POINTER (si));
- g_signal_connect (item, "activate", G_CALLBACK (source_type_changed), gui);
+ gtk_object_set_data (GTK_OBJECT (gui->source.type),
+ provider->protocol, item);
+ gtk_object_set_data (GTK_OBJECT (item), "provider", provider);
+ gtk_object_set_data (GTK_OBJECT (item), "number",
+ GUINT_TO_POINTER (si));
+ gtk_signal_connect (GTK_OBJECT (item), "activate",
+ GTK_SIGNAL_FUNC (source_type_changed),
+ gui);
- gtk_menu_shell_append(GTK_MENU_SHELL(stores), item);
+ gtk_menu_append (GTK_MENU (stores), item);
gtk_widget_show (item);
@@ -1624,7 +1588,7 @@ mail_account_gui_setup (MailAccountGui *gui, GtkWidget *top)
hstore = si;
}
- if (source_proto && !strcasecmp (provider->protocol, source_proto)) {
+ if (source_proto && !g_strcasecmp (provider->protocol, source_proto)) {
fstore = item;
hstore = si;
}
@@ -1634,15 +1598,19 @@ mail_account_gui_setup (MailAccountGui *gui, GtkWidget *top)
if (provider->object_types[CAMEL_PROVIDER_TRANSPORT]) {
item = gtk_menu_item_new_with_label (provider->name);
- g_object_set_data ((GObject *) gui->transport.type, provider->protocol, item);
- g_object_set_data ((GObject *) item, "provider", provider);
- g_object_set_data ((GObject *) item, "number", GUINT_TO_POINTER (ti));
- g_signal_connect (item, "activate", G_CALLBACK (transport_type_changed), gui);
+ gtk_object_set_data (GTK_OBJECT (gui->transport.type),
+ provider->protocol, item);
+ gtk_object_set_data (GTK_OBJECT (item), "provider", provider);
+ gtk_object_set_data (GTK_OBJECT (item), "number",
+ GUINT_TO_POINTER (ti));
+ gtk_signal_connect (GTK_OBJECT (item), "activate",
+ GTK_SIGNAL_FUNC (transport_type_changed),
+ gui);
- gtk_menu_shell_append(GTK_MENU_SHELL(transports), item);
+ gtk_menu_append (GTK_MENU (transports), item);
gtk_widget_show (item);
-
+
if (CAMEL_PROVIDER_IS_STORE_AND_TRANSPORT (provider))
gtk_widget_set_sensitive (item, FALSE);
@@ -1651,7 +1619,7 @@ mail_account_gui_setup (MailAccountGui *gui, GtkWidget *top)
htransport = ti;
}
- if (transport_proto && !strcasecmp (provider->protocol, transport_proto)) {
+ if (transport_proto && !g_strcasecmp (provider->protocol, transport_proto)) {
ftransport = item;
htransport = ti;
}
@@ -1660,7 +1628,7 @@ mail_account_gui_setup (MailAccountGui *gui, GtkWidget *top)
}
if (item && provider->authtypes) {
- /*GdkFont *font = GTK_WIDGET (item)->style->font;*/
+ GdkFont *font = GTK_WIDGET (item)->style->font;
CamelServiceAuthType *at;
int width;
GList *a;
@@ -1668,10 +1636,7 @@ mail_account_gui_setup (MailAccountGui *gui, GtkWidget *top)
for (a = provider->authtypes; a; a = a->next) {
at = a->data;
- /* Just using string length is probably good enough,
- as we only use the width of the widget, not the string */
- /*width = gdk_string_width (font, at->name);*/
- width = strlen(at->name) * 14;
+ width = gdk_string_width (font, at->name);
if (width > max_width) {
max_authname = at->name;
max_width = width;
@@ -1683,10 +1648,12 @@ mail_account_gui_setup (MailAccountGui *gui, GtkWidget *top)
/* add a "None" option to the stores menu */
item = gtk_menu_item_new_with_label (_("None"));
- g_object_set_data ((GObject *) item, "provider", NULL);
- g_signal_connect (item, "activate", G_CALLBACK (source_type_changed), gui);
+ gtk_object_set_data (GTK_OBJECT (item), "provider", NULL);
+ gtk_signal_connect (GTK_OBJECT (item), "activate",
+ GTK_SIGNAL_FUNC (source_type_changed),
+ gui);
- gtk_menu_shell_append(GTK_MENU_SHELL(stores), item);
+ gtk_menu_append (GTK_MENU (stores), item);
gtk_widget_show (item);
@@ -1709,16 +1676,16 @@ mail_account_gui_setup (MailAccountGui *gui, GtkWidget *top)
menu = gtk_menu_new ();
item = gtk_menu_item_new_with_label (max_authname);
- gtk_menu_shell_append(GTK_MENU_SHELL(menu), item);
+ gtk_menu_append (GTK_MENU (menu), item);
gtk_widget_show_all (menu);
gtk_option_menu_set_menu (gui->source.authtype, menu);
gtk_widget_show (GTK_WIDGET (gui->source.authtype));
gtk_widget_size_request (GTK_WIDGET (gui->source.authtype),
&size_req);
- gtk_widget_set_size_request (GTK_WIDGET (gui->source.authtype),
+ gtk_widget_set_usize (GTK_WIDGET (gui->source.authtype),
size_req.width, -1);
- gtk_widget_set_size_request (GTK_WIDGET (gui->transport.authtype),
+ gtk_widget_set_usize (GTK_WIDGET (gui->transport.authtype),
size_req.width, -1);
}
@@ -1727,12 +1694,12 @@ mail_account_gui_setup (MailAccountGui *gui, GtkWidget *top)
}
if (fstore) {
- g_signal_emit_by_name (fstore, "activate");
+ gtk_signal_emit_by_name (GTK_OBJECT (fstore), "activate");
gtk_option_menu_set_history (gui->source.type, hstore);
}
if (ftransport) {
- g_signal_emit_by_name (ftransport, "activate");
+ gtk_signal_emit_by_name (GTK_OBJECT (ftransport), "activate");
gtk_option_menu_set_history (gui->transport.type, htransport);
}
@@ -1756,10 +1723,11 @@ mail_account_gui_setup (MailAccountGui *gui, GtkWidget *top)
}
static void
-save_service (MailAccountGuiService *gsvc, GHashTable *extra_config, EAccountService *service)
+save_service (MailAccountGuiService *gsvc, GHashTable *extra_config,
+ MailConfigService *service)
{
CamelURL *url;
- const char *str;
+ char *str;
if (!gsvc->provider) {
g_free (service->url);
@@ -1780,7 +1748,7 @@ save_service (MailAccountGuiService *gsvc, GHashTable *extra_config, EAccountSer
GTK_WIDGET_IS_SENSITIVE (gsvc->authtype) && gsvc->authitem && url->user) {
CamelServiceAuthType *authtype;
- authtype = g_object_get_data(G_OBJECT(gsvc->authitem), "authtype");
+ authtype = gtk_object_get_data (GTK_OBJECT (gsvc->authitem), "authtype");
if (authtype && authtype->authproto && *authtype->authproto)
url->authmech = g_strdup (authtype->authproto);
@@ -1810,7 +1778,7 @@ save_service (MailAccountGuiService *gsvc, GHashTable *extra_config, EAccountSer
if (gsvc->provider->flags & CAMEL_PROVIDER_SUPPORTS_SSL) {
const char *use_ssl;
- use_ssl = g_object_get_data(G_OBJECT(gsvc->ssl_selected), "use_ssl");
+ use_ssl = gtk_object_get_data (GTK_OBJECT (gsvc->ssl_selected), "use_ssl");
/* set the value to either "always" or "when-possible"
but don't bother setting it for "never" */
@@ -1834,7 +1802,7 @@ save_service (MailAccountGuiService *gsvc, GHashTable *extra_config, EAccountSer
static void
add_new_store (char *uri, CamelStore *store, void *user_data)
{
- EAccount *account = user_data;
+ const MailConfigAccount *account = user_data;
EvolutionStorage *storage;
if (store == NULL)
@@ -1853,13 +1821,13 @@ add_new_store (char *uri, CamelStore *store, void *user_data)
gboolean
mail_account_gui_save (MailAccountGui *gui)
{
- EAccount *account, *new;
+ MailConfigAccount *account = gui->account;
+ MailConfigAccount *old_account;
CamelProvider *provider = NULL;
CamelURL *source_url = NULL, *url;
- gboolean is_new = FALSE;
- const char *new_name;
gboolean is_storage;
- GSList *signatures;
+ gboolean enabled;
+ char *new_name;
if (!mail_account_gui_identity_complete (gui, NULL) ||
!mail_account_gui_source_complete (gui, NULL) ||
@@ -1867,63 +1835,70 @@ mail_account_gui_save (MailAccountGui *gui)
!mail_account_gui_management_complete (gui, NULL))
return FALSE;
- new = gui->account;
-
/* this would happen at an inconvenient time in the druid,
* but the druid performs its own check so this can't happen
* here. */
- new_name = gtk_entry_get_text (gui->account_name);
- account = mail_config_get_account_by_name (new_name);
+ new_name = e_utf8_gtk_entry_get_text (gui->account_name);
+ old_account = (MailConfigAccount *) mail_config_get_account_by_name (new_name);
- if (account && account != new) {
- e_notice (gui->account_name, GTK_MESSAGE_ERROR, _("You may not create two accounts with the same name."));
+ if (old_account && old_account != account) {
+ e_notice (NULL, GNOME_MESSAGE_BOX_ERROR,
+ _("You may not create two accounts with the same name."));
return FALSE;
}
- account = new;
+ /* make a copy of the old account for later use... */
+ old_account = account_copy (account);
- new = e_account_new ();
- new->name = g_strdup (new_name);
- new->enabled = account->enabled;
+ g_free (account->name);
+ account->name = new_name;
/* construct the identity */
- new->id->name = g_strdup (gtk_entry_get_text (gui->full_name));
- new->id->address = g_strdup (gtk_entry_get_text (gui->email_address));
- new->id->reply_to = g_strdup (gtk_entry_get_text (gui->reply_to));
- new->id->organization = g_strdup (gtk_entry_get_text (gui->organization));
+ identity_destroy (account->id);
+ account->id = g_new0 (MailConfigIdentity, 1);
+ account->id->name = e_utf8_gtk_entry_get_text (gui->full_name);
+ account->id->address = e_utf8_gtk_entry_get_text (gui->email_address);
+ account->id->reply_to = e_utf8_gtk_entry_get_text (gui->reply_to);
+ account->id->organization = e_utf8_gtk_entry_get_text (gui->organization);
/* signatures */
- signatures = mail_config_get_signature_list ();
- new->id->def_signature = g_slist_index (signatures, gui->def_signature);
- new->id->auto_signature = gui->auto_signature;
-
- /* source */
- save_service (&gui->source, gui->extra_config, new->source);
- if (new->source->url) {
- provider = camel_session_get_provider (session, new->source->url, NULL);
- source_url = provider ? camel_url_new (new->source->url, NULL) : NULL;
+ account->id->def_signature = gui->def_signature;
+ account->id->auto_signature = gui->auto_signature;
+
+ enabled = account->source && account->source->enabled;
+ service_destroy (account->source);
+ account->source = g_new0 (MailConfigService, 1);
+ save_service (&gui->source, gui->extra_config, account->source);
+ if (account->source->url) {
+ provider = camel_session_get_provider (session, account->source->url, NULL);
+ source_url = provider ? camel_url_new (account->source->url, NULL) : NULL;
}
- new->source->auto_check = gtk_toggle_button_get_active (gui->source_auto_check);
- if (new->source->auto_check)
- new->source->auto_check_time = gtk_spin_button_get_value_as_int (gui->source_auto_check_min);
+ account->source->enabled = enabled;
+
+ account->source->auto_check = gtk_toggle_button_get_active (gui->source_auto_check);
+ if (account->source->auto_check)
+ account->source->auto_check_time = gtk_spin_button_get_value_as_int (gui->source_auto_check_min);
- /* transport */
+ service_destroy (account->transport);
+ account->transport = g_new0 (MailConfigService, 1);
if (CAMEL_PROVIDER_IS_STORE_AND_TRANSPORT (gui->transport.provider)) {
/* The transport URI is the same as the source URI. */
- save_service (&gui->source, gui->extra_config, new->transport);
+ save_service (&gui->source, gui->extra_config, account->transport);
} else
- save_service (&gui->transport, NULL, new->transport);
+ save_service (&gui->transport, NULL, account->transport);
/* Check to make sure that the Drafts folder uri is "valid" before assigning it */
url = source_url && gui->drafts_folder_uri ? camel_url_new (gui->drafts_folder_uri, NULL) : NULL;
if (mail_config_get_account_by_source_url (gui->drafts_folder_uri) ||
(url && provider->url_equal (source_url, url))) {
- new->drafts_folder_uri = g_strdup (gui->drafts_folder_uri);
+ g_free (account->drafts_folder_uri);
+ account->drafts_folder_uri = g_strdup (gui->drafts_folder_uri);
} else {
/* assign defaults - the uri is unknown to us (probably pointed to an old source url) */
- new->drafts_folder_uri = g_strdup (default_drafts_folder_uri);
+ g_free (account->drafts_folder_uri);
+ account->drafts_folder_uri = g_strdup (default_drafts_folder_uri);
}
if (url)
@@ -1933,10 +1908,12 @@ mail_account_gui_save (MailAccountGui *gui)
url = source_url && gui->sent_folder_uri ? camel_url_new (gui->sent_folder_uri, NULL) : NULL;
if (mail_config_get_account_by_source_url (gui->sent_folder_uri) ||
(url && provider->url_equal (source_url, url))) {
- new->sent_folder_uri = g_strdup (gui->sent_folder_uri);
+ g_free (account->sent_folder_uri);
+ account->sent_folder_uri = g_strdup (gui->sent_folder_uri);
} else {
/* assign defaults - the uri is unknown to us (probably pointed to an old source url) */
- new->sent_folder_uri = g_strdup (default_sent_folder_uri);
+ g_free (account->sent_folder_uri);
+ account->sent_folder_uri = g_strdup (default_sent_folder_uri);
}
if (url)
@@ -1945,49 +1922,44 @@ mail_account_gui_save (MailAccountGui *gui)
if (source_url)
camel_url_free (source_url);
- new->always_cc = gtk_toggle_button_get_active (gui->always_cc);
- new->cc_addrs = g_strdup (gtk_entry_get_text (gui->cc_addrs));
- new->always_bcc = gtk_toggle_button_get_active (gui->always_bcc);
- new->bcc_addrs = g_strdup (gtk_entry_get_text (gui->bcc_addrs));
+ account->always_cc = gtk_toggle_button_get_active (gui->always_cc);
+ account->cc_addrs = e_utf8_gtk_entry_get_text (gui->cc_addrs);
+ account->always_bcc = gtk_toggle_button_get_active (gui->always_bcc);
+ account->bcc_addrs = e_utf8_gtk_entry_get_text (gui->bcc_addrs);
- new->pgp_key = g_strdup (gtk_entry_get_text (gui->pgp_key));
- new->pgp_encrypt_to_self = gtk_toggle_button_get_active (gui->pgp_encrypt_to_self);
- new->pgp_always_sign = gtk_toggle_button_get_active (gui->pgp_always_sign);
- new->pgp_no_imip_sign = gtk_toggle_button_get_active (gui->pgp_no_imip_sign);
- new->pgp_always_trust = gtk_toggle_button_get_active (gui->pgp_always_trust);
+ g_free (account->pgp_key);
+ account->pgp_key = e_utf8_gtk_entry_get_text (gui->pgp_key);
+ account->pgp_encrypt_to_self = gtk_toggle_button_get_active (gui->pgp_encrypt_to_self);
+ account->pgp_always_sign = gtk_toggle_button_get_active (gui->pgp_always_sign);
+ account->pgp_no_imip_sign = gtk_toggle_button_get_active (gui->pgp_no_imip_sign);
+ account->pgp_always_trust = gtk_toggle_button_get_active (gui->pgp_always_trust);
#if defined (HAVE_NSS) && defined (SMIME_SUPPORTED)
- new->smime_key = g_strdup (gtk_entry_get_text (gui->smime_key));
- new->smime_encrypt_to_self = gtk_toggle_button_get_active (gui->smime_encrypt_to_self);
- new->smime_always_sign = gtk_toggle_button_get_active (gui->smime_always_sign);
+ g_free (account->smime_key);
+ account->smime_key = e_utf8_gtk_entry_get_text (gui->smime_key);
+ account->smime_encrypt_to_self = gtk_toggle_button_get_active (gui->smime_encrypt_to_self);
+ account->smime_always_sign = gtk_toggle_button_get_active (gui->smime_always_sign);
#endif /* HAVE_NSS && SMIME_SUPPORTED */
is_storage = provider && (provider->flags & CAMEL_PROVIDER_IS_STORAGE) &&
!(provider->flags & CAMEL_PROVIDER_IS_EXTERNAL);
if (!mail_config_find_account (account)) {
- /* this is a new account so add it to our account-list */
- is_new = TRUE;
- } else if (account->source->url) {
+ /* this is a new account so it it to our account-list */
+ mail_config_add_account (account);
+ } else if (old_account->source && old_account->source->url) {
/* this means the account was edited - if the old and
new source urls are not identical, replace the old
storage with the new storage */
#define sources_equal(old,new) (new->url && !strcmp (old->url, new->url))
- if (!sources_equal (account->source, new->source)) {
+ if (!sources_equal (old_account->source, account->source)) {
/* Remove the old storage from the folder-tree */
- mail_remove_storage_by_uri (account->source->url);
+ mail_remove_storage_by_uri (old_account->source->url);
}
}
- /* update the old account with the new settings */
- e_account_import (account, new);
- g_object_unref (new);
-
- if (is_new) {
- mail_config_add_account (account);
- } else {
- e_account_list_change (mail_config_get_accounts (), account);
- }
+ /* destroy the copy of the old account */
+ account_destroy (old_account);
/* if the account provider is something we can stick
in the folder-tree and not added by some other
@@ -1999,7 +1971,6 @@ mail_account_gui_save (MailAccountGui *gui)
if (gtk_toggle_button_get_active (gui->default_account))
mail_config_set_default_account (account);
- mail_config_save_accounts ();
mail_config_write_account_sig (account, -1);
mail_autoreceive_setup ();
@@ -2012,13 +1983,10 @@ mail_account_gui_destroy (MailAccountGui *gui)
{
if (gui->dialog)
mail_config_signature_unregister_client ((MailConfigSignatureClient) sig_event_client, gui);
-
- g_object_unref (gui->xml);
- g_object_unref (gui->account);
-
+
+ gtk_object_unref (GTK_OBJECT (gui->xml));
if (gui->extra_config)
g_hash_table_destroy (gui->extra_config);
-
g_free (gui->drafts_folder_uri);
g_free (gui->sent_folder_uri);
g_free (gui);
diff --git a/mail/mail-accounts.c b/mail/mail-accounts.c
index fb06efd6ba..1ad5c066fa 100644
--- a/mail/mail-accounts.c
+++ b/mail/mail-accounts.c
@@ -27,10 +27,16 @@
#include "mail-accounts.h"
+#include <libgnomeui/gnome-stock.h>
+#include <libgnomeui/gnome-messagebox.h>
+#include <gal/e-table/e-table-memory-store.h>
+#include <gal/e-table/e-table-scrolled.h>
+#include <gal/e-table/e-cell-toggle.h>
+#include <gal/util/e-unicode-i18n.h>
+#include <gal/widgets/e-unicode.h>
#include <camel/camel-url.h>
-#include <gtk/gtkliststore.h>
-#include <gtk/gtktreeselection.h>
+#include <bonobo/bonobo-generic-factory.h>
#include "mail.h"
#include "mail-config.h"
@@ -40,11 +46,11 @@
#include "art/mark.xpm"
+#define USE_ETABLE 0
static void mail_accounts_tab_class_init (MailAccountsTabClass *class);
static void mail_accounts_tab_init (MailAccountsTab *prefs);
-static void mail_accounts_tab_finalise (GObject *obj);
-static void mail_accounts_tab_destroy (GtkObject *object);
+static void mail_accounts_tab_finalise (GtkObject *obj);
static void mail_accounts_load (MailAccountsTab *tab);
@@ -57,23 +63,23 @@ static GtkVBoxClass *parent_class = NULL;
#define PREFS_WINDOW(prefs) GTK_WINDOW (gtk_widget_get_ancestor (GTK_WIDGET (prefs), GTK_TYPE_WINDOW))
-GType
+GtkType
mail_accounts_tab_get_type (void)
{
- static GType type = 0;
+ static GtkType type = 0;
if (!type) {
- GTypeInfo type_info = {
- sizeof (MailAccountsTabClass),
- NULL, NULL,
- (GClassInitFunc) mail_accounts_tab_class_init,
- NULL, NULL,
+ GtkTypeInfo type_info = {
+ "MailAccountsTab",
sizeof (MailAccountsTab),
- 0,
- (GInstanceInitFunc) mail_accounts_tab_init,
+ sizeof (MailAccountsTabClass),
+ (GtkClassInitFunc) mail_accounts_tab_class_init,
+ (GtkObjectInitFunc) mail_accounts_tab_init,
+ (GtkArgSetFunc) NULL,
+ (GtkArgGetFunc) NULL
};
- type = g_type_register_static (gtk_vbox_get_type (), "MailAccountsTab", &type_info, 0);
+ type = gtk_type_unique (gtk_vbox_get_type (), &type_info);
}
return type;
@@ -82,14 +88,14 @@ mail_accounts_tab_get_type (void)
static void
mail_accounts_tab_class_init (MailAccountsTabClass *klass)
{
- GtkObjectClass *gtk_object_class = (GtkObjectClass *) klass;
- GObjectClass *object_class = (GObjectClass *) klass;
+ GtkObjectClass *object_class;
- parent_class = g_type_class_ref (gtk_vbox_get_type ());
-
- gtk_object_class->destroy = mail_accounts_tab_destroy;
+ object_class = (GtkObjectClass *) klass;
+ parent_class = gtk_type_class (gtk_vbox_get_type ());
object_class->finalize = mail_accounts_tab_finalise;
+ /* override methods */
+
/* setup static data */
disabled_pixbuf = NULL;
@@ -106,71 +112,59 @@ mail_accounts_tab_init (MailAccountsTab *prefs)
}
static void
-mail_accounts_tab_destroy (GtkObject *obj)
-{
- MailAccountsTab *prefs = (MailAccountsTab *) obj;
-
- prefs->destroyed = TRUE;
-
- GTK_OBJECT_CLASS (parent_class)->destroy (obj);
-}
-
-static void
-mail_accounts_tab_finalise (GObject *obj)
+mail_accounts_tab_finalise (GtkObject *obj)
{
MailAccountsTab *prefs = (MailAccountsTab *) obj;
- g_object_unref (prefs->gui);
+ gtk_object_unref (GTK_OBJECT (prefs->gui));
gdk_pixmap_unref (prefs->mark_pixmap);
- g_object_unref (prefs->mark_bitmap);
+ gdk_bitmap_unref (prefs->mark_bitmap);
- G_OBJECT_CLASS (parent_class)->finalize (obj);
+ ((GtkObjectClass *)(parent_class))->finalize (obj);
}
static void
-account_add_finished (MailAccountsTab *prefs, GObject *deadbeef)
+account_add_finished (GtkWidget *widget, gpointer user_data)
{
/* Either Cancel or Finished was clicked in the druid so reload the accounts */
+ MailAccountsTab *prefs = user_data;
+
prefs->druid = NULL;
- if (!prefs->destroyed)
+ if (!GTK_OBJECT_DESTROYED (prefs))
mail_accounts_load (prefs);
- g_object_unref (prefs);
+ gtk_object_unref ((GtkObject *) prefs);
}
static void
account_add_clicked (GtkButton *button, gpointer user_data)
{
MailAccountsTab *prefs = (MailAccountsTab *) user_data;
- GtkWidget *parent;
if (prefs->druid == NULL) {
- prefs->druid = (GtkWidget *) mail_config_druid_new ();
-
- parent = gtk_widget_get_toplevel ((GtkWidget *) prefs);
- if (GTK_WIDGET_TOPLEVEL (parent))
- gtk_window_set_transient_for ((GtkWindow *) prefs->druid, (GtkWindow *) parent);
-
- g_object_weak_ref ((GObject *) prefs->druid,
- (GWeakNotify) account_add_finished, prefs);
+ prefs->druid = (GtkWidget *) mail_config_druid_new (prefs->shell);
+ gtk_signal_connect (GTK_OBJECT (prefs->druid), "destroy",
+ GTK_SIGNAL_FUNC (account_add_finished), prefs);
gtk_widget_show (prefs->druid);
- g_object_ref (prefs);
+ gtk_object_ref ((GtkObject *) prefs);
} else {
gdk_window_raise (prefs->druid->window);
}
}
static void
-account_edit_finished (MailAccountsTab *prefs, GObject *deadbeef)
+account_edit_finished (GtkWidget *widget, gpointer user_data)
{
+ MailAccountsTab *prefs = user_data;
+
prefs->editor = NULL;
- if (!prefs->destroyed)
+ if (!GTK_OBJECT_DESTROYED (prefs))
mail_accounts_load (prefs);
- g_object_unref (prefs);
+ gtk_object_unref ((GtkObject *) prefs);
}
static void
@@ -179,26 +173,29 @@ account_edit_clicked (GtkButton *button, gpointer user_data)
MailAccountsTab *prefs = (MailAccountsTab *) user_data;
if (prefs->editor == NULL) {
- GtkTreeSelection *selection;
- EAccount *account = NULL;
- GtkTreeModel *model;
- GtkTreeIter iter;
-
- selection = gtk_tree_view_get_selection (prefs->table);
- if (gtk_tree_selection_get_selected (selection, &model, &iter))
- gtk_tree_model_get (model, &iter, 3, &account, -1);
-
- if (account) {
- GtkWidget *parent;
-
- parent = gtk_widget_get_toplevel ((GtkWidget *) prefs);
- parent = GTK_WIDGET_TOPLEVEL (parent) ? parent : NULL;
+ int row;
+#if USE_ETABLE
+ row = e_table_get_cursor_row (prefs->table);
+#else
+ row = prefs->table->selection ? GPOINTER_TO_INT (prefs->table->selection->data) : -1;
+#endif
+ if (row >= 0) {
+ MailConfigAccount *account;
+ GtkWidget *window;
- prefs->editor = (GtkWidget *) mail_account_editor_new (account, (GtkWindow *) parent, prefs);
+ window = gtk_widget_get_ancestor (GTK_WIDGET (prefs), GTK_TYPE_WINDOW);
- g_object_weak_ref ((GObject *) prefs->editor, (GWeakNotify) account_edit_finished, prefs);
+#if USE_ETABLE
+ account = e_table_memory_get_data (E_TABLE_MEMORY (prefs->model), row);
+#else
+ account = gtk_clist_get_row_data (prefs->table, row);
+#endif
+ prefs->editor = (GtkWidget *) mail_account_editor_new (account, GTK_WINDOW (window), prefs);
+ gtk_signal_connect (GTK_OBJECT (prefs->editor), "destroy",
+ GTK_SIGNAL_FUNC (account_edit_finished),
+ prefs);
gtk_widget_show (prefs->editor);
- g_object_ref (prefs);
+ gtk_object_ref ((GtkObject *) prefs);
}
} else {
gdk_window_raise (prefs->editor->window);
@@ -209,60 +206,66 @@ static void
account_delete_clicked (GtkButton *button, gpointer user_data)
{
MailAccountsTab *prefs = user_data;
- GtkTreeSelection *selection;
- EAccount *account = NULL;
- EAccountList *accounts;
- GtkTreeModel *model;
- GtkWidget *confirm;
- GtkTreeIter iter;
- int ans;
-
- selection = gtk_tree_view_get_selection (prefs->table);
- if (gtk_tree_selection_get_selected (selection, &model, &iter))
- gtk_tree_model_get (model, &iter, 3, &account, -1);
+ const MailConfigAccount *account;
+ GnomeDialog *confirm;
+ const GSList *list;
+ int row, ans;
+
+#if USE_ETABLE
+ row = e_table_get_cursor_row (prefs->table);
+#else
+ row = prefs->table->selection ? GPOINTER_TO_INT (prefs->table->selection->data) : -1;
+#endif
/* make sure we have a valid account selected and that we aren't editing anything... */
- if (account == NULL || prefs->editor != NULL)
+ if (row < 0 || prefs->editor != NULL)
return;
- confirm = gtk_message_dialog_new (PREFS_WINDOW (prefs),
- GTK_DIALOG_MODAL|GTK_DIALOG_DESTROY_WITH_PARENT,
- GTK_MESSAGE_QUESTION, GTK_BUTTONS_NONE,
- _("Are you sure you want to delete this account?"));
-
- button = (GtkButton *) gtk_button_new_from_stock (GTK_STOCK_YES);
- gtk_button_set_label (button, _("Delete"));
- gtk_dialog_add_action_widget ((GtkDialog *) confirm, (GtkWidget *) button, GTK_RESPONSE_YES);
- gtk_widget_show ((GtkWidget *) button);
-
- button = (GtkButton *) gtk_button_new_from_stock (GTK_STOCK_NO);
- gtk_button_set_label (button, _("Don't delete"));
- gtk_dialog_add_action_widget ((GtkDialog *) confirm, (GtkWidget *) button, GTK_RESPONSE_NO);
- gtk_widget_show ((GtkWidget *) button);
-
- ans = gtk_dialog_run ((GtkDialog *) confirm);
- gtk_widget_destroy (confirm);
-
- if (ans == GTK_RESPONSE_YES) {
- int len;
+ confirm = GNOME_DIALOG (gnome_message_box_new (_("Are you sure you want to delete this account?"),
+ GNOME_MESSAGE_BOX_QUESTION,
+ NULL));
+ gnome_dialog_append_button_with_pixmap (confirm, _("Delete"), GNOME_STOCK_BUTTON_YES);
+ gnome_dialog_append_button_with_pixmap (confirm, _("Don't delete"), GNOME_STOCK_BUTTON_NO);
+ gtk_window_set_policy (GTK_WINDOW (confirm), TRUE, TRUE, TRUE);
+ gtk_window_set_modal (GTK_WINDOW (confirm), TRUE);
+ gtk_window_set_title (GTK_WINDOW (confirm), _("Really delete account?"));
+ gnome_dialog_set_parent (confirm, PREFS_WINDOW (prefs));
+ ans = gnome_dialog_run_and_close (confirm);
+
+ if (ans == 0) {
+ int select, len;
+
+#if USE_ETABLE
+ account = e_table_memory_get_data (E_TABLE_MEMORY (prefs->model), row);
+#else
+ account = gtk_clist_get_row_data (prefs->table, row);
+#endif
/* remove it from the folder-tree in the shell */
- if (account->enabled && account->source && account->source->url)
+ if (account->source && account->source->url && account->source->enabled)
mail_remove_storage_by_uri (account->source->url);
/* remove it from the config file */
- mail_config_remove_account (account);
- accounts = mail_config_get_accounts ();
+ list = mail_config_remove_account ((MailConfigAccount *) account);
mail_config_write ();
mail_autoreceive_setup ();
- gtk_list_store_remove ((GtkListStore *) model, &iter);
+#if USE_ETABLE
+ e_table_memory_store_remove (E_TABLE_MEMORY_STORE (prefs->model), row);
+#else
+ gtk_clist_remove (prefs->table, row);
+#endif
- len = e_list_length ((EList *) accounts);
+ len = list ? g_slist_length ((GSList *) list) : 0;
if (len > 0) {
- gtk_tree_selection_select_iter (selection, &iter);
+ select = row >= len ? len - 1 : row;
+#if USE_ETABLE
+ e_table_set_cursor_row (prefs->table, select);
+#else
+ gtk_clist_select_row (prefs->table, select, 0);
+#endif
} else {
gtk_widget_set_sensitive (GTK_WIDGET (prefs->mail_edit), FALSE);
gtk_widget_set_sensitive (GTK_WIDGET (prefs->mail_delete), FALSE);
@@ -276,16 +279,22 @@ static void
account_default_clicked (GtkButton *button, gpointer user_data)
{
MailAccountsTab *prefs = user_data;
- GtkTreeSelection *selection;
- EAccount *account = NULL;
- GtkTreeModel *model;
- GtkTreeIter iter;
+ const MailConfigAccount *account;
+ int row;
- selection = gtk_tree_view_get_selection (prefs->table);
- if (gtk_tree_selection_get_selected (selection, &model, &iter))
- gtk_tree_model_get (model, &iter, 3, &account, -1);
+#if USE_ETABLE
+ row = e_table_get_cursor_row (prefs->table);
+#else
+ row = prefs->table->selection ? GPOINTER_TO_INT (prefs->table->selection->data) : -1;
+#endif
- if (account) {
+ if (row >= 0) {
+#if USE_ETABLE
+ account = e_table_memory_get_data (E_TABLE_MEMORY (prefs->model), row);
+#else
+ account = gtk_clist_get_row_data (prefs->table, row);
+#endif
+
mail_config_set_default_account (account);
mail_config_write ();
@@ -298,222 +307,259 @@ static void
account_able_clicked (GtkButton *button, gpointer user_data)
{
MailAccountsTab *prefs = user_data;
- GtkTreeSelection *selection;
- EAccount *account = NULL;
- GtkTreeModel *model;
- GtkTreeIter iter;
-
- selection = gtk_tree_view_get_selection (prefs->table);
- if (gtk_tree_selection_get_selected (selection, &model, &iter)) {
- gtk_tree_model_get (model, &iter, 3, &account, -1);
- account->enabled = !account->enabled;
- gtk_list_store_set ((GtkListStore *) model, &iter, 0, account->enabled, -1);
-
- gtk_button_set_label (prefs->mail_able, account->enabled ? _("Disable") : _("Enable"));
- }
+ const MailConfigAccount *account;
+ int row;
- if (account) {
+#if USE_ETABLE
+ row = e_table_get_cursor_row (prefs->table);
+#else
+ row = prefs->table->selection ? GPOINTER_TO_INT (prefs->table->selection->data) : -1;
+#endif
+
+ if (row >= 0) {
+#if USE_ETABLE
+ account = e_table_memory_get_data (E_TABLE_MEMORY (prefs->model), row);
+#else
+ account = gtk_clist_get_row_data (prefs->table, row);
+#endif
+
+ account->source->enabled = !account->source->enabled;
+
/* if the account got disabled, remove it from the
folder-tree, otherwise add it to the folder-tree */
if (account->source->url) {
- if (account->enabled)
+ if (account->source->enabled)
mail_load_storage_by_uri (prefs->shell, account->source->url, account->name);
else
mail_remove_storage_by_uri (account->source->url);
}
+#if USE_ETABLE
+
+#else
+ if (account->source->enabled)
+ gtk_clist_set_pixmap (prefs->table, row, 0,
+ prefs->mark_pixmap,
+ prefs->mark_bitmap);
+ else
+ gtk_clist_set_pixmap (prefs->table, row, 0, NULL, NULL);
+
+ gtk_clist_select_row (prefs->table, row, 0);
+#endif
+
mail_autoreceive_setup ();
mail_config_write ();
}
}
+#if USE_ETABLE
static void
-account_able_toggled (GtkCellRendererToggle *renderer, char *arg1, gpointer user_data)
+account_cursor_change (ETable *table, int row, gpointer user_data)
{
MailAccountsTab *prefs = user_data;
- GtkTreeSelection *selection;
- EAccount *account = NULL;
- GtkTreeModel *model;
- GtkTreePath *path;
- GtkTreeIter iter;
-
- path = gtk_tree_path_new_from_string (arg1);
- model = gtk_tree_view_get_model (prefs->table);
- selection = gtk_tree_view_get_selection (prefs->table);
-
- if (gtk_tree_model_get_iter (model, &iter, path)) {
- gtk_tree_model_get (model, &iter, 3, &account, -1);
- account->enabled = !account->enabled;
- gtk_list_store_set ((GtkListStore *) model, &iter, 0, account->enabled, -1);
-
- if (gtk_tree_selection_iter_is_selected (selection, &iter))
- gtk_button_set_label (prefs->mail_able, account->enabled ? _("Disable") : _("Enable"));
- }
-
- gtk_tree_path_free (path);
- if (account) {
- /* if the account got disabled, remove it from the
- folder-tree, otherwise add it to the folder-tree */
- if (account->source->url) {
- if (account->enabled)
- mail_load_storage_by_uri (prefs->shell, account->source->url, account->name);
- else
- mail_remove_storage_by_uri (account->source->url);
- }
+ if (row >= 0) {
+ const MailConfigAccount *account;
- mail_autoreceive_setup ();
+ account = e_table_memory_get_data (E_TABLE_MEMORY (prefs->model), row);
+ if (account->source && account->source->enabled)
+ gtk_label_set_text (GTK_LABEL (GTK_BIN (prefs->mail_able)->child), _("Disable"));
+ else
+ gtk_label_set_text (GTK_LABEL (GTK_BIN (prefs->mail_able)->child), _("Enable"));
- mail_config_write ();
+ gtk_widget_set_sensitive (GTK_WIDGET (prefs->mail_edit), TRUE);
+ gtk_widget_set_sensitive (GTK_WIDGET (prefs->mail_delete), TRUE);
+ gtk_widget_set_sensitive (GTK_WIDGET (prefs->mail_default), TRUE);
+ gtk_widget_set_sensitive (GTK_WIDGET (prefs->mail_able), TRUE);
+ } else {
+ gtk_widget_set_sensitive (GTK_WIDGET (prefs->mail_edit), FALSE);
+ gtk_widget_set_sensitive (GTK_WIDGET (prefs->mail_delete), FALSE);
+ gtk_widget_set_sensitive (GTK_WIDGET (prefs->mail_default), FALSE);
+ gtk_widget_set_sensitive (GTK_WIDGET (prefs->mail_able), FALSE);
+
+ gtk_widget_grab_focus (GTK_WIDGET (prefs->mail_add));
}
}
static void
-account_double_click (GtkTreeView *treeview, GtkTreePath *path,
- GtkTreeViewColumn *column, MailAccountsTab *prefs)
+account_double_click (ETable *table, int row, int col, GdkEvent *event, gpointer user_data)
{
- account_edit_clicked (NULL, prefs);
+ account_edit_clicked (NULL, user_data);
}
-
+#else
static void
-account_cursor_change (GtkTreeSelection *selection, MailAccountsTab *prefs)
+account_cursor_change (GtkCList *table, int row, int column, GdkEventButton *event, gpointer user_data)
{
- EAccount *account = NULL;
- GtkTreeModel *model;
- GtkTreeIter iter;
- int state;
-
- state = gtk_tree_selection_get_selected (selection, &model, &iter);
- if (state) {
- gtk_tree_model_get (model, &iter, 3, &account, -1);
- if (account->source && account->enabled)
- gtk_button_set_label (prefs->mail_able, _("Disable"));
+ MailAccountsTab *prefs = user_data;
+
+ if (row >= 0) {
+ const MailConfigAccount *account;
+
+ account = gtk_clist_get_row_data (prefs->table, row);
+ if (account->source && account->source->enabled)
+ gtk_label_set_text (GTK_LABEL (GTK_BIN (prefs->mail_able)->child), _("Disable"));
else
- gtk_button_set_label (prefs->mail_able, _("Enable"));
+ gtk_label_set_text (GTK_LABEL (GTK_BIN (prefs->mail_able)->child), _("Enable"));
+
+ gtk_widget_set_sensitive (GTK_WIDGET (prefs->mail_edit), TRUE);
+ gtk_widget_set_sensitive (GTK_WIDGET (prefs->mail_delete), TRUE);
+ gtk_widget_set_sensitive (GTK_WIDGET (prefs->mail_default), TRUE);
+ gtk_widget_set_sensitive (GTK_WIDGET (prefs->mail_able), TRUE);
+
+ if (event && event->type == GDK_2BUTTON_PRESS)
+ account_edit_clicked (NULL, user_data);
} else {
+ gtk_widget_set_sensitive (GTK_WIDGET (prefs->mail_edit), FALSE);
+ gtk_widget_set_sensitive (GTK_WIDGET (prefs->mail_delete), FALSE);
+ gtk_widget_set_sensitive (GTK_WIDGET (prefs->mail_default), FALSE);
+ gtk_widget_set_sensitive (GTK_WIDGET (prefs->mail_able), FALSE);
+
gtk_widget_grab_focus (GTK_WIDGET (prefs->mail_add));
}
-
- gtk_widget_set_sensitive (GTK_WIDGET (prefs->mail_edit), state);
- gtk_widget_set_sensitive (GTK_WIDGET (prefs->mail_delete), state);
- gtk_widget_set_sensitive (GTK_WIDGET (prefs->mail_default), state);
- gtk_widget_set_sensitive (GTK_WIDGET (prefs->mail_able), state);
}
+#endif
+
static void
mail_accounts_load (MailAccountsTab *prefs)
{
- EAccount *default_account;
- EAccountList *accounts;
- GtkListStore *model;
- GtkTreeIter iter;
- char *name, *val;
- EIterator *node;
+ const GSList *node;
int row = 0;
- model = (GtkListStore *) gtk_tree_view_get_model (prefs->table);
- gtk_list_store_clear (model);
+#if USE_ETABLE
+ e_table_memory_freeze (E_TABLE_MEMORY (prefs->model));
- default_account = mail_config_get_default_account ();
+ e_table_memory_store_clear (E_TABLE_MEMORY_STORE (prefs->model));
+#else
+ gtk_clist_freeze (prefs->table);
- accounts = mail_config_get_accounts ();
- node = e_list_get_iterator ((EList *) accounts);
- while (e_iterator_is_valid (node)) {
- EAccount *account;
+ gtk_clist_clear (prefs->table);
+#endif
+
+ node = mail_config_get_accounts ();
+ while (node) {
+ const MailConfigAccount *account;
CamelURL *url;
- account = (EAccount *) e_iterator_get (node);
+ account = node->data;
url = account->source && account->source->url ? camel_url_new (account->source->url, NULL) : NULL;
- gtk_list_store_append (model, &iter);
- if (account == default_account) {
- /* translators: default account indicator */
- name = val = g_strdup_printf ("%s %s", account->name, _("[Default]"));
- } else {
- val = account->name;
- name = NULL;
- }
+#if USE_ETABLE
+ e_table_memory_store_insert_list (E_TABLE_MEMORY_STORE (prefs->model),
+ row, GINT_TO_POINTER (account->source->enabled),
+ account->name,
+ url && url->protocol ? url->protocol : U_("None"));
- gtk_list_store_set (model, &iter,
- 0, account->enabled,
- 1, val,
- 2, url && url->protocol ? url->protocol : (char *) _("None"),
- 3, account,
- -1);
- g_free (name);
+ e_table_memory_set_data (E_TABLE_MEMORY (prefs->model), row, (gpointer) account);
+#else
+ {
+ const MailConfigAccount *default_account;
+ char *str, *text[3];
+
+ default_account = mail_config_get_default_account ();
+
+ str = e_utf8_to_gtk_string (GTK_WIDGET (prefs->table), account->name);
+
+ text[0] = NULL;
+ text[1] = g_strdup_printf ("%s%s%s", str, account == default_account ? " " : "",
+ account == default_account ? _("[Default]") : "");
+ text[2] = url && url->protocol ? url->protocol : (char *) _("None");
+
+ gtk_clist_insert (prefs->table, row, text);
+
+ g_free (str);
+ g_free (text[1]);
+
+ if (account->source->enabled)
+ gtk_clist_set_pixmap (prefs->table, row, 0,
+ prefs->mark_pixmap,
+ prefs->mark_bitmap);
+
+ gtk_clist_set_row_data (prefs->table, row, (gpointer) account);
+ }
+#endif
if (url)
camel_url_free (url);
+ node = node->next;
row++;
-
- e_iterator_next (node);
}
- g_object_unref (node);
+#if USE_ETABLE
+ e_table_memory_thaw (E_TABLE_MEMORY (prefs->model));
+#else
+ gtk_clist_thaw (prefs->table);
+#endif
}
-GtkWidget *mail_accounts_treeview_new (char *widget_name, char *string1, char *string2,
- int int1, int int2);
+GtkWidget *mail_accounts_etable_new (char *widget_name, char *string1, char *string2,
+ int int1, int int2);
+#if USE_ETABLE
GtkWidget *
-mail_accounts_treeview_new (char *widget_name, char *string1, char *string2, int int1, int int2)
+mail_accounts_etable_new (char *widget_name, char *string1, char *string2, int int1, int int2)
{
- GtkWidget *table, *scrolled;
- GtkTreeSelection *selection;
- GtkCellRenderer *renderer;
- GtkListStore *model;
+ ETableModel *model;
+ ETableExtras *extras;
+ GdkPixbuf *images[2];
+ ETableMemoryStoreColumnInfo columns[] = {
+ E_TABLE_MEMORY_STORE_INTEGER,
+ E_TABLE_MEMORY_STORE_STRING,
+ E_TABLE_MEMORY_STORE_STRING,
+ E_TABLE_MEMORY_STORE_TERMINATOR,
+ };
- scrolled = gtk_scrolled_window_new (NULL, NULL);
- gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled),
- GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
- gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolled), GTK_SHADOW_IN);
+ extras = e_table_extras_new ();
- renderer = gtk_cell_renderer_toggle_new ();
- g_object_set ((GObject *) renderer, "activatable", TRUE, NULL);
+ images[0] = disabled_pixbuf; /* disabled */
+ images[1] = enabled_pixbuf; /* enabled */
+ e_table_extras_add_cell (extras, "render_able", e_cell_toggle_new (0, 2, images));
- model = gtk_list_store_new (4, G_TYPE_BOOLEAN, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_POINTER);
- table = gtk_tree_view_new_with_model ((GtkTreeModel *) model);
- gtk_tree_view_insert_column_with_attributes ((GtkTreeView *) table, -1, _("Enabled"),
- renderer, "active", 0, NULL);
+ model = e_table_memory_store_new (columns);
- g_object_set_data ((GObject *) scrolled, "renderer", renderer);
+ return e_table_scrolled_new_from_spec_file (model, extras, EVOLUTION_ETSPECDIR "/mail-accounts.etspec", NULL);
+}
+#else
+GtkWidget *
+mail_accounts_etable_new (char *widget_name, char *string1, char *string2, int int1, int int2)
+{
+ GtkWidget *table, *scrolled;
+ char *titles[3];
- renderer = gtk_cell_renderer_text_new ();
- gtk_tree_view_insert_column_with_attributes ((GtkTreeView *) table, -1, _("Account name"),
- renderer, "text", 1, NULL);
- gtk_tree_view_insert_column_with_attributes ((GtkTreeView *)table, -1, _("Protocol"),
- renderer, "text", 2, NULL);
- selection = gtk_tree_view_get_selection ((GtkTreeView *) table);
- gtk_tree_selection_set_mode (selection, GTK_SELECTION_SINGLE);
- gtk_tree_view_set_headers_visible ((GtkTreeView *) table, TRUE);
+ scrolled = gtk_scrolled_window_new (NULL, NULL);
+ gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled),
+ GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
- /* FIXME: column auto-resize? */
- /* Is this needed?
- gtk_tree_view_column_set_alignment (gtk_tree_view_get_column (prefs->table, 0), 1.0);*/
+ titles[0] = _("Enabled");
+ titles[1] = _("Account name");
+ titles[2] = _("Protocol");
+ table = gtk_clist_new_with_titles (3, titles);
+ gtk_clist_set_selection_mode (GTK_CLIST (table), GTK_SELECTION_SINGLE);
+ gtk_clist_column_titles_show (GTK_CLIST (table));
gtk_container_add (GTK_CONTAINER (scrolled), table);
- g_object_set_data ((GObject *) scrolled, "table", table);
+ gtk_object_set_data (GTK_OBJECT (scrolled), "table", table);
gtk_widget_show (scrolled);
gtk_widget_show (table);
return scrolled;
}
+#endif
static void
mail_accounts_tab_construct (MailAccountsTab *prefs)
{
GtkWidget *toplevel, *widget;
- GtkCellRenderer *renderer;
GladeXML *gui;
- gui = glade_xml_new (EVOLUTION_GLADEDIR "/mail-config.glade", "accounts_tab", NULL);
+ gui = glade_xml_new (EVOLUTION_GLADEDIR "/mail-config.glade", "accounts_tab");
prefs->gui = gui;
/* get our toplevel widget */
@@ -527,30 +573,54 @@ mail_accounts_tab_construct (MailAccountsTab *prefs)
widget = glade_xml_get_widget (gui, "etableMailAccounts");
- prefs->table = (GtkTreeView *) g_object_get_data ((GObject *) widget, "table");
- g_signal_connect (gtk_tree_view_get_selection (prefs->table),
- "changed", G_CALLBACK (account_cursor_change), prefs);
- g_signal_connect (prefs->table, "row-activated", G_CALLBACK (account_double_click), prefs);
+#if USE_ETABLE
+ prefs->table = e_table_scrolled_get_table (E_TABLE_SCROLLED (widget));
+ prefs->model = prefs->table->model;
- renderer = g_object_get_data ((GObject *) widget, "renderer");
- g_signal_connect (renderer, "toggled", G_CALLBACK (account_able_toggled), prefs);
+ gtk_signal_connect (GTK_OBJECT (prefs->table), "cursor_change",
+ account_cursor_change, prefs);
+
+ gtk_signal_connect (GTK_OBJECT (prefs->table), "double_click",
+ account_double_click, prefs);
mail_accounts_load (prefs);
+#else
+ prefs->table = GTK_CLIST (gtk_object_get_data (GTK_OBJECT (widget), "table"));
+ gtk_clist_set_column_justification (prefs->table, 0, GTK_JUSTIFY_RIGHT);
+
+ gtk_signal_connect (GTK_OBJECT (prefs->table), "select-row",
+ account_cursor_change, prefs);
+
+ mail_accounts_load (prefs);
+
+ {
+ int col;
+
+ for (col = 0; col < 3; col++) {
+ gtk_clist_set_column_auto_resize (prefs->table, col, TRUE);
+ }
+ }
+#endif
prefs->mail_add = GTK_BUTTON (glade_xml_get_widget (gui, "cmdAccountAdd"));
- g_signal_connect (prefs->mail_add, "clicked", G_CALLBACK (account_add_clicked), prefs);
+ gtk_signal_connect (GTK_OBJECT (prefs->mail_add), "clicked",
+ account_add_clicked, prefs);
prefs->mail_edit = GTK_BUTTON (glade_xml_get_widget (gui, "cmdAccountEdit"));
- g_signal_connect (prefs->mail_edit, "clicked", G_CALLBACK (account_edit_clicked), prefs);
+ gtk_signal_connect (GTK_OBJECT (prefs->mail_edit), "clicked",
+ account_edit_clicked, prefs);
prefs->mail_delete = GTK_BUTTON (glade_xml_get_widget (gui, "cmdAccountDelete"));
- g_signal_connect (prefs->mail_delete, "clicked", G_CALLBACK (account_delete_clicked), prefs);
+ gtk_signal_connect (GTK_OBJECT (prefs->mail_delete), "clicked",
+ account_delete_clicked, prefs);
prefs->mail_default = GTK_BUTTON (glade_xml_get_widget (gui, "cmdAccountDefault"));
- g_signal_connect (prefs->mail_default, "clicked", G_CALLBACK (account_default_clicked), prefs);
+ gtk_signal_connect (GTK_OBJECT (prefs->mail_default), "clicked",
+ account_default_clicked, prefs);
prefs->mail_able = GTK_BUTTON (glade_xml_get_widget (gui, "cmdAccountAble"));
- g_signal_connect (prefs->mail_able, "clicked", G_CALLBACK (account_able_clicked), prefs);
+ gtk_signal_connect (GTK_OBJECT (prefs->mail_able), "clicked",
+ account_able_clicked, prefs);
}
@@ -559,7 +629,7 @@ mail_accounts_tab_new (GNOME_Evolution_Shell shell)
{
MailAccountsTab *new;
- new = (MailAccountsTab *) g_object_new (mail_accounts_tab_get_type (), NULL);
+ new = (MailAccountsTab *) gtk_type_new (mail_accounts_tab_get_type ());
mail_accounts_tab_construct (new);
new->shell = shell;
diff --git a/mail/mail-callbacks.c b/mail/mail-callbacks.c
index d1fbb74957..4850ca79d0 100644
--- a/mail/mail-callbacks.c
+++ b/mail/mail-callbacks.c
@@ -29,24 +29,21 @@
#include <config.h>
#endif
-#include <time.h>
#include <errno.h>
-
-#include <gtkhtml/gtkhtml.h>
-
-#include <gconf/gconf.h>
-#include <gconf/gconf-client.h>
-
-#include <gtk/gtkmessagedialog.h>
-
-#include <libgnomeprint/gnome-print-job.h>
-#include <libgnomeprintui/gnome-print-dialog.h>
-
+#include <time.h>
+#include <libgnome/gnome-paper.h>
+#include <libgnomeui/gnome-stock.h>
+#include <libgnome/gnome-paper.h>
+#include <libgnomeprint/gnome-print-master.h>
+#include <libgnomeprint/gnome-print-master-preview.h>
#include <bonobo/bonobo-widget.h>
#include <bonobo/bonobo-socket.h>
#include <gal/e-table/e-table.h>
+#include <gal/widgets/e-gui-utils.h>
+#include <gal/widgets/e-unicode.h>
#include <e-util/e-dialog-utils.h>
#include <filter/filter-editor.h>
+#include <gtkhtml/gtkhtml.h>
#include "mail.h"
#include "message-browser.h"
@@ -66,6 +63,7 @@
#include "subscribe-dialog.h"
#include "message-tag-editor.h"
#include "message-tag-followup.h"
+#include "e-messagebox.h"
#include "Evolution.h"
#include "evolution-storage.h"
@@ -77,40 +75,6 @@
#define FB_WINDOW(fb) GTK_WINDOW (gtk_widget_get_ancestor (GTK_WIDGET (fb), GTK_TYPE_WINDOW))
-/* default is default gtk response
- if again is != NULL, a checkbox "dont show this again" will appear, and the result stored in *again
-*/
-static gboolean
-e_question (GtkWindow *parent, int def, gboolean *again, const char *fmt, ...)
-{
- GtkWidget *mbox, *check = NULL;
- va_list ap;
- int button;
- char *str;
-
- va_start (ap, fmt);
- str = g_strdup_vprintf (fmt, ap);
- va_end (ap);
- mbox = gtk_message_dialog_new (parent, GTK_DIALOG_DESTROY_WITH_PARENT,
- GTK_MESSAGE_QUESTION, GTK_BUTTONS_YES_NO,
- "%s", str);
- g_free (str);
- gtk_dialog_set_default_response ((GtkDialog *) mbox, def);
- if (again) {
- check = gtk_check_button_new_with_label (_("Don't show this message again."));
- gtk_box_pack_start ((GtkBox *)((GtkDialog *) mbox)->vbox, check, TRUE, TRUE, 10);
- gtk_widget_show (check);
- }
-
- button = gtk_dialog_run ((GtkDialog *) mbox);
- if (again)
- *again = !gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (check));
- gtk_widget_destroy (mbox);
-
- return button == GTK_RESPONSE_YES;
-}
-
-
struct _composer_callback_data {
unsigned int ref_count;
@@ -168,14 +132,14 @@ ccd_unref (struct _composer_callback_data *ccd)
static void
-composer_destroy_cb (gpointer user_data, GObject *deadbeef)
+composer_destroy_cb (GtkWidget *composer, gpointer user_data)
{
ccd_unref (user_data);
}
static void
-druid_destroy_cb (gpointer user_data, GObject *deadbeef)
+druid_destroyed (void)
{
gtk_main_quit ();
}
@@ -184,17 +148,37 @@ static gboolean
configure_mail (FolderBrowser *fb)
{
MailConfigDruid *druid;
+ GtkWidget *dialog;
- if (e_question (FB_WINDOW (fb), GTK_RESPONSE_YES, NULL,
- _("You have not configured the mail client.\n"
- "You need to do this before you can send,\n"
- "receive or compose mail.\n"
- "Would you like to configure it now?"))) {
- druid = mail_config_druid_new ();
- g_object_weak_ref ((GObject *) druid, (GWeakNotify) druid_destroy_cb, NULL);
- gtk_widget_show ((GtkWidget *) druid);
- gtk_grab_add ((GtkWidget *) druid);
+ dialog = gnome_message_box_new (
+ _("You have not configured the mail client.\n"
+ "You need to do this before you can send,\n"
+ "receive or compose mail.\n"
+ "Would you like to configure it now?"),
+ GNOME_MESSAGE_BOX_QUESTION,
+ GNOME_STOCK_BUTTON_YES,
+ GNOME_STOCK_BUTTON_NO, NULL);
+
+ /*
+ * Focus YES
+ */
+ gnome_dialog_set_default (GNOME_DIALOG (dialog), 0);
+ gtk_widget_grab_focus (GTK_WIDGET (GNOME_DIALOG (dialog)->buttons->data));
+
+ e_gnome_dialog_set_parent (GNOME_DIALOG (dialog), FB_WINDOW (fb));
+
+ switch (gnome_dialog_run_and_close (GNOME_DIALOG (dialog))) {
+ case 0:
+ druid = mail_config_druid_new (fb->shell);
+ gtk_signal_connect (GTK_OBJECT (druid), "destroy",
+ GTK_SIGNAL_FUNC (druid_destroyed), NULL);
+ gtk_widget_show (GTK_WIDGET (druid));
+ gtk_grab_add (GTK_WIDGET (druid));
gtk_main ();
+ break;
+ case 1:
+ default:
+ break;
}
return mail_config_is_configured ();
@@ -203,52 +187,69 @@ configure_mail (FolderBrowser *fb)
static gboolean
check_send_configuration (FolderBrowser *fb)
{
- EAccount *account;
+ const MailConfigAccount *account;
- if (!mail_config_is_configured ()) {
- if (fb == NULL) {
- e_notice (NULL, GTK_MESSAGE_WARNING,
- _("You need to configure an account\nbefore you can compose mail."));
- return FALSE;
- }
-
- if (!configure_mail (fb))
- return FALSE;
- }
+ /* Check general */
+ if (!mail_config_is_configured () && !configure_mail (fb))
+ return FALSE;
/* Get the default account */
account = mail_config_get_default_account ();
/* Check for an identity */
if (!account) {
- e_notice (FB_WINDOW (fb), GTK_MESSAGE_WARNING,
- _("You need to configure an identity\nbefore you can compose mail."));
+ GtkWidget *message;
+
+ message = e_gnome_warning_dialog_parented (_("You need to configure an identity\n"
+ "before you can compose mail."),
+ FB_WINDOW (fb));
+
+ gnome_dialog_set_close (GNOME_DIALOG (message), TRUE);
+ gtk_widget_show (message);
+
return FALSE;
}
/* Check for a transport */
- if (!account->transport->url) {
- e_notice (FB_WINDOW (fb), GTK_MESSAGE_WARNING,
- _("You need to configure a mail transport\n"
- "before you can compose mail."));
+ if (!account->transport || !account->transport->url) {
+ GtkWidget *message;
+
+ message = e_gnome_warning_dialog_parented (_("You need to configure a mail transport\n"
+ "before you can compose mail."),
+ GTK_WINDOW (gtk_widget_get_ancestor (GTK_WIDGET (fb),
+ GTK_TYPE_WINDOW)));
+
+ gnome_dialog_set_close (GNOME_DIALOG (message), TRUE);
+ gtk_widget_show (message);
+
return FALSE;
}
return TRUE;
}
+static void
+msgbox_destroyed (GtkWidget *widget, gpointer data)
+{
+ gboolean *show_again = data;
+ GtkWidget *checkbox;
+
+ checkbox = e_message_box_get_checkbox (E_MESSAGE_BOX (widget));
+ *show_again = !gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (checkbox));
+}
+
static gboolean
ask_confirm_for_unwanted_html_mail (EMsgComposer *composer, EDestination **recipients)
{
- gboolean show_again, res;
- GConfClient *gconf;
+ gboolean show_again = TRUE;
GString *str;
- int i;
+ GtkWidget *mbox;
+ int i, button;
- gconf = gconf_client_get_default ();
-
- if (!gconf_client_get_bool (gconf, "/apps/evolution/mail/prompts/unwanted_html", NULL))
+ if (!mail_config_get_confirm_unwanted_html ()) {
+ g_message ("doesn't want to see confirm html messages!");
return TRUE;
+ }
/* FIXME: this wording sucks */
str = g_string_new (_("You are sending an HTML-formatted message. Please make sure that\n"
@@ -256,51 +257,93 @@ ask_confirm_for_unwanted_html_mail (EMsgComposer *composer, EDestination **recip
for (i = 0; recipients[i] != NULL; ++i) {
if (!e_destination_get_html_mail_pref (recipients[i])) {
const char *name;
+ char *buf;
- name = e_destination_get_textrep (recipients[i], FALSE);
+ name = e_destination_get_textrep (recipients[i]);
+ buf = e_utf8_to_locale_string (name);
- g_string_append_printf (str, " %s\n", name);
+ g_string_sprintfa (str, " %s\n", buf);
+ g_free (buf);
}
}
g_string_append (str, _("Send anyway?"));
- res = e_question ((GtkWindow *) composer, GTK_RESPONSE_YES, &show_again, "%s", str->str);
+
+ mbox = e_message_box_new (str->str,
+ E_MESSAGE_BOX_QUESTION,
+ GNOME_STOCK_BUTTON_YES,
+ GNOME_STOCK_BUTTON_NO,
+ NULL);
+
g_string_free (str, TRUE);
- gconf_client_set_bool (gconf, "/apps/evolution/mail/prompts/unwanted_html", show_again, NULL);
+ gtk_signal_connect (GTK_OBJECT (mbox), "destroy",
+ msgbox_destroyed, &show_again);
+
+ button = gnome_dialog_run_and_close (GNOME_DIALOG (mbox));
- return res;
+ if (!show_again) {
+ mail_config_set_confirm_unwanted_html (show_again);
+ g_message ("don't show HTML warning again");
+ }
+
+ if (button == 0)
+ return TRUE;
+ else
+ return FALSE;
}
static gboolean
ask_confirm_for_empty_subject (EMsgComposer *composer)
{
- gboolean show_again, res;
- GConfClient *gconf;
-
- gconf = gconf_client_get_default ();
+ /* FIXME: EMessageBox should really handle this stuff
+ automagically. What Miguel thinks would be nice is to pass
+ in a unique id which could be used as a key in the config
+ file and the value would be an int. -1 for always show or
+ the button pressed otherwise. This probably means we'd have
+ to write e_messagebox_run () */
+ gboolean show_again = TRUE;
+ GtkWidget *mbox;
+ int button;
- if (gconf_client_get_bool (gconf, "/apps/evolution/mail/prompts/empty_subject", NULL))
+ if (!mail_config_get_prompt_empty_subject ())
return TRUE;
- res = e_question ((GtkWindow *) composer, GTK_RESPONSE_YES, &show_again,
- _("This message has no subject.\nReally send?"));
+ mbox = e_message_box_new (_("This message has no subject.\nReally send?"),
+ E_MESSAGE_BOX_QUESTION,
+ GNOME_STOCK_BUTTON_YES,
+ GNOME_STOCK_BUTTON_NO,
+ NULL);
+
+ gtk_signal_connect (GTK_OBJECT (mbox), "destroy",
+ msgbox_destroyed, &show_again);
- gconf_client_set_bool (gconf, "/apps/evolution/mail/prompts/empty_subject", show_again, NULL);
+ button = gnome_dialog_run_and_close (GNOME_DIALOG (mbox));
- return res;
+ mail_config_set_prompt_empty_subject (show_again);
+
+ if (button == 0)
+ return TRUE;
+ else
+ return FALSE;
}
static gboolean
ask_confirm_for_only_bcc (EMsgComposer *composer, gboolean hidden_list_case)
{
- gboolean show_again, res;
+ /* FIXME: EMessageBox should really handle this stuff
+ automagically. What Miguel thinks would be nice is to pass
+ in a message-id which could be used as a key in the config
+ file and the value would be an int. -1 for always show or
+ the button pressed otherwise. This probably means we'd have
+ to write e_messagebox_run () */
+ gboolean show_again = TRUE;
+ GtkWidget *mbox;
+ int button;
const char *first_text;
- GConfClient *gconf;
+ char *message_text;
- gconf = gconf_client_get_default ();
-
- if (!gconf_client_get_bool (gconf, "/apps/evolution/mail/prompts/only_bcc", NULL))
+ if (!mail_config_get_prompt_only_bcc ())
return TRUE;
/* If the user is mailing a hidden contact list, it is possible for
@@ -317,14 +360,29 @@ ask_confirm_for_only_bcc (EMsgComposer *composer, gboolean hidden_list_case)
first_text = _("This message contains only Bcc recipients.");
}
- res = e_question ((GtkWindow *) composer, GTK_RESPONSE_YES, &show_again,
- "%s\n%s", first_text,
- _("It is possible that the mail server may reveal the recipients "
- "by adding an Apparently-To header.\nSend anyway?"));
+ message_text = g_strdup_printf ("%s\n%s", first_text,
+ _("It is possible that the mail server may reveal the recipients "
+ "by adding an Apparently-To header.\nSend anyway?"));
+
+ mbox = e_message_box_new (message_text,
+ E_MESSAGE_BOX_QUESTION,
+ GNOME_STOCK_BUTTON_YES,
+ GNOME_STOCK_BUTTON_NO,
+ NULL);
- gconf_client_set_bool (gconf, "/apps/evolution/mail/prompts/only_bcc", show_again, NULL);
+ gtk_signal_connect (GTK_OBJECT (mbox), "destroy",
+ msgbox_destroyed, &show_again);
- return res;
+ button = gnome_dialog_run_and_close (GNOME_DIALOG (mbox));
+
+ mail_config_set_prompt_only_bcc (show_again);
+
+ g_free (message_text);
+
+ if (button == 0)
+ return TRUE;
+ else
+ return FALSE;
}
@@ -375,20 +433,23 @@ composer_send_queued_cb (CamelFolder *folder, CamelMimeMessage *msg, CamelMessag
ccd = ccd_new ();
/* disconnect the previous signal handlers */
- g_signal_handlers_disconnect_matched(send->composer, G_SIGNAL_MATCH_FUNC, 0,
- 0, NULL, composer_send_cb, NULL);
- g_signal_handlers_disconnect_matched(send->composer, G_SIGNAL_MATCH_FUNC, 0,
- 0, NULL, composer_save_draft_cb, NULL);
+ gtk_signal_disconnect_by_func (GTK_OBJECT (send->composer),
+ GTK_SIGNAL_FUNC (composer_send_cb), NULL);
+ gtk_signal_disconnect_by_func (GTK_OBJECT (send->composer),
+ GTK_SIGNAL_FUNC (composer_save_draft_cb), NULL);
/* reconnect to the signals using a non-NULL ccd for the callback data */
- g_signal_connect (send->composer, "send", G_CALLBACK (composer_send_cb), ccd);
- g_signal_connect (send->composer, "save-draft", G_CALLBACK (composer_save_draft_cb), ccd);
-
- g_object_weak_ref ((GObject *) send->composer, (GWeakNotify) composer_destroy_cb, ccd);
+ gtk_signal_connect (GTK_OBJECT (send->composer), "send",
+ GTK_SIGNAL_FUNC (composer_send_cb), ccd);
+ gtk_signal_connect (GTK_OBJECT (send->composer), "save-draft",
+ GTK_SIGNAL_FUNC (composer_save_draft_cb), ccd);
+ gtk_signal_connect (GTK_OBJECT (send->composer), "destroy",
+ GTK_SIGNAL_FUNC (composer_destroy_cb), ccd);
}
e_msg_composer_set_enable_autosave (send->composer, TRUE);
gtk_widget_show (GTK_WIDGET (send->composer));
+ gtk_object_unref (GTK_OBJECT (send->composer));
}
camel_message_info_free (info);
@@ -402,18 +463,14 @@ composer_send_queued_cb (CamelFolder *folder, CamelMimeMessage *msg, CamelMessag
static CamelMimeMessage *
composer_get_message (EMsgComposer *composer, gboolean post, gboolean save_html_object_data)
{
+ const MailConfigAccount *account;
CamelMimeMessage *message = NULL;
EDestination **recipients, **recipients_bcc;
- gboolean send_html, confirm_html;
CamelInternetAddress *cia;
+ char *subject;
+ int i;
int hidden = 0, shown = 0;
int num = 0, num_bcc = 0;
- const char *subject;
- GConfClient *gconf;
- EAccount *account;
- int i;
-
- gconf = gconf_client_get_default ();
/* We should do all of the validity checks based on the composer, and not on
the created message, as extra interaction may occur when we get the message
@@ -458,7 +515,6 @@ composer_get_message (EMsgComposer *composer, gboolean post, gboolean save_html_
}
}
}
-
e_destination_freev (recipients_bcc);
}
@@ -466,8 +522,15 @@ composer_get_message (EMsgComposer *composer, gboolean post, gboolean save_html_
/* I'm sensing a lack of love, er, I mean recipients. */
if (num == 0 && !post) {
- e_notice ((GtkWindow *) composer, GTK_MESSAGE_WARNING,
- _("You must specify recipients in order to send this message."));
+ GtkWidget *message_box;
+
+ message_box = gnome_message_box_new (_("You must specify recipients in order to "
+ "send this message."),
+ GNOME_MESSAGE_BOX_WARNING,
+ GNOME_STOCK_BUTTON_OK,
+ NULL);
+
+ gnome_dialog_run_and_close (GNOME_DIALOG (message_box));
goto finished;
}
@@ -477,17 +540,15 @@ composer_get_message (EMsgComposer *composer, gboolean post, gboolean save_html_
goto finished;
}
- send_html = gconf_client_get_bool (gconf, "/apps/evolution/mail/composer/send_html", NULL);
- confirm_html = gconf_client_get_bool (gconf, "/apps/evolution/mail/prompts/unwanted_html", NULL);
-
/* Only show this warning if our default is to send html. If it isn't, we've
manually switched into html mode in the composer and (presumably) had a good
reason for doing this. */
- if (e_msg_composer_get_send_html (composer) && send_html && confirm_html) {
+ if (e_msg_composer_get_send_html (composer) && mail_config_get_send_html ()
+ && mail_config_get_confirm_unwanted_html ()) {
gboolean html_problem = FALSE;
if (recipients) {
- for (i = 0; recipients[i] != NULL && !html_problem; i++) {
+ for (i = 0; recipients[i] != NULL && !html_problem; ++i) {
if (!e_destination_get_html_mail_pref (recipients[i]))
html_problem = TRUE;
}
@@ -503,9 +564,12 @@ composer_get_message (EMsgComposer *composer, gboolean post, gboolean save_html_
/* Check for no subject */
subject = e_msg_composer_get_subject (composer);
if (subject == NULL || subject[0] == '\0') {
- if (!ask_confirm_for_empty_subject (composer))
+ if (!ask_confirm_for_empty_subject (composer)) {
+ g_free (subject);
goto finished;
+ }
}
+ g_free (subject);
/* actually get the message now, this will sign/encrypt etc */
message = e_msg_composer_get_message (composer, save_html_object_data);
@@ -543,7 +607,7 @@ got_post_folder (char *uri, CamelFolder *folder, void *data)
*fp = folder;
if (folder)
- camel_object_ref (folder);
+ camel_object_ref (CAMEL_OBJECT (folder));
}
void
@@ -594,7 +658,7 @@ composer_send_cb (EMsgComposer *composer, gpointer user_data)
ccd_ref (send->ccd);
send->send = !post;
send->composer = composer;
- g_object_ref (composer);
+ gtk_object_ref (GTK_OBJECT (composer));
gtk_widget_hide (GTK_WIDGET (composer));
e_msg_composer_set_enable_autosave (composer, FALSE);
@@ -628,14 +692,18 @@ save_draft_done (CamelFolder *folder, CamelMimeMessage *msg, CamelMessageInfo *i
ccd = ccd_new ();
/* disconnect the previous signal handlers */
- g_signal_handlers_disconnect_by_func (sdi->composer, G_CALLBACK (composer_send_cb), NULL);
- g_signal_handlers_disconnect_by_func (sdi->composer, G_CALLBACK (composer_save_draft_cb), NULL);
+ gtk_signal_disconnect_by_func (GTK_OBJECT (sdi->composer),
+ GTK_SIGNAL_FUNC (composer_send_cb), NULL);
+ gtk_signal_disconnect_by_func (GTK_OBJECT (sdi->composer),
+ GTK_SIGNAL_FUNC (composer_save_draft_cb), NULL);
/* reconnect to the signals using a non-NULL ccd for the callback data */
- g_signal_connect (sdi->composer, "send", G_CALLBACK (composer_send_cb), ccd);
- g_signal_connect (sdi->composer, "save-draft", G_CALLBACK (composer_save_draft_cb), ccd);
-
- g_object_weak_ref ((GObject *) sdi->composer, (GWeakNotify) composer_destroy_cb, ccd);
+ gtk_signal_connect (GTK_OBJECT (sdi->composer), "send",
+ GTK_SIGNAL_FUNC (composer_send_cb), ccd);
+ gtk_signal_connect (GTK_OBJECT (sdi->composer), "save-draft",
+ GTK_SIGNAL_FUNC (composer_save_draft_cb), ccd);
+ gtk_signal_connect (GTK_OBJECT (sdi->composer), "destroy",
+ GTK_SIGNAL_FUNC (composer_destroy_cb), ccd);
}
if (ccd->drafts_folder) {
@@ -668,7 +736,7 @@ save_draft_done (CamelFolder *folder, CamelMimeMessage *msg, CamelMessageInfo *i
gtk_widget_destroy (GTK_WIDGET (sdi->composer));
done:
- g_object_unref (sdi->composer);
+ gtk_object_unref (GTK_OBJECT (sdi->composer));
if (sdi->ccd)
ccd_unref (sdi->ccd);
g_free (info);
@@ -683,7 +751,7 @@ use_default_drafts_cb (int reply, gpointer data)
if (reply == 0) {
*folder = drafts_folder;
- camel_object_ref (drafts_folder);
+ camel_object_ref (CAMEL_OBJECT (*folder));
}
}
@@ -694,7 +762,7 @@ save_draft_folder (char *uri, CamelFolder *folder, gpointer data)
if (folder) {
*save = folder;
- camel_object_ref (folder);
+ camel_object_ref (CAMEL_OBJECT (folder));
}
}
@@ -703,11 +771,11 @@ composer_save_draft_cb (EMsgComposer *composer, int quit, gpointer user_data)
{
extern char *default_drafts_folder_uri;
extern CamelFolder *drafts_folder;
- struct _save_draft_info *sdi;
- CamelFolder *folder = NULL;
CamelMimeMessage *msg;
CamelMessageInfo *info;
- EAccount *account;
+ const MailConfigAccount *account;
+ struct _save_draft_info *sdi;
+ CamelFolder *folder = NULL;
account = e_msg_composer_get_preferred_account (composer);
if (account && account->drafts_folder_uri &&
@@ -718,17 +786,18 @@ composer_save_draft_cb (EMsgComposer *composer, int quit, gpointer user_data)
mail_msg_wait (id);
if (!folder) {
- if (!e_question ((GtkWindow *) composer, GTK_RESPONSE_YES, NULL,
- _("Unable to open the drafts folder for this account.\n"
- "Would you like to use the default drafts folder?")))
- return;
+ GtkWidget *dialog;
- folder = drafts_folder;
- camel_object_ref (drafts_folder);
+ dialog = gnome_ok_cancel_dialog_parented (_("Unable to open the drafts folder for this account.\n"
+ "Would you like to use the default drafts folder?"),
+ use_default_drafts_cb, &folder, GTK_WINDOW (composer));
+ gnome_dialog_run_and_close (GNOME_DIALOG (dialog));
+ if (!folder)
+ return;
}
} else {
folder = drafts_folder;
- camel_object_ref (folder);
+ camel_object_ref (CAMEL_OBJECT (folder));
}
msg = e_msg_composer_get_message_draft (composer);
@@ -738,32 +807,31 @@ composer_save_draft_cb (EMsgComposer *composer, int quit, gpointer user_data)
sdi = g_malloc (sizeof (struct _save_draft_info));
sdi->composer = composer;
- g_object_ref (composer);
+ gtk_object_ref (GTK_OBJECT (composer));
sdi->ccd = user_data;
if (sdi->ccd)
ccd_ref (sdi->ccd);
sdi->quit = quit;
mail_append_mail (folder, msg, info, save_draft_done, sdi);
- camel_object_unref (folder);
- camel_object_unref (msg);
+ camel_object_unref (CAMEL_OBJECT (folder));
+ camel_object_unref (CAMEL_OBJECT (msg));
}
static GtkWidget *
-create_msg_composer (EAccount *account, gboolean post, const char *url)
+create_msg_composer (const MailConfigAccount *account, gboolean post, const char *url)
{
EMsgComposer *composer;
- GConfClient *gconf;
gboolean send_html;
/* Make sure that we've actually been passed in an account. If one has
* not been passed in, grab the default account.
*/
- if (account == NULL)
+ if (account == NULL) {
account = mail_config_get_default_account ();
+ }
- gconf = gconf_client_get_default ();
- send_html = gconf_client_get_bool (gconf, "/apps/evolution/mail/composer/send_html", NULL);
+ send_html = mail_config_get_send_html ();
if (post)
composer = e_msg_composer_new_post ();
@@ -785,10 +853,10 @@ create_msg_composer (EAccount *account, gboolean post, const char *url)
void
compose_msg (GtkWidget *widget, gpointer user_data)
{
+ const MailConfigAccount *account;
FolderBrowser *fb = FOLDER_BROWSER (user_data);
struct _composer_callback_data *ccd;
GtkWidget *composer;
- EAccount *account;
if (FOLDER_BROWSER_IS_DESTROYED (fb) || !check_send_configuration (fb))
return;
@@ -802,10 +870,12 @@ compose_msg (GtkWidget *widget, gpointer user_data)
ccd = ccd_new ();
- g_signal_connect (composer, "send", G_CALLBACK (composer_send_cb), ccd);
- g_signal_connect (composer, "save-draft", G_CALLBACK (composer_save_draft_cb), ccd);
-
- g_object_weak_ref ((GObject *) composer, (GWeakNotify) composer_destroy_cb, ccd);
+ gtk_signal_connect (GTK_OBJECT (composer), "send",
+ GTK_SIGNAL_FUNC (composer_send_cb), ccd);
+ gtk_signal_connect (GTK_OBJECT (composer), "save-draft",
+ GTK_SIGNAL_FUNC (composer_save_draft_cb), ccd);
+ gtk_signal_connect (GTK_OBJECT (composer), "destroy",
+ GTK_SIGNAL_FUNC (composer_destroy_cb), ccd);
gtk_widget_show (composer);
}
@@ -816,7 +886,7 @@ send_to_url (const char *url, const char *parent_uri)
{
struct _composer_callback_data *ccd;
GtkWidget *composer;
- EAccount *account = NULL;
+ MailConfigAccount *account = NULL;
/* FIXME: no way to get folder browser? Not without
* big pain in the ass, as far as I can tell */
@@ -833,20 +903,22 @@ send_to_url (const char *url, const char *parent_uri)
ccd = ccd_new ();
- g_signal_connect (composer, "send", G_CALLBACK (composer_send_cb), ccd);
- g_signal_connect (composer, "save-draft", G_CALLBACK (composer_save_draft_cb), ccd);
-
- g_object_weak_ref ((GObject *) composer, (GWeakNotify) composer_destroy_cb, ccd);
+ gtk_signal_connect (GTK_OBJECT (composer), "send",
+ GTK_SIGNAL_FUNC (composer_send_cb), ccd);
+ gtk_signal_connect (GTK_OBJECT (composer), "save-draft",
+ GTK_SIGNAL_FUNC (composer_save_draft_cb), ccd);
+ gtk_signal_connect (GTK_OBJECT (composer), "destroy",
+ GTK_SIGNAL_FUNC (composer_destroy_cb), ccd);
gtk_widget_show (composer);
}
static GList *
list_add_addresses (GList *list, const CamelInternetAddress *cia, GHashTable *account_hash,
- GHashTable *rcpt_hash, EAccount **me)
+ GHashTable *rcpt_hash, const MailConfigAccount **me)
{
+ const MailConfigAccount *account;
const char *name, *addr;
- EAccount *account;
int i;
for (i = 0; camel_internet_address_get (cia, i, &name, &addr); i++) {
@@ -872,10 +944,10 @@ list_add_addresses (GList *list, const CamelInternetAddress *cia, GHashTable *ac
return list;
}
-static EAccount *
+static const MailConfigAccount *
guess_me (const CamelInternetAddress *to, const CamelInternetAddress *cc, GHashTable *account_hash)
{
- EAccount *account = NULL;
+ const MailConfigAccount *account = NULL;
const char *addr;
int i;
@@ -904,12 +976,12 @@ guess_me (const CamelInternetAddress *to, const CamelInternetAddress *cc, GHashT
return account;
}
-static EAccount *
-guess_me_from_accounts (const CamelInternetAddress *to, const CamelInternetAddress *cc, EAccountList *accounts)
+static const MailConfigAccount *
+guess_me_from_accounts (const CamelInternetAddress *to, const CamelInternetAddress *cc, const GSList *accounts)
{
- EAccount *account, *def;
+ const MailConfigAccount *account, *def;
GHashTable *account_hash;
- EIterator *iter;
+ const GSList *l;
account_hash = g_hash_table_new (g_strcase_hash, g_strcase_equal);
@@ -919,12 +991,12 @@ guess_me_from_accounts (const CamelInternetAddress *to, const CamelInternetAddre
g_hash_table_insert (account_hash, (char *) def->id->address, (void *) def);
}
- iter = e_list_get_iterator ((EList *) accounts);
- while (e_iterator_is_valid (iter)) {
- account = (EAccount *) e_iterator_get (iter);
+ l = accounts;
+ while (l) {
+ account = l->data;
if (account->id->address) {
- EAccount *acnt;
+ const MailConfigAccount *acnt;
/* Accounts with identical email addresses that are enabled
* take precedence over the accounts that aren't. If all
@@ -933,7 +1005,7 @@ guess_me_from_accounts (const CamelInternetAddress *to, const CamelInternetAddre
* account always takes precedence no matter what.
*/
acnt = g_hash_table_lookup (account_hash, account->id->address);
- if (acnt && acnt != def && !acnt->enabled && account->enabled) {
+ if (acnt && acnt != def && !acnt->source->enabled && account->source->enabled) {
g_hash_table_remove (account_hash, acnt->id->address);
acnt = NULL;
}
@@ -942,11 +1014,9 @@ guess_me_from_accounts (const CamelInternetAddress *to, const CamelInternetAddre
g_hash_table_insert (account_hash, (char *) account->id->address, (void *) account);
}
- e_iterator_next (iter);
+ l = l->next;
}
- g_object_unref (iter);
-
account = guess_me (to, cc, account_hash);
g_hash_table_destroy (account_hash);
@@ -981,22 +1051,18 @@ mail_generate_reply (CamelFolder *folder, CamelMimeMessage *message, const char
const CamelInternetAddress *reply_to, *sender, *to_addrs, *cc_addrs;
const char *name = NULL, *address = NULL, *source = NULL;
const char *message_id, *references, *mlist = NULL;
- char *text = NULL, *subject, format[256];
- EAccount *def, *account, *me = NULL;
- EAccountList *accounts = NULL;
+ char *text = NULL, *subject, date_str[100], *format;
+ const MailConfigAccount *def, *account, *me = NULL;
+ const GSList *l, *accounts = NULL;
GHashTable *account_hash = NULL;
CamelMessageInfo *info = NULL;
GList *to = NULL, *cc = NULL;
EDestination **tov, **ccv;
EMsgComposer *composer;
CamelMimePart *part;
- GConfClient *gconf;
- EIterator *iter;
time_t date;
char *url;
- gconf = gconf_client_get_default ();
-
if (mode == REPLY_POST) {
composer = e_msg_composer_new_post ();
if (composer != NULL) {
@@ -1022,12 +1088,12 @@ mail_generate_reply (CamelFolder *folder, CamelMimeMessage *message, const char
g_hash_table_insert (account_hash, (char *) def->id->address, (void *) def);
}
- iter = e_list_get_iterator ((EList *) accounts);
- while (e_iterator_is_valid (iter)) {
- account = (EAccount *) e_iterator_get (iter);
+ l = accounts;
+ while (l) {
+ account = l->data;
if (account->id->address) {
- EAccount *acnt;
+ const MailConfigAccount *acnt;
/* Accounts with identical email addresses that are enabled
* take precedence over the accounts that aren't. If all
@@ -1036,7 +1102,7 @@ mail_generate_reply (CamelFolder *folder, CamelMimeMessage *message, const char
* account always takes precedence no matter what.
*/
acnt = g_hash_table_lookup (account_hash, account->id->address);
- if (acnt && acnt != def && !acnt->enabled && account->enabled) {
+ if (acnt && acnt != def && !acnt->source->enabled && account->source->enabled) {
g_hash_table_remove (account_hash, acnt->id->address);
acnt = NULL;
}
@@ -1045,11 +1111,9 @@ mail_generate_reply (CamelFolder *folder, CamelMimeMessage *message, const char
g_hash_table_insert (account_hash, (char *) account->id->address, (void *) account);
}
- e_iterator_next (iter);
+ l = l->next;
}
- g_object_unref (iter);
-
to_addrs = camel_mime_message_get_recipients (message, CAMEL_RECIPIENT_TYPE_TO);
cc_addrs = camel_mime_message_get_recipients (message, CAMEL_RECIPIENT_TYPE_CC);
mail_ignore_address (composer, to_addrs);
@@ -1076,7 +1140,7 @@ mail_generate_reply (CamelFolder *folder, CamelMimeMessage *message, const char
max = camel_address_length (CAMEL_ADDRESS (to_addrs));
for (i = 0; i < max; i++) {
camel_internet_address_get (to_addrs, i, &name, &address);
- if (!strcasecmp (address, mlist))
+ if (!g_strcasecmp (address, mlist))
break;
}
@@ -1084,7 +1148,7 @@ mail_generate_reply (CamelFolder *folder, CamelMimeMessage *message, const char
max = camel_address_length (CAMEL_ADDRESS (cc_addrs));
for (i = 0; i < max; i++) {
camel_internet_address_get (cc_addrs, i, &name, &address);
- if (!strcasecmp (address, mlist))
+ if (!g_strcasecmp (address, mlist))
break;
}
}
@@ -1167,7 +1231,7 @@ mail_generate_reply (CamelFolder *folder, CamelMimeMessage *message, const char
}
/* set body text here as we want all ignored words to take effect */
- switch (gconf_client_get_int (gconf, "/apps/evolution/mail/format/reply_style", NULL)) {
+ switch (mail_config_get_default_reply_style ()) {
case MAIL_CONFIG_REPLY_DO_NOT_QUOTE:
/* do nothing */
break;
@@ -1175,7 +1239,7 @@ mail_generate_reply (CamelFolder *folder, CamelMimeMessage *message, const char
/* attach the original message as an attachment */
part = mail_tool_make_message_attachment (message);
e_msg_composer_attach (composer, part);
- camel_object_unref (part);
+ camel_object_unref (CAMEL_OBJECT (part));
break;
case MAIL_CONFIG_REPLY_QUOTED:
default:
@@ -1188,9 +1252,12 @@ mail_generate_reply (CamelFolder *folder, CamelMimeMessage *message, const char
}
date = camel_mime_message_get_date (message, NULL);
- strftime (format, sizeof (format), _("On %a, %Y-%m-%d at %H:%M, %%s wrote:"), localtime (&date));
+ strftime (date_str, sizeof (date_str), _("On %a, %Y-%m-%d at %H:%M, %%s wrote:"),
+ localtime (&date));
+ format = e_utf8_from_locale_string (date_str);
text = mail_tool_quote_message (message, format, name && *name ? name : address);
mail_ignore (composer, name, address);
+ g_free (format);
if (text) {
e_msg_composer_set_body_text (composer, text);
g_free (text);
@@ -1203,7 +1270,7 @@ mail_generate_reply (CamelFolder *folder, CamelMimeMessage *message, const char
if (!subject)
subject = g_strdup ("");
else {
- if (!strncasecmp (subject, "Re: ", 4))
+ if (!g_strncasecmp (subject, "Re: ", 4))
subject = g_strndup (subject, MAX_SUBJECT_LEN);
else {
if (strlen (subject) < MAX_SUBJECT_LEN) {
@@ -1298,10 +1365,12 @@ mail_reply (CamelFolder *folder, CamelMimeMessage *msg, const char *uid, int mod
ccd->flags |= CAMEL_MESSAGE_ANSWERED_ALL;
ccd->set = ccd->flags;
- g_signal_connect (composer, "send", G_CALLBACK (composer_send_cb), ccd);
- g_signal_connect (composer, "save-draft", G_CALLBACK (composer_save_draft_cb), ccd);
-
- g_object_weak_ref ((GObject *) composer, (GWeakNotify) composer_destroy_cb, ccd);
+ gtk_signal_connect (GTK_OBJECT (composer), "send",
+ GTK_SIGNAL_FUNC (composer_send_cb), ccd);
+ gtk_signal_connect (GTK_OBJECT (composer), "save-draft",
+ GTK_SIGNAL_FUNC (composer_save_draft_cb), ccd);
+ gtk_signal_connect (GTK_OBJECT (composer), "destroy",
+ GTK_SIGNAL_FUNC (composer_destroy_cb), ccd);
gtk_widget_show (GTK_WIDGET (composer));
e_msg_composer_unset_changed (composer);
@@ -1352,13 +1421,13 @@ enumerate_msg (MessageList *ml, const char *uid, gpointer data)
static EMsgComposer *
forward_get_composer (CamelMimeMessage *message, const char *subject)
{
+ const MailConfigAccount *account = NULL;
struct _composer_callback_data *ccd;
- EAccount *account = NULL;
EMsgComposer *composer;
if (message) {
const CamelInternetAddress *to_addrs, *cc_addrs;
- EAccountList *accounts;
+ const GSList *accounts = NULL;
accounts = mail_config_get_accounts ();
to_addrs = camel_mime_message_get_recipients (message, CAMEL_RECIPIENT_TYPE_TO);
@@ -1381,10 +1450,12 @@ forward_get_composer (CamelMimeMessage *message, const char *subject)
if (composer) {
ccd = ccd_new ();
- g_signal_connect (composer, "send", G_CALLBACK (composer_send_cb), ccd);
- g_signal_connect (composer, "save-draft", G_CALLBACK (composer_save_draft_cb), ccd);
-
- g_object_weak_ref ((GObject *) composer, (GWeakNotify) composer_destroy_cb, ccd);
+ gtk_signal_connect (GTK_OBJECT (composer), "send",
+ GTK_SIGNAL_FUNC (composer_send_cb), ccd);
+ gtk_signal_connect (GTK_OBJECT (composer), "save-draft",
+ GTK_SIGNAL_FUNC (composer_save_draft_cb), ccd);
+ gtk_signal_connect (GTK_OBJECT (composer), "destroy",
+ GTK_SIGNAL_FUNC (composer_destroy_cb), ccd);
e_msg_composer_set_headers (composer, account->name, NULL, NULL, NULL, subject);
} else {
@@ -1495,11 +1566,7 @@ forward_attached (GtkWidget *widget, gpointer user_data)
void
forward (GtkWidget *widget, gpointer user_data)
{
- MailConfigForwardStyle style;
- GConfClient *gconf;
-
- gconf = gconf_client_get_default ();
- style = gconf_client_get_int (gconf, "/apps/evolution/mail/format/forward_style", NULL);
+ MailConfigForwardStyle style = mail_config_get_default_forward_style ();
if (style == MAIL_CONFIG_FORWARD_ATTACHED)
forward_attached (widget, user_data);
@@ -1513,7 +1580,7 @@ post_to_url (const char *url)
{
struct _composer_callback_data *ccd;
GtkWidget *composer;
- EAccount *account = NULL;
+ MailConfigAccount *account = NULL;
/* FIXME: no way to get folder browser? Not without
* big pain in the ass, as far as I can tell */
@@ -1531,10 +1598,12 @@ post_to_url (const char *url)
ccd = ccd_new ();
- g_signal_connect (composer, "send", G_CALLBACK (composer_send_cb), ccd);
- g_signal_connect (composer, "save-draft", G_CALLBACK (composer_save_draft_cb), ccd);
-
- g_object_weak_ref ((GObject *) composer, (GWeakNotify) composer_destroy_cb, ccd);
+ gtk_signal_connect (GTK_OBJECT (composer), "send",
+ GTK_SIGNAL_FUNC (composer_send_cb), ccd);
+ gtk_signal_connect (GTK_OBJECT (composer), "save-draft",
+ GTK_SIGNAL_FUNC (composer_save_draft_cb), ccd);
+ gtk_signal_connect (GTK_OBJECT (composer), "destroy",
+ GTK_SIGNAL_FUNC (composer_destroy_cb), ccd);
gtk_widget_show (composer);
}
@@ -1568,10 +1637,10 @@ post_reply (GtkWidget *widget, gpointer user_data)
static EMsgComposer *
redirect_get_composer (CamelMimeMessage *message)
{
+ const MailConfigAccount *account = NULL;
const CamelInternetAddress *to_addrs, *cc_addrs;
+ const GSList *accounts = NULL;
struct _composer_callback_data *ccd;
- EAccountList *accounts = NULL;
- EAccount *account = NULL;
EMsgComposer *composer;
g_return_val_if_fail (CAMEL_IS_MIME_MESSAGE (message), NULL);
@@ -1602,10 +1671,12 @@ redirect_get_composer (CamelMimeMessage *message)
if (composer) {
ccd = ccd_new ();
- g_signal_connect (composer, "send", G_CALLBACK (composer_send_cb), ccd);
- g_signal_connect (composer, "save-draft", G_CALLBACK (composer_save_draft_cb), ccd);
-
- g_object_weak_ref ((GObject *) composer, (GWeakNotify) composer_destroy_cb, ccd);
+ gtk_signal_connect (GTK_OBJECT (composer), "send",
+ GTK_SIGNAL_FUNC (composer_send_cb), ccd);
+ gtk_signal_connect (GTK_OBJECT (composer), "save-draft",
+ GTK_SIGNAL_FUNC (composer_save_draft_cb), ccd);
+ gtk_signal_connect (GTK_OBJECT (composer), "destroy",
+ GTK_SIGNAL_FUNC (composer_destroy_cb), ccd);
} else {
g_warning ("Could not create composer");
}
@@ -1654,20 +1725,16 @@ static void
transfer_msg_done (gboolean ok, void *data)
{
FolderBrowser *fb = data;
- gboolean hide_deleted;
- GConfClient *gconf;
int row;
if (ok && !FOLDER_BROWSER_IS_DESTROYED (fb)) {
- gconf = gconf_client_get_default ();
- hide_deleted = !gconf_client_get_bool (gconf, "/apps/evolution/mail/display/show_deleted", NULL);
-
row = e_tree_row_of_node (fb->message_list->tree,
e_tree_get_cursor (fb->message_list->tree));
/* If this is the last message and deleted messages
are hidden, select the previous */
- if ((row + 1 == e_tree_row_count (fb->message_list->tree)) && hide_deleted)
+ if ((row + 1 == e_tree_row_count (fb->message_list->tree))
+ && mail_config_get_hide_deleted ())
message_list_select (fb->message_list, MESSAGE_LIST_SELECT_PREVIOUS,
0, CAMEL_MESSAGE_DELETED, FALSE);
else
@@ -1675,7 +1742,7 @@ transfer_msg_done (gboolean ok, void *data)
0, 0, FALSE);
}
- g_object_unref (fb);
+ gtk_object_unref (GTK_OBJECT (fb));
}
static void
@@ -1715,7 +1782,7 @@ transfer_msg (FolderBrowser *fb, gboolean delete_from_source)
message_list_foreach (fb->message_list, enumerate_msg, uids);
if (delete_from_source) {
- g_object_ref (fb);
+ gtk_object_ref (GTK_OBJECT (fb));
mail_transfer_messages (fb->folder, uids, delete_from_source,
folder->physicalUri, 0,
transfer_msg_done, fb);
@@ -1723,7 +1790,6 @@ transfer_msg (FolderBrowser *fb, gboolean delete_from_source)
mail_transfer_messages (fb->folder, uids, delete_from_source,
folder->physicalUri, 0, NULL, NULL);
}
-
CORBA_free (folder);
}
@@ -1757,7 +1823,7 @@ find_socket (GtkContainer *container)
{
GList *children, *tmp;
- children = gtk_container_get_children (container);
+ children = gtk_container_children (container);
while (children) {
if (BONOBO_IS_SOCKET (children->data))
return children->data;
@@ -1770,14 +1836,13 @@ find_socket (GtkContainer *container)
g_list_free_1 (children);
children = tmp;
}
-
- return NULL;
+ return NULL;
}
static void
popup_listener_cb (BonoboListener *listener,
- const char *event_name,
- const CORBA_any *any,
+ char *event_name,
+ CORBA_any *any,
CORBA_Environment *ev,
gpointer user_data)
{
@@ -1801,17 +1866,18 @@ addrbook_sender (GtkWidget *widget, gpointer user_data)
GtkWidget *socket;
GPtrArray *uids;
int i;
-
+
if (FOLDER_BROWSER_IS_DESTROYED (fb))
return;
-
- uids = g_ptr_array_new ();
- message_list_foreach (fb->message_list, enumerate_msg, uids);
+
+ uids = g_ptr_array_new();
+ message_list_foreach(fb->message_list, enumerate_msg, uids);
if (uids->len != 1)
goto done;
-
- info = camel_folder_get_message_info (fb->folder, uids->pdata[0]);
- if (info == NULL || (addr_str = camel_message_info_from (info)) == NULL)
+
+ info = camel_folder_get_message_info(fb->folder, uids->pdata[0]);
+ if (info == NULL
+ || (addr_str = camel_message_info_from(info)) == NULL)
goto done;
win = gtk_window_new (GTK_WINDOW_TOPLEVEL);
@@ -1820,23 +1886,25 @@ addrbook_sender (GtkWidget *widget, gpointer user_data)
control = bonobo_widget_new_control ("OAFIID:GNOME_Evolution_Addressbook_AddressPopup",
CORBA_OBJECT_NIL);
bonobo_widget_set_property (BONOBO_WIDGET (control),
- "email", TC_CORBA_string, addr_str,
+ "email", addr_str,
NULL);
bonobo_event_source_client_add_listener (bonobo_widget_get_objref (BONOBO_WIDGET (control)),
popup_listener_cb, NULL, NULL, win);
socket = find_socket (GTK_CONTAINER (control));
-
- g_object_weak_ref ((GObject *) socket, (GWeakNotify) gtk_widget_destroy, win);
+ gtk_signal_connect_object (GTK_OBJECT (socket),
+ "destroy",
+ GTK_SIGNAL_FUNC (gtk_widget_destroy),
+ GTK_OBJECT (win));
gtk_container_add (GTK_CONTAINER (win), control);
gtk_widget_show_all (win);
done:
- for (i = 0; i < uids->len; i++)
- g_free (uids->pdata[i]);
- g_ptr_array_free (uids, TRUE);
+ for (i=0; i < uids->len; i++)
+ g_free(uids->pdata[i]);
+ g_ptr_array_free(uids, TRUE);
}
void
@@ -1984,7 +2052,6 @@ flag_messages (FolderBrowser *fb, guint32 mask, guint32 set)
camel_folder_set_message_flags (fb->folder, uids->pdata[i], mask, set);
g_free (uids->pdata[i]);
}
-
camel_folder_thaw (fb->folder);
g_ptr_array_free (uids, TRUE);
@@ -2009,13 +2076,13 @@ toggle_flags (FolderBrowser *fb, guint32 mask)
guint32 flags;
flags = ~(camel_folder_get_message_flags (fb->folder, uids->pdata[i]));
-
+
/* if we're flagging a message important, always undelete it too */
if (mask & flags & CAMEL_MESSAGE_FLAGGED) {
flags &= ~CAMEL_MESSAGE_DELETED;
mask |= CAMEL_MESSAGE_DELETED;
}
-
+
/* if we're flagging a message deleted, mark it seen. If
* we're undeleting it, we also want it to be seen, so always do this.
*/
@@ -2023,9 +2090,9 @@ toggle_flags (FolderBrowser *fb, guint32 mask)
flags |= CAMEL_MESSAGE_SEEN;
mask |= CAMEL_MESSAGE_SEEN;
}
-
+
camel_folder_set_message_flags (fb->folder, uids->pdata[i], mask, flags);
-
+
g_free (uids->pdata[i]);
}
camel_folder_thaw (fb->folder);
@@ -2051,7 +2118,7 @@ mark_as_unseen (BonoboUIComponent *uih, void *user_data, const char *path)
/* Remove the automatic mark-as-read timer first */
if (fb->seen_id) {
- g_source_remove (fb->seen_id);
+ gtk_timeout_remove (fb->seen_id);
fb->seen_id = 0;
}
@@ -2102,33 +2169,51 @@ struct _tag_editor_data {
};
static void
-tag_editor_response(GtkWidget *gd, int button, struct _tag_editor_data *data)
+tag_editor_ok (GtkWidget *button, gpointer user_data)
{
+ struct _tag_editor_data *data = user_data;
CamelFolder *folder;
CamelTag *tags, *t;
GPtrArray *uids;
int i;
-
- /*if (FOLDER_BROWSER_IS_DESTROYED (data->fb))
- goto done;*/
-
- if (button == GTK_RESPONSE_OK
- && (tags = message_tag_editor_get_tag_list (data->editor))) {
- folder = data->fb->folder;
- uids = data->uids;
- camel_folder_freeze (folder);
- for (i = 0; i < uids->len; i++) {
- for (t = tags; t; t = t->next)
- camel_folder_set_message_user_tag (folder, uids->pdata[i], t->name, t->value);
- }
- camel_folder_thaw (folder);
- camel_tag_list_free (&tags);
+ if (FOLDER_BROWSER_IS_DESTROYED (data->fb))
+ goto done;
+
+ tags = message_tag_editor_get_tag_list (data->editor);
+ if (tags == NULL)
+ goto done;
+
+ folder = data->fb->folder;
+ uids = data->uids;
+
+ camel_folder_freeze (folder);
+ for (i = 0; i < uids->len; i++) {
+ for (t = tags; t; t = t->next)
+ camel_folder_set_message_user_tag (folder, uids->pdata[i], t->name, t->value);
}
+ camel_folder_thaw (folder);
+
+ camel_tag_list_free (&tags);
+
+ done:
+ gtk_widget_destroy (GTK_WIDGET (data->editor));
+}
- gtk_widget_destroy(gd);
+static void
+tag_editor_cancel (GtkWidget *button, gpointer user_data)
+{
+ struct _tag_editor_data *data = user_data;
+
+ gtk_widget_destroy (GTK_WIDGET (data->editor));
+}
- g_object_unref (data->fb);
+static void
+tag_editor_destroy (GnomeDialog *dialog, gpointer user_data)
+{
+ struct _tag_editor_data *data = user_data;
+
+ gtk_object_unref (GTK_OBJECT (data->fb));
g_ptr_array_free (data->uids, TRUE);
g_free (data);
}
@@ -2164,8 +2249,10 @@ flag_for_followup (BonoboUIComponent *uih, void *user_data, const char *path)
camel_message_info_from (info),
camel_message_info_subject (info));
}
-
- g_signal_connect(editor, "response", G_CALLBACK(tag_editor_response), data);
+
+ gnome_dialog_button_connect (GNOME_DIALOG (editor), 0, tag_editor_ok, data);
+ gnome_dialog_button_connect (GNOME_DIALOG (editor), 1, tag_editor_cancel, data);
+ gnome_dialog_set_close (GNOME_DIALOG (editor), TRUE);
/* special-case... */
if (uids->len == 1) {
@@ -2179,6 +2266,9 @@ flag_for_followup (BonoboUIComponent *uih, void *user_data, const char *path)
}
}
+ gtk_signal_connect (GTK_OBJECT (editor), "destroy",
+ tag_editor_destroy, data);
+
gtk_widget_show (editor);
}
@@ -2299,10 +2389,12 @@ do_edit_messages (CamelFolder *folder, GPtrArray *uids, GPtrArray *messages, voi
ccd->drafts_uid = g_strdup (uids->pdata[i]);
}
- g_signal_connect (composer, "send", G_CALLBACK (composer_send_cb), ccd);
- g_signal_connect (composer, "save-draft", G_CALLBACK (composer_save_draft_cb), ccd);
-
- g_object_weak_ref ((GObject *) composer, (GWeakNotify) composer_destroy_cb, ccd);
+ gtk_signal_connect (GTK_OBJECT (composer), "send",
+ GTK_SIGNAL_FUNC (composer_send_cb), ccd);
+ gtk_signal_connect (GTK_OBJECT (composer), "save-draft",
+ GTK_SIGNAL_FUNC (composer_save_draft_cb), ccd);
+ gtk_signal_connect (GTK_OBJECT (composer), "destroy",
+ GTK_SIGNAL_FUNC (composer_destroy_cb), ccd);
gtk_widget_show (GTK_WIDGET (composer));
}
@@ -2313,21 +2405,19 @@ static gboolean
are_you_sure (const char *msg, GPtrArray *uids, FolderBrowser *fb)
{
GtkWidget *dialog;
+ char *buf;
int button, i;
-
- dialog = gtk_message_dialog_new (FB_WINDOW (fb), GTK_DIALOG_MODAL|GTK_DIALOG_DESTROY_WITH_PARENT,
- GTK_MESSAGE_QUESTION, GTK_BUTTONS_OK_CANCEL,
- msg, uids->len);
- button = gtk_dialog_run ((GtkDialog *) dialog);
- gtk_widget_destroy (dialog);
- if (button != GTK_RESPONSE_OK) {
+ buf = g_strdup_printf (msg, uids->len);
+ dialog = e_gnome_ok_cancel_dialog_parented (buf, NULL, NULL, FB_WINDOW (fb));
+ button = gnome_dialog_run_and_close (GNOME_DIALOG (dialog));
+ if (button != 0) {
for (i = 0; i < uids->len; i++)
g_free (uids->pdata[i]);
g_ptr_array_free (uids, TRUE);
}
- return button == GTK_RESPONSE_OK;
+ return button == 0;
}
static void
@@ -2341,8 +2431,16 @@ edit_msg_internal (FolderBrowser *fb)
uids = g_ptr_array_new ();
message_list_foreach (fb->message_list, enumerate_msg, uids);
- if (uids->len > 10 && !are_you_sure (_("Are you sure you want to edit all %d messages?"), uids, fb))
+ if (uids->len > 10 && !are_you_sure (_("Are you sure you want to edit all %d messages?"), uids, fb)) {
+ int i;
+
+ for (i = 0; i < uids->len; i++)
+ g_free (uids->pdata[i]);
+
+ g_ptr_array_free (uids, TRUE);
+
return;
+ }
mail_get_messages (fb->folder, uids, do_edit_messages, fb);
}
@@ -2356,8 +2454,13 @@ edit_msg (GtkWidget *widget, gpointer user_data)
return;
if (!folder_browser_is_drafts (fb)) {
- e_notice(FB_WINDOW(fb), GTK_MESSAGE_ERROR,
- _("You may only edit messages saved\nin the Drafts folder."));
+ GtkWidget *dialog;
+
+ dialog = gnome_warning_dialog_parented (_("You may only edit messages saved\n"
+ "in the Drafts folder."),
+ FB_WINDOW (fb));
+ gnome_dialog_set_close (GNOME_DIALOG (dialog), TRUE);
+ gtk_widget_show (dialog);
return;
}
@@ -2379,6 +2482,7 @@ do_resend_messages (CamelFolder *folder, GPtrArray *uids, GPtrArray *messages, v
}
+
void
resend_msg (GtkWidget *widget, gpointer user_data)
{
@@ -2389,8 +2493,13 @@ resend_msg (GtkWidget *widget, gpointer user_data)
return;
if (!folder_browser_is_sent (fb)) {
- e_notice (FB_WINDOW (fb), GTK_MESSAGE_ERROR,
- _("You may only resend messages\nin the Sent folder."));
+ GtkWidget *dialog;
+
+ dialog = gnome_warning_dialog_parented (_("You may only resend messages\n"
+ "in the Sent folder."),
+ FB_WINDOW (fb));
+ gnome_dialog_set_close (GNOME_DIALOG (dialog), TRUE);
+ gtk_widget_show (dialog);
return;
}
@@ -2400,13 +2509,20 @@ resend_msg (GtkWidget *widget, gpointer user_data)
uids = g_ptr_array_new ();
message_list_foreach (fb->message_list, enumerate_msg, uids);
- if (uids->len > 10 && !are_you_sure (_("Are you sure you want to resend all %d messages?"), uids, fb))
+ if (uids->len > 10 && !are_you_sure (_("Are you sure you want to resend all %d messages?"), uids, fb)) {
+ int i;
+
+ for (i = 0; i < uids->len; i++)
+ g_free (uids->pdata[i]);
+
+ g_ptr_array_free (uids, TRUE);
+
return;
+ }
mail_get_messages (fb->folder, uids, do_resend_messages, fb);
}
-
void
search_msg (GtkWidget *widget, gpointer user_data)
{
@@ -2419,10 +2535,8 @@ search_msg (GtkWidget *widget, gpointer user_data)
if (fb->mail_display->current_message == NULL) {
GtkWidget *dialog;
- dialog = gtk_message_dialog_new (FB_WINDOW(fb), GTK_DIALOG_DESTROY_WITH_PARENT,
- GTK_MESSAGE_WARNING, GTK_BUTTONS_CLOSE,
- _("No Message Selected"));
- g_signal_connect_swapped (dialog, "response", G_CALLBACK (gtk_widget_destroy), dialog);
+ dialog = gnome_warning_dialog_parented (_("No Message Selected"), FB_WINDOW (fb));
+ gnome_dialog_set_close (GNOME_DIALOG (dialog), TRUE);
gtk_widget_show (dialog);
return;
}
@@ -2448,8 +2562,8 @@ save_msg_ok (GtkWidget *widget, gpointer user_data)
CamelFolder *folder;
GPtrArray *uids;
const char *path;
+ int fd, ret = 0;
struct stat st;
- gboolean ret = TRUE;
path = gtk_file_selection_get_filename (GTK_FILE_SELECTION (user_data));
if (path[0] == '\0')
@@ -2458,21 +2572,33 @@ save_msg_ok (GtkWidget *widget, gpointer user_data)
/* make sure we can actually save to it... */
if (stat (path, &st) != -1 && !S_ISREG (st.st_mode))
return;
-
- if (access(path, F_OK) == 0) {
- if (access(path, W_OK) != 0) {
- e_notice(GTK_WINDOW(user_data), GTK_MESSAGE_ERROR,
- _("Cannot save to `%s'\n %s"), path, g_strerror(errno));
- return;
- }
-
- ret = e_question(GTK_WINDOW(user_data), GTK_RESPONSE_NO, NULL,
- _("`%s' already exists.\nOverwrite it?"), path);
+
+ fd = open (path, O_RDONLY);
+ if (fd != -1) {
+ GtkWidget *dialog;
+ GtkWidget *text;
+
+ close (fd);
+
+ dialog = gnome_dialog_new (_("Overwrite file?"),
+ GNOME_STOCK_BUTTON_YES,
+ GNOME_STOCK_BUTTON_NO,
+ NULL);
+
+ e_gnome_dialog_set_parent (GNOME_DIALOG (dialog), GTK_WINDOW (user_data));
+
+ text = gtk_label_new (_("A file by that name already exists.\nOverwrite it?"));
+ gtk_box_pack_start (GTK_BOX (GNOME_DIALOG (dialog)->vbox), text, TRUE, TRUE, 4);
+ gtk_window_set_policy (GTK_WINDOW (dialog), FALSE, TRUE, FALSE);
+ gtk_widget_show (text);
+
+ ret = gnome_dialog_run_and_close (GNOME_DIALOG (dialog));
}
- if (ret) {
- folder = g_object_get_data ((GObject *) user_data, "folder");
- uids = g_object_steal_data (G_OBJECT (user_data), "uids");
+ if (ret == 0) {
+ folder = gtk_object_get_data (GTK_OBJECT (user_data), "folder");
+ uids = gtk_object_get_data (GTK_OBJECT (user_data), "uids");
+ gtk_object_remove_no_notify (GTK_OBJECT (user_data), "uids");
mail_save_messages (folder, uids, path, NULL, NULL);
gtk_widget_destroy (GTK_WIDGET (user_data));
}
@@ -2516,13 +2642,13 @@ save_msg (GtkWidget *widget, gpointer user_data)
path = g_strdup_printf ("%s/", g_get_home_dir ());
gtk_file_selection_set_filename (filesel, path);
g_free (path);
-
- g_object_set_data_full ((GObject *) filesel, "uids", uids, save_msg_destroy);
- g_object_set_data ((GObject *) filesel, "folder", fb->folder);
-
- g_signal_connect (filesel->ok_button, "clicked", G_CALLBACK (save_msg_ok), filesel);
- g_signal_connect_swapped (filesel->cancel_button, "clicked",
- G_CALLBACK (gtk_widget_destroy), filesel);
+ gtk_object_set_data_full (GTK_OBJECT (filesel), "uids", uids, save_msg_destroy);
+ gtk_object_set_data (GTK_OBJECT (filesel), "folder", fb->folder);
+ gtk_signal_connect (GTK_OBJECT (filesel->ok_button),
+ "clicked", GTK_SIGNAL_FUNC (save_msg_ok), filesel);
+ gtk_signal_connect_object (GTK_OBJECT (filesel->cancel_button),
+ "clicked", GTK_SIGNAL_FUNC (gtk_widget_destroy),
+ GTK_OBJECT (filesel));
gtk_widget_show (GTK_WIDGET (filesel));
}
@@ -2537,15 +2663,11 @@ void
delete_msg (GtkWidget *button, gpointer user_data)
{
FolderBrowser *fb = FOLDER_BROWSER (user_data);
- gboolean hide_deleted;
- GConfClient *gconf;
int deleted, row;
if (FOLDER_BROWSER_IS_DESTROYED (fb))
return;
- gconf = gconf_client_get_default ();
-
deleted = flag_messages (fb, CAMEL_MESSAGE_DELETED | CAMEL_MESSAGE_SEEN,
CAMEL_MESSAGE_DELETED | CAMEL_MESSAGE_SEEN);
@@ -2554,11 +2676,10 @@ delete_msg (GtkWidget *button, gpointer user_data)
row = e_tree_row_of_node (fb->message_list->tree,
e_tree_get_cursor (fb->message_list->tree));
- hide_deleted = !gconf_client_get_bool (gconf, "/apps/evolution/mail/display/show_deleted", NULL);
-
/* If this is the last message and deleted messages
are hidden, select the previous */
- if ((row + 1 == e_tree_row_count (fb->message_list->tree)) && hide_deleted)
+ if ((row+1 == e_tree_row_count (fb->message_list->tree))
+ && mail_config_get_hide_deleted ())
message_list_select (fb->message_list, MESSAGE_LIST_SELECT_PREVIOUS,
0, CAMEL_MESSAGE_DELETED, FALSE);
else
@@ -2573,6 +2694,153 @@ undelete_msg (GtkWidget *button, gpointer user_data)
flag_messages (FOLDER_BROWSER (user_data), CAMEL_MESSAGE_DELETED, 0);
}
+
+#if 0
+static gboolean
+confirm_goto_next_folder (FolderBrowser *fb)
+{
+ GtkWidget *dialog, *label, *checkbox;
+ int button;
+
+ if (!mail_config_get_confirm_goto_next_folder ())
+ return mail_config_get_goto_next_folder ();
+
+ dialog = gnome_dialog_new (_("Go to next folder with unread messages?"),
+ GNOME_STOCK_BUTTON_YES,
+ GNOME_STOCK_BUTTON_NO,
+ NULL);
+
+ e_gnome_dialog_set_parent (GNOME_DIALOG (dialog), FB_WINDOW (fb));
+
+ label = gtk_label_new (_("There are no more new messages in this folder.\n"
+ "Would you like to go to the next folder?"));
+
+ gtk_label_set_line_wrap (GTK_LABEL (label), TRUE);
+ gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT);
+ gtk_widget_show (label);
+ gtk_box_pack_start (GTK_BOX (GNOME_DIALOG (dialog)->vbox), label, TRUE, TRUE, 4);
+
+ checkbox = gtk_check_button_new_with_label (_("Do not ask me again."));
+ gtk_object_ref (GTK_OBJECT (checkbox));
+ gtk_widget_show (checkbox);
+ gtk_box_pack_start (GTK_BOX (GNOME_DIALOG (dialog)->vbox), checkbox, TRUE, TRUE, 4);
+
+ button = gnome_dialog_run_and_close (GNOME_DIALOG (dialog));
+
+ if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (checkbox)))
+ mail_config_set_confirm_goto_next_folder (FALSE);
+
+ gtk_object_unref (GTK_OBJECT (checkbox));
+
+ if (button == 0) {
+ mail_config_set_goto_next_folder (TRUE);
+ return TRUE;
+ } else {
+ mail_config_set_goto_next_folder (FALSE);
+ return FALSE;
+ }
+}
+
+static CamelFolderInfo *
+find_current_folder (CamelFolderInfo *root, const char *current_uri)
+{
+ CamelFolderInfo *node, *current = NULL;
+
+ node = root;
+ while (node) {
+ if (!strcmp (current_uri, node->url)) {
+ current = node;
+ break;
+ }
+
+ current = find_current_folder (node->child, current_uri);
+ if (current)
+ break;
+
+ node = node->sibling;
+ }
+
+ return current;
+}
+
+static CamelFolderInfo *
+find_next_folder_r (CamelFolderInfo *node)
+{
+ CamelFolderInfo *next;
+
+ while (node) {
+ if (node->unread_message_count > 0)
+ return node;
+
+ next = find_next_folder_r (node->child);
+ if (next)
+ return next;
+
+ node = node->sibling;
+ }
+
+ return NULL;
+}
+
+static CamelFolderInfo *
+find_next_folder (CamelFolderInfo *current)
+{
+ CamelFolderInfo *next;
+
+ /* first search subfolders... */
+ next = find_next_folder_r (current->child);
+ if (next)
+ return next;
+
+ /* now search siblings... */
+ next = find_next_folder_r (current->sibling);
+ if (next)
+ return next;
+
+ /* now go up one level (if we can) and search... */
+ if (current->parent && current->parent->sibling) {
+ return find_next_folder_r (current->parent->sibling);
+ } else {
+ return NULL;
+ }
+}
+
+static void
+do_evil_kludgy_goto_next_folder_hack (FolderBrowser *fb)
+{
+ CamelFolderInfo *root, *current, *node;
+ CORBA_Environment ev;
+ CamelStore *store;
+
+ store = camel_folder_get_parent_store (fb->folder);
+
+ /* FIXME: loop over all available mail stores? */
+
+ root = camel_store_get_folder_info (store, "", CAMEL_STORE_FOLDER_INFO_RECURSIVE |
+ CAMEL_STORE_FOLDER_INFO_SUBSCRIBED, NULL);
+
+ if (!root)
+ return;
+
+ current = find_current_folder (root, fb->uri);
+ g_assert (current != NULL);
+
+ node = find_next_folder (current);
+ if (node) {
+ g_warning ("doin' my thang...");
+ CORBA_exception_init (&ev);
+ GNOME_Evolution_ShellView_changeCurrentView (fb->shell_view, "evolution:/local/Inbox", &ev);
+ if (ev._major != CORBA_NO_EXCEPTION)
+ g_warning ("got an exception");
+ CORBA_exception_free (&ev);
+ } else {
+ g_warning ("can't find a folder with unread mail?");
+ }
+
+ camel_store_free_folder_info (store, root);
+}
+#endif
+
void
next_msg (GtkWidget *button, gpointer user_data)
{
@@ -2592,7 +2860,12 @@ next_unread_msg (GtkWidget *button, gpointer user_data)
if (FOLDER_BROWSER_IS_DESTROYED (fb))
return;
- message_list_select (fb->message_list, MESSAGE_LIST_SELECT_NEXT, 0, CAMEL_MESSAGE_SEEN, TRUE);
+ if (!message_list_select (fb->message_list, MESSAGE_LIST_SELECT_NEXT, 0, CAMEL_MESSAGE_SEEN, TRUE)) {
+#if 0
+ if (confirm_goto_next_folder (fb))
+ do_evil_kludgy_goto_next_folder_hack (fb);
+#endif
+ }
}
void
@@ -2664,33 +2937,50 @@ expunged_folder (CamelFolder *f, void *data)
fb->expunging = NULL;
gtk_widget_set_sensitive (GTK_WIDGET (fb->message_list), TRUE);
-
- /* FIXME: we should check that the focus hasn't changed in the
- * mean time, otherwise we steal the focus unecessarily.
- * Check :get_toplevel()->focus_widget? */
- if (fb->expunge_mlfocussed)
- gtk_widget_grab_focus((GtkWidget *)fb->message_list);
}
static gboolean
confirm_expunge (FolderBrowser *fb)
{
- gboolean res, show_again;
- GConfClient *gconf;
-
- gconf = gconf_client_get_default ();
+ GtkWidget *dialog, *label, *checkbox;
+ int button;
- if (!gconf_client_get_bool (gconf, "/apps/evolution/mail/prompts/expunge", NULL))
+ if (!mail_config_get_confirm_expunge ())
return TRUE;
- res = e_question (FB_WINDOW (fb), GTK_RESPONSE_NO, &show_again,
- _("This operation will permanently erase all messages marked as\n"
- "deleted. If you continue, you will not be able to recover these messages.\n"
- "\nReally erase these messages?"));
+ dialog = gnome_dialog_new (_("Warning"),
+ GNOME_STOCK_BUTTON_YES,
+ GNOME_STOCK_BUTTON_NO,
+ NULL);
+
+ e_gnome_dialog_set_parent (GNOME_DIALOG (dialog), FB_WINDOW (fb));
+
+ label = gtk_label_new (_("This operation will permanently erase all messages marked as deleted. If you continue, you will not be able to recover these messages.\n\nReally erase these messages?"));
+
+ gtk_label_set_line_wrap (GTK_LABEL (label), TRUE);
+ gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT);
+ gtk_widget_show (label);
+ gtk_box_pack_start (GTK_BOX (GNOME_DIALOG (dialog)->vbox), label, TRUE, TRUE, 4);
- gconf_client_set_bool (gconf, "/apps/evolution/mail/prompts/expunge", show_again, NULL);
+ checkbox = gtk_check_button_new_with_label (_("Do not ask me again."));
+ gtk_object_ref (GTK_OBJECT (checkbox));
+ gtk_widget_show (checkbox);
+ gtk_box_pack_start (GTK_BOX (GNOME_DIALOG (dialog)->vbox), checkbox, TRUE, TRUE, 4);
- return res;
+ /* Set the 'No' button as the default */
+ gnome_dialog_set_default (GNOME_DIALOG (dialog), 1);
+
+ button = gnome_dialog_run_and_close (GNOME_DIALOG (dialog));
+
+ if (button == 0 && gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (checkbox)))
+ mail_config_set_confirm_expunge (FALSE);
+
+ gtk_object_unref (GTK_OBJECT (checkbox));
+
+ if (button == 0)
+ return TRUE;
+ else
+ return FALSE;
}
void
@@ -2703,17 +2993,8 @@ expunge_folder (BonoboUIComponent *uih, void *user_data, const char *path)
if (fb->folder && (fb->expunging == NULL || fb->folder != fb->expunging) && confirm_expunge (fb)) {
CamelMessageInfo *info;
- GtkWindow *top;
- GtkWidget *focus;
-
- /* disable the message list so user can't click on them while we expunge */
-
- /* nasty hack to find out if some widget inside the message list is focussed ... */
- top = GTK_WINDOW (gtk_widget_get_toplevel((GtkWidget *)fb->message_list));
- focus = top?top->focus_widget:NULL;
- while (focus && focus != (GtkWidget *)fb->message_list)
- focus = focus->parent;
- fb->expunge_mlfocussed = focus == (GtkWidget *)fb->message_list;
+
+ /* hide the deleted messages so user can't click on them while we expunge */
gtk_widget_set_sensitive (GTK_WIDGET (fb->message_list), FALSE);
/* Only blank the mail display if the message being
@@ -2735,22 +3016,28 @@ expunge_folder (BonoboUIComponent *uih, void *user_data, const char *path)
static GtkWidget *filter_editor = NULL;
static void
-filter_editor_response (GtkWidget *dialog, int button, FolderBrowser *fb)
+filter_editor_destroy (GtkWidget *dialog, gpointer user_data)
+{
+ filter_editor = NULL;
+}
+
+static void
+filter_editor_clicked (GtkWidget *dialog, int button, FolderBrowser *fb)
{
FilterContext *fc;
- if (button == GTK_RESPONSE_ACCEPT) {
+ if (button == 0) {
char *user;
- fc = g_object_get_data(G_OBJECT(dialog), "context");
+ fc = gtk_object_get_data (GTK_OBJECT (dialog), "context");
user = g_strdup_printf ("%s/filters.xml", evolution_dir);
rule_context_save ((RuleContext *)fc, user);
g_free (user);
}
-
- gtk_widget_destroy(dialog);
-
- filter_editor = NULL;
+
+ if (button != -1) {
+ gnome_dialog_close (GNOME_DIALOG (dialog));
+ }
}
static const char *filter_source_names[] = {
@@ -2773,23 +3060,32 @@ filter_edit (BonoboUIComponent *uih, void *user_data, const char *path)
fc = filter_context_new ();
user = g_strdup_printf ("%s/filters.xml", evolution_dir);
- system = EVOLUTION_PRIVDATADIR "/filtertypes.xml";
+ system = EVOLUTION_DATADIR "/evolution/filtertypes.xml";
rule_context_load ((RuleContext *)fc, system, user);
g_free (user);
if (((RuleContext *)fc)->error) {
- e_notice(FB_WINDOW (fb), GTK_MESSAGE_ERROR,
- _("Error loading filter information:\n%s"),
- ((RuleContext *)fc)->error);
+ GtkWidget *dialog;
+ char *err;
+
+ err = g_strdup_printf (_("Error loading filter information:\n%s"),
+ ((RuleContext *)fc)->error);
+ dialog = gnome_warning_dialog_parented (err, FB_WINDOW (fb));
+ g_free (err);
+
+ gnome_dialog_set_close (GNOME_DIALOG (dialog), TRUE);
+ gtk_widget_show (dialog);
return;
}
filter_editor = (GtkWidget *)filter_editor_new (fc, filter_source_names);
- /* FIXME: maybe this needs destroy func? */
- gtk_window_set_transient_for ((GtkWindow *) filter_editor, FB_WINDOW (fb));
+ gnome_dialog_set_parent (GNOME_DIALOG (filter_editor), FB_WINDOW (fb));
gtk_window_set_title (GTK_WINDOW (filter_editor), _("Filters"));
- g_object_set_data_full ((GObject *) filter_editor, "context", fc, (GtkDestroyNotify) g_object_unref);
- g_signal_connect (filter_editor, "response", G_CALLBACK (filter_editor_response), fb);
+
+ gtk_object_set_data_full (GTK_OBJECT (filter_editor), "context", fc, (GtkDestroyNotify)gtk_object_unref);
+ gtk_signal_connect (GTK_OBJECT (filter_editor), "clicked", filter_editor_clicked, fb);
+ gtk_signal_connect (GTK_OBJECT (filter_editor), "destroy", filter_editor_destroy, NULL);
+ gnome_dialog_append_buttons(GNOME_DIALOG(filter_editor), GNOME_STOCK_BUTTON_CANCEL, NULL);
gtk_widget_show (GTK_WIDGET (filter_editor));
}
@@ -2826,13 +3122,11 @@ footer_print_cb (GtkHTML *html, GnomePrintContext *print_context,
double x, double y, double width, double height, gpointer user_data)
{
struct footer_info *info = (struct footer_info *) user_data;
-
+
if (info->local_font) {
- char *text = g_strdup_printf (_("Page %d of %d"), info->page_num, info->pages);
- /*gdouble tw = gnome_font_get_width_string (info->local_font, text);*/
- /* FIXME: work out how to measure this */
- gdouble tw = strlen (text) * 8;
-
+ gchar *text = g_strdup_printf (_("Page %d of %d"), info->page_num, info->pages);
+ gdouble tw = gnome_font_get_width_string (info->local_font, text);
+
gnome_print_gsave (print_context);
gnome_print_newpath (print_context);
gnome_print_setrgbcolor (print_context, .0, .0, .0);
@@ -2840,7 +3134,7 @@ footer_print_cb (GtkHTML *html, GnomePrintContext *print_context,
gnome_print_setfont (print_context, info->local_font);
gnome_print_show (print_context, text);
gnome_print_grestore (print_context);
-
+
g_free (text);
info->page_num++;
}
@@ -2858,16 +3152,15 @@ static struct footer_info *
footer_info_new (GtkHTML *html, GnomePrintContext *pc, gdouble *line)
{
struct footer_info *info;
-
+
info = g_new (struct footer_info, 1);
- info->local_font = gnome_font_find_closest ("Helvetica", 10.0);
-
- if (info->local_font)
+ info->local_font = gnome_font_new_closest ("Helvetica", GNOME_FONT_BOOK, FALSE, 10);
+ if (info->local_font) {
*line = gnome_font_get_ascender (info->local_font) + gnome_font_get_descender (info->local_font);
-
+ }
info->page_num = 1;
info->pages = gtk_html_print_get_pages_num (html, pc, 0.0, *line);
-
+
return info;
}
@@ -2875,43 +3168,51 @@ static void
do_mail_print (FolderBrowser *fb, gboolean preview)
{
GtkHTML *html;
- GtkWidget *w = NULL;
GnomePrintContext *print_context;
- GnomePrintJob *print_master;
- GnomePrintConfig *config = NULL;
- GtkDialog *dialog;
+ GnomePrintMaster *print_master;
+ GnomePrintDialog *dialog;
+ GnomePrinter *printer = NULL;
+ GnomePaper *paper;
gdouble line = 0.0;
+ int copies = 1;
+ int collate = FALSE;
struct footer_info *info;
-
+
if (!preview) {
- dialog = (GtkDialog *) gnome_print_dialog_new (NULL, _("Print Message"), GNOME_PRINT_DIALOG_COPIES);
- gtk_dialog_set_default_response (dialog, GNOME_PRINT_DIALOG_RESPONSE_PRINT);
- gtk_window_set_transient_for ((GtkWindow *) dialog, (GtkWindow *) gtk_widget_get_toplevel ((GtkWidget *) fb));
-
- switch (gtk_dialog_run (dialog)) {
- case GNOME_PRINT_DIALOG_RESPONSE_PRINT:
- break;
- case GNOME_PRINT_DIALOG_RESPONSE_PREVIEW:
+ dialog = GNOME_PRINT_DIALOG (gnome_print_dialog_new (_("Print Message"),
+ GNOME_PRINT_DIALOG_COPIES));
+ gnome_dialog_set_default (GNOME_DIALOG (dialog), GNOME_PRINT_PRINT);
+ e_gnome_dialog_set_parent (GNOME_DIALOG (dialog), FB_WINDOW (fb));
+
+ switch (gnome_dialog_run (GNOME_DIALOG (dialog))) {
+ case GNOME_PRINT_PRINT:
+ break;
+ case GNOME_PRINT_PREVIEW:
preview = TRUE;
break;
+ case -1:
+ return;
default:
- gtk_widget_destroy ((GtkWidget *) dialog);
+ gnome_dialog_close (GNOME_DIALOG (dialog));
return;
}
- config = gnome_print_dialog_get_config ((GnomePrintDialog *) dialog);
- gtk_widget_destroy ((GtkWidget *)dialog);
+ gnome_print_dialog_get_copies (dialog, &copies, &collate);
+ printer = gnome_print_dialog_get_printer (dialog);
+ gnome_dialog_close (GNOME_DIALOG (dialog));
}
- if (config) {
- print_master = gnome_print_job_new (config);
- gnome_print_config_unref (config);
- } else
- print_master = gnome_print_job_new (NULL);
+ print_master = gnome_print_master_new ();
- /* paper size settings? */
- /*gnome_print_master_set_paper (print_master, paper);*/
- print_context = gnome_print_job_get_context (print_master);
+ if (printer)
+ gnome_print_master_set_printer (print_master, printer);
+ paper = (GnomePaper *) gnome_paper_with_name (_("US-Letter"));
+
+ if (!paper)
+ paper = (GnomePaper *) gnome_paper_with_name (gnome_paper_name_default ());
+ gnome_print_master_set_paper (print_master, paper);
+ gnome_print_master_set_copies (print_master, copies, collate);
+ print_context = gnome_print_master_get_context (print_master);
html = GTK_HTML (gtk_html_new ());
mail_display_initialize_gtkhtml (fb->mail_display, html);
@@ -2921,13 +3222,8 @@ do_mail_print (FolderBrowser *fb, gboolean preview)
user's theme. */
fb->mail_display->printing = TRUE;
- if (!GTK_WIDGET_REALIZED (GTK_WIDGET (html))) {
- /* gtk widgets don't like to be realized outside top level widget
- so we put new html widget into gtk window */
- w = gtk_window_new (GTK_WINDOW_TOPLEVEL);
- gtk_container_add (GTK_CONTAINER (w), GTK_WIDGET (html));
+ if (!GTK_WIDGET_REALIZED (GTK_WIDGET (html)))
gtk_widget_realize (GTK_WIDGET (html));
- }
mail_display_render (fb->mail_display, html, TRUE);
gtk_html_print_set_master (html, print_master);
@@ -2937,24 +3233,25 @@ do_mail_print (FolderBrowser *fb, gboolean preview)
fb->mail_display->printing = FALSE;
- gnome_print_job_close (print_master);
- gtk_widget_destroy (GTK_WIDGET (html));
- if (w)
- gtk_widget_destroy (w);
+ gnome_print_master_close (print_master);
if (preview){
- GtkWidget *pw;
+ gboolean landscape = FALSE;
+ GnomePrintMasterPreview *preview;
- pw = gnome_print_job_preview_new (print_master, _("Print Preview"));
- gtk_widget_show (pw);
+ preview = gnome_print_master_preview_new_with_orientation (
+ print_master, _("Print Preview"), landscape);
+ gtk_widget_show (GTK_WIDGET (preview));
} else {
- int result = gnome_print_job_print (print_master);
+ int result = gnome_print_master_print (print_master);
- if (result == -1)
- e_notice (FB_WINDOW (fb), GTK_MESSAGE_ERROR, _("Printing of message failed"));
+ if (result == -1){
+ e_notice (NULL, GNOME_MESSAGE_BOX_ERROR,
+ _("Printing of message failed"));
+ }
}
-
- g_object_unref (print_master);
+
+ /* FIXME: We are leaking the GtkHTML object */
}
/* This is pretty evil. FolderBrowser's API should be extended to allow these sorts of
@@ -2985,7 +3282,7 @@ done_message_selected (CamelFolder *folder, const char *uid, CamelMimeMessage *m
g_free (fb->loaded_uid);
fb->loaded_uid = fb->loading_uid;
fb->loading_uid = NULL;
-
+
if (msg)
do_mail_print (fb, preview);
}
@@ -3052,12 +3349,10 @@ print_preview_msg (GtkWidget *button, gpointer user_data)
static GtkObject *subscribe_dialog = NULL;
static void
-subscribe_dialog_destroy (GtkObject *dialog, GObject *deadbeef)
+subscribe_dialog_destroy (GtkWidget *widget, gpointer user_data)
{
- if (subscribe_dialog) {
- g_object_unref (subscribe_dialog);
- subscribe_dialog = NULL;
- }
+ gtk_object_unref (subscribe_dialog);
+ subscribe_dialog = NULL;
}
void
@@ -3065,9 +3360,8 @@ manage_subscriptions (BonoboUIComponent *uih, void *user_data, const char *path)
{
if (!subscribe_dialog) {
subscribe_dialog = subscribe_dialog_new ();
-
- g_object_weak_ref ((GObject *) SUBSCRIBE_DIALOG (subscribe_dialog)->app,
- (GWeakNotify) subscribe_dialog_destroy, subscribe_dialog);
+ gtk_signal_connect (GTK_OBJECT (SUBSCRIBE_DIALOG (subscribe_dialog)->app), "destroy",
+ subscribe_dialog_destroy, NULL);
subscribe_dialog_show (subscribe_dialog);
} else {
@@ -3083,7 +3377,7 @@ local_configure_done(const char *uri, CamelFolder *folder, void *data)
FolderBrowser *fb = data;
if (FOLDER_BROWSER_IS_DESTROYED (fb)) {
- g_object_unref(fb);
+ gtk_object_unref((GtkObject *)fb);
return;
}
@@ -3091,7 +3385,7 @@ local_configure_done(const char *uri, CamelFolder *folder, void *data)
folder = fb->folder;
message_list_set_folder(fb->message_list, folder, FALSE);
- g_object_unref(fb);
+ gtk_object_unref((GtkObject *)fb);
}
void
@@ -3107,7 +3401,7 @@ configure_folder (BonoboUIComponent *uih, void *user_data, const char *path)
vfolder_edit_rule (fb->uri);
} else {
message_list_set_folder(fb->message_list, NULL, FALSE);
- g_object_ref((GtkObject *)fb);
+ gtk_object_ref((GtkObject *)fb);
mail_local_reconfigure_folder(fb->uri, local_configure_done, fb);
}
}
@@ -3190,19 +3484,18 @@ stop_threads (BonoboUIComponent *uih, void *user_data, const char *path)
static void
empty_trash_expunged_cb (CamelFolder *folder, void *data)
{
- camel_object_unref (folder);
+ camel_object_unref (CAMEL_OBJECT (folder));
}
void
empty_trash (BonoboUIComponent *uih, void *user_data, const char *path)
{
+ MailConfigAccount *account;
CamelProvider *provider;
- EAccountList *accounts;
+ const GSList *accounts;
CamelFolder *vtrash;
FolderBrowser *fb;
CamelException ex;
- EAccount *account;
- EIterator *iter;
fb = user_data ? FOLDER_BROWSER (user_data) : NULL;
@@ -3213,12 +3506,11 @@ empty_trash (BonoboUIComponent *uih, void *user_data, const char *path)
/* expunge all remote stores */
accounts = mail_config_get_accounts ();
- iter = e_list_get_iterator ((EList *) accounts);
- while (e_iterator_is_valid (iter)) {
- account = (EAccount *) e_iterator_get (iter);
+ while (accounts) {
+ account = accounts->data;
/* make sure this is a valid source */
- if (account->enabled && account->source->url) {
+ if (account->source && account->source->enabled && account->source->url) {
provider = camel_session_get_provider (session, account->source->url, &ex);
if (provider) {
/* make sure this store is a remote store */
@@ -3235,16 +3527,14 @@ empty_trash (BonoboUIComponent *uih, void *user_data, const char *path)
/* clear the exception for the next round */
camel_exception_clear (&ex);
}
-
- e_iterator_next (iter);
+ accounts = accounts->next;
}
- g_object_unref (iter);
-
/* Now empty the local trash folder */
vtrash = mail_tool_get_trash ("file:/", TRUE, &ex);
- if (vtrash)
+ if (vtrash) {
mail_expunge_folder (vtrash, empty_trash_expunged_cb, NULL);
+ }
camel_exception_clear (&ex);
}
diff --git a/mail/mail-composer-prefs.c b/mail/mail-composer-prefs.c
index 8b361035dd..8e6cbb54f8 100644
--- a/mail/mail-composer-prefs.c
+++ b/mail/mail-composer-prefs.c
@@ -25,20 +25,16 @@
#include <config.h>
#endif
-#include <string.h>
-
#include "mail-composer-prefs.h"
#include "composer/e-msg-composer.h"
+#include <gtk/gtksignal.h>
+
#include <bonobo/bonobo-generic-factory.h>
+#include <bonobo/bonobo-object-client.h>
-#include <gal/util/e-iconv.h>
#include <gal/widgets/e-gui-utils.h>
-
-#include <gtk/gtktreemodel.h>
-#include <gtk/gtkliststore.h>
-#include <gtk/gtktreeselection.h>
-#include <gtk/gtktreeview.h>
+#include <gal/widgets/e-unicode.h>
#include "widgets/misc/e-charset-picker.h"
@@ -52,30 +48,30 @@
static void mail_composer_prefs_class_init (MailComposerPrefsClass *class);
static void mail_composer_prefs_init (MailComposerPrefs *dialog);
static void mail_composer_prefs_destroy (GtkObject *obj);
-static void mail_composer_prefs_finalise (GObject *obj);
+static void mail_composer_prefs_finalise (GtkObject *obj);
static void sig_event_client (MailConfigSigEvent event, MailConfigSignature *sig, MailComposerPrefs *prefs);
static GtkVBoxClass *parent_class = NULL;
-GType
+GtkType
mail_composer_prefs_get_type (void)
{
- static GType type = 0;
+ static GtkType type = 0;
if (!type) {
- static const GTypeInfo info = {
- sizeof (MailComposerPrefsClass),
- NULL, NULL,
- (GClassInitFunc) mail_composer_prefs_class_init,
- NULL, NULL,
+ GtkTypeInfo type_info = {
+ "MailComposerPrefs",
sizeof (MailComposerPrefs),
- 0,
- (GInstanceInitFunc) mail_composer_prefs_init,
+ sizeof (MailComposerPrefsClass),
+ (GtkClassInitFunc) mail_composer_prefs_class_init,
+ (GtkObjectInitFunc) mail_composer_prefs_init,
+ (GtkArgSetFunc) NULL,
+ (GtkArgGetFunc) NULL
};
- type = g_type_register_static (gtk_vbox_get_type (), "MailComposerPrefs", &info, 0);
+ type = gtk_type_unique (gtk_vbox_get_type (), &type_info);
}
return type;
@@ -84,13 +80,15 @@ mail_composer_prefs_get_type (void)
static void
mail_composer_prefs_class_init (MailComposerPrefsClass *klass)
{
- GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
- GtkObjectClass *object_class = GTK_OBJECT_CLASS (klass);
+ GtkObjectClass *object_class;
- parent_class = g_type_class_ref (gtk_vbox_get_type ());
+ object_class = (GtkObjectClass *) klass;
+ parent_class = gtk_type_class (gtk_vbox_get_type ());
object_class->destroy = mail_composer_prefs_destroy;
- gobject_class->finalize = mail_composer_prefs_finalise;
+ object_class->finalize = mail_composer_prefs_finalise;
+ /* override methods */
+
}
static void
@@ -102,27 +100,28 @@ mail_composer_prefs_init (MailComposerPrefs *composer_prefs)
}
static void
-mail_composer_prefs_finalise (GObject *obj)
+mail_composer_prefs_finalise (GtkObject *obj)
{
MailComposerPrefs *prefs = (MailComposerPrefs *) obj;
- g_object_unref (prefs->gui);
- g_object_unref (prefs->pman);
- g_object_unref (prefs->enabled_pixbuf);
+ gtk_object_unref (GTK_OBJECT (prefs->gui));
+ gtk_object_unref (GTK_OBJECT (prefs->pman));
+ gdk_pixbuf_unref (prefs->enabled_pixbuf);
gdk_pixmap_unref (prefs->mark_pixmap);
- g_object_unref (prefs->mark_bitmap);
-
- G_OBJECT_CLASS (parent_class)->finalize (obj);
+ gdk_bitmap_unref (prefs->mark_bitmap);
+
+ ((GtkObjectClass *)(parent_class))->finalize (obj);
}
static void
mail_composer_prefs_destroy (GtkObject *obj)
{
MailComposerPrefs *prefs = (MailComposerPrefs *) obj;
-
+
mail_config_signature_unregister_client ((MailConfigSignatureClient) sig_event_client, prefs);
- GTK_OBJECT_CLASS (parent_class)->destroy (obj);
+ if (GTK_OBJECT_CLASS (parent_class))
+ (* GTK_OBJECT_CLASS (parent_class)->destroy) (obj);
}
static void
@@ -130,7 +129,7 @@ attach_style_info (GtkWidget *item, gpointer user_data)
{
int *style = user_data;
- g_object_set_data ((GObject *) item, "style", GINT_TO_POINTER (*style));
+ gtk_object_set_data (GTK_OBJECT (item), "style", GINT_TO_POINTER (*style));
(*style)++;
}
@@ -164,7 +163,8 @@ option_menu_connect (GtkOptionMenu *omenu, gpointer user_data)
items = GTK_MENU_SHELL (menu)->children;
while (items) {
item = items->data;
- g_signal_connect (item, "activate", G_CALLBACK (menu_changed), user_data);
+ gtk_signal_connect (GTK_OBJECT (item), "activate",
+ menu_changed, user_data);
items = items->next;
}
}
@@ -178,18 +178,18 @@ sig_load_preview (MailComposerPrefs *prefs, MailConfigSignature *sig)
gtk_html_load_from_string (GTK_HTML (prefs->sig_preview), " ", 1);
return;
}
-
+
if (sig->script)
str = mail_config_signature_run_script (sig->script);
else
str = e_msg_composer_get_sig_file_content (sig->filename, sig->html);
if (!str)
- str = g_strdup ("");
+ str = g_strdup (" ");
/* printf ("HTML: %s\n", str); */
- if (sig->html) {
+ if (sig->html)
gtk_html_load_from_string (GTK_HTML (prefs->sig_preview), str, strlen (str));
- } else {
+ else {
GtkHTMLStream *stream;
int len;
@@ -205,181 +205,180 @@ sig_load_preview (MailComposerPrefs *prefs, MailConfigSignature *sig)
g_free (str);
}
+static MailConfigSignature *
+sig_current_sig (MailComposerPrefs *prefs)
+{
+ return gtk_clist_get_row_data (GTK_CLIST (prefs->sig_clist), prefs->sig_row);
+}
+
static void
-sig_edit_cb (GtkWidget *widget, MailComposerPrefs *prefs)
+sig_edit (GtkWidget *widget, MailComposerPrefs *prefs)
{
- GtkTreeSelection *selection;
- MailConfigSignature *sig;
- GtkTreeModel *model;
- GtkWidget *parent;
- GtkTreeIter iter;
-
- selection = gtk_tree_view_get_selection (prefs->sig_list);
- if (!gtk_tree_selection_get_selected (selection, &model, &iter))
- return;
-
- gtk_tree_model_get (model, &iter, 1, &sig, -1);
+ MailConfigSignature *sig = sig_current_sig (prefs);
- if (!sig->filename || *sig->filename == '\0') {
- g_free (sig->filename);
- sig->filename = g_strdup (_("Unnamed"));
- }
-
- parent = gtk_widget_get_toplevel ((GtkWidget *) prefs);
- parent = GTK_WIDGET_TOPLEVEL (parent) ? parent : NULL;
-
- mail_signature_editor (sig, (GtkWindow *) parent, FALSE);
+ if (sig->filename && *sig->filename)
+ mail_signature_editor (sig);
+ else
+ e_notice (GTK_WINDOW (prefs), GNOME_MESSAGE_BOX_ERROR,
+ _("Please specify signature filename\nin Advanced section of signature settings."));
}
MailConfigSignature *
-mail_composer_prefs_new_signature (GtkWindow *parent, gboolean html, const char *script)
+mail_composer_prefs_new_signature (MailComposerPrefs *prefs, gboolean html, const gchar *script)
{
MailConfigSignature *sig;
+ char *name[1];
+ int row;
+
+ sig = mail_config_signature_add (html, script);
+
+ if (prefs) {
+ if (!(name[0] = e_utf8_to_gtk_string (GTK_WIDGET (prefs->sig_clist), sig->name)))
+ name[0] = g_strdup ("");
+
+ if (sig->script) {
+ char *tmp;
+
+ tmp = name[0];
+ name[0] = g_strconcat (tmp, _(" [script]"), NULL);
+ g_free (tmp);
+ }
+
+ row = gtk_clist_append (prefs->sig_clist, name);
+ gtk_clist_set_row_data (prefs->sig_clist, row, sig);
+ gtk_clist_select_row (GTK_CLIST (prefs->sig_clist), row, 0);
+ g_free (name[0]);
+ /*gtk_widget_grab_focus (prefs->sig_name);*/
+ }
- sig = mail_config_signature_new (html, script);
- mail_signature_editor (sig, parent, TRUE);
+ if (sig->filename && *sig->filename)
+ mail_signature_editor (sig);
return sig;
}
+static void sig_row_unselect (GtkCList *clist, int row, int col, GdkEvent *event, MailComposerPrefs *prefs);
+
static void
-sig_delete_cb (GtkWidget *widget, MailComposerPrefs *prefs)
+sig_delete (GtkWidget *widget, MailComposerPrefs *prefs)
{
- MailConfigSignature *sig;
- GtkTreeModel *model;
- GtkTreeSelection *selection;
- GtkTreeIter iter;
-
- selection = gtk_tree_view_get_selection (prefs->sig_list);
- if (gtk_tree_selection_get_selected (selection, &model, &iter)) {
- gtk_tree_model_get (model, &iter, 1, &sig, -1);
- gtk_list_store_remove ((GtkListStore *) model, &iter);
- mail_config_signature_delete (sig);
- }
+ MailConfigSignature *sig = sig_current_sig (prefs);
+
+ gtk_clist_remove (prefs->sig_clist, prefs->sig_row);
+ mail_config_signature_delete (sig);
+ if (prefs->sig_row < prefs->sig_clist->rows)
+ gtk_clist_select_row (prefs->sig_clist, prefs->sig_row, 0);
+ else if (prefs->sig_row)
+ gtk_clist_select_row (prefs->sig_clist, prefs->sig_row - 1, 0);
+ else
+ sig_row_unselect (prefs->sig_clist, prefs->sig_row, 0, NULL, prefs);
}
static void
-sig_add_cb (GtkWidget *widget, MailComposerPrefs *prefs)
+sig_add (GtkWidget *widget, MailComposerPrefs *prefs)
{
- GConfClient *gconf;
- gboolean send_html;
- GtkWidget *parent;
-
- gconf = gconf_client_get_default ();
- send_html = gconf_client_get_bool (gconf, "/apps/evolution/mail/composer/send_html", NULL);
-
- parent = gtk_widget_get_toplevel ((GtkWidget *) prefs);
- parent = GTK_WIDGET_TOPLEVEL (parent) ? parent : NULL;
-
- mail_composer_prefs_new_signature ((GtkWindow *) parent, send_html, NULL);
+ mail_composer_prefs_new_signature (prefs, mail_config_get_send_html (), NULL);
}
static void
-sig_add_script_response (GtkWidget *widget, int button, MailComposerPrefs *prefs)
+sig_add_script_add (GtkWidget *widget, MailComposerPrefs *prefs)
{
- const char *script, *name;
- GtkWidget *dialog;
+ char *script, *name;
GtkWidget *entry;
- if (button == GTK_RESPONSE_ACCEPT) {
- entry = glade_xml_get_widget (prefs->sig_script_gui, "fileentry_add_script_script");
- script = gtk_entry_get_text (GTK_ENTRY (gnome_file_entry_gtk_entry (GNOME_FILE_ENTRY (entry))));
+ entry = glade_xml_get_widget (prefs->sig_script_gui, "fileentry_add_script_script");
+ script = gtk_entry_get_text (GTK_ENTRY (gnome_file_entry_gtk_entry (GNOME_FILE_ENTRY (entry))));
+
+ entry = glade_xml_get_widget (prefs->sig_script_gui, "entry_add_script_name");
+ name = e_utf8_gtk_entry_get_text (GTK_ENTRY (entry));
+ if (script && *script) {
+ struct stat st;
- entry = glade_xml_get_widget (prefs->sig_script_gui, "entry_add_script_name");
- name = gtk_entry_get_text (GTK_ENTRY (entry));
- if (script && *script) {
- struct stat st;
+ if (!stat (script, &st)
+ && S_ISREG (st.st_mode) && (st.st_mode & (S_IXOTH | S_IXGRP | S_IXUSR))) {
+ MailConfigSignature *sig;
+
+ sig = mail_composer_prefs_new_signature (prefs, TRUE, script);
+ mail_config_signature_set_name (sig, name);
+ g_free (name);
+ gtk_widget_hide (prefs->sig_script_dialog);
- if (!stat (script, &st) && S_ISREG (st.st_mode) && access (script, X_OK) == 0) {
- MailConfigSignature *sig;
- GtkWidget *parent;
-
- parent = gtk_widget_get_toplevel ((GtkWidget *) prefs);
- parent = GTK_WIDGET_TOPLEVEL (parent) ? parent : NULL;
-
- sig = mail_composer_prefs_new_signature ((GtkWindow *) parent, TRUE, script);
- mail_config_signature_set_name (sig, name);
- mail_config_signature_add (sig);
-
- gtk_widget_hide (prefs->sig_script_dialog);
-
- return;
- }
+ return;
}
-
- dialog = gtk_message_dialog_new (GTK_WINDOW (prefs->sig_script_dialog),
- GTK_DIALOG_DESTROY_WITH_PARENT,
- GTK_MESSAGE_ERROR, GTK_BUTTONS_CLOSE,
- "%s", _("You must specify a valid script name."));
-
- gtk_dialog_run ((GtkDialog *) dialog);
- gtk_widget_destroy (dialog);
}
-
- gtk_widget_hide (widget);
+ gnome_dialog_run_and_close (GNOME_DIALOG (gnome_ok_dialog_parented (_("Please specify a valid script name"),
+ GTK_WINDOW (prefs->sig_script_dialog))));
}
static void
-sig_add_script_cb (GtkWidget *widget, MailComposerPrefs *prefs)
+sig_add_script_cancel (GtkWidget *widget, MailComposerPrefs *prefs)
+{
+ gnome_dialog_close (GNOME_DIALOG (prefs->sig_script_dialog));
+}
+
+static void
+sig_add_script (GtkWidget *widget, MailComposerPrefs *prefs)
{
GtkWidget *entry;
entry = glade_xml_get_widget (prefs->sig_script_gui, "entry_add_script_name");
gtk_entry_set_text (GTK_ENTRY (entry), _("Unnamed"));
- gtk_widget_show (prefs->sig_script_dialog);
+ gtk_widget_show_all (prefs->sig_script_dialog);
gdk_window_raise (prefs->sig_script_dialog->window);
}
static void
-sig_selection_changed (GtkTreeSelection *selection, MailComposerPrefs *prefs)
+sig_row_select (GtkCList *clist, int row, int col, GdkEvent *event, MailComposerPrefs *prefs)
{
MailConfigSignature *sig;
- GtkTreeModel *model;
- GtkTreeIter iter;
- int state;
-
- state = gtk_tree_selection_get_selected (selection, &model, &iter);
- if (state) {
- gtk_tree_model_get (model, &iter, 1, &sig, -1);
- sig_load_preview (prefs, sig);
- }
- gtk_widget_set_sensitive ((GtkWidget *) prefs->sig_delete, state);
- gtk_widget_set_sensitive ((GtkWidget *) prefs->sig_edit, state);
+ d(printf ("sig_row_select\n"));
+ sig = gtk_clist_get_row_data (prefs->sig_clist, row);
+ prefs->sig_row = row;
+
+ gtk_widget_set_sensitive ((GtkWidget *) prefs->sig_delete, TRUE);
+ gtk_widget_set_sensitive ((GtkWidget *) prefs->sig_edit, sig->script == NULL);
+
+ sig_load_preview (prefs, sig);
}
static void
-sig_fill_clist (GtkTreeView *clist)
+sig_row_unselect (GtkCList *clist, int row, int col, GdkEvent *event, MailComposerPrefs *prefs)
{
- GSList *l;
- GtkListStore *model;
- GtkTreeIter iter;
-
- model = (GtkListStore *) gtk_tree_view_get_model (clist);
- gtk_list_store_clear (model);
+ d(printf ("sig_row_unselect\n"));
+ gtk_widget_set_sensitive ((GtkWidget *) prefs->sig_delete, FALSE);
+ gtk_widget_set_sensitive ((GtkWidget *) prefs->sig_edit, FALSE);
+}
+
+static void
+sig_fill_clist (GtkCList *clist)
+{
+ GList *l;
+ char *name[1];
+ int row;
+ gtk_clist_freeze (clist);
for (l = mail_config_get_signature_list (); l; l = l->next) {
- MailConfigSignature *sig = l->data;
- char *name = NULL, *val;
-
- gtk_list_store_append (model, &iter);
-
- if (sig->script)
- name = val = g_strconcat (sig->name, " ", _("[script]"), NULL);
- else
- val = sig->name;
- gtk_list_store_set (model, &iter, 0, val, 1, sig, -1);
- g_free (name);
+ name[0] = e_utf8_to_gtk_string (GTK_WIDGET (clist), ((MailConfigSignature *) l->data)->name);
+ if (((MailConfigSignature *) l->data)->script) {
+ char *tmp;
+
+ tmp = name [0];
+ name[0] = g_strconcat (name[0], _(" [script]"), NULL);
+ g_free (tmp);
+ }
+ row = gtk_clist_append (clist, name);
+ gtk_clist_set_row_data (clist, row, l->data);
+ g_free (name [0]);
}
+ gtk_clist_thaw (clist);
}
static void
url_requested (GtkHTML *html, const char *url, GtkHTMLStream *handle)
{
GtkHTMLStreamStatus status;
- char buf[128];
- ssize_t size;
int fd;
if (!strncmp (url, "file:", 5))
@@ -388,12 +387,14 @@ url_requested (GtkHTML *html, const char *url, GtkHTMLStream *handle)
fd = open (url, O_RDONLY);
status = GTK_HTML_STREAM_OK;
if (fd != -1) {
- while ((size = read (fd, buf, sizeof (buf)))) {
+ ssize_t size;
+ void *buf = alloca (1 << 7);
+ while ((size = read (fd, buf, 1 << 7))) {
if (size == -1) {
status = GTK_HTML_STREAM_ERROR;
break;
} else
- gtk_html_write (html, handle, buf, size);
+ gtk_html_write (html, handle, (const gchar *) buf, size);
}
} else
status = GTK_HTML_STREAM_ERROR;
@@ -404,46 +405,29 @@ url_requested (GtkHTML *html, const char *url, GtkHTMLStream *handle)
static void
sig_event_client (MailConfigSigEvent event, MailConfigSignature *sig, MailComposerPrefs *prefs)
{
- MailConfigSignature *current;
- GtkTreeSelection *selection;
- GtkTreeModel *model;
- GtkTreeIter iter;
- char path[16];
+ char *tmp, *tmp1;
switch (event) {
- case MAIL_CONFIG_SIG_EVENT_ADDED:
- d(printf ("signature ADDED\n"));
-
- model = gtk_tree_view_get_model (prefs->sig_list);
- gtk_list_store_append ((GtkListStore *) model, &iter);
- gtk_list_store_set ((GtkListStore *) model, &iter, 0, sig->name, 1, sig, -1);
- break;
case MAIL_CONFIG_SIG_EVENT_NAME_CHANGED:
- d(printf ("signature NAME CHANGED\n"));
-
- /* this is one bizarro interface */
- model = gtk_tree_view_get_model (prefs->sig_list);
- sprintf (path, "%d", sig->id);
- if (gtk_tree_model_get_iter_from_string (model, &iter, path)) {
- char *val, *name = NULL;
-
- if (sig->script)
- name = val = g_strconcat (sig->name, " ", _("[script]"), NULL);
- else
- val = sig->name;
-
- gtk_list_store_set ((GtkListStore *) model, &iter, 0, val, -1);
- g_free (name);
+ d(printf ("accounts NAME CHANGED\n"));
+ tmp = e_utf8_to_gtk_string (GTK_WIDGET (prefs->sig_clist), sig->name);
+ if (sig->script) {
+ tmp1 = tmp;
+ tmp = g_strconcat (tmp, _(" [script]"), NULL);
+ g_free (tmp1);
+ }
+ gtk_clist_set_text (GTK_CLIST (prefs->sig_clist), sig->id, 0, tmp);
+ g_free (tmp);
+ if (sig == sig_current_sig (prefs)) {
+ prefs->sig_switch = TRUE;
+ /*e_utf8_gtk_entry_set_text (GTK_ENTRY (prefs->sig_name), sig->name);*/
+ prefs->sig_switch = FALSE;
}
break;
case MAIL_CONFIG_SIG_EVENT_CONTENT_CHANGED:
- d(printf ("signature CONTENT CHANGED\n"));
- selection = gtk_tree_view_get_selection (prefs->sig_list);
- if (gtk_tree_selection_get_selected (selection, &model, &iter)) {
- gtk_tree_model_get (model, &iter, 1, &current, -1);
- if (sig == current)
- sig_load_preview (prefs, sig);
- }
+ d(printf ("accounts CONTENT CHANGED\n"));
+ if (sig == sig_current_sig (prefs))
+ sig_load_preview (prefs, sig);
break;
default:
;
@@ -459,38 +443,54 @@ sig_event_client (MailConfigSigEvent event, MailConfigSignature *sig, MailCompos
#include "Spell.h"
#define GNOME_SPELL_GCONF_DIR "/GNOME/Spell"
-#define SPELL_API_VERSION "0.3"
+#define SPELL_API_VERSION "0.2"
static void
-spell_set_ui (MailComposerPrefs *prefs)
+spell_select_lang (MailComposerPrefs *prefs, const gchar *abrev)
{
- GtkListStore *model;
- GtkTreeIter iter;
- GHashTable *present;
- gboolean go;
- char **strv;
int i;
+
+ for (i = 0; i < prefs->language_seq->_length; i ++) {
+ if (!strcasecmp (abrev, prefs->language_seq->_buffer [i].abrev)) {
+ gtk_clist_set_pixmap (GTK_CLIST (prefs->language), i, 0, prefs->mark_pixmap, prefs->mark_bitmap);
+ }
+ }
+}
- prefs->spell_active = FALSE;
-
- /* setup the language list */
- strv = g_strsplit (prefs->language_str, " ", 0);
- present = g_hash_table_new (g_str_hash, g_str_equal);
- for (i = 0; strv[i]; i++)
- g_hash_table_insert (present, strv[i], strv[i]);
+static void
+spell_set_ui_language (MailComposerPrefs *prefs)
+{
+ char *l, *last, *lang;
+ int i;
- model = (GtkListStore *) gtk_tree_view_get_model (prefs->language);
- for (go = gtk_tree_model_get_iter_first ((GtkTreeModel *) model, &iter); go;
- go = gtk_tree_model_iter_next ((GtkTreeModel *) model, &iter)) {
- char *abbr;
-
- gtk_tree_model_get ((GtkTreeModel *) model, &iter, 2, &abbr, -1);
- gtk_list_store_set (model, &iter, 0, g_hash_table_lookup (present, abbr) != NULL, -1);
+ gtk_clist_freeze (GTK_CLIST (prefs->language));
+ gtk_clist_unselect_all (GTK_CLIST (prefs->language));
+
+ for (i = 0; i < prefs->language_seq->_length; i ++) {
+ gtk_clist_set_pixmap (GTK_CLIST (prefs->language), i, 0, NULL, NULL);
}
- g_hash_table_destroy (present);
- g_strfreev (strv);
+ last = prefs->language_str;
+ while ((l = strchr (last, ' '))) {
+ if (l != last) {
+ lang = g_strndup (last, l - last);
+ spell_select_lang (prefs, lang);
+ g_free (lang);
+ }
+
+ last = l + 1;
+ }
+ if (last)
+ spell_select_lang (prefs, last);
+ gtk_clist_thaw (GTK_CLIST (prefs->language));
+}
+
+static void
+spell_set_ui (MailComposerPrefs *prefs)
+{
+ prefs->spell_active = FALSE;
+ spell_set_ui_language (prefs);
gnome_color_picker_set_i16 (GNOME_COLOR_PICKER (prefs->colour),
prefs->spell_error_color.red,
prefs->spell_error_color.green,
@@ -502,31 +502,26 @@ spell_set_ui (MailComposerPrefs *prefs)
static gchar *
spell_get_language_str (MailComposerPrefs *prefs)
{
- GString *str = g_string_new ("");
- GtkListStore *model;
- GtkTreeIter iter;
- gboolean go;
+ GString *str = g_string_new (NULL);
char *rv;
-
- model = (GtkListStore *) gtk_tree_view_get_model (prefs->language);
- for (go = gtk_tree_model_get_iter_first ((GtkTreeModel *) model, &iter);
- go;
- go = gtk_tree_model_iter_next ((GtkTreeModel *) model, &iter)) {
- char *abbr;
- gboolean state;
+ int i;
+
+ for (i = 0; i < GTK_CLIST (prefs->language)->rows; i ++) {
+ GdkPixmap *pmap = NULL;
+ GdkBitmap *bmap;
- gtk_tree_model_get ((GtkTreeModel *) model, &iter, 0, &state, 2, &abbr, -1);
- if (state) {
+ gtk_clist_get_pixmap (GTK_CLIST (prefs->language), i, 0, &pmap, &bmap);
+ if (pmap) {
if (str->len)
g_string_append_c (str, ' ');
- g_string_append (str, abbr);
+ g_string_append (str, gtk_clist_get_row_data (GTK_CLIST (prefs->language), i));
}
}
rv = str->str;
g_string_free (str, FALSE);
- return rv;
+ return rv ? rv : g_strdup ("");
}
static void
@@ -567,7 +562,7 @@ spell_load_values (MailComposerPrefs *prefs)
GConfValue *val;
char *def_lang;
- def_lang = g_strdup ("en_us");
+ def_lang = g_strdup ("en");
g_free (prefs->language_str);
prefs->language_str = g_strdup (def_lang);
prefs->spell_error_color.red = 0xffff;
@@ -639,111 +634,141 @@ spell_color_set (GtkWidget *widget, guint r, guint g, guint b, guint a, gpointer
}
static void
-spell_language_selection_changed (GtkTreeSelection *selection, MailComposerPrefs *prefs)
+spell_language_select_row (GtkWidget *widget, gint row, gint column, GdkEvent *event, MailComposerPrefs *prefs)
{
- GtkTreeIter iter;
- GtkTreeModel *model;
- gboolean state = FALSE;
-
- if (gtk_tree_selection_get_selected (selection, &model, &iter)) {
- gtk_tree_model_get ((GtkTreeModel *) model, &iter, 0, &state, -1);
- gtk_button_set_label ((GtkButton *) prefs->spell_able_button, state ? _("Disable") : _("Enable"));
- state = TRUE;
+ GList *sel = GTK_CLIST (prefs->language)->selection;
+
+ if (sel) {
+ GdkPixmap *pmap = NULL;
+ GdkBitmap *bmap;
+ int row = GPOINTER_TO_INT (sel->data);
+
+ gtk_clist_get_pixmap (GTK_CLIST (prefs->language), row, 0, &pmap, &bmap);
+ if (pmap)
+ gtk_label_set_text (GTK_LABEL (GTK_BIN (prefs->spell_able_button)->child), _("Disable"));
+ else
+ gtk_label_set_text (GTK_LABEL (GTK_BIN (prefs->spell_able_button)->child), _("Enable"));
}
- gtk_widget_set_sensitive (prefs->spell_able_button, state);
+
+ gtk_widget_set_sensitive (prefs->spell_able_button, TRUE);
+}
+
+static void
+spell_language_unselect_row (GtkWidget *widget, gint row, gint column, GdkEvent *event, MailComposerPrefs *prefs)
+{
+ gtk_widget_set_sensitive (prefs->spell_able_button, FALSE);
}
static void
spell_language_enable (GtkWidget *widget, MailComposerPrefs *prefs)
{
- GtkTreeIter iter;
- GtkTreeModel *model;
- GtkTreeSelection *selection;
- gboolean state;
+ GList *sel = GTK_CLIST (prefs->language)->selection;
- selection = gtk_tree_view_get_selection (prefs->language);
- if (gtk_tree_selection_get_selected (selection, &model, &iter)) {
- gtk_tree_model_get (model, &iter, 0, &state, -1);
- gtk_list_store_set ((GtkListStore *) model, &iter, 0, !state, -1);
- gtk_button_set_label ((GtkButton *) prefs->spell_able_button, state ? _("Enable") : _("Disable"));
+ if (sel) {
+ GdkPixmap *pmap = NULL;
+ GdkBitmap *bmap;
+ int row = GPOINTER_TO_INT (sel->data);
+
+ gtk_clist_get_pixmap (GTK_CLIST (prefs->language), row, 0, &pmap, &bmap);
+ if (pmap) {
+ gtk_clist_set_pixmap (GTK_CLIST (prefs->language), row, 0, NULL, NULL);
+ gtk_label_set_text (GTK_LABEL (GTK_BIN (prefs->spell_able_button)->child), _("Enable"));
+ } else {
+ gtk_label_set_text (GTK_LABEL (GTK_BIN (prefs->spell_able_button)->child), _("Disable"));
+ gtk_clist_set_pixmap (GTK_CLIST (prefs->language), row, 0, prefs->mark_pixmap, prefs->mark_bitmap);
+ }
+
spell_changed (prefs);
}
}
-static gboolean
-spell_language_button_press (GtkTreeView *tv, GdkEventButton *event, MailComposerPrefs *prefs)
+static void
+spell_language_button_press (GtkWidget *widget, GdkEventButton *event, MailComposerPrefs *prefs)
{
- GtkTreePath *path = NULL;
- GtkTreeViewColumn *column = NULL;
- gtk_tree_view_get_path_at_pos (tv, event->x, event->y, &path, &column, NULL, NULL);
-
- if (path != NULL && column != NULL && !strcmp (gtk_tree_view_column_get_title (column), _("Enabled"))) {
- GtkTreeIter iter;
- GtkTreeModel *model;
- gboolean enabled;
-
- model = gtk_tree_view_get_model (tv);
- gtk_tree_model_get_iter (model, &iter, path);
- gtk_tree_model_get (model, &iter, 0, &enabled, -1);
- gtk_list_store_set ((GtkListStore *) model, &iter, 0, !enabled, -1);
- spell_changed (prefs);
+ int row, col;
+
+ if (gtk_clist_get_selection_info (prefs->language, event->x, event->y, &row, &col)) {
+ if (col == 0) {
+ GList *sel = GTK_CLIST (prefs->language)->selection;
+ GdkPixmap *pmap = NULL;
+ GdkBitmap *bmap;
+
+ gtk_signal_emit_stop_by_name (GTK_OBJECT (widget), "button_press_event");
+
+ gtk_clist_get_pixmap (GTK_CLIST (prefs->language), row, 0, &pmap, &bmap);
+ if (pmap)
+ gtk_clist_set_pixmap (GTK_CLIST (prefs->language), row, 0, NULL, NULL);
+ else
+ gtk_clist_set_pixmap (GTK_CLIST (prefs->language), row, 0,
+ prefs->mark_pixmap, prefs->mark_bitmap);
+
+ if (sel && GPOINTER_TO_INT (sel->data) == row)
+ gtk_label_set_text (GTK_LABEL (GTK_BIN (prefs->spell_able_button)->child),
+ pmap ? _("Enable") : _("Disable"));
+
+ spell_changed (prefs);
+ }
}
-
- return FALSE;
}
static void
spell_setup (MailComposerPrefs *prefs)
{
- GtkListStore *model;
- GtkTreeIter iter;
int i;
- model = (GtkListStore *) gtk_tree_view_get_model (prefs->language);
-
+ gtk_clist_freeze (GTK_CLIST (prefs->language));
if (prefs->language_seq) {
for (i = 0; i < prefs->language_seq->_length; i++) {
- gtk_list_store_append (model, &iter);
- gtk_list_store_set (model, &iter,
- 1, _(prefs->language_seq->_buffer[i].name),
- 2, prefs->language_seq->_buffer[i].abbreviation,
- -1);
+ char *texts[2];
+
+ texts[0] = NULL;
+ texts[1] = _(prefs->language_seq->_buffer [i].name);
+ gtk_clist_append (GTK_CLIST (prefs->language), texts);
+ gtk_clist_set_row_data (GTK_CLIST (prefs->language), i, prefs->language_seq->_buffer [i].abrev);
}
}
+ gtk_clist_thaw (GTK_CLIST (prefs->language));
spell_load_values (prefs);
spell_set_ui (prefs);
- glade_xml_signal_connect_data (prefs->gui, "spellColorSet", G_CALLBACK (spell_color_set), prefs);
+ glade_xml_signal_connect_data (prefs->gui, "spellColorSet", GTK_SIGNAL_FUNC (spell_color_set), prefs);
+ glade_xml_signal_connect_data (prefs->gui, "spellLanguageSelectRow",
+ GTK_SIGNAL_FUNC (spell_language_select_row), prefs);
+ glade_xml_signal_connect_data (prefs->gui, "spellLanguageUnselectRow",
+ GTK_SIGNAL_FUNC (spell_language_unselect_row), prefs);
glade_xml_signal_connect_data (prefs->gui, "spellLanguageEnable", GTK_SIGNAL_FUNC (spell_language_enable), prefs);
- g_signal_connect (prefs->language, "button_press_event", G_CALLBACK (spell_language_button_press), prefs);
+ gtk_signal_connect (GTK_OBJECT (prefs->language), "button_press_event", spell_language_button_press, prefs);
}
static gboolean
spell_setup_check_options (MailComposerPrefs *prefs)
{
+ BonoboObjectClient *dictionary_client;
GNOME_Spell_Dictionary dict;
CORBA_Environment ev;
char *dictionary_id;
dictionary_id = "OAFIID:GNOME_Spell_Dictionary:" SPELL_API_VERSION;
- dict = bonobo_activation_activate_from_id (dictionary_id, 0, NULL, NULL);
- if (dict == CORBA_OBJECT_NIL) {
+ dictionary_client = bonobo_object_activate (dictionary_id, 0);
+
+ if (!dictionary_client) {
g_warning ("Cannot activate %s", dictionary_id);
return FALSE;
}
+ dict = bonobo_object_corba_objref (BONOBO_OBJECT (dictionary_client));
CORBA_exception_init (&ev);
prefs->language_seq = GNOME_Spell_Dictionary_getLanguages (dict, &ev);
if (ev._major != CORBA_NO_EXCEPTION)
prefs->language_seq = NULL;
CORBA_exception_free (&ev);
-
+
if (prefs->language_seq == NULL)
return FALSE;
-
+
gconf_client_add_dir (prefs->gconf, GNOME_SPELL_GCONF_DIR, GCONF_CLIENT_PRELOAD_NONE, NULL);
spell_setup (prefs);
@@ -759,13 +784,8 @@ static void
mail_composer_prefs_construct (MailComposerPrefs *prefs)
{
GtkWidget *toplevel, *widget, *menu, *info_pixmap;
- GtkDialog *dialog;
GladeXML *gui;
- GtkListStore *model;
- GtkTreeSelection *selection;
- gboolean bool;
int style;
- char *buf;
char *names[][2] = {
{ "live_spell_check", "chkEnableSpellChecking" },
{ "magic_smileys_check", "chkAutoSmileys" },
@@ -775,9 +795,9 @@ mail_composer_prefs_construct (MailComposerPrefs *prefs)
prefs->gconf = gconf_client_get_default ();
- gui = glade_xml_new (EVOLUTION_GLADEDIR "/mail-config.glade", "composer_tab", NULL);
+ gui = glade_xml_new (EVOLUTION_GLADEDIR "/mail-config.glade", "composer_tab");
prefs->gui = gui;
- prefs->sig_script_gui = glade_xml_new (EVOLUTION_GLADEDIR "/mail-config.glade", "vbox_add_script_signature", NULL);
+ prefs->sig_script_gui = glade_xml_new (EVOLUTION_GLADEDIR "/mail-config.glade", "vbox_add_script_signature");
/* get our toplevel widget */
toplevel = glade_xml_get_widget (gui, "toplevel");
@@ -792,66 +812,46 @@ mail_composer_prefs_construct (MailComposerPrefs *prefs)
/* Default Behavior */
prefs->send_html = GTK_TOGGLE_BUTTON (glade_xml_get_widget (gui, "chkSendHTML"));
- bool = gconf_client_get_bool (prefs->gconf, "/apps/evolution/mail/composer/send_html", NULL);
- gtk_toggle_button_set_active (prefs->send_html, bool);
- g_signal_connect (prefs->send_html, "toggled", G_CALLBACK (toggle_button_toggled), prefs);
+ gtk_toggle_button_set_active (prefs->send_html, mail_config_get_send_html ());
+ gtk_signal_connect (GTK_OBJECT (prefs->send_html), "toggled",
+ toggle_button_toggled, prefs);
prefs->auto_smileys = GTK_TOGGLE_BUTTON (glade_xml_get_widget (gui, "chkAutoSmileys"));
- /* FIXME: set active? */
- g_signal_connect (prefs->auto_smileys, "toggled", G_CALLBACK (toggle_button_toggled), prefs);
+ gtk_signal_connect (GTK_OBJECT (prefs->auto_smileys), "toggled",
+ toggle_button_toggled, prefs);
prefs->prompt_empty_subject = GTK_TOGGLE_BUTTON (glade_xml_get_widget (gui, "chkPromptEmptySubject"));
- bool = gconf_client_get_bool (prefs->gconf, "/apps/evolution/mail/prompts/empty_subject", NULL);
- gtk_toggle_button_set_active (prefs->prompt_empty_subject, bool);
- g_signal_connect (prefs->prompt_empty_subject, "toggled", G_CALLBACK (toggle_button_toggled), prefs);
+ gtk_toggle_button_set_active (prefs->prompt_empty_subject, mail_config_get_prompt_empty_subject ());
+ gtk_signal_connect (GTK_OBJECT (prefs->prompt_empty_subject), "toggled",
+ toggle_button_toggled, prefs);
prefs->prompt_bcc_only = GTK_TOGGLE_BUTTON (glade_xml_get_widget (gui, "chkPromptBccOnly"));
- bool = gconf_client_get_bool (prefs->gconf, "/apps/evolution/mail/prompts/only_bcc", NULL);
- gtk_toggle_button_set_active (prefs->prompt_bcc_only, bool);
- g_signal_connect (prefs->prompt_bcc_only, "toggled", G_CALLBACK (toggle_button_toggled), prefs);
+ gtk_toggle_button_set_active (prefs->prompt_bcc_only, mail_config_get_prompt_only_bcc ());
+ gtk_signal_connect (GTK_OBJECT (prefs->prompt_bcc_only), "toggled",
+ toggle_button_toggled, prefs);
prefs->charset = GTK_OPTION_MENU (glade_xml_get_widget (gui, "omenuCharset"));
- buf = gconf_client_get_string (prefs->gconf, "/apps/evolution/mail/composer/charset", NULL);
- menu = e_charset_picker_new (buf ? buf : e_iconv_locale_charset ());
+ menu = e_charset_picker_new (mail_config_get_default_charset ());
gtk_option_menu_set_menu (prefs->charset, GTK_WIDGET (menu));
option_menu_connect (prefs->charset, prefs);
- g_free (buf);
-#warning "gtkhtml prop manager"
-#if 0
/* Spell Checking: GtkHTML part */
prefs->pman = GTK_HTML_PROPMANAGER (gtk_html_propmanager_new (NULL));
- g_signal_connect (prefs->pman, "changed", G_CALLBACK(toggle_button_toggled), prefs);
- g_object_ref (prefs->pman);
+ gtk_signal_connect (GTK_OBJECT (prefs->pman), "changed", toggle_button_toggled, prefs);
+ gtk_object_ref (GTK_OBJECT (prefs->pman));
gtk_html_propmanager_set_names (prefs->pman, names);
gtk_html_propmanager_set_gui (prefs->pman, gui, NULL);
-#endif
-
+
/* Spell Checking: GNOME Spell part */
prefs->colour = GNOME_COLOR_PICKER (glade_xml_get_widget (gui, "colorpickerSpellCheckColor"));
- prefs->language = GTK_TREE_VIEW (glade_xml_get_widget (gui, "clistSpellCheckLanguage"));
- model = gtk_list_store_new (3, G_TYPE_BOOLEAN, G_TYPE_STRING, G_TYPE_POINTER);
- gtk_tree_view_set_model (prefs->language, (GtkTreeModel *) model);
- gtk_tree_view_insert_column_with_attributes (prefs->language, -1, _("Enabled"),
- gtk_cell_renderer_toggle_new (),
- "active", 0,
- NULL);
- gtk_tree_view_insert_column_with_attributes (prefs->language, -1, _("Language(s)"),
- gtk_cell_renderer_text_new (),
- "text", 1,
- NULL);
- selection = gtk_tree_view_get_selection (prefs->language);
- gtk_tree_selection_set_mode (selection, GTK_SELECTION_SINGLE);
- g_signal_connect (selection, "changed", G_CALLBACK (spell_language_selection_changed), prefs);
-#if 0
- gtk_clist_set_column_justification (prefs->language, 0, GTK_JUSTIFY_RIGHT);
- gtk_clist_set_column_auto_resize (prefs->language, 0, TRUE);
-#endif
-
+ prefs->language = GTK_CLIST (glade_xml_get_widget (gui, "clistSpellCheckLanguage"));
prefs->spell_able_button = glade_xml_get_widget (gui, "buttonSpellCheckEnable");
info_pixmap = glade_xml_get_widget (gui, "pixmapSpellInfo");
- gtk_image_set_from_file (GTK_IMAGE (info_pixmap), EVOLUTION_IMAGES "/info-bulb.png");
+ gtk_clist_set_column_justification (prefs->language, 0, GTK_JUSTIFY_RIGHT);
+ gtk_clist_set_column_auto_resize (prefs->language, 0, TRUE);
+ gnome_pixmap_load_file (GNOME_PIXMAP (info_pixmap), EVOLUTION_IMAGES "/info-bulb.png");
+
if (!spell_setup_check_options (prefs)) {
gtk_widget_hide (GTK_WIDGET (prefs->colour));
gtk_widget_hide (GTK_WIDGET (prefs->language));
@@ -859,55 +859,48 @@ mail_composer_prefs_construct (MailComposerPrefs *prefs)
/* Forwards and Replies */
prefs->forward_style = GTK_OPTION_MENU (glade_xml_get_widget (gui, "omenuForwardStyle"));
- style = gconf_client_get_int (prefs->gconf, "/apps/evolution/mail/format/forward_style", NULL);
- gtk_option_menu_set_history (prefs->forward_style, style);
+ gtk_option_menu_set_history (prefs->forward_style, mail_config_get_default_forward_style ());
style = 0;
gtk_container_foreach (GTK_CONTAINER (gtk_option_menu_get_menu (prefs->forward_style)),
attach_style_info, &style);
option_menu_connect (prefs->forward_style, prefs);
prefs->reply_style = GTK_OPTION_MENU (glade_xml_get_widget (gui, "omenuReplyStyle"));
- style = gconf_client_get_int (prefs->gconf, "/apps/evolution/mail/format/reply_style", NULL);
- gtk_option_menu_set_history (prefs->reply_style, style);
+ gtk_option_menu_set_history (prefs->reply_style, mail_config_get_default_reply_style ());
style = 0;
gtk_container_foreach (GTK_CONTAINER (gtk_option_menu_get_menu (prefs->reply_style)),
attach_style_info, &style);
option_menu_connect (prefs->reply_style, prefs);
/* Signatures */
- dialog = (GtkDialog *) gtk_dialog_new ();
- prefs->sig_script_dialog = (GtkWidget *) dialog;
- gtk_dialog_add_buttons (dialog, GTK_STOCK_CANCEL, GTK_RESPONSE_REJECT,
- GTK_STOCK_OK, GTK_RESPONSE_ACCEPT, NULL);
- gtk_window_set_title ((GtkWindow *) dialog, _("Add script signature"));
- g_signal_connect (dialog, "response", G_CALLBACK (sig_add_script_response), prefs);
- widget = glade_xml_get_widget (prefs->sig_script_gui, "vbox_add_script_signature");
- gtk_box_pack_start_defaults ((GtkBox *) dialog->vbox, widget);
-
prefs->sig_add = GTK_BUTTON (glade_xml_get_widget (gui, "cmdSignatureAdd"));
- g_signal_connect (prefs->sig_add, "clicked", G_CALLBACK (sig_add_cb), prefs);
+ gtk_signal_connect (GTK_OBJECT (prefs->sig_add), "clicked",
+ GTK_SIGNAL_FUNC (sig_add), prefs);
- glade_xml_signal_connect_data (gui, "cmdSignatureAddScriptClicked",
- G_CALLBACK (sig_add_script_cb), prefs);
+ prefs->sig_script_dialog = gnome_dialog_new (_("Add script signature"),
+ _("Add Signature"), GNOME_STOCK_BUTTON_CANCEL, NULL);
+ gnome_dialog_close_hides (GNOME_DIALOG (prefs->sig_script_dialog), TRUE);
+ gtk_box_pack_start_defaults (GTK_BOX (GNOME_DIALOG (prefs->sig_script_dialog)->vbox),
+ glade_xml_get_widget (prefs->sig_script_gui, "vbox_add_script_signature"));
+ gnome_dialog_button_connect (GNOME_DIALOG (prefs->sig_script_dialog), 0, sig_add_script_add, prefs);
+ gnome_dialog_button_connect (GNOME_DIALOG (prefs->sig_script_dialog), 1, sig_add_script_cancel, prefs);
+
+ glade_xml_signal_connect_data (gui, "cmdSignatureAddScriptClicked", sig_add_script, prefs);
prefs->sig_edit = GTK_BUTTON (glade_xml_get_widget (gui, "cmdSignatureEdit"));
- g_signal_connect (prefs->sig_edit, "clicked", G_CALLBACK (sig_edit_cb), prefs);
+ gtk_signal_connect (GTK_OBJECT (prefs->sig_edit), "clicked",
+ GTK_SIGNAL_FUNC (sig_edit), prefs);
prefs->sig_delete = GTK_BUTTON (glade_xml_get_widget (gui, "cmdSignatureDelete"));
- g_signal_connect (prefs->sig_delete, "clicked", G_CALLBACK (sig_delete_cb), prefs);
-
- prefs->sig_list = GTK_TREE_VIEW (glade_xml_get_widget (gui, "clistSignatures"));
- model = gtk_list_store_new (2, G_TYPE_STRING, G_TYPE_POINTER);
- gtk_tree_view_set_model (prefs->sig_list, (GtkTreeModel *)model);
- gtk_tree_view_insert_column_with_attributes (prefs->sig_list, -1, _("Signature(s)"),
- gtk_cell_renderer_text_new (),
- "text", 0,
- NULL);
- selection = gtk_tree_view_get_selection (prefs->sig_list);
- gtk_tree_selection_set_mode (selection, GTK_SELECTION_SINGLE);
- g_signal_connect (selection, "changed", G_CALLBACK (sig_selection_changed), prefs);
-
- sig_fill_clist (prefs->sig_list);
+ gtk_signal_connect (GTK_OBJECT (prefs->sig_delete), "clicked",
+ GTK_SIGNAL_FUNC (sig_delete), prefs);
+
+ prefs->sig_clist = GTK_CLIST (glade_xml_get_widget (gui, "clistSignatures"));
+ sig_fill_clist (prefs->sig_clist);
+ gtk_signal_connect (GTK_OBJECT (prefs->sig_clist), "select_row",
+ GTK_SIGNAL_FUNC (sig_row_select), prefs);
+ gtk_signal_connect (GTK_OBJECT (prefs->sig_clist), "unselect_row",
+ GTK_SIGNAL_FUNC (sig_row_unselect), prefs);
if (mail_config_get_signature_list () == NULL) {
gtk_widget_set_sensitive ((GtkWidget *) prefs->sig_delete, FALSE);
gtk_widget_set_sensitive ((GtkWidget *) prefs->sig_edit, FALSE);
@@ -916,10 +909,13 @@ mail_composer_prefs_construct (MailComposerPrefs *prefs)
/* preview GtkHTML widget */
widget = glade_xml_get_widget (gui, "scrolled-sig");
prefs->sig_preview = (GtkHTML *) gtk_html_new ();
- g_signal_connect (prefs->sig_preview, "url_requested", G_CALLBACK (url_requested), NULL);
+ gtk_signal_connect (GTK_OBJECT (prefs->sig_preview), "url_requested", GTK_SIGNAL_FUNC (url_requested), NULL);
gtk_widget_show (GTK_WIDGET (prefs->sig_preview));
gtk_container_add (GTK_CONTAINER (widget), GTK_WIDGET (prefs->sig_preview));
+ if (GTK_CLIST (prefs->sig_clist)->rows)
+ gtk_clist_select_row (GTK_CLIST (prefs->sig_clist), 0, 0);
+
mail_config_signature_register_client ((MailConfigSignatureClient) sig_event_client, prefs);
}
@@ -929,7 +925,7 @@ mail_composer_prefs_new (void)
{
MailComposerPrefs *new;
- new = (MailComposerPrefs *) g_object_new (mail_composer_prefs_get_type (), NULL);
+ new = (MailComposerPrefs *) gtk_type_new (mail_composer_prefs_get_type ());
mail_composer_prefs_construct (new);
return (GtkWidget *) new;
@@ -946,45 +942,35 @@ mail_composer_prefs_apply (MailComposerPrefs *prefs)
/* General tab */
/* Default Behavior */
- gconf_client_set_bool (prefs->gconf, "/apps/evolution/mail/composer/send_html",
- gtk_toggle_button_get_active (prefs->send_html), NULL);
-
- gconf_client_set_bool (prefs->gconf, "/apps/evolution/mail/prompts/empty_subject",
- gtk_toggle_button_get_active (prefs->prompt_empty_subject), NULL);
-
- gconf_client_set_bool (prefs->gconf, "/apps/evolution/mail/prompts/only_bcc",
- gtk_toggle_button_get_active (prefs->prompt_bcc_only), NULL);
+ mail_config_set_send_html (gtk_toggle_button_get_active (prefs->send_html));
+ mail_config_set_prompt_empty_subject (gtk_toggle_button_get_active (prefs->prompt_empty_subject));
+ mail_config_set_prompt_only_bcc (gtk_toggle_button_get_active (prefs->prompt_bcc_only));
menu = gtk_option_menu_get_menu (prefs->charset);
- if (!(string = e_charset_picker_get_charset (menu)))
- string = g_strdup (e_iconv_locale_charset ());
-
- gconf_client_set_string (prefs->gconf, "/apps/evolution/mail/composer/charset", string, NULL);
- g_free (string);
+ string = e_charset_picker_get_charset (menu);
+ if (string) {
+ mail_config_set_default_charset (string);
+ g_free (string);
+ }
/* Spell Checking */
-#warning "gtkhtml propmanager"
-#if 0
gtk_html_propmanager_apply (prefs->pman);
-#endif
spell_apply (prefs);
/* Forwards and Replies */
menu = gtk_option_menu_get_menu (prefs->forward_style);
item = gtk_menu_get_active (GTK_MENU (menu));
- val = GPOINTER_TO_INT (g_object_get_data ((GObject *) item, "style"));
- gconf_client_set_int (prefs->gconf, "/apps/evolution/mail/format/forward_style", val, NULL);
+ val = GPOINTER_TO_INT (gtk_object_get_data (GTK_OBJECT (item), "style"));
+ mail_config_set_default_forward_style (val);
menu = gtk_option_menu_get_menu (prefs->reply_style);
item = gtk_menu_get_active (GTK_MENU (menu));
- val = GPOINTER_TO_INT (g_object_get_data ((GObject *) item, "style"));
- gconf_client_set_int (prefs->gconf, "/apps/evolution/mail/format/reply_style", val, NULL);
+ val = GPOINTER_TO_INT (gtk_object_get_data (GTK_OBJECT (item), "style"));
+ mail_config_set_default_reply_style (val);
/* Keyboard Shortcuts */
/* FIXME: implement me */
/* Signatures */
/* FIXME: implement me */
-
- gconf_client_suggest_sync (prefs->gconf, NULL);
}
diff --git a/mail/mail-config-druid.c b/mail/mail-config-druid.c
index 6210d8177b..6afa19b642 100644
--- a/mail/mail-config-druid.c
+++ b/mail/mail-config-druid.c
@@ -23,7 +23,6 @@
*
*/
-
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
@@ -33,23 +32,38 @@
#include <string.h>
#include <unistd.h>
-#include <gal/util/e-util.h>
-#include <glade/glade.h>
-#include <gtkhtml/gtkhtml.h>
#include <libgnomeui/gnome-dialog.h>
#include <libgnomeui/gnome-dialog-util.h>
#include <libgnomeui/gnome-druid.h>
#include <libgnomeui/gnome-druid-page-standard.h>
-#include <bonobo/bonobo-exception.h>
-
+#include <glade/glade.h>
+#include <gtkhtml/gtkhtml.h>
+#include <gal/widgets/e-unicode.h>
#include "mail-config-druid.h"
#include "mail-config.h"
#include "mail-ops.h"
#include "mail.h"
#include "mail-session.h"
+#include <bonobo/bonobo-exception.h>
+#include <bonobo/bonobo-control.h>
+#include <bonobo/bonobo-widget.h>
+#include <bonobo/bonobo-generic-factory.h>
+#include <bonobo/bonobo-context.h>
+
#include <evolution-wizard.h>
-#include <e-util/e-account.h>
+
+static void mail_config_druid_class_init (MailConfigDruidClass *class);
+static void mail_config_druid_finalize (GtkObject *obj);
+
+static GtkWindowClass *parent_class;
+
+/* These globals need fixed FIXME FIXME FIXME FIXME*/
+static GHashTable *page_hash = NULL;
+static GList *page_list = NULL;
+static EvolutionWizard *account_wizard;
+
+#define WIZARD_IID "OAFIID:GNOME_Evolution_Mail_Wizard_Factory"
typedef enum {
MAIL_CONFIG_WIZARD_PAGE_NONE = -1,
@@ -58,202 +72,294 @@ typedef enum {
MAIL_CONFIG_WIZARD_PAGE_EXTRA,
MAIL_CONFIG_WIZARD_PAGE_TRANSPORT,
MAIL_CONFIG_WIZARD_PAGE_MANAGEMENT,
-
- MAIL_CONFIG_WIZARD_NUM_PAGES
} MailConfigWizardPage;
typedef struct {
- /* Only one of these will be set */
- GnomeDruid *druid;
- EvolutionWizard *corba_wizard;
-
MailAccountGui *gui;
- GPtrArray *interior_pages;
- GnomeDruidPage *last_page;
+ MailConfigAccount *account;
+ EvolutionWizard *wizard;
gboolean identity_copied;
CamelProvider *last_source;
MailConfigWizardPage page;
} MailConfigWizard;
+GtkType
+mail_config_druid_get_type (void)
+{
+ static GtkType type = 0;
+
+ if (!type) {
+ GtkTypeInfo type_info = {
+ "MailConfigDruid",
+ sizeof (MailConfigDruid),
+ sizeof (MailConfigDruidClass),
+ (GtkClassInitFunc) mail_config_druid_class_init,
+ (GtkObjectInitFunc) NULL,
+ (GtkArgSetFunc) NULL,
+ (GtkArgGetFunc) NULL
+ };
+
+ type = gtk_type_unique (gtk_window_get_type (), &type_info);
+ }
+
+ return type;
+}
+
+static void
+mail_config_druid_class_init (MailConfigDruidClass *class)
+{
+ GtkObjectClass *object_class;
+
+ object_class = (GtkObjectClass *) class;
+ parent_class = gtk_type_class (gtk_window_get_type ());
+
+ /* override methods */
+ object_class->finalize = mail_config_druid_finalize;
+}
+
+static void
+mail_config_druid_finalize (GtkObject *obj)
+{
+ MailConfigDruid *druid = (MailConfigDruid *) obj;
+ CORBA_Environment ev;
+
+ gtk_object_destroy (GTK_OBJECT (druid->xml));
+
+ CORBA_exception_init (&ev);
+ Bonobo_EventSource_removeListener ((Bonobo_EventSource) druid->event_source, druid->id, &ev);
+ CORBA_exception_free (&ev);
+
+ bonobo_object_release_unref ((Bonobo_Unknown) druid->event_source, &ev);
+ bonobo_object_unref (BONOBO_OBJECT (druid->listener));
+
+ ((GtkObjectClass *)(parent_class))->finalize (obj);
+}
+static struct {
+ char *name;
+ char *text;
+} info[] = {
+ { "identity_html",
+ N_("Please enter your name and email address below. The \"optional\" fields below do not need to be filled in, unless you wish to include this information in email you send.") },
+ { "source_html",
+ N_("Please enter information about your incoming mail server below. If you are not sure, ask your system administrator or Internet Service Provider.") },
+ { "extra_html",
+ N_("Please select among the following options") },
+ { "transport_html",
+ N_("Please enter information about the way you will send mail. If you are not sure, ask your system administrator or Internet Service Provider.") },
+ { "management_html",
+ N_("You are almost done with the mail configuration process. The identity, incoming mail server and outgoing mail transport method which you provided will be grouped together to make an Evolution mail account. Please enter a name for this account in the space below. This name will be used for display purposes only.") }
+};
+static int num_info = (sizeof (info) / sizeof (info[0]));
+
+static GtkWidget *
+create_label (const char *name)
+{
+ GtkWidget *widget, *align;
+ int i;
+
+ for (i = 0; i < num_info; i++) {
+ if (!strcmp (name, info[i].name))
+ break;
+ }
+
+ g_return_val_if_fail (i != num_info, NULL);
+
+ widget = gtk_label_new (_(info[i].text));
+ gtk_label_set_line_wrap (GTK_LABEL (widget), TRUE);
+ gtk_label_set_justify (GTK_LABEL (widget), GTK_JUSTIFY_FILL);
+ gtk_widget_show (widget);
+
+ align = gtk_alignment_new (0.0, 0.5, 1.0, 1.0);
+ gtk_container_add (GTK_CONTAINER (align), widget);
+
+ gtk_widget_show (align);
+
+ return align;
+}
static void
-config_wizard_set_buttons_sensitive (MailConfigWizard *mcw,
- gboolean prev_sensitive,
- gboolean next_sensitive)
-{
- if (mcw->corba_wizard) {
- evolution_wizard_set_buttons_sensitive (mcw->corba_wizard,
- prev_sensitive,
- next_sensitive,
- TRUE, NULL);
- } else {
- gnome_druid_set_buttons_sensitive (mcw->druid,
- prev_sensitive,
- next_sensitive,
- TRUE, FALSE);
+druid_cancel (GnomeDruid *druid, gpointer user_data)
+{
+ MailConfigDruid *config = user_data;
+ GNOME_Evolution_Wizard wiz;
+ CORBA_Environment ev;
+
+ wiz = bonobo_object_corba_objref (BONOBO_OBJECT (account_wizard));
+ CORBA_exception_init (&ev);
+
+ GNOME_Evolution_Wizard_notifyAction (wiz, 0, GNOME_Evolution_Wizard_CANCEL, &ev);
+ CORBA_exception_free (&ev);
+
+ if (page_list != NULL) {
+ g_list_free (page_list);
+ page_list = NULL;
+ }
+
+ if (page_hash != NULL) {
+ g_hash_table_destroy (page_hash);
+ page_hash = NULL;
}
+
+ gtk_widget_destroy (GTK_WIDGET (config));
}
static void
-config_wizard_set_page (MailConfigWizard *mcw, MailConfigWizardPage page)
+druid_finish (GnomeDruidPage *page, gpointer arg1, gpointer user_data)
{
- if (mcw->corba_wizard)
- evolution_wizard_set_page (mcw->corba_wizard, page, NULL);
- else {
- if (page <= mcw->interior_pages->len)
- gnome_druid_set_page (mcw->druid, mcw->interior_pages->pdata[page]);
- else
- gnome_druid_set_page (mcw->druid, mcw->last_page);
+ MailConfigDruid *druid = user_data;
+
+ gtk_object_set_data (GTK_OBJECT (account_wizard), "account-data", NULL);
+ if (page_list != NULL) {
+ g_list_free (page_list);
+ page_list = NULL;
+ }
+
+ if (page_hash != NULL) {
+ g_hash_table_destroy (page_hash);
+ page_hash = NULL;
}
+
+ gtk_widget_destroy (GTK_WIDGET (druid));
}
/* Identity Page */
static void
identity_changed (GtkWidget *widget, gpointer data)
{
- MailConfigWizard *mcw = data;
+ MailConfigWizard *gui = data;
GtkWidget *incomplete;
gboolean next_sensitive;
- if (mcw->page != MAIL_CONFIG_WIZARD_PAGE_IDENTITY)
+ if (gui->page != MAIL_CONFIG_WIZARD_PAGE_IDENTITY)
return;
- next_sensitive = mail_account_gui_identity_complete (mcw->gui, &incomplete);
+ next_sensitive = mail_account_gui_identity_complete (gui->gui, &incomplete);
- config_wizard_set_buttons_sensitive (mcw, TRUE, next_sensitive);
+ evolution_wizard_set_buttons_sensitive (gui->wizard, TRUE, next_sensitive, TRUE, NULL);
if (!next_sensitive)
gtk_widget_grab_focus (incomplete);
}
static void
-identity_prepare (MailConfigWizard *mcw)
+identity_prepare (EvolutionWizard *wizard, gpointer data)
{
+ MailConfigWizard *gui = data;
const char *name;
- mcw->page = MAIL_CONFIG_WIZARD_PAGE_IDENTITY;
+ gui->page = MAIL_CONFIG_WIZARD_PAGE_IDENTITY;
- name = gtk_entry_get_text (mcw->gui->full_name);
+ name = gtk_entry_get_text (gui->gui->full_name);
if (!name) {
name = g_get_real_name ();
- gtk_entry_set_text (mcw->gui->full_name, name ? name : "");
- gtk_editable_select_region (GTK_EDITABLE (mcw->gui->full_name), 0, -1);
+ gtk_entry_set_text (gui->gui->full_name, name ? name : "");
+ gtk_entry_select_region (gui->gui->full_name, 0, -1);
}
- gtk_widget_grab_focus (GTK_WIDGET (mcw->gui->full_name));
- identity_changed (NULL, mcw);
+ gtk_widget_grab_focus (GTK_WIDGET (gui->gui->full_name));
+ identity_changed (NULL, data);
}
static gboolean
-identity_next (MailConfigWizard *mcw)
+identity_next (EvolutionWizard *wizard, gpointer data)
{
- if (!mcw->identity_copied) {
+ MailConfigWizard *gui = data;
+
+ if (!gui->identity_copied) {
char *username;
- const char *user;
-
+
/* Copy the username part of the email address into
* the Username field of the source and transport pages.
*/
- user = gtk_entry_get_text (mcw->gui->email_address);
- username = g_strndup (user, strcspn (user, "@"));
- gtk_entry_set_text (mcw->gui->source.username, username);
- gtk_entry_set_text (mcw->gui->transport.username, username);
+ username = gtk_entry_get_text (gui->gui->email_address);
+ username = g_strndup (username, strcspn (username, "@"));
+ gtk_entry_set_text (gui->gui->source.username, username);
+ gtk_entry_set_text (gui->gui->transport.username, username);
g_free (username);
- mcw->identity_copied = TRUE;
+ gui->identity_copied = TRUE;
}
return FALSE;
}
-static void
-identity_activate_cb (GtkEntry *ent, gpointer user_data)
-{
- MailConfigWizard *mcw = user_data;
-
- if (mail_account_gui_identity_complete (mcw->gui, NULL) &&
- !identity_next (mcw))
- config_wizard_set_page (mcw, MAIL_CONFIG_WIZARD_PAGE_SOURCE);
-}
-
/* Incoming mail Page */
static void
source_changed (GtkWidget *widget, gpointer data)
{
- MailConfigWizard *mcw = data;
+ MailConfigWizard *gui = data;
GtkWidget *incomplete;
gboolean next_sensitive;
- if (mcw->page != MAIL_CONFIG_WIZARD_PAGE_SOURCE)
+ if (gui->page != MAIL_CONFIG_WIZARD_PAGE_SOURCE)
return;
- next_sensitive = mail_account_gui_source_complete (mcw->gui, &incomplete);
+ next_sensitive = mail_account_gui_source_complete (gui->gui, &incomplete);
- config_wizard_set_buttons_sensitive (mcw, TRUE, next_sensitive);
+ evolution_wizard_set_buttons_sensitive (gui->wizard, TRUE, next_sensitive, TRUE, NULL);
if (!next_sensitive)
gtk_widget_grab_focus (incomplete);
}
static void
-source_prepare (MailConfigWizard *mcw)
+source_prepare (EvolutionWizard *wizard, gpointer data)
{
- mcw->page = MAIL_CONFIG_WIZARD_PAGE_SOURCE;
- source_changed (NULL, mcw);
+ MailConfigWizard *gui = data;
+
+ gui->page = MAIL_CONFIG_WIZARD_PAGE_SOURCE;
+ source_changed (NULL, gui);
}
static gboolean
-source_next (MailConfigWizard *mcw)
+source_next (EvolutionWizard *wizard, gpointer data)
{
+ MailConfigWizard *gui = data;
+
/* FIXME: if online, check that the data is good. */
- if (mcw->gui->source.provider && mcw->gui->source.provider->extra_conf)
+ if (gui->gui->source.provider && gui->gui->source.provider->extra_conf)
return FALSE;
/* Otherwise, skip to transport page. */
- config_wizard_set_page (mcw, MAIL_CONFIG_WIZARD_PAGE_TRANSPORT);
+ evolution_wizard_set_page (gui->wizard, MAIL_CONFIG_WIZARD_PAGE_TRANSPORT, NULL);
+
return TRUE;
}
-static void
-source_activate_cb (GtkEntry *ent, gpointer user_data)
-{
- MailConfigWizard *mcw = user_data;
-
- if (mail_account_gui_source_complete (mcw->gui, NULL) &&
- !source_next (mcw))
- config_wizard_set_page (mcw, MAIL_CONFIG_WIZARD_PAGE_EXTRA);
-}
-
/* Extra Config Page */
static void
-extra_prepare (MailConfigWizard *mcw)
+extra_prepare (EvolutionWizard *wizard, gpointer data)
{
- mcw->page = MAIL_CONFIG_WIZARD_PAGE_EXTRA;
- if (mcw->gui->source.provider != mcw->last_source) {
- mcw->last_source = mcw->gui->source.provider;
- mail_account_gui_auto_detect_extra_conf (mcw->gui);
+ MailConfigWizard *gui = data;
+
+ gui->page = MAIL_CONFIG_WIZARD_PAGE_EXTRA;
+ if (gui->gui->source.provider != gui->last_source) {
+ gui->last_source = gui->gui->source.provider;
+ mail_account_gui_auto_detect_extra_conf (gui->gui);
}
}
/* Transport Page */
static gboolean
-transport_next (MailConfigWizard *mcw)
+transport_next (EvolutionWizard *wizard, gpointer data)
{
/* FIXME: if online, check that the data is good. */
return FALSE;
}
static gboolean
-transport_back (MailConfigWizard *mcw)
+transport_back (EvolutionWizard *wizard, gpointer data)
{
- if (mcw->gui->source.provider && mcw->gui->source.provider->extra_conf)
+ MailConfigWizard *gui = data;
+
+ if (gui->gui->source.provider && gui->gui->source.provider->extra_conf)
return FALSE;
else {
- config_wizard_set_page (mcw, MAIL_CONFIG_WIZARD_PAGE_SOURCE);
+ evolution_wizard_set_page (wizard, MAIL_CONFIG_WIZARD_PAGE_SOURCE, NULL);
return TRUE;
}
}
@@ -261,66 +367,60 @@ transport_back (MailConfigWizard *mcw)
static void
transport_changed (GtkWidget *widget, gpointer data)
{
- MailConfigWizard *mcw = data;
+ MailConfigWizard *gui = data;
GtkWidget *incomplete;
gboolean next_sensitive;
- if (mcw->page != MAIL_CONFIG_WIZARD_PAGE_TRANSPORT)
+ if (gui->page != MAIL_CONFIG_WIZARD_PAGE_TRANSPORT)
return;
- next_sensitive = mail_account_gui_transport_complete (mcw->gui, &incomplete);
+ next_sensitive = mail_account_gui_transport_complete (gui->gui, &incomplete);
- config_wizard_set_buttons_sensitive (mcw, TRUE, next_sensitive);
+ evolution_wizard_set_buttons_sensitive (gui->wizard, TRUE, next_sensitive, TRUE, NULL);
if (!next_sensitive)
gtk_widget_grab_focus (incomplete);
}
static void
-transport_prepare (MailConfigWizard *mcw)
-{
- mcw->page = MAIL_CONFIG_WIZARD_PAGE_TRANSPORT;
- transport_changed (NULL, mcw);
-}
-
-static void
-transport_activate_cb (GtkEntry *ent, gpointer user_data)
+transport_prepare (EvolutionWizard *wizard, gpointer data)
{
- MailConfigWizard *mcw = user_data;
-
- if (mail_account_gui_transport_complete (mcw->gui, NULL) &&
- !transport_next (mcw))
- config_wizard_set_page (mcw, MAIL_CONFIG_WIZARD_PAGE_MANAGEMENT);
+ MailConfigWizard *gui = data;
+
+ gui->page = MAIL_CONFIG_WIZARD_PAGE_TRANSPORT;
+ transport_changed (NULL, data);
}
/* Management page */
static gboolean
-management_check (MailConfigWizard *mcw)
+management_check (MailConfigWizard *wizard)
{
gboolean next_sensitive;
- const char *text;
+ char *text;
- text = gtk_entry_get_text (mcw->gui->account_name);
+ text = gtk_entry_get_text (wizard->gui->account_name);
next_sensitive = text && *text;
/* no accounts with the same name */
if (next_sensitive && mail_config_get_account_by_name (text))
next_sensitive = FALSE;
- config_wizard_set_buttons_sensitive (mcw, TRUE, next_sensitive);
+ evolution_wizard_set_buttons_sensitive (wizard->wizard, TRUE,
+ next_sensitive, TRUE, NULL);
return next_sensitive;
}
static void
-management_prepare (MailConfigWizard *mcw)
+management_prepare (EvolutionWizard *wizard, gpointer data)
{
+ MailConfigWizard *gui = data;
const char *name, *text;
- mcw->page = MAIL_CONFIG_WIZARD_PAGE_MANAGEMENT;
+ gui->page = MAIL_CONFIG_WIZARD_PAGE_MANAGEMENT;
- text = gtk_entry_get_text (mcw->gui->account_name);
+ text = gtk_entry_get_text (gui->gui->account_name);
if (!text || *text == '\0') {
- name = gtk_entry_get_text(mcw->gui->email_address);
+ name = e_utf8_gtk_entry_get_text (gui->gui->email_address);
if (name && *name) {
if (mail_config_get_account_by_name (name)) {
char *template;
@@ -338,444 +438,630 @@ management_prepare (MailConfigWizard *mcw)
} while (mail_config_get_account_by_name (name) && i != 0);
}
- gtk_entry_set_text(mcw->gui->account_name, name);
+ e_utf8_gtk_entry_set_text (gui->gui->account_name, name);
}
}
- management_check (mcw);
+ management_check (gui);
}
static void
management_changed (GtkWidget *widget, gpointer data)
{
- MailConfigWizard *mcw = data;
+ MailConfigWizard *gui = data;
- if (mcw->page != MAIL_CONFIG_WIZARD_PAGE_MANAGEMENT)
+ if (gui->page != MAIL_CONFIG_WIZARD_PAGE_MANAGEMENT)
return;
- management_check (mcw);
+ management_check (gui);
- gtk_widget_grab_focus (GTK_WIDGET (mcw->gui->account_name));
+ gtk_widget_grab_focus (GTK_WIDGET (gui->gui->account_name));
}
-static void
-management_activate_cb (GtkEntry *ent, gpointer user_data)
+static MailConfigAccount *
+make_account (void)
{
- MailConfigWizard *mcw = user_data;
-
- if (management_check (mcw))
- config_wizard_set_page (mcw, mcw->page + 1);
+ MailConfigAccount *account;
+ char *name, *user;
+ struct utsname uts;
+
+ account = g_new0 (MailConfigAccount, 1);
+
+ account->id = g_new0 (MailConfigIdentity, 1);
+ name = g_get_real_name ();
+ account->id->name = e_utf8_from_locale_string (name);
+ user = g_get_user_name ();
+ if (user && !uname (&uts) && strchr (uts.nodename, '.'))
+ account->id->address = g_strdup_printf ("%s@%s", user, uts.nodename);
+
+ if (mail_config_get_default_transport ())
+ account->transport = service_copy (mail_config_get_default_transport ());
+
+ return account;
}
+static const char *pages[] = {
+ "identity_page",
+ "source_page",
+ "extra_page",
+ "transport_page",
+ "management_page",
+ "finish_page",
+ NULL
+};
-#define WIZARD_ICON(name) (EVOLUTION_IMAGES "/mail-config-druid-" name ".png")
+static int
+page_to_num (gpointer page)
+{
+ gpointer r;
-static struct {
- const char *page_name, *title, *icon_path;
- void (*prepare_func) (MailConfigWizard *mcw);
- gboolean (*back_func) (MailConfigWizard *mcw);
- gboolean (*next_func) (MailConfigWizard *mcw);
- const char *help_text;
-} wizard_pages[] = {
- { "identity_page", N_("Identity"), WIZARD_ICON ("identity"),
- identity_prepare, NULL, identity_next,
- N_("Please enter your name and email address below. "
- "The \"optional\" fields below do not need to be "
- "filled in, unless you wish to include this "
- "information in email you send.")
- },
-
- { "source_page", N_("Receiving Mail"), WIZARD_ICON ("receive"),
- source_prepare, NULL, source_next,
- N_("Please enter information about your incoming "
- "mail server below. If you are not sure, ask your "
- "system administrator or Internet Service Provider.")
- },
-
- { "extra_page", N_("Receiving Mail"), WIZARD_ICON ("receive"),
- extra_prepare, NULL, NULL,
- N_("Please select among the following options")
- },
-
- { "transport_page", N_("Sending Mail"), WIZARD_ICON ("send"),
- transport_prepare, transport_back, transport_next,
- N_("Please enter information about the way you will "
- "send mail. If you are not sure, ask your system "
- "administrator or Internet Service Provider.")
- },
-
- { "management_page", N_("Account Management"), WIZARD_ICON ("account-name"),
- management_prepare, NULL, NULL,
- N_("You are almost done with the mail configuration "
- "process. The identity, incoming mail server and "
- "outgoing mail transport method which you provided "
- "will be grouped together to make an Evolution mail "
- "account. Please enter a name for this account in "
- "the space below. This name will be used for display "
- "purposes only.")
+ r = g_hash_table_lookup (page_hash, page);
+ if (r == NULL) {
+ return 0;
}
-};
-static const int num_wizard_pages = sizeof (wizard_pages) / sizeof (wizard_pages[0]);
-static GtkWidget *
-get_page (GladeXML *xml, int page_num)
+ return GPOINTER_TO_INT (r);
+}
+
+static gboolean
+next_func (GnomeDruidPage *page,
+ GnomeDruid *druid,
+ gpointer data)
{
- GtkWidget *vbox, *widget;
+ GNOME_Evolution_Wizard wiz;
+ CORBA_Environment ev;
+ int pagenum;
- vbox = gtk_vbox_new (FALSE, 4);
+ wiz = bonobo_object_corba_objref (BONOBO_OBJECT (account_wizard));
+ CORBA_exception_init (&ev);
- widget = gtk_label_new (_(wizard_pages[page_num].help_text));
- gtk_label_set_line_wrap (GTK_LABEL (widget), TRUE);
- gtk_label_set_justify (GTK_LABEL (widget), GTK_JUSTIFY_FILL);
- gtk_box_pack_start (GTK_BOX (vbox), widget, FALSE, FALSE, 0);
- gtk_widget_show_all (vbox);
-
- switch (page_num) {
- case MAIL_CONFIG_WIZARD_PAGE_IDENTITY:
- widget = glade_xml_get_widget (xml, "identity_required_frame");
- gtk_container_set_border_width (GTK_CONTAINER (widget), 0);
- gtk_widget_reparent (widget, vbox);
- gtk_box_set_child_packing (GTK_BOX (vbox), widget, FALSE, FALSE, 0, GTK_PACK_START);
- widget = glade_xml_get_widget (xml, "identity_optional_frame");
- gtk_container_set_border_width (GTK_CONTAINER (widget), 0);
- gtk_widget_reparent (widget, vbox);
- gtk_box_set_child_packing (GTK_BOX (vbox), widget, FALSE, FALSE, 0, GTK_PACK_START);
- break;
+ pagenum = page_to_num (page);
+ GNOME_Evolution_Wizard_notifyAction (wiz, pagenum, GNOME_Evolution_Wizard_NEXT, &ev);
+ CORBA_exception_free (&ev);
- case MAIL_CONFIG_WIZARD_PAGE_SOURCE:
- widget = glade_xml_get_widget (xml, "source_vbox");
- gtk_container_set_border_width (GTK_CONTAINER (widget), 0);
- gtk_widget_reparent (widget, vbox);
- break;
+ if (pagenum < 5-1)
+ return TRUE;
- case MAIL_CONFIG_WIZARD_PAGE_EXTRA:
- widget = glade_xml_get_widget (xml, "extra_table");
- gtk_container_set_border_width (GTK_CONTAINER (widget), 0);
- gtk_widget_reparent (widget, vbox);
- break;
+ return FALSE;
+}
- case MAIL_CONFIG_WIZARD_PAGE_TRANSPORT:
- widget = glade_xml_get_widget (xml, "transport_vbox");
- gtk_container_set_border_width (GTK_CONTAINER (widget), 0);
- gtk_widget_reparent (widget, vbox);
- break;
+static gboolean
+prepare_func (GnomeDruidPage *page,
+ GnomeDruid *druid,
+ gpointer data)
+{
+ GNOME_Evolution_Wizard wiz;
+ CORBA_Environment ev;
+ int pagenum;
- case MAIL_CONFIG_WIZARD_PAGE_MANAGEMENT:
- widget = glade_xml_get_widget (xml, "management_frame");
- gtk_container_set_border_width (GTK_CONTAINER (widget), 0);
- gtk_widget_reparent (widget, vbox);
- break;
+ wiz = bonobo_object_corba_objref (BONOBO_OBJECT (account_wizard));
+ CORBA_exception_init (&ev);
- default:
- g_return_val_if_reached (NULL);
- }
-
- return vbox;
+ pagenum = page_to_num (page);
+ GNOME_Evolution_Wizard_notifyAction (wiz, pagenum, GNOME_Evolution_Wizard_PREPARE, &ev);
+ CORBA_exception_free (&ev);
+ return FALSE;
+}
+
+static gboolean
+back_func (GnomeDruidPage *page,
+ GnomeDruid *druid,
+ gpointer data)
+{
+ GNOME_Evolution_Wizard wiz;
+ CORBA_Environment ev;
+ int pagenum;
+
+ wiz = bonobo_object_corba_objref (BONOBO_OBJECT (account_wizard));
+ CORBA_exception_init (&ev);
+
+ pagenum = page_to_num (page);
+ GNOME_Evolution_Wizard_notifyAction (wiz, pagenum, GNOME_Evolution_Wizard_BACK, &ev);
+ CORBA_exception_free (&ev);
+
+ if (pagenum > 0)
+ return TRUE;
+
+ return FALSE;
}
+static gboolean
+finish_func (GnomeDruidPage *page,
+ GnomeDruid *druid,
+ gpointer data)
+{
+ GNOME_Evolution_Wizard wiz;
+ CORBA_Environment ev;
+ int pagenum;
+
+ wiz = bonobo_object_corba_objref (BONOBO_OBJECT (account_wizard));
+ CORBA_exception_init (&ev);
+
+ pagenum = page_to_num (page);
+ GNOME_Evolution_Wizard_notifyAction (wiz, 0, GNOME_Evolution_Wizard_FINISH, &ev);
+ CORBA_exception_free (&ev);
-static MailConfigWizard *
-config_wizard_new (void)
+ druid_finish (page, druid, data);
+ return FALSE;
+}
+
+static void
+wizard_listener_event (BonoboListener *listener,
+ char *event_name,
+ BonoboArg *event_data,
+ CORBA_Environment *ev,
+ MailConfigDruid *druid)
{
- MailConfigWizard *mcw;
- const char *name, *user;
- EAccountService *xport;
- struct utsname uts;
- EAccount *account;
-
- /* Create a new account object with some defaults */
- account = e_account_new ();
- account->enabled = TRUE;
+ CORBA_short buttons, pagenum;
+ GnomeDruidPage *page;
+
+ if (strcmp (event_name, EVOLUTION_WIZARD_SET_BUTTONS_SENSITIVE) == 0) {
+ buttons = (int) *((CORBA_short *)event_data->_value);
+ gnome_druid_set_buttons_sensitive (GNOME_DRUID (druid->druid),
+ (buttons & 4) >> 2,
+ (buttons & 2) >> 1,
+ (buttons & 1));
+ } else if (strcmp (event_name, EVOLUTION_WIZARD_SET_SHOW_FINISH) == 0) {
+ gnome_druid_set_show_finish (GNOME_DRUID (druid->druid),
+ (gboolean) *((CORBA_boolean *)event_data->_value));
+ } else if (strcmp (event_name, EVOLUTION_WIZARD_SET_PAGE) == 0) {
+ pagenum = (int) *((CORBA_short *) event_data->_value);
+
+ page = g_list_nth_data (page_list, pagenum);
+ gnome_druid_set_page (GNOME_DRUID (druid->druid), page);
+ }
+}
+
+static void
+construct (MailConfigDruid *druid)
+{
+ GtkWidget *widget;
+ GNOME_Evolution_Wizard corba_wizard;
+ Bonobo_Listener corba_listener;
+ CORBA_Environment ev;
+ int i;
+
+ /* Start account wizard */
+ CORBA_exception_init (&ev);
+ corba_wizard = oaf_activate_from_id ("OAFIID:GNOME_Evolution_Mail_Wizard", 0, NULL, &ev);
+ CORBA_exception_free (&ev);
+ g_assert (account_wizard != NULL);
- name = g_get_real_name ();
- account->id->name = g_strdup (name);
- user = g_get_user_name ();
- if (user && !uname (&uts) && strchr (uts.nodename, '.'))
- account->id->address = g_strdup_printf ("%s@%s", user, uts.nodename);
+ druid->xml = glade_xml_new (EVOLUTION_GLADEDIR "/mail-config.glade", NULL);
+ /* get our toplevel widget and reparent it */
+ widget = glade_xml_get_widget (druid->xml, "druid");
+ gtk_widget_reparent (widget, GTK_WIDGET (druid));
- if ((xport = mail_config_get_default_transport ())) {
- account->transport->url = g_strdup (xport->url);
- account->transport->save_passwd = xport->save_passwd;
+ druid->druid = GNOME_DRUID (widget);
+
+ /* set window title */
+ gtk_window_set_title (GTK_WINDOW (druid), _("Evolution Account Assistant"));
+ gtk_window_set_policy (GTK_WINDOW (druid), FALSE, TRUE, FALSE);
+ gtk_window_set_modal (GTK_WINDOW (druid), FALSE);
+ gtk_object_set (GTK_OBJECT (druid), "type", GTK_WINDOW_DIALOG, NULL);
+
+ druid->listener = bonobo_listener_new (NULL, NULL);
+ gtk_signal_connect (GTK_OBJECT (druid->listener), "event-notify",
+ GTK_SIGNAL_FUNC (wizard_listener_event), druid);
+ corba_listener = bonobo_object_corba_objref (BONOBO_OBJECT (druid->listener));
+ CORBA_exception_init (&ev);
+ druid->event_source = (Bonobo_Unknown) bonobo_object_query_interface (
+ BONOBO_OBJECT (account_wizard), "IDL:Bonobo/EventSource:1.0");
+ g_assert (druid->event_source != CORBA_OBJECT_NIL);
+ druid->id = Bonobo_EventSource_addListener ((Bonobo_EventSource) druid->event_source, corba_listener, &ev);
+ if (BONOBO_EX (&ev)) {
+ g_warning ("Error adding listener (%s)",
+ CORBA_exception_id (&ev));
+ }
+ CORBA_exception_free (&ev);
+
+ if (page_hash != NULL) {
+ g_hash_table_destroy (page_hash);
}
+ page_hash = g_hash_table_new (NULL, NULL);
+ for (i = 0; pages[i] != NULL; i++) {
+ GtkWidget *page;
+ GnomeDruidPageStandard *dpage;
+
+ page = glade_xml_get_widget (druid->xml, pages[i]);
+ /* Store pages */
+ g_hash_table_insert (page_hash, page, GINT_TO_POINTER (i));
+ page_list = g_list_append (page_list, page);
+
+ gtk_signal_connect (GTK_OBJECT (page), "next",
+ GTK_SIGNAL_FUNC (next_func), druid);
+ gtk_signal_connect (GTK_OBJECT (page), "prepare",
+ GTK_SIGNAL_FUNC (prepare_func), druid);
+ gtk_signal_connect (GTK_OBJECT (page), "back",
+ GTK_SIGNAL_FUNC (back_func), druid);
- /* Create the config wizard object */
- mcw = g_new0 (MailConfigWizard, 1);
- mcw->gui = mail_account_gui_new (account, NULL);
- g_object_unref (account);
-
- /* Set up gui */
- g_signal_connect (mcw->gui->account_name, "changed",
- G_CALLBACK (management_changed), mcw);
- g_signal_connect (mcw->gui->full_name, "changed",
- G_CALLBACK (identity_changed), mcw);
- g_signal_connect (mcw->gui->email_address, "changed",
- G_CALLBACK (identity_changed), mcw);
- g_signal_connect (mcw->gui->reply_to,"changed",
- G_CALLBACK (identity_changed), mcw);
- g_signal_connect (mcw->gui->source.hostname, "changed",
- G_CALLBACK (source_changed), mcw);
- g_signal_connect (mcw->gui->source.username, "changed",
- G_CALLBACK (source_changed), mcw);
- g_signal_connect (mcw->gui->source.path, "changed",
- G_CALLBACK (source_changed), mcw);
- g_signal_connect (mcw->gui->transport.hostname, "changed",
- G_CALLBACK (transport_changed), mcw);
- g_signal_connect (mcw->gui->transport.username, "changed",
- G_CALLBACK (transport_changed), mcw);
- g_signal_connect (mcw->gui->transport_needs_auth, "toggled",
- G_CALLBACK (transport_changed), mcw);
-
- g_signal_connect (mcw->gui->account_name, "activate",
- G_CALLBACK (management_activate_cb), mcw);
-
- g_signal_connect (mcw->gui->full_name, "activate",
- G_CALLBACK (identity_activate_cb), mcw);
- g_signal_connect (mcw->gui->email_address, "activate",
- G_CALLBACK (identity_activate_cb), mcw);
- g_signal_connect (mcw->gui->reply_to,"activate",
- G_CALLBACK (identity_activate_cb), mcw);
- g_signal_connect (mcw->gui->organization, "activate",
- G_CALLBACK (identity_activate_cb), mcw);
-
- g_signal_connect (mcw->gui->source.hostname, "activate",
- G_CALLBACK (source_activate_cb), mcw);
- g_signal_connect (mcw->gui->source.username, "activate",
- G_CALLBACK (source_activate_cb), mcw);
- g_signal_connect (mcw->gui->source.path, "activate",
- G_CALLBACK (source_activate_cb), mcw);
-
- g_signal_connect (mcw->gui->transport.hostname, "activate",
- G_CALLBACK (transport_activate_cb), mcw);
- g_signal_connect (mcw->gui->transport.username, "activate",
- G_CALLBACK (transport_activate_cb), mcw);
-
- return mcw;
+ gtk_signal_connect (GTK_OBJECT (page), "finish",
+ GTK_SIGNAL_FUNC (finish_func), druid);
+
+ if (i != 5) {
+ Bonobo_Control control;
+ GtkWidget *w;
+ CORBA_Environment ev;
+
+ dpage = GNOME_DRUID_PAGE_STANDARD (page);
+
+ CORBA_exception_init (&ev);
+ control = GNOME_Evolution_Wizard_getControl (corba_wizard, i, &ev);
+ if (BONOBO_EX (&ev)) {
+ g_warning ("Error getting page %d: %s", i,
+ CORBA_exception_id (&ev));
+ CORBA_exception_free (&ev);
+ continue;
+ }
+
+ w = bonobo_widget_new_control_from_objref (control,
+ CORBA_OBJECT_NIL);
+ gtk_box_pack_start (GTK_BOX (dpage->vbox), w, TRUE,
+ TRUE, 0);
+ gtk_widget_show_all (w);
+ }
+ }
+ gtk_signal_connect (GTK_OBJECT (druid->druid), "cancel", druid_cancel, druid);
+
+ gnome_druid_set_buttons_sensitive (druid->druid, FALSE, TRUE, TRUE);
}
-static void
-free_config_wizard (MailConfigWizard *mcw)
+MailConfigDruid *
+mail_config_druid_new (GNOME_Evolution_Shell shell)
{
- mail_account_gui_destroy (mcw->gui);
+ MailConfigDruid *new;
- if (mcw->interior_pages)
- g_ptr_array_free (mcw->interior_pages, TRUE);
+ new = (MailConfigDruid *) gtk_type_new (mail_config_druid_get_type ());
+ construct (new);
+ new->shell = shell;
- g_free (mcw);
+ return new;
}
-/* In-proc config druid */
+static void wizard_next_cb (EvolutionWizard *wizard, int page_num, MailConfigWizard *gui);
static void
-druid_cancel (GnomeDruid *druid, gpointer user_data)
+goto_next_page (MailConfigWizard *gui)
{
- MailConfigWizard *mcw = user_data;
- GtkWidget *window;
-
- window = glade_xml_get_widget (mcw->gui->xml, "account_druid");
- gtk_widget_destroy (window);
-
- free_config_wizard (mcw);
+ wizard_next_cb (gui->wizard, gui->page, gui);
}
static void
-druid_finish (GnomeDruidPage *page, GnomeDruid *druid, gpointer user_data)
+identity_activate_cb (GtkEntry *ent, gpointer user_data)
{
- MailConfigWizard *mcw = user_data;
+ MailConfigWizard *gui = (MailConfigWizard *) user_data;
- mail_account_gui_save (mcw->gui);
- druid_cancel (druid, user_data);
+ if (mail_account_gui_identity_complete (gui->gui, NULL))
+ goto_next_page (gui);
}
static void
-druid_prepare (GnomeDruidPage *page, GnomeDruid *druid, gpointer data)
+source_activate_cb (GtkEntry *ent, gpointer user_data)
{
- MailConfigWizard *mcw = g_object_get_data (G_OBJECT (druid), "MailConfigWizard");
- int page_num = GPOINTER_TO_INT (data);
+ MailConfigWizard *gui = (MailConfigWizard *) user_data;
- if (wizard_pages[page_num].prepare_func)
- wizard_pages[page_num].prepare_func (mcw);
+ if (mail_account_gui_source_complete (gui->gui, NULL))
+ goto_next_page (gui);
}
-
-static gboolean
-druid_back (GnomeDruidPage *page, GnomeDruid *druid, gpointer data)
-{
- MailConfigWizard *mcw = g_object_get_data (G_OBJECT (druid), "MailConfigWizard");
- int page_num = GPOINTER_TO_INT (data);
- if (wizard_pages[page_num].back_func)
- return wizard_pages[page_num].back_func (mcw);
- else
- return FALSE;
-}
-
-static gboolean
-druid_next (GnomeDruidPage *page, GnomeDruid *druid, gpointer data)
+static void
+transport_activate_cb (GtkEntry *ent, gpointer user_data)
{
- MailConfigWizard *mcw = g_object_get_data (G_OBJECT (druid), "MailConfigWizard");
- int page_num = GPOINTER_TO_INT (data);
+ MailConfigWizard *gui = (MailConfigWizard *) user_data;
- if (wizard_pages[page_num].next_func)
- return wizard_pages[page_num].next_func (mcw);
- else
- return FALSE;
+ if (mail_account_gui_transport_complete (gui->gui, NULL))
+ goto_next_page (gui);
}
-
-MailConfigDruid *
-mail_config_druid_new (void)
+static void
+management_activate_cb (GtkEntry *ent, gpointer user_data)
{
- MailConfigWizard *mcw;
- GtkWidget *new, *page;
- int i;
+ MailConfigWizard *gui = (MailConfigWizard *) user_data;
- mcw = config_wizard_new ();
- mcw->druid = (GnomeDruid *)glade_xml_get_widget (mcw->gui->xml, "druid");
- g_object_set_data (G_OBJECT (mcw->druid), "MailConfigWizard", mcw);
-
- mcw->interior_pages = g_ptr_array_new ();
- for (i = 0; i < num_wizard_pages; i++) {
- page = glade_xml_get_widget (mcw->gui->xml,
- wizard_pages[i].page_name);
- g_ptr_array_add (mcw->interior_pages, page);
- gtk_box_pack_start (GTK_BOX (GNOME_DRUID_PAGE_STANDARD (page)->vbox),
- get_page (mcw->gui->xml, i),
- FALSE, FALSE, 0);
- g_signal_connect (page, "back", G_CALLBACK (druid_back),
- GINT_TO_POINTER (i));
- g_signal_connect (page, "next", G_CALLBACK (druid_next),
- GINT_TO_POINTER (i));
-
- /* At least in 2.0 (and probably 2.2 too),
- * GnomeDruidPageStandard is broken and you need to
- * connect_after to "prepare" or else its default
- * method will run after your signal handler and
- * undo its button sensitivity changes.
- */
- g_signal_connect_after (page, "prepare",
- G_CALLBACK (druid_prepare),
- GINT_TO_POINTER (i));
- }
- g_signal_connect (mcw->druid, "cancel", G_CALLBACK (druid_cancel), mcw);
+ if (management_check (gui))
+ goto_next_page (gui);
+}
- mcw->last_page = (GnomeDruidPage *)glade_xml_get_widget (mcw->gui->xml, "finish_page");
- g_signal_connect (mcw->last_page, "finish", G_CALLBACK (druid_finish), mcw);
+static BonoboControl *
+get_fn (EvolutionWizard *wizard,
+ int page_num,
+ void *closure)
+{
+ MailConfigWizard *gui = closure;
+ BonoboControl *control;
+ GtkWidget *vbox, *widget;
+ static gboolean first_time = TRUE;
+
+ if (gui->gui == NULL) {
+ if (gui->account == NULL) {
+ gui->account = make_account ();
+ gtk_object_set_data (GTK_OBJECT (wizard), "account-data",
+ gui->account);
+ }
+
+ gui->gui = mail_account_gui_new (gui->account, NULL);
+
+ /* set up signals, etc */
+ gtk_signal_connect (GTK_OBJECT (gui->gui->account_name),
+ "changed", management_changed, gui);
+ gtk_signal_connect (GTK_OBJECT (gui->gui->full_name),
+ "changed", identity_changed, gui);
+ gtk_signal_connect (GTK_OBJECT (gui->gui->email_address),
+ "changed", identity_changed, gui);
+ gtk_signal_connect (GTK_OBJECT (gui->gui->reply_to),
+ "changed", identity_changed, gui);
+ gtk_signal_connect (GTK_OBJECT (gui->gui->source.hostname),
+ "changed", source_changed, gui);
+ gtk_signal_connect (GTK_OBJECT (gui->gui->source.username),
+ "changed", source_changed, gui);
+ gtk_signal_connect (GTK_OBJECT (gui->gui->source.path),
+ "changed", source_changed, gui);
+ gtk_signal_connect (GTK_OBJECT (gui->gui->transport.hostname),
+ "changed", transport_changed, gui);
+ gtk_signal_connect (GTK_OBJECT (gui->gui->transport.username),
+ "changed", transport_changed, gui);
+ gtk_signal_connect (GTK_OBJECT (gui->gui->transport_needs_auth),
+ "toggled", transport_changed, gui);
+
+ gtk_signal_connect (GTK_OBJECT (gui->gui->account_name),
+ "activate", management_activate_cb, gui);
+
+ gtk_signal_connect (GTK_OBJECT (gui->gui->full_name),
+ "activate", identity_activate_cb, gui);
+ gtk_signal_connect (GTK_OBJECT (gui->gui->email_address),
+ "activate", identity_activate_cb, gui);
+ gtk_signal_connect (GTK_OBJECT (gui->gui->reply_to),
+ "activate", identity_activate_cb, gui);
+ gtk_signal_connect (GTK_OBJECT (gui->gui->organization),
+ "activate", identity_activate_cb, gui);
+
+ gtk_signal_connect (GTK_OBJECT (gui->gui->source.hostname),
+ "activate", source_activate_cb, gui);
+ gtk_signal_connect (GTK_OBJECT (gui->gui->source.username),
+ "activate", source_activate_cb, gui);
+ gtk_signal_connect (GTK_OBJECT (gui->gui->source.path),
+ "activate", source_activate_cb, gui);
+
+ gtk_signal_connect (GTK_OBJECT (gui->gui->transport.hostname),
+ "activate", transport_activate_cb, gui);
+ gtk_signal_connect (GTK_OBJECT (gui->gui->transport.username),
+ "activate", transport_activate_cb, gui);
+ first_time = TRUE;
+ }
+
+ /* Fill in the druid pages */
+ vbox = gtk_vbox_new (FALSE, 0);
+ switch (page_num) {
+ case 0:
+ widget = create_label ("identity_html");
+ gtk_box_pack_start (GTK_BOX (vbox), widget, FALSE, FALSE, 0);
+ widget = glade_xml_get_widget (gui->gui->xml, "identity_required_frame");
+ gtk_widget_reparent (widget, vbox);
+ gtk_box_set_child_packing (GTK_BOX (vbox), widget, FALSE, FALSE, 0, GTK_PACK_START);
+ widget = glade_xml_get_widget (gui->gui->xml, "identity_optional_frame");
+ gtk_widget_reparent (widget, vbox);
+ gtk_box_set_child_packing (GTK_BOX (vbox), widget, FALSE, FALSE, 0, GTK_PACK_START);
+ break;
+
+ case 1:
+ widget = create_label ("source_html");
+ gtk_box_pack_start (GTK_BOX (vbox), widget, FALSE, FALSE, 0);
+ widget = glade_xml_get_widget (gui->gui->xml, "source_vbox");
+ gtk_widget_reparent (widget, vbox);
+ gtk_widget_show (widget);
+ break;
+
+ case 2:
+ widget = create_label ("extra_html");
+ gtk_box_pack_start (GTK_BOX (vbox), widget, FALSE, FALSE, 0);
+ widget = glade_xml_get_widget (gui->gui->xml, "extra_vbox");
+ gtk_widget_reparent (widget, vbox);
+ break;
+
+ case 3:
+ widget = create_label ("transport_html");
+ gtk_box_pack_start (GTK_BOX (vbox), widget, FALSE, FALSE, 0);
+ widget = glade_xml_get_widget (gui->gui->xml, "transport_vbox");
+ gtk_widget_reparent (widget, vbox);
+ gtk_widget_show (widget);
+ break;
+
+ case 4:
+ widget = glade_xml_get_widget (gui->gui->xml, "management_frame");
+ gtk_widget_reparent (widget, vbox);
+ break;
- gnome_druid_set_buttons_sensitive (mcw->druid, FALSE, TRUE, TRUE, FALSE);
- gtk_widget_show_all (GTK_WIDGET (mcw->druid));
- mail_account_gui_setup (mcw->gui, NULL);
+ default:
+ return NULL;
+ }
+
+ gtk_widget_show (vbox);
+ control = bonobo_control_new (vbox);
- new = glade_xml_get_widget (mcw->gui->xml, "account_druid");
- gtk_window_set_type_hint ((GtkWindow *) new, GDK_WINDOW_TYPE_HINT_DIALOG);
+ if (first_time) {
+ mail_account_gui_setup (gui->gui, NULL);
+ first_time = FALSE;
+ }
- return (MailConfigDruid *) new;
+ return control;
}
+typedef gboolean (*NextFunc)(EvolutionWizard *wizard, gpointer data);
-/* CORBA wizard */
+static struct {
+ NextFunc next_func;
+ GtkSignalFunc prepare_func;
+ NextFunc back_func;
+ GtkSignalFunc finish_func;
+ GtkSignalFunc help_func;
+} wizard_pages[] = {
+ { identity_next,
+ GTK_SIGNAL_FUNC (identity_prepare),
+ NULL,
+ GTK_SIGNAL_FUNC (NULL),
+ GTK_SIGNAL_FUNC (NULL) },
+ { source_next,
+ GTK_SIGNAL_FUNC (source_prepare),
+ NULL,
+ GTK_SIGNAL_FUNC (NULL),
+ GTK_SIGNAL_FUNC (NULL) },
+ { NULL,
+ GTK_SIGNAL_FUNC (extra_prepare),
+ NULL,
+ GTK_SIGNAL_FUNC (NULL),
+ GTK_SIGNAL_FUNC (NULL) },
+ { transport_next,
+ GTK_SIGNAL_FUNC (transport_prepare),
+ transport_back,
+ GTK_SIGNAL_FUNC (NULL),
+ GTK_SIGNAL_FUNC (NULL) },
+ { NULL,
+ GTK_SIGNAL_FUNC (management_prepare),
+ NULL,
+ GTK_SIGNAL_FUNC (NULL),
+ GTK_SIGNAL_FUNC (NULL) }
+};
static void
wizard_next_cb (EvolutionWizard *wizard,
- int page_num,
- MailConfigWizard *mcw)
+ int page_num,
+ MailConfigWizard *gui)
{
- if (page_num >= MAIL_CONFIG_WIZARD_PAGE_MANAGEMENT)
- return;
-
- if (wizard_pages[page_num].next_func &&
- wizard_pages[page_num].next_func (mcw))
- return;
-
- evolution_wizard_set_page (wizard, page_num + 1, NULL);
+ if (wizard_pages[page_num].next_func == NULL
+ || !(wizard_pages[page_num].next_func (wizard, gui))) {
+ if (page_num < 5-1) {
+ evolution_wizard_set_page(wizard, page_num+1, NULL);
+ }
+ }
}
static void
wizard_prepare_cb (EvolutionWizard *wizard,
- int page_num,
- MailConfigWizard *mcw)
+ int page_num,
+ MailConfigWizard *gui)
{
- if (wizard_pages[page_num].prepare_func)
- wizard_pages[page_num].prepare_func (mcw);
+ if (wizard_pages[page_num].prepare_func != NULL) {
+ wizard_pages[page_num].prepare_func (wizard, gui);
+ }
}
static void
wizard_back_cb (EvolutionWizard *wizard,
- int page_num,
- MailConfigWizard *mcw)
+ int page_num,
+ MailConfigWizard *gui)
{
- if (page_num >= MAIL_CONFIG_WIZARD_NUM_PAGES) {
- evolution_wizard_set_page (wizard, MAIL_CONFIG_WIZARD_PAGE_MANAGEMENT, NULL);
- return;
- }
-
- if (wizard_pages[page_num].back_func &&
- wizard_pages[page_num].back_func (mcw))
- return;
-
- if (page_num > 0)
- evolution_wizard_set_page (wizard, page_num - 1, NULL);
+ if (page_num >= 5)
+ evolution_wizard_set_page(wizard, 4, NULL);
+ else if (wizard_pages[page_num].back_func == NULL
+ || !(wizard_pages[page_num].back_func (wizard, gui))) {
+ if (page_num > 0)
+ evolution_wizard_set_page(wizard, page_num-1, NULL);
+ }
}
static void
wizard_finish_cb (EvolutionWizard *wizard,
+ int page_num,
MailConfigWizard *w)
{
MailAccountGui *gui = w->gui;
-
+
/* Save the settings for that account */
if (mail_account_gui_save (gui) == FALSE)
/* problem. Um, how to keep the druid alive? */
return;
+ if (gui->account->source)
+ gui->account->source->enabled = TRUE;
+
/* Write out the config info */
mail_config_write ();
mail_account_gui_destroy (gui);
w->gui = NULL;
+ w->account = NULL;
}
static void
wizard_cancel_cb (EvolutionWizard *wizard,
- MailConfigWizard *mcw)
+ int page_num,
+ MailConfigWizard *gui)
{
- mail_account_gui_destroy (mcw->gui);
- mcw->gui = NULL;
+ mail_account_gui_destroy (gui->gui);
+ gui->gui = NULL;
}
static void
wizard_help_cb (EvolutionWizard *wizard,
- int page_num,
- MailConfigWizard *mcw)
+ int page_num,
+ MailConfigWizard *gui)
{
}
-BonoboObject *
-evolution_mail_config_wizard_new (void)
+static void
+wizard_free (MailConfigWizard *wizard)
+{
+ if (wizard->gui)
+ mail_account_gui_destroy (wizard->gui);
+
+ if (wizard->account)
+ account_destroy (wizard->account);
+
+ g_free (wizard);
+}
+
+static BonoboObject *
+evolution_mail_config_wizard_factory_fn (BonoboGenericFactory *factory,
+ void *closure)
{
EvolutionWizard *wizard;
- MailConfigWizard *mcw;
- GdkPixbuf *icon;
- int i;
+ MailConfigAccount *account;
+ MailConfigWizard *gui;
- mcw = config_wizard_new ();
- mail_account_gui_setup (mcw->gui, NULL);
+ account = make_account ();
- wizard = evolution_wizard_new ();
- for (i = 0; i < MAIL_CONFIG_WIZARD_NUM_PAGES; i++) {
- icon = gdk_pixbuf_new_from_file (wizard_pages[i].icon_path, NULL);
- evolution_wizard_add_page (wizard, _(wizard_pages[i].title),
- icon, get_page (mcw->gui->xml, i));
- g_object_unref (icon);
- }
+ gui = g_new (MailConfigWizard, 1);
+ gui->gui = NULL;
+ gui->account = account;
+ gui->identity_copied = FALSE;
+ gui->last_source = NULL;
+ gui->page = MAIL_CONFIG_WIZARD_PAGE_NONE;
- g_object_set_data_full (G_OBJECT (wizard), "MailConfigWizard",
- mcw, (GDestroyNotify)free_config_wizard);
- mcw->corba_wizard = wizard;
+ wizard = evolution_wizard_new (get_fn, 5, gui);
+ account_wizard = wizard;
- g_signal_connect (wizard, "next", G_CALLBACK (wizard_next_cb), mcw);
- g_signal_connect (wizard, "prepare", G_CALLBACK (wizard_prepare_cb), mcw);
- g_signal_connect (wizard, "back", G_CALLBACK (wizard_back_cb), mcw);
- g_signal_connect (wizard, "finish", G_CALLBACK (wizard_finish_cb), mcw);
- g_signal_connect (wizard, "cancel", G_CALLBACK (wizard_cancel_cb), mcw);
- g_signal_connect (wizard, "help", G_CALLBACK (wizard_help_cb), mcw);
+ gtk_object_set_data_full (GTK_OBJECT (account_wizard),
+ "account-data", gui,
+ (GtkDestroyNotify) wizard_free);
+ gui->wizard = wizard;
- return BONOBO_OBJECT (wizard);
+ gtk_signal_connect (GTK_OBJECT (wizard), "next",
+ GTK_SIGNAL_FUNC (wizard_next_cb), gui);
+ gtk_signal_connect (GTK_OBJECT (wizard), "prepare",
+ GTK_SIGNAL_FUNC (wizard_prepare_cb), gui);
+ gtk_signal_connect (GTK_OBJECT (wizard), "back",
+ GTK_SIGNAL_FUNC (wizard_back_cb), gui);
+ gtk_signal_connect (GTK_OBJECT (wizard), "finish",
+ GTK_SIGNAL_FUNC (wizard_finish_cb), gui);
+ gtk_signal_connect (GTK_OBJECT (wizard), "cancel",
+ GTK_SIGNAL_FUNC (wizard_cancel_cb), gui);
+ gtk_signal_connect (GTK_OBJECT (wizard), "help",
+ GTK_SIGNAL_FUNC (wizard_help_cb), gui);
+
+ return BONOBO_OBJECT (wizard);
+}
+
+void
+evolution_mail_config_wizard_init (void)
+{
+ BonoboGenericFactory *factory;
+
+ factory = bonobo_generic_factory_new (WIZARD_IID,
+ evolution_mail_config_wizard_factory_fn, NULL);
+
+ if (factory == NULL) {
+ g_warning ("Error starting factory");
+ return;
+ }
+
+ bonobo_running_context_auto_exit_unref (BONOBO_OBJECT (factory));
}
diff --git a/mail/mail-display.c b/mail/mail-display.c
index 657275df98..e1ecc0e272 100644
--- a/mail/mail-display.c
+++ b/mail/mail-display.c
@@ -29,30 +29,26 @@
#include <config.h>
#endif
-#include <string.h>
#include <sys/stat.h>
#include <ctype.h>
#include <fcntl.h>
#include <errno.h>
-
-#include <gtk/gtkinvisible.h>
-#include <libgnome/gnome-program.h>
-
-#include <gconf/gconf.h>
-#include <gconf/gconf-client.h>
-
+#include <libgnorba/gnorba.h>
+#include <libgnomevfs/gnome-vfs-mime-info.h>
#include <libgnomevfs/gnome-vfs-mime-handlers.h>
#include <libgnomevfs/gnome-vfs.h>
-#include <libgnome/gnome-url.h>
#include <bonobo/bonobo-control-frame.h>
#include <bonobo/bonobo-stream-memory.h>
+#include <bonobo/bonobo-ui-toolbar-icon.h>
#include <bonobo/bonobo-widget.h>
#include <bonobo/bonobo-socket.h>
#include <gdk-pixbuf/gdk-pixbuf.h>
#include <gdk-pixbuf/gdk-pixbuf-loader.h>
#include <gal/util/e-util.h>
+#include <gal/util/e-unicode-i18n.h>
#include <gal/widgets/e-popup-menu.h>
-
+#include <gal/widgets/e-unicode.h>
+#include <gtk/gtkinvisible.h>
#include <gtkhtml/gtkhtml.h>
#include <gtkhtml/gtkhtml-embedded.h>
#include <gtkhtml/htmlengine.h>
@@ -60,19 +56,18 @@
#include <gtkhtml/htmltext.h>
#include <gtkhtml/htmlinterval.h>
#include <gtkhtml/gtkhtml-stream.h>
-
#include <libsoup/soup-message.h>
+#include "e-util/e-html-utils.h"
#include "e-util/e-mktemp.h"
#include "addressbook/backend/ebook/e-book-util.h"
#include "e-searching-tokenizer.h"
#include "folder-browser-factory.h"
-#include "mail-display-stream.h"
+#include "mail-stream-gtkhtml.h"
#include "folder-browser.h"
-#include "mail-config.h"
#include "mail-display.h"
-#include "mail-format.h"
+#include "mail-config.h"
#include "mail-ops.h"
#include "mail-mt.h"
#include "mail.h"
@@ -180,24 +175,31 @@ write_data_written(CamelMimePart *part, char *name, int done, void *data)
static gboolean
write_data_to_file (CamelMimePart *part, const char *name, gboolean unique)
{
- int fd, ret = FALSE;
+ int fd;
+ int ret = FALSE;
g_return_val_if_fail (CAMEL_IS_MIME_PART (part), FALSE);
fd = open (name, O_WRONLY | O_CREAT | O_EXCL, 0666);
if (fd == -1 && errno == EEXIST && !unique) {
- GtkWidget *dialog;
- int button;
+ GtkWidget *dlg;
+ GtkWidget *text;
+ char *msg;
+
+ dlg = gnome_dialog_new (_("Overwrite file?"),
+ GNOME_STOCK_BUTTON_YES,
+ GNOME_STOCK_BUTTON_NO,
+ NULL);
- dialog = gtk_message_dialog_new (NULL, 0, GTK_MESSAGE_QUESTION, GTK_BUTTONS_YES_NO,
- _("File `%s' already exists.\nOverwrite it?"),
- name);
+ msg = g_strdup_printf (_("File `%s' already exists.\nOverwrite it?"), name);
+ text = gtk_label_new (msg);
+ g_free (msg);
- g_object_set (dialog, "title", _("Overwrite file?"), "allow_grow", TRUE, NULL);
- button = gtk_dialog_run ((GtkDialog *) dialog);
- gtk_widget_destroy (dialog);
+ gtk_box_pack_start (GTK_BOX (GNOME_DIALOG (dlg)->vbox), text, TRUE, TRUE, 4);
+ gtk_window_set_policy (GTK_WINDOW (dlg), FALSE, TRUE, FALSE);
+ gtk_widget_show (text);
- if (button != GTK_RESPONSE_YES)
+ if (gnome_dialog_run_and_close (GNOME_DIALOG (dlg)) != 0)
return FALSE;
}
@@ -213,11 +215,13 @@ write_data_to_file (CamelMimePart *part, const char *name, gboolean unique)
static char *
make_safe_filename (const char *prefix,CamelMimePart *part)
{
- const char *name;
+ const char *name = NULL;
char *safe, *p;
- name = part ? camel_mime_part_get_filename (part) : NULL;
-
+ if (part) {
+ name = camel_mime_part_get_filename (part);
+ }
+
if (!name) {
/* This is a filename. Translators take note. */
name = _("attachment");
@@ -239,29 +243,27 @@ make_safe_filename (const char *prefix,CamelMimePart *part)
static void
save_data_cb (GtkWidget *widget, gpointer user_data)
{
- GtkFileSelection *file_select;
- GConfClient *gconf;
+ GtkFileSelection *file_select = (GtkFileSelection *)
+ gtk_widget_get_ancestor (widget, GTK_TYPE_FILE_SELECTION);
char *dir;
- file_select = (GtkFileSelection *) gtk_widget_get_ancestor (widget, GTK_TYPE_FILE_SELECTION);
-
/* uh, this doesn't really feel right, but i dont know what to do better */
gtk_widget_hide (GTK_WIDGET (file_select));
- write_data_to_file (user_data, gtk_file_selection_get_filename (file_select), FALSE);
+ write_data_to_file (user_data, gtk_file_selection_get_filename (file_select),
+ FALSE);
/* preserve the pathname */
- dir = g_path_get_dirname (gtk_file_selection_get_filename (file_select));
- gconf = gconf_client_get_default ();
- gconf_client_set_string (gconf, "/apps/evolution/mail/save_dir", dir, NULL);
+ dir = g_dirname (gtk_file_selection_get_filename (file_select));
+ mail_config_set_last_filesel_dir (dir);
g_free (dir);
gtk_widget_destroy (GTK_WIDGET (file_select));
}
static void
-save_destroy_cb (CamelMimePart *part, GObject *deadbeef)
+save_destroy_cb (GtkWidget *widget, CamelMimePart *part)
{
- camel_object_unref (part);
+ camel_object_unref (CAMEL_OBJECT (part));
}
static gboolean
@@ -290,7 +292,7 @@ mail_display_jump_to_anchor (MailDisplay *md, const char *url)
char *anchor = strstr (url, "#");
g_return_if_fail (anchor != NULL);
-
+
if (anchor)
gtk_html_jump_to_anchor (md->html, anchor + 1);
}
@@ -298,20 +300,14 @@ mail_display_jump_to_anchor (MailDisplay *md, const char *url)
static void
on_link_clicked (GtkHTML *html, const char *url, MailDisplay *md)
{
-
- if (!strncasecmp (url, "mailto:", 7)) {
+ if (!g_strncasecmp (url, "news:", 5) || !g_strncasecmp (url, "nntp:", 5)) {
+ g_warning ("Can't handle news URLs yet.");
+ } else if (!g_strncasecmp (url, "mailto:", 7)) {
send_to_url (url, NULL);
} else if (*url == '#') {
mail_display_jump_to_anchor (md, url);
} else {
- GError *err = NULL;
-
- gnome_url_show (url, &err);
-
- if (err) {
- g_warning ("gnome_url_show: %s", err->message);
- g_error_free (err);
- }
+ gnome_url_show (url);
}
}
@@ -319,40 +315,37 @@ static void
save_part (CamelMimePart *part)
{
GtkFileSelection *file_select;
- char *filename, *dir, *base;
- GConfClient *gconf;
+ char *filename;
- camel_object_ref (part);
+ g_return_if_fail (part != NULL);
+ camel_object_ref (CAMEL_OBJECT (part));
- gconf = gconf_client_get_default ();
- dir = gconf_client_get_string (gconf, "/apps/evolution/mail/save_dir", NULL);
- filename = make_safe_filename (dir, part);
- g_free (dir);
+ filename = make_safe_filename (mail_config_get_last_filesel_dir (), part);
file_select = GTK_FILE_SELECTION (
gtk_file_selection_new (_("Save Attachment")));
gtk_file_selection_set_filename (file_select, filename);
/* set the GtkEntry with the locale filename by breaking abstraction */
- base = g_path_get_basename (filename);
- gtk_entry_set_text (GTK_ENTRY (file_select->selection_entry), base);
+ e_utf8_gtk_entry_set_text (GTK_ENTRY (file_select->selection_entry), g_basename (filename));
g_free (filename);
- g_free (base);
- g_signal_connect (file_select->ok_button, "clicked",
- G_CALLBACK (save_data_cb), part);
-
- g_signal_connect_swapped (file_select->cancel_button, "clicked",
- G_CALLBACK (gtk_widget_destroy), file_select);
-
- g_object_weak_ref ((GObject *) file_select, (GWeakNotify) save_destroy_cb, part);
+ gtk_signal_connect (GTK_OBJECT (file_select->ok_button), "clicked",
+ GTK_SIGNAL_FUNC (save_data_cb), part);
+ gtk_signal_connect_object (GTK_OBJECT (file_select->cancel_button),
+ "clicked",
+ GTK_SIGNAL_FUNC (gtk_widget_destroy),
+ GTK_OBJECT (file_select));
+ gtk_signal_connect (GTK_OBJECT (file_select), "destroy",
+ GTK_SIGNAL_FUNC (save_destroy_cb), part);
+
gtk_widget_show (GTK_WIDGET (file_select));
}
static void
save_cb (GtkWidget *widget, gpointer user_data)
{
- CamelMimePart *part = g_object_get_data ((GObject *) user_data, "CamelMimePart");
+ CamelMimePart *part = gtk_object_get_data (GTK_OBJECT (user_data), "CamelMimePart");
save_part (part);
}
@@ -360,18 +353,18 @@ save_cb (GtkWidget *widget, gpointer user_data)
static void
launch_cb (GtkWidget *widget, gpointer user_data)
{
- CamelMimePart *part = g_object_get_data(user_data, "CamelMimePart");
+ CamelMimePart *part = gtk_object_get_data (user_data, "CamelMimePart");
MailMimeHandler *handler;
GList *apps, *children, *c;
GnomeVFSMimeApplication *app;
char *command, *filename;
const char *tmpdir;
- handler = mail_lookup_handler (g_object_get_data(user_data, "mime_type"));
+ handler = mail_lookup_handler (gtk_object_get_data (user_data, "mime_type"));
g_return_if_fail (handler != NULL && handler->applications != NULL);
/* Yum. Too bad EPopupMenu doesn't allow per-item closures. */
- children = gtk_container_get_children (GTK_CONTAINER (widget->parent));
+ children = gtk_container_children (GTK_CONTAINER (widget->parent));
g_return_if_fail (children != NULL && children->next != NULL && children->next->next != NULL);
for (c = children->next->next, apps = handler->applications; c && apps; c = c->next, apps = apps->next) {
@@ -382,40 +375,30 @@ launch_cb (GtkWidget *widget, gpointer user_data)
g_return_if_fail (c != NULL && apps != NULL);
app = apps->data;
- tmpdir = e_mkdtemp ("app-launcher-XXXXXX");
+ tmpdir = e_mkdtemp ("evolution.XXXXXX");
if (!tmpdir) {
- GtkWidget *dialog;
-
- dialog = gtk_message_dialog_new (NULL, 0, GTK_MESSAGE_ERROR, GTK_RESPONSE_CLOSE,
- _("Could not create temporary directory: %s"),
- g_strerror (errno));
-
- /* FIXME: this should be async */
- gtk_dialog_run ((GtkDialog *) dialog);
- gtk_widget_destroy (dialog);
+ char *msg = g_strdup_printf (_("Could not create temporary directory: %s"),
+ g_strerror (errno));
+ gnome_error_dialog (msg);
+ g_free (msg);
return;
}
filename = make_safe_filename (tmpdir, part);
if (!write_data_to_file (part, filename, TRUE)) {
- GtkWidget *dialog;
-
- dialog = gtk_message_dialog_new (NULL, 0, GTK_MESSAGE_ERROR, GTK_RESPONSE_CLOSE,
- _("Could not create temporary file '%s': %s"),
- filename, g_strerror (errno));
-
- /* FIXME: this should be async */
- gtk_dialog_run ((GtkDialog *) dialog);
- gtk_widget_destroy (dialog);
+ char *msg = g_strdup_printf (_("Could not create temporary file '%s': %s"),
+ filename, g_strerror (errno));
+ gnome_error_dialog (msg);
g_free (filename);
+ g_free (msg);
return;
}
command = g_strdup_printf ("%s %s%s &", app->command,
- app->expects_uris == GNOME_VFS_MIME_APPLICATION_ARGUMENT_TYPE_URIS ?
- "file://" : "", filename);
+ app->expects_uris == GNOME_VFS_MIME_APPLICATION_ARGUMENT_TYPE_URIS ? "file://" : "",
+ filename);
g_free (filename);
system (command);
@@ -425,9 +408,9 @@ launch_cb (GtkWidget *widget, gpointer user_data)
static void
inline_cb (GtkWidget *widget, gpointer user_data)
{
- MailDisplay *md = g_object_get_data (user_data, "MailDisplay");
- CamelMimePart *part = g_object_get_data (user_data, "CamelMimePart");
-
+ MailDisplay *md = gtk_object_get_data (user_data, "MailDisplay");
+ CamelMimePart *part = gtk_object_get_data (user_data, "CamelMimePart");
+
mail_part_toggle_displayed (part, md);
mail_display_queue_redisplay (md);
}
@@ -436,24 +419,24 @@ static void
button_press (GtkWidget *widget, CamelMimePart *part)
{
MailDisplay *md;
-
- md = g_object_get_data ((GObject *) widget, "MailDisplay");
+
+ md = gtk_object_get_data (GTK_OBJECT (widget), "MailDisplay");
if (md == NULL) {
g_warning ("No MailDisplay on button!");
return;
}
-
+
mail_part_toggle_displayed (part, md);
mail_display_queue_redisplay (md);
}
static gboolean
-pixmap_press (GtkWidget *widget, GdkEventButton *event, gpointer user_data)
+pixmap_press (GtkWidget *widget, GdkEventButton *event, EScrollFrame *user_data)
{
EPopupMenu *menu;
- EPopupMenu save_item = E_POPUP_ITEM (N_("Save Attachment..."), G_CALLBACK (save_cb), 0);
- EPopupMenu view_item = E_POPUP_ITEM (N_("View Inline"), G_CALLBACK (inline_cb), 2);
- EPopupMenu open_item = E_POPUP_ITEM (N_("Open in %s..."), G_CALLBACK (launch_cb), 1);
+ EPopupMenu save_item = E_POPUP_ITEM (N_("Save Attachment..."), GTK_SIGNAL_FUNC (save_cb), 0);
+ EPopupMenu view_item = E_POPUP_ITEM (N_("View Inline"), GTK_SIGNAL_FUNC (inline_cb), 2);
+ EPopupMenu open_item = E_POPUP_ITEM (N_("Open in %s..."), GTK_SIGNAL_FUNC (launch_cb), 1);
MailDisplay *md;
CamelMimePart *part;
MailMimeHandler *handler;
@@ -475,10 +458,11 @@ pixmap_press (GtkWidget *widget, GdkEventButton *event, gpointer user_data)
/* Stop the signal, since we don't want the button's class method to
mess up our popup. */
- g_signal_stop_emission_by_name (widget, "button_press_event");
+ gtk_signal_emit_stop_by_name (GTK_OBJECT (widget), "button_press_event");
- part = g_object_get_data ((GObject *) widget, "CamelMimePart");
- handler = mail_lookup_handler (g_object_get_data ((GObject *) widget, "mime_type"));
+ part = gtk_object_get_data (GTK_OBJECT (widget), "CamelMimePart");
+ handler = mail_lookup_handler (gtk_object_get_data (GTK_OBJECT (widget),
+ "mime_type"));
if (handler && handler->applications)
nitems = g_list_length (handler->applications) + 2;
@@ -489,27 +473,30 @@ pixmap_press (GtkWidget *widget, GdkEventButton *event, gpointer user_data)
/* Save item */
memcpy (&menu[0], &save_item, sizeof (menu[0]));
menu[0].name = _(menu[0].name);
-
+
/* Inline view item */
memcpy (&menu[1], &view_item, sizeof (menu[1]));
if (handler && handler->builtin) {
- md = g_object_get_data ((GObject *) widget, "MailDisplay");
-
+ md = gtk_object_get_data (GTK_OBJECT (widget), "MailDisplay");
+
if (!mail_part_is_displayed_inline (part, md)) {
if (handler->component) {
- Bonobo_ActivationProperty *prop;
+ OAF_Property *prop;
char *name;
-
- prop = bonobo_server_info_prop_find (handler->component, "name");
+
+ prop = oaf_server_info_prop_find (
+ handler->component, "name");
if (!prop) {
- prop = bonobo_server_info_prop_find (handler->component,
- "description");
+ prop = oaf_server_info_prop_find (
+ handler->component,
+ "description");
}
- if (prop && prop->v._d == Bonobo_ACTIVATION_P_STRING)
+ if (prop && prop->v._d == OAF_P_STRING)
name = prop->v._u.value_string;
else
name = "bonobo";
- menu[1].name = g_strdup_printf (_("View Inline (via %s)"), name);
+ menu[1].name = g_strdup_printf (
+ _("View Inline (via %s)"), name);
} else
menu[1].name = g_strdup (_(menu[1].name));
} else
@@ -518,13 +505,13 @@ pixmap_press (GtkWidget *widget, GdkEventButton *event, gpointer user_data)
menu[1].name = g_strdup (_(menu[1].name));
mask |= 2;
}
-
+
/* External views */
if (handler && handler->applications) {
GnomeVFSMimeApplication *app;
GList *apps;
int i;
-
+
apps = handler->applications;
for (i = 2; i < nitems; i++, apps = apps->next) {
app = apps->data;
@@ -533,16 +520,16 @@ pixmap_press (GtkWidget *widget, GdkEventButton *event, gpointer user_data)
}
} else {
memcpy (&menu[2], &open_item, sizeof (menu[2]));
- menu[2].name = g_strdup_printf (_(menu[2].name), _("External Viewer"));
+ menu[2].name = g_strdup_printf (_(menu[2].name),
+ _("External Viewer"));
mask |= 1;
}
-
+
e_popup_menu_run (menu, (GdkEvent *)event, mask, 0, widget);
-
+
for (i = 1; i < nitems; i++)
g_free (menu[i].name);
g_free (menu);
-
return TRUE;
}
@@ -553,47 +540,48 @@ pixbuf_for_mime_type (const char *mime_type)
char *filename = NULL;
GdkPixbuf *pixbuf = NULL;
- icon_name = gnome_vfs_mime_get_icon (mime_type);
+ /* GnomeVFS changed the key from icon-filename to
+ icon_filename, so check icon_filename first and if that
+ fails, fall back to the old key name */
+ if (!(icon_name = gnome_vfs_mime_get_value (mime_type, "icon_filename")))
+ icon_name = gnome_vfs_mime_get_value (mime_type, "icon-filename");
if (icon_name) {
if (*icon_name == '/') {
- pixbuf = gdk_pixbuf_new_from_file (icon_name, NULL);
+ pixbuf = gdk_pixbuf_new_from_file (icon_name);
if (pixbuf)
return pixbuf;
}
- filename = gnome_program_locate_file (NULL, GNOME_FILE_DOMAIN_PIXMAP,
- icon_name, TRUE, NULL);
+ filename = gnome_pixmap_file (icon_name);
if (!filename) {
char *fm_icon;
fm_icon = g_strdup_printf ("nautilus/%s", icon_name);
- filename = gnome_program_locate_file (NULL, GNOME_FILE_DOMAIN_PIXMAP,
- fm_icon, TRUE, NULL);
+ filename = gnome_pixmap_file (fm_icon);
if (!filename) {
g_free (fm_icon);
fm_icon = g_strdup_printf ("mc/%s", icon_name);
- filename = gnome_program_locate_file (NULL, GNOME_FILE_DOMAIN_PIXMAP,
- fm_icon, TRUE, NULL);
+ filename = gnome_pixmap_file (fm_icon);
}
g_free (fm_icon);
}
if (filename) {
- pixbuf = gdk_pixbuf_new_from_file (filename, NULL);
+ pixbuf = gdk_pixbuf_new_from_file (filename);
g_free (filename);
}
}
if (!pixbuf) {
- filename = gnome_program_locate_file (NULL, GNOME_FILE_DOMAIN_PIXMAP,
- "gnome-unknown.png", TRUE, NULL);
+ filename = gnome_pixmap_file ("gnome-unknown.png");
if (filename) {
- pixbuf = gdk_pixbuf_new_from_file (filename, NULL);
+ pixbuf = gdk_pixbuf_new_from_file (filename);
g_free (filename);
} else {
g_warning ("Could not get any icon for %s!",mime_type);
- pixbuf = gdk_pixbuf_new_from_xpm_data((const char **)empty_xpm);
+ pixbuf = gdk_pixbuf_new_from_xpm_data (
+ (const char **)empty_xpm);
}
}
@@ -604,9 +592,9 @@ static gboolean
pixbuf_uncache (gpointer key)
{
GdkPixbuf *pixbuf;
-
+
pixbuf = g_hash_table_lookup (thumbnail_cache, key);
- g_object_unref (pixbuf);
+ gdk_pixbuf_unref (pixbuf);
g_hash_table_remove (thumbnail_cache, key);
g_free (key);
return FALSE;
@@ -620,93 +608,73 @@ pixbuf_gen_idle (struct _PixbufLoader *pbl)
char tmp[4096];
int len, width, height, ratio;
gpointer orig_key;
-
+
/* Get the pixbuf from the cache */
if (g_hash_table_lookup_extended (thumbnail_cache, pbl->cid,
&orig_key, (gpointer *)&mini)) {
width = gdk_pixbuf_get_width (mini);
height = gdk_pixbuf_get_height (mini);
-
- gtk_image_set_from_pixbuf ((GtkImage *) pbl->pixmap, mini);
- gtk_widget_set_size_request (pbl->pixmap, width, height);
+
+ bonobo_ui_toolbar_icon_set_pixbuf (
+ BONOBO_UI_TOOLBAR_ICON (pbl->pixmap), mini);
+ gtk_widget_set_usize (pbl->pixmap, width, height);
/* Restart the cache-cleaning timer */
g_source_remove_by_user_data (orig_key);
g_timeout_add (5 * 60 * 1000, pixbuf_uncache, orig_key);
-
+
if (pbl->loader) {
- gdk_pixbuf_loader_close (pbl->loader, NULL);
- g_object_unref (pbl->loader);
- camel_object_unref (pbl->mstream);
+ gdk_pixbuf_loader_close (pbl->loader);
+ gtk_object_destroy (GTK_OBJECT (pbl->loader));
+ camel_object_unref (CAMEL_OBJECT (pbl->mstream));
}
-
- g_signal_handler_disconnect (pbl->eb, pbl->destroy_id);
+ gtk_signal_disconnect (GTK_OBJECT (pbl->eb), pbl->destroy_id);
g_free (pbl->type);
g_free (pbl->cid);
g_free (pbl);
-
+
return FALSE;
}
-
+
/* Not in cache, so get a pixbuf from the wrapper */
-
+
if (!GTK_IS_WIDGET (pbl->pixmap)) {
/* Widget has died */
if (pbl->mstream)
- camel_object_unref (pbl->mstream);
-
+ camel_object_unref (CAMEL_OBJECT (pbl->mstream));
+
if (pbl->loader) {
- gdk_pixbuf_loader_close (pbl->loader, NULL);
- g_object_unref (pbl->loader);
+ gdk_pixbuf_loader_close (pbl->loader);
+ gtk_object_destroy (GTK_OBJECT (pbl->loader));
}
-
- g_signal_handler_disconnect (pbl->eb, pbl->destroy_id);
+
g_free (pbl->type);
g_free (pbl->cid);
g_free (pbl);
-
return FALSE;
}
-
+
if (pbl->mstream) {
if (pbl->loader == NULL)
pbl->loader = gdk_pixbuf_loader_new ();
-
+
len = camel_stream_read (pbl->mstream, tmp, 4096);
if (len > 0) {
- error = !gdk_pixbuf_loader_write (pbl->loader, tmp, len, NULL);
+ error = !gdk_pixbuf_loader_write (pbl->loader, tmp, len);
if (!error)
return TRUE;
} else if (!camel_stream_eos (pbl->mstream))
error = TRUE;
}
-
+
if (error || !pbl->mstream) {
if (pbl->type)
pixbuf = pixbuf_for_mime_type (pbl->type);
else
- pixbuf = gdk_pixbuf_new_from_file (EVOLUTION_ICONSDIR "/pgp-signature-nokey.png", NULL);
+ pixbuf = gdk_pixbuf_new_from_file (EVOLUTION_ICONSDIR "/pgp-signature-nokey.png");
} else
pixbuf = gdk_pixbuf_loader_get_pixbuf (pbl->loader);
- if (pixbuf == NULL) {
- /* pixbuf is non-existant */
- if (pbl->mstream)
- camel_object_unref (pbl->mstream);
-
- if (pbl->loader) {
- gdk_pixbuf_loader_close (pbl->loader, NULL);
- g_object_unref (pbl->loader);
- }
-
- g_signal_handler_disconnect (pbl->eb, pbl->destroy_id);
- g_free (pbl->type);
- g_free (pbl->cid);
- g_free (pbl);
-
- return FALSE;
- }
-
width = gdk_pixbuf_get_width (pixbuf);
height = gdk_pixbuf_get_height (pixbuf);
@@ -723,27 +691,26 @@ pixbuf_gen_idle (struct _PixbufLoader *pbl)
width /= ratio;
}
}
-
- mini = gdk_pixbuf_scale_simple (pixbuf, width, height, GDK_INTERP_BILINEAR);
+
+ mini = gdk_pixbuf_scale_simple (pixbuf, width, height,
+ GDK_INTERP_BILINEAR);
if (error || !pbl->mstream)
- g_object_unref (pixbuf);
-
- gtk_image_set_from_pixbuf ((GtkImage *) pbl->pixmap, mini);
-
+ gdk_pixbuf_unref (pixbuf);
+ bonobo_ui_toolbar_icon_set_pixbuf (
+ BONOBO_UI_TOOLBAR_ICON (pbl->pixmap), mini);
+
/* Add the pixbuf to the cache */
g_hash_table_insert (thumbnail_cache, pbl->cid, mini);
g_timeout_add (5 * 60 * 1000, pixbuf_uncache, pbl->cid);
-
- g_signal_handler_disconnect (pbl->eb, pbl->destroy_id);
+
+ gtk_signal_disconnect (GTK_OBJECT (pbl->eb), pbl->destroy_id);
if (pbl->loader) {
- gdk_pixbuf_loader_close (pbl->loader, NULL);
- g_object_unref (pbl->loader);
- camel_object_unref (pbl->mstream);
+ gdk_pixbuf_loader_close (pbl->loader);
+ gtk_object_unref (GTK_OBJECT (pbl->loader));
+ camel_object_unref (CAMEL_OBJECT (pbl->mstream));
}
-
g_free (pbl->type);
g_free (pbl);
-
return FALSE;
}
@@ -751,15 +718,16 @@ pixbuf_gen_idle (struct _PixbufLoader *pbl)
as the widget that the pixbuf was to be rendered to
has died on us. */
static void
-embeddable_destroy_cb (GtkObject *embeddable, struct _PixbufLoader *pbl)
+embeddable_destroy_cb (GtkObject *embeddable,
+ struct _PixbufLoader *pbl)
{
g_idle_remove_by_data (pbl);
if (pbl->mstream)
- camel_object_unref (pbl->mstream);
+ camel_object_unref (CAMEL_OBJECT (pbl->mstream));
if (pbl->loader) {
- gdk_pixbuf_loader_close (pbl->loader, NULL);
- g_object_unref (pbl->loader);
+ gdk_pixbuf_loader_close (pbl->loader);
+ gtk_object_destroy (GTK_OBJECT (pbl->loader));
}
g_free (pbl->type);
@@ -779,8 +747,6 @@ get_embedded_for_component (const char *iid, MailDisplay *md)
*/
embedded = bonobo_widget_new_control (iid, NULL);
if (embedded == NULL) {
-#warning "what about bonobo_widget_new_subdoc?"
-#if 0
/*
* No control, try an embeddable instead.
*/
@@ -791,22 +757,21 @@ get_embedded_for_component (const char *iid, MailDisplay *md)
* destruction path that we have to balance out to
* prevent problems.
*/
- bonobo_object_ref (BONOBO_OBJECT (bonobo_widget_get_client_site (
+ bonobo_object_ref (BONOBO_OBJECT(bonobo_widget_get_client_site (
BONOBO_WIDGET (embedded))));
-
+
return embedded;
}
-#endif
}
-
+
if (embedded == NULL)
return NULL;
-
+
control_frame = bonobo_widget_get_control_frame (BONOBO_WIDGET (embedded));
-
- prop_bag = bonobo_control_frame_get_control_property_bag (control_frame, NULL);
-
- if (prop_bag != CORBA_OBJECT_NIL) {
+
+ prop_bag = bonobo_control_frame_get_control_property_bag ( control_frame, NULL );
+
+ if (prop_bag != CORBA_OBJECT_NIL){
CORBA_Environment ev;
/*
* Now we can take care of business. Currently, the only control
@@ -817,20 +782,20 @@ get_embedded_for_component (const char *iid, MailDisplay *md)
*/
const CamelInternetAddress *from;
char *from_address;
-
+
CORBA_exception_init (&ev);
from = camel_mime_message_get_from (md->current_message);
- from_address = camel_address_encode ((CamelAddress *) from);
+ from_address = camel_address_encode((CamelAddress *)from);
bonobo_property_bag_client_set_value_string (
prop_bag, "from_address",
from_address, &ev);
- g_free (from_address);
-
+ g_free(from_address);
+
Bonobo_Unknown_unref (prop_bag, &ev);
CORBA_exception_free (&ev);
}
-
+
return embedded;
}
@@ -839,73 +804,63 @@ save_url (MailDisplay *md, const char *url)
{
GHashTable *urls;
CamelMimePart *part;
-
+
urls = g_datalist_get_data (md->data, "part_urls");
- g_return_val_if_fail (url != NULL, NULL);
g_return_val_if_fail (urls != NULL, NULL);
part = g_hash_table_lookup (urls, url);
if (part == NULL) {
- CamelDataWrapper *wrapper;
- CamelStream *stream = NULL;
- const char *name;
+ GByteArray *ba;
+
+ urls = g_datalist_get_data (md->data, "data_urls");
+ g_return_val_if_fail (urls != NULL, NULL);
/* See if it's some piece of cached data if it is then pretend it
- * is a mime part so that we can use the mime part saving routines.
+ * is a mime part so that we can use the mime part saveing routines.
* It is gross but it keeps duplicated code to a minimum and helps
* out with ref counting and the like.
*/
- name = strrchr (url, '/');
- name = name ? name : url;
-
- if (fetch_cache) {
- /* look in the soup cache */
- stream = camel_data_cache_get(fetch_cache, FETCH_HTTP_CACHE, url, NULL);
- } else {
- GByteArray *ba = NULL;
-
- urls = g_datalist_get_data (md->data, "data_urls");
- g_return_val_if_fail (urls != NULL, NULL);
-
- ba = g_hash_table_lookup (urls, url);
- if (ba) {
- /* we have to copy the data here since the ba may be long gone
- * by the time the user actually saves the file
- */
- stream = camel_stream_mem_new_with_buffer (ba->data, ba->len);
- }
- }
-
- if (stream) {
+ ba = g_hash_table_lookup (urls, url);
+ if (ba) {
+ CamelStream *memstream;
+ CamelDataWrapper *wrapper;
+ const char *name;
+
+ name = strrchr (url, '/');
+ name = name ? name : url;
+
+ /* we have to copy the data here since the ba may be long gone
+ * by the time the user actually saves the file
+ */
+ memstream = camel_stream_mem_new_with_buffer (ba->data, ba->len);
wrapper = camel_data_wrapper_new ();
- camel_data_wrapper_construct_from_stream (wrapper, stream);
- camel_object_unref (stream);
+ camel_data_wrapper_construct_from_stream (wrapper, memstream);
+ camel_object_unref (CAMEL_OBJECT (memstream));
part = camel_mime_part_new ();
camel_medium_set_content_object (CAMEL_MEDIUM (part), wrapper);
- camel_object_unref (wrapper);
+ camel_object_unref (CAMEL_OBJECT (wrapper));
camel_mime_part_set_filename (part, name);
}
} else {
- camel_object_ref (part);
+ camel_object_ref (CAMEL_OBJECT (part));
}
-
+
if (part) {
CamelDataWrapper *data;
-
+
g_return_val_if_fail (CAMEL_IS_MIME_PART (part), NULL);
-
+
data = camel_medium_get_content_object ((CamelMedium *)part);
if (!mail_content_loaded (data, md, TRUE, NULL, NULL, NULL)) {
return NULL;
}
-
+
save_part (part);
- camel_object_unref (part);
+ camel_object_unref (CAMEL_OBJECT (part));
return NULL;
}
- g_warning ("Data for url: \"%s\" not found", url);
-
+ g_warning ("part not found");
return NULL;
}
@@ -920,11 +875,11 @@ drag_data_get_cb (GtkWidget *widget,
CamelMimePart *part = user_data;
const char *filename, *tmpdir;
char *uri_list;
-
+
switch (info) {
case DND_TARGET_TYPE_TEXT_URI_LIST:
/* Kludge around Nautilus requesting the same data many times */
- uri_list = g_object_get_data ((GObject *) widget, "uri-list");
+ uri_list = gtk_object_get_data (GTK_OBJECT (widget), "uri-list");
if (uri_list) {
gtk_selection_data_set (selection_data, selection_data->target, 8,
uri_list, strlen (uri_list));
@@ -933,19 +888,15 @@ drag_data_get_cb (GtkWidget *widget,
tmpdir = e_mkdtemp ("drag-n-drop-XXXXXX");
if (!tmpdir) {
- GtkWidget *dialog;
+ char *msg;
- dialog = gtk_message_dialog_new (NULL, 0, GTK_MESSAGE_ERROR, GTK_RESPONSE_CLOSE,
- _("Could not create temporary directory: %s"),
- g_strerror (errno));
-
- /* FIXME: this should be async */
- gtk_dialog_run ((GtkDialog *) dialog);
- gtk_widget_destroy (dialog);
+ msg = g_strdup_printf (_("Could not create temporary directory: %s"),
+ g_strerror (errno));
+ gnome_error_dialog (msg);
+ g_free (msg);
}
filename = camel_mime_part_get_filename (part);
- /* This is the default filename used for dnd temporary target of attachment */
if (!filename)
filename = _("Unknown");
@@ -959,13 +910,13 @@ drag_data_get_cb (GtkWidget *widget,
gtk_selection_data_set (selection_data, selection_data->target, 8,
uri_list, strlen (uri_list));
- g_object_set_data_full ((GObject *) widget, "uri-list", uri_list, g_free);
+ gtk_object_set_data_full (GTK_OBJECT (widget), "uri-list", uri_list, g_free);
break;
case DND_TARGET_TYPE_PART_MIME_TYPE:
if (header_content_type_is (part->content_type, "text", "*")) {
GByteArray *ba;
-
- ba = mail_format_get_data_wrapper_text ((CamelDataWrapper *) part, NULL);
+
+ ba = mail_format_get_data_wrapper_text ((CamelDataWrapper *)part, NULL);
if (ba) {
gtk_selection_data_set (selection_data, selection_data->target, 8,
ba->data, ba->len);
@@ -973,16 +924,19 @@ drag_data_get_cb (GtkWidget *widget,
}
} else {
CamelDataWrapper *wrapper;
- CamelStreamMem *cstream;
-
- cstream = (CamelStreamMem *) camel_stream_mem_new ();
+ CamelStream *cstream;
+ GByteArray *ba;
+
+ ba = g_byte_array_new ();
+
+ cstream = camel_stream_mem_new_with_byte_array (ba);
wrapper = camel_medium_get_content_object (CAMEL_MEDIUM (part));
- camel_data_wrapper_write_to_stream (wrapper, (CamelStream *)cstream);
+ camel_data_wrapper_write_to_stream (wrapper, cstream);
gtk_selection_data_set (selection_data, selection_data->target, 8,
- cstream->buffer->data, cstream->buffer->len);
+ ba->data, ba->len);
- camel_object_unref (cstream);
+ camel_object_unref (CAMEL_OBJECT (cstream));
}
break;
default:
@@ -997,10 +951,10 @@ drag_data_delete_cb (GtkWidget *widget,
{
char *uri_list;
- uri_list = g_object_get_data ((GObject *) widget, "uri-list");
+ uri_list = gtk_object_get_data (GTK_OBJECT (widget), "uri-list");
if (uri_list) {
unlink (uri_list + 7);
- g_object_set_data ((GObject *) widget, "uri-list", NULL);
+ gtk_object_set_data (GTK_OBJECT (widget), "uri-list", NULL);
}
}
@@ -1013,7 +967,7 @@ do_attachment_header (GtkHTML *html, GtkHTMLEmbedded *eb,
struct _PixbufLoader *pbl;
pbl = g_new0 (struct _PixbufLoader, 1);
- if (strncasecmp (eb->type, "image/", 6) == 0) {
+ if (g_strncasecmp (eb->type, "image/", 6) == 0) {
CamelDataWrapper *content;
content = camel_medium_get_content_object (CAMEL_MEDIUM (part));
@@ -1023,47 +977,50 @@ do_attachment_header (GtkHTML *html, GtkHTMLEmbedded *eb,
camel_stream_reset (pbl->mstream);
}
}
-
pbl->type = g_strdup (eb->type);
pbl->cid = g_strdup (eb->classid + 6);
- pbl->pixmap = gtk_image_new();
- gtk_widget_set_size_request (pbl->pixmap, 24, 24);
+ pbl->pixmap = bonobo_ui_toolbar_icon_new ();
+ gtk_widget_set_usize (pbl->pixmap, 24, 24);
pbl->eb = eb;
- pbl->destroy_id = g_signal_connect (eb, "destroy", G_CALLBACK (embeddable_destroy_cb), pbl);
+ pbl->destroy_id = gtk_signal_connect (GTK_OBJECT (eb), "destroy",
+ embeddable_destroy_cb, pbl);
- g_idle_add_full (G_PRIORITY_LOW, (GSourceFunc) pixbuf_gen_idle, pbl, NULL);
+ g_idle_add_full (G_PRIORITY_LOW, (GSourceFunc)pixbuf_gen_idle,
+ pbl, NULL);
mainbox = gtk_hbox_new (FALSE, 0);
button = gtk_button_new ();
GTK_WIDGET_UNSET_FLAGS (button, GTK_CAN_FOCUS);
- g_object_set_data ((GObject *) button, "MailDisplay", md);
+ gtk_object_set_data (GTK_OBJECT (button), "MailDisplay", md);
handler = mail_lookup_handler (eb->type);
if (handler && handler->builtin)
- g_signal_connect (button, "clicked", G_CALLBACK (button_press), part);
+ gtk_signal_connect (GTK_OBJECT (button), "clicked",
+ GTK_SIGNAL_FUNC (button_press), part);
/* Drag & Drop */
- drag_types[DND_TARGET_TYPE_PART_MIME_TYPE].target = header_content_type_simple (part->content_type);
- camel_strdown (drag_types[DND_TARGET_TYPE_PART_MIME_TYPE].target);
-
+ drag_types[DND_TARGET_TYPE_PART_MIME_TYPE].target = header_content_type_simple(part->content_type);
+ g_strdown (drag_types[DND_TARGET_TYPE_PART_MIME_TYPE].target);
+
gtk_drag_source_set (button, GDK_BUTTON1_MASK,
drag_types, num_drag_types,
GDK_ACTION_COPY);
- g_signal_connect (button, "drag-data-get", G_CALLBACK (drag_data_get_cb), part);
- g_signal_connect (button, "drag-data-delete", G_CALLBACK (drag_data_delete_cb), part);
+ gtk_signal_connect (GTK_OBJECT (button), "drag-data-get",
+ drag_data_get_cb, part);
+ gtk_signal_connect (GTK_OBJECT (button), "drag-data-delete",
+ drag_data_delete_cb, part);
g_free (drag_types[DND_TARGET_TYPE_PART_MIME_TYPE].target);
drag_types[DND_TARGET_TYPE_PART_MIME_TYPE].target = NULL;
-
+
hbox = gtk_hbox_new (FALSE, 2);
gtk_container_set_border_width (GTK_CONTAINER (hbox), 2);
- /* should this be a gtk_arrow? */
if (handler && mail_part_is_displayed_inline (part, md))
- arrow = gtk_image_new_from_stock (GTK_STOCK_GO_DOWN, GTK_ICON_SIZE_BUTTON);
+ arrow = gnome_stock_new_with_icon (GNOME_STOCK_PIXMAP_DOWN);
else
- arrow = gtk_image_new_from_stock (GTK_STOCK_GO_FORWARD, GTK_ICON_SIZE_BUTTON);
+ arrow = gnome_stock_new_with_icon (GNOME_STOCK_PIXMAP_FORWARD);
gtk_box_pack_start (GTK_BOX (hbox), arrow, TRUE, TRUE, 0);
gtk_box_pack_start (GTK_BOX (hbox), pbl->pixmap, TRUE, TRUE, 0);
gtk_container_add (GTK_CONTAINER (button), hbox);
@@ -1074,11 +1031,13 @@ do_attachment_header (GtkHTML *html, GtkHTMLEmbedded *eb,
gtk_arrow_new (GTK_ARROW_DOWN,
GTK_SHADOW_ETCHED_IN));
- g_object_set_data ((GObject *) popup, "MailDisplay", md);
- g_object_set_data ((GObject *) popup, "CamelMimePart", part);
- g_object_set_data_full ((GObject *) popup, "mime_type", g_strdup (eb->type), (GDestroyNotify) g_free);
+ gtk_object_set_data (GTK_OBJECT (popup), "MailDisplay", md);
+ gtk_object_set_data (GTK_OBJECT (popup), "CamelMimePart", part);
+ gtk_object_set_data_full (GTK_OBJECT (popup), "mime_type",
+ g_strdup (eb->type), (GDestroyNotify)g_free);
- g_signal_connect (popup, "button_press_event", G_CALLBACK (pixmap_press), md->scroll);
+ gtk_signal_connect (GTK_OBJECT (popup), "button_press_event",
+ GTK_SIGNAL_FUNC (pixmap_press), md->scroll);
gtk_box_pack_start (GTK_BOX (mainbox), button, TRUE, TRUE, 0);
gtk_box_pack_start (GTK_BOX (mainbox), popup, TRUE, TRUE, 0);
@@ -1094,11 +1053,13 @@ do_external_viewer (GtkHTML *html, GtkHTMLEmbedded *eb,
CamelMimePart *part, MailDisplay *md)
{
CamelDataWrapper *wrapper;
- Bonobo_ServerInfo *component;
+ OAF_ServerInfo *component;
GtkWidget *embedded;
+ BonoboObjectClient *server;
Bonobo_PersistStream persist;
CORBA_Environment ev;
- CamelStreamMem *cstream;
+ GByteArray *ba;
+ CamelStream *cstream;
BonoboStream *bstream;
MailMimeHandler *handler;
@@ -1109,49 +1070,50 @@ do_external_viewer (GtkHTML *html, GtkHTMLEmbedded *eb,
component = gnome_vfs_mime_get_default_component (eb->type);
if (!component)
return FALSE;
-
+
embedded = get_embedded_for_component (component->iid, md);
CORBA_free (component);
if (!embedded)
return FALSE;
-
- persist = (Bonobo_PersistStream) Bonobo_Unknown_queryInterface (
- bonobo_widget_get_objref (BONOBO_WIDGET (embedded)),
- "IDL:Bonobo/PersistStream:1.0", NULL);
-
+
+ server = bonobo_widget_get_server (BONOBO_WIDGET (embedded));
+ persist = (Bonobo_PersistStream) bonobo_object_client_query_interface (
+ server, "IDL:Bonobo/PersistStream:1.0", NULL);
if (persist == CORBA_OBJECT_NIL) {
gtk_object_sink (GTK_OBJECT (embedded));
return FALSE;
}
-
+
/* Write the data to a CamelStreamMem... */
- cstream = (CamelStreamMem *) camel_stream_mem_new ();
+ ba = g_byte_array_new ();
+ cstream = camel_stream_mem_new_with_byte_array (ba);
wrapper = camel_medium_get_content_object (CAMEL_MEDIUM (part));
- camel_data_wrapper_write_to_stream (wrapper, (CamelStream *)cstream);
-
+ camel_data_wrapper_write_to_stream (wrapper, cstream);
+
/* ...convert the CamelStreamMem to a BonoboStreamMem... */
- bstream = bonobo_stream_mem_create (cstream->buffer->data, cstream->buffer->len, TRUE, FALSE);
- camel_object_unref (cstream);
-
+ bstream = bonobo_stream_mem_create (ba->data, ba->len, TRUE, FALSE);
+ camel_object_unref (CAMEL_OBJECT (cstream));
+
/* ...and hydrate the PersistStream from the BonoboStream. */
CORBA_exception_init (&ev);
Bonobo_PersistStream_load (persist,
- bonobo_object_corba_objref (BONOBO_OBJECT (bstream)),
+ bonobo_object_corba_objref (
+ BONOBO_OBJECT (bstream)),
eb->type, &ev);
bonobo_object_unref (BONOBO_OBJECT (bstream));
Bonobo_Unknown_unref (persist, &ev);
CORBA_Object_release (persist, &ev);
-
+
if (ev._major != CORBA_NO_EXCEPTION) {
gtk_object_sink (GTK_OBJECT (embedded));
CORBA_exception_free (&ev);
return FALSE;
}
CORBA_exception_free (&ev);
-
+
gtk_widget_show (embedded);
gtk_container_add (GTK_CONTAINER (eb), embedded);
-
+
return TRUE;
}
@@ -1161,25 +1123,28 @@ do_signature (GtkHTML *html, GtkHTMLEmbedded *eb,
{
GtkWidget *button;
struct _PixbufLoader *pbl;
-
+
pbl = g_new0 (struct _PixbufLoader, 1);
pbl->type = NULL;
pbl->cid = g_strdup (eb->classid);
- pbl->pixmap = gtk_image_new ();
- gtk_widget_set_size_request (pbl->pixmap, 24, 24);
+ pbl->pixmap = bonobo_ui_toolbar_icon_new ();
+ gtk_widget_set_usize (pbl->pixmap, 24, 24);
pbl->eb = eb;
- pbl->destroy_id = g_signal_connect (eb, "destroy", G_CALLBACK (embeddable_destroy_cb), pbl);
-
- g_idle_add_full (G_PRIORITY_LOW, (GSourceFunc) pixbuf_gen_idle, pbl, NULL);
-
+ pbl->destroy_id = gtk_signal_connect (GTK_OBJECT (eb), "destroy",
+ embeddable_destroy_cb, pbl);
+
+ g_idle_add_full (G_PRIORITY_LOW, (GSourceFunc)pixbuf_gen_idle,
+ pbl, NULL);
+
button = gtk_button_new ();
GTK_WIDGET_UNSET_FLAGS (button, GTK_CAN_FOCUS);
- g_object_set_data ((GObject *) button, "MailDisplay", md);
- g_signal_connect (button, "clicked", G_CALLBACK (button_press), part);
+ gtk_object_set_data (GTK_OBJECT (button), "MailDisplay", md);
+ gtk_signal_connect (GTK_OBJECT (button), "clicked",
+ GTK_SIGNAL_FUNC (button_press), part);
gtk_container_add (GTK_CONTAINER (button), pbl->pixmap);
gtk_widget_show_all (button);
gtk_container_add (GTK_CONTAINER (eb), button);
-
+
return TRUE;
}
@@ -1189,10 +1154,10 @@ on_object_requested (GtkHTML *html, GtkHTMLEmbedded *eb, gpointer data)
MailDisplay *md = data;
GHashTable *urls;
CamelMimePart *part;
-
+
if (!eb->classid)
return FALSE;
-
+
urls = g_datalist_get_data (md->data, "part_urls");
if (!urls)
return FALSE;
@@ -1213,7 +1178,7 @@ on_object_requested (GtkHTML *html, GtkHTMLEmbedded *eb, gpointer data)
return FALSE;
return do_external_viewer (html, eb, part, md);
}
-
+
return FALSE;
}
@@ -1221,11 +1186,11 @@ static void
ebook_callback (EBook *book, const gchar *addr, ECard *card, gpointer data)
{
MailDisplay *md = data;
-
+
if (card && md->current_message) {
const CamelInternetAddress *from = camel_mime_message_get_from (md->current_message);
const char *md_name = NULL, *md_addr = NULL;
-
+
/* We are extra anal, in case we are dealing with some sort of pathological message
w/o a From: header. */
if (from != NULL && camel_internet_address_get (from, 0, &md_name, &md_addr)) {
@@ -1240,13 +1205,10 @@ on_url_requested (GtkHTML *html, const char *url, GtkHTMLStream *handle,
gpointer user_data)
{
MailDisplay *md = user_data;
- GConfClient *gconf;
GHashTable *urls;
CamelMedium *medium;
GByteArray *ba;
- gconf = gconf_client_get_default ();
-
urls = g_datalist_get_data (md->data, "part_urls");
g_return_if_fail (urls != NULL);
@@ -1254,30 +1216,34 @@ on_url_requested (GtkHTML *html, const char *url, GtkHTMLStream *handle,
medium = g_hash_table_lookup (urls, url);
if (medium) {
CamelContentType *content_type;
- CamelDataWrapper *wrapper;
- CamelStream *html_stream;
+ CamelDataWrapper *data;
g_return_if_fail (CAMEL_IS_MEDIUM (medium));
if (md->related)
- g_hash_table_remove (md->related, medium);
+ g_hash_table_remove(md->related, medium);
- wrapper = camel_medium_get_content_object (medium);
- if (!mail_content_loaded (wrapper, md, FALSE, url, html, handle))
+ data = camel_medium_get_content_object (medium);
+ if (!mail_content_loaded (data, md, FALSE, url, html, handle))
return;
- content_type = camel_data_wrapper_get_mime_type_field (wrapper);
-
- html_stream = mail_display_stream_new (html, handle);
+ content_type = camel_data_wrapper_get_mime_type_field (data);
if (header_content_type_is (content_type, "text", "*")) {
- mail_format_data_wrapper_write_to_stream (wrapper, md, html_stream);
+ ba = mail_format_get_data_wrapper_text (data, md);
+ if (ba) {
+ gtk_html_write (html, handle, ba->data, ba->len);
+
+ g_byte_array_free (ba, TRUE);
+ }
} else {
- camel_data_wrapper_write_to_stream (wrapper, html_stream);
+ CamelStream *html_stream;
+
+ html_stream = mail_stream_gtkhtml_new (html, handle);
+ camel_data_wrapper_write_to_stream (data, html_stream);
+ camel_object_unref (CAMEL_OBJECT (html_stream));
}
- camel_object_unref (html_stream);
-
gtk_html_end (html, handle, GTK_HTML_STREAM_OK);
return;
}
@@ -1300,22 +1266,18 @@ on_url_requested (GtkHTML *html, const char *url, GtkHTMLStream *handle,
/* See if it's something we can load. */
if (strncmp (url, "http:", 5) == 0 || strncmp (url, "https:", 6) == 0) {
- int http_mode;
-
- http_mode = gconf_client_get_int (gconf, "/apps/evolution/mail/display/load_http_images", NULL);
- if (http_mode == MAIL_CONFIG_HTTP_ALWAYS ||
+ if (mail_config_get_http_mode () == MAIL_CONFIG_HTTP_ALWAYS ||
g_datalist_get_data (md->data, "load_images")) {
- fetch_remote (md, url, html, handle);
- } else if (http_mode == MAIL_CONFIG_HTTP_SOMETIMES &&
+ fetch_remote(md, url, html, handle);
+ } else if (mail_config_get_http_mode () == MAIL_CONFIG_HTTP_SOMETIMES &&
!g_datalist_get_data (md->data, "checking_from")) {
- const CamelInternetAddress *from;
+ const CamelInternetAddress *from = camel_mime_message_get_from (md->current_message);
const char *name, *addr;
- from = camel_mime_message_get_from (md->current_message);
- g_datalist_set_data (md->data, "checking_from", GINT_TO_POINTER (1));
+ g_datalist_set_data (md->data, "checking_from",
+ GINT_TO_POINTER (1));
- /* Make sure we aren't deal w/ some sort of a
- pathological message w/o a From: header */
+ /* Make sure we aren't deal w/ some sort of a pathological message w/o a From: header */
if (from != NULL && camel_internet_address_get (from, 0, &name, &addr))
e_book_query_address_default (addr, ebook_callback, md);
else
@@ -1329,22 +1291,20 @@ static struct _mail_msg_op fetch_fake_op = {
NULL, NULL, NULL, NULL,
};
-static gboolean
-fetch_cancelled (GIOChannel *source, GIOCondition cond, void *user_data)
+static gboolean fetch_cancelled(GIOChannel *source, GIOCondition cond, void *data)
{
- fetch_cancel ((MailDisplay *) user_data);
-
+ fetch_cancel((MailDisplay *)data);
+
return FALSE;
}
-static void
-fetch_next (MailDisplay *md)
+static void fetch_next(MailDisplay *md)
{
struct _remote_data *rd;
struct _MailDisplayPrivate *p = md->priv;
SoupMessage *msg;
SoupContext *ctx;
-
+
/* if we're called and no more work to do, clean up, otherwise, setup */
if (e_dlist_empty(&p->fetch_active) && e_dlist_empty(&p->fetch_queue)) {
if (p->fetch_msg) {
@@ -1419,7 +1379,7 @@ static void fetch_remote(MailDisplay *md, const char *uri, GtkHTML *html, GtkHTM
rd->md = md; /* dont ref */
rd->uri = g_strdup(uri);
rd->html = html;
- g_object_ref(html);
+ gtk_object_ref((GtkObject *)html);
rd->stream = stream;
rd->cstream = cstream;
@@ -1474,7 +1434,7 @@ static void fetch_data(SoupMessage *req, void *data)
static void fetch_free(struct _remote_data *rd)
{
- g_object_unref(rd->html);
+ gtk_object_unref((GtkObject *)rd->html);
if (rd->cstream)
camel_object_unref(rd->cstream);
g_free(rd->uri);
@@ -1573,9 +1533,9 @@ try_part_urls (struct _load_content_msg *m)
return TRUE;
}
- html_stream = mail_display_stream_new (m->html, m->handle);
+ html_stream = mail_stream_gtkhtml_new (m->html, m->handle);
camel_data_wrapper_write_to_stream (data, html_stream);
- camel_object_unref (html_stream);
+ camel_object_unref (CAMEL_OBJECT (html_stream));
gtk_html_end (m->html, m->handle, GTK_HTML_STREAM_OK);
return TRUE;
@@ -1593,9 +1553,12 @@ try_data_urls (struct _load_content_msg *m)
urls = g_datalist_get_data (m->display->data, "data_urls");
ba = g_hash_table_lookup (urls, m->url);
+ printf ("url: %s data: %p len: %d\n", m->url, ba, ba ? ba->len : -1);
if (ba) {
- if (ba->len)
+ if (ba->len) {
+ printf ("writing ...\n");
gtk_html_write (m->html, m->handle, ba->data, ba->len);
+ }
gtk_html_end (m->html, m->handle, GTK_HTML_STREAM_OK);
return TRUE;
}
@@ -1608,18 +1571,20 @@ load_content_loaded (struct _mail_msg *mm)
{
struct _load_content_msg *m = (struct _load_content_msg *)mm;
- if (m->display->destroyed)
+ if (GTK_OBJECT_DESTROYED (m->display))
return;
if (m->display->current_message == m->message) {
if (m->handle) {
+ printf ("handle: %p orig: %d actual: %d\n", m->handle,
+ m->redisplay_counter,
+ m->display->redisplay_counter);
if (m->redisplay_counter == m->display->redisplay_counter) {
if (!try_part_urls (m) && !try_data_urls (m))
gtk_html_end (m->html, m->handle, GTK_HTML_STREAM_ERROR);
}
- } else {
+ } else
mail_display_redisplay (m->display, FALSE);
- }
}
}
@@ -1629,9 +1594,9 @@ load_content_free (struct _mail_msg *mm)
struct _load_content_msg *m = (struct _load_content_msg *)mm;
g_free (m->url);
- g_object_unref (m->html);
- g_object_unref (m->display);
- camel_object_unref (m->message);
+ gtk_object_unref (GTK_OBJECT (m->html));
+ gtk_object_unref (GTK_OBJECT (m->display));
+ camel_object_unref (CAMEL_OBJECT (m->message));
}
static struct _mail_msg_op load_content_op = {
@@ -1653,7 +1618,7 @@ stream_write_or_redisplay_when_loaded (MailDisplay *md,
struct _load_content_msg *m;
GHashTable *loading;
- if (md->destroyed)
+ if (GTK_OBJECT_DESTROYED (md))
return;
loading = g_datalist_get_data (md->data, "loading");
@@ -1663,20 +1628,20 @@ stream_write_or_redisplay_when_loaded (MailDisplay *md,
} else {
loading = g_hash_table_new (NULL, NULL);
g_datalist_set_data_full (md->data, "loading", loading,
- (GDestroyNotify) g_hash_table_destroy);
+ (GDestroyNotify)g_hash_table_destroy);
}
- g_hash_table_insert (loading, (gpointer) key, GINT_TO_POINTER (1));
+ g_hash_table_insert (loading, (gpointer)key, GINT_TO_POINTER (1));
m = mail_msg_new (&load_content_op, NULL, sizeof (*m));
m->display = md;
- g_object_ref((m->display));
+ gtk_object_ref (GTK_OBJECT (m->display));
m->html = html;
- g_object_ref((html));
+ gtk_object_ref (GTK_OBJECT (html));
m->handle = handle;
m->url = g_strdup (url);
m->redisplay_counter = md->redisplay_counter;
m->message = md->current_message;
- camel_object_ref (m->message);
+ camel_object_ref (CAMEL_OBJECT (m->message));
m->callback = callback;
m->data = data;
@@ -1707,79 +1672,31 @@ mail_display_redisplay_when_loaded (MailDisplay *md,
}
void
-mail_text_write (MailDisplayStream *stream, MailDisplay *md, CamelMimePart *part,
- int idx, gboolean printing, const char *text)
+mail_text_write (GtkHTML *html, GtkHTMLStream *stream, gboolean printing, const char *text)
{
- CamelStreamFilter *filtered_stream;
- CamelMimeFilter *html_filter;
- GConfClient *gconf;
- guint32 flags, rgb;
- GdkColor colour;
- char *buf;
-
- gconf = gconf_client_get_default ();
-
- flags = CAMEL_MIME_FILTER_TOHTML_CONVERT_NL | CAMEL_MIME_FILTER_TOHTML_CONVERT_SPACES;
-
- if (!printing)
- flags |= CAMEL_MIME_FILTER_TOHTML_CONVERT_URLS | CAMEL_MIME_FILTER_TOHTML_CONVERT_ADDRESSES;
-
- if (!printing && gconf_client_get_bool (gconf, "/apps/evolution/mail/display/mark_citations", NULL))
- flags |= CAMEL_MIME_FILTER_TOHTML_MARK_CITATION;
-
- buf = gconf_client_get_string (gconf, "/apps/evolution/mail/display/citation_colour", NULL);
- gdk_color_parse (buf ? buf : "#737373", &colour);
- g_free (buf);
-
- rgb = ((colour.red & 0xff00) << 8) | (colour.green & 0xff00) | ((colour.blue & 0xff00) >> 8);
- html_filter = camel_mime_filter_tohtml_new (flags, rgb);
- filtered_stream = camel_stream_filter_new_with_stream ((CamelStream *) stream);
- camel_stream_filter_add (filtered_stream, html_filter);
- camel_object_unref (html_filter);
-
- camel_stream_write ((CamelStream *) stream, "<tt>\n", 5);
- camel_stream_write ((CamelStream *) filtered_stream, text, strlen (text));
- camel_stream_flush ((CamelStream *) filtered_stream);
- camel_stream_write ((CamelStream *) stream, "</tt>\n", 6);
- camel_object_unref (filtered_stream);
-
-#if 0
- /* this was the old way of doing it, I don't understand why we need iframes... */
- GByteArray *ba;
- char *xed, *iframe;
- char *btt = "<tt>\n";
- char *ett = "</tt>\n";
+ guint flags;
char *htmltext;
- guint32 flags;
- flags = CAMEL_MIME_FILTER_TOHTML_CONVERT_NL | CAMEL_MIME_FILTER_TOHTML_CONVERT_SPACES;
+ flags = E_TEXT_TO_HTML_CONVERT_NL | E_TEXT_TO_HTML_CONVERT_SPACES;
if (!printing)
- flags |= CAMEL_MIME_FILTER_TOHTML_CONVERT_URLS | CAMEL_MIME_FILTER_TOHTML_CONVERT_ADDRESSES;
+ flags |= E_TEXT_TO_HTML_CONVERT_URLS | E_TEXT_TO_HTML_CONVERT_ADDRESSES;
- if (!printing && mail_config_get_citation_highlight ())
- flags |= CAMEL_MIME_FILTER_TOHTML_MARK_CITATION;
+ if (mail_config_get_citation_highlight () && ! printing)
+ flags |= E_TEXT_TO_HTML_MARK_CITATION;
- htmltext = camel_text_to_html (text, flags, mail_config_get_citation_color ());
+ htmltext = e_text_to_html_full (text, flags, mail_config_get_citation_color ());
- ba = g_byte_array_new ();
- g_byte_array_append (ba, (const guint8 *) btt, strlen (btt) + 1);
- g_byte_array_append (ba, (const guint8 *) htmltext, strlen (htmltext) + 1);
- g_byte_array_append (ba, (const guint8 *) ett, strlen (ett) + 1);
+ gtk_html_write (html, stream, "<tt>", 4);
+ gtk_html_write (html, stream, htmltext, strlen (htmltext));
+ gtk_html_write (html, stream, "</tt>", 5);
g_free (htmltext);
-
- xed = g_strdup_printf ("x-evolution-data:%p-%d", part, idx);
- iframe = g_strdup_printf ("<iframe src=\"%s\" frameborder=0 scrolling=no>could not get %s</iframe>", xed, xed);
- mail_display_add_url (md, "data_urls", xed, ba);
- camel_stream_write ((CamelStream *) stream, iframe, strlen (iframe));
- g_free (iframe);
-#endif
}
void
-mail_error_printf (MailDisplayStream *stream, const char *format, ...)
+mail_error_printf (GtkHTML *html, GtkHTMLStream *stream,
+ const char *format, ...)
{
- /* FIXME: it'd be nice if camel-stream had a vprintf method... */
char *buf, *htmltext;
va_list ap;
@@ -1787,13 +1704,12 @@ mail_error_printf (MailDisplayStream *stream, const char *format, ...)
buf = g_strdup_vprintf (format, ap);
va_end (ap);
- htmltext = camel_text_to_html (buf, CAMEL_MIME_FILTER_TOHTML_CONVERT_NL |
- CAMEL_MIME_FILTER_TOHTML_CONVERT_URLS, 0);
+ htmltext = e_text_to_html (buf, E_TEXT_TO_HTML_CONVERT_NL | E_TEXT_TO_HTML_CONVERT_URLS);
g_free (buf);
- camel_stream_printf ((CamelStream *) stream, "<em><font color=red>");
- camel_stream_write ((CamelStream *) stream, htmltext, strlen (htmltext));
- camel_stream_printf ((CamelStream *) stream, "</font></em>");
+ gtk_html_stream_printf (stream, "<em><font color=red>");
+ gtk_html_stream_write (stream, htmltext, strlen (htmltext));
+ gtk_html_stream_printf (stream, "</font></em>");
g_free (htmltext);
}
@@ -1801,31 +1717,26 @@ mail_error_printf (MailDisplayStream *stream, const char *format, ...)
#define COLOR_IS_LIGHT(r, g, b) ((r + g + b) > (128 * 3))
-#define HTML_HEADER "<!doctype html public \"-//W3C//DTD HTML 4.0 TRANSITIONAL//EN\">\n<html>\n" \
- "<head>\n<meta name=\"generator\" content=\"Evolution Mail Component\">\n</head>\n"
-
void
mail_display_render (MailDisplay *md, GtkHTML *html, gboolean reset_scroll)
{
const char *flag, *completed;
- GtkHTMLStream *html_stream;
- MailDisplayStream *stream;
+ GtkHTMLStream *stream;
g_return_if_fail (IS_MAIL_DISPLAY (md));
g_return_if_fail (GTK_IS_HTML (html));
- html_stream = gtk_html_begin (html);
+ stream = gtk_html_begin (html);
if (!reset_scroll) {
/* This is a hack until there's a clean way to do this. */
GTK_HTML (md->html)->engine->newPage = FALSE;
}
- gtk_html_stream_write (html_stream, HTML_HEADER, sizeof (HTML_HEADER) - 1);
-
- if (md->current_message && md->display_style == MAIL_CONFIG_DISPLAY_SOURCE)
- gtk_html_stream_write (html_stream, "<body>\n", 7);
- else
- gtk_html_stream_write (html_stream, "<body marginwidth=0 marginheight=0>\n", 36);
+ mail_html_write (html, stream,
+ "<!doctype html public \"-//W3C//DTD HTML 4.0 TRANSITIONAL//EN\">\n"
+ "<html>\n"
+ "<head>\n<meta name=\"generator\" content=\"Evolution Mail Component\">\n</head>\n");
+ mail_html_write (html, stream, "<body marginwidth=0 marginheight=0>\n");
flag = md->info ? camel_tag_get (&md->info->user_tags, "follow-up") : NULL;
completed = md->info ? camel_tag_get (&md->info->user_tags, "completed-on") : NULL;
@@ -1839,7 +1750,6 @@ mail_display_render (MailDisplay *md, GtkHTML *html, gboolean reset_scroll)
int offset;
/* my favorite thing to do... muck around with colors so we respect people's stupid themes. */
- /* FIXME: this is also in mail-format.c */
style = gtk_widget_get_style (GTK_WIDGET (html));
if (style && !md->printing) {
int state = GTK_WIDGET_STATE (GTK_WIDGET (html));
@@ -1876,7 +1786,7 @@ mail_display_render (MailDisplay *md, GtkHTML *html, gboolean reset_scroll)
target_date = header_decode_date (due_by, &offset);
now = time (NULL);
if (now >= target_date)
- overdue = _("Overdue:");
+ overdue = U_("Overdue:");
localtime_r (&target_date, &due);
@@ -1885,7 +1795,7 @@ mail_display_render (MailDisplay *md, GtkHTML *html, gboolean reset_scroll)
due_date[0] = '\0';
}
- gtk_html_stream_printf (html_stream, "<font color=\"#%s\">"
+ gtk_html_stream_printf (stream, "<font color=\"#%s\">"
"<table width=\"100%%\" cellpadding=0 cellspacing=0><tr><td colspan=3 height=10></td></tr>"
"<tr><td width=10></td><td>"
"<table cellspacing=1 cellpadding=1 bgcolor=\"#000000\" width=\"100%%\"><tr><td>"
@@ -1899,18 +1809,14 @@ mail_display_render (MailDisplay *md, GtkHTML *html, gboolean reset_scroll)
}
if (md->current_message) {
- stream = (MailDisplayStream *) mail_display_stream_new (html, html_stream);
-
if (md->display_style == MAIL_CONFIG_DISPLAY_SOURCE)
- mail_format_raw_message (md->current_message, md, stream);
+ mail_format_raw_message (md->current_message, md, html, stream);
else
- mail_format_mime_message (md->current_message, md, stream);
-
- camel_object_unref (stream);
+ mail_format_mime_message (md->current_message, md, html, stream);
}
- gtk_html_stream_write (html_stream, "</body></html>\n", 15);
- gtk_html_end (html, html_stream, GTK_HTML_STREAM_OK);
+ mail_html_write (html, stream, "</body></html>\n");
+ gtk_html_end (html, stream, GTK_HTML_STREAM_OK);
}
/**
@@ -1923,15 +1829,9 @@ mail_display_render (MailDisplay *md, GtkHTML *html, gboolean reset_scroll)
void
mail_display_redisplay (MailDisplay *md, gboolean reset_scroll)
{
- if (md->destroyed)
+ if (GTK_OBJECT_DESTROYED (md))
return;
- /* we're in effect stealing the queued redisplay */
- if (md->idle_id) {
- g_source_remove(md->idle_id);
- md->idle_id = 0;
- }
-
fetch_cancel(md);
md->last_active = NULL;
@@ -1964,7 +1864,7 @@ mail_display_set_message (MailDisplay *md, CamelMedium *medium, CamelFolder *fol
/* Clean up from previous message. */
if (md->current_message) {
fetch_cancel (md);
- camel_object_unref (md->current_message);
+ camel_object_unref (CAMEL_OBJECT (md->current_message));
g_datalist_clear (md->data);
}
@@ -2006,7 +1906,7 @@ mail_display_set_charset (MailDisplay *mail_display, const char *charset)
{
g_free (mail_display->charset);
mail_display->charset = g_strdup (charset);
-
+
mail_display_queue_redisplay (mail_display);
}
@@ -2028,12 +1928,10 @@ mail_display_load_images (MailDisplay *md)
*----------------------------------------------------------------------*/
static void
-mail_display_init (GObject *object)
+mail_display_init (GtkObject *object)
{
MailDisplay *mail_display = MAIL_DISPLAY (object);
- GConfClient *gconf;
- int style;
-
+
mail_display->scroll = NULL;
mail_display->html = NULL;
mail_display->redisplay_counter = 0;
@@ -2047,15 +1945,11 @@ mail_display_init (GObject *object)
mail_display->data = NULL;
mail_display->invisible = gtk_invisible_new ();
- g_object_ref (mail_display->invisible);
- gtk_object_sink ((GtkObject *) mail_display->invisible);
-
- gconf = gconf_client_get_default ();
- style = gconf_client_get_int (gconf, "/apps/evolution/mail/format/message_display_style", NULL);
- mail_display->display_style = style;
-
+
+ mail_display->display_style = mail_config_get_message_display_style ();
+
mail_display->printing = FALSE;
-
+
mail_display->priv = g_malloc0(sizeof(*mail_display->priv));
e_dlist_init(&mail_display->priv->fetch_active);
e_dlist_init(&mail_display->priv->fetch_queue);
@@ -2065,48 +1959,33 @@ static void
mail_display_destroy (GtkObject *object)
{
MailDisplay *mail_display = MAIL_DISPLAY (object);
-
- if (mail_display->html) {
- g_object_unref (mail_display->html);
- mail_display->html = NULL;
- }
+
+ gtk_object_unref (GTK_OBJECT (mail_display->html));
if (mail_display->current_message) {
camel_object_unref (mail_display->current_message);
g_datalist_clear (mail_display->data);
fetch_cancel(mail_display);
- mail_display->current_message = NULL;
}
g_free (mail_display->charset);
- mail_display->charset = NULL;
g_free (mail_display->selection);
- mail_display->selection = NULL;
if (mail_display->folder) {
if (mail_display->info)
camel_folder_free_message_info (mail_display->folder, mail_display->info);
camel_object_unref (mail_display->folder);
- mail_display->folder = NULL;
}
g_free (mail_display->data);
mail_display->data = NULL;
- if (mail_display->idle_id) {
+ if (mail_display->idle_id)
gtk_timeout_remove (mail_display->idle_id);
- mail_display->idle_id = 0;
- }
- if (mail_display->invisible) {
- g_object_unref (mail_display->invisible);
- mail_display->invisible = NULL;
- }
-
- g_free (mail_display->priv);
- mail_display->priv = NULL;
-
- mail_display->destroyed = TRUE;
+ gtk_widget_unref (mail_display->invisible);
+
+ g_free(mail_display->priv);
mail_display_parent_class->destroy (object);
}
@@ -2119,14 +1998,14 @@ invisible_selection_get_callback (GtkWidget *widget,
void *data)
{
MailDisplay *display;
-
+
display = MAIL_DISPLAY (data);
if (!display->selection)
return;
g_assert (info == 1);
-
+
gtk_selection_data_set (selection_data, GDK_SELECTION_TYPE_STRING, 8,
display->selection, strlen (display->selection));
}
@@ -2137,12 +2016,12 @@ invisible_selection_clear_event_callback (GtkWidget *widget,
void *data)
{
MailDisplay *display;
-
+
display = MAIL_DISPLAY (data);
-
+
g_free (display->selection);
display->selection = NULL;
-
+
return TRUE;
}
@@ -2150,22 +2029,21 @@ static void
mail_display_class_init (GtkObjectClass *object_class)
{
object_class->destroy = mail_display_destroy;
-
+
if (mail_display_parent_class == NULL) {
/* blah, this is an unecessary dependency ... */
extern char *evolution_dir;
- char *path;
-
- path = g_alloca (strlen (evolution_dir) + 16);
- sprintf (path, "%s/cache", evolution_dir);
-
+ char *path = alloca(strlen(evolution_dir)+16);
+
+ sprintf(path, "%s/cache", evolution_dir);
/* cache expiry - 2 hour access, 1 day max */
fetch_cache = camel_data_cache_new(path, 0, NULL);
camel_data_cache_set_expire_age(fetch_cache, 24*60*60);
camel_data_cache_set_expire_access(fetch_cache, 2*60*60);
-
- mail_display_parent_class = g_type_class_ref (PARENT_TYPE);
+
+ mail_display_parent_class = gtk_type_class (PARENT_TYPE);
thumbnail_cache = g_hash_table_new (g_str_hash, g_str_equal);
+
}
}
@@ -2191,18 +2069,18 @@ static void
link_copy_location (GtkWidget *w, MailDisplay *mail_display)
{
GdkAtom clipboard_atom;
-
+
g_free (mail_display->selection);
mail_display->selection = g_strdup (mail_display->html->pointer_url);
-
+
clipboard_atom = gdk_atom_intern ("CLIPBOARD", FALSE);
if (clipboard_atom == GDK_NONE)
return; /* failed */
-
+
/* We don't check the return values of the following since there is not
* much we can do if we cannot assert the selection.
*/
-
+
gtk_selection_owner_set (GTK_WIDGET (mail_display->invisible),
GDK_SELECTION_PRIMARY,
GDK_CURRENT_TIME);
@@ -2215,8 +2093,10 @@ static void
image_save_as (GtkWidget *w, MailDisplay *mail_display)
{
const char *src;
-
- src = g_object_get_data ((GObject *) mail_display, "current_src_uri");
+
+ src = gtk_object_get_data (GTK_OBJECT (mail_display), "current_src_uri");
+
+ g_warning ("loading uri=%s", src);
save_url (mail_display, src);
}
@@ -2237,13 +2117,13 @@ enum {
#define TERMINATOR { NULL, NULL, (NULL), NULL, 0 }
static EPopupMenu link_menu [] = {
- E_POPUP_ITEM (N_("Open Link in Browser"), G_CALLBACK (link_open_in_browser), MASK_URL),
- E_POPUP_ITEM (N_("Copy Link Location"), G_CALLBACK (link_copy_location), MASK_URL),
+ E_POPUP_ITEM (N_("Open Link in Browser"), GTK_SIGNAL_FUNC (link_open_in_browser), MASK_URL),
+ E_POPUP_ITEM (N_("Copy Link Location"), GTK_SIGNAL_FUNC (link_copy_location), MASK_URL),
#if 0
- E_POPUP_ITEM (N_("Save Link as (FIXME)"), G_CALLBACK (link_save_as), MASK_URL),
+ E_POPUP_ITEM (N_("Save Link as (FIXME)"), GTK_SIGNAL_FUNC (link_save_as), MASK_URL),
#endif
- E_POPUP_ITEM (N_("Save Image as..."), G_CALLBACK (image_save_as), MASK_SRC),
-
+ E_POPUP_ITEM (N_("Save Image as..."), GTK_SIGNAL_FUNC (image_save_as), MASK_SRC),
+
TERMINATOR
};
@@ -2259,7 +2139,7 @@ struct _PopupInfo {
GtkWidget *win;
guint destroy_timeout;
guint widget_destroy_handle;
- Bonobo_Listener listener;
+ Bonobo_EventSource_ListenerId listener_id;
gboolean hidden;
};
@@ -2267,55 +2147,64 @@ struct _PopupInfo {
static GtkWidget *the_popup = NULL;
static void
-popup_window_destroy_cb (PopupInfo *pop, GObject *deadbeef)
+popup_info_free (PopupInfo *pop)
{
- the_popup = NULL;
+ if (pop) {
+ if (pop->destroy_timeout)
+ gtk_timeout_remove (pop->destroy_timeout);
- if (pop->destroy_timeout != 0)
- g_source_remove(pop->destroy_timeout);
+ bonobo_event_source_client_remove_listener (bonobo_widget_get_objref (BONOBO_WIDGET (pop->w)),
+ pop->listener_id,
+ NULL);
- bonobo_event_source_client_remove_listener (bonobo_widget_get_objref (BONOBO_WIDGET (pop->w)),
- pop->listener,
- NULL);
- CORBA_Object_release (pop->listener, NULL);
- g_object_unref(pop->w);
- g_free (pop);
+ g_free (pop);
+ }
}
-static int
+static void
+popup_window_destroy_cb (GtkWidget *w, gpointer user_data)
+{
+ PopupInfo *pop = (PopupInfo *) user_data;
+
+ the_popup = NULL;
+
+ popup_info_free (pop);
+}
+
+static gint
popup_timeout_cb (gpointer user_data)
{
PopupInfo *pop = (PopupInfo *) user_data;
pop->destroy_timeout = 0;
gtk_widget_destroy (pop->win);
-
+
return 0;
}
-static int
+static gint
popup_enter_cb (GtkWidget *w, GdkEventCrossing *ev, gpointer user_data)
{
PopupInfo *pop = (PopupInfo *) user_data;
-
+
if (pop->destroy_timeout)
gtk_timeout_remove (pop->destroy_timeout);
pop->destroy_timeout = 0;
-
+
return 0;
}
-static int
+static gint
popup_leave_cb (GtkWidget *w, GdkEventCrossing *ev, gpointer user_data)
{
PopupInfo *pop = (PopupInfo *) user_data;
-
+
if (pop->destroy_timeout)
gtk_timeout_remove (pop->destroy_timeout);
-
+
if (!pop->hidden)
pop->destroy_timeout = gtk_timeout_add (500, popup_timeout_cb, pop);
-
+
return 0;
}
@@ -2323,9 +2212,9 @@ static void
popup_realize_cb (GtkWidget *widget, gpointer user_data)
{
PopupInfo *pop = (PopupInfo *) user_data;
-
+
gtk_widget_add_events (pop->win, GDK_ENTER_NOTIFY_MASK | GDK_LEAVE_NOTIFY_MASK);
-
+
if (pop->destroy_timeout == 0) {
if (!pop->hidden) {
pop->destroy_timeout = gtk_timeout_add (5000, popup_timeout_cb, pop);
@@ -2338,7 +2227,18 @@ popup_realize_cb (GtkWidget *widget, gpointer user_data)
static void
popup_size_allocate_cb (GtkWidget *widget, GtkAllocation *alloc, gpointer user_data)
{
- gtk_window_set_position (GTK_WINDOW (widget), GTK_WIN_POS_MOUSE);
+ gint x, y, w, h, xmax, ymax;
+
+ xmax = gdk_screen_width ();
+ ymax = gdk_screen_height ();
+
+ gdk_window_get_pointer (NULL, &x, &y, NULL);
+ w = alloc->width;
+ h = alloc->height;
+ x = CLAMP (x - w/2, 0, xmax - w);
+ y = CLAMP (y - h/2, 0, ymax - h);
+ gtk_widget_set_uposition (widget, x, y);
+
}
static PopupInfo *
@@ -2346,32 +2246,45 @@ make_popup_window (GtkWidget *w)
{
PopupInfo *pop = g_new0 (PopupInfo, 1);
GtkWidget *fr;
-
+
/* Only allow for one popup at a time. Ugly. */
if (the_popup)
gtk_widget_destroy (the_popup);
-
+
pop->w = w;
- g_object_ref(w);
the_popup = pop->win = gtk_window_new (GTK_WINDOW_POPUP);
fr = gtk_frame_new (NULL);
-
+
gtk_container_add (GTK_CONTAINER (pop->win), fr);
gtk_container_add (GTK_CONTAINER (fr), w);
-
- gtk_window_set_resizable (GTK_WINDOW (pop->win), FALSE);
-
- g_signal_connect (pop->win, "enter_notify_event", G_CALLBACK (popup_enter_cb), pop);
- g_signal_connect (pop->win, "leave_notify_event", G_CALLBACK (popup_leave_cb), pop);
- g_signal_connect_after (pop->win, "realize", G_CALLBACK (popup_realize_cb), pop);
- g_signal_connect (pop->win, "size_allocate", G_CALLBACK (popup_size_allocate_cb), pop);
-
- g_object_weak_ref ((GObject *) pop->win, (GWeakNotify) popup_window_destroy_cb, pop);
-
+
+ gtk_window_set_policy (GTK_WINDOW (pop->win), FALSE, FALSE, FALSE);
+
+ gtk_signal_connect (GTK_OBJECT (pop->win),
+ "destroy",
+ GTK_SIGNAL_FUNC (popup_window_destroy_cb),
+ pop);
+ gtk_signal_connect (GTK_OBJECT (pop->win),
+ "enter_notify_event",
+ GTK_SIGNAL_FUNC (popup_enter_cb),
+ pop);
+ gtk_signal_connect (GTK_OBJECT (pop->win),
+ "leave_notify_event",
+ GTK_SIGNAL_FUNC (popup_leave_cb),
+ pop);
+ gtk_signal_connect_after (GTK_OBJECT (pop->win),
+ "realize",
+ GTK_SIGNAL_FUNC (popup_realize_cb),
+ pop);
+ gtk_signal_connect (GTK_OBJECT (pop->win),
+ "size_allocate",
+ GTK_SIGNAL_FUNC (popup_size_allocate_cb),
+ pop);
+
gtk_widget_show (w);
gtk_widget_show (fr);
gtk_widget_show (pop->win);
-
+
return pop;
}
@@ -2384,22 +2297,22 @@ listener_cb (BonoboListener *listener,
{
PopupInfo *pop;
char *type;
-
+
pop = user_data;
-
+
if (pop->destroy_timeout)
gtk_timeout_remove (pop->destroy_timeout);
pop->destroy_timeout = 0;
type = bonobo_event_subtype (event_name);
-
+
if (!strcmp (type, "Destroy")) {
gtk_widget_destroy (GTK_WIDGET (pop->win));
} else if (!strcmp (type, "Hide")) {
pop->hidden = TRUE;
gtk_widget_hide (GTK_WIDGET (pop->win));
}
-
+
g_free (type);
}
@@ -2408,69 +2321,72 @@ html_button_press_event (GtkWidget *widget, GdkEventButton *event, MailDisplay *
{
g_return_val_if_fail (widget != NULL, FALSE);
g_return_val_if_fail (event != NULL, FALSE);
-
+
if (event->type == GDK_BUTTON_PRESS) {
if (event->button == 3) {
HTMLEngine *e;
HTMLPoint *point;
GtkWidget *popup_thing;
-
+
e = GTK_HTML (widget)->engine;
point = html_engine_get_point_at (e, event->x + e->x_offset, event->y + e->y_offset, FALSE);
if (point) {
- const char *url, *src;
-
+ const gchar *url;
+ const gchar *src;
+
url = html_object_get_url (point->object);
src = html_object_get_src (point->object);
-
- if (url && !strncasecmp (url, "mailto:", 7)) {
+
+ if (url && !g_strncasecmp (url, "mailto:", 7)) {
PopupInfo *pop;
- char *url_decoded;
-
+ gchar *url_decoded;
+
url_decoded = gtk_html_get_url_object_relative (GTK_HTML (widget),
point->object,
url);
camel_url_decode (url_decoded);
-
+
popup_thing = bonobo_widget_new_control ("OAFIID:GNOME_Evolution_Addressbook_AddressPopup",
CORBA_OBJECT_NIL);
-
+
bonobo_widget_set_property (BONOBO_WIDGET (popup_thing),
- "email", TC_CORBA_string, url_decoded+7,
+ "email", url_decoded+7,
NULL);
g_free (url_decoded);
pop = make_popup_window (popup_thing);
-
- pop->listener = bonobo_event_source_client_add_listener_full(
- bonobo_widget_get_objref (BONOBO_WIDGET (popup_thing)),
- g_cclosure_new (G_CALLBACK (listener_cb), pop, NULL),
- NULL, NULL);
+
+ pop->listener_id =
+ bonobo_event_source_client_add_listener (bonobo_widget_get_objref (BONOBO_WIDGET (popup_thing)),
+ listener_cb, NULL, NULL, pop);
+
} else if (url || src) {
- int hide_mask = 0;
-
+ gint hide_mask = 0;
+
if (!url)
hide_mask |= MASK_URL;
-
+
if (!src)
hide_mask |= MASK_SRC;
-
- g_free (g_object_get_data ((GObject *) mail_display, "current_src_uri"));
- g_object_set_data ((GObject *) mail_display, "current_src_uri",
- gtk_html_get_url_object_relative (GTK_HTML (widget),
- point->object,
- src));
+
+ g_free (gtk_object_get_data (GTK_OBJECT (mail_display), "current_src_uri"));
+ gtk_object_set_data (GTK_OBJECT (mail_display), "current_src_uri",
+ gtk_html_get_url_object_relative (GTK_HTML (widget),
+ point->object,
+ src));
e_popup_menu_run (link_menu, (GdkEvent *) event, 0, hide_mask, mail_display);
+
}
-
+
html_point_destroy (point);
- return TRUE;
- }
+ }
+
+ return TRUE;
}
}
-
+
return FALSE;
}
@@ -2478,7 +2394,7 @@ static inline void
set_underline (HTMLEngine *e, HTMLObject *o, gboolean underline)
{
HTMLText *text = HTML_TEXT (o);
-
+
html_text_set_font_style (text, e, underline
? html_text_get_font_style (text) | GTK_HTML_FONT_STYLE_UNDERLINE
: html_text_get_font_style (text) & ~GTK_HTML_FONT_STYLE_UNDERLINE);
@@ -2491,9 +2407,9 @@ update_active (GtkWidget *widget, gint x, gint y, MailDisplay *mail_display)
HTMLEngine *e;
HTMLPoint *point;
const gchar *email;
-
+
e = GTK_HTML (widget)->engine;
-
+
point = html_engine_get_point_at (e, x + e->x_offset, y + e->y_offset, FALSE);
if (mail_display->last_active && (!point || mail_display->last_active != point->object)) {
set_underline (e, HTML_OBJECT (mail_display->last_active), FALSE);
@@ -2509,44 +2425,44 @@ update_active (GtkWidget *widget, gint x, gint y, MailDisplay *mail_display)
}
}
-static int
+static gint
html_enter_notify_event (GtkWidget *widget, GdkEventCrossing *event, MailDisplay *mail_display)
{
update_active (widget, event->x, event->y, mail_display);
-
- return FALSE;
+
+ return TRUE;
}
-static int
+static gint
html_motion_notify_event (GtkWidget *widget, GdkEventMotion *event, MailDisplay *mail_display)
{
- int x, y;
-
+ gint x, y;
+
g_return_val_if_fail (widget != NULL, 0);
g_return_val_if_fail (GTK_IS_HTML (widget), 0);
g_return_val_if_fail (event != NULL, 0);
-
+
if (event->is_hint)
gdk_window_get_pointer (GTK_LAYOUT (widget)->bin_window, &x, &y, NULL);
else {
x = event->x;
y = event->y;
}
-
+
update_active (widget, x, y, mail_display);
-
- return FALSE;
+
+ return TRUE;
}
static void
html_iframe_created (GtkWidget *w, GtkHTML *iframe, MailDisplay *mail_display)
{
- g_signal_connect (iframe, "button_press_event",
- G_CALLBACK (html_button_press_event), mail_display);
- g_signal_connect (iframe, "motion_notify_event",
- G_CALLBACK (html_motion_notify_event), mail_display);
- g_signal_connect (iframe, "enter_notify_event",
- G_CALLBACK (html_enter_notify_event), mail_display);
+ gtk_signal_connect (GTK_OBJECT (iframe), "button_press_event",
+ GTK_SIGNAL_FUNC (html_button_press_event), mail_display);
+ gtk_signal_connect (GTK_OBJECT (iframe), "motion_notify_event",
+ GTK_SIGNAL_FUNC (html_motion_notify_event), mail_display);
+ gtk_signal_connect (GTK_OBJECT (iframe), "enter_notify_event",
+ GTK_SIGNAL_FUNC (html_enter_notify_event), mail_display);
}
static GNOME_Evolution_ShellView
@@ -2555,25 +2471,25 @@ retrieve_shell_view_interface_from_control (BonoboControl *control)
Bonobo_ControlFrame control_frame;
GNOME_Evolution_ShellView shell_view_interface;
CORBA_Environment ev;
-
- control_frame = bonobo_control_get_control_frame (control, NULL);
-
+
+ control_frame = bonobo_control_get_control_frame (control);
+
if (control_frame == NULL)
return CORBA_OBJECT_NIL;
-
+
CORBA_exception_init (&ev);
shell_view_interface = Bonobo_Unknown_queryInterface (control_frame,
"IDL:GNOME/Evolution/ShellView:1.0",
&ev);
CORBA_exception_free (&ev);
-
+
if (shell_view_interface != CORBA_OBJECT_NIL)
- g_object_set_data ((GObject *) control,
- "mail_threads_shell_view_interface",
- shell_view_interface);
+ gtk_object_set_data (GTK_OBJECT (control),
+ "mail_threads_shell_view_interface",
+ shell_view_interface);
else
g_warning ("Control frame doesn't have Evolution/ShellView.");
-
+
return shell_view_interface;
}
@@ -2591,7 +2507,7 @@ set_status_message (const char *message, int busy)
control = BONOBO_CONTROL (e_iterator_get (it));
- shell_view_interface = g_object_get_data ((GObject *) control, "mail_threads_shell_view_interface");
+ shell_view_interface = gtk_object_get_data (GTK_OBJECT (control), "mail_threads_shell_view_interface");
if (shell_view_interface == CORBA_OBJECT_NIL)
shell_view_interface = retrieve_shell_view_interface_from_control (control);
@@ -2612,17 +2528,18 @@ set_status_message (const char *message, int busy)
random ones lying around otherwise. Shrug. */
break;
}
-
- g_object_unref (it);
+ gtk_object_unref (GTK_OBJECT(it));
}
/* For now show every url but possibly limit it to showing only http:
or ftp: urls */
static void
-html_on_url (GtkHTML *html, const char *url, MailDisplay *mail_display)
+html_on_url (GtkHTML *html,
+ const char *url,
+ MailDisplay *mail_display)
{
static char *previous_url = NULL;
-
+
/* This all looks silly but yes, this is the proper way to mix
GtkHTML's on_url with BonoboUIComponent statusbar */
if (!url || (previous_url && (strcmp (url, previous_url) != 0)))
@@ -2637,7 +2554,7 @@ html_on_url (GtkHTML *html, const char *url, MailDisplay *mail_display)
GtkWidget *
mail_display_new (void)
{
- MailDisplay *mail_display = g_object_new (mail_display_get_type (), NULL);
+ MailDisplay *mail_display = gtk_type_new (mail_display_get_type ());
GtkWidget *scroll, *html;
GdkAtom clipboard_atom;
HTMLTokenizer *tok;
@@ -2645,26 +2562,28 @@ mail_display_new (void)
gtk_box_set_homogeneous (GTK_BOX (mail_display), FALSE);
gtk_widget_show (GTK_WIDGET (mail_display));
- scroll = gtk_scrolled_window_new (NULL, NULL);
- gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scroll), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
- gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scroll), GTK_SHADOW_IN);
- gtk_box_pack_start_defaults (GTK_BOX (mail_display), scroll);
- gtk_widget_show (scroll);
+ scroll = e_scroll_frame_new (NULL, NULL);
+ e_scroll_frame_set_policy (E_SCROLL_FRAME (scroll),
+ GTK_POLICY_AUTOMATIC,
+ GTK_POLICY_AUTOMATIC);
+ e_scroll_frame_set_shadow_type (E_SCROLL_FRAME (scroll), GTK_SHADOW_IN);
+ gtk_box_pack_start_defaults (GTK_BOX (mail_display), GTK_WIDGET (scroll));
+ gtk_widget_show (GTK_WIDGET (scroll));
html = gtk_html_new ();
tok = e_searching_tokenizer_new ();
html_engine_set_tokenizer (GTK_HTML (html)->engine, tok);
- g_object_unref (tok);
+ gtk_object_unref (GTK_OBJECT (tok));
mail_display_initialize_gtkhtml (mail_display, GTK_HTML (html));
gtk_container_add (GTK_CONTAINER (scroll), html);
gtk_widget_show (GTK_WIDGET (html));
- g_signal_connect (mail_display->invisible, "selection_get",
- G_CALLBACK (invisible_selection_get_callback), mail_display);
- g_signal_connect (mail_display->invisible, "selection_clear_event",
- G_CALLBACK (invisible_selection_clear_event_callback), mail_display);
+ gtk_signal_connect (GTK_OBJECT (mail_display->invisible), "selection_get",
+ GTK_SIGNAL_FUNC (invisible_selection_get_callback), mail_display);
+ gtk_signal_connect (GTK_OBJECT (mail_display->invisible), "selection_clear_event",
+ GTK_SIGNAL_FUNC (invisible_selection_clear_event_callback), mail_display);
gtk_selection_add_target (mail_display->invisible,
GDK_SELECTION_PRIMARY, GDK_SELECTION_TYPE_STRING, 1);
@@ -2674,9 +2593,9 @@ mail_display_new (void)
gtk_selection_add_target (mail_display->invisible,
clipboard_atom, GDK_SELECTION_TYPE_STRING, 1);
- mail_display->scroll = GTK_SCROLLED_WINDOW (scroll);
+ mail_display->scroll = E_SCROLL_FRAME (scroll);
mail_display->html = GTK_HTML (html);
- g_object_ref (mail_display->html);
+ gtk_object_ref (GTK_OBJECT (mail_display->html));
mail_display->last_active = NULL;
mail_display->data = g_new0 (GData *, 1);
g_datalist_init (mail_display->data);
@@ -2687,29 +2606,30 @@ mail_display_new (void)
void
mail_display_initialize_gtkhtml (MailDisplay *mail_display, GtkHTML *html)
{
- gtk_html_set_default_content_type (GTK_HTML (html), "text/html; charset=utf-8");
+ gtk_html_set_default_content_type (GTK_HTML (html),
+ "text/html; charset=utf-8");
gtk_html_set_editable (GTK_HTML (html), FALSE);
- g_signal_connect (html, "url_requested",
- G_CALLBACK (on_url_requested),
- mail_display);
- g_signal_connect (html, "object_requested",
- G_CALLBACK (on_object_requested),
- mail_display);
- g_signal_connect (html, "link_clicked",
- G_CALLBACK (on_link_clicked),
- mail_display);
- g_signal_connect (html, "button_press_event",
- G_CALLBACK (html_button_press_event), mail_display);
- g_signal_connect (html, "motion_notify_event",
- G_CALLBACK (html_motion_notify_event), mail_display);
- g_signal_connect (html, "enter_notify_event",
- G_CALLBACK (html_enter_notify_event), mail_display);
- g_signal_connect (html, "iframe_created",
- G_CALLBACK (html_iframe_created), mail_display);
- g_signal_connect (html, "on_url",
- G_CALLBACK (html_on_url), mail_display);
+ gtk_signal_connect (GTK_OBJECT (html), "url_requested",
+ GTK_SIGNAL_FUNC (on_url_requested),
+ mail_display);
+ gtk_signal_connect (GTK_OBJECT (html), "object_requested",
+ GTK_SIGNAL_FUNC (on_object_requested),
+ mail_display);
+ gtk_signal_connect (GTK_OBJECT (html), "link_clicked",
+ GTK_SIGNAL_FUNC (on_link_clicked),
+ mail_display);
+ gtk_signal_connect (GTK_OBJECT (html), "button_press_event",
+ GTK_SIGNAL_FUNC (html_button_press_event), mail_display);
+ gtk_signal_connect (GTK_OBJECT (html), "motion_notify_event",
+ GTK_SIGNAL_FUNC (html_motion_notify_event), mail_display);
+ gtk_signal_connect (GTK_OBJECT (html), "enter_notify_event",
+ GTK_SIGNAL_FUNC (html_enter_notify_event), mail_display);
+ gtk_signal_connect (GTK_OBJECT (html), "iframe_created",
+ GTK_SIGNAL_FUNC (html_iframe_created), mail_display);
+ gtk_signal_connect (GTK_OBJECT (html), "on_url",
+ GTK_SIGNAL_FUNC (html_on_url), mail_display);
}
static void
@@ -2762,8 +2682,7 @@ mail_display_get_url_for_icon (MailDisplay *md, const char *icon_name)
if (*icon_name == '/')
icon_path = g_strdup (icon_name);
else {
- icon_path = gnome_program_locate_file (NULL, GNOME_FILE_DOMAIN_PIXMAP,
- icon_name, TRUE, NULL);
+ icon_path = gnome_pixmap_file (icon_name);
if (!icon_path)
return "file:///dev/null";
}
diff --git a/mail/mail-format.c b/mail/mail-format.c
index f47ebccd4d..7ca745187a 100644
--- a/mail/mail-format.c
+++ b/mail/mail-format.c
@@ -3,7 +3,7 @@
* Authors: Dan Winship <danw@ximian.com>
* Jeffrey Stedfast <fejj@ximian.com>
*
- * Copyright 2000, 2003 Ximian, Inc.
+ * Copyright 2000, 2001 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
@@ -30,69 +30,87 @@
#include <ctype.h>
#include <fcntl.h>
-#include <gconf/gconf.h>
-#include <gconf/gconf-client.h>
-
+#include <liboaf/liboaf.h>
+#include <libgnome/gnome-defs.h>
#include <libgnome/gnome-util.h>
+#include <libgnomevfs/gnome-vfs-mime-info.h>
#include <libgnomevfs/gnome-vfs-mime-handlers.h>
-#include <shell/e-setup.h>
-
+#include <gal/widgets/e-unicode.h>
#include <gal/util/e-iconv.h>
#include <camel/camel-mime-utils.h>
#include <camel/camel-pgp-mime.h>
#include <camel/camel-stream-null.h>
-#include <camel/camel-stream-filter.h>
#include <camel/camel-multipart-signed.h>
-#include <camel/camel-mime-filter-enriched.h>
-#include <camel/camel-mime-filter-tohtml.h>
-
-#include <e-util/e-trie.h>
+#include <shell/e-setup.h>
+#include <e-util/e-html-utils.h>
+#include <gal/util/e-unicode-i18n.h>
#include "mail.h"
#include "mail-tools.h"
#include "mail-display.h"
-#include "mail-format.h"
#include "mail-mt.h"
#include "mail-crypto.h"
-
-#define STANDARD_ISSUE_TABLE_OPEN "<table cellspacing=0 cellpadding=10 width=\"100%\">"
-
-
-static gboolean handle_text_plain (CamelMimePart *part, const char *mime_type,
- MailDisplay *md, MailDisplayStream *stream);
-static gboolean handle_text_enriched (CamelMimePart *part, const char *mime_type,
- MailDisplay *md, MailDisplayStream *stream);
-static gboolean handle_text_html (CamelMimePart *part, const char *mime_type,
- MailDisplay *md, MailDisplayStream *stream);
-static gboolean handle_image (CamelMimePart *part, const char *mime_type,
- MailDisplay *md, MailDisplayStream *stream);
-static gboolean handle_multipart_mixed (CamelMimePart *part, const char *mime_type,
- MailDisplay *md, MailDisplayStream *stream);
-static gboolean handle_multipart_related (CamelMimePart *part, const char *mime_type,
- MailDisplay *md, MailDisplayStream *stream);
-static gboolean handle_multipart_alternative (CamelMimePart *part, const char *mime_type,
- MailDisplay *md, MailDisplayStream *stream);
-static gboolean handle_multipart_appledouble (CamelMimePart *part, const char *mime_type,
- MailDisplay *md, MailDisplayStream *stream);
-static gboolean handle_multipart_encrypted (CamelMimePart *part, const char *mime_type,
- MailDisplay *md, MailDisplayStream *stream);
-static gboolean handle_multipart_signed (CamelMimePart *part, const char *mime_type,
- MailDisplay *md, MailDisplayStream *stream);
-static gboolean handle_message_rfc822 (CamelMimePart *part, const char *mime_type,
- MailDisplay *md, MailDisplayStream *stream);
-static gboolean handle_message_external_body (CamelMimePart *part, const char *mime_type,
- MailDisplay *md, MailDisplayStream *stream);
-
-static gboolean handle_via_bonobo (CamelMimePart *part, const char *mime_type,
- MailDisplay *md, MailDisplayStream *stream);
+static char *try_inline_pgp (char *start, CamelMimePart *part,
+ guint offset, MailDisplay *md, GtkHTML *html, GtkHTMLStream *stream);
+static char *try_inline_pgp_sig (char *start, CamelMimePart *part,
+ guint offset, MailDisplay *md, GtkHTML *html, GtkHTMLStream *stream);
+static char *try_uudecoding (char *start, CamelMimePart *part,
+ guint offset, MailDisplay *md, GtkHTML *html, GtkHTMLStream *stream);
+static char *try_inline_binhex (char *start, CamelMimePart *part,
+ guint offset, MailDisplay *md, GtkHTML *html, GtkHTMLStream *stream);
+
+static gboolean handle_text_plain (CamelMimePart *part,
+ const char *mime_type,
+ MailDisplay *md, GtkHTML *html, GtkHTMLStream *stream);
+static gboolean handle_text_plain_flowed (char *text,
+ MailDisplay *md, GtkHTML *html, GtkHTMLStream *stream);
+static gboolean handle_text_enriched (CamelMimePart *part,
+ const char *mime_type,
+ MailDisplay *md, GtkHTML *html, GtkHTMLStream *stream);
+static gboolean handle_text_html (CamelMimePart *part,
+ const char *mime_type,
+ MailDisplay *md, GtkHTML *html, GtkHTMLStream *stream);
+static gboolean handle_image (CamelMimePart *part,
+ const char *mime_type,
+ MailDisplay *md, GtkHTML *html, GtkHTMLStream *stream);
+static gboolean handle_multipart_mixed (CamelMimePart *part,
+ const char *mime_type,
+ MailDisplay *md, GtkHTML *html, GtkHTMLStream *stream);
+static gboolean handle_multipart_related (CamelMimePart *part,
+ const char *mime_type,
+ MailDisplay *md, GtkHTML *html, GtkHTMLStream *stream);
+static gboolean handle_multipart_alternative (CamelMimePart *part,
+ const char *mime_type,
+ MailDisplay *md, GtkHTML *html, GtkHTMLStream *stream);
+static gboolean handle_multipart_appledouble (CamelMimePart *part,
+ const char *mime_type,
+ MailDisplay *md, GtkHTML *html, GtkHTMLStream *stream);
+static gboolean handle_multipart_encrypted (CamelMimePart *part,
+ const char *mime_type,
+ MailDisplay *md, GtkHTML *html, GtkHTMLStream *stream);
+static gboolean handle_multipart_signed (CamelMimePart *part,
+ const char *mime_type,
+ MailDisplay *md, GtkHTML *html, GtkHTMLStream *stream);
+static gboolean handle_message_rfc822 (CamelMimePart *part,
+ const char *mime_type,
+ MailDisplay *md, GtkHTML *html, GtkHTMLStream *stream);
+static gboolean handle_message_external_body (CamelMimePart *part,
+ const char *mime_type,
+ MailDisplay *md, GtkHTML *html, GtkHTMLStream *stream);
+
+static gboolean handle_via_bonobo (CamelMimePart *part,
+ const char *mime_type,
+ MailDisplay *md, GtkHTML *html, GtkHTMLStream *stream);
/* writes the header info for a mime message into an html stream */
-static void write_headers (MailDisplayStream *stream, MailDisplay *md, CamelMimeMessage *message);
+static void write_headers (CamelMimeMessage *message, MailDisplay *md,
+ GtkHTML *html, GtkHTMLStream *stream);
/* dispatch html printing via mimetype */
-static gboolean format_mime_part (CamelMimePart *part, MailDisplay *md, MailDisplayStream *stream);
+static gboolean format_mime_part (CamelMimePart *part, MailDisplay *md,
+ GtkHTML *html, GtkHTMLStream *stream);
static void
free_url (gpointer key, gpointer value, gpointer data)
@@ -125,12 +143,12 @@ free_data_urls (gpointer urls)
**/
void
mail_format_mime_message (CamelMimeMessage *mime_message, MailDisplay *md,
- MailDisplayStream *stream)
+ GtkHTML *html, GtkHTMLStream *stream)
{
GHashTable *hash;
g_return_if_fail (CAMEL_IS_MIME_MESSAGE (mime_message));
-
+
hash = g_datalist_get_data (md->data, "part_urls");
if (!hash) {
hash = g_hash_table_new (g_str_hash, g_str_equal);
@@ -157,8 +175,8 @@ mail_format_mime_message (CamelMimeMessage *mime_message, MailDisplay *md,
(GDestroyNotify) g_hash_table_destroy);
}
- write_headers (stream, md, mime_message);
- format_mime_part (CAMEL_MIME_PART (mime_message), md, stream);
+ write_headers (mime_message, md, html, stream);
+ format_mime_part (CAMEL_MIME_PART (mime_message), md, html, stream);
}
@@ -171,33 +189,32 @@ mail_format_mime_message (CamelMimeMessage *mime_message, MailDisplay *md,
**/
void
mail_format_raw_message (CamelMimeMessage *mime_message, MailDisplay *md,
- MailDisplayStream *stream)
+ GtkHTML *html, GtkHTMLStream *stream)
{
- CamelStreamFilter *filtered_stream;
- CamelMimeFilter *html_filter;
- CamelDataWrapper *wrapper;
- guint32 flags;
+ GByteArray *bytes;
+ char *html_str;
g_return_if_fail (CAMEL_IS_MIME_MESSAGE (mime_message));
- wrapper = CAMEL_DATA_WRAPPER (mime_message);
- if (!mail_content_loaded (wrapper, md, TRUE, NULL, md->html, NULL))
+ if (!mail_content_loaded (CAMEL_DATA_WRAPPER (mime_message), md,
+ TRUE, NULL, html, NULL))
return;
- filtered_stream = camel_stream_filter_new_with_stream ((CamelStream *) stream);
-
- flags = CAMEL_MIME_FILTER_TOHTML_CONVERT_NL | CAMEL_MIME_FILTER_TOHTML_CONVERT_SPACES |
- CAMEL_MIME_FILTER_TOHTML_ESCAPE_8BIT;
- html_filter = camel_mime_filter_tohtml_new (flags, 0);
- camel_stream_filter_add (filtered_stream, html_filter);
- camel_object_unref (html_filter);
+ mail_html_write (html, stream,
+ "<table cellspacing=0 cellpadding=10 width=\"100%\"><tr><td><tt>\n");
- camel_stream_write_string ((CamelStream *) stream, STANDARD_ISSUE_TABLE_OPEN "<tr><td><tt>");
-
- mail_format_data_wrapper_write_to_stream (wrapper, md, (CamelStream *) filtered_stream);
- camel_object_unref (filtered_stream);
+ bytes = mail_format_get_data_wrapper_text (CAMEL_DATA_WRAPPER (mime_message), md);
+ if (bytes) {
+ g_byte_array_append (bytes, "", 1);
+ html_str = e_text_to_html (bytes->data, E_TEXT_TO_HTML_CONVERT_NL |
+ E_TEXT_TO_HTML_CONVERT_SPACES | E_TEXT_TO_HTML_ESCAPE_8BIT);
+ g_byte_array_free (bytes, TRUE);
+
+ mail_html_write (html, stream, html_str);
+ g_free (html_str);
+ }
- camel_stream_write_string ((CamelStream *) stream, "</tt></td></tr></table>");
+ mail_html_write (html, stream, "</tt></td></tr></table>");
}
static const char *
@@ -210,7 +227,8 @@ get_cid (CamelMimePart *part, MailDisplay *md)
* make a (syntactically invalid, unique) fake one.
*/
if (camel_mime_part_get_content_id (part)) {
- cid = g_strdup_printf ("cid:%s", camel_mime_part_get_content_id (part));
+ cid = g_strdup_printf ("cid:%s",
+ camel_mime_part_get_content_id (part));
} else
cid = g_strdup_printf ("cid:@@@%d", fake_cid_counter++);
@@ -336,38 +354,38 @@ setup_mime_tables (void)
}
static gboolean
-component_supports (Bonobo_ServerInfo *component, const char *mime_type)
+component_supports (OAF_ServerInfo *component, const char *mime_type)
{
- Bonobo_ActivationProperty *prop;
+ OAF_Property *prop;
CORBA_sequence_CORBA_string stringv;
int i;
-
- prop = bonobo_server_info_prop_find (component, "repo_ids");
- if (!prop || prop->v._d != Bonobo_ACTIVATION_P_STRINGV)
+
+ prop = oaf_server_info_prop_find (component, "repo_ids");
+ if (!prop || prop->v._d != OAF_P_STRINGV)
return FALSE;
-
+
stringv = prop->v._u.value_stringv;
for (i = 0; i < stringv._length; i++) {
- if (!strcasecmp ("IDL:Bonobo/PersistStream:1.0", stringv._buffer[i]))
+ if (!g_strcasecmp ("IDL:Bonobo/PersistStream:1.0", stringv._buffer[i]))
break;
}
-
+
/* got to end of list with no persist stream? */
-
+
if (i >= stringv._length)
return FALSE;
-
- prop = bonobo_server_info_prop_find (component,
- "bonobo:supported_mime_types");
- if (!prop || prop->v._d != Bonobo_ACTIVATION_P_STRINGV)
+
+ prop = oaf_server_info_prop_find (component,
+ "bonobo:supported_mime_types");
+ if (!prop || prop->v._d != OAF_P_STRINGV)
return FALSE;
-
+
stringv = prop->v._u.value_stringv;
for (i = 0; i < stringv._length; i++) {
- if (!strcasecmp (mime_type, stringv._buffer[i]))
+ if (!g_strcasecmp (mime_type, stringv._buffer[i]))
return TRUE;
}
-
+
return FALSE;
}
@@ -392,15 +410,15 @@ mail_lookup_handler (const char *mime_type)
char *mime_type_main;
const char *p;
GList *components, *iter;
-
+
if (mime_handler_table == NULL)
setup_mime_tables ();
-
+
/* See if we've already found it. */
handler = g_hash_table_lookup (mime_handler_table, mime_type);
if (handler)
return handler;
-
+
/* Special case MIME type: application/octet-stream
* The point of this type is that there isn't a handler.
*/
@@ -416,13 +434,12 @@ mail_lookup_handler (const char *mime_type)
gnome_vfs_mime_get_short_list_applications (mime_type);
handler->builtin =
g_hash_table_lookup (mime_function_table, mime_type);
-
+
if (handler->builtin) {
handler->generic = FALSE;
- handler->is_bonobo = FALSE;
goto reg;
}
-
+
/* Try for the first matching component. (we don't use get_short_list_comps
* as that will return NULL if the oaf files don't have the short_list properties
* defined). */
@@ -432,19 +449,19 @@ mail_lookup_handler (const char *mime_type)
handler->generic = FALSE;
handler->is_bonobo = TRUE;
handler->builtin = handle_via_bonobo;
- handler->component = Bonobo_ServerInfo_duplicate (iter->data);
+ handler->component = OAF_ServerInfo_duplicate (iter->data);
gnome_vfs_mime_component_list_free (components);
goto reg;
}
}
-
+
gnome_vfs_mime_component_list_free (components);
-
+
/* Try for a generic builtin match. */
p = strchr (mime_type, '/');
if (p == NULL)
p = mime_type + strlen (mime_type);
- mime_type_main = g_alloca ((p - mime_type) + 3);
+ mime_type_main = alloca ((p - mime_type) + 3);
memcpy (mime_type_main, mime_type, p - mime_type);
memcpy (mime_type_main + (p - mime_type), "/*", 3);
@@ -453,36 +470,34 @@ mail_lookup_handler (const char *mime_type)
if (handler->builtin) {
handler->generic = TRUE;
- handler->is_bonobo = FALSE;
if (handler->component) {
CORBA_free (handler->component);
handler->component = NULL;
}
goto reg;
}
-
+
/* Try for a generic component match. */
if (handler->component) {
handler->generic = TRUE;
- handler->is_bonobo = TRUE;
handler->builtin = handle_via_bonobo;
+ handler->is_bonobo = TRUE;
goto reg;
}
-
+
/* If we at least got an application, use that. */
if (handler->applications) {
handler->generic = TRUE;
- handler->is_bonobo = FALSE;
goto reg;
}
-
+
/* Nada. */
g_free (handler);
return NULL;
-
+
reg:
- g_hash_table_insert (mime_handler_table, g_strdup (mime_type), handler);
-
+ g_hash_table_insert (mime_handler_table, g_strdup (mime_type),
+ handler);
return handler;
}
@@ -492,12 +507,11 @@ mail_lookup_handler (const char *mime_type)
static gboolean
is_anonymous (CamelMimePart *part, const char *mime_type)
{
- /* FIXME: should use CamelContentType stuff */
- if (!strncasecmp (mime_type, "multipart/", 10) ||
- !strncasecmp (mime_type, "message/", 8))
+ if (!g_strncasecmp (mime_type, "multipart/", 10) ||
+ !g_strncasecmp (mime_type, "message/", 8))
return TRUE;
- if (!strncasecmp (mime_type, "text/", 5) &&
+ if (!g_strncasecmp (mime_type, "text/", 5) &&
!camel_mime_part_get_filename (part))
return TRUE;
@@ -515,13 +529,13 @@ mail_part_is_inline (CamelMimePart *part)
{
const char *disposition;
CamelContentType *content_type;
- gboolean anon;
char *type;
+ gboolean anon;
/* If it has an explicit disposition, return that. */
disposition = camel_mime_part_get_disposition (part);
if (disposition)
- return strcasecmp (disposition, "inline") == 0;
+ return g_strcasecmp (disposition, "inline") == 0;
/* Certain types should default to inline. FIXME: this should
* be customizable.
@@ -546,28 +560,28 @@ enum inline_states {
I_DISPLAYED = (1 << 2)
};
-static int
+static gint
get_inline_flags (CamelMimePart *part, MailDisplay *md)
{
GHashTable *asht;
- int val;
-
+ gint val;
+
/* check if we already know. */
-
+
asht = g_datalist_get_data (md->data, "attachment_states");
val = GPOINTER_TO_INT (g_hash_table_lookup (asht, part));
if (val)
return val;
-
+
/* ok, we don't know. Figure it out. */
-
+
if (mail_part_is_inline (part))
val = (I_VALID | I_ACTUALLY | I_DISPLAYED);
else
val = (I_VALID);
-
+
g_hash_table_insert (asht, part, GINT_TO_POINTER (val));
-
+
return val;
}
@@ -582,7 +596,7 @@ mail_part_toggle_displayed (CamelMimePart *part, MailDisplay *md)
{
GHashTable *asht = g_datalist_get_data (md->data, "attachment_states");
gpointer ostate, opart;
- int state;
+ gint state;
if (g_hash_table_lookup_extended (asht, part, &opart, &ostate)) {
g_hash_table_remove (asht, part);
@@ -605,71 +619,77 @@ mail_part_set_default_displayed_inline (CamelMimePart *part, MailDisplay *md,
gboolean displayed)
{
GHashTable *asht = g_datalist_get_data (md->data, "attachment_states");
- int state;
+ gint state;
if (g_hash_table_lookup (asht, part))
return;
-
+
state = I_VALID | (displayed ? I_DISPLAYED : 0);
g_hash_table_insert (asht, part, GINT_TO_POINTER (state));
}
static void
attachment_header (CamelMimePart *part, const char *mime_type, MailDisplay *md,
- MailDisplayStream *stream)
+ GtkHTML *html, GtkHTMLStream *stream)
{
- char *htmlinfo;
+ char *htmlinfo, *html_str, *fmt;
const char *info;
/* Start the table, create the pop-up object. */
- camel_stream_write_string ((CamelStream *) stream, "<table cellspacing=0 cellpadding=0><tr><td>"
- "<table width=10 cellspacing=0 cellpadding=0>"
- "<tr><td></td></tr></table></td>");
-
- if (!md->printing) {
- camel_stream_printf ((CamelStream *) stream, "<td><object classid=\"popup:%s\""
- "type=\"%s\"></object></td>", get_cid (part, md), mime_type);
+ mail_html_write (html, stream,
+ "<table cellspacing=0 cellpadding=0>"
+ "<tr><td><table width=10 cellspacing=0 cellpadding=0><tr><td></td></tr></table></td>");
+
+ if (! md->printing) {
+ gtk_html_stream_printf (stream, "<td><object classid=\"popup:%s\" type=\"%s\"></object></td>",
+ get_cid (part, md), mime_type);
}
- camel_stream_write_string ((CamelStream *) stream, "<td><table width=3 cellspacing=0 cellpadding=0>"
- "<tr><td></td></tr></table></td><td><font size=-1>");
+ mail_html_write (html, stream,
+ "<td><table width=3 cellspacing=0 cellpadding=0><tr><td></td></tr></table></td>"
+ "<td><font size=-1>");
+
/* Write the MIME type */
- info = gnome_vfs_mime_get_description (mime_type);
- htmlinfo = camel_text_to_html (info ? info : mime_type, 0, 0);
- camel_stream_printf ((CamelStream *) stream, _("%s attachment"), htmlinfo);
+ info = gnome_vfs_mime_get_value (mime_type, "description");
+ html_str = e_text_to_html (info ? info : mime_type, 0);
+ htmlinfo = e_utf8_from_locale_string (html_str);
+ g_free (html_str);
+ fmt = e_utf8_from_locale_string (_("%s attachment"));
+ gtk_html_stream_printf (stream, fmt, htmlinfo);
g_free (htmlinfo);
-
+ g_free (fmt);
+
/* Write the name, if we have it. */
info = camel_mime_part_get_filename (part);
if (info) {
- htmlinfo = camel_text_to_html (info, 0, 0);
- camel_stream_printf ((CamelStream *) stream, " (%s)", htmlinfo);
+ htmlinfo = e_text_to_html (info, 0);
+ gtk_html_stream_printf (stream, " (%s)", htmlinfo);
g_free (htmlinfo);
}
/* Write a description, if we have one. */
info = camel_mime_part_get_description (part);
if (info) {
- htmlinfo = camel_text_to_html (info, md->printing ? 0 : CAMEL_MIME_FILTER_TOHTML_CONVERT_URLS, 0);
- camel_stream_printf ((CamelStream *) stream, ", \"%s\"", htmlinfo);
+ htmlinfo = e_text_to_html (info, md->printing ? 0 : E_TEXT_TO_HTML_CONVERT_URLS);
+ gtk_html_stream_printf (stream, ", \"%s\"", htmlinfo);
g_free (htmlinfo);
}
- camel_stream_write_string ((CamelStream *) stream, "</font></td></tr><tr><td height=10>"
- "<table cellspacing=0 cellpadding=0><tr><td height=10>"
- "<a name=\"glue\"></td></tr></table></td></tr></table>\n");
+ mail_html_write (html, stream, "</font></td></tr><tr>"
+ "<td height=10><table height=10 cellspacing=0 cellpadding=0>"
+ "<tr><td></td></tr></table></td></tr></table>\n");
}
static gboolean
format_mime_part (CamelMimePart *part, MailDisplay *md,
- MailDisplayStream *stream)
+ GtkHTML *html, GtkHTMLStream *stream)
{
CamelDataWrapper *wrapper;
+ char *mime_type;
MailMimeHandler *handler;
gboolean output;
int inline_flags;
- char *mime_type;
/* Record URLs associated with this part */
get_cid (part, md);
@@ -679,14 +699,15 @@ format_mime_part (CamelMimePart *part, MailDisplay *md,
if (CAMEL_IS_MULTIPART (wrapper) &&
camel_multipart_get_number (CAMEL_MULTIPART (wrapper)) == 0) {
- mail_error_printf (stream, "\n%s\n", _("Could not parse MIME message. Displaying as source."));
- if (mail_content_loaded (wrapper, md, TRUE, NULL, md->html, NULL))
- handle_text_plain (part, "text/plain", md, stream);
+
+ mail_error_printf (html, stream, "\n%s\n", U_("Could not parse MIME message. Displaying as source."));
+ if (mail_content_loaded (wrapper, md, TRUE, NULL, html, NULL))
+ handle_text_plain (part, "text/plain", md, html, stream);
return TRUE;
}
mime_type = camel_data_wrapper_get_mime_type (wrapper);
- camel_strdown (mime_type);
+ g_strdown (mime_type);
handler = mail_lookup_handler (mime_type);
if (!handler) {
@@ -713,11 +734,11 @@ format_mime_part (CamelMimePart *part, MailDisplay *md,
/* No header for anonymous inline parts. */
if (!((inline_flags & I_ACTUALLY) && is_anonymous (part, mime_type)))
- attachment_header (part, mime_type, md, stream);
+ attachment_header (part, mime_type, md, html, stream);
if (handler && handler->builtin && inline_flags & I_DISPLAYED &&
- mail_content_loaded (wrapper, md, TRUE, NULL, md->html, NULL))
- output = (*handler->builtin) (part, mime_type, md, stream);
+ mail_content_loaded (wrapper, md, TRUE, NULL, html, NULL))
+ output = (*handler->builtin) (part, mime_type, md, html, stream);
else
output = TRUE;
@@ -732,119 +753,129 @@ enum {
};
static void
-write_field_row_begin (MailDisplayStream *stream, const char *name, int flags)
+write_field_row_begin (const char *name, gint flags, GtkHTML *html, GtkHTMLStream *stream)
{
+ char *encoded_name;
gboolean bold = (flags & WRITE_BOLD);
gboolean nocolumns = (flags & WRITE_NOCOLUMNS);
+ encoded_name = e_utf8_from_gtk_string (GTK_WIDGET (html), name);
+
if (nocolumns) {
- camel_stream_printf ((CamelStream *) stream, "<tr><td>%s%s:%s ",
- bold ? "<b>" : "", name, bold ? "</b>" : "");
+ gtk_html_stream_printf (stream, "<tr><td>%s%s:%s ",
+ bold ? "<b>" : "", encoded_name,
+ bold ? "</b>" : "");
} else {
- camel_stream_printf ((CamelStream *) stream,
- "<tr><%s align=\"right\" valign=\"top\">%s:"
- "<b>&nbsp;</%s><td>", bold ? "th" : "td",
- name, bold ? "th" : "td");
+ gtk_html_stream_printf (stream, "<tr><%s align=\"right\" valign=\"top\">%s:"
+ "<b>&nbsp;</%s><td>", bold ? "th" : "td",
+ encoded_name, bold ? "th" : "td");
}
+
+ g_free (encoded_name);
}
static void
-write_date (MailDisplayStream *stream, CamelMimeMessage *message, int flags)
+write_date (CamelMimeMessage *message, int flags, GtkHTML *html, GtkHTMLStream *stream)
{
const char *datestr;
datestr = camel_medium_get_header (CAMEL_MEDIUM (message), "Date");
if (datestr) {
- write_field_row_begin (stream, _("Date"), flags);
- camel_stream_printf ((CamelStream *) stream, "%s</td> </tr>", datestr);
+ write_field_row_begin (_("Date"), flags, html, stream);
+ gtk_html_stream_printf (stream, "%s</td> </tr>", datestr);
}
}
static void
-write_text_header (MailDisplayStream *stream, const char *name, const char *value, int flags)
+write_text_header (const char *name, const char *value, int flags, GtkHTML *html, GtkHTMLStream *stream)
{
char *encoded;
-
+
if (value && *value)
- encoded = camel_text_to_html (value, CAMEL_MIME_FILTER_TOHTML_CONVERT_NL |
- CAMEL_MIME_FILTER_TOHTML_CONVERT_SPACES |
- CAMEL_MIME_FILTER_TOHTML_CONVERT_URLS, 0);
+ encoded = e_text_to_html (value, E_TEXT_TO_HTML_CONVERT_NL |
+ E_TEXT_TO_HTML_CONVERT_SPACES |
+ E_TEXT_TO_HTML_CONVERT_URLS);
else
encoded = "";
- write_field_row_begin (stream, name, flags);
+ write_field_row_begin (name, flags, html, stream);
- camel_stream_printf ((CamelStream *) stream, "%s</td></tr>", encoded);
+ gtk_html_stream_printf (stream, "%s</td> </tr>", encoded);
if (value && *value)
g_free (encoded);
}
static void
-write_address (MailDisplay *md, MailDisplayStream *stream,
+write_address (MailDisplay *md, GtkHTML *html, GtkHTMLStream *stream,
const CamelInternetAddress *addr, const char *field_name, int flags)
{
const char *name, *email;
- int i;
+ gint i;
if (addr == NULL || !camel_internet_address_get (addr, 0, NULL, NULL))
return;
- write_field_row_begin (stream, field_name, flags);
+ write_field_row_begin (field_name, flags, html, stream);
i = 0;
while (camel_internet_address_get (addr, i, &name, &email)) {
CamelInternetAddress *subaddr;
- char *addr_txt, *addr_url;
+ gchar *addr_txt, *addr_url;
gboolean have_name = name && *name;
gboolean have_email = email && *email;
- char *name_disp = NULL;
- char *email_disp = NULL;
-
+ gchar *name_disp = NULL;
+ gchar *email_disp = NULL;
+
subaddr = camel_internet_address_new ();
camel_internet_address_add (subaddr, name, email);
addr_txt = camel_address_format (CAMEL_ADDRESS (subaddr));
- addr_url = camel_url_encode (addr_txt, NULL);
- camel_object_unref (subaddr);
+ addr_url = camel_url_encode (addr_txt, TRUE, NULL);
+ camel_object_unref (CAMEL_OBJECT (subaddr));
if (have_name) {
- name_disp = camel_text_to_html (name, 0, 0);
+ name_disp = e_text_to_html (name, 0);
}
if (have_email) {
- email_disp = camel_text_to_html (email, 0, 0);
+ email_disp = e_text_to_html (email, 0);
}
if (i)
- camel_stream_write_string ((CamelStream *) stream, ", ");
+ mail_html_write (html, stream, ", ");
if (have_email || have_name) {
- if (!have_email)
+ if (!have_email) {
email_disp = g_strdup ("???");
+ }
if (have_name) {
if (md->printing) {
- camel_stream_printf ((CamelStream *) stream,
- "%s &lt;%s&gt;", name_disp, email_disp);
+ gtk_html_stream_printf (stream, "%s &lt;%s&gt;", name_disp, email_disp);
} else {
- camel_stream_printf ((CamelStream *) stream,
- "%s &lt;<a href=\"mailto:%s\">%s</a>&gt;",
- name_disp, addr_url, email_disp);
+ gtk_html_stream_printf (stream,
+ "%s &lt;<a href=\"mailto:%s\">%s</a>&gt;",
+ name_disp, addr_url, email_disp);
}
} else {
if (md->printing) {
- camel_stream_write_string ((CamelStream *) stream, email_disp);
+ mail_html_write (html, stream, email_disp);
} else {
- camel_stream_printf ((CamelStream *) stream,
- "<a href=\"mailto:%s\">%s</a>",
- addr_url, email_disp);
+ gtk_html_stream_printf (stream,
+ "<a href=\"mailto:%s\">%s</a>",
+ addr_url, email_disp);
}
- }
+ }
+
} else {
- camel_stream_printf ((CamelStream *) stream, "<i>%s</i>", _("Bad Address"));
+ char *str;
+
+ str = e_utf8_from_locale_string (_("Bad Address"));
+ gtk_html_stream_printf (stream, "<i>%s</i>", str);
+ g_free (str);
}
-
+
g_free (name_disp);
g_free (email_disp);
g_free (addr_txt);
@@ -853,7 +884,7 @@ write_address (MailDisplay *md, MailDisplayStream *stream,
i++;
}
- camel_stream_write_string ((CamelStream *) stream, "</td></tr>");
+ mail_html_write (html, stream, "</td></tr>");
}
/* order of these must match write_header code */
@@ -863,12 +894,12 @@ static char *default_headers[] = {
/* return index of header in default_headers array */
static int
-default_header_index (const char *name)
+default_header_index(const char *name)
{
int i;
-
- for (i = 0; i < sizeof (default_headers) / sizeof (default_headers[0]); i++)
- if (!strcasecmp (name, default_headers[i]))
+
+ for (i=0;i<sizeof(default_headers)/sizeof(default_headers[0]);i++)
+ if (!g_strcasecmp(name, default_headers[i]))
return i;
return -1;
@@ -876,88 +907,87 @@ default_header_index (const char *name)
/* index is index of header in default_headers array */
static void
-write_default_header (CamelMimeMessage *message, MailDisplay *md,
- MailDisplayStream *stream,
- int index, int flags)
+write_default_header(CamelMimeMessage *message, MailDisplay *md,
+ GtkHTML *html, GtkHTMLStream *stream,
+ int index, int flags)
{
- switch (index) {
+ switch(index) {
case 0:
- write_address (md, stream,
+ write_address (md, html, stream,
camel_mime_message_get_from (message), _("From"), flags | WRITE_BOLD);
break;
case 1:
- write_address (md, stream,
+ write_address (md, html, stream,
camel_mime_message_get_reply_to (message), _("Reply-To"), flags | WRITE_BOLD);
break;
case 2:
- write_address (md, stream,
- camel_mime_message_get_recipients (message, CAMEL_RECIPIENT_TYPE_TO),
+ write_address(md, html, stream,
+ camel_mime_message_get_recipients(message, CAMEL_RECIPIENT_TYPE_TO),
_("To"), flags | WRITE_BOLD);
break;
case 3:
- write_address (md, stream,
+ write_address (md, html, stream,
camel_mime_message_get_recipients (message, CAMEL_RECIPIENT_TYPE_CC),
_("Cc"), flags | WRITE_BOLD);
break;
case 4:
- write_address (md, stream,
+ write_address (md, html, stream,
camel_mime_message_get_recipients (message, CAMEL_RECIPIENT_TYPE_BCC),
_("Bcc"), flags | WRITE_BOLD);
break;
case 5:
- write_text_header (stream, _("Subject"), camel_mime_message_get_subject (message),
- flags | WRITE_BOLD);
+ write_text_header (_("Subject"), camel_mime_message_get_subject (message),
+ flags | WRITE_BOLD, html, stream);
break;
case 6:
- write_date (stream, message, flags | WRITE_BOLD);
+ write_date (message, flags | WRITE_BOLD, html, stream);
break;
default:
- g_assert_not_reached ();
+ g_assert_not_reached();
}
}
static gboolean
write_xmailer_header (CamelMimeMessage *message, MailDisplay *md,
- MailDisplayStream *stream, int xmask)
+ GtkHTML *html, GtkHTMLStream *stream,
+ MailConfigXMailerDisplayStyle xm)
{
const char *xmailer, *evolution;
-
+
xmailer = camel_medium_get_header (CAMEL_MEDIUM (message), "X-Mailer");
if (!xmailer) {
xmailer = camel_medium_get_header (CAMEL_MEDIUM (message), "User-Agent");
if (!xmailer)
return FALSE;
}
-
+
evolution = strstr (xmailer, "Evolution");
- if ((xmask & MAIL_CONFIG_XMAILER_OTHER) ||
- (evolution && (xmask & MAIL_CONFIG_XMAILER_EVO)))
- write_text_header (stream, _("Mailer"), xmailer, WRITE_BOLD);
-
- return evolution != NULL && (xmask & MAIL_CONFIG_XMAILER_RUPERT_APPROVED);
+ if ((xm & MAIL_CONFIG_XMAILER_OTHER) ||
+ (evolution && (xm & MAIL_CONFIG_XMAILER_EVO)))
+ write_text_header (_("Mailer"), xmailer, WRITE_BOLD, html, stream);
+
+ return evolution != NULL && (xm & MAIL_CONFIG_XMAILER_RUPERT_APPROVED);
}
#define COLOR_IS_LIGHT(r, g, b) ((r + g + b) > (128 * 3))
static void
-write_headers (MailDisplayStream *stream, MailDisplay *md, CamelMimeMessage *message)
+write_headers (CamelMimeMessage *message, MailDisplay *md,
+ GtkHTML *html, GtkHTMLStream *stream)
{
+ MailConfigXMailerDisplayStyle xm = mail_config_get_x_mailer_display_style ();
gboolean full = (md->display_style == MAIL_CONFIG_DISPLAY_FULL_HEADERS);
char bgcolor[7], fontcolor[7];
GtkStyle *style = NULL;
gboolean evo_icon = FALSE;
- GConfClient *gconf;
- int xmask, i;
-
- gconf = gconf_client_get_default ();
- xmask = gconf_client_get_int (gconf, "/apps/evolution/mail/display/xmailer_mask", NULL);
-
+ int i;
+
/* My favorite thing to do... muck around with colors so we respect people's stupid themes.
However, we only do this if we are rendering to the screen -- we ignore the theme
when we are printing. */
- style = gtk_widget_get_style (GTK_WIDGET (md->html));
+ style = gtk_widget_get_style (GTK_WIDGET (html));
if (style && !md->printing) {
- int state = GTK_WIDGET_STATE (GTK_WIDGET (md->html));
+ int state = GTK_WIDGET_STATE (GTK_WIDGET (html));
gushort r, g, b;
r = style->base[state].red / 256;
@@ -986,28 +1016,20 @@ write_headers (MailDisplayStream *stream, MailDisplay *md, CamelMimeMessage *mes
strcpy (fontcolor, "000000");
}
- camel_stream_write_string ((CamelStream *) stream,
- "<table width=\"100%\" cellpadding=0 cellspacing=0>");
-
- /* Top margin */
- camel_stream_write_string ((CamelStream *) stream, "<tr><td colspan=3 height=10>"
- "<table cellpadding=0 cellspacing=0><tr><td height=10>"
- "<a name=\"glue\"></td></tr></table></td></tr>");
-
- /* Left margin */
- camel_stream_write_string ((CamelStream *) stream, "<tr><td><table width=10 "
- "cellpadding=0 cellspacing=0><tr><td></td></tr></table></td>");
-
- /* Black border */
- camel_stream_write_string ((CamelStream *) stream, "<td width=\"100%\"><table bgcolor=\"#000000\" "
- "width=\"100%\" cellspacing=0 cellpadding=1>");
-
- /* Main header box */
- camel_stream_printf ((CamelStream *) stream, "<tr><td><table bgcolor=\"#%s\" width=\"100%%\" "
- "cellpadding=0 cellspacing=0>"
- /* Internal header table */
- "<tr valign=top><td><table><font color=\"#%s\">\n",
- bgcolor, fontcolor);
+ gtk_html_stream_printf (
+ stream,
+ "<table width=\"100%%\" cellpadding=0 cellspacing=0>"
+ /* Top margin */
+ "<tr><td colspan=3 height=10><table height=10 cellpadding=0 cellspacing=0><tr><td></td></tr></table></td></tr>"
+ /* Left margin */
+ "<tr><td><table width=10 cellpadding=0 cellspacing=0><tr><td></td></tr></table></td>"
+ /* Black border */
+ "<td width=\"100%%\"><table bgcolor=\"#000000\" width=\"100%%\" cellspacing=0 cellpadding=1>"
+ /* Main header box */
+ "<tr><td><table bgcolor=\"#%s\" width=\"100%%\" cellpadding=0 cellspacing=0>"
+ /* Internal header table */
+ "<tr valign=top><td><table><font color=\"#%s\">\n",
+ bgcolor, fontcolor);
if (full) {
struct _header_raw *header;
@@ -1015,46 +1037,47 @@ write_headers (MailDisplayStream *stream, MailDisplay *md, CamelMimeMessage *mes
CamelContentType *ct;
char *value;
- ct = camel_mime_part_get_content_type (CAMEL_MIME_PART (message));
- charset = header_content_type_param (ct, "charset");
- charset = e_iconv_charset_name (charset);
+ ct = camel_mime_part_get_content_type(CAMEL_MIME_PART(message));
+ charset = header_content_type_param(ct, "charset");
+ charset = e_iconv_charset_name(charset);
- header = CAMEL_MIME_PART (message)->headers;
+ header = CAMEL_MIME_PART(message)->headers;
while (header) {
- i = default_header_index (header->name);
+ i = default_header_index(header->name);
if (i == -1) {
- value = header_decode_string (header->value, charset);
- write_text_header (stream, header->name, value, WRITE_NOCOLUMNS);
- g_free (value);
+ value = header_decode_string(header->value, charset);
+ write_text_header(header->name, value, WRITE_NOCOLUMNS, html, stream);
+ g_free(value);
} else
- write_default_header (message, md, stream, i, WRITE_NOCOLUMNS);
+ write_default_header(message, md, html, stream, i, WRITE_NOCOLUMNS);
header = header->next;
}
} else {
- for (i = 0; i < sizeof (default_headers) / sizeof (default_headers[0]); i++)
- write_default_header (message, md, stream, i, 0);
- if (xmask != MAIL_CONFIG_XMAILER_NONE)
- evo_icon = write_xmailer_header (message, md, stream, xmask);
+ for (i=0;i<sizeof(default_headers)/sizeof(default_headers[0]);i++)
+ write_default_header(message, md, html, stream, i, 0);
+ if (xm != MAIL_CONFIG_XMAILER_NONE)
+ evo_icon = write_xmailer_header(message, md, html, stream, xm);
}
/* Close off the internal header table */
- camel_stream_write_string ((CamelStream *) stream, "</font></table></td>");
-
+ mail_html_write (html, stream, "</font></table></td>");
+
if (!md->printing && evo_icon) {
- camel_stream_printf ((CamelStream *) stream, "<td align=right><table><tr><td width=16>"
- "<img src=\"%s\"></td></tr></table></td>",
- mail_display_get_url_for_icon (md, EVOLUTION_ICONSDIR "/monkey-16.png"));
+ gtk_html_stream_printf (stream,
+ "<td align=right><table><tr><td width=16>"
+ "<img src=\"%s\">"
+ "</td></tr></table></td>",
+ mail_display_get_url_for_icon (md, EVOLUTION_ICONSDIR "/monkey-16.png"));
}
-
- camel_stream_write_string ((CamelStream *) stream,
- /* Main header box */
- "</tr></table>"
- /* Black border */
- "</td></tr></table></td>"
- /* Right margin */
- "<td><table width=10 cellpadding=0 cellspacing=0>"
- "<tr><td></td></tr></table></td>"
- "</tr></table>\n");
+
+ mail_html_write (html, stream,
+ /* Main header box */
+ "</tr></table>"
+ /* Black border */
+ "</td></tr></table></td>"
+ /* Right margin */
+ "<td><table width=10 cellpadding=0 cellspacing=0><tr><td></td></tr></table></td>"
+ "</tr></table>\n");
}
static void
@@ -1065,110 +1088,86 @@ load_offline_content (MailDisplay *md, gpointer data)
stream = camel_stream_null_new ();
camel_data_wrapper_write_to_stream (wrapper, stream);
- camel_object_unref (stream);
- camel_object_unref (wrapper);
+ camel_object_unref (CAMEL_OBJECT (stream));
+ camel_object_unref (CAMEL_OBJECT (wrapper));
}
gboolean
-mail_content_loaded (CamelDataWrapper *wrapper, MailDisplay *md, gboolean redisplay, const char *url,
- GtkHTML *html, GtkHTMLStream *stream)
+mail_content_loaded (CamelDataWrapper *wrapper, MailDisplay *md, gboolean redisplay, const gchar *url,
+ GtkHTML *html, GtkHTMLStream *handle)
{
if (!camel_data_wrapper_is_offline (wrapper))
return TRUE;
- camel_object_ref (wrapper);
- if (redisplay) {
- mail_display_redisplay_when_loaded (md, wrapper, load_offline_content,
- html, wrapper);
- } else {
- mail_display_stream_write_when_loaded (md, wrapper, url, load_offline_content,
- html, stream, wrapper);
- }
+ camel_object_ref (CAMEL_OBJECT (wrapper));
+ if (redisplay)
+ mail_display_redisplay_when_loaded (md, wrapper, load_offline_content, html, wrapper);
+ else
+ mail_display_stream_write_when_loaded (md, wrapper, url, load_offline_content, html, handle, wrapper);
return FALSE;
}
-
-ssize_t
-mail_format_data_wrapper_write_to_stream (CamelDataWrapper *wrapper, MailDisplay *mail_display, CamelStream *stream)
+/* Return the contents of a data wrapper, or %NULL if it contains only
+ * whitespace.
+ */
+GByteArray *
+mail_format_get_data_wrapper_text (CamelDataWrapper *wrapper, MailDisplay *mail_display)
{
+ CamelStream *memstream;
CamelStreamFilter *filtered_stream;
- ssize_t written;
+ GByteArray *ba;
+ char *text, *end;
+
+ memstream = camel_stream_mem_new ();
+ ba = g_byte_array_new ();
+ camel_stream_mem_set_byte_array (CAMEL_STREAM_MEM (memstream), ba);
- filtered_stream = camel_stream_filter_new_with_stream (stream);
+ filtered_stream = camel_stream_filter_new_with_stream (memstream);
+ camel_object_unref (CAMEL_OBJECT (memstream));
if (wrapper->rawtext || (mail_display && mail_display->charset)) {
CamelMimeFilterCharset *filter;
- CamelContentType *content_type;
- GConfClient *gconf;
- char *charset;
-
- gconf = gconf_client_get_default ();
-
- content_type = camel_data_wrapper_get_mime_type_field (wrapper);
+ const char *charset;
if (!wrapper->rawtext) {
/* data wrapper had been successfully converted to UTF-8 using the mime
part's charset, but the user thinks he knows best so we'll let him
shoot himself in the foot here... */
+ CamelContentType *content_type;
/* get the original charset of the mime part */
- charset = (char *) (content_type ? header_content_type_param (content_type, "charset") : NULL);
+ content_type = camel_data_wrapper_get_mime_type_field (wrapper);
+ charset = content_type ? header_content_type_param (content_type, "charset") : NULL;
if (!charset)
- charset = gconf_client_get_string (gconf, "/apps/evolution/mail/format/charset", NULL);
- else
- charset = g_strdup (charset);
+ charset = mail_config_get_default_charset ();
/* since the content is already in UTF-8, we need to decode into the
original charset before we can convert back to UTF-8 using the charset
the user is overriding with... */
- if ((filter = camel_mime_filter_charset_new_convert ("utf-8", charset))) {
+ filter = camel_mime_filter_charset_new_convert ("utf-8", charset);
+ if (filter) {
camel_stream_filter_add (filtered_stream, CAMEL_MIME_FILTER (filter));
- camel_object_unref (filter);
+ camel_object_unref (CAMEL_OBJECT (filter));
}
-
- g_free (charset);
}
/* find out the charset the user wants to override to */
if (mail_display && mail_display->charset)
- charset = g_strdup (mail_display->charset);
- else if (content_type && (charset = (char *) header_content_type_param (content_type, "charset")))
- charset = g_strdup (charset);
+ charset = mail_display->charset;
else
- charset = gconf_client_get_string (gconf, "/apps/evolution/mail/format/charset", NULL);
+ charset = mail_config_get_default_charset ();
- if ((filter = camel_mime_filter_charset_new_convert (charset, "utf-8"))) {
+ filter = camel_mime_filter_charset_new_convert (charset, "utf-8");
+ if (filter) {
camel_stream_filter_add (filtered_stream, CAMEL_MIME_FILTER (filter));
- camel_object_unref (filter);
+ camel_object_unref (CAMEL_OBJECT (filter));
}
-
- g_free (charset);
}
- written = camel_data_wrapper_write_to_stream (wrapper, CAMEL_STREAM (filtered_stream));
+ camel_data_wrapper_write_to_stream (wrapper, CAMEL_STREAM (filtered_stream));
camel_stream_flush (CAMEL_STREAM (filtered_stream));
- camel_object_unref (filtered_stream);
-
- return written;
-}
-
-/* Return the contents of a data wrapper, or %NULL if it contains only
- * whitespace.
- */
-GByteArray *
-mail_format_get_data_wrapper_text (CamelDataWrapper *wrapper, MailDisplay *mail_display)
-{
- CamelStream *memstream;
- GByteArray *ba;
- char *text, *end;
-
- memstream = camel_stream_mem_new ();
- ba = g_byte_array_new ();
- camel_stream_mem_set_byte_array (CAMEL_STREAM_MEM (memstream), ba);
-
- mail_format_data_wrapper_write_to_stream (wrapper, mail_display, memstream);
- camel_object_unref (memstream);
+ camel_object_unref (CAMEL_OBJECT (filtered_stream));
for (text = ba->data, end = text + ba->len; text < end; text++) {
if (!isspace ((unsigned char) *text))
@@ -1184,111 +1183,516 @@ mail_format_get_data_wrapper_text (CamelDataWrapper *wrapper, MailDisplay *mail_
}
static void
-write_hr (MailDisplayStream *stream)
+write_hr (GtkHTML *html, GtkHTMLStream *stream)
{
- camel_stream_write_string ((CamelStream *) stream, STANDARD_ISSUE_TABLE_OPEN
- "<tr><td width=\"100%\"><hr noshadow size=1>"
- "</td></tr></table>\n");
+ mail_html_write (html, stream,
+ "<table cellspacing=0 cellpadding=10 width=\"100%\"><tr><td width=\"100%\">"
+ "<hr noshadow size=1></td></tr></table>\n");
}
/*----------------------------------------------------------------------*
* Mime handling functions
*----------------------------------------------------------------------*/
+struct {
+ char *start;
+ char * (*handler) (char *start, CamelMimePart *part,
+ guint offset, MailDisplay *md, GtkHTML *html, GtkHTMLStream *stream);
+} text_specials[] = {
+ { "-----BEGIN PGP MESSAGE-----\n", try_inline_pgp },
+ { "-----BEGIN PGP SIGNED MESSAGE-----\n", try_inline_pgp_sig },
+ { "begin ", try_uudecoding },
+ { "(This file must be converted with BinHex 4.0)\n", try_inline_binhex }
+};
+
+static int num_specials = (sizeof (text_specials) / sizeof (text_specials[0]));
+
+static void
+write_one_text_plain_chunk (const char *text, int len, GtkHTML *html, GtkHTMLStream *stream, gboolean printing)
+{
+ char *buf;
+
+ mail_html_write (html, stream,
+ "<table cellspacing=0 cellpadding=10 width=\"100%\"><tr><td>\n");
+
+ buf = g_strndup (text, len);
+ mail_text_write (html, stream, printing, buf);
+ g_free (buf);
+
+ mail_html_write (html, stream, "</td></tr></table>\n");
+}
+
static gboolean
handle_text_plain (CamelMimePart *part, const char *mime_type,
- MailDisplay *md, MailDisplayStream *stream)
+ MailDisplay *md, GtkHTML *html, GtkHTMLStream *stream)
{
- CamelStreamFilter *filtered_stream;
- CamelMimeFilter *html_filter;
- CamelDataWrapper *wrapper;
+ CamelDataWrapper *wrapper =
+ camel_medium_get_content_object (CAMEL_MEDIUM (part));
CamelContentType *type;
+ gboolean check_specials;
+ char *p, *start, *text;
const char *format;
- GConfClient *gconf;
- guint32 flags, rgb = 0;
- GdkColor colour;
- char *buf;
+ GByteArray *bytes;
+ int i;
- gconf = gconf_client_get_default ();
+ bytes = mail_format_get_data_wrapper_text (wrapper, md);
+ if (!bytes)
+ return FALSE;
- flags = CAMEL_MIME_FILTER_TOHTML_CONVERT_NL | CAMEL_MIME_FILTER_TOHTML_CONVERT_SPACES;
- if (!md->printing) {
- flags |= CAMEL_MIME_FILTER_TOHTML_CONVERT_URLS | CAMEL_MIME_FILTER_TOHTML_CONVERT_ADDRESSES;
- if (gconf_client_get_bool (gconf, "/apps/evolution/mail/display/mark_citations", NULL)) {
- flags |= CAMEL_MIME_FILTER_TOHTML_MARK_CITATION;
-
- buf = gconf_client_get_string (gconf, "/apps/evolution/mail/display/citation_colour", NULL);
- gdk_color_parse (buf ? buf : "#737373", &colour);
- g_free (buf);
-
- rgb = ((colour.red & 0xff00) << 8) | (colour.green & 0xff00) | ((colour.blue & 0xff00) >> 8);
- }
+ g_byte_array_append (bytes, "", 1);
+ text = bytes->data;
+ g_byte_array_free (bytes, FALSE);
+
+ /* Check to see if this is a broken text/html part with content-type text/plain */
+ start = text;
+ while (isspace ((unsigned) *start))
+ start++;
+ if (!g_strncasecmp (start, "<html>", 6) || !g_strncasecmp (start, "<!DOCTYPE HTML", 14)) {
+ g_free (text);
+ return handle_text_html (part, "text/html", md, html, stream);
}
/* Check for RFC 2646 flowed text. */
type = camel_mime_part_get_content_type (part);
format = header_content_type_param (type, "format");
- if (format && !strcasecmp (format, "flowed"))
- flags |= CAMEL_MIME_FILTER_TOHTML_FORMAT_FLOWED;
+ if (format && !g_strcasecmp (format, "flowed"))
+ return handle_text_plain_flowed (text, md, html, stream);
- html_filter = camel_mime_filter_tohtml_new (flags, rgb);
- filtered_stream = camel_stream_filter_new_with_stream ((CamelStream *) stream);
- camel_stream_filter_add (filtered_stream, html_filter);
- camel_object_unref (html_filter);
+ /* Only look for binhex and stuff if this is real text/plain.
+ * (and not, say, application/mac-binhex40 that mail-identify
+ * has decided to call text/plain because it starts with English
+ * text...)
+ */
+ check_specials = header_content_type_is (type, "text", "plain");
+
+ p = text;
+ while (p && check_specials) {
+ /* Look for special cases. */
+ for (i = 0; i < num_specials; i++) {
+ start = strstr (p, text_specials[i].start);
+ if (start && (start == p || start[-1] == '\n'))
+ break;
+ }
+ if (i == num_specials)
+ break;
+
+ /* Deal with special case */
+ if (start != p)
+ write_one_text_plain_chunk (p, start - p, html, stream, md->printing);
+
+ p = text_specials[i].handler (start, part, start - text, md, html, stream);
+ if (p == start) {
+ /* Oops. That failed. Output this line normally and
+ * skip over it.
+ */
+ p = strchr (start, '\n');
+ /* Last line, drop out, and dump */
+ if (p == NULL) {
+ p = start;
+ break;
+ }
+ p++;
+ write_one_text_plain_chunk (start, p - start, html, stream, md->printing);
+ } else if (p)
+ write_hr (html, stream);
+ }
+ /* Finish up (or do the whole thing if there were no specials). */
+ if (p)
+ write_one_text_plain_chunk (p, strlen (p), html, stream, md->printing);
- camel_stream_write_string ((CamelStream *) stream, STANDARD_ISSUE_TABLE_OPEN "<tr><td><tt>\n");
+ g_free (text);
- wrapper = camel_medium_get_content_object (CAMEL_MEDIUM (part));
- mail_format_data_wrapper_write_to_stream (wrapper, md, (CamelStream *) filtered_stream);
+ return TRUE;
+}
+
+static gboolean
+handle_text_plain_flowed (char *buf, MailDisplay *md, GtkHTML *html, GtkHTMLStream *stream)
+{
+ char *text, *line, *eol, *p;
+ int prevquoting = 0, quoting, len, br_pending = 0;
+ guint32 citation_color = mail_config_get_citation_color ();
+
+ mail_html_write (html, stream,
+ "\n<!-- text/plain, flowed -->\n"
+ "<table cellspacing=0 cellpadding=10 width=\"100%\"><tr><td>\n<tt>\n");
+
+ for (line = buf; *line; line = eol + 1) {
+ /* Process next line */
+ eol = strchr (line, '\n');
+ if (eol)
+ *eol = '\0';
+
+ quoting = 0;
+ for (p = line; *p == '>'; p++)
+ quoting++;
+ if (quoting != prevquoting) {
+ if (prevquoting == 0) {
+ if (md->printing)
+ mail_html_write (html, stream, "<i>");
+ else
+ gtk_html_stream_printf (stream, "<font color=\"#%06x\">", citation_color);
+ if (br_pending)
+ br_pending--;
+ }
+ while (quoting > prevquoting) {
+ mail_html_write (html, stream, "<blockquote type=\"cite\">");
+ prevquoting++;
+ }
+ while (quoting < prevquoting) {
+ mail_html_write (html, stream, "</blockquote>");
+ prevquoting--;
+ }
+ if (quoting == 0) {
+ mail_html_write (html, stream, md->printing ? "</i>" : "</font>\n");
+ if (br_pending)
+ br_pending--;
+ }
+ }
+
+ if (*p == ' ')
+ p++;
+ len = strlen (p);
+ if (len == 0) {
+ br_pending++;
+ if (!eol)
+ break;
+ continue;
+ }
+
+ while (br_pending) {
+ mail_html_write (html, stream, "<br>\n");
+ br_pending--;
+ }
+
+ /* replace '<' with '&lt;', etc. */
+ text = e_text_to_html (p,
+ md->printing ?
+ E_TEXT_TO_HTML_CONVERT_SPACES :
+ E_TEXT_TO_HTML_CONVERT_SPACES | E_TEXT_TO_HTML_CONVERT_URLS);
+ if (text && *text)
+ mail_html_write (html, stream, text);
+ g_free (text);
+
+ if ((len > 0 && p[len - 1]) != ' ' || !strcmp (p, "-- "))
+ br_pending++;
+
+ if (!eol)
+ break;
+ }
- camel_stream_write_string ((CamelStream *) stream, "</tt></td></tr></table>\n");
+ g_free (buf);
- camel_object_unref (filtered_stream);
+ mail_html_write (html, stream, "</tt>\n</td></tr></table>\n");
return TRUE;
}
+static CamelMimePart *
+fake_mime_part_from_data (const char *data, int len, const char *type,
+ guint offset, MailDisplay *md)
+{
+ GHashTable *fake_parts = g_datalist_get_data (md->data, "fake_parts");
+ CamelStream *memstream;
+ CamelDataWrapper *wrapper;
+ CamelMimePart *part;
+
+ part = g_hash_table_lookup (fake_parts, GUINT_TO_POINTER (offset));
+ if (part)
+ return part;
+
+ memstream = camel_stream_mem_new_with_buffer (data, len);
+ wrapper = camel_data_wrapper_new ();
+ camel_data_wrapper_construct_from_stream (wrapper, memstream);
+ camel_data_wrapper_set_mime_type (wrapper, type);
+ camel_object_unref (CAMEL_OBJECT (memstream));
+ part = camel_mime_part_new ();
+ camel_medium_set_content_object (CAMEL_MEDIUM (part), wrapper);
+ camel_object_unref (CAMEL_OBJECT (wrapper));
+ camel_mime_part_set_disposition (part, "inline");
+
+ g_hash_table_insert (fake_parts, GUINT_TO_POINTER (offset), part);
+ return part;
+}
+
+static void
+destroy_part (CamelObject *root, gpointer event_data, gpointer user_data)
+{
+ camel_object_unref (user_data);
+}
+
+static char *
+try_inline_pgp (char *start, CamelMimePart *mime_part,
+ guint offset, MailDisplay *md, GtkHTML *html, GtkHTMLStream *stream)
+{
+ return start;
+}
+
+static char *
+try_inline_pgp_sig (char *start, CamelMimePart *mime_part,
+ guint offset, MailDisplay *md, GtkHTML *html, GtkHTMLStream *stream)
+{
+ return start;
+}
+
+static char *
+try_uudecoding (char *start, CamelMimePart *mime_part,
+ guint offset, MailDisplay *md, GtkHTML *html, GtkHTMLStream *stream)
+{
+ int mode, len, state = CAMEL_UUDECODE_STATE_INIT;
+ char *filename, *eoln, *p, *out;
+ CamelMimePart *part;
+ guint32 save = 0;
+
+ /* Make sure it's a real uudecode begin line:
+ * begin [0-7]+ .*
+ */
+ mode = strtoul (start + 6, &p, 8);
+ if (p == start + 6 || *p != ' ')
+ return start;
+
+ if (!(eoln = strchr (start, '\n')))
+ return start;
+
+ while (*p == ' ' || *p == '\t')
+ p++;
+
+ if (p == eoln)
+ return start;
+
+ filename = g_strndup (p, eoln - p);
+
+ /* Make sure there's an end line. */
+ if (!(p = strstr (p, "\nend\n"))) {
+ g_free (filename);
+ return start;
+ }
+
+ eoln++;
+ out = g_malloc (p - eoln);
+ len = uudecode_step (eoln, p - eoln, out, &state, &save);
+
+ part = fake_mime_part_from_data (out, len, "application/octet-stream",
+ offset, md);
+ g_free (out);
+
+ camel_mime_part_set_filename (part, filename);
+ g_free (filename);
+
+ camel_object_hook_event (CAMEL_OBJECT (md->current_message),
+ "finalize", destroy_part, part);
+
+ write_hr (html, stream);
+ format_mime_part (part, md, html, stream);
+
+ return p + 4;
+}
+
+static char *
+try_inline_binhex (char *start, CamelMimePart *mime_part,
+ guint offset, MailDisplay *md, GtkHTML *html, GtkHTMLStream *stream)
+{
+ char *p;
+ CamelMimePart *part;
+
+ /* Find data start. */
+ p = strstr (start, "\n:");
+ if (!p)
+ return start;
+
+ /* And data end. */
+ p = strchr (p + 2, ':');
+ if (!p || (*(p + 1) != '\n' && *(p + 1) != '\0'))
+ return start;
+ p += 2;
+
+ part = fake_mime_part_from_data (start, p - start,
+ "application/mac-binhex40",
+ offset, md);
+ camel_object_hook_event (CAMEL_OBJECT (md->current_message),
+ "finalize", destroy_part, part);
+
+ write_hr (html, stream);
+ format_mime_part (part, md, html, stream);
+
+ return p;
+}
+
+static void
+g_string_append_len (GString *string, const char *str, int len)
+{
+ char *tmp;
+
+ tmp = g_malloc (len + 1);
+ tmp[len] = 0;
+ memcpy (tmp, str, len);
+ g_string_append (string, tmp);
+ g_free (tmp);
+}
+
/* text/enriched (RFC 1896) or text/richtext (included in RFC 1341) */
static gboolean
handle_text_enriched (CamelMimePart *part, const char *mime_type,
- MailDisplay *md, MailDisplayStream *stream)
+ MailDisplay *md, GtkHTML *html, GtkHTMLStream *stream)
{
- CamelStreamFilter *filtered_stream;
- CamelMimeFilter *enriched;
- CamelDataWrapper *wrapper;
- guint32 flags = 0;
+ static GHashTable *translations = NULL;
+ CamelDataWrapper *wrapper =
+ camel_medium_get_content_object (CAMEL_MEDIUM (part));
+ GByteArray *ba, *bytes;
+ char *text, *p, *xed;
+ int len, nofill = 0;
+ gboolean enriched;
+ GString *string;
+
+ if (!translations) {
+ translations = g_hash_table_new (g_strcase_hash, g_strcase_equal);
+
+ g_hash_table_insert (translations, "bold", "<b>");
+ g_hash_table_insert (translations, "/bold", "</b>");
+ g_hash_table_insert (translations, "italic", "<i>");
+ g_hash_table_insert (translations, "/italic", "</i>");
+ g_hash_table_insert (translations, "fixed", "<tt>");
+ g_hash_table_insert (translations, "/fixed", "</tt>");
+ g_hash_table_insert (translations, "smaller", "<font size=-1>");
+ g_hash_table_insert (translations, "/smaller", "</font>");
+ g_hash_table_insert (translations, "bigger", "<font size=+1>");
+ g_hash_table_insert (translations, "/bigger", "</font>");
+ g_hash_table_insert (translations, "underline", "<u>");
+ g_hash_table_insert (translations, "/underline", "</u>");
+ g_hash_table_insert (translations, "center", "<p align=center>");
+ g_hash_table_insert (translations, "/center", "</p>");
+ g_hash_table_insert (translations, "flushleft", "<p align=left>");
+ g_hash_table_insert (translations, "/flushleft", "</p>");
+ g_hash_table_insert (translations, "flushright", "<p align=right>");
+ g_hash_table_insert (translations, "/flushright", "</p>");
+ g_hash_table_insert (translations, "excerpt", "<blockquote>");
+ g_hash_table_insert (translations, "/excerpt", "</blockquote>");
+ g_hash_table_insert (translations, "paragraph", "<p>");
+ g_hash_table_insert (translations, "signature", "<address>");
+ g_hash_table_insert (translations, "/signature", "</address>");
+ g_hash_table_insert (translations, "comment", "<!-- ");
+ g_hash_table_insert (translations, "/comment", " -->");
+ g_hash_table_insert (translations, "param", "<!-- ");
+ g_hash_table_insert (translations, "/param", " -->");
+ g_hash_table_insert (translations, "np", "<hr>");
+ }
- wrapper = camel_medium_get_content_object (CAMEL_MEDIUM (part));
+ bytes = mail_format_get_data_wrapper_text (wrapper, md);
+ if (!bytes)
+ return FALSE;
- if (!strcasecmp (mime_type, "text/richtext")) {
- flags = CAMEL_MIME_FILTER_ENRICHED_IS_RICHTEXT;
- camel_stream_write_string ((CamelStream *) stream, "\n<!-- text/richtext -->\n");
+ if (!g_strcasecmp (mime_type, "text/richtext")) {
+ enriched = FALSE;
+ mail_html_write (html, stream,
+ "\n<!-- text/richtext -->\n");
} else {
- camel_stream_write_string ((CamelStream *) stream, "\n<!-- text/enriched -->\n");
+ enriched = TRUE;
+ mail_html_write (html, stream,
+ "\n<!-- text/enriched -->\n");
}
- enriched = camel_mime_filter_enriched_new (flags);
- filtered_stream = camel_stream_filter_new_with_stream ((CamelStream *) stream);
- camel_stream_filter_add (filtered_stream, enriched);
- camel_object_unref (enriched);
+ /* This is not great code, but I don't feel like fixing it right
+ * now. I mean, it's just text/enriched...
+ */
+ string = g_string_sized_new (2 * bytes->len);
+ g_byte_array_append (bytes, "", 1);
+ p = text = bytes->data;
+ g_byte_array_free (bytes, FALSE);
+
+ while (p) {
+ len = strcspn (p, " <>&\n");
+ if (len)
+ g_string_append_len (string, p, len);
+
+ p += len;
+ if (!*p)
+ break;
+
+ switch (*p++) {
+ case ' ':
+ while (*p == ' ') {
+ g_string_append (string, "&nbsp;");
+ p++;
+ }
+ g_string_append (string, " ");
+ break;
+ case '\n':
+ g_string_append (string, " ");
+ if (enriched && nofill <= 0) {
+ while (*p == '\n') {
+ g_string_append (string, "<br>");
+ p++;
+ }
+ }
+ break;
+ case '>':
+ g_string_append (string, "&gt;");
+ break;
+ case '&':
+ g_string_append (string, "&amp;");
+ break;
+ case '<':
+ if (enriched) {
+ if (*p == '<') {
+ g_string_append (string, "&lt;");
+ p++;
+ break;
+ }
+ } else {
+ if (strncmp (p, "lt>", 3) == 0) {
+ g_string_append (string, "&lt;");
+ p += 3;
+ break;
+ } else if (strncmp (p, "nl>", 3) == 0) {
+ g_string_append (string, "<br>");
+ p += 3;
+ break;
+ }
+ }
+
+ if (strncmp (p, "nofill>", 7) == 0) {
+ nofill++;
+ g_string_append (string, "<pre>");
+ } else if (strncmp (p, "/nofill>", 8) == 0) {
+ nofill--;
+ g_string_append (string, "</pre>");
+ } else {
+ char *copy, *match;
+
+ len = strcspn (p, ">");
+ copy = g_strndup (p, len);
+ match = g_hash_table_lookup (translations,
+ copy);
+ g_free (copy);
+ if (match)
+ g_string_append (string, match);
+ }
+
+ p = strchr (p, '>');
+ if (p)
+ p++;
+ }
+ }
+ g_free (text);
- camel_stream_write_string ((CamelStream *) stream, STANDARD_ISSUE_TABLE_OPEN "<tr><td><tt>\n");
- wrapper = camel_medium_get_content_object (CAMEL_MEDIUM (part));
- mail_format_data_wrapper_write_to_stream (wrapper, md, (CamelStream *) filtered_stream);
+ ba = g_byte_array_new ();
+ g_byte_array_append (ba, (const guint8 *)string->str,
+ string->len);
+ g_string_free (string, TRUE);
- camel_stream_write_string ((CamelStream *) stream, "</tt></td></tr></table>\n");
- camel_object_unref (filtered_stream);
+ xed = g_strdup_printf ("x-evolution-data:%p", part);
+ gtk_html_stream_printf (stream, "<iframe src=\"%s\" frameborder=0 scrolling=no></iframe>", xed);
+ mail_display_add_url (md, "data_urls", xed, ba);
return TRUE;
}
static gboolean
handle_text_html (CamelMimePart *part, const char *mime_type,
- MailDisplay *md, MailDisplayStream *stream)
+ MailDisplay *md, GtkHTML *html, GtkHTMLStream *stream)
{
const char *location, *base;
- camel_stream_write_string ((CamelStream *) stream, "\n<!-- text/html -->\n");
+ mail_html_write (html, stream, "\n<!-- text/html -->\n");
if ((base = camel_medium_get_header (CAMEL_MEDIUM (part), "Content-Base"))) {
char *base_url;
@@ -1298,36 +1702,33 @@ handle_text_html (CamelMimePart *part, const char *mime_type,
if (*base == '"' && *(base + len - 1) == '"') {
len -= 2;
- base_url = g_alloca (len + 1);
+ base_url = alloca (len + 1);
memcpy (base_url, base + 1, len);
base_url[len] = '\0';
base = base_url;
}
- gtk_html_set_base (md->html, base);
+ gtk_html_set_base (html, base);
}
location = get_location (part, md);
if (!location)
location = get_cid (part, md);
-
- camel_stream_printf ((CamelStream *) stream, "<iframe src=\"%s\" frameborder=0 "
- "scrolling=no>could not get %s</iframe>", location, location);
-
+ gtk_html_stream_printf (stream, "<iframe src=\"%s\" frameborder=0 scrolling=no></iframe>", location);
return TRUE;
}
static gboolean
-handle_image (CamelMimePart *part, const char *mime_type, MailDisplay *md, MailDisplayStream *stream)
+handle_image (CamelMimePart *part, const char *mime_type, MailDisplay *md, GtkHTML *html, GtkHTMLStream *stream)
{
- camel_stream_printf ((CamelStream *) stream, "<img hspace=10 vspace=10 src=\"%s\">",
- get_cid (part, md));
+ gtk_html_stream_printf (stream, "<img hspace=10 vspace=10 src=\"%s\">",
+ get_cid (part, md));
return TRUE;
}
static gboolean
handle_multipart_mixed (CamelMimePart *part, const char *mime_type,
- MailDisplay *md, MailDisplayStream *stream)
+ MailDisplay *md, GtkHTML *html, GtkHTMLStream *stream)
{
CamelDataWrapper *wrapper =
camel_medium_get_content_object (CAMEL_MEDIUM (part));
@@ -1336,30 +1737,30 @@ handle_multipart_mixed (CamelMimePart *part, const char *mime_type,
gboolean output = FALSE;
if (!CAMEL_IS_MULTIPART (wrapper)) {
- mail_error_printf (stream, "\n%s\n", _("Could not parse MIME message. Displaying as source."));
- if (mail_content_loaded (wrapper, md, TRUE, NULL, md->html, NULL))
- handle_text_plain (part, "text/plain", md, stream);
+ mail_error_printf (html, stream, "\n%s\n", U_("Could not parse MIME message. Displaying as source."));
+ if (mail_content_loaded (wrapper, md, TRUE, NULL, html, NULL))
+ handle_text_plain (part, "text/plain", md, html, stream);
return TRUE;
}
-
+
mp = CAMEL_MULTIPART (wrapper);
-
+
nparts = camel_multipart_get_number (mp);
for (i = 0; i < nparts; i++) {
if (i != 0 && output)
- write_hr (stream);
-
+ write_hr (html, stream);
+
part = camel_multipart_get_part (mp, i);
- output = format_mime_part (part, md, stream);
+ output = format_mime_part (part, md, html, stream);
}
-
+
return TRUE;
}
static gboolean
handle_multipart_encrypted (CamelMimePart *part, const char *mime_type,
- MailDisplay *md, MailDisplayStream *stream)
+ MailDisplay *md, GtkHTML *html, GtkHTMLStream *stream)
{
CamelMultipartEncrypted *mpe;
CamelMimePart *mime_part;
@@ -1370,7 +1771,7 @@ handle_multipart_encrypted (CamelMimePart *part, const char *mime_type,
/* Currently we only handle RFC2015-style PGP encryption. */
if (!camel_pgp_mime_is_rfc2015_encrypted (part))
- return handle_multipart_mixed (part, mime_type, md, stream);
+ return handle_multipart_mixed (part, mime_type, md, html, stream);
wrapper = camel_medium_get_content_object (CAMEL_MEDIUM (part));
@@ -1382,12 +1783,18 @@ handle_multipart_encrypted (CamelMimePart *part, const char *mime_type,
camel_object_unref (cipher);
if (camel_exception_is_set (&ex)) {
- mail_error_printf (stream, "\n%s\n", camel_exception_get_description (&ex));
+ char *error;
+
+ error = e_utf8_from_locale_string (camel_exception_get_description (&ex));
+
+ mail_error_printf (html, stream, "\n%s\n", error);
+ g_free (error);
+
camel_exception_clear (&ex);
return TRUE;
}
- handled = format_mime_part (mime_part, md, stream);
+ handled = format_mime_part (mime_part, md, html, stream);
camel_object_unref (mime_part);
return handled;
@@ -1395,7 +1802,7 @@ handle_multipart_encrypted (CamelMimePart *part, const char *mime_type,
static gboolean
handle_multipart_signed (CamelMimePart *part, const char *mime_type,
- MailDisplay *md, MailDisplayStream *stream)
+ MailDisplay *md, GtkHTML *html, GtkHTMLStream *stream)
{
CamelMimePart *subpart;
CamelDataWrapper *wrapper;
@@ -1405,12 +1812,12 @@ handle_multipart_signed (CamelMimePart *part, const char *mime_type,
wrapper = camel_medium_get_content_object (CAMEL_MEDIUM (part));
if (!CAMEL_IS_MULTIPART_SIGNED (wrapper)) {
- mail_error_printf (stream, "\n%s\n", _("Could not parse MIME message. Displaying as source."));
- if (mail_content_loaded (wrapper, md, TRUE, NULL, md->html, NULL))
- handle_text_plain (part, "text/plain", md, stream);
+ mail_error_printf (html, stream, "\n%s\n", U_("Could not parse MIME message. Displaying as source."));
+ if (mail_content_loaded (wrapper, md, TRUE, NULL, html, NULL))
+ handle_text_plain (part, "text/plain", md, html, stream);
return TRUE;
}
-
+
mps = CAMEL_MULTIPART_SIGNED (wrapper);
/* if subpart & signature is null, what do we do? just write it out raw?
@@ -1418,18 +1825,18 @@ handle_multipart_signed (CamelMimePart *part, const char *mime_type,
this includes: more or less than 2 parts */
/* output the content */
- subpart = camel_multipart_get_part ((CamelMultipart *) mps, CAMEL_MULTIPART_SIGNED_CONTENT);
+ subpart = camel_multipart_get_part((CamelMultipart *)mps, CAMEL_MULTIPART_SIGNED_CONTENT);
if (subpart == NULL)
return FALSE;
- output = format_mime_part (subpart, md, stream);
+ output = format_mime_part (subpart, md, html, stream);
/* now handle the signature */
- subpart = camel_multipart_get_part ((CamelMultipart *) mps, CAMEL_MULTIPART_SIGNED_SIGNATURE);
+ subpart = camel_multipart_get_part((CamelMultipart *)mps, CAMEL_MULTIPART_SIGNED_SIGNATURE);
if (subpart == NULL)
return FALSE;
- mail_part_set_default_displayed_inline (subpart, md, FALSE);
+ mail_part_set_default_displayed_inline(subpart, md, FALSE);
if (!mail_part_is_displayed_inline (subpart, md) && !md->printing) {
char *url;
@@ -1437,24 +1844,23 @@ handle_multipart_signed (CamelMimePart *part, const char *mime_type,
/* Write out the click-for-info object */
url = g_strdup_printf ("signature:%p/%lu", subpart,
(unsigned long)time (NULL));
- camel_stream_printf ((CamelStream *) stream,
- "<br><table cellspacing=0 cellpadding=0>"
- "<tr><td><table width=10 cellspacing=0 cellpadding=0>"
- "<tr><td></td></tr></table></td>"
- "<td><object classid=\"%s\"></object></td>"
- "<td><table width=3 cellspacing=0 cellpadding=0>"
- "<tr><td></td></tr></table></td>"
- "<td><font size=-1>", url);
+ gtk_html_stream_printf (stream,
+ "<br><table cellspacing=0 cellpadding=0>"
+ "<tr><td><table width=10 cellspacing=0 cellpadding=0>"
+ "<tr><td></td></tr></table></td>"
+ "<td><object classid=\"%s\"></object></td>"
+ "<td><table width=3 cellspacing=0 cellpadding=0>"
+ "<tr><td></td></tr></table></td>"
+ "<td><font size=-1>", url);
mail_display_add_url (md, "part_urls", url, subpart);
- camel_stream_write_string ((CamelStream *) stream,
- _("This message is digitally signed. "
- "Click the lock icon for more information."));
+ mail_html_write (html, stream,
+ U_("This message is digitally signed. "
+ "Click the lock icon for more information."));
- camel_stream_write_string ((CamelStream *) stream, "</font></td></tr><tr><td height=10>"
- "<table cellspacing=0 cellpadding=0><tr>"
- "<td height=10><a name=\"glue\"></td></tr>"
- "</table></td></tr></table>\n");
+ mail_html_write (html, stream,
+ "</font></td></tr><tr><td height=10><table height=10 cellspacing=0 cellpadding=0>"
+ "<tr><td></td></tr></table></td></tr></table>\n");
} else {
CamelCipherValidity *valid = NULL;
CamelException ex;
@@ -1468,7 +1874,7 @@ handle_multipart_signed (CamelMimePart *part, const char *mime_type,
cipher = camel_gpg_context_new (session);
if (cipher) {
valid = camel_multipart_signed_verify (mps, cipher, &ex);
- camel_object_unref (cipher);
+ camel_object_unref (CAMEL_OBJECT (cipher));
if (valid) {
good = camel_cipher_validity_get_valid (valid);
message = camel_cipher_validity_get_description (valid);
@@ -1476,44 +1882,45 @@ handle_multipart_signed (CamelMimePart *part, const char *mime_type,
message = camel_exception_get_description (&ex);
}
} else {
- message = _("Could not create a PGP verfication context");
+ message = U_("Could not create a PGP verfication context");
}
if (good) {
- camel_stream_printf ((CamelStream *) stream, "<table><tr valign=top><td>"
- "<img src=\"%s\"></td><td>%s<br><br>",
- mail_display_get_url_for_icon (md, EVOLUTION_ICONSDIR
- "/pgp-signature-ok.png"),
- _("This message is digitally signed and "
- "has been found to be authentic."));
+ gtk_html_stream_printf (stream,
+ "<table><tr valign=top>"
+ "<td><img src=\"%s\"></td>"
+ "<td>%s<br><br>",
+ mail_display_get_url_for_icon (md, EVOLUTION_ICONSDIR "/pgp-signature-ok.png"),
+ U_("This message is digitally signed and "
+ "has been found to be authentic."));
} else {
- camel_stream_printf ((CamelStream *) stream, "<table><tr valign=top><td>"
- "<img src=\"%s\"></td><td>%s<br><br>",
- mail_display_get_url_for_icon (md, EVOLUTION_ICONSDIR
- "/pgp-signature-bad.png"),
- _("This message is digitally signed but can "
- "not be proven to be authentic."));
+ gtk_html_stream_printf (stream,
+ "<table><tr valign=top>"
+ "<td><img src=\"%s\"></td>"
+ "<td>%s<br><br>",
+ mail_display_get_url_for_icon (md, EVOLUTION_ICONSDIR "/pgp-signature-bad.png"),
+ U_("This message is digitally signed but can "
+ "not be proven to be authentic."));
}
if (message) {
- camel_stream_printf ((CamelStream *) stream, "<font size=-1%s>", good ||
- md->printing ? "" : " color=red");
- mail_text_write (stream, md, part, 0, md->printing, message);
- camel_stream_write_string ((CamelStream *) stream, "</font>");
+ gtk_html_stream_printf (stream, "<font size=-1 %s>", good || md->printing ? "" : "color=red");
+ mail_text_write (html, stream, md->printing, message);
+ mail_html_write (html, stream, "</font>");
}
- camel_stream_write_string ((CamelStream *) stream, "</td></tr></table>");
+ mail_html_write (html, stream, "</td></tr></table>");
camel_exception_clear (&ex);
camel_cipher_validity_free (valid);
}
-
+
return TRUE;
}
/* As seen in RFC 2387! */
static gboolean
handle_multipart_related (CamelMimePart *part, const char *mime_type,
- MailDisplay *md, MailDisplayStream *stream)
+ MailDisplay *md, GtkHTML *html, GtkHTMLStream *stream)
{
CamelDataWrapper *wrapper = camel_medium_get_content_object (CAMEL_MEDIUM (part));
CamelMultipart *mp;
@@ -1525,12 +1932,12 @@ handle_multipart_related (CamelMimePart *part, const char *mime_type,
int ret;
if (!CAMEL_IS_MULTIPART (wrapper)) {
- mail_error_printf (stream, "\n%s\n", _("Could not parse MIME message. Displaying as source."));
- if (mail_content_loaded (wrapper, md, TRUE, NULL, md->html, NULL))
- handle_text_plain (part, "text/plain", md, stream);
+ mail_error_printf (html, stream, "\n%s\n", U_("Could not parse MIME message. Displaying as source."));
+ if (mail_content_loaded (wrapper, md, TRUE, NULL, html, NULL))
+ handle_text_plain (part, "text/plain", md, html, stream);
return TRUE;
}
-
+
mp = CAMEL_MULTIPART (wrapper);
nparts = camel_multipart_get_number (mp);
@@ -1550,7 +1957,8 @@ handle_multipart_related (CamelMimePart *part, const char *mime_type,
body_part = camel_multipart_get_part (mp, i);
cid = camel_mime_part_get_content_id (body_part);
- if (cid && !strncmp (cid, start + 1, len) && strlen (cid) == len) {
+ if (cid && !strncmp (cid, start + 1, len) &&
+ strlen (cid) == len) {
display_part = body_part;
break;
}
@@ -1562,7 +1970,7 @@ handle_multipart_related (CamelMimePart *part, const char *mime_type,
if (!display_part) {
/* Oops. Hrmph. */
- return handle_multipart_mixed (part, mime_type, md, stream);
+ return handle_multipart_mixed (part, mime_type, md, html, stream);
}
/* setup a 'stack' of related parts */
@@ -1581,11 +1989,11 @@ handle_multipart_related (CamelMimePart *part, const char *mime_type,
get_cid (body_part, md);
get_location (body_part, md);
- g_hash_table_insert (md->related, body_part, body_part);
+ g_hash_table_insert(md->related, body_part, body_part);
}
/* Now, display the displayed part. */
- ret = format_mime_part (display_part, md, stream);
+ ret = format_mime_part (display_part, md, html, stream);
/* FIXME: flush html stream via gtkhtml_stream_flush which doens't exist yet ... */
while (gtk_events_pending ())
@@ -1597,10 +2005,10 @@ handle_multipart_related (CamelMimePart *part, const char *mime_type,
if (body_part == display_part)
continue;
- if (g_hash_table_lookup (md->related, body_part)) {
+ if (g_hash_table_lookup(md->related, body_part)) {
if (ret)
- write_hr (stream);
- ret |= format_mime_part (body_part, md, stream);
+ write_hr (html, stream);
+ ret |= format_mime_part (body_part, md, html, stream);
}
}
@@ -1620,14 +2028,14 @@ find_preferred_alternative (CamelMultipart *multipart, gboolean want_plain)
int i, nparts;
CamelMimePart *preferred_part = NULL;
MailMimeHandler *handler;
-
+
nparts = camel_multipart_get_number (multipart);
for (i = 0; i < nparts; i++) {
CamelMimePart *part = camel_multipart_get_part (multipart, i);
CamelContentType *type = camel_mime_part_get_content_type (part);
char *mime_type = header_content_type_simple (type);
-
- camel_strdown (mime_type);
+
+ g_strdown (mime_type);
if (want_plain && !strcmp (mime_type, "text/plain"))
return part;
handler = mail_lookup_handler (mime_type);
@@ -1635,13 +2043,13 @@ find_preferred_alternative (CamelMultipart *multipart, gboolean want_plain)
preferred_part = part;
g_free (mime_type);
}
-
+
return preferred_part;
}
static gboolean
handle_multipart_alternative (CamelMimePart *part, const char *mime_type,
- MailDisplay *md, MailDisplayStream *stream)
+ MailDisplay *md, GtkHTML *html, GtkHTMLStream *stream)
{
CamelDataWrapper *wrapper =
camel_medium_get_content_object (CAMEL_MEDIUM (part));
@@ -1649,9 +2057,9 @@ handle_multipart_alternative (CamelMimePart *part, const char *mime_type,
CamelMimePart *mime_part;
if (!CAMEL_IS_MULTIPART (wrapper)) {
- mail_error_printf (stream, "\n%s\n", _("Could not parse MIME message. Displaying as source."));
- if (mail_content_loaded (wrapper, md, TRUE, NULL, md->html, NULL))
- handle_text_plain (part, "text/plain", md, stream);
+ mail_error_printf (html, stream, "\n%s\n", U_("Could not parse MIME message. Displaying as source."));
+ if (mail_content_loaded (wrapper, md, TRUE, NULL, html, NULL))
+ handle_text_plain (part, "text/plain", md, html, stream);
return TRUE;
}
@@ -1659,68 +2067,69 @@ handle_multipart_alternative (CamelMimePart *part, const char *mime_type,
mime_part = find_preferred_alternative (multipart, FALSE);
if (mime_part)
- return format_mime_part (mime_part, md, stream);
+ return format_mime_part (mime_part, md, html, stream);
else
- return handle_multipart_mixed (part, mime_type, md, stream);
+ return handle_multipart_mixed (part, mime_type, md, html, stream);
}
/* RFC 1740 */
static gboolean
handle_multipart_appledouble (CamelMimePart *part, const char *mime_type,
- MailDisplay *md, MailDisplayStream *stream)
+ MailDisplay *md, GtkHTML *html, GtkHTMLStream *stream)
{
CamelDataWrapper *wrapper =
camel_medium_get_content_object (CAMEL_MEDIUM (part));
CamelMultipart *multipart;
-
+
if (!CAMEL_IS_MULTIPART (wrapper)) {
- mail_error_printf (stream, "\n%s\n", _("Could not parse MIME message. Displaying as source."));
- if (mail_content_loaded (wrapper, md, TRUE, NULL, md->html, NULL))
- handle_text_plain (part, "text/plain", md, stream);
+ mail_error_printf (html, stream, "\n%s\n", U_("Could not parse MIME message. Displaying as source."));
+ if (mail_content_loaded (wrapper, md, TRUE, NULL, html, NULL))
+ handle_text_plain (part, "text/plain", md, html, stream);
return TRUE;
}
-
+
multipart = CAMEL_MULTIPART (wrapper);
-
+
/* The first part is application/applefile and is not useful
* to us. The second part _may_ be displayable data. Most
* likely it's application/octet-stream though.
*/
part = camel_multipart_get_part (multipart, 1);
- return format_mime_part (part, md, stream);
+ return format_mime_part (part, md, html, stream);
}
static gboolean
handle_message_rfc822 (CamelMimePart *part, const char *mime_type,
- MailDisplay *md, MailDisplayStream *stream)
+ MailDisplay *md, GtkHTML *html, GtkHTMLStream *stream)
{
CamelDataWrapper *wrapper =
camel_medium_get_content_object (CAMEL_MEDIUM (part));
g_return_val_if_fail (CAMEL_IS_MIME_MESSAGE (wrapper), FALSE);
- camel_stream_write_string ((CamelStream *) stream, "<blockquote>");
- mail_format_mime_message (CAMEL_MIME_MESSAGE (wrapper), md, stream);
- camel_stream_write_string ((CamelStream *) stream, "</blockquote>");
+ mail_html_write (html, stream, "<blockquote>");
+ mail_format_mime_message (CAMEL_MIME_MESSAGE (wrapper), md, html, stream);
+ mail_html_write (html, stream, "</blockquote>");
return TRUE;
}
static gboolean
handle_message_external_body (CamelMimePart *part, const char *mime_type,
- MailDisplay *md, MailDisplayStream *stream)
+ MailDisplay *md, GtkHTML *html, GtkHTMLStream *stream)
{
CamelContentType *type;
const char *access_type;
char *url = NULL, *desc = NULL;
+ char *fmt;
type = camel_mime_part_get_content_type (part);
access_type = header_content_type_param (type, "access-type");
if (!access_type)
goto fallback;
- if (!strcasecmp (access_type, "ftp") ||
- !strcasecmp (access_type, "anon-ftp")) {
+ if (!g_strcasecmp (access_type, "ftp") ||
+ !g_strcasecmp (access_type, "anon-ftp")) {
const char *name, *site, *dir, *mode, *ftype;
char *path;
@@ -1755,8 +2164,10 @@ handle_message_external_body (CamelMimePart *part, const char *mime_type,
url = g_strdup_printf ("ftp://%s%s%s", site, path, ftype);
g_free (path);
- desc = g_strdup_printf (_("Pointer to FTP site (%s)"), url);
- } else if (!g_ascii_strcasecmp (access_type, "local-file")) {
+ fmt = e_utf8_from_locale_string (_("Pointer to FTP site (%s)"));
+ desc = g_strdup_printf (fmt, url);
+ g_free (fmt);
+ } else if (!g_strcasecmp (access_type, "local-file")) {
const char *name, *site;
name = header_content_type_param (type, "name");
@@ -1764,14 +2175,19 @@ handle_message_external_body (CamelMimePart *part, const char *mime_type,
goto fallback;
site = header_content_type_param (type, "site");
- url = g_strdup_printf ("file://%s%s", *name == '/' ? "" : "/", name);
+ url = g_strdup_printf ("file://%s%s", *name == '/' ? "" : "/",
+ name);
if (site) {
- desc = g_strdup_printf(_("Pointer to local file (%s) "
- "valid at site \"%s\""), name, site);
+ fmt = e_utf8_from_locale_string (_("Pointer to local file (%s) "
+ "valid at site \"%s\""));
+ desc = g_strdup_printf (fmt, name, site);
+ g_free (fmt);
} else {
- desc = g_strdup_printf(_("Pointer to local file (%s)"), name);
+ fmt = e_utf8_from_locale_string (_("Pointer to local file (%s)"));
+ desc = g_strdup_printf (fmt, name);
+ g_free (fmt);
}
- } else if (!strcasecmp (access_type, "URL")) {
+ } else if (!g_strcasecmp (access_type, "URL")) {
const char *urlparam;
char *s, *d;
@@ -1796,15 +2212,20 @@ handle_message_external_body (CamelMimePart *part, const char *mime_type,
}
*d = *s;
- desc = g_strdup_printf (_("Pointer to remote data (%s)"), url);
+ fmt = e_utf8_from_locale_string (_("Pointer to remote data (%s)"));
+ desc = g_strdup_printf (fmt, url);
+ g_free (fmt);
}
fallback:
if (!desc) {
- if (access_type)
- desc = g_strdup_printf (_("Pointer to unknown external data (\"%s\" type)"), access_type);
- else
- desc = g_strdup (_("Malformed external-body part."));
+ if (access_type) {
+ fmt = e_utf8_from_locale_string (_("Pointer to unknown external data "
+ "(\"%s\" type)"));
+ desc = g_strdup_printf (fmt, access_type);
+ g_free (fmt);
+ } else
+ desc = e_utf8_from_locale_string (_("Malformed external-body part."));
}
#if 0 /* FIXME */
@@ -1814,20 +2235,19 @@ handle_message_external_body (CamelMimePart *part, const char *mime_type,
g_free (desc);
g_free (url);
-
return TRUE;
}
static gboolean
handle_via_bonobo (CamelMimePart *part, const char *mime_type,
- MailDisplay *md, MailDisplayStream *stream)
+ MailDisplay *md, GtkHTML *html, GtkHTMLStream *stream)
{
- if (!md->printing) {
- camel_stream_printf ((CamelStream *) stream,
- "<object classid=\"%s\" type=\"%s\"></object>",
- get_cid (part, md), mime_type);
+ if (! md->printing) {
+ gtk_html_stream_printf (stream,
+ "<object classid=\"%s\" type=\"%s\"></object>",
+ get_cid (part, md), mime_type);
}
-
+
return TRUE;
}
@@ -1850,77 +2270,75 @@ mail_get_message_rfc822 (CamelMimeMessage *message, gboolean want_plain, gboolea
char *text, *citation, *buf, *html;
time_t date_val;
int offset;
-
+
contents = camel_medium_get_content_object (CAMEL_MEDIUM (message));
text = mail_get_message_body (contents, want_plain, cite);
if (!text)
text = g_strdup ("");
citation = cite ? "&gt; " : "";
retval = g_string_new (NULL);
-
+
/* Kludge: if text starts with "<PRE>", wrap it around the
* headers too so we won't get a blank line between them for the
* <P> to <PRE> switch.
*/
- if (!strncasecmp (text, "<pre>", 5))
- g_string_append_printf (retval, "<PRE>");
-
+ if (!g_strncasecmp (text, "<pre>", 5))
+ g_string_sprintfa (retval, "<PRE>");
+
/* create credits */
cia = camel_mime_message_get_from (message);
buf = camel_address_format (CAMEL_ADDRESS (cia));
if (buf) {
- html = camel_text_to_html (buf, CAMEL_MIME_FILTER_TOHTML_CONVERT_NL, 0);
- g_string_append_printf (retval, "%s<b>From:</b> %s<br>",
- citation, html);
+ html = e_text_to_html (buf, E_TEXT_TO_HTML_CONVERT_NL);
+ g_string_sprintfa (retval, "%s<b>From:</b> %s<br>",
+ citation, html);
g_free (html);
g_free (buf);
}
-
+
cia = camel_mime_message_get_recipients (message, CAMEL_RECIPIENT_TYPE_TO);
buf = camel_address_format (CAMEL_ADDRESS (cia));
if (buf) {
- html = camel_text_to_html (buf, CAMEL_MIME_FILTER_TOHTML_CONVERT_NL, 0);
- g_string_append_printf (retval, "%s<b>To:</b> %s<br>",
- citation, html);
+ html = e_text_to_html (buf, E_TEXT_TO_HTML_CONVERT_NL);
+ g_string_sprintfa (retval, "%s<b>To:</b> %s<br>",
+ citation, html);
g_free (html);
g_free (buf);
}
-
+
cia = camel_mime_message_get_recipients (message, CAMEL_RECIPIENT_TYPE_CC);
buf = camel_address_format (CAMEL_ADDRESS (cia));
if (buf) {
- html = camel_text_to_html (buf, CAMEL_MIME_FILTER_TOHTML_CONVERT_NL, 0);
- g_string_append_printf (retval, "%s<b>Cc:</b> %s<br>",
- citation, html);
+ html = e_text_to_html (buf, E_TEXT_TO_HTML_CONVERT_NL);
+ g_string_sprintfa (retval, "%s<b>Cc:</b> %s<br>",
+ citation, html);
g_free (html);
g_free (buf);
}
-
+
buf = (char *) camel_mime_message_get_subject (message);
if (buf) {
- html = camel_text_to_html (buf, CAMEL_MIME_FILTER_TOHTML_CONVERT_NL |
- CAMEL_MIME_FILTER_TOHTML_CONVERT_URLS, 0);
- g_string_append_printf (retval, "%s<b>Subject:</b> %s<br>",
- citation, html);
+ html = e_text_to_html (buf, E_TEXT_TO_HTML_CONVERT_NL | E_TEXT_TO_HTML_CONVERT_URLS);
+ g_string_sprintfa (retval, "%s<b>Subject:</b> %s<br>",
+ citation, html);
g_free (html);
}
-
+
date_val = camel_mime_message_get_date (message, &offset);
buf = header_format_date (date_val, offset);
- html = camel_text_to_html (buf, CAMEL_MIME_FILTER_TOHTML_CONVERT_NL, 0);
- g_string_append_printf (retval, "%s<b>Date:</b> %s<br>", citation, html);
+ html = e_text_to_html (buf, E_TEXT_TO_HTML_CONVERT_NL);
+ g_string_sprintfa (retval, "%s<b>Date:</b> %s<br>", citation, html);
g_free (html);
g_free (buf);
- if (!strncasecmp (text, "<pre>", 5))
- g_string_append_printf (retval, "%s<br>%s", citation, text + 5);
+ if (!g_strncasecmp (text, "<pre>", 5))
+ g_string_sprintfa (retval, "%s<br>%s", citation, text + 5);
else
- g_string_append_printf (retval, "%s<br>%s", citation, text);
+ g_string_sprintfa (retval, "%s<br>%s", citation, text);
g_free (text);
-
+
buf = retval->str;
g_string_free (retval, FALSE);
-
return buf;
}
@@ -1979,9 +2397,8 @@ mail_get_message_body (CamelDataWrapper *data, gboolean want_plain, gboolean cit
if (text && !header_content_type_is (mime_type, "text", "html")) {
char *html;
- html = camel_text_to_html (text, CAMEL_MIME_FILTER_TOHTML_PRE |
- CAMEL_MIME_FILTER_TOHTML_CONVERT_URLS |
- (cite ? CAMEL_MIME_FILTER_TOHTML_CITE : 0), 0);
+ html = e_text_to_html (text, E_TEXT_TO_HTML_PRE | E_TEXT_TO_HTML_CONVERT_URLS |
+ (cite ? E_TEXT_TO_HTML_CITE : 0));
g_free (text);
text = html;
}
diff --git a/mail/mail-local.c b/mail/mail-local.c
index cbec89d89e..e73dc0fc71 100644
--- a/mail/mail-local.c
+++ b/mail/mail-local.c
@@ -29,15 +29,17 @@
#include <config.h>
#endif
-#include <string.h>
#include <unistd.h>
#include <errno.h>
-#include <libxml/xmlmemory.h>
+#include <gnome-xml/xmlmemory.h>
+#include <libgnomeui/gnome-dialog.h>
+#include <libgnomeui/gnome-dialog-util.h>
#include <glade/glade.h>
#include "e-util/e-path.h"
-#include "e-util/e-dialog-utils.h"
+#include <gal/widgets/e-gui-utils.h>
+#include <gal/util/e-unicode-i18n.h>
#include <gal/util/e-xml-utils.h>
#include "Evolution.h"
@@ -149,11 +151,11 @@ load_metainfo(const char *path)
if (doc == NULL)
goto dodefault;
- node = doc->children;
+ node = doc->root;
if (strcmp(node->name, "folderinfo"))
goto dodefault;
- node = node->children;
+ node = node->childs;
while (node) {
if (!strcmp(node->name, "folder")) {
char *index, *txt;
@@ -237,11 +239,11 @@ mlf_refresh_info(CamelFolder *folder, CamelException *ex)
LOCAL_FOLDER_LOCK(mlf);
f = mlf->real_folder;
- camel_object_ref(f);
+ camel_object_ref((CamelObject *)f);
LOCAL_FOLDER_UNLOCK(mlf);
camel_folder_refresh_info(f, ex);
- camel_object_unref(f);
+ camel_object_unref((CamelObject *)f);
}
static void
@@ -252,11 +254,11 @@ mlf_sync(CamelFolder *folder, gboolean expunge, CamelException *ex)
LOCAL_FOLDER_LOCK(mlf);
f = mlf->real_folder;
- camel_object_ref(f);
+ camel_object_ref((CamelObject *)f);
LOCAL_FOLDER_UNLOCK(mlf);
camel_folder_sync(f, expunge, ex);
- camel_object_unref(f);
+ camel_object_unref((CamelObject *)f);
}
static void
@@ -267,11 +269,11 @@ mlf_expunge(CamelFolder *folder, CamelException *ex)
LOCAL_FOLDER_LOCK(mlf);
f = mlf->real_folder;
- camel_object_ref(f);
+ camel_object_ref((CamelObject *)f);
LOCAL_FOLDER_UNLOCK(mlf);
camel_folder_expunge(f, ex);
- camel_object_unref(f);
+ camel_object_unref((CamelObject *)f);
}
static void
@@ -282,11 +284,11 @@ mlf_append_message(CamelFolder *folder, CamelMimeMessage *message, const CamelMe
LOCAL_FOLDER_LOCK(mlf);
f = mlf->real_folder;
- camel_object_ref(f);
+ camel_object_ref((CamelObject *)f);
LOCAL_FOLDER_UNLOCK(mlf);
camel_folder_append_message(f, message, info, appended_uid, ex);
- camel_object_unref(f);
+ camel_object_unref((CamelObject *)f);
}
static CamelMimeMessage *
@@ -298,11 +300,11 @@ mlf_get_message(CamelFolder *folder, const char *uid, CamelException *ex)
LOCAL_FOLDER_LOCK(mlf);
f = mlf->real_folder;
- camel_object_ref(f);
+ camel_object_ref((CamelObject *)f);
LOCAL_FOLDER_UNLOCK(mlf);
ret = camel_folder_get_message(f, uid, ex);
- camel_object_unref(f);
+ camel_object_unref((CamelObject *)f);
return ret;
}
@@ -316,11 +318,11 @@ mlf_search_by_expression(CamelFolder *folder, const char *expression, CamelExcep
LOCAL_FOLDER_LOCK(mlf);
f = mlf->real_folder;
- camel_object_ref(f);
+ camel_object_ref((CamelObject *)f);
LOCAL_FOLDER_UNLOCK(mlf);
ret = camel_folder_search_by_expression(f, expression, ex);
- camel_object_unref(f);
+ camel_object_unref((CamelObject *)f);
return ret;
}
@@ -334,11 +336,11 @@ mlf_search_by_uids(CamelFolder *folder, const char *expression, GPtrArray *uids,
LOCAL_FOLDER_LOCK(mlf);
f = mlf->real_folder;
- camel_object_ref(f);
+ camel_object_ref((CamelObject *)f);
LOCAL_FOLDER_UNLOCK(mlf);
ret = camel_folder_search_by_uids(f, expression, uids, ex);
- camel_object_unref(f);
+ camel_object_unref((CamelObject *)f);
return ret;
}
@@ -351,11 +353,11 @@ mlf_search_free(CamelFolder *folder, GPtrArray *result)
LOCAL_FOLDER_LOCK(mlf);
f = mlf->real_folder;
- camel_object_ref(f);
+ camel_object_ref((CamelObject *)f);
LOCAL_FOLDER_UNLOCK(mlf);
camel_folder_search_free(f, result);
- camel_object_unref(f);
+ camel_object_unref((CamelObject *)f);
}
static void
@@ -366,11 +368,11 @@ mlf_set_message_flags(CamelFolder *folder, const char *uid, guint32 flags, guint
LOCAL_FOLDER_LOCK(mlf);
f = mlf->real_folder;
- camel_object_ref(f);
+ camel_object_ref((CamelObject *)f);
LOCAL_FOLDER_UNLOCK(mlf);
camel_folder_set_message_flags(mlf->real_folder, uid, flags, set);
- camel_object_unref(f);
+ camel_object_unref((CamelObject *)f);
}
static void
@@ -381,11 +383,11 @@ mlf_set_message_user_flag(CamelFolder *folder, const char *uid, const char *name
LOCAL_FOLDER_LOCK(mlf);
f = mlf->real_folder;
- camel_object_ref(f);
+ camel_object_ref((CamelObject *)f);
LOCAL_FOLDER_UNLOCK(mlf);
camel_folder_set_message_user_flag(mlf->real_folder, uid, name, value);
- camel_object_unref(f);
+ camel_object_unref((CamelObject *)f);
}
static void
@@ -396,11 +398,11 @@ mlf_set_message_user_tag(CamelFolder *folder, const char *uid, const char *name,
LOCAL_FOLDER_LOCK(mlf);
f = mlf->real_folder;
- camel_object_ref(f);
+ camel_object_ref((CamelObject *)f);
LOCAL_FOLDER_UNLOCK(mlf);
camel_folder_set_message_user_tag(mlf->real_folder, uid, name, value);
- camel_object_unref(f);
+ camel_object_unref((CamelObject *)f);
}
/* Internal store-rename call, update our strings */
@@ -435,13 +437,13 @@ mlf_rename(CamelFolder *folder, const char *new)
static void
mlf_proxy_message_changed(CamelObject *real_folder, gpointer event_data, gpointer user_data)
{
- camel_object_trigger_event(user_data, "message_changed", event_data);
+ camel_object_trigger_event((CamelObject *)user_data, "message_changed", event_data);
}
static void
mlf_proxy_folder_changed(CamelObject *real_folder, gpointer event_data, gpointer user_data)
{
- camel_object_trigger_event(user_data, "folder_changed", event_data);
+ camel_object_trigger_event((CamelObject *)user_data, "folder_changed", event_data);
}
static void
@@ -451,20 +453,20 @@ mlf_unset_folder (MailLocalFolder *mlf)
g_assert(mlf->real_folder);
- camel_object_unhook_event(mlf->real_folder,
+ camel_object_unhook_event(CAMEL_OBJECT(mlf->real_folder),
"message_changed",
mlf_proxy_message_changed,
mlf);
- camel_object_unhook_event(mlf->real_folder,
+ camel_object_unhook_event(CAMEL_OBJECT(mlf->real_folder),
"folder_changed",
mlf_proxy_folder_changed,
mlf);
- camel_object_unref(folder->summary);
+ camel_object_unref((CamelObject *)folder->summary);
folder->summary = NULL;
- camel_object_unref(mlf->real_folder);
+ camel_object_unref((CamelObject *)mlf->real_folder);
mlf->real_folder = NULL;
- camel_object_unref(mlf->real_store);
+ camel_object_unref((CamelObject *)mlf->real_store);
mlf->real_store = NULL;
folder->permanent_flags = 0;
@@ -500,14 +502,14 @@ mlf_set_folder(MailLocalFolder *mlf, guint32 flags, CamelException *ex)
if (mlf->real_folder->folder_flags & CAMEL_FOLDER_HAS_SUMMARY_CAPABILITY) {
folder->summary = mlf->real_folder->summary;
- camel_object_ref(mlf->real_folder->summary);
+ camel_object_ref((CamelObject *)mlf->real_folder->summary);
}
folder->permanent_flags = mlf->real_folder->permanent_flags;
folder->folder_flags = mlf->real_folder->folder_flags;
- camel_object_hook_event(mlf->real_folder, "message_changed", mlf_proxy_message_changed, mlf);
- camel_object_hook_event(mlf->real_folder, "folder_changed", mlf_proxy_folder_changed, mlf);
+ camel_object_hook_event((CamelObject *)mlf->real_folder, "message_changed", mlf_proxy_message_changed, mlf);
+ camel_object_hook_event((CamelObject *)mlf->real_folder, "folder_changed", mlf_proxy_folder_changed, mlf);
return TRUE;
}
@@ -534,9 +536,9 @@ mlf_getv(CamelObject *object, CamelException *ex, CamelArgGetV *args)
/* string to describe a local folder as the location of a message */
pathlen = strlen(evolution_dir) + strlen("local") + 1;
if (strlen(folder->full_name) > pathlen)
- mlf->description = g_strdup_printf(_("Local folders/%s"), folder->full_name+pathlen);
+ mlf->description = g_strdup_printf(U_("Local folders/%s"), folder->full_name+pathlen);
else
- mlf->description = g_strdup_printf(_("Local folders/%s"), folder->name);
+ mlf->description = g_strdup_printf(U_("Local folders/%s"), folder->name);
}
*arg->ca_str = mlf->description;
break;
@@ -620,28 +622,30 @@ mail_local_folder_get_type (void)
NULL,
mlf_init,
mlf_finalize);
- mlf_parent_class = (CamelFolderClass *)CAMEL_FOLDER_TYPE;
+ mlf_parent_class = (CamelFolderClass *)camel_type_get_global_classfuncs (CAMEL_FOLDER_TYPE);
}
return mail_local_folder_type;
}
static MailLocalFolder *
-mail_local_folder_construct(MailLocalFolder *mlf, MailLocalStore *parent_store, const char *full_name, CamelException *ex)
+mail_local_folder_construct(MailLocalFolder *mlf, MailLocalStore *parent_store, const char *full_name, CamelException *ex)
{
- char *metapath, *name;
+ const char *name;
+ char *metapath;
- name = g_path_get_basename (full_name);
- d(printf ("constructing local folder: full = %s, name = %s\n", full_name, name));
- camel_folder_construct (CAMEL_FOLDER (mlf), CAMEL_STORE (parent_store), full_name, name);
- g_free (name);
-
- mlf->real_path = g_strdup (((CamelFolder *) mlf)->full_name);
-
- metapath = g_strdup_printf ("%s/%s/local-metadata.xml", ((CamelService *) parent_store)->url->path, full_name);
- mlf->meta = load_metainfo (metapath);
- g_free (metapath);
+ name = g_basename (full_name);
+ d(printf("constructing local folder: full = %s, name = %s\n", full_name, name));
+
+ camel_folder_construct(CAMEL_FOLDER (mlf), CAMEL_STORE(parent_store), full_name, name);
+
+ mlf->real_path = g_strdup(((CamelFolder *)mlf)->full_name);
+
+ metapath = g_strdup_printf("%s/%s/local-metadata.xml", ((CamelService *)parent_store)->url->path, full_name);
+ mlf->meta = load_metainfo(metapath);
+ g_free(metapath);
+
return mlf;
}
@@ -736,7 +740,7 @@ mail_local_folder_reconfigure (MailLocalFolder *mlf, const char *new_format, int
camel_folder_expunge(fromfolder, ex);
d(printf("delete old mbox ...\n"));
- camel_object_unref(fromfolder);
+ camel_object_unref(CAMEL_OBJECT(fromfolder));
fromfolder = NULL;
camel_store_delete_folder(fromstore, tmpname, ex);
@@ -759,9 +763,9 @@ mail_local_folder_reconfigure (MailLocalFolder *mlf, const char *new_format, int
if (mlf->real_folder == NULL)
mlf_set_folder (mlf, CAMEL_STORE_FOLDER_CREATE, ex);
if (fromfolder)
- camel_object_unref(fromfolder);
+ camel_object_unref((CamelObject *)fromfolder);
if (fromstore)
- camel_object_unref(fromstore);
+ camel_object_unref((CamelObject *)fromstore);
g_free(tmpname);
g_free(mbox);
@@ -794,7 +798,7 @@ mls_get_folder(CamelStore *store, const char *folder_name, guint32 flags, CamelE
return NULL;
if (!mlf_set_folder(folder, flags, ex)) {
- camel_object_unref(folder);
+ camel_object_unref(CAMEL_OBJECT(folder));
return NULL;
}
@@ -802,8 +806,8 @@ mls_get_folder(CamelStore *store, const char *folder_name, guint32 flags, CamelE
if (save_metainfo(folder->meta) == FALSE) {
camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
_("Cannot save folder metainfo to %s: %s"),
- folder->meta->path, g_strerror(errno));
- camel_object_unref(folder);
+ folder->meta->path, strerror(errno));
+ camel_object_unref(CAMEL_OBJECT (folder));
return NULL;
}
}
@@ -832,7 +836,7 @@ mls_delete_folder(CamelStore *store, const char *folder_name, CamelException *ex
if (real_store == NULL) {
g_free(metapath);
free_metainfo(meta);
- camel_object_unref(real_store);
+ camel_object_unref((CamelObject *)real_store);
return;
}
@@ -843,7 +847,7 @@ mls_delete_folder(CamelStore *store, const char *folder_name, CamelException *ex
camel_exception_xfer(ex, &local_ex);
g_free(metapath);
free_metainfo(meta);
- camel_object_unref(real_store);
+ camel_object_unref((CamelObject *)real_store);
return;
}
@@ -854,7 +858,7 @@ mls_delete_folder(CamelStore *store, const char *folder_name, CamelException *ex
if (unlink(metapath) == -1) {
camel_exception_setv(ex, CAMEL_EXCEPTION_SYSTEM,
_("Cannot delete folder metadata %s: %s"),
- metapath, g_strerror(errno));
+ metapath, strerror(errno));
}
g_free(metapath);
@@ -934,7 +938,7 @@ mls_rename_folder(CamelStore *store, const char *old_name, const char *new_name,
reninfo.new = info;
reninfo.old_base = (char *)old_name;
- camel_object_trigger_event(store, "folder_renamed", &reninfo);
+ camel_object_trigger_event((CamelObject *)store, "folder_renamed", &reninfo);
} else {
g_free(newuri);
g_warning("Cannot find existing folder '%s' in table?\n", olduri);
@@ -948,7 +952,7 @@ mls_rename_folder(CamelStore *store, const char *old_name, const char *new_name,
g_free(newname);
g_free(oldname);
- camel_object_unref(real_store);
+ camel_object_unref((CamelObject *)real_store);
free_metainfo(meta);
@@ -1060,7 +1064,7 @@ static void mail_local_store_add_folder(MailLocalStore *mls, const char *uri, co
if (info) {
/* FIXME: should copy info, so we dont get a removed while we're using it? */
- camel_object_trigger_event(mls, "folder_created", info);
+ camel_object_trigger_event((CamelObject *)mls, "folder_created", info);
/* this is just so the folder is opened at least once to setup the folder
counts etc in the display. Joy eh? The result is discarded. */
@@ -1095,7 +1099,7 @@ static void mail_local_store_remove_folder(MailLocalStore *mls, const char *path
LOCAL_STORE_UNLOCK(mls);
if (data.info) {
- camel_object_trigger_event(mls, "folder_deleted", data.info);
+ camel_object_trigger_event((CamelObject *)mls, "folder_deleted", data.info);
g_free(data.info->url);
g_free(data.info->full_name);
@@ -1191,7 +1195,7 @@ local_storage_new_folder_cb (EvolutionStorageListener *storage_listener,
info.unread_message_count = 0;
info.path = (char *)path;
- camel_object_trigger_event(global_local_store, "folder_created", &info);
+ camel_object_trigger_event((CamelObject *)global_local_store, "folder_created", &info);
g_free(info.url);
camel_url_free(url);
}
@@ -1232,19 +1236,18 @@ storage_listener_startup (EvolutionShellClient *shellclient)
corba_local_storage_listener = evolution_storage_listener_corba_objref (
local_storage_listener);
- /* FIXME: is this supposed to be destroy? */
- g_signal_connect(local_storage_listener,
- "destroyed",
- G_CALLBACK (local_storage_destroyed_cb),
- corba_storage);
- g_signal_connect(local_storage_listener,
- "new_folder",
- G_CALLBACK (local_storage_new_folder_cb),
- corba_storage);
- g_signal_connect(local_storage_listener,
- "removed_folder",
- G_CALLBACK (local_storage_removed_folder_cb),
- corba_storage);
+ gtk_signal_connect (GTK_OBJECT (local_storage_listener),
+ "destroyed",
+ GTK_SIGNAL_FUNC (local_storage_destroyed_cb),
+ corba_storage);
+ gtk_signal_connect (GTK_OBJECT (local_storage_listener),
+ "new_folder",
+ GTK_SIGNAL_FUNC (local_storage_new_folder_cb),
+ corba_storage);
+ gtk_signal_connect (GTK_OBJECT (local_storage_listener),
+ "removed_folder",
+ GTK_SIGNAL_FUNC (local_storage_removed_folder_cb),
+ corba_storage);
CORBA_exception_init (&ev);
GNOME_Evolution_Storage_addListener (corba_storage,
@@ -1345,15 +1348,11 @@ static void
reconfigure_folder_reconfigured (struct _mail_msg *mm)
{
struct _reconfigure_msg *m = (struct _reconfigure_msg *)mm;
- GtkWidget *dialog;
/*char *uri;*/
if (camel_exception_is_set (&mm->ex)) {
- dialog = gtk_message_dialog_new (NULL, GTK_DIALOG_MODAL, GTK_MESSAGE_ERROR,
- GTK_BUTTONS_OK, "%s",
- _("If you can no longer open this mailbox, then\n"
- "you may need to repair it manually."));
- gtk_dialog_run (GTK_DIALOG (dialog));
+ gnome_error_dialog (_("If you can no longer open this mailbox, then\n"
+ "you may need to repair it manually."));
}
if (m->done)
@@ -1374,7 +1373,7 @@ reconfigure_folder_free (struct _mail_msg *mm)
}
if (m->folder)
- camel_object_unref (m->folder);
+ camel_object_unref (CAMEL_OBJECT (m->folder));
g_free(m->uri);
g_free (m->newtype);
}
@@ -1387,15 +1386,13 @@ static struct _mail_msg_op reconfigure_folder_op = {
};
static void
-reconfigure_response(GtkDialog *dialog, int button, struct _reconfigure_msg *m)
+reconfigure_clicked (GnomeDialog *dialog, int button, struct _reconfigure_msg *m)
{
- switch(button) {
- case GTK_RESPONSE_OK: {
+ if (button == 0) {
GtkWidget *menu, *item;
-
menu = gtk_option_menu_get_menu(m->optionlist);
item = gtk_menu_get_active(GTK_MENU(menu));
- m->newtype = g_strdup(g_object_get_data ((GObject *)item, "type"));
+ m->newtype = g_strdup(gtk_object_get_data((GtkObject *)item, "type"));
m->index_body = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(m->check_index_body));
gtk_widget_set_sensitive (m->frame, FALSE);
@@ -1403,23 +1400,21 @@ reconfigure_response(GtkDialog *dialog, int button, struct _reconfigure_msg *m)
gtk_widget_set_sensitive (m->cancel, FALSE);
e_thread_put (mail_thread_queued, (EMsg *)m);
- break; }
- case GTK_RESPONSE_CANCEL:
- default:
+ } else {
if (m->done)
m->done(m->uri, NULL, m->done_data);
mail_msg_free ((struct _mail_msg *)m);
- break;
}
-
- gtk_widget_destroy((GtkWidget *)dialog);
+
+ if (button != -1)
+ gnome_dialog_close (dialog);
}
static void
reconfigure_got_folder(char *uri, CamelFolder *folder, void *data)
{
GladeXML *gui;
- GtkDialog *gd;
+ GnomeDialog *gd;
struct _reconfigure_msg *m = data;
char *title;
GList *p;
@@ -1448,8 +1443,8 @@ reconfigure_got_folder(char *uri, CamelFolder *folder, void *data)
return;
}
- gui = glade_xml_new (EVOLUTION_GLADEDIR "/local-config.glade", "dialog_format", NULL);
- gd = (GtkDialog *)glade_xml_get_widget (gui, "dialog_format");
+ gui = glade_xml_new (EVOLUTION_GLADEDIR "/local-config.glade", "dialog_format");
+ gd = (GnomeDialog *)glade_xml_get_widget (gui, "dialog_format");
title = g_strdup_printf (_("Reconfigure /%s"),
camel_folder_get_full_name (folder));
@@ -1465,34 +1460,34 @@ reconfigure_got_folder(char *uri, CamelFolder *folder, void *data)
m->newtype = NULL;
m->folder = folder;
camel_object_ref(folder);
-
+
/* dynamically create the folder type list from camel */
/* we assume the list is static and never freed */
currentformat = MAIL_LOCAL_FOLDER (folder)->meta->format;
- p = camel_session_list_providers (session, TRUE);
- menu = gtk_menu_new ();
+ p = camel_session_list_providers(session, TRUE);
+ menu = gtk_menu_new();
while (p) {
CamelProvider *cp = p->data;
-
+
/* we only want local providers */
if (cp->flags & CAMEL_PROVIDER_IS_LOCAL) {
GtkWidget *item;
char *label;
-
- if (!strcmp (cp->protocol, currentformat))
+
+ if (strcmp(cp->protocol, currentformat) == 0)
history = index;
-
+
label = g_strdup_printf("%s (%s)", cp->protocol, _(cp->name));
- item = gtk_menu_item_new_with_label (label);
- g_free (label);
- g_object_set_data ((GObject *) item, "type", cp->protocol);
- gtk_widget_show (item);
- gtk_menu_shell_append (GTK_MENU_SHELL (menu), item);
+ item = gtk_menu_item_new_with_label(label);
+ g_free(label);
+ gtk_object_set_data((GtkObject *)item, "type", cp->protocol);
+ gtk_widget_show(item);
+ gtk_menu_append(GTK_MENU(menu), item);
index++;
}
p = p->next;
}
- gtk_option_menu_remove_menu (GTK_OPTION_MENU (m->optionlist));
+ gtk_option_menu_remove_menu (GTK_OPTION_MENU(m->optionlist));
gtk_option_menu_set_menu (GTK_OPTION_MENU(m->optionlist), menu);
gtk_option_menu_set_history(GTK_OPTION_MENU(m->optionlist), history);
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(m->check_index_body), MAIL_LOCAL_FOLDER (folder)->meta->indexed);
@@ -1500,8 +1495,8 @@ reconfigure_got_folder(char *uri, CamelFolder *folder, void *data)
gtk_label_set_text ((GtkLabel *)glade_xml_get_widget (gui, "label_format"),
MAIL_LOCAL_FOLDER (folder)->meta->format);
- g_signal_connect(gd, "response", G_CALLBACK(reconfigure_response), m);
- g_object_unref(gui);
+ gtk_signal_connect (GTK_OBJECT (gd), "clicked", reconfigure_clicked, m);
+ gtk_object_unref (GTK_OBJECT (gui));
g_hash_table_insert (reconfigure_folder_hash, (gpointer) folder, (gpointer) gd);
@@ -1514,7 +1509,7 @@ mail_local_reconfigure_folder(const char *uri, void (*done)(const char *uri, Cam
struct _reconfigure_msg *m;
if (strncmp(uri, "file:", 5) != 0) {
- e_notice (NULL, GTK_MESSAGE_WARNING,
+ e_notice (NULL, GNOME_MESSAGE_BOX_WARNING,
_("You cannot change the format of a non-local folder."));
if (done)
done(uri, NULL, done_data);
diff --git a/mail/mail-preferences.c b/mail/mail-preferences.c
index 7fc9f19e6e..2046859174 100644
--- a/mail/mail-preferences.c
+++ b/mail/mail-preferences.c
@@ -25,14 +25,13 @@
#include <config.h>
#endif
-#include <string.h>
-
#include "mail-preferences.h"
-#include <gconf/gconf.h>
-#include <gal/util/e-iconv.h>
+#include <gal/widgets/e-unicode.h>
+#include <gal/util/e-unicode-i18n.h>
#include <gtkhtml/gtkhtml-properties.h>
#include "widgets/misc/e-charset-picker.h"
+
#include <bonobo/bonobo-generic-factory.h>
#include "mail-config.h"
@@ -40,7 +39,7 @@
static void mail_preferences_class_init (MailPreferencesClass *class);
static void mail_preferences_init (MailPreferences *dialog);
-static void mail_preferences_finalise (GObject *obj);
+static void mail_preferences_finalise (GtkObject *obj);
static GtkVBoxClass *parent_class = NULL;
@@ -48,20 +47,20 @@ static GtkVBoxClass *parent_class = NULL;
GtkType
mail_preferences_get_type (void)
{
- static GType type = 0;
+ static GtkType type = 0;
if (!type) {
- GTypeInfo type_info = {
- sizeof (MailPreferencesClass),
- NULL, NULL,
- (GClassInitFunc) mail_preferences_class_init,
- NULL, NULL,
+ GtkTypeInfo type_info = {
+ "MailPreferences",
sizeof (MailPreferences),
- 0,
- (GInstanceInitFunc) mail_preferences_init,
+ sizeof (MailPreferencesClass),
+ (GtkClassInitFunc) mail_preferences_class_init,
+ (GtkObjectInitFunc) mail_preferences_init,
+ (GtkArgSetFunc) NULL,
+ (GtkArgGetFunc) NULL
};
- type = g_type_register_static (gtk_vbox_get_type (), "MailPreferences", &type_info, 0);
+ type = gtk_type_unique (gtk_vbox_get_type (), &type_info);
}
return type;
@@ -70,12 +69,14 @@ mail_preferences_get_type (void)
static void
mail_preferences_class_init (MailPreferencesClass *klass)
{
- GObjectClass *object_class;
+ GtkObjectClass *object_class;
- object_class = (GObjectClass *) klass;
- parent_class = g_type_class_ref (gtk_vbox_get_type ());
+ object_class = (GtkObjectClass *) klass;
+ parent_class = gtk_type_class (gtk_vbox_get_type ());
object_class->finalize = mail_preferences_finalise;
+ /* override methods */
+
}
static void
@@ -85,27 +86,21 @@ mail_preferences_init (MailPreferences *preferences)
}
static void
-mail_preferences_finalise (GObject *obj)
+mail_preferences_finalise (GtkObject *obj)
{
MailPreferences *prefs = (MailPreferences *) obj;
- g_object_unref (prefs->gui);
- g_object_unref (prefs->pman);
- g_object_unref (prefs->gconf);
+ gtk_object_unref (GTK_OBJECT (prefs->gui));
+ gtk_object_unref (GTK_OBJECT (prefs->pman));
+ gtk_object_unref (GTK_OBJECT (prefs->gconf));
- ((GObjectClass *)(parent_class))->finalize (obj);
+ ((GtkObjectClass *)(parent_class))->finalize (obj);
}
static void
-colorpicker_set_color (GnomeColorPicker *color, const char *str)
+colorpicker_set_color (GnomeColorPicker *color, guint32 rgb)
{
- GdkColor colour;
- guint32 rgb;
-
- gdk_color_parse (str, &colour);
- rgb = ((colour.red & 0xff00) << 8) | (colour.green & 0xff00) | ((colour.blue & 0xff00) >> 8);
-
gnome_color_picker_set_i8 (color, (rgb & 0xff0000) >> 16, (rgb & 0xff00) >> 8, rgb & 0xff, 0xff);
}
@@ -127,7 +122,16 @@ colorpicker_get_color (GnomeColorPicker *color)
}
static void
-settings_changed (GtkWidget *widget, gpointer user_data)
+toggle_button_toggled (GtkWidget *widget, gpointer user_data)
+{
+ MailPreferences *prefs = (MailPreferences *) user_data;
+
+ if (prefs->control)
+ evolution_config_control_changed (prefs->control);
+}
+
+static void
+entry_changed (GtkWidget *widget, gpointer user_data)
{
MailPreferences *prefs = (MailPreferences *) user_data;
@@ -151,8 +155,8 @@ restore_labels_clicked (GtkWidget *widget, gpointer user_data)
int i;
for (i = 0; i < 5; i++) {
- gtk_entry_set_text (prefs->labels[i].name, _(label_defaults[i].name));
- colorpicker_set_color (prefs->labels[i].color, label_defaults[i].colour);
+ e_utf8_gtk_entry_set_text (prefs->labels[i].name, U_(label_defaults[i].name));
+ colorpicker_set_color (prefs->labels[i].color, label_defaults[i].color);
}
}
@@ -176,7 +180,8 @@ option_menu_connect (GtkOptionMenu *omenu, gpointer user_data)
items = GTK_MENU_SHELL (menu)->children;
while (items) {
item = items->data;
- g_signal_connect (item, "activate", G_CALLBACK (menu_changed), user_data);
+ gtk_signal_connect (GTK_OBJECT (item), "activate",
+ menu_changed, user_data);
items = items->next;
}
}
@@ -186,18 +191,15 @@ mail_preferences_construct (MailPreferences *prefs)
{
GtkWidget *widget, *toplevel, *menu;
const char *text;
- GSList *list, *l;
GladeXML *gui;
- gboolean bool;
- int i, val;
- char *buf;
+ int i;
char *names[][2] = {
{ "anim_check", "chkShowAnimatedImages" },
{ "magic_links_check", "chkAutoDetectLinks" },
{ NULL, NULL }
};
- gui = glade_xml_new (EVOLUTION_GLADEDIR "/mail-config.glade", "preferences_tab", NULL);
+ gui = glade_xml_new (EVOLUTION_GLADEDIR "/mail-config.glade", "preferences_tab");
prefs->gui = gui;
/* get our toplevel widget */
@@ -213,128 +215,122 @@ mail_preferences_construct (MailPreferences *prefs)
/* Message Display */
prefs->timeout_toggle = GTK_TOGGLE_BUTTON (glade_xml_get_widget (gui, "chkMarkTimeout"));
- bool = gconf_client_get_bool (prefs->gconf, "/apps/evolution/mail/display/mark_seen", NULL);
- gtk_toggle_button_set_active (prefs->timeout_toggle, bool);
- g_signal_connect (prefs->timeout_toggle, "toggled", G_CALLBACK (settings_changed), prefs);
+ gtk_toggle_button_set_active (prefs->timeout_toggle, mail_config_get_do_seen_timeout ());
+ gtk_signal_connect (GTK_OBJECT (prefs->timeout_toggle), "toggled",
+ toggle_button_toggled, prefs);
prefs->timeout = GTK_SPIN_BUTTON (glade_xml_get_widget (gui, "spinMarkTimeout"));
- val = gconf_client_get_int (prefs->gconf, "/apps/evolution/mail/display/mark_seen_timeout", NULL);
- gtk_spin_button_set_value (prefs->timeout, (1.0 * val) / 1000.0);
- g_signal_connect (prefs->timeout, "changed", G_CALLBACK (settings_changed), prefs);
+ gtk_spin_button_set_value (prefs->timeout, (1.0 * mail_config_get_mark_as_seen_timeout ()) / 1000.0);
+ gtk_signal_connect (GTK_OBJECT (prefs->timeout), "changed",
+ entry_changed, prefs);
prefs->charset = GTK_OPTION_MENU (glade_xml_get_widget (gui, "omenuCharset"));
- buf = gconf_client_get_string (prefs->gconf, "/apps/evolution/mail/format/charset", NULL);
- menu = e_charset_picker_new (buf ? buf : e_iconv_locale_charset ());
+ menu = e_charset_picker_new (mail_config_get_default_charset ());
gtk_option_menu_set_menu (prefs->charset, GTK_WIDGET (menu));
option_menu_connect (prefs->charset, prefs);
- g_free (buf);
prefs->citation_highlight = GTK_TOGGLE_BUTTON (glade_xml_get_widget (gui, "chkHighlightCitations"));
- bool = gconf_client_get_bool (prefs->gconf, "/apps/evolution/mail/display/mark_citations", NULL);
- gtk_toggle_button_set_active (prefs->citation_highlight, bool);
- g_signal_connect (prefs->citation_highlight, "toggled", G_CALLBACK (settings_changed), prefs);
+ gtk_toggle_button_set_active (prefs->citation_highlight, mail_config_get_citation_highlight ());
+ gtk_signal_connect (GTK_OBJECT (prefs->citation_highlight), "toggled",
+ toggle_button_toggled, prefs);
prefs->citation_color = GNOME_COLOR_PICKER (glade_xml_get_widget (gui, "colorpickerHighlightCitations"));
- buf = gconf_client_get_string (prefs->gconf, "/apps/evolution/mail/display/citation_colour", NULL);
- colorpicker_set_color (prefs->citation_color, buf ? buf : "#737373");
- g_signal_connect (prefs->citation_color, "color-set", G_CALLBACK (color_set), prefs);
- g_free (buf);
+ colorpicker_set_color (prefs->citation_color, mail_config_get_citation_color ());
+ gtk_signal_connect (GTK_OBJECT (prefs->citation_color), "color-set",
+ color_set, prefs);
/* Deleting Mail */
prefs->empty_trash = GTK_TOGGLE_BUTTON (glade_xml_get_widget (gui, "chkEmptyTrashOnExit"));
- bool = gconf_client_get_bool (prefs->gconf, "/apps/evolution/mail/trash/empty_on_exit", NULL);
- gtk_toggle_button_set_active (prefs->empty_trash, bool);
- g_signal_connect (prefs->empty_trash, "toggled", G_CALLBACK (settings_changed), prefs);
+ gtk_toggle_button_set_active (prefs->empty_trash, mail_config_get_empty_trash_on_exit ());
+ gtk_signal_connect (GTK_OBJECT (prefs->empty_trash), "toggled",
+ toggle_button_toggled, prefs);
prefs->confirm_expunge = GTK_TOGGLE_BUTTON (glade_xml_get_widget (gui, "chkConfirmExpunge"));
- bool = gconf_client_get_bool (prefs->gconf, "/apps/evolution/mail/prompts/expunge", NULL);
- gtk_toggle_button_set_active (prefs->confirm_expunge, bool);
- g_signal_connect (prefs->confirm_expunge, "toggled", G_CALLBACK (settings_changed), prefs);
+ gtk_toggle_button_set_active (prefs->confirm_expunge, mail_config_get_confirm_expunge ());
+ gtk_signal_connect (GTK_OBJECT (prefs->confirm_expunge), "toggled",
+ toggle_button_toggled, prefs);
/* New Mail Notification */
- val = gconf_client_get_int (prefs->gconf, "/apps/evolution/mail/notify/type", NULL);
prefs->notify_not = GTK_TOGGLE_BUTTON (glade_xml_get_widget (gui, "radNotifyNot"));
- gtk_toggle_button_set_active (prefs->notify_not, val == MAIL_CONFIG_NOTIFY_NOT);
- g_signal_connect (prefs->notify_not, "toggled", G_CALLBACK (settings_changed), prefs);
+ gtk_toggle_button_set_active (prefs->notify_not, mail_config_get_new_mail_notify () == MAIL_CONFIG_NOTIFY_NOT);
+ gtk_signal_connect (GTK_OBJECT (prefs->notify_not), "toggled",
+ toggle_button_toggled, prefs);
prefs->notify_beep = GTK_TOGGLE_BUTTON (glade_xml_get_widget (gui, "radNotifyBeep"));
- gtk_toggle_button_set_active (prefs->notify_beep, val == MAIL_CONFIG_NOTIFY_BEEP);
- g_signal_connect (prefs->notify_beep, "toggled", G_CALLBACK (settings_changed), prefs);
+ gtk_toggle_button_set_active (prefs->notify_beep, mail_config_get_new_mail_notify () == MAIL_CONFIG_NOTIFY_BEEP);
+ gtk_signal_connect (GTK_OBJECT (prefs->notify_beep), "toggled",
+ toggle_button_toggled, prefs);
prefs->notify_play_sound = GTK_TOGGLE_BUTTON (glade_xml_get_widget (gui, "radNotifyPlaySound"));
- gtk_toggle_button_set_active (prefs->notify_play_sound, val == MAIL_CONFIG_NOTIFY_PLAY_SOUND);
- g_signal_connect (prefs->notify_play_sound, "toggled", G_CALLBACK (settings_changed), prefs);
+ gtk_toggle_button_set_active (prefs->notify_play_sound,
+ mail_config_get_new_mail_notify () == MAIL_CONFIG_NOTIFY_PLAY_SOUND);
+ gtk_signal_connect (GTK_OBJECT (prefs->notify_play_sound), "toggled",
+ toggle_button_toggled, prefs);
prefs->notify_sound_file = GNOME_FILE_ENTRY (glade_xml_get_widget (gui, "fileNotifyPlaySound"));
- buf = gconf_client_get_string (prefs->gconf, "/apps/evolution/mail/notify/sound", NULL);
- gtk_entry_set_text (GTK_ENTRY (gnome_file_entry_gtk_entry (prefs->notify_sound_file)), buf ? buf : "");
- g_signal_connect (gnome_file_entry_gtk_entry (prefs->notify_sound_file), "changed",
- G_CALLBACK (settings_changed), prefs);
- g_free (buf);
+ text = mail_config_get_new_mail_notify_sound_file ();
+ gtk_entry_set_text (GTK_ENTRY (gnome_file_entry_gtk_entry (prefs->notify_sound_file)),
+ text ? text : "");
+ gtk_signal_connect (GTK_OBJECT (gnome_file_entry_gtk_entry (prefs->notify_sound_file)), "changed",
+ entry_changed, prefs);
/* HTML Mail tab */
/* Loading Images */
- val = gconf_client_get_int (prefs->gconf, "/apps/evolution/mail/display/load_http_images", NULL);
prefs->images_never = GTK_TOGGLE_BUTTON (glade_xml_get_widget (gui, "radImagesNever"));
- gtk_toggle_button_set_active (prefs->images_never, val == MAIL_CONFIG_HTTP_NEVER);
- g_signal_connect (prefs->images_never, "toggled", G_CALLBACK (settings_changed), prefs);
+ gtk_toggle_button_set_active (prefs->images_never, mail_config_get_http_mode () == MAIL_CONFIG_HTTP_NEVER);
+ gtk_signal_connect (GTK_OBJECT (prefs->images_never), "toggled",
+ toggle_button_toggled, prefs);
prefs->images_sometimes = GTK_TOGGLE_BUTTON (glade_xml_get_widget (gui, "radImagesSometimes"));
- gtk_toggle_button_set_active (prefs->images_sometimes, val == MAIL_CONFIG_HTTP_SOMETIMES);
- g_signal_connect (prefs->images_sometimes, "toggled", G_CALLBACK (settings_changed), prefs);
+ gtk_toggle_button_set_active (prefs->images_sometimes, mail_config_get_http_mode () == MAIL_CONFIG_HTTP_SOMETIMES);
+ gtk_signal_connect (GTK_OBJECT (prefs->images_sometimes), "toggled",
+ toggle_button_toggled, prefs);
prefs->images_always = GTK_TOGGLE_BUTTON (glade_xml_get_widget (gui, "radImagesAlways"));
- gtk_toggle_button_set_active (prefs->images_always, val == MAIL_CONFIG_HTTP_ALWAYS);
- g_signal_connect (prefs->images_always, "toggled", G_CALLBACK (settings_changed), prefs);
+ gtk_toggle_button_set_active (prefs->images_always, mail_config_get_http_mode () == MAIL_CONFIG_HTTP_ALWAYS);
+ gtk_signal_connect (GTK_OBJECT (prefs->images_always), "toggled",
+ toggle_button_toggled, prefs);
-#warning "gtkhtml prop manager"
-#if 0
prefs->pman = GTK_HTML_PROPMANAGER (gtk_html_propmanager_new (prefs->gconf));
- g_signal_connect (prefs->pman, "changed", G_CALLBACK (settings_changed), prefs);
- g_object_ref (prefs->pman);
+ gtk_signal_connect (GTK_OBJECT (prefs->pman), "changed", toggle_button_toggled, prefs);
+ gtk_object_ref (GTK_OBJECT (prefs->pman));
gtk_html_propmanager_set_names (prefs->pman, names);
gtk_html_propmanager_set_gui (prefs->pman, gui, NULL);
for (i = 0; names[i][0] != NULL; i++) {
widget = glade_xml_get_widget (gui, names[i][1]);
- g_signal_connect (widget, "toggled", G_CALLBACK (settings_changed), prefs);
+ gtk_signal_connect (GTK_OBJECT (widget), "toggled",
+ toggle_button_toggled, prefs);
}
-#endif
prefs->prompt_unwanted_html = GTK_TOGGLE_BUTTON (glade_xml_get_widget (gui, "chkPromptWantHTML"));
- bool = gconf_client_get_bool (prefs->gconf, "/apps/evolution/mail/prompts/unwanted_html", NULL);
- gtk_toggle_button_set_active (prefs->prompt_unwanted_html, bool);
- g_signal_connect (prefs->prompt_unwanted_html, "toggled", G_CALLBACK (settings_changed), prefs);
-
- i = 0;
- list = mail_config_get_labels ();
- while (list != NULL && i < 5) {
- MailConfigLabel *label;
+ gtk_toggle_button_set_active (prefs->prompt_unwanted_html, mail_config_get_confirm_unwanted_html ());
+ gtk_signal_connect (GTK_OBJECT (prefs->prompt_unwanted_html), "toggled",
+ toggle_button_toggled, prefs);
+
+ /* Labels and Colours tab */
+ for (i = 0; i < 5; i++) {
char *widget_name;
- label = list->data;
-
widget_name = g_strdup_printf ("txtLabel%d", i);
prefs->labels[i].name = GTK_ENTRY (glade_xml_get_widget (gui, widget_name));
g_free (widget_name);
+ text = mail_config_get_label_name (i);
+ e_utf8_gtk_entry_set_text (prefs->labels[i].name, text ? text : "");
+ gtk_signal_connect (GTK_OBJECT (prefs->labels[i].name), "changed",
+ entry_changed, prefs);
widget_name = g_strdup_printf ("colorLabel%d", i);
prefs->labels[i].color = GNOME_COLOR_PICKER (glade_xml_get_widget (gui, widget_name));
g_free (widget_name);
-
- gtk_entry_set_text (prefs->labels[i].name, label->name);
- g_signal_connect (prefs->labels[i].name, "changed", G_CALLBACK (settings_changed), prefs);
-
- colorpicker_set_color (prefs->labels[i].color, label->colour);
- g_signal_connect (prefs->labels[i].color, "color_set", G_CALLBACK (color_set), prefs);
-
- i++;
- list = list->next;
+ colorpicker_set_color (prefs->labels[i].color, mail_config_get_label_color (i));
+ gtk_signal_connect (GTK_OBJECT (prefs->labels[i].color), "color_set",
+ color_set, prefs);
}
-
prefs->restore_labels = GTK_BUTTON (glade_xml_get_widget (gui, "cmdRestoreLabels"));
- g_signal_connect (prefs->restore_labels, "clicked", G_CALLBACK (restore_labels_clicked), prefs);
+ gtk_signal_connect (GTK_OBJECT (prefs->restore_labels), "clicked",
+ restore_labels_clicked, prefs);
}
@@ -343,7 +339,7 @@ mail_preferences_new (void)
{
MailPreferences *new;
- new = (MailPreferences *) g_object_new (mail_preferences_get_type (), NULL);
+ new = (MailPreferences *) gtk_type_new (mail_preferences_get_type ());
mail_preferences_construct (new);
return (GtkWidget *) new;
@@ -354,91 +350,70 @@ void
mail_preferences_apply (MailPreferences *prefs)
{
GtkWidget *entry, *menu;
- char *string, buf[20];
- const char *cstring;
- GSList *list, *l;
+ char *string;
guint32 rgb;
int i, val;
/* General tab */
/* Message Display */
- gconf_client_set_bool (prefs->gconf, "/apps/evolution/mail/display/mark_seen",
- gtk_toggle_button_get_active (prefs->timeout_toggle), NULL);
+ mail_config_set_do_seen_timeout (gtk_toggle_button_get_active (prefs->timeout_toggle));
- val = (int) (gtk_spin_button_get_value (prefs->timeout) * 1000.0);
- gconf_client_set_int (prefs->gconf, "/apps/evolution/mail/display/mark_seen_timeout", val, NULL);
+ val = (int) (gtk_spin_button_get_value_as_float (prefs->timeout) * 1000);
+ mail_config_set_mark_as_seen_timeout (val);
menu = gtk_option_menu_get_menu (prefs->charset);
- if (!(string = e_charset_picker_get_charset (menu)))
- string = g_strdup (e_iconv_locale_charset ());
-
- gconf_client_set_string (prefs->gconf, "/apps/evolution/mail/format/charset", string, NULL);
- g_free (string);
+ string = e_charset_picker_get_charset (menu);
+ if (string) {
+ mail_config_set_default_charset (string);
+ g_free (string);
+ }
- gconf_client_set_bool (prefs->gconf, "/apps/evolution/mail/display/mark_citations",
- gtk_toggle_button_get_active (prefs->citation_highlight), NULL);
+ mail_config_set_citation_highlight (gtk_toggle_button_get_active (prefs->citation_highlight));
rgb = colorpicker_get_color (prefs->citation_color);
- sprintf (buf,"#%06x", rgb & 0xffffff);
- gconf_client_set_string (prefs->gconf, "/apps/evolution/mail/display/citation_colour", buf, NULL);
+ mail_config_set_citation_color (rgb);
/* Deleting Mail */
- gconf_client_set_bool (prefs->gconf, "/apps/evolution/mail/trash/empty_on_exit",
- gtk_toggle_button_get_active (prefs->empty_trash), NULL);
+ mail_config_set_empty_trash_on_exit (gtk_toggle_button_get_active (prefs->empty_trash));
- gconf_client_set_bool (prefs->gconf, "/apps/evolution/mail/prompts/expunge",
- gtk_toggle_button_get_active (prefs->confirm_expunge), NULL);
+ mail_config_set_confirm_expunge (gtk_toggle_button_get_active (prefs->confirm_expunge));
/* New Mail Notification */
if (gtk_toggle_button_get_active (prefs->notify_not))
- val = MAIL_CONFIG_NOTIFY_NOT;
+ mail_config_set_new_mail_notify (MAIL_CONFIG_NOTIFY_NOT);
else if (gtk_toggle_button_get_active (prefs->notify_beep))
- val = MAIL_CONFIG_NOTIFY_BEEP;
+ mail_config_set_new_mail_notify (MAIL_CONFIG_NOTIFY_BEEP);
else
- val = MAIL_CONFIG_NOTIFY_PLAY_SOUND;
-
- gconf_client_set_int (prefs->gconf, "/apps/evolution/mail/notify/type", val, NULL);
+ mail_config_set_new_mail_notify (MAIL_CONFIG_NOTIFY_PLAY_SOUND);
entry = gnome_file_entry_gtk_entry (GNOME_FILE_ENTRY (prefs->notify_sound_file));
- cstring = gtk_entry_get_text (GTK_ENTRY (entry));
- gconf_client_set_string (prefs->gconf, "/apps/evolution/mail/notify/sound", cstring, NULL);
+ string = gtk_entry_get_text (GTK_ENTRY (entry));
+ mail_config_set_new_mail_notify_sound_file (string);
/* HTML Mail */
if (gtk_toggle_button_get_active (prefs->images_always))
- val = MAIL_CONFIG_HTTP_ALWAYS;
+ mail_config_set_http_mode (MAIL_CONFIG_HTTP_ALWAYS);
else if (gtk_toggle_button_get_active (prefs->images_sometimes))
- val = MAIL_CONFIG_HTTP_SOMETIMES;
+ mail_config_set_http_mode (MAIL_CONFIG_HTTP_SOMETIMES);
else
- val = MAIL_CONFIG_HTTP_NEVER;
-
- gconf_client_set_int (prefs->gconf, "/apps/evolution/mail/display/load_http_images", val, NULL);
+ mail_config_set_http_mode (MAIL_CONFIG_HTTP_NEVER);
-#warning "gtkhtml propmanager"
-#if 0
gtk_html_propmanager_apply (prefs->pman);
-#endif
- gconf_client_set_bool (prefs->gconf, "/apps/evolution/mail/prompts/unwanted_html",
- gtk_toggle_button_get_active (prefs->prompt_unwanted_html), NULL);
+ mail_config_set_confirm_unwanted_html (gtk_toggle_button_get_active (prefs->prompt_unwanted_html));
/* Labels and Colours */
- list = NULL;
- for (i = 4; i >= 0; i--) {
- cstring = gtk_entry_get_text (prefs->labels[i].name);
+ for (i = 0; i < 5; i++) {
+ /* save the label... */
+ string = e_utf8_gtk_entry_get_text (prefs->labels[i].name);
+ mail_config_set_label_name (i, string);
+ g_free (string);
+
+ /* save the colour... */
rgb = colorpicker_get_color (prefs->labels[i].color);
- string = g_strdup_printf ("%s:#%06x", cstring, rgb & 0xffffff);
- list = g_slist_prepend (list, string);
- }
-
- gconf_client_set_list (prefs->gconf, "/apps/evolution/mail/labels", GCONF_VALUE_STRING, list, NULL);
-
- l = list;
- while (l != NULL) {
- g_free (l->data);
- l = l->next;
+ mail_config_set_label_color (i, rgb);
}
- g_slist_free (list);
- gconf_client_suggest_sync (prefs->gconf, NULL);
+ mail_config_write ();
}
diff --git a/mail/mail-session.c b/mail/mail-session.c
index c898bff2e4..ff749d90e0 100644
--- a/mail/mail-session.c
+++ b/mail/mail-session.c
@@ -25,16 +25,15 @@
#endif
#include <stdlib.h>
-#include <string.h>
-
-#include <gtk/gtkdialog.h>
-#include <gtk/gtkstock.h>
-
-#include <gconf/gconf.h>
-#include <gconf/gconf-client.h>
-
+#include <libgnome/gnome-defs.h>
#include <libgnome/gnome-config.h>
#include <libgnome/gnome-sound.h>
+#include <libgnomeui/gnome-dialog.h>
+#include <libgnomeui/gnome-dialog-util.h>
+#include <libgnomeui/gnome-messagebox.h>
+#include <libgnomeui/gnome-stock.h>
+
+#include <gal/widgets/e-unicode.h>
#include "camel/camel-filter-driver.h"
#include "filter/filter-context.h"
@@ -80,7 +79,7 @@ typedef struct _MailSessionClass {
} MailSessionClass;
-static char *get_password(CamelSession *session, const char *prompt, gboolean reprompt, gboolean secret, CamelService *service, const char *item, CamelException *ex);
+static char *get_password(CamelSession *session, const char *prompt, gboolean secret, CamelService *service, const char *item, CamelException *ex);
static void forget_password(CamelSession *session, CamelService *service, const char *item, CamelException *ex);
static gboolean alert_user(CamelSession *session, CamelSessionAlertType type, const char *prompt, gboolean cancel);
static guint register_timeout(CamelSession *session, guint32 interval, CamelTimeoutCallback cb, gpointer camel_data);
@@ -151,26 +150,24 @@ make_key (CamelService *service, const char *item)
/* ********************************************************************** */
-static GtkDialog *password_dialog = NULL;
+static GnomeDialog *password_dialogue = NULL;
static EDList password_list = E_DLIST_INITIALISER(password_list);
+static int password_destroy_id;
struct _pass_msg {
struct _mail_msg msg;
-
+
CamelSession *session;
const char *prompt;
- gboolean reprompt;
gboolean secret;
CamelService *service;
const char *item;
CamelException *ex;
-
+
char *service_url;
char *key;
-
- EAccountService *config_service;
+
GtkWidget *check;
- GtkWidget *entry;
char *result;
int ismain;
};
@@ -178,28 +175,29 @@ struct _pass_msg {
static void do_get_pass(struct _mail_msg *mm);
static void
-pass_activate (GtkEntry *entry, void *data)
-{
- if (password_dialog)
- gtk_dialog_response (password_dialog, GTK_RESPONSE_OK);
-}
-
-static void
-pass_response (GtkDialog *dialog, int button, void *data)
+pass_got (char *string, void *data)
{
struct _pass_msg *m = data;
- switch (button) {
- case GTK_RESPONSE_OK:
- {
+ if (string) {
+ MailConfigService *service = NULL;
+ const MailConfigAccount *mca;
gboolean cache, remember;
- m->result = g_strdup (gtk_entry_get_text ((GtkEntry *) m->entry));
- remember = cache = m->check ? gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (m->check)) : FALSE;
-
+ m->result = g_strdup (string);
+ remember = cache = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (m->check));
if (m->service_url) {
- if (m->config_service) {
- mail_config_service_set_save_passwd (m->config_service, cache);
+ mca = mail_config_get_account_by_source_url (m->service_url);
+ if (mca) {
+ service = mca->source;
+ } else {
+ mca = mail_config_get_account_by_transport_url (m->service_url);
+ if (mca)
+ service = mca->transport;
+ }
+
+ if (service) {
+ mail_config_service_set_save_passwd (service, cache);
/* set `cache' to TRUE because people don't want to have to
re-enter their passwords for this session even if they told
@@ -217,80 +215,128 @@ pass_response (GtkDialog *dialog, int button, void *data)
/* should we remember it between sessions? */
if (remember)
- e_passwords_remember_password ("Mail", m->key);
+ e_passwords_remember_password (m->key);
}
- break;
+ } else {
+ camel_exception_set(m->ex, CAMEL_EXCEPTION_USER_CANCEL, _("User canceled operation."));
}
- default:
- camel_exception_set (m->ex, CAMEL_EXCEPTION_USER_CANCEL, _("User canceled operation."));
- break;
+
+ if (password_destroy_id) {
+ gtk_signal_disconnect((GtkObject *)password_dialogue, password_destroy_id);
+ password_destroy_id = 0;
}
-
- gtk_widget_destroy ((GtkWidget *) dialog);
-
- password_dialog = NULL;
- e_msgport_reply ((EMsg *)m);
-
- if ((m = (struct _pass_msg *) e_dlist_remhead (&password_list)))
- do_get_pass ((struct _mail_msg *) m);
+
+ password_dialogue = NULL;
+ e_msgport_reply((EMsg *)m);
+
+ if ((m = (struct _pass_msg *)e_dlist_remhead(&password_list)))
+ do_get_pass((struct _mail_msg *)m);
}
static void
-request_password (struct _pass_msg *m)
+request_password_deleted(GtkWidget *w, struct _pass_msg *m)
{
- EAccount *mca = NULL;
+ password_destroy_id = 0;
+ pass_got(NULL, m);
+}
+
+static void
+request_password(struct _pass_msg *m)
+{
+ const MailConfigAccount *mca = NULL;
+ GtkWidget *dialogue;
+ GtkWidget *check, *check_label, *entry;
+ GList *children, *iter;
+ gboolean show;
char *title;
-
- /* If we already have a password_dialog up, save this request till later */
- if (!m->ismain && password_dialog) {
- e_dlist_addtail (&password_list, (EDListNode *)m);
+ unsigned int accel_key;
+
+ /* If we already have a password_dialogue up, save this request till later */
+ if (!m->ismain && password_dialogue) {
+ e_dlist_addtail(&password_list, (EDListNode *)m);
return;
}
+
+ /* FIXME: Remove this total snot */
+
+ /* assume we can use any widget to translate string for display */
+ check_label = gtk_label_new ("");
+ password_dialogue = (GnomeDialog *)dialogue = gnome_request_dialog (m->secret, m->prompt, NULL, 0, pass_got, m, NULL);
+ password_destroy_id = gtk_signal_connect((GtkObject *)dialogue, "destroy", request_password_deleted, m);
+
+ check = gtk_check_button_new ();
+ gtk_misc_set_alignment (GTK_MISC (check_label), 0.0, 0.5);
+ accel_key = gtk_label_parse_uline (GTK_LABEL (check_label),
+ m->service_url ? _("_Remember this password") :
+ _("_Remember this password for the remainder of this session"));
+ gtk_widget_add_accelerator (check, "clicked",
+ GNOME_DIALOG (password_dialogue)->accelerators,
+ accel_key,
+ GDK_MOD1_MASK, 0);
+ gtk_container_add (GTK_CONTAINER (check), check_label);
+
+ show = TRUE;
if (m->service_url) {
- if ((mca = mail_config_get_account_by_source_url (m->service_url)))
- m->config_service = mca->source;
- else if ((mca = mail_config_get_account_by_transport_url (m->service_url)))
- m->config_service = mca->transport;
+ mca = mail_config_get_account_by_source_url(m->service_url);
+ if (mca)
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (check), mca->source->save_passwd);
+ else {
+ mca = mail_config_get_account_by_transport_url (m->service_url);
+ if (mca)
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (check), mca->transport->save_passwd);
+ else {
+ d(printf ("Cannot figure out which account owns URL \"%s\"\n", m->service_url));
+ show = FALSE;
+ }
+ }
}
- if (mca)
- title = g_strdup_printf (_("Enter Password for %s"), mca->name);
- else
- title = g_strdup (_("Enter Password"));
+ if (show)
+ gtk_widget_show_all (check);
+
+ /* do some dirty stuff to put the checkbutton after the entry */
+ entry = NULL;
+ children = gtk_container_children (GTK_CONTAINER (GNOME_DIALOG (dialogue)->vbox));
+ for (iter = children; iter; iter = iter->next) {
+ if (GTK_IS_ENTRY (iter->data)) {
+ entry = GTK_WIDGET (iter->data);
+ break;
+ }
+ }
+ g_list_free (children);
- password_dialog = (GtkDialog *) gtk_message_dialog_new (NULL, 0, GTK_MESSAGE_QUESTION,
- GTK_BUTTONS_OK_CANCEL, "%s", m->prompt);
- gtk_window_set_title (GTK_WINDOW (password_dialog), title);
- g_free (title);
+ if (entry) {
+ gtk_object_ref (GTK_OBJECT (entry));
+ gtk_container_remove (GTK_CONTAINER (GNOME_DIALOG (dialogue)->vbox), entry);
+ }
- m->entry = gtk_entry_new ();
- gtk_entry_set_visibility ((GtkEntry *) m->entry, !m->secret);
- g_signal_connect (m->entry, "activate", G_CALLBACK (pass_activate), password_dialog);
- gtk_box_pack_start (GTK_BOX (GTK_DIALOG (password_dialog)->vbox), m->entry, TRUE, FALSE, 0);
- gtk_widget_show (m->entry);
+ gtk_box_pack_end (GTK_BOX (GNOME_DIALOG (dialogue)->vbox), check, TRUE, FALSE, 0);
- if (m->reprompt && m->result) {
- gtk_entry_set_text ((GtkEntry *) m->entry, m->result);
- g_free (m->result);
- m->result = NULL;
+ if (entry) {
+ gtk_box_pack_end (GTK_BOX (GNOME_DIALOG (dialogue)->vbox), entry, TRUE, FALSE, 0);
+ gtk_widget_grab_focus (entry);
+ gtk_object_unref (GTK_OBJECT (entry));
}
- if (m->service_url == NULL || m->service != NULL) {
- m->check = gtk_check_button_new_with_mnemonic (m->service_url ? _("_Remember this password") :
- _("_Remember this password for the remainder of this session"));
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (m->check),
- m->config_service ? m->config_service->save_passwd : FALSE);
- gtk_box_pack_start (GTK_BOX (GTK_DIALOG (password_dialog)->vbox), m->check, TRUE, FALSE, 0);
- gtk_widget_show (m->check);
- }
+ m->check = check;
- if (m->ismain) {
- pass_response(password_dialog, gtk_dialog_run (password_dialog), m);
- } else {
- g_signal_connect (password_dialog, "response", G_CALLBACK (pass_response), m);
- gtk_widget_show ((GtkWidget *) password_dialog);
- }
+ if (mca) {
+ char *name;
+
+ name = e_utf8_to_gtk_string (GTK_WIDGET (dialogue), mca->name);
+ title = g_strdup_printf (_("Enter Password for %s"), name);
+ g_free (name);
+ } else
+ title = g_strdup (_("Enter Password"));
+
+ gtk_window_set_title (GTK_WINDOW (dialogue), title);
+ g_free (title);
+
+ if (m->ismain)
+ gnome_dialog_run_and_close ((GnomeDialog *)dialogue);
+ else
+ gtk_widget_show(dialogue);
}
static void
@@ -300,15 +346,15 @@ do_get_pass(struct _mail_msg *mm)
MailSession *mail_session = MAIL_SESSION (m->session);
if (!strcmp (m->item, "popb4smtp_uri")) {
- char *url = camel_url_to_string (m->service->url, 0);
- EAccount *account = mail_config_get_account_by_transport_url (url);
+ char *url = camel_url_to_string(m->service->url, 0);
+ const MailConfigAccount *account = mail_config_get_account_by_transport_url(url);
g_free(url);
if (account)
m->result = g_strdup(account->source->url);
} else if (m->key) {
- m->result = e_passwords_get_password ("Mail", m->key);
- if (m->result == NULL || m->reprompt) {
+ m->result = e_passwords_get_password(m->key);
+ if (m->result == NULL) {
if (mail_session->interactive) {
request_password(m);
return;
@@ -336,13 +382,12 @@ static struct _mail_msg_op get_pass_op = {
};
static char *
-get_password (CamelSession *session, const char *prompt, gboolean reprompt, gboolean secret,
- CamelService *service, const char *item, CamelException *ex)
+get_password (CamelSession *session, const char *prompt, gboolean secret, CamelService *service, const char *item, CamelException *ex)
{
struct _pass_msg *m, *r;
EMsgPort *pass_reply;
char *ret;
-
+
/* We setup an async request and send it off, and wait for it to return */
/* If we're really in main, we dont of course ...
... but this shouldn't be allowed because of locking issues */
@@ -351,7 +396,6 @@ get_password (CamelSession *session, const char *prompt, gboolean reprompt, gboo
m->ismain = pthread_self() == mail_gui_thread;
m->session = session;
m->prompt = prompt;
- m->reprompt = reprompt;
m->secret = secret;
m->service = service;
m->item = item;
@@ -360,11 +404,11 @@ get_password (CamelSession *session, const char *prompt, gboolean reprompt, gboo
m->service_url = camel_url_to_string (service->url, CAMEL_URL_HIDE_ALL);
m->key = make_key(service, item);
- if (m->ismain) {
+ if (m->ismain)
do_get_pass((struct _mail_msg *)m);
- } else {
+ else {
extern EMsgPort *mail_gui_port2;
-
+
e_msgport_put(mail_gui_port2, (EMsg *)m);
}
@@ -375,7 +419,7 @@ get_password (CamelSession *session, const char *prompt, gboolean reprompt, gboo
ret = m->result;
mail_msg_free(m);
e_msgport_destroy(pass_reply);
-
+
return ret;
}
@@ -383,8 +427,8 @@ static void
main_forget_password (CamelSession *session, CamelService *service, const char *item, CamelException *ex)
{
char *key = make_key (service, item);
-
- e_passwords_forget_password ("Mail", key);
+
+ e_passwords_forget_password (key);
g_free (key);
}
@@ -398,8 +442,9 @@ forget_password (CamelSession *session, CamelService *service, const char *item,
/* ********************************************************************** */
-static GtkDialog *message_dialog;
-static EDList message_list = E_DLIST_INITIALISER(message_list);
+static GnomeDialog *message_dialogue;
+static EDList message_list = E_DLIST_INITIALISER(password_list);
+static guint message_destroy_id;
struct _user_message_msg {
struct _mail_msg msg;
@@ -414,77 +459,88 @@ struct _user_message_msg {
static void do_user_message (struct _mail_msg *mm);
+/* if we dont have to wait for reply, we just check to see if any newly waiting prompts are there */
+static void
+user_message_destroy_noreply(GnomeDialog *gd, void *data)
+{
+ struct _user_message_msg *m;
+
+ message_dialogue = NULL;
+ if ((m = (struct _user_message_msg *)e_dlist_remhead(&message_list)))
+ do_user_message((struct _mail_msg *)m);
+}
+
/* clicked, send back the reply */
static void
-user_message_response (GtkDialog *dialog, int button, struct _user_message_msg *m)
+user_message_clicked(GnomeDialog *gd, int button, struct _user_message_msg *m)
{
- gtk_widget_destroy ((GtkWidget *) dialog);
-
- message_dialog = NULL;
-
- /* if !allow_cancel, then we've already replied */
- if (m->allow_cancel) {
- m->result = button == GTK_RESPONSE_OK;
- e_msgport_reply((EMsg *)m);
+ message_dialogue = NULL;
+
+ if (message_destroy_id) {
+ gtk_signal_disconnect((GtkObject *)gd, message_destroy_id);
+ message_destroy_id = 0;
}
-
+
+ m->result = button == 0;
+ e_msgport_reply((EMsg *)m);
+
/* check for pendings */
if ((m = (struct _user_message_msg *)e_dlist_remhead(&message_list)))
do_user_message((struct _mail_msg *)m);
}
static void
-user_message_destroy_notify (struct _user_message_msg *m, GObject *deadbeef)
+user_message_destroy(GnomeDialog *gd, struct _user_message_msg *m)
{
- message_dialog = NULL;
+ message_destroy_id = 0;
+ user_message_clicked(gd, -1, m);
}
static void
do_user_message (struct _mail_msg *mm)
{
struct _user_message_msg *m = (struct _user_message_msg *)mm;
- GtkMessageType msg_type;
-
- if (!m->ismain && message_dialog != NULL) {
- e_dlist_addtail (&message_list, (EDListNode *)m);
+ const char *msg_type;
+
+ if (!m->ismain && message_dialogue != NULL) {
+ e_dlist_addtail(&message_list, (EDListNode *)m);
return;
}
-
+
switch (m->type) {
case CAMEL_SESSION_ALERT_INFO:
- msg_type = GTK_MESSAGE_INFO;
+ msg_type = GNOME_MESSAGE_BOX_INFO;
break;
case CAMEL_SESSION_ALERT_WARNING:
- msg_type = GTK_MESSAGE_WARNING;
+ msg_type = GNOME_MESSAGE_BOX_WARNING;
break;
case CAMEL_SESSION_ALERT_ERROR:
- msg_type = GTK_MESSAGE_ERROR;
+ msg_type = GNOME_MESSAGE_BOX_ERROR;
break;
default:
- msg_type = GTK_MESSAGE_INFO;
+ msg_type = NULL;
}
-
- message_dialog = (GtkDialog *) gtk_message_dialog_new (
- NULL, 0, msg_type,
- m->allow_cancel ? GTK_BUTTONS_OK_CANCEL : GTK_BUTTONS_OK,
- "%s", m->prompt);
- gtk_dialog_set_default_response (message_dialog, m->allow_cancel ? GTK_RESPONSE_CANCEL : GTK_RESPONSE_OK);
- g_object_set ((GObject *) message_dialog, "allow_shrink", TRUE, "allow_grow", TRUE, NULL);
-
+
+ message_dialogue = (GnomeDialog *)gnome_message_box_new(m->prompt, msg_type, GNOME_STOCK_BUTTON_OK,
+ m->allow_cancel ? GNOME_STOCK_BUTTON_CANCEL : NULL,
+ NULL);
+ gnome_dialog_set_default(message_dialogue, 1);
+ gnome_dialog_set_close(message_dialogue, TRUE);
+ gtk_window_set_policy (GTK_WINDOW (message_dialogue), TRUE, TRUE, TRUE);
+
/* We only need to wait for the result if we allow cancel otherwise show but send result back instantly */
if (m->allow_cancel) {
- if (m->ismain) {
- user_message_response(message_dialog, gtk_dialog_run (message_dialog), m);
- } else {
- g_signal_connect (message_dialog, "response", G_CALLBACK (user_message_response), m);
- gtk_widget_show ((GtkWidget *) message_dialog);
- }
+ gtk_signal_connect((GtkObject*)message_dialogue, "clicked", user_message_clicked, m);
+ message_destroy_id = gtk_signal_connect((GtkObject*)message_dialogue, "destroy", user_message_destroy, m);
+ if (m->ismain)
+ gnome_dialog_run_and_close ((GnomeDialog *)message_dialogue);
+ else
+ gtk_widget_show((GtkWidget *)message_dialogue);
} else {
- g_signal_connect (message_dialog, "response", G_CALLBACK (gtk_widget_destroy), message_dialog);
- g_object_weak_ref ((GObject *) message_dialog, (GWeakNotify) user_message_destroy_notify, m);
- gtk_widget_show ((GtkWidget *) message_dialog);
+ gtk_signal_connect((GtkObject *)message_dialogue, "destroy", user_message_destroy_noreply, NULL);
+ gtk_widget_show((GtkWidget *)message_dialogue);
m->result = TRUE;
- e_msgport_reply ((EMsg *)m);
+ e_msgport_reply((EMsg *)m);
}
}
@@ -595,31 +651,31 @@ timeout_timeout (struct _mail_msg *mm)
}
static void
-timeout_done (struct _mail_msg *mm)
+timeout_done(struct _mail_msg *mm)
{
- struct _timeout_msg *m = (struct _timeout_msg *) mm;
- MailSession *ms = (MailSession *) m->session;
+ struct _timeout_msg *m = (struct _timeout_msg *)mm;
+ MailSession *ms = (MailSession *)m->session;
struct _timeout_data *td;
-
+
if (!m->result) {
MAIL_SESSION_LOCK(ms, lock);
- td = find_timeout (&ms->timeouts, m->id);
+ td = find_timeout(&ms->timeouts, m->id);
if (td) {
- e_dlist_remove ((EDListNode *) td);
+ e_dlist_remove((EDListNode *)td);
if (td->timeout_id)
- gtk_timeout_remove (td->timeout_id);
- g_free (td);
+ gtk_timeout_remove(td->timeout_id);
+ g_free(td);
}
MAIL_SESSION_UNLOCK(ms, lock);
}
}
static void
-timeout_free (struct _mail_msg *mm)
+timeout_free(struct _mail_msg *mm)
{
struct _timeout_msg *m = (struct _timeout_msg *)mm;
-
- camel_object_unref (m->session);
+
+ camel_object_unref((CamelObject *)m->session);
}
static struct _mail_msg_op timeout_op = {
@@ -634,63 +690,63 @@ camel_timeout (gpointer data)
{
struct _timeout_data *td = data;
struct _timeout_msg *m;
-
+
/* stop if we are removed pending */
if (td->removed)
return FALSE;
- m = mail_msg_new (&timeout_op, NULL, sizeof (*m));
-
+ m = mail_msg_new(&timeout_op, NULL, sizeof (*m));
+
m->session = td->session;
- camel_object_ref (td->session);
+ camel_object_ref((CamelObject *)td->session);
m->id = td->id;
- e_thread_put (mail_thread_queued, (EMsg *)m);
+ e_thread_put(mail_thread_queued, (EMsg *)m);
return TRUE;
}
static void
-main_register_timeout (CamelSession *session, void *event_data, void *data)
+main_register_timeout(CamelSession *session, void *event_data, void *data)
{
MailSession *ms = (MailSession *)session;
unsigned int handle = (unsigned int)event_data;
struct _timeout_data *td;
-
+
MAIL_SESSION_LOCK(session, lock);
- td = find_timeout (&ms->timeouts, handle);
+ td = find_timeout(&ms->timeouts, handle);
if (td) {
if (td->removed) {
- e_dlist_remove ((EDListNode *) td);
+ e_dlist_remove((EDListNode *)td);
if (td->timeout_id)
- gtk_timeout_remove (td->timeout_id);
- g_free (td);
+ gtk_timeout_remove(td->timeout_id);
+ g_free(td);
} else {
- td->timeout_id = gtk_timeout_add (td->interval, camel_timeout, td);
+ td->timeout_id = gtk_timeout_add(td->interval, camel_timeout, td);
}
}
MAIL_SESSION_UNLOCK(session, lock);
-
- camel_object_unref (ms);
+
+ camel_object_unref((CamelObject *)ms);
}
static guint
register_timeout (CamelSession *session, guint32 interval, CamelTimeoutCallback cb, gpointer camel_data)
{
struct _timeout_data *td;
- MailSession *ms = (MailSession *) session;
+ MailSession *ms = (MailSession *)session;
guint ret;
-
+
MAIL_SESSION_LOCK(session, lock);
-
+
ret = ms->timeout_id;
- ms->timeout_id++;
-
+ ms->timeout_id ++;
+
/* just debugging, the timeout code now ignores excessive events anyway */
if (interval < 100)
- g_warning ("Timeout requested %d is small, may cause performance problems", interval);
-
- td = g_malloc (sizeof (*td));
+ g_warning("Timeout requested %d is small, may cause performance problems", interval);
+
+ td = g_malloc(sizeof(*td));
td->cb = cb;
td->camel_data = camel_data;
td->interval = interval;
@@ -698,35 +754,34 @@ register_timeout (CamelSession *session, guint32 interval, CamelTimeoutCallback
td->session = session;
td->removed = FALSE;
td->busy = FALSE;
- e_dlist_addhead (&ms->timeouts, (EDListNode *) td);
-
+ e_dlist_addhead(&ms->timeouts, (EDListNode *)td);
+
MAIL_SESSION_UNLOCK(session, lock);
-
- camel_object_ref (ms);
- mail_async_event_emit (ms->async, MAIL_ASYNC_GUI, (MailAsyncFunc) main_register_timeout,
- (CamelObject *) session, (void *) ret, NULL);
+
+ camel_object_ref((CamelObject *)ms);
+ mail_async_event_emit(ms->async, MAIL_ASYNC_GUI, (MailAsyncFunc)main_register_timeout, (CamelObject *)session, (void *)ret, NULL);
return ret;
}
static void
-main_remove_timeout (CamelSession *session, void *event_data, void *data)
+main_remove_timeout(CamelSession *session, void *event_data, void *data)
{
- MailSession *ms = (MailSession *) session;
- unsigned int handle = (unsigned int) event_data;
+ MailSession *ms = (MailSession *)session;
+ unsigned int handle = (unsigned int)event_data;
struct _timeout_data *td;
-
+
MAIL_SESSION_LOCK(session, lock);
- td = find_timeout (&ms->timeouts, handle);
+ td = find_timeout(&ms->timeouts, handle);
if (td) {
- e_dlist_remove ((EDListNode *) td);
+ e_dlist_remove((EDListNode *)td);
if (td->timeout_id)
- gtk_timeout_remove (td->timeout_id);
- g_free (td);
+ gtk_timeout_remove(td->timeout_id);
+ g_free(td);
}
MAIL_SESSION_UNLOCK(session, lock);
-
- camel_object_unref (ms);
+
+ camel_object_unref((CamelObject *)ms);
}
static gboolean
@@ -735,21 +790,21 @@ remove_timeout (CamelSession *session, guint handle)
MailSession *ms = (MailSession *)session;
struct _timeout_data *td;
int remove = FALSE;
-
+
MAIL_SESSION_LOCK(session, lock);
- td = find_timeout (&ms->timeouts, handle);
+ td = find_timeout(&ms->timeouts, handle);
if (td && !td->removed) {
td->removed = TRUE;
remove = TRUE;
}
MAIL_SESSION_UNLOCK(session, lock);
-
+
if (remove) {
- camel_object_ref (ms);
- mail_async_event_emit (ms->async, MAIL_ASYNC_GUI, (MailAsyncFunc) main_remove_timeout,
- (CamelObject *) session, (void *) handle, NULL);
+ camel_object_ref((CamelObject *)ms);
+ mail_async_event_emit(ms->async, MAIL_ASYNC_GUI,
+ (MailAsyncFunc)main_remove_timeout, (CamelObject *)session, (void *)handle, NULL);
} else
- g_warning ("Removing a timeout i dont know about (or twice): %d", handle);
+ g_warning("Removing a timeout i dont know about (or twice): %d", handle);
return TRUE;
}
@@ -779,37 +834,30 @@ static CamelFilterDriver *
main_get_filter_driver (CamelSession *session, const char *type, CamelException *ex)
{
CamelFilterDriver *driver;
+ RuleContext *fc;
GString *fsearch, *faction;
FilterRule *rule = NULL;
char *user, *system;
- GConfClient *gconf;
- RuleContext *fc;
- long notify;
-
- gconf = gconf_client_get_default ();
user = g_strdup_printf ("%s/filters.xml", evolution_dir);
- system = EVOLUTION_PRIVDATADIR "/filtertypes.xml";
- fc = (RuleContext *) filter_context_new ();
+ system = EVOLUTION_DATADIR "/evolution/filtertypes.xml";
+ fc = (RuleContext *)filter_context_new ();
rule_context_load (fc, system, user);
g_free (user);
driver = camel_filter_driver_new (session);
camel_filter_driver_set_folder_func (driver, get_folder, NULL);
- if (gconf_client_get_bool (gconf, "/apps/evolution/mail/filters/log", NULL)) {
- MailSession *ms = (MailSession *) session;
+ if (mail_config_get_filter_log ()) {
+ MailSession *ms = (MailSession *)session;
if (ms->filter_logfile == NULL) {
- char *filename;
+ const char *filename;
- filename = gconf_client_get_string (gconf, "/apps/evolution/mail/filters/logfile", NULL);
- if (filename) {
+ filename = mail_config_get_filter_log_path ();
+ if (filename)
ms->filter_logfile = fopen (filename, "a+");
- g_free (filename);
- }
}
-
if (ms->filter_logfile)
camel_filter_driver_set_logfile (driver, ms->filter_logfile);
}
@@ -826,26 +874,19 @@ main_get_filter_driver (CamelSession *session, const char *type, CamelException
/* FIXME: we need a way to distinguish between filtering new
mail and re-filtering a folder because both use the
"incoming" filter type */
- notify = gconf_client_get_int (gconf, "/apps/evolution/mail/notify/type", NULL);
- if (notify != MAIL_CONFIG_NOTIFY_NOT && !strcmp (type, "incoming")) {
- char *filename;
-
+ if (mail_config_get_new_mail_notify () && !strcmp (type, "incoming")) {
g_string_truncate (faction, 0);
g_string_append (faction, "(only-once \"new-mail-notification\" ");
- switch (notify) {
- case MAIL_CONFIG_NOTIFY_PLAY_SOUND:
- filename = gconf_client_get_string (gconf, "/apps/evolution/mail/notify/sound", NULL);
- if (filename) {
- g_string_append_printf (faction, "\"(play-sound \\\"%s\\\")\"", filename);
- g_free (filename);
- break;
- }
- /* fall through */
+ switch (mail_config_get_new_mail_notify ()) {
case MAIL_CONFIG_NOTIFY_BEEP:
g_string_append (faction, "\"(beep)\"");
break;
+ case MAIL_CONFIG_NOTIFY_PLAY_SOUND:
+ g_string_sprintfa (faction, "\"(play-sound \\\"%s\\\")\"",
+ mail_config_get_new_mail_notify_sound_file ());
+ break;
default:
break;
}
@@ -861,15 +902,16 @@ main_get_filter_driver (CamelSession *session, const char *type, CamelException
g_string_truncate (faction, 0);
filter_rule_build_code (rule, fsearch);
- filter_filter_build_action ((FilterFilter *) rule, faction);
+ filter_filter_build_action ((FilterFilter *)rule, faction);
- camel_filter_driver_add_rule (driver, rule->name, fsearch->str, faction->str);
+ camel_filter_driver_add_rule (driver, rule->name,
+ fsearch->str, faction->str);
}
g_string_free (fsearch, TRUE);
g_string_free (faction, TRUE);
- g_object_unref (fc);
+ gtk_object_unref (GTK_OBJECT (fc));
return driver;
}
@@ -877,8 +919,8 @@ main_get_filter_driver (CamelSession *session, const char *type, CamelException
static CamelFilterDriver *
get_filter_driver (CamelSession *session, const char *type, CamelException *ex)
{
- return (CamelFilterDriver *) mail_call_main (MAIL_CALL_p_ppp, (MailMainFunc) main_get_filter_driver,
- session, type, ex);
+ return (CamelFilterDriver *)mail_call_main(MAIL_CALL_p_ppp, (MailMainFunc)main_get_filter_driver,
+ session, type, ex);
}
char *
@@ -887,15 +929,15 @@ mail_session_get_password (const char *url_string)
CamelURL *url;
char *simple_url;
char *passwd;
-
+
url = camel_url_new (url_string, NULL);
simple_url = camel_url_to_string (url, CAMEL_URL_HIDE_PASSWORD | CAMEL_URL_HIDE_PARAMS);
camel_url_free (url);
-
- passwd = e_passwords_get_password ("Mail", simple_url);
-
+
+ passwd = e_passwords_get_password (simple_url);
+
g_free (simple_url);
-
+
return passwd;
}
@@ -905,13 +947,13 @@ mail_session_add_password (const char *url_string,
{
CamelURL *url;
char *simple_url;
-
+
url = camel_url_new (url_string, NULL);
simple_url = camel_url_to_string (url, CAMEL_URL_HIDE_PASSWORD | CAMEL_URL_HIDE_PARAMS);
camel_url_free (url);
-
+
e_passwords_add_password (simple_url, passwd);
-
+
g_free (simple_url);
}
@@ -924,16 +966,16 @@ mail_session_remember_password (const char *url_string)
url = camel_url_new (url_string, NULL);
simple_url = camel_url_to_string (url, CAMEL_URL_HIDE_PASSWORD | CAMEL_URL_HIDE_PARAMS);
camel_url_free (url);
-
- e_passwords_remember_password ("Mail", simple_url);
-
+
+ e_passwords_remember_password (simple_url);
+
g_free (simple_url);
}
void
mail_session_forget_password (const char *key)
{
- e_passwords_forget_password ("Mail", key);
+ e_passwords_forget_password (key);
}
void
@@ -948,10 +990,10 @@ mail_session_init (void)
camel_dir = g_strdup_printf ("%s/mail", evolution_dir);
camel_session_construct (session, camel_dir);
-
+
/* The shell will tell us to go online. */
- camel_session_set_online ((CamelSession *) session, FALSE);
-
+ camel_session_set_online ((CamelSession *)session, FALSE);
+
g_free (camel_dir);
}
@@ -969,31 +1011,31 @@ mail_session_set_interactive (gboolean interactive)
if (!interactive) {
struct _pass_msg *pm;
struct _user_message_msg *um;
-
- d(printf ("Gone non-interactive, checking for outstanding interactive tasks\n"));
-
+
+ d(printf("Gone non-interactive, checking for outstanding interactive tasks\n"));
+
/* clear out pending password requests */
- while ((pm = (struct _pass_msg *) e_dlist_remhead (&password_list))) {
- d(printf ("Flushing password request : %s\n", pm->prompt));
- e_msgport_reply ((EMsg *) pm);
+ while ((pm = (struct _pass_msg *)e_dlist_remhead(&password_list))) {
+ d(printf("Flushing password request : %s\n", pm->prompt));
+ e_msgport_reply((EMsg *)pm);
}
-
+
/* destroy the current */
- if (password_dialog) {
- d(printf ("Destroying password dialogue\n"));
- gtk_widget_destroy ((GtkWidget *) password_dialog);
+ if (password_dialogue) {
+ d(printf("Destroying password dialogue\n"));
+ gtk_object_destroy((GtkObject *)password_dialogue);
}
-
+
/* same for pending user messages */
- while ((um = (struct _user_message_msg *) e_dlist_remhead (&message_list))) {
- d(printf ("Flusing message request: %s\n", um->prompt));
- e_msgport_reply((EMsg *) um);
+ while ((um = (struct _user_message_msg *)e_dlist_remhead(&message_list))) {
+ d(printf("Flusing message request: %s\n", um->prompt));
+ e_msgport_reply((EMsg *)um);
}
-
+
/* and the current */
- if (message_dialog) {
+ if (message_dialogue) {
d(printf("Destroying message dialogue\n"));
- gtk_widget_destroy ((GtkWidget *) message_dialog);
+ gtk_object_destroy((GtkObject *)message_dialogue);
}
}
}
diff --git a/mail/mail.h b/mail/mail.h
index 1c40b52107..046c873e4d 100644
--- a/mail/mail.h
+++ b/mail/mail.h
@@ -29,12 +29,45 @@
#include "mail-callbacks.h"
#include "mail-config.h"
#include "mail-config-druid.h"
-#include "mail-display-stream.h"
+/*#include "folder-browser.h"*/
#include "mail-session.h"
#include "mail-types.h"
extern char *evolution_dir;
+/* mail-format */
+GByteArray *mail_format_get_data_wrapper_text (CamelDataWrapper *data,
+ MailDisplay *mail_display);
+
+void mail_format_mime_message (CamelMimeMessage *mime_message,
+ MailDisplay *md, GtkHTML *html, GtkHTMLStream *stream);
+void mail_format_raw_message (CamelMimeMessage *mime_message,
+ MailDisplay *md, GtkHTML *html, GtkHTMLStream *stream);
+gboolean mail_content_loaded (CamelDataWrapper *wrapper,
+ MailDisplay *display,
+ gboolean redisplay,
+ const gchar *url,
+ GtkHTML *html,
+ GtkHTMLStream *handle);
+
+typedef gboolean (*MailMimeHandlerFn) (CamelMimePart *part,
+ const char *mime_type,
+ MailDisplay *md, GtkHTML *html, GtkHTMLStream *stream);
+typedef struct {
+ OAF_ServerInfo *component;
+ GList *applications;
+ MailMimeHandlerFn builtin;
+ guint generic : 1;
+ guint is_bonobo : 1;
+} MailMimeHandler;
+MailMimeHandler *mail_lookup_handler (const char *mime_type);
+
+gboolean mail_part_is_inline (CamelMimePart *part);
+gboolean mail_part_is_displayed_inline (CamelMimePart *part, MailDisplay *md);
+void mail_part_toggle_displayed (CamelMimePart *part, MailDisplay *md);
+
+char *mail_get_message_body (CamelDataWrapper *data, gboolean want_plain, gboolean cite);
+
/* mail-identify */
char *mail_identify_mime_part (CamelMimePart *part, MailDisplay *md);
@@ -42,7 +75,7 @@ char *mail_identify_mime_part (CamelMimePart *part, MailDisplay *md);
void mail_add_storage (CamelStore *store, const char *name, const char *uri);
void mail_load_storage_by_uri (GNOME_Evolution_Shell shell, const char *uri, const char *name);
/*takes a GSList of MailConfigServices */
-void mail_load_storages (GNOME_Evolution_Shell shell, EAccountList *sources);
+void mail_load_storages (GNOME_Evolution_Shell shell, const GSList *sources);
void mail_hash_storage (CamelService *store, EvolutionStorage *storage);
EvolutionStorage *mail_lookup_storage (CamelStore *store);
diff --git a/mail/subscribe-dialog.glade b/mail/subscribe-dialog.glade
index 0cbeb7ac59..f86596530b 100644
--- a/mail/subscribe-dialog.glade
+++ b/mail/subscribe-dialog.glade
@@ -1,256 +1,335 @@
-<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*-->
-<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd">
+<?xml version="1.0"?>
+<GTK-Interface>
-<glade-interface>
-<requires lib="gnome"/>
-<requires lib="bonobo"/>
+<project>
+ <name>Evolution</name>
+ <program_name>evolution</program_name>
+ <directory></directory>
+ <source_directory>src</source_directory>
+ <pixmaps_directory>pixmaps</pixmaps_directory>
+ <language>C</language>
+ <gnome_support>True</gnome_support>
+ <gettext_support>True</gettext_support>
+ <translatable_strings_file>subscribe-dialog.glade.h</translatable_strings_file>
+</project>
-<widget class="GnomeApp" id="app">
- <property name="visible">True</property>
- <property name="title" translatable="yes">Manage Subscriptions</property>
- <property name="type">GTK_WINDOW_TOPLEVEL</property>
- <property name="window_position">GTK_WIN_POS_NONE</property>
- <property name="modal">False</property>
- <property name="resizable">True</property>
- <property name="destroy_with_parent">False</property>
- <property name="enable_layout_config">True</property>
+<widget>
+ <class>GnomeApp</class>
+ <name>app</name>
+ <title>Manage Subscriptions</title>
+ <type>GTK_WINDOW_TOPLEVEL</type>
+ <position>GTK_WIN_POS_NONE</position>
+ <modal>False</modal>
+ <allow_shrink>False</allow_shrink>
+ <allow_grow>True</allow_grow>
+ <auto_shrink>False</auto_shrink>
+ <enable_layout_config>True</enable_layout_config>
- <child internal-child="dock">
- <widget class="BonoboDock" id="dock2">
- <property name="border_width">3</property>
- <property name="visible">True</property>
- <property name="allow_floating">True</property>
+ <widget>
+ <class>GnomeDock</class>
+ <child_name>GnomeApp:dock</child_name>
+ <name>dock2</name>
+ <border_width>3</border_width>
+ <allow_floating>True</allow_floating>
+ <child>
+ <padding>0</padding>
+ <expand>True</expand>
+ <fill>True</fill>
+ </child>
- <child>
- <widget class="BonoboDockItem" id="dockitem2">
- <property name="border_width">1</property>
- <property name="visible">True</property>
- <property name="shadow_type">GTK_SHADOW_OUT</property>
+ <widget>
+ <class>GnomeDockItem</class>
+ <name>dockitem2</name>
+ <border_width>1</border_width>
+ <placement>GNOME_DOCK_TOP</placement>
+ <band>0</band>
+ <position>0</position>
+ <offset>0</offset>
+ <locked>False</locked>
+ <exclusive>True</exclusive>
+ <never_floating>False</never_floating>
+ <never_vertical>False</never_vertical>
+ <never_horizontal>False</never_horizontal>
+ <shadow_type>GTK_SHADOW_OUT</shadow_type>
+ <widget>
+ <class>GtkToolbar</class>
+ <name>toolbar1</name>
+ <border_width>1</border_width>
+ <orientation>GTK_ORIENTATION_HORIZONTAL</orientation>
+ <type>GTK_TOOLBAR_BOTH</type>
+ <space_size>16</space_size>
+ <space_style>GTK_TOOLBAR_SPACE_LINE</space_style>
+ <relief>GTK_RELIEF_NONE</relief>
+ <tooltips>True</tooltips>
+
+ <widget>
+ <class>GtkButton</class>
+ <child_name>Toolbar:button</child_name>
+ <name>refresh_button</name>
+ <tooltip>Refresh folder listing</tooltip>
+ <label>Refresh List</label>
+ <stock_pixmap>GNOME_STOCK_PIXMAP_REFRESH</stock_pixmap>
+ </widget>
+
+ <widget>
+ <class>GtkButton</class>
+ <child_name>Toolbar:button</child_name>
+ <name>close_button</name>
+ <label>Close</label>
+ <stock_pixmap>GNOME_STOCK_PIXMAP_CLOSE</stock_pixmap>
<child>
- <widget class="GtkToolbar" id="toolbar1">
- <property name="border_width">1</property>
- <property name="visible">True</property>
- <property name="orientation">GTK_ORIENTATION_HORIZONTAL</property>
- <property name="toolbar_style">GTK_TOOLBAR_BOTH</property>
- <property name="tooltips">True</property>
+ <new_group>True</new_group>
+ </child>
+ </widget>
+ </widget>
+ </widget>
- <child>
- <widget class="button" id="refresh_button">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Refresh List</property>
- <property name="use_underline">True</property>
- <property name="stock_pixmap">gtk-refresh</property>
- </widget>
- </child>
+ <widget>
+ <class>GtkVBox</class>
+ <child_name>GnomeDock:contents</child_name>
+ <name>vbox6</name>
+ <border_width>3</border_width>
+ <homogeneous>False</homogeneous>
+ <spacing>3</spacing>
- <child>
- <widget class="button" id="close_button">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Close</property>
- <property name="use_underline">True</property>
- <property name="stock_pixmap">gtk-close</property>
- </widget>
- <packing>
- <property name="new_group">True</property>
- </packing>
- </child>
- </widget>
+ <widget>
+ <class>GtkHBox</class>
+ <name>hbox7</name>
+ <homogeneous>False</homogeneous>
+ <spacing>0</spacing>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>True</fill>
+ </child>
+
+ <widget>
+ <class>GtkLabel</class>
+ <name>label5</name>
+ <label>S_elect server: </label>
+ <justify>GTK_JUSTIFY_CENTER</justify>
+ <wrap>False</wrap>
+ <xalign>0.5</xalign>
+ <yalign>0.5</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <default_focus_target>store_menu</default_focus_target>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
</child>
</widget>
- <packing>
- <property name="placement">BONOBO_DOCK_TOP</property>
- <property name="band">0</property>
- <property name="position">0</property>
- <property name="offset">0</property>
- <property name="behavior">BONOBO_DOCK_ITEM_BEH_EXCLUSIVE</property>
- </packing>
- </child>
- <child>
- <widget class="GtkVBox" id="vbox6">
- <property name="border_width">3</property>
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">3</property>
+ <widget>
+ <class>GtkOptionMenu</class>
+ <name>store_menu</name>
+ <can_focus>True</can_focus>
+ <items></items>
+ <initial_choice>0</initial_choice>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
+ </child>
+ </widget>
+ </widget>
+ <widget>
+ <class>GtkHBox</class>
+ <name>tree_box</name>
+ <homogeneous>False</homogeneous>
+ <spacing>0</spacing>
+ <child>
+ <padding>0</padding>
+ <expand>True</expand>
+ <fill>True</fill>
+ </child>
+
+ <widget>
+ <class>Placeholder</class>
+ </widget>
+
+ <widget>
+ <class>GtkVBox</class>
+ <name>vbox7</name>
+ <border_width>3</border_width>
+ <homogeneous>False</homogeneous>
+ <spacing>3</spacing>
<child>
- <widget class="GtkHBox" id="hbox7">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">0</property>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
+ <pack>GTK_PACK_END</pack>
+ </child>
- <child>
- <widget class="GtkLabel" id="label5">
- <property name="visible">True</property>
- <property name="label" translatable="yes">S_elect server: </property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="mnemonic_widget">store_menu</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
+ <widget>
+ <class>GtkLabel</class>
+ <name>label6</name>
+ <label>
+</label>
+ <justify>GTK_JUSTIFY_CENTER</justify>
+ <wrap>False</wrap>
+ <xalign>0.5</xalign>
+ <yalign>0.5</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
+ </child>
+ </widget>
- <child>
- <widget class="GtkOptionMenu" id="store_menu">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="history">-1</property>
+ <widget>
+ <class>GtkVButtonBox</class>
+ <name>vbuttonbox6</name>
+ <layout_style>GTK_BUTTONBOX_SPREAD</layout_style>
+ <spacing>0</spacing>
+ <child_min_width>85</child_min_width>
+ <child_min_height>27</child_min_height>
+ <child_ipad_x>7</child_ipad_x>
+ <child_ipad_y>0</child_ipad_y>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
+ </child>
- <child internal-child="menu">
- <widget class="GtkMenu" id="convertwidget1">
- <property name="visible">True</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
+ <widget>
+ <class>GtkButton</class>
+ <name>subscribe_button</name>
+ <can_default>True</can_default>
+ <can_focus>True</can_focus>
+ <label>_Subscribe</label>
+ <relief>GTK_RELIEF_NORMAL</relief>
</widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">True</property>
- </packing>
- </child>
- <child>
- <widget class="GtkHBox" id="tree_box">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">0</property>
+ <widget>
+ <class>GtkButton</class>
+ <name>unsubscribe_button</name>
+ <can_default>True</can_default>
+ <can_focus>True</can_focus>
+ <label>_Unsubscribe</label>
+ <relief>GTK_RELIEF_NORMAL</relief>
+ </widget>
+ </widget>
- <child>
- <placeholder/>
- </child>
+ <widget>
+ <class>GtkVButtonBox</class>
+ <name>vbuttonbox7</name>
+ <layout_style>GTK_BUTTONBOX_START</layout_style>
+ <spacing>10</spacing>
+ <child_min_width>85</child_min_width>
+ <child_min_height>27</child_min_height>
+ <child_ipad_x>7</child_ipad_x>
+ <child_ipad_y>0</child_ipad_y>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
+ </child>
+ </widget>
+ </widget>
+ </widget>
- <child>
- <widget class="GtkVBox" id="vbox7">
- <property name="border_width">3</property>
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">3</property>
+ <widget>
+ <class>GtkFrame</class>
+ <name>frame3</name>
+ <label>Display Options</label>
+ <label_xalign>0</label_xalign>
+ <shadow_type>GTK_SHADOW_ETCHED_IN</shadow_type>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>True</fill>
+ </child>
- <child>
- <widget class="GtkLabel" id="label6">
- <property name="visible">True</property>
- <property name="label" translatable="yes">
-</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
+ <widget>
+ <class>GtkHBox</class>
+ <name>hbox9</name>
+ <border_width>3</border_width>
+ <homogeneous>False</homogeneous>
+ <spacing>3</spacing>
- <child>
- <widget class="GtkVButtonBox" id="vbuttonbox6">
- <property name="visible">True</property>
- <property name="layout_style">GTK_BUTTONBOX_SPREAD</property>
- <property name="spacing">0</property>
+ <widget>
+ <class>GtkRadioButton</class>
+ <name>all_radio</name>
+ <can_focus>True</can_focus>
+ <label>All folders</label>
+ <active>False</active>
+ <draw_indicator>True</draw_indicator>
+ <group>view_type</group>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
+ </child>
+ </widget>
- <child>
- <widget class="GtkButton" id="subscribe_button">
- <property name="visible">True</property>
- <property name="can_default">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">_Subscribe</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- </widget>
- </child>
+ <widget>
+ <class>GtkRadioButton</class>
+ <name>filter_radio</name>
+ <can_focus>True</can_focus>
+ <label>Folders whose names begin with:</label>
+ <active>False</active>
+ <draw_indicator>True</draw_indicator>
+ <group>view_type</group>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
+ </child>
+ </widget>
- <child>
- <widget class="GtkButton" id="unsubscribe_button">
- <property name="visible">True</property>
- <property name="can_default">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">_Unsubscribe</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
+ <widget>
+ <class>GtkEntry</class>
+ <name>search_entry</name>
+ <can_focus>True</can_focus>
+ <editable>True</editable>
+ <text_visible>True</text_visible>
+ <text_max_length>0</text_max_length>
+ <text></text>
+ <child>
+ <padding>0</padding>
+ <expand>True</expand>
+ <fill>True</fill>
+ </child>
+ </widget>
- <child>
- <widget class="GtkVButtonBox" id="vbuttonbox7">
- <property name="visible">True</property>
- <property name="layout_style">GTK_BUTTONBOX_START</property>
- <property name="spacing">10</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="pack_type">GTK_PACK_END</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
+ <widget>
+ <class>GtkHButtonBox</class>
+ <name>hbuttonbox3</name>
+ <layout_style>GTK_BUTTONBOX_DEFAULT_STYLE</layout_style>
+ <spacing>30</spacing>
+ <child_min_width>85</child_min_width>
+ <child_min_height>27</child_min_height>
+ <child_ipad_x>7</child_ipad_x>
+ <child_ipad_y>0</child_ipad_y>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
+ </child>
+ </widget>
</widget>
- </child>
+ </widget>
</widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
+ </widget>
- <child internal-child="appbar">
- <widget class="GnomeAppBar" id="appbar2">
- <property name="visible">True</property>
- <property name="has_progress">True</property>
- <property name="has_status">True</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
+ <widget>
+ <class>GnomeAppBar</class>
+ <child_name>GnomeApp:appbar</child_name>
+ <name>appbar2</name>
+ <has_progress>True</has_progress>
+ <has_status>True</has_status>
+ <child>
+ <padding>0</padding>
+ <expand>True</expand>
+ <fill>True</fill>
+ </child>
+ </widget>
</widget>
-</glade-interface>
+</GTK-Interface>
diff --git a/my-evolution/ChangeLog b/my-evolution/ChangeLog
index 89018b2a22..b9c19c7275 100644
--- a/my-evolution/ChangeLog
+++ b/my-evolution/ChangeLog
@@ -1,484 +1,14 @@
-2003-03-31 Larry Ewing <lewing@ximian.com>
+2003-01-24 Ettore Perazzoli <ettore@ximian.com>
- * e-summary-factory.c: make the verbs static so they don't enter
- the global namespace.
-
-2003-03-27 Ettore Perazzoli <ettore@ximian.com>
-
- [#40358]
-
- * e-summary.c (e_summary_init): Likewise.
-
- * e-summary-weather.c (e_summary_weather_get_html): Likewise.
- (weather_make_html): Likewise.
-
- * e-summary-mail.c (e_summary_mail_generate_html): Fix so it
- handles the fact that the translated strings are already in UTF8.
- * e-summary-rdf.c (tree_walk): Likewise.
- (display_doc): Likewise.
-
-2003-03-27 Not Zed <NotZed@Ximian.com>
-
- ** see bug #40141
-
- * e-summary-preferences.c (config_control_destroy_cb): Dont save
- prefs here, but restore the last saved.
- (config_control_apply_cb): save preferences here.
-
-2003-03-26 Ettore Perazzoli <ettore@ximian.com>
-
- * e-summary-mail.c: New member physical_uri in struct
- ESummaryMailFolder.
- (new_folder_cb): Set it.
- (remove_folder_cb): Free it.
- (make_pretty_foldername): Rewritten to honour the display_name.
- [#7153]
-
- * e-summary.c (destroy): Only remove the source with ID
- tomorrow_timeout_id if the ID is nonzero.
-
-2003-03-25 Dan Winship <danw@ximian.com>
-
- * e-summary.c: Update for e_notice move
- (do_summary_print): Pass a parent_window to e_notice
-
-2003-03-19 Ettore Perazzoli <ettore@ximian.com>
-
- * e-summary-calendar.c (generate_html): Add a %P in the strftime
- string for the case when the user wants am/pm format. [#19957]
-
-2003-03-13 Mike Kestner <mkestner@ximian.com>
-
- * e-summary-preferences.c (fill_rdf_etable): pass FALSE for
- expand to e_summary_shown_add_node.
- * e-summary-shown.c (make_table): ditto, set_expanded_default to FALSE.
- (add_node): only call e_tree_node_set_expanded is expanded != default.
- * e-summary-weather.c (*_fill_etable): pass FALSE for expand to
- e_summary_shown_add_node.
-
-2003-03-13 Ettore Perazzoli <ettore@ximian.com>
-
- * e-summary-calendar.c (generate_html): Changed so its printf()s
- are protected against default_uri being NULL. Also, no need to do
- e_utf8_from_locale_string() anymore.
-
-2003-03-12 Dan Winship <danw@ximian.com>
-
- * e-summary-shown.c (e_summary_shown_freeze,
- e_summary_shown_thaw): New, to free/thaw the ETree models.
- (e_summary_shown_add_node): Don't freeze/thaw around the single
- add here. That doesn't really help much.
-
- * e-summary-preferences.c (fill_rdf_etable): Freeze/thaw the
- ESummaryShown while filling it in.
-
- * e-summary-weather.c (e_summary_weather_fill_etable): Likewise.
-
-2003-03-07 Ettore Perazzoli <ettore@ximian.com>
-
- * Locations (name): Add some escapes to the newly added locations
- so they get split properly.
-
- * e-summary-weather.c (e_summary_weather_init_locations): Fetch
- the Locations file from the right path. If you find an invalid
- entry in the Locations file, complain with an informative
- g_warning() instead of just returning FALSE.
- (e_summary_weather_fill_etable): Do the same thing here.
-
-2003-03-06 Ettore Perazzoli <ettore@ximian.com>
-
- * e-summary-calendar.c (generate_html): Added the AM/PM part when
- not in "wants24hr" mode; moved the date before the time instead of
- vice versa. Also, do not check the boolean value against TRUE!
-
-2003-03-06 Ettore Perazzoli <ettore@ximian.com>
-
- * Locations: Added more Swedish locations, submitted by Marten
- Woxberg. [See #5344]
-
-2003-03-06 Ettore Perazzoli <ettore@ximian.com>
-
- * e-summary-calendar.c (e_summary_calendar_protocol): Use
- G_GNUC_FUNCTION instead of __FUNCTION__.
- * e-summary-rdf.c (e_summary_rdf_update): Likewise.
- * e-summary-tasks.c (e_summary_tasks_protocol): Likewise.
- (e_summary_tasks_protocol): Likewise.
- * e-summary-weather.c (e_summary_weather_update): Likewise.
-
->>>>>>> 1.264
-2003-03-05 Ettore Perazzoli <ettore@ximian.com>
-
- * e-summary-weather.c (e_summary_weather_set_online): Likewise,
- assume weather_refresh_time of zero means "never update the
- weather".
- (e_summary_weather_init): Likewise here.
- (e_summary_weather_reconfigure): And here.
-
- * e-summary-rdf.c (e_summary_rdf_init): Don't add the news feeds
- here -- it should be handled with a GConf schema. Also, assume
- that prefs is always not NULL (as is the case with the current
- code), and interpret a timeout value of zero as "never update
- automatically".
- (e_summary_rdf_reconfigure): Likewise here. If rdf->timeout is
- zero, assume there is no pending timeout.
- (e_summary_rdf_set_online): Likewise here. Sigh, so much
- duplication in this code.
-
-2003-03-05 Not Zed <NotZed@Ximian.com>
-
- * component-factory.c (owner_unset_cb): dont call bonobo_main_quit
- anymore now we're shlib'ised.
-
-2003-02-28 Dan Winship <danw@ximian.com>
-
- * e-summary.c (e_summary_init): Don't need to use libalarm to set
- a timeout to change the date. We know how many seconds away it is,
- so we can just set a timeout for then.
-
- * Makefile.am (summary_libs): Remove libalarm.a
-
-2003-02-21 Dan Winship <danw@ximian.com>
-
- * Makefile.am (summary_libs): clean up
-
-2003-02-20 Dan Winship <danw@ximian.com>
-
- * Makefile.am (summary_libs):
- s/libemiscwidgets.a/libemiscwidgets.la/
-
-2003-02-19 Dan Winship <danw@ximian.com>
-
- * e-summary-rdf.c: Declare xmlSubstituteEntitiesDefaultValue
- extern.
- (message_finished): And set its value here. Fixes a duplicate
- symbol error on OS X.
-
-2003-02-10 Ettore Perazzoli <ettore@ximian.com>
-
- * Makefile.am: Split the IDL generated rules so ${ORBIT_IDL}
- doesn't get invoked multiple times in parallel.
- (BUILT_SOURCES): Added this.
- (CLEANFILES): And this.
-
-2003-02-06 Dan Winship <danw@ximian.com>
-
- * Makefile.am (INCLUDES): Fix typo in previous commit
-
-2003-02-06 Dan Winship <danw@ximian.com>
-
- * Makefile.am: clean up, update, etc
-
- * component-factory.c: #include string.h
-
- * e-summary.c (e_pixmap_file): s/IMAGEDIR/IMAGESDIR/
-
- * e-summary-rdf.c: Fix some warnings
-
-2003-02-05 Dan Winship <danw@ximian.com>
-
- * e-summary-offline-handler.c: s/BonoboXObject/BonoboObject/
-
-2003-01-23 Ettore Perazzoli <ettore@ximian.com>
-
- * Makefile.am (componentdir): Removed definition; this is now
- defined in configure.in.
-
-2003-01-22 Ettore Perazzoli <ettore@ximian.com>
-
- * e-summary-factory.c (control_activate): Get my-evolution.xml
- from EVOLUTION_UI_DIRECTORY.
-
- * e-summary.c (e_pixmap_file): Use EVOLUTION_IMAGEDIR.
- (e_pixmap_file): Use EVOLUTION_BUTTONSDIR.
-
- * e-summary-weather.c (e_summary_weather_init_locations): Use
- LOCATIONDIR.
- (e_summary_weather_fill_etable): Likewise.
-
- * Makefile.am (Locationdir): Version using $(BASE_VERSION).
- (gladedir): Likewise.
- (INCLUDES): Define EVOLUTION_IMAGEDIR.
+ * e-summary-preferences.c (config_control_apply_cb):
+ display_folders is a list of folders, not a list of strings, treat
+ accordingly. [#36557, patch from Harry Lu <harry.lu@sun.com>.]
2003-01-20 Ettore Perazzoli <ettore@ximian.com>
- * Locations: Updated locations for EU_FI, contributed by Pekka
+ * Locations: Update locations for EU_FI, contributed by Pekka
Pietikainen <Pekka.Pietikainen@nixu.com>.
-2003-01-14 Ettore Perazzoli <ettore@ximian.com>
-
- * Makefile.am (EXTRA_DIST): Add $(schema_DATA).
-
-2003-01-13 Not Zed <NotZed@Ximian.com>
-
- * e-summary-preferences.c (e_summary_preferences_save): fix a
- past-o with the physical_uri_list prepend.
-
-2003-01-10 Not Zed <NotZed@Ximian.com>
-
- * e-summary-mail.c (new_folder_cb): glist->gslist for
- display_folders list
- (mail_change_notify): "
- (e_summary_mail_reconfigure): ", and also traverse the list
- forwards, since we can't go backwards since its now an slist.
-
- * e-summary-preferences.c (e_summary_preferences_restore): append
- new folder entries to the folders list.
- (config_control_apply_cb): display_folders is a list of folders,
- not a list of strings, treat accordingly.
-
-2003-01-09 Chris Toshok <toshok@ximian.com>
-
- * e-summary-preferences.c (e_summary_preferences_create_control):
- change gtk_widget_show to gtk_widget_show_all so all the various
- custom widgets are displayed.
-
-2003-01-08 Ettore Perazzoli <ettore@ximian.com>
-
- * e-summary.c (e_pixmap_file): Update to use
- $(datadir)/evolution/images/ instead of
- $(datadir)/images/evolution to fetch the icons.
-
-2002-12-16 Ettore Perazzoli <ettore@ximian.com>
-
- * e-summary-shown.c (make_table): Do not ref/sink the ETreeMemory
- object.
-
-2002-12-11 Kevin Breit <mrproper@ximian.com>
-
- * Locations: Removed Marquette from the listing, it is no longer
- listed by METAR. This is per bug 29693.
-
- * Locations.h: Removed Marquette from the listing, it is no longer
- listed by METAR.
-
-2002-12-06 Ettore Perazzoli <ettore@ximian.com>
-
- * component-factory.c: Change description passed to
- BONOBO_ACTIVATION_SHLIB_FACTORY to correctly say we are a factroy.
-
-2002-12-04 Ettore Perazzoli <ettore@ximian.com>
-
- * Makefile.am (componentdir): Install in $(COMPONENT_DIR), not in
- ${prefix}/evolution/components.
-
-2002-12-04 Ettore Perazzoli <ettore@ximian.com>
-
- * GNOME_Evolution_Summary.server.in.in: Updated to be a shared
- library.
-
- * main.c: Removed.
-
- * Makefile.am: Update to compile as a shared library.
-
- * component-factory.c: Changed to be a shared library factory, for
- both the ShellComponent and the ConfigControl objects.
-
- * e-summary-preferences.c
- (e_summary_preferences_init_config_control): Renamed from
- e_summary_preferences_register_config_control_factory.
- (e_summary_preferences_create_control): Renamed from factory_fn
- and removed all args.
-
-2002-11-27 Not Zed <NotZed@Ximian.com>
-
- * e-summary-shown.c (e_summary_shown_init): GNOME_STOCK_*NEXT/PREV ->
- GTK_STOCK_*GO_BACK/FORWARD.
-
- * e-summary.[ch]: ran fix.sh over this.
-
-2002-11-25 Ettore Perazzoli <ettore@ximian.com>
-
- * component-factory.c (component_destroy): Removed.
- (create_component): Do not connect.
-
-2002-11-20 Ettore Perazzoli <ettore@ximian.com>
-
- * component-factory.c (owner_unset_cb): bonobo_main_quit() instead
- of gtk_main_quit().
- (component_destroy): Likewise.
-
-2002-11-20 Ettore Perazzoli <ettore@ximian.com>
-
- * component-factory.c: Removed unused #define
- COMPONENT_FACTORY_ID.
- (component_factory_init): Removed unused variable.
-
- * GNOME_Evolution_Summary.server.in.in: Updated to not use a
- factory, which is what the code actually expects.
-
-2002-11-20 Ettore Perazzoli <ettore@ximian.com>
-
- * e-summary.c (e_summary_init): Use GConf.
-
- * e-summary-tasks.c: Replaced member config_listener in
- ESummaryTasks with a gconf_client.
- (setup_gconf_client): Renamed from setup_config_listener(). Set
- up the GConf client and invoke gconf_client_add_dir() on the
- interesting namespaces.
- (gconf_client_value_changed_cb): Renamed from
- config_listener_value_changed_cb and changed prototype to match
- that of the "value_changed" signal in GConfClient.
- (setup_task_folder): Updated to use GConf.
-
- * e-summary-calendar.c: Replaced member config_listener with a
- gconf_listener.
- (setup_calendar): Use GConf.
- (setup_gconf_client): Renamed from setup_config_listener. Set up
- a GConf client and invoke gconf_client_add_dir() on the
- interesting namespaces.
- (gconf_client_value_changed_cb): Renamed from
- config_listener_key_changed_cb() and changed prototype to match
- that of the "value_changed" signal in GConfClient.
- (locale_uses_24h_time_format): Removed.
- (e_summary_calendar_free): g_object_unref() the gconf_client.
-
- * Makefile.am: Add rules to install the schemas.
-
- * apps_evolution_summary.schemas: New.
-
- * e-summary-preferences.c: Did a global GList -> GSList switch.
- (e_summary_preferences_restore): Use GConfClient instead of
- EConfigListener.
- (vector_from_folder_list): Removed since GConf makes this useless.
- (folder_list_from_vector): Likewise.
- (str_list_from_vector): Likewise.
- (vector_from_str_list): Likewise.
- (make_initial_weather_list): Likewise.
- (make_initial_rdf_list): Likewise.
- (make_initial_mail_list): Likewise.
- (e_summary_preferences_save): Use GConf.
- (e_summary_preferences_init): No need to set up defaults here.
-
- * e-summary.h: Changed members display_folders, rdf_urls, stations
- in ESummaryPrefs to be GSLists instead of GLists; updated all the
- functions that use them accordingly.
-
-2002-11-14 Ettore Perazzoli <ettore@ximian.com>
-
- * Makefile.am: Added rule to generate
- GNOME_Evolution_Summary.server.in from
- GNOME_Evolution_Summary.server.in.in, substituting @LIBEXECDIR@.
- Also, install evolution-executive-summary in $libexecdir instead
- of $bindir.
-
- * GNOME_Evolution_Summary.server.in.in: Removed the @OAF_SHLIB_*@
- stuff and added @LIBEXECDIR@/ to the executable's name instead.
-
-2002-11-14 Ettore Perazzoli <ettore@ximian.com>
-
- * my-evolution.glade: Converted to Glade 2.
-
-2002-11-14 Ettore Perazzoli <ettore@ximian.com>
-
- * e-summary-calendar.c: Replaced all gtk_signal_connect() calls
- with g_signal_connect() ones.
- * e-summary-mail.c: Likewise.
- * e-summary-offline-handler.c: Likewise.
- * e-summary-preferences.c: Likewise.
- * e-summary-shown.c: Likewise.
- * e-summary-tasks.c: Likewise.
- * e-summary.c: Likewise.
-
-2002-11-11 Ettore Perazzoli <ettore@ximian.com>
-
- * e-summary-factory.c (control_destroy_cb): gtk_widget_destroy()
- instead of gtk_object_destroy().
- (e_summary_factory_new_control): Likewise.
-
- * e-summary-calendar.c: Use g_object_ref()/g_object_unref()
- instead of gtk_object_ref()/gtk_object_unref().
- * e-summary-preferences.c: Likewise.
- * e-summary-shown.c: Likewise.
- * e-summary-table.c: Likewise.
- * e-summary-tasks.c: Likewise.
- * e-summary.c: Likewise.
-
- * e-summary-preferences.c (e_summary_preferences_make_mail_table):
- g_object_set_data() instead of gtk_object_set_data().
- (make_property_dialog): g_object_get_data() instead of
- gtk_object_get_data().
- (get_folders_from_view): Likewise.
-
- * component-factory.c (create_view): Use
- evolution_shell_client_corba_objref() instead of
- bonobo_object_corba_objref() on the EvolutionShellClient object.
- Also, use g_object_get_data() instead of gtk_object_get_data().
- (owner_set_cb): Likewise.
- (create_component): Use g_object_set_data() instead of
- gtk_object_set_data().
-
-2002-11-11 Ettore Perazzoli <ettore@ximian.com>
-
- * e-summary-rdf.c: Convert to use libxml2.
-
-2002-11-11 Ettore Perazzoli <ettore@ximian.com>
-
- * e-summary-offline-handler.c: Convert from GtkObject to GObject.
-
-2002-11-07 Ettore Perazzoli <ettore@ximian.com>
-
- * GNOME_Evolution_Summary.server.in.in: Renamed from
- GNOME_Evolution_Summary.oaf.in.in.
-
- * Makefile.am: GNOME_Evolution_Summary.server instead of .oaf.
-
-2002-11-05 Ettore Perazzoli <ettore@ximian.com>
-
- * metar.c: #include <string.h>.
-
- * main.c (main): Use gnome_program_init().
-
- * e-summary-tasks.c (e_summary_tasks_protocol): Use
- bonobo-activation.
-
- * e-summary-table.c (set_value_at): Use g_signal_emit() instead of
- gtk_signal_emit().
-
- * e-summary-shown.c (e_summary_shown_class_init): GObjectified.
- (construct_pixmap_button): Use gtk_image_new_from_stock() instead
- of gnome_stock_pixmap_new().
-
- * e-summary-preferences.c (e_summary_preferences_restore): Use
- EConfigListener.
- (add_dialog_clicked_cb): Add some missing consts.
- (factory_fn): Pass NULL as the domain arg to glade_xml_new().
- (factory_fn): Add id arg.
- (e_summary_preferences_register_config_control_factory):
-
- * e-summary-mail.c (e_summary_folder_init_folder_store): Use
- bonobo-activation.
-
- * e-summary-factory.c (control_activate): Pass NULL ev arg to
- bonobo functions that now need it.
- (control_deactivate): Likewise.
- (control_activate_cb): Likewise.
- (e_summary_factory_new_control): Use g_signal_connect() instead of
- gtk_signal_connect().
-
- * e-summary-calendar.c (e_summary_calendar_protocol): Use
- bonobo_activation.
-
- * e-summary.c: Update gnome-print #includes. Added some missing
- #includes.
- (e_summary_url_clicked): Pass NULL as the error arg to
- gnome_url_show().
- (do_summary_print): Use GnomePrintConfig instead of GnomePrinter
- et al.
-
- * e-cell-tri.h: Removed BEGIN_GNOME_DECLS/END_GNOME_DECLS.
-
- * e-summary.c: Removed #include <libgnome/gnome-defs.h>. Ported
- to e-config-listener.c.
-
- * e-cell-tri.h: Removed #include <libgnome/gnome-defs.h>.
-
- * component-factory.c: #include <gtk/gtkmain.h>.
- (create_component): Use g_signal_connect. Match prototype with
- the one required by bonobo_generic_factory().
-
- * Makefile.am: Add @INTLTOOL_SERVER_RULE@.
- ($(MAIL_GENERATED)): Update with new ORBit rules.
-
2002-10-25 Ettore Perazzoli <ettore@ximian.com>
* e-cell-tri.c (set_value): Removed debugging message.
diff --git a/my-evolution/Locations b/my-evolution/Locations
index c7d42f2298..6b904fc78a 100644
--- a/my-evolution/Locations
+++ b/my-evolution/Locations
@@ -1063,18 +1063,19 @@ loc17=Jackson KJXN MIZ074 dtw
loc18=Kalamazoo KAZO MIZ072 045
loc19=Lansing KLAN MIZ066 ---
loc20=Manistee KMBL MIZ031 ---
-loc21=Menominee KMNM MIZ012 ---
-loc22=Mount\\ Clemens KMTC MIZ070 ---
-loc23=Muskegon KMKG MIZ050 ---
-loc24=Oscoda KOSC MIZ036 ---
-loc25=Pellston KPLN MIZ016 ---
-loc26=Pontiac KPTK MIZ069 ---
-loc27=Saginaw KMBS MIZ053 ---
-loc28=Sault\\ Ste\\ Marie KSSM MIZ008 ---
-loc29=Sawyer\\ AFB KSAW MIZ077 ---
-loc30=Seul\\ Choix\\ Pt KP75 ------ ---
-loc31=Traverse\\ City KTVC MIZ020 ---
-loc32=Ypsilanti KYIP MIZ075 dtw
+loc21=Marquette KMQT MIZ005 ---
+loc22=Menominee KMNM MIZ012 ---
+loc23=Mount\\ Clemens KMTC MIZ070 ---
+loc24=Muskegon KMKG MIZ050 ---
+loc25=Oscoda KOSC MIZ036 ---
+loc26=Pellston KPLN MIZ016 ---
+loc27=Pontiac KPTK MIZ069 ---
+loc28=Saginaw KMBS MIZ053 ---
+loc29=Sault\\ Ste\\ Marie KSSM MIZ008 ---
+loc30=Sawyer\\ AFB KSAW MIZ077 ---
+loc31=Seul\\ Choix\\ Pt KP75 ------ ---
+loc32=Traverse\\ City KTVC MIZ020 ---
+loc33=Ypsilanti KYIP MIZ075 dtw
[US_MN]
name=Minnesota
@@ -1944,32 +1945,20 @@ loc2=Portoroz LJPZ ------ ---
[EU_SE]
name=Sweden
-loc0=Borlange ESSD ------ --
-loc1=Gavle\\ Sandviken ESSK ------ --
-loc2=Gallivare ESNG ------ --
-loc3=Goteborg\\ (Landvetter) ESGG ------ --
-loc4=Goteborg\\ (Save) ESGP ------ --
-loc5=Hagshult ESMV ------ --
-loc6=Halmstad\\ (Swedish\\ Air\\ Force\\ Base) ESMT ------ --
-loc7=Hultsfred\\ (Swedish\\ Air\\ Force\\ Base) ESSF ------ --
-loc8=Jonkoping ESGJ ------ ---
-loc9=Kiruna ESNQ ------ ---
-loc10=Linkoping\\ (Malmen) ESCF ------ --
-loc11=Linkoping\\ (Saab) ESSL ------ --
-loc12=Lulea\\ (Kallax) ESPA ------ --
-loc13=Malmo\\ (Sturup) ESMS ------ --
-loc14=Norrkoping ESSP ------ ---
-loc15=Ronneby ESDF ------ ---
-loc16=Stockholm\\ (Arlanda) ESSA ------ --
-loc17=Stockholm\\ (Bromma) ESSB ------ --
-loc18=Sundsvall-Harnosand ESNN ------ --
-loc19=Umea ESNU ------ ---
-loc20=Vasteras ESOW ------ ---
-loc21=Vaxjo ESMX ------ ---
-loc22=Visby ESSV ------ --
-loc23=Angelholm ESDB ------ --
-loc24=Ornskoldsvik ESNO ------ --
-loc25=Ostersund\\ (Froson) ESPC ------ --
+loc0=Goteborg\\ (Landvetter) ESGG ------ ---
+loc1=Goteborg\\ (Save) ESGP ------ ---
+loc2=Jonkoping ESGJ ------ ---
+loc3=Kiruna ESNQ ------ ---
+loc4=Malmo/Sturup ESMS ------ ---
+loc5=Norrkoping ESSP ------ ---
+loc6=Ronneby ESDF ------ ---
+loc7=Stockholm\\ (Arlanda) ESSA ------ ---
+loc8=Stockholm\\ (Bromma) ESSB ------ ---
+loc9=Sundsvall-Harnosand ESNN ------ ---
+loc10=Umea ESNU ------ ---
+loc11=Vasteras ESOW ------ ---
+loc12=Vaxjo ESMX ------ ---
+loc13=Visby ESSV ------ ---
[EU_CH]
name=Switzerland
diff --git a/my-evolution/e-summary-preferences.c b/my-evolution/e-summary-preferences.c
index c99069c0d2..692ba16a5e 100644
--- a/my-evolution/e-summary-preferences.c
+++ b/my-evolution/e-summary-preferences.c
@@ -1,7 +1,7 @@
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
/* e-summary-preferences.c
*
- * Copyright (C) 2001, 2002 Ximian, Inc.
+ * Copyright (C) 2001 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
@@ -26,11 +26,13 @@
#include <gtk/gtk.h>
+#include <libgnome/gnome-defs.h>
#include <libgnome/gnome-util.h>
#include <libgnome/gnome-i18n.h>
#include <libgnome/gnome-config.h>
#include <libgnomeui/gnome-propertybox.h>
+#include <libgnomeui/gnome-stock.h>
#include <glade/glade.h>
#include <stdio.h>
@@ -42,12 +44,10 @@
#include <bonobo/bonobo-control.h>
#include <bonobo/bonobo-widget.h>
-#include <gconf/gconf-client.h>
+#include <bonobo-conf/bonobo-config-database.h>
#include <shell/evolution-storage-set-view-listener.h>
-#include <string.h>
-
#include "e-summary.h"
#include "e-summary-preferences.h"
#include "e-summary-table.h"
@@ -55,125 +55,335 @@
#include "evolution-config-control.h"
+#define FACTORY_ID "OAFIID:GNOME_Evolution_Summary_ConfigControlFactory"
+
static ESummaryPrefs *global_preferences = NULL;
static GNOME_Evolution_Shell global_shell = NULL;
-gboolean
-e_summary_preferences_restore (ESummaryPrefs *prefs)
+static char *default_folders[2] = {
+ "/local/Inbox", "/local/Outbox"
+};
+
+static void
+make_initial_mail_list (ESummaryPrefs *prefs)
{
- GConfClient *gconf_client;
- GSList *path_list;
- GSList *uri_list;
- GSList *p, *q;
+ char *evolution_dir;
+ GList *folders = NULL;
+ int i;
+
+ evolution_dir = gnome_util_prepend_user_home ("evolution");
+ for (i = 0; i < 2; i++) {
+ ESummaryPrefsFolder *folder;
- g_return_val_if_fail (prefs != NULL, FALSE);
+ folder = g_new (ESummaryPrefsFolder, 1);
+ folder->evolution_uri = g_strconcat ("evolution:", default_folders[i], NULL);
+ folder->physical_uri = g_strconcat ("file://", evolution_dir, default_folders[i], NULL);
+
+ folders = g_list_append (folders, folder);
+ }
+
+ g_free (evolution_dir);
+ prefs->display_folders = folders;
+}
+
+static void
+make_initial_rdf_list (ESummaryPrefs *prefs)
+{
+ GList *rdfs;
+
+ rdfs = g_list_prepend (NULL, g_strdup ("http://linuxtoday.com/backend/my-netscape.rdf"));
+ rdfs = g_list_append (rdfs, g_strdup ("http://www.salon.com/feed/RDF/salon_use.rdf"));
+
+ prefs->rdf_urls = rdfs;
+}
+
+static void
+make_initial_weather_list (ESummaryPrefs *prefs)
+{
+ /* translators: Put a list of codes for locations you want to see in
+ My Evolution by default here. You can find the list of all
+ stations and their codes in Evolution sources.
+ (evolution/my-evolution/Locations)
+ Codes are seperated with : eg. "KBOS:EGAA"*/
+ char *default_stations = _("KBOS"), **stations_v, **p;
+ GList *stations = NULL;
+
+ stations_v = g_strsplit (default_stations, ":", 0);
+ g_assert (stations_v != NULL);
+ for (p = stations_v; *p != NULL; p++) {
+ stations = g_list_prepend (stations, *p);
+ }
+ g_free (stations_v);
+
+ prefs->stations = g_list_reverse (stations);
+}
+
+/* Load the prefs off disk */
+
+static char *
+vector_from_str_list (GList *strlist)
+{
+ char *vector;
+ GString *str;
+
+ if (strlist == NULL) {
+ return g_strdup ("");
+ }
+
+ str = g_string_new ("");
+ for (; strlist; strlist = strlist->next) {
+ g_string_append (str, strlist->data);
+
+ /* No space at end */
+ if (strlist->next) {
+ g_string_append (str, " !<-->! ");
+ }
+ }
+
+ vector = str->str;
+ g_string_free (str, FALSE);
+
+ return vector;
+}
+
+static GList *
+str_list_from_vector (const char *vector)
+{
+ GList *strlist = NULL;
+ char **tokens, **t;
+
+ t = tokens = g_strsplit (vector, " !<-->! ", 8196);
+
+ if (tokens == NULL) {
+ return NULL;
+ }
- gconf_client = gconf_client_get_default ();
+ for (; *tokens; tokens++) {
+ strlist = g_list_prepend (strlist, g_strdup (*tokens));
+ }
- path_list = gconf_client_get_list (gconf_client, "/apps/evolution/summary/mail/folder_evolution_uris",
- GCONF_VALUE_STRING, NULL);
- uri_list = gconf_client_get_list (gconf_client, "/apps/evolution/summary/mail/folder_physical_uris",
- GCONF_VALUE_STRING, NULL);
+ g_strfreev (t);
+
+ strlist = g_list_reverse (strlist);
+ return strlist;
+}
- prefs->display_folders = NULL;
- for (p = path_list, q = uri_list; p != NULL && q != NULL; p = p->next, q = q->next) {
+static GList *
+folder_list_from_vector (const char *vector)
+{
+ GList *flist = NULL;
+ char **tokens, **t;
+
+ t = tokens = g_strsplit (vector, " !<-->! ", 8196);
+ if (tokens == NULL) {
+ return NULL;
+ }
+
+ for (tokens = t; *tokens; tokens += 2) {
ESummaryPrefsFolder *folder;
+ const char *evolution_uri;
+ const char *physical_uri;
+
+ evolution_uri = *tokens;
+ if (evolution_uri == NULL || strncmp (evolution_uri, "evolution:", 10) != 0)
+ break;
+
+ physical_uri = *(tokens + 1);
+ if (physical_uri == NULL)
+ break;
folder = g_new (ESummaryPrefsFolder, 1);
- folder->evolution_uri = p->data;
- folder->physical_uri = q->data;
- prefs->display_folders = g_slist_append(prefs->display_folders, folder);
+ folder->evolution_uri = g_strdup (evolution_uri);
+ folder->physical_uri = g_strdup (physical_uri);
+
+ flist = g_list_prepend (flist, folder);
+ }
+
+ g_strfreev (t);
+
+ flist = g_list_reverse (flist);
+ return flist;
+}
+
+static char *
+vector_from_folder_list (GList *flist)
+{
+ char *vector;
+ GString *string;
+
+ if (flist == NULL) {
+ return g_strdup ("");
+ }
+
+ string = g_string_new ("");
+ for (; flist; flist = flist->next) {
+ ESummaryPrefsFolder *folder;
+
+ folder = flist->data;
+ string = g_string_append (string, folder->evolution_uri);
+ string = g_string_append (string, " !<-->! ");
+ string = g_string_append (string, folder->physical_uri);
+
+ if (flist->next != NULL) {
+ string = g_string_append (string, " !<-->! ");
+ }
}
- g_slist_free (path_list);
- g_slist_free (uri_list);
+ vector = string->str;
+ g_string_free (string, FALSE);
- prefs->show_full_path = gconf_client_get_bool (gconf_client, "/apps/evolution/summary/mail/show_full_paths", NULL);
+ return vector;
+}
- prefs->rdf_urls = gconf_client_get_list (gconf_client, "/apps/evolution/summary/rdf/uris",
- GCONF_VALUE_STRING, NULL);
+gboolean
+e_summary_preferences_restore (ESummaryPrefs *prefs)
+{
+ Bonobo_ConfigDatabase db;
+ CORBA_Environment ev;
+ char *vector;
- prefs->rdf_refresh_time = gconf_client_get_int (gconf_client, "/apps/evolution/summary/rdf/refresh_time", NULL);
+ g_return_val_if_fail (prefs != NULL, FALSE);
+
+ CORBA_exception_init (&ev);
+ db = bonobo_get_object ("wombat:", "Bonobo/ConfigDatabase", &ev);
+ if (BONOBO_EX (&ev) || db == CORBA_OBJECT_NIL) {
+ g_warning ("Error getting Wombat. Using defaults");
+ CORBA_exception_free (&ev);
+ return FALSE;
+ }
- prefs->limit = gconf_client_get_int (gconf_client, "/apps/evolution/summary/rdf/max_items", NULL);
+ CORBA_exception_free (&ev);
+ vector = bonobo_config_get_string (db, "My-Evolution/Mail/display_folders-1.2", &ev);
+ if (BONOBO_EX (&ev)) {
+ g_warning ("Error getting Mail/display_folders. Using defaults");
+ CORBA_exception_free (&ev);
+ make_initial_mail_list (prefs);
+ } else {
+ prefs->display_folders = folder_list_from_vector (vector);
+ g_free (vector);
+ }
- prefs->stations = gconf_client_get_list (gconf_client, "/apps/evolution/summary/weather/stations",
- GCONF_VALUE_STRING, NULL);
+ prefs->show_full_path = bonobo_config_get_boolean (db, "My-Evolution/Mail/show_full_path", &ev);
+ if (BONOBO_EX (&ev) || db == CORBA_OBJECT_NIL) {
+ g_warning ("Error getting Mail/show_full_path. Using defaults");
+ bonobo_object_release_unref (db, NULL);
+ CORBA_exception_free (&ev);
+ return FALSE;
+ }
- if (gconf_client_get_bool (gconf_client, "/apps/evolution/summary/weather/use_metric", NULL))
- prefs->units = UNITS_METRIC;
- else
- prefs->units = UNITS_IMPERIAL;
- prefs->weather_refresh_time = gconf_client_get_int (gconf_client, "/apps/evolution/summary/weather/refresh_time",
- NULL);
+ vector = bonobo_config_get_string (db, "My-Evolution/RDF/rdf_urls", &ev);
+ if (BONOBO_EX (&ev)) {
+ g_warning ("Error getting RDF/rdf_urls");
+ CORBA_exception_free (&ev);
+ bonobo_object_release_unref (db, NULL);
+ return FALSE;
+ }
+ prefs->rdf_urls = str_list_from_vector (vector);
+ g_free (vector);
+
+ prefs->rdf_refresh_time = bonobo_config_get_long_with_default (db, "My-Evolution/RDF/rdf_refresh_time", 600, NULL);
+
+ prefs->limit = bonobo_config_get_long_with_default (db, "My-Evolution/RDF/limit", 10, NULL);
+
+ vector = bonobo_config_get_string (db, "My-Evolution/Weather/stations", &ev);
+ if (BONOBO_EX (&ev)) {
+ g_warning ("Error getting Weather/stations");
+ CORBA_exception_free (&ev);
+ bonobo_object_release_unref (db, NULL);
+ return FALSE;
+ }
+ prefs->stations = str_list_from_vector (vector);
+ g_free (vector);
+
+ prefs->units = bonobo_config_get_long (db, "My-Evolution/Weather/units", &ev);
+ if (BONOBO_EX (&ev) || db == CORBA_OBJECT_NIL) {
+ g_warning ("Error getting Weather/units. Using defaults");
+ bonobo_object_release_unref (db, NULL);
+ CORBA_exception_free (&ev);
+ return FALSE;
+ }
+
+ prefs->weather_refresh_time = bonobo_config_get_long (db, "My-Evolution/Weather/weather_refresh_time", &ev);
+ if (BONOBO_EX (&ev) || db == CORBA_OBJECT_NIL) {
+ g_warning ("Error getting Weather/weather_refresh_time. Using defaults");
+ bonobo_object_release_unref (db, NULL);
+ CORBA_exception_free (&ev);
+ return FALSE;
+ }
+
- prefs->days = gconf_client_get_int (gconf_client, "/apps/evolution/summary/calendar/days_shown", NULL);
- if (gconf_client_get_bool (gconf_client, "/apps/evolution/summary/tasks/show_all", NULL))
- prefs->show_tasks = E_SUMMARY_CALENDAR_ALL_TASKS;
- else
- prefs->show_tasks = E_SUMMARY_CALENDAR_ONE_DAY;
+ prefs->days = bonobo_config_get_long (db, "My-Evolution/Schedule/days", &ev);
+ if (BONOBO_EX (&ev) || db == CORBA_OBJECT_NIL) {
+ g_warning ("Error getting Schedule/days. Using defaults");
+ bonobo_object_release_unref (db, NULL);
+ CORBA_exception_free (&ev);
+ return FALSE;
+ }
+
+ prefs->show_tasks = bonobo_config_get_long (db, "My-Evolution/Schedule/show_tasks", &ev);
+ if (BONOBO_EX (&ev) || db == CORBA_OBJECT_NIL) {
+ g_warning ("Error getting Schedule/show_tasks. Using defaults");
+ bonobo_object_release_unref (db, NULL);
+ CORBA_exception_free (&ev);
+ return FALSE;
+ }
- g_object_unref (gconf_client);
+ bonobo_object_release_unref (db, NULL);
return TRUE;
}
+/* Write prefs to disk */
void
e_summary_preferences_save (ESummaryPrefs *prefs)
{
- GConfClient *gconf_client;
- GSList *evolution_uri_list, *physical_uri_list;
- GSList *p;
-
- gconf_client = gconf_client_get_default ();
+ Bonobo_ConfigDatabase db;
+ CORBA_Environment ev;
+ char *vector;
- evolution_uri_list = NULL;
- physical_uri_list = NULL;
- for (p = prefs->display_folders; p != NULL; p = p->next) {
- const ESummaryPrefsFolder *folder;
+ g_return_if_fail (prefs != NULL);
- folder = (const ESummaryPrefsFolder *) p->data;
- evolution_uri_list = g_slist_prepend (evolution_uri_list, folder->evolution_uri);
- physical_uri_list = g_slist_prepend (physical_uri_list, folder->physical_uri);
+ CORBA_exception_init (&ev);
+ db = bonobo_get_object ("wombat:", "Bonobo/ConfigDatabase", &ev);
+ if (BONOBO_EX (&ev) || db == CORBA_OBJECT_NIL) {
+ g_warning ("Cannot save preferences");
+ CORBA_exception_free (&ev);
+ return;
}
- evolution_uri_list = g_slist_reverse (evolution_uri_list);
- physical_uri_list = g_slist_reverse (physical_uri_list);
-
- gconf_client_set_list (gconf_client, "/apps/evolution/summary/mail/folder_evolution_uris",
- GCONF_VALUE_STRING, evolution_uri_list, NULL);
- gconf_client_set_list (gconf_client, "/apps/evolution/summary/mail/folder_physical_uris",
- GCONF_VALUE_STRING, physical_uri_list, NULL);
+ CORBA_exception_free (&ev);
- g_slist_free (evolution_uri_list);
- g_slist_free (physical_uri_list);
+ vector = vector_from_folder_list (prefs->display_folders);
+ bonobo_config_set_string (db, "My-Evolution/Mail/display_folders-1.2", vector, NULL);
+ g_free (vector);
- gconf_client_set_bool (gconf_client, "/apps/evolution/summary/mail/show_full_paths", prefs->show_full_path, NULL);
+ bonobo_config_set_boolean (db, "My-Evolution/Mail/show_full_path", prefs->show_full_path, NULL);
- gconf_client_set_list (gconf_client, "/apps/evolution/summary/rdf/uris",
- GCONF_VALUE_STRING, prefs->rdf_urls, NULL);
+ vector = vector_from_str_list (prefs->rdf_urls);
+ bonobo_config_set_string (db, "My-Evolution/RDF/rdf_urls", vector, NULL);
+ g_free (vector);
- gconf_client_set_int (gconf_client, "/apps/evolution/summary/rdf/refresh_time", prefs->rdf_refresh_time, NULL);
- gconf_client_set_int (gconf_client, "/apps/evolution/summary/rdf/max_items", prefs->limit, NULL);
+ bonobo_config_set_long (db, "My-Evolution/RDF/rdf_refresh_time", prefs->rdf_refresh_time, NULL);
+ bonobo_config_set_long (db, "My-Evolution/RDF/limit", prefs->limit, NULL);
- gconf_client_set_list (gconf_client, "/apps/evolution/summary/weather/stations",
- GCONF_VALUE_STRING, prefs->stations, NULL);
+ vector = vector_from_str_list (prefs->stations);
+ bonobo_config_set_string (db, "My-Evolution/Weather/stations", vector, NULL);
+ g_free (vector);
- gconf_client_set_bool (gconf_client, "/apps/evolution/summary/weather/use_metric",
- prefs->units == UNITS_METRIC, NULL);
- gconf_client_set_int (gconf_client, "/apps/evolution/summary/weather/refresh_time",
- prefs->weather_refresh_time, NULL);
+ bonobo_config_set_long (db, "My-Evolution/Weather/units", prefs->units, NULL);
+ bonobo_config_set_long (db, "My-Evolution/Weather/weather_refresh_time", prefs->weather_refresh_time, NULL);
- gconf_client_set_int (gconf_client, "/apps/evolution/summary/calendar/days_shown",
- prefs->days, NULL);
+ bonobo_config_set_long (db, "My-Evolution/Schedule/days", prefs->days, NULL);
+ bonobo_config_set_long (db, "My-Evolution/Schedule/show_tasks", prefs->show_tasks, NULL);
- gconf_client_set_bool (gconf_client, "/apps/evolution/summary/tasks/show_all",
- prefs->show_tasks == E_SUMMARY_CALENDAR_ALL_TASKS, NULL);
+ CORBA_exception_init (&ev);
+ Bonobo_ConfigDatabase_sync (db, &ev);
+ CORBA_exception_free (&ev);
- g_object_unref (gconf_client);
+ bonobo_object_release_unref (db, NULL);
}
static void
-free_str_list (GSList *list)
+free_str_list (GList *list)
{
for (; list; list = list->next) {
g_free (list->data);
@@ -181,7 +391,7 @@ free_str_list (GSList *list)
}
static void
-free_folder_list (GSList *list)
+free_folder_list (GList *list)
{
for (; list; list = list->next) {
ESummaryPrefsFolder *f = list->data;
@@ -197,39 +407,39 @@ e_summary_preferences_free (ESummaryPrefs *prefs)
{
if (prefs->display_folders) {
free_folder_list (prefs->display_folders);
- g_slist_free (prefs->display_folders);
+ g_list_free (prefs->display_folders);
}
if (prefs->rdf_urls) {
free_str_list (prefs->rdf_urls);
- g_slist_free (prefs->rdf_urls);
+ g_list_free (prefs->rdf_urls);
}
if (prefs->stations) {
free_str_list (prefs->stations);
- g_slist_free (prefs->stations);
+ g_list_free (prefs->stations);
}
g_free (prefs);
}
-static GSList *
-copy_str_list (GSList *list)
+static GList *
+copy_str_list (GList *list)
{
- GSList *list_copy = NULL;
+ GList *list_copy = NULL;
for (; list; list = list->next) {
- list_copy = g_slist_prepend (list_copy, g_strdup (list->data));
+ list_copy = g_list_prepend (list_copy, g_strdup (list->data));
}
- list_copy = g_slist_reverse (list_copy);
+ list_copy = g_list_reverse (list_copy);
return list_copy;
}
-static GSList *
-copy_folder_list (GSList *list)
+static GList *
+copy_folder_list (GList *list)
{
- GSList *list_copy = NULL;
+ GList *list_copy = NULL;
for (; list; list = list->next) {
ESummaryPrefsFolder *f1, *f2;
@@ -239,10 +449,10 @@ copy_folder_list (GSList *list)
f2->evolution_uri = g_strdup (f1->evolution_uri);
f2->physical_uri = g_strdup (f1->physical_uri);
- list_copy = g_slist_prepend (list_copy, f2);
+ list_copy = g_list_prepend (list_copy, f2);
}
- list_copy = g_slist_reverse (list_copy);
+ list_copy = g_list_reverse (list_copy);
return list_copy;
}
@@ -282,7 +492,27 @@ e_summary_preferences_init (void)
prefs = g_new0 (ESummaryPrefs, 1);
global_preferences = prefs;
- e_summary_preferences_restore (prefs);
+ if (e_summary_preferences_restore (prefs) == TRUE) {
+ return prefs;
+ }
+
+ /* Defaults */
+
+ /* Mail */
+ make_initial_mail_list (prefs);
+
+ /* RDF */
+ make_initial_rdf_list (prefs);
+ prefs->rdf_refresh_time = 600;
+ prefs->limit = 10;
+
+ /* Weather */
+ make_initial_weather_list (prefs);
+ prefs->units = UNITS_METRIC;
+ prefs->weather_refresh_time = 600;
+
+ prefs->days = E_SUMMARY_CALENDAR_ONE_DAY;
+ prefs->show_tasks = E_SUMMARY_CALENDAR_ALL_TASKS;
return prefs;
}
@@ -290,8 +520,6 @@ e_summary_preferences_init (void)
ESummaryPrefs *
e_summary_preferences_get_global (void)
{
- g_assert(global_preferences);
-
return global_preferences;
}
@@ -302,7 +530,7 @@ struct _MailPage {
GtkWidget *add, *remove;
GHashTable *model;
- GSList *tmp_list;
+ GList *tmp_list;
};
struct _RDFPage {
@@ -311,7 +539,7 @@ struct _RDFPage {
GtkWidget *new_button, *delete_url;
GHashTable *default_hash, *model;
- GSList *known, *tmp_list;
+ GList *known, *tmp_list;
};
struct _WeatherPage {
@@ -320,7 +548,7 @@ struct _WeatherPage {
GtkWidget *add, *remove;
GHashTable *model;
- GSList *tmp_list;
+ GList *tmp_list;
};
struct _CalendarPage {
@@ -381,7 +609,7 @@ static struct _RDFInfo rdfs[] = {
};
static void
-save_known_rdfs (GSList *rdfs)
+save_known_rdfs (GList *rdfs)
{
FILE *handle;
char *rdf_file;
@@ -417,7 +645,7 @@ static gboolean
rdf_is_shown (PropertyData *pd,
const char *url)
{
- GSList *p;
+ GList *p;
for (p = global_preferences->rdf_urls; p; p = p->next) {
if (strcmp (p->data, url) == 0) {
@@ -443,7 +671,6 @@ fill_rdf_etable (GtkWidget *widget,
}
ess = E_SUMMARY_SHOWN (widget);
- e_summary_shown_freeze (ess);
/* Fill the defaults first */
for (i = 0; rdfs[i].url; i++) {
@@ -453,7 +680,7 @@ fill_rdf_etable (GtkWidget *widget,
entry->showable = TRUE;
entry->data = &rdfs[i];
- e_summary_shown_add_node (ess, TRUE, entry, NULL, FALSE, NULL);
+ e_summary_shown_add_node (ess, TRUE, entry, NULL, TRUE, NULL);
if (rdf_is_shown (pd, rdfs[i].url) == TRUE) {
entry = g_new (ESummaryShownModelEntry, 1);
@@ -462,10 +689,10 @@ fill_rdf_etable (GtkWidget *widget,
entry->showable = TRUE;
entry->data = &rdfs[i];
- e_summary_shown_add_node (ess, FALSE, entry, NULL, FALSE, NULL);
+ e_summary_shown_add_node (ess, FALSE, entry, NULL, TRUE, NULL);
}
- pd->rdf->known = g_slist_append (pd->rdf->known, &rdfs[i]);
+ pd->rdf->known = g_list_append (pd->rdf->known, &rdfs[i]);
g_hash_table_insert (pd->rdf->default_hash, rdfs[i].url, &rdfs[i]);
}
@@ -483,7 +710,6 @@ fill_rdf_etable (GtkWidget *widget,
}
if (handle == NULL) {
- e_summary_shown_thaw (ess);
return;
}
@@ -512,7 +738,7 @@ fill_rdf_etable (GtkWidget *widget,
info->name = g_strdup (tokens[1]);
info->custom = TRUE;
- pd->rdf->known = g_slist_append (pd->rdf->known, info);
+ pd->rdf->known = g_list_append (pd->rdf->known, info);
entry = g_new (ESummaryShownModelEntry, 1);
entry->location = g_strdup (info->url);
@@ -520,7 +746,7 @@ fill_rdf_etable (GtkWidget *widget,
entry->showable = TRUE;
entry->data = info;
- e_summary_shown_add_node (ess, TRUE, entry, NULL, FALSE, NULL);
+ e_summary_shown_add_node (ess, TRUE, entry, NULL, TRUE, NULL);
if (rdf_is_shown (pd, tokens[0]) == TRUE) {
entry = g_new (ESummaryShownModelEntry, 1);
@@ -529,14 +755,13 @@ fill_rdf_etable (GtkWidget *widget,
entry->showable = TRUE;
entry->data = info;
- e_summary_shown_add_node (ess, FALSE, entry, NULL, FALSE, NULL);
+ e_summary_shown_add_node (ess, FALSE, entry, NULL, TRUE, NULL);
}
g_strfreev (tokens);
}
fclose (handle);
- e_summary_shown_thaw (ess);
}
static void
@@ -561,8 +786,8 @@ add_dialog_clicked_cb (GtkWidget *widget,
PropertyData *pd)
{
if (button == 0) {
- const char *url;
- const char *name;
+ char *url;
+ char *name;
name = gtk_entry_get_text (GTK_ENTRY (pd->new_name_entry));
url = gtk_entry_get_text (GTK_ENTRY (pd->new_url_entry));
@@ -577,7 +802,7 @@ add_dialog_clicked_cb (GtkWidget *widget,
info->name = g_strdup (name);
info->custom = TRUE;
- pd->rdf->known = g_slist_append (pd->rdf->known, info);
+ pd->rdf->known = g_list_append (pd->rdf->known, info);
entry = g_new (ESummaryShownModelEntry, 1);
entry->location = g_strdup (info->url);
@@ -586,7 +811,7 @@ add_dialog_clicked_cb (GtkWidget *widget,
entry->data = info;
e_summary_shown_add_node (E_SUMMARY_SHOWN (pd->rdf->etable), TRUE,
- entry, NULL, FALSE, NULL);
+ entry, NULL, TRUE, NULL);
/* Should we add to shown? */
@@ -615,8 +840,10 @@ rdf_new_url_clicked_cb (GtkButton *button,
add_dialog = gnome_dialog_new (_("Add a news feed"),
GNOME_STOCK_BUTTON_OK,
GNOME_STOCK_BUTTON_CANCEL, NULL);
- g_signal_connect (add_dialog, "clicked", G_CALLBACK (add_dialog_clicked_cb), pd);
- g_signal_connect (add_dialog, "destroy", G_CALLBACK (gtk_widget_destroyed), &add_dialog);
+ gtk_signal_connect (GTK_OBJECT (add_dialog), "clicked",
+ GTK_SIGNAL_FUNC (add_dialog_clicked_cb), pd);
+ gtk_signal_connect (GTK_OBJECT (add_dialog), "destroy",
+ GTK_SIGNAL_FUNC (gtk_widget_destroyed), &add_dialog);
label = gtk_label_new (_("Enter the URL of the news feed you wish to add"));
gtk_box_pack_start (GTK_BOX (GNOME_DIALOG (add_dialog)->vbox), label,
@@ -658,7 +885,7 @@ rdf_delete_url_cb (GtkButton *button,
}
e_summary_shown_remove_node (E_SUMMARY_SHOWN (pd->rdf->etable), TRUE, entry);
- pd->rdf->known = g_slist_remove (pd->rdf->known, entry->data);
+ pd->rdf->known = g_list_remove (pd->rdf->known, entry->data);
/* FIXME: Remove from shown side as well */
}
@@ -861,45 +1088,52 @@ make_property_dialog (PropertyData *pd)
mail->storage_set_view = glade_xml_get_widget (pd->xml, "mail-custom");
g_return_val_if_fail (mail->storage_set_view != NULL, FALSE);
- listener = g_object_get_data (G_OBJECT (mail->storage_set_view), "listener");
- g_signal_connect (listener, "folder-toggled", G_CALLBACK (storage_set_changed), pd);
+ listener = gtk_object_get_data (GTK_OBJECT (mail->storage_set_view),
+ "listener");
+ gtk_signal_connect (GTK_OBJECT (listener), "folder-toggled",
+ GTK_SIGNAL_FUNC (storage_set_changed), pd);
mail->fullpath = glade_xml_get_widget (pd->xml, "checkbutton1");
g_return_val_if_fail (mail->fullpath != NULL, FALSE);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (mail->fullpath),
global_preferences->show_full_path);
- g_signal_connect (mail->fullpath, "toggled", G_CALLBACK (mail_show_full_path_toggled_cb), pd);
+ gtk_signal_connect (GTK_OBJECT (mail->fullpath), "toggled",
+ GTK_SIGNAL_FUNC (mail_show_full_path_toggled_cb), pd);
/* RDF */
rdf = pd->rdf = g_new0 (struct _RDFPage, 1);
rdf->etable = glade_xml_get_widget (pd->xml, "rdf-custom");
g_return_val_if_fail (rdf->etable != NULL, FALSE);
- g_signal_connect (rdf->etable, "item-changed", G_CALLBACK (rdf_etable_item_changed_cb), pd);
- g_signal_connect (rdf->etable, "selection-changed", G_CALLBACK (rdf_etable_selection_cb), pd);
+ gtk_signal_connect (GTK_OBJECT (rdf->etable), "item-changed",
+ GTK_SIGNAL_FUNC (rdf_etable_item_changed_cb), pd);
+ gtk_signal_connect (GTK_OBJECT (rdf->etable), "selection-changed",
+ GTK_SIGNAL_FUNC (rdf_etable_selection_cb), pd);
fill_rdf_etable (rdf->etable, pd);
rdf->refresh = glade_xml_get_widget (pd->xml, "spinbutton1");
g_return_val_if_fail (rdf->refresh != NULL, FALSE);
gtk_spin_button_set_value (GTK_SPIN_BUTTON (rdf->refresh),
(float) global_preferences->rdf_refresh_time);
- g_signal_connect (GTK_SPIN_BUTTON (rdf->refresh)->adjustment, "value_changed",
- G_CALLBACK (rdf_refresh_value_changed_cb), pd);
+ gtk_signal_connect (GTK_OBJECT (GTK_SPIN_BUTTON (rdf->refresh)->adjustment), "value_changed",
+ GTK_SIGNAL_FUNC (rdf_refresh_value_changed_cb), pd);
rdf->limit = glade_xml_get_widget (pd->xml, "spinbutton4");
g_return_val_if_fail (rdf->limit != NULL, FALSE);
gtk_spin_button_set_value (GTK_SPIN_BUTTON (rdf->limit),
(float) global_preferences->limit);
- g_signal_connect (GTK_SPIN_BUTTON (rdf->limit)->adjustment, "value_changed",
- G_CALLBACK (rdf_limit_value_changed_cb), pd);
+ gtk_signal_connect (GTK_OBJECT (GTK_SPIN_BUTTON (rdf->limit)->adjustment), "value_changed",
+ GTK_SIGNAL_FUNC (rdf_limit_value_changed_cb), pd);
rdf->new_button = glade_xml_get_widget (pd->xml, "button11");
g_return_val_if_fail (rdf->limit != NULL, FALSE);
- g_signal_connect (rdf->new_button, "clicked", G_CALLBACK (rdf_new_url_clicked_cb), pd);
+ gtk_signal_connect (GTK_OBJECT (rdf->new_button), "clicked",
+ GTK_SIGNAL_FUNC (rdf_new_url_clicked_cb), pd);
rdf->delete_url = glade_xml_get_widget (pd->xml, "delete-button");
g_return_val_if_fail (rdf->delete_url != NULL, FALSE);
- g_signal_connect (rdf->delete_url, "clicked", G_CALLBACK (rdf_delete_url_cb), pd);
+ gtk_signal_connect (GTK_OBJECT (rdf->delete_url), "clicked",
+ GTK_SIGNAL_FUNC (rdf_delete_url_cb), pd);
/* Weather */
weather = pd->weather = g_new (struct _WeatherPage, 1);
@@ -908,7 +1142,9 @@ make_property_dialog (PropertyData *pd)
weather->etable = glade_xml_get_widget (pd->xml, "weather-custom");
g_return_val_if_fail (weather->etable != NULL, FALSE);
- g_signal_connect (weather->etable, "item-changed", G_CALLBACK (weather_etable_item_changed_cb), pd);
+ gtk_signal_connect (GTK_OBJECT (weather->etable), "item-changed",
+ GTK_SIGNAL_FUNC (weather_etable_item_changed_cb),
+ pd);
fill_weather_etable (E_SUMMARY_SHOWN (weather->etable), pd);
@@ -916,20 +1152,24 @@ make_property_dialog (PropertyData *pd)
g_return_val_if_fail (weather->refresh != NULL, FALSE);
gtk_spin_button_set_value (GTK_SPIN_BUTTON (weather->refresh),
(float) global_preferences->weather_refresh_time);
- g_signal_connect (GTK_SPIN_BUTTON (weather->refresh)->adjustment, "value-changed",
- G_CALLBACK (weather_refresh_value_changed_cb), pd);
+ gtk_signal_connect (GTK_OBJECT (GTK_SPIN_BUTTON (weather->refresh)->adjustment),
+ "value-changed",
+ GTK_SIGNAL_FUNC (weather_refresh_value_changed_cb),
+ pd);
weather->metric = glade_xml_get_widget (pd->xml, "radiobutton7");
g_return_val_if_fail (weather->metric != NULL, FALSE);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (weather->metric),
(global_preferences->units == UNITS_METRIC));
- g_signal_connect (weather->metric, "toggled", G_CALLBACK (weather_metric_toggled_cb), pd);
+ gtk_signal_connect (GTK_OBJECT (weather->metric), "toggled",
+ GTK_SIGNAL_FUNC (weather_metric_toggled_cb), pd);
weather->imperial = glade_xml_get_widget (pd->xml, "radiobutton8");
g_return_val_if_fail (weather->imperial != NULL, FALSE);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (weather->imperial),
(global_preferences->units == UNITS_IMPERIAL));
- g_signal_connect (weather->imperial, "toggled", G_CALLBACK (weather_imperial_toggled_cb), pd);
+ gtk_signal_connect (GTK_OBJECT (weather->imperial), "toggled",
+ GTK_SIGNAL_FUNC (weather_imperial_toggled_cb), pd);
/* Calendar */
calendar = pd->calendar = g_new (struct _CalendarPage, 1);
@@ -937,37 +1177,43 @@ make_property_dialog (PropertyData *pd)
g_return_val_if_fail (calendar->one != NULL, FALSE);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (calendar->one),
(global_preferences->days == E_SUMMARY_CALENDAR_ONE_DAY));
- g_signal_connect (calendar->one, "toggled", G_CALLBACK (calendar_one_toggled_cb), pd);
+ gtk_signal_connect (GTK_OBJECT (calendar->one), "toggled",
+ GTK_SIGNAL_FUNC (calendar_one_toggled_cb), pd);
calendar->five = glade_xml_get_widget (pd->xml, "radiobutton4");
g_return_val_if_fail (calendar->five != NULL, FALSE);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (calendar->five),
(global_preferences->days == E_SUMMARY_CALENDAR_FIVE_DAYS));
- g_signal_connect (calendar->five, "toggled", G_CALLBACK (calendar_five_toggled_cb), pd);
+ gtk_signal_connect (GTK_OBJECT (calendar->five), "toggled",
+ GTK_SIGNAL_FUNC (calendar_five_toggled_cb), pd);
calendar->week = glade_xml_get_widget (pd->xml, "radiobutton5");
g_return_val_if_fail (calendar->week != NULL, FALSE);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (calendar->week),
(global_preferences->days == E_SUMMARY_CALENDAR_ONE_WEEK));
- g_signal_connect (calendar->week, "toggled", G_CALLBACK (calendar_week_toggled_cb), pd);
+ gtk_signal_connect (GTK_OBJECT (calendar->week), "toggled",
+ GTK_SIGNAL_FUNC (calendar_week_toggled_cb), pd);
calendar->month = glade_xml_get_widget (pd->xml, "radiobutton6");
g_return_val_if_fail (calendar->month != NULL, FALSE);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (calendar->month),
(global_preferences->days == E_SUMMARY_CALENDAR_ONE_MONTH));
- g_signal_connect (calendar->month, "toggled", G_CALLBACK (calendar_month_toggled_cb), pd);
+ gtk_signal_connect (GTK_OBJECT (calendar->month), "toggled",
+ GTK_SIGNAL_FUNC (calendar_month_toggled_cb), pd);
calendar->all = glade_xml_get_widget (pd->xml, "radiobutton1");
g_return_val_if_fail (calendar->all != NULL, FALSE);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (calendar->all),
(global_preferences->show_tasks == E_SUMMARY_CALENDAR_ALL_TASKS));
- g_signal_connect (calendar->all, "toggled", G_CALLBACK (calendar_all_toggled_cb), pd);
+ gtk_signal_connect (GTK_OBJECT (calendar->all), "toggled",
+ GTK_SIGNAL_FUNC (calendar_all_toggled_cb), pd);
calendar->today = glade_xml_get_widget (pd->xml, "radiobutton2");
g_return_val_if_fail (calendar->today != NULL, FALSE);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (calendar->today),
(global_preferences->show_tasks == E_SUMMARY_CALENDAR_TODAYS_TASKS));
- g_signal_connect (calendar->today, "toggled", G_CALLBACK (calendar_today_toggled_cb), pd);
+ gtk_signal_connect (GTK_OBJECT(calendar->today), "toggled",
+ GTK_SIGNAL_FUNC (calendar_today_toggled_cb), pd);
return TRUE;
}
@@ -976,28 +1222,29 @@ static void
free_property_dialog (PropertyData *pd)
{
if (pd->rdf) {
- g_slist_free (pd->rdf->known);
+ g_list_free (pd->rdf->known);
free_str_list (pd->rdf->tmp_list);
- g_slist_free (pd->rdf->tmp_list);
+ g_list_free (pd->rdf->tmp_list);
g_free (pd->rdf);
}
if (pd->mail) {
free_str_list (pd->mail->tmp_list);
- g_slist_free (pd->mail->tmp_list);
+ g_list_free (pd->mail->tmp_list);
g_free (pd->mail);
}
if (pd->weather) {
free_str_list (pd->weather->tmp_list);
- g_slist_free (pd->weather->tmp_list);
+ g_list_free (pd->weather->tmp_list);
g_free (pd->weather);
}
if (pd->calendar) {
g_free (pd->calendar);
}
- if (pd->xml)
- g_object_unref (pd->xml);
+ if (pd->xml) {
+ gtk_object_unref (GTK_OBJECT (pd->xml));
+ }
g_free (pd);
}
@@ -1013,7 +1260,7 @@ set_selected_folders (GNOME_Evolution_StorageSetView view)
{
GNOME_Evolution_FolderList *list;
CORBA_Environment ev;
- GSList *l;
+ GList *l;
int i, count;
for (count = 0, l = global_preferences->display_folders; l;
@@ -1090,8 +1337,8 @@ e_summary_preferences_make_mail_table (PropertyData *pd)
CORBA_exception_free (&ev);
widget = bonobo_widget_new_control_from_objref (control, CORBA_OBJECT_NIL);
- g_object_set_data (G_OBJECT (widget), "listener", listener);
- g_object_set_data (G_OBJECT (widget), "corba_view", view);
+ gtk_object_set_data (GTK_OBJECT (widget), "listener", listener);
+ gtk_object_set_data (GTK_OBJECT (widget), "corba_view", view);
set_selected_folders (view);
return widget;
@@ -1118,24 +1365,24 @@ add_shown_to_list (gpointer key,
gpointer data)
{
ESummaryShownModelEntry *item;
- GSList **list;
+ GList **list;
item = (ESummaryShownModelEntry *) value;
- list = (GSList **) data;
+ list = (GList **) data;
- *list = g_slist_prepend (*list, g_strdup (item->location));
+ *list = g_list_prepend (*list, g_strdup (item->location));
}
-static GSList *
+static GList *
get_folders_from_view (GtkWidget *view)
{
GNOME_Evolution_StorageSetView set_view;
GNOME_Evolution_FolderList *list;
CORBA_Environment ev;
- GSList *out_list = NULL;
+ GList *out_list = NULL;
int i;
- set_view = g_object_get_data (G_OBJECT (view), "corba_view");
+ set_view = gtk_object_get_data (GTK_OBJECT (view), "corba_view");
CORBA_exception_init (&ev);
list = GNOME_Evolution_StorageSetView__get_checkedFolders (set_view, &ev);
@@ -1155,7 +1402,7 @@ get_folders_from_view (GtkWidget *view)
f = g_new (ESummaryPrefsFolder, 1);
f->evolution_uri = g_strdup (folder.evolutionUri);
f->physical_uri = g_strdup (folder.physicalUri);
- out_list = g_slist_append (out_list, f);
+ out_list = g_list_append (out_list, f);
}
return out_list;
@@ -1171,7 +1418,7 @@ config_control_apply_cb (EvolutionConfigControl *control,
if (pd->rdf->tmp_list) {
free_str_list (pd->rdf->tmp_list);
- g_slist_free (pd->rdf->tmp_list);
+ g_list_free (pd->rdf->tmp_list);
pd->rdf->tmp_list = NULL;
}
/* Take each news feed which is on and add it
@@ -1181,7 +1428,7 @@ config_control_apply_cb (EvolutionConfigControl *control,
if (global_preferences->rdf_urls) {
free_str_list (global_preferences->rdf_urls);
- g_slist_free (global_preferences->rdf_urls);
+ g_list_free (global_preferences->rdf_urls);
}
global_preferences->rdf_urls = copy_str_list (pd->rdf->tmp_list);
@@ -1189,7 +1436,7 @@ config_control_apply_cb (EvolutionConfigControl *control,
/* Weather */
if (pd->weather->tmp_list) {
free_str_list (pd->weather->tmp_list);
- g_slist_free (pd->weather->tmp_list);
+ g_list_free (pd->weather->tmp_list);
pd->weather->tmp_list = NULL;
}
@@ -1197,44 +1444,51 @@ config_control_apply_cb (EvolutionConfigControl *control,
add_shown_to_list, &pd->weather->tmp_list);
if (global_preferences->stations) {
free_str_list (global_preferences->stations);
- g_slist_free (global_preferences->stations);
+ g_list_free (global_preferences->stations);
}
global_preferences->stations = copy_str_list (pd->weather->tmp_list);
/* Folders */
if (pd->mail->tmp_list) {
free_str_list (pd->mail->tmp_list);
- g_slist_free (pd->mail->tmp_list);
+ g_list_free (pd->mail->tmp_list);
pd->mail->tmp_list = NULL;
}
+#if 0
+ g_hash_table_foreach (pd->mail->model, maybe_add_to_shown, &pd->mail->tmp_list);
+#endif
if (global_preferences->display_folders) {
free_folder_list (global_preferences->display_folders);
- g_slist_free (global_preferences->display_folders);
+ g_list_free (global_preferences->display_folders);
}
- global_preferences->display_folders = get_folders_from_view(pd->mail->storage_set_view);
-
- e_summary_preferences_save (global_preferences);
+ global_preferences->display_folders = get_folders_from_view (pd->mail->storage_set_view);
e_summary_reconfigure_all ();
}
static void
-config_control_destroy_cb (EvolutionConfigControl *config_control, void *data)
+config_control_destroy_cb (EvolutionConfigControl *config_control,
+ void *data)
{
- e_summary_preferences_restore(global_preferences);
- free_property_dialog ((PropertyData *)data);
+ PropertyData *pd;
+
+ pd = (PropertyData *) data;
+
+ e_summary_preferences_save (global_preferences);
+ free_property_dialog (pd);
}
-BonoboObject *
-e_summary_preferences_create_control (void)
+static BonoboObject *
+factory_fn (BonoboGenericFactory *generic_factory,
+ void *data)
{
PropertyData *pd;
GtkWidget *widget;
pd = g_new0 (PropertyData, 1);
- pd->xml = glade_xml_new (EVOLUTION_GLADEDIR "/my-evolution.glade", NULL, NULL);
+ pd->xml = glade_xml_new (EVOLUTION_GLADEDIR "/my-evolution.glade", NULL);
g_return_val_if_fail (pd->xml != NULL, NULL);
widget = glade_xml_get_widget (pd->xml, "notebook");
@@ -1247,20 +1501,26 @@ e_summary_preferences_create_control (void)
gtk_widget_ref (widget);
gtk_container_remove (GTK_CONTAINER (widget->parent), widget);
- gtk_widget_show_all (widget);
+ gtk_widget_show (widget);
pd->config_control = evolution_config_control_new (widget);
gtk_widget_unref (widget);
- g_signal_connect (pd->config_control, "apply", G_CALLBACK (config_control_apply_cb), pd);
- g_signal_connect (pd->config_control, "destroy", G_CALLBACK (config_control_destroy_cb), pd);
+ gtk_signal_connect (GTK_OBJECT (pd->config_control), "apply",
+ GTK_SIGNAL_FUNC (config_control_apply_cb), pd);
+ gtk_signal_connect (GTK_OBJECT (pd->config_control), "destroy",
+ GTK_SIGNAL_FUNC (config_control_destroy_cb), pd);
return BONOBO_OBJECT (pd->config_control);
}
-/* FIXME this kinda sucks. */
-void
-e_summary_preferences_init_control (GNOME_Evolution_Shell corba_shell)
+gboolean
+e_summary_preferences_register_config_control_factory (GNOME_Evolution_Shell corba_shell)
{
+ if (bonobo_generic_factory_new (FACTORY_ID, factory_fn, NULL) == NULL)
+ return FALSE;
+
global_shell = corba_shell;
+
+ return TRUE;
}
diff --git a/po/.cvsignore b/po/.cvsignore
index 9e83e03c05..1b0b11d498 100644
--- a/po/.cvsignore
+++ b/po/.cvsignore
@@ -4,16 +4,8 @@
Makefile
Makefile.in
Makefile.in.in
-Makevars.template
POTFILES
-Rules-quot
-boldquot.sed
cat-id-tbl.c
-en@boldquot.header
-en@quot.header
-insert-header.sin
messages
missing
-quot.sed
-remove-potcdate.sin
stamp-cat-id
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 4562f898ee..8e447caae7 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -1,7 +1,7 @@
# List of source files containing translatable strings.
# Please keep this list in alphabetic order.
-addressbook/backend/ebook/GNOME_Evolution_Addressbook_LDIF_Importer.server.in.in
-addressbook/backend/ebook/GNOME_Evolution_Addressbook_VCard_Importer.server.in.in
+addressbook/backend/ebook/GNOME_Evolution_Addressbook_LDIF_Importer.oaf.in
+addressbook/backend/ebook/GNOME_Evolution_Addressbook_VCard_Importer.oaf.in
addressbook/backend/ebook/e-card-simple.c
addressbook/backend/ebook/e-card.c
addressbook/backend/ebook/e-destination.c
@@ -12,28 +12,28 @@ addressbook/backend/ebook/test-client.c
addressbook/backend/pas/pas-backend-file.c
addressbook/backend/pas/pas-backend-ldap.c
addressbook/conduit/address-conduit.c
-addressbook/gui/component/GNOME_Evolution_Addressbook.server.in.in
+addressbook/gui/component/GNOME_Evolution_Addressbook.oaf.in
addressbook/gui/component/addressbook-component.c
addressbook/gui/component/addressbook-config.c
+addressbook/gui/component/addressbook-config.etspec
+addressbook/gui/component/addressbook-factory.c
addressbook/gui/component/addressbook-storage.c
addressbook/gui/component/addressbook.c
addressbook/gui/component/e-address-popup.c
addressbook/gui/component/e-address-widget.c
addressbook/gui/component/ldap-config.glade
-addressbook/gui/component/select-names/GNOME_Evolution_Addressbook_SelectNames.server.in.in
+addressbook/gui/component/select-names/GNOME_Evolution_Addressbook_SelectNames.oaf.in
addressbook/gui/component/select-names/e-select-names-popup.c
-addressbook/gui/component/select-names/e-select-names-section.etspec
-addressbook/gui/component/select-names/e-select-names-table-model.c
-addressbook/gui/component/select-names/e-select-names-text-model.c
addressbook/gui/component/select-names/e-select-names.c
addressbook/gui/component/select-names/e-select-names.etspec
addressbook/gui/component/select-names/select-names.glade
addressbook/gui/contact-editor/contact-editor.glade
addressbook/gui/contact-editor/e-contact-editor-address.c
-addressbook/gui/contact-editor/e-contact-editor-fullname.c
+addressbook/gui/contact-editor/e-contact-editor-confirm-delete.glade
addressbook/gui/contact-editor/e-contact-editor.c
addressbook/gui/contact-editor/e-contact-quick-add.c
addressbook/gui/contact-editor/e-contact-save-as.c
+addressbook/gui/contact-editor/file-exists.glade
addressbook/gui/contact-editor/fulladdr.glade
addressbook/gui/contact-editor/fullname.glade
addressbook/gui/contact-list-editor/contact-list-editor.glade
@@ -49,34 +49,28 @@ addressbook/gui/widgets/e-addressbook-util.c
addressbook/gui/widgets/e-addressbook-view.c
addressbook/gui/widgets/e-addressbook-view.etspec
addressbook/gui/widgets/e-minicard-control.c
-addressbook/gui/widgets/e-minicard-label.c
-addressbook/gui/widgets/e-minicard-view-widget.c
addressbook/gui/widgets/e-minicard-view.c
-addressbook/gui/widgets/e-minicard-widget.c
addressbook/gui/widgets/e-minicard.c
addressbook/gui/widgets/gal-view-factory-minicard.c
-addressbook/gui/widgets/gal-view-factory-treeview.c
addressbook/printing/e-contact-print-envelope.c
addressbook/printing/e-contact-print.c
addressbook/printing/e-contact-print.glade
calendar/cal-util/cal-component.c
-calendar/cal-util/cal-recur.c
calendar/cal-util/cal-util.c
calendar/cal-util/timeutil.c
calendar/conduits/calendar/calendar-conduit.c
calendar/conduits/todo/todo-conduit.c
-calendar/gui/GNOME_Evolution_Calendar.server.in.in
-calendar/gui/alarm-notify/GNOME_Evolution_Calendar_AlarmNotify.server.in.in
+calendar/gui/GNOME_Evolution_Calendar.oaf.in
+calendar/gui/alarm-notify/GNOME_Evolution_Calendar_AlarmNotify.oaf.in
calendar/gui/alarm-notify/alarm-notify-dialog.c
calendar/gui/alarm-notify/alarm-notify.glade
calendar/gui/alarm-notify/alarm-queue.c
calendar/gui/alarm-notify/notify-main.c
calendar/gui/cal-search-bar.c
calendar/gui/calendar-commands.c
-calendar/gui/calendar-component.c
calendar/gui/calendar-model.c
calendar/gui/calendar-view-factory.c
-calendar/gui/comp-editor-factory.c
+calendar/gui/component-factory.c
calendar/gui/control-factory.c
calendar/gui/dialogs/alarm-options.c
calendar/gui/dialogs/alarm-options.glade
@@ -96,7 +90,6 @@ calendar/gui/dialogs/event-page.glade
calendar/gui/dialogs/meeting-page.c
calendar/gui/dialogs/meeting-page.etspec
calendar/gui/dialogs/meeting-page.glade
-calendar/gui/dialogs/recur-comp.c
calendar/gui/dialogs/recurrence-page.c
calendar/gui/dialogs/recurrence-page.glade
calendar/gui/dialogs/save-comp.c
@@ -108,7 +101,6 @@ calendar/gui/dialogs/task-details-page.glade
calendar/gui/dialogs/task-editor.c
calendar/gui/dialogs/task-page.c
calendar/gui/dialogs/task-page.glade
-calendar/gui/e-alarm-list.c
calendar/gui/e-calendar-table.c
calendar/gui/e-calendar-table.etspec
calendar/gui/e-cell-date-edit-text.c
@@ -130,11 +122,12 @@ calendar/gui/goto.c
calendar/gui/itip-utils.c
calendar/gui/main.c
calendar/gui/print.c
+calendar/gui/tasks-control-factory.c
calendar/gui/tasks-control.c
+calendar/gui/tasks-migrate.c
calendar/gui/weekday-picker.c
-calendar/importers/GNOME_Evolution_Calendar_Importer.server.in.in
+calendar/importers/GNOME_Evolution_Calendar_Importer.oaf.in
calendar/importers/icalendar-importer.c
-calendar/pcs/cal-backend-file.c
calendar/pcs/query.c
calendar/zones.h
camel/camel-cipher-context.c
@@ -154,12 +147,10 @@ camel/camel-movemail.c
camel/camel-multipart-encrypted.c
camel/camel-multipart-signed.c
camel/camel-pgp-mime.c
-camel/camel-process.c
camel/camel-provider.c
camel/camel-sasl-anonymous.c
camel/camel-sasl-cram-md5.c
camel/camel-sasl-digest-md5.c
-camel/camel-sasl-gssapi.c
camel/camel-sasl-kerberos4.c
camel/camel-sasl-login.c
camel/camel-sasl-ntlm.c
@@ -217,8 +208,6 @@ composer/evolution-composer.c
data/evolution.desktop.in
data/evolution.keys.in
default_user/searches.xml
-designs/OOA/ooa.glade
-designs/read_receipts/read.glade
e-util/e-categories-config.c
e-util/e-component-listener.c
e-util/e-dialog-utils.c
@@ -237,31 +226,27 @@ filter/filter-part.c
filter/filter-rule.c
filter/filter.glade
filter/libfilter-i18n.h
-filter/rule-context.c
filter/rule-editor.c
filter/score-editor.c
filter/score-rule.c
filter/vfolder-editor.c
filter/vfolder-rule.c
+importers/GNOME_Evolution_Elm_Intelligent_Importer.oaf.in
+importers/GNOME_Evolution_Netscape_Intelligent_Importer.oaf.in
+importers/GNOME_Evolution_Pine_Intelligent_Importer.oaf.in
importers/elm-importer.c
importers/evolution-gnomecard-importer.c
importers/netscape-importer.c
importers/pine-importer.c
-mail/GNOME_Evolution_Mail.server.in.in
+mail/GNOME_Evolution_Mail.oaf.in
mail/component-factory.c
mail/folder-browser-factory.c
mail/folder-browser-ui.c
mail/folder-browser.c
mail/folder-browser.h
mail/folder-info.c
-mail/importers/GNOME_Evolution_Mail_Elm_Intelligent_Importer.server.in.in
-mail/importers/GNOME_Evolution_Mail_Mbox_Importer.server.in.in
-mail/importers/GNOME_Evolution_Mail_Netscape_Intelligent_Importer.server.in.in
-mail/importers/GNOME_Evolution_Mail_Outlook_Importer.server.in.in
-mail/importers/GNOME_Evolution_Mail_Pine_Intelligent_Importer.server.in.in
-mail/importers/elm-importer.c
-mail/importers/netscape-importer.c
-mail/importers/pine-importer.c
+mail/importers/GNOME_Evolution_Mail_Mbox_Importer.oaf.in
+mail/importers/GNOME_Evolution_Mail_Outlook_Importer.oaf.in
mail/local-config.glade
mail/mail-account-editor.c
mail/mail-account-gui.c
@@ -280,6 +265,7 @@ mail/mail-format.c
mail/mail-local.c
mail/mail-mt.c
mail/mail-ops.c
+mail/mail-search-dialogue.c
mail/mail-search.c
mail/mail-search.c
mail/mail-send-recv.c
@@ -296,7 +282,6 @@ mail/message-tags.glade
mail/subscribe-dialog.c
mail/subscribe-dialog.etspec
mail/subscribe-dialog.glade
-my-evolution/GNOME_Evolution_Summary.server.in.in
my-evolution/Locations.h
my-evolution/component-factory.c
my-evolution/e-summary-calendar.c
@@ -308,11 +293,11 @@ my-evolution/e-summary-table.c
my-evolution/e-summary-tasks.c
my-evolution/e-summary-weather.c
my-evolution/e-summary.c
+my-evolution/main.c
my-evolution/metar.c
my-evolution/my-evolution.glade
-shell/GNOME_Evolution_Shell.server.in.in
+shell/GNOME_Evolution_Shell.oaf.in
shell/e-activity-handler.c
-shell/e-config-upgrade.c
shell/e-folder-dnd-bridge.c
shell/e-folder-list.c
shell/e-local-storage.c
@@ -359,6 +344,7 @@ tools/evolution-addressbook-abuse.c
tools/evolution-addressbook-export.c
tools/evolution-addressbook-import.c
tools/evolution-launch-composer.c
+ui/evolution-addressbook.h
ui/evolution-addressbook.xml
ui/evolution-calendar.xml
ui/evolution-comp-editor.xml
@@ -370,6 +356,7 @@ ui/evolution-mail-global.xml
ui/evolution-mail-list.xml
ui/evolution-mail-message.xml
ui/evolution-mail-messagedisplay.xml
+ui/evolution-message-composer.h
ui/evolution-message-composer.xml
ui/evolution-signature-editor.xml
ui/evolution-subscribe.xml
@@ -395,6 +382,9 @@ widgets/misc/e-filter-bar.c
widgets/misc/e-filter-bar.h
widgets/misc/e-messagebox.c
widgets/misc/e-search-bar.c
-wombat/GNOME_Evolution_WombatLDAP.server.in.in
-wombat/GNOME_Evolution_WombatNOLDAP.server.in.in
+wombat/GNOME_Evolution_WombatLDAP.oaf.in
+wombat/GNOME_Evolution_WombatNOLDAP.oaf.in
wombat/wombat.c
+calendar/gui/comp-editor-factory.c
+calendar/gui/dialogs/recur-comp.c
+camel/camel-sasl-gssapi.c
diff --git a/po/POTFILES.skip b/po/POTFILES.skip
index 7eabf41e44..77d6dfebbe 100644
--- a/po/POTFILES.skip
+++ b/po/POTFILES.skip
@@ -1,17 +1,23 @@
+tests/ui-tests/store_listing.glade
addressbook/gui/component/select-names/recipient.glade
addressbook/gui/widgets/test-minicard-view.c
+notes/component-factory.c
+notes/main.c
+tests/ui-tests/message-browser.c
camel/camel-pkcs7-context.c
camel/providers/nntp/camel-nntp-auth.c
camel/providers/nntp/camel-nntp-folder.c
camel/providers/nntp/camel-nntp-grouplist.c
+executive-summary/GNOME_Evolution_Summary.oaf.in
executive-summary/component/component-factory.c
executive-summary/component/e-summary-callbacks.c
executive-summary/component/e-summary-url.c
executive-summary/component/e-summary.c
executive-summary/component/main.c
+executive-summary/test-service/GNOME_Evolution_Summary_rdf.oaf.in
+executive-summary/test-service/GNOME_Evolution_Summary_test.oaf.in
executive-summary/test-service/rdf-summary.c
mail/mail-summary.c
-notes/component-factory.c
-notes/main.c
-tests/ui-tests/message-browser.c
-tests/ui-tests/store_listing.glade
+my-evolution/GNOME_Evolution_Summary.oaf.in.in
+notes/GNOME_Evolution_Notes.oaf.in
+calendar/gui/calendar-component.c
diff --git a/shell/ChangeLog b/shell/ChangeLog
index d4f8e00991..38e20819f4 100644
--- a/shell/ChangeLog
+++ b/shell/ChangeLog
@@ -1,746 +1,21 @@
-2003-04-01 Not Zed <NotZed@Ximian.com>
+2003-03-04 Rodney Dawes <dobey@ximian.com>
- [#40474]
+ * shell/Evolution-Offline.idl:
+ * shell/Evolution-Session.idl:
+ * shell/Evolution-ShellComponent.idl:
+ * shell/Evolution-ShellComponentDnd.idl:
+ * shell/Evolution-Storage.idl: Fix #includes
- * e-config-upgrade.c (gconf_remap_list[]): The summary settings
- start at "My-Evolution", not "/My-Evolution".
- (import_bonobo_config): Same for mail summary settings, and hex
- decode the string for the strlist. Add a few extra debug
- printf's.
-
-2003-03-28 Ettore Perazzoli <ettore@ximian.com>
-
- [#40377]
-
- * main.c (kill_old_wombat): New.
- (kill_wombat): New.
- (idle_cb): Call kill_old_wombat().
-
-2003-03-27 Ettore Perazzoli <ettore@ximian.com>
-
- * e-shell-offline-handler.c (update_dialog_tree_view): Renamed
- from update_dialog_clist, Ported to GtkTreeView.
- (update_dialog_tree_view_hash_foreach): Likewise.
-
- * glade/e-active-connection-dialog.glade: Rename
- "active_connection_clist" to "active_connection_treeview".
-
-2003-03-27 Not Zed <NotZed@Ximian.com>
-
- * e-shell-about-box.c: Make Radek's surname correct, Doulík,
- inserted utf8 into the name string. For bug #17034.
-
-2003-03-26 Ettore Perazzoli <ettore@ximian.com>
-
- * e-shell-view.c (e_shell_view_construct): Pass "evolution-1.4" as
- the app name to bonobo_ui_util_set_ui() instead of "evolution".
-
-2003-03-26 Ettore Perazzoli <ettore@ximian.com>
-
- [Shell part of #7153.]
-
- * e-local-storage.c (load_folder): Call e_storage_new_folder()
- instead of new_folder() here so the folder doesn't get added to
- the EvolutionStorage. Since the EvolutionStorage has its own
- CORBAfied copy of the folder info [sigh] and it can't be updated,
- we have to set up the EvolutionStorage after setup_stock_folders()
- has been called.
- (setup_corba_storage): New function to set up the CORBA storage.
- (load_all_folders): Call setup_corba_storage() after
- setup_stock_folders().
-
-2003-03-25 Not Zed <NotZed@Ximian.com>
-
- * e-shell-settings-dialog.c (set_dialog_size): Use
- set_default_size instead of size_request so we allow the user to
- resize the window. Also try using 60x30 rather than 72x35 as the
- approximate font cell size. For bug #39706.
-
-2003-03-25 Dan Winship <danw@ximian.com>
-
- * e-folder-dnd-bridge.c: Update for e_notice move.
- * e-setup.c: Likewise
- * e-shell-folder-commands.c: Likewise
- * e-shell-folder-creation-dialog.c: Likewise
- * e-shell-offline-sync.c: Likewise
- * e-shell-shared-folder-picker-dialog.c: Likewise
- * e-shell-view-menu.c: Likewise
- * e-shell.c: Likewise
- * evolution-shell-component-utils.c: Likewise
-
- * Makefile.am (libeshell_la_LIBADD): libeshell depends on
- libeutil.
-
- * e-corba-storage.c: Fix warnings
-
- * glade/evolution-startup-wizard.glade: Fix colors again
-
-2003-03-25 Dan Winship <danw@ximian.com>
-
- * Evolution-ShellComponent.idl (interactive): add a "new_view_xid"
- arg, so the component has a window id to make use of as a parent
- if it needs to pop up a dialog.
-
- * e-shell.c (set_interactive): Pass the new_view_xid when going
- interactive.
- (e_shell_set_interactive): Remove this since it wasn't being used,
- and couldn't be used for anything except lying to the components.
-
- * evolution-shell-component.c
- (evolution_shell_component_class_init): Update "interactive"
- signal definition
- (impl_interactive): Update prototype and signal emission
-
- * e-shell-marshal.list (NONE:BOOL,INT): add
-
-2003-03-21 Dan Winship <danw@ximian.com>
-
- * e-corba-storage.c (async_open_folder_idle): If we get a second
- request to open a folder we're already waiting for, don't send a
- second CORBA request, just remember the additional request.
- (async_open_cb): Call the callbacks for all pending requests for
- this folder.
- (init): grumble-grumble-non-g_new0-using-people-grumbe
-
-2003-03-20 JP Rosevear <jpr@ximian.com>
-
- * e-shell-view-menu.c: remove unused command
-
-2003-03-19 Not Zed <NotZed@Ximian.com>
-
- * e-config-upgrade.c (e_config_upgrade): Added some more doco just
- to make it clear how it was intended to be used/expanded.
-
-2003-03-18 Ettore Perazzoli <ettore@ximian.com>
-
- * importer/evolution-importer.c
- (impl_GNOME_Evolution_Importer_loadFile): Get a physical_uri arg
- instead of a folderpath arg.
-
- * importer/evolution-importer-client.c
- (evolution_importer_client_load_file): Get a physical_uri arg.
-
- * e-shell-importer.c (start_import): Get a physical_uri arg
- instead of a folderpath.
- (folder_selected): Updated accordingly.
-
-2003-03-19 Ettore Perazzoli <ettore@ximian.com>
-
- * e-shell-importer.c (get_name_from_component_info): Look for the
- "evolution:menu_name" property instead of "evolution:menu-name".
- [#39692]
-
-2003-03-19 Ettore Perazzoli <ettore@ximian.com>
-
- * evolution-folder-selector-button.c (set_folder): If you can't
- get a pixbuf icon for the folder's type, do not crash. [#39599]
-
- * e-shell.c (impl_Shell__get_displayName): Removed. [#38974]
- (e_shell_class_init): Do not install anymore.
-
- * Evolution-Shell.idl: Remove displayName attribute.
-
-2003-03-18 Ettore Perazzoli <ettore@ximian.com>
-
- * importer/evolution-importer.c
- (impl_GNOME_Evolution_Importer_loadFile): Get a physical_uri arg
- instead of a folderpath arg.
-
- * importer/evolution-importer-client.c
- (evolution_importer_client_load_file): Get a physical_uri arg.
-
- * e-shell-importer.c (start_import): Get a physical_uri arg
- instead of a folderpath.
- (folder_selected): Updated accordingly.
-
-2003-03-14 Dan Winship <danw@ximian.com>
-
- * e-storage.c (e_storage_get_has_subfolders): Add
- (e_storage_declare_has_subfolders): Rename from
- e_storage_has_subfolders to make it clearer that this is a setter,
- not a getter. (Can't call it e_storage_set_has_subfolders because
- that sounds like it belongs in e-storage-set.)
-
- * e-corba-storage.c (impl_StorageListener_notifyHasSubfolders):
- update for e_storage_declare_has_subfolders name change
- (get_folder): Override the default EStorage implementation: if
- asked for a folder under a not-yet-expanded folder, attempt to
- force the parent(s) to expand so that the child is available.
- Fixes part of #30415
-
-2003-03-14 Dan Winship <danw@ximian.com>
-
- * Evolution-Storage.idl (asyncOpenFolder): add a Bonobo::Listener
- to this like the other async interfaces, rather than having a
- hacky way to signal failure.
-
- * evolution-storage.c (impl_Storage_asyncOpenFolder): Update to
- take a listener and emit it as part of the signal
- (evolution_storage_class_init): update OPEN_FOLDER signal
- prototype.
-
- * e-shell-marshal.list (NONE:POINTER,STRING): add, for changed
- EvolutionStorage open_folder signal
-
- * e-storage.c (e_storage_async_open_folder): add a callback arg
- (impl_async_open_folder): call the callback with NOTIMPLEMENTED.
- (class_init): remove the CLOSE_FOLDER signal
- (e_storage_has_subfolders): Don't emit CLOSE_FOLDER since it
- doesn't exist any more, and this function is used for that side
- effect any more anyway.
-
- * e-corba-storage.c (async_open_folder): add the callback arg and
- create a proper closure.
- (async_open_folder_idle): Call the callback in case of error.
- Create a listener and pass that to the CORBA call.
- (async_open_cb): Listener callback.
-
- * e-storage-set.c (storage_set_view_folder_opened): Pass a
- callback to e_storage_async_open_folder.
- (async_open_cb): emit CLOSE_FOLDER if the open failed
- (storage_close_folder_cb): Remove this since the signal no longer
- exists.
-
-2003-03-11 Dan Winship <danw@ximian.com>
-
- * e-shell-startup-wizard.c (start_wizard): If the wizard factory
- returns NULL, we'll get a NIL wizard but no exception. Deal with
- that case. (ie, try the next wizard).
- (finish_func): Simplify for e-timezone-dialog changes.
- (prepare_timezone_page): If there is already a timezone set in
- gconf, set the map to point to it. (For connector autoconfig.)
-
-2003-03-07 Not Zed <NotZed@Ximian.com>
-
- ** reverted the following patch from ettore, this is a gnome 2.2
- api change, and shouldn't be used yet.
-
- * e-shell.c (impl_finalize): Use
- bonobo_activation_unregister_active_server() instead of
- bonobo_activation_active_server_unregister().
- (e_shell_construct): Use
- bonobo_activation_register_active_server() instead of
- bonobo_activation_active_server_register().
-
-2003-03-04 Not Zed <NotZed@Ximian.com>
-
- * main.c (show_development_warning): Separated the current stable
- version number from the warning prompt, and fixed a minor
- grammatical error. For bug #38775.
-
-2003-03-06 Ettore Perazzoli <ettore@ximian.com>
-
- * e-shell.c (impl_Shell_selectUserFolder): At least for now,
- disable the nasty XWMHints trick to fool WMs; it is not needed now
- that everything is in-proc.
-
-2003-03-06 Ettore Perazzoli <ettore@ximian.com>
-
- * e-shell-utils.c (e_shell_folder_name_is_valid): Do not allow
- names with a "#" in them either.
-
-2003-03-06 Ettore Perazzoli <ettore@ximian.com>
-
- * e-shell-view.c (update_other_users_folder_items_sensitivity):
- New function to toggle the "open other user's folder" menu item
- sensitivity on or off depending on whether there are any storages
- that actually support that.
- (storage_set_removed_storage_callback): New callback for the
- EStorageSet's "removed_storage" signal; it updates the sensitivity
- if necessary.
- (storage_set_new_storage_callback): Likewise, new callback for the
- EStorageSet's "new_storage" signal.
- (e_shell_view_construct): Connect these two signal callbacks here.
- Also, call update_other_users_folder_items_sensitivity() to set up
- the initial sensitivity of the menu item.
- (update_for_current_uri): Add a missing EStorageSetView cast here.
-
-2003-03-06 Ettore Perazzoli <ettore@ximian.com>
-
- [#34371]
-
- * e-shell-shared-folder-picker-dialog.c
- (folder_name_entry_changed_callback): New callback to set the
- sensitivity of the OK button according to whether the folder name
- entry is empty or not.
- (show_dialog): Connect here. Pop up an error message if no user
- is selected.
-
-2003-03-06 Ettore Perazzoli <ettore@ximian.com>
-
- * e-shell.c (impl_finalize): Use
- bonobo_activation_unregister_active_server() instead of
- bonobo_activatino_active_server_unregister().
- (e_shell_construct): Use
- bonobo_activation_register_active_server() instead of
- bonobo_activation_active_server_register().
-
-2003-03-06 Ettore Perazzoli <ettore@ximian.com>
-
- * e-shell-importer.c (IN): Use G_GNUC_FUNCTION instead of
- __FUNCTION__.
- (OUT): Likewise.
-
-2003-03-06 Ettore Perazzoli <ettore@ximian.com>
-
- Patch from Not Zed <NotZed@Ximian.com>:
-
- * main.c (show_development_warning): Separated the current stable
- version number from the warning prompt, and fixed a minor
- grammatical error. For bug #38775.
-
-2003-03-06 Ettore Perazzoli <ettore@ximian.com>
-
- * e-config-upgrade.c (import_bonobo_config): Protect from val
- being NULL when printf()ing -- should fix #39096 (Solaris-specific
- crash).
-
-2003-03-05 Ettore Perazzoli <ettore@ximian.com>
-
- * e-shell-view-menu.c: Added icon for "/popups/NewPopup/Folder".
-
-2003-03-05 Ettore Perazzoli <ettore@ximian.com>
-
- * importer/Makefile.am (BUILT_SOURCES): $(IDL_GENERATED), not
- $(IDL_GENERATED_H).
- (CLEANFILES): Make the same as $(BUILT_SOURCES).
- (GNOME_Evolution_Importer-impl.o): Removed useless rule.
-
-2003-03-04 Mike Kestner <mkestner@ximian.com>
-
- * e-shell-view.c (update_for_current_uri): only set current
- folder when the folder_path is different from the current folder.
-
-2003-03-04 Ettore Perazzoli <ettore@ximian.com>
-
- * e-folder-dnd-bridge.c (find_matching_target_for_drag_context):
- Handle p->data as a GdkAtom instead of a GdkAtom *.
- (handle_data_received_non_path): Set the target member of the
- corba_data struct to be the name of the atom.
-
- * e-storage-set-view.c (impl_tree_drag_data_get): Pass the name of
- the atom instead of the atom itself.
-
- * Evolution-ShellComponentDnd.idl: Changed the type of Data.target
- to string.
-
-2003-03-03 Ettore Perazzoli <ettore@ximian.com>
-
- * glade/e-shell-shared-folder-picker-dialog.glade: Swap Cancel/OK
- buttons as per the HIG. Also added proper response_ids.
-
-2003-03-03 Ettore Perazzoli <ettore@ximian.com>
-
- * evolution-folder-selector-button.c (impl_finalize): Protect
- against priv->possible_types being NULL.
-
-2003-02-27 Rodney Dawes <dobey@ximian.com>
-
- * Makefile.am (evolution_SOURCES): Add e-config-upgrade.h
-
-2003-02-26 Chris Toshok <toshok@ximian.com>
-
- * e-folder-list.c (e_folder_list_parse_xml): make this more robust
- - only assume it's a folderlistitem node if the name of the node
- is "folder".
-
-2003-02-26 Jeffrey Stedfast <fejj@ximian.com>
-
- * e-config-upgrade.c: Change the type of load_http_images to INT
- rather than BOOL. Fixes bug #38767.
-
-2003-02-26 Dan Winship <danw@ximian.com>
-
- * e-shell-startup-wizard.c (start_wizard): New routine to attempt
- to start each available startup wizard in priority order, and
- return once it has successfully started one. (Allows Connector,
- etc, to override the mailer startup wizard.)
- (make_corba_dialog_pages): Use it.
-
-2003-02-26 Not Zed <NotZed@Ximian.com>
-
- * apps_evolution_shell.schemas: Added a key for
- /apps/evolution/version - seems the best place to put it. This
- should not return any value if unset, so i'm not sure if this is
- the right mechanism ...
-
- * e-config-upgrade.c: Upgrade settings from earlier versions of
- evolution.
-
- * main.c (upgrade_from_1_0_if_needed): Removed.
- (main): Call e_config_upgrade before going into gmainloop.
- (main): Turn off the --force-upgrade option, since it doesn't work
- yet ...
-
-2003-02-25 Dan Winship <danw@ximian.com>
-
- * Evolution-Wizard.idl: Change this to let the Wizard provide an
- array of title/icon/control triplets, instead of just controls, so
- the shell doesn't need to know the name of each page a priori.
-
- * glade/evolution-startup-wizard.glade: Remove the mailer-specific
- pages, which are now inserted at run time based on info from the
- mailer.
-
- * evolution-wizard.c: Update for new idl.
- (evolution_wizard_new): Now takes no arguments.
- (evolution_wizard_add_page): New function to add page info to the
- wizard.
-
- * e-shell-startup-wizard.c: Various renamings to make this
- slightly less mailer-centric, though it still explicitly launches
- the mailer startup wizard.
- (make_corba_page): Replaces make_identity_page, make_receive_page,
- etc. Uses the new Wizard idl to generically create a page and
- insert it into the druid.
- (e_shell_startup_wizard_create): Update
-
-2003-02-25 Dan Winship <danw@ximian.com>
-
- * e-shell-startup-wizard.c (connect_page, make_importer_page): Use
- g_signal_connect_after to connect to the "prepare" signal to work
- around a GnomeDruidPageStandard bug (b.g.o 81869)
- (e_shell_startup_wizard_create): Remove the "return TRUE" that was
- added here a while back to disable the startup wizard.
-
- * glade/evolution-startup-wizard.glade: Change "Next" and "Finish"
- in the text to "Forward" and "Apply" to match the gnome 2 druid
- buttons.
-
-2003-02-24 Rodney Dawes <dobey@ximian.com>
-
- * e-shell-view.c: Doh, forgot to remove the e-gray-bar.h include
-
-2003-02-24 Rodney Dawes <dobey@ximian.com>
-
- * Makefile.am: We don't need e-gray-bar.[ch] anymore
- * e-gray-bar.[ch]: Remove these unused files now
- * e-shell-folder-title-bar.c: We are themeable now!!!!
- Use GtkArrows now instead of pixmaps
- Get rid of the hardcoded colors
- Add an expose_event to paint a flat box for the background
- * e-shell-view.c: Don't need e-gray-bar anymore
-
-2003-02-24 Ettore Perazzoli <ettore@ximian.com>
-
- * evolution-shell-component.c (impl_populateFolderContextMenu):
- Don't release_unref the corba_uih since
- bonobo_ui_component_set_container() takes ownership of the object
- without reffing it.
-
-2003-02-24 Ettore Perazzoli <ettore@ximian.com>
-
- * glade/e-active-connection-dialog.glade: Update dialog to use
- stock response IDs.
-
-2003-02-20 Not Zed <NotZed@Ximian.com>
-
- * main.c (upgrade_from_1_0_if_needed): fix the conf keys, currently unused.
-
- * e-shell.c (save_settings_for_component): lower-case the config prefix.
-
-2003-02-20 Dan Winship <danw@ximian.com>
-
- * Makefile.am (evolution_LDADD):
- s/libemiscwidgets.a/libemiscwidgets.la/ and likewise for
- libetimezonedialog
-
-2003-02-18 Ettore Perazzoli <ettore@ximian.com>
-
- * e-shortcuts.c (shortcut_item_new): Get the name from the name,
- not the type. Fixes #37952, pointed out by Lonnie Borntreger.
-
-2003-02-17 Chris Toshok <toshok@ximian.com>
-
- * e-shortcuts.c (load_shortcuts): plug memory leak - free path.
-
-2003-02-13 Ettore Perazzoli <ettore@ximian.com>
-
- [Ported SIGSEGV signal redirection hack from mail/.]
-
- * main.c (segv_redirect): New, SIGSEGV signal handler.
- (setup_segv_redirect): New function to set it up.
- (main): Call setup_segv_redirect().
-
-2003-02-12 Ettore Perazzoli <ettore@ximian.com>
-
- * e-setup.c (DEFAULT_USER_PATH): Look into evolution/$BASE_VERSION
- instead of evolution-$BASE_VERSION.
-
-2003-02-11 Joe Shaw <joe@ximian.com>
-
- * main.c (show_development_warning): Suggest people use 1.2.x instead
- of 1.0.x.
-
-2003-02-09 Larry Ewing <lewing@ximian.com>
-
- * e-local-storage.c (remove_folder_directory): fix length calculation.
- (create_folder_directory): remove alloca usage, clears up crash.
-
-2003-02-07 Larry Ewing <lewing@ximian.com>
-
- * e-shell-folder-creation-dialog.c
- (folder_name_entry_activate_cb): add an activate handler that
- returns a response OK if the OK response would be active.
-
-2003-02-06 Dan Winship <danw@ximian.com>
-
- * evolution-test-component.c (main): s/PACKAGE/GETTEXT_PACKAGE/ in
- gettext init.
-
-2003-02-06 Not Zed <NotZed@Ximian.com>
-
- * e-shortcuts-view.c (class_init): use POINTER_STRING_BOOL for
- activate_shortcut.
-
- * e-shell-marshal.list: Added NONE,STRING,BOOL, and
- POINTER,STRING,BOOL, removed POINTER,STRING,INT
-
- * evolution-shell-view.c (evolution_shell_view_class_init): Use
- STRING_BOOL for the set_message signal to match rest of command.
-
- * e-shell-marshal.list: Added NONE,STRING,STRING,STRING
-
- * evolution-shell-component.c
- (evolution_shell_component_class_init): Change the
- user_create_new_item marshaller to STRING_STRING_STRING to match
- the rest of the call. The 'new' button should work now.
-
- * e-setup.c (copy_default_stuff): We want to copy whats in the
- default user dir, not the default user dir.
-
-2003-02-05 Dan Winship <danw@ximian.com>
-
- * Makefile.am (INCLUDES): Define EVOLUTION_IMAGES using
- $(imagesdir). Define EVOLUTION_GLADEDIR using $(gladedir)
- (eshellincludedir): Define in terms of $(privincludedir)
- (evolution_LDFLAGS): Remove this. gmodule-2's LDFLAGS include the
- equivalent of -export-dynamic for us.
- (serverdir, etspecdir): Remove. Defined in configure.in now.
-
- * e-folder.c: #include <string.h>
- * e-corba-config-page.c: Likewise
- * e-shell-config.c: Likewise
- * e-shell-folder-creation-dialog.c: Likewise
- * e-shell-folder-title-bar.c: Likewise
- * e-shell-startup-wizard.c: Likewise
- * evolution-activity-client.c: Likewise.
- * evolution-shell-component-client.c: Likewise
- * evolution-shell-component-utils.c: Likewise
- * evolution-storage.c: Likewise
- * evolution-test-component.c: Likewise
-
- * e-shortcuts-view.c (destroy_group_cb): Remove unused variable
-
- * importer/Makefile.am (INCLUDES): Remove -I$(includedir). Define
- EVOLUTION_GLADEDIR using $(gladedir).
- (libevolution_importerincludedir): Define in terms of
- $(privincludedir)
- (gladedir): Removed. Defined in configure.in now.
-
- * glade/Makefile.am (gladedir): Likewise
-
-2003-02-05 Dan Winship <danw@ximian.com>
-
- * importer/evolution-intelligent-importer.c:
- s/BonoboXObject/BonoboObject/
-
- * e-folder-list.c (e_folder_list_class_init):
- s/glade_gnome_init/glade_init/
-
- * main.c (main): Likewise
-
-2003-02-05 Not Zed <NotZed@Ximian.com>
-
- * e-shell-startup-wizard.c (start_importers): re-enable.
- (prepare_importer_page): re-enable importer code.
-
- * e-shell-importer.c (druid_finish_button_change): removed, since
- its not such a hack to change anymore. Dunno how to get an icon
- on it tho, without a stock button.
- (show_import_wizard): Change the apply button to "Import" here.
-
-2003-01-28 Not Zed <NotZed@Ximian.com>
-
- * e-local-storage.c (create_folder_directory): We can't use
- pointer arithmetic with g_path_get_*, so adjust code accordingly.
-
-2003-01-16 Not Zed <NotZed@Ximian.com>
-
- * e-shell-startup-wizard.c (e_shell_startup_wizard_create): Hook
- onto finish instead of next on the last page.
-
-2003-01-28 Ettore Perazzoli <ettore@ximian.com>
-
- * Makefile.am ($(SELECT_NAMES_IDL_GENERATED_C)): No need for the
- @true command.
- ($(IDL_GENERATED_C)): Likewise.
- (e-shell-marshal.h, e-shell-marshal.c): Use different names for
- the .tmp files so these can be generated in parallel.
-
- * importer/Makefile.am (GNOME_Evolution_Importer-impl.o): Remove
- unused rule.
- ($(IDL_GENERATED_C)): Remove useless @true command.
- (BUILT_SOURCES): Put the .h generated files in here as well.
-
-2003-01-28 Ettore Perazzoli <ettore@ximian.com>
-
- * Makefile.am (Evolution-impl.o): Removed unused rule.
-
-2003-01-28 Ettore Perazzoli <ettore@ximian.com>
-
- * importer/Makefile.am: Make this work with parallel make as well.
-
-2003-01-28 Ettore Perazzoli <ettore@ximian.com>
-
- * Makefile.am: Use a little trick for the IDL compilation so that
- it works with parallel makes.
-
-2003-01-28 Ettore Perazzoli <ettore@ximian.com>
-
- * e-shell.c (e_shell_construct): Use
- bonobo_activation_server_register() instead of
- bonobo_activation_register_active_server() again, since we want to
- be able to build against bonobo-activation 2.0 and the latter is
- 2.2-specific.
- (impl_finalize): Likewise, use
- bonobo_activation_active_server_unregister() instead of
- bonobo_activation_unregister_active_server().
-
-2003-01-27 Ettore Perazzoli <ettore@ximian.com>
-
- * e-shell-importer.c (choose_importer_from_list): Set
- GTK_RESPONSE_OK as the default response.
-
- * Makefile.am (INCLUDES): Add -DGNOME_DISABLE_DEPRECATED,
- -DBONOBO_DISABLE_DEPRECATED.
-
- * e-shortcuts.c (update_shortcut_and_emit_signal): Use
- g_signal_emit() instead of gtk_signal_emit().
-
- * e-shortcuts-view.c (destroy_group_cb): Port from GnomeMessageBox
- to GtkMessageDialog.
-
- * e-shell.c (get_icon_path_for_component_info): Use
- gnome_program_locate_file() instead of gnome_pixmap_file().
- (impl_finalize): Use bonobo_activation_unregister_active_server()
- instead of bonobo_activation_active_server_register().
- (e_shell_construct): Use
- bonobo_activation_register_active_server() instead of
- bonobo_activation_active_server_register().
-
- * e-shell-view-menu.c (command_submit_bug): Use e_notice().
- (launch_pilot_settings): Use g_find_program_in_path() instead of
- gnome_is_program_in_path().
- (command_submit_bug): Likewise.
-
- * e-shell-utils.c (get_icon_path): Use g_file_test() instead of
- g_file_exists().
-
- * e-shell-startup-wizard.c (prepare_importer_page): Port from
- GnomeMessageBox to GtkMessageDialog.
-
- * e-shell-shared-folder-picker-dialog.c (show_dialog): Update for
- GtkDialog.
- (progress_dialog_close_callback): Removed.
- (progress_dialog_clicked_callback): Removed.
- (progress_dialog_response_callback): New.
- (create_progress_dialog): Ported to GnomeDialog.
-
- * e-shell-offline-sync.c: Add member parent_window to struct
- SyncData.
- (e_shell_offline_sync_all_folders): Set it from the parent_window
- arg.
- (progress_dialog_close_callback): Removed.
- (progress_dialog_clicked_callback): Removed.
- (progress_dialog_response_callback): New.
- (setup_dialog): Create a GtkDialog instead of a GnomeDialog.
- (sync_folder): Updated for GtkDialog.
-
- * e-shell-offline-handler.c (dialog_handle_ok): Make it get a
- GtkDialog instead of a GnomeDialog.
- (dialog_handle_cancel): Likewise.
- (dialog_clicked_cb): Removed.
- (dialog_response_cb): New.
- (pop_up_confirmation_dialog): Connect the new dialog_response_cb()
- instead of the old dialog_clicked_cb(). Removed
- gnome_dialog_set_default() call.
-
- * e-shell-folder-creation-dialog.c (dialog_response_cb): Make
- first arg a GtkDialog, not a GnomeDialog.
-
- * e-shell-folder-commands.c (e_shell_command_delete_folder):
- Expect delete_dialog() to return a GtkResponseType.
- (delete_dialog): Ported to GtkMessageDialog; Return a
- GtkResponseType.
-
- * e-shell-config-default-folders.c
- (e_shell_config_default_folders_create_widget): Removed unused
- variable.
-
- * e-setup.c (check_evolution_directory): Remove Evolution
- directory installation message.
- (e_setup): Remove check for the Executive-Summary directory.
-
- * e-local-storage.c (create_folder_directory): Use g_file_test()
- instead of g_file_exists().
-
- * evolution-shell-component-utils.c (e_pixmaps_update): Use
- g_build_filename() of g_concat_dir_and_file().
- * e-folder-dnd-bridge.c (handle_data_received_path): Likewise.
- * e-local-folder.c (construct_loading_metadata): Likewise.
- (save_metadata): Likewise.
- * e-local-storage.c (remove_folder_directory): Likewise.
- (append_xfer_item_list): Likewise.
- * e-setup.c (check_dir_recur): Likewise.
- (e_shell_rm_dir): Likewise.
- (setup_bonobo_conf_private_directory): Likewise.
- * e-shell-folder-commands.c
- (folder_selection_dialog_folder_selected_callback): Likewise.
- (e_shell_command_rename_folder): Likewise.
- * e-shell-folder-creation-dialog.c (dialog_response_cb): Likewise.
- * e-shell-settings-dialog.c (load_pages): Likewise.
- * e-shell-utils.c (get_icon_path): Likewise.
- * e-shell.c (setup_local_storage): Likewise.
- (get_icon_path_for_component_info): Likewise.
- (e_shell_construct): Likewise.
- * main.c (main): Likewise.
-
-2003-01-27 Ettore Perazzoli <ettore@ximian.com>
-
- * e-shell-about-box.c (timeout_callback): Pass a the context's
- language to pango_context_get_metrics() instead of NULL, so the
- heights are computed correctly.
-
-2003-01-27 Ettore Perazzoli <ettore@ximian.com>
-
- * evolution-shell-component.c (owner_ping_callback): #if 0'ed out
- for now, since it seems to cause trouble for local components.
- (setup_owner_pinging): Likewise.
+2003-01-31 Ettore Perazzoli <ettore@ximian.com>
* e-shell-user-creatable-items-handler.c
(get_default_action_for_view): Return default_menu_item [instead
of NULL] if there is no view displayed. [#32736]
-2003-01-23 Ettore Perazzoli <ettore@ximian.com>
-
- * e-shell-folder-title-bar.c (get_max_clipped_label_width): Use
- clipped_label->layout instead of creating a new PangoLayout; this
- way we respect the actual font being used.
-
-2003-01-23 Ettore Perazzoli <ettore@ximian.com>
-
- * e-shell-view.c (create_label_for_empty_page): Update for new
- args to e_clipped_label_new().
-
- * e-shell-folder-title-bar.c (e_shell_folder_title_bar_construct):
- Make the title label bold and larger using the new args to
- e_clipped_label_new().
-
2002-01-23 Ettore Perazzoli <ettore@ximian.com>
- [Port fix for #34129 from evolution-1-2-branch, unread count in
- shortcut bar doesn't update properly.]
+ [Fix #34129, unread count in shortcut bar doesn't update
+ properly.]
* e-shortcuts.c (update_shortcuts_by_path): Use
e_shell_parse_uri() so we handle default shortcuts properly as
@@ -750,430 +25,10 @@
<leon.zhang@sun.com> for pointing out the brokenness of this
code.]
-2003-01-23 Ettore Perazzoli <ettore@ximian.com>
-
- * e-shell-about-box.c: Update copyright year.
-
-2003-01-22 Ettore Perazzoli <ettore@ximian.com>
+2002-12-17 Frederic Crozat <fcrozat@mandrakesoft.com>
- * Makefile.am: Install the shell executable as
- evolution-$(BASE_VERSION) using an install-exec-local hack. Also
- put libeshell in $(privlibdir) instead of $(libdir).
- (eshellincludedir): Version using $(BASE_VERSION).
- (INCLUDES): Update for the new locations of things.
- (etspecdir): Likewise.
-
- * e-shell-view.c (e_shell_view_construct): Get evolution.xml from
- EVOLUTION_UIDIR.
-
- * importer/Makefile.am: Install libevolution-importer in
- $(privlibdir) instead of $(libdir).
- (INCLUDES): Updated for the new versioned paths. Define
- EVOLUTION_UIDIR.
- (libevolution_importerincludedir): Version using $(BASE_VERSION).
- (gladedir): Likewise.
-
- * glade/Makefile.am (gladedir): Version using $(BASE_VERSION).
-
- * e-setup.c (DEFAULT_USER_PATH): New #define.
- (check_evolution_directory): Use it.
- (copy_default_stuff): Likewise. Also, remove old shortcuts.xml
- removal cruft.
-
-2003-01-17 Chris Toshok <toshok@ximian.com>
-
- * e-shell-settings-dialog.c (set_dialog_size): pass
- pango_context_get_language (context) to
- pango_context_get_metrics.
-
-2003-01-14 Ettore Perazzoli <ettore@ximian.com>
-
- * e-shell-folder-selection-dialog.c
- (e_shell_folder_selection_dialog_construct): Make dialog
- New/Cancel/OK to match HIG.
-
- * glade/e-shell-folder-creation-dialog.glade: Swap Cancel/OK
- buttons to match HIG.
-
- * e-shell-importer.c (choose_importer_from_list): Make dialog
- Cancel/OK to match HIG.
-
- * e-shell-folder-selection-dialog.c
- (e_shell_folder_selection_dialog_construct): Make dialog Cancel/OK
- to match HIG.
-
- * e-shell-view.c: Do not #include "e-bonobo-widget.h".
-
-2003-01-14 Ettore Perazzoli <ettore@ximian.com>
-
- * Makefile.am (EXTRA_DIST): Add $(schema_DATA) here.
-
-2003-01-14 Rodney Dawes <dobey@ximian.com>
-
- * e-shell-view.c: Use GtkPaned instead of EPaned
-
-2003-01-13 Dan Winship <danw@ximian.com>
-
- * s/BonoboXObject/BonoboObject/ (for BONOBO_DISABLE_DEPRECATED)
-
-2003-01-10 Ettore Perazzoli <ettore@ximian.com>
-
- * evolution-shell-component.c (impl_setOwner): Don't duplicate the
- shell object here before passing to evolution_shell_client_new().
-
- * evolution-shell-client.c (evolution_shell_client_construct):
- Dupliate the @corba_shell before storing into the
- EvolutionShellClientPrivate struct.
-
- * e-shell-config-default-folders.c
- (e_shell_config_default_folders_create_widget): Do not duplicate
- the shell's CORBA objref.
-
- * e-shell-config-autocompletion.c
- (e_shell_config_autocompletion_create_widget): Do not duplicate
- the shell's CORBA objref.
-
-2003-01-10 Dan Winship <danw@ximian.com>
-
- * e-storage-set-view.c (popup_folder_menu): Make this work again.
-
-2003-01-10 Ettore Perazzoli <ettore@ximian.com>
-
- * e-shell-view.c (e_shell_view_save_defaults): Save the expansion
- state of the EStorageSetView.
- (setup_defaults): Load the expansion state.
-
-2003-01-10 Ettore Perazzoli <ettore@ximian.com>
-
- * e-shell.c (e_shell_request_close_view): Make the view save its
- settings as the default ones if it's the last one.
-
- * e-shell-view-menu.c (command_quit): Make this view save its
- settings as the defaults before quitting.
-
-2003-01-10 Ettore Perazzoli <ettore@ximian.com>
-
- * main.c (main): Generate the URI list from the popt context
- fetched from the GnomeProgram object.
-
- * e-shell-view.c (setup_defaults): Removed @setup_default_uri arg.
- Don't load any URI here.
- (e_shell_view_construct): Open the URI here instead.
-
-2003-01-10 Ettore Perazzoli <ettore@ximian.com>
-
- * e-shell.c (parse_default_uri): Remove bogus is_default check.
-
-2003-01-10 Ettore Perazzoli <ettore@ximian.com>
-
- * e-setup.c (set_default_folder_physical_uri_from_path): New
- function.
- (e_setup_check_config): Call it for each of the *_path keys. Do
- not set the default for *_path keys as those come from the GConf
- schema anyways.
-
-2003-01-10 Ettore Perazzoli <ettore@ximian.com>
-
- * apps_evolution_shell.schemas: Set defaults for
- /apps/evolution/shell/default_folders/... .
-
- * e-shortcuts-view.c (pop_up_right_click_menu_for_group): Destroy
- the popup_menu with gtk_widget_destroy() instead of
- gtk_widget_unref().
-
-2003-01-10 Not Zed <NotZed@Ximian.com>
-
- * evolution-config-control.c (impl_apply): remove cast to
- GTK_OBJECT, it isn't, nor needed.
-
-2003-01-09 Chris Toshok <toshok@ximian.com>
-
- * e-shell-settings-dialog.c (set_dialog_size): use
- pango_layout_get_pixel_size here instead of
- pango_layout_get_width, which returns 0 (unless it's been set by
- the user before, I believe).
-
-2003-01-09 Ettore Perazzoli <ettore@ximian.com>
-
- * evolution-shell-client.c (impl_dispose): Properly reset
- activity_interface to NULL.
- (evolution_shell_client_construct): Ref the shell object here.
-
- * e-shell.c (view_weak_notify): Ref the shell since it's being
- passed to notify_no_views_left_idle_cb as the data.
- (notify_no_views_left_idle_cb): Only unref the shell here.
-
-2003-01-08 Not Zed <NotZed@Ximian.com>
-
- * e-shell-settings-dialog.c (set_dialog_size): dont unref the
- pango context, get_context() doesn't create a ref.
-
-2003-01-08 Ettore Perazzoli <ettore@ximian.com>
-
- * Makefile.am: Images are now in $(datadir)/evolution/images
- instead of $(datadir)/images/evolution.
-
- * e-folder-list.c (e_folder_list_class_init): Remove
- "EFolderList::" prefix from the properties.
-
-2003-01-08 Ettore Perazzoli <ettore@ximian.com>
-
- * Makefile.am (evolution_LDFLAGS): -export-dynamic so custom
- widgets in libglade work.
-
-2003-01-07 Dan Winship <danw@ximian.com>
-
- * main.c (main): setup gettext
-
-2003-01-06 Not Zed <NotZed@Ximian.com>
-
- * evolution-folder-selector-button.c (set_folder): dont
- double-free storage_lname.
-
-2003-01-06 Dan Winship <danw@ximian.com>
-
- * Makefile.am: Remove idldir definition. (It's defined in
- configure.in now).
-
- * importer/Makefile.am: Likewise
-
-2002-12-19 Ettore Perazzoli <ettore@ximian.com>
-
- [With this commit, the shell compiles without deprecated GLib/GTK+
- functions, except for a couple of places were we use GtkCList.]
-
- * Makefile.am (INCLUDES): Add `-DG_DISABLE_DEPRECATED
- -DGTK_DISABLE_DEPRECATED'.
-
- * evolution-test-component.c (create_new_folder_selector): No
- gtk_window_set_policy().
-
- * main.c (quit_box_new): gtk_window_set_resizable() instead of
- gtk_window_set_policy().
- (view_map_callback): g_signal_handlers_disconnect_by_func()
- instead of gtk_signal_disconnect_by_func().
- (main): No need to push the GdkRGB visual/cmap anymore.
- (new_view_created_callback): Likewise.
-
- * e-task-widget.c: Renamed member pixmap of ETaskWidgetPrivate to
- `image'.
- (init): Updated accordingly.
- (e_task_widget_construct): Use GtkImage, not GtkPixmap.
-
- * e-storage.c (class_init): Converted from gtk_signal_new() to
- g_signal_new().
-
- * e-storage-set.c (class_init): Converted from gtk_signal_new() to
- g_signal_new().
-
- * e-storage-set-view.c
- (setup_folder_properties_items_if_corba_storage_clicked):
- g_string_append_printf() instead of g_string_sprintfa().
- (class_init): Converted from gtk_signal_new() to g_signal_new().
- (setup_folder_changed_callbacks): Use
- e_signal_connect_while_alive() and
- e_signal_connect_full_while_alive().
-
- * e-splash.c (e_splash_construct): gtk_window_set_resizable()
- instead of gtk_window_set_policy().
-
- * e-shortcuts.c: Do not #include e-unicode.h.
- (shortcut_item_update): Use g_path_get_basename() instead of
- g_basename().
- (e_shortcuts_add_default_shortcuts): No need to de-utfize strings.
- (e_shortcuts_add_default_group): Same here.
-
- * e-shortcuts-view.c: Do not #include <e-unicode.h>.
- (class_init): Converted from gtk_signal_new() to g_signal_new().
- (destroy_group_cb): No need to convert the text from UTF8.
-
- * e-shell.c (impl_dispose): g_signal_handlers_disconnect_by_func()
- instead of gtk_signal_disconnect_by_func().
- (class_init): Use g_signal_new() instead of gtk_signal_new().
-
- * e-shell-view.c: Do not #include e-unicode.h. Renamed member
- offline_toggle_pixmap to offline_toggle_image in
- EShellViewPrivate.
- (update_folder_title_bar): No need to de-UTF8-ize the title.
- (cleanup_delayed_selection):
- g_signal_handlers_disconnect_by_func() instead of
- gtk_signal_disconnect_by_func().
- (ui_engine_add_hint_callback): gtk_label_set_text(), not
- gtk_label_set().
- (class_init): Use g_signal_new() instead of gtk_signal_new().
- (update_for_current_uri): No need to convert the title from UTF8.
- (setup_offline_toggle): Changed to set up a GtkImage, not a
- GtkPixmap.
- (update_offline_toggle_status): Accordingly (gtk_image* instead of
- gtk_pixmap*).
- (set_current_notebook_page): gtk_notebook_set_current_page(), not
- gtk_notebook_set_page().
- (get_storage_set_path_from_uri): g_ascii_strncasecmp() instead of
- g_strncasecmp().
- (folder_bar_popup_map_callback): Use
- e_signal_connect_while_alive() instead of
- gtk_signal_connect_while_alive().
- (e_shell_view_construct): Likewise.
- (display_uri): g_signal_connect_after() instead of
- gtk_signal_connect_full().
- (update_for_current_uri):
- g_signal_handlers_{block,unblock}_by_func() instead of
- gtk_signal_handler_{block,unblock}_by_func().
-
- * e-shell-view-menu.c (command_about_box):
- gtk_window_set_resizable() instead of gtk_window_set_policy().
-
- * e-shell-utils.c (get_mini_name): g_path_get_basename() instead
- of g_basename().
-
- * e-shell-user-creatable-items-handler.c
- (append_xml_for_menu_item): g_string_append_printf() instead of
- g_string_sprintfa().
- (create_menu_xml): Likewise.
-
- * e-shell-shared-folder-picker-dialog.c: Do not #include
- e-unicode.h.
- (progress_bar_timeout_callback): Expect a GtkProgressBar data and
- just use gtk_progress_bar_pulse().
- (create_progress_dialog): gtk_window_set_resizable() instead of
- gtk_window_set_policy(). No gtk_progress_set_activity_mode().
- (setup_server_option_menu): Just use
- gtk_menu_item_new_with_label() instead of
- e_utf8_gtk_menu_item_new_with_label().
-
- * e-shell-settings-dialog.c (set_dialog_size): Ported to Pango.
-
- * e-shell-offline-sync.c
- (impl_SyncFolderProgressListener_updateProgress):
- gtk_progress_set_fraction() instead of
- gtk_progress_bar_set_percentage().
- (sync_folder): Likewise.
- (setup_dialog): gtk_window_set_resizable() instead of
- gtk_window_set_policy().
- (sync_folder): No gtk_progress_set_activity_mode().
-
- * e-shell-offline-handler.c: #undef {G,GTK}_DISABLE_DEPRECATED
- here for now (need to port from GtkCList).
- (class_init): Use g_signal_new()
-
- * e-shell-importer.c: #undef {G,GTK}_DISABLE_DEPRECATED here for
- now (need to port from GtkCList).
-
- * e-shell-folder-title-bar.c (create_image_widget_from_xpm):
- Renamed from create_pixmap_widget_from_xpm(); handle GtkImage
- instead of GtkPixmap.
- (new_empty_image_widget): Renamed from new_empty_pixmap_widget();
- return a GtkImage instead of a GtkPixmap.
- (add_navigation_buttons): Updated accordingly; so use GtkImages
- instead of GtkPixmaps.
- (e_shell_folder_title_bar_construct): Likewise.
- (e_shell_folder_title_bar_set_icon): Use gtk_image_* instead of
- gtk_pixmap_* on the image widgets.
- (class_init): Converted to use g_signal_new() instead of
- gtk_signal_new().
- (e_shell_folder_title_bar_new): No need for pushing the GdkRGB
- visual/cmap anymore.
-
- * e-shell-folder-selection-dialog.c (check_folder_type_valid):
- Just use strcmp instead of strcasecmp().
- (class_init): g_signal_new() instead of gtk_signal_new().
- (e_shell_folder_selection_dialog_construct): Removed call to
- gtk_window_set_policy().
-
- * e-shell-folder-creation-dialog.c
- (type_with_display_name_compare_func): Changed to use
- g_utf8_casefold().
-
- * e-shell-folder-commands.c: Do not #include e-unicode.h.
- (e_shell_command_rename_folder): g_path_get_dirname() instead of
- g_dirname().
- (folder_selection_dialog_folder_selected_callback):
- g_path_get_basename() instead of g_basename().
- (rename_cb): Likewise.
- (delete_dialog): Do not convert from UTF8 for display purposes.
- (e_shell_command_rename_folder): Likewise.
-
- * e-shell-about-box.c (timeout_callback): Ported to Pango and use
- gdk_window_invalidate_rect() instead of gtk_widget_draw().
-
- * e-setup.c (check_evolution_directory): Use
- gtk_window_set_resizable() instead of gtk_window_set_policy().
-
- * e-local-storage.c: Do not include e-unicode.h.
- (create_folder): Use g_path_get_basename() instead of
- g_basename().
- (create_folder_directory): Likewise.
- (remove_folder_directory): Likewise.
- (append_xfer_item_list): Likewise.
-
- * e-local-folder.c (construct_loading_metadata): Use
- g_path_get_basename() instead of g_basename().
-
- * e-folder-dnd-bridge.c (handle_evolution_path_drag_motion): Use
- g_path_get_basename() instead of g_basename().
-
- * e-corba-storage-registry.c: G_STRUCT_OFFSET instead of
- GTK_STRUCT_OFFSET.
-
- * e-corba-shortcuts.c: G_STRUCT_OFFSET instead of
- GTK_STRUCT_OFFSET.
-
- * e-component-registry.c
- (sleep_with_g_main_loop_timeout_callback): g_main_loop_* instead
- of g_main_*.
- (sleep_with_g_main_loop): Likewise.
-
- * e-activity-handler.c: G_STRUCT_OFFSET instead of
- GTK_STRUCT_OFFSET.
-
- * evolution-wizard.c (evolution_wizard_class_init): g_signal_new()
- instead of gtk_signal_new().
-
- * evolution-storage-listener.c (class_init): g_signal_new()
- instead of gtk_signal_new().
-
- * evolution-shell-view.c (class_init): g_signal_new() instead of
- gtk_signal_new().
-
- * evolution-shell-component-dnd.c: G_STRUCT_OFFSET instead of
- GTK_STRUCT_OFFSET.
-
- * evolution-shell-component.c: G_STRUCT_OFFSET instead of
- GTK_STRUCT_OFFSET.
-
- * evolution-session.c: G_STRUCT_OFFSET instead of
- GTK_STRUCT_OFFSET.
-
- * evolution-folder-selector-button.c: Do not include e-unicode.h.
- (set_folder): No need to convert from UTF8 to locale encoding
- anymore. Removed unused variable.
-
- * evolution-config-control.c (class_init): Use g_signal_new()
- instead of gtk_signal_new().
-
- * evolution-activity-client.c (class_init): Use g_signal_new()
- instead of gtk_signal_new().
-
- * e-folder-list.c: Do not include e-unicode.h. Use E_MAKE_TYPE().
- (e_folder_list_get_type): Removed explicit implementation of this.
- (e_folder_list_set_arg): Removed.
- (e_folder_list_get_arg): Removed.
- (e_folder_list_set_property): New.
- (e_folder_list_get_property): New.
- (e_folder_list_destroy): Removed.
- (e_folder_list_dispose): New.
- (e_folder_list_class_init): Updated accordingly.
-
- * e-folder.c (impl_save_info): Use G_OBJECT_TYPE_NAME() instead of
- gtk_type_name().
- (impl_load_info): Likewise.
- (impl_remove): Likewise.
- (class_init): Use g_signal_new() instead of gtk_signal_new().
-
-2002-12-16 Jeffrey Stedfast <fejj@ximian.com>
-
- * e-shell-importer.c: Don't #include "e-util/e-html-utils.h" as
- we don't use it.
+ * e-shell-settings-dialog.c: (page_new):
+ oaf returns locale encoded strings, not UTF-8 ones.
2002-12-13 Chris Toshok <toshok@ximian.com>
@@ -1189,1351 +44,55 @@
"contacts/ldap" as the accepted contacts types, so it'll allow
both normal and ldap contact folders.
-2002-12-04 Ettore Perazzoli <ettore@ximian.com>
-
- * e-component-registry.c (component_free): Only invoke
- wait_for_corba_object_to_die on components that are out-of-proc.
-
-2002-11-27 Not Zed <NotZed@Ximian.com>
-
- * main.c (show_development_warning): changed to use a gtkdialog
- instead of a gnome one.
- (warning_dialog_response_callback): clicked->response.
+2002-11-26 Ettore Perazzoli <ettore@ximian.com>
- * e-shell-folder-selection-dialog.c: Include gtk/gtkstock.h
+ * main.c (kill_old_wombat): New function to kill running wombat
+ processes whose version is different from ours, using the
+ WombatInterfaceCheck interface.
+ (kill_wombat): New.
+ (idle_cb): Invoke kill_old_wombat().
- * e-shell-folder-creation-dialog.c: include gnome-dialog.h
- (dialog_response_cb): gtk_entry_get_text now returns const. Dont
- free result.
+ * e-storage-set-view.c (path_free_func): New GHFunc to free keys.
+ (impl_destroy): g_hash_table_foreach() it on
+ priv->path_to_etree_node befor destroying the hash table.
+ (e_storage_set_view_set_show_checkboxes): Unref the state object.
- * e-setup.c: include gnome-messagebox.h
+ * e-shell-user-creatable-items-handler.c
+ (append_xml_for_menu_item): Free return value from
+ bonobo_ui_util_pixbuf_to_xml().
- * *.c: (re)run fix.sh over all, for e_notice changes & pick up
- some deprecated functions.
+ * e-shell-folder-title-bar.c (create_pixmap_widget_from_xpm):
+ Unref the pixbuf.
- * e-shell-shared-folder-picker-dialog.c
- (shared_folder_discovery_callback): reformat e_notice call for
- script.
+ * e-corba-storage-registry.c (listener_notify): CORBA_free the
+ name string.
- * e-shell-offline-sync.c
- (impl_SyncFolderProgressListener_reportFailure): Fix e_notice
- call, we weren't passing type in.
-
- * e-shell-folder-commands.c (xfer_result_callback): changed around
- slightly to save some processing & allow a script to run.
- (e_shell_command_rename_folder): reformat e_notice call to help script.
- Include gnome-messagebox.h
+ * e-storage.c (e_storage_has_subfolders): Free local variable
+ pseudofolder_path.
2002-11-25 Dan Winship <danw@ximian.com>
* e-shell-settings-dialog.c (page_new): e_get_language_list now
returns language codes that actually work with oaf, making the
- _()s here redundant.
+ U_()s here redundant.
* e-component-info.c (get_i18n_value): Remove code to turn "fr_FR"
into "fr", since e_get_language_list will return both now.
-2002-11-25 Ettore Perazzoli <ettore@ximian.com>
-
- * apps_evolution_shell.schemas: Fix <key> -> <applyto> typo.
-
-2002-11-25 Ettore Perazzoli <ettore@ximian.com>
-
- * e-shell-offline-sync.c (e_shell_offline_sync_all_folders):
- Filled in, use GConf.
- (cleanup): Re-enabled again.
- (sync_folder): Likewise.
- (progress_dialog_close_callback): Likewise.
- (progress_dialog_clicked_callback): Likewise.
- (setup_dialog): Likewise.
- (setup_progress_listener): Likewise.
- (impl_SyncFolderProgressListener_reportFailure): Likewise.
- (impl_SyncFolderProgressListener_reportSuccess): Likewise.
- (impl_SyncFolderProgressListener_updateProgress): Likewise.
- (progress_listener_servant_free): Likewise.
- (progress_listener_servant_new): Likewise.
-
-2002-11-25 Ettore Perazzoli <ettore@ximian.com>
-
- * evolution-storage-set-view.c
- (impl_StorageSetView__set_checkedFolders): Updated to pass a
- GSList to e_storage_set_view_set_checkboxes_list() [instead of a
- GList].
- (impl_StorageSetView__get_checkedFolders): Likewise with the
- return value from e_storage_set_view_get_checkboxes_list().
-
- * e-shell-config-offline.c (config_control_apply_callback): Filled
- in, using GConf.
- (init_storage_set_view_status_from_config): Likewise.
-
- * e-storage-set-view.c (e_storage_set_view_get_checkboxes_list):
- Return a GSList instead of a GList.
- (essv_add_to_list): Update for the GSList.
- (e_storage_set_view_set_checkboxes_list): Get a GSList instead of
- a GList.
-
- * apps_evolution_shell.schemas: Added
- /schemas/apps/evolution/shell/offline/folder_paths.
-
-2002-11-20 Ettore Perazzoli <ettore@ximian.com>
-
- * main.c (idle_cb): Set displayed_any in the case when we are
- calling e_shell_create_view(). Also initialize displayed_any to
- FALSE earlier so we dont' end up opening two views at startup by
- default.
-
-2002-11-20 Ettore Perazzoli <ettore@ximian.com>
-
- * e-shell-folder-selection-dialog.c (impl_dispose): Save the
- expansion state for the EStorageSetView here.
- (impl_finalize): Instead of here.
-
-2002-11-20 Chris Toshok <toshok@ximian.com>
-
- * e-folder-list.c (e_folder_list_class_init): use e_shell_
- marshallers, and make sure STRING parameters map to *_STRING*
- marshallers.
-
- * evolution-wizard.c (evolution_wizard_class_init): same.
-
- * evolution-storage.c (class_init): same.
-
- * evolution-storage-set-view-listener.c (class_init): same.
-
- * evolution-storage-listener.c (class_init): same.
-
- * evolution-shell-view.c (class_init): same.
-
- * evolution-session.c (class_init): same.
-
- * evolution-folder-selector-button.c (class_init): same.
-
- * evolution-config-control.c (class_init): same.
-
- * evolution-activity-client.c (class_init): same.
-
- * e-storage-set.c (class_init): same.
-
- * e-shortcuts.c (class_init): same.
-
- * e-shortcuts-view.c (class_init): same.
-
- * e-shell.c (class_init): same.
-
- * e-shell-view.c (class_init): same.
-
- * e-shell-offline-handler.c (class_init): same.
-
- * e-shell-folder-title-bar.c (class_init): same.
-
- * e-shell-folder-selection-dialog.c (class_init): same.
-
- * e-folder.c (class_init): same.
-
- * e-shell-marshal.list: add all the STRING marshallers.
-
-2002-11-20 Not Zed <NotZed@Ximian.com>
-
- * e-shell-importer.c (prepare_intelligent_page): gnome message box
- -> gtk message dialog.
- (prepare_intelligent_page): Fix the signature on this. This could
- NEVER have worked.
-
-2002-11-19 Ettore Perazzoli <ettore@ximian.com>
-
- * main.c (upgrade_from_1_0_if_needed): Disabled for now.
-
- * e-shell-startup-wizard.c: Removed member config_listener from
- struct SWData.
- (e_shell_startup_wizard_create): Updated accordingly, just use
- GConf, checking the /apps/evolution/mail/account-list key.
- (finish_func): Use GConf.
-
- * e-shell-config-default-folders.c: Removed member config_listener
- in struct EvolutionDefaultFolderConfig.
- (e_shell_config_default_folders_create_widget): Do not initialize
- here. GConfified the paths.
- (config_control_destroy_notify): No unref of the config_listener
- anymore.
- (config_control_apply_cb): Use GConf.
- (setup_folder_selector): Likewise.
-
- * e-shell-config-autocompletion.c: Removed member config_listener
- from EvolutionAutocompletionConfig.
- (config_control_destroy_notify): Do not unref.
- (config_control_apply_callback): Use a GConfClient.
-
- * e-folder-list.c (e_folder_list_init): Add missing cast.
-
- * main.c (show_development_warning): Use GConf.
-
- * e-setup.c (e_setup_check_config): Removed arg @listener.
- GConfified.
-
- * e-shell-view.c (e_shell_view_save_defaults): New.
- (e_shell_view_save_settings): Removed.
- (e_shell_view_load_settings): Removed.
- (setup_defaults): New helper function.
- (e_shell_view_construct): New arg @uri.
- (e_shell_view_new): New arg @uri.
-
- * e-shell.c: Removed member config_listener in struct
- EShellPrivate.
- (impl_dispose): Do not unref.
- (init): Do not initialize.
- (get_config_start_offline): New helper function.
- (e_shell_construct): Use this to get the startup mode in case
- E_SHELL_STARTUP_LINE_MODE_CONFIG.
- (save_misc_settings): Changed to use GConfClient instead of
- EConfigListener.
- (e_shell_create_view_from_settings): Removed.
- (e_shell_restore_from_settings): Removed.
- (e_shell_get_config_listener): Removed.
- (e_shell_disconnect_db): Removed.
- (parse_default_uri): Use GConf.
-
- * main.c (idle_cb): Simplified the logic here. Always assume that
- the view will be created with the default folder open by just
- using e_shell_create_view().
-
-2002-11-19 Not Zed <NotZed@Ximian.com>
-
- * e-shell-shared-folder-picker-dialog.c (show_dialog): Pass type
- to bonobo_widget::set_property.
-
-2002-11-18 Not Zed <NotZed@Ximian.com>
-
- * e-shell-view-menu.c (file_verbs[]): re-enable importer wizard.
-
- * importer/importer.c (dialog_response_cb): from clicked_cb.
- (start_import): gtkdialogise.
-
- * e-shell-importer.c: removed redundant header.
- (create_html): Removed utf8 from locale stuff.
- (get_name_from_component_info): oaf->bonobo activation.
- (get_iid_for_filetype): "
- (create_plugin_menu): Likewise, and change oafiid to bonoboiid
- (get_intelligent_importers): "
- (prepare_intelligent_page): "
- (show_import_wizard): add null domain to glade_xml_new.
- (choose_importer_from_list): gtkdialogise.
- (dialog_response_cb): changed from dialog_clicked_cb.
- (start_import): gtkdialogise.
- (show_error): use gtk message box.
- (error_response_cb): callback to close error box.
- (show_import_wizard): gnome_druid_page_start/finish ->
- gnome_druid_page_edge.
- (prepare_file_page):
- (filename_changed): set HELP button insensitive.
- (create_plugin_menu): casts for warnings and fix a typo,
- set_data->set_data_full.
- (import_druid_finish): folder_selection_dialog api change(?),
- allow create.
- (dialog_weak_notify): renamed from close_dialog().
- (show_import_wizard): remove gnome_dialog_close_hides -> its a
- gtkwindow anyway(!).
-
- * Makefile.am (evolution_LDADD): Added back importer.
- (evolution_SOURCES): Added back importer.
-
- * importer/intelligent.c (get_intelligent_importers):
- bonobo-activationised.
- (create_gui): gtkdialogise.
- (intelligent_importer_init): gtkdialogise.
- (create_gui): remove gnome_util_user_home().
- (intelligent_importer_init): "
-
- * importer/evolution-importer.c (finalise): from destroy.
- (evolution_importer_new): type_new->object_new.
-
- * importer/evolution-importer-listener.c (finalise): from destroy.
- (evolution_importer_listener_new): type_new->object_new.
-
- * importer/evolution-importer-client.c (destroy): removed, as it
- wasn't used anyway.
- (evolution_importer_client_new): g_object_new.
- (finalise): added, tho doesn't do anythign yet, should it unref
- the client->objref? This whole class doesn't seem much use.
-
- * importer/evolution-importer-client.h: removed
- bonobo-object-client, change to g_object.
-
- * importer/*.[ch]: ran fix script over everything.
-
- * importer/evolution-intelligent-importer.c: gobjectise.
- (finalise): renamed from destroy.
- (evolution_intelligent_importer_new): gtk_type_new -> g_object_new
-
-2002-11-18 Chris Toshok <toshok@ximian.com>
-
- * importer/import.glade: run libglade-convert.
-
-2002-11-16 Chris Toshok <toshok@ximian.com>
-
- * e-folder-list.c (e_folder_list_init): force the scrolled table
- to be shown, apparently a bug in libglade2.
-
- * e-shell-config-default-folders.c (setup_folder_selector): same,
- but with the evolution-folder-selector-button's.
-
-2002-11-16 Chris Toshok <toshok@ximian.com>
-
- * e-shell-settings-dialog.c (load_pages): init the corba exception
- before loading each config page, so previous errors don't make
- subsequence pages to fail to load.
-
-2002-11-15 Ettore Perazzoli <ettore@ximian.com>
-
- * Makefile.am: Added rule to generate
- GNOME_Evolution_Shell.server.in from
- GNOME_Evolution_Shell.server.in.in, substituting @BINDIR@.
-
- * GNOME_Evolution_Shell.server.in.in: Renamed from
- GNOME_Evolution_Shell.server.in. Prepend @BINDIR@ to the location
- of the executable.
-
-2002-11-15 Ettore Perazzoli <ettore@ximian.com>
-
- * evolution-storage.c (impl_finalize): Fix typo; p -> sp.
-
-2002-11-15 Ettore Perazzoli <ettore@ximian.com>
-
- * e-activity-handler.c (impl_operationStarted): No need to check
- for priv being NULL here anymore.
- (impl_operationProgressing): Likewise.
- (impl_operationFinished): Likewise.
- (impl_requestDialog): Likewise.
-
- * evolution-folder-selector-button.c (clicked): Use
- g_object_add_weak_pointer() on the parent_window instead of using
- GTK_OBJECT_DESTROYED().
-
-2002-11-15 Ettore Perazzoli <ettore@ximian.com>
-
- * e-shell-startup-wizard.c (e_shell_startup_wizard_create): For
- now, always return TRUE.
-
-2002-11-14 Ettore Perazzoli <ettore@ximian.com>
-
- * evolution-shell-client.c (class_init): Pass the right parent
- type to gtk_type_class().
-
-2002-11-14 Ettore Perazzoli <ettore@ximian.com>
-
- * e-shell-user-creatable-items-handler.c,
- * e-shell-user-creatable-items-handler.c: Changed into a GObject
- subclass instead of a GtkObject subclass.
-
- * e-component-registry.c,
- * e-component-registri.h: Changed into a GObject subclass instead
- of a GtkObject subclass.
-
- * evolution-shell-view.c (impl_ShellView_set_message): Remove
- bogus GTK_OBJECT() cast in call to g_signal_emit().
- (impl_ShellView_unset_message): Likewise.
- (impl_ShellView_change_current_view): Likewise.
- (impl_ShellView_set_title): Likewise.
-
- * e-shell-view.c (init): Ref/sink the GtkTooltips.
-
- * e-uri-schema-registry.c (schema_handler_free): g_object_unref()
- on the component instead of bonobo_object_unref().
-
-2002-11-14 Ettore Perazzoli <ettore@ximian.com>
-
- * main.c (no_views_left_cb): Use bonobo_main_quit() instead of
- gtk_main_quit().
- (shell_weak_notify): Likewise.
- (idle_cb): Likewise.
-
- * e-shell.c (notify_no_views_left_idle_cb): New idle function to
- emit the "no_views_left" signal.
- (view_weak_notify): Put it on the idle loop instead of firing the
- signal here.
-
- * e-task-widget.c (e_task_widget_construct): Ref/sink the
- GtkTooltips object.
-
-2002-11-14 Ettore Perazzoli <ettore@ximian.com>
-
- * e-shell.c (save_settings_for_views): Removed.
- (e_shell_save_settings): Do not call it here.
-
-2002-11-14 Ettore Perazzoli <ettore@ximian.com>
-
- * e-storage-set-view.c (impl_dispose): NULL priv->ui_component
- after unreffing it.
-
-2002-11-14 Ettore Perazzoli <ettore@ximian.com>
-
- * evolution-shell-component-client.c (destroy_listener_interface):
- Avoid freeing the servant for now, it looks like something is
- messed up and this causes a crash on exit.
-
- * evolution-storage-set-view-listener.c (impl_finalize): Do not
- invoke POA_GNOME_Evolution_StorageSetViewListener__fini().
-
- * evolution-storage-listener.c (impl_finalize): Do not invoke
- POA_GNOME_Evolution_StorageListener__fini().
-
- * e-shell-offline-sync.c (progress_listener_servant_free): Do not
- invoke POA_GNOME_Evolution_SyncFolderProgressListener__fini().
-
- * e-shell-offline-handler.c (progress_listener_servant_free): Do
- not invoke POA_GNOME_Evolution_OfflineProgressListener__fini().
-
- * e-corba-storage.c (impl_dispose): Do not invoke
- POA_GNOME_Evolution_StorageListener__fini().
-
- * evolution-shell-component-client.c (destroy_listener_interface):
- Do not invoke POA_GNOME_Evolution_ShellComponentListener__fini().
-
-2002-11-14 Ettore Perazzoli <ettore@ximian.com>
-
- * main.c (quit_box_destroyed_callback): Removed.
- (no_views_left_cb): Use g_object_add_weak_pointer() instad of
- connecting to the "destroy" signal.
- (destroy_cb): Removed.
- (shell_weak_notify): New.
- (idle_cb): Use g_object_weak_ref() on the shell object instead of
- connecting to the "destroy" signal.
-
- * evolution-test-component.c (dialog_destroy_callback): Removed.
- (dialog_weak_notify): New.
- (create_new_folder_selector): Use g_object_weak_ref() on the
- dialog instead of connecting the "destroy" signal.
-
- * e-shortcuts.c (view_destroyed_cb): Removed.
- (view_weak_notify): New.
- (e_shortcuts_new_view): g_object_weak_ref() the new view instead
- of connecting the "destroy" signal.
- (impl_dispose): Free the ->views and g_object_weak_unref() all the
- items.
-
- * e-shell.c (view_destroy_cb): Removed.
- (view_weak_notify): New.
- (create_view): Use g_object_weak_ref() on the newly created view
- instead of connecting to the "destroy" signal.
- (impl_dispose): g_object_weak_unref() the views.
- (e_shell_show_settings): Use g_object_add_weak_pointer() on the
- settings_dialog instead of connecting to the "destroy" signal.
- (settings_dialog_destroy_cb): Removed.
-
- * e-shell-shared-folder-picker-dialog.c
- (progress_bar_weak_notify): New.
- (progress_bar_destroy_callback): Removed.
- (create_progress_dialog): Use g_object_weak_ref() on the progress
- bar object instead of connecting to its "destroy" signal.
- (shell_destroy_callback): Removed.
- (shell_view_destroy_callback): Removed.
- (storage_destroy_callback): Removed.
- (shell_weak_notify): New.
- (shell_view_weak_notify): New.
- (storage_weak_notify): New.
- (discover_folder): Use g_object_weak_ref() on the shell, parent,
- storage objects instead of connecting to their "destroy" signals.
-
- * e-shell-importer.c: Removed member destroyed from
- ImporterComponentData.
- (import_cb): Instead of checking if ->destroyed is TRUE, check if
- ->dialog is NULL to decide whether the dialog has been destroyed
- or not.
- (dialog_destroy_cb): Removed.
- (start_import): Use g_object_weak_ref() on the dialog object
- instead of connecting to its "destroy" signal.
- (dialog_close): Removed.
- (dialog_weak_notify): New.
- (show_import_wizard): Use g_object_weak_ref() on the dialog object
- instead of connecting to its "destroy" signal.
- (import_druid_destroy): New.
- (import_druid_weak_notify): New.
- (show_import_wizard): Use g_object_weak_ref() on the druid object
- instead of connecting to its "destroy" signal.
-
- * e-shell-folder-selection-dialog.c
- (e_shell_folder_selection_dialog_construct): g_object_weak_ref()
- the shell object instead of connecting to its "destroy" signal.
-
- * e-shell-folder-creation-dialog.c (dialog_destroy_cb): Removed.
- (dialog_destroy_notify): New.
- (e_shell_show_folder_creation_dialog): g_object_weak_ref() the
- dialog instead of connecting to its "destroy" signal.
- (shell_destroy_cb): Removed.
- (shell_destroy_notify): New.
- (e_shell_show_folder_creation_dialog): g_object_weak_ref() the
- shell object instead of connecting to its "destroy" signal.
-
- * e-shell-config-offline.c (config_control_destroy_callback):
- Removed.
- (config_control_destroy_notify): New.
- (e_shell_config_offline_create_widget): g_object_weak_ref() the
- config_control instead of connecting to its "destroy" signal.
-
- * e-shell-config-default-folders.c
- (config_control_destroy_callback): Removed.
- (config_control_destroy_notify): New.
- (e_shell_config_default_folders_create_widget):
- g_object_weak_ref() instead of connecting to the "destroy" signal.
-
- * e-shell-config-autocompletion.c (config_control_destroy_notify):
- New.
- (config_control_destroy_callback): Removed.
- (e_shell_config_autocompletion_create_widget):
- g_object_weak_ref() instead of connecting to the "destroy" signal.
-
- * e-activity-handler.c (task_bar_destroy_cb): Removed.
- (task_bar_destroy_notify): New.
- (e_activity_handler_attach_task_bar): Weak_ref the task_bar using
- task_bar_destroy_notify.
- (impl_dispose): Weak_unref the task bars in priv->task_bars.
-
-2002-11-13 Ettore Perazzoli <ettore@ximian.com>
-
- * e-shell-startup-wizard.c: Change type of member etd in
- TimezoneDialogPage to GObject from GtkObject.
- (make_timezone_page): Cast to G_OBJECT() not GTK_OBJECT().
-
-2002-11-13 Ettore Perazzoli <ettore@ximian.com>
-
- * e-shell-startup-wizard.c (e_shell_startup_wizard_create):
- Connect finish_func to the "next" signal for now, since GnomeDruid
- seems to be borked.
-
- * e-uri-schema-registry.c (schema_handler_new): g_object_ref()
- @component instead of bonobo_object_ref().
-
- * e-local-storage.c (create_folder): g_object_ref() for the
- component_client, instead of bonobo_object_ref().
- (remove_folder_step): Likewise.
-
-2002-11-13 Not Zed <NotZed@Ximian.com>
-
- * evolution-storage.c: remove GTK_OBJECT cast and other GTK stuff.
-
- * evolution-storage.h: this is a gobject not a gtkobject, fix cast
- macros, and get_type call.
-
-2002-11-11 Chris Toshok <toshok@ximian.com>
+2002-11-12 Frederic Crozat <fcrozat@mandrakesoft.com>
- * e-task-widget.c (impl_finalize): need to assign priv here, fixes
- a crash.
+ reviewed by: Ettore Perazzoli
-2002-11-11 Ettore Perazzoli <ettore@ximian.com>
+ * e-shell-settings-dialog.c: (page_new): Ensure we get
+ an UTF-8 translated string.
- * e-shell.c (impl_dispose): Do unref the config_listener here [I
- fixed the finalize crash we were getting].
+2002-11-06 Ettore Perazzoli <ettore@ximian.com>
-2002-11-11 Ettore Perazzoli <ettore@ximian.com>
-
- * e-storage-set-view.c (impl_finalize): Protect against
- priv->checkboxes being NULL.
-
-2002-11-11 Ettore Perazzoli <ettore@ximian.com>
-
- * e-component-registry.c: Make separate dispose/finalize overrides
- of just overriding destroy.
- * e-corba-config-page.c: Likewise.
- * e-corba-storage.c: Likewise.
- * e-folder-type-registry.c: Likewise.
- * e-folder.c: Likewise.
- * e-history.c: Likewise.
- * e-local-folder.c: Likewise.
- * e-local-storage.c: Likewise.
- * e-shell-folder-selection-dialog.c: Likewise.
- * e-shell-folder-title-bar.c: Likewise.
- * e-shell-offline-handler.c: Likewise.
- * e-shell-settings-dialog.c: Likewise.
- * e-shell-user-creatable-items-handler.c: Likewise.
- * e-shell-view.c: Likewise.
- * e-shortcuts-view-model.c: Likewise.
- * e-shortcuts-view.c: Likewise.
- * e-shortcuts.c: Likewise.
- * e-storage-set-view.c: Likewise.
- * e-storage-set.c: Likewise.
- * e-storage.c: Likewise.
- * e-task-bar.c: Likewise.
- * e-task-widget.c: Likewise.
- * e-uri-schema-registry.c: Likewise.
- * evolution-activity-client.c: Likewise.
- * evolution-folder-selector-button.c: Likewise.
- * evolution-storage-listener.c: Likewise.
- * evolution-storage-set-view-listener.c: Likewise.
- * evolution-test-component.c: Likewise.
-
-2002-11-08 Rodrigo Moya <rodrigo@ximian.com>
-
- * importer/Makefile.am: use correctly IDL flags.
-
-2002-11-07 Chris Toshok <toshok@ximian.com>
-
- * e-task-widget.c (impl_destroy): guard against multiple calls.
- fixes a crash whenever a task finishes (the addressbook finishing
- loading, etc.).
-
- * e-shell-marshal.list: add NONE:BOOL for
- evolution-shell-component.
-
- * evolution-shell-component.c (class_init): register the signals
- with g_signal_new.
-
-2002-11-05 Ettore Perazzoli <ettore@ximian.com>
-
- * e-shell.c (e_shell_show_settings): Allow type being NULL.
-
-2002-11-05 Ettore Perazzoli <ettore@ximian.com>
-
- * e-local-storage.c (load_folder): Do add folders with an unknown
- type.
-
-2002-11-05 Ettore Perazzoli <ettore@ximian.com>
-
- * glade/e-shell-folder-creation-dialog.glade (ok_button): Set
- response_id to GTK_RESPONSE_OK.
- (cancel_button): Likewise, with GTK_RESPONSE_CANCEL.
-
- * e-shell-folder-creation-dialog.h,
- e-shell-folder-creation-dialog.c: Ported to GtkDialog.
-
-2002-11-05 Ettore Perazzoli <ettore@ximian.com>
-
- * e-folder-list.c: Use g_object_get_data() instead of
- gtk_object_get_data().
- * e-shell-config-default-folders.c: Likewise.
- * e-shell-folder-creation-dialog.c: Likewise.
- * e-shell-importer.c: Likewise.
- * e-shell-shared-folder-picker-dialog.c: Likewise.
- * e-shell-user-creatable-items-handler.c: Likewise.
- * e-shell-view.c: Likewise.
- * e-shell.c: Likewise.
- * e-storage.c: Likewise.
-
-2002-11-05 Ettore Perazzoli <ettore@ximian.com>
-
- * e-activity-handler.c: Split finalize/dispose.
- * e-corba-shortcuts.c: Likewise.
- * e-corba-storage-registry.c: Likewise.
- * e-shell-about-box.c: Likewise.
- * e-shell.c: Likewise.
- * e-splash.c: Likewise.
- * evolution-config-control.c: Likewise.
- * evolution-session.c: Likewise.
- * evolution-shell-component.c: Likewise.
- * evolution-shell-view.c: Likewise.
- * evolution-storage-set-view.c: Likewise.
- * evolution-storage.c: Likewise.
- * evolution-wizard.c: Likewise.
-
-2002-11-05 Ettore Perazzoli <ettore@ximian.com>
-
- * All: g_object_unref instead of bonobo_object_unref for the
- EvolutionShellComponentClient and EvolutionShellClient interfaces.
-
-2002-11-05 Ettore Perazzoli <ettore@ximian.com>
-
- * evolution-shell-client.c (impl_dispose): New.
- (impl_finalize): New.
- (destroy): Removed.
- (class_init): Install dispose, finalize handlers.
-
- * All: Use evolution_shell_client_corba_objref() or
- evolution_shell_component_client_corba_objref() instead of
- BONOBO_OBJREF() or bonobo_object_corba_objref() where needed.
-
- * e-folder-type-registry.c (set_handler): Use g_object_ref() for
- the handler, not bonobo_object_ref().
- (folder_type_free): Likewise for unref.
-
- * evolution-shell-component-client.c
- (evolution_shell_component_client_corba_objref): New.
- (impl_dispose): Moved from impl_destroy; only unref things.
- (impl_finalize) New.
- (class_init): Install dispose/finalize.
- (evolution_shell_component_client_get_dnd_source_interface): Use
- priv->corba_objref instead of bonobo_object_corba_objref() since
- we are not a BonoboObject anymore.
- (evolution_shell_component_client_get_dnd_destination_interface):
- Likewise.
- (evolution_shell_component_client_get_offline_interface): Likewise.
- (evolution_shell_component_client_set_owner): Likewise.
- (evolution_shell_component_client_unset_owner): Likewise.
- (evolution_shell_component_client_create_view): Likewise.
- (evolution_shell_component_client_handle_external_uri): Likewise.
- (evolution_shell_component_client_async_create_folder): Likewise.
- (evolution_shell_component_client_async_xfer_folder): Likewise.
- (evolution_shell_component_client_populate_folder_context_menu): Likewise.
- (evolution_shell_component_client_unpopulate_folder_context_menu): Likewise.
-
- * e-component-registry.c (register_component): Use
- evolution_shell_component_client_corba_objref().
- (e_component_registry_restart_component): Likewise.
- (component_free): Likewise.
-
- * evolution-shell-component-client.c: g_object_new() instead of gtk_type_new().
- * e-component-registry.c: Likewise.
- * e-corba-config-page.c
- * e-folder-list.c: Likewise.
- * e-folder-type-registry.c: Likewise.
- * e-folder.c: Likewise.
- * e-gray-bar.c: Likewise.
- * e-history.c: Likewise.
- * e-local-folder.c: Likewise.
- * e-local-folder.c: Likewise.
- * e-local-storage.c: Likewise.
- * e-shell-about-box.c: Likewise.
- * e-shell-config-default-folders.c: Likewise.
- * e-shell-folder-selection-dialog.c: Likewise.
- * e-shell-folder-title-bar.c: Likewise.
- * e-shell-offline-handler.c: Likewise.
- * e-shell-settings-dialog.c: Likewise.
- * e-shell-user-creatable-items-handler.c: Likewise.
- * e-shell-view.c: Likewise.
- * e-shortcuts-view-model.c: Likewise.
- * e-shortcuts-view.c: Likewise.
- * e-shortcuts.c: Likewise.
- * e-splash.c: Likewise.
- * e-storage-set-view.c: Likewise.
- * e-storage-set.c: Likewise.
- * e-storage.c: Likewise.
- * e-task-bar.c: Likewise.
- * e-task-widget.c: Likewise.
- * e-uri-schema-registry.c: Likewise.
- * evolution-activity-client.c: Likewise.
- * evolution-folder-selector-button.c: Likewise.
- * evolution-shell-client.c: Likewise.
- * evolution-shell-view.c: Likewise.
- * evolution-storage-listener.c: Likewise.
- * evolution-storage-set-view-listener.c: Likewise.
- * evolution-storage-set-view.c: Likewise.
- * evolution-wizard.c: Likewise.
-
- * GNOME_Evolution_TestComponent.server: Renamed from
- GNOME_Evolution_TestComponent.oaf.
-
- * evolution-test-component.c (spit_out_shortcuts): Use
- BONOBO_EX_REPOID().
- (create_new_folder_selector): Ported to use GtkDialog instead of
- GnomeDialog.
- (storage_cancel_discover_shared_folder_callback): Add missing
- G_OBJECT() cast.
- (shared_folder_discovery_timeout_callback): Likewise.
- (storage_discover_shared_folder_callback): Likewise.
- (timeout_callback_2): Likewise.
- (timeout_callback_1): Likewise.
- (shared_folder_discovery_timeout_callback): Use
- g_object_get_data() instead of gtk_object_get_data().
- (storage_cancel_discover_shared_folder_callback): Likewise.
- (timeout_callback_2): Likewise.
- (timeout_callback_2): g_timeout_add() instead of
- gtk_timeout_add().
- (create_view_fn): Likewise.
- (timeout_callback_1): Likewise.
- (timeout_callback_1): Pass NULL as the error arg to
- gdk_pixbuf_new_from_file().
- (register_component): Use bonobo-activation instead of OAF.
-
- * e-shell-about-box.c (impl_destroy): Removed.
- (impl_finalize): New.
- (class_init): Install finalize handler, not destroy.
-
- * e-shell-view-menu.c (command_about_box): Use a GtkWindow again.
- Set the GTK_WINDOW_TYPE_HINT_DIALOG hint.
-
- * e-shell-about-box.c (e_shell_about_box_construct): Removed.
-
-2002-11-04 Ettore Perazzoli <ettore@ximian.com>
-
- * e-shell-folder-commands.c (e_shell_command_copy_folder): Pass
- TRUE for arg allow_creation to
- e_shell_folder_selection_dialog_new().
- (e_shell_command_move_folder): Likewise.
- * e-shell-view-menu.c (command_goto_folder): Likewise.
- (command_new_shortcut): Likewise.
- * e-shell.c (impl_Shell_selectUserFolder): Likewise.
-
- * e-shell-folder-selection-dialog.c
- (e_shell_folder_selection_dialog_set_allow_creation): Removed.
- (e_shell_folder_selection_dialog_get_allow_creation): Removed.
- (e_shell_folder_selection_dialog_new): New arg allow_creation.
- (e_shell_folder_selection_dialog_construct): Likewise. Also, do
- set priv->shell.
-
- * e-shell-folder-selection-dialog.h,
- e-shell-folder-selection-dialog.c: Port to GtkDialog.
-
-2002-11-04 Ettore Perazzoli <ettore@ximian.com>
-
- * e-folder-type-registry.c
- (e_folder_type_registry_get_handler_for_type): Remove warning for
- when the type is unknown.
- (e_folder_type_registry_type_is_user_creatable): Likewise.
- (e_folder_type_registry_get_display_name_for_type): Likewise.
- (e_folder_type_registry_get_description_for_type): Likewise.
- (e_folder_type_registry_get_exported_dnd_types_for_type):
- Likewise.
- (e_folder_type_registry_get_accepted_dnd_types_for_type):
- Likewise.
- (e_folder_type_registry_unregister_type): Likewise.
- (e_folder_type_registry_get_icon_name_for_type): Likewise.
- (e_folder_type_registry_get_icon_for_type): Likewise.
- (set_handler): Removed warning here too.
-
-2002-11-04 Ettore Perazzoli <ettore@ximian.com>
-
- * e-folder-list.c: Replace gtk_signal_emit() with g_signal_emit().
- * e-folder.c: Likewise.
- * e-shell-folder-selection-dialog.c: Likewise.
- * e-shell-folder-title-bar.c: Likewise.
- * e-shell-offline-handler.c: Likewise.
- * e-shell-view.c: Likewise.
- * e-shortcuts-view.c: Likewise.
- * e-shortcuts.c: Likewise.
- * e-storage-set-view.c: Likewise.
- * e-storage-set.c: Likewise.
- * e-storage.c: Likewise.
- * evolution-activity-client.c: Likewise.
- * evolution-folder-selector-button.c: Likewise.
- * evolution-storage-listener.c: Likewise.
- * evolution-storage-set-view-listener.c: Likewise.
-
-2002-11-04 Ettore Perazzoli <ettore@ximian.com>
-
- * e-folder-list.c: Use g_object_set_data() instead of
- gtk_object_set_data().
- * e-shell-config-default-folders.c: Likewise.
- * e-shell-folder-creation-dialog.c: Likewise.
- * e-shell-importer.c: Likewise.
- * e-shell-shared-folder-picker-dialog.c: Likewise.
- * e-shell-user-creatable-items-handler.c: Likewise.
- * e-shell-view.c: Likewise.
- * e-shell.c: Likewise.
- * e-storage-set-view.c: Likewise.
- * e-storage.c: Likewise.
- * evolution-test-component.c: Likewise.
-
- * e-storage-set-view.c (e_storage_set_view_construct): Use
- g_object_weakref() instead of gtk_object_weakref() for the
- ui_container.
- (ui_container_destroy_notify): Add param where_the_object_was to
- match the GWeakNotify prototype.
-
- * e-shell.c: Use g_signal_emit() instead of gtk_signal_emit().
-
-2002-11-03 Ettore Perazzoli <ettore@ximian.com>
-
- * glade/e-active-connection-dialog.glade: Converted to Glade2
- format.
- * glade/evolution-startup-wizard.glade: Likewise.
- * glade/e-shell-shared-folder-picker-dialog.glade: Likewise.
- * glade/e-shell-folder-creation-dialog.glade: Likewise.
- * glade/e-shell-config-default-folders.glade: Likewise.
- * glade/e-folder-list.glade: Likewise.
-
-2002-11-03 Ettore Perazzoli <ettore@ximian.com>
-
- * *.c, *.h: Changed all gtk_object_refs()/gtk_object_unrefs() into
- g_object_refs()/g_object_unrefs() and all gtk_signal_connect_*()
- into g_signal_connect_*(). [Except for some case where we have
- gtk_signal_connect_full() or gtk_signal_connect_while_alive()
- calls that cannot be trivially ported to use the g_signal_*
- functions, we'll have to fix those later.]
-
- * e-splash.c (impl_finalize): Finalize implementation, copied over
- from impl_destroy.
- (impl_destroy): Removed.
- (class_init): Override finalize, not destroy.
-
- * e-activity-handler.c: Ported from GtkObject to GObject.
- * evolution-storage.c: Likewise.
- * e-corba-shortcuts.c: Likewise.
- * evolution-session.h: Likewise.
- * evolution-config-control.c: Likewise.
- * evolution-shell-component-dnd.c: Likewise.
- * evolution-shell-component.c: Likewise.
- * evolution-shell-view.c: Likewise.
- * evolution-storage-set-view.c: Likewise.
- * evolution-wizard.c: Likewise.
-
-2002-11-03 Ettore Perazzoli <ettore@ximian.com>
-
- * e-component-info.c: Updated for libxml2.
- * e-shortcuts.c: Likewise.
- * e-folder-list.c: Likewise.
- * e-local-folder.c: Likewise.
-
-2002-11-03 Ettore Perazzoli <ettore@ximian.com>
-
- * GNOME_Evolution_Shell.server.in: Renamed from
- GNOME_Evolution_Shell.oaf.in.
-
- * Makefile.am: Port from OAF to bonobo-activation.
- (INCLUDES): Define SYSCONFDIR, DATADIR, LIBDIR.
-
- * main.c (main): Use gnome_program_init().
-
- * e-corba-storage-registry.c (e_corba_storage_registry_new):
- g_object_new(), not gtk_type_new().
- (impl_finalize): New, ported over from destroy.
- (destroy): Removed.
- (class_init): Install finalize handler, not destroy handler, since
- we are not a GtkObject anymore.
-
- * e-corba-storage.c (e_corba_storage_new): g_object_new(), not
- gtk_type_new().
-
- * e-shell.c (class_init): Override finalize, not destroy.
- (impl_finalize): Finalize implementation, basically the old
- destroy renamed.
- (e_shell_new): g_object_new(), not gtk_type_new().
- (class_init): Use e_shell_marshal_NONE__INT for
- line_status_changed instead of using an ENUM.
- (e_shell_construct): Use g_signal_connect_object() instead of
- gtk_signal_connect_while_alive().
-
- * e-setup.c (e_setup): Do not unref local_folder if NULL.
-
- * e-folder.c (init): Make not floating.
- (e_folder_construct): No need to make it floating here anymore.
-
- * e-shell.c (impl_Shell_selectUserFolder): For now don't set
- dialog parent from xid.
-
- * main.c (no_views_left_cb): Add missing GTK_SIGNAL_FUNC() cast.
- (new_view_created_callback): Likewise.
- (warning_dialog_clicked_callback): Update to use the
- EConfigListener from the shell instead of bonobo-conf.
- (show_development_warning): Likewise.
- (upgrade_from_1_0_if_needed): BONOBO_EX_ID -> BONOBO_EX_REPOID.
- (idle_cb): Use bonobo-activation and BONOBO_EX_REPOID().
- (main): Cleaned up the various things that are unneeded in GNOME
- 2.
- (upgrade_from_1_0_if_needed): Use EConfigListener.
-
- * evolution-storage-set-view.h, evolution-storage-set-view.c:
- BonoboXObjectified.
-
- * e-storage.c (class_init): GLIB2-ified and made to use
- e-shell-marshal.h.
- (ES_CLASS): Use GTK_OBJECT_GET_CLASS().
- (e_storage_new_folder): Added missing GTK_SIGNAL_FUNC() prototype.
-
- * e-storage-set.c (class_init): GLIB2-ified and made to use
- e-shell-marshal.h.
-
- * e-storage-set-view.c (popup_folder_menu): For now, do not add
- the pop-up since we lack bonobo_ui_container_get_win() and I am
- not sure how to work around it.
- (popup_folder_menu): Pass self as the for_widget arg to
- gnome_popup_menu_do_popup_modal().
- (class_init): GLIB2-ified, and got to use e-shell-marshal.h.
- (marshal_NONE__GDKDRAGCONTEXT_STRING_STRING_STRING): Removed.
- (impl_tree_drag_data_get): Don't set the selection for now -- we
- have to fix the CORBA target stuff to match GTK 2.
- (e_storage_set_view_construct): Pass NULL as the opt_ev arg to
- bonobo_ui_component_set_container().
-
- * e-splash.c: #include <libgnomecanvas/gnome-canvas-pixbuf.h>
- instead of <gdk-pixbuf/gnome-canvas-pixbuf.h>.
- (e_splash_new): Pass NULL as the error arg to
- gdk_pixbuf_new_from_file().
-
- * e-shortcuts.c (class_init): GLIB2-ified. Also use the
- e-shell-marshal marshallers.
- (e_shortcuts_new_view): Add missing GTK_SIGNAL_FUNC() cast.
-
- * e-shortcuts-view.c: Use GTK_STOCK_* stuff instead of
- GNOME_STOCK_* stuff.
- (pop_up_right_click_menu_for_group): Pass self as the for_widget
- arg to gnome_popup_menu_do_popup_modal().
- (pop_up_right_click_menu_for_shortcut): Likewise.
- (class_init): GLIB2-ified.
-
- * e-shell.c: Do not #include <gal/util/e-unicode-i18n.h> or
- #include <libgnome/gnome-defs.h>.
- (set_interactive): Use BONOBO_EX_REPOID().
- (setup_local_storage): Use _() not U_().
- (destroy): Use gtk_widget_destroy() instead of
- gtk_object_destroy() on priv->settings_dialog.
- (class_init): GLIB2-ized.
- (init): Initialize config_listener member.
- (get_icon_path_for_component_info): Port to bonobo-activation from
- OAF.
- (setup_components): Likewise.
- (destroy): Likewise.
- (e_shell_construct): Use e_setup_check_config(), not
- e_setup_check_db (). Use the e_config_listener instead of
- bonobo-conf.
- (save_settings_for_views): Likewise.
- (save_misc_settings): Likewise.
- (e_shell_restore_from_settings): Likewise.
- (parse_default_uri): Likewise.
- (e_shell_component_maybe_crashed): Pass NULL for opt_ev arg to
- bonobo_unkown_ping()
- (e_shell_component_maybe_crashed): Use
- bonobo_engine_deregister_dead_components() instead of
- bonobo_window_deregister_component_by_ref() which is no more.
- (e_shell_send_receive): BONOBO_EX_REPOID() instead of
- BONOBO_EX_ID().
- (e_shell_get_config_listener): Return the config_listener.
-
- * e-shell-view.c (find_inbox_in_storage): Use _() instead of U_().
- (load_images): Pass NULL as the error arg to
- gdk_pixbuf_new_from_file().
- (load_images): Likewise.
- (find_inbox_in_storage): Work around the lack of
- g_utf8_strcasecmp() in glib-2.0.
- (class_init): GLIB2-ified. Also, use the marshallers in
- e-shell-marshal.h.
- (pop_up_folder_bar): Use gtk_window_move()/gtk_widget_show()
- instead gtk_widget_popup().
- (unmerge_on_error): Work around the death of
- bonobo_ui_component_get_win() and
- bonobo_window_deregister_component_by_ref().
- (e_shell_view_construct): Pass NULL as the uic arg to
- bonobo_window_construct(). Add missing GTK_SIGNAL_FUNC() cast.
- Match the new BonoboWindow behavior wrt the UIContainer and the
- new opt_ev args.
- (display_uri): Use bonobo_ui_engine_freeze() and
- bonobo_ui_engine_thaw() since bonobo_window_freeze() and
- bonobo_window_thaw() got axed [sigh].
- (e_shell_view_save_settings): Use EConfigListener.
- (e_shell_view_load_settings): Likewise.
- (get_view_for_uri): Use bonobo_widget_new_control_from_objref()
- instead of e_bonobo_widget_new_control_from_objref().
-
- * e-shell-view-menu.c (command_help_faq): Pass NULL for the error
- arg to gnome_url_show().
- (command_about_box): Use GtkDialog instead of a GtkWindow of a
- type GTK_WINDOW_DIALOG [which does not exist anymore].
- (command_xml_dump): Removed.
- (menu_do_misc): Do not add the corresponding verb.
-
- * e-shell-user-creatable-items-handler.c (execute_verb): Use
- BONOBO_EX_REPOID().
-
- * e-shell-startup-wizard.c: Remove id member from SWData. Replace
- member db with config_listener.
- (e_shell_startup_wizard_create): Initialize config_listener.
- (make_mail_dialog_pages): Do not set the listener id here.
- (druid_event_notify_cb): Pass FALSE as the help_sensitive arg to
- gnome_druid_set_buttons_sensitive().
- (e_shell_startup_wizard_create): Likewise.
- (make_mail_dialog_pages): Use bonobo-activation instead of OAF.
- (get_intelligent_importers): Likewise.
- (prepare_importer_page): Likewise.
- (start_importers): Do nothing here for now.
- (finish_func): Constify local variable displayname.
- (finish_func): Updated to use the config_listener instead of the
- bono-conf db.
- (prepare_importer_page): Do not actually run the importer yet.
- (e_shell_startup_wizard_create): Pass NULL as the domain arg to
- glade_xml_new(). Use the config_listener.
-
- * e-shell-shared-folder-picker-dialog.c (user_clicked):
- BONOBO_EX_REPOID() instead of BONOBO_EX_ID().
- (setup_name_selector): Likewise.
- (setup_name_selector): Use bonobo-activation.
- (show_dialog): Pass NULL as the domain arg to glade_xml_new().
- (setup_name_selector): Add a missing GTK_SIGNAL_FUNC() cast.
-
- * e-shell-settings-dialog.c: #include
- <bonobo-activation/bonobo-activation.h>. Use
- Bonobo_ActivationProperty instead of OAF_Property.
- (set_dialog_size): Use gtk_style_get_font() to get the font from
- the widget->style.
- (load_pages): Converted to use bonobo-activation instead of OAF.
- Pass NULL as the error arg to gdk_pixbuf_new_from_file().
-
- * e-shell-offline-sync.c (sync_folder): BONOBO_EX_REPOID(), not
- BONOBO_EX_ID().
- (e_shell_offline_sync_all_folders): For now, avoid doing anything
- [see changes to e-shell-config-offline.c below].
- (setup_progress_listener): #if 0 for now.
- (setup_dialog): Likewise.
- (sync_folder): Likewise.
- (cleanup): Likewise.
- (progress_listener_servant_free): Likewise.
- (progress_listener_servant_new): Likewise.
- (impl_SyncFolderProgressListener_updateProgress): Likewise.
- (impl_SyncFolderProgressListener_reportSuccess): Likewise.
- (impl_SyncFolderProgressListener_reportFailure): Likewise.
- (progress_dialog_close_callback): Likewise.
- (progress_dialog_clicked_callback): Likewise.
-
- * e-shell-offline-handler.c (prepare_for_offline): Use
- BONOBO_EX_REPOID().
- (pop_up_confirmation_dialog): Pass NULL as the domain arg to
- glade_xml_new().
- (class_init): GLIB2-ified.
-
- * Makefile.am: Do not compile e-shell-importer.c,
- e-shell-importer.h for now.
-
- * e-shell-folder-title-bar.c (get_max_clipped_label_width): Use
- gtk_style_get_font() to retrieve the font.
- (class_init): GLIB2-ified.
- (e_shell_folder_title_bar_construct): Get {x,y}thickness from
- widget->style, not from widget->style->klass.
-
- * e-shell-folder-selection-dialog.c: #include <string.h>,
- <gtk/gtklabel.h> and <gtk/gtksignal.h>.
- (class_init): GLIB2-ified.
-
- * e-shell-folder-creation-dialog.c: No <libgnome/gnome-defs.h>,
- add some GTK includes.
- (e_shell_show_folder_creation_dialog): Pass NULL as the domain arg
- to glade_xml_new(). Added missing GTK_SIGNAL_FUNC() cast.
-
- * e-shell-folder-commands.c: Do not #include
- <libgnomeui/gnome-stock.h> and #include
- <bonobo-conf/Bonobo_Config.h>.
-
- * e-shell-config-default-folders.c: Replace member db in
- EvolutionDefaultFolderConfig with config_listener.
- (e_shell_config_default_folders_create_widget): Init here.
- (config_control_destroy_cb): Unref here.
- (config_control_apply_cb): Use EConfigListener instead of
- BonoboConf.
- (setup_folder_selector): Likewise.
- (e_shell_config_default_folders_create_widget): Pass NULL as the
- domain arg to glade_xml_new().
-
- * e-shell-config-offline.c (config_control_apply_callback): For
- now, do not change the configuration. [Needs to be ported to
- EConfigListener or something, but we were storing a sequence using
- typecodes here and there is no trivial way to do that right now.]
- (init_storage_set_view_status_from_config): Likewise, do not
- retrieve the configuration here.
-
- * e-shell-marshal.list: Removed duplicates, added a bunch new
- marshallers.
-
-2002-11-02 Ettore Perazzoli <ettore@ximian.com>
-
- * e-shell-config-autocompletion.c: No bonobo-conf; removed member
- db in struct EvolutionAutocompletionConfig and replaced with a
- config_listener arg.
- (e_shell_config_autocompletion_create_widget): Init it here.
- (config_control_destroy_callback): Unref it here.
- (config_control_apply_callback): Updated to use the
- config_listener.
-
- * e-shell-config.c (e_shell_config_factory_register): Use
- bonobo_generic_factory_new() instead of
- bonobo_generic_factory_new_multi().
-
- * e-shell-about-box.c (impl_realize): Pass NULL as the error arg
- to gdk_pixbuf_new_from_file().
- (timeout_callback): Use gtk_style_get_font() to retrieve the
- style's font instead of style->font.
- (impl_draw): Removed.
- (impl_expose_event): Do the drawing of the pixmap here.
-
- * e-setup.c (e_setup_check_db): Removed.
- (e_setup_check_config): New, version using EConfigListener instead
- of bonobo-conf.
-
- * e-setup.h: #include "e-util/e-config-listener.h" instead of
- <bonobo-conf/bonobo-config-database.h>.
-
- * e-local-storage.c (construct): Use _() instead of U_().
- (setup_stock_folders): Likewise.
-
- * e-icon-factory.c (load_icon): Pass NULL as the error arg to
- gdk_pixbuf_new_from_file().
-
- * e-folder-type-registry.c (folder_type_new): Pass NULL as the
- error arg to gdk_pixbuf_new_from_file().
-
- * e-folder-dnd-bridge.c (find_matching_target_for_drag_context):
- GdkAtom is not an integer anymore; update accordingly.
-
- * e-corba-storage.c (async_folder_cb): Constified args
- appropriately to match BonoboListenerCallbackFn.
- (async_folder_discovery_cb): Likewise.
- (cancel_discover_shared_folder): BONOBO_EX_ID() ->
- BONOBO_EX_REPOID().
- (e_corba_storage_show_folder_properties): Likewise.
-
- * e-corba-storage-registry.h, e-corba-storage-registry.c:
- BonoboXObjectified.
-
- * e-corba-config-page.c: Removed member listener_id in struct
- ECorbaConfigPagePrivate.
- (init): Don't init.
- (setup_listener): Bonobo_EventSource_addListener doesn't return an
- ID anymore.
- (impl_destroy): Just pass the listener to
- Bonobo_EventSource_removeListener.
- (setup_listener): BONOBO_EX_REPOID() instead of BONOBO_EX_ID().
- (impl_apply): Likewise.
- (listener_event_callback): Constified args appropriately to match
- BonoboListenerCallbackFn.
- (e_corba_config_page_construct): Likewise.
-
- * e-component-registry.c (wait_for_corba_object_to_die): Pass NULL
- for the exception arg to bonobo_unknown_ping().
-
- * e-shell-view.h: <bonobo/bonobo-window.h>, not
- <bonobo/bonobo-win.h>.
-
- * e-shell.c: Replace member db in EShellPrivate with an
- EConfigListener config_listener.
- (destroy): Do not call e_shell_disconnect_db(). Unref
- EConfigListener. Destroy settings_dialog if not NULL. Pass
- config_listener to e_setup_check_db().
- (e_shell_get_config_db): Removed.
- (e_shell_get_config_listener): New.
- (e_shell_construct): Set up the config_listener, instead of the
- Bonobo_ConfigDatabase.
-
- * e-shell.h: #include <bonobo-activation/bonobo-activation.h>
- instead of <liboaf/oaf.h>. No
- <bonobo-conf/bonobo-config-database.h>.
-
- * e-component-registry.c: #include
- <bonobo-activation/bonobo-activation.h> instead of <liboaf/oaf.h>.
-
- * e-activity-handler.c (task_widget_button_press_event_callback):
- Use BONOBO_EX() and BONOBO_EX_REPOID().
- (impl_operationStarted): Don't use GTK_OBJECT_DESTROYED() [needs
- to be fixed later].
- (impl_operationProgressing): Likewise.
- (impl_operationFinished): Likewise.
- (impl_requestDialog): Likewise.
-
- * evolution-wizard.c (evolution_wizard_class_init): GLIB2-ified.
-
- * evolution-wizard.h: Remove BEGIN_GNOME_DECLS/END_GNOME_DECLS.
-
- * evolution-storage.c: Chagned to use generated marshallers
- instead of custom ones or GAL's.
-
- * eshell-marshal.list: New.
- * Makefile.am: Added rule to build eshell-marshal.[ch] and link
- them in.
-
- * evolution-storage.h, evolution-storage.c: BonoboXObjectified.
-
- * evolution-storage-set-view-listener.c (class_init): GLIB2-ified.
-
- * evolution-storage-listener.c (class_init): GLIB2-ified.
-
- * evolution-shell-view.h, evolution-shell-view.c:
- BonoboXObjectified.
-
- * evolution-shell-component-utils.c: #include
- <bonobo-activation/bonobo-activation.h>.
- (e_pixmaps_update): Pass NULL as the error arg to
- gdk_pixbuf_new_from_file().
- (e_activation_failure_dialog): Bonobo_GeneralError instead of
- OAF_GeneralError.
- (e_get_activation_failure_msg): Likewise.
-
- * evolution-shell-component-dnd.h, evolution-shell-component-dnd.c:
- BonoboXObjectified.
-
- * evolution-shell-component.c: #include <unistd.h>.
- (owner_ping_callback): Pass NULL for the opt_ev arg to
- bonobo_unknown_ping().
- (impl_populateFolderContextMenu): Pass NULL for the opt_ev arg to
- bonobo_ui_component_set_container().
- (class_init): GLIB2-ified.
-
- * e-component-registry.c (component_free): Use g_object_unref() on
- the EvolutionShellComponentClient instead of
- bonobo_object_unref().
- (register_component): Likewise.
- (component_new): Likewise, use g_object_ref() instead of
- bonobo_object_ref().
-
- * evolution-shell-component-client.c: New member corba_objref in
- EvolutionShellComponentClientPrivate.
- (init): Init to CORBA_OBJECT_NIL.
- (impl_destroy): Unref. Also CORBA_OBJECT_NILify all the pointers
- to unreffed objects.
- (corba_exception_to_result): Use BONOBO_EX_REPOID(ev) instead of
- ev->_repo_id.
- (evolution_shell_component_client_construct): Set the corba_objref
- pointer, do not call bonobo_object_client_construct().
- (evolution_shell_component_client_new): Use
- bonobo_activation_activate_from_id() here instead of
- oaf_activate_from_id().
-
- * evolution-shell-component-client.h,
- evolution-shell-component-client.c: Derive from GObject instead of
- BonoboObjectClient.
-
- * evolution-shell-client.c
- (evolution_shell_client_create_storage_set_view): Use
- BONOBO_EX_REPOID() instead of BONOBO_EX_ID().
-
- * evolution-folder-selector-button.c (destroy): g_object_unref the
- EvolutionShellClient instead of bonobo_object_unref().
- (evolution_folder_selector_button_construct): Likewise.
-
- * e-folder-list.c (e_folder_list_destroy): g_object_unref the
- EvolutionShellClient instead of bonobo_object_unref().
- (e_folder_list_construct): g_object_ref the EvolutionShellClient
- instead of bonobo_object_ref().
-
- * evolution-shell-client.c: New member corba_objref in
- EvolutionShellClientPrivate.
- (init): Init to CORBA_OBJECT_NIL.
- (destroy): Unref/release.
- (query_shell_interface): Use BONOBO_EX() and BONOBO_EX_REPOID()
- instead of ._major and ._repo_id.
- (destroy): Likewise.
- (evolution_shell_client_get_local_storage): Likewise.
-
- * evolution-shell-client.h: Derive from GObject instead of
- BonoboObjectClient.
-
- * evolution-session.c (corba_class_init): Get klass arg.
- (class_init): Pass klass arg. GLIB2-ified.
- (evolution_session_construct): Removed.
- (evolution_session_new): Just return what gtk_type_new() returns.
-
- * evolution-session.h, evolution-session.c: Derive from
- BonoboXObject.
-
- * evolution-folder-selector-button.c (init): Make icon a GtkImage
- instead of a BonoboUIToolbarIcon.
- (set_folder, class_init): GLIB2-ified.
-
- * evolution-config-control.c (class_init): GLIB2-ified.
-
- * evolution-activity-client.c (corba_update_progress): Use
- BONOBO_EX_REPOID() instead of ._major and ._repo_id.
- (evolution_activity_client_request_dialog): Likewise.
- (impl_destroy): Likewise.
- (class_init): GLIB2-ified.
-
- * e-folder-list.c: #include <gtk/gtframe.h> and #include
- <string.h>.
- (e_folder_list_destroy): bonobo_object_unref(), not
- bonobo_object_client_unref().
- (e_folder_list_init): Pass NULL as the domain to glade_xml_new().
-
- * e-folder-list.h: #include <gtk/gtkvbox.h>.
-
- * e-folder.c (impl_remove): Renamed from remove().
- (impl_get_physical_uri): Renamed from get_physical_uri().
- (impl_load_info): Renamed from load_info().
- (impl_save_info): Renamed from save_info().
- (class_init): GLIB2-ified.
-
- * Evolution-Session.idl: #include <Bonobo.idl>, not <Bonobo.h>.
- * Evolution-Offline.idl: Likewise.
- * Evolution-ShellComponent.idl: Likewise.
- * Evolution-ShellComponentDnd.idl: Likewise.
- * Evolution-Storage.idl: Likewise.
-
- * Makefile.am: Do not compile the importer directory for now.
-
- * evolution-wizard.c (evolution_wizard_set_buttons_sensitive):
- ORBit2-ize type names.
- (evolution_wizard_set_show_finish): Likewise.
- (evolution_wizard_set_page): Likewise.
+ * main.c (show_development_warning): Removed.
+ (warning_dialog_clicked_callback): Removed.
+ (view_map_callback): Removed.
+ (new_view_created_callback): Removed.
+ (idle_cb): Don't connect.
2002-10-28 Ettore Perazzoli <ettore@ximian.com>
diff --git a/shell/Evolution-ShellComponent.idl b/shell/Evolution-ShellComponent.idl
index 90cd6fa57d..bb9b4ae682 100644
--- a/shell/Evolution-ShellComponent.idl
+++ b/shell/Evolution-ShellComponent.idl
@@ -88,11 +88,8 @@ module Evolution {
/* Notify the component of whether the shell is currently
* running in interactive mode or not. (I.e. basically,
- * whether there are any Evolution windows on the screen.)
- * @new_view_xid is an X Window ID ("None" if
- * @now_interactive is FALSE) */
- void interactive (in boolean now_interactive,
- in unsigned long new_view_xid);
+ * whether there are any Evolution windows on the screen.) */
+ void interactive (in boolean now_interactive);
/* Send debugging output to the file specified. */
void debug (in string log_path);
diff --git a/shell/Evolution-ShellComponentDnd.idl b/shell/Evolution-ShellComponentDnd.idl
index baf715f0f7..064f233417 100644
--- a/shell/Evolution-ShellComponentDnd.idl
+++ b/shell/Evolution-ShellComponentDnd.idl
@@ -26,7 +26,7 @@ module ShellComponentDnd {
struct Data {
short format;
- string target;
+ short target;
sequence <octet> bytes;
};
diff --git a/shell/Evolution-Storage.idl b/shell/Evolution-Storage.idl
index 2d6928938b..26313b6825 100644
--- a/shell/Evolution-Storage.idl
+++ b/shell/Evolution-Storage.idl
@@ -82,8 +82,7 @@ module Evolution {
in Bonobo::Listener listener);
/* Open remote nodes. */
- void asyncOpenFolder (in string path,
- in Bonobo::Listener listener);
+ void asyncOpenFolder (in string path);
/* Set unread count. */
void updateFolder (in string path,
diff --git a/shell/Makefile.am b/shell/Makefile.am
index defd6266c3..7c5900ce09 100644
--- a/shell/Makefile.am
+++ b/shell/Makefile.am
@@ -1,28 +1,20 @@
SUBDIRS = glade importer
-INCLUDES = \
- -DG_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED \
- -DBONOBO_DISABLE_DEPRECATED -DGNOME_DISABLE_DEPRECATED \
+INCLUDES = -O \
-I$(top_srcdir)/widgets \
-I$(top_srcdir)/widgets/misc \
-I$(top_srcdir)/libical/src/libical \
-I$(top_builddir)/libical/src/libical \
-I$(top_srcdir) \
- -DEVOLUTION_IMAGES=\""$(imagesdir)"\" \
- -DEVOLUTION_LOCALEDIR=\""$(localedir)"\" \
- -DEVOLUTION_DATADIR=\""$(datadir)"\" \
- -DEVOLUTION_GLADEDIR=\""$(gladedir)"\" \
+ -DEVOLUTION_IMAGES=\""$(datadir)/images/evolution"\" \
+ -DEVOLUTION_LOCALEDIR=\""$(localedir)"\" \
+ -DEVOLUTION_DATADIR=\""$(datadir)"\" \
+ -DEVOLUTION_GLADEDIR=\"$(datadir)/evolution/glade\" \
-DEVOLUTION_ETSPECDIR=\""$(etspecdir)"\" \
- -DEVOLUTION_UIDIR=\""$(evolutionuidir)"\" \
- -DPREFIX=\""$(prefix)"\" \
- -DSYSCONFDIR=\""$(sysconfdir)"\" \
- -DDATADIR=\""$(datadir)"\" \
- -DLIBDIR=\""$(datadir)"\" \
+ -DPREFIX=\"$(prefix)\" \
-DG_LOG_DOMAIN=\"evolution-shell\" \
$(SHELL_CFLAGS)
-noinst_PROGRAMS = evolution evolution-test-component
-
# Shell CORBA stuff
IDLS = \
@@ -41,74 +33,58 @@ IDLS = \
Evolution-common.idl \
Evolution.idl
-IDL_GENERATED_H = \
- Evolution.h
-
-IDL_GENERATED_C = \
+IDL_GENERATED = \
+ Evolution.h \
Evolution-common.c \
Evolution-skels.c \
Evolution-stubs.c
-IDL_GENERATED = $(IDL_GENERATED_H) $(IDL_GENERATED_C)
-
-$(IDL_GENERATED_H): $(IDLS)
- $(ORBIT_IDL) -I $(srcdir) $(IDL_INCLUDES) $(srcdir)/Evolution.idl
-
-$(IDL_GENERATED_C): $(IDL_GENERATED_H)
+Evolution-impl.o: Evolution.h
+$(IDL_GENERATED): $(IDLS)
+ $(ORBIT_IDL) -I $(srcdir) -I $(datadir)/idl `$(GNOME_CONFIG) --cflags idl` \
+ $(srcdir)/Evolution.idl
# SelectNames CORBA stuff
SELECT_NAMES_IDL = \
$(top_srcdir)/addressbook/gui/component/select-names/Evolution-Addressbook-SelectNames.idl
-SELECT_NAMES_IDL_GENERATED_H = \
- Evolution-Addressbook-SelectNames.h
-
-SELECT_NAMES_IDL_GENERATED_C = \
+SELECT_NAMES_IDL_GENERATED = \
+ Evolution-Addressbook-SelectNames.h \
Evolution-Addressbook-SelectNames-common.c \
Evolution-Addressbook-SelectNames-skels.c \
Evolution-Addressbook-SelectNames-stubs.c
-SELECT_NAMES_IDL_GENERATED = $(SELECT_NAMES_IDL_GENERATED_C) $(SELECT_NAMES_IDL_GENERATED_H)
-
-$(SELECT_NAMES_IDL_GENERATED_H): $(SELECT_NAMES_IDL)
- $(ORBIT_IDL) -I $(srcdir) $(IDL_INCLUDES) $(SELECT_NAMES_IDL)
-
-$(SELECT_NAMES_IDL_GENERATED_C): $(SELECT_NAMES_IDL_GENERATED_H)
-
+$(SELECT_NAMES_IDL_GENERATED): $(SELECT_NAMES_IDL)
+ $(ORBIT_IDL) -I $(srcdir) -I $(datadir)/idl `$(GNOME_CONFIG) --cflags idl` \
+ $(SELECT_NAMES_IDL)
# Wombat CORBA stuff
-WOMBAT_IDL = \
- $(top_srcdir)/wombat/Evolution-Wombat.idl
-
-WOMBAT_IDL_GENERATED_H = \
- Evolution-Wombat.h
+WOMBAT_IDL = $(top_srcdir)/wombat/Evolution-Wombat.idl
-WOMBAT_IDL_GENERATED_C = \
+WOMBAT_IDL_GENERATED = \
+ Evolution-Wombat.h \
Evolution-Wombat-common.c \
Evolution-Wombat-skels.c \
Evolution-Wombat-stubs.c
-WOMBAT_IDL_GENERATED = $(WOMBAT_IDL_GENERATED_C) $(WOMBAT_IDL_GENERATED_H)
-
-$(WOMBAT_IDL_GENERATED_H): $(WOMBAT_IDL)
- $(ORBIT_IDL) -I $(srcdir) $(IDL_INCLUDES) $(WOMBAT_IDL)
-
-$(WOMBAT_IDL_GENERATED_C): $(WOMBAT_IDL_GENERATED_H)
-
+$(WOMBAT_IDL_GENERATED): $(WOMBAT_IDL)
+ $(ORBIT_IDL) -I $(srcdir) -I $(datadir)/idl `$(GNOME_CONFIG) --cflags idl` $(WOMBAT_IDL)
# IDL install
+idldir = $(datadir)/idl
+
idl_DATA = $(IDLS)
# Shell library
-privlib_LTLIBRARIES = \
+lib_LTLIBRARIES = \
libeshell.la
-eshellincludedir = $(privincludedir)/shell
+eshellincludedir = $(includedir)/evolution/shell
eshellinclude_HEADERS = \
Evolution.h \
@@ -151,14 +127,12 @@ libeshell_la_SOURCES = \
evolution-storage-set-view-listener.c \
evolution-storage.c \
evolution-wizard.c \
- e-shell-marshal.c \
$(eshellinclude_HEADERS)
-libeshell_la_LIBADD = \
- $(top_builddir)/e-util/libeutil.la
-
# Evolution executable
+bin_PROGRAMS = evolution
+
evolution_SOURCES = \
$(SELECT_NAMES_IDL_GENERATED) \
$(WOMBAT_IDL_GENERATED) \
@@ -168,8 +142,6 @@ evolution_SOURCES = \
e-component-info.h \
e-component-registry.c \
e-component-registry.h \
- e-config-upgrade.c \
- e-config-upgrade.h \
e-corba-config-page.c \
e-corba-config-page.h \
e-corba-shortcuts.c \
@@ -182,6 +154,8 @@ evolution_SOURCES = \
e-folder-dnd-bridge.h \
e-folder-type-registry.c \
e-folder-type-registry.h \
+ e-gray-bar.c \
+ e-gray-bar.h \
e-history.c \
e-history.h \
e-icon-factory.c \
@@ -264,14 +238,17 @@ evolution_SOURCES = \
evolution_LDADD = \
libeshell.la \
importer/libevolution-importer.la \
- $(top_builddir)/widgets/e-timezone-dialog/libetimezonedialog.la \
- $(top_builddir)/widgets/misc/libemiscwidgets.la \
+ $(top_builddir)/widgets/e-timezone-dialog/libetimezonedialog.a \
+ $(top_builddir)/widgets/misc/libemiscwidgets.a \
$(top_builddir)/e-util/libeutil.la \
$(top_builddir)/libical/src/libical/libical-evolution.la \
$(SHELL_LIBS)
# Test component
+noinst_PROGRAMS = \
+ evolution-test-component
+
evolution_test_component_SOURCES = \
evolution-test-component.c
@@ -280,67 +257,35 @@ evolution_test_component_LDADD = \
$(SHELL_LIBS)
install-test-component: evolution-test-component
+ $(mkinstalldirs) $(DESTDIR)$(bindir)
$(LIBTOOL) --mode=install $(INSTALL_PROGRAM) evolution-test-component $(DESTDIR)$(bindir)/evolution-test-component
- $(mkinstalldirs) $(DESTDIR)$(serverdir)
- $(INSTALL_DATA) $(srcdir)/GNOME_Evolution_TestComponent.server $(DESTDIR)$(serverdir)/GNOME_Evolution_TestComponent.server
+ $(mkinstalldirs) $(DESTDIR)$(oafdir)
+ $(INSTALL_DATA) $(srcdir)/GNOME_Evolution_TestComponent.oaf $(DESTDIR)$(oafdir)/GNOME_Evolution_TestComponent.oaf
# Misc stuff
-server_in_files = GNOME_Evolution_Shell.server.in.in
-server_DATA = $(server_in_files:.server.in.in=.server)
-$(server_in_files:.server.in.in=.server.in): $(server_in_files)
- sed -e "s|\@BINDIR\@|$(bindir)|" $< > $@
+oafdir = $(datadir)/oaf
+oaf_in_files = GNOME_Evolution_Shell.oaf.in
+oaf_DATA = $(oaf_in_files:.oaf.in=.oaf)
-etspec_DATA = e-storage-set-view.etspec
+etspecdir = $(datadir)/evolution/etspec/
+etspec_DATA = \
+ e-storage-set-view.etspec
-@INTLTOOL_SERVER_RULE@
+@XML_I18N_MERGE_OAF_RULE@
icons = \
check-empty.xpm \
check-filled.xpm \
check-missing.xpm
-# GConf schemas
-
-schemadir = $(GCONF_SCHEMA_FILE_DIR)
-schema_DATA = apps_evolution_shell.schemas
-
-install-data-local:
- if test -z "$(DESTDIR)" ; then \
- for p in $(schema_DATA) ; do \
- GCONF_CONFIG_SOURCE=$(GCONF_SCHEMA_CONFIG_SOURCE) $(GCONFTOOL) --makefile-install-rule $(srcdir)/$$p; \
- done \
- fi
-
-install-exec-local:
- $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) evolution $(DESTDIR)$(bindir)/evolution-$(BASE_VERSION)
-
-
-# GLib marshalling cruft
-
-e-shell-marshal.h: e-shell-marshal.list
- ( @GLIB_GENMARSHAL@ --prefix=e_shell_marshal e-shell-marshal.list --header > e-shell-marshal.h.tmp \
- && mv e-shell-marshal.h.tmp e-shell-marshal.h ) \
- || ( rm -f e-shell-marshal.h.tmp && exit 1 )
-
-e-shell-marshal.c: e-shell-marshal.h
- ( @GLIB_GENMARSHAL@ --prefix=e_shell_marshal e-shell-marshal.list --body > e-shell-marshal.c.tmp \
- && mv e-shell-marshal.c.tmp e-shell-marshal.c ) \
- || ( rm -f e-shell-marshal.c.tmp && exit 1 )
-
-MARSHAL_GENERATED = e-shell-marshal.c e-shell-marshal.h
-
-# Extra dist stuff
-
EXTRA_DIST = \
$(IDLS) \
- $(server_in_files) \
- $(server_DATA) \
+ $(oaf_in_files) \
+ $(oaf_DATA) \
$(etspec_DATA) \
- $(schema_DATA) \
$(icons) \
- GNOME_Evolution_TestComponent.server \
- e-shell-marshal.list \
+ GNOME_Evolution_TestComponent.oaf \
evolution-nognome.in
# Purify support
@@ -357,8 +302,8 @@ evolution.pure: evolution
endif
-BUILT_SOURCES = $(IDL_GENERATED) $(SELECT_NAMES_IDL_GENERATED) $(MARSHAL_GENERATED)
-CLEANFILES = $(BUILT_SOURCES)
+CLEANFILES = $(IDL_GENERATED) $(SELECT_NAMES_IDL_GENERATED)
+BUILT_SOURCES = $(IDL_GENERATED) $(SELECT_NAMES_IDL_GENERATED)
dist-hook:
cd $(distdir); rm -f $(BUILT_SOURCES)
@@ -368,4 +313,4 @@ if HAVE_DTAPPINTEGRATE
bin_SCRIPTS = evolution-nognome
-endif
+endif \ No newline at end of file
diff --git a/shell/e-component-info.c b/shell/e-component-info.c
index a89647c8a1..512c61f37f 100644
--- a/shell/e-component-info.c
+++ b/shell/e-component-info.c
@@ -28,8 +28,8 @@
#include "e-util/e-lang-utils.h"
-#include <libxml/parser.h>
-#include <libxml/xmlmemory.h>
+#include <gnome-xml/parser.h>
+#include <gnome-xml/xmlmemory.h>
#include <string.h>
#include <stdlib.h>
@@ -54,7 +54,7 @@ lookup_node (xmlNode *parent_node,
{
xmlNode *p;
- for (p = parent_node->children; p != NULL; p = p->next) {
+ for (p = parent_node->childs; p != NULL; p = p->next) {
if (strcmp ((const char *) p->name, node_name) == 0)
return p;
}
@@ -82,7 +82,7 @@ lookup_node_for_language (xmlNode *parent_node,
{
xmlNode *p;
- for (p = parent_node->children; p != NULL; p = p->next) {
+ for (p = parent_node->childs; p != NULL; p = p->next) {
xmlChar *node_language_id;
if (strcmp ((const char *) p->name, node_name) != 0)
@@ -219,7 +219,7 @@ e_component_info_load (const char *file_name)
new->uri_schemas = NULL;
new->user_creatable_item_types = NULL;
- for (p = root->children; p != NULL; p = p->next) {
+ for (p = root->childs; p != NULL; p = p->next) {
if (strcmp ((char *) p->name, "folder_type") == 0)
add_folder_type (new, p, language_list);
else if (strcmp ((char *) p->name, "user_creatable_item_type") == 0)
diff --git a/shell/e-corba-storage-registry.c b/shell/e-corba-storage-registry.c
index bfffdb6981..a0dafc239c 100644
--- a/shell/e-corba-storage-registry.c
+++ b/shell/e-corba-storage-registry.c
@@ -34,8 +34,6 @@
#include <bonobo/bonobo-exception.h>
#include <gal/util/e-util.h>
-#include <string.h>
-
#define PARENT_TYPE BONOBO_OBJECT_TYPE
static BonoboObjectClass *parent_class = NULL;
@@ -49,6 +47,31 @@ struct _ECorbaStorageRegistryPrivate {
/* CORBA interface implementation. */
+static POA_GNOME_Evolution_StorageRegistry__vepv storage_registry_vepv;
+
+static POA_GNOME_Evolution_StorageRegistry *
+create_servant (void)
+{
+ POA_GNOME_Evolution_StorageRegistry *servant;
+ CORBA_Environment ev;
+
+ servant = (POA_GNOME_Evolution_StorageRegistry *) g_new0 (BonoboObjectServant, 1);
+ servant->vepv = &storage_registry_vepv;
+
+ CORBA_exception_init (&ev);
+
+ POA_GNOME_Evolution_StorageRegistry__init ((PortableServer_Servant) servant, &ev);
+ if (ev._major != CORBA_NO_EXCEPTION) {
+ g_free (servant);
+ CORBA_exception_free (&ev);
+ return NULL;
+ }
+
+ CORBA_exception_free (&ev);
+
+ return servant;
+}
+
static void
listener_notify (Bonobo_Listener listener,
GNOME_Evolution_StorageRegistry_MessageType type,
@@ -73,6 +96,8 @@ listener_notify (Bonobo_Listener listener,
CORBA_exception_id (&ev));
}
+ CORBA_free (nr.name);
+
CORBA_exception_free (&ev);
}
@@ -103,7 +128,7 @@ impl_StorageRegistry_addStorage (PortableServer_Servant servant,
return CORBA_OBJECT_NIL;
}
- g_object_unref (storage);
+ gtk_object_unref (GTK_OBJECT (storage));
/* FIXME: if we remove a listener while looping through the list we can
@@ -239,7 +264,7 @@ storage_set_foreach (EStorageSet *set,
name = e_storage_get_name (E_STORAGE (p->data));
listener_notify (listener, GNOME_Evolution_StorageRegistry_STORAGE_CREATED, name);
- g_object_unref (p->data);
+ gtk_object_unref (GTK_OBJECT (p->data));
}
g_list_free (storage_list);
@@ -387,27 +412,10 @@ impl_StorageRegistry_getFolderByUri (PortableServer_Servant servant,
}
-/* GObject methods. */
+/* GtkObject methods. */
static void
-impl_dispose (GObject *object)
-{
- ECorbaStorageRegistry *corba_storage_registry;
- ECorbaStorageRegistryPrivate *priv;
-
- corba_storage_registry = E_CORBA_STORAGE_REGISTRY (object);
- priv = corba_storage_registry->priv;
-
- if (priv->storage_set != NULL) {
- g_object_unref (priv->storage_set);
- priv->storage_set = NULL;
- }
-
- (* G_OBJECT_CLASS (parent_class)->dispose) (object);
-}
-
-static void
-impl_finalize (GObject *object)
+destroy (GtkObject *object)
{
ECorbaStorageRegistry *corba_storage_registry;
ECorbaStorageRegistryPrivate *priv;
@@ -415,25 +423,29 @@ impl_finalize (GObject *object)
corba_storage_registry = E_CORBA_STORAGE_REGISTRY (object);
priv = corba_storage_registry->priv;
+ if (priv->storage_set != NULL)
+ gtk_object_unref (GTK_OBJECT (priv->storage_set));
g_free (priv);
- (* G_OBJECT_CLASS (parent_class)->finalize) (object);
+ (* GTK_OBJECT_CLASS (parent_class)->destroy) (object);
}
/* Initialization. */
static void
-e_corba_storage_registry_class_init (ECorbaStorageRegistryClass *klass)
+corba_class_init (void)
{
- GObjectClass *object_class;
+ POA_GNOME_Evolution_StorageRegistry__vepv *vepv;
POA_GNOME_Evolution_StorageRegistry__epv *epv;
+ PortableServer_ServantBase__epv *base_epv;
- object_class = G_OBJECT_CLASS (klass);
- object_class->dispose = impl_dispose;
- object_class->finalize = impl_finalize;
+ base_epv = g_new0 (PortableServer_ServantBase__epv, 1);
+ base_epv->_private = NULL;
+ base_epv->finalize = NULL;
+ base_epv->default_POA = NULL;
- epv = & klass->epv;
+ epv = g_new0 (POA_GNOME_Evolution_StorageRegistry__epv, 1);
epv->addStorage = impl_StorageRegistry_addStorage;
epv->getStorageList = impl_StorageRegistry_getStorageList;
epv->getStorageByName = impl_StorageRegistry_getStorageByName;
@@ -442,11 +454,27 @@ e_corba_storage_registry_class_init (ECorbaStorageRegistryClass *klass)
epv->removeListener = impl_StorageRegistry_removeListener;
epv->getFolderByUri = impl_StorageRegistry_getFolderByUri;
- parent_class = g_type_class_ref(PARENT_TYPE);
+ vepv = &storage_registry_vepv;
+ vepv->_base_epv = base_epv;
+ vepv->Bonobo_Unknown_epv = bonobo_object_get_epv ();
+ vepv->GNOME_Evolution_StorageRegistry_epv = epv;
+}
+
+static void
+class_init (ECorbaStorageRegistryClass *klass)
+{
+ GtkObjectClass *object_class;
+
+ object_class = GTK_OBJECT_CLASS (klass);
+ object_class->destroy = destroy;
+
+ parent_class = gtk_type_class (PARENT_TYPE);
+
+ corba_class_init ();
}
static void
-e_corba_storage_registry_init (ECorbaStorageRegistry *corba_storage_registry)
+init (ECorbaStorageRegistry *corba_storage_registry)
{
ECorbaStorageRegistryPrivate *priv;
@@ -460,15 +488,20 @@ e_corba_storage_registry_init (ECorbaStorageRegistry *corba_storage_registry)
void
e_corba_storage_registry_construct (ECorbaStorageRegistry *corba_storage_registry,
+ GNOME_Evolution_StorageRegistry corba_object,
EStorageSet *storage_set)
{
ECorbaStorageRegistryPrivate *priv;
+ g_return_if_fail (corba_storage_registry != NULL);
g_return_if_fail (E_IS_CORBA_STORAGE_REGISTRY (corba_storage_registry));
+ g_return_if_fail (corba_object != CORBA_OBJECT_NIL);
+
+ bonobo_object_construct (BONOBO_OBJECT (corba_storage_registry), corba_object);
priv = corba_storage_registry->priv;
- g_object_ref (storage_set);
+ gtk_object_ref (GTK_OBJECT (storage_set));
priv->storage_set = storage_set;
}
@@ -476,19 +509,25 @@ ECorbaStorageRegistry *
e_corba_storage_registry_new (EStorageSet *storage_set)
{
ECorbaStorageRegistry *corba_storage_registry;
+ POA_GNOME_Evolution_StorageRegistry *servant;
+ GNOME_Evolution_StorageRegistry corba_object;
g_return_val_if_fail (storage_set != NULL, NULL);
g_return_val_if_fail (E_IS_STORAGE_SET (storage_set), NULL);
- corba_storage_registry = g_object_new (e_corba_storage_registry_get_type (), NULL);
+ servant = create_servant ();
+ if (servant == NULL)
+ return NULL;
+
+ corba_storage_registry = gtk_type_new (e_corba_storage_registry_get_type ());
+
+ corba_object = bonobo_object_activate_servant (BONOBO_OBJECT (corba_storage_registry),
+ servant);
- e_corba_storage_registry_construct (corba_storage_registry, storage_set);
+ e_corba_storage_registry_construct (corba_storage_registry, corba_object, storage_set);
return corba_storage_registry;
}
-BONOBO_TYPE_FUNC_FULL (ECorbaStorageRegistry,
- GNOME_Evolution_StorageRegistry,
- PARENT_TYPE,
- e_corba_storage_registry)
+E_MAKE_TYPE (e_corba_storage_registry, "ECorbaStorageRegistry", ECorbaStorageRegistry, class_init, init, PARENT_TYPE)
diff --git a/shell/e-shell-config-default-folders.c b/shell/e-shell-config-default-folders.c
index 8c60682068..4c1d7d070c 100644
--- a/shell/e-shell-config-default-folders.c
+++ b/shell/e-shell-config-default-folders.c
@@ -35,8 +35,6 @@
#include <libgnome/gnome-i18n.h>
-#include <gconf/gconf-client.h>
-
typedef struct {
GladeXML *glade;
@@ -47,6 +45,7 @@ typedef struct {
char *calendar_uri, *calendar_path;
char *tasks_uri, *tasks_path;
+ Bonobo_ConfigDatabase db;
EvolutionShellClient *shell_client;
} EvolutionDefaultFolderConfig;
@@ -57,8 +56,8 @@ folder_selected (EvolutionFolderSelectorButton *button,
{
char **uri_ptr, **path_ptr;
- uri_ptr = g_object_get_data (G_OBJECT (button), "uri_ptr");
- path_ptr = g_object_get_data (G_OBJECT (button), "path_ptr");
+ uri_ptr = gtk_object_get_data (GTK_OBJECT (button), "uri_ptr");
+ path_ptr = gtk_object_get_data (GTK_OBJECT (button), "path_ptr");
g_free (*uri_ptr);
g_free (*path_ptr);
@@ -76,36 +75,27 @@ e_shell_config_default_folder_selector_button_new (char *widget_name,
char *string2,
int int1, int int2)
{
- return (GtkWidget *) g_object_new (EVOLUTION_TYPE_FOLDER_SELECTOR_BUTTON, NULL);
+ return (GtkWidget *)gtk_type_new (EVOLUTION_TYPE_FOLDER_SELECTOR_BUTTON);
}
static void
config_control_apply_cb (EvolutionConfigControl *control,
EvolutionDefaultFolderConfig *dfc)
{
- GConfClient *client;
-
- client = gconf_client_get_default ();
-
- gconf_client_set_string (client, "/apps/evolution/shell/default_folders/mail_path", dfc->mail_path, NULL);
- gconf_client_set_string (client, "/apps/evolution/shell/default_folders/mail_uri", dfc->mail_uri, NULL);
- gconf_client_set_string (client, "/apps/evolution/shell/default_folders/contacts_path", dfc->contacts_path, NULL);
- gconf_client_set_string (client, "/apps/evolution/shell/default_folders/contacts_uri", dfc->contacts_uri, NULL);
- gconf_client_set_string (client, "/apps/evolution/shell/default_folders/calendar_path", dfc->calendar_path, NULL);
- gconf_client_set_string (client, "/apps/evolution/shell/default_folders/calendar_uri", dfc->calendar_uri, NULL);
- gconf_client_set_string (client, "/apps/evolution/shell/default_folders/tasks_path", dfc->tasks_path, NULL);
- gconf_client_set_string (client, "/apps/evolution/shell/default_folders/tasks_uri", dfc->tasks_uri, NULL);
-
-
- g_object_unref (client);
+ bonobo_config_set_string (dfc->db, "/DefaultFolders/mail_path", dfc->mail_path, NULL);
+ bonobo_config_set_string (dfc->db, "/DefaultFolders/mail_uri", dfc->mail_uri, NULL);
+ bonobo_config_set_string (dfc->db, "/DefaultFolders/contacts_path", dfc->contacts_path, NULL);
+ bonobo_config_set_string (dfc->db, "/DefaultFolders/contacts_uri", dfc->contacts_uri, NULL);
+ bonobo_config_set_string (dfc->db, "/DefaultFolders/calendar_path", dfc->calendar_path, NULL);
+ bonobo_config_set_string (dfc->db, "/DefaultFolders/calendar_uri", dfc->calendar_uri, NULL);
+ bonobo_config_set_string (dfc->db, "/DefaultFolders/tasks_path", dfc->tasks_path, NULL);
+ bonobo_config_set_string (dfc->db, "/DefaultFolders/tasks_uri", dfc->tasks_uri, NULL);
}
static void
-config_control_destroy_notify (void *data,
- GObject *where_the_config_control_was)
+config_control_destroy_cb (EvolutionConfigControl *config_control,
+ EvolutionDefaultFolderConfig *dfc)
{
- EvolutionDefaultFolderConfig *dfc = (EvolutionDefaultFolderConfig *) data;
-
g_free (dfc->mail_uri);
g_free (dfc->mail_path);
g_free (dfc->contacts_uri);
@@ -115,9 +105,8 @@ config_control_destroy_notify (void *data,
g_free (dfc->tasks_uri);
g_free (dfc->tasks_path);
- g_object_unref (dfc->glade);
- g_object_unref (dfc->shell_client);
-
+ gtk_object_unref (GTK_OBJECT (dfc->glade));
+ bonobo_object_unref (BONOBO_OBJECT (dfc->shell_client));
g_free (dfc);
}
@@ -133,59 +122,56 @@ setup_folder_selector (EvolutionDefaultFolderConfig *dfc,
char **uri_ptr, char *uri_dbpath,
const char **types)
{
- GConfClient *client;
GtkWidget *button;
- client = gconf_client_get_default ();
-
- *path_ptr = gconf_client_get_string (client, path_dbpath, NULL);
- *uri_ptr = gconf_client_get_string (client, uri_dbpath, NULL);
-
- g_object_unref (client);
+ *path_ptr = bonobo_config_get_string (dfc->db, path_dbpath, NULL);
+ *uri_ptr = bonobo_config_get_string (dfc->db, uri_dbpath, NULL);
button = glade_xml_get_widget (dfc->glade, widget_name);
evolution_folder_selector_button_construct (
EVOLUTION_FOLDER_SELECTOR_BUTTON (button),
dfc->shell_client, _("Select Default Folder"),
*uri_ptr, types);
- g_object_set_data (G_OBJECT (button), "uri_ptr", uri_ptr);
- g_object_set_data (G_OBJECT (button), "path_ptr", path_ptr);
- g_signal_connect (button, "selected",
- G_CALLBACK (folder_selected),
- dfc);
-
- /* XXX libglade2 seems to not show custom widgets even when
- they're flagged Visible.*/
- gtk_widget_show (button);
+ gtk_object_set_data (GTK_OBJECT (button), "uri_ptr", uri_ptr);
+ gtk_object_set_data (GTK_OBJECT (button), "path_ptr", path_ptr);
+ gtk_signal_connect (GTK_OBJECT (button), "selected",
+ GTK_SIGNAL_FUNC (folder_selected),
+ dfc);
}
GtkWidget*
e_shell_config_default_folders_create_widget (EShell *shell, EvolutionConfigControl *config_control)
{
+ GNOME_Evolution_Shell shell_dup;
+ CORBA_Environment ev;
EvolutionDefaultFolderConfig *dfc;
GtkWidget *widget;
dfc = g_new0 (EvolutionDefaultFolderConfig, 1);
+ dfc->db = e_shell_get_config_db (shell);
- dfc->shell_client = evolution_shell_client_new (BONOBO_OBJREF (shell));
+ CORBA_exception_init (&ev);
+ shell_dup = CORBA_Object_duplicate (bonobo_object_corba_objref (BONOBO_OBJECT (shell)), &ev);
+ CORBA_exception_free (&ev);
+ dfc->shell_client = evolution_shell_client_new (shell_dup);
- dfc->glade = glade_xml_new (EVOLUTION_GLADEDIR "/e-shell-config-default-folders.glade", NULL, NULL);
+ dfc->glade = glade_xml_new (EVOLUTION_GLADEDIR "/e-shell-config-default-folders.glade", NULL);
setup_folder_selector (dfc, "default_mail_button",
- &dfc->mail_path, "/apps/evolution/shell/default_folders/mail_path",
- &dfc->mail_uri, "/apps/evolution/shell/default_folders/mail_uri",
+ &dfc->mail_path, "/DefaultFolders/mail_path",
+ &dfc->mail_uri, "/DefaultFolders/mail_uri",
mail_types);
setup_folder_selector (dfc, "default_contacts_button",
- &dfc->contacts_path, "/apps/evolution/shell/default_folders/contacts_path",
- &dfc->contacts_uri, "/apps/evolution/shell/default_folders/contacts_uri",
+ &dfc->contacts_path, "/DefaultFolders/contacts_path",
+ &dfc->contacts_uri, "/DefaultFolders/contacts_uri",
contacts_types);
setup_folder_selector (dfc, "default_calendar_button",
- &dfc->calendar_path, "/apps/evolution/shell/default_folders/calendar_path",
- &dfc->calendar_uri, "/apps/evolution/shell/default_folders/calendar_uri",
+ &dfc->calendar_path, "/DefaultFolders/calendar_path",
+ &dfc->calendar_uri, "/DefaultFolders/calendar_uri",
calendar_types);
setup_folder_selector (dfc, "default_tasks_button",
- &dfc->tasks_path, "/apps/evolution/shell/default_folders/tasks_path",
- &dfc->tasks_uri, "/apps/evolution/shell/default_folders/tasks_uri",
+ &dfc->tasks_path, "/DefaultFolders/tasks_path",
+ &dfc->tasks_uri, "/DefaultFolders/tasks_uri",
tasks_types);
widget = glade_xml_get_widget (dfc->glade, "default_folders_table");
@@ -194,10 +180,10 @@ e_shell_config_default_folders_create_widget (EShell *shell, EvolutionConfigCont
gtk_widget_show (widget);
dfc->config_control = config_control;
- g_signal_connect (dfc->config_control, "apply",
- G_CALLBACK (config_control_apply_cb), dfc);
-
- g_object_weak_ref (G_OBJECT (dfc->config_control), config_control_destroy_notify, dfc);
+ gtk_signal_connect (GTK_OBJECT (dfc->config_control), "apply",
+ GTK_SIGNAL_FUNC (config_control_apply_cb), dfc);
+ gtk_signal_connect (GTK_OBJECT (dfc->config_control), "destroy",
+ GTK_SIGNAL_FUNC (config_control_destroy_cb), dfc);
return widget;
}
diff --git a/shell/e-shell-folder-title-bar.c b/shell/e-shell-folder-title-bar.c
index 5c995f32d8..ee1fb91dc6 100644
--- a/shell/e-shell-folder-title-bar.c
+++ b/shell/e-shell-folder-title-bar.c
@@ -24,13 +24,12 @@
#include <config.h>
#endif
-#include <string.h>
-#include <gtk/gtkarrow.h>
#include <gtk/gtklabel.h>
-#include <gtk/gtkimage.h>
+#include <gtk/gtkpixmap.h>
#include <gtk/gtkrc.h>
#include <gtk/gtksignal.h>
#include <gtk/gtktogglebutton.h>
+#include <libgnome/gnome-defs.h>
#include <libgnome/gnome-i18n.h>
#include <gdk-pixbuf/gdk-pixbuf.h>
@@ -39,7 +38,6 @@
#include "widgets/misc/e-clipped-label.h"
#include "e-shell-constants.h"
-#include "e-shell-marshal.h"
#include "e-shell-folder-title-bar.h"
@@ -85,8 +83,66 @@ enum {
static guint signals[LAST_SIGNAL] = { 0 };
+static const char *down_arrow_xpm[] = {
+ "11 5 2 1",
+ " c none",
+ ". c #ffffffffffff",
+ " ......... ",
+ " ....... ",
+ " ..... ",
+ " ... ",
+ " . ",
+};
+
+static const char *left_arrow_xpm[] = {
+ "11 7 2 1",
+ " c none",
+ ". c #ffffffffffff",
+ " . ",
+ " .. ",
+ " ........ ",
+ " ......... ",
+ " ........ ",
+ " .. ",
+ " . ",
+};
+
+static const char *right_arrow_xpm[] = {
+ "11 7 2 1",
+ " c none",
+ ". c #ffffffffffff",
+ " . ",
+ " .. ",
+ " ........ ",
+ " ......... ",
+ " ........ ",
+ " .. ",
+ " . ",
+};
+
+
/* Utility functions for managing icons and icon widgets. */
+static GtkWidget *
+create_pixmap_widget_from_xpm (const char **xpm)
+{
+ GdkPixbuf *pixbuf;
+ GdkPixmap *pixmap;
+ GdkBitmap *mask;
+ GtkWidget *widget;
+
+ pixbuf = gdk_pixbuf_new_from_xpm_data (xpm);
+
+ gdk_pixbuf_render_pixmap_and_mask (pixbuf, &pixmap, &mask, 127);
+
+ widget = gtk_pixmap_new (pixmap, mask);
+ gtk_widget_show (widget);
+
+ gdk_pixbuf_unref (pixbuf);
+
+ return widget;
+}
+
static GdkPixbuf *
new_empty_pixbuf (void)
{
@@ -102,9 +158,9 @@ new_empty_pixbuf (void)
}
static GtkWidget *
-new_empty_image_widget (void)
+new_empty_pixmap_widget (void)
{
- GtkWidget *image_widget;
+ GtkWidget *pixmap_widget;
GdkPixmap *pixmap;
GdkBitmap *mask;
GdkPixbuf *empty_pixbuf;
@@ -112,11 +168,28 @@ new_empty_image_widget (void)
empty_pixbuf = new_empty_pixbuf ();
gdk_pixbuf_render_pixmap_and_mask (empty_pixbuf, &pixmap, &mask, 127);
- image_widget = gtk_image_new_from_pixmap (pixmap, mask);
+ pixmap_widget = gtk_pixmap_new (pixmap, mask);
- g_object_unref (empty_pixbuf);
+ gdk_pixbuf_unref (empty_pixbuf);
- return image_widget;
+ return pixmap_widget;
+}
+
+
+static void
+set_title_bar_label_style (GtkWidget *widget)
+{
+ GtkRcStyle *rc_style;
+
+ rc_style = gtk_rc_style_new();
+
+ rc_style->color_flags[GTK_STATE_NORMAL] |= GTK_RC_FG;
+ rc_style->fg[GTK_STATE_NORMAL].red = 0xffff;
+ rc_style->fg[GTK_STATE_NORMAL].green = 0xffff;
+ rc_style->fg[GTK_STATE_NORMAL].blue = 0xffff;
+
+ gtk_widget_modify_style (widget, rc_style);
+ gtk_rc_style_unref (rc_style);
}
@@ -125,9 +198,12 @@ new_empty_image_widget (void)
static int
get_max_clipped_label_width (EClippedLabel *clipped_label)
{
+ GdkFont *font;
int width;
- pango_layout_get_pixel_size (clipped_label->layout, &width, NULL);
+ font = GTK_WIDGET (clipped_label)->style->font;
+
+ width = gdk_string_width (font, clipped_label->label);
width += 2 * GTK_MISC (clipped_label)->xpad;
return width;
@@ -242,7 +318,7 @@ back_button_clicked_callback (GtkButton *button,
folder_title_bar = E_SHELL_FOLDER_TITLE_BAR (data);
- g_signal_emit (folder_title_bar, signals[BACK_CLICKED], 0);
+ gtk_signal_emit (GTK_OBJECT (folder_title_bar), signals[BACK_CLICKED]);
}
static void
@@ -253,15 +329,15 @@ forward_button_clicked_callback (GtkButton *button,
folder_title_bar = E_SHELL_FOLDER_TITLE_BAR (data);
- g_signal_emit (folder_title_bar, signals[FORWARD_CLICKED], 0);
+ gtk_signal_emit (GTK_OBJECT (folder_title_bar), signals[FORWARD_CLICKED]);
}
static void
add_navigation_buttons (EShellFolderTitleBar *folder_title_bar)
{
EShellFolderTitleBarPrivate *priv;
- GtkWidget *back_image;
- GtkWidget *forward_image;
+ GtkWidget *back_pixmap;
+ GtkWidget *forward_pixmap;
priv = folder_title_bar->priv;
@@ -269,21 +345,21 @@ add_navigation_buttons (EShellFolderTitleBar *folder_title_bar)
gtk_button_set_relief (GTK_BUTTON (priv->back_button), GTK_RELIEF_NONE);
GTK_WIDGET_UNSET_FLAGS (priv->back_button, GTK_CAN_FOCUS);
- back_image = gtk_arrow_new (GTK_ARROW_LEFT, GTK_SHADOW_NONE);
- gtk_container_add (GTK_CONTAINER (priv->back_button), back_image);
+ back_pixmap = create_pixmap_widget_from_xpm (left_arrow_xpm);
+ gtk_container_add (GTK_CONTAINER (priv->back_button), back_pixmap);
- g_signal_connect (priv->back_button, "clicked",
- G_CALLBACK (back_button_clicked_callback), folder_title_bar);
+ gtk_signal_connect (GTK_OBJECT (priv->back_button), "clicked",
+ GTK_SIGNAL_FUNC (back_button_clicked_callback), folder_title_bar);
priv->forward_button = gtk_button_new ();
gtk_button_set_relief (GTK_BUTTON (priv->forward_button), GTK_RELIEF_NONE);
GTK_WIDGET_UNSET_FLAGS (priv->forward_button, GTK_CAN_FOCUS);
- forward_image = gtk_arrow_new (GTK_ARROW_RIGHT, GTK_SHADOW_NONE);
- gtk_container_add (GTK_CONTAINER (priv->forward_button), forward_image);
+ forward_pixmap = create_pixmap_widget_from_xpm (right_arrow_xpm);
+ gtk_container_add (GTK_CONTAINER (priv->forward_button), forward_pixmap);
- g_signal_connect (priv->forward_button, "clicked",
- G_CALLBACK (forward_button_clicked_callback), folder_title_bar);
+ gtk_signal_connect (GTK_OBJECT (priv->forward_button), "clicked",
+ GTK_SIGNAL_FUNC (forward_button_clicked_callback), folder_title_bar);
gtk_box_pack_start (GTK_BOX (folder_title_bar), priv->back_button, FALSE, FALSE, 0);
gtk_box_pack_start (GTK_BOX (folder_title_bar), priv->forward_button, FALSE, FALSE, 0);
@@ -302,33 +378,16 @@ title_button_toggled_cb (GtkToggleButton *title_button,
EShellFolderTitleBar *folder_title_bar;
folder_title_bar = E_SHELL_FOLDER_TITLE_BAR (data);
-
- g_signal_emit (folder_title_bar, signals[TITLE_TOGGLED], 0,
- gtk_toggle_button_get_active (title_button));
+ gtk_signal_emit (GTK_OBJECT (folder_title_bar),
+ signals[TITLE_TOGGLED],
+ gtk_toggle_button_get_active (title_button));
}
-/* GObject methods. */
-
-static void
-impl_dispose (GObject *object)
-{
- EShellFolderTitleBar *folder_title_bar;
- EShellFolderTitleBarPrivate *priv;
-
- folder_title_bar = E_SHELL_FOLDER_TITLE_BAR (object);
- priv = folder_title_bar->priv;
-
- if (priv->icon != NULL) {
- g_object_unref (priv->icon);
- priv->icon = NULL;
- }
-
- (* G_OBJECT_CLASS (parent_class)->dispose) (object);
-}
+/* GtkObject methods. */
static void
-impl_finalize (GObject *object)
+impl_destroy (GtkObject *object)
{
EShellFolderTitleBar *folder_title_bar;
EShellFolderTitleBarPrivate *priv;
@@ -336,9 +395,11 @@ impl_finalize (GObject *object)
folder_title_bar = E_SHELL_FOLDER_TITLE_BAR (object);
priv = folder_title_bar->priv;
+ if (priv->icon != NULL)
+ gdk_pixbuf_unref (priv->icon);
g_free (priv);
- (* G_OBJECT_CLASS (parent_class)->finalize) (object);
+ (* GTK_OBJECT_CLASS (parent_class)->destroy) (object);
}
@@ -383,67 +444,43 @@ impl_size_allocate (GtkWidget *widget,
}
-static int
-impl_expose_event (GtkWidget *widget,
- GdkEventExpose *event)
-{
- gtk_paint_flat_box (widget->style, widget->window,
- GTK_STATE_ACTIVE, GTK_SHADOW_OUT,
- &event->area, widget, "EShellFolderTitleBar",
- widget->allocation.x,
- widget->allocation.y,
- widget->allocation.width,
- widget->allocation.height);
-
- (* GTK_WIDGET_CLASS (parent_class)->expose_event) (widget, event);
-
- return FALSE;
-}
-
-
static void
class_init (EShellFolderTitleBarClass *klass)
{
- GObjectClass *object_class;
+ GtkObjectClass *object_class;
GtkWidgetClass *widget_class;
- object_class = G_OBJECT_CLASS (klass);
- object_class->dispose = impl_dispose;
- object_class->finalize = impl_finalize;
+ object_class = GTK_OBJECT_CLASS (klass);
+ object_class->destroy = impl_destroy;
widget_class = GTK_WIDGET_CLASS (klass);
widget_class->size_allocate = impl_size_allocate;
- widget_class->expose_event = impl_expose_event;
-
- parent_class = g_type_class_ref(PARENT_TYPE);
-
- signals[TITLE_TOGGLED]
- = g_signal_new ("title_toggled",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_FIRST,
- G_STRUCT_OFFSET (EShellFolderTitleBarClass, title_toggled),
- NULL, NULL,
- e_shell_marshal_NONE__BOOL,
- G_TYPE_NONE, 1,
- G_TYPE_BOOLEAN);
-
- signals[BACK_CLICKED]
- = g_signal_new ("back_clicked",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_FIRST,
- G_STRUCT_OFFSET (EShellFolderTitleBarClass, back_clicked),
- NULL, NULL,
- e_shell_marshal_NONE__NONE,
- G_TYPE_NONE, 0);
-
- signals[FORWARD_CLICKED]
- = g_signal_new ("forward_clicked",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_FIRST,
- G_STRUCT_OFFSET (EShellFolderTitleBarClass, forward_clicked),
- NULL, NULL,
- e_shell_marshal_NONE__NONE,
- G_TYPE_NONE, 0);
+
+ parent_class = gtk_type_class (PARENT_TYPE);
+
+ signals[TITLE_TOGGLED] = gtk_signal_new ("title_toggled",
+ GTK_RUN_FIRST,
+ object_class->type,
+ GTK_SIGNAL_OFFSET (EShellFolderTitleBarClass, title_toggled),
+ gtk_marshal_NONE__BOOL,
+ GTK_TYPE_NONE, 1,
+ GTK_TYPE_BOOL);
+
+ signals[BACK_CLICKED] = gtk_signal_new ("back_clicked",
+ GTK_RUN_FIRST,
+ object_class->type,
+ GTK_SIGNAL_OFFSET (EShellFolderTitleBarClass, back_clicked),
+ gtk_marshal_NONE__NONE,
+ GTK_TYPE_NONE, 0);
+
+ signals[FORWARD_CLICKED] = gtk_signal_new ("forward_clicked",
+ GTK_RUN_FIRST,
+ object_class->type,
+ GTK_SIGNAL_OFFSET (EShellFolderTitleBarClass, forward_clicked),
+ gtk_marshal_NONE__NONE,
+ GTK_TYPE_NONE, 0);
+
+ gtk_object_class_add_signals (object_class, signals, LAST_SIGNAL);
}
static void
@@ -493,25 +530,28 @@ e_shell_folder_title_bar_construct (EShellFolderTitleBar *folder_title_bar)
priv = folder_title_bar->priv;
widget = GTK_WIDGET (folder_title_bar);
- priv->title_icon = new_empty_image_widget ();
+ priv->title_icon = new_empty_pixmap_widget ();
gtk_misc_set_alignment (GTK_MISC (priv->title_icon), 1.0, .5);
gtk_misc_set_padding (GTK_MISC (priv->title_icon), 2, 0);
gtk_widget_show (priv->title_icon);
- priv->title_label = e_clipped_label_new ("", PANGO_WEIGHT_BOLD, 1.2);
+ priv->title_label = e_clipped_label_new ("");
gtk_misc_set_padding (GTK_MISC (priv->title_label), 0, 0);
gtk_misc_set_alignment (GTK_MISC (priv->title_label), 0.0, 0.5);
+ set_title_bar_label_style (priv->title_label);
- priv->title_button_label = e_clipped_label_new ("", PANGO_WEIGHT_BOLD, 1.2);
+ priv->title_button_label = e_clipped_label_new ("");
gtk_misc_set_padding (GTK_MISC (priv->title_button_label), 2, 0);
gtk_misc_set_alignment (GTK_MISC (priv->title_button_label), 0.0, 0.5);
gtk_widget_show (priv->title_button_label);
+ set_title_bar_label_style (priv->title_button_label);
- priv->folder_bar_label = e_clipped_label_new ("", PANGO_WEIGHT_NORMAL, 1.0);
+ priv->folder_bar_label = e_clipped_label_new ("");
gtk_misc_set_alignment (GTK_MISC (priv->folder_bar_label), 1.0, 0.5);
gtk_widget_show (priv->folder_bar_label);
+ set_title_bar_label_style (priv->folder_bar_label);
- priv->title_button_icon = new_empty_image_widget ();
+ priv->title_button_icon = new_empty_pixmap_widget ();
gtk_widget_show (priv->title_button_icon);
title_button_hbox = gtk_hbox_new (FALSE, 0);
@@ -519,7 +559,7 @@ e_shell_folder_title_bar_construct (EShellFolderTitleBar *folder_title_bar)
FALSE, TRUE, 2);
gtk_box_pack_start (GTK_BOX (title_button_hbox), priv->title_button_label,
TRUE, TRUE, 0);
- gtk_box_pack_start (GTK_BOX (title_button_hbox), gtk_arrow_new (GTK_ARROW_DOWN, GTK_SHADOW_NONE),
+ gtk_box_pack_start (GTK_BOX (title_button_hbox), create_pixmap_widget_from_xpm (down_arrow_xpm),
FALSE, TRUE, 2);
gtk_widget_show (title_button_hbox);
@@ -540,11 +580,11 @@ e_shell_folder_title_bar_construct (EShellFolderTitleBar *folder_title_bar)
as the padding is hardcoded in GtkButton too (see CHILD_SPACING in
gtkbutton.c). */
gtk_misc_set_padding (GTK_MISC (priv->title_label),
- GTK_WIDGET (priv->title_button)->style->xthickness,
- GTK_WIDGET (priv->title_button)->style->ythickness + 2);
+ GTK_WIDGET (priv->title_button)->style->klass->xthickness,
+ GTK_WIDGET (priv->title_button)->style->klass->ythickness + 2);
- g_signal_connect (priv->title_button, "toggled",
- G_CALLBACK (title_button_toggled_cb), folder_title_bar);
+ gtk_signal_connect (GTK_OBJECT (priv->title_button), "toggled",
+ GTK_SIGNAL_FUNC (title_button_toggled_cb), folder_title_bar);
add_navigation_buttons (folder_title_bar);
@@ -564,9 +604,13 @@ e_shell_folder_title_bar_new (void)
{
EShellFolderTitleBar *new;
- new = g_object_new (e_shell_folder_title_bar_get_type (), NULL);
+ gtk_widget_push_colormap (gdk_rgb_get_cmap ());
+ gtk_widget_push_visual (gdk_rgb_get_visual ());
+ new = gtk_type_new (e_shell_folder_title_bar_get_type ());
e_shell_folder_title_bar_construct (new);
+ gtk_widget_pop_visual ();
+ gtk_widget_pop_colormap ();
return GTK_WIDGET (new);
}
@@ -653,20 +697,20 @@ e_shell_folder_title_bar_set_icon (EShellFolderTitleBar *folder_title_bar,
if (icon == NULL) {
if (priv->icon != NULL)
- g_object_unref (priv->icon);
+ gdk_pixbuf_unref (priv->icon);
priv->icon = new_empty_pixbuf ();
} else {
- g_object_ref (icon);
+ gdk_pixbuf_ref (icon);
if (priv->icon != NULL)
- g_object_unref (priv->icon);
+ gdk_pixbuf_unref (priv->icon);
priv->icon = icon;
}
gdk_pixbuf_render_pixmap_and_mask (priv->icon, &pixmap, &mask, 127);
- gtk_image_set_from_pixmap (GTK_IMAGE (priv->title_button_icon), pixmap, mask);
+ gtk_pixmap_set (GTK_PIXMAP (priv->title_button_icon), pixmap, mask);
gdk_pixbuf_render_pixmap_and_mask (priv->icon, &pixmap, &mask, 127);
- gtk_image_set_from_pixmap (GTK_IMAGE (priv->title_icon), pixmap, mask);
+ gtk_pixmap_set (GTK_PIXMAP (priv->title_icon), pixmap, mask);
}
diff --git a/shell/e-shell-settings-dialog.c b/shell/e-shell-settings-dialog.c
index cab4070def..64db14d714 100644
--- a/shell/e-shell-settings-dialog.c
+++ b/shell/e-shell-settings-dialog.c
@@ -32,11 +32,11 @@
#include "e-util/e-lang-utils.h"
#include <gal/util/e-util.h>
+#include <gal/util/e-unicode-i18n.h>
#include <bonobo/bonobo-widget.h>
#include <bonobo/bonobo-exception.h>
-
-#include <bonobo-activation/bonobo-activation.h>
+#include <liboaf/liboaf.h>
#include <string.h>
@@ -57,26 +57,14 @@ struct _EShellSettingsDialogPrivate {
static void
set_dialog_size (EShellSettingsDialog *dialog)
{
- PangoLayout *layout;
- PangoContext *context;
- PangoFontMetrics *metrics;
+ GdkFont *font;
int width, height;
- layout = gtk_widget_create_pango_layout (GTK_WIDGET (dialog), "M");
- context = pango_layout_get_context (layout);
- metrics = pango_context_get_metrics (context,
- gtk_widget_get_style (GTK_WIDGET (dialog))->font_desc,
- pango_context_get_language (context));
-
- pango_layout_get_pixel_size (layout, &width, NULL);
-
- width *= 60;
- height = PANGO_PIXELS (pango_font_metrics_get_ascent (metrics)
- + pango_font_metrics_get_descent (metrics)) * 30;
+ font = GTK_WIDGET (dialog)->style->font;
+ width = gdk_string_width (font, "M") * 72;
+ height = (font->ascent + font->descent) * 35;
- gtk_window_set_default_size((GtkWindow *)dialog, width, height);
- g_object_unref (layout);
- pango_font_metrics_unref (metrics);
+ gtk_widget_set_usize (GTK_WIDGET (dialog), width, height);
}
@@ -86,7 +74,7 @@ struct _Page {
char *title;
char *description;
GdkPixbuf *icon;
- Bonobo_ActivationProperty *type;
+ OAF_Property *type;
int priority;
EConfigPage *page_widget;
};
@@ -96,18 +84,18 @@ static Page *
page_new (const char *title,
const char *description,
GdkPixbuf *icon,
- Bonobo_ActivationProperty *type,
+ OAF_Property *type,
int priority,
EConfigPage *page_widget)
{
Page *page;
if (icon != NULL)
- g_object_ref (icon);
+ gdk_pixbuf_ref (icon);
page = g_new (Page, 1);
- page->title = g_strdup (title);
- page->description = g_strdup (description);
+ page->title = e_utf8_from_locale_string (title);
+ page->description = e_utf8_from_locale_string (description);
page->icon = icon;
page->type = type;
page->priority = priority;
@@ -123,7 +111,7 @@ page_free (Page *page)
g_free (page->description);
if (page->icon != NULL)
- g_object_unref (page->icon);
+ gdk_pixbuf_unref (page->icon);
g_free (page);
}
@@ -154,7 +142,7 @@ static void
load_pages (EShellSettingsDialog *dialog)
{
EShellSettingsDialogPrivate *priv;
- Bonobo_ServerInfoList *control_list;
+ OAF_ServerInfoList *control_list;
CORBA_Environment ev;
GSList *language_list;
GList *page_list;
@@ -165,61 +153,57 @@ load_pages (EShellSettingsDialog *dialog)
CORBA_exception_init (&ev);
- control_list = bonobo_activation_query ("defined(evolution:config_item:title)", NULL, &ev);
+ control_list = oaf_query ("defined(evolution:config_item:title)", NULL, &ev);
if (ev._major != CORBA_NO_EXCEPTION || control_list == NULL) {
- g_warning ("Cannot load configuration pages -- %s", BONOBO_EX_REPOID (&ev));
+ g_warning ("Cannot load configuration pages -- %s", ev._repo_id);
CORBA_exception_free (&ev);
return;
}
- CORBA_exception_free (&ev);
-
language_list = e_get_language_list ();
page_list = NULL;
for (i = 0; i < control_list->_length; i ++) {
CORBA_Object corba_object;
- Bonobo_ServerInfo *info;
+ OAF_ServerInfo *info;
const char *title;
const char *description;
const char *icon_path;
const char *priority_string;
- Bonobo_ActivationProperty *type;
+ OAF_Property *type;
int priority;
GdkPixbuf *icon;
- CORBA_exception_init (&ev);
-
info = & control_list->_buffer[i];
- title = bonobo_server_info_prop_lookup (info, "evolution:config_item:title", language_list);
- description = bonobo_server_info_prop_lookup (info, "evolution:config_item:description", language_list);
- icon_path = bonobo_server_info_prop_lookup (info, "evolution:config_item:icon_name", NULL);
- type = bonobo_server_info_prop_find (info, "evolution:config_item:type");
- priority_string = bonobo_server_info_prop_lookup (info, "evolution:config_item:priority", NULL);
+ title = oaf_server_info_prop_lookup (info, "evolution:config_item:title", language_list);
+ description = oaf_server_info_prop_lookup (info, "evolution:config_item:description", language_list);
+ icon_path = oaf_server_info_prop_lookup (info, "evolution:config_item:icon_name", NULL);
+ type = oaf_server_info_prop_find (info, "evolution:config_item:type");
+ priority_string = oaf_server_info_prop_lookup (info, "evolution:config_item:priority", NULL);
if (icon_path == NULL) {
icon = NULL;
} else {
if (g_path_is_absolute (icon_path)) {
- icon = gdk_pixbuf_new_from_file (icon_path, NULL);
+ icon = gdk_pixbuf_new_from_file (icon_path);
} else {
char *real_icon_path;
- real_icon_path = g_build_filename (EVOLUTION_IMAGES, icon_path, NULL);
- icon = gdk_pixbuf_new_from_file (real_icon_path, NULL);
+ real_icon_path = g_concat_dir_and_file (EVOLUTION_IMAGES, icon_path);
+ icon = gdk_pixbuf_new_from_file (real_icon_path);
g_free (real_icon_path);
}
}
- if (type != NULL && type->v._d != Bonobo_ACTIVATION_P_STRINGV)
+ if (type != NULL && type->v._d != OAF_P_STRINGV)
type = NULL;
if (priority_string == NULL)
priority = 0xffff;
else
priority = atoi (priority_string);
- corba_object = bonobo_activation_activate_from_id ((char *) info->iid, 0, NULL, &ev);
+ corba_object = oaf_activate_from_id ((char *) info->iid, 0, NULL, &ev);
if (! BONOBO_EX (&ev)) {
Page *page;
@@ -229,15 +213,11 @@ load_pages (EShellSettingsDialog *dialog)
page_list = g_list_prepend (page_list, page);
} else {
- char *bonobo_ex_text = bonobo_exception_get_text (&ev);
- g_warning ("Cannot activate %s -- %s", info->iid, bonobo_ex_text);
- g_free (bonobo_ex_text);
+ g_warning ("Cannot activate %s -- %s", info->iid, BONOBO_EX_ID (&ev));
}
if (icon != NULL)
- g_object_unref (icon);
-
- CORBA_exception_free (&ev);
+ gdk_pixbuf_unref (icon);
}
page_list = sort_page_list (page_list);
@@ -253,7 +233,7 @@ load_pages (EShellSettingsDialog *dialog)
page->page_widget);
if (page->type != NULL) {
- Bonobo_StringList list = page->type->v._u.value_stringv;
+ GNOME_stringlist list = page->type->v._u.value_stringv;
for (j = 0; j < list._length; j++) {
if (g_hash_table_lookup (priv->types, list._buffer[j]) == NULL)
@@ -269,6 +249,8 @@ load_pages (EShellSettingsDialog *dialog)
g_list_free (page_list);
e_free_language_list (language_list);
CORBA_free (control_list);
+
+ CORBA_exception_free (&ev);
}
@@ -298,7 +280,7 @@ destroy_type_entry (gpointer key, gpointer value, gpointer data)
}
static void
-impl_finalize (GObject *object)
+impl_destroy (GtkObject *object)
{
EShellSettingsDialog *dialog;
EShellSettingsDialogPrivate *priv;
@@ -311,23 +293,23 @@ impl_finalize (GObject *object)
g_free (priv);
- (* G_OBJECT_CLASS (parent_class)->finalize) (object);
+ (* GTK_OBJECT_CLASS (parent_class)->destroy) (object);
}
static void
class_init (EShellSettingsDialog *class)
{
- GObjectClass *object_class;
+ GtkObjectClass *object_class;
GtkWidgetClass *widget_class;
- object_class = G_OBJECT_CLASS (class);
- object_class->finalize = impl_finalize;
+ object_class = GTK_OBJECT_CLASS (class);
+ object_class->destroy = impl_destroy;
widget_class = GTK_WIDGET_CLASS (class);
widget_class->realize = impl_realize;
- parent_class = g_type_class_ref(PARENT_TYPE);
+ parent_class = gtk_type_class (PARENT_TYPE);
}
static void
@@ -351,7 +333,7 @@ e_shell_settings_dialog_new ()
{
EShellSettingsDialog *new;
- new = g_object_new (e_shell_settings_dialog_get_type (), NULL);
+ new = gtk_type_new (e_shell_settings_dialog_get_type ());
return GTK_WIDGET (new);
}
diff --git a/shell/e-shell-shared-folder-picker-dialog.c b/shell/e-shell-shared-folder-picker-dialog.c
index 191eccbbe3..5e9f245812 100644
--- a/shell/e-shell-shared-folder-picker-dialog.c
+++ b/shell/e-shell-shared-folder-picker-dialog.c
@@ -33,8 +33,11 @@
#include "Evolution-Addressbook-SelectNames.h"
-#include "e-util/e-dialog-utils.h"
+#include <gal/widgets/e-gui-utils.h>
+#include <gal/widgets/e-unicode.h>
+#include <libgnomeui/gnome-stock.h>
+#include <libgnomeui/gnome-dialog.h>
#include <libgnome/gnome-i18n.h>
#include <glade/glade.h>
@@ -42,10 +45,7 @@
#include <bonobo/bonobo-listener.h>
#include <bonobo/bonobo-widget.h>
-#include <bonobo-activation/bonobo-activation.h>
-
#include <gtk/gtk.h>
-#include <gtk/gtksignal.h>
/* Timeout for showing the progress dialog (msecs). */
@@ -89,9 +89,9 @@ user_clicked (GtkWidget *button, GNOME_Evolution_Addressbook_SelectNames corba_i
CORBA_exception_init (&ev);
GNOME_Evolution_Addressbook_SelectNames_activateDialog (corba_iface, "User", &ev);
- if (BONOBO_EX (&ev))
- g_warning ("Cannot activate SelectNames dialog -- %s", BONOBO_EX_REPOID (&ev));
-
+ if (BONOBO_EX (&ev)) {
+ g_warning ("Cannot activate SelectNames dialog -- %s", BONOBO_EX_ID (&ev));
+ }
CORBA_exception_free (&ev);
}
@@ -111,23 +111,23 @@ setup_name_selector (GladeXML *glade_xml,
CORBA_exception_init (&ev);
- corba_iface = bonobo_activation_activate_from_id ("OAFIID:GNOME_Evolution_Addressbook_SelectNames",
- 0, NULL, &ev);
+ corba_iface = oaf_activate_from_id ("OAFIID:GNOME_Evolution_Addressbook_SelectNames",
+ 0, NULL, &ev);
if (corba_iface == CORBA_OBJECT_NIL || BONOBO_EX (&ev)) {
- g_warning ("Cannot activate SelectNames -- %s", BONOBO_EX_REPOID (&ev));
+ g_warning ("Cannot activate SelectNames -- %s", BONOBO_EX_ID (&ev));
CORBA_exception_free (&ev);
return CORBA_OBJECT_NIL;
}
GNOME_Evolution_Addressbook_SelectNames_addSectionWithLimit (corba_iface, "User", "User", 1, &ev);
if (BONOBO_EX (&ev)) {
- g_warning ("Cannot add SelectNames section -- %s", BONOBO_EX_REPOID (&ev));
+ g_warning ("Cannot add SelectNames section -- %s", BONOBO_EX_ID (&ev));
goto err;
}
control = GNOME_Evolution_Addressbook_SelectNames_getEntryBySection (corba_iface, "User", &ev);
if (BONOBO_EX (&ev)) {
- g_warning ("Cannot get SelectNames section -- %s", BONOBO_EX_REPOID (&ev));
+ g_warning ("Cannot get SelectNames section -- %s", BONOBO_EX_ID (&ev));
goto err;
}
@@ -136,7 +136,8 @@ setup_name_selector (GladeXML *glade_xml,
gtk_widget_show (control_widget);
button = glade_xml_get_widget (glade_xml, "button-user");
- g_signal_connect (button, "clicked", G_CALLBACK (user_clicked), corba_iface);
+ gtk_signal_connect (GTK_OBJECT (button), "clicked",
+ user_clicked, corba_iface);
CORBA_exception_free (&ev);
*iface_ret = corba_iface;
@@ -158,20 +159,8 @@ server_option_menu_item_activate_callback (GtkMenuItem *menu_item,
if (*storage_name_return != NULL)
g_free (*storage_name_return);
- *storage_name_return = g_strdup ((const char *) g_object_get_data (G_OBJECT (menu_item), "storage_name"));
-}
-
-static void
-folder_name_entry_changed_callback (GtkEditable *editable,
- void *data)
-{
- GtkDialog *dialog = GTK_DIALOG (data);
- const char *folder_name_text = gtk_entry_get_text (GTK_ENTRY (editable));
-
- if (*folder_name_text == '\0')
- gtk_dialog_set_response_sensitive (dialog, GTK_RESPONSE_OK, FALSE);
- else
- gtk_dialog_set_response_sensitive (dialog, GTK_RESPONSE_OK, TRUE);
+ *storage_name_return = g_strdup ((const char *) gtk_object_get_data (GTK_OBJECT (menu_item),
+ "storage_name"));
}
static void
@@ -201,14 +190,15 @@ setup_server_option_menu (EShell *shell,
storage_name = e_storage_get_name (E_STORAGE (p->data));
- menu_item = gtk_menu_item_new_with_label (storage_name);
- g_signal_connect (menu_item, "activate",
- G_CALLBACK (server_option_menu_item_activate_callback),
- storage_name_return);
- g_object_set_data_full (G_OBJECT (menu_item), "storage_name", g_strdup (storage_name), g_free);
+ menu_item = e_utf8_gtk_menu_item_new_with_label (GTK_MENU (menu), storage_name);
+ gtk_signal_connect (GTK_OBJECT (menu_item), "activate",
+ GTK_SIGNAL_FUNC (server_option_menu_item_activate_callback),
+ storage_name_return);
+ gtk_object_set_data_full (GTK_OBJECT (menu_item), "storage_name",
+ g_strdup (storage_name), g_free);
gtk_widget_show (menu_item);
- gtk_menu_shell_append(GTK_MENU_SHELL(menu), menu_item);
+ gtk_menu_append (GTK_MENU (menu), menu_item);
if (*storage_name_return == NULL)
*storage_name_return = g_strdup (storage_name);
@@ -231,11 +221,10 @@ show_dialog (EShell *shell,
GtkWidget *dialog;
GtkWidget *name_selector_widget;
GtkWidget *folder_name_entry;
- char *user_email_address;
- int response;
+ int button_num;
glade_xml = glade_xml_new (EVOLUTION_GLADEDIR "/e-shell-shared-folder-picker-dialog.glade",
- NULL, NULL);
+ NULL);
g_assert (glade_xml != NULL);
name_selector_widget = setup_name_selector (glade_xml, &corba_iface);
@@ -248,40 +237,22 @@ show_dialog (EShell *shell,
dialog = glade_xml_get_widget (glade_xml, "dialog");
g_assert (dialog != NULL);
- folder_name_entry = glade_xml_get_widget (glade_xml, "folder-name-entry");
+ gnome_dialog_close_hides (GNOME_DIALOG (dialog), TRUE);
- /* Connect the callback to set the OK button insensitive when there is
- no text in the folder_name_entry. Notice that we put a value there
- by default so the OK button is sensitive by default. */
- g_signal_connect (folder_name_entry, "changed",
- G_CALLBACK (folder_name_entry_changed_callback), dialog);
-
- while (TRUE) {
- response = gtk_dialog_run (GTK_DIALOG (dialog));
- if (response == GTK_RESPONSE_CANCEL) {
- g_free (*storage_name_return);
- *storage_name_return = NULL;
- gtk_widget_destroy (dialog);
- bonobo_object_release_unref (corba_iface, NULL);
- return FALSE;
- }
-
- bonobo_widget_get_property (BONOBO_WIDGET (name_selector_widget),
- "addresses", TC_CORBA_string, &user_email_address,
- NULL);
-
- if (user_email_address != NULL && *user_email_address != '\0')
- break;
-
- g_free (user_email_address);
-
- /* It would be nice to insensitivize the OK button appropriately
- instead of doing this, but unfortunately we can't do this for the
- Bonobo control. */
- e_notice (dialog, GTK_MESSAGE_ERROR, _("Please select a user."));
+ button_num = gnome_dialog_run_and_close (GNOME_DIALOG (dialog));
+ if (button_num == 1) { /* Cancel */
+ g_free (*storage_name_return);
+ *storage_name_return = NULL;
+ gtk_widget_destroy (dialog);
+ bonobo_object_release_unref (corba_iface, NULL);
+ return FALSE;
}
- *user_email_address_return = user_email_address;
+ bonobo_widget_get_property (BONOBO_WIDGET (name_selector_widget),
+ "addresses", user_email_address_return,
+ NULL);
+
+ folder_name_entry = glade_xml_get_widget (glade_xml, "folder-name-entry");
*folder_name_return = g_strdup (gtk_entry_get_text (GTK_ENTRY (folder_name_entry)));
gtk_widget_destroy (dialog);
@@ -310,21 +281,29 @@ cleanup_discovery (DiscoveryData *discovery_data)
g_free (discovery_data->user_email_address);
g_free (discovery_data->folder_name);
- g_object_unref (discovery_data->storage);
+ gtk_object_unref (GTK_OBJECT (discovery_data->storage));
g_free (discovery_data);
}
static int
progress_bar_timeout_callback (void *data)
{
- gtk_progress_bar_pulse (GTK_PROGRESS_BAR (data));
+ GtkAdjustment *adjustment;
+ float value;
+
+ adjustment = GTK_PROGRESS (data)->adjustment;
+ value = adjustment->value + 1;
+ if (value > adjustment->upper)
+ value = adjustment->lower;
+
+ gtk_progress_set_value (GTK_PROGRESS (data), value);
return TRUE;
}
static void
-progress_bar_weak_notify (void *data,
- GObject *where_the_object_was)
+progress_bar_destroy_callback (GtkObject *object,
+ void *data)
{
int timeout_id;
@@ -332,10 +311,19 @@ progress_bar_weak_notify (void *data,
g_source_remove (timeout_id);
}
+static int
+progress_dialog_close_callback (GnomeDialog *dialog,
+ void *data)
+{
+ /* Don't allow the dialog to be closed through the window manager close
+ command. */
+ return TRUE;
+}
+
/* This is invoked if the "Cancel" button is clicked. */
static void
-progress_dialog_clicked_callback (GtkDialog *dialog,
- int response,
+progress_dialog_clicked_callback (GnomeDialog *dialog,
+ int button_number,
void *data)
{
DiscoveryData *discovery_data;
@@ -371,37 +359,43 @@ create_progress_dialog (EShell *shell,
int timeout_id;
char *text;
- dialog = gtk_dialog_new_with_buttons (_("Opening Folder"), NULL, 0,
- GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
- NULL);
- gtk_widget_set_size_request (dialog, 300, -1);
- gtk_window_set_resizable (GTK_WINDOW (dialog), FALSE);
+ dialog = gnome_dialog_new (_("Opening Folder"), GNOME_STOCK_BUTTON_CANCEL, NULL);
+ gtk_widget_set_usize (dialog, 300, -1);
+ gtk_window_set_policy (GTK_WINDOW (dialog), FALSE, FALSE, FALSE);
+
+ gtk_signal_connect (GTK_OBJECT (dialog), "close",
+ GTK_SIGNAL_FUNC (progress_dialog_close_callback), NULL);
text = g_strdup_printf (_("Opening Folder \"%s\""), folder_name);
label = gtk_label_new (text);
- gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox), label, FALSE, TRUE, 0);
+ gtk_box_pack_start (GTK_BOX (GNOME_DIALOG (dialog)->vbox), label, FALSE, TRUE, 0);
g_free (text);
text = g_strdup_printf (_("in \"%s\" ..."), e_storage_get_name (storage));
label = gtk_label_new (text);
- gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox), label, FALSE, TRUE, 0);
+ gtk_box_pack_start (GTK_BOX (GNOME_DIALOG (dialog)->vbox), label, FALSE, TRUE, 0);
g_free (text);
progress_bar = gtk_progress_bar_new ();
- gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox), progress_bar, FALSE, TRUE, 0);
+ gtk_progress_set_activity_mode (GTK_PROGRESS (progress_bar), TRUE);
+ gtk_box_pack_start (GTK_BOX (GNOME_DIALOG (dialog)->vbox), progress_bar, FALSE, TRUE, 0);
timeout_id = g_timeout_add (50, progress_bar_timeout_callback, progress_bar);
- g_object_weak_ref (G_OBJECT (progress_bar), progress_bar_weak_notify, GINT_TO_POINTER (timeout_id));
+ gtk_signal_connect (GTK_OBJECT (progress_bar), "destroy",
+ GTK_SIGNAL_FUNC (progress_bar_destroy_callback),
+ GINT_TO_POINTER (timeout_id));
timeout_id = g_timeout_add (PROGRESS_DIALOG_DELAY, progress_dialog_show_timeout_callback, dialog);
- g_object_weak_ref (G_OBJECT (progress_bar), progress_bar_weak_notify, GINT_TO_POINTER (timeout_id));
+ gtk_signal_connect (GTK_OBJECT (progress_bar), "destroy",
+ GTK_SIGNAL_FUNC (progress_bar_destroy_callback),
+ GINT_TO_POINTER (timeout_id));
return dialog;
}
static void
-shell_weak_notify (void *data,
- GObject *where_the_object_was)
+shell_destroy_callback (GtkObject *object,
+ void *data)
{
DiscoveryData *discovery_data;
@@ -410,8 +404,8 @@ shell_weak_notify (void *data,
}
static void
-shell_view_weak_notify (void *data,
- GObject *where_the_object_was)
+shell_view_destroy_callback (GtkObject *object,
+ void *data)
{
DiscoveryData *discovery_data;
@@ -420,8 +414,8 @@ shell_view_weak_notify (void *data,
}
static void
-storage_weak_notify (void *data,
- GObject *where_the_object_was)
+storage_destroy_callback (GtkObject *object,
+ void *data)
{
DiscoveryData *discovery_data;
@@ -461,7 +455,8 @@ shared_folder_discovery_callback (EStorage *storage,
else
e_shell_create_view (shell, uri, NULL);
} else {
- e_notice (parent, GTK_MESSAGE_ERROR,
+ e_notice (parent ? GTK_WINDOW (parent) : NULL,
+ GNOME_MESSAGE_BOX_ERROR,
_("Could not open shared folder: %s."),
e_storage_result_to_string (result));
}
@@ -496,14 +491,19 @@ discover_folder (EShell *shell,
discovery_data->user_email_address = g_strdup (user_email_address);
discovery_data->folder_name = g_strdup (folder_name);
discovery_data->storage = storage;
- g_object_ref (storage);
+ gtk_object_ref (GTK_OBJECT (storage));
+
+ gtk_signal_connect (GTK_OBJECT (shell), "destroy",
+ GTK_SIGNAL_FUNC (shell_destroy_callback), discovery_data);
- g_object_weak_ref (G_OBJECT (shell), shell_weak_notify, discovery_data);
- g_object_weak_ref (G_OBJECT (parent), shell_view_weak_notify, discovery_data);
- g_object_weak_ref (G_OBJECT (storage), storage_weak_notify, discovery_data);
+ gtk_signal_connect (GTK_OBJECT (parent), "destroy",
+ GTK_SIGNAL_FUNC (shell_view_destroy_callback), discovery_data);
- g_signal_connect (dialog, "clicked",
- G_CALLBACK (progress_dialog_clicked_callback), discovery_data);
+ gtk_signal_connect (GTK_OBJECT (storage), "destroy",
+ GTK_SIGNAL_FUNC (storage_destroy_callback), discovery_data);
+
+ gtk_signal_connect (GTK_OBJECT (dialog), "clicked",
+ GTK_SIGNAL_FUNC (progress_dialog_clicked_callback), discovery_data);
e_storage_async_discover_shared_folder (storage,
user_email_address,
@@ -514,7 +514,7 @@ discover_folder (EShell *shell,
error:
/* FIXME: Be more verbose? */
- e_notice (parent, GTK_MESSAGE_ERROR,
+ e_notice (GTK_WINDOW (parent), GNOME_MESSAGE_BOX_ERROR,
_("Cannot find the specified shared folder."));
}
@@ -523,9 +523,9 @@ void
e_shell_show_shared_folder_picker_dialog (EShell *shell,
EShellView *parent)
{
- char *user_email_address = NULL;
- char *storage_name = NULL;
- char *folder_name = NULL;
+ char *user_email_address;
+ char *storage_name;
+ char *folder_name;
g_return_if_fail (E_IS_SHELL (shell));
diff --git a/shell/e-shell-user-creatable-items-handler.c b/shell/e-shell-user-creatable-items-handler.c
index ebd5be0911..53e2bc1731 100644
--- a/shell/e-shell-user-creatable-items-handler.c
+++ b/shell/e-shell-user-creatable-items-handler.c
@@ -35,7 +35,6 @@
#include <gal/util/e-util.h>
#include <bonobo/bonobo-ui-util.h>
-#include <bonobo/bonobo-exception.h>
#include <libgnome/gnome-i18n.h>
@@ -44,11 +43,10 @@
#include <stdlib.h>
#include <ctype.h>
-#include <string.h>
-#define PARENT_TYPE G_TYPE_OBJECT
-static GObjectClass *parent_class = NULL;
+#define PARENT_TYPE gtk_object_get_type ()
+static GtkObjectClass *parent_class = NULL;
#define VERB_PREFIX "ShellUserCreatableItemVerb"
@@ -106,11 +104,11 @@ component_new (const char *id,
new = g_new (Component, 1);
new->component_client = client;
- g_object_ref (client);
+ gtk_object_ref (GTK_OBJECT (client));
CORBA_exception_init (&ev);
- objref = evolution_shell_component_client_corba_objref (client);
+ objref = bonobo_object_corba_objref (BONOBO_OBJECT (client));
new->type_list = GNOME_Evolution_ShellComponent__get_userCreatableItemTypes (objref, &ev);
if (ev._major != CORBA_NO_EXCEPTION)
@@ -124,7 +122,7 @@ component_new (const char *id,
static void
component_free (Component *component)
{
- g_object_unref (component->component_client);
+ gtk_object_unref (GTK_OBJECT (component->component_client));
if (component->type_list != NULL)
CORBA_free (component->type_list);
@@ -248,7 +246,7 @@ free_menu_items (GSList *menu_items)
g_free (item->verb);
if (item->icon != NULL)
- g_object_unref (item->icon);
+ gdk_pixbuf_unref (item->icon);
g_free (item->component_id);
@@ -299,20 +297,24 @@ append_xml_for_menu_item (GString *xml,
char *encoded_tooltip;
encoded_label = bonobo_ui_util_encode_str (item->label);
- g_string_append_printf (xml, "<menuitem name=\"New:%s\" verb=\"%s\" label=\"%s\"",
- item->verb, item->verb, encoded_label);
+ g_string_sprintfa (xml, "<menuitem name=\"New:%s\" verb=\"%s\" label=\"%s\"",
+ item->verb, item->verb, encoded_label);
if (first)
- g_string_append_printf (xml, " accel=\"*Control*N\"");
+ g_string_sprintfa (xml, " accel=\"*Control*N\"");
else if (item->shortcut != '\0')
- g_string_append_printf (xml, " accel=\"*Control**Shift*%c\"", item->shortcut);
-
- if (item->icon != NULL)
- g_string_append_printf (xml, " pixtype=\"pixbuf\" pixname=\"%s\"",
- bonobo_ui_util_pixbuf_to_xml (item->icon));
+ g_string_sprintfa (xml, " accel=\"*Control**Shift*%c\"", item->shortcut);
+
+ if (item->icon != NULL) {
+ char *pixbuf_xml;
+
+ pixbuf_xml = bonobo_ui_util_pixbuf_to_xml (item->icon);
+ g_string_sprintfa (xml, " pixtype=\"pixbuf\" pixname=\"%s\"", pixbuf_xml);
+ g_free (pixbuf_xml);
+ }
encoded_tooltip = bonobo_ui_util_encode_str (item->tooltip);
- g_string_append_printf (xml, " tip=\"%s\"", encoded_tooltip);
+ g_string_sprintfa (xml, " tip=\"%s\"", encoded_tooltip);
g_string_append (xml, "/> ");
@@ -384,8 +386,8 @@ create_menu_xml (EShellUserCreatableItemsHandler *handler,
g_string_append (xml, "<placeholder name=\"EShellUserCreatableItemsPlaceholder\">");
/* 1. Add all the elements that are default for this component. (Note
- that we don't need to do any sorting since the items are already
- sorted alphabetically.) */
+ that we don't need to do any sorting since the items are already
+ sorted alphabetically.) */
if (component_id != NULL) {
gboolean first = TRUE;
@@ -404,8 +406,7 @@ create_menu_xml (EShellUserCreatableItemsHandler *handler,
/* 2. Add a separator. */
if (component_id != NULL)
- g_string_append_printf (xml,
- "<separator f=\"\" name=\"EShellUserCreatableItemsHandlerSeparator\"/>");
+ g_string_sprintfa (xml, "<separator f=\"\" name=\"EShellUserCreatableItemsHandlerSeparator\"/>");
/* 3. Add the elements that are not default for this component. */
@@ -475,14 +476,14 @@ execute_verb (EShellUserCreatableItemsHandler *handler,
CORBA_exception_init (&ev);
GNOME_Evolution_ShellComponent_userCreateNewItem
- (evolution_shell_component_client_corba_objref (component->component_client),
+ (bonobo_object_corba_objref (BONOBO_OBJECT (component->component_client)),
id,
e_safe_corba_string (e_shell_view_get_current_physical_uri (shell_view)),
e_safe_corba_string (e_shell_view_get_current_folder_type (shell_view)),
&ev);
if (ev._major != CORBA_NO_EXCEPTION)
- g_warning ("Error in userCreateNewItem -- %s", BONOBO_EX_REPOID (&ev));
+ g_warning ("Error in userCreateNewItem -- %s", ev._repo_id);
CORBA_exception_free (&ev);
return;
@@ -498,7 +499,7 @@ verb_fn (BonoboUIComponent *ui_component,
EShellUserCreatableItemsHandler *handler;
EShellView *shell_view;
- shell_view = g_object_get_data (G_OBJECT (ui_component), SHELL_VIEW_KEY);
+ shell_view = gtk_object_get_data (GTK_OBJECT (ui_component), SHELL_VIEW_KEY);
g_assert (E_IS_SHELL_VIEW (shell_view));
handler = E_SHELL_USER_CREATABLE_ITEMS_HANDLER (data);
@@ -518,7 +519,7 @@ add_verbs (EShellUserCreatableItemsHandler *handler,
priv = handler->priv;
ui_component = e_shell_view_get_bonobo_ui_component (shell_view);
- g_object_set_data (G_OBJECT (ui_component), SHELL_VIEW_KEY, shell_view);
+ gtk_object_set_data (GTK_OBJECT (ui_component), SHELL_VIEW_KEY, shell_view);
component_num = 0;
for (p = priv->components; p != NULL; p = p->next) {
@@ -582,9 +583,9 @@ setup_toolbar_button (EShellUserCreatableItemsHandler *handler,
e_combo_button_set_label (E_COMBO_BUTTON (combo_button), _("New"));
gtk_widget_show (combo_button);
- g_signal_connect (combo_button, "activate_default",
- G_CALLBACK (combo_button_activate_default_callback),
- shell_view);
+ gtk_signal_connect (GTK_OBJECT (combo_button), "activate_default",
+ GTK_SIGNAL_FUNC (combo_button_activate_default_callback),
+ shell_view);
ui_component = e_shell_view_get_bonobo_ui_component (shell_view);
bonobo_window_add_popup (BONOBO_WINDOW (shell_view), GTK_MENU (menu), "/popups/NewPopup");
@@ -594,10 +595,10 @@ setup_toolbar_button (EShellUserCreatableItemsHandler *handler,
bonobo_ui_component_object_set (ui_component, "/Toolbar/NewComboButton",
BONOBO_OBJREF (control), NULL);
- g_object_set_data (G_OBJECT (shell_view), COMBO_BUTTON_WIDGET_KEY, combo_button);
+ gtk_object_set_data (GTK_OBJECT (shell_view), COMBO_BUTTON_WIDGET_KEY, combo_button);
tooltips = gtk_tooltips_new ();
- g_object_set_data (G_OBJECT (combo_button), TOOLTIPS_KEY, tooltips);
+ gtk_object_set_data (GTK_OBJECT (combo_button), TOOLTIPS_KEY, tooltips);
}
@@ -624,10 +625,10 @@ shell_view_view_changed_callback (EShellView *shell_view,
handler = E_SHELL_USER_CREATABLE_ITEMS_HANDLER (data);
priv = handler->priv;
- combo_button_widget = g_object_get_data (G_OBJECT (shell_view), COMBO_BUTTON_WIDGET_KEY);
+ combo_button_widget = gtk_object_get_data (GTK_OBJECT (shell_view), COMBO_BUTTON_WIDGET_KEY);
g_assert (E_IS_COMBO_BUTTON (combo_button_widget));
- tooltips = g_object_get_data (G_OBJECT (combo_button_widget), TOOLTIPS_KEY);
+ tooltips = gtk_object_get_data (GTK_OBJECT (combo_button_widget), TOOLTIPS_KEY);
g_assert (tooltips != NULL);
default_menu_item = get_default_action_for_view (handler, shell_view);
@@ -657,10 +658,10 @@ shell_view_view_changed_callback (EShellView *shell_view,
}
-/* GObject methods. */
+/* GtkObject methods. */
static void
-impl_dispose (GObject *object)
+impl_destroy (GtkObject *object)
{
EShellUserCreatableItemsHandler *handler;
EShellUserCreatableItemsHandlerPrivate *priv;
@@ -673,35 +674,21 @@ impl_dispose (GObject *object)
component_free ((Component *) p->data);
g_slist_free (priv->components);
- priv->components = NULL;
-
- (* G_OBJECT_CLASS (parent_class)->dispose) (object);
-}
-
-static void
-impl_finalize (GObject *object)
-{
- EShellUserCreatableItemsHandler *handler;
- EShellUserCreatableItemsHandlerPrivate *priv;
-
- handler = E_SHELL_USER_CREATABLE_ITEMS_HANDLER (object);
- priv = handler->priv;
free_menu_items (priv->menu_items);
g_free (priv);
- (* G_OBJECT_CLASS (parent_class)->finalize) (object);
+ (* GTK_OBJECT_CLASS (parent_class)->destroy) (object);
}
static void
-class_init (GObjectClass *object_class)
+class_init (GtkObjectClass *object_class)
{
- parent_class = g_type_class_ref(PARENT_TYPE);
+ parent_class = gtk_type_class (PARENT_TYPE);
- object_class->dispose = impl_dispose;
- object_class->finalize = impl_finalize;
+ object_class->destroy = impl_destroy;
}
static void
@@ -723,7 +710,7 @@ e_shell_user_creatable_items_handler_new (void)
{
EShellUserCreatableItemsHandler *new;
- new = g_object_new (e_shell_user_creatable_items_handler_get_type (), NULL);
+ new = gtk_type_new (e_shell_user_creatable_items_handler_get_type ());
return new;
}
@@ -771,8 +758,8 @@ e_shell_user_creatable_items_handler_attach_menus (EShellUserCreatableItemsHandl
priv = handler->priv;
setup_toolbar_button (handler, shell_view);
- g_signal_connect (shell_view, "view_changed",
- G_CALLBACK (shell_view_view_changed_callback), handler);
+ gtk_signal_connect (GTK_OBJECT (shell_view), "view_changed",
+ GTK_SIGNAL_FUNC (shell_view_view_changed_callback), handler);
add_verbs (handler, shell_view);
menu_xml = create_menu_xml (handler,
diff --git a/shell/e-shortcuts.c b/shell/e-shortcuts.c
index 5def82dcdb..c93af1c166 100644
--- a/shell/e-shortcuts.c
+++ b/shell/e-shortcuts.c
@@ -1,7 +1,7 @@
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
/* e-shortcuts.c
*
- * Copyright (C) 2000, 2001 Ximian, Inc.
+ * Copyright (C) 2000, 2001, 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
@@ -52,19 +52,19 @@
#include <gtk/gtksignal.h>
#include <gtk/gtktypeutils.h>
-#include <libxml/parser.h>
-#include <libxml/xmlmemory.h>
+#include <gnome-xml/parser.h>
+#include <gnome-xml/xmlmemory.h>
+#include <libgnome/gnome-defs.h>
#include <libgnome/gnome-i18n.h>
-
-#include <gal/util/e-xml-utils.h>
#include <gal/util/e-util.h>
+#include <gal/util/e-xml-utils.h>
+#include <gal/widgets/e-unicode.h>
#include <gal/shortcut-bar/e-shortcut-bar.h>
#include "e-shortcuts-view.h"
#include "e-shell-constants.h"
-#include "e-shell-marshal.h"
#define PARENT_TYPE GTK_TYPE_OBJECT
@@ -133,14 +133,12 @@ shortcut_item_new (const char *uri,
{
EShortcutItem *new;
- new = g_new (EShortcutItem, 1);
-
if (name == NULL)
- new->name = g_path_get_basename (uri);
- else
- new->name = g_strdup (name);
+ name = g_basename (uri);
+ new = g_new (EShortcutItem, 1);
new->uri = g_strdup (uri);
+ new->name = g_strdup (name);
new->type = g_strdup (type);
new->custom_icon_name = g_strdup (custom_icon_name);
new->unread_count = unread_count;
@@ -156,11 +154,10 @@ shortcut_item_update (EShortcutItem *shortcut_item,
const char *type,
const char *custom_icon_name)
{
- char *base_name = g_path_get_basename (uri);
gboolean changed = FALSE;
if (name == NULL)
- name = base_name;
+ name = g_basename (uri);
if (shortcut_item->unread_count != unread_count) {
shortcut_item->unread_count = unread_count;
@@ -182,8 +179,6 @@ shortcut_item_update (EShortcutItem *shortcut_item,
#undef UPDATE_STRING
- g_free (base_name);
-
return changed;
}
@@ -242,7 +237,7 @@ update_shortcut_and_emit_signal (EShortcuts *shortcuts,
shortcut_changed = shortcut_item_update (shortcut_item, uri, name, unread_count, type, custom_icon_name);
if (shortcut_changed) {
- g_signal_emit (shortcuts, signals[UPDATE_SHORTCUT], 0, group_num, num);
+ gtk_signal_emit (GTK_OBJECT (shortcuts), signals[UPDATE_SHORTCUT], group_num, num);
return TRUE;
}
@@ -262,7 +257,7 @@ unload_shortcuts (EShortcuts *shortcuts)
for (p = priv->groups; p != NULL; p = p->next) {
ShortcutGroup *group;
- g_signal_emit (shortcuts, signals[REMOVE_GROUP], 0, 0);
+ gtk_signal_emit (GTK_OBJECT (shortcuts), signals[REMOVE_GROUP], 0);
group = (ShortcutGroup *) p->data;
@@ -302,7 +297,7 @@ load_shortcuts (EShortcuts *shortcuts,
unload_shortcuts (shortcuts);
- for (p = root->children; p != NULL; p = p->next) {
+ for (p = root->childs; p != NULL; p = p->next) {
ShortcutGroup *shortcut_group;
xmlChar *shortcut_group_title;
xmlChar *icon_size;
@@ -324,7 +319,7 @@ load_shortcuts (EShortcuts *shortcuts,
shortcut_group->use_small_icons = FALSE;
xmlFree (icon_size);
- for (q = p->children; q != NULL; q = q->next) {
+ for (q = p->childs; q != NULL; q = q->next) {
EShortcutItem *shortcut_item;
xmlChar *uri;
xmlChar *name;
@@ -335,7 +330,7 @@ load_shortcuts (EShortcuts *shortcuts,
if (strcmp ((char *) q->name, "item") != 0)
continue;
- uri = xmlNodeListGetString (doc, q->children, 1);
+ uri = xmlNodeListGetString (doc, q->childs, 1);
if (uri == NULL)
continue;
@@ -369,7 +364,6 @@ load_shortcuts (EShortcuts *shortcuts,
xmlFree (icon);
}
- g_free (path);
xmlFree (uri);
}
@@ -504,15 +498,12 @@ update_shortcuts_by_path (EShortcuts *shortcuts,
EShortcutsPrivate *priv;
EFolder *folder;
const GSList *p, *q;
- char *evolution_uri;
int group_num, num;
gboolean changed = FALSE;
priv = shortcuts->priv;
folder = e_storage_set_get_folder (e_shell_get_storage_set (priv->shell), path);
- evolution_uri = g_strconcat (E_SHELL_URI_PREFIX, path, NULL);
-
group_num = 0;
for (p = priv->groups; p != NULL; p = p->next, group_num++) {
ShortcutGroup *group;
@@ -546,8 +537,6 @@ update_shortcuts_by_path (EShortcuts *shortcuts,
}
}
- g_free (evolution_uri);
-
if (changed)
make_dirty (shortcuts);
}
@@ -585,8 +574,8 @@ get_item (EShortcuts *shortcuts,
/* Signal handlers for the views. */
static void
-view_weak_notify (void *data,
- GObject *where_the_object_was)
+view_destroyed_cb (GtkObject *object,
+ gpointer data)
{
EShortcuts *shortcuts;
EShortcutsPrivate *priv;
@@ -594,7 +583,7 @@ view_weak_notify (void *data,
shortcuts = E_SHORTCUTS (data);
priv = shortcuts->priv;
- priv->views = g_slist_remove (priv->views, where_the_object_was);
+ priv->views = g_slist_remove (priv->views, object);
}
@@ -625,140 +614,112 @@ storage_set_updated_folder_callback (EStorageSet *storage_set,
}
-/* GObject methods. */
+/* GtkObject methods. */
static void
-impl_dispose (GObject *object)
+impl_destroy (GtkObject *object)
{
EShortcuts *shortcuts;
EShortcutsPrivate *priv;
- GSList *p;
shortcuts = E_SHORTCUTS (object);
priv = shortcuts->priv;
+ g_free (priv->file_name);
+
unload_shortcuts (shortcuts);
- if (priv->save_idle_id != 0) {
+ if (priv->save_idle_id != 0)
gtk_idle_remove (priv->save_idle_id);
- priv->save_idle_id = 0;
- }
if (priv->dirty) {
if (! e_shortcuts_save (shortcuts, NULL))
g_warning (_("Error saving shortcuts.")); /* FIXME */
- priv->dirty = FALSE;
}
- for (p = priv->views; p != NULL; p = p->next)
- g_object_weak_unref (G_OBJECT (p->data), view_weak_notify, shortcuts);
- g_slist_free (priv->views);
- priv->views = NULL;
-
- (* G_OBJECT_CLASS (parent_class)->dispose) (object);
-}
-
-static void
-impl_finalize (GObject *object)
-{
- EShortcuts *shortcuts;
- EShortcutsPrivate *priv;
-
- shortcuts = E_SHORTCUTS (object);
- priv = shortcuts->priv;
-
- g_free (priv->file_name);
- g_free (priv);
-
- (* G_OBJECT_CLASS (parent_class)->finalize) (object);
+ (* GTK_OBJECT_CLASS (parent_class)->destroy) (object);
}
static void
class_init (EShortcutsClass *klass)
{
- GObjectClass *object_class;
+ GtkObjectClass *object_class;
- object_class = G_OBJECT_CLASS (klass);
- object_class->dispose = impl_dispose;
- object_class->finalize = impl_finalize;
+ object_class = (GtkObjectClass*) klass;
+ object_class->destroy = impl_destroy;
- parent_class = g_type_class_ref(gtk_object_get_type ());
+ parent_class = gtk_type_class (gtk_object_get_type ());
signals[NEW_GROUP]
- = g_signal_new ("new_group",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_FIRST,
- G_STRUCT_OFFSET (EShortcutsClass, new_group),
- NULL, NULL,
- e_shell_marshal_NONE__INT,
- G_TYPE_NONE, 1,
- G_TYPE_INT);
+ = gtk_signal_new ("new_group",
+ GTK_RUN_FIRST,
+ object_class->type,
+ GTK_SIGNAL_OFFSET (EShortcutsClass, new_group),
+ gtk_marshal_NONE__INT,
+ GTK_TYPE_NONE, 1,
+ GTK_TYPE_INT);
signals[REMOVE_GROUP]
- = g_signal_new ("remove_group",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_FIRST,
- G_STRUCT_OFFSET (EShortcutsClass, remove_group),
- NULL, NULL,
- e_shell_marshal_NONE__INT,
- G_TYPE_NONE, 1,
- G_TYPE_INT);
+ = gtk_signal_new ("remove_group",
+ GTK_RUN_FIRST,
+ object_class->type,
+ GTK_SIGNAL_OFFSET (EShortcutsClass, remove_group),
+ gtk_marshal_NONE__INT,
+ GTK_TYPE_NONE, 1,
+ GTK_TYPE_INT);
signals[RENAME_GROUP]
- = g_signal_new ("rename_group",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_FIRST,
- G_STRUCT_OFFSET (EShortcutsClass, rename_group),
- NULL, NULL,
- e_shell_marshal_NONE__INT_STRING,
- G_TYPE_NONE, 2,
- G_TYPE_INT,
- G_TYPE_STRING);
+ = gtk_signal_new ("rename_group",
+ GTK_RUN_FIRST,
+ object_class->type,
+ GTK_SIGNAL_OFFSET (EShortcutsClass, rename_group),
+ gtk_marshal_NONE__INT_POINTER,
+ GTK_TYPE_NONE, 2,
+ GTK_TYPE_INT,
+ GTK_TYPE_STRING);
signals[GROUP_CHANGE_ICON_SIZE]
- = g_signal_new ("group_change_icon_size",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_FIRST,
- G_STRUCT_OFFSET (EShortcutsClass, group_change_icon_size),
- NULL, NULL,
- e_shell_marshal_NONE__INT_INT,
- G_TYPE_NONE, 2,
- G_TYPE_INT,
- G_TYPE_INT);
+ = gtk_signal_new ("group_change_icon_size",
+ GTK_RUN_FIRST,
+ object_class->type,
+ GTK_SIGNAL_OFFSET (EShortcutsClass, group_change_icon_size),
+ gtk_marshal_NONE__INT_INT,
+ GTK_TYPE_NONE, 2,
+ GTK_TYPE_INT,
+ GTK_TYPE_INT);
signals[NEW_SHORTCUT]
- = g_signal_new ("new_shortcut",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_FIRST,
- G_STRUCT_OFFSET (EShortcutsClass, new_shortcut),
- NULL, NULL,
- e_shell_marshal_NONE__INT_INT,
- G_TYPE_NONE, 2,
- G_TYPE_INT,
- G_TYPE_INT);
+ = gtk_signal_new ("new_shortcut",
+ GTK_RUN_FIRST,
+ object_class->type,
+ GTK_SIGNAL_OFFSET (EShortcutsClass, new_shortcut),
+ gtk_marshal_NONE__INT_INT,
+ GTK_TYPE_NONE, 2,
+ GTK_TYPE_INT,
+ GTK_TYPE_INT);
signals[REMOVE_SHORTCUT]
- = g_signal_new ("remove_shortcut",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_FIRST,
- G_STRUCT_OFFSET (EShortcutsClass, remove_shortcut),
- NULL, NULL,
- e_shell_marshal_NONE__INT_INT,
- G_TYPE_NONE, 2,
- G_TYPE_INT,
- G_TYPE_INT);
+ = gtk_signal_new ("remove_shortcut",
+ GTK_RUN_FIRST,
+ object_class->type,
+ GTK_SIGNAL_OFFSET (EShortcutsClass, remove_shortcut),
+ gtk_marshal_NONE__INT_INT,
+ GTK_TYPE_NONE, 2,
+ GTK_TYPE_INT,
+ GTK_TYPE_INT);
signals[UPDATE_SHORTCUT]
- = g_signal_new ("update_shortcut",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_FIRST,
- G_STRUCT_OFFSET (EShortcutsClass, update_shortcut),
- NULL, NULL,
- e_shell_marshal_NONE__INT_INT,
- G_TYPE_NONE, 2,
- G_TYPE_INT,
- G_TYPE_INT);
+ = gtk_signal_new ("update_shortcut",
+ GTK_RUN_FIRST,
+ object_class->type,
+ GTK_SIGNAL_OFFSET (EShortcutsClass, update_shortcut),
+ gtk_marshal_NONE__INT_INT,
+ GTK_TYPE_NONE, 2,
+ GTK_TYPE_INT,
+ GTK_TYPE_INT);
+
+ gtk_object_class_add_signals (object_class, signals, LAST_SIGNAL);
}
@@ -800,10 +761,12 @@ e_shortcuts_construct (EShortcuts *shortcuts,
storage_set = e_shell_get_storage_set (shell);
- g_signal_connect_object (storage_set, "new_folder",
- G_CALLBACK (storage_set_new_folder_callback), shortcuts, 0);
- g_signal_connect_object (storage_set, "updated_folder",
- G_CALLBACK (storage_set_updated_folder_callback), shortcuts, 0);
+ gtk_signal_connect_while_alive (GTK_OBJECT (storage_set), "new_folder",
+ GTK_SIGNAL_FUNC (storage_set_new_folder_callback),
+ shortcuts, GTK_OBJECT (shortcuts));
+ gtk_signal_connect_while_alive (GTK_OBJECT (storage_set), "updated_folder",
+ GTK_SIGNAL_FUNC (storage_set_updated_folder_callback),
+ shortcuts, GTK_OBJECT (shortcuts));
}
EShortcuts *
@@ -815,7 +778,7 @@ e_shortcuts_new_from_file (EShell *shell,
g_return_val_if_fail (E_IS_SHELL (shell), NULL);
g_return_val_if_fail (file_name != NULL, NULL);
- new = g_object_new (e_shortcuts_get_type (), NULL);
+ new = gtk_type_new (e_shortcuts_get_type ());
e_shortcuts_construct (new, shell);
if (! e_shortcuts_load (new, file_name))
@@ -904,7 +867,7 @@ e_shortcuts_new_view (EShortcuts *shortcuts)
new = e_shortcuts_view_new (shortcuts);
priv->views = g_slist_prepend (priv->views, new);
- g_object_weak_ref (G_OBJECT (new), view_weak_notify, shortcuts);
+ gtk_signal_connect (GTK_OBJECT (new), "destroy", view_destroyed_cb, shortcuts);
return new;
}
@@ -1004,7 +967,7 @@ e_shortcuts_remove_shortcut (EShortcuts *shortcuts,
p = g_slist_nth (group->shortcuts, num);
g_return_if_fail (p != NULL);
- g_signal_emit (shortcuts, signals[REMOVE_SHORTCUT], 0, group_num, num);
+ gtk_signal_emit (GTK_OBJECT (shortcuts), signals[REMOVE_SHORTCUT], group_num, num);
item = (EShortcutItem *) p->data;
shortcut_item_free (item);
@@ -1046,7 +1009,7 @@ e_shortcuts_add_shortcut (EShortcuts *shortcuts,
group->shortcuts = g_slist_insert (group->shortcuts, item, num);
- g_signal_emit (shortcuts, signals[NEW_SHORTCUT], 0, group_num, num);
+ gtk_signal_emit (GTK_OBJECT (shortcuts), signals[NEW_SHORTCUT], group_num, num);
make_dirty (shortcuts);
}
@@ -1079,21 +1042,40 @@ void
e_shortcuts_add_default_shortcuts (EShortcuts *shortcuts,
int group_num)
{
- e_shortcuts_add_shortcut (shortcuts, 0, -1, E_SUMMARY_URI, _("Summary"), 0, "summary", NULL);
+ char *utf;
+
+ utf = e_utf8_from_locale_string (_("Summary"));
+ e_shortcuts_add_shortcut (shortcuts, 0, -1, E_SUMMARY_URI, utf, 0, "summary", NULL);
+ g_free (utf);
- e_shortcuts_add_shortcut (shortcuts, 0, -1, "default:mail", _("Inbox"), 0, "mail", "inbox");
- e_shortcuts_add_shortcut (shortcuts, 0, -1, "default:calendar", _("Calendar"), 0, "calendar", NULL);
- e_shortcuts_add_shortcut (shortcuts, 0, -1, "default:tasks", _("Tasks"), 0, "tasks", NULL);
- e_shortcuts_add_shortcut (shortcuts, 0, -1, "default:contacts", _("Contacts"), 0, "contacts", NULL);
+ utf = e_utf8_from_locale_string (_("Inbox"));
+ e_shortcuts_add_shortcut (shortcuts, 0, -1, "default:mail", utf, 0, "mail", "inbox");
+ g_free (utf);
+
+ utf = e_utf8_from_locale_string (_("Calendar"));
+ e_shortcuts_add_shortcut (shortcuts, 0, -1, "default:calendar", utf, 0, "calendar", NULL);
+ g_free (utf);
+
+ utf = e_utf8_from_locale_string (_("Tasks"));
+ e_shortcuts_add_shortcut (shortcuts, 0, -1, "default:tasks", utf, 0, "tasks", NULL);
+ g_free (utf);
+
+ utf = e_utf8_from_locale_string (_("Contacts"));
+ e_shortcuts_add_shortcut (shortcuts, 0, -1, "default:contacts", utf, 0, "contacts", NULL);
+ g_free (utf);
}
void
e_shortcuts_add_default_group (EShortcuts *shortcuts)
{
+ char *utf;
+
g_return_if_fail (shortcuts != NULL);
g_return_if_fail (E_IS_SHORTCUTS (shortcuts));
- e_shortcuts_add_group (shortcuts, -1, _("Shortcuts"));
+ utf = e_utf8_from_locale_string (_("Shortcuts"));
+ e_shortcuts_add_group (shortcuts, -1, utf);
+ g_free (utf);
e_shortcuts_add_default_shortcuts (shortcuts, -1);
}
@@ -1113,7 +1095,7 @@ e_shortcuts_remove_group (EShortcuts *shortcuts,
p = g_slist_nth (priv->groups, group_num);
g_return_if_fail (p != NULL);
- g_signal_emit (shortcuts, signals[REMOVE_GROUP], 0, group_num);
+ gtk_signal_emit (GTK_OBJECT (shortcuts), signals[REMOVE_GROUP], group_num);
shortcut_group_free ((ShortcutGroup *) p->data);
@@ -1147,7 +1129,7 @@ e_shortcuts_rename_group (EShortcuts *shortcuts,
} else
return;
- g_signal_emit (shortcuts, signals[RENAME_GROUP], 0, group_num, new_title);
+ gtk_signal_emit (GTK_OBJECT (shortcuts), signals[RENAME_GROUP], group_num, new_title);
make_dirty (shortcuts);
}
@@ -1173,7 +1155,7 @@ e_shortcuts_add_group (EShortcuts *shortcuts,
priv->groups = g_slist_insert (priv->groups, group, group_num);
priv->num_groups ++;
- g_signal_emit (shortcuts, signals[NEW_GROUP], 0, group_num);
+ gtk_signal_emit (GTK_OBJECT (shortcuts), signals[NEW_GROUP], group_num);
make_dirty (shortcuts);
}
@@ -1223,7 +1205,8 @@ e_shortcuts_set_group_uses_small_icons (EShortcuts *shortcuts,
use_small_icons = !! use_small_icons;
if (group->use_small_icons != use_small_icons) {
group->use_small_icons = use_small_icons;
- g_signal_emit (shortcuts, signals[GROUP_CHANGE_ICON_SIZE], 0, group_num, use_small_icons);
+ gtk_signal_emit (GTK_OBJECT (shortcuts), signals[GROUP_CHANGE_ICON_SIZE],
+ group_num, use_small_icons);
make_dirty (shortcuts);
}
diff --git a/shell/e-storage-set-view.c b/shell/e-storage-set-view.c
index 735da0ab21..281feb6168 100644
--- a/shell/e-storage-set-view.c
+++ b/shell/e-storage-set-view.c
@@ -33,7 +33,6 @@
#include "e-icon-factory.h"
#include "e-folder-dnd-bridge.h"
#include "e-shell-constants.h"
-#include "e-shell-marshal.h"
#include <gal/util/e-util.h>
#include <gal/widgets/e-gui-utils.h>
@@ -41,16 +40,14 @@
#include <gal/e-table/e-cell-text.h>
#include <gal/e-table/e-cell-toggle.h>
#include <gal/e-table/e-cell-tree.h>
+#include <gal/unicode/gunicode.h>
+#include <glib.h>
+#include <gnome.h>
+#include <libgnome/gnome-defs.h>
#include <libgnome/gnome-util.h>
-#include <libgnomeui/gnome-popup-menu.h>
-
-#include <bonobo/bonobo-window.h>
#include <bonobo/bonobo-ui-util.h>
-
-#include <gtk/gtksignal.h>
-
-#include <string.h>
+#include <libgnome/gnome-util.h>
#include "check-empty.xpm"
#include "check-filled.xpm"
@@ -325,7 +322,7 @@ get_pixbuf_for_folder (EStorageSetView *storage_set_view,
icon_pixbuf_height = gdk_pixbuf_get_height (icon_pixbuf);
if (icon_pixbuf_width == E_SHELL_MINI_ICON_SIZE && icon_pixbuf_height == E_SHELL_MINI_ICON_SIZE) {
- scaled_pixbuf = g_object_ref (icon_pixbuf);
+ scaled_pixbuf = gdk_pixbuf_ref (icon_pixbuf);
} else {
scaled_pixbuf = gdk_pixbuf_new (gdk_pixbuf_get_colorspace (icon_pixbuf),
gdk_pixbuf_get_has_alpha (icon_pixbuf),
@@ -410,8 +407,7 @@ convert_gdk_drag_action_set_to_corba (GdkDragAction action)
/* The weakref callback for priv->ui_component. */
static void
-ui_container_destroy_notify (void *data,
- GObject *where_the_object_was)
+ui_container_destroy_notify (void *data)
{
EStorageSetViewPrivate *priv = (EStorageSetViewPrivate *) data;
@@ -419,6 +415,31 @@ ui_container_destroy_notify (void *data,
}
+/* Custom marshalling function. */
+
+typedef void (* GtkSignal_NONE__GDKDRAGCONTEXT_STRING_STRING_STRING) (GtkObject *object,
+ GdkDragContext *action,
+ const char *,
+ const char *,
+ const char *);
+
+static void
+marshal_NONE__GDKDRAGCONTEXT_STRING_STRING_STRING (GtkObject *object,
+ GtkSignalFunc func,
+ void *func_data,
+ GtkArg *args)
+{
+ GtkSignal_NONE__GDKDRAGCONTEXT_STRING_STRING_STRING rfunc;
+
+ rfunc = (GtkSignal_NONE__GDKDRAGCONTEXT_STRING_STRING_STRING) func;
+ (* rfunc) (object,
+ GTK_VALUE_POINTER (args[0]),
+ GTK_VALUE_STRING (args[1]),
+ GTK_VALUE_STRING (args[2]),
+ GTK_VALUE_STRING (args[3]));
+}
+
+
/* DnD selection setup stuff. */
/* This will create an array of GtkTargetEntries from the specified list of DND
@@ -671,16 +692,16 @@ setup_folder_properties_items_if_corba_storage_clicked (EStorageSetView *storage
item = (const ECorbaStoragePropertyItem *) p->data;
num_property_items ++;
- g_string_append_printf (xml, "<menuitem name=\"EStorageSetView:FolderPropertyItem:%d\"",
- num_property_items);
- g_string_append_printf (xml, " verb=\"EStorageSetView:FolderPropertyItem:%d\"",
- num_property_items);
+ g_string_sprintfa (xml, "<menuitem name=\"EStorageSetView:FolderPropertyItem:%d\"",
+ num_property_items);
+ g_string_sprintfa (xml, " verb=\"EStorageSetView:FolderPropertyItem:%d\"",
+ num_property_items);
encoded_tooltip = bonobo_ui_util_encode_str (item->tooltip);
- g_string_append_printf (xml, " tip=\"%s\"", encoded_tooltip);
+ g_string_sprintfa (xml, " tip=\"%s\"", encoded_tooltip);
encoded_label = bonobo_ui_util_encode_str (item->label);
- g_string_append_printf (xml, " label=\"%s\"/>", encoded_label);
+ g_string_sprintfa (xml, " label=\"%s\"/>", encoded_label);
g_free (encoded_tooltip);
g_free (encoded_label);
@@ -693,8 +714,8 @@ setup_folder_properties_items_if_corba_storage_clicked (EStorageSetView *storage
data->corba_storage = E_CORBA_STORAGE (storage);
data->num_items = num_property_items;
- g_object_ref (data->storage_set_view);
- g_object_ref (data->corba_storage);
+ gtk_object_ref (GTK_OBJECT (data->storage_set_view));
+ gtk_object_ref (GTK_OBJECT (data->corba_storage));
for (i = 1; i <= num_property_items; i ++) {
char *verb;
@@ -742,8 +763,8 @@ remove_property_items (EStorageSetView *storage_set_view,
}
}
- g_object_unref (data->storage_set_view);
- g_object_unref (data->corba_storage);
+ gtk_object_unref (GTK_OBJECT (data->storage_set_view));
+ gtk_object_unref (GTK_OBJECT (data->corba_storage));
g_free (data);
}
@@ -756,13 +777,13 @@ popup_folder_menu (EStorageSetView *storage_set_view,
EStorageSetViewPrivate *priv;
EFolderTypeRegistry *folder_type_registry;
EFolder *folder;
- GtkWidget *menu, *window;
+ GtkWidget *menu;
FolderPropertyItemsData *folder_property_items_data;
priv = storage_set_view->priv;
folder = e_storage_set_get_folder (priv->storage_set, priv->right_click_row_path);
- g_object_ref (folder);
+ gtk_object_ref (GTK_OBJECT (folder));
folder_type_registry = e_storage_set_get_folder_type_registry (priv->storage_set);
g_assert (folder_type_registry != NULL);
@@ -770,10 +791,7 @@ popup_folder_menu (EStorageSetView *storage_set_view,
handler = e_folder_type_registry_get_handler_for_type (folder_type_registry,
e_folder_get_type_string (folder));
menu = gtk_menu_new ();
-
- window = gtk_widget_get_ancestor (GTK_WIDGET (storage_set_view),
- BONOBO_TYPE_WINDOW);
- bonobo_window_add_popup (BONOBO_WINDOW (window),
+ bonobo_window_add_popup (bonobo_ui_container_get_win (priv->ui_container),
GTK_MENU (menu), "/popups/FolderPopup");
bonobo_ui_component_set (priv->ui_component,
@@ -790,8 +808,7 @@ popup_folder_menu (EStorageSetView *storage_set_view,
gtk_widget_show (GTK_WIDGET (menu));
- gnome_popup_menu_do_popup_modal (GTK_WIDGET (menu), NULL, NULL, event, NULL,
- GTK_WIDGET (storage_set_view));
+ gnome_popup_menu_do_popup_modal (GTK_WIDGET (menu), NULL, NULL, event, NULL);
if (folder_property_items_data != NULL)
remove_property_items (storage_set_view, folder_property_items_data);
@@ -802,7 +819,7 @@ popup_folder_menu (EStorageSetView *storage_set_view,
e_folder_get_physical_uri (folder),
e_folder_get_type_string (folder));
- g_object_unref (folder);
+ gtk_object_unref (GTK_OBJECT (folder));
gtk_widget_destroy (GTK_WIDGET (menu));
e_tree_right_click_up (E_TREE (storage_set_view));
@@ -812,14 +829,20 @@ popup_folder_menu (EStorageSetView *storage_set_view,
/* GtkObject methods. */
static void
+path_free_func (gpointer key, gpointer value, gpointer user_data)
+{
+ g_free (key);
+}
+
+static void
pixbuf_free_func (gpointer key, gpointer value, gpointer user_data)
{
g_free (key);
- g_object_unref ((GdkPixbuf*)value);
+ gdk_pixbuf_unref ((GdkPixbuf*)value);
}
static void
-impl_dispose (GObject *object)
+impl_destroy (GtkObject *object)
{
EStorageSetView *storage_set_view;
EStorageSetViewPrivate *priv;
@@ -827,22 +850,27 @@ impl_dispose (GObject *object)
storage_set_view = E_STORAGE_SET_VIEW (object);
priv = storage_set_view->priv;
- if (priv->etree_model != NULL) {
- /* Destroy the tree. */
- e_tree_memory_node_remove (E_TREE_MEMORY(priv->etree_model), priv->root_node);
- g_object_unref (priv->etree_model);
- priv->etree_model = NULL;
+ /* need to destroy our tree */
+ e_tree_memory_node_remove (E_TREE_MEMORY(priv->etree_model), priv->root_node);
+ gtk_object_unref (GTK_OBJECT (priv->etree_model));
- /* (The data in the hash table was all freed by freeing the tree.) */
- g_hash_table_destroy (priv->path_to_etree_node);
- priv->path_to_etree_node = NULL;
- }
+ /* the data in the hash table was all freed by freeing the tree */
+ g_hash_table_foreach (priv->path_to_etree_node, path_free_func, NULL);
+ g_hash_table_destroy (priv->path_to_etree_node);
- if (priv->storage_set != NULL) {
- g_object_unref (priv->storage_set);
- priv->storage_set = NULL;
+ /* now free up all the type_names and pixbufs stored in the
+ hash table and destroy the hash table itself */
+ g_hash_table_foreach (priv->type_name_to_pixbuf, pixbuf_free_func, NULL);
+ g_hash_table_destroy (priv->type_name_to_pixbuf);
+
+ if (priv->checkboxes) {
+ g_hash_table_foreach (priv->checkboxes, (GHFunc) g_free, NULL);
+ g_hash_table_destroy (priv->checkboxes);
+ priv->checkboxes = NULL;
}
+ gtk_object_unref (GTK_OBJECT (priv->storage_set));
+
if (priv->drag_corba_source_interface != CORBA_OBJECT_NIL) {
CORBA_Environment ev;
@@ -858,35 +886,6 @@ impl_dispose (GObject *object)
CORBA_Object_release (priv->drag_corba_source_interface, &ev);
CORBA_exception_free (&ev);
-
- priv->drag_corba_source_interface = CORBA_OBJECT_NIL;
- }
-
- if (priv->ui_component != NULL) {
- bonobo_object_unref (BONOBO_OBJECT (priv->ui_component));
- priv->ui_component = NULL;
- }
-
- /* (No unreffing for priv->ui_container since we use a weakref.) */
-
- (* G_OBJECT_CLASS (parent_class)->dispose) (object);
-}
-
-static void
-impl_finalize (GObject *object)
-{
- EStorageSetView *storage_set_view;
- EStorageSetViewPrivate *priv;
-
- storage_set_view = E_STORAGE_SET_VIEW (object);
- priv = storage_set_view->priv;
-
- g_hash_table_foreach (priv->type_name_to_pixbuf, pixbuf_free_func, NULL);
- g_hash_table_destroy (priv->type_name_to_pixbuf);
-
- if (priv->checkboxes != NULL) {
- g_hash_table_foreach (priv->checkboxes, (GHFunc) g_free, NULL);
- g_hash_table_destroy (priv->checkboxes);
}
if (priv->drag_corba_source_context != NULL)
@@ -895,12 +894,17 @@ impl_finalize (GObject *object)
if (priv->drag_corba_data != NULL)
CORBA_free (priv->drag_corba_data);
+ if (priv->ui_component != NULL)
+ bonobo_object_unref (BONOBO_OBJECT (priv->ui_component));
+
+ /* (No unreffing for priv->ui_container since we use a weakref.) */
+
g_free (priv->selected_row_path);
g_free (priv->right_click_row_path);
g_free (priv);
- (* G_OBJECT_CLASS (parent_class)->finalize) (object);
+ (* GTK_OBJECT_CLASS (parent_class)->destroy) (object);
}
@@ -981,7 +985,7 @@ impl_tree_drag_begin (ETree *etree,
CORBA_exception_init (&ev);
- corba_component = evolution_shell_component_client_corba_objref (component_client);
+ corba_component = bonobo_object_corba_objref (BONOBO_OBJECT (component_client));
priv->drag_corba_source_interface = Bonobo_Unknown_queryInterface (corba_component,
"IDL:GNOME/Evolution/ShellComponentDnd/SourceFolder:1.0",
&ev);
@@ -1098,11 +1102,10 @@ impl_tree_drag_data_get (ETree *etree,
&ev);
if (ev._major != CORBA_NO_EXCEPTION)
- gtk_selection_data_set (selection_data,
- selection_data->target, 8, "", -1);
+ gtk_selection_data_set (selection_data, selection_data->target, 8, "", -1);
else
gtk_selection_data_set (selection_data,
- gdk_atom_intern (priv->drag_corba_data->target, FALSE),
+ priv->drag_corba_data->target,
priv->drag_corba_data->format,
priv->drag_corba_data->bytes._buffer,
priv->drag_corba_data->bytes._length);
@@ -1161,7 +1164,7 @@ impl_tree_drag_motion (ETree *tree,
return FALSE;
folder_path = e_tree_memory_node_get_data (E_TREE_MEMORY (priv->etree_model),
- e_tree_node_at_row (E_TREE (storage_set_view), row));
+ e_tree_node_at_row (E_TREE (storage_set_view), row));
if (folder_path == NULL)
return FALSE;
@@ -1263,11 +1266,14 @@ impl_right_click (ETree *etree,
priv->right_click_row_path = g_strdup (e_tree_memory_node_get_data (E_TREE_MEMORY(priv->etree_model), path));
if (priv->ui_container) {
- g_signal_emit (storage_set_view, signals[FOLDER_CONTEXT_MENU_POPPING_UP], 0, priv->right_click_row_path);
+ gtk_signal_emit (GTK_OBJECT (storage_set_view),
+ signals[FOLDER_CONTEXT_MENU_POPPING_UP],
+ priv->right_click_row_path);
popup_folder_menu (storage_set_view, (GdkEventButton *) event);
- g_signal_emit (storage_set_view, signals[FOLDER_CONTEXT_MENU_POPPED_DOWN], 0);
+ gtk_signal_emit (GTK_OBJECT (storage_set_view),
+ signals[FOLDER_CONTEXT_MENU_POPPED_DOWN]);
}
g_free (priv->right_click_row_path);
@@ -1292,8 +1298,8 @@ impl_cursor_activated (ETree *tree,
if (path) {
priv->selected_row_path = g_strdup (e_tree_memory_node_get_data (E_TREE_MEMORY (priv->etree_model), path));
- g_signal_emit (storage_set_view, signals[FOLDER_SELECTED], 0,
- priv->selected_row_path);
+ gtk_signal_emit (GTK_OBJECT (storage_set_view), signals[FOLDER_SELECTED],
+ priv->selected_row_path);
}
else
priv->selected_row_path = NULL;
@@ -1451,7 +1457,9 @@ etree_value_at (ETreeModel *etree,
name_with_unread = g_strdup_printf ("%s (%d)", folder_name,
unread_count);
- g_object_set_data_full (G_OBJECT (folder), "name_with_unread", name_with_unread, g_free);
+ gtk_object_set_data_full (GTK_OBJECT (folder),
+ "name_with_unread",
+ name_with_unread, g_free);
return (void *) name_with_unread;
} else
@@ -1489,7 +1497,8 @@ etree_fill_in_children (ETreeModel *etree,
parent = e_tree_model_node_get_parent (etree, tree_path);
path = (char *) e_tree_memory_node_get_data (E_TREE_MEMORY(etree), parent);
if (tree_path == e_tree_model_node_get_first_child (etree, parent)) {
- g_signal_emit (storage_set_view, signals[FOLDER_OPENED], 0, path);
+ gtk_signal_emit (GTK_OBJECT (storage_set_view),
+ signals[FOLDER_OPENED], path);
}
}
@@ -1533,7 +1542,8 @@ etree_set_value_at (ETreeModel *etree,
}
e_tree_model_node_col_changed (etree, tree_path, col);
- g_signal_emit (storage_set_view, signals[CHECKBOXES_CHANGED], 0);
+ gtk_signal_emit (GTK_OBJECT (storage_set_view),
+ signals[CHECKBOXES_CHANGED]);
break;
}
}
@@ -1784,14 +1794,13 @@ close_folder_cb (EStorageSet *storage_set,
static void
class_init (EStorageSetViewClass *klass)
{
- GObjectClass *object_class;
+ GtkObjectClass *object_class;
ETreeClass *etree_class;
- parent_class = g_type_class_ref(PARENT_TYPE);
+ parent_class = gtk_type_class (PARENT_TYPE);
- object_class = G_OBJECT_CLASS (klass);
- object_class->dispose = impl_dispose;
- object_class->finalize = impl_finalize;
+ object_class = GTK_OBJECT_CLASS (klass);
+ object_class->destroy = impl_destroy;
etree_class = E_TREE_CLASS (klass);
etree_class->right_click = impl_right_click;
@@ -1807,65 +1816,61 @@ class_init (EStorageSetViewClass *klass)
etree_class->tree_drag_data_received = impl_tree_drag_data_received;
signals[FOLDER_SELECTED]
- = g_signal_new ("folder_selected",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_FIRST,
- G_STRUCT_OFFSET (EStorageSetViewClass, folder_selected),
- NULL, NULL,
- e_shell_marshal_NONE__STRING,
- G_TYPE_NONE, 1,
- G_TYPE_STRING);
+ = gtk_signal_new ("folder_selected",
+ GTK_RUN_FIRST,
+ object_class->type,
+ GTK_SIGNAL_OFFSET (EStorageSetViewClass, folder_selected),
+ gtk_marshal_NONE__STRING,
+ GTK_TYPE_NONE, 1,
+ GTK_TYPE_STRING);
signals[FOLDER_OPENED]
- = g_signal_new ("folder_opened",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_FIRST,
- G_STRUCT_OFFSET (EStorageSetViewClass, folder_opened),
- NULL, NULL,
- e_shell_marshal_NONE__STRING,
- G_TYPE_NONE, 1,
- G_TYPE_STRING);
+ = gtk_signal_new ("folder_opened",
+ GTK_RUN_FIRST,
+ object_class->type,
+ GTK_SIGNAL_OFFSET (EStorageSetViewClass, folder_opened),
+ gtk_marshal_NONE__STRING,
+ GTK_TYPE_NONE, 1,
+ GTK_TYPE_STRING);
signals[DND_ACTION]
- = g_signal_new ("dnd_action",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_FIRST,
- G_STRUCT_OFFSET (EStorageSetViewClass, dnd_action),
- NULL, NULL,
- e_shell_marshal_NONE__POINTER_POINTER_POINTER_POINTER,
- G_TYPE_NONE, 4,
- G_TYPE_POINTER,
- G_TYPE_POINTER,
- G_TYPE_POINTER,
- G_TYPE_POINTER);
+ = gtk_signal_new ("dnd_action",
+ GTK_RUN_FIRST,
+ object_class->type,
+ GTK_SIGNAL_OFFSET (EStorageSetViewClass, dnd_action),
+ marshal_NONE__GDKDRAGCONTEXT_STRING_STRING_STRING,
+ GTK_TYPE_NONE, 4,
+ GTK_TYPE_GDK_DRAG_CONTEXT,
+ GTK_TYPE_STRING,
+ GTK_TYPE_STRING,
+ GTK_TYPE_STRING);
signals[FOLDER_CONTEXT_MENU_POPPING_UP]
- = g_signal_new ("folder_context_menu_popping_up",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_FIRST,
- G_STRUCT_OFFSET (EStorageSetViewClass, folder_context_menu_popping_up),
- NULL, NULL,
- e_shell_marshal_NONE__STRING,
- G_TYPE_NONE, 1,
- G_TYPE_STRING);
+ = gtk_signal_new ("folder_context_menu_popping_up",
+ GTK_RUN_FIRST,
+ object_class->type,
+ GTK_SIGNAL_OFFSET (EStorageSetViewClass, folder_context_menu_popping_up),
+ gtk_marshal_NONE__STRING,
+ GTK_TYPE_NONE, 1,
+ GTK_TYPE_STRING);
signals[FOLDER_CONTEXT_MENU_POPPED_DOWN]
- = g_signal_new ("folder_context_menu_popped_down",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_FIRST,
- G_STRUCT_OFFSET (EStorageSetViewClass, folder_context_menu_popped_down),
- NULL, NULL,
- e_shell_marshal_NONE__NONE,
- G_TYPE_NONE, 0);
+ = gtk_signal_new ("folder_context_menu_popped_down",
+ GTK_RUN_FIRST,
+ object_class->type,
+ GTK_SIGNAL_OFFSET (EStorageSetViewClass, folder_context_menu_popped_down),
+ gtk_marshal_NONE__NONE,
+ GTK_TYPE_NONE, 0);
signals[CHECKBOXES_CHANGED]
- = g_signal_new ("checkboxes_changed",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_FIRST,
- G_STRUCT_OFFSET (EStorageSetViewClass, checkboxes_changed),
- NULL, NULL,
- e_shell_marshal_NONE__NONE,
- G_TYPE_NONE, 0);
+ = gtk_signal_new ("checkboxes_changed",
+ GTK_RUN_FIRST,
+ object_class->type,
+ GTK_SIGNAL_OFFSET (EStorageSetViewClass, checkboxes_changed),
+ gtk_marshal_NONE__NONE,
+ GTK_TYPE_NONE, 0);
+
+ gtk_object_class_add_signals (object_class, signals, LAST_SIGNAL);
checks [0] = gdk_pixbuf_new_from_xpm_data (check_empty_xpm);
checks [1] = gdk_pixbuf_new_from_xpm_data (check_filled_xpm);
@@ -1993,18 +1998,18 @@ setup_folder_changed_callbacks (EStorageSetView *storage_set_view,
folder_changed_callback_data->storage_set_view = storage_set_view;
folder_changed_callback_data->path = g_strdup (path);
- e_signal_connect_while_alive (folder, "name_changed",
- G_CALLBACK (folder_name_changed_cb),
- folder_changed_callback_data,
- storage_set_view);
+ gtk_signal_connect_while_alive (GTK_OBJECT (folder), "name_changed",
+ GTK_SIGNAL_FUNC (folder_name_changed_cb),
+ folder_changed_callback_data,
+ GTK_OBJECT (storage_set_view));
- e_signal_connect_full_while_alive (folder, "changed",
- G_CALLBACK (folder_changed_cb),
- NULL,
- folder_changed_callback_data,
- folder_changed_callback_data_destroy_notify,
- FALSE, FALSE,
- storage_set_view);
+ e_gtk_signal_connect_full_while_alive (GTK_OBJECT (folder), "changed",
+ GTK_SIGNAL_FUNC (folder_changed_cb),
+ NULL,
+ folder_changed_callback_data,
+ folder_changed_callback_data_destroy_notify,
+ FALSE, FALSE,
+ GTK_OBJECT (storage_set_view));
}
@@ -2107,12 +2112,11 @@ e_storage_set_view_construct (EStorageSetView *storage_set_view,
priv->ui_container = ui_container;
if (ui_container != NULL) {
- g_object_weak_ref (G_OBJECT (ui_container), ui_container_destroy_notify, priv);
+ gtk_object_weakref (GTK_OBJECT (ui_container), ui_container_destroy_notify, priv);
priv->ui_component = bonobo_ui_component_new_default ();
bonobo_ui_component_set_container (priv->ui_component,
- bonobo_object_corba_objref (BONOBO_OBJECT (ui_container)),
- NULL);
+ bonobo_object_corba_objref (BONOBO_OBJECT (ui_container)));
}
priv->etree_model = e_tree_memory_callbacks_new (etree_icon_at,
@@ -2146,7 +2150,7 @@ e_storage_set_view_construct (EStorageSetView *storage_set_view,
extras = e_table_extras_new ();
cell = e_cell_text_new (NULL, GTK_JUSTIFY_LEFT);
- g_object_set((cell), "bold_column", 1, NULL);
+ gtk_object_set (GTK_OBJECT (cell), "bold_column", 1, NULL);
e_table_extras_add_cell (extras, "render_tree",
e_cell_tree_new (NULL, NULL, TRUE, cell));
@@ -2158,21 +2162,35 @@ e_storage_set_view_construct (EStorageSetView *storage_set_view,
e_tree_root_node_set_visible (E_TREE(storage_set_view), FALSE);
- g_object_unref (extras);
+ gtk_object_unref (GTK_OBJECT (extras));
- g_object_ref (storage_set);
+ gtk_object_ref (GTK_OBJECT (storage_set));
priv->storage_set = storage_set;
e_tree_drag_dest_set (E_TREE (storage_set_view), 0, NULL, 0, GDK_ACTION_MOVE | GDK_ACTION_COPY);
- g_signal_connect_object (storage_set, "new_storage", G_CALLBACK (new_storage_cb), storage_set_view, 0);
- g_signal_connect_object (storage_set, "removed_storage", G_CALLBACK (removed_storage_cb), storage_set_view, 0);
- g_signal_connect_object (storage_set, "new_folder", G_CALLBACK (new_folder_cb), storage_set_view, 0);
- g_signal_connect_object (storage_set, "updated_folder", G_CALLBACK (updated_folder_cb), storage_set_view, 0);
- g_signal_connect_object (storage_set, "removed_folder", G_CALLBACK (removed_folder_cb), storage_set_view, 0);
- g_signal_connect_object (storage_set, "close_folder", G_CALLBACK (close_folder_cb), storage_set_view, 0);
-
- g_signal_connect_object (priv->etree_model, "fill_in_children", G_CALLBACK (etree_fill_in_children), storage_set_view, 0);
+ gtk_signal_connect_while_alive (GTK_OBJECT (storage_set), "new_storage",
+ GTK_SIGNAL_FUNC (new_storage_cb), storage_set_view,
+ GTK_OBJECT (storage_set_view));
+ gtk_signal_connect_while_alive (GTK_OBJECT (storage_set), "removed_storage",
+ GTK_SIGNAL_FUNC (removed_storage_cb), storage_set_view,
+ GTK_OBJECT (storage_set_view));
+ gtk_signal_connect_while_alive (GTK_OBJECT (storage_set), "new_folder",
+ GTK_SIGNAL_FUNC (new_folder_cb), storage_set_view,
+ GTK_OBJECT (storage_set_view));
+ gtk_signal_connect_while_alive (GTK_OBJECT (storage_set), "updated_folder",
+ GTK_SIGNAL_FUNC (updated_folder_cb), storage_set_view,
+ GTK_OBJECT (storage_set_view));
+ gtk_signal_connect_while_alive (GTK_OBJECT (storage_set), "removed_folder",
+ GTK_SIGNAL_FUNC (removed_folder_cb), storage_set_view,
+ GTK_OBJECT (storage_set_view));
+ gtk_signal_connect_while_alive (GTK_OBJECT (storage_set), "close_folder",
+ GTK_SIGNAL_FUNC (close_folder_cb), storage_set_view,
+ GTK_OBJECT (storage_set_view));
+
+ gtk_signal_connect_while_alive (GTK_OBJECT (priv->etree_model), "fill_in_children",
+ GTK_SIGNAL_FUNC (etree_fill_in_children), storage_set_view,
+ GTK_OBJECT (storage_set_view));
insert_storages (storage_set_view);
}
@@ -2186,7 +2204,7 @@ e_storage_set_view_new (EStorageSet *storage_set,
g_return_val_if_fail (E_IS_STORAGE_SET (storage_set), NULL);
- new = g_object_new (e_storage_set_view_get_type (), NULL);
+ new = gtk_type_new (e_storage_set_view_get_type ());
e_storage_set_view_construct (E_STORAGE_SET_VIEW (new), storage_set, ui_container);
@@ -2228,7 +2246,7 @@ e_storage_set_view_set_current_folder (EStorageSetView *storage_set_view,
g_free (priv->selected_row_path);
priv->selected_row_path = g_strdup (path);
- g_signal_emit (storage_set_view, signals[FOLDER_SELECTED], 0, path);
+ gtk_signal_emit (GTK_OBJECT (storage_set_view), signals[FOLDER_SELECTED], path);
}
const char *
@@ -2324,6 +2342,8 @@ e_storage_set_view_set_show_checkboxes (EStorageSetView *storage_set_view,
state->columns [0] = 1;
e_tree_set_state_object (E_TREE (storage_set_view), state);
+ gtk_object_unref (GTK_OBJECT (state));
+
priv->has_checkbox_func = has_checkbox_func;
priv->has_checkbox_func_data = func_data;
}
@@ -2355,7 +2375,7 @@ e_storage_set_view_enable_search (EStorageSetView *storage_set_view,
void
e_storage_set_view_set_checkboxes_list (EStorageSetView *storage_set_view,
- GSList *checkboxes)
+ GList *checkboxes)
{
gboolean changed = FALSE;
EStorageSetViewPrivate *priv = storage_set_view->priv;
@@ -2369,7 +2389,7 @@ e_storage_set_view_set_checkboxes_list (EStorageSetView *storage_set_view,
if (checkboxes) {
priv->checkboxes = g_hash_table_new (g_str_hash, g_str_equal);
- for (; checkboxes; checkboxes = g_slist_next (checkboxes)) {
+ for (; checkboxes; checkboxes = g_list_next (checkboxes)) {
char *path = checkboxes->data;
if (g_hash_table_lookup (priv->checkboxes, path))
@@ -2392,22 +2412,21 @@ essv_add_to_list (gpointer key,
gpointer value,
gpointer user_data)
{
- GSList **list = user_data;
+ GList **list = user_data;
- *list = g_slist_prepend (*list, g_strdup (key));
+ *list = g_list_prepend (*list, g_strdup (key));
}
-GSList *
+GList *
e_storage_set_view_get_checkboxes_list (EStorageSetView *storage_set_view)
{
- GSList *list = NULL;
+ GList *list = NULL;
if (storage_set_view->priv->checkboxes) {
g_hash_table_foreach (storage_set_view->priv->checkboxes, essv_add_to_list, &list);
- list = g_slist_reverse (list);
+ list = g_list_reverse (list);
}
-
return list;
}
diff --git a/shell/e-storage.c b/shell/e-storage.c
index 1f54ee5afa..2f6ec935e5 100644
--- a/shell/e-storage.c
+++ b/shell/e-storage.c
@@ -32,22 +32,20 @@
#include "e-folder-tree.h"
#include "e-shell-constants.h"
-#include "e-shell-marshal.h"
#include <gtk/gtkobject.h>
#include <gtk/gtksignal.h>
+#include <libgnome/gnome-defs.h>
#include <libgnome/gnome-i18n.h>
#include <gal/util/e-util.h>
-#include <string.h>
-
#define PARENT_TYPE GTK_TYPE_OBJECT
static GtkObjectClass *parent_class = NULL;
#define ES_CLASS(obj) \
- E_STORAGE_CLASS (GTK_OBJECT_GET_CLASS (obj))
+ E_STORAGE_CLASS (GTK_OBJECT (obj)->klass)
struct _EStoragePrivate {
/* The set of folders we have in this storage. */
@@ -64,6 +62,7 @@ enum {
NEW_FOLDER,
UPDATED_FOLDER,
REMOVED_FOLDER,
+ CLOSE_FOLDER,
LAST_SIGNAL
};
@@ -86,7 +85,7 @@ folder_destroy_notify (EFolderTree *tree,
}
e_folder = E_FOLDER (data);
- g_object_unref (e_folder);
+ gtk_object_unref (GTK_OBJECT (e_folder));
}
@@ -109,12 +108,13 @@ folder_changed_cb (EFolder *folder,
path = e_folder_tree_get_path_for_data (priv->folder_tree, folder);
g_assert (path != NULL);
- g_signal_emit (storage, signals[UPDATED_FOLDER], 0, path);
+ gtk_signal_emit (GTK_OBJECT (storage), signals[UPDATED_FOLDER], path);
- highlight = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (folder), "last_highlight"));
+ highlight = GPOINTER_TO_INT (gtk_object_get_data (GTK_OBJECT (folder), "last_highlight"));
if (highlight != e_folder_get_highlighted (folder)) {
highlight = !highlight;
- g_object_set_data (G_OBJECT (folder), "last_highlight", GINT_TO_POINTER (highlight));
+ gtk_object_set_data (GTK_OBJECT (folder), "last_highlight",
+ GINT_TO_POINTER (highlight));
p = strrchr (path, '/');
if (p && p != path) {
char *name;
@@ -129,7 +129,7 @@ folder_changed_cb (EFolder *folder,
}
-/* GObject methods. */
+/* GtkObject methods. */
static void
free_folder (gpointer path, gpointer folder, gpointer user_data)
@@ -139,7 +139,7 @@ free_folder (gpointer path, gpointer folder, gpointer user_data)
}
static void
-impl_finalize (GObject *object)
+destroy (GtkObject *object)
{
EStorage *storage;
EStoragePrivate *priv;
@@ -156,9 +156,7 @@ impl_finalize (GObject *object)
g_free (priv->name);
- g_free (priv);
-
- (* G_OBJECT_CLASS (parent_class)->finalize) (object);
+ (* GTK_OBJECT_CLASS (parent_class)->destroy) (object);
}
@@ -228,11 +226,9 @@ impl_async_xfer_folder (EStorage *storage,
static void
impl_async_open_folder (EStorage *storage,
- const char *path,
- EStorageDiscoveryCallback callback,
- void *data)
+ const char *path)
{
- (*callback) (storage, E_STORAGE_NOTIMPLEMENTED, path, data);
+ ;
}
static gboolean
@@ -266,12 +262,12 @@ impl_async_remove_shared_folder (EStorage *storage,
static void
class_init (EStorageClass *class)
{
- GObjectClass *object_class;
+ GtkObjectClass *object_class;
- object_class = G_OBJECT_CLASS (class);
- parent_class = g_type_class_ref(gtk_object_get_type ());
+ object_class = GTK_OBJECT_CLASS (class);
+ parent_class = gtk_type_class (gtk_object_get_type ());
- object_class->finalize = impl_finalize;
+ object_class->destroy = destroy;
class->get_subfolder_paths = impl_get_subfolder_paths;
class->get_folder = impl_get_folder;
@@ -286,32 +282,39 @@ class_init (EStorageClass *class)
class->async_remove_shared_folder = impl_async_remove_shared_folder;
signals[NEW_FOLDER] =
- g_signal_new ("new_folder",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_FIRST,
- G_STRUCT_OFFSET (EStorageClass, new_folder),
- NULL, NULL,
- e_shell_marshal_NONE__STRING,
- G_TYPE_NONE, 1,
- G_TYPE_STRING);
+ gtk_signal_new ("new_folder",
+ GTK_RUN_FIRST,
+ object_class->type,
+ GTK_SIGNAL_OFFSET (EStorageClass, new_folder),
+ gtk_marshal_NONE__STRING,
+ GTK_TYPE_NONE, 1,
+ GTK_TYPE_STRING);
signals[UPDATED_FOLDER] =
- g_signal_new ("updated_folder",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_FIRST,
- G_STRUCT_OFFSET (EStorageClass, updated_folder),
- NULL, NULL,
- e_shell_marshal_NONE__STRING,
- G_TYPE_NONE, 1,
- G_TYPE_STRING);
+ gtk_signal_new ("updated_folder",
+ GTK_RUN_FIRST,
+ object_class->type,
+ GTK_SIGNAL_OFFSET (EStorageClass, updated_folder),
+ gtk_marshal_NONE__STRING,
+ GTK_TYPE_NONE, 1,
+ GTK_TYPE_STRING);
signals[REMOVED_FOLDER] =
- g_signal_new ("removed_folder",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_FIRST,
- G_STRUCT_OFFSET (EStorageClass, removed_folder),
- NULL, NULL,
- e_shell_marshal_NONE__STRING,
- G_TYPE_NONE, 1,
- G_TYPE_STRING);
+ gtk_signal_new ("removed_folder",
+ GTK_RUN_FIRST,
+ object_class->type,
+ GTK_SIGNAL_OFFSET (EStorageClass, removed_folder),
+ gtk_marshal_NONE__STRING,
+ GTK_TYPE_NONE, 1,
+ GTK_TYPE_STRING);
+ signals[CLOSE_FOLDER] =
+ gtk_signal_new ("close_folder",
+ GTK_RUN_FIRST,
+ object_class->type,
+ GTK_SIGNAL_OFFSET (EStorageClass, close_folder),
+ gtk_marshal_NONE__STRING,
+ GTK_TYPE_NONE, 1,
+ GTK_TYPE_STRING);
+
+ gtk_object_class_add_signals (object_class, signals, LAST_SIGNAL);
}
static void
@@ -356,7 +359,7 @@ e_storage_new (const char *name,
{
EStorage *new;
- new = g_object_new (e_storage_get_type (), NULL);
+ new = gtk_type_new (e_storage_get_type ());
e_storage_construct (new, name, root_folder);
@@ -490,21 +493,17 @@ e_storage_async_xfer_folder (EStorage *storage,
void
e_storage_async_open_folder (EStorage *storage,
- const char *path,
- EStorageDiscoveryCallback callback,
- void *data)
+ const char *path)
{
g_return_if_fail (storage != NULL);
g_return_if_fail (E_IS_STORAGE (storage));
g_return_if_fail (path != NULL);
g_return_if_fail (g_path_is_absolute (path));
- if (g_hash_table_lookup (storage->priv->pseudofolders, path) == NULL) {
- (* callback) (storage, E_STORAGE_OK, path, data);
+ if (g_hash_table_lookup (storage->priv->pseudofolders, path) == NULL)
return;
- }
- (* ES_CLASS (storage)->async_open_folder) (storage, path, callback, data);
+ (* ES_CLASS (storage)->async_open_folder) (storage, path);
}
@@ -711,30 +710,26 @@ e_storage_new_folder (EStorage *storage,
}
g_free (parent_path);
- g_signal_connect_object (e_folder, "changed", G_CALLBACK (folder_changed_cb), storage, 0);
+ gtk_signal_connect_while_alive (GTK_OBJECT (e_folder), "changed", folder_changed_cb,
+ storage, GTK_OBJECT (storage));
- g_signal_emit (storage, signals[NEW_FOLDER], 0, path);
+ gtk_signal_emit (GTK_OBJECT (storage), signals[NEW_FOLDER], path);
folder_changed_cb (e_folder, storage);
return TRUE;
}
-/* This really should be called e_storage_set_has_subfolders, but then
- * it would look like it was an EStorageSet function. (Fact o' the
- * day: The word "set" has more distinct meanings than any other word
- * in the English language.) Anyway, we now return you to your
- * regularly scheduled source code, already in progress.
- */
gboolean
-e_storage_declare_has_subfolders (EStorage *storage,
- const char *path,
- const char *message)
+e_storage_has_subfolders (EStorage *storage,
+ const char *path,
+ const char *message)
{
EStoragePrivate *priv;
GList *subfolders, *f;
EFolder *pseudofolder;
char *pseudofolder_path;
+ gboolean retval;
g_return_val_if_fail (storage != NULL, FALSE);
g_return_val_if_fail (E_IS_STORAGE (storage), FALSE);
@@ -744,6 +739,8 @@ e_storage_declare_has_subfolders (EStorage *storage,
priv = storage->priv;
+ gtk_signal_emit (GTK_OBJECT (storage), signals[CLOSE_FOLDER], path);
+
if (g_hash_table_lookup (priv->pseudofolders, path))
return TRUE;
@@ -764,23 +761,10 @@ e_storage_declare_has_subfolders (EStorage *storage,
g_hash_table_insert (priv->pseudofolders, g_strdup (path), pseudofolder);
- return e_storage_new_folder (storage, pseudofolder_path, pseudofolder);
-}
-
-gboolean
-e_storage_get_has_subfolders (EStorage *storage,
- const char *path)
-{
- EStoragePrivate *priv;
-
- g_return_val_if_fail (storage != NULL, FALSE);
- g_return_val_if_fail (E_IS_STORAGE (storage), FALSE);
- g_return_val_if_fail (path != NULL, FALSE);
- g_return_val_if_fail (g_path_is_absolute (path), FALSE);
-
- priv = storage->priv;
+ retval = e_storage_new_folder (storage, pseudofolder_path, pseudofolder);
+ g_free (pseudofolder_path);
- return g_hash_table_lookup (priv->pseudofolders, path) != NULL;
+ return retval;
}
gboolean
@@ -816,7 +800,7 @@ e_storage_removed_folder (EStorage *storage,
g_free (parent_path);
}
- g_signal_emit (storage, signals[REMOVED_FOLDER], 0, path);
+ gtk_signal_emit (GTK_OBJECT (storage), signals[REMOVED_FOLDER], path);
e_folder_tree_remove (priv->folder_tree, path);
diff --git a/shell/main.c b/shell/main.c
index 8aa3b9b79a..5ffc020d38 100644
--- a/shell/main.c
+++ b/shell/main.c
@@ -1,7 +1,7 @@
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
/* main.c
*
- * Copyright (C) 2000, 2001, 2002, 2003 Ximian, Inc.
+ * Copyright (C) 2000 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
@@ -21,18 +21,9 @@
*/
#include <config.h>
-
-#include "e-util/e-dialog-utils.h"
-#include "e-util/e-gtk-utils.h"
-
-#include "e-icon-factory.h"
-#include "e-shell-constants.h"
-#include "e-shell-config.h"
-#include "e-setup.h"
-
-#include "e-shell.h"
-
-#include <gconf/gconf-client.h>
+#include <fcntl.h>
+#include <glib.h>
+#include <stdio.h>
#include <gtk/gtkalignment.h>
#include <gtk/gtkframe.h>
@@ -40,42 +31,39 @@
#include <gtk/gtkmain.h>
#include <gtk/gtksignal.h>
#include <gtk/gtkwindow.h>
-#include <gtk/gtkdialog.h>
-#include <gtk/gtkstock.h>
#include <gdk/gdkx.h>
#include <X11/Xlib.h>
+#include <libgnome/gnome-defs.h>
#include <libgnome/gnome-i18n.h>
#include <libgnome/gnome-util.h>
-#include <libgnomeui/gnome-ui-init.h>
+#include <libgnomeui/gnome-init.h>
+#include <libgnomeui/gnome-stock.h>
#include <libgnomeui/gnome-window-icon.h>
-
#include <bonobo/bonobo-main.h>
#include <bonobo/bonobo-moniker-util.h>
#include <bonobo/bonobo-exception.h>
-
-#include <bonobo-activation/bonobo-activation.h>
-
#include <glade/glade.h>
-
-#include "e-config-upgrade.h"
-#include "Evolution-Wombat.h"
+#include <liboaf/liboaf.h>
#ifdef GTKHTML_HAVE_GCONF
#include <gconf/gconf.h>
#endif
+#include <gal/widgets/e-gui-utils.h>
#include <gal/widgets/e-cursors.h>
-#include <fcntl.h>
-#include <signal.h>
-#include <string.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <unistd.h>
+#include "Evolution-Wombat.h"
+
+#include "e-util/e-gtk-utils.h"
+
+#include "e-icon-factory.h"
+#include "e-shell-constants.h"
+#include "e-shell-config.h"
+#include "e-setup.h"
-#include <pthread.h>
+#include "e-shell.h"
static EShell *shell = NULL;
@@ -98,11 +86,11 @@ quit_box_new (void)
GtkWidget *frame;
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
- gtk_window_set_resizable (GTK_WINDOW (window), FALSE);
+ gtk_window_set_policy (GTK_WINDOW (window), FALSE, FALSE, FALSE);
gtk_window_set_position (GTK_WINDOW (window), GTK_WIN_POS_CENTER);
/* (Just to prevent smart-ass window managers like Sawfish from setting
- the make the dialog as big as the standard Evolution window). */
+ the make the dialog as big as the standard Evolution window). */
gtk_window_set_wmclass (GTK_WINDOW (window), "evolution-quit", "Evolution:quit");
e_make_widget_backing_stored (window);
@@ -139,12 +127,22 @@ quit_box_new (void)
}
static void
+quit_box_destroyed_callback (GtkObject *object,
+ void *data)
+{
+ GtkWidget **p;
+
+ p = (GtkWidget **) data;
+ *p = NULL;
+}
+
+static void
no_views_left_cb (EShell *shell, gpointer data)
{
GtkWidget *quit_box;
quit_box = quit_box_new ();
- g_object_add_weak_pointer (G_OBJECT (quit_box), (void **) &quit_box);
+ gtk_signal_connect (GTK_OBJECT (quit_box), "destroy", quit_box_destroyed_callback, &quit_box);
/* FIXME: This is wrong. We should exit only when the shell is
destroyed. But refcounting is broken at present, so this is a
@@ -152,19 +150,41 @@ no_views_left_cb (EShell *shell, gpointer data)
e_shell_unregister_all (shell);
+ /* FIXME: And this is another ugly hack. We have a strange race
+ condition that I cannot work around. What happens is that the
+ EShell object gets unreffed and its aggregate EActivityHandler gets
+ destroyed too. But for some reason, the EActivityHanlder GtkObject
+ gets freed, while its CORBA object counterpart is still an active
+ server. So there is a slight chance that we receive CORBA
+ invocation that act on an uninitialized object, and we crash. (See
+ #8615.)
+
+ The CORBA invocation on the dead object only happens because we
+ ::unref the BonoboConf database server in the ::destroy method of
+ the shell. Since this is a CORBA call, it allows incoming CORBA
+ calls to happen -- and these get invoked on the partially
+ uninitialized object.
+
+ Since I am not 100% sure what the reason for this half-stale object
+ is, I am just going to make sure that no CORBA ops happen in
+ ::destroy... And this is achieved by placing this call here. (If
+ the DB is disconnected, there will be no ::unref of it in
+ ::destroy.) */
+
+ e_shell_disconnect_db (shell);
+
bonobo_object_unref (BONOBO_OBJECT (shell));
if (quit_box != NULL)
gtk_widget_destroy (quit_box);
- bonobo_main_quit ();
+ gtk_main_quit ();
}
static void
-shell_weak_notify (void *data,
- GObject *where_the_object_was)
+destroy_cb (GtkObject *object, gpointer data)
{
- bonobo_main_quit ();
+ gtk_main_quit ();
}
@@ -173,8 +193,8 @@ kill_wombat (void)
{
g_print ("(Killing old version of Wombat...)\n");
- system (KILL_PROCESS_CMD " -9 lt-evolution-wombat 2> /dev/null");
- system (KILL_PROCESS_CMD " -9 evolution-wombat 2> /dev/null");
+ system (KILL_PROCESS_CMD " -9 lt-wombat 2> /dev/null");
+ system (KILL_PROCESS_CMD " -9 wombat 2> /dev/null");
}
static void
@@ -186,7 +206,7 @@ kill_old_wombat (void)
CORBA_exception_init (&ev);
- iface = bonobo_activation_activate_from_id ("OAFIID:GNOME_Evolution_Wombat_InterfaceCheck", 0, NULL, &ev);
+ iface = bonobo_get_object ("wombat:", "GNOME/Evolution/WombatInterfaceCheck", &ev);
if (BONOBO_EX (&ev) || iface == CORBA_OBJECT_NIL) {
kill_wombat ();
CORBA_exception_free (&ev);
@@ -196,7 +216,7 @@ kill_old_wombat (void)
version = GNOME_Evolution_WombatInterfaceCheck__get_interfaceVersion (iface, &ev);
if (BONOBO_EX (&ev)) {
kill_wombat ();
- CORBA_Object_release (iface, &ev);
+ bonobo_object_release_unref (iface, &ev);
CORBA_exception_free (&ev);
return;
}
@@ -204,131 +224,56 @@ kill_old_wombat (void)
if (strcmp (version, VERSION) != 0) {
CORBA_free (version);
kill_wombat ();
- CORBA_Object_release (iface, &ev);
+ bonobo_object_release_unref (iface, &ev);
CORBA_exception_free (&ev);
return;
}
CORBA_free (version);
- CORBA_Object_release (iface, &ev);
+
+ bonobo_object_release_unref (iface, &ev);
+
CORBA_exception_free (&ev);
}
-/* Warning dialog to scare people off a little bit. */
-
static void
-warning_dialog_response_callback (GtkDialog *dialog,
- int button_number,
- void *data)
+upgrade_from_1_0_if_needed (void)
{
- GtkCheckButton *dont_bother_me_again_checkbox;
- GConfClient *client;
-
- dont_bother_me_again_checkbox = GTK_CHECK_BUTTON (data);
-
- client = gconf_client_get_default ();
- gconf_client_set_bool (client, "/apps/evolution/shell/skip_warning_dialog",
- gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (dont_bother_me_again_checkbox)),
- NULL);
- g_object_unref (client);
+ Bonobo_ConfigDatabase config_db;
+ CORBA_Environment ev;
+ int result;
- gtk_widget_destroy (GTK_WIDGET (dialog));
-}
+ CORBA_exception_init (&ev);
-static void
-show_development_warning (GtkWindow *parent)
-{
- GtkWidget *label;
- GtkWidget *warning_dialog;
- GtkWidget *dont_bother_me_again_checkbox;
- GtkWidget *alignment;
- GConfClient *client;
- char *text;
+ config_db = bonobo_get_object ("wombat:", "Bonobo/ConfigDatabase", &ev);
+ if (BONOBO_EX (&ev) || config_db == CORBA_OBJECT_NIL) {
+ g_print ("(Cannot access Bonobo/ConfigDatabase, not upgrading configuration.)\n");
+ if (BONOBO_EX (&ev))
+ g_print ("\t%s\n", BONOBO_EX_ID (&ev));
+ CORBA_exception_free (&ev);
+ return;
+ }
- client = gconf_client_get_default ();
+ CORBA_exception_free (&ev);
- if (gconf_client_get_bool (client, "/apps/evolution/shell/skip_warning_dialog", NULL)) {
- g_object_unref (client);
+ if (! force_upgrade
+ && bonobo_config_get_boolean_with_default (config_db, "/Shell/upgrade_from_1_0_to_1_2_performed",
+ FALSE, NULL))
return;
- }
-
- g_object_unref (client);
-
- warning_dialog = gtk_dialog_new_with_buttons("Ximian Evolution " VERSION, parent,
- GTK_DIALOG_MODAL|GTK_DIALOG_DESTROY_WITH_PARENT,
- GTK_STOCK_OK, GTK_RESPONSE_OK, NULL);
- text = g_strdup_printf(
- /* xgettext:no-c-format */
- /* Preview/Alpha/Beta version warning message */
- _("Hi. Thanks for taking the time to download this preview release\n"
- "of the Ximian Evolution groupware suite.\n"
- "\n"
- "This version of Ximian Evolution is not yet complete. It is getting close,\n"
- "but some features are either unfinished or do not work properly.\n"
- "\n"
- "If you want a stable version of Evolution, we urge you to uninstall\n"
- "this version, and install version %s instead.\n"
- "\n"
- "If you find bugs, please report them to us at bugzilla.ximian.com.\n"
- "This product comes with no warranty and is not intended for\n"
- "individuals prone to violent fits of anger.\n"
- "\n"
- "We hope that you enjoy the results of our hard work, and we\n"
- "eagerly await your contributions!\n"),
- "1.2.x (1.2.2)");
- label = gtk_label_new (text);
- g_free(text);
-
- gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT);
-
- gtk_box_pack_start (GTK_BOX (GTK_DIALOG (warning_dialog)->vbox),
- label, TRUE, TRUE, 4);
-
- label = gtk_label_new (_("Thanks\n"
- "The Ximian Evolution Team\n"));
- gtk_label_set_justify(GTK_LABEL(label), GTK_JUSTIFY_RIGHT);
- gtk_misc_set_alignment(GTK_MISC(label), 1, .5);
-
- gtk_box_pack_start (GTK_BOX (GTK_DIALOG (warning_dialog)->vbox),
- label, TRUE, TRUE, 0);
-
- dont_bother_me_again_checkbox = gtk_check_button_new_with_label (_("Don't tell me again"));
-
- /* GTK sucks. (Just so you know.) */
- alignment = gtk_alignment_new (0.0, 0.0, 0.0, 0.0);
-
- gtk_container_add (GTK_CONTAINER (alignment), dont_bother_me_again_checkbox);
- gtk_box_pack_start (GTK_BOX (GTK_DIALOG (warning_dialog)->vbox),
- alignment, FALSE, FALSE, 0);
-
- gtk_widget_show_all (warning_dialog);
-
- g_signal_connect (warning_dialog, "response",
- G_CALLBACK (warning_dialog_response_callback),
- dont_bother_me_again_checkbox);
-}
-/* The following signal handlers are used to display the development warning as
- soon as the first view is created. */
+ g_print ("\nOlder configuration files detected, upgrading...\n");
-static void
-view_map_callback (GtkWidget *widget,
- void *data)
-{
- g_signal_handlers_disconnect_by_func (widget, G_CALLBACK (view_map_callback), data);
+ result = system (PREFIX "/bin/evolution-mail-upgrade");
- show_development_warning (GTK_WINDOW (widget));
-}
+ if (result == 0)
+ g_print ("\n--> Configuration files upgraded from version 1.0.\n");
+ else
+ g_print ("\n*** Error upgrading configuration files -- status %d\n", result);
-static void
-new_view_created_callback (EShell *shell,
- EShellView *view,
- void *data)
-{
- g_signal_handlers_disconnect_by_func (shell, G_CALLBACK (new_view_created_callback), data);
+ bonobo_config_set_boolean (config_db, "/Shell/upgrade_from_1_0_to_1_2_performed", TRUE, NULL);
- g_signal_connect (view, "map", G_CALLBACK (view_map_callback), NULL);
+ bonobo_object_release_unref (config_db, NULL);
}
@@ -349,6 +294,8 @@ idle_cb (void *data)
kill_old_wombat ();
+ upgrade_from_1_0_if_needed ();
+
CORBA_exception_init (&ev);
uri_list = (GSList *) data;
@@ -367,41 +314,37 @@ idle_cb (void *data)
case E_SHELL_CONSTRUCT_RESULT_OK:
e_shell_config_factory_register (shell);
- g_signal_connect (shell, "no_views_left", G_CALLBACK (no_views_left_cb), NULL);
- g_object_weak_ref (G_OBJECT (shell), shell_weak_notify, NULL);
-
- if (!getenv ("EVOLVE_ME_HARDER"))
- g_signal_connect (shell, "new_view_created",
- G_CALLBACK (new_view_created_callback), NULL);
+ gtk_signal_connect (GTK_OBJECT (shell), "no_views_left",
+ GTK_SIGNAL_FUNC (no_views_left_cb), NULL);
+ gtk_signal_connect (GTK_OBJECT (shell), "destroy",
+ GTK_SIGNAL_FUNC (destroy_cb), NULL);
corba_shell = bonobo_object_corba_objref (BONOBO_OBJECT (shell));
corba_shell = CORBA_Object_duplicate (corba_shell, &ev);
break;
case E_SHELL_CONSTRUCT_RESULT_CANNOTREGISTER:
- corba_shell = bonobo_activation_activate_from_id (E_SHELL_OAFIID, 0, NULL, &ev);
+ corba_shell = oaf_activate_from_id (E_SHELL_OAFIID, 0, NULL, &ev);
if (ev._major != CORBA_NO_EXCEPTION || corba_shell == CORBA_OBJECT_NIL) {
- e_notice (NULL, GTK_MESSAGE_ERROR,
+ e_notice (NULL, GNOME_MESSAGE_BOX_ERROR,
_("Cannot access the Ximian Evolution shell."));
CORBA_exception_free (&ev);
- bonobo_main_quit ();
+ gtk_main_quit ();
return FALSE;
}
break;
default:
- e_notice (NULL, GTK_MESSAGE_ERROR,
+ e_notice (NULL, GNOME_MESSAGE_BOX_ERROR,
_("Cannot initialize the Ximian Evolution shell: %s"),
e_shell_construct_result_to_string (result));
CORBA_exception_free (&ev);
- bonobo_main_quit ();
+ gtk_main_quit ();
return FALSE;
}
have_evolution_uri = FALSE;
- displayed_any = FALSE;
-
for (p = uri_list; p != NULL; p = p->next) {
const char *uri;
@@ -412,25 +355,30 @@ idle_cb (void *data)
}
if (shell == NULL) {
- /* We're talking to a remote shell. If the user didn't ask us to open any particular
- URI, then open another view of the default URI. */
+ /* We're talking to a remote shell. If the user didn't
+ * ask us to open any particular URI, then open another
+ * view of the default URI
+ */
if (uri_list == NULL)
display_default = TRUE;
else
display_default = FALSE;
} else {
- /* We're starting a new shell. If the user didn't specify any evolution: URIs to
- view, AND we can't load the user's previous settings, then show the default
- URI. */
+ /* We're starting a new shell. If the user didn't specify
+ * any evolution: URIs to view, AND we can't load the
+ * user's previous settings, then show the default URI.
+ */
if (! have_evolution_uri) {
- e_shell_create_view (shell, NULL, NULL);
- display_default = TRUE;
- displayed_any = TRUE;
+ if (! e_shell_restore_from_settings (shell, FALSE))
+ display_default = TRUE;
+ else
+ display_default = FALSE;
} else {
display_default = FALSE;
}
}
+ displayed_any = FALSE;
for (p = uri_list; p != NULL; p = p->next) {
const char *uri;
@@ -439,8 +387,7 @@ idle_cb (void *data)
if (ev._major == CORBA_NO_EXCEPTION)
displayed_any = TRUE;
else {
- g_warning ("CORBA exception %s when requesting URI -- %s",
- BONOBO_EX_REPOID (&ev), uri);
+ g_warning ("CORBA exception %s when requesting URI -- %s", ev._repo_id, uri);
CORBA_exception_free (&ev);
}
}
@@ -453,7 +400,7 @@ idle_cb (void *data)
uri = E_SHELL_VIEW_DEFAULT_URI;
GNOME_Evolution_Shell_handleURI (corba_shell, uri, &ev);
if (ev._major != CORBA_NO_EXCEPTION)
- g_warning ("CORBA exception %s when requesting URI -- %s", BONOBO_EX_REPOID (&ev), uri);
+ g_warning ("CORBA exception %s when requesting URI -- %s", ev._repo_id, uri);
}
CORBA_Object_release (corba_shell, &ev);
@@ -461,63 +408,11 @@ idle_cb (void *data)
CORBA_exception_free (&ev);
if (shell == NULL)
- bonobo_main_quit ();
+ gtk_main_quit ();
return FALSE;
}
-
-/* SIGSEGV handling.
-
- The GNOME SEGV handler will lose if it's not run from the main Gtk
- thread. So if we have to redirect the signal if the crash happens in another
- thread. */
-
-static void (*gnome_segv_handler) (int);
-static GStaticMutex segv_mutex = G_STATIC_MUTEX_INIT;
-static pthread_t main_thread;
-
-static void
-segv_redirect (int sig)
-{
- if (pthread_self () == main_thread)
- gnome_segv_handler (sig);
- else {
- pthread_kill (main_thread, sig);
-
- /* We can't return from the signal handler or the thread may
- SEGV again. But we can't pthread_exit, because then the
- thread may get cleaned up before bug-buddy can get a stack
- trace. So we block by trying to lock a mutex we know is
- already locked. */
- g_static_mutex_lock (&segv_mutex);
- }
-}
-
-static void
-setup_segv_redirect (void)
-{
- struct sigaction sa, osa;
-
- sigaction (SIGSEGV, NULL, &osa);
- if (osa.sa_handler == SIG_DFL)
- return;
-
- main_thread = pthread_self ();
-
- sa.sa_flags = 0;
- sigemptyset (&sa.sa_mask);
- sa.sa_handler = segv_redirect;
- sigaction (SIGSEGV, &sa, NULL);
- sigaction (SIGBUS, &sa, NULL);
- sigaction (SIGFPE, &sa, NULL);
-
- sa.sa_handler = SIG_IGN;
- sigaction (SIGXFSZ, &sa, NULL);
- gnome_segv_handler = osa.sa_handler;
- g_static_mutex_lock (&segv_mutex);
-}
-
int
main (int argc, char **argv)
{
@@ -530,31 +425,23 @@ main (int argc, char **argv)
N_("Start in online mode"), NULL },
{ "debug", '\0', POPT_ARG_STRING, &evolution_debug_log, 0,
N_("Send the debugging output of all components to a file."), NULL },
-#if 0
{ "force-upgrade", '\0', POPT_ARG_NONE, &force_upgrade, 0,
N_("Force upgrading of configuration files from Evolution 1.0.x"), NULL },
-#endif
+ { NULL, '\0', POPT_ARG_INCLUDE_TABLE, &oaf_popt_options, 0, NULL, NULL },
POPT_AUTOHELP
{ NULL, '\0', 0, NULL, 0, NULL, NULL }
};
GSList *uri_list;
- GValue popt_context_value = { 0, };
- GnomeProgram *program;
- poptContext popt_context;
const char **args;
+ poptContext popt_context;
+
+ bindtextdomain (PACKAGE, EVOLUTION_LOCALEDIR);
+ textdomain (PACKAGE);
/* Make ElectricFence work. */
free (malloc (10));
- bindtextdomain (GETTEXT_PACKAGE, EVOLUTION_LOCALEDIR);
- bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
- textdomain (GETTEXT_PACKAGE);
-
- program = gnome_program_init (PACKAGE, VERSION, LIBGNOMEUI_MODULE, argc, argv,
- GNOME_PROGRAM_STANDARD_PROPERTIES,
- GNOME_PARAM_POPT_TABLE, options,
- GNOME_PARAM_HUMAN_READABLE_NAME, _("Evolution"),
- NULL);
+ gnome_init_with_popt_table ("Evolution", VERSION " [" SUB_VERSION "]", argc, argv, options, 0, &popt_context);
if (start_online && start_offline) {
fprintf (stderr, _("%s: --online and --offline cannot be used together.\n Use %s --help for more information.\n"),
@@ -562,8 +449,6 @@ main (int argc, char **argv)
exit (1);
}
- setup_segv_redirect ();
-
if (evolution_debug_log) {
int fd;
@@ -576,23 +461,32 @@ main (int argc, char **argv)
g_warning ("Could not set up debugging output file.");
}
- glade_init ();
+ oaf_init (argc, argv);
+
+#ifdef GTKHTML_HAVE_GCONF
+ gconf_init (argc, argv, NULL);
+#endif
+
+ glade_gnome_init ();
e_cursors_init ();
e_icon_factory_init ();
gnome_window_icon_set_default_from_file (EVOLUTION_IMAGES "/evolution-inbox.png");
+ if (! bonobo_init (CORBA_OBJECT_NIL, CORBA_OBJECT_NIL, CORBA_OBJECT_NIL)) {
+ e_notice (NULL, GNOME_MESSAGE_BOX_ERROR,
+ _("Cannot initialize the Bonobo component system."));
+ exit (1);
+ }
+
/* FIXME */
- evolution_directory = g_build_filename (g_get_home_dir (), "evolution", NULL);
+ evolution_directory = g_concat_dir_and_file (g_get_home_dir (), "evolution");
if (! e_setup (evolution_directory))
exit (1);
uri_list = NULL;
- g_value_init (&popt_context_value, G_TYPE_POINTER);
- g_object_get_property (G_OBJECT (program), GNOME_PARAM_POPT_CONTEXT, &popt_context_value);
- popt_context = g_value_get_pointer (&popt_context_value);
args = poptGetArgs (popt_context);
if (args != NULL) {
const char **p;
@@ -600,13 +494,12 @@ main (int argc, char **argv)
for (p = args; *p != NULL; p++)
uri_list = g_slist_prepend (uri_list, (char *) *p);
}
- uri_list = g_slist_reverse (uri_list);
- g_value_unset (&popt_context_value);
-
- e_config_upgrade(evolution_directory);
gtk_idle_add (idle_cb, uri_list);
+ gtk_widget_push_visual (gdk_rgb_get_visual ());
+ gtk_widget_push_colormap (gdk_rgb_get_cmap ());
+
bonobo_main ();
return 0;
diff --git a/tools/Makefile.am b/tools/Makefile.am
index 5687cc174b..7ea0e47099 100644
--- a/tools/Makefile.am
+++ b/tools/Makefile.am
@@ -1,12 +1,10 @@
-toolsdir = $(privdatadir)/tools
-
-tools_SCRIPTS = \
+bin_SCRIPTS = \
csv2vcard \
evolution-move-tasks \
evolution-addressbook-clean \
killev
-tools_PROGRAMS = \
+bin_PROGRAMS = \
evolution-addressbook-import \
evolution-addressbook-export \
evolution-launch-composer
@@ -17,59 +15,69 @@ INCLUDES = \
-DG_LOG_DOMAIN=\"evolution-tools\" \
-I$(top_srcdir) \
-I$(top_builddir) \
+ -DEVOLUTION_BINDIR=\""$(bindir)"\" \
-DEVOLUTION_LOCALEDIR=\""$(localedir)"\" \
- -DPREFIX=\""$(prefix)"\" \
- -DSYSCONFDIR=\""$(sysconfdir)"\" \
- -DDATADIR=\""$(datadir)"\" \
- -DLIBDIR=\""$(libdir)"\" \
-I$(top_srcdir)/addressbook \
-I$(top_srcdir)/addressbook/backend \
-I$(top_builddir)/addressbook/backend \
- -DG_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED \
$(GNOME_FULL_CFLAGS)
-EXTRA_DIST = $(tools_SCRIPTS) verify-evolution-install.sh \
- evolution-addressbook-clean.in
-
-CORBA_SOURCE = \
+CORBA_SOURCE = \
Evolution-Composer.h \
Evolution-Composer-common.c \
Evolution-Composer-skels.c \
Evolution-Composer-stubs.c
-BUILT_SOURCES = $(CORBA_SOURCE)
+idls = \
+ $(top_srcdir)/composer/Evolution-Composer.idl
-idls = \
- $(top_srcdir)/composer/Evolution-Composer.idl
+idl_flags = `$(GNOME_CONFIG) --cflags idl` -I $(datadir)/idl
$(CORBA_SOURCE): $(idls)
- $(ORBIT_IDL) -I $(srcdir) $(IDL_INCLUDES) $(idls)
+ $(ORBIT_IDL) -I $(srcdir) $(idls) $(idl_flags)
+
+BUILT_SOURCES = $(CORBA_SOURCE)
+
+dist-hook:
+ cd $(distdir); rm -f $(BUILT_SOURCES)
+
+EXTRA_DIST = $(bin_SCRIPTS) verify-evolution-install.sh \
+ evolution-addressbook-clean.in
+
+evolution_launch_composer_SOURCES = \
+ $(CORBA_SOURCE) \
+ evolution-launch-composer.c
+
+evolution_launch_composer_LDADD = \
+ $(GNOME_FULL_LIBS) \
+ $(top_builddir)/addressbook/backend/ebook/libebook.la \
+ $(top_builddir)/camel/libcamel.la \
+ $(top_builddir)/e-util/ename/libename.la \
+ $(top_builddir)/libversit/libversit.a \
+ $(top_builddir)/e-util/libeutil.la \
+ $(top_builddir)/widgets/menus/libmenus.la
+
evolution_addressbook_import_LDADD = \
$(GNOME_FULL_LIBS) \
$(top_builddir)/addressbook/backend/ebook/libebook.la \
+ $(top_builddir)/camel/libcamel.la \
+ $(top_builddir)/e-util/ename/libename.la \
+ $(top_builddir)/libversit/libversit.a \
+ $(top_builddir)/e-util/libeutil.la \
$(top_builddir)/widgets/menus/libmenus.la
-evolution_addressbook_export_LDADD = \
+evolution_addressbook_export_LDADD = \
$(evolution_addressbook_import_LDADD)
-evolution_addressbook_abuse_LDADD = \
+evolution_addressbook_abuse_LDADD = \
$(evolution_addressbook_import_LDADD)
-evolution_launch_composer_SOURCES = \
- $(CORBA_SOURCE) \
- evolution-launch-composer.c
-
-evolution_launch_composer_LDADD = \
- $(GNOME_FULL_LIBS) \
- $(top_builddir)/addressbook/backend/ebook/libebook.la \
- $(top_builddir)/widgets/menus/libmenus.la
-
-CLEANFILES = evolution-addressbook-clean $(BUILD_SOURCES)
+CLEANFILES = evolution-addressbook-clean $(BUILT_SOURCES)
evolution-addressbook-clean: evolution-addressbook-clean.in Makefile
## Use sed and then mv to avoid problems if the user interrupts.
- sed -e 's?\@EVOLUTION_TOOLSDIR\@?$(toolsdir)?g' \
+ sed -e 's?\@EVOLUTION_BINDIR\@?$(bindir)?g' \
< $(srcdir)/evolution-addressbook-clean.in > evolution-addressbook-clean.tmp \
&& mv evolution-addressbook-clean.tmp evolution-addressbook-clean
diff --git a/tools/evolution-launch-composer.c b/tools/evolution-launch-composer.c
index 8c89dbe480..834ba2ff15 100644
--- a/tools/evolution-launch-composer.c
+++ b/tools/evolution-launch-composer.c
@@ -24,16 +24,16 @@
#include <config.h>
#include <Evolution-Composer.h>
-
-#include <string.h>
+#include <bonobo/bonobo-object-client.h>
+#include <popt.h>
#include <gal/util/e-util.h>
-#include <bonobo-activation/bonobo-activation.h>
+#include <gal/util/e-i18n.h>
+#include <liboaf/liboaf.h>
#include <gtk/gtkmain.h>
#include <bonobo/bonobo-main.h>
-#include <libgnome/gnome-i18n.h>
-#include <libgnomeui/gnome-ui-init.h>
+#include <libgnomeui/gnome-init.h>
#include <libgnomevfs/gnome-vfs-ops.h>
#include <libgnomevfs/gnome-vfs-uri.h>
@@ -48,13 +48,13 @@
#define NOTNULL(x) ((x) ? (x) : "")
typedef struct {
- char *filename;
- char *basename;
- char *content;
- int size;
- char *description;
- char *content_type;
- gboolean show_inline;
+ char *filename;
+ char *basename;
+ char *content;
+ int size;
+ char *description;
+ char *content_type;
+ gboolean show_inline;
} attachment_t;
GList *attachments; /* Of type attachment_t */
@@ -64,196 +64,194 @@ char *subject;
static void
free_attachment (attachment_t *attachment)
{
- g_free (attachment->content);
- g_free (attachment->filename);
- g_free (attachment->basename);
- g_free (attachment->content_type);
- g_free (attachment->description);
- g_free (attachment);
+ g_free (attachment->content);
+ g_free (attachment->filename);
+ g_free (attachment->basename);
+ g_free (attachment->content_type);
+ g_free (attachment->description);
+ g_free (attachment);
}
-static GnomeVFSResult
+GnomeVFSResult
elc_read_entire_file (const char *uri,
- int *file_size,
- char **file_contents,
- char **content_type)
+ int *file_size,
+ char **file_contents,
+ char **content_type)
{
- GnomeVFSResult result;
- GnomeVFSHandle *handle;
- char *buffer;
- GnomeVFSFileSize total_bytes_read;
- GnomeVFSFileSize bytes_read;
-
- *file_size = 0;
- *file_contents = NULL;
-
- /* Open the file. */
- result = gnome_vfs_open (&handle, uri, GNOME_VFS_OPEN_READ);
- if (result != GNOME_VFS_OK) {
- return result;
- }
-
- /* Read the whole thing. */
- buffer = NULL;
- total_bytes_read = 0;
- do {
- buffer = g_realloc (buffer, total_bytes_read + READ_CHUNK_SIZE);
- result = gnome_vfs_read (handle,
- buffer + total_bytes_read,
- READ_CHUNK_SIZE,
- &bytes_read);
- if (result != GNOME_VFS_OK && result != GNOME_VFS_ERROR_EOF) {
- g_free (buffer);
- gnome_vfs_close (handle);
- return result;
- }
-
- /* Check for overflow. */
- if (total_bytes_read + bytes_read < total_bytes_read) {
- g_free (buffer);
- gnome_vfs_close (handle);
- return GNOME_VFS_ERROR_TOO_BIG;
- }
-
- total_bytes_read += bytes_read;
- } while (result == GNOME_VFS_OK);
-
- if (content_type) {
- GnomeVFSFileInfo *info;
-
- info = gnome_vfs_file_info_new ();
- result = gnome_vfs_get_file_info_from_handle (handle, info,
- GNOME_VFS_FILE_INFO_GET_MIME_TYPE |
- GNOME_VFS_FILE_INFO_FOLLOW_LINKS);
- if (result == GNOME_VFS_OK)
- *content_type = g_strdup (gnome_vfs_file_info_get_mime_type (info));
- else
- *content_type = g_strdup ("application/octet-stream");
-
- gnome_vfs_file_info_unref (info);
- }
-
- /* Close the file. */
- result = gnome_vfs_close (handle);
- if (result != GNOME_VFS_OK) {
- g_free (buffer);
- return result;
- }
-
- /* Return the file. */
- *file_size = total_bytes_read;
- *file_contents = g_realloc (buffer, total_bytes_read);
- return GNOME_VFS_OK;
+ GnomeVFSResult result;
+ GnomeVFSHandle *handle;
+ char *buffer;
+ GnomeVFSFileSize total_bytes_read;
+ GnomeVFSFileSize bytes_read;
+
+ *file_size = 0;
+ *file_contents = NULL;
+
+ /* Open the file. */
+ result = gnome_vfs_open (&handle, uri, GNOME_VFS_OPEN_READ);
+ if (result != GNOME_VFS_OK) {
+ return result;
+ }
+
+ /* Read the whole thing. */
+ buffer = NULL;
+ total_bytes_read = 0;
+ do {
+ buffer = g_realloc (buffer, total_bytes_read + READ_CHUNK_SIZE);
+ result = gnome_vfs_read (handle,
+ buffer + total_bytes_read,
+ READ_CHUNK_SIZE,
+ &bytes_read);
+ if (result != GNOME_VFS_OK && result != GNOME_VFS_ERROR_EOF) {
+ g_free (buffer);
+ gnome_vfs_close (handle);
+ return result;
+ }
+
+ /* Check for overflow. */
+ if (total_bytes_read + bytes_read < total_bytes_read) {
+ g_free (buffer);
+ gnome_vfs_close (handle);
+ return GNOME_VFS_ERROR_TOO_BIG;
+ }
+
+ total_bytes_read += bytes_read;
+ } while (result == GNOME_VFS_OK);
+
+ if (content_type) {
+ GnomeVFSFileInfo *info;
+
+ info = gnome_vfs_file_info_new ();
+ result = gnome_vfs_get_file_info_from_handle (handle, info,
+ GNOME_VFS_FILE_INFO_GET_MIME_TYPE |
+ GNOME_VFS_FILE_INFO_FOLLOW_LINKS);
+ if (result == GNOME_VFS_OK)
+ *content_type = g_strdup (gnome_vfs_file_info_get_mime_type (info));
+ else
+ *content_type = g_strdup ("application/octet-stream");
+
+ gnome_vfs_file_info_unref (info);
+ }
+
+ /* Close the file. */
+ result = gnome_vfs_close (handle);
+ if (result != GNOME_VFS_OK) {
+ g_free (buffer);
+ return result;
+ }
+
+ /* Return the file. */
+ *file_size = total_bytes_read;
+ *file_contents = g_realloc (buffer, total_bytes_read);
+ return GNOME_VFS_OK;
}
static void
-do_send (GNOME_Evolution_Composer composer_server)
+do_send (BonoboObjectClient *bonobo_server)
{
- CORBA_Environment ev;
+ GNOME_Evolution_Composer composer_server;
+ CORBA_Environment ev;
+
+ GNOME_Evolution_Composer_AttachmentData *attach_data;
- GNOME_Evolution_Composer_AttachmentData *attach_data;
+ GNOME_Evolution_Composer_RecipientList *to_list, *cc_list, *bcc_list;
- GNOME_Evolution_Composer_RecipientList *to_list, *cc_list, *bcc_list;
+ composer_server = bonobo_object_corba_objref (BONOBO_OBJECT (bonobo_server));
- CORBA_exception_init (&ev);
+ CORBA_exception_init (&ev);
- attachments = g_list_reverse (attachments);
+ attachments = g_list_reverse (attachments);
- while (attachments) {
- attachment_t *attachment = attachments->data;
- GList *temp;
+ while (attachments) {
+ attachment_t *attachment = attachments->data;
+ GList *temp;
- attach_data = GNOME_Evolution_Composer_AttachmentData__alloc();
- attach_data->_maximum = attach_data->_length = attachment->size;
- attach_data->_buffer = CORBA_sequence_CORBA_char_allocbuf (attach_data->_length);
- strcpy (attach_data->_buffer, attachment->content);
+ attach_data = GNOME_Evolution_Composer_AttachmentData__alloc();
+ attach_data->_maximum = attach_data->_length = attachment->size;
+ attach_data->_buffer = CORBA_sequence_CORBA_char_allocbuf (attach_data->_length);
+ strcpy (attach_data->_buffer, attachment->content);
- GNOME_Evolution_Composer_attachData (composer_server,
- NOTNULL (attachment->content_type),
- NOTNULL (attachment->basename),
- NOTNULL (attachment->description),
- attachment->show_inline,
- attach_data,
- &ev);
+ GNOME_Evolution_Composer_attachData (composer_server,
+ NOTNULL (attachment->content_type),
+ NOTNULL (attachment->basename),
+ NOTNULL (attachment->description),
+ attachment->show_inline,
+ attach_data,
+ &ev);
- if (ev._major != CORBA_NO_EXCEPTION) {
- g_printerr ("evolution-sendmail.c: I couldn't attach data to the composer via CORBA! Aagh.\n");
- CORBA_exception_free (&ev);
- return;
- }
+ if (ev._major != CORBA_NO_EXCEPTION) {
+ g_printerr ("evolution-sendmail.c: I couldn't attach data to the composer via CORBA! Aagh.\n");
+ CORBA_exception_free (&ev);
+ return;
+ }
- CORBA_free (attach_data);
+ CORBA_free (attach_data);
- free_attachment (attachment);
+ free_attachment (attachment);
- temp = attachments;
- attachments = g_list_remove_link (attachments, attachments);
- g_list_free_1 (temp);
- }
+ temp = attachments;
+ attachments = g_list_remove_link (attachments, attachments);
+ g_list_free_1 (temp);
+ }
- to_list = GNOME_Evolution_Composer_RecipientList__alloc ();
- to_list->_maximum = to_list->_length = 0;
+ to_list = GNOME_Evolution_Composer_RecipientList__alloc ();
+ to_list->_maximum = to_list->_length = 0;
- cc_list = GNOME_Evolution_Composer_RecipientList__alloc ();
- cc_list->_maximum = cc_list->_length = 0;
+ cc_list = GNOME_Evolution_Composer_RecipientList__alloc ();
+ cc_list->_maximum = cc_list->_length = 0;
- bcc_list = GNOME_Evolution_Composer_RecipientList__alloc ();
- bcc_list->_maximum = bcc_list->_length = 0;
+ bcc_list = GNOME_Evolution_Composer_RecipientList__alloc ();
+ bcc_list->_maximum = bcc_list->_length = 0;
- GNOME_Evolution_Composer_setHeaders (composer_server, "", to_list, cc_list, bcc_list, NOTNULL (subject), &ev);
+ GNOME_Evolution_Composer_setHeaders (composer_server, "", to_list, cc_list, bcc_list, NOTNULL (subject), &ev);
- CORBA_free (to_list);
- CORBA_free (cc_list);
- CORBA_free (bcc_list);
+ CORBA_free (to_list);
+ CORBA_free (cc_list);
+ CORBA_free (bcc_list);
- GNOME_Evolution_Composer_show (composer_server, &ev);
+ GNOME_Evolution_Composer_show (composer_server, &ev);
- if (ev._major != CORBA_NO_EXCEPTION) {
- g_printerr ("evolution-sendmail.c: I couldn't show the composer via CORBA! Aagh.\n");
- CORBA_exception_free (&ev);
- return;
- }
+ if (ev._major != CORBA_NO_EXCEPTION) {
+ g_printerr ("evolution-sendmail.c: I couldn't show the composer via CORBA! Aagh.\n");
+ CORBA_exception_free (&ev);
+ return;
+ }
- CORBA_exception_free (&ev);
+ CORBA_exception_free (&ev);
}
-static GNOME_Evolution_Composer
+static BonoboObjectClient *
get_composer ()
{
- CORBA_Object shell;
- GNOME_Evolution_Composer composer;
+ BonoboObjectClient *bonobo_server;
- /* First, I obtain an object reference that represents the Shell, to make sure it's running. */
- shell = bonobo_activation_activate_from_id (E_SHELL_OAFIID, 0, NULL, NULL);
+ /* First, I obtain an object reference that represents the Shell, to make sure it's running. */
+ bonobo_server = bonobo_object_activate (E_SHELL_OAFIID, 0);
- printf ("shell == %p\n", shell);
+ g_return_val_if_fail (bonobo_server != NULL, NULL);
- g_return_val_if_fail (shell != CORBA_OBJECT_NIL, NULL);
+ /* Next, I obtain an object reference that represents the Composer. */
+ bonobo_server = bonobo_object_activate (COMPOSER_OAFIID, 0);
- /* Next, I obtain an object reference that represents the Composer. */
- composer = bonobo_activation_activate_from_id (COMPOSER_OAFIID, 0, NULL, NULL);
-
- printf ("composer == %p\n", composer);
-
- return composer;
+ return bonobo_server;
}
static gboolean
composer_timeout (gpointer data)
{
- GNOME_Evolution_Composer composer;
+ BonoboObjectClient *bonobo_server;
- composer = get_composer ();
+ bonobo_server = get_composer ();
- if (composer != CORBA_OBJECT_NIL) {
- do_send (composer);
- gtk_main_quit ();
- return FALSE;
- } else {
- return TRUE;
- }
+ if (bonobo_server) {
+ do_send (bonobo_server);
+ gtk_main_quit ();
+ return FALSE;
+ } else {
+ return TRUE;
+ }
}
static void
@@ -333,25 +331,26 @@ static struct poptOption cap_options[] = {
int
main(int argc, char *argv[])
{
- GNOME_Evolution_Composer composer;
+ BonoboObjectClient *bonobo_server;
bindtextdomain (PACKAGE, EVOLUTION_LOCALEDIR);
textdomain (PACKAGE);
- gnome_program_init ("evolution-launch-composer", VERSION,
- LIBGNOMEUI_MODULE, argc, argv,
- GNOME_PROGRAM_STANDARD_PROPERTIES,
- GNOME_PARAM_POPT_TABLE, cap_options,
- NULL);
+ gnome_vfs_init ();
- composer = get_composer ();
+ gnome_init_with_popt_table ("evolution-launch-composer", VERSION, argc, argv, cap_options, 0, NULL);
- if (composer != CORBA_OBJECT_NIL) {
- do_send (composer);
- } else {
- g_timeout_add(1000, composer_timeout, NULL);
- bonobo_main ();
- }
+ if (bonobo_init (CORBA_OBJECT_NIL, CORBA_OBJECT_NIL, CORBA_OBJECT_NIL) == FALSE)
+ g_error (_("Could not initialize Bonobo"));
+
+ bonobo_server = get_composer ();
+
+ if (bonobo_server) {
+ do_send (bonobo_server);
+ } else {
+ g_timeout_add(1000, composer_timeout, NULL);
+ gtk_main ();
+ }
- return 0;
+ return 0;
}
diff --git a/ui/ChangeLog b/ui/ChangeLog
index 44048e1f14..481254c658 100644
--- a/ui/ChangeLog
+++ b/ui/ChangeLog
@@ -1,54 +1,6 @@
-2003-03-26 Chris Toshok <toshok@ximian.com>
+2002-11-03 Jeffrey Stedfast <fejj@ximian.com>
- [ fixes #40212 ]
- * evolution-contact-editor.xml: change accelerator for Save
- As... to Control-Shift-s
-
- * evolution-contact-list-editor.xml: same.
-
-2003-03-20 JP Rosevear <jpr@ximian.com>
-
- * evolution.xml: remove conduit settings as a separate entry
-
-2003-02-28 Ettore Perazzoli <ettore@ximian.com>
-
- * evolution-mail-message.xml: Make "MessageReplyList" and
- "MessagePostReply" have no pixbuf.
- * evolution-mail-global.xml: Same with "MailPost".
-
-2003-02-23 Hans Petter Jansson <hpj@ximian.com>
-
- * evolution-event-editor.xml: Fix an attributes typo.
-
-2003-02-23 Hans Petter Jansson <hpj@ximian.com>
-
- * evolution-comp-editor.xml: Fix an attributes typo and add stock
- icon identifiers to silence warning spew.
-
-2003-01-22 Ettore Perazzoli <ettore@ximian.com>
-
- * Makefile.am (uidir): Removed (this is now defined in
- configure.in).
-
-2002-11-20 Ettore Perazzoli <ettore@ximian.com>
-
- * evolution-message-composer.xml: Change hlook value for "Toolbar"
- to be "both_horiz".
- * evolution-signature-editor.xml: Likewise.
- * evolution-mail-messagedisplay.xml: Likewise.
- * evolution-event-editor.xml: Likewise.
- * evolution-contact-list-editor.xml: Likewise.
- * evolution-contact-editor.xml: Likewise.
- * evolution-comp-editor.xml: Likewise.
-
-2002-11-20 Ettore Perazzoli <ettore@ximian.com>
-
- * evolution.xml: Change hlook value for Toolbar to be
- "both_horiz".
-
-2002-11-04 Ettore Perazzoli <ettore@ximian.com>
-
- * Makefile.am (uidir): Install in $(datadir)/gnome-2.0/ui.
+ * evolution-mail-message.xml: Fix for bug #33173
2002-10-28 Ettore Perazzoli <ettore@ximian.com>
diff --git a/ui/evolution-mail-message.xml b/ui/evolution-mail-message.xml
index 17b19b96f6..610c07791d 100644
--- a/ui/evolution-mail-message.xml
+++ b/ui/evolution-mail-message.xml
@@ -92,7 +92,8 @@
<cmd name="MessagePostReply"
_tip="Post a reply to a message in a Public folder"
- accel=""/>
+ accel=""
+ pixtype="pixbuf"/>
<cmd name="MessageRedirect"
_tip="Redirect (bounce) the selected message to someone"
@@ -105,7 +106,8 @@
<cmd name="MessageReplyList"
_tip="Compose a reply to the mailing list of the selected message"
- accel=""/>
+ accel=""
+ pixtype="pixbuf"/>
<cmd name="MessageReplySender"
_tip="Compose a reply to the sender of the selected message"
diff --git a/widgets/menus/gal-define-views-dialog.c b/widgets/menus/gal-define-views-dialog.c
deleted file mode 100644
index 4c2cbbf69b..0000000000
--- a/widgets/menus/gal-define-views-dialog.c
+++ /dev/null
@@ -1,343 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * gal-define-views-dialog.c
- * Copyright 2000, 2001, Ximian, Inc.
- *
- * Authors:
- * Chris Lahey <clahey@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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 "gal-define-views-dialog.h"
-
-#include <gtk/gtk.h>
-#include "gal-define-views-model.h"
-#include "gal-view-new-dialog.h"
-#include <gal/e-table/e-table-scrolled.h>
-#include <gal/util/e-i18n.h>
-#include <gal/util/e-util.h>
-
-static void gal_define_views_dialog_init (GalDefineViewsDialog *card);
-static void gal_define_views_dialog_class_init (GalDefineViewsDialogClass *klass);
-static void gal_define_views_dialog_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec);
-static void gal_define_views_dialog_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec);
-static void gal_define_views_dialog_dispose (GObject *object);
-
-static GtkDialogClass *parent_class = NULL;
-#define PARENT_TYPE GTK_TYPE_DIALOG
-
-/* The properties we support */
-enum {
- PROP_0,
- PROP_COLLECTION
-};
-
-typedef struct {
- char *title;
- ETableModel *model;
- GalDefineViewsDialog *names;
-} GalDefineViewsDialogChild;
-
-
-E_MAKE_TYPE(gal_define_views_dialog, "GalDefineViewsDialog", GalDefineViewsDialog, gal_define_views_dialog_class_init, gal_define_views_dialog_init, PARENT_TYPE)
-
-static void
-gal_define_views_dialog_class_init (GalDefineViewsDialogClass *klass)
-{
- GObjectClass *object_class;
-
- object_class = (GObjectClass*) klass;
-
- parent_class = g_type_class_ref (PARENT_TYPE);
-
- object_class->set_property = gal_define_views_dialog_set_property;
- object_class->get_property = gal_define_views_dialog_get_property;
- object_class->dispose = gal_define_views_dialog_dispose;
-
- g_object_class_install_property (object_class, PROP_COLLECTION,
- g_param_spec_object ("collection",
- _("Collection"),
- /*_( */"XXX blurb" /*)*/,
- GAL_VIEW_COLLECTION_TYPE,
- G_PARAM_READWRITE));
-}
-
-/* ETable creation */
-#define SPEC "<ETableSpecification cursor-mode=\"line\" draw-grid=\"true\" selection-mode=\"single\" gettext-domain=\"" E_I18N_DOMAIN "\">" \
- "<ETableColumn model_col= \"0\" _title=\"Name\" expansion=\"1.0\" minimum_width=\"18\" resizable=\"true\" cell=\"string\" compare=\"string\"/>" \
- "<ETableState> <column source=\"0\"/> <grouping> </grouping> </ETableState>" \
- "</ETableSpecification>"
-
-/* For use from libglade. */
-GtkWidget *gal_define_views_dialog_create_etable(char *name, char *string1, char *string2, int int1, int int2);
-
-GtkWidget *
-gal_define_views_dialog_create_etable(char *name, char *string1, char *string2, int int1, int int2)
-{
- GtkWidget *table;
- ETableModel *model;
- model = gal_define_views_model_new();
- table = e_table_scrolled_new(model, NULL, SPEC, NULL);
- g_object_set_data(G_OBJECT (table), "GalDefineViewsDialog::model", model);
- return table;
-}
-
-/* Button callbacks */
-
-static void
-gdvd_button_new_dialog_callback(GtkWidget *widget, int id, GalDefineViewsDialog *dialog)
-{
- gchar *name;
- GalView *view;
- GalViewFactory *factory;
- switch (id) {
- case GTK_RESPONSE_OK:
- g_object_get(widget,
- "name", &name,
- "factory", &factory,
- NULL);
- if (name && factory) {
- gchar *dup_of_name = g_strdup(name);
- g_strchomp(dup_of_name);
- if (*dup_of_name != '\0') {
- GtkWidget *editor;
- view = gal_view_factory_new_view(factory, dup_of_name);
- gal_define_views_model_append(GAL_DEFINE_VIEWS_MODEL(dialog->model), view);
- gal_view_edit(view, GTK_WINDOW (dialog));
- g_object_unref(view);
- }
- g_free(dup_of_name);
- }
- break;
- }
- gtk_widget_destroy (widget);
-}
-
-static void
-gdvd_button_new_callback(GtkWidget *widget, GalDefineViewsDialog *dialog)
-{
- GtkWidget *view_new_dialog = gal_view_new_dialog_new(dialog->collection);
- gtk_window_set_transient_for (GTK_WINDOW (view_new_dialog), GTK_WINDOW (dialog));
- g_signal_connect(view_new_dialog, "response",
- G_CALLBACK(gdvd_button_new_dialog_callback), dialog);
- gtk_widget_show(view_new_dialog);
-}
-
-static void
-gdvd_button_modify_callback(GtkWidget *widget, GalDefineViewsDialog *dialog)
-{
- int row;
- GtkWidget *scrolled;
- ETable *etable;
-
- scrolled = glade_xml_get_widget(dialog->gui, "custom-table");
- etable = e_table_scrolled_get_table(E_TABLE_SCROLLED(scrolled));
- row = e_table_get_cursor_row (E_TABLE(etable));
-
- if (row != -1) {
- GalView *view;
- view = gal_define_views_model_get_view(GAL_DEFINE_VIEWS_MODEL(dialog->model),
- row);
- gal_view_edit(view, GTK_WINDOW (dialog));
- }
-
-}
-
-static void
-gdvd_button_delete_callback(GtkWidget *widget, GalDefineViewsDialog *dialog)
-{
- int row;
- GtkWidget *scrolled;
- ETable *etable;
-
- scrolled = glade_xml_get_widget(dialog->gui, "custom-table");
- etable = e_table_scrolled_get_table(E_TABLE_SCROLLED(scrolled));
- row = e_table_get_cursor_row (E_TABLE(etable));
-
- if (row != -1) {
- gal_define_views_model_delete_view(GAL_DEFINE_VIEWS_MODEL(dialog->model),
- row);
- }
-
-}
-
-static void
-gdvd_button_copy_callback(GtkWidget *widget, GalDefineViewsDialog *dialog)
-{
- int row;
- GtkWidget *scrolled;
- ETable *etable;
-
- scrolled = glade_xml_get_widget(dialog->gui, "custom-table");
- etable = e_table_scrolled_get_table(E_TABLE_SCROLLED(scrolled));
- row = e_table_get_cursor_row (E_TABLE(etable));
-
- if (row != -1) {
- gal_define_views_model_copy_view(GAL_DEFINE_VIEWS_MODEL(dialog->model),
- row);
- }
-
-}
-
-static void
-gdvd_connect_signal(GalDefineViewsDialog *dialog, char *widget_name, char *signal, GCallback handler)
-{
- GtkWidget *widget;
-
- widget = glade_xml_get_widget(dialog->gui, widget_name);
-
- if (widget)
- g_signal_connect(widget, signal, handler, dialog);
-}
-
-static void
-gal_define_views_dialog_init (GalDefineViewsDialog *dialog)
-{
- GladeXML *gui;
- GtkWidget *widget;
- GtkWidget *etable;
-
- dialog->collection = NULL;
-
- gui = glade_xml_new (GAL_GLADEDIR "/gal-define-views.glade", NULL, PACKAGE);
- dialog->gui = gui;
-
- widget = glade_xml_get_widget(gui, "table-top");
- if (!widget) {
- return;
- }
- gtk_widget_ref(widget);
- gtk_container_remove (GTK_CONTAINER (widget->parent), widget);
- gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->vbox), widget, TRUE, TRUE, 0);
- gtk_widget_unref(widget);
-
- gtk_dialog_add_buttons (GTK_DIALOG (dialog),
- GTK_STOCK_OK, GTK_RESPONSE_OK,
- GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
- NULL);
-
- gdvd_connect_signal(dialog, "button-new", "clicked", G_CALLBACK(gdvd_button_new_callback));
- gdvd_connect_signal(dialog, "button-modify", "clicked", G_CALLBACK(gdvd_button_modify_callback));
- gdvd_connect_signal(dialog, "button-delete", "clicked", G_CALLBACK(gdvd_button_delete_callback));
- gdvd_connect_signal(dialog, "button-copy", "clicked", G_CALLBACK(gdvd_button_copy_callback));
-
- dialog->model = NULL;
- etable = glade_xml_get_widget(dialog->gui, "custom-table");
- if (etable) {
- dialog->model = g_object_get_data(G_OBJECT (etable), "GalDefineViewsDialog::model");
- g_object_set(dialog->model,
- "collection", dialog->collection,
- NULL);
- gtk_widget_show_all (etable);
- }
-
- gtk_window_set_policy(GTK_WINDOW(dialog), FALSE, TRUE, FALSE);
-}
-
-static void
-gal_define_views_dialog_dispose (GObject *object)
-{
- GalDefineViewsDialog *gal_define_views_dialog = GAL_DEFINE_VIEWS_DIALOG(object);
-
- if (gal_define_views_dialog->gui)
- g_object_unref(gal_define_views_dialog->gui);
- gal_define_views_dialog->gui = NULL;
-
- if (G_OBJECT_CLASS (parent_class)->dispose)
- (* G_OBJECT_CLASS (parent_class)->dispose) (object);
-}
-
-static void
-gal_define_views_dialog_set_collection(GalDefineViewsDialog *dialog,
- GalViewCollection *collection)
-{
- dialog->collection = collection;
- if (dialog->model) {
- g_object_set(dialog->model,
- "collection", collection,
- NULL);
- }
- if (dialog->gui) {
- GtkWidget *widget = glade_xml_get_widget(dialog->gui, "label-views");
- if (widget && GTK_IS_LABEL (widget)) {
- if (collection->title) {
- char *text = g_strdup_printf (_("Define Views for %s"),
- collection->title);
- gtk_label_set_text (GTK_LABEL (widget),
- text);
- g_free (text);
- } else {
- gtk_label_set_text (GTK_LABEL (widget),
- _("Define Views"));
- }
- }
- }
-}
-
-/**
- * gal_define_views_dialog_new
- *
- * Returns a new dialog for defining views.
- *
- * Returns: The GalDefineViewsDialog.
- */
-GtkWidget*
-gal_define_views_dialog_new (GalViewCollection *collection)
-{
- GtkWidget *widget = g_object_new (GAL_DEFINE_VIEWS_DIALOG_TYPE, NULL);
- gal_define_views_dialog_set_collection(GAL_DEFINE_VIEWS_DIALOG (widget), collection);
- return widget;
-}
-
-static void
-gal_define_views_dialog_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec)
-{
- GalDefineViewsDialog *dialog;
-
- dialog = GAL_DEFINE_VIEWS_DIALOG (object);
-
- switch (prop_id){
- case PROP_COLLECTION:
- if (g_value_get_object (value))
- gal_define_views_dialog_set_collection(dialog, GAL_VIEW_COLLECTION(g_value_get_object (value)));
- else
- gal_define_views_dialog_set_collection(dialog, NULL);
- break;
-
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
- return;
- }
-}
-
-static void
-gal_define_views_dialog_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec)
-{
- GalDefineViewsDialog *dialog;
-
- dialog = GAL_DEFINE_VIEWS_DIALOG (object);
-
- switch (prop_id) {
- case PROP_COLLECTION:
- g_value_set_object (value, dialog->collection);
-
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
- break;
- }
-}
diff --git a/widgets/menus/gal-define-views-dialog.h b/widgets/menus/gal-define-views-dialog.h
deleted file mode 100644
index 03a047b9fe..0000000000
--- a/widgets/menus/gal-define-views-dialog.h
+++ /dev/null
@@ -1,78 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * gal-define-views-dialog.h
- * Copyright 2000, 2001, Ximian, Inc.
- *
- * Authors:
- * Chris Lahey <clahey@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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.
- */
-
-#ifndef __GAL_DEFINE_VIEWS_DIALOG_H__
-#define __GAL_DEFINE_VIEWS_DIALOG_H__
-
-#include <gtk/gtkdialog.h>
-#include <glade/glade.h>
-#include <gal/e-table/e-table-model.h>
-#include <gal/menus/gal-view-collection.h>
-
-#ifdef __cplusplus
-extern "C" {
-#pragma }
-#endif /* __cplusplus */
-
-/* GalDefineViewsDialog - A dialog displaying information about a contact.
- *
- * The following arguments are available:
- *
- * name type read/write description
- * --------------------------------------------------------------------------------
- */
-
-#define GAL_DEFINE_VIEWS_DIALOG_TYPE (gal_define_views_dialog_get_type ())
-#define GAL_DEFINE_VIEWS_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GAL_DEFINE_VIEWS_DIALOG_TYPE, GalDefineViewsDialog))
-#define GAL_DEFINE_VIEWS_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GAL_DEFINE_VIEWS_DIALOG_TYPE, GalDefineViewsDialogClass))
-#define GAL_IS_DEFINE_VIEWS_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GAL_DEFINE_VIEWS_DIALOG_TYPE))
-#define GAL_IS_DEFINE_VIEWS_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), GAL_DEFINE_VIEWS_DIALOG_TYPE))
-
-typedef struct _GalDefineViewsDialog GalDefineViewsDialog;
-typedef struct _GalDefineViewsDialogClass GalDefineViewsDialogClass;
-
-struct _GalDefineViewsDialog
-{
- GtkDialog parent;
-
- /* item specific fields */
- GladeXML *gui;
- ETableModel *model;
-
- GalViewCollection *collection;
-};
-
-struct _GalDefineViewsDialogClass
-{
- GtkDialogClass parent_class;
-};
-
-GtkWidget *gal_define_views_dialog_new (GalViewCollection *collection);
-GType gal_define_views_dialog_get_type (void);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-
-#endif /* __GAL_DEFINE_VIEWS_DIALOG_H__ */
diff --git a/widgets/menus/gal-define-views-model.c b/widgets/menus/gal-define-views-model.c
deleted file mode 100644
index 40e54a53b6..0000000000
--- a/widgets/menus/gal-define-views-model.c
+++ /dev/null
@@ -1,322 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * gal-define-views-model.c
- * Copyright 2000, 2001, Ximian, Inc.
- *
- * Authors:
- * Chris Lahey <clahey@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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 <libxml/tree.h>
-#include <libxml/parser.h>
-#include <libxml/xmlmemory.h>
-#include "gal-define-views-model.h"
-#include <gal/util/e-i18n.h>
-#include <gal/util/e-util.h>
-
-#define PARENT_TYPE E_TABLE_MODEL_TYPE
-static ETableModelClass *parent_class;
-
-/*
- * GalDefineViewsModel callbacks
- * These are the callbacks that define the behavior of our custom model.
- */
-static void gal_define_views_model_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec);
-static void gal_define_views_model_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec);
-
-enum {
- PROP_0,
- PROP_EDITABLE,
- PROP_COLLECTION
-};
-
-static void
-gdvm_dispose(GObject *object)
-{
- GalDefineViewsModel *model = GAL_DEFINE_VIEWS_MODEL(object);
-
- if (model->collection)
- g_object_unref(model->collection);
- model->collection = NULL;
-
- if (G_OBJECT_CLASS (parent_class)->dispose)
- (* G_OBJECT_CLASS (parent_class)->dispose) (object);
-}
-
-/* This function returns the number of columns in our ETableModel. */
-static int
-gdvm_col_count (ETableModel *etc)
-{
- return 1;
-}
-
-/* This function returns the number of rows in our ETableModel. */
-static int
-gdvm_row_count (ETableModel *etc)
-{
- GalDefineViewsModel *views = GAL_DEFINE_VIEWS_MODEL(etc);
- if (views->collection)
- return gal_view_collection_get_count(views->collection);
- else
- return 0;
-}
-
-/* This function returns the value at a particular point in our ETableModel. */
-static void *
-gdvm_value_at (ETableModel *etc, int col, int row)
-{
- GalDefineViewsModel *views = GAL_DEFINE_VIEWS_MODEL(etc);
- const char *value;
-
- value = gal_view_get_title (gal_view_collection_get_view(views->collection, row));
-
- return (void *)(value ? value : "");
-}
-
-/* This function sets the value at a particular point in our ETableModel. */
-static void
-gdvm_set_value_at (ETableModel *etc, int col, int row, const void *val)
-{
- GalDefineViewsModel *views = GAL_DEFINE_VIEWS_MODEL(etc);
- if (views->editable) {
- e_table_model_pre_change(etc);
- gal_view_set_title(gal_view_collection_get_view(views->collection, row), val);
- e_table_model_cell_changed(etc, col, row);
- }
-}
-
-/* This function returns whether a particular cell is editable. */
-static gboolean
-gdvm_is_cell_editable (ETableModel *etc, int col, int row)
-{
- return GAL_DEFINE_VIEWS_MODEL(etc)->editable;
-}
-
-static void
-gdvm_append_row (ETableModel *etm, ETableModel *source, gint row)
-{
-}
-
-/* This function duplicates the value passed to it. */
-static void *
-gdvm_duplicate_value (ETableModel *etc, int col, const void *value)
-{
- return g_strdup(value);
-}
-
-/* This function frees the value passed to it. */
-static void
-gdvm_free_value (ETableModel *etc, int col, void *value)
-{
- g_free(value);
-}
-
-static void *
-gdvm_initialize_value (ETableModel *etc, int col)
-{
- return g_strdup("");
-}
-
-static gboolean
-gdvm_value_is_empty (ETableModel *etc, int col, const void *value)
-{
- return !(value && *(char *)value);
-}
-
-static char *
-gdvm_value_to_string (ETableModel *etc, int col, const void *value)
-{
- return g_strdup(value);
-}
-
-/**
- * gal_define_views_model_append
- * @model: The model to add to.
- * @view: The view to add.
- *
- * Adds the given view to the gal define views model.
- */
-void
-gal_define_views_model_append (GalDefineViewsModel *model,
- GalView *view)
-{
- ETableModel *etm = E_TABLE_MODEL(model);
-
- e_table_model_pre_change(etm);
- gal_view_collection_append(model->collection, view);
- e_table_model_row_inserted(etm, gal_view_collection_get_count(model->collection) - 1);
-}
-
-static void
-gal_define_views_model_class_init (GObjectClass *object_class)
-{
- ETableModelClass *model_class = (ETableModelClass *) object_class;
-
- parent_class = g_type_class_ref (PARENT_TYPE);
-
- object_class->dispose = gdvm_dispose;
- object_class->set_property = gal_define_views_model_set_property;
- object_class->get_property = gal_define_views_model_get_property;
-
- g_object_class_install_property (object_class, PROP_EDITABLE,
- g_param_spec_boolean ("editable",
- _("Editable"),
- /*_( */"XXX blurb" /*)*/,
- FALSE,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_COLLECTION,
- g_param_spec_object ("collection",
- _("Collection"),
- /*_( */"XXX blurb" /*)*/,
- GAL_VIEW_COLLECTION_TYPE,
- G_PARAM_READWRITE));
-
- model_class->column_count = gdvm_col_count;
- model_class->row_count = gdvm_row_count;
- model_class->value_at = gdvm_value_at;
- model_class->set_value_at = gdvm_set_value_at;
- model_class->is_cell_editable = gdvm_is_cell_editable;
- model_class->append_row = gdvm_append_row;
- model_class->duplicate_value = gdvm_duplicate_value;
- model_class->free_value = gdvm_free_value;
- model_class->initialize_value = gdvm_initialize_value;
- model_class->value_is_empty = gdvm_value_is_empty;
- model_class->value_to_string = gdvm_value_to_string;
-}
-
-static void
-gal_define_views_model_init (GObject *object)
-{
- GalDefineViewsModel *model = GAL_DEFINE_VIEWS_MODEL(object);
-
- model->collection = NULL;
-}
-
-static void
-gal_define_views_model_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec)
-{
- GalDefineViewsModel *model;
-
- model = GAL_DEFINE_VIEWS_MODEL (object);
-
- switch (prop_id){
- case PROP_EDITABLE:
- model->editable = g_value_get_boolean (value);
- break;
-
- case PROP_COLLECTION:
- e_table_model_pre_change(E_TABLE_MODEL(object));
- if (g_value_get_object (value))
- model->collection = GAL_VIEW_COLLECTION(g_value_get_object (value));
- else
- model->collection = NULL;
- e_table_model_changed(E_TABLE_MODEL(object));
- break;
- }
-}
-
-static void
-gal_define_views_model_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec)
-{
- GalDefineViewsModel *model;
-
- model = GAL_DEFINE_VIEWS_MODEL (object);
-
- switch (prop_id) {
- case PROP_EDITABLE:
- g_value_set_boolean (value, model->editable);
- break;
-
- case PROP_COLLECTION:
- g_value_set_object (value, model->collection);
-
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
- break;
- }
-}
-
-E_MAKE_TYPE(gal_define_views_model, "GalDefineViewsModel", GalDefineViewsModel, gal_define_views_model_class_init, gal_define_views_model_init, PARENT_TYPE)
-
-/**
- * gal_define_views_model_new
- *
- * Returns a new define views model. This is a list of views as an
- * ETable for use in the GalDefineViewsDialog.
- *
- * Returns: The new GalDefineViewsModel.
- */
-ETableModel *
-gal_define_views_model_new (void)
-{
- GalDefineViewsModel *et;
-
- et = g_object_new (GAL_DEFINE_VIEWS_MODEL_TYPE, NULL);
-
- return E_TABLE_MODEL(et);
-}
-
-/**
- * gal_define_views_model_get_view:
- * @model: The GalDefineViewsModel.
- * @n: Which view to get.
- *
- * Gets the nth view.
- *
- * Returns: The view.
- */
-GalView *
-gal_define_views_model_get_view (GalDefineViewsModel *model,
- int n)
-{
- return gal_view_collection_get_view(model->collection, n);
-}
-
-/**
- * gal_define_views_model_delete_view:
- * @model: The GalDefineViewsModel.
- * @n: Which view to delete.
- *
- * Deletes the nth view.
- */
-void
-gal_define_views_model_delete_view (GalDefineViewsModel *model,
- int n)
-{
- e_table_model_pre_change(E_TABLE_MODEL(model));
- gal_view_collection_delete_view(model->collection, n);
- e_table_model_row_deleted(E_TABLE_MODEL(model), n);
-}
-
-/**
- * gal_define_views_model_copy_view:
- * @model: The GalDefineViewsModel.
- * @n: Which view to copy.
- *
- * Copys the nth view.
- */
-void
-gal_define_views_model_copy_view (GalDefineViewsModel *model,
- int n)
-{
- ETableModel *etm = E_TABLE_MODEL(model);
- e_table_model_pre_change(etm);
- gal_view_collection_copy_view(model->collection, n);
- e_table_model_row_inserted(etm, gal_view_collection_get_count(model->collection) - 1);
-}
diff --git a/widgets/menus/gal-define-views-model.h b/widgets/menus/gal-define-views-model.h
deleted file mode 100644
index 6ea2b28cbc..0000000000
--- a/widgets/menus/gal-define-views-model.h
+++ /dev/null
@@ -1,72 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * gal-define-views-model.h
- * Copyright 2000, 2001, Ximian, Inc.
- *
- * Authors:
- * Chris Lahey <clahey@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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.
- */
-
-#ifndef _GAL_DEFINE_VIEWS_MODEL_H_
-#define _GAL_DEFINE_VIEWS_MODEL_H_
-
-#include <gal/e-table/e-table-model.h>
-#include <gal/menus/gal-view.h>
-#include <gal/menus/gal-view-collection.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
-
-#define GAL_DEFINE_VIEWS_MODEL_TYPE (gal_define_views_model_get_type ())
-#define GAL_DEFINE_VIEWS_MODEL(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GAL_DEFINE_VIEWS_MODEL_TYPE, GalDefineViewsModel))
-#define GAL_DEFINE_VIEWS_MODEL_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GAL_DEFINE_VIEWS_MODEL_TYPE, GalDefineViewsModelClass))
-#define GAL_IS_DEFINE_VIEWS_MODEL(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GAL_DEFINE_VIEWS_MODEL_TYPE))
-#define GAL_IS_DEFINE_VIEWS_MODEL_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GAL_DEFINE_VIEWS_MODEL_TYPE))
-
-typedef struct {
- ETableModel parent;
-
- /* item specific fields */
- GalViewCollection *collection;
-
- guint editable : 1;
-} GalDefineViewsModel;
-
-
-typedef struct {
- ETableModelClass parent_class;
-} GalDefineViewsModelClass;
-
-
-GType gal_define_views_model_get_type (void);
-ETableModel *gal_define_views_model_new (void);
-
-void gal_define_views_model_append (GalDefineViewsModel *model,
- GalView *view);
-GalView *gal_define_views_model_get_view (GalDefineViewsModel *model,
- int i);
-void gal_define_views_model_delete_view (GalDefineViewsModel *model,
- int i);
-void gal_define_views_model_copy_view (GalDefineViewsModel *model,
- int i);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* _GAL_DEFINE_VIEWS_MODEL_H_ */
diff --git a/widgets/menus/gal-define-views.glade b/widgets/menus/gal-define-views.glade
deleted file mode 100644
index ce5ea5a928..0000000000
--- a/widgets/menus/gal-define-views.glade
+++ /dev/null
@@ -1,287 +0,0 @@
-<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*-->
-<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd" >
-
-<glade-interface>
- <widget class="GtkDialog" id="dialog1">
- <property name="visible">no</property>
- <property name="title" translatable="yes">Define Views for &quot;%s&quot;</property>
- <property name="type">GTK_WINDOW_TOPLEVEL</property>
- <property name="modal">no</property>
- <property name="allow_shrink">no</property>
- <property name="allow_grow">yes</property>
- <property name="window-position">GTK_WIN_POS_NONE</property>
-
- <child internal-child="vbox">
- <widget class="GtkVBox" id="dialog-vbox1">
- <property name="homogeneous">no</property>
- <property name="spacing">8</property>
- <property name="visible">yes</property>
-
- <child internal-child="action_area">
- <widget class="GtkHButtonBox" id="dialog-action_area1">
- <property name="layout_style">GTK_BUTTONBOX_END</property>
- <property name="spacing">8</property>
- <property name="visible">yes</property>
-
- <child>
- <widget class="GtkButton" id="button1">
- <property name="can_default">yes</property>
- <property name="can_focus">yes</property>
- <property name="visible">yes</property>
- <property name="label">gtk-ok</property>
- <property name="use_stock">yes</property>
- <property name="use_underline">yes</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkButton" id="button7">
- <property name="can_default">yes</property>
- <property name="can_focus">yes</property>
- <property name="visible">yes</property>
- <property name="label">gtk-cancel</property>
- <property name="use_stock">yes</property>
- <property name="use_underline">yes</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">no</property>
- <property name="fill">yes</property>
- <property name="pack_type">GTK_PACK_END</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkTable" id="table-top">
- <property name="homogeneous">no</property>
- <property name="row_spacing">6</property>
- <property name="column_spacing">6</property>
- <property name="n-rows">5</property>
- <property name="n-columns">1</property>
- <property name="visible">yes</property>
-
- <child>
- <widget class="GtkFrame" id="frame1">
- <property name="label" translatable="yes">Description</property>
- <property name="label_xalign">0</property>
- <property name="shadow">GTK_SHADOW_ETCHED_IN</property>
- <property name="visible">yes</property>
-
- <child>
- <widget class="GtkTable" id="table-description">
- <property name="border_width">6</property>
- <property name="homogeneous">no</property>
- <property name="row_spacing">6</property>
- <property name="column_spacing">6</property>
- <property name="n-rows">1</property>
- <property name="n-columns">2</property>
- <property name="visible">yes</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">3</property>
- <property name="bottom_attach">4</property>
- <property name="x_padding">0</property>
- <property name="y_padding">0</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkHBox" id="hbox1">
- <property name="homogeneous">no</property>
- <property name="spacing">6</property>
- <property name="visible">yes</property>
-
- <child>
- <widget class="Custom" id="custom-table">
- <property name="creation_function">gal_define_views_dialog_create_etable</property>
- <property name="int1">0</property>
- <property name="int2">0</property>
- <property name="last_modification_time">Fri, 10 Nov 2000 16:37:39 GMT</property>
- <property name="visible">yes</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">yes</property>
- <property name="fill">yes</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkVBox" id="vbox1">
- <property name="homogeneous">no</property>
- <property name="spacing">6</property>
- <property name="visible">yes</property>
-
- <child>
- <widget class="GtkButton" id="button-new">
- <property name="can_focus">yes</property>
- <property name="label" translatable="yes">_New...</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="visible">yes</property>
- <property name="use_underline">yes</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">no</property>
- <property name="fill">no</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkButton" id="button-copy">
- <property name="can_focus">yes</property>
- <property name="label" translatable="yes">_Copy...</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="visible">yes</property>
- <property name="use_underline">yes</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">no</property>
- <property name="fill">no</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkButton" id="button-modify">
- <property name="can_focus">yes</property>
- <property name="label" translatable="yes">_Edit...</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="visible">yes</property>
- <property name="use_underline">yes</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">no</property>
- <property name="fill">no</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkButton" id="button-delete">
- <property name="can_focus">yes</property>
- <property name="label" translatable="yes">_Delete...</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="visible">yes</property>
- <property name="use_underline">yes</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">no</property>
- <property name="fill">no</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">no</property>
- <property name="fill">no</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="x_padding">0</property>
- <property name="y_padding">0</property>
- <property name="x_options">expand|fill</property>
- <property name="y_options">expand|fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkHButtonBox" id="hbuttonbox1">
- <property name="layout_style">GTK_BUTTONBOX_END</property>
- <property name="spacing">6</property>
- <property name="visible">yes</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">4</property>
- <property name="bottom_attach">5</property>
- <property name="x_padding">0</property>
- <property name="y_padding">0</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkAlignment" id="alignment3">
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xscale">0</property>
- <property name="yscale">1</property>
- <property name="visible">yes</property>
-
- <child>
- <widget class="GtkButton" id="button-reset">
- <property name="can_focus">yes</property>
- <property name="label" translatable="yes">Re_set to Factory Defaults...</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="visible">yes</property>
- <property name="use_underline">yes</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">2</property>
- <property name="bottom_attach">3</property>
- <property name="x_padding">0</property>
- <property name="y_padding">0</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label-views">
- <property name="label" translatable="yes">Define Views for %s</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">no</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="visible">yes</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="x_padding">0</property>
- <property name="y_padding">0</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">yes</property>
- <property name="fill">yes</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">4</property>
- <property name="expand">yes</property>
- <property name="fill">yes</property>
- </packing>
- </child>
- </widget>
-</glade-interface>
diff --git a/widgets/menus/gal-view-collection.c b/widgets/menus/gal-view-collection.c
deleted file mode 100644
index e85d7e765b..0000000000
--- a/widgets/menus/gal-view-collection.c
+++ /dev/null
@@ -1,817 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * gal-view-collection.c
- * Copyright 2000, 2001, Ximian, Inc.
- *
- * Authors:
- * Chris Lahey <clahey@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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 <util/e-i18n.h>
-#include <ctype.h>
-#include <string.h>
-#include <errno.h>
-#include <libxml/parser.h>
-#include <libgnome/gnome-util.h>
-#include <gal/util/e-util.h>
-#include <gal/util/e-xml-utils.h>
-#include <gal/widgets/e-unicode.h>
-#include "gal-view-collection.h"
-
-#define PARENT_TYPE G_TYPE_OBJECT
-
-static GObjectClass *gal_view_collection_parent_class;
-
-#define d(x) x
-
-enum {
- DISPLAY_VIEW,
- CHANGED,
- LAST_SIGNAL
-};
-
-static guint gal_view_collection_signals [LAST_SIGNAL] = { 0, };
-
-/**
- * gal_view_collection_display_view:
- * @collection: The GalViewCollection to send the signal on.
- * @view: The view to display.
- *
- */
-void
-gal_view_collection_display_view (GalViewCollection *collection,
- GalView *view)
-{
- g_return_if_fail (collection != NULL);
- g_return_if_fail (GAL_IS_VIEW_COLLECTION (collection));
- g_return_if_fail (view != NULL);
- g_return_if_fail (GAL_IS_VIEW (view));
-
- g_signal_emit (collection,
- gal_view_collection_signals [DISPLAY_VIEW], 0,
- view);
-}
-
-static void
-gal_view_collection_changed (GalViewCollection *collection)
-{
- g_return_if_fail (collection != NULL);
- g_return_if_fail (GAL_IS_VIEW_COLLECTION (collection));
-
- g_signal_emit (collection,
- gal_view_collection_signals [CHANGED], 0);
-}
-
-static void
-gal_view_collection_item_free (GalViewCollectionItem *item)
-{
- g_free(item->id);
- if (item->view) {
- if (item->view_changed_id)
- g_signal_handler_disconnect (item->view,
- item->view_changed_id);
- g_object_unref(item->view);
- }
- g_free(item);
-}
-
-static char *
-gal_view_generate_string (GalViewCollection *collection,
- GalView *view,
- int which)
-{
- char *ret_val;
- char *pointer;
-
- if (which == 1)
- ret_val = g_strdup(gal_view_get_title(view));
- else
- ret_val = g_strdup_printf("%s_%d", gal_view_get_title(view), which);
- for (pointer = ret_val; *pointer; pointer++) {
- if (!isalnum((guint) *pointer)) {
- *pointer = '_';
- }
- }
- return ret_val;
-}
-
-static gint
-gal_view_check_string (GalViewCollection *collection,
- char *string)
-{
- int i;
-
- if (!strcmp (string, "current_view"))
- return FALSE;
-
- for (i = 0; i < collection->view_count; i++) {
- if (!strcmp(string, collection->view_data[i]->id))
- return FALSE;
- }
- for (i = 0; i < collection->removed_view_count; i++) {
- if (!strcmp(string, collection->removed_view_data[i]->id))
- return FALSE;
- }
- return TRUE;
-}
-
-static char *
-gal_view_generate_id (GalViewCollection *collection,
- GalView *view)
-{
- int i;
- for (i = 1; TRUE; i++) {
- char *try;
-
- try = gal_view_generate_string(collection, view, i);
- if (gal_view_check_string(collection, try))
- return try;
- g_free(try);
- }
-}
-
-static void
-gal_view_collection_dispose (GObject *object)
-{
- GalViewCollection *collection = GAL_VIEW_COLLECTION(object);
- int i;
-
- for (i = 0; i < collection->view_count; i++) {
- gal_view_collection_item_free (collection->view_data[i]);
- }
- g_free (collection->view_data);
- collection->view_data = NULL;
- collection->view_count = 0;
-
- e_free_object_list (collection->factory_list);
- collection->factory_list = NULL;
-
- for (i = 0; i < collection->removed_view_count; i++) {
- gal_view_collection_item_free (collection->removed_view_data[i]);
- }
- g_free(collection->removed_view_data);
- collection->removed_view_data = NULL;
- collection->removed_view_count = 0;
-
- g_free(collection->system_dir);
- collection->system_dir = NULL;
-
- g_free(collection->local_dir);
- collection->system_dir = NULL;
- collection->local_dir = NULL;
-
- g_free (collection->default_view);
- collection->default_view = NULL;
-
- g_free (collection->title);
- collection->title = NULL;
-
- if (gal_view_collection_parent_class->dispose)
- (*gal_view_collection_parent_class->dispose)(object);
-}
-
-static void
-gal_view_collection_class_init (GObjectClass *object_class)
-{
- GalViewCollectionClass *klass = GAL_VIEW_COLLECTION_CLASS(object_class);
- gal_view_collection_parent_class = g_type_class_ref (PARENT_TYPE);
-
- object_class->dispose = gal_view_collection_dispose;
-
- gal_view_collection_signals [DISPLAY_VIEW] =
- g_signal_new ("display_view",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (GalViewCollectionClass, display_view),
- NULL, NULL,
- g_cclosure_marshal_VOID__OBJECT,
- G_TYPE_NONE, 1, GAL_VIEW_TYPE);
-
- gal_view_collection_signals [CHANGED] =
- g_signal_new ("changed",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (GalViewCollectionClass, changed),
- NULL, NULL,
- g_cclosure_marshal_VOID__VOID,
- G_TYPE_NONE, 0);
-
- klass->display_view = NULL;
- klass->changed = NULL;
-}
-
-static void
-gal_view_collection_init (GalViewCollection *collection)
-{
- collection->view_data = NULL;
- collection->view_count = 0;
- collection->factory_list = NULL;
-
- collection->removed_view_data = NULL;
- collection->removed_view_count = 0;
-
- collection->system_dir = NULL;
- collection->local_dir = NULL;
-
- collection->loaded = FALSE;
- collection->default_view = NULL;
- collection->default_view_built_in = TRUE;
-
- collection->title = NULL;
-}
-
-E_MAKE_TYPE(gal_view_collection, "GalViewCollection", GalViewCollection, gal_view_collection_class_init, gal_view_collection_init, PARENT_TYPE)
-
-/**
- * gal_view_collection_new:
- *
- * A collection of views and view factories.
- */
-GalViewCollection *
-gal_view_collection_new (void)
-{
- return g_object_new (GAL_VIEW_COLLECTION_TYPE, NULL);
-}
-
-void
-gal_view_collection_set_title (GalViewCollection *collection,
- const char *title)
-{
- g_free (collection->title);
- collection->title = g_strdup (title);
-}
-
-/**
- * gal_view_collection_set_storage_directories
- * @collection: The view collection to initialize
- * @system_dir: The location of the system built in views
- * @local_dir: The location to store the users set up views
- *
- * Sets up the GalViewCollection.
- */
-void
-gal_view_collection_set_storage_directories (GalViewCollection *collection,
- const char *system_dir,
- const char *local_dir)
-{
- g_return_if_fail (collection != NULL);
- g_return_if_fail (GAL_IS_VIEW_COLLECTION (collection));
- g_return_if_fail (system_dir != NULL);
- g_return_if_fail (local_dir != NULL);
-
- g_free(collection->system_dir);
- g_free(collection->local_dir);
-
- collection->system_dir = g_strdup(system_dir);
- collection->local_dir = g_strdup(local_dir);
-}
-
-/**
- * gal_view_collection_add_factory
- * @collection: The view collection to add a factory to
- * @factory: The factory to add. The @collection will add a reference
- * to the factory object, so you should unref it after calling this
- * function if you no longer need it.
- *
- * Adds the given factory to this collection. This list is used both
- * when loading views from their xml description as well as when the
- * user tries to create a new view.
- */
-void
-gal_view_collection_add_factory (GalViewCollection *collection,
- GalViewFactory *factory)
-{
- g_return_if_fail (collection != NULL);
- g_return_if_fail (GAL_IS_VIEW_COLLECTION (collection));
- g_return_if_fail (factory != NULL);
- g_return_if_fail (GAL_IS_VIEW_FACTORY (factory));
-
- g_object_ref (factory);
- collection->factory_list = g_list_prepend (collection->factory_list, factory);
-}
-
-static void
-view_changed (GalView *view,
- GalViewCollectionItem *item)
-{
- item->changed = TRUE;
- item->ever_changed = TRUE;
-
- gal_view_collection_changed(item->collection);
-}
-
-/* Use factory list to load a GalView file. */
-static GalView *
-gal_view_collection_real_load_view_from_file (GalViewCollection *collection, const char *type, const char *title, const char *dir, const char *filename)
-{
- GalViewFactory *factory;
- GList *factories;
-
- factory = NULL;
- for (factories = collection->factory_list; factories; factories = factories->next) {
- if (type && !strcmp(gal_view_factory_get_type_code(factories->data), type)) {
- factory = factories->data;
- break;
- }
- }
- if (factory) {
- GalView *view;
-
- view = gal_view_factory_new_view (factory, title);
- gal_view_set_title (view, title);
- gal_view_load(view, filename);
- return view;
- }
- return NULL;
-}
-
-GalView *
-gal_view_collection_load_view_from_file (GalViewCollection *collection, const char *type, const char *filename)
-{
- return gal_view_collection_real_load_view_from_file (collection, type, "", collection->local_dir, filename);
-}
-
-static GalViewCollectionItem *
-load_single_file (GalViewCollection *collection,
- gchar *dir,
- gboolean local,
- xmlNode *node)
-{
- GalViewCollectionItem *item;
- item = g_new(GalViewCollectionItem, 1);
- item->ever_changed = local;
- item->changed = FALSE;
- item->built_in = !local;
- item->id = e_xml_get_string_prop_by_name(node, "id");
- item->filename = e_xml_get_string_prop_by_name(node, "filename");
- item->title = e_xml_get_translated_utf8_string_prop_by_name(node, "title");
- item->type = e_xml_get_string_prop_by_name(node, "type");
- item->collection = collection;
- item->view_changed_id = 0;
-
- if (item->filename) {
- char *fullpath;
- fullpath = g_concat_dir_and_file(dir, item->filename);
- item->view = gal_view_collection_real_load_view_from_file (collection, item->type, item->title, dir, fullpath);
- g_free(fullpath);
- if (item->view) {
- item->view_changed_id =
- g_signal_connect(item->view, "changed",
- G_CALLBACK(view_changed), item);
- }
- }
- return item;
-}
-
-static void
-load_single_dir (GalViewCollection *collection,
- char *dir,
- gboolean local)
-{
- xmlDoc *doc;
- xmlNode *root;
- xmlNode *child;
- char *filename = g_concat_dir_and_file(dir, "galview.xml");
- char *default_view;
-
- doc = xmlParseFile(filename);
- if (!doc) {
- g_free (filename);
- return;
- }
- root = xmlDocGetRootElement(doc);
- for (child = root->xmlChildrenNode; child; child = child->next) {
- gchar *id;
- gboolean found = FALSE;
- int i;
-
- if (!strcmp (child->name, "text"))
- continue;
-
- id = e_xml_get_string_prop_by_name(child, "id");
- for (i = 0; i < collection->view_count; i++) {
- if (!strcmp(id, collection->view_data[i]->id)) {
- if (!local)
- collection->view_data[i]->built_in = TRUE;
- found = TRUE;
- break;
- }
- }
- if (!found) {
- for (i = 0; i < collection->removed_view_count; i++) {
- if (!strcmp(id, collection->removed_view_data[i]->id)) {
- if (!local)
- collection->removed_view_data[i]->built_in = TRUE;
- found = TRUE;
- break;
- }
- }
- }
-
- if (!found) {
- GalViewCollectionItem *item = load_single_file (collection, dir, local, child);
- if (item->filename && *item->filename) {
- collection->view_data = g_renew(GalViewCollectionItem *, collection->view_data, collection->view_count + 1);
- collection->view_data[collection->view_count] = item;
- collection->view_count ++;
- } else {
- collection->removed_view_data = g_renew(GalViewCollectionItem *, collection->removed_view_data, collection->removed_view_count + 1);
- collection->removed_view_data[collection->removed_view_count] = item;
- collection->removed_view_count ++;
- }
- }
- g_free(id);
- }
-
- default_view = e_xml_get_string_prop_by_name (root, "default-view");
- if (default_view) {
- if (local)
- collection->default_view_built_in = FALSE;
- else
- collection->default_view_built_in = TRUE;
- g_free (collection->default_view);
- collection->default_view = default_view;
- }
-
- g_free(filename);
- xmlFreeDoc(doc);
-}
-
-/**
- * gal_view_collection_load
- * @collection: The view collection to load information for
- *
- * Loads the data from the system and user directories specified in
- * set storage directories. This is primarily for internal use by
- * other parts of gal_view.
- */
-void
-gal_view_collection_load (GalViewCollection *collection)
-{
- g_return_if_fail (collection != NULL);
- g_return_if_fail (GAL_IS_VIEW_COLLECTION (collection));
- g_return_if_fail (collection->local_dir != NULL);
- g_return_if_fail (collection->system_dir != NULL);
- g_return_if_fail (!collection->loaded);
-
- if ((e_create_directory(collection->local_dir) == -1) && (errno != EEXIST))
- g_warning ("Unable to create dir %s: %s", collection->local_dir, g_strerror(errno));
-
- load_single_dir(collection, collection->local_dir, TRUE);
- load_single_dir(collection, collection->system_dir, FALSE);
- gal_view_collection_changed(collection);
-
- collection->loaded = TRUE;
-}
-
-/**
- * gal_view_collection_save
- * @collection: The view collection to save information for
- *
- * Saves the data to the user directory specified in set storage
- * directories. This is primarily for internal use by other parts of
- * gal_view.
- */
-void
-gal_view_collection_save (GalViewCollection *collection)
-{
- int i;
- xmlDoc *doc;
- xmlNode *root;
- char *filename;
-
- g_return_if_fail (collection != NULL);
- g_return_if_fail (GAL_IS_VIEW_COLLECTION (collection));
- g_return_if_fail (collection->local_dir != NULL);
-
- doc = xmlNewDoc("1.0");
- root = xmlNewNode(NULL, "GalViewCollection");
- xmlDocSetRootElement(doc, root);
-
- if (collection->default_view && !collection->default_view_built_in) {
- e_xml_set_string_prop_by_name(root, "default-view", collection->default_view);
- }
-
- for (i = 0; i < collection->view_count; i++) {
- xmlNode *child;
- GalViewCollectionItem *item;
-
- item = collection->view_data[i];
- if (item->ever_changed) {
- child = xmlNewChild(root, NULL, "GalView", NULL);
- e_xml_set_string_prop_by_name(child, "id", item->id);
- e_xml_set_string_prop_by_name(child, "title", item->title);
- e_xml_set_string_prop_by_name(child, "filename", item->filename);
- e_xml_set_string_prop_by_name(child, "type", item->type);
-
- if (item->changed) {
- filename = g_concat_dir_and_file(collection->local_dir, item->filename);
- gal_view_save(item->view, filename);
- g_free(filename);
- }
- }
- }
- for (i = 0; i < collection->removed_view_count; i++) {
- xmlNode *child;
- GalViewCollectionItem *item;
-
- item = collection->removed_view_data[i];
-
- child = xmlNewChild(root, NULL, "GalView", NULL);
- e_xml_set_string_prop_by_name(child, "id", item->id);
- e_xml_set_string_prop_by_name(child, "title", item->title);
- e_xml_set_string_prop_by_name(child, "type", item->type);
- }
- filename = g_concat_dir_and_file(collection->local_dir, "galview.xml");
- if (e_xml_save_file (filename, doc) == -1)
- g_warning ("Unable to save view to %s - %s", filename, g_strerror(errno));
- xmlFreeDoc(doc);
- g_free(filename);
-}
-
-/**
- * gal_view_collection_get_count
- * @collection: The view collection to count
- *
- * Calculates the number of views in the given collection.
- *
- * Returns: The number of views in the collection.
- */
-gint
-gal_view_collection_get_count (GalViewCollection *collection)
-{
- g_return_val_if_fail (collection != NULL, -1);
- g_return_val_if_fail (GAL_IS_VIEW_COLLECTION (collection), -1);
-
- return collection->view_count;
-}
-
-/**
- * gal_view_collection_get_view
- * @collection: The view collection to query
- * @n: The view to get.
- *
- * Returns: The nth view in the collection
- */
-GalView *
-gal_view_collection_get_view (GalViewCollection *collection,
- int n)
-{
- g_return_val_if_fail (collection != NULL, NULL);
- g_return_val_if_fail (GAL_IS_VIEW_COLLECTION (collection), NULL);
- g_return_val_if_fail (n < collection->view_count, NULL);
- g_return_val_if_fail (n >= 0, NULL);
-
- return collection->view_data[n]->view;
-}
-
-/**
- * gal_view_collection_get_view_item
- * @collection: The view collection to query
- * @n: The view item to get.
- *
- * Returns: The nth view item in the collection
- */
-GalViewCollectionItem *
-gal_view_collection_get_view_item (GalViewCollection *collection,
- int n)
-{
- g_return_val_if_fail (collection != NULL, NULL);
- g_return_val_if_fail (GAL_IS_VIEW_COLLECTION (collection), NULL);
- g_return_val_if_fail(n < collection->view_count, NULL);
- g_return_val_if_fail(n >= 0, NULL);
-
- return collection->view_data[n];
-}
-
-int
-gal_view_collection_get_view_index_by_id (GalViewCollection *collection, const char *view_id)
-{
- int i;
- for (i = 0; i < collection->view_count; i++) {
- if (!strcmp (collection->view_data[i]->id, view_id))
- return i;
- }
- return -1;
-}
-
-char *
-gal_view_collection_get_view_id_by_index (GalViewCollection *collection, int n)
-{
- g_return_val_if_fail (collection != NULL, NULL);
- g_return_val_if_fail (GAL_IS_VIEW_COLLECTION (collection), NULL);
- g_return_val_if_fail(n < collection->view_count, NULL);
- g_return_val_if_fail(n >= 0, NULL);
-
- return g_strdup (collection->view_data[n]->id);
-}
-
-
-void
-gal_view_collection_append (GalViewCollection *collection,
- GalView *view)
-{
- GalViewCollectionItem *item;
-
- g_return_if_fail (collection != NULL);
- g_return_if_fail (GAL_IS_VIEW_COLLECTION (collection));
- g_return_if_fail (view != NULL);
- g_return_if_fail (GAL_IS_VIEW (view));
-
- item = g_new(GalViewCollectionItem, 1);
- item->ever_changed = TRUE;
- item->changed = TRUE;
- item->built_in = FALSE;
- item->title = g_strdup(gal_view_get_title(view));
- item->type = g_strdup(gal_view_get_type_code(view));
- item->id = gal_view_generate_id(collection, view);
- item->filename = g_strdup_printf("%s.galview", item->id);
- item->view = view;
- item->collection = collection;
- g_object_ref(view);
-
- item->view_changed_id =
- g_signal_connect(item->view, "changed",
- G_CALLBACK (view_changed), item);
-
- collection->view_data = g_renew(GalViewCollectionItem *, collection->view_data, collection->view_count + 1);
- collection->view_data[collection->view_count] = item;
- collection->view_count ++;
-
- gal_view_collection_changed(collection);
-}
-
-void
-gal_view_collection_delete_view (GalViewCollection *collection,
- int i)
-{
- GalViewCollectionItem *item;
-
- g_return_if_fail (collection != NULL);
- g_return_if_fail (GAL_IS_VIEW_COLLECTION (collection));
- g_return_if_fail (i >= 0 && i < collection->view_count);
-
- item = collection->view_data[i];
- memmove(collection->view_data + i, collection->view_data + i + 1, (collection->view_count - i - 1) * sizeof(GalViewCollectionItem *));
- collection->view_count --;
- if (item->built_in) {
- g_free(item->filename);
- item->filename = NULL;
-
- collection->removed_view_data = g_renew(GalViewCollectionItem *, collection->removed_view_data, collection->removed_view_count + 1);
- collection->removed_view_data[collection->removed_view_count] = item;
- collection->removed_view_count ++;
- } else {
- gal_view_collection_item_free (item);
- }
-
- gal_view_collection_changed(collection);
-}
-
-void
-gal_view_collection_copy_view (GalViewCollection *collection,
- int i)
-{
- GalViewCollectionItem *item;
- GalView *view;
-
- g_return_if_fail (collection != NULL);
- g_return_if_fail (GAL_IS_VIEW_COLLECTION (collection));
- g_return_if_fail (i >= 0 && i < collection->view_count);
-
- view = collection->view_data[i]->view;
-
- item = g_new(GalViewCollectionItem, 1);
- item->ever_changed = TRUE;
- item->changed = FALSE;
- item->built_in = FALSE;
- item->title = g_strdup(gal_view_get_title(view));
- item->type = g_strdup(gal_view_get_type_code(view));
- item->id = gal_view_generate_id(collection, view);
- item->filename = g_strdup_printf("%s.galview", item->id);
- item->view = gal_view_clone(view);
- item->collection = collection;
-
- item->view_changed_id =
- g_signal_connect(item->view, "changed",
- G_CALLBACK (view_changed), item);
-
- collection->view_data = g_renew(GalViewCollectionItem *, collection->view_data, collection->view_count + 1);
- collection->view_data[collection->view_count] = item;
- collection->view_count ++;
-
- gal_view_collection_changed(collection);
-}
-
-gboolean
-gal_view_collection_loaded (GalViewCollection *collection)
-{
- return collection->loaded;
-}
-
-const char *
-gal_view_collection_append_with_title (GalViewCollection *collection, const char *title, GalView *view)
-{
- GalViewCollectionItem *item;
-
- g_return_val_if_fail (collection != NULL, NULL);
- g_return_val_if_fail (GAL_IS_VIEW_COLLECTION (collection), NULL);
- g_return_val_if_fail (view != NULL, NULL);
- g_return_val_if_fail (GAL_IS_VIEW (view), NULL);
-
- gal_view_set_title (view, title);
-
- d(g_print("%s: %p\n", G_GNUC_FUNCTION, view));
-
- item = g_new(GalViewCollectionItem, 1);
- item->ever_changed = TRUE;
- item->changed = TRUE;
- item->built_in = FALSE;
- item->title = g_strdup(gal_view_get_title(view));
- item->type = g_strdup(gal_view_get_type_code(view));
- item->id = gal_view_generate_id(collection, view);
- item->filename = g_strdup_printf("%s.galview", item->id);
- item->view = view;
- item->collection = collection;
- g_object_ref(view);
-
- item->view_changed_id =
- g_signal_connect(item->view, "changed",
- G_CALLBACK (view_changed), item);
-
- collection->view_data = g_renew(GalViewCollectionItem *, collection->view_data, collection->view_count + 1);
- collection->view_data[collection->view_count] = item;
- collection->view_count ++;
-
- gal_view_collection_changed(collection);
- return item->id;
-}
-
-const char *
-gal_view_collection_set_nth_view (GalViewCollection *collection, int i, GalView *view)
-{
- GalViewCollectionItem *item;
-
- g_return_val_if_fail (collection != NULL, NULL);
- g_return_val_if_fail (GAL_IS_VIEW_COLLECTION (collection), NULL);
- g_return_val_if_fail (view != NULL, NULL);
- g_return_val_if_fail (GAL_IS_VIEW (view), NULL);
- g_return_val_if_fail (i >= 0, NULL);
- g_return_val_if_fail (i < collection->view_count, NULL);
-
- d(g_print("%s: %p\n", G_GNUC_FUNCTION, view));
-
- item = collection->view_data[i];
-
- gal_view_set_title (view, item->title);
- g_object_ref (view);
- if (item->view) {
- g_signal_handler_disconnect (item->view,
- item->view_changed_id);
- g_object_unref (item->view);
- }
- item->view = view;
-
- item->ever_changed = TRUE;
- item->changed = TRUE;
- item->type = g_strdup(gal_view_get_type_code(view));
-
- item->view_changed_id =
- g_signal_connect(item->view, "changed",
- G_CALLBACK (view_changed), item);
-
- gal_view_collection_changed (collection);
- return item->id;
-}
-
-const char *
-gal_view_collection_get_default_view (GalViewCollection *collection)
-{
- return collection->default_view;
-}
-
-void
-gal_view_collection_set_default_view (GalViewCollection *collection, const char *id)
-{
- g_free (collection->default_view);
- collection->default_view = g_strdup (id);
- gal_view_collection_changed (collection);
- collection->default_view_built_in = FALSE;
-}
-
diff --git a/widgets/menus/gal-view-collection.h b/widgets/menus/gal-view-collection.h
deleted file mode 100644
index 9ba5eab71f..0000000000
--- a/widgets/menus/gal-view-collection.h
+++ /dev/null
@@ -1,151 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * gal-view-collection.h
- * Copyright 2000, 2001, Ximian, Inc.
- *
- * Authors:
- * Chris Lahey <clahey@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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.
- */
-
-#ifndef _GAL_VIEW_SET_H_
-#define _GAL_VIEW_SET_H_
-
-#include <gtk/gtkobject.h>
-#include <gal/menus/gal-view-factory.h>
-
-G_BEGIN_DECLS
-
-#define GAL_VIEW_COLLECTION_TYPE (gal_view_collection_get_type ())
-#define GAL_VIEW_COLLECTION(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GAL_VIEW_COLLECTION_TYPE, GalViewCollection))
-#define GAL_VIEW_COLLECTION_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GAL_VIEW_COLLECTION_TYPE, GalViewCollectionClass))
-#define GAL_IS_VIEW_COLLECTION(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GAL_VIEW_COLLECTION_TYPE))
-#define GAL_IS_VIEW_COLLECTION_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GAL_VIEW_COLLECTION_TYPE))
-#define GAL_VIEW_COLLECTION_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GAL_VIEW_COLLECTION_TYPE, GalViewCollectionClass))
-
-typedef struct GalViewCollectionItem GalViewCollectionItem;
-
-typedef struct {
- GObject base;
-
- GalViewCollectionItem **view_data;
- int view_count;
-
- GList *factory_list;
-
- GalViewCollectionItem **removed_view_data;
- int removed_view_count;
-
- guint loaded : 1;
- guint default_view_built_in : 1;
-
- char *system_dir;
- char *local_dir;
-
- char *default_view;
-
- char *title;
-} GalViewCollection;
-
-typedef struct {
- GObjectClass parent_class;
-
- /*
- * Signals
- */
- void (*display_view) (GalViewCollection *collection,
- GalView *view);
- void (*changed) (GalViewCollection *collection);
-} GalViewCollectionClass;
-
-struct GalViewCollectionItem {
- GalView *view;
- char *id;
- guint changed : 1;
- guint ever_changed : 1;
- guint built_in : 1;
- char *filename;
- char *title;
- char *type;
- GalViewCollection *collection;
- guint view_changed_id;
-};
-
-/* Standard functions */
-GType gal_view_collection_get_type (void);
-GalViewCollection *gal_view_collection_new (void);
-
-void gal_view_collection_set_title (GalViewCollection *collection,
- const char *title);
-/* Set up the view collection. Call these two functions before ever doing load or save and never call them again. */
-void gal_view_collection_set_storage_directories (GalViewCollection *collection,
- const char *system_dir,
- const char *local_dir);
-void gal_view_collection_add_factory (GalViewCollection *collection,
- GalViewFactory *factory);
-
-/* Send the display view signal. This function is deprecated. */
-void gal_view_collection_display_view (GalViewCollection *collection,
- GalView *view);
-
-
-/* Query the view collection. */
-gint gal_view_collection_get_count (GalViewCollection *collection);
-GalView *gal_view_collection_get_view (GalViewCollection *collection,
- int n);
-GalViewCollectionItem *gal_view_collection_get_view_item (GalViewCollection *collection,
- int n);
-int gal_view_collection_get_view_index_by_id (GalViewCollection *collection,
- const char *view_id);
-char *gal_view_collection_get_view_id_by_index (GalViewCollection *collection,
- int n);
-
-/* Manipulate the view collection */
-void gal_view_collection_append (GalViewCollection *collection,
- GalView *view);
-void gal_view_collection_delete_view (GalViewCollection *collection,
- int i);
-void gal_view_collection_copy_view (GalViewCollection *collection,
- int i);
-/* Call set_storage_directories and add factories for anything that
- * might be found there before doing either of these. */
-void gal_view_collection_load (GalViewCollection *collection);
-void gal_view_collection_save (GalViewCollection *collection);
-gboolean gal_view_collection_loaded (GalViewCollection *collection);
-
-/* Use factory list to load a GalView file. */
-GalView *gal_view_collection_load_view_from_file (GalViewCollection *collection,
- const char *type,
- const char *filename);
-
-/* Returns id of the new view. These functions are used for
- GalViewInstanceSaveAsDialog. */
-const char *gal_view_collection_append_with_title (GalViewCollection *collection,
- const char *title,
- GalView *view);
-const char *gal_view_collection_set_nth_view (GalViewCollection *collection,
- int i,
- GalView *view);
-
-const char *gal_view_collection_get_default_view (GalViewCollection *collection);
-void gal_view_collection_set_default_view (GalViewCollection *collection,
- const char *id);
-
-
-G_END_DECLS
-
-
-#endif /* _GAL_VIEW_COLLECTION_H_ */
diff --git a/widgets/menus/gal-view-etable.c b/widgets/menus/gal-view-etable.c
deleted file mode 100644
index a881b52bab..0000000000
--- a/widgets/menus/gal-view-etable.c
+++ /dev/null
@@ -1,303 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * gal-view-etable.c
- * Copyright 2000, 2001, Ximian, Inc.
- *
- * Authors:
- * Chris Lahey <clahey@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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 "gal-view-etable.h"
-#include <gal/e-table/e-table-config.h>
-
-#define PARENT_TYPE GAL_VIEW_TYPE
-
-static GalViewClass *gal_view_etable_parent_class;
-
-static void
-detach_table (GalViewEtable *view)
-{
- if (view->table == NULL)
- return;
- if (view->table_state_changed_id) {
- g_signal_handler_disconnect (view->table,
- view->table_state_changed_id);
- view->table_state_changed_id = 0;
- }
- g_object_unref (view->table);
- view->table = NULL;
-}
-
-static void
-detach_tree (GalViewEtable *view)
-{
- if (view->tree == NULL)
- return;
- if (view->tree_state_changed_id) {
- g_signal_handler_disconnect (view->tree,
- view->tree_state_changed_id);
- view->tree_state_changed_id = 0;
- }
- g_object_unref (view->tree);
- view->tree = NULL;
-}
-
-static void
-config_changed (ETableConfig *config, GalViewEtable *view)
-{
- ETableState *state;
- if (view->state)
- g_object_unref(view->state);
- g_object_get (config,
- "state", &state,
- NULL);
- view->state = e_table_state_duplicate(state);
- gal_view_changed(GAL_VIEW(view));
-}
-
-static void
-gal_view_etable_edit (GalView *view, GtkWindow *parent)
-{
- GalViewEtable *etable_view = GAL_VIEW_ETABLE(view);
- ETableConfig *config;
-
- config = e_table_config_new(etable_view->title,
- etable_view->spec,
- etable_view->state,
- parent);
-
- g_signal_connect(config, "changed",
- G_CALLBACK(config_changed), view);
-}
-
-static void
-gal_view_etable_load (GalView *view,
- const char *filename)
-{
- e_table_state_load_from_file(GAL_VIEW_ETABLE(view)->state, filename);
-}
-
-static void
-gal_view_etable_save (GalView *view,
- const char *filename)
-{
- e_table_state_save_to_file(GAL_VIEW_ETABLE(view)->state, filename);
-}
-
-static const char *
-gal_view_etable_get_title (GalView *view)
-{
- return GAL_VIEW_ETABLE(view)->title;
-}
-
-static void
-gal_view_etable_set_title (GalView *view,
- const char *title)
-{
- g_free(GAL_VIEW_ETABLE(view)->title);
- GAL_VIEW_ETABLE(view)->title = g_strdup(title);
-}
-
-static const char *
-gal_view_etable_get_type_code (GalView *view)
-{
- return "etable";
-}
-
-static GalView *
-gal_view_etable_clone (GalView *view)
-{
- GalViewEtable *gve, *new;
-
- gve = GAL_VIEW_ETABLE(view);
-
- new = g_object_new (GAL_VIEW_ETABLE_TYPE, NULL);
- new->spec = gve->spec;
- new->title = g_strdup (gve->title);
- new->state = e_table_state_duplicate(gve->state);
-
- g_object_ref(new->spec);
-
- return GAL_VIEW(new);
-}
-
-static void
-gal_view_etable_dispose (GObject *object)
-{
- GalViewEtable *view = GAL_VIEW_ETABLE(object);
-
- gal_view_etable_detach (view);
-
- g_free(view->title);
- view->title = NULL;
-
- if (view->spec)
- g_object_unref(view->spec);
- view->spec = NULL;
-
- if (view->state)
- g_object_unref(view->state);
- view->state = NULL;
-
- if (G_OBJECT_CLASS (gal_view_etable_parent_class)->dispose)
- (* G_OBJECT_CLASS (gal_view_etable_parent_class)->dispose) (object);
-}
-
-static void
-gal_view_etable_class_init (GObjectClass *object_class)
-{
- GalViewClass *gal_view_class = GAL_VIEW_CLASS(object_class);
- gal_view_etable_parent_class = g_type_class_ref (PARENT_TYPE);
-
- gal_view_class->edit = gal_view_etable_edit ;
- gal_view_class->load = gal_view_etable_load ;
- gal_view_class->save = gal_view_etable_save ;
- gal_view_class->get_title = gal_view_etable_get_title ;
- gal_view_class->set_title = gal_view_etable_set_title ;
- gal_view_class->get_type_code = gal_view_etable_get_type_code;
- gal_view_class->clone = gal_view_etable_clone ;
-
- object_class->dispose = gal_view_etable_dispose ;
-}
-
-static void
-gal_view_etable_init (GalViewEtable *gve)
-{
- gve->spec = NULL;
- gve->state = e_table_state_new();
- gve->title = NULL;
-}
-
-E_MAKE_TYPE(gal_view_etable, "GalViewEtable", GalViewEtable, gal_view_etable_class_init, gal_view_etable_init, PARENT_TYPE)
-
-/**
- * gal_view_etable_new
- * @spec: The ETableSpecification that this view will be based upon.
- * @title: The name of the new view.
- *
- * Returns a new GalViewEtable. This is primarily for use by
- * GalViewFactoryEtable.
- *
- * Returns: The new GalViewEtable.
- */
-GalView *
-gal_view_etable_new (ETableSpecification *spec,
- const gchar *title)
-{
- return gal_view_etable_construct (g_object_new (GAL_VIEW_ETABLE_TYPE, NULL), spec, title);
-}
-
-/**
- * gal_view_etable_construct
- * @view: The view to construct.
- * @spec: The ETableSpecification that this view will be based upon.
- * @title: The name of the new view.
- *
- * constructs the GalViewEtable. To be used by subclasses and
- * language bindings.
- *
- * Returns: The GalViewEtable.
- */
-GalView *
-gal_view_etable_construct (GalViewEtable *view,
- ETableSpecification *spec,
- const gchar *title)
-{
- if (spec)
- g_object_ref(spec);
- view->spec = spec;
-
- if (view->state)
- g_object_unref(view->state);
- view->state = e_table_state_duplicate(spec->state);
-
- view->title = g_strdup(title);
-
- return GAL_VIEW(view);
-}
-
-void
-gal_view_etable_set_state (GalViewEtable *view, ETableState *state)
-{
- if (view->state)
- g_object_unref(view->state);
- view->state = e_table_state_duplicate(state);
-
- gal_view_changed(GAL_VIEW(view));
-}
-
-static void
-table_state_changed (ETable *table, GalViewEtable *view)
-{
- ETableState *state;
-
- state = e_table_get_state_object (table);
- g_object_unref (view->state);
- view->state = state;
-
- gal_view_changed(GAL_VIEW(view));
-}
-
-static void
-tree_state_changed (ETree *tree, GalViewEtable *view)
-{
- ETableState *state;
-
- state = e_tree_get_state_object (tree);
- g_object_unref (view->state);
- view->state = state;
-
- gal_view_changed(GAL_VIEW(view));
-}
-
-void
-gal_view_etable_attach_table (GalViewEtable *view, ETable *table)
-{
- gal_view_etable_detach (view);
-
- view->table = table;
-
- e_table_set_state_object(view->table, view->state);
- g_object_ref (view->table);
- view->table_state_changed_id =
- g_signal_connect(view->table, "state_change",
- G_CALLBACK (table_state_changed), view);
-}
-
-void
-gal_view_etable_attach_tree (GalViewEtable *view, ETree *tree)
-{
- gal_view_etable_detach (view);
-
- view->tree = tree;
-
- e_tree_set_state_object(view->tree, view->state);
- g_object_ref (view->tree);
- view->tree_state_changed_id =
- g_signal_connect(view->tree, "state_change",
- G_CALLBACK (tree_state_changed), view);
-}
-
-void
-gal_view_etable_detach (GalViewEtable *view)
-{
- if (view->table != NULL)
- detach_table (view);
- if (view->tree != NULL)
- detach_tree (view);
-}
diff --git a/widgets/menus/gal-view-etable.h b/widgets/menus/gal-view-etable.h
deleted file mode 100644
index 65879663fa..0000000000
--- a/widgets/menus/gal-view-etable.h
+++ /dev/null
@@ -1,78 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * gal-view-etable.h
- * Copyright 2000, 2001, Ximian, Inc.
- *
- * Authors:
- * Chris Lahey <clahey@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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.
- */
-
-#ifndef _GAL_VIEW_ETABLE_H_
-#define _GAL_VIEW_ETABLE_H_
-
-#include <gtk/gtkobject.h>
-#include <gal/menus/gal-view.h>
-#include <gal/e-table/e-table-state.h>
-#include <gal/e-table/e-table-specification.h>
-#include <gal/e-table/e-table.h>
-#include <gal/e-table/e-tree.h>
-
-G_BEGIN_DECLS
-
-#define GAL_VIEW_ETABLE_TYPE (gal_view_etable_get_type ())
-#define GAL_VIEW_ETABLE(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GAL_VIEW_ETABLE_TYPE, GalViewEtable))
-#define GAL_VIEW_ETABLE_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GAL_VIEW_ETABLE_TYPE, GalViewEtableClass))
-#define GAL_IS_VIEW_ETABLE(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GAL_VIEW_ETABLE_TYPE))
-#define GAL_IS_VIEW_ETABLE_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GAL_VIEW_ETABLE_TYPE))
-
-typedef struct {
- GalView base;
-
- ETableSpecification *spec;
- ETableState *state;
- char *title;
-
- ETable *table;
- guint table_state_changed_id;
-
- ETree *tree;
- guint tree_state_changed_id;
-} GalViewEtable;
-
-typedef struct {
- GalViewClass parent_class;
-} GalViewEtableClass;
-
-/* Standard functions */
-GType gal_view_etable_get_type (void);
-GalView *gal_view_etable_new (ETableSpecification *spec,
- const gchar *title);
-GalView *gal_view_etable_construct (GalViewEtable *view,
- ETableSpecification *spec,
- const gchar *title);
-void gal_view_etable_set_state (GalViewEtable *view,
- ETableState *state);
-void gal_view_etable_attach_table (GalViewEtable *view,
- ETable *table);
-void gal_view_etable_attach_tree (GalViewEtable *view,
- ETree *tree);
-void gal_view_etable_detach (GalViewEtable *view);
-
-
-G_END_DECLS
-
-#endif /* _GAL_VIEW_ETABLE_H_ */
diff --git a/widgets/menus/gal-view-factory-etable.c b/widgets/menus/gal-view-factory-etable.c
deleted file mode 100644
index c0d68fe006..0000000000
--- a/widgets/menus/gal-view-factory-etable.c
+++ /dev/null
@@ -1,120 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * gal-view-factory-etable.c
- * Copyright 2000, 2001, Ximian, Inc.
- *
- * Authors:
- * Chris Lahey <clahey@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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 "gal/util/e-i18n.h"
-#include "gal/util/e-util.h"
-#include "gal-view-factory-etable.h"
-#include "gal-view-etable.h"
-
-#define PARENT_TYPE GAL_VIEW_FACTORY_TYPE
-
-static GalViewFactoryClass *gal_view_factory_etable_parent_class;
-
-static const char *
-gal_view_factory_etable_get_title (GalViewFactory *factory)
-{
- return _("Table");
-}
-
-static GalView *
-gal_view_factory_etable_new_view (GalViewFactory *factory,
- const char *name)
-{
- return gal_view_etable_new(GAL_VIEW_FACTORY_ETABLE(factory)->spec, name);
-}
-
-static const char *
-gal_view_factory_etable_get_type_code (GalViewFactory *factory)
-{
- return "etable";
-}
-
-static void
-gal_view_factory_etable_dispose (GObject *object)
-{
- GalViewFactoryEtable *factory = GAL_VIEW_FACTORY_ETABLE(object);
-
- if (factory->spec)
- g_object_unref(factory->spec);
- factory->spec = NULL;
-
- if (G_OBJECT_CLASS (gal_view_factory_etable_parent_class)->dispose)
- (* G_OBJECT_CLASS (gal_view_factory_etable_parent_class)->dispose) (object);
-}
-
-static void
-gal_view_factory_etable_class_init (GObjectClass *object_class)
-{
- GalViewFactoryClass *view_factory_class = GAL_VIEW_FACTORY_CLASS(object_class);
- gal_view_factory_etable_parent_class = g_type_class_ref (PARENT_TYPE);
-
- view_factory_class->get_title = gal_view_factory_etable_get_title;
- view_factory_class->new_view = gal_view_factory_etable_new_view;
- view_factory_class->get_type_code = gal_view_factory_etable_get_type_code;
-
- object_class->dispose = gal_view_factory_etable_dispose;
-}
-
-static void
-gal_view_factory_etable_init (GalViewFactoryEtable *factory)
-{
- factory->spec = NULL;
-}
-
-/**
- * gal_view_etable_new
- * @spec: The spec to create GalViewEtables based upon.
- *
- * A new GalViewFactory for creating ETable views. Create one of
- * these and pass it to GalViewCollection for use.
- *
- * Returns: The new GalViewFactoryEtable.
- */
-GalViewFactory *
-gal_view_factory_etable_new (ETableSpecification *spec)
-{
- return gal_view_factory_etable_construct (g_object_new (GAL_VIEW_FACTORY_ETABLE_TYPE, NULL), spec);
-}
-
-/**
- * gal_view_etable_construct
- * @factory: The factory to construct
- * @spec: The spec to create GalViewEtables based upon.
- *
- * constructs the GalViewFactoryEtable. To be used by subclasses and
- * language bindings.
- *
- * Returns: The GalViewFactoryEtable.
- */
-GalViewFactory *
-gal_view_factory_etable_construct (GalViewFactoryEtable *factory,
- ETableSpecification *spec)
-{
- if (spec)
- g_object_ref(spec);
- factory->spec = spec;
- return GAL_VIEW_FACTORY(factory);
-}
-
-E_MAKE_TYPE(gal_view_factory_etable, "GalViewFactoryEtable", GalViewFactoryEtable, gal_view_factory_etable_class_init, gal_view_factory_etable_init, PARENT_TYPE)
diff --git a/widgets/menus/gal-view-factory-etable.h b/widgets/menus/gal-view-factory-etable.h
deleted file mode 100644
index 542aa255fc..0000000000
--- a/widgets/menus/gal-view-factory-etable.h
+++ /dev/null
@@ -1,62 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * gal-view-factory-etable.h
- * Copyright 2000, 2001, Ximian, Inc.
- *
- * Authors:
- * Chris Lahey <clahey@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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.
- */
-
-#ifndef _GAL_VIEW_FACTORY_ETABLE_H_
-#define _GAL_VIEW_FACTORY_ETABLE_H_
-
-#include <gtk/gtkobject.h>
-#include <gal/menus/gal-view-factory.h>
-#include <gal/e-table/e-table-specification.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
-
-#define GAL_VIEW_FACTORY_ETABLE_TYPE (gal_view_factory_etable_get_type ())
-#define GAL_VIEW_FACTORY_ETABLE(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GAL_VIEW_FACTORY_ETABLE_TYPE, GalViewFactoryEtable))
-#define GAL_VIEW_FACTORY_ETABLE_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GAL_VIEW_FACTORY_ETABLE_TYPE, GalViewFactoryEtableClass))
-#define GAL_IS_VIEW_FACTORY_ETABLE(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GAL_VIEW_FACTORY_ETABLE_TYPE))
-#define GAL_IS_VIEW_FACTORY_ETABLE_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GAL_VIEW_FACTORY_ETABLE_TYPE))
-#define GAL_VIEW_FACTORY_ETABLE_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GAL_VIEW_FACTORY_ETABLE_TYPE, GalViewFactoryEtableClass))
-
-typedef struct {
- GalViewFactory base;
-
- ETableSpecification *spec;
-} GalViewFactoryEtable;
-
-typedef struct {
- GalViewFactoryClass parent_class;
-} GalViewFactoryEtableClass;
-
-/* Standard functions */
-GType gal_view_factory_etable_get_type (void);
-GalViewFactory *gal_view_factory_etable_new (ETableSpecification *spec);
-GalViewFactory *gal_view_factory_etable_construct (GalViewFactoryEtable *factory,
- ETableSpecification *spec);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* _GAL_VIEW_FACTORY_ETABLE_H_ */
diff --git a/widgets/menus/gal-view-factory.c b/widgets/menus/gal-view-factory.c
deleted file mode 100644
index 5bc2c9f11d..0000000000
--- a/widgets/menus/gal-view-factory.c
+++ /dev/null
@@ -1,107 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * gal-view-factory.c
- * Copyright 2000, 2001, Ximian, Inc.
- *
- * Authors:
- * Chris Lahey <clahey@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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 "gal-view-factory.h"
-#include "gal/util/e-util.h"
-
-#define PARENT_TYPE G_TYPE_OBJECT
-
-#define d(x)
-
-d(static gint depth = 0;)
-
-static GObjectClass *gal_view_factory_parent_class;
-
-/**
- * gal_view_factory_get_title:
- * @factory: The factory to query.
- *
- * Returns: The title of the factory.
- */
-const char *
-gal_view_factory_get_title (GalViewFactory *factory)
-{
- g_return_val_if_fail (factory != NULL, 0);
- g_return_val_if_fail (GAL_IS_VIEW_FACTORY (factory), 0);
-
- if (GAL_VIEW_FACTORY_GET_CLASS (factory)->get_title)
- return GAL_VIEW_FACTORY_GET_CLASS (factory)->get_title (factory);
- else
- return NULL;
-}
-
-/**
- * gal_view_factory_new_view:
- * @factory: The factory to use
- * @name: the name for the view.
- *
- * Returns: The new view
- */
-GalView *
-gal_view_factory_new_view (GalViewFactory *factory,
- const char *name)
-{
- g_return_val_if_fail (factory != NULL, NULL);
- g_return_val_if_fail (GAL_IS_VIEW_FACTORY (factory), NULL);
-
- if (GAL_VIEW_FACTORY_GET_CLASS (factory)->new_view)
- return GAL_VIEW_FACTORY_GET_CLASS (factory)->new_view (factory, name);
- else
- return NULL;
-}
-
-/**
- * gal_view_factory_get_type_code:
- * @factory: The factory to use
- *
- * Returns: The type code
- */
-const char *
-gal_view_factory_get_type_code (GalViewFactory *factory)
-{
- g_return_val_if_fail (factory != NULL, NULL);
- g_return_val_if_fail (GAL_IS_VIEW_FACTORY (factory), NULL);
-
- if (GAL_VIEW_FACTORY_GET_CLASS (factory)->get_type_code)
- return GAL_VIEW_FACTORY_GET_CLASS (factory)->get_type_code (factory);
- else
- return NULL;
-}
-
-static void
-gal_view_factory_class_init (GObjectClass *object_class)
-{
- GalViewFactoryClass *klass = GAL_VIEW_FACTORY_CLASS(object_class);
- gal_view_factory_parent_class = g_type_class_ref (PARENT_TYPE);
-
- klass->get_title = NULL;
- klass->new_view = NULL;
-}
-
-static void
-gal_view_factory_init (GalViewFactory *factory)
-{
-}
-
-E_MAKE_TYPE(gal_view_factory, "GalViewFactory", GalViewFactory, gal_view_factory_class_init, gal_view_factory_init, PARENT_TYPE)
diff --git a/widgets/menus/gal-view-factory.h b/widgets/menus/gal-view-factory.h
deleted file mode 100644
index 5fff83e048..0000000000
--- a/widgets/menus/gal-view-factory.h
+++ /dev/null
@@ -1,79 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * gal-view-factory.h
- * Copyright 2000, 2001, Ximian, Inc.
- *
- * Authors:
- * Chris Lahey <clahey@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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.
- */
-
-#ifndef _GAL_VIEW_FACTORY_H_
-#define _GAL_VIEW_FACTORY_H_
-
-#include <gtk/gtkobject.h>
-#include <gal/menus/gal-view.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
-
-#define GAL_VIEW_FACTORY_TYPE (gal_view_factory_get_type ())
-#define GAL_VIEW_FACTORY(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GAL_VIEW_FACTORY_TYPE, GalViewFactory))
-#define GAL_VIEW_FACTORY_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GAL_VIEW_FACTORY_TYPE, GalViewFactoryClass))
-#define GAL_IS_VIEW_FACTORY(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GAL_VIEW_FACTORY_TYPE))
-#define GAL_IS_VIEW_FACTORY_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GAL_VIEW_FACTORY_TYPE))
-#define GAL_VIEW_FACTORY_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GAL_VIEW_FACTORY_TYPE, GalViewFactoryClass))
-
-typedef struct {
- GObject base;
-} GalViewFactory;
-
-typedef struct {
- GObjectClass parent_class;
-
- /*
- * Virtual methods
- */
- const char *(*get_title) (GalViewFactory *factory);
- const char *(*get_type_code) (GalViewFactory *factory);
- GalView *(*new_view) (GalViewFactory *factory,
- const char *name);
-} GalViewFactoryClass;
-
-/* Standard functions */
-GType gal_view_factory_get_type (void);
-
-/* Query functions */
-/* Returns already translated title. */
-const char *gal_view_factory_get_title (GalViewFactory *factory);
-
-/* Returns the code for use in identifying this type of object in the
- * view list. This identifier should identify this as being the
- * unique factory for xml files which were written out with this
- * identifier. Thus each factory should have a unique type code. */
-const char *gal_view_factory_get_type_code (GalViewFactory *factory);
-
-/* Create a new view */
-GalView *gal_view_factory_new_view (GalViewFactory *factory,
- const char *name);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-
-#endif /* _GAL_VIEW_FACTORY_H_ */
diff --git a/widgets/menus/gal-view-instance-save-as-dialog.c b/widgets/menus/gal-view-instance-save-as-dialog.c
deleted file mode 100644
index 692658230f..0000000000
--- a/widgets/menus/gal-view-instance-save-as-dialog.c
+++ /dev/null
@@ -1,299 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * gal-define-views-dialog.c
- * Copyright 2000, 2001, Ximian, Inc.
- *
- * Authors:
- * Chris Lahey <clahey@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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 "gal-view-instance-save-as-dialog.h"
-
-#include "gal-define-views-model.h"
-#include "gal-view-new-dialog.h"
-#include <gal/e-table/e-table-scrolled.h>
-#include <gal/util/e-i18n.h>
-#include <gtk/gtknotebook.h>
-#include <gtk/gtkentry.h>
-#include <gtk/gtktogglebutton.h>
-#include <gtk/gtkbox.h>
-#include <gtk/gtkstock.h>
-
-static GtkDialogClass *parent_class = NULL;
-#define PARENT_TYPE GTK_TYPE_DIALOG
-
-/* The arguments we take */
-enum {
- PROP_0,
- PROP_INSTANCE,
-};
-
-typedef struct {
- char *title;
- ETableModel *model;
- GalViewInstanceSaveAsDialog *names;
-} GalViewInstanceSaveAsDialogChild;
-
-
-/* Static functions */
-static void
-gal_view_instance_save_as_dialog_set_instance(GalViewInstanceSaveAsDialog *dialog,
- GalViewInstance *instance)
-{
- dialog->instance = instance;
- if (dialog->model) {
- g_object_set(dialog->model,
- "collection", instance ? instance->collection : NULL,
- NULL);
- }
-}
-
-static void
-gvisad_setup_radio_buttons (GalViewInstanceSaveAsDialog *dialog)
-{
- GtkWidget *radio_replace = glade_xml_get_widget (dialog->gui, "radiobutton-replace");
- GtkWidget *radio_create = glade_xml_get_widget (dialog->gui, "radiobutton-create" );
- GtkWidget *widget;
- GtkNotebook *notebook = GTK_NOTEBOOK (glade_xml_get_widget (dialog->gui, "notebook-help"));
-
- widget = glade_xml_get_widget (dialog->gui, "custom-replace");
- if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (radio_replace))) {
- gtk_widget_set_sensitive (widget, TRUE);
- gtk_notebook_set_page (notebook, 0);
- dialog->toggle = GAL_VIEW_INSTANCE_SAVE_AS_DIALOG_TOGGLE_REPLACE;
- } else {
- gtk_widget_set_sensitive (widget, FALSE);
- }
-
- widget = glade_xml_get_widget (dialog->gui, "entry-create");
- if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (radio_create))) {
- gtk_widget_set_sensitive (widget, TRUE);
- gtk_notebook_set_page (notebook, 1);
- dialog->toggle = GAL_VIEW_INSTANCE_SAVE_AS_DIALOG_TOGGLE_CREATE;
- } else {
- gtk_widget_set_sensitive (widget, FALSE);
- }
-}
-
-static void
-gvisad_radio_toggled (GtkWidget *widget, GalViewInstanceSaveAsDialog *dialog)
-{
- gvisad_setup_radio_buttons (dialog);
-}
-
-static void
-gvisad_connect_signal(GalViewInstanceSaveAsDialog *dialog, char *widget_name, char *signal, GCallback handler)
-{
- GtkWidget *widget;
-
- widget = glade_xml_get_widget(dialog->gui, widget_name);
-
- if (widget)
- g_signal_connect (G_OBJECT (widget), signal, handler, dialog);
-}
-
-/* Method override implementations */
-static void
-gal_view_instance_save_as_dialog_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec)
-{
- GalViewInstanceSaveAsDialog *dialog;
-
- dialog = GAL_VIEW_INSTANCE_SAVE_AS_DIALOG (object);
-
- switch (prop_id){
- case PROP_INSTANCE:
- if (g_value_get_object (value))
- gal_view_instance_save_as_dialog_set_instance(dialog, GAL_VIEW_INSTANCE(g_value_get_object (value)));
- else
- gal_view_instance_save_as_dialog_set_instance(dialog, NULL);
- break;
-
- default:
- return;
- }
-}
-
-static void
-gal_view_instance_save_as_dialog_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec)
-{
- GalViewInstanceSaveAsDialog *dialog;
-
- dialog = GAL_VIEW_INSTANCE_SAVE_AS_DIALOG (object);
-
- switch (prop_id) {
- case PROP_INSTANCE:
- g_value_set_object (value, dialog->instance);
- break;
-
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
- break;
- }
-}
-
-static void
-gal_view_instance_save_as_dialog_dispose (GObject *object)
-{
- GalViewInstanceSaveAsDialog *gal_view_instance_save_as_dialog = GAL_VIEW_INSTANCE_SAVE_AS_DIALOG(object);
-
- if (gal_view_instance_save_as_dialog->gui)
- g_object_unref(gal_view_instance_save_as_dialog->gui);
- gal_view_instance_save_as_dialog->gui = NULL;
-
- if (G_OBJECT_CLASS (parent_class)->dispose)
- (* G_OBJECT_CLASS (parent_class)->dispose) (object);
-}
-
-/* Init functions */
-static void
-gal_view_instance_save_as_dialog_class_init (GalViewInstanceSaveAsDialogClass *klass)
-{
- GObjectClass *object_class;
-
- object_class = (GObjectClass*) klass;
-
- parent_class = g_type_class_ref (PARENT_TYPE);
-
- object_class->set_property = gal_view_instance_save_as_dialog_set_property;
- object_class->get_property = gal_view_instance_save_as_dialog_get_property;
- object_class->dispose = gal_view_instance_save_as_dialog_dispose;
-
- g_object_class_install_property (object_class, PROP_INSTANCE,
- g_param_spec_object ("instance",
- _("Instance"),
- /*_( */"XXX blurb" /*)*/,
- GAL_VIEW_INSTANCE_TYPE,
- G_PARAM_READWRITE));
-}
-
-static void
-gal_view_instance_save_as_dialog_init (GalViewInstanceSaveAsDialog *dialog)
-{
- GladeXML *gui;
- GtkWidget *widget;
- GtkWidget *etable;
-
- dialog->instance = NULL;
-
- gui = glade_xml_new_with_domain (GAL_GLADEDIR "/gal-view-instance-save-as-dialog.glade", NULL, PACKAGE);
- dialog->gui = gui;
-
- widget = glade_xml_get_widget(gui, "table-top");
- if (!widget) {
- return;
- }
- gtk_widget_ref(widget);
- gtk_container_remove (GTK_CONTAINER (widget->parent), widget);
- gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->vbox), widget, TRUE, TRUE, 0);
- gtk_widget_unref(widget);
-
- gtk_dialog_add_buttons (GTK_DIALOG (dialog),
- GTK_STOCK_OK, GTK_RESPONSE_OK,
- GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
- NULL);
-
- gvisad_connect_signal(dialog, "radiobutton-replace", "toggled", G_CALLBACK(gvisad_radio_toggled));
- gvisad_connect_signal(dialog, "radiobutton-create", "toggled", G_CALLBACK(gvisad_radio_toggled));
-
- dialog->model = NULL;
- etable = glade_xml_get_widget(dialog->gui, "custom-replace");
- if (etable) {
- dialog->model = g_object_get_data(G_OBJECT (etable), "GalViewInstanceSaveAsDialog::model");
- g_object_set(dialog->model,
- "collection", dialog->instance ? dialog->instance->collection : NULL,
- NULL);
- }
-
- gvisad_setup_radio_buttons (dialog);
- gtk_window_set_policy(GTK_WINDOW(dialog), FALSE, TRUE, FALSE);
-}
-
-
-/* For use from libglade. */
-/* ETable creation */
-#define SPEC "<ETableSpecification no-header=\"true\" cursor-mode=\"line\" draw-grid=\"false\" selection-mode=\"single\" gettext-domain=\"" E_I18N_DOMAIN "\">" \
- "<ETableColumn model_col= \"0\" _title=\"Name\" expansion=\"1.0\" minimum_width=\"18\" resizable=\"true\" cell=\"string\" compare=\"string\"/>" \
- "<ETableState> <column source=\"0\"/> <grouping> </grouping> </ETableState>" \
- "</ETableSpecification>"
-
-GtkWidget *gal_view_instance_save_as_dialog_create_etable(char *name, char *string1, char *string2, int int1, int int2);
-
-GtkWidget *
-gal_view_instance_save_as_dialog_create_etable(char *name, char *string1, char *string2, int int1, int int2)
-{
- GtkWidget *table;
- ETableModel *model;
- model = gal_define_views_model_new();
- table = e_table_scrolled_new(model, NULL, SPEC, NULL);
- g_object_set_data(G_OBJECT (table), "GalViewInstanceSaveAsDialog::model", model);
- return table;
-}
-
-/* External methods */
-/**
- * gal_view_instance_save_as_dialog_new
- *
- * Returns a new dialog for defining views.
- *
- * Returns: The GalViewInstanceSaveAsDialog.
- */
-GtkWidget*
-gal_view_instance_save_as_dialog_new (GalViewInstance *instance)
-{
- GtkWidget *widget = g_object_new (GAL_VIEW_INSTANCE_SAVE_AS_DIALOG_TYPE, NULL);
- gal_view_instance_save_as_dialog_set_instance(GAL_VIEW_INSTANCE_SAVE_AS_DIALOG (widget), instance);
- return widget;
-}
-
-E_MAKE_TYPE(gal_view_instance_save_as_dialog, "GalViewInstanceSaveAsDialog",
- GalViewInstanceSaveAsDialog,
- gal_view_instance_save_as_dialog_class_init,
- gal_view_instance_save_as_dialog_init, PARENT_TYPE)
-
-void
-gal_view_instance_save_as_dialog_save (GalViewInstanceSaveAsDialog *dialog)
-{
- GalView *view = gal_view_instance_get_current_view (dialog->instance);
- GtkWidget *widget;
- const char *title;
- int n;
- const char *id = NULL;
- switch (dialog->toggle) {
- case GAL_VIEW_INSTANCE_SAVE_AS_DIALOG_TOGGLE_REPLACE:
- widget = glade_xml_get_widget(dialog->gui, "custom-replace");
- if (widget && E_IS_TABLE_SCROLLED (widget)) {
- n = e_table_get_cursor_row (e_table_scrolled_get_table (E_TABLE_SCROLLED (widget)));
- id = gal_view_collection_set_nth_view (dialog->instance->collection, n, view);
- gal_view_collection_save (dialog->instance->collection);
- }
- break;
- case GAL_VIEW_INSTANCE_SAVE_AS_DIALOG_TOGGLE_CREATE:
- widget = glade_xml_get_widget(dialog->gui, "entry-create");
- if (widget && GTK_IS_ENTRY (widget)) {
- title = gtk_entry_get_text (GTK_ENTRY (widget));
- id = gal_view_collection_append_with_title (dialog->instance->collection, title, view);
- gal_view_collection_save (dialog->instance->collection);
- }
- break;
- }
-
- if (id) {
- gal_view_instance_set_current_view_id (dialog->instance, id);
- }
-}
diff --git a/widgets/menus/gal-view-instance-save-as-dialog.glade b/widgets/menus/gal-view-instance-save-as-dialog.glade
deleted file mode 100644
index e60357e17c..0000000000
--- a/widgets/menus/gal-view-instance-save-as-dialog.glade
+++ /dev/null
@@ -1,243 +0,0 @@
-<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*-->
-<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd" >
-
-<glade-interface>
- <widget class="GtkDialog" id="dialog1">
- <property name="visible">no</property>
- <property name="type">GTK_WINDOW_TOPLEVEL</property>
- <property name="modal">no</property>
- <property name="allow_shrink">no</property>
- <property name="allow_grow">yes</property>
- <property name="window-position">GTK_WIN_POS_NONE</property>
-
- <child internal-child="vbox">
- <widget class="GtkVBox" id="dialog-vbox1">
- <property name="homogeneous">no</property>
- <property name="spacing">8</property>
- <property name="visible">yes</property>
-
- <child internal-child="action_area">
- <widget class="GtkHButtonBox" id="dialog-action_area1">
- <property name="layout_style">GTK_BUTTONBOX_END</property>
- <property name="spacing">8</property>
- <property name="visible">yes</property>
-
- <child>
- <widget class="GtkButton" id="button1">
- <property name="can_default">yes</property>
- <property name="can_focus">yes</property>
- <property name="visible">yes</property>
- <property name="label">gtk-ok</property>
- <property name="use_stock">yes</property>
- <property name="use_underline">yes</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkButton" id="button3">
- <property name="can_default">yes</property>
- <property name="can_focus">yes</property>
- <property name="visible">yes</property>
- <property name="label">gtk-cancel</property>
- <property name="use_stock">yes</property>
- <property name="use_underline">yes</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">no</property>
- <property name="fill">yes</property>
- <property name="pack_type">GTK_PACK_END</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkTable" id="table-top">
- <property name="homogeneous">no</property>
- <property name="row_spacing">0</property>
- <property name="column_spacing">0</property>
- <property name="n-rows">5</property>
- <property name="n-columns">1</property>
- <property name="visible">yes</property>
-
- <child>
- <widget class="GtkNotebook" id="notebook-help">
- <property name="show_tabs">no</property>
- <property name="show_border">no</property>
- <property name="tab_pos">GTK_POS_TOP</property>
- <property name="scrollable">no</property>
- <property name="tab_hborder">2</property>
- <property name="tab_vborder">2</property>
- <property name="enable-popup">no</property>
- <property name="visible">yes</property>
-
- <child>
- <widget class="GtkLabel" id="label6">
- <property name="label" translatable="yes">The current view will replace the given view. Any folders
-set to this view wil be replaced with the current view.</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">no</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="visible">yes</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label4">
- <property name="label" translatable="yes">label4</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">no</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="visible">yes</property>
- </widget>
- <packing>
- <property name="type">tab</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label7">
- <property name="label" translatable="yes">This will create a new View.</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">no</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="visible">yes</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label5">
- <property name="label" translatable="yes">label5</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">no</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="visible">yes</property>
- </widget>
- <packing>
- <property name="type">tab</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">4</property>
- <property name="bottom_attach">5</property>
- <property name="x_padding">0</property>
- <property name="y_padding">0</property>
- <property name="x_options">expand|fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="Custom" id="custom-replace">
- <property name="creation_function">gal_view_instance_save_as_dialog_create_etable</property>
- <property name="int1">0</property>
- <property name="int2">0</property>
- <property name="last_modification_time">Fri, 01 Feb 2002 20:18:32 GMT</property>
- <property name="visible">yes</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">3</property>
- <property name="bottom_attach">4</property>
- <property name="x_padding">0</property>
- <property name="y_padding">0</property>
- <property name="x_options">fill</property>
- <property name="y_options">expand|fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkEntry" id="entry-create">
- <property name="sensitive">no</property>
- <property name="can_focus">yes</property>
- <property name="editable">yes</property>
- <property name="text" translatable="yes"></property>
- <property name="max-length">0</property>
- <property name="visibility">yes</property>
- <property name="visible">yes</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="x_padding">0</property>
- <property name="y_padding">0</property>
- <property name="x_options">expand|fill</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkRadioButton" id="radiobutton-replace">
- <property name="can_focus">yes</property>
- <property name="label" translatable="yes">Replace Existing View</property>
- <property name="active">no</property>
- <property name="draw_indicator">yes</property>
- <property name="visible">yes</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">2</property>
- <property name="bottom_attach">3</property>
- <property name="x_padding">0</property>
- <property name="y_padding">0</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkRadioButton" id="radiobutton-create">
- <property name="can_focus">yes</property>
- <property name="label" translatable="yes">Create New View Named</property>
- <property name="active">yes</property>
- <property name="draw_indicator">yes</property>
- <property name="visible">yes</property>
- <property name="group">radiobutton-replace</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="x_padding">0</property>
- <property name="y_padding">0</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">yes</property>
- <property name="fill">yes</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">4</property>
- <property name="expand">yes</property>
- <property name="fill">yes</property>
- </packing>
- </child>
- </widget>
-</glade-interface>
diff --git a/widgets/menus/gal-view-instance-save-as-dialog.h b/widgets/menus/gal-view-instance-save-as-dialog.h
deleted file mode 100644
index 53d99d0789..0000000000
--- a/widgets/menus/gal-view-instance-save-as-dialog.h
+++ /dev/null
@@ -1,89 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * gal-define-views-dialog.h
- * Copyright 2000, 2001, Ximian, Inc.
- *
- * Authors:
- * Chris Lahey <clahey@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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.
- */
-
-#ifndef __GAL_VIEW_INSTANCE_SAVE_AS_DIALOG_H__
-#define __GAL_VIEW_INSTANCE_SAVE_AS_DIALOG_H__
-
-#include <gtk/gtkdialog.h>
-#include <glade/glade.h>
-#include <gal/e-table/e-table-model.h>
-#include <gal/menus/gal-view-collection.h>
-#include <gal/menus/gal-view-instance.h>
-
-#ifdef __cplusplus
-extern "C" {
-#pragma }
-#endif /* __cplusplus */
-
-/* GalViewInstanceSaveAsDialog - A dialog displaying information about a contact.
- *
- * The following arguments are available:
- *
- * name type read/write description
- * --------------------------------------------------------------------------------
- */
-
-#define GAL_VIEW_INSTANCE_SAVE_AS_DIALOG_TYPE (gal_view_instance_save_as_dialog_get_type ())
-#define GAL_VIEW_INSTANCE_SAVE_AS_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GAL_VIEW_INSTANCE_SAVE_AS_DIALOG_TYPE, GalViewInstanceSaveAsDialog))
-#define GAL_VIEW_INSTANCE_SAVE_AS_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GAL_VIEW_INSTANCE_SAVE_AS_DIALOG_TYPE, GalViewInstanceSaveAsDialogClass))
-#define GAL_IS_VIEW_INSTANCE_SAVE_AS_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GAL_VIEW_INSTANCE_SAVE_AS_DIALOG_TYPE))
-#define GAL_IS_VIEW_INSTANCE_SAVE_AS_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), GAL_VIEW_INSTANCE_SAVE_AS_DIALOG_TYPE))
-
-typedef struct _GalViewInstanceSaveAsDialog GalViewInstanceSaveAsDialog;
-typedef struct _GalViewInstanceSaveAsDialogClass GalViewInstanceSaveAsDialogClass;
-
-typedef enum {
- GAL_VIEW_INSTANCE_SAVE_AS_DIALOG_TOGGLE_REPLACE,
- GAL_VIEW_INSTANCE_SAVE_AS_DIALOG_TOGGLE_CREATE
-} GalViewInstanceSaveAsDialogToggle;
-
-struct _GalViewInstanceSaveAsDialog
-{
- GtkDialog parent;
-
- /* item specific fields */
- GladeXML *gui;
- ETableModel *model;
-
- GalViewInstance *instance;
- GalViewCollection *collection;
-
- GalViewInstanceSaveAsDialogToggle toggle;
-};
-
-struct _GalViewInstanceSaveAsDialogClass
-{
- GtkDialogClass parent_class;
-};
-
-GtkWidget *gal_view_instance_save_as_dialog_new (GalViewInstance *instance);
-GType gal_view_instance_save_as_dialog_get_type (void);
-
-void gal_view_instance_save_as_dialog_save (GalViewInstanceSaveAsDialog *dialog);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-
-#endif /* __GAL_VIEW_INSTANCE_SAVE_AS_DIALOG_H__ */
diff --git a/widgets/menus/gal-view-instance.c b/widgets/menus/gal-view-instance.c
deleted file mode 100644
index 19a3726de2..0000000000
--- a/widgets/menus/gal-view-instance.c
+++ /dev/null
@@ -1,595 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * gal-view-instance.c
- * Copyright 2000, 2001, Ximian, Inc.
- *
- * Authors:
- * Chris Lahey <clahey@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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 <util/e-i18n.h>
-#include <ctype.h>
-#include <string.h>
-#include <errno.h>
-#include <libxml/parser.h>
-#include <libgnome/gnome-util.h>
-#include <gal/util/e-util.h>
-#include <gal/util/e-xml-utils.h>
-#include <gal/widgets/e-unicode.h>
-#include "gal-view-instance.h"
-#include "gal-view-instance-save-as-dialog.h"
-#include "gal-define-views-dialog.h"
-#include <sys/stat.h>
-#include <unistd.h>
-#include <gtk/gtkcheckmenuitem.h>
-
-#define PARENT_TYPE G_TYPE_OBJECT
-
-static GObjectClass *gal_view_instance_parent_class;
-
-static const EPopupMenu separator = E_POPUP_SEPARATOR;
-static const EPopupMenu terminator = E_POPUP_TERMINATOR;
-
-
-#define d(x) x
-
-enum {
- DISPLAY_VIEW,
- CHANGED,
- LAST_SIGNAL
-};
-
-static guint gal_view_instance_signals [LAST_SIGNAL] = { 0, };
-
-static void
-gal_view_instance_changed (GalViewInstance *instance)
-{
- g_return_if_fail (instance != NULL);
- g_return_if_fail (GAL_IS_VIEW_INSTANCE (instance));
-
- g_signal_emit (instance,
- gal_view_instance_signals [CHANGED], 0);
-}
-
-static void
-gal_view_instance_display_view (GalViewInstance *instance, GalView *view)
-{
- g_return_if_fail (instance != NULL);
- g_return_if_fail (GAL_IS_VIEW_INSTANCE (instance));
-
- g_signal_emit (instance,
- gal_view_instance_signals [DISPLAY_VIEW], 0,
- view);
-}
-
-static void
-save_current_view (GalViewInstance *instance)
-{
- xmlDoc *doc;
- xmlNode *root;
-
- doc = xmlNewDoc("1.0");
- root = xmlNewNode (NULL, "GalViewCurrentView");
- xmlDocSetRootElement(doc, root);
-
- if (instance->current_id)
- e_xml_set_string_prop_by_name (root, "current_view", instance->current_id);
- if (instance->current_type)
- e_xml_set_string_prop_by_name (root, "current_view_type", instance->current_type);
-
- if (e_xml_save_file (instance->current_view_filename, doc) == -1)
- g_warning ("Unable to save view to %s - %s", instance->current_view_filename, g_strerror(errno));
- xmlFreeDoc(doc);
-}
-
-static void
-view_changed (GalView *view, GalViewInstance *instance)
-{
- if (instance->current_id != NULL) {
- g_free (instance->current_id);
- instance->current_id = NULL;
- save_current_view (instance);
- gal_view_instance_changed(instance);
- }
-
- gal_view_save (view, instance->custom_filename);
-}
-
-static void
-disconnect_view (GalViewInstance *instance)
-{
- if (instance->current_view) {
- if (instance->view_changed_id) {
- g_signal_handler_disconnect (instance->current_view,
- instance->view_changed_id);
- }
-
- g_object_unref (instance->current_view);
- }
- g_free (instance->current_type);
- g_free (instance->current_title);
- instance->current_title = NULL;
- instance->current_type = NULL;
- instance->view_changed_id = 0;
- instance->current_view = NULL;
-}
-
-static void
-connect_view (GalViewInstance *instance, GalView *view)
-{
- if (instance->current_view)
- disconnect_view (instance);
- instance->current_view = view;
-
- instance->current_title = g_strdup (gal_view_get_title(view));
- instance->current_type = g_strdup (gal_view_get_type_code(view));
- instance->view_changed_id =
- g_signal_connect(instance->current_view, "changed",
- G_CALLBACK (view_changed), instance);
-
- gal_view_instance_display_view (instance, instance->current_view);
-}
-
-static void
-gal_view_instance_dispose (GObject *object)
-{
- GalViewInstance *instance = GAL_VIEW_INSTANCE(object);
-
- if (instance->collection) {
- if (instance->collection_changed_id) {
- g_signal_handler_disconnect (instance->collection,
- instance->collection_changed_id);
- }
- g_object_unref (instance->collection);
- }
-
- g_free (instance->instance_id);
- g_free (instance->custom_filename);
- g_free (instance->current_view_filename);
-
- g_free (instance->current_id);
- disconnect_view (instance);
-
- g_free (instance->default_view);
-
- if (gal_view_instance_parent_class->dispose)
- (*gal_view_instance_parent_class->dispose)(object);
-}
-
-static void
-gal_view_instance_class_init (GObjectClass *object_class)
-{
- GalViewInstanceClass *klass = GAL_VIEW_INSTANCE_CLASS(object_class);
- gal_view_instance_parent_class = g_type_class_ref (PARENT_TYPE);
-
- object_class->dispose = gal_view_instance_dispose;
-
- gal_view_instance_signals [DISPLAY_VIEW] =
- g_signal_new ("display_view",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (GalViewInstanceClass, display_view),
- NULL, NULL,
- g_cclosure_marshal_VOID__OBJECT,
- G_TYPE_NONE, 1, GAL_VIEW_TYPE);
-
- gal_view_instance_signals [CHANGED] =
- g_signal_new ("changed",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (GalViewInstanceClass, changed),
- NULL, NULL,
- g_cclosure_marshal_VOID__VOID,
- G_TYPE_NONE, 0);
-
- klass->display_view = NULL;
- klass->changed = NULL;
-}
-
-static void
-gal_view_instance_init (GalViewInstance *instance)
-{
- instance->collection = NULL;
-
- instance->instance_id = NULL;
- instance->custom_filename = NULL;
- instance->current_view_filename = NULL;
-
- instance->current_title = NULL;
- instance->current_type = NULL;
- instance->current_id = NULL;
- instance->current_view = NULL;
-
- instance->view_changed_id = 0;
- instance->collection_changed_id = 0;
-
- instance->loaded = FALSE;
- instance->default_view = NULL;
-}
-
-E_MAKE_TYPE(gal_view_instance, "GalViewInstance", GalViewInstance, gal_view_instance_class_init, gal_view_instance_init, PARENT_TYPE)
-
-static void
-collection_changed (GalView *view, GalViewInstance *instance)
-{
- if (instance->current_id) {
- char *view_id = instance->current_id;
- instance->current_id = NULL;
- gal_view_instance_set_current_view_id (instance, view_id);
- g_free (view_id);
- }
-}
-
-static void
-load_current_view (GalViewInstance *instance)
-{
- xmlDoc *doc;
- xmlNode *root;
- GalView *view = NULL;
-
- doc = xmlParseFile(instance->current_view_filename);
-
- if (doc == NULL) {
- instance->current_id = g_strdup (gal_view_instance_get_default_view (instance));
-
- if (instance->current_id) {
- int index = gal_view_collection_get_view_index_by_id (instance->collection,
- instance->current_id);
-
- if (index != -1) {
- view = gal_view_collection_get_view (instance->collection,
- index);
- view = gal_view_clone(view);
- connect_view (instance, view);
- }
- }
- return;
- }
-
- root = xmlDocGetRootElement(doc);
- instance->current_id = e_xml_get_string_prop_by_name_with_default (root, "current_view", NULL);
-
- if (instance->current_id != NULL) {
- int index = gal_view_collection_get_view_index_by_id (instance->collection,
- instance->current_id);
-
- if (index != -1) {
- view = gal_view_collection_get_view (instance->collection,
- index);
- view = gal_view_clone(view);
- }
- }
- if (view == NULL) {
- char *type;
- type = e_xml_get_string_prop_by_name_with_default (root, "current_view_type", NULL);
- view = gal_view_collection_load_view_from_file (instance->collection,
- type,
- instance->custom_filename);
- g_free (type);
- }
-
- connect_view (instance, view);
-
- xmlFreeDoc(doc);
-}
-
-/**
- * gal_view_instance_new:
- * @collection: This %GalViewCollection should be loaded before being passed to this function.
- * @instance_id: Which instance of this type of object is this (for most of evo, this is the folder id.)
- *
- * Create a new %GalViewInstance.
- *
- * Return value: The new %GalViewInstance.
- **/
-GalViewInstance *
-gal_view_instance_new (GalViewCollection *collection, const char *instance_id)
-{
- GalViewInstance *instance = g_object_new (GAL_VIEW_INSTANCE_TYPE, NULL);
- if (gal_view_instance_construct (instance, collection, instance_id))
- return instance;
- else {
- g_object_unref (instance);
- return NULL;
- }
-}
-
-GalViewInstance *
-gal_view_instance_construct (GalViewInstance *instance, GalViewCollection *collection, const char *instance_id)
-{
- char *filename;
- char *safe_id;
-
- g_return_val_if_fail (gal_view_collection_loaded (collection), NULL);
-
- instance->collection = collection;
- if (collection)
- g_object_ref (collection);
- instance->collection_changed_id =
- g_signal_connect (collection, "changed",
- G_CALLBACK (collection_changed), instance);
-
- if (instance_id)
- instance->instance_id = g_strdup (instance_id);
- else
- instance->instance_id = g_strdup ("");
-
- safe_id = g_strdup (instance->instance_id);
- e_filename_make_safe (safe_id);
-
- filename = g_strdup_printf ("custom_view-%s.xml", safe_id);
- instance->custom_filename = g_concat_dir_and_file (instance->collection->local_dir, filename);
- g_free (filename);
-
- filename = g_strdup_printf ("current_view-%s.xml", safe_id);
- instance->current_view_filename = g_concat_dir_and_file (instance->collection->local_dir, filename);
- g_free (filename);
-
- g_free (safe_id);
-
- return instance;
-}
-
-/* Manipulate the current view. */
-char *
-gal_view_instance_get_current_view_id (GalViewInstance *instance)
-{
- if (instance->current_id && gal_view_collection_get_view_index_by_id (instance->collection, instance->current_id) != -1)
- return g_strdup (instance->current_id);
- else
- return NULL;
-}
-
-void
-gal_view_instance_set_current_view_id (GalViewInstance *instance, const char *view_id)
-{
- GalView *view;
- int index;
-
- g_return_if_fail (instance != NULL);
- g_return_if_fail (GAL_IS_VIEW_INSTANCE (instance));
-
- d(g_print("%s: view_id set to %s\n", G_GNUC_FUNCTION, view_id));
-
- if (instance->current_id && !strcmp (instance->current_id, view_id))
- return;
-
- g_free (instance->current_id);
- instance->current_id = g_strdup (view_id);
-
- index = gal_view_collection_get_view_index_by_id (instance->collection, view_id);
- if (index != -1) {
- view = gal_view_collection_get_view (instance->collection, index);
- connect_view (instance, gal_view_clone (view));
- }
-
- save_current_view (instance);
- gal_view_instance_changed(instance);
- gal_view_instance_display_view (instance, instance->current_view);
-}
-
-GalView *
-gal_view_instance_get_current_view (GalViewInstance *instance)
-{
- return instance->current_view;
-}
-
-void
-gal_view_instance_set_custom_view (GalViewInstance *instance, GalView *view)
-{
- g_free (instance->current_id);
- instance->current_id = NULL;
-
- view = gal_view_clone (view);
- connect_view (instance, view);
- gal_view_save (view, instance->custom_filename);
- save_current_view (instance);
- gal_view_instance_changed(instance);
-}
-
-static void
-dialog_response(GtkWidget *dialog, int id, GalViewInstance *instance)
-{
- if (id == GTK_RESPONSE_OK) {
- gal_view_instance_save_as_dialog_save (GAL_VIEW_INSTANCE_SAVE_AS_DIALOG (dialog));
- }
- gtk_widget_destroy (dialog);
-}
-
-void
-gal_view_instance_save_as (GalViewInstance *instance)
-{
- GtkWidget *dialog = gal_view_instance_save_as_dialog_new(instance);
- g_signal_connect(dialog, "response",
- G_CALLBACK(dialog_response), instance);
- gtk_widget_show(dialog);
-}
-
-/* This is idempotent. Once it's been called once, the rest of the calls are ignored. */
-void
-gal_view_instance_load (GalViewInstance *instance)
-{
- if (!instance->loaded) {
- load_current_view (instance);
- instance->loaded = TRUE;
- }
-}
-
-/* These only mean anything before gal_view_instance_load is called the first time. */
-const char *
-gal_view_instance_get_default_view (GalViewInstance *instance)
-{
- if (instance->default_view)
- return instance->default_view;
- else
- return gal_view_collection_get_default_view (instance->collection);
-}
-
-void
-gal_view_instance_set_default_view (GalViewInstance *instance, const char *id)
-{
- g_free (instance->default_view);
- instance->default_view = g_strdup (id);
-}
-
-gboolean
-gal_view_instance_exists (GalViewInstance *instance)
-{
- struct stat st;
-
- if (instance->current_view_filename && stat (instance->current_view_filename, &st) == 0 && st.st_size > 0 && S_ISREG (st.st_mode))
- return TRUE;
- else
- return FALSE;
-
-}
-
-typedef struct {
- GalViewInstance *instance;
- char *id;
-} ListenerClosure;
-
-static void
-view_item_cb (GtkWidget *widget,
- gpointer user_data)
-{
- ListenerClosure *closure = user_data;
-
- if (GTK_CHECK_MENU_ITEM (widget)->active) {
- gal_view_instance_set_current_view_id (closure->instance, closure->id);
- }
-}
-
-static void
-add_popup_radio_item (EPopupMenu *menu_item,
- gchar *title,
- GtkSignalFunc fn,
- gpointer closure,
- gboolean value)
-{
- EPopupMenu menu_item_struct =
- E_POPUP_RADIO_ITEM_CC (title,
- fn,
- closure,
- 0,
- 0);
- menu_item_struct.is_active = value;
-
- e_popup_menu_copy_1 (menu_item, &menu_item_struct);
-}
-
-static void
-add_popup_menu_item (EPopupMenu *menu_item,
- gchar *title,
- GCallback fn,
- gpointer closure)
-{
- EPopupMenu menu_item_struct =
- E_POPUP_ITEM_CC (title,
- fn,
- closure,
- 0);
-
- e_popup_menu_copy_1 (menu_item, &menu_item_struct);
-}
-
-static void
-define_views_dialog_response(GtkWidget *dialog, int id, GalViewInstance *instance)
-{
- if (id == GTK_RESPONSE_OK) {
- gal_view_collection_save(instance->collection);
- }
- gtk_widget_destroy (dialog);
-}
-
-static void
-define_views_cb(GtkWidget *widget,
- GalViewInstance *instance)
-{
- GtkWidget *dialog = gal_define_views_dialog_new(instance->collection);
- g_signal_connect(dialog, "response",
- G_CALLBACK(define_views_dialog_response), instance);
- gtk_widget_show(dialog);
-}
-
-static void
-save_current_view_cb(GtkWidget *widget,
- GalViewInstance *instance)
-{
- gal_view_instance_save_as (instance);
-}
-
-EPopupMenu *
-gal_view_instance_get_popup_menu (GalViewInstance *instance)
-{
- EPopupMenu *ret_val;
- int length;
- int i;
- gboolean found = FALSE;
- char *id;
-
- length = gal_view_collection_get_count(instance->collection);
- id = gal_view_instance_get_current_view_id (instance);
-
- ret_val = g_new (EPopupMenu, length + 6);
-
- for (i = 0; i < length; i++) {
- gboolean value = FALSE;
- GalViewCollectionItem *item = gal_view_collection_get_view_item(instance->collection, i);
- ListenerClosure *closure;
-
- closure = g_new (ListenerClosure, 1);
- closure->instance = instance;
- closure->id = item->id;
- g_object_ref (closure->instance);
-
- if (!found && id && !strcmp (id, item->id)) {
- found = TRUE;
- value = TRUE;
- }
-
- add_popup_radio_item (ret_val + i, item->title, G_CALLBACK (view_item_cb), closure, value);
- }
-
- if (!found) {
- e_popup_menu_copy_1 (ret_val + i++, &separator);
-
- add_popup_radio_item (ret_val + i++, N_("Custom View"), NULL, NULL, TRUE);
- add_popup_menu_item (ret_val + i++, N_("Save Custom View"), G_CALLBACK (save_current_view_cb), instance);
- }
-
- e_popup_menu_copy_1 (ret_val + i++, &separator);
- add_popup_menu_item (ret_val + i++, N_("Define Views"), G_CALLBACK (define_views_cb), instance);
- e_popup_menu_copy_1 (ret_val + i++, &terminator);
-
- return ret_val;
-}
-
-void
-gal_view_instance_free_popup_menu (GalViewInstance *instance, EPopupMenu *menu)
-{
- int i;
- /* This depends on the first non-custom closure to be a separator or a terminator. */
- for (i = 0; menu[i].name && *(menu[i].name); i++) {
- g_object_unref (((ListenerClosure *)(menu[i].closure))->instance);
- g_free (menu[i].closure);
- }
-
- e_popup_menu_free (menu);
-}
diff --git a/widgets/menus/gal-view-instance.h b/widgets/menus/gal-view-instance.h
deleted file mode 100644
index 05723a2ea6..0000000000
--- a/widgets/menus/gal-view-instance.h
+++ /dev/null
@@ -1,116 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * gal-view-instance.h
- * Copyright 2000, 2001, Ximian, Inc.
- *
- * Authors:
- * Chris Lahey <clahey@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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.
- */
-
-#ifndef _GAL_VIEW_INSTANCE_H_
-#define _GAL_VIEW_INSTANCE_H_
-
-#include <gtk/gtkobject.h>
-#include <gal/menus/gal-view-collection.h>
-#include <gal/widgets/e-popup-menu.h>
-
-G_BEGIN_DECLS
-
-#define GAL_VIEW_INSTANCE_TYPE (gal_view_instance_get_type ())
-#define GAL_VIEW_INSTANCE(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GAL_VIEW_INSTANCE_TYPE, GalViewInstance))
-#define GAL_VIEW_INSTANCE_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GAL_VIEW_INSTANCE_TYPE, GalViewInstanceClass))
-#define GAL_IS_VIEW_INSTANCE(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GAL_VIEW_INSTANCE_TYPE))
-#define GAL_IS_VIEW_INSTANCE_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GAL_VIEW_INSTANCE_TYPE))
-
-typedef struct {
- GObject base;
-
- GalViewCollection *collection;
-
- char *instance_id;
- char *current_view_filename;
- char *custom_filename;
-
- char *current_title;
- char *current_type;
- char *current_id;
-
- GalView *current_view;
-
- guint view_changed_id;
- guint collection_changed_id;
-
- guint loaded : 1;
- char *default_view;
-} GalViewInstance;
-
-typedef struct {
- GObjectClass parent_class;
-
- /*
- * Signals
- */
- void (*display_view) (GalViewInstance *instance,
- GalView *view);
- void (*changed) (GalViewInstance *instance);
-} GalViewInstanceClass;
-
-/* Standard functions */
-GType gal_view_instance_get_type (void);
-
-/* */
-/*collection should be loaded when you call this.
- instance_id: Which instance of this type of object is this (for most of evo, this is the folder id.) */
-GalViewInstance *gal_view_instance_new (GalViewCollection *collection,
- const char *instance_id);
-GalViewInstance *gal_view_instance_construct (GalViewInstance *instance,
- GalViewCollection *collection,
- const char *instance_id);
-
-/* Manipulate the current view. */
-char *gal_view_instance_get_current_view_id (GalViewInstance *instance);
-void gal_view_instance_set_current_view_id (GalViewInstance *instance,
- const char *view_id);
-GalView *gal_view_instance_get_current_view (GalViewInstance *instance);
-
-/* Sets the current view to the given custom view. */
-void gal_view_instance_set_custom_view (GalViewInstance *instance,
- GalView *view);
-
-
-/* Returns true if this instance has ever been used before. */
-gboolean gal_view_instance_exists (GalViewInstance *instance);
-
-/* Manipulate the view collection */
-/* void gal_view_instance_set_as_default (GalViewInstance *instance); */
-void gal_view_instance_save_as (GalViewInstance *instance);
-
-/* This is idempotent. Once it's been called once, the rest of the calls are ignored. */
-void gal_view_instance_load (GalViewInstance *instance);
-
-/* These only mean anything before gal_view_instance_load is called the first time. */
-const char *gal_view_instance_get_default_view (GalViewInstance *instance);
-void gal_view_instance_set_default_view (GalViewInstance *instance,
- const char *id);
-
-EPopupMenu *gal_view_instance_get_popup_menu (GalViewInstance *instance);
-void gal_view_instance_free_popup_menu (GalViewInstance *instance,
- EPopupMenu *menu);
-
-G_END_DECLS
-
-#endif /* _GAL_VIEW_INSTANCE_H_ */
diff --git a/widgets/menus/gal-view-new-dialog.c b/widgets/menus/gal-view-new-dialog.c
deleted file mode 100644
index b529959178..0000000000
--- a/widgets/menus/gal-view-new-dialog.c
+++ /dev/null
@@ -1,284 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * gal-view-new-dialog.c
- * Copyright 2000, 2001, Ximian, Inc.
- *
- * Authors:
- * Chris Lahey <clahey@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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 <gtk/gtk.h>
-#include <gtk/gtktreeselection.h>
-#include "gal-view-new-dialog.h"
-#include "gal-define-views-model.h"
-#include <gal/widgets/e-unicode.h>
-#include <gal/e-table/e-table-scrolled.h>
-#include <gal/util/e-i18n.h>
-#include <gal/util/e-util.h>
-
-static void gal_view_new_dialog_init (GalViewNewDialog *card);
-static void gal_view_new_dialog_class_init (GalViewNewDialogClass *klass);
-static void gal_view_new_dialog_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec);
-static void gal_view_new_dialog_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec);
-static void gal_view_new_dialog_dispose (GObject *object);
-
-static GtkDialogClass *parent_class = NULL;
-#define PARENT_TYPE GTK_TYPE_DIALOG
-
-/* The arguments we take */
-enum {
- PROP_0,
- PROP_NAME,
- PROP_FACTORY
-};
-
-E_MAKE_TYPE(gal_view_new_dialog, "GalViewNewDialog",
- GalViewNewDialog,
- gal_view_new_dialog_class_init,
- gal_view_new_dialog_init, PARENT_TYPE)
-
-static void
-gal_view_new_dialog_class_init (GalViewNewDialogClass *klass)
-{
- GObjectClass *object_class;
-
- object_class = (GObjectClass*) klass;
-
- parent_class = g_type_class_ref (PARENT_TYPE);
-
- object_class->set_property = gal_view_new_dialog_set_property;
- object_class->get_property = gal_view_new_dialog_get_property;
- object_class->dispose = gal_view_new_dialog_dispose;
-
- g_object_class_install_property (object_class, PROP_NAME,
- g_param_spec_string ("name",
- _("Name"),
- /*_( */"XXX blurb" /*)*/,
- NULL,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_FACTORY,
- g_param_spec_object ("factory",
- _("Factory"),
- /*_( */"XXX blurb" /*)*/,
- GAL_VIEW_FACTORY_TYPE,
- G_PARAM_READWRITE));
-}
-
-static void
-gal_view_new_dialog_init (GalViewNewDialog *dialog)
-{
- GladeXML *gui;
- GtkWidget *widget;
-
- gui = glade_xml_new (GAL_GLADEDIR "/gal-view-new-dialog.glade", NULL, PACKAGE);
- dialog->gui = gui;
-
- widget = glade_xml_get_widget(gui, "table-top");
- if (!widget) {
- return;
- }
- gtk_widget_ref(widget);
- gtk_container_remove (GTK_CONTAINER (widget->parent), widget);
- gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->vbox), widget, TRUE, TRUE, 0);
- gtk_widget_unref(widget);
-
- gtk_dialog_add_buttons (GTK_DIALOG (dialog),
- GTK_STOCK_OK, GTK_RESPONSE_OK,
- GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
- NULL);
-
- gtk_window_set_policy(GTK_WINDOW(dialog), FALSE, TRUE, FALSE);
- gtk_window_set_modal (GTK_WINDOW(dialog), TRUE);
-
- dialog->collection = NULL;
- dialog->selected_factory = NULL;
-}
-
-static void
-gal_view_new_dialog_dispose (GObject *object)
-{
- GalViewNewDialog *gal_view_new_dialog = GAL_VIEW_NEW_DIALOG(object);
-
- if (gal_view_new_dialog->gui)
- g_object_unref(gal_view_new_dialog->gui);
- gal_view_new_dialog->gui = NULL;
-
- if (G_OBJECT_CLASS (parent_class)->dispose)
- (* G_OBJECT_CLASS (parent_class)->dispose) (object);
-}
-
-GtkWidget*
-gal_view_new_dialog_new (GalViewCollection *collection)
-{
- GtkWidget *widget =
- gal_view_new_dialog_construct(g_object_new (GAL_VIEW_NEW_DIALOG_TYPE, NULL),
- collection);
- return widget;
-}
-
-static void
-sensitize_ok_response (GalViewNewDialog *dialog)
-{
- gboolean ok = TRUE;
- const char *text;
-
- text = gtk_entry_get_text (GTK_ENTRY (dialog->entry));
- if (!text || !text[0])
- ok = FALSE;
-
- if (!dialog->selected_factory)
- ok = FALSE;
-
- gtk_dialog_set_response_sensitive (GTK_DIALOG (dialog), GTK_RESPONSE_OK, ok);
-}
-
-static gboolean
-selection_func (GtkTreeSelection *selection,
- GtkTreeModel *model,
- GtkTreePath *path,
- gboolean path_currently_selected,
- gpointer data)
-{
- GtkTreeIter iter;
- GalViewNewDialog *dialog = data;
-
- if (path_currently_selected)
- return TRUE;
-
- gtk_tree_model_get_iter (GTK_TREE_MODEL (dialog->list_store),
- &iter,
- (GtkTreePath*)path);
-
- gtk_tree_model_get (GTK_TREE_MODEL (dialog->list_store),
- &iter,
- 1, &dialog->selected_factory,
- -1);
-
- printf ("%s factory selected\n", gal_view_factory_get_title(dialog->selected_factory));
-
- sensitize_ok_response (dialog);
-
- return TRUE;
-}
-
-static void
-entry_changed (GtkWidget *entry, gpointer data)
-{
- GalViewNewDialog *dialog = data;
-
- sensitize_ok_response (dialog);
-}
-
-GtkWidget*
-gal_view_new_dialog_construct (GalViewNewDialog *dialog,
- GalViewCollection *collection)
-{
- GList *iterator;
- GtkTreeSelection *selection;
- GtkTreeViewColumn *column;
- GtkCellRenderer *rend;
-
- dialog->collection = collection;
- dialog->list = glade_xml_get_widget(dialog->gui,"list-type-list");
- dialog->entry = glade_xml_get_widget(dialog->gui, "entry-name");
- dialog->list_store = gtk_list_store_new (2,
- G_TYPE_STRING,
- G_TYPE_POINTER);
-
- rend = gtk_cell_renderer_text_new ();
- column = gtk_tree_view_column_new_with_attributes ("factory title",
- rend,
- "text", 0,
- NULL);
-
- gtk_tree_view_append_column (GTK_TREE_VIEW (dialog->list), column);
-
- iterator = dialog->collection->factory_list;
- for ( ; iterator; iterator = g_list_next(iterator) ) {
- GalViewFactory *factory = iterator->data;
- GtkTreeIter iter;
-
- g_object_ref(factory);
- gtk_list_store_append (dialog->list_store,
- &iter);
- gtk_list_store_set (dialog->list_store,
- &iter,
- 0, gal_view_factory_get_title(factory),
- 1, factory,
- -1);
- }
-
- gtk_tree_view_set_model (GTK_TREE_VIEW (dialog->list), GTK_TREE_MODEL (dialog->list_store));
-
- selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (dialog->list));
- gtk_tree_selection_set_select_function (selection, selection_func, dialog, NULL);
-
- g_signal_connect (dialog->entry, "changed",
- G_CALLBACK (entry_changed), dialog);
-
- sensitize_ok_response (dialog);
-
- return GTK_WIDGET(dialog);
-}
-
-static void
-gal_view_new_dialog_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec)
-{
- GalViewNewDialog *dialog;
- GtkWidget *entry;
-
- dialog = GAL_VIEW_NEW_DIALOG (object);
-
- switch (prop_id){
- case PROP_NAME:
-
- if (entry && GTK_IS_ENTRY(entry)) {
- gtk_entry_set_text(GTK_ENTRY(entry), g_value_get_string (value));
- }
- break;
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
- return;
- }
-}
-
-
-static void
-gal_view_new_dialog_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec)
-{
- GalViewNewDialog *dialog;
- GtkWidget *entry;
-
- dialog = GAL_VIEW_NEW_DIALOG (object);
-
- switch (prop_id) {
- case PROP_NAME:
- entry = glade_xml_get_widget(dialog->gui, "entry-name");
- if (entry && GTK_IS_ENTRY(entry)) {
- g_value_set_string (value, gtk_entry_get_text (GTK_ENTRY (entry)));
- }
- break;
- case PROP_FACTORY:
- g_value_set_object (value, dialog->selected_factory);
- break;
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
- break;
- }
-}
diff --git a/widgets/menus/gal-view-new-dialog.glade b/widgets/menus/gal-view-new-dialog.glade
deleted file mode 100644
index 70922f5dc5..0000000000
--- a/widgets/menus/gal-view-new-dialog.glade
+++ /dev/null
@@ -1,175 +0,0 @@
-<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*-->
-<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd">
-
-<glade-interface>
-
-<widget class="GtkDialog" id="dialog1">
- <property name="title" translatable="yes"></property>
- <property name="type">GTK_WINDOW_TOPLEVEL</property>
- <property name="window_position">GTK_WIN_POS_NONE</property>
- <property name="modal">False</property>
- <property name="resizable">True</property>
- <property name="destroy_with_parent">False</property>
- <property name="has_separator">True</property>
-
- <child internal-child="vbox">
- <widget class="GtkVBox" id="dialog-vbox1">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">8</property>
-
- <child internal-child="action_area">
- <widget class="GtkHButtonBox" id="dialog-action_area1">
- <property name="visible">True</property>
- <property name="layout_style">GTK_BUTTONBOX_END</property>
-
- <child>
- <widget class="GtkButton" id="button1">
- <property name="visible">True</property>
- <property name="can_default">True</property>
- <property name="can_focus">True</property>
- <property name="label">gtk-ok</property>
- <property name="use_stock">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="response_id">0</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkButton" id="button3">
- <property name="visible">True</property>
- <property name="can_default">True</property>
- <property name="can_focus">True</property>
- <property name="label">gtk-cancel</property>
- <property name="use_stock">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="response_id">0</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="pack_type">GTK_PACK_END</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkTable" id="table-top">
- <property name="visible">True</property>
- <property name="n_rows">4</property>
- <property name="n_columns">1</property>
- <property name="homogeneous">False</property>
- <property name="row_spacing">6</property>
- <property name="column_spacing">6</property>
-
- <child>
- <widget class="GtkLabel" id="label1">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Name of new view:</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="mnemonic_widget">entry-name</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkEntry" id="entry-name">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="editable">True</property>
- <property name="visibility">True</property>
- <property name="max_length">0</property>
- <property name="text" translatable="yes"></property>
- <property name="has_frame">True</property>
- <property name="invisible_char" translatable="yes">*</property>
- <property name="activates_default">False</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label2">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Type of view:</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">2</property>
- <property name="bottom_attach">3</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkScrolledWindow" id="scrolledwindow1">
- <property name="visible">True</property>
- <property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
- <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
- <property name="shadow_type">GTK_SHADOW_IN</property>
- <property name="window_placement">GTK_CORNER_TOP_LEFT</property>
-
- <child>
- <widget class="GtkTreeView" id="list-type-list">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="headers_visible">False</property>
- <property name="rules_hint">False</property>
- <property name="reorderable">False</property>
- <property name="enable_search">True</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">3</property>
- <property name="bottom_attach">4</property>
- <property name="x_options">fill</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
- </widget>
- </child>
-</widget>
-
-</glade-interface>
diff --git a/widgets/menus/gal-view-new-dialog.h b/widgets/menus/gal-view-new-dialog.h
deleted file mode 100644
index cd523a2476..0000000000
--- a/widgets/menus/gal-view-new-dialog.h
+++ /dev/null
@@ -1,86 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * gal-view-new-dialog.h
- * Copyright 2000, 2001, Ximian, Inc.
- *
- * Authors:
- * Chris Lahey <clahey@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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.
- */
-
-#ifndef __GAL_VIEW_NEW_DIALOG_H__
-#define __GAL_VIEW_NEW_DIALOG_H__
-
-#include <gtk/gtkdialog.h>
-#include <gtk/gtkliststore.h>
-#include <glade/glade.h>
-#include <gal-view-collection.h>
-
-#ifdef __cplusplus
-extern "C" {
-#pragma }
-#endif /* __cplusplus */
-
-/* GalViewNewDialog - A dialog displaying information about a contact.
- *
- * The following arguments are available:
- *
- * name type read/write description
- * --------------------------------------------------------------------------------
- */
-
-#define GAL_VIEW_NEW_DIALOG_TYPE (gal_view_new_dialog_get_type ())
-#define GAL_VIEW_NEW_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GAL_VIEW_NEW_DIALOG_TYPE, GalViewNewDialog))
-#define GAL_VIEW_NEW_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GAL_VIEW_NEW_DIALOG_TYPE, GalViewNewDialogClass))
-#define GAL_IS_VIEW_NEW_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GAL_VIEW_NEW_DIALOG_TYPE))
-#define GAL_IS_VIEW_NEW_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), GAL_VIEW_NEW_DIALOG_TYPE))
-
-typedef struct _GalViewNewDialog GalViewNewDialog;
-typedef struct _GalViewNewDialogClass GalViewNewDialogClass;
-
-struct _GalViewNewDialog
-{
- GtkDialog parent;
-
- /* item specific fields */
- GladeXML *gui;
-
- GalViewCollection *collection;
- GalViewFactory *selected_factory;
-
- GtkListStore *list_store;
-
- GtkWidget *entry;
- GtkWidget *list;
-};
-
-struct _GalViewNewDialogClass
-{
- GtkDialogClass parent_class;
-};
-
-GtkWidget *gal_view_new_dialog_new (GalViewCollection *collection);
-GType gal_view_new_dialog_get_type (void);
-
-GtkWidget *gal_view_new_dialog_construct (GalViewNewDialog *dialog,
- GalViewCollection *collection);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-
-#endif /* __GAL_VIEW_NEW_DIALOG_H__ */
diff --git a/widgets/menus/gal-view.c b/widgets/menus/gal-view.c
deleted file mode 100644
index fa1402fae4..0000000000
--- a/widgets/menus/gal-view.c
+++ /dev/null
@@ -1,206 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * gal-view.c
- * Copyright 2000, 2001, Ximian, Inc.
- *
- * Authors:
- * Chris Lahey <clahey@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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 "gal-view.h"
-#include "gal/util/e-util.h"
-
-#define PARENT_TYPE G_TYPE_OBJECT
-
-#define d(x)
-
-d(static gint depth = 0;)
-
-
-static GObjectClass *gal_view_parent_class;
-
-enum {
- CHANGED,
- LAST_SIGNAL
-};
-
-static guint gal_view_signals [LAST_SIGNAL] = { 0, };
-
-/**
- * gal_view_edit
- * @view: The view to edit
- * @parent: the parent window.
- */
-void
-gal_view_edit (GalView *view,
- GtkWindow *parent)
-{
- g_return_if_fail (view != NULL);
- g_return_if_fail (GAL_IS_VIEW (view));
- g_return_if_fail (GTK_IS_WINDOW (parent));
-
- if (GAL_VIEW_GET_CLASS (view)->edit)
- GAL_VIEW_GET_CLASS (view)->edit (view, parent);
-}
-
-/**
- * gal_view_load
- * @view: The view to load to
- * @filename: The file to load from
- */
-void
-gal_view_load (GalView *view,
- const char *filename)
-{
- g_return_if_fail (view != NULL);
- g_return_if_fail (GAL_IS_VIEW (view));
-
- if (GAL_VIEW_GET_CLASS (view)->load)
- GAL_VIEW_GET_CLASS (view)->load (view, filename);
-}
-
-/**
- * gal_view_save
- * @view: The view to save
- * @filename: The file to save to
- */
-void
-gal_view_save (GalView *view,
- const char *filename)
-{
- g_return_if_fail (view != NULL);
- g_return_if_fail (GAL_IS_VIEW (view));
-
- if (GAL_VIEW_GET_CLASS (view)->save)
- GAL_VIEW_GET_CLASS (view)->save (view, filename);
-}
-
-/**
- * gal_view_get_title
- * @view: The view to query.
- *
- * Returns: The title of the view.
- */
-const char *
-gal_view_get_title (GalView *view)
-{
- g_return_val_if_fail (view != NULL, NULL);
- g_return_val_if_fail (GAL_IS_VIEW (view), NULL);
-
- if (GAL_VIEW_GET_CLASS (view)->get_title)
- return GAL_VIEW_GET_CLASS (view)->get_title (view);
- else
- return NULL;
-}
-
-/**
- * gal_view_set_title
- * @view: The view to set.
- * @title: The new title value.
- */
-void
-gal_view_set_title (GalView *view,
- const char *title)
-{
- g_return_if_fail (view != NULL);
- g_return_if_fail (GAL_IS_VIEW (view));
-
- if (GAL_VIEW_GET_CLASS (view)->set_title)
- GAL_VIEW_GET_CLASS (view)->set_title (view, title);
-}
-
-/**
- * gal_view_get_type_code
- * @view: The view to get.
- *
- * Returns: The type of the view.
- */
-const char *
-gal_view_get_type_code (GalView *view)
-{
- g_return_val_if_fail (view != NULL, NULL);
- g_return_val_if_fail (GAL_IS_VIEW (view), NULL);
-
- if (GAL_VIEW_GET_CLASS (view)->get_type_code)
- return GAL_VIEW_GET_CLASS (view)->get_type_code (view);
- else
- return NULL;
-}
-
-/**
- * gal_view_clone
- * @view: The view to clone.
- *
- * Returns: The clone.
- */
-GalView *
-gal_view_clone (GalView *view)
-{
- g_return_val_if_fail (view != NULL, NULL);
- g_return_val_if_fail (GAL_IS_VIEW (view), NULL);
-
- if (GAL_VIEW_GET_CLASS (view)->clone)
- return GAL_VIEW_GET_CLASS (view)->clone (view);
- else
- return NULL;
-}
-
-/**
- * gal_view_changed
- * @view: The view that changed.
- */
-void
-gal_view_changed (GalView *view)
-{
- g_return_if_fail (view != NULL);
- g_return_if_fail (GAL_IS_VIEW (view));
-
- g_signal_emit(view,
- gal_view_signals [CHANGED], 0);
-}
-
-static void
-gal_view_class_init (GObjectClass *object_class)
-{
- GalViewClass *klass = GAL_VIEW_CLASS(object_class);
- gal_view_parent_class = g_type_class_ref (PARENT_TYPE);
-
- klass->edit = NULL;
- klass->load = NULL;
- klass->save = NULL;
- klass->get_title = NULL;
- klass->clone = NULL;
-
- klass->changed = NULL;
-
- gal_view_signals [CHANGED] =
- g_signal_new ("changed",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (GalViewClass, changed),
- NULL, NULL,
- g_cclosure_marshal_VOID__VOID,
- G_TYPE_NONE, 0);
-}
-
-static void
-gal_view_init (GalView *view)
-{
-}
-
-E_MAKE_TYPE(gal_view, "GalView", GalView, gal_view_class_init, gal_view_init, PARENT_TYPE)
diff --git a/widgets/menus/gal-view.h b/widgets/menus/gal-view.h
deleted file mode 100644
index 77056243c5..0000000000
--- a/widgets/menus/gal-view.h
+++ /dev/null
@@ -1,98 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * gal-view.h
- * Copyright 2000, 2001, Ximian, Inc.
- *
- * Authors:
- * Chris Lahey <clahey@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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.
- */
-
-#ifndef _GAL_VIEW_H_
-#define _GAL_VIEW_H_
-
-#include <gtk/gtkwindow.h>
-#include <libxml/tree.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
-
-#define GAL_VIEW_TYPE (gal_view_get_type ())
-#define GAL_VIEW(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GAL_VIEW_TYPE, GalView))
-#define GAL_VIEW_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GAL_VIEW_TYPE, GalViewClass))
-#define GAL_IS_VIEW(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GAL_VIEW_TYPE))
-#define GAL_IS_VIEW_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GAL_VIEW_TYPE))
-#define GAL_VIEW_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GAL_VIEW_TYPE, GalViewClass))
-
-typedef struct {
- GObject base;
-} GalView;
-
-typedef struct {
- GObjectClass parent_class;
-
- /*
- * Virtual methods
- */
- void (*edit) (GalView *view, GtkWindow *parent_window);
- void (*load) (GalView *view,
- const char *filename);
- void (*save) (GalView *view,
- const char *filename);
- const char *(*get_title) (GalView *view);
- void (*set_title) (GalView *view,
- const char *title);
- const char *(*get_type_code) (GalView *view);
- GalView *(*clone) (GalView *view);
-
- /* Signals */
- void (*changed) (GalView *view);
-} GalViewClass;
-
-/* Standard functions */
-GType gal_view_get_type (void);
-
-/* Open an editor dialog for this view, modal/transient for the GtkWindow arg. */
-void gal_view_edit (GalView *view,
- GtkWindow *parent);
-
-/* xml load and save functions */
-void gal_view_load (GalView *view,
- const char *filename);
-void gal_view_save (GalView *view,
- const char *filename);
-
-/* Title functions */
-const char *gal_view_get_title (GalView *view);
-void gal_view_set_title (GalView *view,
- const char *title);
-
-/* View type. */
-const char *gal_view_get_type_code (GalView *view);
-
-/* Cloning the view */
-GalView *gal_view_clone (GalView *view);
-
-/* Changed signal */
-void gal_view_changed (GalView *view);
-
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* _GAL_VIEW_H_ */
diff --git a/widgets/misc/ChangeLog b/widgets/misc/ChangeLog
index b86d9c8943..b2b9325d1a 100644
--- a/widgets/misc/ChangeLog
+++ b/widgets/misc/ChangeLog
@@ -1,396 +1,17 @@
-2003-03-30 Hans Petter Jansson <hpj@ximian.com>
+2003-01-24 Kjartan Maraas <kmaraas@gnome.org>
- * e-calendar-item.c (e_calendar_item_destroy): Handle multiple
- destroys.
-
-2003-03-28 JP Rosevear <jpr@ximian.com>
-
- * e-search-bar.c (clear_search): set the sub item to the default
- as well
-
-2003-03-25 Dan Winship <danw@ximian.com>
-
- * e-calendar.c: #include gtkarrow.h
- * e-combo-button.c: Likewise
-
- * e-charset-picker.c: Update for e_notice move
-
-2003-03-19 Jeffrey Stedfast <fejj@ximian.com>
-
- * e-filter-bar.c: Updated to use GtkDialog instead of
- GnomeDialog. Also fixed bug #39550 while I was at it.
-
-2003-03-10 Rodney Dawes <dobey@ximian.com>
-
- * e-calendar.c: Use GtkArrow instead of pixmaps
- * e-combo-button.c: Use GtkArrow instead of pixmaps
- * e-filter-bar.c: gtk_window_set_policy () is deprecated
- * e-url-entry.c: Load the icon in a pixbuf instead of GdkPixmap
+ * *.h: Remove #include <config.h>. Should be in .c files only.
-2003-03-06 Ettore Perazzoli <ettore@ximian.com>
-
- * e-url-entry.c (destroy): Removed unused variable.
-
-2003-03-06 Ettore Perazzoli <ettore@ximian.com>
-
- * e-dropdown-button.c (menu_deactivate_cb): Removed debugging
- spew.
-
-2003-02-27 Chris Toshok <toshok@ximian.com>
-
- * e-url-entry.c (destroy): guard this so we don't try to free priv
- multiple times.
-
-2003-02-25 Dan Winship <danw@ximian.com>
-
- * e-map.c (e_map_destroy): Use
- g_signal_handlers_disconnect_by_func since
- gtk_signal_disconnect_by_data doesn't seem to work right.
- (e_map_set_scroll_adjustments): Likewise.
-
-2003-02-25 Jeffrey Stedfast <fejj@ximian.com>
-
- * e-dateedit.c (on_date_popup_date_selected): Same as below.
-
- * e-cell-date-edit.c (e_cell_date_edit_on_ok_clicked): Also
- updated to use the new GDate API from glib 2.0
-
- * test-calendar.c (on_selection_changed): Fixed to use glib 2.0's
- GDate API.
-
- * e-calendar-item.c (e_calendar_item_get_week_number): Port to
- glib 2.0's GDate API.
- (e_calendar_item_set_selection): Same.
-
- * e-search-bar.c (append_xml_menu_item): Use
- g_string_append_printf instead of g_string_sprintfa since the
- latter is now deprecated.
- (setup_bonobo_menus): Same.
-
- * e-filter-bar.c (do_advanced): Use gtk_window_set_resizable()
-
- * e-charset-picker.c: Fixes to make it build cleanly with
- -DG_DISABLE_DEPRECATED
- (add_charset): Escape _'s so we don't get underline weirdness due
- to GtkLabel thinking the _ means to underline the next char.
- (e_charset_picker_bonobo_ui_populate): Same here.
-
-2003-02-20 Dan Winship <danw@ximian.com>
-
- * Makefile.am: Make libemiscwidgets and libefilterbar dynamic
- libraries instead of static so they can be portably linked into
- the shlib components
-
-2003-02-05 Dan Winship <danw@ximian.com>
-
- * Makefile.am (INCLUDES): Define MAP_DIR in terms of $(imagesdir).
- (widgetsincludedir): Define in terms of $(privincludedir)
-
-2003-02-02 Hans Petter Jansson <hpj@ximian.com>
-
- * e-calendar-item.[ch]: Use Pango to draw.
- (e_calendar_item_class_init): Add font_desc and week_number_font_desc
- args.
- (e_calendar_item_get_arg): Ditto.
- (e_calendar_item_set_arg): Ditto.
- (e_calendar_item_draw_month): Use Pango.
- (e_calendar_item_draw_day_numbers): Ditto.
-
- * e-calendar.c: Use Pango to draw. Specify just the size of the small
- font to use, instead of all aspects of it.
- (e_calendar_init): Produce the small font description and pass it to
- the ECalendarItem.
-
-2003-02-01 Hans Petter Jansson <hpj@ximian.com>
-
- * e-dateedit.c (create_children): Don't request combo boxes that are
- 0 pixels tall.
- (position_date_popup): Make this work when the button doesn't have
- its own window.
-
-2003-01-26 Chris Toshok <toshok@ximian.com>
-
- * e-clipped-label.c (e_clipped_label_new): init the layout to
- NULL.
-
-2003-01-23 Ettore Perazzoli <ettore@ximian.com>
-
- * e-title-bar.c (e_title_bar_construct): Make the label bold using
- the new args to e_clipped_label_new().
-
- * e-clipped-label.c (build_layout): Honor ->font_size and ->layout
- in the newly created PangoLayout.
- (e_clipped_label_new): New args font_weight, font_size.
- (e_clipped_label_size_request): Removed unused variables.
- (e_clipped_label_expose): Likewise.
- (e_clipped_label_expose): Likewise.
- (e_clipped_label_set_text): Likewise.
- (e_clipped_label_recalc_chars_displayed): Likewise.
-
- * e-clipped-label.h (struct _EClippedLabel): Add font_size, layout
- members.
-
-2003-01-22 Ettore Perazzoli <ettore@ximian.com>
+2002-11-26 Ettore Perazzoli <ettore@ximian.com>
- * Makefile.am (widgetsincludedir): Version using $(BASE_VERSION).
+ * e-multi-config-dialog.c (impl_destroy): Unref the
+ list_e_table_model.
-2003-01-14 Ettore Perazzoli <ettore@ximian.com>
+2002-11-04 JP Rosevear <jpr@ximian.com>
- * e-multi-config-dialog.c (init): Change dialog from
- OK/Apply/Cancel to Apply/Close/OK to be closer to the HIG.
-
-2003-01-14 Ettore Perazzoli <ettore@ximian.com>
-
- * Makefile.am (widgetsinclude_HEADERS): Ooops, remove
- e-bonobo-widget.h.
- (libemiscwidgets_a_SOURCES): Likewise, remove e-bonobo-widget.c.
-
-2003-01-14 Ettore Perazzoli <ettore@ximian.com>
-
- * Makefile.am (EXTRA_DIST): e-util-marshal.list, not
- e-book-marshal.list.
- (widgetsinclude_HEADERS): Add e-bonobo-widget.h.
- (libemiscwidgets_a_SOURCES): Add e-bonobo-widget.c.
-
-2003-01-08 Ettore Perazzoli <ettore@ximian.com>
-
- * Makefile.am: Images are now in $(datadir)/evolution/images
- instead of $(datadir)/images/evolution.
-
-2002-12-10 Not Zed <NotZed@Ximian.com>
-
- * e-multi-config-dialog.c (impl_response): Removed the
- g_assert_not_reached(). If you hit the close button on your
- window it would abort, treat same as close.
-
-2002-12-09 Chris Toshok <toshok@ximian.com>
-
- * e-clipped-label.[ch]: rework this to be faster and deal more
- correctly with the ellipsis.
-
-2002-12-03 Not Zed <NotZed@Ximian.com>
-
- * e-search-bar.c (impl_dispose): dispose can be run multiple times
- too ... bloody gobject crap.
-
-2002-11-27 Not Zed <NotZed@Ximian.com>
-
- * e-charset-picker.c: Add include of gnome-dialog.h
-
- * *.[ch]: ran fix.sh script over everything.
-
-2002-11-26 Not Zed <NotZed@Ximian.com>
-
- * e-combo-button.c (impl_button_press_event): Dont grab_add
- anymore on the button, gtk_button is changed in gtk2 not to do
- this anymore.
-
-2002-11-15 Chris Toshok <toshok@ximian.com>
-
- * e-clipped-label.c (build_layout): new function, build pango
- layout for string.
- (e_clipped_label_size_request): pango-ize this, make the size
- requested dependent on the label.
- (e_clipped_label_expose): pango-ize this.
- (e_clipped_label_recalc_chars_displayed): pango-ize this.
-
-2002-11-14 Ettore Perazzoli <ettore@ximian.com>
-
- * e-clipped-label.c (e_clipped_label_finalize): New.
- (e_clipped_label_destroy): Removed.
-
- * e-title-bar.c (destroy): Removed.
- (impl_finalize): New.
- (class_init): Install GObject::finalize handler instead of
- GtkObject::destroy handler.
-
-2002-11-14 Ettore Perazzoli <ettore@ximian.com>
-
- * e-filter-bar.c: Changed to use g_object_*() and g_signal_*()
- functions instead of gtk_object_*() and gtk_signal_*().
- (destroy): Removed.
- (dispose): New.
- (class_init): Install GObject::dispose handler instead of
- GtkObject::destroy handler.
-
-2002-11-11 Chris Toshok <toshok@ximian.com>
-
- * e-dateedit.[ch]: port to GObject.
-
-2002-11-11 Ettore Perazzoli <ettore@ximian.com>
-
- * e-multi-config-dialog.c (init): Use GObject functions instead of
- GtkObject throughout.
-
-2002-11-11 Ettore Perazzoli <ettore@ximian.com>
-
- * e-multi-config-dialog.c (impl_destroy): Removed.
- (impl_finalize): New.
- (class_init): Override GObject::finalize, not GtkObject::destroy.
-
- * e-config-page.c (impl_destroy): Removed.
- (impl_finalize): New.
- (class_init): Override GObject::finalize, not GtkObject::destroy.
-
- * e-multi-config-dialog.c: Converted to a GtkDialog subclass
- [instead of GnomeDialog].
-
-2002-11-07 JP Rosevear <jpr@ximian.com>
-
- * e-filter-bar.c: include gnome-dialog.h
-
-2002-11-06 Chris Toshok <toshok@ximian.com>
-
- * .cvsignore: ignore the generated marshal source.
-
- * Makefile.am: add marshal stuff.
-
- * e-util-marshal.list: marshaller list.
-
- * e-search-bar.[ch]: gobjectify this.
-
-2002-11-04 Ettore Perazzoli <ettore@ximian.com>
-
- * e-combo-button.c (impl_expose_event): Use
- gtk_container_propagate_expose().
-
-2002-11-01 Ettore Perazzoli <ettore@ximian.com>
-
- * test-title-bar.c: #include <libgnomeui/gnome-ui-init.h> instead
- of <libgnomeui/gnome-init.h>.
- (main): Use a GtkLabel, not a GtkText.
-
- * test-dropdown-button.c: #include <libgnomeui/gnome-ui-init.h>
- instead of <libgnomeui/gnome-init.h>, and
- <libgnomeui/gnome-stock-icons.h> instead of
- <libgnomeui/gnome-stock.h>.
-
- * test-dateedit.c: #include <libgnomeui/gnome-ui-init.h> instead
- of <libgnomeui/gnome-init.h>.
- (main): Use gnome_program_init().
-
- * test-calendar.c: #include <libgnomeui/gnome-ui-init.h>.
-
- * e-url-entry.c (button_clicked_cb): Pass NULL as the error arg to
- gnome_url_show().
-
- * e-title-bar.c (class_init): GTK2-ified. Use GTK_TYPE_POINTER
- instead of GTK_TYPE_GDK_EVENT.
-
- * e-search-bar.c: Removed #include <libgnome/gnome-defs.h>.
- #include <string.h>.
- (class_init): GTK2-ified.
- (e_search_bar_set_menu): Use GTK_OBJECT_GET_CLASS.
- (e_search_bar_set_option): Likewise.
-
- * e-messagebox.c (e_message_box_class_init): Updated to put
- finalize in GObjectClass intead of GtkObjectClass.
- (e_message_box_finalize): Likewise.
- (e_message_box_construct): Just check if pixmap is NULL, instead
- of pixmap->pixmap.
-
- * e-messagebox.h: No {BEGIN,END}_GNOME_DECLS.
- (e_message_box_get_type): Fix prototype, should return GtkType
- instead of guint.
-
- * e-map.c: Removed e_map_signals, which was unused.
- (e_map_finalize): Update for the fact that finalize is now in
- GObjectClass.
- (e_map_class_init): Likewise. Also GTK2-ify.
- (e_map_draw): Removed.
- (load_map_background): Pass NULL as the gdk_pixbuf_new_from_file()
- error arg.
-
- * e-dropdown-button.c (menu_position_cb): Added arg push_in.
-
- * e-dateedit.c (e_date_edit_class_init): GTK2-ified.
- (e_date_edit_show_date_popup): Constify local variable.
- (e_date_edit_check_date_changed): Likewise.
- (e_date_edit_check_time_changed): Likewise.
- (e_date_edit_check_date_changed): Likewise.
- (field_set_to_none): Constify arg text.
- (e_date_edit_parse_date): Constify arg date_text.
- (e_date_edit_parse_time): Constify arg time_text.
-
- * e-dateedit.h: No {BEGIN,END}_GNOME_DECLS.
-
- * e-combo-button.c (menu_position_func): New arg push_in.
- (impl_draw): Removed.
- (class_init): GTK2-ified.
- (init): style->xthickness instead of style->klass->xthickness.
-
- * e-config-page.c (class_init): GTK2-ified.
-
- * e-clipped-label.c (e_clipped_label_size_request): Use
- gtk_style_get_font().
- (e_clipped_label_recalc_chars_displayed): Likewise.
- (e_clipped_label_expose): Likewise.
-
- * e-charset-picker.c: No #include <libgnome/gnome-defs.h> or
- <libgnome/gnome-i18n.h> or <libgnome/gnome-stock.h>. Also no
- <gal/gunicode.h>. On the other hand, #include <gtk/gtkvbox.h>.
- (e_charset_picker_new): Make locale_charset const.
- (e_charset_picker_bonobo_ui_populate): Make locale_charset const.
-
- * e-cell-percent.c: #include <stdio.h> for sscanf().
-
- * e-cell-percent.h: Removed BEGIN_GNOME_DECLS, END_GNOME_DECLS.
-
- * e-cell-percent.c: Do not #include <libgnomeui/gnome-stock.h>.
-
- * e-cell-date-edit.c: Do not #include <libgnomeui/gnome-stock.h>.
- Added a bunch of #includes for GTK stuff.
- (e_cell_date_edit_on_ok_clicked): Constified variable.
-
- * e-calendar-item.c: Do not #include <libgnome/gnome-defs.h>.
- (e_calendar_item_class_init): Use GTK_TYPE_POINTER instead of
- GTK_TYPE_GDK_POINTER.
- (e_calendar_item_class_init): GTK_CLASS_TYPE() instead of
- object_class->type.
- (e_calendar_item_class_init): No gtk_object_class_add_signals().
- (e_calendar_item_update): style->[xy]thickness instead of
- style->klass->[xy]thickness.
- (e_calendar_item_draw): Likewise.
- (e_calendar_item_draw_month): Likewise.
- (e_calendar_item_draw_month): Likewise.
- (e_calendar_item_recalc_sizes): Likewise.
- (e_calendar_item_convert_position_to_day): Likewise.
- (e_calendar_item_update): Use gtk_style_get_font().
- (e_calendar_item_draw_month): Likewise.
- (e_calendar_item_draw_day_numbers): Likewise.
- (e_calendar_item_convert_position_to_day): Likewise.
- (e_calendar_item_recalc_sizes): Likewise.
- (e_calendar_item_signal_emission_idle_cb): Removed check for
- GTK_OBJECT_DESTROY.
- (e_calendar_item_position_menu): Add push_in arg.
-
- * e-calendar.c (e_calendar_draw): Remove.
- (e_calendar_size_request): style->[xy]thickness instead of
- style->klass->[xy]thickness.
- (e_calendar_size_allocate): Likewise.
- (e_calendar_get_border_size): Likewise.
- (e_calendar_size_allocate): Get font from style with
- gtk_style_get_font().
-
- * e-calendar-item.h: #include <libgnomecanvas/gnome-canvas.h>
- instead of <libgnomeui/gnome-canvas.h>.
- * e-calendar.c: Likewise for
- <libgnomecanvas/gnome-canvas-widget.h>.
-
- * Makefile.am: Don't compile e-bonobo-widget.c, e-bonobo-widget.h.
- [Unused right now, so we can avoid porting until, and if, they are
- needed.]
-
- * e-filter-bar.c: Do not #include <libgnome/gnome-defs.h>. Do not
- #include <libgnomeui/gnome-stock.h>. #include <gtk/gtksignal.h>.
- Also remove gal #includes.
- (do_advanced): Add some GTK_SIGNAL_FUNC() casts.
- (menubar_activated): Likewise.
- (menubar_activated): Likewise.
-
-2002-10-30 Ettore Perazzoli <ettore@ximian.com>
-
- * e-map.h: Do not #include <libgnome/gnome-defs.h>.
+ * e-calendar-item.c (e_calendar_item_ensure_days_visible): set the
+ year when testing end date stuff, don't reset the end month if we
+ couldn't fit the days in the next month
2002-10-28 Jeffrey Stedfast <fejj@ximian.com>
diff --git a/widgets/misc/e-calendar-item.c b/widgets/misc/e-calendar-item.c
index ee25c8f3bd..c308552a04 100644
--- a/widgets/misc/e-calendar-item.c
+++ b/widgets/misc/e-calendar-item.c
@@ -25,10 +25,7 @@
* ECalendarItem - canvas item displaying a calendar.
*/
-
-#ifdef HAVE_CONFIG_H
#include <config.h>
-#endif
#include "e-calendar-item.h"
@@ -40,6 +37,7 @@
#include <gtk/gtkmenuitem.h>
#include <gtk/gtklabel.h>
#include <gtk/gtksignal.h>
+#include <libgnome/gnome-defs.h>
#include <libgnome/gnome-i18n.h>
#include <gal/util/e-util.h>
@@ -216,7 +214,6 @@ static void e_calendar_item_on_menu_item_activate(GtkWidget *menuitem,
static void e_calendar_item_position_menu (GtkMenu *menu,
gint *x,
gint *y,
- gboolean *push_in,
gpointer user_data);
static void e_calendar_item_date_range_changed (ECalendarItem *calitem);
static void e_calendar_item_queue_signal_emission (ECalendarItem *calitem);
@@ -232,9 +229,7 @@ enum {
ARG_X2,
ARG_Y2,
ARG_FONT,
- ARG_FONT_DESC,
ARG_WEEK_NUMBER_FONT,
- ARG_WEEK_NUMBER_FONT_DESC,
ARG_ROW_HEIGHT,
ARG_COLUMN_WIDTH,
ARG_MINIMUM_ROWS,
@@ -272,7 +267,7 @@ e_calendar_item_class_init (ECalendarItemClass *class)
GtkObjectClass *object_class;
GnomeCanvasItemClass *item_class;
- parent_class = g_type_class_ref(gnome_canvas_item_get_type());
+ parent_class = gtk_type_class (gnome_canvas_item_get_type());
object_class = (GtkObjectClass *) class;
item_class = (GnomeCanvasItemClass *) class;
@@ -296,17 +291,11 @@ e_calendar_item_class_init (ECalendarItemClass *class)
GTK_TYPE_DOUBLE, GTK_ARG_READWRITE,
ARG_Y2);
gtk_object_add_arg_type ("ECalendarItem::font",
- GTK_TYPE_POINTER, GTK_ARG_READWRITE,
+ GTK_TYPE_GDK_FONT, GTK_ARG_READWRITE,
ARG_FONT);
- gtk_object_add_arg_type ("ECalendarItem::font_desc",
- GTK_TYPE_POINTER, GTK_ARG_READWRITE,
- ARG_FONT_DESC);
gtk_object_add_arg_type ("ECalendarItem::week_number_font",
- GTK_TYPE_POINTER, GTK_ARG_READWRITE,
+ GTK_TYPE_GDK_FONT, GTK_ARG_READWRITE,
ARG_WEEK_NUMBER_FONT);
- gtk_object_add_arg_type ("ECalendarItem::week_number_font_desc",
- GTK_TYPE_POINTER, GTK_ARG_READWRITE,
- ARG_WEEK_NUMBER_FONT_DESC);
gtk_object_add_arg_type ("ECalendarItem::row_height",
GTK_TYPE_INT, GTK_ARG_READABLE,
ARG_ROW_HEIGHT);
@@ -350,18 +339,22 @@ e_calendar_item_class_init (ECalendarItemClass *class)
e_calendar_item_signals[DATE_RANGE_CHANGED] =
gtk_signal_new ("date_range_changed",
GTK_RUN_FIRST,
- GTK_CLASS_TYPE (object_class),
- G_STRUCT_OFFSET (ECalendarItemClass, date_range_changed),
+ object_class->type,
+ GTK_SIGNAL_OFFSET (ECalendarItemClass, date_range_changed),
gtk_marshal_NONE__NONE,
GTK_TYPE_NONE, 0);
e_calendar_item_signals[SELECTION_CHANGED] =
gtk_signal_new ("selection_changed",
GTK_RUN_FIRST,
- GTK_CLASS_TYPE (object_class),
- G_STRUCT_OFFSET (ECalendarItemClass, selection_changed),
+ object_class->type,
+ GTK_SIGNAL_OFFSET (ECalendarItemClass, selection_changed),
gtk_marshal_NONE__NONE,
GTK_TYPE_NONE, 0);
+ gtk_object_class_add_signals (object_class, e_calendar_item_signals,
+ LAST_SIGNAL);
+
+
object_class->destroy = e_calendar_item_destroy;
object_class->get_arg = e_calendar_item_get_arg;
object_class->set_arg = e_calendar_item_set_arg;
@@ -447,24 +440,17 @@ e_calendar_item_destroy (GtkObject *o)
e_calendar_item_set_style_callback (calitem, NULL, NULL, NULL);
e_calendar_item_set_get_time_callback (calitem, NULL, NULL, NULL);
- if (calitem->styles) {
- g_free (calitem->styles);
- calitem->styles = NULL;
- }
+ g_free (calitem->styles);
if (calitem->signal_emission_idle_id != 0) {
g_source_remove (calitem->signal_emission_idle_id);
calitem->signal_emission_idle_id = 0;
}
- if (calitem->old_font) {
+ if (calitem->old_font)
gdk_font_unref (calitem->old_font);
- calitem->old_font = NULL;
- }
- if (calitem->old_week_number_font) {
+ if (calitem->old_week_number_font)
gdk_font_unref (calitem->old_week_number_font);
- calitem->old_week_number_font = NULL;
- }
if (GTK_OBJECT_CLASS (parent_class)->destroy)
(* GTK_OBJECT_CLASS (parent_class)->destroy) (o);
@@ -502,15 +488,9 @@ e_calendar_item_get_arg (GtkObject *o, GtkArg *arg, guint arg_id)
case ARG_FONT:
GTK_VALUE_BOXED (*arg) = calitem->font;
break;
- case ARG_FONT_DESC:
- GTK_VALUE_BOXED (*arg) = calitem->font_desc;
- break;
case ARG_WEEK_NUMBER_FONT:
GTK_VALUE_BOXED (*arg) = calitem->week_number_font;
break;
- case ARG_WEEK_NUMBER_FONT_DESC:
- GTK_VALUE_BOXED (*arg) = calitem->week_number_font_desc;
- break;
case ARG_ROW_HEIGHT:
e_calendar_item_recalc_sizes (calitem);
GTK_VALUE_INT (*arg) = calitem->min_month_height;
@@ -564,7 +544,6 @@ e_calendar_item_set_arg (GtkObject *o, GtkArg *arg, guint arg_id)
GnomeCanvasItem *item;
ECalendarItem *calitem;
GdkFont *font;
- PangoFontDescription *font_desc;
gboolean need_update = FALSE;
gdouble dvalue;
gint ivalue;
@@ -623,13 +602,6 @@ e_calendar_item_set_arg (GtkObject *o, GtkArg *arg, guint arg_id)
need_update = TRUE;
}
break;
- case ARG_FONT_DESC:
- font_desc = GTK_VALUE_BOXED (*arg);
- if (calitem->font_desc)
- pango_font_description_free (calitem->font_desc);
- calitem->font_desc = pango_font_description_copy (font_desc);
- need_update = TRUE;
- break;
case ARG_WEEK_NUMBER_FONT:
font = GTK_VALUE_BOXED (*arg);
if (calitem->week_number_font != font) {
@@ -641,13 +613,6 @@ e_calendar_item_set_arg (GtkObject *o, GtkArg *arg, guint arg_id)
need_update = TRUE;
}
break;
- case ARG_WEEK_NUMBER_FONT_DESC:
- font_desc = GTK_VALUE_BOXED (*arg);
- if (calitem->week_number_font_desc)
- pango_font_description_free (calitem->week_number_font_desc);
- calitem->week_number_font_desc = pango_font_description_copy (font_desc);
- need_update = TRUE;
- break;
case ARG_MINIMUM_ROWS:
ivalue = GTK_VALUE_INT (*arg);
ivalue = MAX (1, ivalue);
@@ -772,11 +737,8 @@ e_calendar_item_unrealize (GnomeCanvasItem *item)
colormap = gtk_widget_get_colormap (GTK_WIDGET (item->canvas));
- for (i = 0; i < E_CALENDAR_ITEM_COLOR_LAST; i++) {
- /* FIXME: gdk_colors_free expects gulong* here but the pixel value in GdkColor
- is guint32. GDK bug? */
- gdk_colors_free (colormap, (gulong *) &calitem->colors[i].pixel, 1, 0);
- }
+ for (i = 0; i < E_CALENDAR_ITEM_COLOR_LAST; i++)
+ gdk_colors_free (colormap, &calitem->colors[i].pixel, 1, 0);
if (GNOME_CANVAS_ITEM_CLASS (parent_class)->unrealize)
(* GNOME_CANVAS_ITEM_CLASS (parent_class)->unrealize) (item);
@@ -817,8 +779,8 @@ e_calendar_item_update (GnomeCanvasItem *item,
calitem = E_CALENDAR_ITEM (item);
style = GTK_WIDGET (item->canvas)->style;
- xthickness = style->xthickness;
- ythickness = style->ythickness;
+ xthickness = style->klass->xthickness;
+ ythickness = style->klass->ythickness;
item->x1 = calitem->x1;
item->y1 = calitem->y1;
@@ -869,7 +831,7 @@ e_calendar_item_update (GnomeCanvasItem *item,
font = calitem->font;
if (!font)
- font = gtk_style_get_font (style);
+ font = style->font;
char_height = font->ascent + font->descent;
calitem->month_width = calitem->min_month_width;
@@ -949,10 +911,10 @@ e_calendar_item_draw (GnomeCanvasItem *canvas_item,
style = GTK_WIDGET (canvas_item->canvas)->style;
font = calitem->font;
if (!font)
- font = gtk_style_get_font (style);
+ font = style->font;
char_height = font->ascent + font->descent;
- xthickness = style->xthickness;
- ythickness = style->ythickness;
+ xthickness = style->klass->xthickness;
+ ythickness = style->klass->ythickness;
base_gc = style->base_gc[GTK_STATE_NORMAL];
bg_gc = style->bg_gc[GTK_STATE_NORMAL];
@@ -1028,7 +990,6 @@ e_calendar_item_draw_month (ECalendarItem *calitem,
GtkWidget *widget;
GtkStyle *style;
GdkFont *font;
- PangoFontDescription *font_desc;
GdkGC *fg_gc;
struct tm tmp_tm;
GdkRectangle clip_rect;
@@ -1039,7 +1000,6 @@ e_calendar_item_draw_month (ECalendarItem *calitem,
gint day, day_index, cells_x, cells_y, min_cell_width, text_width;
gint clip_width, clip_height;
gchar buffer[64];
- PangoLayout *layout;
#if 0
g_print ("In e_calendar_item_draw_month: %i,%i %ix%i row:%i col:%i\n",
@@ -1050,15 +1010,11 @@ e_calendar_item_draw_month (ECalendarItem *calitem,
style = widget->style;
font = calitem->font;
if (!font)
- font = gtk_style_get_font (style);
- font_desc = calitem->font_desc;
- if (!font_desc)
- font_desc = style->font_desc;
+ font = style->font;
char_height = font->ascent + font->descent;
- xthickness = style->xthickness;
- ythickness = style->ythickness;
+ xthickness = style->klass->xthickness;
+ ythickness = style->klass->ythickness;
fg_gc = style->fg_gc[GTK_STATE_NORMAL];
- layout = gtk_widget_create_pango_layout (widget, NULL);
/* Calculate the top-left position of the entire month display. */
month_x = item->x1 + xthickness + calitem->x_offset
@@ -1091,7 +1047,7 @@ e_calendar_item_draw_month (ECalendarItem *calitem,
else
max_x -= E_CALENDAR_ITEM_XPAD_AFTER_MONTH_NAME;
- text_y = month_y + style->ythickness
+ text_y = month_y + style->klass->ythickness
+ E_CALENDAR_ITEM_YPAD_ABOVE_MONTH_NAME;
clip_rect.x = month_x + min_x;
clip_rect.x = MAX (0, clip_rect.x);
@@ -1119,12 +1075,8 @@ e_calendar_item_draw_month (ECalendarItem *calitem,
text_x = (calitem->month_width - text_width) / 2;
text_x = MAX (min_x, text_x);
- pango_layout_set_font_description (layout, font_desc);
- pango_layout_set_text (layout, buffer, -1);
- gdk_draw_layout (drawable, fg_gc,
- month_x + text_x,
- text_y,
- layout);
+ gdk_draw_string (drawable, font, fg_gc,
+ month_x + text_x, text_y + font->ascent, buffer);
}
/* Set the clip rectangle for the main month display. */
@@ -1163,15 +1115,12 @@ e_calendar_item_draw_month (ECalendarItem *calitem,
+ E_CALENDAR_ITEM_YPAD_BELOW_DAY_LETTERS + 1
+ E_CALENDAR_ITEM_YPAD_ABOVE_CELLS;
+ text_y += font->ascent;
day_index = calitem->week_start_day;
- pango_layout_set_font_description (layout, font_desc);
for (day = 0; day < 7; day++) {
- pango_layout_set_text (layout, &calitem->days [day_index], 1);
- gdk_draw_layout (drawable, fg_gc,
- text_x - calitem->day_widths [day_index],
- text_y,
- layout);
-
+ gdk_draw_text (drawable, font, fg_gc,
+ text_x - calitem->day_widths[day_index], text_y,
+ &calitem->days[day_index], 1);
text_x += calitem->cell_width;
day_index++;
if (day_index == 7)
@@ -1200,7 +1149,6 @@ e_calendar_item_draw_month (ECalendarItem *calitem,
}
gdk_gc_set_clip_rectangle (fg_gc, NULL);
- g_object_unref (layout);
}
@@ -1221,7 +1169,6 @@ e_calendar_item_draw_day_numbers (ECalendarItem *calitem,
GtkWidget *widget;
GtkStyle *style;
GdkFont *font, *wkfont;
- PangoFontDescription *font_desc, *wkfont_desc;
GdkGC *fg_gc;
GdkColor *bg_color, *fg_color, *box_color;
struct tm today_tm;
@@ -1237,23 +1184,16 @@ e_calendar_item_draw_day_numbers (ECalendarItem *calitem,
gint today_year, today_month, today_mday, month_offset;
gchar buffer[2];
gint day_style = 0;
- PangoLayout *layout;
item = GNOME_CANVAS_ITEM (calitem);
widget = GTK_WIDGET (item->canvas);
style = widget->style;
font = calitem->font;
if (!font)
- font = gtk_style_get_font (style);
- font_desc = calitem->font_desc;
- if (!font_desc)
- font_desc = style->font_desc;
+ font = style->font;
wkfont = calitem->week_number_font;
if (!wkfont)
wkfont = font;
- wkfont_desc = calitem->week_number_font_desc;
- if (!wkfont_desc)
- wkfont_desc = font_desc;
fg_gc = style->fg_gc[GTK_STATE_NORMAL];
char_height = font->ascent + font->descent;
@@ -1261,8 +1201,6 @@ e_calendar_item_draw_day_numbers (ECalendarItem *calitem,
+ E_CALENDAR_ITEM_MIN_CELL_XPAD;
min_cell_height = char_height + E_CALENDAR_ITEM_MIN_CELL_YPAD;
- layout = gtk_widget_create_pango_layout (widget, NULL);
-
/* Calculate the number of days in the previous, current, and next
months. */
years[0] = years[1] = years[2] = year;
@@ -1346,13 +1284,9 @@ e_calendar_item_draw_day_numbers (ECalendarItem *calitem,
gdk_gc_set_foreground (fg_gc,
&style->fg[GTK_STATE_NORMAL]);
-
- pango_layout_set_font_description (layout, wkfont_desc);
- pango_layout_set_text (layout, buffer, num_chars);
- gdk_draw_layout (drawable, fg_gc,
- text_x,
- text_y,
- layout);
+ gdk_draw_text (drawable, wkfont, fg_gc,
+ text_x, text_y + font->ascent,
+ buffer, num_chars);
}
for (dcol = 0; dcol < 7; dcol++) {
@@ -1455,20 +1389,17 @@ e_calendar_item_draw_day_numbers (ECalendarItem *calitem,
&style->fg[GTK_STATE_NORMAL]);
}
- pango_layout_set_font_description (layout, font_desc);
- pango_layout_set_text (layout, buffer, num_chars);
- gdk_draw_layout (drawable, fg_gc,
- day_x,
- day_y,
- layout);
-
+ gdk_draw_text (drawable, font, fg_gc,
+ day_x,
+ day_y + font->ascent,
+ buffer, num_chars);
/* We use a stupid technique for bold. Just
draw it again 1 pixel to the left. */
if (bold)
- gdk_draw_layout (drawable, fg_gc,
- day_x - 1,
- day_y,
- layout);
+ gdk_draw_text (drawable, font, fg_gc,
+ day_x - 1,
+ day_y + font->ascent,
+ buffer, num_chars);
}
/* See if we've reached the end of a month. */
@@ -1497,8 +1428,6 @@ e_calendar_item_draw_day_numbers (ECalendarItem *calitem,
/* Reset the foreground color. */
gdk_gc_set_foreground (fg_gc, &style->fg[GTK_STATE_NORMAL]);
-
- g_object_unref (layout);
}
@@ -1508,38 +1437,37 @@ e_calendar_item_get_week_number (ECalendarItem *calitem,
gint month,
gint year)
{
- GDate date;
- guint weekday, yearday;
- int offset, week_num;
-
+ GDate tmp_date;
+ gint weekday, yearday, offset, week_num;
+
/* FIXME: check what happens at year boundaries. */
-
- g_date_clear (&date, 1);
- g_date_set_dmy (&date, day, month + 1, year);
-
- /* This results in a value of 0 (Monday) - 6 (Sunday). (or -1 on error - oops!!) */
- weekday = g_date_get_weekday (&date) - 1;
-
+
+ g_date_clear (&tmp_date, 1);
+ g_date_set_dmy (&tmp_date, day, month + 1, year);
+
+ /* This results in a value of 0 (Monday) - 6 (Sunday). */
+ weekday = g_date_weekday (&tmp_date) - 1;
+
/* Calculate the offset from the start of the week. */
offset = (calitem->week_start_day + 7 - weekday) % 7;
-
+
/* Calculate the day of the year, from 0 to 365. */
- yearday = g_date_get_day_of_year (&date) - 1;
-
+ yearday = g_date_day_of_year (&tmp_date) - 1;
+
/* If the week starts on or after 29th December, it is week 1 of the
next year, since there are 4 days in the next year. */
- g_date_subtract_days (&date, offset);
- if (g_date_get_month (&date) == 12 && g_date_get_day (&date) >= 29)
+ g_date_subtract_days (&tmp_date, offset);
+ if (g_date_month (&tmp_date) == 12 && g_date_day (&tmp_date) >= 29)
return 1;
-
+
/* Calculate the week number, from 0. */
week_num = (yearday - offset) / 7;
-
+
/* If the first week starts on or after Jan 5th, then we need to add
1 since the previous week will really be the first week. */
if ((yearday - offset) % 7 >= 4)
week_num++;
-
+
/* Add 1 so week numbers are from 1 to 53. */
return week_num + 1;
}
@@ -1602,7 +1530,7 @@ e_calendar_item_recalc_sizes (ECalendarItem *calitem)
font = calitem->font;
if (!font)
- font = gtk_style_get_font (style);
+ font = style->font;
wkfont = calitem->week_number_font;
if (!wkfont)
wkfont = font;
@@ -1660,7 +1588,7 @@ e_calendar_item_recalc_sizes (ECalendarItem *calitem)
+ E_CALENDAR_ITEM_XPAD_AFTER_WEEK_NUMBERS + 1;
}
- calitem->min_month_height = style->ythickness * 2
+ calitem->min_month_height = style->klass->ythickness * 2
+ E_CALENDAR_ITEM_YPAD_ABOVE_MONTH_NAME + char_height
+ E_CALENDAR_ITEM_YPAD_BELOW_MONTH_NAME + 1
+ E_CALENDAR_ITEM_YPAD_ABOVE_DAY_LETTERS
@@ -2039,9 +1967,9 @@ e_calendar_item_convert_position_to_day (ECalendarItem *calitem,
item = GNOME_CANVAS_ITEM (calitem);
widget = GTK_WIDGET (item->canvas);
style = widget->style;
- char_height = gtk_style_get_font (style)->ascent + gtk_style_get_font (style)->descent;
- xthickness = style->xthickness;
- ythickness = style->ythickness;
+ char_height = style->font->ascent + style->font->descent;
+ xthickness = style->klass->xthickness;
+ ythickness = style->klass->ythickness;
*entire_week = FALSE;
@@ -2694,16 +2622,16 @@ e_calendar_item_set_selection (ECalendarItem *calitem,
if (end_date == NULL)
end_date = start_date;
-
+
g_return_if_fail (g_date_compare (start_date, end_date) <= 0);
-
- start_year = g_date_get_year (start_date);
- start_month = g_date_get_month (start_date) - 1;
- start_day = g_date_get_day (start_date);
- end_year = g_date_get_year (end_date);
- end_month = g_date_get_month (end_date) - 1;
- end_day = g_date_get_day (end_date);
-
+
+ start_year = g_date_year (start_date);
+ start_month = g_date_month (start_date) - 1;
+ start_day = g_date_day (start_date);
+ end_year = g_date_year (end_date);
+ end_month = g_date_month (end_date) - 1;
+ end_day = g_date_day (end_date);
+
need_update = e_calendar_item_ensure_days_visible (calitem,
start_year,
start_month,
@@ -2780,6 +2708,7 @@ e_calendar_item_ensure_days_visible (ECalendarItem *calitem,
/* First we see if the end of the selection will fit in the
leftover days of the month after the last one shown. */
+ calitem->year = end_year;
calitem->month += (months_shown - 1);
e_calendar_item_normalize_date (calitem, &calitem->year,
&calitem->month);
@@ -2795,8 +2724,6 @@ e_calendar_item_ensure_days_visible (ECalendarItem *calitem,
calitem->year = end_year;
calitem->month = end_month - months_shown + 1;
- } else {
- calitem->month -= (months_shown - 1);
}
e_calendar_item_normalize_date (calitem, &calitem->year,
@@ -2856,9 +2783,9 @@ e_calendar_item_show_popup_menu (ECalendarItem *calitem,
submenu = gtk_menu_new ();
gtk_menu_item_set_submenu (GTK_MENU_ITEM (menuitem), submenu);
- g_object_set_data(G_OBJECT(submenu), "year",
+ gtk_object_set_data (GTK_OBJECT (submenu), "year",
GINT_TO_POINTER (year));
- g_object_set_data(G_OBJECT(submenu), "month_offset",
+ gtk_object_set_data (GTK_OBJECT (submenu), "month_offset",
GINT_TO_POINTER (month_offset));
for (month = 0; month < 12; month++) {
@@ -2879,17 +2806,17 @@ e_calendar_item_show_popup_menu (ECalendarItem *calitem,
gtk_widget_show (label);
gtk_container_add (GTK_CONTAINER (menuitem), label);
- g_object_set_data(G_OBJECT(menuitem), "month",
+ gtk_object_set_data (GTK_OBJECT (menuitem), "month",
GINT_TO_POINTER (month));
- g_signal_connect((menuitem), "activate",
- G_CALLBACK (e_calendar_item_on_menu_item_activate), calitem);
+ gtk_signal_connect (GTK_OBJECT (menuitem), "activate",
+ GTK_SIGNAL_FUNC (e_calendar_item_on_menu_item_activate), calitem);
}
}
/* Run the menu modal so we can destroy it after. */
- g_signal_connect((menu), "deactivate",
- G_CALLBACK (gtk_main_quit), NULL);
+ gtk_signal_connect (GTK_OBJECT (menu), "deactivate",
+ GTK_SIGNAL_FUNC (gtk_main_quit), NULL);
gtk_menu_popup (GTK_MENU (menu), NULL, NULL,
e_calendar_item_position_menu, calitem,
event->button, event->time);
@@ -2906,9 +2833,9 @@ e_calendar_item_on_menu_item_activate (GtkWidget *menuitem,
{
gint year, month_offset, month;
- year = GPOINTER_TO_INT (g_object_get_data(G_OBJECT(menuitem->parent), "year"));
- month_offset = GPOINTER_TO_INT (g_object_get_data(G_OBJECT(menuitem->parent), "month_offset"));
- month = GPOINTER_TO_INT (g_object_get_data(G_OBJECT(menuitem), "month"));
+ year = GPOINTER_TO_INT (gtk_object_get_data (GTK_OBJECT (menuitem->parent), "year"));
+ month_offset = GPOINTER_TO_INT (gtk_object_get_data (GTK_OBJECT (menuitem->parent), "month_offset"));
+ month = GPOINTER_TO_INT (gtk_object_get_data (GTK_OBJECT (menuitem), "month"));
month -= month_offset;
e_calendar_item_normalize_date (calitem, &year, &month);
@@ -2920,7 +2847,6 @@ static void
e_calendar_item_position_menu (GtkMenu *menu,
gint *x,
gint *y,
- gboolean *push_in,
gpointer user_data)
{
GtkRequisition requisition;
@@ -2991,7 +2917,7 @@ e_calendar_item_signal_emission_idle_cb (gpointer data)
/* We ref the calitem & check in case it gets destroyed, since we
were getting a free memory write here. */
- g_object_ref((calitem));
+ gtk_object_ref (GTK_OBJECT (calitem));
if (calitem->date_range_changed) {
calitem->date_range_changed = FALSE;
@@ -2999,13 +2925,15 @@ e_calendar_item_signal_emission_idle_cb (gpointer data)
e_calendar_item_signals[DATE_RANGE_CHANGED]);
}
- if (calitem->selection_changed) {
+ if (GTK_OBJECT_DESTROYED (calitem)) {
+ g_warning ("e_calendar_item_signal_emission_idle_cb: item destroyed");
+ } else if (calitem->selection_changed) {
calitem->selection_changed = FALSE;
gtk_signal_emit (GTK_OBJECT (calitem),
e_calendar_item_signals[SELECTION_CHANGED]);
}
- g_object_unref((calitem));
+ gtk_object_unref (GTK_OBJECT (calitem));
GDK_THREADS_LEAVE ();
return FALSE;
diff --git a/widgets/misc/e-canvas-background.c b/widgets/misc/e-canvas-background.c
deleted file mode 100644
index d2d68d180f..0000000000
--- a/widgets/misc/e-canvas-background.c
+++ /dev/null
@@ -1,495 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-canvas-background.c - background color for canvas.
- * Copyright 2001, Ximian, Inc.
- *
- * Authors:
- * Chris Lahey <clahey@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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 "e-canvas-background.h"
-
-#include <math.h>
-#include <stdio.h>
-#include <gtk/gtksignal.h>
-#include <gdk/gdkkeysyms.h>
-#include "gal/widgets/e-hsv-utils.h"
-#include "gal/widgets/e-canvas.h"
-#include "gal/widgets/e-canvas-utils.h"
-#include "gal/util/e-util.h"
-#include "gal/util/e-i18n.h"
-#include <string.h>
-
-#define PARENT_OBJECT_TYPE gnome_canvas_item_get_type ()
-
-#define d(x)
-
-struct _ECanvasBackgroundPrivate {
- guint rgba; /* Fill color, RGBA */
- GdkColor color; /* Fill color */
- GdkBitmap *stipple; /* Stipple for fill */
- GdkGC *gc; /* GC for filling */
- double x1;
- double x2;
- double y1;
- double y2;
-
- guint needs_redraw : 1;
-};
-
-static GnomeCanvasItemClass *parent_class;
-
-enum {
- PROP_0,
- PROP_FILL_COLOR,
- PROP_FILL_COLOR_GDK,
- PROP_FILL_COLOR_RGBA,
- PROP_FILL_STIPPLE,
- PROP_X1,
- PROP_X2,
- PROP_Y1,
- PROP_Y2,
-};
-
-static void
-get_color(ECanvasBackground *ecb)
-{
- GnomeCanvasItem *item = GNOME_CANVAS_ITEM (ecb);
- ecb->priv->color.pixel = gnome_canvas_get_color_pixel (item->canvas,
- GNOME_CANVAS_COLOR (ecb->priv->color.red >> 8,
- ecb->priv->color.green>> 8,
- ecb->priv->color.blue>> 8));
-}
-
-static void
-ecb_bounds (GnomeCanvasItem *item, double *x1, double *y1, double *x2, double *y2)
-{
- double i2c [6];
- ArtPoint c1, c2, i1, i2;
- ECanvasBackground *ecb = E_CANVAS_BACKGROUND (item);
-
- /* Wrong BBox's are the source of redraw nightmares */
-
- gnome_canvas_item_i2c_affine (GNOME_CANVAS_ITEM (ecb), i2c);
-
- i1.x = ecb->priv->x1;
- i1.y = ecb->priv->y1;
- i2.x = ecb->priv->x2;
- i2.y = ecb->priv->y2;
- art_affine_point (&c1, &i1, i2c);
- art_affine_point (&c2, &i2, i2c);
-
- if (ecb->priv->x1 < 0)
- c1.x = -(double)UINT_MAX;
-
- if (ecb->priv->y1 < 0)
- c1.y = -(double)UINT_MAX;
-
- if (ecb->priv->x2 < 0)
- c2.x = (double)UINT_MAX;
-
- if (ecb->priv->y2 < 0)
- c2.y = (double)UINT_MAX;
-
- *x1 = c1.x;
- *y1 = c1.y;
- *x2 = c2.x + 1;
- *y2 = c2.y + 1;
-}
-
-/*
- * GnomeCanvasItem::update method
- */
-static void
-ecb_update (GnomeCanvasItem *item, double *affine, ArtSVP *clip_path, int flags)
-{
- ArtPoint o1, o2;
- ECanvasBackground *ecb = E_CANVAS_BACKGROUND (item);
-
- if (GNOME_CANVAS_ITEM_CLASS (parent_class)->update)
- GNOME_CANVAS_ITEM_CLASS (parent_class)->update (item, affine, clip_path, flags);
-
- o1.x = item->x1;
- o1.y = item->y1;
- o2.x = item->x2;
- o2.y = item->y2;
-
- ecb_bounds (item, &item->x1, &item->y1, &item->x2, &item->y2);
- if (item->x1 != o1.x ||
- item->y1 != o1.y ||
- item->x2 != o2.x ||
- item->y2 != o2.y) {
- gnome_canvas_request_redraw (item->canvas, o1.x, o1.y, o2.x, o2.y);
- ecb->priv->needs_redraw = 1;
- }
-
- if (ecb->priv->needs_redraw) {
- gnome_canvas_request_redraw (item->canvas, item->x1, item->y1,
- item->x2, item->y2);
- ecb->priv->needs_redraw = 0;
- }
-}
-
-/* Sets the stipple pattern for the text */
-static void
-set_stipple (ECanvasBackground *ecb, GdkBitmap *stipple, int use_value)
-{
- if (use_value) {
- if (ecb->priv->stipple)
- gdk_bitmap_unref (ecb->priv->stipple);
-
- ecb->priv->stipple = stipple;
- if (stipple)
- gdk_bitmap_ref (stipple);
- }
-
- if (ecb->priv->gc) {
- if (stipple) {
- gdk_gc_set_stipple (ecb->priv->gc, stipple);
- gdk_gc_set_fill (ecb->priv->gc, GDK_STIPPLED);
- } else
- gdk_gc_set_fill (ecb->priv->gc, GDK_SOLID);
- }
-}
-
-static void
-ecb_dispose (GObject *object)
-{
- ECanvasBackground *ecb = E_CANVAS_BACKGROUND (object);
-
- if (ecb->priv) {
- if (ecb->priv->stipple)
- gdk_bitmap_unref (ecb->priv->stipple);
- ecb->priv->stipple = NULL;
-
- g_free (ecb->priv);
- ecb->priv = NULL;
- }
-
- if (G_OBJECT_CLASS (parent_class)->dispose)
- G_OBJECT_CLASS (parent_class)->dispose (object);
-}
-
-static void
-ecb_set_property (GObject *object,
- guint prop_id,
- const GValue *value,
- GParamSpec *pspec)
-{
- GnomeCanvasItem *item;
- ECanvasBackground *ecb;
-
- GdkColor color = { 0, 0, 0, 0, };
- GdkColor *pcolor;
- gboolean color_changed = FALSE;
-
- item = GNOME_CANVAS_ITEM (object);
- ecb = E_CANVAS_BACKGROUND (object);
-
- switch (prop_id){
- case PROP_FILL_COLOR:
- if (g_value_get_string (value))
- gdk_color_parse (g_value_get_string (value), &color);
-
- ecb->priv->rgba = ((color.red & 0xff00) << 16 |
- (color.green & 0xff00) << 8 |
- (color.blue & 0xff00) |
- 0xff);
- color_changed = TRUE;
- break;
-
- case PROP_FILL_COLOR_GDK:
- pcolor = g_value_get_pointer (value);
- if (pcolor) {
- color = *pcolor;
- }
-
- ecb->priv->rgba = ((color.red & 0xff00) << 16 |
- (color.green & 0xff00) << 8 |
- (color.blue & 0xff00) |
- 0xff);
- color_changed = TRUE;
- break;
-
- case PROP_FILL_COLOR_RGBA:
- ecb->priv->rgba = g_value_get_uint (value);
- color.red = ((ecb->priv->rgba >> 24) & 0xff) * 0x101;
- color.green = ((ecb->priv->rgba >> 16) & 0xff) * 0x101;
- color.blue = ((ecb->priv->rgba >> 8) & 0xff) * 0x101;
- color_changed = TRUE;
- break;
-
- case PROP_FILL_STIPPLE:
- set_stipple (ecb, g_value_get_object (value), TRUE);
- break;
-
- case PROP_X1:
- ecb->priv->x1 = g_value_get_double (value);
- break;
- case PROP_X2:
- ecb->priv->x2 = g_value_get_double (value);
- break;
- case PROP_Y1:
- ecb->priv->y1 = g_value_get_double (value);
- break;
- case PROP_Y2:
- ecb->priv->y2 = g_value_get_double (value);
- break;
- }
-
- if (color_changed) {
- ecb->priv->color = color;
-
- if (GNOME_CANVAS_ITEM_REALIZED & GTK_OBJECT_FLAGS(item)) {
- get_color (ecb);
- if (!item->canvas->aa) {
- gdk_gc_set_foreground (ecb->priv->gc, &ecb->priv->color);
- }
- }
- }
-
- ecb->priv->needs_redraw = 1;
- gnome_canvas_item_request_update (GNOME_CANVAS_ITEM(ecb));
-}
-
-static void
-ecb_get_property (GObject *object,
- guint prop_id,
- GValue *value,
- GParamSpec *pspec)
-{
- GnomeCanvasItem *item;
- ECanvasBackground *ecb;
-
- item = GNOME_CANVAS_ITEM (object);
- ecb = E_CANVAS_BACKGROUND (object);
-
- switch (prop_id){
- case PROP_FILL_COLOR_GDK:
- g_value_set_pointer (value, gdk_color_copy (&ecb->priv->color));
- break;
- case PROP_FILL_COLOR_RGBA:
- g_value_set_uint (value, ecb->priv->rgba);
- break;
- case PROP_FILL_STIPPLE:
- g_value_set_object (value, ecb->priv->stipple);
- break;
- case PROP_X1:
- g_value_set_double (value, ecb->priv->x1);
- break;
- case PROP_X2:
- g_value_set_double (value, ecb->priv->x2);
- break;
- case PROP_Y1:
- g_value_set_double (value, ecb->priv->y1);
- break;
- case PROP_Y2:
- g_value_set_double (value, ecb->priv->y2);
- break;
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
- break;
- }
-}
-
-static void
-ecb_init (GnomeCanvasItem *item)
-{
- ECanvasBackground *ecb = E_CANVAS_BACKGROUND (item);
-
- ecb->priv = g_new (ECanvasBackgroundPrivate, 1);
-
- ecb->priv->color.pixel = 0;
- ecb->priv->color.red = 0;
- ecb->priv->color.green = 0;
- ecb->priv->color.blue = 0;
- ecb->priv->stipple = NULL;
- ecb->priv->gc = NULL;
- ecb->priv->x1 = -1.0;
- ecb->priv->x2 = -1.0;
- ecb->priv->y1 = -1.0;
- ecb->priv->y2 = -1.0;
-}
-
-static void
-ecb_realize (GnomeCanvasItem *item)
-{
- ECanvasBackground *ecb = E_CANVAS_BACKGROUND (item);
-
- if (GNOME_CANVAS_ITEM_CLASS (parent_class)->realize)
- GNOME_CANVAS_ITEM_CLASS (parent_class)->realize (item);
-
- ecb->priv->gc = gdk_gc_new (item->canvas->layout.bin_window);
- get_color (ecb);
- if (!item->canvas->aa)
- gdk_gc_set_foreground (ecb->priv->gc, &ecb->priv->color);
-
- set_stipple (ecb, NULL, FALSE);
-
- ecb->priv->needs_redraw = 1;
- gnome_canvas_item_request_update (GNOME_CANVAS_ITEM (ecb));
-}
-
-static void
-ecb_unrealize (GnomeCanvasItem *item)
-{
- ECanvasBackground *ecb = E_CANVAS_BACKGROUND (item);
-
- gdk_gc_unref (ecb->priv->gc);
- ecb->priv->gc = NULL;
-
- if (GNOME_CANVAS_ITEM_CLASS (parent_class)->unrealize)
- GNOME_CANVAS_ITEM_CLASS (parent_class)->unrealize (item);
-}
-
-static void
-ecb_draw (GnomeCanvasItem *item, GdkDrawable *drawable, int x, int y, int width, int height)
-{
- ECanvasBackground *ecb = E_CANVAS_BACKGROUND (item);
- int x1, x2, y1, y2;
- double i2c [6];
- ArtPoint upper_left, lower_right, ecb_base_point;
-
- /*
- * Find out our real position after grouping
- */
- gnome_canvas_item_i2c_affine (item, i2c);
- ecb_base_point.x = ecb->priv->x1;
- ecb_base_point.y = ecb->priv->y1;
- art_affine_point (&upper_left, &ecb_base_point, i2c);
-
- ecb_base_point.x = ecb->priv->x2;
- ecb_base_point.y = ecb->priv->y2;
- art_affine_point (&lower_right, &ecb_base_point, i2c);
-
- x1 = 0;
- y1 = 0;
- x2 = width;
- y2 = height;
- if (ecb->priv->x1 >= 0 && upper_left.x > x1)
- x1 = upper_left.x;
- if (ecb->priv->y1 >= 0 && upper_left.y > y1)
- y1 = upper_left.y;
- if (ecb->priv->x2 >= 0 && lower_right.x < x2)
- x2 = lower_right.x;
- if (ecb->priv->y2 >= 0 && lower_right.y < y2)
- y2 = lower_right.y;
-
- gdk_draw_rectangle (drawable, ecb->priv->gc, TRUE,
- x1, y1, x2 - x1, y2 - y1);
-}
-
-static double
-ecb_point (GnomeCanvasItem *item, double x, double y, int cx, int cy,
- GnomeCanvasItem **actual_item)
-{
- ECanvasBackground *ecb = E_CANVAS_BACKGROUND (item);
-
- if (ecb->priv->x1 >= 0 && ecb->priv->x1 > x)
- return 1.0;
- if (ecb->priv->x2 >= 0 && ecb->priv->x2 < x)
- return 1.0;
- if (ecb->priv->y1 >= 0 && ecb->priv->y1 > y)
- return 1.0;
- if (ecb->priv->y2 >= 0 && ecb->priv->y2 < y)
- return 1.0;
- *actual_item = item;
-
- return 0.0;
-}
-
-static void
-ecb_class_init (GObjectClass *object_class)
-{
- GnomeCanvasItemClass *item_class = (GnomeCanvasItemClass *) object_class;
-
- parent_class = g_type_class_ref (PARENT_OBJECT_TYPE);
-
- object_class->dispose = ecb_dispose;
- object_class->set_property = ecb_set_property;
- object_class->get_property = ecb_get_property;
-
- item_class->update = ecb_update;
- item_class->realize = ecb_realize;
- item_class->unrealize = ecb_unrealize;
- item_class->draw = ecb_draw;
- item_class->point = ecb_point;
-
- g_object_class_install_property (object_class, PROP_FILL_COLOR,
- g_param_spec_string ("fill_color",
- _( "Fill color" ),
- _( "Fill color" ),
- NULL,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_FILL_COLOR_GDK,
- g_param_spec_pointer ("fill_color_gdk",
- _( "GDK fill color" ),
- _( "GDK fill color" ),
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_FILL_COLOR_RGBA,
- g_param_spec_uint ("fill_color_rgba",
- _( "GDK fill color" ),
- _( "GDK fill color" ),
- 0, G_MAXUINT, 0,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_FILL_STIPPLE,
- g_param_spec_object ("fill_stipple",
- _( "Fill stipple" ),
- _( "FIll stipple" ),
- GDK_TYPE_WINDOW,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_X1,
- g_param_spec_double ("x1",
- _( "X1" ),
- _( "X1" ),
- 0.0, G_MAXDOUBLE, 0.0,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_X2,
- g_param_spec_double ("x2",
- _( "X2" ),
- _( "X2" ),
- 0.0, G_MAXDOUBLE, 0.0,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_Y1,
- g_param_spec_double ("y1",
- _( "Y1" ),
- _( "Y1" ),
- 0.0, G_MAXDOUBLE, 0.0,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_Y2,
- g_param_spec_double ("y2",
- _( "Y2" ),
- _( "Y2" ),
- 0.0, G_MAXDOUBLE, 0.0,
- G_PARAM_READWRITE));
-}
-
-E_MAKE_TYPE (e_canvas_background,
- "ECanvasBackground",
- ECanvasBackground,
- ecb_class_init,
- ecb_init,
- PARENT_OBJECT_TYPE)
diff --git a/widgets/misc/e-canvas-background.h b/widgets/misc/e-canvas-background.h
deleted file mode 100644
index 4a8e3294fb..0000000000
--- a/widgets/misc/e-canvas-background.h
+++ /dev/null
@@ -1,71 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-canvas-background.h - background color for canvas.
- * Copyright 2001, Ximian, Inc.
- *
- * Authors:
- * Chris Lahey <clahey@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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.
- */
-
-#ifndef E_CANVAS_BACKGROUND_H
-#define E_CANVAS_BACKGROUND_H
-
-#include <libgnomecanvas/gnome-canvas.h>
-
-G_BEGIN_DECLS
-
-/*
- * name type read/write description
- * ------------------------------------------------------------------------------------------
- * fill_color string W X color specification for fill color,
- * or NULL pointer for no color (transparent)
- * fill_color_gdk GdkColor* RW Allocated GdkColor for fill
- * fill_stipple GdkBitmap* RW Stipple pattern for fill
- * x1 double RW Coordinates for edges of background rectangle
- * x2 double RW Default is all of them = -1.
- * y1 double RW Which means that the entire space is shown.
- * y2 double RW If you need the rectangle to have negative coordinates, use an affine.
- */
-
-
-#define E_CANVAS_BACKGROUND_TYPE (e_canvas_background_get_type ())
-#define E_CANVAS_BACKGROUND(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), E_CANVAS_BACKGROUND_TYPE, ECanvasBackground))
-#define E_CANVAS_BACKGROUND_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), E_CANVAS_BACKGROUND_TYPE, ECanvasBackgroundClass))
-#define E_IS_CANVAS_BACKGROUND(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), E_CANVAS_BACKGROUND_TYPE))
-#define E_IS_CANVAS_BACKGROUND_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), E_CANVAS_BACKGROUND_TYPE))
-
-typedef struct _ECanvasBackground ECanvasBackground;
-typedef struct _ECanvasBackgroundClass ECanvasBackgroundClass;
-typedef struct _ECanvasBackgroundPrivate ECanvasBackgroundPrivate;
-
-struct _ECanvasBackground {
- GnomeCanvasItem item;
-
- ECanvasBackgroundPrivate *priv;
-};
-
-struct _ECanvasBackgroundClass {
- GnomeCanvasItemClass parent_class;
-};
-
-
-/* Standard Gtk function */
-GtkType e_canvas_background_get_type (void);
-
-G_END_DECLS
-
-#endif
diff --git a/widgets/misc/e-canvas-utils.c b/widgets/misc/e-canvas-utils.c
deleted file mode 100644
index 629804a2d7..0000000000
--- a/widgets/misc/e-canvas-utils.c
+++ /dev/null
@@ -1,171 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-canvas-utils.c
- * Copyright 2000, 2001, Ximian, Inc.
- *
- * Authors:
- * Chris Lahey <clahey@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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 "e-canvas-utils.h"
-
-void
-e_canvas_item_move_absolute (GnomeCanvasItem *item, double dx, double dy)
-{
- double translate[6];
-
- g_return_if_fail (item != NULL);
- g_return_if_fail (GNOME_IS_CANVAS_ITEM (item));
-
- art_affine_translate (translate, dx, dy);
-
- gnome_canvas_item_affine_absolute (item, translate);
-}
-
-static double
-compute_offset(int top, int bottom, int page_top, int page_bottom)
-{
- int size = bottom - top;
- int offset = 0;
-
- if (top <= page_top && bottom >= page_bottom)
- return 0;
-
- if (bottom > page_bottom)
- offset = (bottom - page_bottom);
- if (top < page_top + offset)
- offset = (top - page_top);
-
- if (top <= page_top + offset && bottom >= page_bottom + offset)
- return offset;
-
- if (top < page_top + size * 3 / 2 + offset)
- offset = top - (page_top + size * 3 / 2);
- if (bottom > page_bottom - size * 3 / 2 + offset)
- offset = bottom - (page_bottom - size * 3 / 2);
- if (top < page_top + size * 3 / 2 + offset)
- offset = top - ((page_top + page_bottom - (bottom - top)) / 2);
-
- return offset;
-}
-
-
-static void
-e_canvas_show_area (GnomeCanvas *canvas, double x1, double y1, double x2, double y2)
-{
- GtkAdjustment *h, *v;
- int dx = 0, dy = 0;
-
- g_return_if_fail (canvas != NULL);
- g_return_if_fail (GNOME_IS_CANVAS (canvas));
-
- h = gtk_layout_get_hadjustment(GTK_LAYOUT(canvas));
- dx = compute_offset(x1, x2, h->value, h->value + h->page_size);
- if (dx)
- gtk_adjustment_set_value(h, CLAMP(h->value + dx, h->lower, h->upper - h->page_size));
-
- v = gtk_layout_get_vadjustment(GTK_LAYOUT(canvas));
- dy = compute_offset(y1, y2, v->value, v->value + v->page_size);
- if (dy)
- gtk_adjustment_set_value(v, CLAMP(v->value + dy, v->lower, v->upper - v->page_size));
-}
-
-void
-e_canvas_item_show_area (GnomeCanvasItem *item, double x1, double y1, double x2, double y2)
-{
- g_return_if_fail (item != NULL);
- g_return_if_fail (GNOME_IS_CANVAS_ITEM (item));
-
- gnome_canvas_item_i2w(item, &x1, &y1);
- gnome_canvas_item_i2w(item, &x2, &y2);
-
- e_canvas_show_area(item->canvas, x1, y1, x2, y2);
-}
-
-
-static gboolean
-e_canvas_area_shown (GnomeCanvas *canvas, double x1, double y1, double x2, double y2)
-{
- GtkAdjustment *h, *v;
- int dx = 0, dy = 0;
-
- g_return_val_if_fail (canvas != NULL, FALSE);
- g_return_val_if_fail (GNOME_IS_CANVAS (canvas), FALSE);
-
- h = gtk_layout_get_hadjustment(GTK_LAYOUT(canvas));
- dx = compute_offset(x1, x2, h->value, h->value + h->page_size);
- if (CLAMP(h->value + dx, h->lower, h->upper - h->page_size) - h->value != 0)
- return FALSE;
-
- v = gtk_layout_get_vadjustment(GTK_LAYOUT(canvas));
- dy = compute_offset(y1, y2, v->value, v->value + v->page_size);
- if (CLAMP(v->value + dy, v->lower, v->upper - v->page_size) - v->value != 0)
- return FALSE;
- return TRUE;
-}
-
-gboolean
-e_canvas_item_area_shown (GnomeCanvasItem *item, double x1, double y1, double x2, double y2)
-{
- g_return_val_if_fail (item != NULL, FALSE);
- g_return_val_if_fail (GNOME_IS_CANVAS_ITEM (item), FALSE);
-
- gnome_canvas_item_i2w(item, &x1, &y1);
- gnome_canvas_item_i2w(item, &x2, &y2);
-
- return e_canvas_area_shown(item->canvas, x1, y1, x2, y2);
-}
-
-typedef struct {
- double x1;
- double y1;
- double x2;
- double y2;
- GnomeCanvas *canvas;
-} DoubsAndCanvas;
-
-static gboolean
-show_area_timeout (gpointer data)
-{
- DoubsAndCanvas *dac = data;
-
- e_canvas_show_area(dac->canvas, dac->x1, dac->y1, dac->x2, dac->y2);
- g_object_unref (dac->canvas);
- g_free(dac);
- return FALSE;
-}
-
-void
-e_canvas_item_show_area_delayed (GnomeCanvasItem *item, double x1, double y1, double x2, double y2, gint delay)
-{
- DoubsAndCanvas *dac;
-
- g_return_if_fail (item != NULL);
- g_return_if_fail (GNOME_IS_CANVAS_ITEM (item));
-
- gnome_canvas_item_i2w(item, &x1, &y1);
- gnome_canvas_item_i2w(item, &x2, &y2);
-
- dac = g_new(DoubsAndCanvas, 1);
- dac->x1 = x1;
- dac->y1 = y1;
- dac->x2 = x2;
- dac->y2 = y2;
- dac->canvas = item->canvas;
- g_object_ref (item->canvas);
- g_timeout_add(delay, show_area_timeout, dac);
-}
diff --git a/widgets/misc/e-canvas-utils.h b/widgets/misc/e-canvas-utils.h
deleted file mode 100644
index 5b1a329140..0000000000
--- a/widgets/misc/e-canvas-utils.h
+++ /dev/null
@@ -1,55 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Copyright 2000, 2001, Ximian, Inc.
- *
- * Authors:
- * Chris Lahey <clahey@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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.
- */
-
-#ifndef __E_CANVAS_UTILS__
-#define __E_CANVAS_UTILS__
-
-#include <libgnomecanvas/gnome-canvas.h>
-
-G_BEGIN_DECLS
-
-void e_canvas_item_move_absolute (GnomeCanvasItem *item,
- double dx,
- double dy);
-void e_canvas_item_show_area (GnomeCanvasItem *item,
- double x1,
- double y1,
- double x2,
- double y2);
-void e_canvas_item_show_area_delayed (GnomeCanvasItem *item,
- double x1,
- double y1,
- double x2,
- double y2,
- gint delay);
-/* Returns TRUE if the area is already shown on the screen (including
- spacing.) This is equivelent to returning FALSE iff show_area
- would do anything. */
-gboolean e_canvas_item_area_shown (GnomeCanvasItem *item,
- double x1,
- double y1,
- double x2,
- double y2);
-
-G_END_DECLS
-
-#endif /* __E_CANVAS_UTILS__ */
diff --git a/widgets/misc/e-canvas-vbox.c b/widgets/misc/e-canvas-vbox.c
deleted file mode 100644
index 354da5d872..0000000000
--- a/widgets/misc/e-canvas-vbox.c
+++ /dev/null
@@ -1,381 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-canvas-vbox.c
- * Copyright 2000, 2001, Ximian, Inc.
- *
- * Authors:
- * Chris Lahey <clahey@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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 <math.h>
-#include <gdk/gdkkeysyms.h>
-#include <gtk/gtksignal.h>
-#include "e-canvas-vbox.h"
-#include "e-canvas-utils.h"
-#include "e-canvas.h"
-#include "gal/util/e-util.h"
-#include "gal/util/e-i18n.h"
-
-static void e_canvas_vbox_init (ECanvasVbox *CanvasVbox);
-static void e_canvas_vbox_class_init (ECanvasVboxClass *klass);
-static void e_canvas_vbox_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec);
-static void e_canvas_vbox_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec);
-static void e_canvas_vbox_dispose (GObject *object);
-
-static gint e_canvas_vbox_event (GnomeCanvasItem *item, GdkEvent *event);
-static void e_canvas_vbox_realize (GnomeCanvasItem *item);
-
-static void e_canvas_vbox_reflow (GnomeCanvasItem *item, int flags);
-
-static void e_canvas_vbox_real_add_item(ECanvasVbox *e_canvas_vbox, GnomeCanvasItem *item);
-static void e_canvas_vbox_real_add_item_start(ECanvasVbox *e_canvas_vbox, GnomeCanvasItem *item);
-static void e_canvas_vbox_resize_children (GnomeCanvasItem *item);
-
-#define PARENT_TYPE GNOME_TYPE_CANVAS_GROUP
-static GnomeCanvasGroupClass *parent_class = NULL;
-
-/* The arguments we take */
-enum {
- PROP_0,
- PROP_WIDTH,
- PROP_MINIMUM_WIDTH,
- PROP_HEIGHT,
- PROP_SPACING
-};
-
-E_MAKE_TYPE (e_canvas_vbox,
- "ECanvasVbox",
- ECanvasVbox,
- e_canvas_vbox_class_init,
- e_canvas_vbox_init,
- PARENT_TYPE)
-
-static void
-e_canvas_vbox_class_init (ECanvasVboxClass *klass)
-{
- GObjectClass *object_class;
- GnomeCanvasItemClass *item_class;
-
- object_class = (GObjectClass*) klass;
- item_class = (GnomeCanvasItemClass *) klass;
-
- parent_class = g_type_class_ref (PARENT_TYPE);
-
- klass->add_item = e_canvas_vbox_real_add_item;
- klass->add_item_start = e_canvas_vbox_real_add_item_start;
-
- object_class->set_property = e_canvas_vbox_set_property;
- object_class->get_property = e_canvas_vbox_get_property;
- object_class->dispose = e_canvas_vbox_dispose;
-
- /* GnomeCanvasItem method overrides */
- item_class->event = e_canvas_vbox_event;
- item_class->realize = e_canvas_vbox_realize;
-
- g_object_class_install_property (object_class, PROP_WIDTH,
- g_param_spec_double ("width",
- _( "Width" ),
- _( "Width" ),
- 0.0, G_MAXDOUBLE, 0.0,
- G_PARAM_READWRITE));
- g_object_class_install_property (object_class, PROP_MINIMUM_WIDTH,
- g_param_spec_double ("minimum_width",
- _( "Minimum width" ),
- _( "Minimum Width" ),
- 0.0, G_MAXDOUBLE, 0.0,
- G_PARAM_READWRITE));
- g_object_class_install_property (object_class, PROP_HEIGHT,
- g_param_spec_double ("height",
- _( "Height" ),
- _( "Height" ),
- 0.0, G_MAXDOUBLE, 0.0,
- G_PARAM_READABLE));
- g_object_class_install_property (object_class, PROP_SPACING,
- g_param_spec_double ("spacing",
- _( "Spacing" ),
- _( "Spacing" ),
- 0.0, G_MAXDOUBLE, 0.0,
- G_PARAM_READWRITE));
-}
-
-static void
-e_canvas_vbox_init (ECanvasVbox *vbox)
-{
- vbox->items = NULL;
-
- vbox->width = 10;
- vbox->minimum_width = 10;
- vbox->height = 10;
- vbox->spacing = 0;
-
- e_canvas_item_set_reflow_callback(GNOME_CANVAS_ITEM(vbox), e_canvas_vbox_reflow);
-}
-
-static void
-e_canvas_vbox_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec)
-{
- GnomeCanvasItem *item;
- ECanvasVbox *e_canvas_vbox;
-
- item = GNOME_CANVAS_ITEM (object);
- e_canvas_vbox = E_CANVAS_VBOX (object);
-
- switch (prop_id){
- case PROP_WIDTH:
- case PROP_MINIMUM_WIDTH:
- e_canvas_vbox->minimum_width = g_value_get_double (value);
- e_canvas_vbox_resize_children(item);
- e_canvas_item_request_reflow(item);
- break;
- case PROP_SPACING:
- e_canvas_vbox->spacing = g_value_get_double (value);
- e_canvas_item_request_reflow(item);
- break;
- }
-}
-
-static void
-e_canvas_vbox_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec)
-{
- ECanvasVbox *e_canvas_vbox;
-
- e_canvas_vbox = E_CANVAS_VBOX (object);
-
- switch (prop_id) {
- case PROP_WIDTH:
- g_value_set_double (value, e_canvas_vbox->width);
- break;
- case PROP_MINIMUM_WIDTH:
- g_value_set_double (value, e_canvas_vbox->minimum_width);
- break;
- case PROP_HEIGHT:
- g_value_set_double (value, e_canvas_vbox->height);
- break;
- case PROP_SPACING:
- g_value_set_double (value, e_canvas_vbox->spacing);
- break;
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
- break;
- }
-}
-
-/* Used from g_list_foreach(); disconnects from an item's signals */
-static void
-disconnect_item_cb (gpointer data, gpointer user_data)
-{
- ECanvasVbox *vbox;
- GnomeCanvasItem *item;
-
- vbox = E_CANVAS_VBOX (user_data);
-
- item = GNOME_CANVAS_ITEM (data);
- g_signal_handlers_disconnect_matched (item,
- G_SIGNAL_MATCH_DATA,
- 0, 0, NULL, NULL,
- vbox);
-}
-
-static void
-e_canvas_vbox_dispose (GObject *object)
-{
- ECanvasVbox *vbox = E_CANVAS_VBOX(object);
-
- if (vbox->items) {
- g_list_foreach(vbox->items, disconnect_item_cb, vbox);
- g_list_free(vbox->items);
- vbox->items = NULL;
- }
-
- G_OBJECT_CLASS(parent_class)->dispose (object);
-}
-
-static gint
-e_canvas_vbox_event (GnomeCanvasItem *item, GdkEvent *event)
-{
- gint return_val = TRUE;
-
- switch (event->type) {
- case GDK_KEY_PRESS:
- switch (event->key.keyval) {
- case GDK_Left:
- case GDK_KP_Left:
- case GDK_Right:
- case GDK_KP_Right:
- case GDK_Down:
- case GDK_KP_Down:
- case GDK_Up:
- case GDK_KP_Up:
- case GDK_Return:
- case GDK_KP_Enter:
- return_val = TRUE;
- break;
- default:
- return_val = FALSE;
- break;
- }
- break;
- default:
- return_val = FALSE;
- break;
- }
- if (!return_val) {
- if (GNOME_CANVAS_ITEM_CLASS(parent_class)->event)
- return GNOME_CANVAS_ITEM_CLASS (parent_class)->event (item, event);
- }
- return return_val;
-
-}
-
-static void
-e_canvas_vbox_realize (GnomeCanvasItem *item)
-{
- if (GNOME_CANVAS_ITEM_CLASS(parent_class)->realize)
- (* GNOME_CANVAS_ITEM_CLASS(parent_class)->realize) (item);
-
- e_canvas_vbox_resize_children(item);
- e_canvas_item_request_reflow(item);
-}
-
-static void
-e_canvas_vbox_remove_item (gpointer data, GObject *where_object_was)
-{
- ECanvasVbox *vbox = data;
- vbox->items = g_list_remove(vbox->items, where_object_was);
-}
-
-static void
-e_canvas_vbox_real_add_item(ECanvasVbox *e_canvas_vbox, GnomeCanvasItem *item)
-{
- e_canvas_vbox->items = g_list_append(e_canvas_vbox->items, item);
- g_object_weak_ref (G_OBJECT (item),
- e_canvas_vbox_remove_item, e_canvas_vbox);
- if ( GTK_OBJECT_FLAGS( e_canvas_vbox ) & GNOME_CANVAS_ITEM_REALIZED ) {
- gnome_canvas_item_set(item,
- "width", (double) e_canvas_vbox->minimum_width,
- NULL);
- e_canvas_item_request_reflow(item);
- }
-}
-
-
-static void
-e_canvas_vbox_real_add_item_start(ECanvasVbox *e_canvas_vbox, GnomeCanvasItem *item)
-{
- e_canvas_vbox->items = g_list_prepend(e_canvas_vbox->items, item);
- g_object_weak_ref (G_OBJECT (item),
- e_canvas_vbox_remove_item, e_canvas_vbox);
- if ( GTK_OBJECT_FLAGS( e_canvas_vbox ) & GNOME_CANVAS_ITEM_REALIZED ) {
- gnome_canvas_item_set(item,
- "width", (double) e_canvas_vbox->minimum_width,
- NULL);
- e_canvas_item_request_reflow(item);
- }
-}
-
-static void
-e_canvas_vbox_resize_children (GnomeCanvasItem *item)
-{
- GList *list;
- ECanvasVbox *e_canvas_vbox;
-
- e_canvas_vbox = E_CANVAS_VBOX (item);
- for ( list = e_canvas_vbox->items; list; list = list->next ) {
- GnomeCanvasItem *child = GNOME_CANVAS_ITEM(list->data);
- gnome_canvas_item_set(child,
- "width", (double) e_canvas_vbox->minimum_width,
- NULL);
- }
-}
-
-static void
-e_canvas_vbox_reflow( GnomeCanvasItem *item, int flags )
-{
- ECanvasVbox *e_canvas_vbox = E_CANVAS_VBOX(item);
- if ( GTK_OBJECT_FLAGS( e_canvas_vbox ) & GNOME_CANVAS_ITEM_REALIZED ) {
-
- gdouble old_height;
- gdouble running_height;
- gdouble old_width;
- gdouble max_width;
-
- old_width = e_canvas_vbox->width;
- max_width = e_canvas_vbox->minimum_width;
-
- old_height = e_canvas_vbox->height;
- running_height = 0;
-
- if (e_canvas_vbox->items == NULL) {
- } else {
- GList *list;
- gdouble item_height;
- gdouble item_width;
-
- list = e_canvas_vbox->items;
- g_object_get (list->data,
- "height", &item_height,
- "width", &item_width,
- NULL);
- e_canvas_item_move_absolute(GNOME_CANVAS_ITEM(list->data),
- (double) 0,
- (double) running_height);
- running_height += item_height;
- if (max_width < item_width)
- max_width = item_width;
- list = g_list_next(list);
-
- for( ; list; list = g_list_next(list)) {
- running_height += e_canvas_vbox->spacing;
-
- g_object_get (list->data,
- "height", &item_height,
- "width", &item_width,
- NULL);
-
- e_canvas_item_move_absolute(GNOME_CANVAS_ITEM(list->data),
- (double) 0,
- (double) running_height);
-
- running_height += item_height;
- if (max_width < item_width)
- max_width = item_width;
- }
-
- }
- e_canvas_vbox->height = running_height;
- e_canvas_vbox->width = max_width;
- if (old_height != e_canvas_vbox->height ||
- old_width != e_canvas_vbox->width)
- e_canvas_item_request_parent_reflow(item);
- }
-}
-
-void
-e_canvas_vbox_add_item(ECanvasVbox *e_canvas_vbox, GnomeCanvasItem *item)
-{
- if (E_CANVAS_VBOX_CLASS(GTK_OBJECT_GET_CLASS(e_canvas_vbox))->add_item)
- (E_CANVAS_VBOX_CLASS(GTK_OBJECT_GET_CLASS(e_canvas_vbox))->add_item) (e_canvas_vbox, item);
-}
-
-void
-e_canvas_vbox_add_item_start(ECanvasVbox *e_canvas_vbox, GnomeCanvasItem *item)
-{
- if (E_CANVAS_VBOX_CLASS(GTK_OBJECT_GET_CLASS(e_canvas_vbox))->add_item_start)
- (E_CANVAS_VBOX_CLASS(GTK_OBJECT_GET_CLASS(e_canvas_vbox))->add_item_start) (e_canvas_vbox, item);
-}
-
diff --git a/widgets/misc/e-canvas-vbox.h b/widgets/misc/e-canvas-vbox.h
deleted file mode 100644
index 7d80e7c056..0000000000
--- a/widgets/misc/e-canvas-vbox.h
+++ /dev/null
@@ -1,93 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-canvas-vbox.h
- * Copyright 2000, 2001, Ximian, Inc.
- *
- * Authors:
- * Chris Lahey <clahey@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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.
- */
-
-#ifndef __E_CANVAS_VBOX_H__
-#define __E_CANVAS_VBOX_H__
-
-#include <gtk/gtktypeutils.h>
-#include <libgnomecanvas/gnome-canvas.h>
-
-#ifdef __cplusplus
-extern "C" {
-#pragma }
-#endif /* __cplusplus */
-
-/* ECanvasVbox - A canvas item container.
- *
- * The following arguments are available:
- *
- * name type read/write description
- * --------------------------------------------------------------------------------
- * width double RW width of the CanvasVbox
- * height double R height of the CanvasVbox
- * spacing double RW Spacing between items.
- */
-
-#define E_CANVAS_VBOX_TYPE (e_canvas_vbox_get_type ())
-#define E_CANVAS_VBOX(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), E_CANVAS_VBOX_TYPE, ECanvasVbox))
-#define E_CANVAS_VBOX_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), E_CANVAS_VBOX_TYPE, ECanvasVboxClass))
-#define E_IS_CANVAS_VBOX(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), E_CANVAS_VBOX_TYPE))
-#define E_IS_CANVAS_VBOX_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), E_CANVAS_VBOX_TYPE))
-
-
-typedef struct _ECanvasVbox ECanvasVbox;
-typedef struct _ECanvasVboxClass ECanvasVboxClass;
-
-struct _ECanvasVbox
-{
- GnomeCanvasGroup parent;
-
- /* item specific fields */
- GList *items; /* Of type GnomeCanvasItem */
-
- double width;
- double minimum_width;
- double height;
- double spacing;
-};
-
-struct _ECanvasVboxClass
-{
- GnomeCanvasGroupClass parent_class;
-
- /* Virtual methods. */
- void (* add_item) (ECanvasVbox *CanvasVbox, GnomeCanvasItem *item);
- void (* add_item_start) (ECanvasVbox *CanvasVbox, GnomeCanvasItem *item);
-};
-
-/*
- * To be added to a CanvasVbox, an item must have the argument "width" as
- * a Read/Write argument and "height" as a Read Only argument. It
- * should also do an ECanvas parent CanvasVbox request if its size
- * changes.
- */
-void e_canvas_vbox_add_item(ECanvasVbox *e_canvas_vbox, GnomeCanvasItem *item);
-void e_canvas_vbox_add_item_start(ECanvasVbox *e_canvas_vbox, GnomeCanvasItem *item);
-GtkType e_canvas_vbox_get_type (void);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-
-#endif /* __E_CANVAS_VBOX_H__ */
diff --git a/widgets/misc/e-canvas.c b/widgets/misc/e-canvas.c
deleted file mode 100644
index 1bbeef9a28..0000000000
--- a/widgets/misc/e-canvas.c
+++ /dev/null
@@ -1,1164 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-canvas.c
- * Copyright 2000, 2001, Ximian, Inc.
- *
- * Authors:
- * Chris Lahey <clahey@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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 <gtk/gtksignal.h>
-#include "e-canvas.h"
-#include "gal/util/e-util.h"
-#include <X11/Xlib.h>
-#include <gtk/gtkmain.h>
-
-static void e_canvas_init (ECanvas *card);
-static void e_canvas_dispose (GObject *object);
-static void e_canvas_class_init (ECanvasClass *klass);
-static void e_canvas_realize (GtkWidget *widget);
-static void e_canvas_unrealize (GtkWidget *widget);
-static gint e_canvas_key (GtkWidget *widget,
- GdkEventKey *event);
-static gint e_canvas_button (GtkWidget *widget,
- GdkEventButton *event);
-
-static gint e_canvas_visibility (GtkWidget *widget,
- GdkEventVisibility *event,
- ECanvas *canvas);
-
-static gint e_canvas_focus_in (GtkWidget *widget,
- GdkEventFocus *event);
-static gint e_canvas_focus_out (GtkWidget *widget,
- GdkEventFocus *event);
-
-static void e_canvas_style_set (GtkWidget *widget,
- GtkStyle *previous_style);
-
-static int emit_event (GnomeCanvas *canvas, GdkEvent *event);
-
-#define PARENT_TYPE GNOME_TYPE_CANVAS
-static GnomeCanvasClass *parent_class = NULL;
-
-#define d(x)
-
-enum {
- REFLOW,
- LAST_SIGNAL
-};
-
-static guint e_canvas_signals [LAST_SIGNAL] = { 0, };
-
-E_MAKE_TYPE (e_canvas,
- "ECanvas",
- ECanvas,
- e_canvas_class_init,
- e_canvas_init,
- PARENT_TYPE)
-
-static void
-e_canvas_class_init (ECanvasClass *klass)
-{
- GObjectClass *object_class;
- GnomeCanvasClass *canvas_class;
- GtkWidgetClass *widget_class;
-
- object_class = (GObjectClass*) klass;
- canvas_class = (GnomeCanvasClass *) klass;
- widget_class = (GtkWidgetClass *) klass;
-
- parent_class = g_type_class_ref (PARENT_TYPE);
-
- object_class->dispose = e_canvas_dispose;
-
- widget_class->key_press_event = e_canvas_key;
- widget_class->key_release_event = e_canvas_key;
- widget_class->button_press_event = e_canvas_button;
- widget_class->button_release_event = e_canvas_button;
- widget_class->focus_in_event = e_canvas_focus_in;
- widget_class->focus_out_event = e_canvas_focus_out;
- widget_class->style_set = e_canvas_style_set;
- widget_class->realize = e_canvas_realize;
- widget_class->unrealize = e_canvas_unrealize;
-
- klass->reflow = NULL;
-
- e_canvas_signals [REFLOW] =
- g_signal_new ("reflow",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (ECanvasClass, reflow),
- NULL, NULL,
- e_marshal_NONE__NONE,
- G_TYPE_NONE, 0);
-}
-
-static void
-e_canvas_init (ECanvas *canvas)
-{
- canvas->selection = NULL;
- canvas->cursor = NULL;
-#ifdef GAL_GDK_IM
- canvas->ic = NULL;
- canvas->ic_attr = NULL;
-#endif
- canvas->tooltip_window = NULL;
-}
-
-static void
-e_canvas_dispose (GObject *object)
-{
- ECanvas *canvas = E_CANVAS(object);
-
- if (canvas->idle_id)
- g_source_remove(canvas->idle_id);
- canvas->idle_id = 0;
-
- if (canvas->grab_cancelled_check_id)
- g_source_remove (canvas->grab_cancelled_check_id);
- canvas->grab_cancelled_check_id = 0;
-
- if (canvas->toplevel) {
- if (canvas->visibility_notify_id)
- g_signal_handler_disconnect (canvas->toplevel,
- canvas->visibility_notify_id);
- canvas->visibility_notify_id = 0;
-
- g_object_unref (canvas->toplevel);
- canvas->toplevel = NULL;
- }
-
- e_canvas_hide_tooltip(canvas);
-
- if ((G_OBJECT_CLASS (parent_class))->dispose)
- (*(G_OBJECT_CLASS (parent_class))->dispose) (object);
-}
-
-GtkWidget *
-e_canvas_new ()
-{
- return GTK_WIDGET (g_object_new (E_CANVAS_TYPE, NULL));
-}
-
-
-/* Emits an event for an item in the canvas, be it the current item, grabbed
- * item, or focused item, as appropriate.
- */
-static int
-emit_event (GnomeCanvas *canvas, GdkEvent *event)
-{
- GdkEvent *ev;
- gint finished;
- GnomeCanvasItem *item;
- GnomeCanvasItem *parent;
- guint mask;
-
- /* Choose where we send the event */
-
- item = canvas->current_item;
-
- if (canvas->focused_item
- && ((event->type == GDK_KEY_PRESS) || (event->type == GDK_KEY_RELEASE) || (event->type == GDK_FOCUS_CHANGE)))
- item = canvas->focused_item;
-
- if (canvas->grabbed_item)
- item = canvas->grabbed_item;
-
- /* Perform checks for grabbed items */
-
- if (canvas->grabbed_item) {
- switch (event->type) {
- case GDK_ENTER_NOTIFY:
- mask = GDK_ENTER_NOTIFY_MASK;
- break;
-
- case GDK_LEAVE_NOTIFY:
- mask = GDK_LEAVE_NOTIFY_MASK;
- break;
-
- case GDK_MOTION_NOTIFY:
- mask = GDK_POINTER_MOTION_MASK;
- break;
-
- case GDK_BUTTON_PRESS:
- case GDK_2BUTTON_PRESS:
- case GDK_3BUTTON_PRESS:
- mask = GDK_BUTTON_PRESS_MASK;
- break;
-
- case GDK_BUTTON_RELEASE:
- mask = GDK_BUTTON_RELEASE_MASK;
- break;
-
- case GDK_KEY_PRESS:
- mask = GDK_KEY_PRESS_MASK;
- break;
-
- case GDK_KEY_RELEASE:
- mask = GDK_KEY_RELEASE_MASK;
- break;
-
- default:
- mask = 0;
- break;
- }
-
- if (!(mask & canvas->grabbed_event_mask))
- return FALSE;
- }
-
- /* Convert to world coordinates -- we have two cases because of diferent
- * offsets of the fields in the event structures.
- */
-
- ev = gdk_event_copy (event);
-
- switch (ev->type) {
- case GDK_ENTER_NOTIFY:
- case GDK_LEAVE_NOTIFY:
- gnome_canvas_window_to_world (canvas,
- ev->crossing.x, ev->crossing.y,
- &ev->crossing.x, &ev->crossing.y);
- break;
-
- case GDK_MOTION_NOTIFY:
- case GDK_BUTTON_PRESS:
- case GDK_2BUTTON_PRESS:
- case GDK_3BUTTON_PRESS:
- case GDK_BUTTON_RELEASE:
- gnome_canvas_window_to_world (canvas,
- ev->motion.x, ev->motion.y,
- &ev->motion.x, &ev->motion.y);
- break;
-
- default:
- break;
- }
-
- /* The event is propagated up the hierarchy (for if someone connected to
- * a group instead of a leaf event), and emission is stopped if a
- * handler returns TRUE, just like for GtkWidget events.
- */
-
- finished = FALSE;
-
- while (item && !finished) {
- g_object_ref (item);
-
- g_signal_emit_by_name (item, "event", ev, &finished);
-
- parent = item->parent;
- g_object_unref (item);
-
- item = parent;
- }
-
- gdk_event_free (ev);
-
- return finished;
-}
-
-/* Key event handler for the canvas */
-static gint
-e_canvas_key (GtkWidget *widget, GdkEventKey *event)
-{
- GnomeCanvas *canvas;
- GdkEvent full_event;
-
- g_return_val_if_fail (widget != NULL, FALSE);
- g_return_val_if_fail (GNOME_IS_CANVAS (widget), FALSE);
- g_return_val_if_fail (event != NULL, FALSE);
-
- canvas = GNOME_CANVAS (widget);
-
- full_event.key = *event;
-
- return emit_event (canvas, &full_event);
-}
-
-
-/* This routine invokes the point method of the item. The argument x, y should
- * be in the parent's item-relative coordinate system. This routine applies the
- * inverse of the item's transform, maintaining the affine invariant.
- */
-#define HACKISH_AFFINE
-
-static double
-gnome_canvas_item_invoke_point (GnomeCanvasItem *item, double x, double y, int cx, int cy,
- GnomeCanvasItem **actual_item)
-{
-#ifdef HACKISH_AFFINE
- double i2w[6], w2c[6], i2c[6], c2i[6];
- ArtPoint c, i;
-#endif
-
-#ifdef HACKISH_AFFINE
- gnome_canvas_item_i2w_affine (item, i2w);
- gnome_canvas_w2c_affine (item->canvas, w2c);
- art_affine_multiply (i2c, i2w, w2c);
- art_affine_invert (c2i, i2c);
- c.x = cx;
- c.y = cy;
- art_affine_point (&i, &c, c2i);
- x = i.x;
- y = i.y;
-#endif
-
- return (* GNOME_CANVAS_ITEM_CLASS (GTK_OBJECT_GET_CLASS (item))->point) (
- item, x, y, cx, cy, actual_item);
-}
-
-/* Re-picks the current item in the canvas, based on the event's coordinates.
- * Also emits enter/leave events for items as appropriate.
- */
-#define DISPLAY_X1(canvas) (GNOME_CANVAS (canvas)->layout.xoffset)
-#define DISPLAY_Y1(canvas) (GNOME_CANVAS (canvas)->layout.yoffset)
-static int
-pick_current_item (GnomeCanvas *canvas, GdkEvent *event)
-{
- int button_down;
- double x, y;
- int cx, cy;
- int retval;
-
- retval = FALSE;
-
- /* If a button is down, we'll perform enter and leave events on the
- * current item, but not enter on any other item. This is more or less
- * like X pointer grabbing for canvas items.
- */
- button_down = canvas->state & (GDK_BUTTON1_MASK
- | GDK_BUTTON2_MASK
- | GDK_BUTTON3_MASK
- | GDK_BUTTON4_MASK
- | GDK_BUTTON5_MASK);
- d(g_print ("%s:%d: button_down = %s\n", __FUNCTION__, __LINE__, button_down ? "TRUE" : "FALSE"));
- if (!button_down)
- canvas->left_grabbed_item = FALSE;
-
- /* Save the event in the canvas. This is used to synthesize enter and
- * leave events in case the current item changes. It is also used to
- * re-pick the current item if the current one gets deleted. Also,
- * synthesize an enter event.
- */
- if (event != &canvas->pick_event) {
- if ((event->type == GDK_MOTION_NOTIFY) || (event->type == GDK_BUTTON_RELEASE)) {
- /* these fields have the same offsets in both types of events */
-
- canvas->pick_event.crossing.type = GDK_ENTER_NOTIFY;
- canvas->pick_event.crossing.window = event->motion.window;
- canvas->pick_event.crossing.send_event = event->motion.send_event;
- canvas->pick_event.crossing.subwindow = NULL;
- canvas->pick_event.crossing.x = event->motion.x;
- canvas->pick_event.crossing.y = event->motion.y;
- canvas->pick_event.crossing.mode = GDK_CROSSING_NORMAL;
- canvas->pick_event.crossing.detail = GDK_NOTIFY_NONLINEAR;
- canvas->pick_event.crossing.focus = FALSE;
- canvas->pick_event.crossing.state = event->motion.state;
-
- /* these fields don't have the same offsets in both types of events */
-
- if (event->type == GDK_MOTION_NOTIFY) {
- canvas->pick_event.crossing.x_root = event->motion.x_root;
- canvas->pick_event.crossing.y_root = event->motion.y_root;
- } else {
- canvas->pick_event.crossing.x_root = event->button.x_root;
- canvas->pick_event.crossing.y_root = event->button.y_root;
- }
- } else
- canvas->pick_event = *event;
- }
-
- /* Don't do anything else if this is a recursive call */
-
- if (canvas->in_repick)
- return retval;
-
- /* LeaveNotify means that there is no current item, so we don't look for one */
-
- if (canvas->pick_event.type != GDK_LEAVE_NOTIFY) {
- /* these fields don't have the same offsets in both types of events */
-
- if (canvas->pick_event.type == GDK_ENTER_NOTIFY) {
- x = canvas->pick_event.crossing.x + canvas->scroll_x1 - canvas->zoom_xofs;
- y = canvas->pick_event.crossing.y + canvas->scroll_y1 - canvas->zoom_yofs;
- } else {
- x = canvas->pick_event.motion.x + canvas->scroll_x1 - canvas->zoom_xofs;
- y = canvas->pick_event.motion.y + canvas->scroll_y1 - canvas->zoom_yofs;
- }
-
- /* canvas pixel coords */
-
- cx = (int) (x + 0.5);
- cy = (int) (y + 0.5);
-
- /* world coords */
-
- x = canvas->scroll_x1 + x / canvas->pixels_per_unit;
- y = canvas->scroll_y1 + y / canvas->pixels_per_unit;
-
- /* find the closest item */
-
- if (canvas->root->object.flags & GNOME_CANVAS_ITEM_VISIBLE)
- gnome_canvas_item_invoke_point (canvas->root, x, y, cx, cy,
- &canvas->new_current_item);
- else
- canvas->new_current_item = NULL;
- } else
- canvas->new_current_item = NULL;
-
- if ((canvas->new_current_item == canvas->current_item) && !canvas->left_grabbed_item)
- return retval; /* current item did not change */
-
- /* Synthesize events for old and new current items */
-
- if ((canvas->new_current_item != canvas->current_item)
- && (canvas->current_item != NULL)
- && !canvas->left_grabbed_item) {
- GdkEvent new_event;
- GnomeCanvasItem *item;
-
- item = canvas->current_item;
-
- new_event = canvas->pick_event;
- new_event.type = GDK_LEAVE_NOTIFY;
-
- new_event.crossing.detail = GDK_NOTIFY_ANCESTOR;
- new_event.crossing.subwindow = NULL;
- canvas->in_repick = TRUE;
- retval = emit_event (canvas, &new_event);
- canvas->in_repick = FALSE;
- }
-
- /* new_current_item may have been set to NULL during the call to emit_event() above */
-
- if ((canvas->new_current_item != canvas->current_item) && button_down) {
- canvas->left_grabbed_item = TRUE;
- return retval;
- }
-
- /* Handle the rest of cases */
-
- canvas->left_grabbed_item = FALSE;
- canvas->current_item = canvas->new_current_item;
-
- if (canvas->current_item != NULL) {
- GdkEvent new_event;
-
- new_event = canvas->pick_event;
- new_event.type = GDK_ENTER_NOTIFY;
- new_event.crossing.detail = GDK_NOTIFY_ANCESTOR;
- new_event.crossing.subwindow = NULL;
- retval = emit_event (canvas, &new_event);
- }
-
- return retval;
-}
-
-/* Button event handler for the canvas */
-static gint
-e_canvas_button (GtkWidget *widget, GdkEventButton *event)
-{
- GnomeCanvas *canvas;
- int mask;
- int retval;
-
- g_return_val_if_fail (widget != NULL, FALSE);
- g_return_val_if_fail (GNOME_IS_CANVAS (widget), FALSE);
- g_return_val_if_fail (event != NULL, FALSE);
-
- retval = FALSE;
-
- canvas = GNOME_CANVAS (widget);
-
- d(g_print ("button %d, event type %d, grabbed=%p, current=%p\n",
- event->button,
- event->type,
- canvas->grabbed_item,
- canvas->current_item));
-
- /* dispatch normally regardless of the event's window if an item has
- has a pointer grab in effect */
- if (!canvas->grabbed_item && event->window != canvas->layout.bin_window)
- return retval;
-
- switch (event->button) {
- case 1:
- mask = GDK_BUTTON1_MASK;
- break;
- case 2:
- mask = GDK_BUTTON2_MASK;
- break;
- case 3:
- mask = GDK_BUTTON3_MASK;
- break;
- case 4:
- mask = GDK_BUTTON4_MASK;
- break;
- case 5:
- mask = GDK_BUTTON5_MASK;
- break;
- default:
- mask = 0;
- }
-
- switch (event->type) {
- case GDK_BUTTON_PRESS:
- case GDK_2BUTTON_PRESS:
- case GDK_3BUTTON_PRESS:
- /* Pick the current item as if the button were not pressed, and
- * then process the event.
- */
- canvas->state = event->state;
- pick_current_item (canvas, (GdkEvent *) event);
- canvas->state ^= mask;
- retval = emit_event (canvas, (GdkEvent *) event);
- break;
-
- case GDK_BUTTON_RELEASE:
- /* Process the event as if the button were pressed, then repick
- * after the button has been released
- */
- canvas->state = event->state;
- retval = emit_event (canvas, (GdkEvent *) event);
- event->state ^= mask;
- canvas->state = event->state;
- pick_current_item (canvas, (GdkEvent *) event);
- event->state ^= mask;
- break;
-
- default:
- g_assert_not_reached ();
- }
-
- return retval;
-}
-
-/* Key event handler for the canvas */
-static gint
-e_canvas_visibility (GtkWidget *widget, GdkEventVisibility *event, ECanvas *canvas)
-{
- if (! canvas->visibility_first) {
- e_canvas_hide_tooltip(canvas);
- }
- canvas->visibility_first = FALSE;
-
- return FALSE;
-}
-
-
-/**
- * e_canvas_item_grab_focus:
- * @item: A canvas item.
- * @widget_too: Whether or not to grab the widget-level focus too
- *
- * Makes the specified item take the keyboard focus, so all keyboard
- * events will be sent to it. If the canvas widget itself did not have
- * the focus and @widget_too is %TRUE, it grabs that focus as well.
- **/
-void
-e_canvas_item_grab_focus (GnomeCanvasItem *item, gboolean widget_too)
-{
- GnomeCanvasItem *focused_item;
- GdkEvent ev;
-
- g_return_if_fail (item != NULL);
- g_return_if_fail (GNOME_IS_CANVAS_ITEM (item));
- g_return_if_fail (GTK_WIDGET_CAN_FOCUS (GTK_WIDGET (item->canvas)));
-
- focused_item = item->canvas->focused_item;
-
- if (focused_item) {
- ev.focus_change.type = GDK_FOCUS_CHANGE;
- ev.focus_change.window = GTK_LAYOUT (item->canvas)->bin_window;
- ev.focus_change.send_event = FALSE;
- ev.focus_change.in = FALSE;
-
- emit_event (item->canvas, &ev);
- }
-
- item->canvas->focused_item = item;
-
- if (widget_too && !GTK_WIDGET_HAS_FOCUS (GTK_WIDGET(item->canvas))) {
- gtk_widget_grab_focus (GTK_WIDGET (item->canvas));
- }
-
- if (item) {
- ev.focus_change.type = GDK_FOCUS_CHANGE;
- ev.focus_change.window = GTK_LAYOUT (item->canvas)->bin_window;
- ev.focus_change.send_event = FALSE;
- ev.focus_change.in = TRUE;
-
- emit_event (item->canvas, &ev);
- }
-}
-
-/* Focus in handler for the canvas */
-static gint
-e_canvas_focus_in (GtkWidget *widget, GdkEventFocus *event)
-{
- GnomeCanvas *canvas;
- ECanvas *ecanvas;
- GdkEvent full_event;
-
- canvas = GNOME_CANVAS (widget);
- ecanvas = E_CANVAS (widget);
-
- GTK_WIDGET_SET_FLAGS (widget, GTK_HAS_FOCUS);
-
-#ifdef GAL_GDK_IM
- if (ecanvas->ic)
- gdk_im_begin (ecanvas->ic, canvas->layout.bin_window);
-#endif
-
- if (canvas->focused_item) {
- full_event.focus_change = *event;
- return emit_event (canvas, &full_event);
- } else {
- return FALSE;
- }
-}
-
-/* Focus out handler for the canvas */
-static gint
-e_canvas_focus_out (GtkWidget *widget, GdkEventFocus *event)
-{
- GnomeCanvas *canvas;
- ECanvas *ecanvas;
- GdkEvent full_event;
-
- canvas = GNOME_CANVAS (widget);
- ecanvas = E_CANVAS (widget);
-
- GTK_WIDGET_UNSET_FLAGS (widget, GTK_HAS_FOCUS);
-
-#ifdef GAL_GDK_IM
- if (ecanvas->ic)
- gdk_im_end ();
-#endif
-
- if (canvas->focused_item) {
- full_event.focus_change = *event;
- return emit_event (canvas, &full_event);
- } else {
- return FALSE;
- }
-}
-
-static void
-ec_style_set_recursive (GnomeCanvasItem *item, GtkStyle *previous_style)
-{
- guint signal_id = g_signal_lookup ("style_set", G_OBJECT_TYPE (item));
- if (signal_id >= 1) {
- GSignalQuery query;
- g_signal_query (signal_id, &query);
- if (query.return_type == GTK_TYPE_NONE && query.n_params == 1 && query.param_types[0] == GTK_TYPE_STYLE) {
- g_signal_emit (item, signal_id, 0, previous_style);
- }
- }
-
- if (GNOME_IS_CANVAS_GROUP (item) ) {
- GList *items = GNOME_CANVAS_GROUP (item)->item_list;
- for (; items; items = items->next)
- ec_style_set_recursive (items->data, previous_style);
- }
-}
-
-static void
-e_canvas_style_set (GtkWidget *widget, GtkStyle *previous_style)
-{
- ec_style_set_recursive (GNOME_CANVAS_ITEM (gnome_canvas_root (GNOME_CANVAS (widget))), previous_style);
-}
-
-
-static void
-e_canvas_realize (GtkWidget *widget)
-{
-#ifdef GAL_GDK_IM
- gint width, height;
- ECanvas *ecanvas = E_CANVAS (widget);
-#endif
-
- if (GTK_WIDGET_CLASS (parent_class)->realize)
- (* GTK_WIDGET_CLASS (parent_class)->realize) (widget);
-
- gdk_window_set_back_pixmap (GTK_LAYOUT (widget)->bin_window, NULL, FALSE);
-
-#ifdef GAL_GDK_IM
- if (gdk_im_ready () && (ecanvas->ic_attr = gdk_ic_attr_new ()) != NULL) {
- GdkEventMask mask;
- GdkICAttr *attr = ecanvas->ic_attr;
- GdkICAttributesType attrmask = GDK_IC_ALL_REQ;
- GdkIMStyle style;
- GdkIMStyle supported_style = GDK_IM_PREEDIT_NONE |
- GDK_IM_PREEDIT_NOTHING |
- GDK_IM_PREEDIT_POSITION |
- GDK_IM_STATUS_NONE |
- GDK_IM_STATUS_NOTHING;
-
- if(widget->style && widget->style->font->type != GDK_FONT_FONTSET)
- supported_style &= ~GDK_IM_PREEDIT_POSITION;
-
- attr->style = style = gdk_im_decide_style (supported_style);
- attr->client_window = ecanvas->parent.layout.bin_window;
-
- switch (style & GDK_IM_PREEDIT_MASK)
- {
- case GDK_IM_PREEDIT_POSITION:
- if (widget->style && widget->style->font->type != GDK_FONT_FONTSET)
- {
- g_warning ("over-the-spot style requires fontset");
- break;
- }
-
- gdk_window_get_size (attr->client_window, &width, &height);
- height = widget->style->font->ascent +
- widget->style->font->descent;
-
- attrmask |= GDK_IC_PREEDIT_POSITION_REQ;
- attr->spot_location.x = 0;
- attr->spot_location.y = height;
- attr->preedit_area.x = 0;
- attr->preedit_area.y = 0;
- attr->preedit_area.width = width;
- attr->preedit_area.height = height;
- attr->preedit_fontset = widget->style->font;
-
- break;
- }
-
- ecanvas->ic = gdk_ic_new (attr, attrmask);
- if (ecanvas->ic != NULL) {
- mask = gdk_window_get_events (attr->client_window);
- mask |= gdk_ic_get_events (ecanvas->ic);
- gdk_window_set_events (attr->client_window, mask);
-
- if (GTK_WIDGET_HAS_FOCUS (widget))
- gdk_im_begin (ecanvas->ic, attr->client_window);
- } else
- g_warning ("Can't create input context.");
- }
-#endif
-}
-
-static void
-e_canvas_unrealize (GtkWidget *widget)
-{
- ECanvas * ecanvas = E_CANVAS (widget);
-
- if (ecanvas->idle_id) {
- g_source_remove(ecanvas->idle_id);
- ecanvas->idle_id = 0;
- }
-
-#ifdef GAL_GDK_IM
- if (ecanvas->ic) {
- gdk_ic_destroy (ecanvas->ic);
- ecanvas->ic = NULL;
- }
- if (ecanvas->ic_attr) {
- gdk_ic_attr_destroy (ecanvas->ic_attr);
- ecanvas->ic_attr = NULL;
- }
-#endif
- if (GTK_WIDGET_CLASS (parent_class)->unrealize)
- (* GTK_WIDGET_CLASS (parent_class)->unrealize) (widget);
-}
-
-static void
-e_canvas_item_invoke_reflow (GnomeCanvasItem *item, int flags)
-{
- GnomeCanvasGroup *group;
- GList *list;
- GnomeCanvasItem *child;
-
- if (GNOME_IS_CANVAS_GROUP (item)) {
- group = GNOME_CANVAS_GROUP (item);
- for (list = group->item_list; list; list = list->next) {
- child = GNOME_CANVAS_ITEM (list->data);
- if (child->object.flags & E_CANVAS_ITEM_DESCENDENT_NEEDS_REFLOW)
- e_canvas_item_invoke_reflow (child, flags);
- }
- }
-
- if (item->object.flags & E_CANVAS_ITEM_NEEDS_REFLOW) {
- ECanvasItemReflowFunc func;
- func = (ECanvasItemReflowFunc)
- g_object_get_data (G_OBJECT (item),
- "ECanvasItem::reflow_callback");
- if (func)
- func (item, flags);
- }
-
- item->object.flags &= ~E_CANVAS_ITEM_NEEDS_REFLOW;
- item->object.flags &= ~E_CANVAS_ITEM_DESCENDENT_NEEDS_REFLOW;
-}
-
-static void
-do_reflow (ECanvas *canvas)
-{
- if (GNOME_CANVAS(canvas)->root->object.flags & E_CANVAS_ITEM_DESCENDENT_NEEDS_REFLOW)
- e_canvas_item_invoke_reflow (GNOME_CANVAS(canvas)->root, 0);
-}
-
-/* Idle handler for the e-canvas. It deals with pending reflows. */
-static gint
-idle_handler (gpointer data)
-{
- ECanvas *canvas;
-
- GDK_THREADS_ENTER();
-
- canvas = E_CANVAS (data);
- do_reflow (canvas);
-
- /* Reset idle id */
- canvas->idle_id = 0;
-
- g_signal_emit (canvas,
- e_canvas_signals [REFLOW], 0);
-
- GDK_THREADS_LEAVE();
-
- return FALSE;
-}
-
-/* Convenience function to add an idle handler to a canvas */
-static void
-add_idle (ECanvas *canvas)
-{
- if (canvas->idle_id != 0)
- return;
-
- canvas->idle_id = g_idle_add_full (G_PRIORITY_HIGH_IDLE, idle_handler, (gpointer) canvas, NULL);
-}
-
-static void
-e_canvas_item_descendent_needs_reflow (GnomeCanvasItem *item)
-{
- if (item->object.flags & E_CANVAS_ITEM_DESCENDENT_NEEDS_REFLOW)
- return;
-
- item->object.flags |= E_CANVAS_ITEM_DESCENDENT_NEEDS_REFLOW;
- if (item->parent)
- e_canvas_item_descendent_needs_reflow(item->parent);
-}
-
-void
-e_canvas_item_request_reflow (GnomeCanvasItem *item)
-{
- if (item->object.flags & GNOME_CANVAS_ITEM_REALIZED) {
- item->object.flags |= E_CANVAS_ITEM_NEEDS_REFLOW;
- e_canvas_item_descendent_needs_reflow(item);
- add_idle(E_CANVAS(item->canvas));
- }
-}
-
-void
-e_canvas_item_request_parent_reflow (GnomeCanvasItem *item)
-{
- g_return_if_fail(item != NULL);
- g_return_if_fail(GNOME_IS_CANVAS_ITEM(item));
- e_canvas_item_request_reflow(item->parent);
-}
-
-void
-e_canvas_item_set_reflow_callback (GnomeCanvasItem *item, ECanvasItemReflowFunc func)
-{
- g_object_set_data(G_OBJECT(item), "ECanvasItem::reflow_callback", (gpointer) func);
-}
-
-
-void
-e_canvas_item_set_selection_callback (GnomeCanvasItem *item, ECanvasItemSelectionFunc func)
-{
- g_object_set_data(G_OBJECT(item), "ECanvasItem::selection_callback", (gpointer) func);
-}
-
-void
-e_canvas_item_set_selection_compare_callback (GnomeCanvasItem *item, ECanvasItemSelectionCompareFunc func)
-{
- g_object_set_data(G_OBJECT(item), "ECanvasItem::selection_compare_callback", (gpointer) func);
-}
-
-void
-e_canvas_item_set_cursor (GnomeCanvasItem *item, gpointer id)
-{
- GList *list;
- int flags;
- ECanvas *canvas;
- ECanvasSelectionInfo *info;
- ECanvasItemSelectionFunc func;
-
- g_return_if_fail(item != NULL);
- g_return_if_fail(GNOME_IS_CANVAS_ITEM(item));
- g_return_if_fail(item->canvas != NULL);
- g_return_if_fail(E_IS_CANVAS(item->canvas));
-
- canvas = E_CANVAS(item->canvas);
- flags = E_CANVAS_ITEM_SELECTION_DELETE_DATA;
-
- for (list = canvas->selection; list; list = g_list_next(list)) {
- info = list->data;
-
- func = (ECanvasItemSelectionFunc)g_object_get_data(G_OBJECT(info->item),
- "ECanvasItem::selection_callback");
- if (func)
- func(info->item, flags, info->id);
- g_message ("ECANVAS: free info (2): item %p, id %p",
- info->item, info->id);
- g_object_unref (info->item);
- g_free(info);
- }
- g_list_free(canvas->selection);
-
- canvas->selection = NULL;
-
- gnome_canvas_item_grab_focus(item);
-
- info = g_new(ECanvasSelectionInfo, 1);
- info->item = item;
- g_object_ref (info->item);
- info->id = id;
- g_message ("ECANVAS: new info item %p, id %p", item, id);
-
- flags = E_CANVAS_ITEM_SELECTION_SELECT | E_CANVAS_ITEM_SELECTION_CURSOR;
- func = (ECanvasItemSelectionFunc)g_object_get_data(G_OBJECT(item),
- "ECanvasItem::selection_callback");
- if (func)
- func(item, flags, id);
-
- canvas->selection = g_list_prepend(canvas->selection, info);
- canvas->cursor = info;
-}
-
-void
-e_canvas_item_set_cursor_end (GnomeCanvasItem *item, gpointer id)
-{
-}
-
-void
-e_canvas_item_add_selection (GnomeCanvasItem *item, gpointer id)
-{
- int flags;
- ECanvas *canvas;
- ECanvasSelectionInfo *info;
- ECanvasItemSelectionFunc func;
- GList *list;
-
- g_return_if_fail(item != NULL);
- g_return_if_fail(GNOME_IS_CANVAS_ITEM(item));
- g_return_if_fail(item->canvas != NULL);
- g_return_if_fail(E_IS_CANVAS(item->canvas));
-
- flags = E_CANVAS_ITEM_SELECTION_SELECT;
- canvas = E_CANVAS(item->canvas);
-
- if (canvas->cursor) {
- func = (ECanvasItemSelectionFunc)g_object_get_data(G_OBJECT(canvas->cursor->item),
- "ECanvasItem::selection_callback");
- if (func)
- func(canvas->cursor->item, flags, canvas->cursor->id);
- }
-
- gnome_canvas_item_grab_focus(item);
-
- flags = E_CANVAS_ITEM_SELECTION_SELECT | E_CANVAS_ITEM_SELECTION_CURSOR;
-
- for (list = canvas->selection; list; list = g_list_next(list)) {
- ECanvasSelectionInfo *search;
- search = list->data;
-
- if (search->item == item) {
- ECanvasItemSelectionCompareFunc compare_func;
- compare_func = (ECanvasItemSelectionCompareFunc)g_object_get_data(G_OBJECT(search->item),
- "ECanvasItem::selection_compare_callback");
-
- if (compare_func(search->item, search->id, id, 0) == 0) {
- canvas->cursor = search;
- func = (ECanvasItemSelectionFunc)g_object_get_data(G_OBJECT(item),
- "ECanvasItem::selection_callback");
- if (func)
- func(item, flags, search->id);
- return;
- }
- }
- }
-
- info = g_new(ECanvasSelectionInfo, 1);
- info->item = item;
- g_object_ref (info->item);
- info->id = id;
- g_message ("ECANVAS: new info (2): item %p, id %p", item, id);
-
- func = (ECanvasItemSelectionFunc)g_object_get_data(G_OBJECT(item),
- "ECanvasItem::selection_callback");
- if (func)
- func(item, flags, id);
-
- canvas->selection = g_list_prepend(canvas->selection, info);
- canvas->cursor = info;
-}
-
-void
-e_canvas_item_remove_selection (GnomeCanvasItem *item, gpointer id)
-{
- int flags;
- ECanvas *canvas;
- ECanvasSelectionInfo *info;
- GList *list;
-
- g_return_if_fail(item != NULL);
- g_return_if_fail(GNOME_IS_CANVAS_ITEM(item));
- g_return_if_fail(item->canvas != NULL);
- g_return_if_fail(E_IS_CANVAS(item->canvas));
-
- flags = E_CANVAS_ITEM_SELECTION_DELETE_DATA;
- canvas = E_CANVAS(item->canvas);
-
- for (list = canvas->selection; list; list = g_list_next(list)) {
- info = list->data;
-
- if (info->item == item) {
- ECanvasItemSelectionCompareFunc compare_func;
- compare_func = (ECanvasItemSelectionCompareFunc)g_object_get_data(G_OBJECT(info->item),
- "ECanvasItem::selection_compare_callback");
-
- if (compare_func(info->item, info->id, id, 0) == 0) {
- ECanvasItemSelectionFunc func;
- func = (ECanvasItemSelectionFunc) g_object_get_data(G_OBJECT(info->item),
- "ECanvasItem::selection_callback");
- if (func)
- func(info->item, flags, info->id);
- canvas->selection = g_list_remove_link(canvas->selection, list);
-
- if (canvas->cursor == info)
- canvas->cursor = NULL;
-
- g_message ("ECANVAS: removing info: item %p, info %p",
- info->item, info->id);
- g_object_unref (info->item);
- g_free(info);
- g_list_free_1(list);
- break;
- }
- }
- }
-}
-
-void e_canvas_popup_tooltip (ECanvas *canvas, GtkWidget *widget, int x, int y)
-{
- if (canvas->tooltip_window && canvas->tooltip_window != widget) {
- e_canvas_hide_tooltip(canvas);
- }
- canvas->tooltip_window = widget;
- canvas->visibility_first = TRUE;
- if (canvas->toplevel == NULL) {
- canvas->toplevel = gtk_widget_get_toplevel (GTK_WIDGET(canvas));
- if (canvas->toplevel) {
- gtk_widget_add_events(canvas->toplevel, GDK_VISIBILITY_NOTIFY_MASK);
- g_object_ref (canvas->toplevel);
- canvas->visibility_notify_id =
- g_signal_connect (canvas->toplevel, "visibility_notify_event",
- G_CALLBACK (e_canvas_visibility), canvas);
- }
- }
- gtk_widget_set_uposition (widget, x, y);
- gtk_widget_show (widget);
-}
-
-void e_canvas_hide_tooltip (ECanvas *canvas)
-{
- if (canvas->tooltip_window) {
- gtk_widget_destroy (canvas->tooltip_window);
- canvas->tooltip_window = NULL;
- }
-}
-
-
-static gboolean
-grab_cancelled_check (gpointer data)
-{
- ECanvas *canvas = data;
-
- if (GNOME_CANVAS (canvas)->grabbed_item == NULL) {
- canvas->grab_cancelled_cb = NULL;
- canvas->grab_cancelled_check_id = 0;
- canvas->grab_cancelled_time = 0;
- canvas->grab_cancelled_data = NULL;
- return FALSE;
- }
-
- if (gtk_grab_get_current ()) {
- gnome_canvas_item_ungrab(GNOME_CANVAS (canvas)->grabbed_item, canvas->grab_cancelled_time);
- if (canvas->grab_cancelled_cb) {
- canvas->grab_cancelled_cb (canvas,
- GNOME_CANVAS (canvas)->grabbed_item,
- canvas->grab_cancelled_data);
- }
- canvas->grab_cancelled_cb = NULL;
- canvas->grab_cancelled_check_id = 0;
- canvas->grab_cancelled_time = 0;
- canvas->grab_cancelled_data = NULL;
- return FALSE;
- }
- return TRUE;
-}
-
-int
-e_canvas_item_grab (ECanvas *canvas,
- GnomeCanvasItem *item,
- guint event_mask,
- GdkCursor *cursor,
- guint32 etime,
- ECanvasItemGrabCancelled cancelled_cb,
- gpointer cancelled_data)
-{
- if (gtk_grab_get_current ()) {
- return AlreadyGrabbed;
- } else {
- int ret_val = gnome_canvas_item_grab (item, event_mask, cursor, etime);
- if (ret_val == GrabSuccess) {
- canvas->grab_cancelled_cb = cancelled_cb;
- canvas->grab_cancelled_check_id =
- g_timeout_add_full (G_PRIORITY_LOW,
- 100,
- grab_cancelled_check,
- canvas,
- NULL);
- canvas->grab_cancelled_time = etime;
- canvas->grab_cancelled_data = cancelled_data;
- }
-
- return ret_val;
- }
-}
-
-void
-e_canvas_item_ungrab (ECanvas *canvas,
- GnomeCanvasItem *item,
- guint32 etime)
-{
- if (canvas->grab_cancelled_check_id) {
- g_source_remove (canvas->grab_cancelled_check_id);
- canvas->grab_cancelled_cb = NULL;
- canvas->grab_cancelled_check_id = 0;
- canvas->grab_cancelled_time = 0;
- canvas->grab_cancelled_data = NULL;
- gnome_canvas_item_ungrab (item, etime);
- }
-}
diff --git a/widgets/misc/e-canvas.h b/widgets/misc/e-canvas.h
deleted file mode 100644
index 5cdcc4ab90..0000000000
--- a/widgets/misc/e-canvas.h
+++ /dev/null
@@ -1,158 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-canvas.h
- * Copyright 2000, 2001, Ximian, Inc.
- *
- * Authors:
- * Chris Lahey <clahey@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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.
- */
-
-#ifndef __E_CANVAS_H__
-#define __E_CANVAS_H__
-
-#include <libgnomecanvas/gnome-canvas.h>
-
-#ifdef __cplusplus
-extern "C" {
-#pragma }
-#endif /* __cplusplus */
-
-/* ECanvas - A class derived from canvas for the purpose of adding
- * evolution specific canvas hacks.
- */
-
-#define E_CANVAS_TYPE (e_canvas_get_type ())
-#define E_CANVAS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), E_CANVAS_TYPE, ECanvas))
-#define E_CANVAS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), E_CANVAS_TYPE, ECanvasClass))
-#define E_IS_CANVAS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), E_CANVAS_TYPE))
-#define E_IS_CANVAS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), E_CANVAS_TYPE))
-
-typedef void (*ECanvasItemReflowFunc) (GnomeCanvasItem *item,
- gint flags);
-
-typedef void (*ECanvasItemSelectionFunc) (GnomeCanvasItem *item,
- gint flags,
- gpointer user_data);
-/* Returns the same as strcmp does. */
-typedef gint (*ECanvasItemSelectionCompareFunc) (GnomeCanvasItem *item,
- gpointer data1,
- gpointer data2,
- gint flags);
-
-
-typedef struct _ECanvas ECanvas;
-typedef struct _ECanvasClass ECanvasClass;
-
-/* Object flags for items */
-enum {
- E_CANVAS_ITEM_NEEDS_REFLOW = 1 << 13,
- E_CANVAS_ITEM_DESCENDENT_NEEDS_REFLOW = 1 << 14
-};
-
-enum {
- E_CANVAS_ITEM_SELECTION_SELECT = 1 << 0, /* TRUE = select. FALSE = unselect. */
- E_CANVAS_ITEM_SELECTION_CURSOR = 1 << 1, /* TRUE = has become cursor. FALSE = not cursor. */
- E_CANVAS_ITEM_SELECTION_DELETE_DATA = 1 << 2
-};
-
-typedef struct {
- GnomeCanvasItem *item;
- gpointer id;
-} ECanvasSelectionInfo;
-
-typedef void (*ECanvasItemGrabCancelled) (ECanvas *canvas, GnomeCanvasItem *item, gpointer data);
-
-struct _ECanvas
-{
- GnomeCanvas parent;
-
- int idle_id;
- GList *selection;
- ECanvasSelectionInfo *cursor;
-
- GtkWidget *tooltip_window;
- int visibility_notify_id;
- GtkWidget *toplevel;
- guint visibility_first : 1;
-#ifdef GAL_GDK_IM
- /* Input context for dead key support */
- GdkIC *ic;
- GdkICAttr *ic_attr;
-#endif
-
- ECanvasItemGrabCancelled grab_cancelled_cb;
- guint grab_cancelled_check_id;
- guint32 grab_cancelled_time;
- gpointer grab_cancelled_data;
-};
-
-struct _ECanvasClass
-{
- GnomeCanvasClass parent_class;
- void (* reflow) (ECanvas *canvas);
-};
-
-
-GtkType e_canvas_get_type (void);
-GtkWidget *e_canvas_new (void);
-
-/* Used to send all of the keystroke events to a specific item as well as
- * GDK_FOCUS_CHANGE events.
- */
-void e_canvas_item_grab_focus (GnomeCanvasItem *item,
- gboolean widget_too);
-void e_canvas_item_request_reflow (GnomeCanvasItem *item);
-void e_canvas_item_request_parent_reflow (GnomeCanvasItem *item);
-void e_canvas_item_set_reflow_callback (GnomeCanvasItem *item,
- ECanvasItemReflowFunc func);
-void e_canvas_item_set_selection_callback (GnomeCanvasItem *item,
- ECanvasItemSelectionFunc func);
-void e_canvas_item_set_selection_compare_callback (GnomeCanvasItem *item,
- ECanvasItemSelectionCompareFunc func);
-void e_canvas_item_set_cursor (GnomeCanvasItem *item,
- gpointer id);
-void e_canvas_item_add_selection (GnomeCanvasItem *item,
- gpointer id);
-void e_canvas_item_remove_selection (GnomeCanvasItem *item,
- gpointer id);
-
-int e_canvas_item_grab (ECanvas *canvas,
- GnomeCanvasItem *item,
- guint event_mask,
- GdkCursor *cursor,
- guint32 etime,
- ECanvasItemGrabCancelled cancelled,
- gpointer cancelled_data);
-void e_canvas_item_ungrab (ECanvas *canvas,
- GnomeCanvasItem *item,
- guint32 etime);
-
-/* Not implemented yet. */
-void e_canvas_item_set_cursor_end (GnomeCanvasItem *item,
- gpointer id);
-void e_canvas_popup_tooltip (ECanvas *canvas,
- GtkWidget *widget,
- int x,
- int y);
-void e_canvas_hide_tooltip (ECanvas *canvas);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-
-#endif /* __E_CANVAS_H__ */
diff --git a/widgets/misc/e-colors.c b/widgets/misc/e-colors.c
deleted file mode 100644
index 3f16437bee..0000000000
--- a/widgets/misc/e-colors.c
+++ /dev/null
@@ -1,103 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-colors.c - General color allocation utilities
- * Copyright 2000, 2001, Ximian, Inc.
- *
- * Authors:
- * Miguel de Icaza (miguel@kernel.org)
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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.
- */
-
-/* We keep our own color context, as the color allocation might take
- * place before things are realized.
- */
-
-#include <config.h>
-#include <gtk/gtkwidget.h>
-#include "e-colors.h"
-
-GdkColor e_white, e_dark_gray, e_black;
-
-gulong
-e_color_alloc (gushort red, gushort green, gushort blue)
-{
- e_color_init ();
-
- red >>= 8;
- green >>= 8;
- blue >>= 8;
- return gdk_rgb_xpixel_from_rgb (
- ((red & 0xff) << 16) | ((green & 0xff) << 8) |
- (blue & 0xff));
-}
-
-void
-e_color_alloc_gdk (GtkWidget *widget, GdkColor *c)
-{
- GdkColormap *map;
-
- e_color_init ();
-
- if (widget)
- map = gtk_widget_get_colormap (widget);
- else /* FIXME: multi depth broken ? */
- map = gtk_widget_get_default_colormap ();
-
- gdk_rgb_find_color (map, c);
-}
-
-void
-e_color_alloc_name (GtkWidget *widget, const char *name, GdkColor *c)
-{
- GdkColormap *map;
-
- e_color_init ();
-
- gdk_color_parse (name, c);
-
- if (widget)
- map = gtk_widget_get_colormap (widget);
- else /* FIXME: multi depth broken ? */
- map = gtk_widget_get_default_colormap ();
-
- gdk_rgb_find_color (map, c);
-}
-
-void
-e_color_init (void)
-{
- static gboolean e_color_inited = FALSE;
-
- /* It's surprisingly easy to end up calling this twice. Survive. */
- if (e_color_inited)
- return;
-
- e_color_inited = TRUE;
-
- /* Allocate the default colors */
- e_white.red = 65535;
- e_white.green = 65535;
- e_white.blue = 65535;
- e_color_alloc_gdk (NULL, &e_white);
-
- e_black.red = 0;
- e_black.green = 0;
- e_black.blue = 0;
- e_color_alloc_gdk (NULL, &e_black);
-
- e_color_alloc_name (NULL, "gray20", &e_dark_gray);
-}
-
diff --git a/widgets/misc/e-colors.h b/widgets/misc/e-colors.h
deleted file mode 100644
index 596fd2b0a5..0000000000
--- a/widgets/misc/e-colors.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-colors.h
- * Copyright 2000, 2001, Ximian, Inc.
- *
- * Authors:
- * Miguel de Icaza (miguel@kernel.org)
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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.
- */
-
-#ifndef GNOME_APP_LIBS_COLOR_H
-#define GNOME_APP_LIBS_COLOR_H
-
-#include <glib.h>
-#include <gdk/gdk.h>
-#include <gtk/gtkwidget.h>
-
-G_BEGIN_DECLS
-
-void e_color_init (void);
-
-/* Return the pixel value for the given red, green and blue */
-gulong e_color_alloc (gushort red, gushort green, gushort blue);
-void e_color_alloc_name (GtkWidget *widget, const char *name, GdkColor *color);
-void e_color_alloc_gdk (GtkWidget *widget, GdkColor *color);
-
-extern GdkColor e_white, e_dark_gray, e_black;
-
-G_END_DECLS
-
-#endif /* GNOME_APP_LIBS_COLOR_H */
diff --git a/widgets/misc/e-combo-button.h b/widgets/misc/e-combo-button.h
index fa4dcc65a2..b71494b46e 100644
--- a/widgets/misc/e-combo-button.h
+++ b/widgets/misc/e-combo-button.h
@@ -23,10 +23,6 @@
#ifndef _E_COMBO_BUTTON_H_
#define _E_COMBO_BUTTON_H_
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
#include <gtk/gtkbutton.h>
#include <gtk/gtkmenu.h>
@@ -38,10 +34,10 @@ extern "C" {
#endif /* __cplusplus */
#define E_TYPE_COMBO_BUTTON (e_combo_button_get_type ())
-#define E_COMBO_BUTTON(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), E_TYPE_COMBO_BUTTON, EComboButton))
-#define E_COMBO_BUTTON_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), E_TYPE_COMBO_BUTTON, EComboButtonClass))
-#define E_IS_COMBO_BUTTON(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), E_TYPE_COMBO_BUTTON))
-#define E_IS_COMBO_BUTTON_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), E_TYPE_COMBO_BUTTON))
+#define E_COMBO_BUTTON(obj) (GTK_CHECK_CAST ((obj), E_TYPE_COMBO_BUTTON, EComboButton))
+#define E_COMBO_BUTTON_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), E_TYPE_COMBO_BUTTON, EComboButtonClass))
+#define E_IS_COMBO_BUTTON(obj) (GTK_CHECK_TYPE ((obj), E_TYPE_COMBO_BUTTON))
+#define E_IS_COMBO_BUTTON_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((obj), E_TYPE_COMBO_BUTTON))
typedef struct _EComboButton EComboButton;
diff --git a/widgets/misc/e-config-page.h b/widgets/misc/e-config-page.h
index 4862f8b1b5..12e8d9e73d 100644
--- a/widgets/misc/e-config-page.h
+++ b/widgets/misc/e-config-page.h
@@ -23,10 +23,6 @@
#ifndef _E_CONFIG_PAGE_H_
#define _E_CONFIG_PAGE_H_
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
#include <gnome.h>
#ifdef __cplusplus
@@ -35,10 +31,10 @@ extern "C" {
#endif /* __cplusplus */
#define E_TYPE_CONFIG_PAGE (e_config_page_get_type ())
-#define E_CONFIG_PAGE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), E_TYPE_CONFIG_PAGE, EConfigPage))
-#define E_CONFIG_PAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), E_TYPE_CONFIG_PAGE, EConfigPageClass))
-#define E_IS_CONFIG_PAGE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), E_TYPE_CONFIG_PAGE))
-#define E_IS_CONFIG_PAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), E_TYPE_CONFIG_PAGE))
+#define E_CONFIG_PAGE(obj) (GTK_CHECK_CAST ((obj), E_TYPE_CONFIG_PAGE, EConfigPage))
+#define E_CONFIG_PAGE_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), E_TYPE_CONFIG_PAGE, EConfigPageClass))
+#define E_IS_CONFIG_PAGE(obj) (GTK_CHECK_TYPE ((obj), E_TYPE_CONFIG_PAGE))
+#define E_IS_CONFIG_PAGE_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((obj), E_TYPE_CONFIG_PAGE))
typedef struct _EConfigPage EConfigPage;
diff --git a/widgets/misc/e-cursors.c b/widgets/misc/e-cursors.c
deleted file mode 100644
index 3b44ab809e..0000000000
--- a/widgets/misc/e-cursors.c
+++ /dev/null
@@ -1,156 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-cursors.c - cursor handling for gnumeric
- * Copyright 2000, 2001, Ximian, Inc.
- *
- * Authors:
- * Miguel de Icaza (miguel@gnu.org)
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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 "e-cursors.h"
-
-#include "e-colors.h"
-#include "pixmaps/cursor_cross.xpm"
-#include "pixmaps/cursor_zoom_in.xpm"
-#include "pixmaps/cursor_zoom_out.xpm"
-#include "pixmaps/cursor_hand_open.xpm"
-#include "pixmaps/cursor_hand_closed.xpm"
-#include <stdio.h>
-
-#define GDK_INTERNAL_CURSOR -1
-
-typedef struct {
- GdkCursor *cursor;
- int hot_x, hot_y;
- char **xpm;
-} CursorDef;
-
-static CursorDef cursors [] = {
- { NULL, 17, 17, cursor_cross_xpm },
- { NULL, GDK_INTERNAL_CURSOR, GDK_CROSSHAIR, NULL },
- { NULL, GDK_INTERNAL_CURSOR, GDK_ARROW, NULL },
- { NULL, GDK_INTERNAL_CURSOR, GDK_FLEUR, NULL },
- { NULL, 24, 24, cursor_zoom_in_xpm },
- { NULL, 24, 24, cursor_zoom_out_xpm },
- { NULL, GDK_INTERNAL_CURSOR, GDK_SB_H_DOUBLE_ARROW, NULL },
- { NULL, GDK_INTERNAL_CURSOR, GDK_SB_V_DOUBLE_ARROW, NULL },
- { NULL, GDK_INTERNAL_CURSOR, GDK_SIZING, NULL },
- { NULL, GDK_INTERNAL_CURSOR, GDK_SIZING, NULL },
- { NULL, GDK_INTERNAL_CURSOR, GDK_HAND2, NULL },
- { NULL, 10, 10, cursor_hand_open_xpm },
- { NULL, 10, 10, cursor_hand_closed_xpm },
- { NULL, GDK_INTERNAL_CURSOR, GDK_XTERM, NULL },
- { NULL, 0, 0, NULL }
-};
-
-
-static void
-create_bitmap_and_mask_from_xpm (GdkBitmap **bitmap, GdkBitmap **mask, gchar **xpm)
-{
- int height, width, colors;
- char pixmap_buffer [(32 * 32)/8];
- char mask_buffer [(32 * 32)/8];
- int x, y, pix, yofs;
- int transparent_color, black_color;
-
- sscanf (xpm [0], "%d %d %d %d", &height, &width, &colors, &pix);
-
- g_assert (height == 32);
- g_assert (width == 32);
- g_assert (colors <= 3);
-
- transparent_color = ' ';
- black_color = '.';
-
- yofs = colors + 1;
- for (y = 0; y < 32; y++){
- for (x = 0; x < 32;){
- char value = 0, maskv = 0;
-
- for (pix = 0; pix < 8; pix++, x++){
- if (xpm [y + yofs][x] != transparent_color){
- maskv |= 1 << pix;
-
- /*
- * Invert the colours here because it seems
- * to workaround a bug the Matrox G100 Xserver?
- * We reverse the foreground & background in the next
- * routine to compensate.
- */
- if (xpm [y + yofs][x] == black_color){
- value |= 1 << pix;
- }
- }
- }
- pixmap_buffer [(y * 4 + x/8)-1] = value;
- mask_buffer [(y * 4 + x/8)-1] = maskv;
- }
- }
- *bitmap = gdk_bitmap_create_from_data (NULL, pixmap_buffer, 32, 32);
- *mask = gdk_bitmap_create_from_data (NULL, mask_buffer, 32, 32);
-}
-
-void
-e_cursors_init (void)
-{
- int i;
-
- e_color_init ();
-
- for (i = 0; cursors [i].hot_x; i++){
- GdkBitmap *bitmap, *mask;
-
- if (cursors [i].hot_x < 0)
- cursors [i].cursor = gdk_cursor_new (cursors [i].hot_y);
- else {
- create_bitmap_and_mask_from_xpm (&bitmap, &mask, cursors [i].xpm);
-
- /* The foreground and background colours are reversed.
- * See comment above for explanation.
- */
- cursors [i].cursor =
- gdk_cursor_new_from_pixmap (
- bitmap, mask,
- &e_black, &e_white,
- cursors [i].hot_x,
- cursors [i].hot_y);
- }
- }
-
- g_assert (i == E_CURSOR_NUM_CURSORS);
-}
-
-void
-e_cursors_shutdown (void)
-{
- int i;
-
- for (i = 0; cursors [i].hot_x; i++)
- gdk_cursor_destroy (cursors [i].cursor);
-}
-
-
-/* Returns a cursor given its type */
-GdkCursor *
-e_cursor_get (ECursorType type)
-{
- g_return_val_if_fail (type >= 0 && type < E_CURSOR_NUM_CURSORS, NULL);
-
- return cursors [type].cursor;
-}
diff --git a/widgets/misc/e-cursors.h b/widgets/misc/e-cursors.h
deleted file mode 100644
index 8e751b659d..0000000000
--- a/widgets/misc/e-cursors.h
+++ /dev/null
@@ -1,68 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-cursors.h
- * Copyright 2000, 2001, Ximian, Inc.
- *
- * Authors:
- * Miguel de Icaza (miguel@gnu.org)
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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.
- */
-
-#ifndef GNOME_APP_LIB_CURSORS_H
-#define GNOME_APP_LIB_CURSORS_H
-
-#include <gdk/gdk.h>
-
-G_BEGIN_DECLS
-
-typedef enum {
- E_CURSOR_FAT_CROSS,
- E_CURSOR_THIN_CROSS,
- E_CURSOR_ARROW,
- E_CURSOR_MOVE,
- E_CURSOR_ZOOM_IN,
- E_CURSOR_ZOOM_OUT,
- E_CURSOR_SIZE_X,
- E_CURSOR_SIZE_Y,
- E_CURSOR_SIZE_TL,
- E_CURSOR_SIZE_TR,
- E_CURSOR_PRESS,
- E_CURSOR_HAND_OPEN,
- E_CURSOR_HAND_CLOSED,
- E_CURSOR_XTERM,
- E_CURSOR_NUM_CURSORS
-} ECursorType;
-
-void e_cursors_init (void);
-void e_cursors_shutdown (void);
-
-#define e_cursor_set(win, c) \
-G_STMT_START { \
- if (win) \
- gdk_window_set_cursor (win, e_cursor_get (c)); \
-} G_STMT_END
-
-#define e_cursor_set_widget(w, c) \
-G_STMT_START { \
- if (GTK_WIDGET (w)->window) \
- gdk_window_set_cursor (GTK_WIDGET (w)->window, e_cursor_get (c)); \
-} G_STMT_END
-
-GdkCursor *e_cursor_get (ECursorType type);
-
-G_END_DECLS
-
-#endif /* GNOME_APP_LIB_CURSORS_H */
diff --git a/widgets/misc/e-dropdown-button.h b/widgets/misc/e-dropdown-button.h
index f0e6257b0f..2823704060 100644
--- a/widgets/misc/e-dropdown-button.h
+++ b/widgets/misc/e-dropdown-button.h
@@ -23,10 +23,6 @@
#ifndef _E_DROPDOWN_BUTTON_H_
#define _E_DROPDOWN_BUTTON_H_
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
#include <gtk/gtktogglebutton.h>
#include <gtk/gtkmenu.h>
@@ -36,10 +32,10 @@ extern "C" {
#endif /* __cplusplus */
#define E_TYPE_DROPDOWN_BUTTON (e_dropdown_button_get_type ())
-#define E_DROPDOWN_BUTTON(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), E_TYPE_DROPDOWN_BUTTON, EDropdownButton))
-#define E_DROPDOWN_BUTTON_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), E_TYPE_DROPDOWN_BUTTON, EDropdownButtonClass))
-#define E_IS_DROPDOWN_BUTTON(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), E_TYPE_DROPDOWN_BUTTON))
-#define E_IS_DROPDOWN_BUTTON_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), E_TYPE_DROPDOWN_BUTTON))
+#define E_DROPDOWN_BUTTON(obj) (GTK_CHECK_CAST ((obj), E_TYPE_DROPDOWN_BUTTON, EDropdownButton))
+#define E_DROPDOWN_BUTTON_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), E_TYPE_DROPDOWN_BUTTON, EDropdownButtonClass))
+#define E_IS_DROPDOWN_BUTTON(obj) (GTK_CHECK_TYPE ((obj), E_TYPE_DROPDOWN_BUTTON))
+#define E_IS_DROPDOWN_BUTTON_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((obj), E_TYPE_DROPDOWN_BUTTON))
typedef struct _EDropdownButton EDropdownButton;
diff --git a/widgets/misc/e-gui-utils.c b/widgets/misc/e-gui-utils.c
deleted file mode 100644
index 59c499e4c1..0000000000
--- a/widgets/misc/e-gui-utils.c
+++ /dev/null
@@ -1,232 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-gui-utils.c
- * Copyright 2000, 2001, Ximian, Inc.
- *
- * Authors:
- * Miguel de Icaza <miguel@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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.
- */
-
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include "e-gui-utils.h"
-
-#include <gtk/gtkentry.h>
-#include <gtk/gtksignal.h>
-#include <gdk-pixbuf/gdk-pixbuf.h>
-#include <libgnomecanvas/gnome-canvas-pixbuf.h>
-
-void
-e_auto_kill_popup_menu_on_selection_done (GtkMenu *menu)
-{
- g_return_if_fail (GTK_IS_MENU (menu));
-
- g_signal_connect (menu, "selection_done", G_CALLBACK (gtk_widget_destroy), menu);
-}
-
-void
-e_popup_menu (GtkMenu *menu, GdkEvent *event)
-{
- g_return_if_fail (GTK_IS_MENU (menu));
-
- e_auto_kill_popup_menu_on_selection_done (menu);
-
- if (event->type == GDK_KEY_PRESS)
- gtk_menu_popup (menu, NULL, NULL, 0, NULL, 0, event->key.time);
- else if ((event->type == GDK_BUTTON_PRESS) ||
- (event->type == GDK_BUTTON_RELEASE) ||
- (event->type == GDK_2BUTTON_PRESS) ||
- (event->type == GDK_3BUTTON_PRESS)){
- gtk_menu_popup (menu, NULL, NULL, 0, NULL, event->button.button, event->button.time);
- } else
- gtk_menu_popup (menu, NULL, NULL, 0, NULL, 0, GDK_CURRENT_TIME);
-}
-
-typedef struct {
- GtkCallback callback;
- gpointer closure;
-} CallbackClosure;
-
-static void
-e_container_foreach_leaf_callback(GtkWidget *widget, CallbackClosure *callback_closure)
-{
- if (GTK_IS_CONTAINER(widget)) {
- e_container_foreach_leaf(GTK_CONTAINER(widget), callback_closure->callback, callback_closure->closure);
- } else {
- (*callback_closure->callback) (widget, callback_closure->closure);
- }
-}
-
-void
-e_container_foreach_leaf(GtkContainer *container,
- GtkCallback callback,
- gpointer closure)
-{
- CallbackClosure callback_closure;
- callback_closure.callback = callback;
- callback_closure.closure = closure;
- gtk_container_foreach(container, (GtkCallback) e_container_foreach_leaf_callback, &callback_closure);
-}
-
-static void
-e_container_change_tab_order_destroy_notify(gpointer data)
-{
- GList *list = data;
- g_list_foreach(list, (GFunc) g_object_unref, NULL);
- g_list_free(list);
-}
-
-
-static gint
-e_container_change_tab_order_callback(GtkContainer *container,
- GtkDirectionType direction,
- GList *children)
-{
- GtkWidget *focus_child;
- GtkWidget *child;
-
- if (direction != GTK_DIR_TAB_FORWARD &&
- direction != GTK_DIR_TAB_BACKWARD)
- return FALSE;
-
- focus_child = container->focus_child;
-
- if (focus_child == NULL)
- return FALSE;
-
- if (direction == GTK_DIR_TAB_BACKWARD) {
- children = g_list_last(children);
- }
-
- while (children) {
- child = children->data;
- if (direction == GTK_DIR_TAB_FORWARD)
- children = children->next;
- else
- children = children->prev;
-
- if (!child)
- continue;
-
- if (focus_child) {
- if (focus_child == child) {
- focus_child = NULL;
-
- if (GTK_WIDGET_DRAWABLE (child) &&
- GTK_IS_CONTAINER (child) &&
- !GTK_WIDGET_HAS_FOCUS (child))
- if (gtk_widget_child_focus (GTK_WIDGET (child), direction)) {
- g_signal_stop_emission_by_name (container, "focus");
- return TRUE;
- }
- }
- }
- else if (GTK_WIDGET_DRAWABLE (child)) {
- if (GTK_IS_CONTAINER (child)) {
- if (gtk_widget_child_focus (GTK_WIDGET (child), direction)) {
- g_signal_stop_emission_by_name (container, "focus");
- return TRUE;
- }
- }
- else if (GTK_WIDGET_CAN_FOCUS (child)) {
- gtk_widget_grab_focus (child);
- g_signal_stop_emission_by_name (container, "focus");
- return TRUE;
- }
- }
- }
-
- return FALSE;
-}
-
-gint
-e_container_change_tab_order(GtkContainer *container, GList *widgets)
-{
- GList *list;
- list = g_list_copy(widgets);
- g_list_foreach(list, (GFunc) g_object_ref, NULL);
- return gtk_signal_connect_full(GTK_OBJECT(container), "focus",
- GTK_SIGNAL_FUNC(e_container_change_tab_order_callback),
- NULL, list,
- e_container_change_tab_order_destroy_notify,
- FALSE, FALSE);
-}
-
-struct widgetandint {
- GtkWidget *widget;
- int count;
-};
-
-static void
-nth_entry_callback(GtkWidget *widget, struct widgetandint *data)
-{
- if (GTK_IS_ENTRY(widget)) {
- if (data->count > 1) {
- data->count --;
- data->widget = widget;
- } else if (data->count == 1) {
- data->count --;
- data->widget = NULL;
- gtk_widget_grab_focus(widget);
- }
- }
-}
-
-void
-e_container_focus_nth_entry(GtkContainer *container, int n)
-{
- struct widgetandint data;
- data.widget = NULL;
- data.count = n;
- e_container_foreach_leaf(container, (GtkCallback) nth_entry_callback, &data);
- if (data.widget)
- gtk_widget_grab_focus(data.widget);
-}
-
-gboolean
-e_glade_xml_connect_widget (GladeXML *gui, char *name, char *signal, GCallback cb, gpointer closure)
-{
- GtkWidget *widget;
-
- widget = glade_xml_get_widget (gui, name);
-
- if (widget) {
- g_signal_connect (widget, signal,
- cb, closure);
- return TRUE;
- }
-
- return FALSE;
-}
-
-gboolean
-e_glade_xml_set_sensitive (GladeXML *gui, char *name, gboolean sensitive)
-{
- GtkWidget *widget;
-
- widget = glade_xml_get_widget (gui, name);
-
- if (widget) {
- gtk_widget_set_sensitive (widget, sensitive);
- return TRUE;
- }
-
- return FALSE;
-}
diff --git a/widgets/misc/e-gui-utils.h b/widgets/misc/e-gui-utils.h
deleted file mode 100644
index c52e233714..0000000000
--- a/widgets/misc/e-gui-utils.h
+++ /dev/null
@@ -1,58 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-gui-utils.h
- * Copyright 2000, 2001, Ximian, Inc.
- *
- * Authors:
- * Miguel de Icaza <miguel@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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.
- */
-
-#ifndef GAL_GUI_UTILS_H
-#define GAL_GUI_UTILS_H
-
-#include <gtk/gtkmenu.h>
-#include <gtk/gtkwindow.h>
-
-#include <glade/glade-xml.h>
-
-G_BEGIN_DECLS
-
-void e_popup_menu (GtkMenu *menu,
- GdkEvent *event);
-void e_auto_kill_popup_menu_on_selection_done (GtkMenu *menu);
-
-void e_container_foreach_leaf (GtkContainer *container,
- GtkCallback callback,
- gpointer closure);
-void e_container_focus_nth_entry (GtkContainer *container,
- int n);
-gint e_container_change_tab_order (GtkContainer *container,
- GList *widgets);
-
-/* Returns TRUE on success. */
-gboolean e_glade_xml_connect_widget (GladeXML *gui,
- char *name,
- char *signal,
- GtkSignalFunc cb,
- gpointer closure);
-gboolean e_glade_xml_set_sensitive (GladeXML *gui,
- char *name,
- gboolean sensitive);
-
-G_END_DECLS
-
-#endif /* GAL_GUI_UTILS_H */
diff --git a/widgets/misc/e-hsv-utils.c b/widgets/misc/e-hsv-utils.c
deleted file mode 100644
index a5007b9b83..0000000000
--- a/widgets/misc/e-hsv-utils.c
+++ /dev/null
@@ -1,178 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-hsv-utils.c - utilites for manipulating colours in HSV space
- * Copyright (C) 1995-2001 Seth Nickell, Peter Mattis, Spencer Kimball and Josh MacDonald
- *
- * Authors:
- * Seth Nickell <seth@eazel.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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 "e-hsv-utils.h"
-
-/* tweak_hsv is a really tweaky function. it modifies its first argument, which
- should be the colour you want tweaked. delta_h, delta_s and delta_v specify
- how much you want their respective channels modified (and in what direction).
- if it can't do the specified modification, it does it in the oppositon direction */
-void
-e_hsv_tweak (GdkColor *colour, gdouble delta_h, gdouble delta_s, gdouble delta_v)
-{
- gdouble h, s, v, r, g, b;
-
- r = colour->red / 65535.0f;
- g = colour->green / 65535.0f;
- b = colour->blue / 65535.0f;
-
- e_rgb_to_hsv (r, g, b, &h, &s, &v);
-
- if (h + delta_h < 0) {
- h -= delta_h;
- } else {
- h += delta_h;
- }
-
- if (s + delta_s < 0) {
- s -= delta_s;
- } else {
- s += delta_s;
- }
-
- if (v + delta_v < 0) {
- v -= delta_v;
- } else {
- v += delta_v;
- }
-
- e_hsv_to_rgb (h, s, v, &r, &g, &b);
-
- colour->red = r * 65535.0f;
- colour->green = g * 65535.0f;
- colour->blue = b * 65535.0f;
-}
-
-/* Copy n' Paste code from the GTK+ colour selector (gtkcolorsel.c) */
-/* Originally lifted, I suspect, from "Foley, van Dam" */
-void
-e_hsv_to_rgb (gdouble h, gdouble s, gdouble v,
- gdouble *r, gdouble *g, gdouble *b)
-{
- gint i;
- gdouble f, w, q, t;
-
- if (s == 0.0)
- s = 0.000001;
-
- if (h == -1.0)
- {
- *r = v;
- *g = v;
- *b = v;
- }
- else
- {
- if (h == 360.0)
- h = 0.0;
- h = h / 60.0;
- i = (gint) h;
- f = h - i;
- w = v * (1.0 - s);
- q = v * (1.0 - (s * f));
- t = v * (1.0 - (s * (1.0 - f)));
-
- switch (i)
- {
- case 0:
- *r = v;
- *g = t;
- *b = w;
- break;
- case 1:
- *r = q;
- *g = v;
- *b = w;
- break;
- case 2:
- *r = w;
- *g = v;
- *b = t;
- break;
- case 3:
- *r = w;
- *g = q;
- *b = v;
- break;
- case 4:
- *r = t;
- *g = w;
- *b = v;
- break;
- case 5:
- *r = v;
- *g = w;
- *b = q;
- break;
- }
- }
-}
-
-void
-e_rgb_to_hsv (gdouble r, gdouble g, gdouble b,
- gdouble *h, gdouble *s, gdouble *v)
-{
- double max, min, delta;
-
- max = r;
- if (g > max)
- max = g;
- if (b > max)
- max = b;
-
- min = r;
- if (g < min)
- min = g;
- if (b < min)
- min = b;
-
- *v = max;
-
- if (max != 0.0)
- *s = (max - min) / max;
- else
- *s = 0.0;
-
- if (*s == 0.0)
- *h = -1.0;
- else
- {
- delta = max - min;
-
- if (r == max)
- *h = (g - b) / delta;
- else if (g == max)
- *h = 2.0 + (b - r) / delta;
- else if (b == max)
- *h = 4.0 + (r - g) / delta;
-
- *h = *h * 60.0;
-
- if (*h < 0.0)
- *h = *h + 360;
- }
-}
-
-
diff --git a/widgets/misc/e-hsv-utils.h b/widgets/misc/e-hsv-utils.h
deleted file mode 100644
index bbde282697..0000000000
--- a/widgets/misc/e-hsv-utils.h
+++ /dev/null
@@ -1,52 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-hsv-utils.h - utilites for manipulating colours in HSV space
- * Copyright (C) 1995-2001 Seth Nickell, Peter Mattis, Spencer Kimball and Josh MacDonald
- *
- * Authors:
- * Seth Nickell <seth@eazel.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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.
- */
-
-#ifndef _E_HSV_UTILS_H_
-#define _E_HSV_UTILS_H_
-
-#include <gdk/gdk.h>
-
-G_BEGIN_DECLS
-
-void e_hsv_to_rgb (gdouble h,
- gdouble s,
- gdouble v,
- gdouble *r,
- gdouble *g,
- gdouble *b);
-
-void e_rgb_to_hsv (gdouble r,
- gdouble g,
- gdouble b,
- gdouble *h,
- gdouble *s,
- gdouble *v);
-
-void e_hsv_tweak (GdkColor *colour,
- gdouble delta_h,
- gdouble delta_s,
- gdouble delta_v);
-
-G_END_DECLS
-
-#endif /* _E_HSV_UTILS_H_ */
diff --git a/widgets/misc/e-multi-config-dialog.c b/widgets/misc/e-multi-config-dialog.c
index 5411cd1413..847789c70c 100644
--- a/widgets/misc/e-multi-config-dialog.c
+++ b/widgets/misc/e-multi-config-dialog.c
@@ -37,8 +37,8 @@
#include <gdk-pixbuf/gdk-pixbuf.h>
-#define PARENT_TYPE gtk_dialog_get_type ()
-static GtkDialogClass *parent_class = NULL;
+#define PARENT_TYPE gnome_dialog_get_type ()
+static GnomeDialogClass *parent_class = NULL;
#define SWITCH_PAGE_INTERVAL 250
@@ -93,11 +93,11 @@ update_buttons (EMultiConfigDialog *dialog)
priv = dialog->priv;
if (priv->num_unapplied > 0) {
- gtk_dialog_set_response_sensitive (GTK_DIALOG (dialog), GTK_RESPONSE_OK, TRUE);
- gtk_dialog_set_response_sensitive (GTK_DIALOG (dialog), GTK_RESPONSE_APPLY, TRUE);
+ gnome_dialog_set_sensitive (GNOME_DIALOG (dialog), 0, TRUE); /* OK */
+ gnome_dialog_set_sensitive (GNOME_DIALOG (dialog), 1, TRUE); /* Apply */
} else {
- gtk_dialog_set_response_sensitive (GTK_DIALOG (dialog), GTK_RESPONSE_OK, FALSE);
- gtk_dialog_set_response_sensitive (GTK_DIALOG (dialog), GTK_RESPONSE_APPLY, FALSE);
+ gnome_dialog_set_sensitive (GNOME_DIALOG (dialog), 0, FALSE); /* OK */
+ gnome_dialog_set_sensitive (GNOME_DIALOG (dialog), 1, FALSE); /* Apply */
}
}
@@ -175,7 +175,7 @@ set_page_timeout_callback (void *data)
static void
do_close (EMultiConfigDialog *dialog)
{
- gtk_widget_destroy (GTK_WIDGET (dialog));
+ gnome_dialog_close (GNOME_DIALOG (dialog));
}
static void
@@ -231,10 +231,10 @@ table_cursor_change_callback (ETable *etable,
}
-/* GObject methods. */
+/* GtkObject methods. */
static void
-impl_finalize (GObject *object)
+impl_destroy (GtkObject *object)
{
EMultiConfigDialog *dialog;
EMultiConfigDialogPrivate *priv;
@@ -245,19 +245,22 @@ impl_finalize (GObject *object)
if (priv->set_page_timeout_id != 0)
g_source_remove (priv->set_page_timeout_id);
+ if (priv->list_e_table_model != NULL)
+ gtk_object_unref (GTK_OBJECT (priv->list_e_table_model));
+
g_slist_free (priv->pages);
g_free (priv);
- (* G_OBJECT_CLASS (parent_class)->finalize) (object);
+ (* GTK_OBJECT_CLASS (parent_class)->destroy) (object);
}
-/* GtkDialog methods. */
+/* GnomeDialog methods. */
static void
-impl_response (GtkDialog *dialog,
- int response_id)
+impl_clicked (GnomeDialog *dialog,
+ int button_number)
{
EMultiConfigDialog *multi_config_dialog;
EMultiConfigDialogPrivate *priv;
@@ -265,36 +268,37 @@ impl_response (GtkDialog *dialog,
multi_config_dialog = E_MULTI_CONFIG_DIALOG (dialog);
priv = multi_config_dialog->priv;
- switch (response_id) {
- case GTK_RESPONSE_OK:
+ switch (button_number) {
+ case 0: /* OK */
do_ok (multi_config_dialog);
break;
- case GTK_RESPONSE_APPLY:
+ case 1: /* Apply */
do_apply (multi_config_dialog);
break;
- case GTK_RESPONSE_CLOSE:
- default:
+ case 2: /* Close */
do_close (multi_config_dialog);
break;
+ default:
+ g_assert_not_reached ();
}
}
-/* GObject ctors. */
+/* GTK+ ctors. */
static void
class_init (EMultiConfigDialogClass *class)
{
- GObjectClass *object_class;
- GtkDialogClass *dialog_class;
+ GnomeDialogClass *dialog_class;
+ GtkObjectClass *object_class;
- object_class = G_OBJECT_CLASS (class);
- object_class->finalize = impl_finalize;
+ object_class = GTK_OBJECT_CLASS (class);
+ object_class->destroy = impl_destroy;
- dialog_class = GTK_DIALOG_CLASS (class);
- dialog_class->response = impl_response;
+ dialog_class = GNOME_DIALOG_CLASS (class);
+ dialog_class->clicked = impl_clicked;
- parent_class = g_type_class_ref (PARENT_TYPE);
+ parent_class = gtk_type_class (PARENT_TYPE);
}
#define RGB_COLOR(color) (((color).red & 0xff00) << 8 | \
@@ -327,7 +331,7 @@ fill_in_pixbufs (EMultiConfigDialog *dialog, int row)
1,
colors[i], colors[i]);
e_table_model_set_value_at (dialog->priv->list_e_table_model, i + 2, row, pixbuf);
- g_object_unref(pixbuf);
+ gdk_pixbuf_unref(pixbuf);
}
}
@@ -357,7 +361,7 @@ init (EMultiConfigDialog *multi_config_dialog)
{
EMultiConfigDialogPrivate *priv;
ETableModel *list_e_table_model;
- GtkWidget *dialog_vbox;
+ GtkWidget *gnome_dialog_vbox;
GtkWidget *hbox;
GtkWidget *notebook;
GtkWidget *list_e_table;
@@ -367,38 +371,40 @@ init (EMultiConfigDialog *multi_config_dialog)
ECell *vbox;
hbox = gtk_hbox_new (FALSE, 2);
- dialog_vbox = GTK_DIALOG (multi_config_dialog)->vbox;
- gtk_container_add (GTK_CONTAINER (dialog_vbox), hbox);
+ gnome_dialog_vbox = GNOME_DIALOG (multi_config_dialog)->vbox;
+ gtk_container_add (GTK_CONTAINER (gnome_dialog_vbox), hbox);
list_e_table_model = e_table_memory_store_new (columns);
vbox = e_cell_vbox_new ();
pixbuf = e_cell_pixbuf_new();
- g_object_set (G_OBJECT (pixbuf),
- "focused_column", 2,
- "selected_column", 3,
- "unselected_column", 4,
- NULL);
+ gtk_object_set (GTK_OBJECT (pixbuf),
+ "focused_column", 2,
+ "selected_column", 3,
+ "unselected_column", 4,
+ NULL);
e_cell_vbox_append (E_CELL_VBOX (vbox), pixbuf, 1);
- g_object_unref (pixbuf);
+ gtk_object_unref (GTK_OBJECT (pixbuf));
text = e_cell_text_new (NULL, GTK_JUSTIFY_CENTER);
e_cell_vbox_append (E_CELL_VBOX (vbox), text, 0);
- g_object_unref (text);
+ gtk_object_unref (GTK_OBJECT (text));
extras = e_table_extras_new ();
e_table_extras_add_cell (extras, "vbox", vbox);
list_e_table = e_table_scrolled_new (list_e_table_model, extras, list_e_table_spec, NULL);
- gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (list_e_table), GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC);
- g_signal_connect (e_table_scrolled_get_table (E_TABLE_SCROLLED (list_e_table)),
- "cursor_change", G_CALLBACK (table_cursor_change_callback), multi_config_dialog);
+ e_scroll_frame_set_policy (E_SCROLL_FRAME (list_e_table), GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC);
+ gtk_signal_connect (GTK_OBJECT (e_table_scrolled_get_table (E_TABLE_SCROLLED (list_e_table))),
+ "cursor_change", GTK_SIGNAL_FUNC (table_cursor_change_callback),
+ multi_config_dialog);
- g_signal_connect (e_table_scrolled_get_table (E_TABLE_SCROLLED (list_e_table))->table_canvas,
- "realize", G_CALLBACK (canvas_realize), multi_config_dialog);
+ gtk_signal_connect (GTK_OBJECT (e_table_scrolled_get_table (E_TABLE_SCROLLED (list_e_table))->table_canvas),
+ "realize", GTK_SIGNAL_FUNC (canvas_realize),
+ multi_config_dialog);
- g_object_unref (extras);
+ gtk_object_unref (GTK_OBJECT (extras));
gtk_box_pack_start (GTK_BOX (hbox), list_e_table, FALSE, TRUE, 0);
@@ -411,13 +417,12 @@ init (EMultiConfigDialog *multi_config_dialog)
gtk_widget_show (notebook);
gtk_widget_show (list_e_table);
- gtk_dialog_add_buttons (GTK_DIALOG (multi_config_dialog),
- GTK_STOCK_APPLY, GTK_RESPONSE_APPLY,
- GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE,
- GTK_STOCK_OK, GTK_RESPONSE_OK,
- NULL);
- gtk_dialog_set_default_response (GTK_DIALOG (multi_config_dialog), GTK_RESPONSE_OK);
-
+ gnome_dialog_append_buttons (GNOME_DIALOG (multi_config_dialog),
+ GNOME_STOCK_BUTTON_OK,
+ GNOME_STOCK_BUTTON_APPLY,
+ GNOME_STOCK_BUTTON_CLOSE,
+ NULL);
+ gnome_dialog_set_default (GNOME_DIALOG (multi_config_dialog), 0);
gtk_window_set_policy (GTK_WINDOW (multi_config_dialog),
FALSE /* allow_shrink */,
@@ -489,7 +494,8 @@ e_multi_config_dialog_add_page (EMultiConfigDialog *dialog,
if (! e_config_page_is_applied (page_widget))
priv->num_unapplied ++;
- g_signal_connect (page_widget, "changed", G_CALLBACK (page_changed_callback), dialog);
+ gtk_signal_connect (GTK_OBJECT (page_widget), "changed",
+ GTK_SIGNAL_FUNC (page_changed_callback), dialog);
update_buttons (dialog);
}
diff --git a/widgets/misc/e-multi-config-dialog.h b/widgets/misc/e-multi-config-dialog.h
index 0a4c32d7a4..6d78897917 100644
--- a/widgets/misc/e-multi-config-dialog.h
+++ b/widgets/misc/e-multi-config-dialog.h
@@ -23,13 +23,10 @@
#ifndef _E_MULTI_CONFIG_DIALOG_H_
#define _E_MULTI_CONFIG_DIALOG_H_
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
#include "e-config-page.h"
-#include <gtk/gtkdialog.h>
+#include <gtk/gtkwindow.h>
+
#include <gdk-pixbuf/gdk-pixbuf.h>
#ifdef __cplusplus
@@ -38,10 +35,10 @@ extern "C" {
#endif /* __cplusplus */
#define E_TYPE_MULTI_CONFIG_DIALOG (e_multi_config_dialog_get_type ())
-#define E_MULTI_CONFIG_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), E_TYPE_MULTI_CONFIG_DIALOG, EMultiConfigDialog))
-#define E_MULTI_CONFIG_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), E_TYPE_MULTI_CONFIG_DIALOG, EMultiConfigDialogClass))
-#define E_IS_MULTI_CONFIG_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), E_TYPE_MULTI_CONFIG_DIALOG))
-#define E_IS_MULTI_CONFIG_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), E_TYPE_MULTI_CONFIG_DIALOG))
+#define E_MULTI_CONFIG_DIALOG(obj) (GTK_CHECK_CAST ((obj), E_TYPE_MULTI_CONFIG_DIALOG, EMultiConfigDialog))
+#define E_MULTI_CONFIG_DIALOG_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), E_TYPE_MULTI_CONFIG_DIALOG, EMultiConfigDialogClass))
+#define E_IS_MULTI_CONFIG_DIALOG(obj) (GTK_CHECK_TYPE ((obj), E_TYPE_MULTI_CONFIG_DIALOG))
+#define E_IS_MULTI_CONFIG_DIALOG_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((obj), E_TYPE_MULTI_CONFIG_DIALOG))
typedef struct _EMultiConfigDialog EMultiConfigDialog;
@@ -49,13 +46,13 @@ typedef struct _EMultiConfigDialogPrivate EMultiConfigDialogPrivate;
typedef struct _EMultiConfigDialogClass EMultiConfigDialogClass;
struct _EMultiConfigDialog {
- GtkDialog parent;
+ GnomeDialog parent;
EMultiConfigDialogPrivate *priv;
};
struct _EMultiConfigDialogClass {
- GtkDialogClass parent_class;
+ GnomeDialogClass parent_class;
};
diff --git a/widgets/misc/e-popup-menu.c b/widgets/misc/e-popup-menu.c
deleted file mode 100644
index 8607cd1b01..0000000000
--- a/widgets/misc/e-popup-menu.c
+++ /dev/null
@@ -1,240 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-popup-menu.c
- * Copyright 2000, 2001, Ximian, Inc.
- *
- * Authors:
- * Miguel de Icaza <miguel@ximian.com>
- * Jody Goldberg (jgoldberg@home.com)
- * Jeffrey Stedfast <fejj@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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 <string.h>
-#include <gtk/gtkimage.h>
-#include <gdk/gdkkeysyms.h>
-#include <gtk/gtkaccellabel.h>
-#include <gtk/gtklabel.h>
-#include <gtk/gtkmenuitem.h>
-#include <gtk/gtkcheckmenuitem.h>
-#include <gtk/gtkradiomenuitem.h>
-#include <gtk/gtksignal.h>
-#include <gtk/gtkimagemenuitem.h>
-
-#include "e-popup-menu.h"
-#include "e-gui-utils.h"
-
-#include <gal/util/e-i18n.h>
-
-/*
- * Creates an item with an optional icon
- */
-static void
-make_item (GtkMenu *menu, GtkMenuItem *item, const char *name, GtkWidget *pixmap)
-{
- GtkWidget *label;
-
- if (*name == '\0')
- return;
-
- /*
- * Ugh. This needs to go into Gtk+
- */
- label = gtk_label_new_with_mnemonic (name);
- gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
- gtk_widget_show (label);
-
- gtk_container_add (GTK_CONTAINER (item), label);
-
- if (pixmap && GTK_IS_IMAGE_MENU_ITEM (item)){
- gtk_widget_show (pixmap);
- gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (item), pixmap);
- }
-}
-
-GtkMenu *
-e_popup_menu_create (EPopupMenu *menu_list,
- guint32 disable_mask,
- guint32 hide_mask,
- void *default_closure)
-{
- return e_popup_menu_create_with_domain (menu_list,
- disable_mask,
- hide_mask,
- default_closure,
- NULL);
-}
-
-
-GtkMenu *
-e_popup_menu_create_with_domain (EPopupMenu *menu_list,
- guint32 disable_mask,
- guint32 hide_mask,
- void *default_closure,
- const char *domain)
-{
- GtkMenu *menu = GTK_MENU (gtk_menu_new ());
- GSList *group = NULL;
- gboolean last_item_separator = TRUE;
- int last_non_separator = -1;
- int i;
-
- for (i = 0; menu_list[i].name; i++) {
- if (strcmp ("", menu_list[i].name) && !(menu_list [i].disable_mask & hide_mask)) {
- last_non_separator = i;
- }
- }
-
- for (i = 0; i <= last_non_separator; i++) {
- gboolean separator;
-
- separator = !strcmp ("", menu_list[i].name);
-
- if ((!(separator && last_item_separator)) && !(menu_list [i].disable_mask & hide_mask)) {
- GtkWidget *item = NULL;
-
- if (!separator) {
- if (menu_list[i].is_toggle)
- item = gtk_check_menu_item_new ();
- else if (menu_list[i].is_radio)
- item = gtk_radio_menu_item_new (group);
- else
- item = menu_list[i].pixmap_widget ? gtk_image_menu_item_new () : gtk_menu_item_new ();
- if (menu_list[i].is_toggle || menu_list[i].is_radio)
- gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (item), menu_list[i].is_active);
- if (menu_list[i].is_radio)
- group = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (item));
-
- make_item (menu, GTK_MENU_ITEM (item), dgettext(domain, menu_list[i].name), menu_list[i].pixmap_widget);
- } else {
- item = gtk_menu_item_new ();
- }
-
- gtk_menu_shell_append (GTK_MENU_SHELL (menu), item);
-
- if (!menu_list[i].submenu) {
- if (menu_list[i].fn)
- g_signal_connect (item, "activate",
- G_CALLBACK (menu_list[i].fn),
- menu_list[i].use_custom_closure ? menu_list[i].closure : default_closure);
- } else {
- /* submenu */
- GtkMenu *submenu;
-
- submenu = e_popup_menu_create (menu_list[i].submenu, disable_mask, hide_mask,
- default_closure);
-
- gtk_menu_item_set_submenu (GTK_MENU_ITEM (item), GTK_WIDGET (submenu));
- }
-
- if (menu_list[i].disable_mask & disable_mask)
- gtk_widget_set_sensitive (item, FALSE);
-
- gtk_widget_show (item);
-
- last_item_separator = separator;
- }
- }
-
- return menu;
-}
-
-void
-e_popup_menu_run (EPopupMenu *menu_list, GdkEvent *event, guint32 disable_mask, guint32 hide_mask, void *default_closure)
-{
- GtkMenu *menu;
-
- g_return_if_fail (menu_list != NULL);
- g_return_if_fail (event != NULL);
-
- menu = e_popup_menu_create (menu_list, disable_mask, hide_mask, default_closure);
-
- e_popup_menu (menu, event);
-}
-
-void
-e_popup_menu_copy_1 (EPopupMenu *destination,
- const EPopupMenu *source)
-{
- destination->name = g_strdup (source->name);
- destination->pixname = g_strdup (source->pixname);
- destination->fn = source->fn;
- destination->submenu = e_popup_menu_copy (source->submenu);
- destination->disable_mask = source->disable_mask;
-
- destination->pixmap_widget = source->pixmap_widget;
- if (destination->pixmap_widget)
- g_object_ref (destination->pixmap_widget);
- destination->closure = source->closure;
-
- destination->is_toggle = source->is_toggle;
- destination->is_radio = source->is_radio;
- destination->is_active = source->is_active;
-
- destination->use_custom_closure = source->use_custom_closure;
-}
-
-void
-e_popup_menu_free_1 (EPopupMenu *menu_item)
-{
- g_free (menu_item->name);
- g_free (menu_item->pixname);
- e_popup_menu_free (menu_item->submenu);
-
- if (menu_item->pixmap_widget)
- g_object_unref (menu_item->pixmap_widget);
-}
-
-EPopupMenu *
-e_popup_menu_copy (const EPopupMenu *menu_list)
-{
- int i;
- EPopupMenu *ret_val;
-
- if (menu_list == NULL)
- return NULL;
-
- for (i = 0; menu_list[i].name; i++) {
- /* Intentionally empty */
- }
-
- ret_val = g_new (EPopupMenu, i + 1);
-
- for (i = 0; menu_list[i].name; i++) {
- e_popup_menu_copy_1 (ret_val + i, menu_list + i);
- }
-
- /* Copy the terminator */
- e_popup_menu_copy_1 (ret_val + i, menu_list + i);
-
- return ret_val;
-}
-
-void
-e_popup_menu_free (EPopupMenu *menu_list)
-{
- int i;
-
- if (menu_list == NULL)
- return;
-
- for (i = 0; menu_list[i].name; i++) {
- e_popup_menu_free_1 (menu_list + i);
- }
- g_free (menu_list);
-}
-
diff --git a/widgets/misc/e-popup-menu.h b/widgets/misc/e-popup-menu.h
deleted file mode 100644
index 7289ab5c86..0000000000
--- a/widgets/misc/e-popup-menu.h
+++ /dev/null
@@ -1,142 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-popup-menu.h
- * Copyright 2000, 2001, Ximian, Inc.
- *
- * Authors:
- * Miguel de Icaza <miguel@ximian.com>
- * Jody Goldberg (jgoldberg@home.com)
- * Jeffrey Stedfast <fejj@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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.
- */
-
-#ifndef E_POPUP_MENU_H
-#define E_POPUP_MENU_H
-
-#include <gtk/gtkmenu.h>
-#include <gtk/gtkwidget.h>
-
-G_BEGIN_DECLS
-
-#define E_POPUP_SEPARATOR { "", NULL, (NULL), NULL, 0 }
-#define E_POPUP_TERMINATOR { NULL, NULL, (NULL), NULL, 0 }
-
-
-/* In the following, CC = custom closure */
-
-#define E_POPUP_ITEM(name,fn,disable_mask) { (name), NULL, (fn), NULL, (disable_mask), NULL, NULL, 0, 0, 0, 0 }
-#define E_POPUP_ITEM_CC(name,fn,closure,disable_mask) { (name), NULL, (fn), NULL, (disable_mask), NULL, (closure), 0, 0, 0, 1 }
-#define E_POPUP_SUBMENU(name,submenu,disable_mask) { (name), NULL, NULL, (submenu), (disable_mask), NULL, NULL, 0, 0, 0, 0 }
-
-#define E_POPUP_PIXMAP_ITEM(name,pixmap,fn,disable_mask) { (name), (pixmap), (fn), NULL, (disable_mask), NULL, NULL, 0, 0, 0, 0 }
-#define E_POPUP_PIXMAP_ITEM_CC(name,pixmap,fn,closure,disable_mask) { (name), (pixmap), (fn), NULL, (disable_mask), NULL, (closure), 0, 0, 0, 1 }
-#define E_POPUP_PIXMAP_SUBMENU(name,pixmap,submenu,disable_mask) { (name), (pixmap), NULL, (submenu), (disable_mask), NULL, NULL, 0, 0, 0, 0 }
-
-#define E_POPUP_PIXMAP_WIDGET_ITEM(name,pixmap_widget,fn,disable_mask) { (name), NULL, (fn), NULL, (disable_mask), (pixmap_widget), NULL, 0, 0, 0, 0 }
-#define E_POPUP_PIXMAP_WIDGET_ITEM_CC(name,pixmap_widget,fn,closure,disable_mask) { (name), NULL, (fn), NULL, (disable_mask), (pixmap_widget), (closure), 0, 0, 0, 1 }
-#define E_POPUP_PIXMAP_WIDGET_SUBMENU(name,pixmap_widget,submenu,disable_mask) { (name), NULL, NULL, (submenu), (disable_mask), (pixmap_widget), NULL, 0, 0, 0, 0 }
-
-
-#define E_POPUP_TOGGLE_ITEM(name,fn,disable_mask,value) { (name), NULL, (fn), NULL, (disable_mask), NULL, NULL, 1, 0, value, 0 }
-#define E_POPUP_TOGGLE_ITEM_CC(name,fn,closure,disable_mask,value) { (name), NULL, (fn), NULL, (disable_mask), NULL, (closure), 1, 0, value, 1 }
-
-#define E_POPUP_SEPARATOR { "", NULL, (NULL), NULL, 0 }
-#define E_POPUP_TERMINATOR { NULL, NULL, (NULL), NULL, 0 }
-
-
-/* In the following, CC = custom closure */
-
-#define E_POPUP_ITEM(name,fn,disable_mask) { (name), NULL, (fn), NULL, (disable_mask), NULL, NULL, 0, 0, 0, 0 }
-#define E_POPUP_ITEM_CC(name,fn,closure,disable_mask) { (name), NULL, (fn), NULL, (disable_mask), NULL, (closure), 0, 0, 0, 1 }
-#define E_POPUP_SUBMENU(name,submenu,disable_mask) { (name), NULL, NULL, (submenu), (disable_mask), NULL, NULL, 0, 0, 0, 0 }
-
-#define E_POPUP_PIXMAP_ITEM(name,pixmap,fn,disable_mask) { (name), (pixmap), (fn), NULL, (disable_mask), NULL, NULL, 0, 0, 0, 0 }
-#define E_POPUP_PIXMAP_ITEM_CC(name,pixmap,fn,closure,disable_mask) { (name), (pixmap), (fn), NULL, (disable_mask), NULL, (closure), 0, 0, 0, 1 }
-#define E_POPUP_PIXMAP_SUBMENU(name,pixmap,submenu,disable_mask) { (name), (pixmap), NULL, (submenu), (disable_mask), NULL, NULL, 0, 0, 0, 0 }
-
-#define E_POPUP_PIXMAP_WIDGET_ITEM(name,pixmap_widget,fn,disable_mask) { (name), NULL, (fn), NULL, (disable_mask), (pixmap_widget), NULL, 0, 0, 0, 0 }
-#define E_POPUP_PIXMAP_WIDGET_ITEM_CC(name,pixmap_widget,fn,closure,disable_mask) { (name), NULL, (fn), NULL, (disable_mask), (pixmap_widget), (closure), 0, 0, 0, 1 }
-#define E_POPUP_PIXMAP_WIDGET_SUBMENU(name,pixmap_widget,submenu,disable_mask) { (name), NULL, NULL, (submenu), (disable_mask), (pixmap_widget), NULL, 0, 0, 0, 0 }
-
-
-#define E_POPUP_TOGGLE_ITEM(name,fn,disable_mask,value) { (name), NULL, (fn), NULL, (disable_mask), NULL, NULL, 1, 0, value, 0 }
-#define E_POPUP_TOGGLE_ITEM_CC(name,fn,closure,disable_mask,value) { (name), NULL, (fn), NULL, (disable_mask), NULL, (closure), 1, 0, value, 1 }
-
-#define E_POPUP_TOGGLE_PIXMAP_ITEM(name,pixmap,fn,disable_mask) { (name), (pixmap), (fn), NULL, (disable_mask), NULL, NULL, 1, 0, value, 0 }
-#define E_POPUP_TOGGLE_PIXMAP_ITEM_CC(name,pixmap,fn,closure,disable_mask) { (name), (pixmap), (fn), NULL, (disable_mask), NULL, (closure), 1, 0, value, 1 }
-
-#define E_POPUP_TOGGLE_PIXMAP_WIDGET_ITEM(name,pixmap_widget,fn,disable_mask) { (name), NULL, (fn), NULL, (disable_mask), (pixmap_widget), NULL, 1, 0, value, 0 }
-#define E_POPUP_TOGGLE_PIXMAP_WIDGET_ITEM_CC(name,pixmap_widget,fn,closure,disable_mask) { (name), NULL, (fn), NULL, (disable_mask), (pixmap_widget), (closure), 1, 0, value, 1 }
-
-
-#define E_POPUP_RADIO_ITEM(name,fn,disable_mask,value) { (name), NULL, (fn), NULL, (disable_mask), NULL, NULL, 0, 1, value, 0 }
-#define E_POPUP_RADIO_ITEM_CC(name,fn,closure,disable_mask,value) { (name), NULL, (fn), NULL, (disable_mask), NULL, (closure), 0, 1, value, 1 }
-
-#define E_POPUP_RADIO_PIXMAP_ITEM(name,pixmap,fn,disable_mask) { (name), (pixmap), (fn), NULL, (disable_mask), NULL, NULL, 0, 1, value, 0 }
-#define E_POPUP_RADIO_PIXMAP_ITEM_CC(name,pixmap,fn,closure,disable_mask) { (name), (pixmap), (fn), NULL, (disable_mask), NULL, (closure), 0, 1, value, 1 }
-
-#define E_POPUP_RADIO_PIXMAP_WIDGET_ITEM(name,pixmap_widget,fn,disable_mask) { (name), NULL, (fn), NULL, (disable_mask), (pixmap_widget), NULL, 0, 1, value, 0 }
-#define E_POPUP_RADIO_PIXMAP_WIDGET_ITEM_CC(name,pixmap_widget,fn,closure,disable_mask) { (name), NULL, (fn), NULL, (disable_mask), (pixmap_widget), (closure), 0, 1, value, 1 }
-
-
-typedef struct _EPopupMenu EPopupMenu;
-
-struct _EPopupMenu {
- char *name;
- char *pixname;
- GtkSignalFunc fn;
-
- EPopupMenu *submenu;
- guint32 disable_mask;
-
- /* Added post 0.19 */
- GtkWidget *pixmap_widget;
- void *closure;
-
- guint is_toggle : 1;
- guint is_radio : 1;
- guint is_active : 1;
-
- guint use_custom_closure : 1;
-};
-
-GtkMenu *e_popup_menu_create (EPopupMenu *menu_list,
- guint32 disable_mask,
- guint32 hide_mask,
- void *default_closure);
-GtkMenu *e_popup_menu_create_with_domain (EPopupMenu *menu_list,
- guint32 disable_mask,
- guint32 hide_mask,
- void *default_closure,
- const char *domain);
-void e_popup_menu_run (EPopupMenu *menu_list,
- GdkEvent *event,
- guint32 disable_mask,
- guint32 hide_mask,
- void *default_closure);
-
-/* Doesn't copy or free the memory. Just the contents. */
-void e_popup_menu_copy_1 (EPopupMenu *destination,
- const EPopupMenu *menu_item);
-void e_popup_menu_free_1 (EPopupMenu *menu_item);
-
-/* Copies or frees the entire structure. */
-EPopupMenu *e_popup_menu_copy (const EPopupMenu *menu_item);
-void e_popup_menu_free (EPopupMenu *menu_item);
-
-G_END_DECLS
-
-#endif /* E_POPUP_MENU_H */
diff --git a/widgets/misc/e-printable.c b/widgets/misc/e-printable.c
deleted file mode 100644
index 534f153823..0000000000
--- a/widgets/misc/e-printable.c
+++ /dev/null
@@ -1,209 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-printable.c
- * Copyright 2000, 2001, Ximian, Inc.
- *
- * Authors:
- * Chris Lahey <clahey@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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 <gtk/gtksignal.h>
-#include "gal/util/e-util.h"
-#include "e-printable.h"
-
-#define EP_CLASS(e) ((EPrintableClass *)((GtkObject *)e)->klass)
-
-#define PARENT_TYPE GTK_TYPE_OBJECT
-
-
-static GtkObjectClass *e_printable_parent_class;
-
-enum {
- PRINT_PAGE,
- DATA_LEFT,
- RESET,
- HEIGHT,
- WILL_FIT,
- LAST_SIGNAL
-};
-
-static guint e_printable_signals [LAST_SIGNAL] = { 0, };
-
-static void
-e_printable_class_init (GtkObjectClass *object_class)
-{
- EPrintableClass *klass = E_PRINTABLE_CLASS(object_class);
- e_printable_parent_class = g_type_class_ref (PARENT_TYPE);
-
- e_printable_signals [PRINT_PAGE] =
- g_signal_new ("print_page",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (EPrintableClass, print_page),
- NULL, NULL,
- e_marshal_NONE__OBJECT_DOUBLE_DOUBLE_BOOLEAN,
- G_TYPE_NONE, 4, G_TYPE_OBJECT, G_TYPE_DOUBLE,
- G_TYPE_DOUBLE, G_TYPE_BOOLEAN);
-
- e_printable_signals [DATA_LEFT] =
- g_signal_new ("data_left",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (EPrintableClass, data_left),
- NULL, NULL,
- e_marshal_BOOLEAN__NONE,
- G_TYPE_BOOLEAN, 0, G_TYPE_NONE);
-
- e_printable_signals [RESET] =
- g_signal_new ("reset",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (EPrintableClass, reset),
- NULL, NULL,
- e_marshal_NONE__NONE,
- G_TYPE_NONE, 0, G_TYPE_NONE);
-
- e_printable_signals [HEIGHT] =
- g_signal_new ("height",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (EPrintableClass, height),
- NULL, NULL,
- e_marshal_DOUBLE__OBJECT_DOUBLE_DOUBLE_BOOLEAN,
- G_TYPE_DOUBLE, 4, G_TYPE_OBJECT, G_TYPE_DOUBLE,
- G_TYPE_DOUBLE, G_TYPE_BOOLEAN);
-
- e_printable_signals [WILL_FIT] =
- g_signal_new ("will_fit",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (EPrintableClass, will_fit),
- NULL, NULL,
- e_marshal_BOOLEAN__OBJECT_DOUBLE_DOUBLE_BOOLEAN,
- G_TYPE_BOOLEAN, 4, G_TYPE_OBJECT, G_TYPE_DOUBLE,
- G_TYPE_DOUBLE, G_TYPE_BOOLEAN);
-
- klass->print_page = NULL;
- klass->data_left = NULL;
- klass->reset = NULL;
- klass->height = NULL;
- klass->will_fit = NULL;
-}
-
-
-E_MAKE_TYPE (e_printable,
- "EPrintable",
- EPrintable,
- e_printable_class_init,
- NULL,
- PARENT_TYPE)
-
-EPrintable *
-e_printable_new(void)
-{
- return E_PRINTABLE(g_object_new(E_PRINTABLE_TYPE, NULL));
-}
-
-void
-e_printable_print_page (EPrintable *e_printable,
- GnomePrintContext *context,
- gdouble width,
- gdouble height,
- gboolean quantized)
-{
- g_return_if_fail (e_printable != NULL);
- g_return_if_fail (E_IS_PRINTABLE (e_printable));
-
- g_signal_emit (e_printable,
- e_printable_signals [PRINT_PAGE], 0,
- context,
- width,
- height,
- quantized);
-}
-
-gboolean
-e_printable_data_left (EPrintable *e_printable)
-{
- gboolean ret_val;
-
- g_return_val_if_fail (e_printable != NULL, FALSE);
- g_return_val_if_fail (E_IS_PRINTABLE (e_printable), FALSE);
-
- g_signal_emit (e_printable,
- e_printable_signals [DATA_LEFT], 0,
- &ret_val);
-
- return ret_val;
-}
-
-void
-e_printable_reset (EPrintable *e_printable)
-{
- g_return_if_fail (e_printable != NULL);
- g_return_if_fail (E_IS_PRINTABLE (e_printable));
-
- g_signal_emit (e_printable,
- e_printable_signals [RESET], 0);
-}
-
-gdouble
-e_printable_height (EPrintable *e_printable,
- GnomePrintContext *context,
- gdouble width,
- gdouble max_height,
- gboolean quantized)
-{
- gdouble ret_val;
-
- g_return_val_if_fail (e_printable != NULL, -1);
- g_return_val_if_fail (E_IS_PRINTABLE (e_printable), -1);
-
- g_signal_emit (e_printable,
- e_printable_signals [HEIGHT], 0,
- context,
- width,
- max_height,
- quantized,
- &ret_val);
-
- return ret_val;
-}
-
-gboolean
-e_printable_will_fit (EPrintable *e_printable,
- GnomePrintContext *context,
- gdouble width,
- gdouble max_height,
- gboolean quantized)
-{
- gboolean ret_val;
-
- g_return_val_if_fail (e_printable != NULL, -1);
- g_return_val_if_fail (E_IS_PRINTABLE (e_printable), -1);
-
- g_signal_emit (e_printable,
- e_printable_signals [WILL_FIT], 0,
- context,
- width,
- max_height,
- quantized,
- &ret_val);
-
- return ret_val;
-}
diff --git a/widgets/misc/e-printable.h b/widgets/misc/e-printable.h
deleted file mode 100644
index 0c665f89c2..0000000000
--- a/widgets/misc/e-printable.h
+++ /dev/null
@@ -1,90 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-printable.h
- * Copyright 2000, 2001, Ximian, Inc.
- *
- * Authors:
- * Chris Lahey <clahey@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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.
- */
-
-#ifndef _E_PRINTABLE_H_
-#define _E_PRINTABLE_H_
-
-#include <gtk/gtkobject.h>
-#include <libgnomeprint/gnome-print.h>
-
-G_BEGIN_DECLS
-
-#define E_PRINTABLE_TYPE (e_printable_get_type ())
-#define E_PRINTABLE(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), E_PRINTABLE_TYPE, EPrintable))
-#define E_PRINTABLE_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), E_PRINTABLE_TYPE, EPrintableClass))
-#define E_IS_PRINTABLE(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), E_PRINTABLE_TYPE))
-#define E_IS_PRINTABLE_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), E_PRINTABLE_TYPE))
-
-typedef struct {
- GtkObject base;
-} EPrintable;
-
-typedef struct {
- GtkObjectClass parent_class;
-
- /*
- * Signals
- */
-
- void (*print_page) (EPrintable *etm, GnomePrintContext *context, gdouble width, gdouble height, gboolean quantized);
- gboolean (*data_left) (EPrintable *etm);
- void (*reset) (EPrintable *etm);
- gdouble (*height) (EPrintable *etm, GnomePrintContext *context, gdouble width, gdouble max_height, gboolean quantized);
-
- /* e_printable_will_fit (ep, ...) should be equal in value to
- * (e_printable_print_page (ep, ...),
- * !e_printable_data_left(ep)) except that the latter has the
- * side effect of doing the printing and advancing the
- * position of the printable.
- */
-
- gboolean (*will_fit) (EPrintable *etm, GnomePrintContext *context, gdouble width, gdouble max_height, gboolean quantized);
-} EPrintableClass;
-
-GtkType e_printable_get_type (void);
-
-EPrintable *e_printable_new (void);
-
-/*
- * Routines for emitting signals on the e_table */
-void e_printable_print_page (EPrintable *e_printable,
- GnomePrintContext *context,
- gdouble width,
- gdouble height,
- gboolean quantized);
-gboolean e_printable_data_left (EPrintable *e_printable);
-void e_printable_reset (EPrintable *e_printable);
-gdouble e_printable_height (EPrintable *e_printable,
- GnomePrintContext *context,
- gdouble width,
- gdouble max_height,
- gboolean quantized);
-gboolean e_printable_will_fit (EPrintable *e_printable,
- GnomePrintContext *context,
- gdouble width,
- gdouble max_height,
- gboolean quantized);
-
-G_END_DECLS
-
-#endif /* _E_PRINTABLE_H_ */
diff --git a/widgets/misc/e-reflow-model.c b/widgets/misc/e-reflow-model.c
deleted file mode 100644
index 33a5498df5..0000000000
--- a/widgets/misc/e-reflow-model.c
+++ /dev/null
@@ -1,355 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-reflow-model.c
- * Copyright 2000, 2001, Ximian, Inc.
- *
- * Authors:
- * Chris Lahey <clahey@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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 "e-reflow-model.h"
-#include "gal/util/e-util.h"
-
-#define PARENT_TYPE G_TYPE_OBJECT
-
-#define d(x)
-
-d(static gint depth = 0;)
-
-
-static GObjectClass *e_reflow_model_parent_class;
-
-enum {
- MODEL_CHANGED,
- COMPARISON_CHANGED,
- MODEL_ITEMS_INSERTED,
- MODEL_ITEM_CHANGED,
- MODEL_ITEM_REMOVED,
- LAST_SIGNAL
-};
-
-static guint e_reflow_model_signals [LAST_SIGNAL] = { 0, };
-
-/**
- * e_reflow_model_set_width:
- * @e_reflow_model: The e-reflow-model to operate on
- * @width: The new value for the width of each item.
- */
-void
-e_reflow_model_set_width (EReflowModel *e_reflow_model, int width)
-{
- g_return_if_fail (e_reflow_model != NULL);
- g_return_if_fail (E_IS_REFLOW_MODEL (e_reflow_model));
-
- E_REFLOW_MODEL_GET_CLASS (e_reflow_model)->set_width (e_reflow_model, width);
-}
-
-/**
- * e_reflow_model_count:
- * @e_reflow_model: The e-reflow-model to operate on
- *
- * Returns: the number of items in the reflow model.
- */
-int
-e_reflow_model_count (EReflowModel *e_reflow_model)
-{
- g_return_val_if_fail (e_reflow_model != NULL, 0);
- g_return_val_if_fail (E_IS_REFLOW_MODEL (e_reflow_model), 0);
-
- return E_REFLOW_MODEL_GET_CLASS (e_reflow_model)->count (e_reflow_model);
-}
-
-/**
- * e_reflow_model_height:
- * @e_reflow_model: The e-reflow-model to operate on
- * @n: The item number to get the height of.
- * @parent: The parent GnomeCanvasItem.
- *
- * Returns: the height of the nth item.
- */
-int
-e_reflow_model_height (EReflowModel *e_reflow_model, int n, GnomeCanvasGroup *parent)
-{
- g_return_val_if_fail (e_reflow_model != NULL, 0);
- g_return_val_if_fail (E_IS_REFLOW_MODEL (e_reflow_model), 0);
-
- return E_REFLOW_MODEL_GET_CLASS (e_reflow_model)->height (e_reflow_model, n, parent);
-}
-
-/**
- * e_reflow_model_incarnate:
- * @e_reflow_model: The e-reflow-model to operate on
- * @n: The item to create.
- * @parent: The parent GnomeCanvasItem to create a child of.
- *
- * Create a GnomeCanvasItem to represent the nth piece of data.
- *
- * Returns: the new GnomeCanvasItem.
- */
-GnomeCanvasItem *
-e_reflow_model_incarnate (EReflowModel *e_reflow_model, int n, GnomeCanvasGroup *parent)
-{
- g_return_val_if_fail (e_reflow_model != NULL, NULL);
- g_return_val_if_fail (E_IS_REFLOW_MODEL (e_reflow_model), NULL);
-
- return E_REFLOW_MODEL_GET_CLASS (e_reflow_model)->incarnate (e_reflow_model, n, parent);
-}
-
-/**
- * e_reflow_model_compare:
- * @e_reflow_model: The e-reflow-model to operate on
- * @n1: The first item to compare
- * @n2: The second item to compare
- *
- * Compares item n1 and item n2 to see which should come first.
- *
- * Returns: strcmp like semantics for the comparison value.
- */
-int
-e_reflow_model_compare (EReflowModel *e_reflow_model, int n1, int n2)
-{
-#if 0
- g_return_val_if_fail (e_reflow_model != NULL, 0);
- g_return_val_if_fail (E_IS_REFLOW_MODEL (e_reflow_model), 0);
-#endif
-
- return E_REFLOW_MODEL_GET_CLASS (e_reflow_model)->compare (e_reflow_model, n1, n2);
-}
-
-/**
- * e_reflow_model_reincarnate:
- * @e_reflow_model: The e-reflow-model to operate on
- * @n: The item to create.
- * @item: The item to reuse.
- *
- * Update item to represent the nth piece of data.
- */
-void
-e_reflow_model_reincarnate (EReflowModel *e_reflow_model, int n, GnomeCanvasItem *item)
-{
- g_return_if_fail (e_reflow_model != NULL);
- g_return_if_fail (E_IS_REFLOW_MODEL (e_reflow_model));
-
- E_REFLOW_MODEL_GET_CLASS (e_reflow_model)->reincarnate (e_reflow_model, n, item);
-}
-
-static void
-e_reflow_model_class_init (GObjectClass *object_class)
-{
- EReflowModelClass *klass = E_REFLOW_MODEL_CLASS(object_class);
- e_reflow_model_parent_class = g_type_class_ref (PARENT_TYPE);
-
- e_reflow_model_signals [MODEL_CHANGED] =
- g_signal_new ("model_changed",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (EReflowModelClass, model_changed),
- NULL, NULL,
- e_marshal_NONE__NONE,
- G_TYPE_NONE, 0);
-
- e_reflow_model_signals [COMPARISON_CHANGED] =
- g_signal_new ("comparison_changed",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (EReflowModelClass, comparison_changed),
- NULL, NULL,
- e_marshal_NONE__NONE,
- G_TYPE_NONE, 0);
-
- e_reflow_model_signals [MODEL_ITEMS_INSERTED] =
- g_signal_new ("model_items_inserted",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (EReflowModelClass, model_items_inserted),
- NULL, NULL,
- e_marshal_NONE__INT_INT,
- G_TYPE_NONE, 2, G_TYPE_INT, G_TYPE_INT);
-
- e_reflow_model_signals [MODEL_ITEM_CHANGED] =
- g_signal_new ("model_item_changed",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (EReflowModelClass, model_item_changed),
- NULL, NULL,
- e_marshal_NONE__INT,
- G_TYPE_NONE, 1, G_TYPE_INT);
-
- e_reflow_model_signals [MODEL_ITEM_REMOVED] =
- g_signal_new ("model_item_removed",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (EReflowModelClass, model_item_removed),
- NULL, NULL,
- e_marshal_NONE__INT,
- G_TYPE_NONE, 1, G_TYPE_INT);
-
- klass->set_width = NULL;
- klass->count = NULL;
- klass->height = NULL;
- klass->incarnate = NULL;
- klass->reincarnate = NULL;
-
- klass->model_changed = NULL;
- klass->comparison_changed = NULL;
- klass->model_items_inserted = NULL;
- klass->model_item_removed = NULL;
- klass->model_item_changed = NULL;
-}
-
-static void
-e_reflow_model_init (GObject *object)
-{
-}
-
-E_MAKE_TYPE(e_reflow_model, "EReflowModel", EReflowModel,
- e_reflow_model_class_init, e_reflow_model_init, PARENT_TYPE)
-
-#if d(!)0
-static void
-print_tabs (void)
-{
- int i;
- for (i = 0; i < depth; i++)
- g_print("\t");
-}
-#endif
-
-/**
- * e_reflow_model_changed:
- * @e_reflow_model: the reflow model to notify of the change
- *
- * Use this function to notify any views of this reflow model that
- * the contents of the reflow model have changed. This will emit
- * the signal "model_changed" on the @e_reflow_model object.
- *
- * It is preferable to use the e_reflow_model_item_changed() signal to
- * notify of smaller changes than to invalidate the entire model, as
- * the views might have ways of caching the information they render
- * from the model.
- */
-void
-e_reflow_model_changed (EReflowModel *e_reflow_model)
-{
- g_return_if_fail (e_reflow_model != NULL);
- g_return_if_fail (E_IS_REFLOW_MODEL (e_reflow_model));
-
- d(print_tabs());
- d(g_print("Emitting model_changed on model 0x%p.\n", e_reflow_model));
- d(depth++);
- g_signal_emit (e_reflow_model,
- e_reflow_model_signals [MODEL_CHANGED], 0);
- d(depth--);
-}
-
-/**
- * e_reflow_model_comparison_changed:
- * @e_reflow_model: the reflow model to notify of the change
- *
- * Use this function to notify any views of this reflow model that the
- * sorting has changed. The actual contents of the items hasn't, so
- * there's no need to re-query the model for the heights of the
- * individual items.
- */
-void
-e_reflow_model_comparison_changed (EReflowModel *e_reflow_model)
-{
- g_return_if_fail (e_reflow_model != NULL);
- g_return_if_fail (E_IS_REFLOW_MODEL (e_reflow_model));
-
- d(print_tabs());
- d(g_print("Emitting comparison_changed on model 0x%p.\n", e_reflow_model));
- d(depth++);
- g_signal_emit (e_reflow_model,
- e_reflow_model_signals [COMPARISON_CHANGED], 0);
- d(depth--);
-}
-
-/**
- * e_reflow_model_items_inserted:
- * @e_reflow_model: The model changed.
- * @position: The position the items were insert in.
- * @count: The number of items inserted.
- *
- * Use this function to notify any views of the reflow model that a number of items have been inserted.
- **/
-void
-e_reflow_model_items_inserted (EReflowModel *e_reflow_model, int position, int count)
-{
- g_return_if_fail (e_reflow_model != NULL);
- g_return_if_fail (E_IS_REFLOW_MODEL (e_reflow_model));
-
- d(print_tabs());
- d(g_print("Emitting items_inserted on model 0x%p, position=%d, count=%d.\n", e_reflow_model, position, count));
- d(depth++);
- g_signal_emit (e_reflow_model,
- e_reflow_model_signals [MODEL_ITEMS_INSERTED], 0,
- position, count);
- d(depth--);
-}
-
-/**
- * e_reflow_model_item_removed:
- * @e_reflow_model: The model changed.
- * @n: The position from which the items were removed.
- *
- * Use this function to notify any views of the reflow model that an
- * item has been removed.
- **/
-void
-e_reflow_model_item_removed (EReflowModel *e_reflow_model,
- int n)
-{
- g_return_if_fail (e_reflow_model != NULL);
- g_return_if_fail (E_IS_REFLOW_MODEL (e_reflow_model));
-
- d(print_tabs());
- d(g_print("Emitting item_removed on model 0x%p, n=%d.\n", e_reflow_model, n));
- d(depth++);
- g_signal_emit (e_reflow_model,
- e_reflow_model_signals [MODEL_ITEM_REMOVED], 0,
- n);
- d(depth--);
-}
-
-
-/**
- * e_reflow_model_item_changed:
- * @e_reflow_model: the reflow model to notify of the change
- * @item: the item that was changed in the model.
- *
- * Use this function to notify any views of the reflow model that the
- * contents of item @item have changed in model such that the height
- * has changed or the item needs to be reincarnated. This function
- * will emit the "model_item_changed" signal on the @e_reflow_model
- * object
- */
-void
-e_reflow_model_item_changed (EReflowModel *e_reflow_model, int n)
-{
- g_return_if_fail (e_reflow_model != NULL);
- g_return_if_fail (E_IS_REFLOW_MODEL (e_reflow_model));
-
- d(print_tabs());
- d(g_print("Emitting item_changed on model 0x%p, n=%d.\n", e_reflow_model, n));
- d(depth++);
- g_signal_emit (e_reflow_model,
- e_reflow_model_signals [MODEL_ITEM_CHANGED], 0,
- n);
- d(depth--);
-}
diff --git a/widgets/misc/e-reflow-model.h b/widgets/misc/e-reflow-model.h
deleted file mode 100644
index 25731b2af5..0000000000
--- a/widgets/misc/e-reflow-model.h
+++ /dev/null
@@ -1,112 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-reflow-model.h
- * Copyright 2000, 2001, Ximian, Inc.
- *
- * Authors:
- * Chris Lahey <clahey@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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.
- */
-
-#ifndef _E_REFLOW_MODEL_H_
-#define _E_REFLOW_MODEL_H_
-
-#include <glib-object.h>
-#include <libgnomecanvas/gnome-canvas.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
-
-#define E_REFLOW_MODEL_TYPE (e_reflow_model_get_type ())
-#define E_REFLOW_MODEL(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), E_REFLOW_MODEL_TYPE, EReflowModel))
-#define E_REFLOW_MODEL_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), E_REFLOW_MODEL_TYPE, EReflowModelClass))
-#define E_IS_REFLOW_MODEL(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), E_REFLOW_MODEL_TYPE))
-#define E_IS_REFLOW_MODEL_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), E_REFLOW_MODEL_TYPE))
-#define E_REFLOW_MODEL_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), E_REFLOW_MODEL_TYPE, EReflowModelClass))
-
-typedef struct {
- GObject base;
-} EReflowModel;
-
-typedef struct {
- GObjectClass parent_class;
-
- /*
- * Virtual methods
- */
- void (*set_width) (EReflowModel *etm, int width);
-
- int (*count) (EReflowModel *etm);
- int (*height) (EReflowModel *etm, int n, GnomeCanvasGroup *parent);
- GnomeCanvasItem *(*incarnate) (EReflowModel *etm, int n, GnomeCanvasGroup *parent);
- int (*compare) (EReflowModel *etm, int n1, int n2);
- void (*reincarnate) (EReflowModel *etm, int n, GnomeCanvasItem *item);
-
- /*
- * Signals
- */
-
- /*
- * These all come after the change has been made.
- * Major structural changes: model_changed
- * Changes to the sorting of elements: comparison_changed
- * Changes only in an item: item_changed
- */
- void (*model_changed) (EReflowModel *etm);
- void (*comparison_changed) (EReflowModel *etm);
- void (*model_items_inserted) (EReflowModel *etm, int position, int count);
- void (*model_item_removed) (EReflowModel *etm, int position);
- void (*model_item_changed) (EReflowModel *etm, int n);
-} EReflowModelClass;
-
-GType e_reflow_model_get_type (void);
-
-/**/
-void e_reflow_model_set_width (EReflowModel *e_reflow_model,
- int width);
-int e_reflow_model_count (EReflowModel *e_reflow_model);
-int e_reflow_model_height (EReflowModel *e_reflow_model,
- int n,
- GnomeCanvasGroup *parent);
-GnomeCanvasItem *e_reflow_model_incarnate (EReflowModel *e_reflow_model,
- int n,
- GnomeCanvasGroup *parent);
-int e_reflow_model_compare (EReflowModel *e_reflow_model,
- int n1,
- int n2);
-void e_reflow_model_reincarnate (EReflowModel *e_reflow_model,
- int n,
- GnomeCanvasItem *item);
-
-/*
- * Routines for emitting signals on the e_reflow
- */
-void e_reflow_model_changed (EReflowModel *e_reflow_model);
-void e_reflow_model_comparison_changed (EReflowModel *e_reflow_model);
-void e_reflow_model_items_inserted (EReflowModel *e_reflow_model,
- int position,
- int count);
-void e_reflow_model_item_removed (EReflowModel *e_reflow_model,
- int n);
-void e_reflow_model_item_changed (EReflowModel *e_reflow_model,
- int n);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* _E_REFLOW_MODEL_H_ */
diff --git a/widgets/misc/e-reflow.c b/widgets/misc/e-reflow.c
deleted file mode 100644
index e0eae3d6f3..0000000000
--- a/widgets/misc/e-reflow.c
+++ /dev/null
@@ -1,1501 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-reflow.c
- * Copyright 2000, 2001, Ximian, Inc.
- *
- * Authors:
- * Chris Lahey <clahey@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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 "e-reflow.h"
-
-#include <math.h>
-#include <gdk/gdkkeysyms.h>
-#include "e-canvas-utils.h"
-#include "e-canvas.h"
-#include "gal/e-text/e-text.h"
-#include "gal/util/e-util.h"
-#include "gal/util/e-i18n.h"
-#include "gal/widgets/e-unicode.h"
-#include <gtk/gtksignal.h>
-#include "e-selection-model-simple.h"
-
-#include <string.h>
-
-static gboolean e_reflow_event (GnomeCanvasItem *item, GdkEvent *event);
-static void e_reflow_realize (GnomeCanvasItem *item);
-static void e_reflow_unrealize (GnomeCanvasItem *item);
-static void e_reflow_draw (GnomeCanvasItem *item, GdkDrawable *drawable,
- int x, int y, int width, int height);
-static void e_reflow_update (GnomeCanvasItem *item, double affine[6], ArtSVP *clip_path, gint flags);
-static double e_reflow_point (GnomeCanvasItem *item, double x, double y, int cx, int cy, GnomeCanvasItem **actual_item);
-static void e_reflow_reflow (GnomeCanvasItem *item, int flags);
-static void set_empty(EReflow *reflow);
-
-static void e_reflow_resize_children (GnomeCanvasItem *item);
-
-#define E_REFLOW_DIVIDER_WIDTH 2
-#define E_REFLOW_BORDER_WIDTH 7
-#define E_REFLOW_FULL_GUTTER (E_REFLOW_DIVIDER_WIDTH + E_REFLOW_BORDER_WIDTH * 2)
-
-#define PARENT_TYPE GNOME_TYPE_CANVAS_GROUP
-static GnomeCanvasGroupClass *parent_class = NULL;
-
-/* The arguments we take */
-enum {
- PROP_0,
- PROP_MINIMUM_WIDTH,
- PROP_WIDTH,
- PROP_HEIGHT,
- PROP_EMPTY_MESSAGE,
- PROP_MODEL,
- PROP_COLUMN_WIDTH
-};
-
-enum {
- SELECTION_EVENT,
- COLUMN_WIDTH_CHANGED,
- LAST_SIGNAL
-};
-
-static guint signals [LAST_SIGNAL] = {0, };
-
-static gint
-er_compare (int i1, int i2, gpointer user_data)
-{
- EReflow *reflow = user_data;
- return e_reflow_model_compare (reflow->model, i1, i2);
-}
-
-static gint
-e_reflow_pick_line (EReflow *reflow, double x)
-{
- x += E_REFLOW_BORDER_WIDTH + E_REFLOW_DIVIDER_WIDTH;
- x /= reflow->column_width + E_REFLOW_FULL_GUTTER;
- return x;
-}
-
-static int
-er_find_item (EReflow *reflow, GnomeCanvasItem *item)
-{
- int i;
- for (i = 0; i < reflow->count; i++) {
- if (reflow->items[i] == item)
- return i;
- }
- return -1;
-}
-
-static void
-e_reflow_resize_children (GnomeCanvasItem *item)
-{
- EReflow *reflow;
- int i;
- int count;
-
- reflow = E_REFLOW (item);
-
- count = reflow->count;
- for (i = 0; i < count; i++) {
- if (reflow->items[i])
- gnome_canvas_item_set(reflow->items[i],
- "width", (double) reflow->column_width,
- NULL);
- }
-}
-
-static inline void
-e_reflow_update_selection_row (EReflow *reflow, int row)
-{
- if (reflow->items[row]) {
- g_object_set(reflow->items[row],
- "selected", e_selection_model_is_row_selected(E_SELECTION_MODEL(reflow->selection), row),
- NULL);
- } else if (e_selection_model_is_row_selected (E_SELECTION_MODEL (reflow->selection), row)) {
- reflow->items[row] = e_reflow_model_incarnate (reflow->model, row, GNOME_CANVAS_GROUP (reflow));
- g_object_set (reflow->items[row],
- "selected", e_selection_model_is_row_selected(E_SELECTION_MODEL(reflow->selection), row),
- "width", (double) reflow->column_width,
- NULL);
- }
-}
-
-static void
-e_reflow_update_selection (EReflow *reflow)
-{
- int i;
- int count;
-
- count = reflow->count;
- for (i = 0; i < count; i++) {
- e_reflow_update_selection_row (reflow, i);
- }
-}
-
-static void
-selection_changed (ESelectionModel *selection, EReflow *reflow)
-{
- e_reflow_update_selection (reflow);
-}
-
-static void
-selection_row_changed (ESelectionModel *selection, int row, EReflow *reflow)
-{
- e_reflow_update_selection_row (reflow, row);
-}
-
-static void
-cursor_changed (ESelectionModel *selection, int row, int col, EReflow *reflow)
-{
- int count = reflow->count;
- int old_cursor = reflow->cursor_row;
-
- if (old_cursor < count && old_cursor >= 0) {
- if (reflow->items[old_cursor]) {
- g_object_set (reflow->items[old_cursor],
- "has_cursor", FALSE,
- NULL);
- }
- }
-
- reflow->cursor_row = row;
-
- if (row < count && row >= 0) {
- if (reflow->items[row]) {
- g_object_set (reflow->items[row],
- "has_cursor", TRUE,
- NULL);
- } else {
- reflow->items[row] = e_reflow_model_incarnate (reflow->model, row, GNOME_CANVAS_GROUP (reflow));
- g_object_set (reflow->items[row],
- "has_cursor", TRUE,
- "width", (double) reflow->column_width,
- NULL);
- }
- }
-}
-
-static void
-incarnate (EReflow *reflow)
-{
- int column_width;
- int first_column;
- int last_column;
- int first_cell;
- int last_cell;
- int i;
- GtkAdjustment *adjustment = gtk_layout_get_hadjustment (GTK_LAYOUT (GNOME_CANVAS_ITEM (reflow)->canvas));
-
- column_width = reflow->column_width;
-
- first_column = adjustment->value - 1 + E_REFLOW_BORDER_WIDTH;
- first_column /= column_width + E_REFLOW_FULL_GUTTER;
-
- last_column = adjustment->value + adjustment->page_size + 1 - E_REFLOW_BORDER_WIDTH - E_REFLOW_DIVIDER_WIDTH;
- last_column /= column_width + E_REFLOW_FULL_GUTTER;
- last_column ++;
-
- if (first_column >= 0 && first_column < reflow->column_count)
- first_cell = reflow->columns[first_column];
- else
- first_cell = 0;
-
- if (last_column >= 0 && last_column < reflow->column_count)
- last_cell = reflow->columns[last_column];
- else
- last_cell = reflow->count;
-
- for (i = first_cell; i < last_cell; i++) {
- int unsorted = e_sorter_sorted_to_model (E_SORTER (reflow->sorter), i);
- if (reflow->items[unsorted] == NULL) {
- if (reflow->model) {
- reflow->items[unsorted] = e_reflow_model_incarnate (reflow->model, unsorted, GNOME_CANVAS_GROUP (reflow));
- g_object_set (reflow->items[unsorted],
- "selected", e_selection_model_is_row_selected(E_SELECTION_MODEL(reflow->selection), unsorted),
- "width", (double) reflow->column_width,
- NULL);
- }
- }
- }
- reflow->incarnate_idle_id = 0;
-}
-
-static gboolean
-invoke_incarnate (gpointer user_data)
-{
- EReflow *reflow = user_data;
- incarnate (reflow);
- return FALSE;
-}
-
-static void
-queue_incarnate (EReflow *reflow)
-{
- if (reflow->incarnate_idle_id == 0)
- reflow->incarnate_idle_id =
- g_idle_add_full (25, invoke_incarnate, reflow, NULL);
-}
-
-static void
-reflow_columns (EReflow *reflow)
-{
- GSList *list;
- int count;
- int start;
- int i;
- int column_count, column_start;
- double running_height;
-
- if (reflow->reflow_from_column <= 1) {
- start = 0;
- column_count = 1;
- column_start = 0;
- }
- else {
- /* we start one column before the earliest new entry,
- so we can handle the case where the new entry is
- inserted at the start of the column */
- column_start = reflow->reflow_from_column - 1;
- start = reflow->columns[column_start];
- column_count = column_start + 1;
- }
-
- list = NULL;
-
- running_height = E_REFLOW_BORDER_WIDTH;
-
- count = reflow->count - start;
- for (i = start; i < count; i++) {
- int unsorted = e_sorter_sorted_to_model (E_SORTER (reflow->sorter), i);
- if (i != 0 && running_height + reflow->heights[unsorted] + E_REFLOW_BORDER_WIDTH > reflow->height) {
- list = g_slist_prepend (list, GINT_TO_POINTER(i));
- column_count ++;
- running_height = E_REFLOW_BORDER_WIDTH * 2 + reflow->heights[unsorted];
- } else
- running_height += reflow->heights[unsorted] + E_REFLOW_BORDER_WIDTH;
- }
-
- reflow->column_count = column_count;
- reflow->columns = g_renew (int, reflow->columns, column_count);
- column_count --;
-
- for (; column_count > column_start; column_count--) {
- GSList *to_free;
- reflow->columns[column_count] = GPOINTER_TO_INT(list->data);
- to_free = list;
- list = list->next;
- g_slist_free_1 (to_free);
- }
- reflow->columns[column_start] = start;
-
- queue_incarnate (reflow);
-
- reflow->need_reflow_columns = FALSE;
- reflow->reflow_from_column = -1;
-}
-
-static void
-item_changed (EReflowModel *model, int i, EReflow *reflow)
-{
- if (i < 0 || i >= reflow->count)
- return;
-
- reflow->heights[i] = e_reflow_model_height (reflow->model, i, GNOME_CANVAS_GROUP (reflow));
- if (reflow->items[i] != NULL)
- e_reflow_model_reincarnate (model, i, reflow->items[i]);
- e_sorter_array_clean (reflow->sorter);
- reflow->reflow_from_column = -1;
- reflow->need_reflow_columns = TRUE;
- e_canvas_item_request_reflow(GNOME_CANVAS_ITEM (reflow));
-}
-
-static void
-item_removed (EReflowModel *model, int i, EReflow *reflow)
-{
- int c;
- int sorted;
-
- if (i < 0 || i >= reflow->count)
- return;
-
- if (reflow->items[i])
- gtk_object_destroy (GTK_OBJECT (reflow->items[i]));
-
- memmove (reflow->heights + i, reflow->heights + i + 1, (reflow->count - i - 1) * sizeof (int));
- memmove (reflow->items + i, reflow->items + i + 1, (reflow->count - i - 1) * sizeof (GnomeCanvasItem *));
-
- reflow->count --;
-
- sorted = e_sorter_model_to_sorted (E_SORTER (reflow->sorter), i);
- for (c = reflow->column_count - 1; c >= 0; c--) {
- int start_of_column = reflow->columns[c];
-
- if (start_of_column <= sorted) {
- if (reflow->reflow_from_column == -1
- || reflow->reflow_from_column > c) {
- reflow->reflow_from_column = c;
- }
- break;
- }
- }
-
- reflow->need_reflow_columns = TRUE;
- set_empty (reflow);
- e_canvas_item_request_reflow(GNOME_CANVAS_ITEM (reflow));
-
- e_sorter_array_set_count (reflow->sorter, reflow->count);
-
- e_selection_model_simple_delete_rows (E_SELECTION_MODEL_SIMPLE (reflow->selection), i, 1);
-}
-
-static void
-items_inserted (EReflowModel *model, int position, int count, EReflow *reflow)
-{
- int i, c;
- int oldcount;
- int lowest_column;
-
- if (position < 0 || position > reflow->count)
- return;
-
- oldcount = reflow->count;
-
- reflow->count += count;
-
- if (reflow->count > reflow->allocated_count) {
- while (reflow->count > reflow->allocated_count)
- reflow->allocated_count += 256;
- reflow->heights = g_renew (int, reflow->heights, reflow->allocated_count);
- reflow->items = g_renew (GnomeCanvasItem *, reflow->items, reflow->allocated_count);
- }
- memmove (reflow->heights + position + count, reflow->heights + position, (reflow->count - position - count) * sizeof (int));
- memmove (reflow->items + position + count, reflow->items + position, (reflow->count - position - count) * sizeof (GnomeCanvasItem *));
- for (i = position; i < position + count; i++) {
- reflow->items[i] = 0;
- reflow->heights[i] = e_reflow_model_height (reflow->model, i, GNOME_CANVAS_GROUP (reflow));
- }
-
- e_selection_model_simple_set_row_count (E_SELECTION_MODEL_SIMPLE (reflow->selection), reflow->count);
- if (position == oldcount)
- e_sorter_array_append (reflow->sorter, count);
- else
- e_sorter_array_set_count (reflow->sorter, reflow->count);
-
- for (i = position; i < position + count; i ++) {
- int sorted = e_sorter_model_to_sorted (E_SORTER (reflow->sorter), i);
- int c;
-
- for (c = reflow->column_count - 1; c >= 0; c--) {
- int start_of_column = reflow->columns[c];
-
- if (start_of_column <= sorted) {
- if (reflow->reflow_from_column == -1
- || reflow->reflow_from_column > c) {
- reflow->reflow_from_column = c;
- }
- break;
- }
- }
- }
-
- reflow->need_reflow_columns = TRUE;
- set_empty (reflow);
- e_canvas_item_request_reflow(GNOME_CANVAS_ITEM (reflow));
-}
-
-static void
-model_changed (EReflowModel *model, EReflow *reflow)
-{
- int i;
- int count;
- int oldcount;
-
- count = reflow->count;
- oldcount = count;
-
- for (i = 0; i < count; i++) {
- if (reflow->items[i])
- gtk_object_destroy (GTK_OBJECT (reflow->items[i]));
- }
- g_free (reflow->items);
- g_free (reflow->heights);
- reflow->count = e_reflow_model_count (model);
- reflow->allocated_count = reflow->count;
- reflow->items = g_new (GnomeCanvasItem *, reflow->count);
- reflow->heights = g_new (int, reflow->count);
-
- count = reflow->count;
- for (i = 0; i < count; i++) {
- reflow->items[i] = 0;
- reflow->heights[i] = e_reflow_model_height (reflow->model, i, GNOME_CANVAS_GROUP (reflow));
- }
-
- e_selection_model_simple_set_row_count (E_SELECTION_MODEL_SIMPLE (reflow->selection), count);
- e_sorter_array_set_count (reflow->sorter, reflow->count);
-
- reflow->need_reflow_columns = TRUE;
- if (oldcount > reflow->count)
- reflow_columns (reflow);
- set_empty (reflow);
- e_canvas_item_request_reflow(GNOME_CANVAS_ITEM (reflow));
-}
-
-static void
-comparison_changed (EReflowModel *model, EReflow *reflow)
-{
- e_sorter_array_clean (reflow->sorter);
- reflow->reflow_from_column = -1;
- reflow->need_reflow_columns = TRUE;
- e_canvas_item_request_reflow(GNOME_CANVAS_ITEM (reflow));
-}
-
-static void
-set_empty(EReflow *reflow)
-{
- if (reflow->count == 0) {
- if (reflow->empty_text) {
- if (reflow->empty_message) {
- gnome_canvas_item_set(reflow->empty_text,
- "width", reflow->minimum_width,
- "text", reflow->empty_message,
- NULL);
- e_canvas_item_move_absolute(reflow->empty_text,
- reflow->minimum_width / 2,
- 0);
- } else {
- gtk_object_destroy(GTK_OBJECT(reflow->empty_text));
- reflow->empty_text = NULL;
- }
- } else {
- if (reflow->empty_message) {
- reflow->empty_text =
- gnome_canvas_item_new(GNOME_CANVAS_GROUP(reflow),
- e_text_get_type(),
- "anchor", GTK_ANCHOR_N,
- "width", reflow->minimum_width,
- "clip", TRUE,
- "use_ellipsis", TRUE,
- "fill_color", "black",
- "justification", GTK_JUSTIFY_CENTER,
- "text", reflow->empty_message,
- "draw_background", FALSE,
- NULL);
- e_canvas_item_move_absolute(reflow->empty_text,
- reflow->minimum_width / 2,
- 0);
- }
- }
- } else {
- if (reflow->empty_text) {
- gtk_object_destroy(GTK_OBJECT(reflow->empty_text));
- reflow->empty_text = NULL;
- }
- }
-}
-
-static void
-disconnect_model (EReflow *reflow)
-{
- if (reflow->model == NULL)
- return;
-
- g_signal_handler_disconnect (reflow->model,
- reflow->model_changed_id);
- g_signal_handler_disconnect (reflow->model,
- reflow->comparison_changed_id);
- g_signal_handler_disconnect (reflow->model,
- reflow->model_items_inserted_id);
- g_signal_handler_disconnect (reflow->model,
- reflow->model_item_removed_id);
- g_signal_handler_disconnect (reflow->model,
- reflow->model_item_changed_id);
- g_object_unref (reflow->model);
-
- reflow->model_changed_id = 0;
- reflow->comparison_changed_id = 0;
- reflow->model_items_inserted_id = 0;
- reflow->model_item_removed_id = 0;
- reflow->model_item_changed_id = 0;
- reflow->model = NULL;
-}
-
-static void
-disconnect_selection (EReflow *reflow)
-{
- if (reflow->selection == NULL)
- return;
-
- g_signal_handler_disconnect (reflow->selection,
- reflow->selection_changed_id);
- g_signal_handler_disconnect (reflow->selection,
- reflow->selection_row_changed_id);
- g_signal_handler_disconnect (reflow->selection,
- reflow->cursor_changed_id);
- g_object_unref (reflow->selection);
-
- reflow->selection_changed_id = 0;
- reflow->selection_row_changed_id = 0;
- reflow->cursor_changed_id = 0;
- reflow->selection = NULL;
-}
-
-static void
-connect_model (EReflow *reflow, EReflowModel *model)
-{
- if (reflow->model != NULL)
- disconnect_model (reflow);
-
- if (model == NULL)
- return;
-
- reflow->model = model;
- g_object_ref (reflow->model);
- reflow->model_changed_id =
- g_signal_connect (reflow->model, "model_changed",
- G_CALLBACK (model_changed), reflow);
- reflow->comparison_changed_id =
- g_signal_connect (reflow->model, "comparison_changed",
- G_CALLBACK (comparison_changed), reflow);
- reflow->model_items_inserted_id =
- g_signal_connect (reflow->model, "model_items_inserted",
- G_CALLBACK (items_inserted), reflow);
- reflow->model_item_removed_id =
- g_signal_connect (reflow->model, "model_item_removed",
- G_CALLBACK (item_removed), reflow);
- reflow->model_item_changed_id =
- g_signal_connect (reflow->model, "model_item_changed",
- G_CALLBACK (item_changed), reflow);
- model_changed (model, reflow);
-}
-
-static void
-adjustment_changed (GtkAdjustment *adjustment, EReflow *reflow)
-{
- queue_incarnate (reflow);
-}
-
-static void
-disconnect_adjustment (EReflow *reflow)
-{
- if (reflow->adjustment == NULL)
- return;
-
- g_signal_handler_disconnect (reflow->adjustment,
- reflow->adjustment_changed_id);
- g_signal_handler_disconnect (reflow->adjustment,
- reflow->adjustment_value_changed_id);
-
- g_object_unref (reflow->adjustment);
-
- reflow->adjustment_changed_id = 0;
- reflow->adjustment_value_changed_id = 0;
- reflow->adjustment = NULL;
-}
-
-static void
-connect_adjustment (EReflow *reflow, GtkAdjustment *adjustment)
-{
- if (reflow->adjustment != NULL)
- disconnect_adjustment (reflow);
-
- if (adjustment == NULL)
- return;
-
- reflow->adjustment = adjustment;
- reflow->adjustment_changed_id =
- g_signal_connect (adjustment, "changed",
- G_CALLBACK (adjustment_changed), reflow);
- reflow->adjustment_value_changed_id =
- g_signal_connect (adjustment, "value_changed",
- G_CALLBACK (adjustment_changed), reflow);
- g_object_ref (adjustment);
-}
-
-#if 0
-static void
-set_scroll_adjustments (GtkLayout *layout, GtkAdjustment *hadj, GtkAdjustment *vadj, EReflow *reflow)
-{
- connect_adjustment (reflow, hadj);
-}
-
-static void
-connect_set_adjustment (EReflow *reflow)
-{
- reflow->set_scroll_adjustments_id =
- g_signal_connect (GNOME_CANVAS_ITEM (reflow)->canvas,
- "set_scroll_adjustments",
- G_CALLBACK (set_scroll_adjustments), reflow);
-}
-#endif
-
-static void
-disconnect_set_adjustment (EReflow *reflow)
-{
- if (reflow->set_scroll_adjustments_id != 0) {
- g_signal_handler_disconnect (GNOME_CANVAS_ITEM (reflow)->canvas,
- reflow->set_scroll_adjustments_id);
- reflow->set_scroll_adjustments_id = 0;
- }
-}
-
-static void
-column_width_changed (EReflow *reflow)
-{
- g_signal_emit (reflow, signals[COLUMN_WIDTH_CHANGED], 0, reflow->column_width);
-}
-
-
-
-
-/* Virtual functions */
-static void
-e_reflow_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec)
-{
- GnomeCanvasItem *item;
- EReflow *reflow;
-
- item = GNOME_CANVAS_ITEM (object);
- reflow = E_REFLOW (object);
-
- switch (prop_id){
- case PROP_HEIGHT:
- reflow->height = g_value_get_double (value);
- reflow->need_reflow_columns = TRUE;
- e_canvas_item_request_reflow(item);
- break;
- case PROP_MINIMUM_WIDTH:
- reflow->minimum_width = g_value_get_double (value);
- if (GNOME_CANVAS_ITEM_REALIZED & GTK_OBJECT_FLAGS(object))
- set_empty(reflow);
- e_canvas_item_request_reflow(item);
- break;
- case PROP_EMPTY_MESSAGE:
- g_free(reflow->empty_message);
- reflow->empty_message = g_strdup(g_value_get_string (value));
- if (GNOME_CANVAS_ITEM_REALIZED & GTK_OBJECT_FLAGS(object))
- set_empty(reflow);
- break;
- case PROP_MODEL:
- connect_model (reflow, (EReflowModel *) g_value_get_object (value));
- break;
- case PROP_COLUMN_WIDTH:
- if (reflow->column_width != g_value_get_double (value)) {
- GtkAdjustment *adjustment = gtk_layout_get_hadjustment(GTK_LAYOUT(item->canvas));
- double old_width = reflow->column_width;
-
- reflow->column_width = g_value_get_double (value);
- adjustment->step_increment = (reflow->column_width + E_REFLOW_FULL_GUTTER) / 2;
- adjustment->page_increment = adjustment->page_size - adjustment->step_increment;
- gtk_adjustment_changed(adjustment);
- e_reflow_resize_children(item);
- e_canvas_item_request_reflow(item);
-
- reflow->need_column_resize = TRUE;
- gnome_canvas_item_request_update(item);
-
- if (old_width != reflow->column_width)
- column_width_changed (reflow);
- }
- break;
- }
-}
-
-static void
-e_reflow_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec)
-{
- EReflow *reflow;
-
- reflow = E_REFLOW (object);
-
- switch (prop_id) {
- case PROP_MINIMUM_WIDTH:
- g_value_set_double (value, reflow->minimum_width);
- break;
- case PROP_WIDTH:
- g_value_set_double (value, reflow->width);
- break;
- case PROP_HEIGHT:
- g_value_set_double (value, reflow->height);
- break;
- case PROP_EMPTY_MESSAGE:
- g_value_set_string (value, g_strdup(reflow->empty_message));
- break;
- case PROP_MODEL:
- g_value_set_object (value, reflow->model);
- break;
- case PROP_COLUMN_WIDTH:
- g_value_set_double (value, reflow->column_width);
- break;
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
- break;
- }
-}
-
-static void
-e_reflow_dispose (GObject *object)
-{
- EReflow *reflow = E_REFLOW(object);
-
- g_free (reflow->items);
- g_free (reflow->heights);
- g_free (reflow->columns);
-
- reflow->items = NULL;
- reflow->heights = NULL;
- reflow->columns = NULL;
- reflow->count = 0;
- reflow->allocated_count = 0;
-
- if (reflow->incarnate_idle_id)
- g_source_remove (reflow->incarnate_idle_id);
- reflow->incarnate_idle_id = 0;
-
- disconnect_model (reflow);
- disconnect_selection (reflow);
-
- g_free(reflow->empty_message);
- reflow->empty_message = NULL;
-
- G_OBJECT_CLASS(parent_class)->dispose (object);
-}
-
-static void
-e_reflow_realize (GnomeCanvasItem *item)
-{
- EReflow *reflow;
- GnomeCanvasGroup *group;
- GtkAdjustment *adjustment;
- int count;
- int i;
-
- reflow = E_REFLOW (item);
- group = GNOME_CANVAS_GROUP (item);
-
- if (GNOME_CANVAS_ITEM_CLASS(parent_class)->realize)
- (* GNOME_CANVAS_ITEM_CLASS(parent_class)->realize) (item);
-
- reflow->arrow_cursor = gdk_cursor_new (GDK_SB_H_DOUBLE_ARROW);
- reflow->default_cursor = gdk_cursor_new (GDK_LEFT_PTR);
-
- count = reflow->count;
- for(i = 0; i < count; i++) {
- if (reflow->items[i])
- gnome_canvas_item_set(reflow->items[i],
- "width", reflow->column_width,
- NULL);
- }
-
- set_empty(reflow);
-
- reflow->need_reflow_columns = TRUE;
- e_canvas_item_request_reflow(item);
-
- adjustment = gtk_layout_get_hadjustment(GTK_LAYOUT(item->canvas));
-
-#if 0
- connect_set_adjustment (reflow);
-#endif
- connect_adjustment (reflow, adjustment);
-
- adjustment->step_increment = (reflow->column_width + E_REFLOW_FULL_GUTTER) / 2;
- adjustment->page_increment = adjustment->page_size - adjustment->step_increment;
- gtk_adjustment_changed(adjustment);
-
- if (!item->canvas->aa) {
- }
-}
-
-static void
-e_reflow_unrealize (GnomeCanvasItem *item)
-{
- EReflow *reflow;
-
- reflow = E_REFLOW (item);
-
- if (!item->canvas->aa) {
- }
-
- gdk_cursor_destroy (reflow->arrow_cursor);
- gdk_cursor_destroy (reflow->default_cursor);
- reflow->arrow_cursor = NULL;
- reflow->default_cursor = NULL;
-
- g_free (reflow->columns);
- reflow->columns = NULL;
-
- disconnect_set_adjustment (reflow);
- disconnect_adjustment (reflow);
-
- if (GNOME_CANVAS_ITEM_CLASS(parent_class)->unrealize)
- (* GNOME_CANVAS_ITEM_CLASS(parent_class)->unrealize) (item);
-}
-
-static gboolean
-e_reflow_event (GnomeCanvasItem *item, GdkEvent *event)
-{
- EReflow *reflow;
- int return_val = FALSE;
-
- reflow = E_REFLOW (item);
-
- switch( event->type )
- {
- case GDK_KEY_PRESS:
- return_val = e_selection_model_key_press(reflow->selection, (GdkEventKey *) event);
- break;
-#if 0
- if (event->key.keyval == GDK_Tab ||
- event->key.keyval == GDK_KP_Tab ||
- event->key.keyval == GDK_ISO_Left_Tab) {
- int i;
- int count;
- count = reflow->count;
- for (i = 0; i < count; i++) {
- int unsorted = e_sorter_sorted_to_model (E_SORTER (reflow->sorter), i);
- GnomeCanvasItem *item = reflow->items[unsorted];
- EFocus has_focus;
- if (item) {
- g_object_get(item,
- "has_focus", &has_focus,
- NULL);
- if (has_focus) {
- if (event->key.state & GDK_SHIFT_MASK) {
- if (i == 0)
- return 0;
- i--;
- } else {
- if (i == count - 1)
- return 0;
- i++;
- }
-
- unsorted = e_sorter_sorted_to_model (E_SORTER (reflow->sorter), i);
- if (reflow->items[unsorted] == NULL) {
- reflow->items[unsorted] = e_reflow_model_incarnate (reflow->model, unsorted, GNOME_CANVAS_GROUP (reflow));
- }
-
- item = reflow->items[unsorted];
- gnome_canvas_item_set(item,
- "has_focus", (event->key.state & GDK_SHIFT_MASK) ? E_FOCUS_END : E_FOCUS_START,
- NULL);
- return 1;
- }
- }
- }
- }
-#endif
- break;
- case GDK_BUTTON_PRESS:
- switch(event->button.button)
- {
- case 1:
- {
- GdkEventButton *button = (GdkEventButton *) event;
- double n_x, max_x;
- n_x = button->x;
- n_x += E_REFLOW_BORDER_WIDTH + E_REFLOW_DIVIDER_WIDTH;
- n_x = fmod(n_x,(reflow->column_width + E_REFLOW_FULL_GUTTER));
-
- max_x = E_REFLOW_BORDER_WIDTH;
- max_x += (reflow->column_width + E_REFLOW_FULL_GUTTER) * reflow->column_count;
- if ( button->y >= E_REFLOW_BORDER_WIDTH && button->y <= reflow->height - E_REFLOW_BORDER_WIDTH && n_x < E_REFLOW_FULL_GUTTER && max_x > button->x ) {
- reflow->which_column_dragged = e_reflow_pick_line(reflow, button->x);
- reflow->start_x = reflow->which_column_dragged * (reflow->column_width + E_REFLOW_FULL_GUTTER) - E_REFLOW_DIVIDER_WIDTH / 2;
- reflow->temp_column_width = reflow->column_width;
- reflow->column_drag = TRUE;
-
- gnome_canvas_item_grab (item,
- GDK_BUTTON_RELEASE_MASK | GDK_POINTER_MOTION_MASK,
- reflow->arrow_cursor,
- button->time);
-
- reflow->previous_temp_column_width = -1;
- reflow->need_column_resize = TRUE;
- gnome_canvas_item_request_update(item);
- return TRUE;
- }
- }
- break;
- case 4:
- {
- GtkAdjustment *adjustment = gtk_layout_get_hadjustment(GTK_LAYOUT(item->canvas));
- gdouble new_value = adjustment->value;
- new_value -= adjustment->step_increment;
- gtk_adjustment_set_value(adjustment, new_value);
- }
- break;
- case 5:
- {
- GtkAdjustment *adjustment = gtk_layout_get_hadjustment(GTK_LAYOUT(item->canvas));
- gdouble new_value = adjustment->value;
- new_value += adjustment->step_increment;
- if ( new_value > adjustment->upper - adjustment->page_size )
- new_value = adjustment->upper - adjustment->page_size;
- gtk_adjustment_set_value(adjustment, new_value);
- }
- break;
- }
- break;
- case GDK_BUTTON_RELEASE:
- if (reflow->column_drag) {
- gdouble old_width = reflow->column_width;
- GdkEventButton *button = (GdkEventButton *) event;
- GtkAdjustment *adjustment = gtk_layout_get_hadjustment(GTK_LAYOUT(item->canvas));
- reflow->temp_column_width = reflow->column_width +
- (button->x - reflow->start_x)/(reflow->which_column_dragged - e_reflow_pick_line(reflow, adjustment->value));
- if ( reflow->temp_column_width < 50 )
- reflow->temp_column_width = 50;
- reflow->column_drag = FALSE;
- if ( old_width != reflow->temp_column_width ) {
- gtk_adjustment_set_value(adjustment, adjustment->value + e_reflow_pick_line(reflow, adjustment->value) * (reflow->temp_column_width - reflow->column_width));
- reflow->column_width = reflow->temp_column_width;
- adjustment->step_increment = (reflow->column_width + E_REFLOW_FULL_GUTTER) / 2;
- adjustment->page_increment = adjustment->page_size - adjustment->step_increment;
- gtk_adjustment_changed(adjustment);
- e_reflow_resize_children(item);
- e_canvas_item_request_reflow(item);
- gnome_canvas_request_redraw(item->canvas, 0, 0, reflow->width, reflow->height);
- column_width_changed (reflow);
- }
- reflow->need_column_resize = TRUE;
- gnome_canvas_item_request_update(item);
- gnome_canvas_item_ungrab (item, button->time);
- return TRUE;
- }
- break;
- case GDK_MOTION_NOTIFY:
- if (reflow->column_drag) {
- double old_width = reflow->temp_column_width;
- GdkEventMotion *motion = (GdkEventMotion *) event;
- GtkAdjustment *adjustment = gtk_layout_get_hadjustment(GTK_LAYOUT(item->canvas));
- reflow->temp_column_width = reflow->column_width +
- (motion->x - reflow->start_x)/(reflow->which_column_dragged - e_reflow_pick_line(reflow, adjustment->value));
- if (reflow->temp_column_width < 50)
- reflow->temp_column_width = 50;
- if (old_width != reflow->temp_column_width) {
- reflow->need_column_resize = TRUE;
- gnome_canvas_item_request_update(item);
- }
- return TRUE;
- } else {
- GdkEventMotion *motion = (GdkEventMotion *) event;
- double n_x, max_x;
-
- n_x = motion->x;
- n_x += E_REFLOW_BORDER_WIDTH + E_REFLOW_DIVIDER_WIDTH;
- n_x = fmod(n_x,(reflow->column_width + E_REFLOW_FULL_GUTTER));
-
- max_x = E_REFLOW_BORDER_WIDTH;
- max_x += (reflow->column_width + E_REFLOW_FULL_GUTTER) * reflow->column_count;
-
- if ( motion->y >= E_REFLOW_BORDER_WIDTH && motion->y <= reflow->height - E_REFLOW_BORDER_WIDTH && n_x < E_REFLOW_FULL_GUTTER && max_x > motion->x) {
- if ( reflow->default_cursor_shown ) {
- gdk_window_set_cursor(GTK_WIDGET(item->canvas)->window, reflow->arrow_cursor);
- reflow->default_cursor_shown = FALSE;
- }
- } else
- if ( ! reflow->default_cursor_shown ) {
- gdk_window_set_cursor(GTK_WIDGET(item->canvas)->window, reflow->default_cursor);
- reflow->default_cursor_shown = TRUE;
- }
-
- }
- break;
- case GDK_ENTER_NOTIFY:
- if (!reflow->column_drag) {
- GdkEventCrossing *crossing = (GdkEventCrossing *) event;
- double n_x, max_x;
- n_x = crossing->x;
- n_x += E_REFLOW_BORDER_WIDTH + E_REFLOW_DIVIDER_WIDTH;
- n_x = fmod(n_x,(reflow->column_width + E_REFLOW_FULL_GUTTER));
-
- max_x = E_REFLOW_BORDER_WIDTH;
- max_x += (reflow->column_width + E_REFLOW_FULL_GUTTER) * reflow->column_count;
- if ( crossing->y >= E_REFLOW_BORDER_WIDTH && crossing->y <= reflow->height - E_REFLOW_BORDER_WIDTH && n_x < E_REFLOW_FULL_GUTTER && max_x > crossing->x) {
- if ( reflow->default_cursor_shown ) {
- gdk_window_set_cursor(GTK_WIDGET(item->canvas)->window, reflow->arrow_cursor);
- reflow->default_cursor_shown = FALSE;
- }
- }
- }
- break;
- case GDK_LEAVE_NOTIFY:
- if (!reflow->column_drag) {
- GdkEventCrossing *crossing = (GdkEventCrossing *) event;
- double n_x;
- n_x = crossing->x;
- n_x += E_REFLOW_BORDER_WIDTH + E_REFLOW_DIVIDER_WIDTH;
- n_x = fmod(n_x,(reflow->column_width + E_REFLOW_FULL_GUTTER));
- if ( !( crossing->y >= E_REFLOW_BORDER_WIDTH && crossing->y <= reflow->height - E_REFLOW_BORDER_WIDTH && n_x < E_REFLOW_FULL_GUTTER ) ) {
- if ( ! reflow->default_cursor_shown ) {
- gdk_window_set_cursor(GTK_WIDGET(item->canvas)->window, reflow->default_cursor);
- reflow->default_cursor_shown = TRUE;
- }
- }
- }
- break;
- default:
- break;
- }
- if (return_val)
- return return_val;
- else if (GNOME_CANVAS_ITEM_CLASS( parent_class )->event)
- return (* GNOME_CANVAS_ITEM_CLASS( parent_class )->event) (item, event);
- else
- return FALSE;
-}
-
-static void e_reflow_draw (GnomeCanvasItem *item, GdkDrawable *drawable,
- int x, int y, int width, int height)
-{
- int x_rect, y_rect, width_rect, height_rect;
- gdouble running_width;
- EReflow *reflow = E_REFLOW(item);
- int i;
- double column_width;
-
- if (GNOME_CANVAS_ITEM_CLASS(parent_class)->draw)
- GNOME_CANVAS_ITEM_CLASS(parent_class)->draw (item, drawable, x, y, width, height);
- column_width = reflow->column_width;
- running_width = E_REFLOW_BORDER_WIDTH + column_width + E_REFLOW_BORDER_WIDTH;
- x_rect = running_width;
- y_rect = E_REFLOW_BORDER_WIDTH;
- width_rect = E_REFLOW_DIVIDER_WIDTH;
- height_rect = reflow->height - (E_REFLOW_BORDER_WIDTH * 2);
-
- /* Compute first column to draw. */
- i = x;
- i /= column_width + E_REFLOW_FULL_GUTTER;
- running_width += i * (column_width + E_REFLOW_FULL_GUTTER);
-
- for ( ; i < reflow->column_count; i++) {
- if ( running_width > x + width )
- break;
- x_rect = running_width;
- gtk_paint_flat_box(GTK_WIDGET(item->canvas)->style,
- drawable,
- GTK_STATE_ACTIVE,
- GTK_SHADOW_NONE,
- NULL,
- GTK_WIDGET(item->canvas),
- "reflow",
- x_rect - x,
- y_rect - y,
- width_rect,
- height_rect);
- running_width += E_REFLOW_DIVIDER_WIDTH + E_REFLOW_BORDER_WIDTH + column_width + E_REFLOW_BORDER_WIDTH;
- }
- if (reflow->column_drag) {
- int start_line = e_reflow_pick_line(reflow,
- gtk_layout_get_hadjustment(GTK_LAYOUT(item->canvas))->value);
- i = x - start_line * (column_width + E_REFLOW_FULL_GUTTER);
- running_width = start_line * (column_width + E_REFLOW_FULL_GUTTER);
- column_width = reflow->temp_column_width;
- running_width -= start_line * (column_width + E_REFLOW_FULL_GUTTER);
- i += start_line * (column_width + E_REFLOW_FULL_GUTTER);
- running_width += E_REFLOW_BORDER_WIDTH + column_width + E_REFLOW_BORDER_WIDTH;
- x_rect = running_width;
- y_rect = E_REFLOW_BORDER_WIDTH;
- width_rect = E_REFLOW_DIVIDER_WIDTH;
- height_rect = reflow->height - (E_REFLOW_BORDER_WIDTH * 2);
-
- /* Compute first column to draw. */
- i /= column_width + E_REFLOW_FULL_GUTTER;
- running_width += i * (column_width + E_REFLOW_FULL_GUTTER);
-
- for ( ; i < reflow->column_count; i++) {
- if ( running_width > x + width )
- break;
- x_rect = running_width;
- gdk_draw_rectangle(drawable,
- GTK_WIDGET(item->canvas)->style->fg_gc[GTK_STATE_NORMAL],
- TRUE,
- x_rect - x,
- y_rect - y,
- width_rect - 1,
- height_rect - 1);
- running_width += E_REFLOW_DIVIDER_WIDTH + E_REFLOW_BORDER_WIDTH + column_width + E_REFLOW_BORDER_WIDTH;
- }
- }
-}
-
-static void
-e_reflow_update (GnomeCanvasItem *item, double affine[6], ArtSVP *clip_path, gint flags)
-{
- EReflow *reflow;
- double x0, x1, y0, y1;
-
- reflow = E_REFLOW (item);
-
- if (GNOME_CANVAS_ITEM_CLASS(parent_class)->update)
- GNOME_CANVAS_ITEM_CLASS(parent_class)->update (item, affine, clip_path, flags);
-
- x0 = item->x1;
- y0 = item->y1;
- x1 = item->x2;
- y1 = item->y2;
- if ( x1 < x0 + reflow->width )
- x1 = x0 + reflow->width;
- if ( y1 < y0 + reflow->height )
- y1 = y0 + reflow->height;
- item->x2 = x1;
- item->y2 = y1;
-
- if (reflow->need_height_update) {
- x0 = item->x1;
- y0 = item->y1;
- x1 = item->x2;
- y1 = item->y2;
- if ( x0 > 0 )
- x0 = 0;
- if ( y0 > 0 )
- y0 = 0;
- if ( x1 < E_REFLOW(item)->width )
- x1 = E_REFLOW(item)->width;
- if ( x1 < E_REFLOW(item)->height )
- x1 = E_REFLOW(item)->height;
-
- gnome_canvas_request_redraw(item->canvas, x0, y0, x1, y1);
- reflow->need_height_update = FALSE;
- } else if (reflow->need_column_resize) {
- int x_rect, y_rect, width_rect, height_rect;
- int start_line = e_reflow_pick_line(reflow,
- gtk_layout_get_hadjustment(GTK_LAYOUT(item->canvas))->value);
- gdouble running_width;
- int i;
- double column_width;
-
- if ( reflow->previous_temp_column_width != -1 ) {
- running_width = start_line * (reflow->column_width + E_REFLOW_FULL_GUTTER);
- column_width = reflow->previous_temp_column_width;
- running_width -= start_line * (column_width + E_REFLOW_FULL_GUTTER);
- running_width += E_REFLOW_BORDER_WIDTH + column_width + E_REFLOW_BORDER_WIDTH;
- y_rect = E_REFLOW_BORDER_WIDTH;
- width_rect = E_REFLOW_DIVIDER_WIDTH;
- height_rect = reflow->height - (E_REFLOW_BORDER_WIDTH * 2);
-
- for ( i = 0; i < reflow->column_count; i++) {
- x_rect = running_width;
- gnome_canvas_request_redraw(item->canvas, x_rect, y_rect, x_rect + width_rect, y_rect + height_rect);
- running_width += E_REFLOW_DIVIDER_WIDTH + E_REFLOW_BORDER_WIDTH + column_width + E_REFLOW_BORDER_WIDTH;
- }
- }
-
- if ( reflow->temp_column_width != -1 ) {
- running_width = start_line * (reflow->column_width + E_REFLOW_FULL_GUTTER);
- column_width = reflow->temp_column_width;
- running_width -= start_line * (column_width + E_REFLOW_FULL_GUTTER);
- running_width += E_REFLOW_BORDER_WIDTH + column_width + E_REFLOW_BORDER_WIDTH;
- y_rect = E_REFLOW_BORDER_WIDTH;
- width_rect = E_REFLOW_DIVIDER_WIDTH;
- height_rect = reflow->height - (E_REFLOW_BORDER_WIDTH * 2);
-
- for ( i = 0; i < reflow->column_count; i++) {
- x_rect = running_width;
- gnome_canvas_request_redraw(item->canvas, x_rect, y_rect, x_rect + width_rect, y_rect + height_rect);
- running_width += E_REFLOW_DIVIDER_WIDTH + E_REFLOW_BORDER_WIDTH + column_width + E_REFLOW_BORDER_WIDTH;
- }
- }
-
- reflow->previous_temp_column_width = reflow->temp_column_width;
- reflow->need_column_resize = FALSE;
- }
-}
-
-static double
-e_reflow_point (GnomeCanvasItem *item,
- double x, double y, int cx, int cy,
- GnomeCanvasItem **actual_item)
-{
- double distance = 1;
-
- *actual_item = NULL;
-
- if (GNOME_CANVAS_ITEM_CLASS(parent_class)->point)
- distance = GNOME_CANVAS_ITEM_CLASS(parent_class)->point (item, x, y, cx, cy, actual_item);
- if ((int) (distance * item->canvas->pixels_per_unit + 0.5) <= item->canvas->close_enough && *actual_item)
- return distance;
-
- *actual_item = item;
- return 0;
-#if 0
- if (y >= E_REFLOW_BORDER_WIDTH && y <= reflow->height - E_REFLOW_BORDER_WIDTH) {
- float n_x;
- n_x = x;
- n_x += E_REFLOW_BORDER_WIDTH + E_REFLOW_DIVIDER_WIDTH;
- n_x = fmod(n_x, (reflow->column_width + E_REFLOW_FULL_GUTTER));
- if (n_x < E_REFLOW_FULL_GUTTER) {
- *actual_item = item;
- return 0;
- }
- }
- return distance;
-#endif
-}
-
-static void
-e_reflow_reflow( GnomeCanvasItem *item, int flags )
-{
- EReflow *reflow = E_REFLOW(item);
- gdouble old_width;
- gdouble running_width;
- gdouble running_height;
- int next_column;
- int i;
-
- if (! (GTK_OBJECT_FLAGS (reflow) & GNOME_CANVAS_ITEM_REALIZED))
- return;
-
- if (reflow->need_reflow_columns) {
- reflow_columns (reflow);
- }
-
- old_width = reflow->width;
-
- running_width = E_REFLOW_BORDER_WIDTH;
- running_height = E_REFLOW_BORDER_WIDTH;
-
- next_column = 1;
-
- for (i = 0; i < reflow->count; i++) {
- int unsorted = e_sorter_sorted_to_model (E_SORTER (reflow->sorter), i);
- if (next_column < reflow->column_count && i == reflow->columns[next_column]) {
- running_height = E_REFLOW_BORDER_WIDTH;
- running_width += reflow->column_width + E_REFLOW_FULL_GUTTER;
- next_column ++;
- }
-
- if (unsorted >= 0 && reflow->items[unsorted]) {
- e_canvas_item_move_absolute(GNOME_CANVAS_ITEM(reflow->items[unsorted]),
- (double) running_width,
- (double) running_height);
- running_height += reflow->heights[unsorted] + E_REFLOW_BORDER_WIDTH;
- }
- }
- reflow->width = running_width + reflow->column_width + E_REFLOW_BORDER_WIDTH;
- if ( reflow->width < reflow->minimum_width )
- reflow->width = reflow->minimum_width;
- if (old_width != reflow->width)
- e_canvas_item_request_parent_reflow(item);
-}
-
-static int
-e_reflow_selection_event_real (EReflow *reflow, GnomeCanvasItem *item, GdkEvent *event)
-{
- int row;
- int return_val = TRUE;
- switch (event->type) {
- case GDK_BUTTON_PRESS:
- switch (event->button.button) {
- case 1: /* Fall through. */
- case 2:
- row = er_find_item (reflow, item);
- if (event->button.button == 1) {
- reflow->maybe_did_something =
- e_selection_model_maybe_do_something(reflow->selection, row, 0, event->button.state);
- reflow->maybe_in_drag = TRUE;
- } else {
- e_selection_model_do_something(reflow->selection, row, 0, event->button.state);
- }
- break;
- case 3:
- row = er_find_item (reflow, item);
- e_selection_model_right_click_down(reflow->selection, row, 0, 0);
- break;
- default:
- return_val = FALSE;
- break;
- }
- break;
- case GDK_BUTTON_RELEASE:
- if (event->button.button == 1) {
- if (reflow->maybe_in_drag) {
- reflow->maybe_in_drag = FALSE;
- if (!reflow->maybe_did_something) {
- row = er_find_item (reflow, item);
- e_selection_model_do_something(reflow->selection, row, 0, event->button.state);
- }
- }
- }
- break;
- case GDK_KEY_PRESS:
- return_val = e_selection_model_key_press(reflow->selection, (GdkEventKey *) event);
- break;
- default:
- return_val = FALSE;
- break;
- }
-
- return return_val;
-}
-
-static void
-e_reflow_class_init (EReflowClass *klass)
-{
- GObjectClass *object_class;
- GnomeCanvasItemClass *item_class;
-
- object_class = (GObjectClass*) klass;
- item_class = (GnomeCanvasItemClass *) klass;
-
- parent_class = g_type_class_ref (PARENT_TYPE);
-
- object_class->set_property = e_reflow_set_property;
- object_class->get_property = e_reflow_get_property;
- object_class->dispose = e_reflow_dispose;
-
- /* GnomeCanvasItem method overrides */
- item_class->event = e_reflow_event;
- item_class->realize = e_reflow_realize;
- item_class->unrealize = e_reflow_unrealize;
- item_class->draw = e_reflow_draw;
- item_class->update = e_reflow_update;
- item_class->point = e_reflow_point;
-
- klass->selection_event = e_reflow_selection_event_real;
- klass->column_width_changed = NULL;
-
- g_object_class_install_property (object_class, PROP_MINIMUM_WIDTH,
- g_param_spec_double ("minimum_width",
- _( "Minimum width" ),
- _( "Minimum Width" ),
- 0.0, G_MAXDOUBLE, 0.0,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_WIDTH,
- g_param_spec_double ("width",
- _( "Width" ),
- _( "Width" ),
- 0.0, G_MAXDOUBLE, 0.0,
- G_PARAM_READABLE));
-
-
- g_object_class_install_property (object_class, PROP_HEIGHT,
- g_param_spec_double ("height",
- _( "Height" ),
- _( "Height" ),
- 0.0, G_MAXDOUBLE, 0.0,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_EMPTY_MESSAGE,
- g_param_spec_string ("empty_message",
- _( "Empty message" ),
- _( "Empty message" ),
- NULL,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_MODEL,
- g_param_spec_object ("model",
- _( "Reflow model" ),
- _( "Reflow model" ),
- E_REFLOW_MODEL_TYPE,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_COLUMN_WIDTH,
- g_param_spec_double ("column_width",
- _( "Column width" ),
- _( "Column width" ),
- 0.0, G_MAXDOUBLE, 150.0,
- G_PARAM_READWRITE));
-
- signals [SELECTION_EVENT] =
- g_signal_new ("selection_event",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (EReflowClass, selection_event),
- NULL, NULL,
- e_marshal_INT__OBJECT_BOXED,
- G_TYPE_INT, 2, G_TYPE_OBJECT,
- GDK_TYPE_EVENT);
-
- signals [COLUMN_WIDTH_CHANGED] =
- g_signal_new ("column_width_changed",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (EReflowClass, column_width_changed),
- NULL, NULL,
- e_marshal_NONE__DOUBLE,
- G_TYPE_NONE, 1, G_TYPE_DOUBLE);
-}
-
-static void
-e_reflow_init (EReflow *reflow)
-{
- reflow->model = NULL;
- reflow->items = NULL;
- reflow->heights = NULL;
- reflow->count = 0;
-
- reflow->columns = NULL;
- reflow->column_count = 0;
-
- reflow->empty_text = NULL;
- reflow->empty_message = NULL;
-
- reflow->minimum_width = 10;
- reflow->width = 10;
- reflow->height = 10;
-
- reflow->column_width = 150;
-
- reflow->column_drag = FALSE;
-
- reflow->need_height_update = FALSE;
- reflow->need_column_resize = FALSE;
- reflow->need_reflow_columns = FALSE;
-
- reflow->maybe_did_something = FALSE;
- reflow->maybe_in_drag = FALSE;
-
- reflow->default_cursor_shown = TRUE;
- reflow->arrow_cursor = NULL;
- reflow->default_cursor = NULL;
-
- reflow->cursor_row = -1;
-
- reflow->incarnate_idle_id = 0;
- reflow->set_scroll_adjustments_id = 0;
-
- reflow->selection = E_SELECTION_MODEL (e_selection_model_simple_new());
- reflow->sorter = e_sorter_array_new (er_compare, reflow);
-
- g_object_set (reflow->selection,
- "sorter", reflow->sorter,
- NULL);
-
- reflow->selection_changed_id =
- g_signal_connect(reflow->selection, "selection_changed",
- G_CALLBACK (selection_changed), reflow);
- reflow->selection_row_changed_id =
- g_signal_connect(reflow->selection, "selection_row_changed",
- G_CALLBACK (selection_row_changed), reflow);
- reflow->cursor_changed_id =
- g_signal_connect(reflow->selection, "cursor_changed",
- G_CALLBACK (cursor_changed), reflow);
-
- e_canvas_item_set_reflow_callback(GNOME_CANVAS_ITEM(reflow), e_reflow_reflow);
-}
-
-E_MAKE_TYPE (e_reflow,
- "EReflow",
- EReflow,
- e_reflow_class_init,
- e_reflow_init,
- PARENT_TYPE)
diff --git a/widgets/misc/e-reflow.h b/widgets/misc/e-reflow.h
deleted file mode 100644
index b92643a935..0000000000
--- a/widgets/misc/e-reflow.h
+++ /dev/null
@@ -1,146 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-reflow.h
- * Copyright 2000, 2001, Ximian, Inc.
- *
- * Authors:
- * Chris Lahey <clahey@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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.
- */
-
-#ifndef __E_REFLOW_H__
-#define __E_REFLOW_H__
-
-#include <libgnomecanvas/gnome-canvas.h>
-#include <gal/widgets/e-reflow-model.h>
-#include <gal/widgets/e-selection-model.h>
-#include <gal/util/e-sorter-array.h>
-
-#ifdef __cplusplus
-extern "C" {
-#pragma }
-#endif /* __cplusplus */
-
-/* EReflow - A canvas item container.
- *
- * The following arguments are available:
- *
- * name type read/write description
- * --------------------------------------------------------------------------------
- * minimum_width double RW minimum width of the reflow. width >= minimum_width
- * width double R width of the reflow
- * height double RW height of the reflow
- */
-
-#define E_REFLOW_TYPE (e_reflow_get_type ())
-#define E_REFLOW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), E_REFLOW_TYPE, EReflow))
-#define E_REFLOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), E_REFLOW_TYPE, EReflowClass))
-#define E_IS_REFLOW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), E_REFLOW_TYPE))
-#define E_IS_REFLOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), E_REFLOW_TYPE))
-
-
-typedef struct EReflowPriv EReflowPriv;
-
-typedef struct _EReflow EReflow;
-typedef struct _EReflowClass EReflowClass;
-
-struct _EReflow
-{
- GnomeCanvasGroup parent;
-
- /* item specific fields */
- EReflowModel *model;
- guint model_changed_id;
- guint comparison_changed_id;
- guint model_items_inserted_id;
- guint model_item_removed_id;
- guint model_item_changed_id;
-
- ESelectionModel *selection;
- guint selection_changed_id;
- guint selection_row_changed_id;
- guint cursor_changed_id;
- ESorterArray *sorter;
-
- GtkAdjustment *adjustment;
- guint adjustment_changed_id;
- guint adjustment_value_changed_id;
- guint set_scroll_adjustments_id;
-
- int *heights;
- GnomeCanvasItem **items;
- int count;
- int allocated_count;
-
- int *columns;
- gint column_count; /* Number of columnns */
-
- GnomeCanvasItem *empty_text;
- gchar *empty_message;
-
- double minimum_width;
- double width;
- double height;
-
- double column_width;
-
- int incarnate_idle_id;
-
- /* These are all for when the column is being dragged. */
- gdouble start_x;
- gint which_column_dragged;
- double temp_column_width;
- double previous_temp_column_width;
-
- int cursor_row;
-
- int reflow_from_column;
-
- guint column_drag : 1;
-
- guint need_height_update : 1;
- guint need_column_resize : 1;
- guint need_reflow_columns : 1;
-
- guint default_cursor_shown : 1;
-
- guint maybe_did_something : 1;
- guint maybe_in_drag : 1;
- GdkCursor *arrow_cursor;
- GdkCursor *default_cursor;
-};
-
-struct _EReflowClass
-{
- GnomeCanvasGroupClass parent_class;
-
- int (*selection_event) (EReflow *reflow, GnomeCanvasItem *item, GdkEvent *event);
- void (*column_width_changed) (EReflow *reflow, double width);
-};
-
-/*
- * To be added to a reflow, an item must have the argument "width" as
- * a Read/Write argument and "height" as a Read Only argument. It
- * should also do an ECanvas parent reflow request if its size
- * changes.
- */
-GtkType e_reflow_get_type (void);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* __E_REFLOW_H__ */
diff --git a/widgets/misc/e-selection-model-array.c b/widgets/misc/e-selection-model-array.c
deleted file mode 100644
index e6e96702a3..0000000000
--- a/widgets/misc/e-selection-model-array.c
+++ /dev/null
@@ -1,557 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-selection-model-array.c
- * Copyright 2000, 2001, Ximian, Inc.
- *
- * Authors:
- * Chris Lahey <clahey@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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 <gtk/gtksignal.h>
-#include "e-selection-model-array.h"
-#include "gal/util/e-i18n.h"
-#include "gal/util/e-util.h"
-
-#define PARENT_TYPE e_selection_model_get_type ()
-
-static ESelectionModelClass *parent_class;
-
-enum {
- PROP_0,
- PROP_CURSOR_ROW,
- PROP_CURSOR_COL
-};
-
-void
-e_selection_model_array_confirm_row_count(ESelectionModelArray *esma)
-{
- if (esma->eba == NULL) {
- int row_count = e_selection_model_array_get_row_count(esma);
- esma->eba = e_bit_array_new(row_count);
- esma->selected_row = -1;
- esma->selected_range_end = -1;
- }
-}
-
-/* FIXME: Should this deal with moving the selection if it's in single mode? */
-void
-e_selection_model_array_delete_rows(ESelectionModelArray *esma, int row, int count)
-{
- if (esma->eba) {
- if (E_SELECTION_MODEL(esma)->mode == GTK_SELECTION_SINGLE)
- e_bit_array_delete_single_mode(esma->eba, row, count);
- else
- e_bit_array_delete(esma->eba, row, count);
-
- if (esma->cursor_row > row + count)
- esma->cursor_row -= count;
- else if (esma->cursor_row > row)
- esma->cursor_row = row;
-
- if (esma->cursor_row >= e_bit_array_bit_count (esma->eba)) {
- esma->cursor_row = e_bit_array_bit_count (esma->eba) - 1;
- } else if (esma->cursor_row < 0) {
- esma->cursor_row = -1;
- }
- if (esma->cursor_row >= 0)
- e_bit_array_change_one_row(esma->eba, esma->cursor_row, TRUE);
-
- esma->selected_row = -1;
- esma->selected_range_end = -1;
- e_selection_model_selection_changed(E_SELECTION_MODEL(esma));
- e_selection_model_cursor_changed(E_SELECTION_MODEL(esma), esma->cursor_row, esma->cursor_col);
- }
-}
-
-void
-e_selection_model_array_insert_rows(ESelectionModelArray *esma, int row, int count)
-{
- if (esma->eba) {
- e_bit_array_insert(esma->eba, row, count);
-
- if (esma->cursor_row >= row)
- esma->cursor_row += count;
-
- esma->selected_row = -1;
- esma->selected_range_end = -1;
- e_selection_model_selection_changed(E_SELECTION_MODEL(esma));
- e_selection_model_cursor_changed(E_SELECTION_MODEL(esma), esma->cursor_row, esma->cursor_col);
- }
-}
-
-void
-e_selection_model_array_move_row(ESelectionModelArray *esma, int old_row, int new_row)
-{
- ESelectionModel *esm = E_SELECTION_MODEL(esma);
-
- if (esma->eba) {
- gboolean selected = e_bit_array_value_at(esma->eba, old_row);
- gboolean cursor = (esma->cursor_row == old_row);
-
- if (old_row < esma->cursor_row && esma->cursor_row < new_row)
- esma->cursor_row --;
- else if (new_row < esma->cursor_row && esma->cursor_row < old_row)
- esma->cursor_row ++;
-
- e_bit_array_move_row(esma->eba, old_row, new_row);
-
- if (selected) {
- if (esm->mode == GTK_SELECTION_SINGLE)
- e_bit_array_select_single_row (esma->eba, new_row);
- else
- e_bit_array_change_one_row(esma->eba, new_row, TRUE);
- }
- if (cursor) {
- esma->cursor_row = new_row;
- }
- esma->selected_row = -1;
- esma->selected_range_end = -1;
- e_selection_model_selection_changed(esm);
- e_selection_model_cursor_changed(esm, esma->cursor_row, esma->cursor_col);
- }
-}
-
-static void
-esma_dispose (GObject *object)
-{
- ESelectionModelArray *esma;
-
- esma = E_SELECTION_MODEL_ARRAY (object);
-
- if (esma->eba) {
- g_object_unref (esma->eba);
- esma->eba = NULL;
- }
-
- if (G_OBJECT_CLASS (parent_class)->dispose)
- (* G_OBJECT_CLASS (parent_class)->dispose) (object);
-}
-
-static void
-esma_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec)
-{
- ESelectionModelArray *esma = E_SELECTION_MODEL_ARRAY (object);
-
- switch (prop_id){
- case PROP_CURSOR_ROW:
- g_value_set_int (value, esma->cursor_row);
- break;
-
- case PROP_CURSOR_COL:
- g_value_set_int (value, esma->cursor_col);
- break;
- }
-}
-
-static void
-esma_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec)
-{
- ESelectionModel *esm = E_SELECTION_MODEL (object);
- ESelectionModelArray *esma = E_SELECTION_MODEL_ARRAY (object);
-
- switch (prop_id){
- case PROP_CURSOR_ROW:
- e_selection_model_do_something(esm, g_value_get_int (value), esma->cursor_col, 0);
- break;
-
- case PROP_CURSOR_COL:
- e_selection_model_do_something(esm, esma->cursor_row, g_value_get_int(value), 0);
- break;
- }
-}
-
-/**
- * e_selection_model_is_row_selected
- * @selection: #ESelectionModel to check
- * @n: The row to check
- *
- * This routine calculates whether the given row is selected.
- *
- * Returns: %TRUE if the given row is selected
- */
-static gboolean
-esma_is_row_selected (ESelectionModel *selection,
- gint n)
-{
- ESelectionModelArray *esma = E_SELECTION_MODEL_ARRAY(selection);
- if (esma->eba)
- return e_bit_array_value_at(esma->eba, n);
- else
- return FALSE;
-}
-
-/**
- * e_selection_model_foreach
- * @selection: #ESelectionModel to traverse
- * @callback: The callback function to call back.
- * @closure: The closure
- *
- * This routine calls the given callback function once for each
- * selected row, passing closure as the closure.
- */
-static void
-esma_foreach (ESelectionModel *selection,
- EForeachFunc callback,
- gpointer closure)
-{
- ESelectionModelArray *esma = E_SELECTION_MODEL_ARRAY(selection);
- if (esma->eba)
- e_bit_array_foreach(esma->eba, callback, closure);
-}
-
-/**
- * e_selection_model_clear
- * @selection: #ESelectionModel to clear
- *
- * This routine clears the selection to no rows selected.
- */
-static void
-esma_clear(ESelectionModel *selection)
-{
- ESelectionModelArray *esma = E_SELECTION_MODEL_ARRAY(selection);
- if (esma->eba) {
- g_object_unref(esma->eba);
- esma->eba = NULL;
- }
- esma->cursor_row = -1;
- esma->cursor_col = -1;
- esma->selected_row = -1;
- esma->selected_range_end = -1;
- e_selection_model_selection_changed(E_SELECTION_MODEL(esma));
- e_selection_model_cursor_changed(E_SELECTION_MODEL(esma), -1, -1);
-}
-
-#define PART(x,n) (((x) & (0x01010101 << n)) >> n)
-#define SECTION(x, n) (((x) >> (n * 8)) & 0xff)
-
-/**
- * e_selection_model_selected_count
- * @selection: #ESelectionModel to count
- *
- * This routine calculates the number of rows selected.
- *
- * Returns: The number of rows selected in the given model.
- */
-static gint
-esma_selected_count (ESelectionModel *selection)
-{
- ESelectionModelArray *esma = E_SELECTION_MODEL_ARRAY(selection);
- if (esma->eba)
- return e_bit_array_selected_count(esma->eba);
- else
- return 0;
-}
-
-/**
- * e_selection_model_select_all
- * @selection: #ESelectionModel to select all
- *
- * This routine selects all the rows in the given
- * #ESelectionModel.
- */
-static void
-esma_select_all (ESelectionModel *selection)
-{
- ESelectionModelArray *esma = E_SELECTION_MODEL_ARRAY(selection);
-
- e_selection_model_array_confirm_row_count(esma);
-
- e_bit_array_select_all(esma->eba);
-
- esma->cursor_col = 0;
- esma->cursor_row = 0;
- esma->selection_start_row = 0;
- esma->selected_row = -1;
- esma->selected_range_end = -1;
- e_selection_model_selection_changed(E_SELECTION_MODEL(esma));
- e_selection_model_cursor_changed(E_SELECTION_MODEL(esma), 0, 0);
-}
-
-/**
- * e_selection_model_invert_selection
- * @selection: #ESelectionModel to invert
- *
- * This routine inverts all the rows in the given
- * #ESelectionModel.
- */
-static void
-esma_invert_selection (ESelectionModel *selection)
-{
- ESelectionModelArray *esma = E_SELECTION_MODEL_ARRAY(selection);
-
- e_selection_model_array_confirm_row_count(esma);
-
- e_bit_array_invert_selection(esma->eba);
-
- esma->cursor_col = -1;
- esma->cursor_row = -1;
- esma->selection_start_row = 0;
- esma->selected_row = -1;
- esma->selected_range_end = -1;
- e_selection_model_selection_changed(E_SELECTION_MODEL(esma));
- e_selection_model_cursor_changed(E_SELECTION_MODEL(esma), -1, -1);
-}
-
-static int
-esma_row_count (ESelectionModel *selection)
-{
- ESelectionModelArray *esma = E_SELECTION_MODEL_ARRAY(selection);
- e_selection_model_array_confirm_row_count(esma);
- return e_bit_array_bit_count(esma->eba);
-}
-
-static void
-esma_change_one_row(ESelectionModel *selection, int row, gboolean grow)
-{
- ESelectionModelArray *esma = E_SELECTION_MODEL_ARRAY(selection);
- e_selection_model_array_confirm_row_count(esma);
- e_bit_array_change_one_row(esma->eba, row, grow);
-}
-
-static void
-esma_change_cursor (ESelectionModel *selection, int row, int col)
-{
- ESelectionModelArray *esma;
-
- g_return_if_fail(selection != NULL);
- g_return_if_fail(E_IS_SELECTION_MODEL(selection));
-
- esma = E_SELECTION_MODEL_ARRAY(selection);
-
- esma->cursor_row = row;
- esma->cursor_col = col;
-}
-
-static void
-esma_change_range(ESelectionModel *selection, int start, int end, gboolean grow)
-{
- int i;
- ESelectionModelArray *esma = E_SELECTION_MODEL_ARRAY(selection);
- if (start != end) {
- if (selection->sorter && e_sorter_needs_sorting(selection->sorter)) {
- for ( i = start; i < end; i++) {
- e_bit_array_change_one_row(esma->eba, e_sorter_sorted_to_model(selection->sorter, i), grow);
- }
- } else {
- e_selection_model_array_confirm_row_count(esma);
- e_bit_array_change_range(esma->eba, start, end, grow);
- }
- }
-}
-
-static int
-esma_cursor_row (ESelectionModel *selection)
-{
- ESelectionModelArray *esma = E_SELECTION_MODEL_ARRAY(selection);
- return esma->cursor_row;
-}
-
-static int
-esma_cursor_col (ESelectionModel *selection)
-{
- ESelectionModelArray *esma = E_SELECTION_MODEL_ARRAY(selection);
- return esma->cursor_col;
-}
-
-static void
-esma_real_select_single_row (ESelectionModel *selection, int row)
-{
- ESelectionModelArray *esma = E_SELECTION_MODEL_ARRAY(selection);
-
- e_selection_model_array_confirm_row_count(esma);
-
- e_bit_array_select_single_row(esma->eba, row);
-
- esma->selection_start_row = row;
- esma->selected_row = row;
- esma->selected_range_end = row;
-}
-
-static void
-esma_select_single_row (ESelectionModel *selection, int row)
-{
- ESelectionModelArray *esma = E_SELECTION_MODEL_ARRAY(selection);
- int selected_row = esma->selected_row;
- esma_real_select_single_row (selection, row);
-
- if (selected_row != -1 && esma->eba && selected_row < e_bit_array_bit_count (esma->eba)) {
- if (selected_row != row) {
- e_selection_model_selection_row_changed(selection, selected_row);
- e_selection_model_selection_row_changed(selection, row);
- }
- } else {
- e_selection_model_selection_changed(selection);
- }
-}
-
-static void
-esma_toggle_single_row (ESelectionModel *selection, int row)
-{
- ESelectionModelArray *esma = E_SELECTION_MODEL_ARRAY(selection);
-
- e_selection_model_array_confirm_row_count(esma);
- e_bit_array_toggle_single_row(esma->eba, row);
-
- esma->selection_start_row = row;
- esma->selected_row = -1;
- esma->selected_range_end = -1;
- e_selection_model_selection_row_changed(E_SELECTION_MODEL(esma), row);
-}
-
-static void
-esma_real_move_selection_end (ESelectionModel *selection, int row)
-{
- ESelectionModelArray *esma = E_SELECTION_MODEL_ARRAY(selection);
- int old_start;
- int old_end;
- int new_start;
- int new_end;
- if (selection->sorter && e_sorter_needs_sorting(selection->sorter)) {
- old_start = MIN (e_sorter_model_to_sorted(selection->sorter, esma->selection_start_row),
- e_sorter_model_to_sorted(selection->sorter, esma->cursor_row));
- old_end = MAX (e_sorter_model_to_sorted(selection->sorter, esma->selection_start_row),
- e_sorter_model_to_sorted(selection->sorter, esma->cursor_row)) + 1;
- new_start = MIN (e_sorter_model_to_sorted(selection->sorter, esma->selection_start_row),
- e_sorter_model_to_sorted(selection->sorter, row));
- new_end = MAX (e_sorter_model_to_sorted(selection->sorter, esma->selection_start_row),
- e_sorter_model_to_sorted(selection->sorter, row)) + 1;
- } else {
- old_start = MIN (esma->selection_start_row, esma->cursor_row);
- old_end = MAX (esma->selection_start_row, esma->cursor_row) + 1;
- new_start = MIN (esma->selection_start_row, row);
- new_end = MAX (esma->selection_start_row, row) + 1;
- }
- /* This wouldn't work nearly so smoothly if one end of the selection weren't held in place. */
- if (old_start < new_start)
- esma_change_range(selection, old_start, new_start, FALSE);
- if (new_start < old_start)
- esma_change_range(selection, new_start, old_start, TRUE);
- if (old_end < new_end)
- esma_change_range(selection, old_end, new_end, TRUE);
- if (new_end < old_end)
- esma_change_range(selection, new_end, old_end, FALSE);
- esma->selected_row = -1;
- esma->selected_range_end = -1;
-}
-
-static void
-esma_move_selection_end (ESelectionModel *selection, int row)
-{
- esma_real_move_selection_end (selection, row);
- e_selection_model_selection_changed(selection);
-}
-
-static void
-esma_set_selection_end (ESelectionModel *selection, int row)
-{
- ESelectionModelArray *esma = E_SELECTION_MODEL_ARRAY(selection);
- int selected_range_end = esma->selected_range_end;
- int view_row = e_sorter_model_to_sorted(selection->sorter, row);
-
- esma_real_select_single_row(selection, esma->selection_start_row);
- esma->cursor_row = esma->selection_start_row;
- esma_real_move_selection_end(selection, row);
-
- esma->selected_range_end = view_row;
- if (selected_range_end != -1 && view_row != -1) {
- if (selected_range_end == view_row - 1 ||
- selected_range_end == view_row + 1) {
- e_selection_model_selection_row_changed(selection, selected_range_end);
- e_selection_model_selection_row_changed(selection, view_row);
- }
- }
- e_selection_model_selection_changed(selection);
-}
-
-int
-e_selection_model_array_get_row_count (ESelectionModelArray *esma)
-{
- g_return_val_if_fail(esma != NULL, 0);
- g_return_val_if_fail(E_IS_SELECTION_MODEL_ARRAY(esma), 0);
-
- if (E_SELECTION_MODEL_ARRAY_GET_CLASS(esma)->get_row_count)
- return E_SELECTION_MODEL_ARRAY_GET_CLASS(esma)->get_row_count (esma);
- else
- return 0;
-}
-
-
-static void
-e_selection_model_array_init (ESelectionModelArray *esma)
-{
- esma->eba = NULL;
- esma->selection_start_row = 0;
- esma->cursor_row = -1;
- esma->cursor_col = -1;
-
- esma->selected_row = -1;
- esma->selected_range_end = -1;
-}
-
-static void
-e_selection_model_array_class_init (ESelectionModelArrayClass *klass)
-{
- GObjectClass *object_class;
- ESelectionModelClass *esm_class;
-
- parent_class = g_type_class_ref (PARENT_TYPE);
-
- object_class = G_OBJECT_CLASS(klass);
- esm_class = E_SELECTION_MODEL_CLASS(klass);
-
- object_class->dispose = esma_dispose;
- object_class->get_property = esma_get_property;
- object_class->set_property = esma_set_property;
-
- esm_class->is_row_selected = esma_is_row_selected ;
- esm_class->foreach = esma_foreach ;
- esm_class->clear = esma_clear ;
- esm_class->selected_count = esma_selected_count ;
- esm_class->select_all = esma_select_all ;
- esm_class->invert_selection = esma_invert_selection ;
- esm_class->row_count = esma_row_count ;
-
- esm_class->change_one_row = esma_change_one_row ;
- esm_class->change_cursor = esma_change_cursor ;
- esm_class->cursor_row = esma_cursor_row ;
- esm_class->cursor_col = esma_cursor_col ;
-
- esm_class->select_single_row = esma_select_single_row ;
- esm_class->toggle_single_row = esma_toggle_single_row ;
- esm_class->move_selection_end = esma_move_selection_end ;
- esm_class->set_selection_end = esma_set_selection_end ;
-
- klass->get_row_count = NULL ;
-
- g_object_class_install_property (object_class, PROP_CURSOR_ROW,
- g_param_spec_int ("cursor_row",
- _("Cursor Row"),
- /*_( */"XXX blurb" /*)*/,
- 0, G_MAXINT, 0,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_CURSOR_COL,
- g_param_spec_int ("cursor_col",
- _("Cursor Column"),
- /*_( */"XXX blurb" /*)*/,
- 0, G_MAXINT, 0,
- G_PARAM_READWRITE));
-}
-
-E_MAKE_TYPE(e_selection_model_array, "ESelectionModelArray", ESelectionModelArray,
- e_selection_model_array_class_init, e_selection_model_array_init, PARENT_TYPE)
diff --git a/widgets/misc/e-selection-model-array.h b/widgets/misc/e-selection-model-array.h
deleted file mode 100644
index a533030f92..0000000000
--- a/widgets/misc/e-selection-model-array.h
+++ /dev/null
@@ -1,96 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-selection-model-array.h
- * Copyright 2000, 2001, Ximian, Inc.
- *
- * Authors:
- * Chris Lahey <clahey@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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.
- */
-
-#ifndef _E_SELECTION_MODEL_ARRAY_H_
-#define _E_SELECTION_MODEL_ARRAY_H_
-
-#include <gtk/gtkobject.h>
-#include <gal/widgets/e-selection-model.h>
-#include <gal/util/e-bit-array.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
-
-#define E_SELECTION_MODEL_ARRAY_TYPE (e_selection_model_array_get_type ())
-#define E_SELECTION_MODEL_ARRAY(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), E_SELECTION_MODEL_ARRAY_TYPE, ESelectionModelArray))
-#define E_SELECTION_MODEL_ARRAY_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), E_SELECTION_MODEL_ARRAY_TYPE, ESelectionModelArrayClass))
-#define E_IS_SELECTION_MODEL_ARRAY(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), E_SELECTION_MODEL_ARRAY_TYPE))
-#define E_IS_SELECTION_MODEL_ARRAY_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), E_SELECTION_MODEL_ARRAY_TYPE))
-#define E_SELECTION_MODEL_ARRAY_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), E_SELECTION_MODEL_ARRAY_TYPE, ESelectionModelArrayClass))
-
-typedef struct {
- ESelectionModel base;
-
- EBitArray *eba;
-
- gint cursor_row;
- gint cursor_col;
- gint selection_start_row;
-
- guint model_changed_id;
- guint model_row_inserted_id, model_row_deleted_id;
-
- /* Anything other than -1 means that the selection is a single
- * row. This being -1 does not impart any information. */
- gint selected_row;
- /* Anything other than -1 means that the selection is a all
- * rows between selection_start_path and cursor_path where
- * selected_range_end is the rwo number of cursor_path. This
- * being -1 does not impart any information. */
- gint selected_range_end;
-
- guint frozen : 1;
- guint selection_model_changed : 1;
- guint group_info_changed : 1;
-} ESelectionModelArray;
-
-typedef struct {
- ESelectionModelClass parent_class;
-
- gint (*get_row_count) (ESelectionModelArray *selection);
-} ESelectionModelArrayClass;
-
-GType e_selection_model_array_get_type (void);
-
-/* Protected Functions */
-void e_selection_model_array_insert_rows (ESelectionModelArray *esm,
- int row,
- int count);
-void e_selection_model_array_delete_rows (ESelectionModelArray *esm,
- int row,
- int count);
-void e_selection_model_array_move_row (ESelectionModelArray *esm,
- int old_row,
- int new_row);
-void e_selection_model_array_confirm_row_count (ESelectionModelArray *esm);
-
-/* Protected Virtual Function */
-gint e_selection_model_array_get_row_count (ESelectionModelArray *esm);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-
-#endif /* _E_SELECTION_MODEL_ARRAY_H_ */
diff --git a/widgets/misc/e-selection-model-simple.c b/widgets/misc/e-selection-model-simple.c
deleted file mode 100644
index 51a0d86623..0000000000
--- a/widgets/misc/e-selection-model-simple.c
+++ /dev/null
@@ -1,115 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-selection-model-simple.c
- * Copyright 2000, 2001, Ximian, Inc.
- *
- * Authors:
- * Chris Lahey <clahey@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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 <gal/util/e-util.h>
-#include "e-selection-model-array.h"
-#include "e-selection-model-simple.h"
-
-#define PARENT_TYPE e_selection_model_array_get_type ()
-
-static ESelectionModelArray *parent_class;
-
-static gint esms_get_row_count (ESelectionModelArray *esma);
-
-static void
-e_selection_model_simple_init (ESelectionModelSimple *selection)
-{
- selection->row_count = 0;
-}
-
-static void
-e_selection_model_simple_class_init (ESelectionModelSimpleClass *klass)
-{
- ESelectionModelArrayClass *esma_class;
-
- parent_class = g_type_class_ref (PARENT_TYPE);
-
- esma_class = E_SELECTION_MODEL_ARRAY_CLASS(klass);
-
- esma_class->get_row_count = esms_get_row_count;
-}
-
-E_MAKE_TYPE(e_selection_model_simple, "ESelectionModelSimple", ESelectionModelSimple,
- e_selection_model_simple_class_init, e_selection_model_simple_init, PARENT_TYPE)
-
-/**
- * e_selection_model_simple_new
- *
- * This routine creates a new #ESelectionModelSimple.
- *
- * Returns: The new #ESelectionModelSimple.
- */
-ESelectionModelSimple *
-e_selection_model_simple_new (void)
-{
- return g_object_new (E_SELECTION_MODEL_SIMPLE_TYPE, NULL);
-}
-
-void
-e_selection_model_simple_set_row_count (ESelectionModelSimple *esms,
- int row_count)
-{
- if (esms->row_count != row_count) {
- ESelectionModelArray *esma = E_SELECTION_MODEL_ARRAY(esms);
- if (esma->eba)
- g_object_unref(esma->eba);
- esma->eba = NULL;
- esma->selected_row = -1;
- esma->selected_range_end = -1;
- }
- esms->row_count = row_count;
-}
-
-static gint
-esms_get_row_count (ESelectionModelArray *esma)
-{
- ESelectionModelSimple *esms = E_SELECTION_MODEL_SIMPLE(esma);
-
- return esms->row_count;
-}
-
-void e_selection_model_simple_insert_rows (ESelectionModelSimple *esms,
- int row,
- int count)
-{
- esms->row_count += count;
- e_selection_model_array_insert_rows (E_SELECTION_MODEL_ARRAY(esms), row, count);
-}
-
-void
-e_selection_model_simple_delete_rows (ESelectionModelSimple *esms,
- int row,
- int count)
-{
- esms->row_count -= count;
- e_selection_model_array_delete_rows (E_SELECTION_MODEL_ARRAY(esms), row, count);
-}
-
-void
-e_selection_model_simple_move_row (ESelectionModelSimple *esms,
- int old_row,
- int new_row)
-{
- e_selection_model_array_move_row (E_SELECTION_MODEL_ARRAY(esms), old_row, new_row);
-}
diff --git a/widgets/misc/e-selection-model-simple.h b/widgets/misc/e-selection-model-simple.h
deleted file mode 100644
index 6b4f84b4f9..0000000000
--- a/widgets/misc/e-selection-model-simple.h
+++ /dev/null
@@ -1,70 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-selection-model-simple.h
- * Copyright 2000, 2001, Ximian, Inc.
- *
- * Authors:
- * Chris Lahey <clahey@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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.
- */
-
-#ifndef _E_SELECTION_MODEL_SIMPLE_H_
-#define _E_SELECTION_MODEL_SIMPLE_H_
-
-#include <gal/widgets/e-selection-model-array.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
-
-#define E_SELECTION_MODEL_SIMPLE_TYPE (e_selection_model_simple_get_type ())
-#define E_SELECTION_MODEL_SIMPLE(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), E_SELECTION_MODEL_SIMPLE_TYPE, ESelectionModelSimple))
-#define E_SELECTION_MODEL_SIMPLE_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), E_SELECTION_MODEL_SIMPLE_TYPE, ESelectionModelSimpleClass))
-#define E_IS_SELECTION_MODEL_SIMPLE(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), E_SELECTION_MODEL_SIMPLE_TYPE))
-#define E_IS_SELECTION_MODEL_SIMPLE_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), E_SELECTION_MODEL_SIMPLE_TYPE))
-
-typedef struct {
- ESelectionModelArray parent;
-
- int row_count;
-} ESelectionModelSimple;
-
-typedef struct {
- ESelectionModelArrayClass parent_class;
-} ESelectionModelSimpleClass;
-
-GType e_selection_model_simple_get_type (void);
-ESelectionModelSimple *e_selection_model_simple_new (void);
-
-void e_selection_model_simple_insert_rows (ESelectionModelSimple *esms,
- int row,
- int count);
-void e_selection_model_simple_delete_rows (ESelectionModelSimple *esms,
- int row,
- int count);
-void e_selection_model_simple_move_row (ESelectionModelSimple *esms,
- int old_row,
- int new_row);
-
-void e_selection_model_simple_set_row_count (ESelectionModelSimple *selection,
- int row_count);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* _E_SELECTION_MODEL_SIMPLE_H_ */
-
diff --git a/widgets/misc/e-selection-model.c b/widgets/misc/e-selection-model.c
deleted file mode 100644
index 991fc78490..0000000000
--- a/widgets/misc/e-selection-model.c
+++ /dev/null
@@ -1,689 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-selection-model.c
- * Copyright 2000, 2001, Ximian, Inc.
- *
- * Authors:
- * Chris Lahey <clahey@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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 <gdk/gdkkeysyms.h>
-#include "e-selection-model.h"
-#include "gal/util/e-i18n.h"
-#include "gal/util/e-util.h"
-
-#define PARENT_TYPE G_TYPE_OBJECT
-
-static GObjectClass *e_selection_model_parent_class;
-
-enum {
- CURSOR_CHANGED,
- CURSOR_ACTIVATED,
- SELECTION_CHANGED,
- SELECTION_ROW_CHANGED,
- LAST_SIGNAL
-};
-
-static guint e_selection_model_signals [LAST_SIGNAL] = { 0, };
-
-enum {
- PROP_0,
- PROP_SORTER,
- PROP_SELECTION_MODE,
- PROP_CURSOR_MODE
-};
-
-inline static void
-add_sorter(ESelectionModel *esm, ESorter *sorter)
-{
- esm->sorter = sorter;
- if (sorter) {
- g_object_ref (sorter);
- }
-}
-
-inline static void
-drop_sorter(ESelectionModel *esm)
-{
- if (esm->sorter) {
- g_object_unref (esm->sorter);
- }
- esm->sorter = NULL;
-}
-
-static void
-esm_dispose (GObject *object)
-{
- ESelectionModel *esm;
-
- esm = E_SELECTION_MODEL (object);
-
- drop_sorter(esm);
-
- if (e_selection_model_parent_class->dispose)
- (* e_selection_model_parent_class->dispose) (object);
-}
-
-static void
-esm_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec)
-{
- ESelectionModel *esm = E_SELECTION_MODEL (object);
-
- switch (prop_id){
- case PROP_SORTER:
- g_value_set_object (value, esm->sorter);
- break;
-
- case PROP_SELECTION_MODE:
- g_value_set_int (value, esm->mode);
- break;
-
- case PROP_CURSOR_MODE:
- g_value_set_int (value, esm->cursor_mode);
- break;
- }
-}
-
-static void
-esm_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec)
-{
- ESelectionModel *esm = E_SELECTION_MODEL (object);
-
- switch (prop_id){
- case PROP_SORTER:
- drop_sorter(esm);
- add_sorter(esm, g_value_get_object (value) ? E_SORTER(g_value_get_object(value)) : NULL);
- break;
-
- case PROP_SELECTION_MODE:
- esm->mode = g_value_get_int (value);
- if (esm->mode == GTK_SELECTION_SINGLE) {
- int cursor_row = e_selection_model_cursor_row(esm);
- int cursor_col = e_selection_model_cursor_col(esm);
- e_selection_model_do_something(esm, cursor_row, cursor_col, 0);
- }
- break;
-
- case PROP_CURSOR_MODE:
- esm->cursor_mode = g_value_get_int (value);
- break;
- }
-}
-
-static void
-e_selection_model_init (ESelectionModel *selection)
-{
- selection->mode = GTK_SELECTION_MULTIPLE;
- selection->cursor_mode = E_CURSOR_SIMPLE;
- selection->old_selection = -1;
-}
-
-static void
-e_selection_model_class_init (ESelectionModelClass *klass)
-{
- GObjectClass *object_class;
-
- e_selection_model_parent_class = g_type_class_ref (PARENT_TYPE);
-
- object_class = G_OBJECT_CLASS(klass);
-
- object_class->dispose = esm_dispose;
- object_class->get_property = esm_get_property;
- object_class->set_property = esm_set_property;
-
- e_selection_model_signals [CURSOR_CHANGED] =
- g_signal_new ("cursor_changed",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (ESelectionModelClass, cursor_changed),
- NULL, NULL,
- e_marshal_NONE__INT_INT,
- G_TYPE_NONE, 2, G_TYPE_INT, G_TYPE_INT);
-
- e_selection_model_signals [CURSOR_ACTIVATED] =
- g_signal_new ("cursor_activated",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (ESelectionModelClass, cursor_activated),
- NULL, NULL,
- e_marshal_NONE__INT_INT,
- G_TYPE_NONE, 2, G_TYPE_INT, G_TYPE_INT);
-
- e_selection_model_signals [SELECTION_CHANGED] =
- g_signal_new ("selection_changed",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (ESelectionModelClass, selection_changed),
- NULL, NULL,
- e_marshal_NONE__NONE,
- G_TYPE_NONE, 0);
-
- e_selection_model_signals [SELECTION_ROW_CHANGED] =
- g_signal_new ("selection_row_changed",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (ESelectionModelClass, selection_row_changed),
- NULL, NULL,
- e_marshal_NONE__INT,
- G_TYPE_NONE, 1, G_TYPE_INT);
-
- klass->cursor_changed = NULL;
- klass->cursor_activated = NULL;
- klass->selection_changed = NULL;
- klass->selection_row_changed = NULL;
-
- klass->is_row_selected = NULL;
- klass->foreach = NULL;
- klass->clear = NULL;
- klass->selected_count = NULL;
- klass->select_all = NULL;
- klass->invert_selection = NULL;
- klass->row_count = NULL;
-
- klass->change_one_row = NULL;
- klass->change_cursor = NULL;
- klass->cursor_row = NULL;
- klass->cursor_col = NULL;
-
- klass->select_single_row = NULL;
- klass->toggle_single_row = NULL;
- klass->move_selection_end = NULL;
- klass->set_selection_end = NULL;
-
- g_object_class_install_property (object_class, PROP_SORTER,
- g_param_spec_object ("sorter",
- _("Sorter"),
- /*_( */"XXX blurb" /*)*/,
- E_SORTER_TYPE,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_SELECTION_MODE,
- g_param_spec_int ("selection_mode",
- _("Selection Mode"),
- /*_( */"XXX blurb" /*)*/,
- GTK_SELECTION_NONE, GTK_SELECTION_MULTIPLE,
- GTK_SELECTION_SINGLE,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_CURSOR_MODE,
- g_param_spec_int ("cursor_mode",
- _("Cursor Mode"),
- /*_( */"XXX blurb" /*)*/,
- E_CURSOR_LINE, E_CURSOR_SPREADSHEET,
- E_CURSOR_LINE,
- G_PARAM_READWRITE));
-}
-
-E_MAKE_TYPE(e_selection_model, "ESelectionModel", ESelectionModel,
- e_selection_model_class_init, e_selection_model_init, PARENT_TYPE)
-
-/**
- * e_selection_model_is_row_selected
- * @selection: #ESelectionModel to check
- * @n: The row to check
- *
- * This routine calculates whether the given row is selected.
- *
- * Returns: %TRUE if the given row is selected
- */
-gboolean
-e_selection_model_is_row_selected (ESelectionModel *selection,
- gint n)
-{
- if (E_SELECTION_MODEL_GET_CLASS(selection)->is_row_selected)
- return E_SELECTION_MODEL_GET_CLASS(selection)->is_row_selected (selection, n);
- else
- return FALSE;
-}
-
-/**
- * e_selection_model_foreach
- * @selection: #ESelectionModel to traverse
- * @callback: The callback function to call back.
- * @closure: The closure
- *
- * This routine calls the given callback function once for each
- * selected row, passing closure as the closure.
- */
-void
-e_selection_model_foreach (ESelectionModel *selection,
- EForeachFunc callback,
- gpointer closure)
-{
- if (E_SELECTION_MODEL_GET_CLASS(selection)->foreach)
- E_SELECTION_MODEL_GET_CLASS(selection)->foreach (selection, callback, closure);
-}
-
-/**
- * e_selection_model_clear
- * @selection: #ESelectionModel to clear
- *
- * This routine clears the selection to no rows selected.
- */
-void
-e_selection_model_clear(ESelectionModel *selection)
-{
- if (E_SELECTION_MODEL_GET_CLASS(selection)->clear)
- E_SELECTION_MODEL_GET_CLASS(selection)->clear (selection);
-}
-
-/**
- * e_selection_model_selected_count
- * @selection: #ESelectionModel to count
- *
- * This routine calculates the number of rows selected.
- *
- * Returns: The number of rows selected in the given model.
- */
-gint
-e_selection_model_selected_count (ESelectionModel *selection)
-{
- if (E_SELECTION_MODEL_GET_CLASS(selection)->selected_count)
- return E_SELECTION_MODEL_GET_CLASS(selection)->selected_count (selection);
- else
- return 0;
-}
-
-/**
- * e_selection_model_select_all
- * @selection: #ESelectionModel to select all
- *
- * This routine selects all the rows in the given
- * #ESelectionModel.
- */
-void
-e_selection_model_select_all (ESelectionModel *selection)
-{
- if (E_SELECTION_MODEL_GET_CLASS(selection)->select_all)
- E_SELECTION_MODEL_GET_CLASS(selection)->select_all (selection);
-}
-
-/**
- * e_selection_model_invert_selection
- * @selection: #ESelectionModel to invert
- *
- * This routine inverts all the rows in the given
- * #ESelectionModel.
- */
-void
-e_selection_model_invert_selection (ESelectionModel *selection)
-{
- if (E_SELECTION_MODEL_GET_CLASS(selection)->invert_selection)
- E_SELECTION_MODEL_GET_CLASS(selection)->invert_selection (selection);
-}
-
-int
-e_selection_model_row_count (ESelectionModel *selection)
-{
- if (E_SELECTION_MODEL_GET_CLASS(selection)->row_count)
- return E_SELECTION_MODEL_GET_CLASS(selection)->row_count (selection);
- else
- return 0;
-}
-
-void
-e_selection_model_change_one_row(ESelectionModel *selection, int row, gboolean grow)
-{
- if (E_SELECTION_MODEL_GET_CLASS(selection)->change_one_row)
- E_SELECTION_MODEL_GET_CLASS(selection)->change_one_row (selection, row, grow);
-}
-
-void
-e_selection_model_change_cursor (ESelectionModel *selection, int row, int col)
-{
- if (E_SELECTION_MODEL_GET_CLASS(selection)->change_cursor)
- E_SELECTION_MODEL_GET_CLASS(selection)->change_cursor (selection, row, col);
-}
-
-int
-e_selection_model_cursor_row (ESelectionModel *selection)
-{
- if (E_SELECTION_MODEL_GET_CLASS(selection)->cursor_row)
- return E_SELECTION_MODEL_GET_CLASS(selection)->cursor_row (selection);
- else
- return -1;
-}
-
-int
-e_selection_model_cursor_col (ESelectionModel *selection)
-{
- if (E_SELECTION_MODEL_GET_CLASS(selection)->cursor_col)
- return E_SELECTION_MODEL_GET_CLASS(selection)->cursor_col (selection);
- else
- return -1;
-}
-
-void
-e_selection_model_select_single_row (ESelectionModel *selection, int row)
-{
- if (E_SELECTION_MODEL_GET_CLASS(selection)->select_single_row)
- E_SELECTION_MODEL_GET_CLASS(selection)->select_single_row (selection, row);
-}
-
-void
-e_selection_model_toggle_single_row (ESelectionModel *selection, int row)
-{
- if (E_SELECTION_MODEL_GET_CLASS(selection)->toggle_single_row)
- E_SELECTION_MODEL_GET_CLASS(selection)->toggle_single_row (selection, row);
-}
-
-void
-e_selection_model_move_selection_end (ESelectionModel *selection, int row)
-{
- if (E_SELECTION_MODEL_GET_CLASS(selection)->move_selection_end)
- E_SELECTION_MODEL_GET_CLASS(selection)->move_selection_end (selection, row);
-}
-
-void
-e_selection_model_set_selection_end (ESelectionModel *selection, int row)
-{
- if (E_SELECTION_MODEL_GET_CLASS(selection)->set_selection_end)
- E_SELECTION_MODEL_GET_CLASS(selection)->set_selection_end (selection, row);
-}
-
-/**
- * e_selection_model_do_something
- * @selection: #ESelectionModel to do something to.
- * @row: The row to do something in.
- * @col: The col to do something in.
- * @state: The state in which to do something.
- *
- * This routine does whatever is appropriate as if the user clicked
- * the mouse in the given row and column.
- */
-void
-e_selection_model_do_something (ESelectionModel *selection,
- guint row,
- guint col,
- GdkModifierType state)
-{
- gint shift_p = state & GDK_SHIFT_MASK;
- gint ctrl_p = state & GDK_CONTROL_MASK;
- int row_count;
-
- selection->old_selection = -1;
-
- if (row == -1 && col != -1)
- row = 0;
- if (col == -1 && row != -1)
- col = 0;
-
- row_count = e_selection_model_row_count(selection);
- if (row_count >= 0 && row < row_count) {
- switch (selection->mode) {
- case GTK_SELECTION_SINGLE:
- e_selection_model_select_single_row (selection, row);
- break;
- case GTK_SELECTION_BROWSE:
- case GTK_SELECTION_MULTIPLE:
- if (shift_p) {
- e_selection_model_set_selection_end (selection, row);
- } else {
- if (ctrl_p) {
- e_selection_model_toggle_single_row (selection, row);
- } else {
- e_selection_model_select_single_row (selection, row);
- }
- }
- break;
- default:
- g_assert_not_reached ();
- break;
- }
- e_selection_model_change_cursor(selection, row, col);
- g_signal_emit(selection,
- e_selection_model_signals[CURSOR_CHANGED], 0,
- row, col);
- g_signal_emit(selection,
- e_selection_model_signals[CURSOR_ACTIVATED], 0,
- row, col);
- }
-}
-
-/**
- * e_selection_model_maybe_do_something
- * @selection: #ESelectionModel to do something to.
- * @row: The row to do something in.
- * @col: The col to do something in.
- * @state: The state in which to do something.
- *
- * If this row is selected, this routine just moves the cursor row and
- * column. Otherwise, it does the same thing as
- * e_selection_model_do_something(). This is for being used on
- * right clicks and other events where if the user hit the selection,
- * they don't want it to change.
- */
-gboolean
-e_selection_model_maybe_do_something (ESelectionModel *selection,
- guint row,
- guint col,
- GdkModifierType state)
-{
- selection->old_selection = -1;
-
- if (e_selection_model_is_row_selected(selection, row)) {
- e_selection_model_change_cursor(selection, row, col);
- g_signal_emit(selection,
- e_selection_model_signals[CURSOR_CHANGED], 0,
- row, col);
- return FALSE;
- } else {
- e_selection_model_do_something(selection, row, col, state);
- return TRUE;
- }
-}
-
-void
-e_selection_model_right_click_down (ESelectionModel *selection,
- guint row,
- guint col,
- GdkModifierType state)
-{
- if (selection->mode == GTK_SELECTION_SINGLE) {
- selection->old_selection = e_selection_model_cursor_row (selection);
- e_selection_model_select_single_row (selection, row);
- } else {
- e_selection_model_maybe_do_something (selection, row, col, state);
- }
-}
-
-void
-e_selection_model_right_click_up (ESelectionModel *selection)
-{
- if (selection->mode == GTK_SELECTION_SINGLE && selection->old_selection != -1) {
- e_selection_model_select_single_row (selection, selection->old_selection);
- }
-}
-
-void
-e_selection_model_select_as_key_press (ESelectionModel *selection,
- guint row,
- guint col,
- GdkModifierType state)
-{
- int cursor_activated = TRUE;
-
- gint shift_p = state & GDK_SHIFT_MASK;
- gint ctrl_p = state & GDK_CONTROL_MASK;
-
- selection->old_selection = -1;
-
- switch (selection->mode) {
- case GTK_SELECTION_BROWSE:
- case GTK_SELECTION_MULTIPLE:
- if (shift_p) {
- e_selection_model_set_selection_end (selection, row);
- } else if (!ctrl_p) {
- e_selection_model_select_single_row (selection, row);
- } else
- cursor_activated = FALSE;
- break;
- case GTK_SELECTION_SINGLE:
- e_selection_model_select_single_row (selection, row);
- break;
- default:
- g_assert_not_reached ();
- break;
- }
- if (row != -1) {
- e_selection_model_change_cursor(selection, row, col);
- g_signal_emit(selection,
- e_selection_model_signals[CURSOR_CHANGED], 0,
- row, col);
- if (cursor_activated)
- g_signal_emit(selection,
- e_selection_model_signals[CURSOR_ACTIVATED], 0,
- row, col);
- }
-}
-
-static gint
-move_selection (ESelectionModel *selection,
- gboolean up,
- GdkModifierType state)
-{
- int row = e_selection_model_cursor_row(selection);
- int col = e_selection_model_cursor_col(selection);
- int row_count;
-
- row = e_sorter_model_to_sorted(selection->sorter, row);
- if (up)
- row--;
- else
- row++;
- if (row < 0)
- row = 0;
- row_count = e_selection_model_row_count(selection);
- if (row >= row_count)
- row = row_count - 1;
- row = e_sorter_sorted_to_model(selection->sorter, row);
-
- e_selection_model_select_as_key_press (selection, row, col, state);
- return TRUE;
-}
-
-/**
- * e_selection_model_key_press
- * @selection: #ESelectionModel to affect.
- * @key: The event.
- *
- * This routine does whatever is appropriate as if the user pressed
- * the given key.
- *
- * Returns: %TRUE if the #ESelectionModel used the key.
- */
-gint
-e_selection_model_key_press (ESelectionModel *selection,
- GdkEventKey *key)
-{
- selection->old_selection = -1;
-
- switch (key->keyval) {
- case GDK_Up:
- case GDK_KP_Up:
- return move_selection(selection, TRUE, key->state);
- break;
- case GDK_Down:
- case GDK_KP_Down:
- return move_selection(selection, FALSE, key->state);
- break;
- case GDK_space:
- case GDK_KP_Space:
- if (selection->mode != GTK_SELECTION_SINGLE) {
- int row = e_selection_model_cursor_row(selection);
- int col = e_selection_model_cursor_col(selection);
- e_selection_model_toggle_single_row (selection, row);
- g_signal_emit(selection,
- e_selection_model_signals[CURSOR_ACTIVATED], 0,
- row, col);
- return TRUE;
- }
- break;
- case GDK_Return:
- case GDK_KP_Enter:
- if (selection->mode != GTK_SELECTION_SINGLE) {
- int row = e_selection_model_cursor_row(selection);
- int col = e_selection_model_cursor_col(selection);
- e_selection_model_select_single_row (selection, row);
- g_signal_emit(selection,
- e_selection_model_signals[CURSOR_ACTIVATED], 0,
- row, col);
- return TRUE;
- }
- break;
- case GDK_Home:
- case GDK_KP_Home:
- if (selection->cursor_mode == E_CURSOR_LINE) {
- int row = 0;
- int cursor_col = e_selection_model_cursor_col(selection);
-
- row = e_sorter_sorted_to_model(selection->sorter, row);
- e_selection_model_select_as_key_press (selection, row, cursor_col, key->state);
- return TRUE;
- }
- break;
- case GDK_End:
- case GDK_KP_End:
- if (selection->cursor_mode == E_CURSOR_LINE) {
- int row = e_selection_model_row_count(selection) - 1;
- int cursor_col = e_selection_model_cursor_col(selection);
-
- row = e_sorter_sorted_to_model(selection->sorter, row);
- e_selection_model_select_as_key_press (selection, row, cursor_col, key->state);
- return TRUE;
- }
- break;
- }
- return FALSE;
-}
-
-void
-e_selection_model_cursor_changed (ESelectionModel *selection,
- int row,
- int col)
-{
- g_signal_emit(selection,
- e_selection_model_signals[CURSOR_CHANGED], 0,
- row, col);
-}
-
-void
-e_selection_model_cursor_activated (ESelectionModel *selection,
- int row,
- int col)
-{
- g_signal_emit(selection,
- e_selection_model_signals[CURSOR_ACTIVATED], 0,
- row, col);
-}
-
-void
-e_selection_model_selection_changed (ESelectionModel *selection)
-{
- g_signal_emit(selection,
- e_selection_model_signals[SELECTION_CHANGED], 0);
-}
-
-void
-e_selection_model_selection_row_changed (ESelectionModel *selection,
- int row)
-{
- g_signal_emit(selection,
- e_selection_model_signals[SELECTION_ROW_CHANGED], 0,
- row);
-}
diff --git a/widgets/misc/e-selection-model.h b/widgets/misc/e-selection-model.h
deleted file mode 100644
index a78bdfd9c3..0000000000
--- a/widgets/misc/e-selection-model.h
+++ /dev/null
@@ -1,170 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-selection-model.h
- * Copyright 2000, 2001, Ximian, Inc.
- *
- * Authors:
- * Chris Lahey <clahey@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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.
- */
-
-#ifndef _E_SELECTION_MODEL_H_
-#define _E_SELECTION_MODEL_H_
-
-#include <gtk/gtkobject.h>
-#include <gal/util/e-sorter.h>
-#include <gdk/gdkevents.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
-
-#define E_SELECTION_MODEL_TYPE (e_selection_model_get_type ())
-#define E_SELECTION_MODEL(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), E_SELECTION_MODEL_TYPE, ESelectionModel))
-#define E_SELECTION_MODEL_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), E_SELECTION_MODEL_TYPE, ESelectionModelClass))
-#define E_IS_SELECTION_MODEL(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), E_SELECTION_MODEL_TYPE))
-#define E_IS_SELECTION_MODEL_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), E_SELECTION_MODEL_TYPE))
-#define E_SELECTION_MODEL_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), E_SELECTION_MODEL_TYPE, ESelectionModelClass))
-
-#ifndef _E_FOREACH_FUNC_H_
-#define _E_FOREACH_FUNC_H_
-typedef void (*EForeachFunc) (int model_row,
- gpointer closure);
-#endif
-
-/* list selection modes */
-typedef enum {
- E_CURSOR_LINE,
- E_CURSOR_SIMPLE,
- E_CURSOR_SPREADSHEET
-} ECursorMode;
-
-typedef struct {
- GObject base;
-
- ESorter *sorter;
-
- GtkSelectionMode mode;
- ECursorMode cursor_mode;
-
- int old_selection;
-} ESelectionModel;
-
-typedef struct {
- GObjectClass parent_class;
-
- /* Virtual methods */
- gboolean (*is_row_selected) (ESelectionModel *esm, int row);
- void (*foreach) (ESelectionModel *esm, EForeachFunc callback, gpointer closure);
- void (*clear) (ESelectionModel *esm);
- gint (*selected_count) (ESelectionModel *esm);
- void (*select_all) (ESelectionModel *esm);
- void (*invert_selection) (ESelectionModel *esm);
- int (*row_count) (ESelectionModel *esm);
-
- /* Protected virtual methods. */
- void (*change_one_row) (ESelectionModel *esm, int row, gboolean on);
- void (*change_cursor) (ESelectionModel *esm, int row, int col);
- int (*cursor_row) (ESelectionModel *esm);
- int (*cursor_col) (ESelectionModel *esm);
-
- void (*select_single_row) (ESelectionModel *selection, int row);
- void (*toggle_single_row) (ESelectionModel *selection, int row);
- void (*move_selection_end) (ESelectionModel *selection, int row);
- void (*set_selection_end) (ESelectionModel *selection, int row);
-
- /*
- * Signals
- */
-
- void (*cursor_changed) (ESelectionModel *esm, int row, int col);
- void (*cursor_activated) (ESelectionModel *esm, int row, int col);
- void (*selection_row_changed) (ESelectionModel *esm, int row);
- void (*selection_changed) (ESelectionModel *esm);
-
-} ESelectionModelClass;
-
-
-GType e_selection_model_get_type (void);
-void e_selection_model_do_something (ESelectionModel *esm,
- guint row,
- guint col,
- GdkModifierType state);
-gboolean e_selection_model_maybe_do_something (ESelectionModel *esm,
- guint row,
- guint col,
- GdkModifierType state);
-void e_selection_model_right_click_down (ESelectionModel *selection,
- guint row,
- guint col,
- GdkModifierType state);
-void e_selection_model_right_click_up (ESelectionModel *selection);
-gint e_selection_model_key_press (ESelectionModel *esm,
- GdkEventKey *key);
-void e_selection_model_select_as_key_press (ESelectionModel *esm,
- guint row,
- guint col,
- GdkModifierType state);
-
-/* Virtual functions */
-gboolean e_selection_model_is_row_selected (ESelectionModel *esm,
- gint n);
-void e_selection_model_foreach (ESelectionModel *esm,
- EForeachFunc callback,
- gpointer closure);
-void e_selection_model_clear (ESelectionModel *esm);
-gint e_selection_model_selected_count (ESelectionModel *esm);
-void e_selection_model_select_all (ESelectionModel *esm);
-void e_selection_model_invert_selection (ESelectionModel *esm);
-int e_selection_model_row_count (ESelectionModel *esm);
-
-
-/* Private virtual Functions */
-void e_selection_model_change_one_row (ESelectionModel *esm,
- int row,
- gboolean on);
-void e_selection_model_change_cursor (ESelectionModel *esm,
- int row,
- int col);
-int e_selection_model_cursor_row (ESelectionModel *esm);
-int e_selection_model_cursor_col (ESelectionModel *esm);
-void e_selection_model_select_single_row (ESelectionModel *selection,
- int row);
-void e_selection_model_toggle_single_row (ESelectionModel *selection,
- int row);
-void e_selection_model_move_selection_end (ESelectionModel *selection,
- int row);
-void e_selection_model_set_selection_end (ESelectionModel *selection,
- int row);
-
-/* Signals */
-void e_selection_model_cursor_changed (ESelectionModel *selection,
- int row,
- int col);
-void e_selection_model_cursor_activated (ESelectionModel *selection,
- int row,
- int col);
-void e_selection_model_selection_row_changed (ESelectionModel *selection,
- int row);
-void e_selection_model_selection_changed (ESelectionModel *selection);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-
-#endif /* _E_SELECTION_MODEL_H_ */
-
diff --git a/widgets/misc/e-title-bar.h b/widgets/misc/e-title-bar.h
index 32c4f2b262..07b99213e4 100644
--- a/widgets/misc/e-title-bar.h
+++ b/widgets/misc/e-title-bar.h
@@ -23,10 +23,6 @@
#ifndef __E_TITLE_BAR_H__
#define __E_TITLE_BAR_H__
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
#include <gtk/gtkframe.h>
#ifdef __cplusplus
@@ -35,10 +31,10 @@ extern "C" {
#endif /* __cplusplus */
#define E_TYPE_TITLE_BAR (e_title_bar_get_type ())
-#define E_TITLE_BAR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), E_TYPE_TITLE_BAR, ETitleBar))
-#define E_TITLE_BAR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), E_TYPE_TITLE_BAR, ETitleBarClass))
-#define E_IS_TITLE_BAR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), E_TYPE_TITLE_BAR))
-#define E_IS_TITLE_BAR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), E_TYPE_TITLE_BAR))
+#define E_TITLE_BAR(obj) (GTK_CHECK_CAST ((obj), E_TYPE_TITLE_BAR, ETitleBar))
+#define E_TITLE_BAR_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), E_TYPE_TITLE_BAR, ETitleBarClass))
+#define E_IS_TITLE_BAR(obj) (GTK_CHECK_TYPE ((obj), E_TYPE_TITLE_BAR))
+#define E_IS_TITLE_BAR_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((obj), E_TYPE_TITLE_BAR))
enum _ETitleBarButtonMode {
diff --git a/widgets/misc/e-unicode.c b/widgets/misc/e-unicode.c
deleted file mode 100644
index fb81db1798..0000000000
--- a/widgets/misc/e-unicode.c
+++ /dev/null
@@ -1,2272 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-unicode.c - utf-8 support functions for gal
- * Copyright 2000, 2001, Ximian, Inc.
- *
- * Authors:
- * Lauris Kaplinski <lauris@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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.
- */
-
-/*
- * TODO: Break simple ligatures in e_utf8_strstrcasedecomp
- */
-
-#include <config.h>
-
-#include "e-unicode.h"
-
-#include "gal/util/e-i18n.h"
-#include <ctype.h>
-#include <string.h>
-#include <stdio.h>
-#include <iconv.h>
-#include <gdk/gdk.h>
-#include <gdk/gdkx.h>
-#include <gdk/gdkkeysyms.h>
-#include <gtk/gtkmenuitem.h>
-#include "e-font.h"
-#include <libxml/xmlmemory.h>
-#include <stdlib.h>
-#include "gal/util/e-iconv.h"
-
-#ifdef HAVE_ALLOCA_H
-#include <alloca.h>
-#endif
-
-#define d(x) x
-
-#define FONT_TESTING
-#define MAX_DECOMP 8
-
-static gint e_canonical_decomposition (gunichar ch, gunichar * buf);
-static gunichar e_stripped_char (gunichar ch);
-
-#ifndef NO_WARNINGS
-#warning FIXME: this has not been ported fully yet - non ASCII people beware.
-#endif
-
-/*
- * This my favourite
- *
- * strstr doing case insensitive, decomposing search
- *
- * Lauris
- */
-
-const gchar *
-e_utf8_strstrcasedecomp (const gchar *haystack, const gchar *needle)
-{
- gunichar *nuni;
- gunichar unival;
- gint nlen;
- const guchar *o, *p;
-
- if (haystack == NULL) return NULL;
- if (needle == NULL) return NULL;
- if (strlen (needle) == 0) return haystack;
- if (strlen (haystack) == 0) return NULL;
-
- nuni = alloca (sizeof (gunichar) * strlen (needle));
-
- nlen = 0;
- for (p = e_unicode_get_utf8 (needle, &unival); p && unival; p = e_unicode_get_utf8 (p, &unival)) {
- gint sc;
- sc = e_stripped_char (unival);
- if (sc) {
- nuni[nlen++] = sc;
- }
- }
- /* NULL means there was illegal utf-8 sequence */
- if (!p) return NULL;
- /* If everything is correct, we have decomposed, lowercase, stripped needle */
- if (nlen < 1) return haystack;
-
- o = haystack;
- for (p = e_unicode_get_utf8 (o, &unival); p && unival; p = e_unicode_get_utf8 (p, &unival)) {
- gint sc;
- sc = e_stripped_char (unival);
- if (sc) {
- /* We have valid stripped char */
- if (sc == nuni[0]) {
- const gchar *q = p;
- gint npos = 1;
- while (npos < nlen) {
- q = e_unicode_get_utf8 (q, &unival);
- if (!q || !unival) return NULL;
- sc = e_stripped_char (unival);
- if ((!sc) || (sc != nuni[npos])) break;
- npos++;
- }
- if (npos == nlen) {
- return o;
- }
- }
- }
- o = p;
- }
-
- return NULL;
-}
-
-const gchar *
-e_utf8_strstrcase (const gchar *haystack, const gchar *needle)
-{
- gunichar *nuni;
- gunichar unival;
- gint nlen;
- const guchar *o, *p;
-
- if (haystack == NULL) return NULL;
- if (needle == NULL) return NULL;
- if (strlen (needle) == 0) return haystack;
- if (strlen (haystack) == 0) return NULL;
-
- nuni = alloca (sizeof (gunichar) * strlen (needle));
-
- nlen = 0;
- for (p = e_unicode_get_utf8 (needle, &unival); p && unival; p = e_unicode_get_utf8 (p, &unival)) {
- nuni[nlen++] = g_unichar_tolower (unival);
- }
- /* NULL means there was illegal utf-8 sequence */
- if (!p) return NULL;
-
- o = haystack;
- for (p = e_unicode_get_utf8 (o, &unival); p && unival; p = e_unicode_get_utf8 (p, &unival)) {
- gint sc;
- sc = g_unichar_tolower (unival);
- /* We have valid stripped char */
- if (sc == nuni[0]) {
- const gchar *q = p;
- gint npos = 1;
- while (npos < nlen) {
- q = e_unicode_get_utf8 (q, &unival);
- if (!q || !unival) return NULL;
- sc = g_unichar_tolower (unival);
- if (sc != nuni[npos]) break;
- npos++;
- }
- if (npos == nlen) {
- return o;
- }
- }
- o = p;
- }
-
- return NULL;
-}
-
-#if 0
-const gchar *
-e_utf8_strstrcase (const gchar *haystack, const gchar *needle)
-{
- gchar *p;
- gunichar *huni, *nuni;
- gunichar unival;
- gint hlen, nlen, hp, np;
-
- if (haystack == NULL) return NULL;
- if (needle == NULL) return NULL;
- if (strlen (needle) == 0) return haystack;
-
- huni = alloca (sizeof (gunichar) * strlen (haystack));
-
- for (hlen = 0, p = e_unicode_get_utf8 (haystack, &unival); p && unival; hlen++, p = e_unicode_get_utf8 (p, &unival)) {
- huni[hlen] = g_unichar_tolower (unival);
- }
-
- if (!p) return NULL;
- if (hlen == 0) return NULL;
-
- nuni = alloca (sizeof (gunichar) * strlen (needle));
-
- for (nlen = 0, p = e_unicode_get_utf8 (needle, &unival); p && unival; nlen++, p = e_unicode_get_utf8 (p, &unival)) {
- nuni[nlen] = g_unichar_tolower (unival);
- }
-
- if (!p) return NULL;
- if (nlen == 0) return NULL;
-
- if (hlen < nlen) return NULL;
-
- for (hp = 0; hp <= hlen - nlen; hp++) {
- for (np = 0; np < nlen; np++) {
- if (huni[hp + np] != nuni[np]) break;
- }
- if (np == nlen) return haystack + unicode_offset_to_index (haystack, hp);
- }
-
- return NULL;
-}
-#endif
-
-gchar *
-e_utf8_from_gtk_event_key (GtkWidget *widget, guint keyval, const gchar *string)
-{
- gint unival;
- gchar *utf;
- gint unilen;
-
- if (keyval == GDK_VoidSymbol) {
- utf = e_utf8_from_locale_string (string);
- } else {
- unival = gdk_keyval_to_unicode (keyval);
-
- if (unival < ' ') return NULL;
-
- utf = g_new (gchar, 7);
-
- unilen = e_unichar_to_utf8 (unival, utf);
-
- utf[unilen] = '\0';
- }
-
- return utf;
-}
-
-gchar *
-e_utf8_from_iconv_string_sized (iconv_t ic, const gchar *string, gint bytes)
-{
- char *new, *ob;
- const char *ib;
- size_t ibl, obl;
-
- if (!string) return NULL;
-
- if (ic == (iconv_t) -1) {
- gint i;
- /* iso-8859-1 */
- ib = (char *) string;
- new = ob = g_new (unsigned char, bytes * 2 + 1);
- for (i = 0; i < (bytes); i ++) {
- ob += e_unichar_to_utf8 (ib[i], ob);
- }
- *ob = '\0';
- return new;
- }
-
- ib = string;
- ibl = bytes;
- new = ob = g_new (gchar, ibl * 6 + 1);
- obl = ibl * 6;
-
- while (ibl > 0) {
- e_iconv (ic, &ib, &ibl, &ob, &obl);
- if (ibl > 0) {
- gint len;
- if ((*ib & 0x80) == 0x00) len = 1;
- else if ((*ib &0xe0) == 0xc0) len = 2;
- else if ((*ib &0xf0) == 0xe0) len = 3;
- else if ((*ib &0xf8) == 0xf0) len = 4;
- else {
- g_warning ("Invalid UTF-8 sequence");
- break;
- }
- ib += len;
- ibl = bytes - (ib - string);
- if (ibl > bytes) ibl = 0;
- *ob++ = '_';
- obl--;
- }
- }
-
- *ob = '\0';
-
- return new;
-}
-
-gchar *
-e_utf8_from_iconv_string (iconv_t ic, const gchar *string)
-{
- if (!string) return NULL;
- return e_utf8_from_iconv_string_sized (ic, string, strlen (string));
-}
-
-gchar *
-e_utf8_to_iconv_string_sized (iconv_t ic, const gchar *string, gint bytes)
-{
- char *new, *ob;
- const char *ib;
- size_t ibl, obl;
-
- if (!string) return NULL;
-
- if (ic == (iconv_t) -1) {
- gint len;
- const gchar *u;
- gunichar uc;
-
- new = g_new (unsigned char, bytes * 4 + 1);
- u = string;
- len = 0;
-
- while ((u) && (u - string < bytes)) {
- u = e_unicode_get_utf8 (u, &uc);
- new[len++] = uc & 0xff;
- }
- new[len] = '\0';
- return new;
- }
-
- ib = string;
- ibl = bytes;
- new = ob = g_new (char, ibl * 4 + 4);
- obl = ibl * 4;
-
- while (ibl > 0) {
- e_iconv (ic, &ib, &ibl, &ob, &obl);
- if (ibl > 0) {
- gint len;
- if ((*ib & 0x80) == 0x00) len = 1;
- else if ((*ib &0xe0) == 0xc0) len = 2;
- else if ((*ib &0xf0) == 0xe0) len = 3;
- else if ((*ib &0xf8) == 0xf0) len = 4;
- else {
- g_warning ("Invalid UTF-8 sequence");
- break;
- }
- ib += len;
- ibl = bytes - (ib - string);
- if (ibl > bytes) ibl = 0;
-
- /* FIXME: this is wrong... what if the destination charset is 16 or 32 bit? */
- *ob++ = '_';
- obl--;
- }
- }
-
- /* Make sure to terminate with plenty of padding */
- memset (ob, 0, 4);
-
- return new;
-}
-
-gchar *
-e_utf8_to_iconv_string (iconv_t ic, const gchar *string)
-{
- if (!string) return NULL;
- return e_utf8_to_iconv_string_sized (ic, string, strlen (string));
-}
-
-gchar *
-e_utf8_from_charset_string_sized (const gchar *charset, const gchar *string, gint bytes)
-{
- iconv_t ic;
- char *ret;
-
- if (!string) return NULL;
-
- ic = e_iconv_open("utf-8", charset);
- ret = e_utf8_from_iconv_string_sized (ic, string, bytes);
- e_iconv_close(ic);
-
- return ret;
-}
-
-gchar *
-e_utf8_from_charset_string (const gchar *charset, const gchar *string)
-{
- if (!string) return NULL;
- return e_utf8_from_charset_string_sized (charset, string, strlen (string));
-}
-
-gchar *
-e_utf8_to_charset_string_sized (const gchar *charset, const gchar *string, gint bytes)
-{
- iconv_t ic;
- char *ret;
-
- if (!string) return NULL;
-
- ic = e_iconv_open(charset, "utf-8");
- ret = e_utf8_to_iconv_string_sized (ic, string, bytes);
- e_iconv_close(ic);
-
- return ret;
-}
-
-gchar *
-e_utf8_to_charset_string (const gchar *charset, const gchar *string)
-{
- if (!string) return NULL;
- return e_utf8_to_charset_string_sized (charset, string, strlen (string));
-}
-
-gchar *
-e_utf8_from_gtk_string_sized (GtkWidget *widget, const gchar *string, gint bytes)
-{
- iconv_t ic;
- char *new, *ob;
- const char *ib;
- size_t ibl, obl;
-
- g_return_val_if_fail (widget != NULL, NULL);
- g_return_val_if_fail (GTK_IS_WIDGET (widget), NULL);
-
- if (!string) return NULL;
-
- g_return_val_if_fail (widget, NULL);
-
- ic = e_iconv_from_gdk_font (gtk_style_get_font (widget->style));
- if (ic == (iconv_t) -1) {
- XFontStruct *xfs;
- /* If iconv is missing we assume either iso-10646 or iso-8859-1 */
- xfs = GDK_FONT_XFONT (gtk_style_get_font (widget->style));
- if (gtk_style_get_font (widget->style)->type == GDK_FONT_FONTSET || ((xfs->min_byte1 != 0) || (xfs->max_byte1 != 0))) {
- gint i;
- const guchar *ib;
- guchar * ob, * new;
- /* iso-10646 */
- ib = string;
- new = ob = g_new (unsigned char, bytes * 6 + 1);
- for (i = 0; i < (bytes - 1); i += 2) {
- ob += e_unichar_to_utf8 (ib[i] * 256 + ib[i + 1], ob);
- }
- *ob = '\0';
- return new;
- } else {
- gint i;
- /* iso-8859-1 */
- ib = (char *) string;
- new = ob = g_new (unsigned char, bytes * 2 + 1);
- for (i = 0; i < (bytes); i ++) {
- ob += e_unichar_to_utf8 (ib[i], ob);
- }
- *ob = '\0';
- return new;
- }
- }
-
- ib = string;
- ibl = bytes;
- new = ob = g_new (gchar, ibl * 6 + 1);
- obl = ibl * 6;
-
- while (ibl > 0) {
- e_iconv (ic, &ib, &ibl, &ob, &obl);
- if (ibl > 0) {
- gint len;
- if ((*ib & 0x80) == 0x00) len = 1;
- else if ((*ib &0xe0) == 0xc0) len = 2;
- else if ((*ib &0xf0) == 0xe0) len = 3;
- else if ((*ib &0xf8) == 0xf0) len = 4;
- else {
- g_warning ("Invalid UTF-8 sequence");
- break;
- }
- ib += len;
- ibl = bytes - (ib - string);
- if (ibl > bytes) ibl = 0;
- *ob++ = '_';
- obl--;
- }
- }
-
- *ob = '\0';
-
- e_iconv_close(ic);
-
- return new;
-}
-
-gchar *
-e_utf8_from_gtk_string (GtkWidget *widget, const gchar *string)
-{
- if (!string) return NULL;
- return e_utf8_from_gtk_string_sized (widget, string, strlen (string));
-}
-
-gchar *
-e_utf8_to_gtk_string_sized (GtkWidget *widget, const gchar *string, gint bytes)
-{
- iconv_t ic;
- char *new, *ob;
- const char *ib;
- size_t ibl, obl;
-
- if (!string) return NULL;
-
- g_return_val_if_fail (widget, NULL);
-
- gtk_widget_ensure_style (widget);
- ic = e_iconv_to_gdk_font (gtk_style_get_font (widget->style));
- if (ic == (iconv_t) -1) {
- XFontStruct *xfs;
- gboolean twobyte;
- gint len;
- const gchar *u;
- gunichar uc;
- /* If iconv is missing we assume either iso-10646 or iso-8859-1 */
- xfs = GDK_FONT_XFONT (gtk_style_get_font (widget->style));
- twobyte = (gtk_style_get_font (widget->style)->type == GDK_FONT_FONTSET || ((xfs->min_byte1 != 0) || (xfs->max_byte1 != 0)));
-
- new = g_new (unsigned char, bytes * 4 + 2);
- u = string;
- len = 0;
-
- while ((u) && (u - string < bytes)) {
- u = e_unicode_get_utf8 (u, &uc);
- if (twobyte) {
- new[len++] = (uc & 0xff00) >> 8;
- }
- new[len++] = uc & 0xff;
- }
-
- new[len++] = '\0';
- if (twobyte)
- new[len] = '\0';
-
- return new;
- }
-
- ib = string;
- ibl = bytes;
- new = ob = g_new (gchar, ibl * 4 + 4);
- obl = ibl * 4;
-
- while (ibl > 0) {
- e_iconv (ic, &ib, &ibl, &ob, &obl);
- if (ibl > 0) {
- gint len;
- if ((*ib & 0x80) == 0x00) len = 1;
- else if ((*ib &0xe0) == 0xc0) len = 2;
- else if ((*ib &0xf0) == 0xe0) len = 3;
- else if ((*ib &0xf8) == 0xf0) len = 4;
- else {
- g_warning ("Invalid UTF-8 sequence");
- break;
- }
- ib += len;
- ibl = bytes - (ib - string);
- if (ibl > bytes) ibl = 0;
- *ob++ = '_';
- obl--;
- }
- }
-
- /* Make sure to terminate with plenty of padding */
- memset (ob, 0, 4);
-
- e_iconv_close(ic);
-
- return new;
-}
-
-gchar *
-e_utf8_to_gtk_string (GtkWidget *widget, const gchar *string)
-{
- if (!string) return NULL;
- return e_utf8_to_gtk_string_sized (widget, string, strlen (string));
-}
-
-gchar *
-e_utf8_from_locale_string_sized (const gchar *string, gint bytes)
-{
- iconv_t ic;
- char *ret;
-
- if (!string) return NULL;
-
- ic = e_iconv_open("utf-8", e_iconv_locale_charset());
- ret = e_utf8_from_iconv_string_sized (ic, string, bytes);
- e_iconv_close(ic);
-
- return ret;
-}
-
-gchar *
-e_utf8_from_locale_string (const gchar *string)
-{
- if (!string) return NULL;
- return e_utf8_from_locale_string_sized (string, strlen (string));
-}
-
-gchar *
-e_utf8_to_locale_string_sized (const gchar *string, gint bytes)
-{
- iconv_t ic;
- char *ret;
-
- if (!string) return NULL;
-
- ic = e_iconv_open(e_iconv_locale_charset(), "utf-8");
- ret = e_utf8_to_iconv_string_sized (ic, string, bytes);
- e_iconv_close(ic);
-
- return ret;
-}
-
-gchar *
-e_utf8_to_locale_string (const gchar *string)
-{
- if (!string) return NULL;
- return e_utf8_to_locale_string_sized (string, strlen (string));
-}
-
-gboolean
-e_utf8_is_ascii (const gchar *string)
-{
- char c;
-
- g_return_val_if_fail (string != NULL, FALSE);
-
- for (; (c = *string); string++) {
- if (c & 0x80)
- return FALSE;
- }
-
- return TRUE;
-}
-
-gchar *
-e_utf8_gtk_entry_get_text (GtkEntry *entry)
-{
- return g_strdup (gtk_entry_get_text (entry));
-}
-
-gchar *
-e_utf8_gtk_editable_get_text (GtkEditable *editable)
-{
- return gtk_editable_get_chars (editable, 0, -1);
-}
-
-gchar *
-e_utf8_gtk_editable_get_chars (GtkEditable *editable, gint start, gint end)
-{
- return gtk_editable_get_chars (editable, start, end);
-}
-
-void
-e_utf8_gtk_editable_insert_text (GtkEditable *editable, const gchar *text, gint length, gint *position)
-{
- gtk_editable_insert_text (editable, text, length, position);
-}
-
-void
-e_utf8_gtk_editable_set_text (GtkEditable *editable, const gchar *text)
-{
- int position;
-
- gtk_editable_delete_text(editable, 0, -1);
- gtk_editable_insert_text (editable, text, strlen (text), &position);
-}
-
-void
-e_utf8_gtk_entry_set_text (GtkEntry *entry, const gchar *text)
-{
- if (!text)
- gtk_entry_set_text(entry, "");
- else
- gtk_entry_set_text (entry, text);
-}
-
-GtkWidget *
-e_utf8_gtk_menu_item_new_with_label (GtkMenu *menu, const gchar *label)
-{
- GtkWidget *w;
- gchar *s;
-
- if (!label) return NULL;
-
- s = e_utf8_to_gtk_string ((GtkWidget *) menu, label);
- w = gtk_menu_item_new_with_label (s);
-
- g_free (s);
-
- return w;
-}
-
-void
-e_utf8_gtk_clist_set_text (GtkCList *clist, gint row, gint col, const gchar *text)
-{
- gchar *s;
-
- if (!text) return;
-
- s = e_utf8_to_gtk_string ((GtkWidget *) clist, text);
- gtk_clist_set_text (clist, row, col, s);
-
- if (s) g_free (s);
-}
-
-gint
-e_utf8_gtk_clist_append (GtkCList *clist, gchar *text[])
-{
- gint row, i;
- gchar **v;
-
- if (!text) return 0;
-
- v = g_new (gchar *, clist->columns);
- for (i = 0; i < clist->columns; i++)
- v[i] = e_utf8_to_gtk_string ((GtkWidget *) clist, text[i]);
-
- row = gtk_clist_append (clist, v);
-
- for (i = 0; i < clist->columns; i++)
- if (v[i]) g_free (v[i]);
-
- return row;
-}
-
-/*
- * Translate \U+XXXX\ sequences to utf8 chars
- */
-
-gchar *
-e_utf8_xml1_decode (const gchar *text)
-{
- const guchar *c;
- guchar *u, *d;
- int len, s;
-
- g_return_val_if_fail (text != NULL, NULL);
-
- len = strlen (text)+1;
- /* len * 2 is absolute maximum */
- u = d = g_malloc (len * 2);
-
- c = text;
- s = 0;
- while (s < len) {
- if ((s <= (len - 8)) &&
- (c[s ] == '\\') &&
- (c[s + 1] == 'U' ) &&
- (c[s + 2] == '+' ) &&
- isxdigit (c[s + 3]) &&
- isxdigit (c[s + 4]) &&
- isxdigit (c[s + 5]) &&
- isxdigit (c[s + 6]) &&
- (c[s + 7] == '\\')) {
- /* Valid \U+XXXX\ sequence */
- unsigned int unival;
- unival = strtol (c + s + 3, NULL, 16);
- d += e_unichar_to_utf8 (unival, d);
- s += 8;
- } else if (c[s] > 127) {
- /* fixme: We assume iso-8859-1 currently */
- d += e_unichar_to_utf8 (c[s], d);
- s += 1;
- } else {
- *d++ = c[s++];
- }
- }
- *d++ = '\0';
- u = g_realloc (u, (d - u));
-
- return u;
-}
-
-gchar *
-e_utf8_xml1_encode (const gchar *text)
-{
- guchar *u, *d, *c;
- int unival;
- int len;
-
- g_return_val_if_fail (text != NULL, NULL);
-
- len = 0;
- for (u = e_unicode_get_utf8 (text, &unival); u && unival; u = e_unicode_get_utf8 (u, &unival)) {
- if ((unival >= 0x80) || (unival == '\\')) {
- len += 8;
- } else {
- len += 1;
- }
- }
- d = c = g_new (guchar, len + 1);
-
- for (u = e_unicode_get_utf8 (text, &unival); u && unival; u = e_unicode_get_utf8 (u, &unival)) {
- if ((unival >= 0x80) || (unival == '\\')) {
- *c++ = '\\';
- *c++ = 'U';
- *c++ = '+';
- c += sprintf (c, "%04x", unival);
- *c++ = '\\';
- } else {
- *c++ = unival;
- }
- }
- *c = '\0';
-
- return d;
-}
-
-/**
- * e_unichar_to_utf8:
- * @c: a ISO10646 character code
- * @outbuf: output buffer, must have at least 6 bytes of space.
- * If %NULL, the length will be computed and returned
- * and nothing will be written to @out.
- *
- * Convert a single character to utf8
- *
- * Return value: number of bytes written
- **/
-
-gint
-e_unichar_to_utf8 (gint c, gchar *outbuf)
-{
- size_t len = 0;
- int first;
- int i;
-
- if (c < 0x80)
- {
- first = 0;
- len = 1;
- }
- else if (c < 0x800)
- {
- first = 0xc0;
- len = 2;
- }
- else if (c < 0x10000)
- {
- first = 0xe0;
- len = 3;
- }
- else if (c < 0x200000)
- {
- first = 0xf0;
- len = 4;
- }
- else if (c < 0x4000000)
- {
- first = 0xf8;
- len = 5;
- }
- else
- {
- first = 0xfc;
- len = 6;
- }
-
- if (outbuf)
- {
- for (i = len - 1; i > 0; --i)
- {
- outbuf[i] = (c & 0x3f) | 0x80;
- c >>= 6;
- }
- outbuf[0] = c | first;
- }
-
- return len;
-}
-
-gchar *
-e_unicode_get_utf8 (const gchar *text, gunichar *out)
-{
- *out = g_utf8_get_char (text);
- return (*out == (gunichar)-1) ? NULL : g_utf8_next_char (text);
-}
-
-/*
- * Canonical decomposition
- *
- * It is copied here from libunicode, because we do not want malloc
- *
- */
-
-typedef struct
-{
- unsigned short ch;
- unsigned char *expansion;
-} e_decomposition;
-
-static e_decomposition e_decomp_table[] =
-{
- { 0x00c0, "\x00\x41\x03\x00\0" },
- { 0x00c1, "\x00\x41\x03\x01\0" },
- { 0x00c2, "\x00\x41\x03\x02\0" },
- { 0x00c3, "\x00\x41\x03\x03\0" },
- { 0x00c4, "\x00\x41\x03\x08\0" },
- { 0x00c5, "\x00\x41\x03\x0a\0" },
- { 0x00c7, "\x00\x43\x03\x27\0" },
- { 0x00c8, "\x00\x45\x03\x00\0" },
- { 0x00c9, "\x00\x45\x03\x01\0" },
- { 0x00ca, "\x00\x45\x03\x02\0" },
- { 0x00cb, "\x00\x45\x03\x08\0" },
- { 0x00cc, "\x00\x49\x03\x00\0" },
- { 0x00cd, "\x00\x49\x03\x01\0" },
- { 0x00ce, "\x00\x49\x03\x02\0" },
- { 0x00cf, "\x00\x49\x03\x08\0" },
- { 0x00d1, "\x00\x4e\x03\x03\0" },
- { 0x00d2, "\x00\x4f\x03\x00\0" },
- { 0x00d3, "\x00\x4f\x03\x01\0" },
- { 0x00d4, "\x00\x4f\x03\x02\0" },
- { 0x00d5, "\x00\x4f\x03\x03\0" },
- { 0x00d6, "\x00\x4f\x03\x08\0" },
- { 0x00d9, "\x00\x55\x03\x00\0" },
- { 0x00da, "\x00\x55\x03\x01\0" },
- { 0x00db, "\x00\x55\x03\x02\0" },
- { 0x00dc, "\x00\x55\x03\x08\0" },
- { 0x00dd, "\x00\x59\x03\x01\0" },
- { 0x00e0, "\x00\x61\x03\x00\0" },
- { 0x00e1, "\x00\x61\x03\x01\0" },
- { 0x00e2, "\x00\x61\x03\x02\0" },
- { 0x00e3, "\x00\x61\x03\x03\0" },
- { 0x00e4, "\x00\x61\x03\x08\0" },
- { 0x00e5, "\x00\x61\x03\x0a\0" },
- { 0x00e7, "\x00\x63\x03\x27\0" },
- { 0x00e8, "\x00\x65\x03\x00\0" },
- { 0x00e9, "\x00\x65\x03\x01\0" },
- { 0x00ea, "\x00\x65\x03\x02\0" },
- { 0x00eb, "\x00\x65\x03\x08\0" },
- { 0x00ec, "\x00\x69\x03\x00\0" },
- { 0x00ed, "\x00\x69\x03\x01\0" },
- { 0x00ee, "\x00\x69\x03\x02\0" },
- { 0x00ef, "\x00\x69\x03\x08\0" },
- { 0x00f1, "\x00\x6e\x03\x03\0" },
- { 0x00f2, "\x00\x6f\x03\x00\0" },
- { 0x00f3, "\x00\x6f\x03\x01\0" },
- { 0x00f4, "\x00\x6f\x03\x02\0" },
- { 0x00f5, "\x00\x6f\x03\x03\0" },
- { 0x00f6, "\x00\x6f\x03\x08\0" },
- { 0x00f9, "\x00\x75\x03\x00\0" },
- { 0x00fa, "\x00\x75\x03\x01\0" },
- { 0x00fb, "\x00\x75\x03\x02\0" },
- { 0x00fc, "\x00\x75\x03\x08\0" },
- { 0x00fd, "\x00\x79\x03\x01\0" },
- { 0x00ff, "\x00\x79\x03\x08\0" },
- { 0x0100, "\x00\x41\x03\x04\0" },
- { 0x0101, "\x00\x61\x03\x04\0" },
- { 0x0102, "\x00\x41\x03\x06\0" },
- { 0x0103, "\x00\x61\x03\x06\0" },
- { 0x0104, "\x00\x41\x03\x28\0" },
- { 0x0105, "\x00\x61\x03\x28\0" },
- { 0x0106, "\x00\x43\x03\x01\0" },
- { 0x0107, "\x00\x63\x03\x01\0" },
- { 0x0108, "\x00\x43\x03\x02\0" },
- { 0x0109, "\x00\x63\x03\x02\0" },
- { 0x010a, "\x00\x43\x03\x07\0" },
- { 0x010b, "\x00\x63\x03\x07\0" },
- { 0x010c, "\x00\x43\x03\x0c\0" },
- { 0x010d, "\x00\x63\x03\x0c\0" },
- { 0x010e, "\x00\x44\x03\x0c\0" },
- { 0x010f, "\x00\x64\x03\x0c\0" },
- { 0x0112, "\x00\x45\x03\x04\0" },
- { 0x0113, "\x00\x65\x03\x04\0" },
- { 0x0114, "\x00\x45\x03\x06\0" },
- { 0x0115, "\x00\x65\x03\x06\0" },
- { 0x0116, "\x00\x45\x03\x07\0" },
- { 0x0117, "\x00\x65\x03\x07\0" },
- { 0x0118, "\x00\x45\x03\x28\0" },
- { 0x0119, "\x00\x65\x03\x28\0" },
- { 0x011a, "\x00\x45\x03\x0c\0" },
- { 0x011b, "\x00\x65\x03\x0c\0" },
- { 0x011c, "\x00\x47\x03\x02\0" },
- { 0x011d, "\x00\x67\x03\x02\0" },
- { 0x011e, "\x00\x47\x03\x06\0" },
- { 0x011f, "\x00\x67\x03\x06\0" },
- { 0x0120, "\x00\x47\x03\x07\0" },
- { 0x0121, "\x00\x67\x03\x07\0" },
- { 0x0122, "\x00\x47\x03\x27\0" },
- { 0x0123, "\x00\x67\x03\x27\0" },
- { 0x0124, "\x00\x48\x03\x02\0" },
- { 0x0125, "\x00\x68\x03\x02\0" },
- { 0x0128, "\x00\x49\x03\x03\0" },
- { 0x0129, "\x00\x69\x03\x03\0" },
- { 0x012a, "\x00\x49\x03\x04\0" },
- { 0x012b, "\x00\x69\x03\x04\0" },
- { 0x012c, "\x00\x49\x03\x06\0" },
- { 0x012d, "\x00\x69\x03\x06\0" },
- { 0x012e, "\x00\x49\x03\x28\0" },
- { 0x012f, "\x00\x69\x03\x28\0" },
- { 0x0130, "\x00\x49\x03\x07\0" },
- { 0x0134, "\x00\x4a\x03\x02\0" },
- { 0x0135, "\x00\x6a\x03\x02\0" },
- { 0x0136, "\x00\x4b\x03\x27\0" },
- { 0x0137, "\x00\x6b\x03\x27\0" },
- { 0x0139, "\x00\x4c\x03\x01\0" },
- { 0x013a, "\x00\x6c\x03\x01\0" },
- { 0x013b, "\x00\x4c\x03\x27\0" },
- { 0x013c, "\x00\x6c\x03\x27\0" },
- { 0x013d, "\x00\x4c\x03\x0c\0" },
- { 0x013e, "\x00\x6c\x03\x0c\0" },
- { 0x0143, "\x00\x4e\x03\x01\0" },
- { 0x0144, "\x00\x6e\x03\x01\0" },
- { 0x0145, "\x00\x4e\x03\x27\0" },
- { 0x0146, "\x00\x6e\x03\x27\0" },
- { 0x0147, "\x00\x4e\x03\x0c\0" },
- { 0x0148, "\x00\x6e\x03\x0c\0" },
- { 0x014c, "\x00\x4f\x03\x04\0" },
- { 0x014d, "\x00\x6f\x03\x04\0" },
- { 0x014e, "\x00\x4f\x03\x06\0" },
- { 0x014f, "\x00\x6f\x03\x06\0" },
- { 0x0150, "\x00\x4f\x03\x0b\0" },
- { 0x0151, "\x00\x6f\x03\x0b\0" },
- { 0x0154, "\x00\x52\x03\x01\0" },
- { 0x0155, "\x00\x72\x03\x01\0" },
- { 0x0156, "\x00\x52\x03\x27\0" },
- { 0x0157, "\x00\x72\x03\x27\0" },
- { 0x0158, "\x00\x52\x03\x0c\0" },
- { 0x0159, "\x00\x72\x03\x0c\0" },
- { 0x015a, "\x00\x53\x03\x01\0" },
- { 0x015b, "\x00\x73\x03\x01\0" },
- { 0x015c, "\x00\x53\x03\x02\0" },
- { 0x015d, "\x00\x73\x03\x02\0" },
- { 0x015e, "\x00\x53\x03\x27\0" },
- { 0x015f, "\x00\x73\x03\x27\0" },
- { 0x0160, "\x00\x53\x03\x0c\0" },
- { 0x0161, "\x00\x73\x03\x0c\0" },
- { 0x0162, "\x00\x54\x03\x27\0" },
- { 0x0163, "\x00\x74\x03\x27\0" },
- { 0x0164, "\x00\x54\x03\x0c\0" },
- { 0x0165, "\x00\x74\x03\x0c\0" },
- { 0x0168, "\x00\x55\x03\x03\0" },
- { 0x0169, "\x00\x75\x03\x03\0" },
- { 0x016a, "\x00\x55\x03\x04\0" },
- { 0x016b, "\x00\x75\x03\x04\0" },
- { 0x016c, "\x00\x55\x03\x06\0" },
- { 0x016d, "\x00\x75\x03\x06\0" },
- { 0x016e, "\x00\x55\x03\x0a\0" },
- { 0x016f, "\x00\x75\x03\x0a\0" },
- { 0x0170, "\x00\x55\x03\x0b\0" },
- { 0x0171, "\x00\x75\x03\x0b\0" },
- { 0x0172, "\x00\x55\x03\x28\0" },
- { 0x0173, "\x00\x75\x03\x28\0" },
- { 0x0174, "\x00\x57\x03\x02\0" },
- { 0x0175, "\x00\x77\x03\x02\0" },
- { 0x0176, "\x00\x59\x03\x02\0" },
- { 0x0177, "\x00\x79\x03\x02\0" },
- { 0x0178, "\x00\x59\x03\x08\0" },
- { 0x0179, "\x00\x5a\x03\x01\0" },
- { 0x017a, "\x00\x7a\x03\x01\0" },
- { 0x017b, "\x00\x5a\x03\x07\0" },
- { 0x017c, "\x00\x7a\x03\x07\0" },
- { 0x017d, "\x00\x5a\x03\x0c\0" },
- { 0x017e, "\x00\x7a\x03\x0c\0" },
- { 0x01a0, "\x00\x4f\x03\x1b\0" },
- { 0x01a1, "\x00\x6f\x03\x1b\0" },
- { 0x01af, "\x00\x55\x03\x1b\0" },
- { 0x01b0, "\x00\x75\x03\x1b\0" },
- { 0x01cd, "\x00\x41\x03\x0c\0" },
- { 0x01ce, "\x00\x61\x03\x0c\0" },
- { 0x01cf, "\x00\x49\x03\x0c\0" },
- { 0x01d0, "\x00\x69\x03\x0c\0" },
- { 0x01d1, "\x00\x4f\x03\x0c\0" },
- { 0x01d2, "\x00\x6f\x03\x0c\0" },
- { 0x01d3, "\x00\x55\x03\x0c\0" },
- { 0x01d4, "\x00\x75\x03\x0c\0" },
- { 0x01d5, "\x00\x55\x03\x08\x03\x04\0" },
- { 0x01d6, "\x00\x75\x03\x08\x03\x04\0" },
- { 0x01d7, "\x00\x55\x03\x08\x03\x01\0" },
- { 0x01d8, "\x00\x75\x03\x08\x03\x01\0" },
- { 0x01d9, "\x00\x55\x03\x08\x03\x0c\0" },
- { 0x01da, "\x00\x75\x03\x08\x03\x0c\0" },
- { 0x01db, "\x00\x55\x03\x08\x03\x00\0" },
- { 0x01dc, "\x00\x75\x03\x08\x03\x00\0" },
- { 0x01de, "\x00\x41\x03\x08\x03\x04\0" },
- { 0x01df, "\x00\x61\x03\x08\x03\x04\0" },
- { 0x01e0, "\x00\x41\x03\x07\x03\x04\0" },
- { 0x01e1, "\x00\x61\x03\x07\x03\x04\0" },
- { 0x01e2, "\x00\xc6\x03\x04\0" },
- { 0x01e3, "\x00\xe6\x03\x04\0" },
- { 0x01e6, "\x00\x47\x03\x0c\0" },
- { 0x01e7, "\x00\x67\x03\x0c\0" },
- { 0x01e8, "\x00\x4b\x03\x0c\0" },
- { 0x01e9, "\x00\x6b\x03\x0c\0" },
- { 0x01ea, "\x00\x4f\x03\x28\0" },
- { 0x01eb, "\x00\x6f\x03\x28\0" },
- { 0x01ec, "\x00\x4f\x03\x28\x03\x04\0" },
- { 0x01ed, "\x00\x6f\x03\x28\x03\x04\0" },
- { 0x01ee, "\x01\xb7\x03\x0c\0" },
- { 0x01ef, "\x02\x92\x03\x0c\0" },
- { 0x01f0, "\x00\x6a\x03\x0c\0" },
- { 0x01f4, "\x00\x47\x03\x01\0" },
- { 0x01f5, "\x00\x67\x03\x01\0" },
- { 0x01fa, "\x00\x41\x03\x0a\x03\x01\0" },
- { 0x01fb, "\x00\x61\x03\x0a\x03\x01\0" },
- { 0x01fc, "\x00\xc6\x03\x01\0" },
- { 0x01fd, "\x00\xe6\x03\x01\0" },
- { 0x01fe, "\x00\xd8\x03\x01\0" },
- { 0x01ff, "\x00\xf8\x03\x01\0" },
- { 0x0200, "\x00\x41\x03\x0f\0" },
- { 0x0201, "\x00\x61\x03\x0f\0" },
- { 0x0202, "\x00\x41\x03\x11\0" },
- { 0x0203, "\x00\x61\x03\x11\0" },
- { 0x0204, "\x00\x45\x03\x0f\0" },
- { 0x0205, "\x00\x65\x03\x0f\0" },
- { 0x0206, "\x00\x45\x03\x11\0" },
- { 0x0207, "\x00\x65\x03\x11\0" },
- { 0x0208, "\x00\x49\x03\x0f\0" },
- { 0x0209, "\x00\x69\x03\x0f\0" },
- { 0x020a, "\x00\x49\x03\x11\0" },
- { 0x020b, "\x00\x69\x03\x11\0" },
- { 0x020c, "\x00\x4f\x03\x0f\0" },
- { 0x020d, "\x00\x6f\x03\x0f\0" },
- { 0x020e, "\x00\x4f\x03\x11\0" },
- { 0x020f, "\x00\x6f\x03\x11\0" },
- { 0x0210, "\x00\x52\x03\x0f\0" },
- { 0x0211, "\x00\x72\x03\x0f\0" },
- { 0x0212, "\x00\x52\x03\x11\0" },
- { 0x0213, "\x00\x72\x03\x11\0" },
- { 0x0214, "\x00\x55\x03\x0f\0" },
- { 0x0215, "\x00\x75\x03\x0f\0" },
- { 0x0216, "\x00\x55\x03\x11\0" },
- { 0x0217, "\x00\x75\x03\x11\0" },
- { 0x0340, "\x03\x00\0" },
- { 0x0341, "\x03\x01\0" },
- { 0x0343, "\x03\x13\0" },
- { 0x0344, "\x03\x08\x03\x01\0" },
- { 0x0374, "\x02\xb9\0" },
- { 0x037e, "\x00\x3b\0" },
- { 0x0385, "\x00\xa8\x03\x01\0" },
- { 0x0386, "\x03\x91\x03\x01\0" },
- { 0x0387, "\x00\xb7\0" },
- { 0x0388, "\x03\x95\x03\x01\0" },
- { 0x0389, "\x03\x97\x03\x01\0" },
- { 0x038a, "\x03\x99\x03\x01\0" },
- { 0x038c, "\x03\x9f\x03\x01\0" },
- { 0x038e, "\x03\xa5\x03\x01\0" },
- { 0x038f, "\x03\xa9\x03\x01\0" },
- { 0x0390, "\x03\xb9\x03\x08\x03\x01\0" },
- { 0x03aa, "\x03\x99\x03\x08\0" },
- { 0x03ab, "\x03\xa5\x03\x08\0" },
- { 0x03ac, "\x03\xb1\x03\x01\0" },
- { 0x03ad, "\x03\xb5\x03\x01\0" },
- { 0x03ae, "\x03\xb7\x03\x01\0" },
- { 0x03af, "\x03\xb9\x03\x01\0" },
- { 0x03b0, "\x03\xc5\x03\x08\x03\x01\0" },
- { 0x03ca, "\x03\xb9\x03\x08\0" },
- { 0x03cb, "\x03\xc5\x03\x08\0" },
- { 0x03cc, "\x03\xbf\x03\x01\0" },
- { 0x03cd, "\x03\xc5\x03\x01\0" },
- { 0x03ce, "\x03\xc9\x03\x01\0" },
- { 0x03d3, "\x03\xd2\x03\x01\0" },
- { 0x03d4, "\x03\xd2\x03\x08\0" },
- { 0x0401, "\x04\x15\x03\x08\0" },
- { 0x0403, "\x04\x13\x03\x01\0" },
- { 0x0407, "\x04\x06\x03\x08\0" },
- { 0x040c, "\x04\x1a\x03\x01\0" },
- { 0x040e, "\x04\x23\x03\x06\0" },
- { 0x0419, "\x04\x18\x03\x06\0" },
- { 0x0439, "\x04\x38\x03\x06\0" },
- { 0x0451, "\x04\x35\x03\x08\0" },
- { 0x0453, "\x04\x33\x03\x01\0" },
- { 0x0457, "\x04\x56\x03\x08\0" },
- { 0x045c, "\x04\x3a\x03\x01\0" },
- { 0x045e, "\x04\x43\x03\x06\0" },
- { 0x0476, "\x04\x74\x03\x0f\0" },
- { 0x0477, "\x04\x75\x03\x0f\0" },
- { 0x04c1, "\x04\x16\x03\x06\0" },
- { 0x04c2, "\x04\x36\x03\x06\0" },
- { 0x04d0, "\x04\x10\x03\x06\0" },
- { 0x04d1, "\x04\x30\x03\x06\0" },
- { 0x04d2, "\x04\x10\x03\x08\0" },
- { 0x04d3, "\x04\x30\x03\x08\0" },
- { 0x04d6, "\x04\x15\x03\x06\0" },
- { 0x04d7, "\x04\x35\x03\x06\0" },
- { 0x04da, "\x04\xd8\x03\x08\0" },
- { 0x04db, "\x04\xd9\x03\x08\0" },
- { 0x04dc, "\x04\x16\x03\x08\0" },
- { 0x04dd, "\x04\x36\x03\x08\0" },
- { 0x04de, "\x04\x17\x03\x08\0" },
- { 0x04df, "\x04\x37\x03\x08\0" },
- { 0x04e2, "\x04\x18\x03\x04\0" },
- { 0x04e3, "\x04\x38\x03\x04\0" },
- { 0x04e4, "\x04\x18\x03\x08\0" },
- { 0x04e5, "\x04\x38\x03\x08\0" },
- { 0x04e6, "\x04\x1e\x03\x08\0" },
- { 0x04e7, "\x04\x3e\x03\x08\0" },
- { 0x04ea, "\x04\xe8\x03\x08\0" },
- { 0x04eb, "\x04\xe9\x03\x08\0" },
- { 0x04ee, "\x04\x23\x03\x04\0" },
- { 0x04ef, "\x04\x43\x03\x04\0" },
- { 0x04f0, "\x04\x23\x03\x08\0" },
- { 0x04f1, "\x04\x43\x03\x08\0" },
- { 0x04f2, "\x04\x23\x03\x0b\0" },
- { 0x04f3, "\x04\x43\x03\x0b\0" },
- { 0x04f4, "\x04\x27\x03\x08\0" },
- { 0x04f5, "\x04\x47\x03\x08\0" },
- { 0x04f8, "\x04\x2b\x03\x08\0" },
- { 0x04f9, "\x04\x4b\x03\x08\0" },
- { 0x0929, "\x09\x28\x09\x3c\0" },
- { 0x0931, "\x09\x30\x09\x3c\0" },
- { 0x0934, "\x09\x33\x09\x3c\0" },
- { 0x0958, "\x09\x15\x09\x3c\0" },
- { 0x0959, "\x09\x16\x09\x3c\0" },
- { 0x095a, "\x09\x17\x09\x3c\0" },
- { 0x095b, "\x09\x1c\x09\x3c\0" },
- { 0x095c, "\x09\x21\x09\x3c\0" },
- { 0x095d, "\x09\x22\x09\x3c\0" },
- { 0x095e, "\x09\x2b\x09\x3c\0" },
- { 0x095f, "\x09\x2f\x09\x3c\0" },
- { 0x09b0, "\x09\xac\x09\xbc\0" },
- { 0x09cb, "\x09\xc7\x09\xbe\0" },
- { 0x09cc, "\x09\xc7\x09\xd7\0" },
- { 0x09dc, "\x09\xa1\x09\xbc\0" },
- { 0x09dd, "\x09\xa2\x09\xbc\0" },
- { 0x09df, "\x09\xaf\x09\xbc\0" },
- { 0x0a59, "\x0a\x16\x0a\x3c\0" },
- { 0x0a5a, "\x0a\x17\x0a\x3c\0" },
- { 0x0a5b, "\x0a\x1c\x0a\x3c\0" },
- { 0x0a5c, "\x0a\x21\x0a\x3c\0" },
- { 0x0a5e, "\x0a\x2b\x0a\x3c\0" },
- { 0x0b48, "\x0b\x47\x0b\x56\0" },
- { 0x0b4b, "\x0b\x47\x0b\x3e\0" },
- { 0x0b4c, "\x0b\x47\x0b\x57\0" },
- { 0x0b5c, "\x0b\x21\x0b\x3c\0" },
- { 0x0b5d, "\x0b\x22\x0b\x3c\0" },
- { 0x0b5f, "\x0b\x2f\x0b\x3c\0" },
- { 0x0b94, "\x0b\x92\x0b\xd7\0" },
- { 0x0bca, "\x0b\xc6\x0b\xbe\0" },
- { 0x0bcb, "\x0b\xc7\x0b\xbe\0" },
- { 0x0bcc, "\x0b\xc6\x0b\xd7\0" },
- { 0x0c48, "\x0c\x46\x0c\x56\0" },
- { 0x0cc0, "\x0c\xbf\x0c\xd5\0" },
- { 0x0cc7, "\x0c\xc6\x0c\xd5\0" },
- { 0x0cc8, "\x0c\xc6\x0c\xd6\0" },
- { 0x0cca, "\x0c\xc6\x0c\xc2\0" },
- { 0x0ccb, "\x0c\xc6\x0c\xc2\x0c\xd5\0" },
- { 0x0d4a, "\x0d\x46\x0d\x3e\0" },
- { 0x0d4b, "\x0d\x47\x0d\x3e\0" },
- { 0x0d4c, "\x0d\x46\x0d\x57\0" },
- { 0x0e33, "\x0e\x4d\x0e\x32\0" },
- { 0x0eb3, "\x0e\xcd\x0e\xb2\0" },
- { 0x0f43, "\x0f\x42\x0f\xb7\0" },
- { 0x0f4d, "\x0f\x4c\x0f\xb7\0" },
- { 0x0f52, "\x0f\x51\x0f\xb7\0" },
- { 0x0f57, "\x0f\x56\x0f\xb7\0" },
- { 0x0f5c, "\x0f\x5b\x0f\xb7\0" },
- { 0x0f69, "\x0f\x40\x0f\xb5\0" },
- { 0x0f73, "\x0f\x71\x0f\x72\0" },
- { 0x0f75, "\x0f\x71\x0f\x74\0" },
- { 0x0f76, "\x0f\xb2\x0f\x80\0" },
- { 0x0f78, "\x0f\xb3\x0f\x80\0" },
- { 0x0f81, "\x0f\x71\x0f\x80\0" },
- { 0x0f93, "\x0f\x92\x0f\xb7\0" },
- { 0x0f9d, "\x0f\x9c\x0f\xb7\0" },
- { 0x0fa2, "\x0f\xa1\x0f\xb7\0" },
- { 0x0fa7, "\x0f\xa6\x0f\xb7\0" },
- { 0x0fac, "\x0f\xab\x0f\xb7\0" },
- { 0x0fb9, "\x0f\x90\x0f\xb5\0" },
- { 0x1e00, "\x00\x41\x03\x25\0" },
- { 0x1e01, "\x00\x61\x03\x25\0" },
- { 0x1e02, "\x00\x42\x03\x07\0" },
- { 0x1e03, "\x00\x62\x03\x07\0" },
- { 0x1e04, "\x00\x42\x03\x23\0" },
- { 0x1e05, "\x00\x62\x03\x23\0" },
- { 0x1e06, "\x00\x42\x03\x31\0" },
- { 0x1e07, "\x00\x62\x03\x31\0" },
- { 0x1e08, "\x00\x43\x03\x27\x03\x01\0" },
- { 0x1e09, "\x00\x63\x03\x27\x03\x01\0" },
- { 0x1e0a, "\x00\x44\x03\x07\0" },
- { 0x1e0b, "\x00\x64\x03\x07\0" },
- { 0x1e0c, "\x00\x44\x03\x23\0" },
- { 0x1e0d, "\x00\x64\x03\x23\0" },
- { 0x1e0e, "\x00\x44\x03\x31\0" },
- { 0x1e0f, "\x00\x64\x03\x31\0" },
- { 0x1e10, "\x00\x44\x03\x27\0" },
- { 0x1e11, "\x00\x64\x03\x27\0" },
- { 0x1e12, "\x00\x44\x03\x2d\0" },
- { 0x1e13, "\x00\x64\x03\x2d\0" },
- { 0x1e14, "\x00\x45\x03\x04\x03\x00\0" },
- { 0x1e15, "\x00\x65\x03\x04\x03\x00\0" },
- { 0x1e16, "\x00\x45\x03\x04\x03\x01\0" },
- { 0x1e17, "\x00\x65\x03\x04\x03\x01\0" },
- { 0x1e18, "\x00\x45\x03\x2d\0" },
- { 0x1e19, "\x00\x65\x03\x2d\0" },
- { 0x1e1a, "\x00\x45\x03\x30\0" },
- { 0x1e1b, "\x00\x65\x03\x30\0" },
- { 0x1e1c, "\x00\x45\x03\x27\x03\x06\0" },
- { 0x1e1d, "\x00\x65\x03\x27\x03\x06\0" },
- { 0x1e1e, "\x00\x46\x03\x07\0" },
- { 0x1e1f, "\x00\x66\x03\x07\0" },
- { 0x1e20, "\x00\x47\x03\x04\0" },
- { 0x1e21, "\x00\x67\x03\x04\0" },
- { 0x1e22, "\x00\x48\x03\x07\0" },
- { 0x1e23, "\x00\x68\x03\x07\0" },
- { 0x1e24, "\x00\x48\x03\x23\0" },
- { 0x1e25, "\x00\x68\x03\x23\0" },
- { 0x1e26, "\x00\x48\x03\x08\0" },
- { 0x1e27, "\x00\x68\x03\x08\0" },
- { 0x1e28, "\x00\x48\x03\x27\0" },
- { 0x1e29, "\x00\x68\x03\x27\0" },
- { 0x1e2a, "\x00\x48\x03\x2e\0" },
- { 0x1e2b, "\x00\x68\x03\x2e\0" },
- { 0x1e2c, "\x00\x49\x03\x30\0" },
- { 0x1e2d, "\x00\x69\x03\x30\0" },
- { 0x1e2e, "\x00\x49\x03\x08\x03\x01\0" },
- { 0x1e2f, "\x00\x69\x03\x08\x03\x01\0" },
- { 0x1e30, "\x00\x4b\x03\x01\0" },
- { 0x1e31, "\x00\x6b\x03\x01\0" },
- { 0x1e32, "\x00\x4b\x03\x23\0" },
- { 0x1e33, "\x00\x6b\x03\x23\0" },
- { 0x1e34, "\x00\x4b\x03\x31\0" },
- { 0x1e35, "\x00\x6b\x03\x31\0" },
- { 0x1e36, "\x00\x4c\x03\x23\0" },
- { 0x1e37, "\x00\x6c\x03\x23\0" },
- { 0x1e38, "\x00\x4c\x03\x23\x03\x04\0" },
- { 0x1e39, "\x00\x6c\x03\x23\x03\x04\0" },
- { 0x1e3a, "\x00\x4c\x03\x31\0" },
- { 0x1e3b, "\x00\x6c\x03\x31\0" },
- { 0x1e3c, "\x00\x4c\x03\x2d\0" },
- { 0x1e3d, "\x00\x6c\x03\x2d\0" },
- { 0x1e3e, "\x00\x4d\x03\x01\0" },
- { 0x1e3f, "\x00\x6d\x03\x01\0" },
- { 0x1e40, "\x00\x4d\x03\x07\0" },
- { 0x1e41, "\x00\x6d\x03\x07\0" },
- { 0x1e42, "\x00\x4d\x03\x23\0" },
- { 0x1e43, "\x00\x6d\x03\x23\0" },
- { 0x1e44, "\x00\x4e\x03\x07\0" },
- { 0x1e45, "\x00\x6e\x03\x07\0" },
- { 0x1e46, "\x00\x4e\x03\x23\0" },
- { 0x1e47, "\x00\x6e\x03\x23\0" },
- { 0x1e48, "\x00\x4e\x03\x31\0" },
- { 0x1e49, "\x00\x6e\x03\x31\0" },
- { 0x1e4a, "\x00\x4e\x03\x2d\0" },
- { 0x1e4b, "\x00\x6e\x03\x2d\0" },
- { 0x1e4c, "\x00\x4f\x03\x03\x03\x01\0" },
- { 0x1e4d, "\x00\x6f\x03\x03\x03\x01\0" },
- { 0x1e4e, "\x00\x4f\x03\x03\x03\x08\0" },
- { 0x1e4f, "\x00\x6f\x03\x03\x03\x08\0" },
- { 0x1e50, "\x00\x4f\x03\x04\x03\x00\0" },
- { 0x1e51, "\x00\x6f\x03\x04\x03\x00\0" },
- { 0x1e52, "\x00\x4f\x03\x04\x03\x01\0" },
- { 0x1e53, "\x00\x6f\x03\x04\x03\x01\0" },
- { 0x1e54, "\x00\x50\x03\x01\0" },
- { 0x1e55, "\x00\x70\x03\x01\0" },
- { 0x1e56, "\x00\x50\x03\x07\0" },
- { 0x1e57, "\x00\x70\x03\x07\0" },
- { 0x1e58, "\x00\x52\x03\x07\0" },
- { 0x1e59, "\x00\x72\x03\x07\0" },
- { 0x1e5a, "\x00\x52\x03\x23\0" },
- { 0x1e5b, "\x00\x72\x03\x23\0" },
- { 0x1e5c, "\x00\x52\x03\x23\x03\x04\0" },
- { 0x1e5d, "\x00\x72\x03\x23\x03\x04\0" },
- { 0x1e5e, "\x00\x52\x03\x31\0" },
- { 0x1e5f, "\x00\x72\x03\x31\0" },
- { 0x1e60, "\x00\x53\x03\x07\0" },
- { 0x1e61, "\x00\x73\x03\x07\0" },
- { 0x1e62, "\x00\x53\x03\x23\0" },
- { 0x1e63, "\x00\x73\x03\x23\0" },
- { 0x1e64, "\x00\x53\x03\x01\x03\x07\0" },
- { 0x1e65, "\x00\x73\x03\x01\x03\x07\0" },
- { 0x1e66, "\x00\x53\x03\x0c\x03\x07\0" },
- { 0x1e67, "\x00\x73\x03\x0c\x03\x07\0" },
- { 0x1e68, "\x00\x53\x03\x23\x03\x07\0" },
- { 0x1e69, "\x00\x73\x03\x23\x03\x07\0" },
- { 0x1e6a, "\x00\x54\x03\x07\0" },
- { 0x1e6b, "\x00\x74\x03\x07\0" },
- { 0x1e6c, "\x00\x54\x03\x23\0" },
- { 0x1e6d, "\x00\x74\x03\x23\0" },
- { 0x1e6e, "\x00\x54\x03\x31\0" },
- { 0x1e6f, "\x00\x74\x03\x31\0" },
- { 0x1e70, "\x00\x54\x03\x2d\0" },
- { 0x1e71, "\x00\x74\x03\x2d\0" },
- { 0x1e72, "\x00\x55\x03\x24\0" },
- { 0x1e73, "\x00\x75\x03\x24\0" },
- { 0x1e74, "\x00\x55\x03\x30\0" },
- { 0x1e75, "\x00\x75\x03\x30\0" },
- { 0x1e76, "\x00\x55\x03\x2d\0" },
- { 0x1e77, "\x00\x75\x03\x2d\0" },
- { 0x1e78, "\x00\x55\x03\x03\x03\x01\0" },
- { 0x1e79, "\x00\x75\x03\x03\x03\x01\0" },
- { 0x1e7a, "\x00\x55\x03\x04\x03\x08\0" },
- { 0x1e7b, "\x00\x75\x03\x04\x03\x08\0" },
- { 0x1e7c, "\x00\x56\x03\x03\0" },
- { 0x1e7d, "\x00\x76\x03\x03\0" },
- { 0x1e7e, "\x00\x56\x03\x23\0" },
- { 0x1e7f, "\x00\x76\x03\x23\0" },
- { 0x1e80, "\x00\x57\x03\x00\0" },
- { 0x1e81, "\x00\x77\x03\x00\0" },
- { 0x1e82, "\x00\x57\x03\x01\0" },
- { 0x1e83, "\x00\x77\x03\x01\0" },
- { 0x1e84, "\x00\x57\x03\x08\0" },
- { 0x1e85, "\x00\x77\x03\x08\0" },
- { 0x1e86, "\x00\x57\x03\x07\0" },
- { 0x1e87, "\x00\x77\x03\x07\0" },
- { 0x1e88, "\x00\x57\x03\x23\0" },
- { 0x1e89, "\x00\x77\x03\x23\0" },
- { 0x1e8a, "\x00\x58\x03\x07\0" },
- { 0x1e8b, "\x00\x78\x03\x07\0" },
- { 0x1e8c, "\x00\x58\x03\x08\0" },
- { 0x1e8d, "\x00\x78\x03\x08\0" },
- { 0x1e8e, "\x00\x59\x03\x07\0" },
- { 0x1e8f, "\x00\x79\x03\x07\0" },
- { 0x1e90, "\x00\x5a\x03\x02\0" },
- { 0x1e91, "\x00\x7a\x03\x02\0" },
- { 0x1e92, "\x00\x5a\x03\x23\0" },
- { 0x1e93, "\x00\x7a\x03\x23\0" },
- { 0x1e94, "\x00\x5a\x03\x31\0" },
- { 0x1e95, "\x00\x7a\x03\x31\0" },
- { 0x1e96, "\x00\x68\x03\x31\0" },
- { 0x1e97, "\x00\x74\x03\x08\0" },
- { 0x1e98, "\x00\x77\x03\x0a\0" },
- { 0x1e99, "\x00\x79\x03\x0a\0" },
- { 0x1e9b, "\x01\x7f\x03\x07\0" },
- { 0x1ea0, "\x00\x41\x03\x23\0" },
- { 0x1ea1, "\x00\x61\x03\x23\0" },
- { 0x1ea2, "\x00\x41\x03\x09\0" },
- { 0x1ea3, "\x00\x61\x03\x09\0" },
- { 0x1ea4, "\x00\x41\x03\x02\x03\x01\0" },
- { 0x1ea5, "\x00\x61\x03\x02\x03\x01\0" },
- { 0x1ea6, "\x00\x41\x03\x02\x03\x00\0" },
- { 0x1ea7, "\x00\x61\x03\x02\x03\x00\0" },
- { 0x1ea8, "\x00\x41\x03\x02\x03\x09\0" },
- { 0x1ea9, "\x00\x61\x03\x02\x03\x09\0" },
- { 0x1eaa, "\x00\x41\x03\x02\x03\x03\0" },
- { 0x1eab, "\x00\x61\x03\x02\x03\x03\0" },
- { 0x1eac, "\x00\x41\x03\x23\x03\x02\0" },
- { 0x1ead, "\x00\x61\x03\x23\x03\x02\0" },
- { 0x1eae, "\x00\x41\x03\x06\x03\x01\0" },
- { 0x1eaf, "\x00\x61\x03\x06\x03\x01\0" },
- { 0x1eb0, "\x00\x41\x03\x06\x03\x00\0" },
- { 0x1eb1, "\x00\x61\x03\x06\x03\x00\0" },
- { 0x1eb2, "\x00\x41\x03\x06\x03\x09\0" },
- { 0x1eb3, "\x00\x61\x03\x06\x03\x09\0" },
- { 0x1eb4, "\x00\x41\x03\x06\x03\x03\0" },
- { 0x1eb5, "\x00\x61\x03\x06\x03\x03\0" },
- { 0x1eb6, "\x00\x41\x03\x23\x03\x06\0" },
- { 0x1eb7, "\x00\x61\x03\x23\x03\x06\0" },
- { 0x1eb8, "\x00\x45\x03\x23\0" },
- { 0x1eb9, "\x00\x65\x03\x23\0" },
- { 0x1eba, "\x00\x45\x03\x09\0" },
- { 0x1ebb, "\x00\x65\x03\x09\0" },
- { 0x1ebc, "\x00\x45\x03\x03\0" },
- { 0x1ebd, "\x00\x65\x03\x03\0" },
- { 0x1ebe, "\x00\x45\x03\x02\x03\x01\0" },
- { 0x1ebf, "\x00\x65\x03\x02\x03\x01\0" },
- { 0x1ec0, "\x00\x45\x03\x02\x03\x00\0" },
- { 0x1ec1, "\x00\x65\x03\x02\x03\x00\0" },
- { 0x1ec2, "\x00\x45\x03\x02\x03\x09\0" },
- { 0x1ec3, "\x00\x65\x03\x02\x03\x09\0" },
- { 0x1ec4, "\x00\x45\x03\x02\x03\x03\0" },
- { 0x1ec5, "\x00\x65\x03\x02\x03\x03\0" },
- { 0x1ec6, "\x00\x45\x03\x23\x03\x02\0" },
- { 0x1ec7, "\x00\x65\x03\x23\x03\x02\0" },
- { 0x1ec8, "\x00\x49\x03\x09\0" },
- { 0x1ec9, "\x00\x69\x03\x09\0" },
- { 0x1eca, "\x00\x49\x03\x23\0" },
- { 0x1ecb, "\x00\x69\x03\x23\0" },
- { 0x1ecc, "\x00\x4f\x03\x23\0" },
- { 0x1ecd, "\x00\x6f\x03\x23\0" },
- { 0x1ece, "\x00\x4f\x03\x09\0" },
- { 0x1ecf, "\x00\x6f\x03\x09\0" },
- { 0x1ed0, "\x00\x4f\x03\x02\x03\x01\0" },
- { 0x1ed1, "\x00\x6f\x03\x02\x03\x01\0" },
- { 0x1ed2, "\x00\x4f\x03\x02\x03\x00\0" },
- { 0x1ed3, "\x00\x6f\x03\x02\x03\x00\0" },
- { 0x1ed4, "\x00\x4f\x03\x02\x03\x09\0" },
- { 0x1ed5, "\x00\x6f\x03\x02\x03\x09\0" },
- { 0x1ed6, "\x00\x4f\x03\x02\x03\x03\0" },
- { 0x1ed7, "\x00\x6f\x03\x02\x03\x03\0" },
- { 0x1ed8, "\x00\x4f\x03\x23\x03\x02\0" },
- { 0x1ed9, "\x00\x6f\x03\x23\x03\x02\0" },
- { 0x1eda, "\x00\x4f\x03\x1b\x03\x01\0" },
- { 0x1edb, "\x00\x6f\x03\x1b\x03\x01\0" },
- { 0x1edc, "\x00\x4f\x03\x1b\x03\x00\0" },
- { 0x1edd, "\x00\x6f\x03\x1b\x03\x00\0" },
- { 0x1ede, "\x00\x4f\x03\x1b\x03\x09\0" },
- { 0x1edf, "\x00\x6f\x03\x1b\x03\x09\0" },
- { 0x1ee0, "\x00\x4f\x03\x1b\x03\x03\0" },
- { 0x1ee1, "\x00\x6f\x03\x1b\x03\x03\0" },
- { 0x1ee2, "\x00\x4f\x03\x1b\x03\x23\0" },
- { 0x1ee3, "\x00\x6f\x03\x1b\x03\x23\0" },
- { 0x1ee4, "\x00\x55\x03\x23\0" },
- { 0x1ee5, "\x00\x75\x03\x23\0" },
- { 0x1ee6, "\x00\x55\x03\x09\0" },
- { 0x1ee7, "\x00\x75\x03\x09\0" },
- { 0x1ee8, "\x00\x55\x03\x1b\x03\x01\0" },
- { 0x1ee9, "\x00\x75\x03\x1b\x03\x01\0" },
- { 0x1eea, "\x00\x55\x03\x1b\x03\x00\0" },
- { 0x1eeb, "\x00\x75\x03\x1b\x03\x00\0" },
- { 0x1eec, "\x00\x55\x03\x1b\x03\x09\0" },
- { 0x1eed, "\x00\x75\x03\x1b\x03\x09\0" },
- { 0x1eee, "\x00\x55\x03\x1b\x03\x03\0" },
- { 0x1eef, "\x00\x75\x03\x1b\x03\x03\0" },
- { 0x1ef0, "\x00\x55\x03\x1b\x03\x23\0" },
- { 0x1ef1, "\x00\x75\x03\x1b\x03\x23\0" },
- { 0x1ef2, "\x00\x59\x03\x00\0" },
- { 0x1ef3, "\x00\x79\x03\x00\0" },
- { 0x1ef4, "\x00\x59\x03\x23\0" },
- { 0x1ef5, "\x00\x79\x03\x23\0" },
- { 0x1ef6, "\x00\x59\x03\x09\0" },
- { 0x1ef7, "\x00\x79\x03\x09\0" },
- { 0x1ef8, "\x00\x59\x03\x03\0" },
- { 0x1ef9, "\x00\x79\x03\x03\0" },
- { 0x1f00, "\x03\xb1\x03\x13\0" },
- { 0x1f01, "\x03\xb1\x03\x14\0" },
- { 0x1f02, "\x03\xb1\x03\x13\x03\x00\0" },
- { 0x1f03, "\x03\xb1\x03\x14\x03\x00\0" },
- { 0x1f04, "\x03\xb1\x03\x13\x03\x01\0" },
- { 0x1f05, "\x03\xb1\x03\x14\x03\x01\0" },
- { 0x1f06, "\x03\xb1\x03\x13\x03\x42\0" },
- { 0x1f07, "\x03\xb1\x03\x14\x03\x42\0" },
- { 0x1f08, "\x03\x91\x03\x13\0" },
- { 0x1f09, "\x03\x91\x03\x14\0" },
- { 0x1f0a, "\x03\x91\x03\x13\x03\x00\0" },
- { 0x1f0b, "\x03\x91\x03\x14\x03\x00\0" },
- { 0x1f0c, "\x03\x91\x03\x13\x03\x01\0" },
- { 0x1f0d, "\x03\x91\x03\x14\x03\x01\0" },
- { 0x1f0e, "\x03\x91\x03\x13\x03\x42\0" },
- { 0x1f0f, "\x03\x91\x03\x14\x03\x42\0" },
- { 0x1f10, "\x03\xb5\x03\x13\0" },
- { 0x1f11, "\x03\xb5\x03\x14\0" },
- { 0x1f12, "\x03\xb5\x03\x13\x03\x00\0" },
- { 0x1f13, "\x03\xb5\x03\x14\x03\x00\0" },
- { 0x1f14, "\x03\xb5\x03\x13\x03\x01\0" },
- { 0x1f15, "\x03\xb5\x03\x14\x03\x01\0" },
- { 0x1f18, "\x03\x95\x03\x13\0" },
- { 0x1f19, "\x03\x95\x03\x14\0" },
- { 0x1f1a, "\x03\x95\x03\x13\x03\x00\0" },
- { 0x1f1b, "\x03\x95\x03\x14\x03\x00\0" },
- { 0x1f1c, "\x03\x95\x03\x13\x03\x01\0" },
- { 0x1f1d, "\x03\x95\x03\x14\x03\x01\0" },
- { 0x1f20, "\x03\xb7\x03\x13\0" },
- { 0x1f21, "\x03\xb7\x03\x14\0" },
- { 0x1f22, "\x03\xb7\x03\x13\x03\x00\0" },
- { 0x1f23, "\x03\xb7\x03\x14\x03\x00\0" },
- { 0x1f24, "\x03\xb7\x03\x13\x03\x01\0" },
- { 0x1f25, "\x03\xb7\x03\x14\x03\x01\0" },
- { 0x1f26, "\x03\xb7\x03\x13\x03\x42\0" },
- { 0x1f27, "\x03\xb7\x03\x14\x03\x42\0" },
- { 0x1f28, "\x03\x97\x03\x13\0" },
- { 0x1f29, "\x03\x97\x03\x14\0" },
- { 0x1f2a, "\x03\x97\x03\x13\x03\x00\0" },
- { 0x1f2b, "\x03\x97\x03\x14\x03\x00\0" },
- { 0x1f2c, "\x03\x97\x03\x13\x03\x01\0" },
- { 0x1f2d, "\x03\x97\x03\x14\x03\x01\0" },
- { 0x1f2e, "\x03\x97\x03\x13\x03\x42\0" },
- { 0x1f2f, "\x03\x97\x03\x14\x03\x42\0" },
- { 0x1f30, "\x03\xb9\x03\x13\0" },
- { 0x1f31, "\x03\xb9\x03\x14\0" },
- { 0x1f32, "\x03\xb9\x03\x13\x03\x00\0" },
- { 0x1f33, "\x03\xb9\x03\x14\x03\x00\0" },
- { 0x1f34, "\x03\xb9\x03\x13\x03\x01\0" },
- { 0x1f35, "\x03\xb9\x03\x14\x03\x01\0" },
- { 0x1f36, "\x03\xb9\x03\x13\x03\x42\0" },
- { 0x1f37, "\x03\xb9\x03\x14\x03\x42\0" },
- { 0x1f38, "\x03\x99\x03\x13\0" },
- { 0x1f39, "\x03\x99\x03\x14\0" },
- { 0x1f3a, "\x03\x99\x03\x13\x03\x00\0" },
- { 0x1f3b, "\x03\x99\x03\x14\x03\x00\0" },
- { 0x1f3c, "\x03\x99\x03\x13\x03\x01\0" },
- { 0x1f3d, "\x03\x99\x03\x14\x03\x01\0" },
- { 0x1f3e, "\x03\x99\x03\x13\x03\x42\0" },
- { 0x1f3f, "\x03\x99\x03\x14\x03\x42\0" },
- { 0x1f40, "\x03\xbf\x03\x13\0" },
- { 0x1f41, "\x03\xbf\x03\x14\0" },
- { 0x1f42, "\x03\xbf\x03\x13\x03\x00\0" },
- { 0x1f43, "\x03\xbf\x03\x14\x03\x00\0" },
- { 0x1f44, "\x03\xbf\x03\x13\x03\x01\0" },
- { 0x1f45, "\x03\xbf\x03\x14\x03\x01\0" },
- { 0x1f48, "\x03\x9f\x03\x13\0" },
- { 0x1f49, "\x03\x9f\x03\x14\0" },
- { 0x1f4a, "\x03\x9f\x03\x13\x03\x00\0" },
- { 0x1f4b, "\x03\x9f\x03\x14\x03\x00\0" },
- { 0x1f4c, "\x03\x9f\x03\x13\x03\x01\0" },
- { 0x1f4d, "\x03\x9f\x03\x14\x03\x01\0" },
- { 0x1f50, "\x03\xc5\x03\x13\0" },
- { 0x1f51, "\x03\xc5\x03\x14\0" },
- { 0x1f52, "\x03\xc5\x03\x13\x03\x00\0" },
- { 0x1f53, "\x03\xc5\x03\x14\x03\x00\0" },
- { 0x1f54, "\x03\xc5\x03\x13\x03\x01\0" },
- { 0x1f55, "\x03\xc5\x03\x14\x03\x01\0" },
- { 0x1f56, "\x03\xc5\x03\x13\x03\x42\0" },
- { 0x1f57, "\x03\xc5\x03\x14\x03\x42\0" },
- { 0x1f59, "\x03\xa5\x03\x14\0" },
- { 0x1f5b, "\x03\xa5\x03\x14\x03\x00\0" },
- { 0x1f5d, "\x03\xa5\x03\x14\x03\x01\0" },
- { 0x1f5f, "\x03\xa5\x03\x14\x03\x42\0" },
- { 0x1f60, "\x03\xc9\x03\x13\0" },
- { 0x1f61, "\x03\xc9\x03\x14\0" },
- { 0x1f62, "\x03\xc9\x03\x13\x03\x00\0" },
- { 0x1f63, "\x03\xc9\x03\x14\x03\x00\0" },
- { 0x1f64, "\x03\xc9\x03\x13\x03\x01\0" },
- { 0x1f65, "\x03\xc9\x03\x14\x03\x01\0" },
- { 0x1f66, "\x03\xc9\x03\x13\x03\x42\0" },
- { 0x1f67, "\x03\xc9\x03\x14\x03\x42\0" },
- { 0x1f68, "\x03\xa9\x03\x13\0" },
- { 0x1f69, "\x03\xa9\x03\x14\0" },
- { 0x1f6a, "\x03\xa9\x03\x13\x03\x00\0" },
- { 0x1f6b, "\x03\xa9\x03\x14\x03\x00\0" },
- { 0x1f6c, "\x03\xa9\x03\x13\x03\x01\0" },
- { 0x1f6d, "\x03\xa9\x03\x14\x03\x01\0" },
- { 0x1f6e, "\x03\xa9\x03\x13\x03\x42\0" },
- { 0x1f6f, "\x03\xa9\x03\x14\x03\x42\0" },
- { 0x1f70, "\x03\xb1\x03\x00\0" },
- { 0x1f71, "\x03\xb1\x03\x01\0" },
- { 0x1f72, "\x03\xb5\x03\x00\0" },
- { 0x1f73, "\x03\xb5\x03\x01\0" },
- { 0x1f74, "\x03\xb7\x03\x00\0" },
- { 0x1f75, "\x03\xb7\x03\x01\0" },
- { 0x1f76, "\x03\xb9\x03\x00\0" },
- { 0x1f77, "\x03\xb9\x03\x01\0" },
- { 0x1f78, "\x03\xbf\x03\x00\0" },
- { 0x1f79, "\x03\xbf\x03\x01\0" },
- { 0x1f7a, "\x03\xc5\x03\x00\0" },
- { 0x1f7b, "\x03\xc5\x03\x01\0" },
- { 0x1f7c, "\x03\xc9\x03\x00\0" },
- { 0x1f7d, "\x03\xc9\x03\x01\0" },
- { 0x1f80, "\x03\xb1\x03\x13\x03\x45\0" },
- { 0x1f81, "\x03\xb1\x03\x14\x03\x45\0" },
- { 0x1f82, "\x03\xb1\x03\x13\x03\x00\x03\x45\0" },
- { 0x1f83, "\x03\xb1\x03\x14\x03\x00\x03\x45\0" },
- { 0x1f84, "\x03\xb1\x03\x13\x03\x01\x03\x45\0" },
- { 0x1f85, "\x03\xb1\x03\x14\x03\x01\x03\x45\0" },
- { 0x1f86, "\x03\xb1\x03\x13\x03\x42\x03\x45\0" },
- { 0x1f87, "\x03\xb1\x03\x14\x03\x42\x03\x45\0" },
- { 0x1f88, "\x03\x91\x03\x13\x03\x45\0" },
- { 0x1f89, "\x03\x91\x03\x14\x03\x45\0" },
- { 0x1f8a, "\x03\x91\x03\x13\x03\x00\x03\x45\0" },
- { 0x1f8b, "\x03\x91\x03\x14\x03\x00\x03\x45\0" },
- { 0x1f8c, "\x03\x91\x03\x13\x03\x01\x03\x45\0" },
- { 0x1f8d, "\x03\x91\x03\x14\x03\x01\x03\x45\0" },
- { 0x1f8e, "\x03\x91\x03\x13\x03\x42\x03\x45\0" },
- { 0x1f8f, "\x03\x91\x03\x14\x03\x42\x03\x45\0" },
- { 0x1f90, "\x03\xb7\x03\x13\x03\x45\0" },
- { 0x1f91, "\x03\xb7\x03\x14\x03\x45\0" },
- { 0x1f92, "\x03\xb7\x03\x13\x03\x00\x03\x45\0" },
- { 0x1f93, "\x03\xb7\x03\x14\x03\x00\x03\x45\0" },
- { 0x1f94, "\x03\xb7\x03\x13\x03\x01\x03\x45\0" },
- { 0x1f95, "\x03\xb7\x03\x14\x03\x01\x03\x45\0" },
- { 0x1f96, "\x03\xb7\x03\x13\x03\x42\x03\x45\0" },
- { 0x1f97, "\x03\xb7\x03\x14\x03\x42\x03\x45\0" },
- { 0x1f98, "\x03\x97\x03\x13\x03\x45\0" },
- { 0x1f99, "\x03\x97\x03\x14\x03\x45\0" },
- { 0x1f9a, "\x03\x97\x03\x13\x03\x00\x03\x45\0" },
- { 0x1f9b, "\x03\x97\x03\x14\x03\x00\x03\x45\0" },
- { 0x1f9c, "\x03\x97\x03\x13\x03\x01\x03\x45\0" },
- { 0x1f9d, "\x03\x97\x03\x14\x03\x01\x03\x45\0" },
- { 0x1f9e, "\x03\x97\x03\x13\x03\x42\x03\x45\0" },
- { 0x1f9f, "\x03\x97\x03\x14\x03\x42\x03\x45\0" },
- { 0x1fa0, "\x03\xc9\x03\x13\x03\x45\0" },
- { 0x1fa1, "\x03\xc9\x03\x14\x03\x45\0" },
- { 0x1fa2, "\x03\xc9\x03\x13\x03\x00\x03\x45\0" },
- { 0x1fa3, "\x03\xc9\x03\x14\x03\x00\x03\x45\0" },
- { 0x1fa4, "\x03\xc9\x03\x13\x03\x01\x03\x45\0" },
- { 0x1fa5, "\x03\xc9\x03\x14\x03\x01\x03\x45\0" },
- { 0x1fa6, "\x03\xc9\x03\x13\x03\x42\x03\x45\0" },
- { 0x1fa7, "\x03\xc9\x03\x14\x03\x42\x03\x45\0" },
- { 0x1fa8, "\x03\xa9\x03\x13\x03\x45\0" },
- { 0x1fa9, "\x03\xa9\x03\x14\x03\x45\0" },
- { 0x1faa, "\x03\xa9\x03\x13\x03\x00\x03\x45\0" },
- { 0x1fab, "\x03\xa9\x03\x14\x03\x00\x03\x45\0" },
- { 0x1fac, "\x03\xa9\x03\x13\x03\x01\x03\x45\0" },
- { 0x1fad, "\x03\xa9\x03\x14\x03\x01\x03\x45\0" },
- { 0x1fae, "\x03\xa9\x03\x13\x03\x42\x03\x45\0" },
- { 0x1faf, "\x03\xa9\x03\x14\x03\x42\x03\x45\0" },
- { 0x1fb0, "\x03\xb1\x03\x06\0" },
- { 0x1fb1, "\x03\xb1\x03\x04\0" },
- { 0x1fb2, "\x03\xb1\x03\x00\x03\x45\0" },
- { 0x1fb3, "\x03\xb1\x03\x45\0" },
- { 0x1fb4, "\x03\xb1\x03\x01\x03\x45\0" },
- { 0x1fb6, "\x03\xb1\x03\x42\0" },
- { 0x1fb7, "\x03\xb1\x03\x42\x03\x45\0" },
- { 0x1fb8, "\x03\x91\x03\x06\0" },
- { 0x1fb9, "\x03\x91\x03\x04\0" },
- { 0x1fba, "\x03\x91\x03\x00\0" },
- { 0x1fbb, "\x03\x91\x03\x01\0" },
- { 0x1fbc, "\x03\x91\x03\x45\0" },
- { 0x1fbe, "\x03\xb9\0" },
- { 0x1fc1, "\x00\xa8\x03\x42\0" },
- { 0x1fc2, "\x03\xb7\x03\x00\x03\x45\0" },
- { 0x1fc3, "\x03\xb7\x03\x45\0" },
- { 0x1fc4, "\x03\xb7\x03\x01\x03\x45\0" },
- { 0x1fc6, "\x03\xb7\x03\x42\0" },
- { 0x1fc7, "\x03\xb7\x03\x42\x03\x45\0" },
- { 0x1fc8, "\x03\x95\x03\x00\0" },
- { 0x1fc9, "\x03\x95\x03\x01\0" },
- { 0x1fca, "\x03\x97\x03\x00\0" },
- { 0x1fcb, "\x03\x97\x03\x01\0" },
- { 0x1fcc, "\x03\x97\x03\x45\0" },
- { 0x1fcd, "\x1f\xbf\x03\x00\0" },
- { 0x1fce, "\x1f\xbf\x03\x01\0" },
- { 0x1fcf, "\x1f\xbf\x03\x42\0" },
- { 0x1fd0, "\x03\xb9\x03\x06\0" },
- { 0x1fd1, "\x03\xb9\x03\x04\0" },
- { 0x1fd2, "\x03\xb9\x03\x08\x03\x00\0" },
- { 0x1fd3, "\x03\xb9\x03\x08\x03\x01\0" },
- { 0x1fd6, "\x03\xb9\x03\x42\0" },
- { 0x1fd7, "\x03\xb9\x03\x08\x03\x42\0" },
- { 0x1fd8, "\x03\x99\x03\x06\0" },
- { 0x1fd9, "\x03\x99\x03\x04\0" },
- { 0x1fda, "\x03\x99\x03\x00\0" },
- { 0x1fdb, "\x03\x99\x03\x01\0" },
- { 0x1fdd, "\x1f\xfe\x03\x00\0" },
- { 0x1fde, "\x1f\xfe\x03\x01\0" },
- { 0x1fdf, "\x1f\xfe\x03\x42\0" },
- { 0x1fe0, "\x03\xc5\x03\x06\0" },
- { 0x1fe1, "\x03\xc5\x03\x04\0" },
- { 0x1fe2, "\x03\xc5\x03\x08\x03\x00\0" },
- { 0x1fe3, "\x03\xc5\x03\x08\x03\x01\0" },
- { 0x1fe4, "\x03\xc1\x03\x13\0" },
- { 0x1fe5, "\x03\xc1\x03\x14\0" },
- { 0x1fe6, "\x03\xc5\x03\x42\0" },
- { 0x1fe7, "\x03\xc5\x03\x08\x03\x42\0" },
- { 0x1fe8, "\x03\xa5\x03\x06\0" },
- { 0x1fe9, "\x03\xa5\x03\x04\0" },
- { 0x1fea, "\x03\xa5\x03\x00\0" },
- { 0x1feb, "\x03\xa5\x03\x01\0" },
- { 0x1fec, "\x03\xa1\x03\x14\0" },
- { 0x1fed, "\x00\xa8\x03\x00\0" },
- { 0x1fee, "\x00\xa8\x03\x01\0" },
- { 0x1fef, "\x00\x60\0" },
- { 0x1ff2, "\x03\xc9\x03\x00\x03\x45\0" },
- { 0x1ff3, "\x03\xc9\x03\x45\0" },
- { 0x1ff4, "\x03\xc9\x03\x01\x03\x45\0" },
- { 0x1ff6, "\x03\xc9\x03\x42\0" },
- { 0x1ff7, "\x03\xc9\x03\x42\x03\x45\0" },
- { 0x1ff8, "\x03\x9f\x03\x00\0" },
- { 0x1ff9, "\x03\x9f\x03\x01\0" },
- { 0x1ffa, "\x03\xa9\x03\x00\0" },
- { 0x1ffb, "\x03\xa9\x03\x01\0" },
- { 0x1ffc, "\x03\xa9\x03\x45\0" },
- { 0x1ffd, "\x00\xb4\0" },
- { 0x2000, "\x20\x02\0" },
- { 0x2001, "\x20\x03\0" },
- { 0x2126, "\x03\xa9\0" },
- { 0x212a, "\x00\x4b\0" },
- { 0x212b, "\x00\x41\x03\x0a\0" },
- { 0x2204, "\x22\x03\x03\x38\0" },
- { 0x2209, "\x22\x08\x03\x38\0" },
- { 0x220c, "\x22\x0b\x03\x38\0" },
- { 0x2224, "\x22\x23\x03\x38\0" },
- { 0x2226, "\x22\x25\x03\x38\0" },
- { 0x2241, "\x00\x7e\x03\x38\0" },
- { 0x2244, "\x22\x43\x03\x38\0" },
- { 0x2247, "\x22\x45\x03\x38\0" },
- { 0x2249, "\x22\x48\x03\x38\0" },
- { 0x2260, "\x00\x3d\x03\x38\0" },
- { 0x2262, "\x22\x61\x03\x38\0" },
- { 0x226d, "\x22\x4d\x03\x38\0" },
- { 0x226e, "\x00\x3c\x03\x38\0" },
- { 0x226f, "\x00\x3e\x03\x38\0" },
- { 0x2270, "\x22\x64\x03\x38\0" },
- { 0x2271, "\x22\x65\x03\x38\0" },
- { 0x2274, "\x22\x72\x03\x38\0" },
- { 0x2275, "\x22\x73\x03\x38\0" },
- { 0x2278, "\x22\x76\x03\x38\0" },
- { 0x2279, "\x22\x77\x03\x38\0" },
- { 0x2280, "\x22\x7a\x03\x38\0" },
- { 0x2281, "\x22\x7b\x03\x38\0" },
- { 0x2284, "\x22\x82\x03\x38\0" },
- { 0x2285, "\x22\x83\x03\x38\0" },
- { 0x2288, "\x22\x86\x03\x38\0" },
- { 0x2289, "\x22\x87\x03\x38\0" },
- { 0x22ac, "\x22\xa2\x03\x38\0" },
- { 0x22ad, "\x22\xa8\x03\x38\0" },
- { 0x22ae, "\x22\xa9\x03\x38\0" },
- { 0x22af, "\x22\xab\x03\x38\0" },
- { 0x22e0, "\x22\x7c\x03\x38\0" },
- { 0x22e1, "\x22\x7d\x03\x38\0" },
- { 0x22e2, "\x22\x91\x03\x38\0" },
- { 0x22e3, "\x22\x92\x03\x38\0" },
- { 0x22ea, "\x22\xb2\x03\x38\0" },
- { 0x22eb, "\x22\xb3\x03\x38\0" },
- { 0x22ec, "\x22\xb4\x03\x38\0" },
- { 0x22ed, "\x22\xb5\x03\x38\0" },
- { 0x2329, "\x30\x08\0" },
- { 0x232a, "\x30\x09\0" },
- { 0x304c, "\x30\x4b\x30\x99\0" },
- { 0x304e, "\x30\x4d\x30\x99\0" },
- { 0x3050, "\x30\x4f\x30\x99\0" },
- { 0x3052, "\x30\x51\x30\x99\0" },
- { 0x3054, "\x30\x53\x30\x99\0" },
- { 0x3056, "\x30\x55\x30\x99\0" },
- { 0x3058, "\x30\x57\x30\x99\0" },
- { 0x305a, "\x30\x59\x30\x99\0" },
- { 0x305c, "\x30\x5b\x30\x99\0" },
- { 0x305e, "\x30\x5d\x30\x99\0" },
- { 0x3060, "\x30\x5f\x30\x99\0" },
- { 0x3062, "\x30\x61\x30\x99\0" },
- { 0x3065, "\x30\x64\x30\x99\0" },
- { 0x3067, "\x30\x66\x30\x99\0" },
- { 0x3069, "\x30\x68\x30\x99\0" },
- { 0x3070, "\x30\x6f\x30\x99\0" },
- { 0x3071, "\x30\x6f\x30\x9a\0" },
- { 0x3073, "\x30\x72\x30\x99\0" },
- { 0x3074, "\x30\x72\x30\x9a\0" },
- { 0x3076, "\x30\x75\x30\x99\0" },
- { 0x3077, "\x30\x75\x30\x9a\0" },
- { 0x3079, "\x30\x78\x30\x99\0" },
- { 0x307a, "\x30\x78\x30\x9a\0" },
- { 0x307c, "\x30\x7b\x30\x99\0" },
- { 0x307d, "\x30\x7b\x30\x9a\0" },
- { 0x3094, "\x30\x46\x30\x99\0" },
- { 0x309e, "\x30\x9d\x30\x99\0" },
- { 0x30ac, "\x30\xab\x30\x99\0" },
- { 0x30ae, "\x30\xad\x30\x99\0" },
- { 0x30b0, "\x30\xaf\x30\x99\0" },
- { 0x30b2, "\x30\xb1\x30\x99\0" },
- { 0x30b4, "\x30\xb3\x30\x99\0" },
- { 0x30b6, "\x30\xb5\x30\x99\0" },
- { 0x30b8, "\x30\xb7\x30\x99\0" },
- { 0x30ba, "\x30\xb9\x30\x99\0" },
- { 0x30bc, "\x30\xbb\x30\x99\0" },
- { 0x30be, "\x30\xbd\x30\x99\0" },
- { 0x30c0, "\x30\xbf\x30\x99\0" },
- { 0x30c2, "\x30\xc1\x30\x99\0" },
- { 0x30c5, "\x30\xc4\x30\x99\0" },
- { 0x30c7, "\x30\xc6\x30\x99\0" },
- { 0x30c9, "\x30\xc8\x30\x99\0" },
- { 0x30d0, "\x30\xcf\x30\x99\0" },
- { 0x30d1, "\x30\xcf\x30\x9a\0" },
- { 0x30d3, "\x30\xd2\x30\x99\0" },
- { 0x30d4, "\x30\xd2\x30\x9a\0" },
- { 0x30d6, "\x30\xd5\x30\x99\0" },
- { 0x30d7, "\x30\xd5\x30\x9a\0" },
- { 0x30d9, "\x30\xd8\x30\x99\0" },
- { 0x30da, "\x30\xd8\x30\x9a\0" },
- { 0x30dc, "\x30\xdb\x30\x99\0" },
- { 0x30dd, "\x30\xdb\x30\x9a\0" },
- { 0x30f4, "\x30\xa6\x30\x99\0" },
- { 0x30f7, "\x30\xef\x30\x99\0" },
- { 0x30f8, "\x30\xf0\x30\x99\0" },
- { 0x30f9, "\x30\xf1\x30\x99\0" },
- { 0x30fa, "\x30\xf2\x30\x99\0" },
- { 0x30fe, "\x30\xfd\x30\x99\0" },
- { 0xf900, "\x8c\x48\0" },
- { 0xf901, "\x66\xf4\0" },
- { 0xf902, "\x8e\xca\0" },
- { 0xf903, "\x8c\xc8\0" },
- { 0xf904, "\x6e\xd1\0" },
- { 0xf905, "\x4e\x32\0" },
- { 0xf906, "\x53\xe5\0" },
- { 0xf907, "\x9f\x9c\0" },
- { 0xf908, "\x9f\x9c\0" },
- { 0xf909, "\x59\x51\0" },
- { 0xf90a, "\x91\xd1\0" },
- { 0xf90b, "\x55\x87\0" },
- { 0xf90c, "\x59\x48\0" },
- { 0xf90d, "\x61\xf6\0" },
- { 0xf90e, "\x76\x69\0" },
- { 0xf90f, "\x7f\x85\0" },
- { 0xf910, "\x86\x3f\0" },
- { 0xf911, "\x87\xba\0" },
- { 0xf912, "\x88\xf8\0" },
- { 0xf913, "\x90\x8f\0" },
- { 0xf914, "\x6a\x02\0" },
- { 0xf915, "\x6d\x1b\0" },
- { 0xf916, "\x70\xd9\0" },
- { 0xf917, "\x73\xde\0" },
- { 0xf918, "\x84\x3d\0" },
- { 0xf919, "\x91\x6a\0" },
- { 0xf91a, "\x99\xf1\0" },
- { 0xf91b, "\x4e\x82\0" },
- { 0xf91c, "\x53\x75\0" },
- { 0xf91d, "\x6b\x04\0" },
- { 0xf91e, "\x72\x1b\0" },
- { 0xf91f, "\x86\x2d\0" },
- { 0xf920, "\x9e\x1e\0" },
- { 0xf921, "\x5d\x50\0" },
- { 0xf922, "\x6f\xeb\0" },
- { 0xf923, "\x85\xcd\0" },
- { 0xf924, "\x89\x64\0" },
- { 0xf925, "\x62\xc9\0" },
- { 0xf926, "\x81\xd8\0" },
- { 0xf927, "\x88\x1f\0" },
- { 0xf928, "\x5e\xca\0" },
- { 0xf929, "\x67\x17\0" },
- { 0xf92a, "\x6d\x6a\0" },
- { 0xf92b, "\x72\xfc\0" },
- { 0xf92c, "\x90\xce\0" },
- { 0xf92d, "\x4f\x86\0" },
- { 0xf92e, "\x51\xb7\0" },
- { 0xf92f, "\x52\xde\0" },
- { 0xf930, "\x64\xc4\0" },
- { 0xf931, "\x6a\xd3\0" },
- { 0xf932, "\x72\x10\0" },
- { 0xf933, "\x76\xe7\0" },
- { 0xf934, "\x80\x01\0" },
- { 0xf935, "\x86\x06\0" },
- { 0xf936, "\x86\x5c\0" },
- { 0xf937, "\x8d\xef\0" },
- { 0xf938, "\x97\x32\0" },
- { 0xf939, "\x9b\x6f\0" },
- { 0xf93a, "\x9d\xfa\0" },
- { 0xf93b, "\x78\x8c\0" },
- { 0xf93c, "\x79\x7f\0" },
- { 0xf93d, "\x7d\xa0\0" },
- { 0xf93e, "\x83\xc9\0" },
- { 0xf93f, "\x93\x04\0" },
- { 0xf940, "\x9e\x7f\0" },
- { 0xf941, "\x8a\xd6\0" },
- { 0xf942, "\x58\xdf\0" },
- { 0xf943, "\x5f\x04\0" },
- { 0xf944, "\x7c\x60\0" },
- { 0xf945, "\x80\x7e\0" },
- { 0xf946, "\x72\x62\0" },
- { 0xf947, "\x78\xca\0" },
- { 0xf948, "\x8c\xc2\0" },
- { 0xf949, "\x96\xf7\0" },
- { 0xf94a, "\x58\xd8\0" },
- { 0xf94b, "\x5c\x62\0" },
- { 0xf94c, "\x6a\x13\0" },
- { 0xf94d, "\x6d\xda\0" },
- { 0xf94e, "\x6f\x0f\0" },
- { 0xf94f, "\x7d\x2f\0" },
- { 0xf950, "\x7e\x37\0" },
- { 0xf951, "\x96\xfb\0" },
- { 0xf952, "\x52\xd2\0" },
- { 0xf953, "\x80\x8b\0" },
- { 0xf954, "\x51\xdc\0" },
- { 0xf955, "\x51\xcc\0" },
- { 0xf956, "\x7a\x1c\0" },
- { 0xf957, "\x7d\xbe\0" },
- { 0xf958, "\x83\xf1\0" },
- { 0xf959, "\x96\x75\0" },
- { 0xf95a, "\x8b\x80\0" },
- { 0xf95b, "\x62\xcf\0" },
- { 0xf95c, "\x6a\x02\0" },
- { 0xf95d, "\x8a\xfe\0" },
- { 0xf95e, "\x4e\x39\0" },
- { 0xf95f, "\x5b\xe7\0" },
- { 0xf960, "\x60\x12\0" },
- { 0xf961, "\x73\x87\0" },
- { 0xf962, "\x75\x70\0" },
- { 0xf963, "\x53\x17\0" },
- { 0xf964, "\x78\xfb\0" },
- { 0xf965, "\x4f\xbf\0" },
- { 0xf966, "\x5f\xa9\0" },
- { 0xf967, "\x4e\x0d\0" },
- { 0xf968, "\x6c\xcc\0" },
- { 0xf969, "\x65\x78\0" },
- { 0xf96a, "\x7d\x22\0" },
- { 0xf96b, "\x53\xc3\0" },
- { 0xf96c, "\x58\x5e\0" },
- { 0xf96d, "\x77\x01\0" },
- { 0xf96e, "\x84\x49\0" },
- { 0xf96f, "\x8a\xaa\0" },
- { 0xf970, "\x6b\xba\0" },
- { 0xf971, "\x8f\xb0\0" },
- { 0xf972, "\x6c\x88\0" },
- { 0xf973, "\x62\xfe\0" },
- { 0xf974, "\x82\xe5\0" },
- { 0xf975, "\x63\xa0\0" },
- { 0xf976, "\x75\x65\0" },
- { 0xf977, "\x4e\xae\0" },
- { 0xf978, "\x51\x69\0" },
- { 0xf979, "\x51\xc9\0" },
- { 0xf97a, "\x68\x81\0" },
- { 0xf97b, "\x7c\xe7\0" },
- { 0xf97c, "\x82\x6f\0" },
- { 0xf97d, "\x8a\xd2\0" },
- { 0xf97e, "\x91\xcf\0" },
- { 0xf97f, "\x52\xf5\0" },
- { 0xf980, "\x54\x42\0" },
- { 0xf981, "\x59\x73\0" },
- { 0xf982, "\x5e\xec\0" },
- { 0xf983, "\x65\xc5\0" },
- { 0xf984, "\x6f\xfe\0" },
- { 0xf985, "\x79\x2a\0" },
- { 0xf986, "\x95\xad\0" },
- { 0xf987, "\x9a\x6a\0" },
- { 0xf988, "\x9e\x97\0" },
- { 0xf989, "\x9e\xce\0" },
- { 0xf98a, "\x52\x9b\0" },
- { 0xf98b, "\x66\xc6\0" },
- { 0xf98c, "\x6b\x77\0" },
- { 0xf98d, "\x8f\x62\0" },
- { 0xf98e, "\x5e\x74\0" },
- { 0xf98f, "\x61\x90\0" },
- { 0xf990, "\x62\x00\0" },
- { 0xf991, "\x64\x9a\0" },
- { 0xf992, "\x6f\x23\0" },
- { 0xf993, "\x71\x49\0" },
- { 0xf994, "\x74\x89\0" },
- { 0xf995, "\x79\xca\0" },
- { 0xf996, "\x7d\xf4\0" },
- { 0xf997, "\x80\x6f\0" },
- { 0xf998, "\x8f\x26\0" },
- { 0xf999, "\x84\xee\0" },
- { 0xf99a, "\x90\x23\0" },
- { 0xf99b, "\x93\x4a\0" },
- { 0xf99c, "\x52\x17\0" },
- { 0xf99d, "\x52\xa3\0" },
- { 0xf99e, "\x54\xbd\0" },
- { 0xf99f, "\x70\xc8\0" },
- { 0xf9a0, "\x88\xc2\0" },
- { 0xf9a1, "\x8a\xaa\0" },
- { 0xf9a2, "\x5e\xc9\0" },
- { 0xf9a3, "\x5f\xf5\0" },
- { 0xf9a4, "\x63\x7b\0" },
- { 0xf9a5, "\x6b\xae\0" },
- { 0xf9a6, "\x7c\x3e\0" },
- { 0xf9a7, "\x73\x75\0" },
- { 0xf9a8, "\x4e\xe4\0" },
- { 0xf9a9, "\x56\xf9\0" },
- { 0xf9aa, "\x5b\xe7\0" },
- { 0xf9ab, "\x5d\xba\0" },
- { 0xf9ac, "\x60\x1c\0" },
- { 0xf9ad, "\x73\xb2\0" },
- { 0xf9ae, "\x74\x69\0" },
- { 0xf9af, "\x7f\x9a\0" },
- { 0xf9b0, "\x80\x46\0" },
- { 0xf9b1, "\x92\x34\0" },
- { 0xf9b2, "\x96\xf6\0" },
- { 0xf9b3, "\x97\x48\0" },
- { 0xf9b4, "\x98\x18\0" },
- { 0xf9b5, "\x4f\x8b\0" },
- { 0xf9b6, "\x79\xae\0" },
- { 0xf9b7, "\x91\xb4\0" },
- { 0xf9b8, "\x96\xb8\0" },
- { 0xf9b9, "\x60\xe1\0" },
- { 0xf9ba, "\x4e\x86\0" },
- { 0xf9bb, "\x50\xda\0" },
- { 0xf9bc, "\x5b\xee\0" },
- { 0xf9bd, "\x5c\x3f\0" },
- { 0xf9be, "\x65\x99\0" },
- { 0xf9bf, "\x6a\x02\0" },
- { 0xf9c0, "\x71\xce\0" },
- { 0xf9c1, "\x76\x42\0" },
- { 0xf9c2, "\x84\xfc\0" },
- { 0xf9c3, "\x90\x7c\0" },
- { 0xf9c4, "\x9f\x8d\0" },
- { 0xf9c5, "\x66\x88\0" },
- { 0xf9c6, "\x96\x2e\0" },
- { 0xf9c7, "\x52\x89\0" },
- { 0xf9c8, "\x67\x7b\0" },
- { 0xf9c9, "\x67\xf3\0" },
- { 0xf9ca, "\x6d\x41\0" },
- { 0xf9cb, "\x6e\x9c\0" },
- { 0xf9cc, "\x74\x09\0" },
- { 0xf9cd, "\x75\x59\0" },
- { 0xf9ce, "\x78\x6b\0" },
- { 0xf9cf, "\x7d\x10\0" },
- { 0xf9d0, "\x98\x5e\0" },
- { 0xf9d1, "\x51\x6d\0" },
- { 0xf9d2, "\x62\x2e\0" },
- { 0xf9d3, "\x96\x78\0" },
- { 0xf9d4, "\x50\x2b\0" },
- { 0xf9d5, "\x5d\x19\0" },
- { 0xf9d6, "\x6d\xea\0" },
- { 0xf9d7, "\x8f\x2a\0" },
- { 0xf9d8, "\x5f\x8b\0" },
- { 0xf9d9, "\x61\x44\0" },
- { 0xf9da, "\x68\x17\0" },
- { 0xf9db, "\x73\x87\0" },
- { 0xf9dc, "\x96\x86\0" },
- { 0xf9dd, "\x52\x29\0" },
- { 0xf9de, "\x54\x0f\0" },
- { 0xf9df, "\x5c\x65\0" },
- { 0xf9e0, "\x66\x13\0" },
- { 0xf9e1, "\x67\x4e\0" },
- { 0xf9e2, "\x68\xa8\0" },
- { 0xf9e3, "\x6c\xe5\0" },
- { 0xf9e4, "\x74\x06\0" },
- { 0xf9e5, "\x75\xe2\0" },
- { 0xf9e6, "\x7f\x79\0" },
- { 0xf9e7, "\x88\xcf\0" },
- { 0xf9e8, "\x88\xe1\0" },
- { 0xf9e9, "\x91\xcc\0" },
- { 0xf9ea, "\x96\xe2\0" },
- { 0xf9eb, "\x53\x3f\0" },
- { 0xf9ec, "\x6e\xba\0" },
- { 0xf9ed, "\x54\x1d\0" },
- { 0xf9ee, "\x71\xd0\0" },
- { 0xf9ef, "\x74\x98\0" },
- { 0xf9f0, "\x85\xfa\0" },
- { 0xf9f1, "\x96\xa3\0" },
- { 0xf9f2, "\x9c\x57\0" },
- { 0xf9f3, "\x9e\x9f\0" },
- { 0xf9f4, "\x67\x97\0" },
- { 0xf9f5, "\x6d\xcb\0" },
- { 0xf9f6, "\x81\xe8\0" },
- { 0xf9f7, "\x7a\xcb\0" },
- { 0xf9f8, "\x7b\x20\0" },
- { 0xf9f9, "\x7c\x92\0" },
- { 0xf9fa, "\x72\xc0\0" },
- { 0xf9fb, "\x70\x99\0" },
- { 0xf9fc, "\x8b\x58\0" },
- { 0xf9fd, "\x4e\xc0\0" },
- { 0xf9fe, "\x83\x36\0" },
- { 0xf9ff, "\x52\x3a\0" },
- { 0xfa00, "\x52\x07\0" },
- { 0xfa01, "\x5e\xa6\0" },
- { 0xfa02, "\x62\xd3\0" },
- { 0xfa03, "\x7c\xd6\0" },
- { 0xfa04, "\x5b\x85\0" },
- { 0xfa05, "\x6d\x1e\0" },
- { 0xfa06, "\x66\xb4\0" },
- { 0xfa07, "\x8f\x3b\0" },
- { 0xfa08, "\x88\x4c\0" },
- { 0xfa09, "\x96\x4d\0" },
- { 0xfa0a, "\x89\x8b\0" },
- { 0xfa0b, "\x5e\xd3\0" },
- { 0xfa0c, "\x51\x40\0" },
- { 0xfa0d, "\x55\xc0\0" },
- { 0xfa10, "\x58\x5a\0" },
- { 0xfa12, "\x66\x74\0" },
- { 0xfa15, "\x51\xde\0" },
- { 0xfa16, "\x73\x2a\0" },
- { 0xfa17, "\x76\xca\0" },
- { 0xfa18, "\x79\x3c\0" },
- { 0xfa19, "\x79\x5e\0" },
- { 0xfa1a, "\x79\x65\0" },
- { 0xfa1b, "\x79\x8f\0" },
- { 0xfa1c, "\x97\x56\0" },
- { 0xfa1d, "\x7c\xbe\0" },
- { 0xfa1e, "\x7f\xbd\0" },
- { 0xfa20, "\x86\x12\0" },
- { 0xfa22, "\x8a\xf8\0" },
- { 0xfa25, "\x90\x38\0" },
- { 0xfa26, "\x90\xfd\0" },
- { 0xfa2a, "\x98\xef\0" },
- { 0xfa2b, "\x98\xfc\0" },
- { 0xfa2c, "\x99\x28\0" },
- { 0xfa2d, "\x9d\xb4\0" },
- { 0xfb1f, "\x05\xf2\x05\xb7\0" },
- { 0xfb2a, "\x05\xe9\x05\xc1\0" },
- { 0xfb2b, "\x05\xe9\x05\xc2\0" },
- { 0xfb2c, "\x05\xe9\x05\xbc\x05\xc1\0" },
- { 0xfb2d, "\x05\xe9\x05\xbc\x05\xc2\0" },
- { 0xfb2e, "\x05\xd0\x05\xb7\0" },
- { 0xfb2f, "\x05\xd0\x05\xb8\0" },
- { 0xfb30, "\x05\xd0\x05\xbc\0" },
- { 0xfb31, "\x05\xd1\x05\xbc\0" },
- { 0xfb32, "\x05\xd2\x05\xbc\0" },
- { 0xfb33, "\x05\xd3\x05\xbc\0" },
- { 0xfb34, "\x05\xd4\x05\xbc\0" },
- { 0xfb35, "\x05\xd5\x05\xbc\0" },
- { 0xfb36, "\x05\xd6\x05\xbc\0" },
- { 0xfb38, "\x05\xd8\x05\xbc\0" },
- { 0xfb39, "\x05\xd9\x05\xbc\0" },
- { 0xfb3a, "\x05\xda\x05\xbc\0" },
- { 0xfb3b, "\x05\xdb\x05\xbc\0" },
- { 0xfb3c, "\x05\xdc\x05\xbc\0" },
- { 0xfb3e, "\x05\xde\x05\xbc\0" },
- { 0xfb40, "\x05\xe0\x05\xbc\0" },
- { 0xfb41, "\x05\xe1\x05\xbc\0" },
- { 0xfb43, "\x05\xe3\x05\xbc\0" },
- { 0xfb44, "\x05\xe4\x05\xbc\0" },
- { 0xfb46, "\x05\xe6\x05\xbc\0" },
- { 0xfb47, "\x05\xe7\x05\xbc\0" },
- { 0xfb48, "\x05\xe8\x05\xbc\0" },
- { 0xfb49, "\x05\xe9\x05\xbc\0" },
- { 0xfb4a, "\x05\xea\x05\xbc\0" },
- { 0xfb4b, "\x05\xd5\x05\xb9\0" },
- { 0xfb4c, "\x05\xd1\x05\xbf\0" },
- { 0xfb4d, "\x05\xdb\x05\xbf\0" },
- { 0xfb4e, "\x05\xe4\x05\xbf\0" }
-};
-
-/*
- * WARNING!
- *
- * NO BUFFER CHECKING AHEAD!
- *
- */
-
-static gint
-e_canonical_decomposition (gunichar ch, gunichar * buf)
-{
- gint len = 0;
-
- if (ch <= 0xffff)
- {
- int start = 0;
- int end = sizeof (e_decomp_table) / sizeof (e_decomp_table[0]);
- while (start != end)
- {
- int half = (start + end) / 2;
- if (ch == e_decomp_table[half].ch) {
- /* Found it. */
- int i;
- /* We store as a double-nul terminated string. */
- for (len = 0; (e_decomp_table[half].expansion[len] || e_decomp_table[half].expansion[len + 1]); len += 2) ;
-
- /* We've counted twice as many bytes as there are
- characters. */
- len /= 2;
-
- for (i = 0; i < len; i ++) {
- buf[i] = (e_decomp_table[half].expansion[2 * i] << 8) | e_decomp_table[half].expansion[2 * i + 1];
- }
- break;
- } else if (ch > e_decomp_table[half].ch) {
- if (start == half) break;
- start = half;
- } else {
- if (end == half) break;
- end = half;
- }
- }
- }
-
- if (len == 0)
- {
- /* Not in our table. */
- *buf = ch;
- len = 1;
- }
-
- /* Supposedly following the Unicode 2.1.9 table means that the
- decompositions come out in canonical order. I haven't tested
- this, but we rely on it here. */
- return len;
-}
-
-static gunichar
-e_stripped_char (gunichar ch)
-{
- gunichar decomp[MAX_DECOMP];
- GUnicodeType utype;
- gint dlen;
-
- utype = g_unichar_type (ch);
-
- switch (utype) {
- case G_UNICODE_CONTROL:
- case G_UNICODE_FORMAT:
- case G_UNICODE_UNASSIGNED:
- case G_UNICODE_COMBINING_MARK:
- /* Ignore those */
- return 0;
- break;
- default:
- /* Convert to lowercase, fall through */
- ch = g_unichar_tolower (ch);
- case G_UNICODE_LOWERCASE_LETTER:
- dlen = e_canonical_decomposition (ch, decomp);
- if (dlen > 0) return *decomp;
- break;
- }
-
- return 0;
-}
-
-gchar *
-e_xml_get_translated_utf8_string_prop_by_name (const xmlNode *parent, const xmlChar *prop_name)
-{
- xmlChar *prop;
- gchar *ret_val = NULL;
- gchar *combined_name;
-
- g_return_val_if_fail (parent != NULL, 0);
- g_return_val_if_fail (prop_name != NULL, 0);
-
- prop = xmlGetProp ((xmlNode *) parent, prop_name);
- if (prop != NULL) {
- ret_val = g_strdup (prop);
- xmlFree (prop);
- return ret_val;
- }
-
- combined_name = g_strdup_printf("_%s", prop_name);
- prop = xmlGetProp ((xmlNode *) parent, combined_name);
- if (prop != NULL) {
- ret_val = g_strdup (gettext (prop));
- xmlFree (prop);
- }
- g_free(combined_name);
-
- return ret_val;
-}
diff --git a/widgets/misc/e-unicode.h b/widgets/misc/e-unicode.h
deleted file mode 100644
index 0a3b3ccafe..0000000000
--- a/widgets/misc/e-unicode.h
+++ /dev/null
@@ -1,133 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-unicode.h - utf-8 support functions for gal
- * Copyright 2000, 2001, Ximian, Inc.
- *
- * Authors:
- * Lauris Kaplinski <lauris@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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.
- */
-
-#ifndef _E_UNICODE_H_
-#define _E_UNICODE_H_
-
-#include <sys/types.h>
-#include <glib.h>
-#include <gtk/gtkclist.h>
-#include <gtk/gtkentry.h>
-#include <gtk/gtkmenu.h>
-#include <gtk/gtkwidget.h>
-#include <libxml/tree.h>
-#include <iconv.h>
-
-G_BEGIN_DECLS
-
-#define G_UTF8_IN_GAL
-
-/*
- * UTF-8 searching implementations
- *
- * e_utf8_strstrcase - case insensitive search
- * e_utf8_strstrcasedecomp - case insensitive and decompositing search (i.e. accented
- * letters are treated equal to their base letters, explicit accent marks (unicode
- * not ascii/iso ones) are ignored).
- */
-
-const gchar *e_utf8_strstrcase (const gchar *haystack,
- const gchar *needle);
-const gchar *e_utf8_strstrcasedecomp (const gchar *haystack,
- const gchar *needle);
-gchar *e_utf8_from_gtk_event_key (GtkWidget *widget,
- guint keyval,
- const gchar *string);
-gchar *e_utf8_from_iconv_string (iconv_t ic,
- const gchar *string);
-gchar *e_utf8_from_iconv_string_sized (iconv_t ic,
- const gchar *string,
- gint bytes);
-gchar *e_utf8_to_iconv_string (iconv_t ic,
- const gchar *string);
-gchar *e_utf8_to_iconv_string_sized (iconv_t ic,
- const gchar *string,
- gint bytes);
-gchar *e_utf8_from_charset_string (const gchar *charset,
- const gchar *string);
-gchar *e_utf8_from_charset_string_sized (const gchar *charset,
- const gchar *string,
- gint bytes);
-gchar *e_utf8_to_charset_string (const gchar *charset,
- const gchar *string);
-gchar *e_utf8_to_charset_string_sized (const gchar *charset,
- const gchar *string,
- gint bytes);
-gchar *e_utf8_from_gtk_string (GtkWidget *widget,
- const gchar *string);
-gchar *e_utf8_from_gtk_string_sized (GtkWidget *widget,
- const gchar *string,
- gint bytes);
-gchar *e_utf8_to_gtk_string (GtkWidget *widget,
- const gchar *string);
-gchar *e_utf8_to_gtk_string_sized (GtkWidget *widget,
- const gchar *string,
- gint bytes);
-gchar *e_utf8_from_locale_string (const gchar *string);
-gchar *e_utf8_from_locale_string_sized (const gchar *string,
- gint bytes);
-gchar *e_utf8_to_locale_string (const gchar *string);
-gchar *e_utf8_to_locale_string_sized (const gchar *string,
- gint bytes);
-gboolean e_utf8_is_ascii (const gchar *string);
-/*
- * These are simple wrappers that save us some typing
- */
-
-/* NB! This return newly allocated string, not const as gtk+ one */
-gchar *e_utf8_gtk_entry_get_text (GtkEntry *entry);
-void e_utf8_gtk_entry_set_text (GtkEntry *entry,
- const gchar *text);
-gchar *e_utf8_gtk_editable_get_text (GtkEditable *editable);
-void e_utf8_gtk_editable_set_text (GtkEditable *editable,
- const gchar *text);
-gchar *e_utf8_gtk_editable_get_chars (GtkEditable *editable,
- gint start,
- gint end);
-void e_utf8_gtk_editable_insert_text (GtkEditable *editable,
- const gchar *text,
- gint length,
- gint *position);
-GtkWidget *e_utf8_gtk_menu_item_new_with_label (GtkMenu *menu,
- const gchar *label);
-void e_utf8_gtk_clist_set_text (GtkCList *clist,
- gint row,
- gint col,
- const gchar *text);
-gint e_utf8_gtk_clist_append (GtkCList *clist,
- gchar *text[]);
-gchar *e_utf8_xml1_decode (const gchar *text);
-gchar *e_utf8_xml1_encode (const gchar *text);
-gint e_unichar_to_utf8 (gint c,
- gchar *outbuf);
-gchar *e_unicode_get_utf8 (const gchar *text,
- gunichar *out);
-guint32 gdk_keyval_to_unicode (guint keysym);
-gchar *e_xml_get_translated_utf8_string_prop_by_name (const xmlNode *parent,
- const xmlChar *prop_name);
-
-G_END_DECLS
-
-#endif
-
-
diff --git a/widgets/misc/e-url-entry.h b/widgets/misc/e-url-entry.h
index 3cf98d7b8c..93b2ff28c0 100644
--- a/widgets/misc/e-url-entry.h
+++ b/widgets/misc/e-url-entry.h
@@ -24,10 +24,6 @@
#ifndef _E_URL_ENTRY_H_
#define _E_URL_ENTRY_H_
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
#include <gtk/gtk.h>
#ifdef __cplusplus
@@ -36,10 +32,10 @@ extern "C" {
#endif /* __cplusplus */
#define E_TYPE_URL_ENTRY (e_url_entry_get_type ())
-#define E_URL_ENTRY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), E_TYPE_URL_ENTRY, EUrlEntry))
-#define E_URL_ENTRY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), E_TYPE_URL_ENTRY, EUrlEntryClass))
-#define E_IS_URL_ENTRY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), E_TYPE_URL_ENTRY))
-#define E_IS_URL_ENTRY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), E_TYPE_URL_ENTRY))
+#define E_URL_ENTRY(obj) (GTK_CHECK_CAST ((obj), E_TYPE_URL_ENTRY, EUrlEntry))
+#define E_URL_ENTRY_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), E_TYPE_URL_ENTRY, EUrlEntryClass))
+#define E_IS_URL_ENTRY(obj) (GTK_CHECK_TYPE ((obj), E_TYPE_URL_ENTRY))
+#define E_IS_URL_ENTRY_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((obj), E_TYPE_URL_ENTRY))
typedef struct _EUrlEntry EUrlEntry;
diff --git a/widgets/misc/gal-categories.glade b/widgets/misc/gal-categories.glade
deleted file mode 100644
index 98286545b3..0000000000
--- a/widgets/misc/gal-categories.glade
+++ /dev/null
@@ -1,168 +0,0 @@
-<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*-->
-<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd" >
-
-<glade-interface>
- <widget class="GtkDialog" id="categories">
- <property name="visible">no</property>
- <property name="title" translatable="yes">categories</property>
- <property name="type">GTK_WINDOW_TOPLEVEL</property>
- <property name="modal">no</property>
- <property name="allow_shrink">no</property>
- <property name="allow_grow">yes</property>
- <property name="window-position">GTK_WIN_POS_NONE</property>
-
- <child internal-child="vbox">
- <widget class="GtkVBox" id="dialog-vbox1">
- <property name="homogeneous">no</property>
- <property name="spacing">8</property>
- <property name="visible">yes</property>
-
- <child internal-child="action_area">
- <widget class="GtkHButtonBox" id="dialog-action_area1">
- <property name="layout_style">GTK_BUTTONBOX_END</property>
- <property name="spacing">8</property>
- <property name="visible">yes</property>
-
- <child>
- <widget class="GtkButton" id="button3">
- <property name="can_default">yes</property>
- <property name="can_focus">yes</property>
- <property name="visible">yes</property>
- <property name="label">gtk-ok</property>
- <property name="use_stock">yes</property>
- <property name="use_underline">yes</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkButton" id="button4">
- <property name="can_default">yes</property>
- <property name="can_focus">yes</property>
- <property name="visible">yes</property>
- <property name="label">gtk-cancel</property>
- <property name="use_stock">yes</property>
- <property name="use_underline">yes</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">no</property>
- <property name="fill">yes</property>
- <property name="pack_type">GTK_PACK_END</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkTable" id="table-categories">
- <property name="homogeneous">no</property>
- <property name="row_spacing">0</property>
- <property name="column_spacing">0</property>
- <property name="n-rows">5</property>
- <property name="n-columns">1</property>
- <property name="visible">yes</property>
-
- <child>
- <widget class="GtkEntry" id="entry-categories">
- <property name="can_focus">yes</property>
- <property name="editable">yes</property>
- <property name="text" translatable="yes"></property>
- <property name="max-length">0</property>
- <property name="visibility">yes</property>
- <property name="visible">yes</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="x_padding">0</property>
- <property name="y_padding">0</property>
- <property name="x_options">expand|fill</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label-header">
- <property name="label" translatable="yes">Item(s) belong to these _categories:</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">no</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="mnemonic_widget">entry-categories</property>
- <property name="visible">yes</property>
- <property name="use_underline">yes</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="x_padding">0</property>
- <property name="y_padding">0</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label2">
- <property name="label" translatable="yes">_Available Categories:</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">no</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="visible">yes</property>
- <property name="use_underline">yes</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">2</property>
- <property name="bottom_attach">3</property>
- <property name="x_padding">0</property>
- <property name="y_padding">0</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkButton" id="button-ecmld">
- <property name="can_focus">yes</property>
- <property name="label" translatable="yes">Edit Master Category List...</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="visible">yes</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">4</property>
- <property name="bottom_attach">5</property>
- <property name="x_padding">0</property>
- <property name="y_padding">0</property>
- <property name="x_options">expand|fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">yes</property>
- <property name="fill">yes</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">4</property>
- <property name="expand">yes</property>
- <property name="fill">yes</property>
- </packing>
- </child>
- </widget>
-</glade-interface>
diff --git a/widgets/misc/pixmaps/.cvsignore b/widgets/misc/pixmaps/.cvsignore
deleted file mode 100644
index 3dda72986f..0000000000
--- a/widgets/misc/pixmaps/.cvsignore
+++ /dev/null
@@ -1,2 +0,0 @@
-Makefile.in
-Makefile
diff --git a/widgets/misc/pixmaps/cursor_cross.xpm b/widgets/misc/pixmaps/cursor_cross.xpm
deleted file mode 100644
index cf9d0aca33..0000000000
--- a/widgets/misc/pixmaps/cursor_cross.xpm
+++ /dev/null
@@ -1,38 +0,0 @@
-/* XPM */
-static char * cursor_cross_xpm[] = {
-"32 32 3 1",
-" c None",
-". c #000000",
-"+ c #FFFFFF",
-" ",
-" ",
-" ",
-" ",
-" ",
-" ",
-" ",
-" ....... ",
-" .+++++.. ",
-" .+++++.. ",
-" .+++++.. ",
-" .+++++.. ",
-" ......+++++...... ",
-" .+++++++++++++++.. ",
-" .+++++++++++++++.. ",
-" .+++++++++++++++.. ",
-" .+++++++++++++++.. ",
-" .+++++++++++++++.. ",
-" ......+++++....... ",
-" .....+++++....... ",
-" .+++++.. ",
-" .+++++.. ",
-" .+++++.. ",
-" ........ ",
-" ....... ",
-" ",
-" ",
-" ",
-" ",
-" ",
-" ",
-" "};
diff --git a/widgets/misc/pixmaps/cursor_hand_closed.xpm b/widgets/misc/pixmaps/cursor_hand_closed.xpm
deleted file mode 100644
index 61a6de4b88..0000000000
--- a/widgets/misc/pixmaps/cursor_hand_closed.xpm
+++ /dev/null
@@ -1,38 +0,0 @@
-/* XPM */
-static char * cursor_hand_closed_xpm[] = {
-"32 32 3 1",
-" c None",
-". c #000000",
-"+ c #FFFFFF",
-" ",
-" ",
-" ",
-" ",
-" ",
-" .. ",
-" ..++... ",
-" .+++++++.. ",
-" .+++++++++. ",
-" ...+++++++++. ",
-" .++.+++++++++. ",
-" .++++++++++++. ",
-" .+++++++++++. ",
-" .++++++++++. ",
-" .+++++++++. ",
-" .+++++++. ",
-" .++++++. ",
-" .++++++. ",
-" ",
-" ",
-" ",
-" ",
-" ",
-" ",
-" ",
-" ",
-" ",
-" ",
-" ",
-" ",
-" ",
-" "};
diff --git a/widgets/misc/pixmaps/cursor_hand_open.xpm b/widgets/misc/pixmaps/cursor_hand_open.xpm
deleted file mode 100644
index 048acc8054..0000000000
--- a/widgets/misc/pixmaps/cursor_hand_open.xpm
+++ /dev/null
@@ -1,38 +0,0 @@
-/* XPM */
-static char * cursor_hand_open_xpm[] = {
-"32 32 3 1",
-" c None",
-". c #000000",
-"+ c #FFFFFF",
-" ",
-" ",
-" .. ",
-" .. .++... ",
-" .++..++.++. ",
-" .++..++.++. . ",
-" .++.++.++..+. ",
-" .++.++.++.++. ",
-" .. .+++++++.++. ",
-" .++..++++++++++. ",
-" .+++.+++++++++. ",
-" .++++++++++++. ",
-" .+++++++++++. ",
-" .++++++++++. ",
-" .+++++++++. ",
-" .+++++++. ",
-" .++++++. ",
-" .++++++. ",
-" ",
-" ",
-" ",
-" ",
-" ",
-" ",
-" ",
-" ",
-" ",
-" ",
-" ",
-" ",
-" ",
-" "};
diff --git a/widgets/misc/pixmaps/cursor_zoom_in.xpm b/widgets/misc/pixmaps/cursor_zoom_in.xpm
deleted file mode 100644
index 1caf9e3e2a..0000000000
--- a/widgets/misc/pixmaps/cursor_zoom_in.xpm
+++ /dev/null
@@ -1,37 +0,0 @@
-/* XPM */
-static char * cursor_zoom_in_xpm[] = {
-"32 32 2 1",
-" c None",
-". c #000000",
-" ",
-" ",
-" ",
-" ",
-" ",
-" ",
-" ...... ",
-" .. .. ",
-" .. .. ",
-" . . ",
-" . ... . ",
-" . ... . ",
-" . ....... . ",
-" . ....... . ",
-" . ... . ",
-" . ... .. ",
-" .. . . ",
-" .. . . . ",
-" ........ . . ",
-" ..... . . . ",
-" . . . ",
-" . . . ",
-" . . . ",
-" . . . ",
-" . . ",
-" . . ",
-" .. ",
-" ",
-" ",
-" ",
-" ",
-" "};
diff --git a/widgets/misc/pixmaps/cursor_zoom_out.xpm b/widgets/misc/pixmaps/cursor_zoom_out.xpm
deleted file mode 100644
index af1b698521..0000000000
--- a/widgets/misc/pixmaps/cursor_zoom_out.xpm
+++ /dev/null
@@ -1,37 +0,0 @@
-/* XPM */
-static char * cursor_zoom_out_xpm[] = {
-"32 32 2 1",
-" c None",
-". c #000000",
-" ",
-" ",
-" ",
-" ",
-" ",
-" ",
-" ...... ",
-" .. .. ",
-" .. .. ",
-" . . ",
-" . . ",
-" . . ",
-" . ....... . ",
-" . ....... . ",
-" . . ",
-" . .. ",
-" .. . . ",
-" .. . . . ",
-" ........ . . ",
-" ..... . . . ",
-" . . . ",
-" . . . ",
-" . . . ",
-" . . . ",
-" . . ",
-" . . ",
-" .. ",
-" ",
-" ",
-" ",
-" ",
-" "};
diff --git a/widgets/misc/test-color.c b/widgets/misc/test-color.c
deleted file mode 100644
index 364e0644de..0000000000
--- a/widgets/misc/test-color.c
+++ /dev/null
@@ -1,76 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * test-color.c
- * Copyright 2000, 2001, Ximian, Inc.
- *
- * Authors:
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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 <gal/util/e-i18n.h>
-#include <gnome.h>
-#include "widget-color-combo.h"
-#include "color-palette.h"
-#include "e-colors.h"
-#include "pixmaps/cursor_hand_open.xpm"
-
-/* To compile (from src/widgets):
-
-gcc -I.. -I../.. -L. -Wall -o tester tester.c ../color.c `gnome-config --cflags --libs gnome gnomeui` -lwidgets
-
-*/
-
-gint
-main ( gint argc, gchar* argv[] )
-{
- GtkWidget * dialog;
- GtkWidget * T;
- ColorGroup *cg;
-
- gnome_program_init ("tester", "1.0",
- LIBGNOMEUI_MODULE,
- argc, argv, NULL);
-
- dialog = gnome_dialog_new ("TESTER", GNOME_STOCK_BUTTON_OK,
- GNOME_STOCK_BUTTON_CANCEL, NULL);
-
- cg = color_group_fetch ("fore_color_group", dialog);
- T = color_palette_new ("Color Palette", NULL, cg);
-
- gtk_box_pack_start(GTK_BOX (GNOME_DIALOG (dialog)-> vbox ),
- T, TRUE, TRUE, 5);
- gtk_widget_show_all (T);
-
- cg = color_group_fetch ("fore_color_group", dialog);
- T = color_combo_new (
- gdk_pixbuf_new_from_xpm_data ((char const **)cursor_hand_open_xpm),
- _("Automatic"), &e_black, cg);
- gtk_box_pack_start(GTK_BOX (GNOME_DIALOG (dialog)-> vbox ),
- T, TRUE, TRUE, 5);
- gtk_widget_show_all (T);
-
- cg = color_group_fetch ("back_color_group", dialog);
- T = color_combo_new (
- gdk_pixbuf_new_from_xpm_data ((char const **)cursor_hand_open_xpm),
- _("Automatic"), &e_black, cg);
- gtk_box_pack_start(GTK_BOX (GNOME_DIALOG (dialog)-> vbox ),
- T, TRUE, TRUE, 5);
- gtk_widget_show_all (T);
-
- gnome_dialog_run_and_close ( GNOME_DIALOG (dialog) );
- return 0;
-}
diff --git a/widgets/table/.cvsignore b/widgets/table/.cvsignore
deleted file mode 100644
index b1004fee2c..0000000000
--- a/widgets/table/.cvsignore
+++ /dev/null
@@ -1,13 +0,0 @@
-.deps
-.libs
-.pure
-Makefile
-Makefile.in
-*.lo
-*.la
-table-test
-table-example-1
-table-example-2
-table-size-test
-tree-example-1
-tree-example-2
diff --git a/widgets/table/add-col.xpm b/widgets/table/add-col.xpm
deleted file mode 100644
index 9c5f314c8e..0000000000
--- a/widgets/table/add-col.xpm
+++ /dev/null
@@ -1,22 +0,0 @@
-/* XPM */
-static char * add_col_xpm[] = {
-"16 16 3 1",
-" c None",
-". c #000000",
-"+ c #FFFFFF",
-" ",
-" ",
-" ",
-" ",
-" .............. ",
-" .++++++++++++. ",
-" .++++++++++++. ",
-" ....+++....... ",
-" .+. ",
-" . ",
-" ",
-" ",
-" ",
-" ",
-" ",
-" "};
diff --git a/widgets/table/arrow-down.xpm b/widgets/table/arrow-down.xpm
deleted file mode 100644
index f1e6cb4b3c..0000000000
--- a/widgets/table/arrow-down.xpm
+++ /dev/null
@@ -1,21 +0,0 @@
-/* XPM */
-static const char * arrow_down_xpm[] = {
-"13 16 2 1",
-" c None",
-". c #FF0000",
-" ... ",
-" ... ",
-" ... ",
-" ... ",
-" ... ",
-" ... ",
-" ... ",
-" ... ",
-" ... ",
-".............",
-" ........... ",
-" ......... ",
-" ....... ",
-" ..... ",
-" ... ",
-" . "};
diff --git a/widgets/table/arrow-up.xpm b/widgets/table/arrow-up.xpm
deleted file mode 100644
index 0cc5b9a00c..0000000000
--- a/widgets/table/arrow-up.xpm
+++ /dev/null
@@ -1,21 +0,0 @@
-/* XPM */
-static const char * arrow_up_xpm[] = {
-"13 16 2 1",
-" c None",
-". c #FF0000",
-" . ",
-" ... ",
-" ..... ",
-" ....... ",
-" ......... ",
-" ........... ",
-".............",
-" ... ",
-" ... ",
-" ... ",
-" ... ",
-" ... ",
-" ... ",
-" ... ",
-" ... ",
-" ... "};
diff --git a/widgets/table/check-empty.xpm b/widgets/table/check-empty.xpm
deleted file mode 100644
index 746b20234e..0000000000
--- a/widgets/table/check-empty.xpm
+++ /dev/null
@@ -1,21 +0,0 @@
-/* XPM */
-static const char * check_empty_xpm[] = {
-"16 16 2 1",
-" c None",
-". c #000000",
-" ",
-" ",
-" ............ ",
-" . . ",
-" . . ",
-" . . ",
-" . . ",
-" . . ",
-" . . ",
-" . . ",
-" . . ",
-" . . ",
-" . . ",
-" ............ ",
-" ",
-" "};
diff --git a/widgets/table/check-filled.xpm b/widgets/table/check-filled.xpm
deleted file mode 100644
index c0468fc25b..0000000000
--- a/widgets/table/check-filled.xpm
+++ /dev/null
@@ -1,21 +0,0 @@
-/* XPM */
-static const char * check_filled_xpm[] = {
-"16 16 2 1",
-" c None",
-". c #000000",
-" ",
-" ",
-" ............ ",
-" . . ",
-" . . . ",
-" . .. . ",
-" . ... . ",
-" . . ... . ",
-" . .. ... . ",
-" . ..... . ",
-" . ... . ",
-" . . . ",
-" . . ",
-" ............ ",
-" ",
-" "};
diff --git a/widgets/table/clip.png b/widgets/table/clip.png
deleted file mode 100644
index 27aa5f072f..0000000000
--- a/widgets/table/clip.png
+++ /dev/null
Binary files differ
diff --git a/widgets/table/e-cell-checkbox.c b/widgets/table/e-cell-checkbox.c
deleted file mode 100644
index 5ef4b23a96..0000000000
--- a/widgets/table/e-cell-checkbox.c
+++ /dev/null
@@ -1,67 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-cell-checkbox.c: Checkbox cell renderer
- * Copyright 1999, 2000, Ximian, Inc.
- *
- * Authors:
- * Miguel de Icaza <miguel@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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 <gtk/gtkenums.h>
-#include <gtk/gtkentry.h>
-#include <gtk/gtkwindow.h>
-#include <gtk/gtksignal.h>
-#include <gdk/gdkkeysyms.h>
-#include <libgnomecanvas/gnome-canvas.h>
-#include "e-cell-checkbox.h"
-#include "gal/util/e-util.h"
-#include "e-table-item.h"
-
-#include "check-empty.xpm"
-#include "check-filled.xpm"
-
-#define PARENT_TYPE e_cell_toggle_get_type ()
-
-static GdkPixbuf *checks [2];
-
-static void
-e_cell_checkbox_class_init (GtkObjectClass *object_class)
-{
- checks [0] = gdk_pixbuf_new_from_xpm_data (check_empty_xpm);
- checks [1] = gdk_pixbuf_new_from_xpm_data (check_filled_xpm);
-}
-
-E_MAKE_TYPE(e_cell_checkbox, "ECellCheckbox", ECellCheckbox, e_cell_checkbox_class_init, NULL, PARENT_TYPE)
-
-/**
- * e_cell_checkbox_new:
- *
- * Creates a new ECell renderer that can be used to render check
- * boxes. the data provided from the model is cast to an integer.
- * zero is used for the off display, and non-zero for checked status.
- *
- * Returns: an ECell object that can be used to render checkboxes.
- */
-ECell *
-e_cell_checkbox_new (void)
-{
- ECellCheckbox *eccb = g_object_new (E_CELL_CHECKBOX_TYPE, NULL);
-
- e_cell_toggle_construct (E_CELL_TOGGLE (eccb), 2, 2, checks);
-
- return (ECell *) eccb;
-}
diff --git a/widgets/table/e-cell-checkbox.h b/widgets/table/e-cell-checkbox.h
deleted file mode 100644
index ab56af27ab..0000000000
--- a/widgets/table/e-cell-checkbox.h
+++ /dev/null
@@ -1,50 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-cell-checkbox.h: Checkbox cell renderer
- * Copyright 1999, 2000, Ximian, Inc.
- *
- * Authors:
- * Miguel de Icaza <miguel@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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.
- */
-#ifndef _E_CELL_CHECKBOX_H_
-#define _E_CELL_CHECKBOX_H_
-
-#include <gal/e-table/e-cell-toggle.h>
-
-G_BEGIN_DECLS
-
-#define E_CELL_CHECKBOX_TYPE (e_cell_checkbox_get_type ())
-#define E_CELL_CHECKBOX(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), E_CELL_CHECKBOX_TYPE, ECellCheckbox))
-#define E_CELL_CHECKBOX_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), E_CELL_CHECKBOX_TYPE, ECellCheckboxClass))
-#define E_IS_CELL_CHECKBOX(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), E_CELL_CHECKBOX_TYPE))
-#define E_IS_CELL_CHECKBOX_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), E_CELL_CHECKBOX_TYPE))
-
-typedef struct {
- ECellToggle parent;
-} ECellCheckbox;
-
-typedef struct {
- ECellToggleClass parent_class;
-} ECellCheckboxClass;
-
-GType e_cell_checkbox_get_type (void);
-ECell *e_cell_checkbox_new (void);
-
-G_END_DECLS
-
-#endif /* _E_CELL_CHECKBOX_H_ */
-
diff --git a/widgets/table/e-cell-combo.c b/widgets/table/e-cell-combo.c
deleted file mode 100644
index 3199e9b917..0000000000
--- a/widgets/table/e-cell-combo.c
+++ /dev/null
@@ -1,658 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-cell-combo.c: Combo cell renderer
- * Copyright 2001, Ximian, Inc.
- *
- * Authors:
- * Damon Chaplin <damon@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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.
- */
-
-/*
- * ECellCombo - a subclass of ECellPopup used to support popup lists like a
- * GtkCombo widget. It only supports a basic popup list of strings at present,
- * with no auto-completion.
- */
-
-/*
- * Notes: (handling pointer grabs and GTK+ grabs is a nightmare!)
- *
- * o We must grab the pointer when we show the popup, so that if any buttons
- * are pressed outside the application we hide the popup.
- *
- * o We have to be careful when popping up any widgets which also grab the
- * pointer at some point, since we will lose our own pointer grab.
- * When we pop up a list it will grab the pointer itself when an item is
- * selected, and release the grab when the button is released.
- * Fortunately we hide the popup at this point, so it isn't a problem.
- * But for other types of widgets in the popup it could cause trouble.
- * - I think GTK+ should provide help for this (nested pointer grabs?).
- *
- * o We must set the 'owner_events' flag of the pointer grab to TRUE so that
- * pointer events get reported to all the application windows as normal.
- * If we don't do this then the widgets in the popup may not work properly.
- *
- * o We must do a gtk_grab_add() so that we only allow events to go to the
- * widgets within the popup (though some special events still get reported
- * to the widget owning the window). Doing th gtk_grab_add() on the toplevel
- * popup window should be fine. We can then check for any events that should
- * close the popup, like the Escape key, or a button press outside the popup.
- */
-
-#include <config.h>
-#include <string.h> /* strcmp() */
-#include <gdk/gdkkeysyms.h>
-#include <gtk/gtk.h>
-#include "gal/util/e-util.h"
-#include "gal/widgets/e-unicode.h"
-#include "e-table-item.h"
-#include "e-cell-combo.h"
-#include "e-cell-text.h"
-
-#define d(x)
-
-
-/* The height to make the popup list if there aren't any items in it. */
-#define E_CELL_COMBO_LIST_EMPTY_HEIGHT 15
-
-/* The object data key used to store the UTF-8 text of the popup list items. */
-#define E_CELL_COMBO_UTF8_KEY "UTF-8-TEXT"
-
-
-static void e_cell_combo_class_init (GObjectClass *object_class);
-static void e_cell_combo_init (ECellCombo *ecc);
-static void e_cell_combo_dispose (GObject *object);
-
-static gint e_cell_combo_do_popup (ECellPopup *ecp,
- GdkEvent *event,
- int row,
- int view_col);
-static void e_cell_combo_select_matching_item (ECellCombo *ecc);
-static void e_cell_combo_show_popup (ECellCombo *ecc,
- int row,
- int view_col);
-static void e_cell_combo_get_popup_pos (ECellCombo *ecc,
- int row,
- int view_col,
- gint *x,
- gint *y,
- gint *height,
- gint *width);
-
-static gint e_cell_combo_button_press (GtkWidget *popup_window,
- GdkEvent *event,
- ECellCombo *ecc);
-static gint e_cell_combo_button_release (GtkWidget *popup_window,
- GdkEventButton *event,
- ECellCombo *ecc);
-static int e_cell_combo_key_press (GtkWidget *popup_window,
- GdkEventKey *event,
- ECellCombo *ecc);
-
-static void e_cell_combo_update_cell (ECellCombo *ecc);
-static void e_cell_combo_restart_edit (ECellCombo *ecc);
-
-
-static ECellPopupClass *parent_class;
-
-
-E_MAKE_TYPE (e_cell_combo, "ECellCombo", ECellCombo,
- e_cell_combo_class_init, e_cell_combo_init,
- e_cell_popup_get_type())
-
-
-static void
-e_cell_combo_class_init (GObjectClass *object_class)
-{
- ECellPopupClass *ecpc = (ECellPopupClass *) object_class;
-
- object_class->dispose = e_cell_combo_dispose;
-
- ecpc->popup = e_cell_combo_do_popup;
-
- parent_class = g_type_class_ref (E_CELL_POPUP_TYPE);
-}
-
-
-static void
-e_cell_combo_init (ECellCombo *ecc)
-{
- GtkWidget *frame;
-
- /* We create one popup window for the ECell, since there will only
- ever be one popup in use at a time. */
- ecc->popup_window = gtk_window_new (GTK_WINDOW_POPUP);
-
- gtk_window_set_policy (GTK_WINDOW (ecc->popup_window),
- TRUE, TRUE, FALSE);
-
- frame = gtk_frame_new (NULL);
- gtk_container_add (GTK_CONTAINER (ecc->popup_window), frame);
- gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_OUT);
- gtk_widget_show (frame);
-
- ecc->popup_scrolled_window = gtk_scrolled_window_new (NULL, NULL);
- gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (ecc->popup_scrolled_window),
- GTK_POLICY_AUTOMATIC,
- GTK_POLICY_AUTOMATIC);
- GTK_WIDGET_UNSET_FLAGS (GTK_SCROLLED_WINDOW (ecc->popup_scrolled_window)->hscrollbar, GTK_CAN_FOCUS);
- GTK_WIDGET_UNSET_FLAGS (GTK_SCROLLED_WINDOW (ecc->popup_scrolled_window)->vscrollbar, GTK_CAN_FOCUS);
- gtk_container_add (GTK_CONTAINER (frame), ecc->popup_scrolled_window);
- gtk_widget_show (ecc->popup_scrolled_window);
-
- ecc->popup_list = gtk_list_new ();
- gtk_list_set_selection_mode (GTK_LIST (ecc->popup_list),
- GTK_SELECTION_BROWSE);
- gtk_scrolled_window_add_with_viewport (GTK_SCROLLED_WINDOW (ecc->popup_scrolled_window), ecc->popup_list);
- gtk_container_set_focus_vadjustment (GTK_CONTAINER (ecc->popup_list),
- gtk_scrolled_window_get_vadjustment (GTK_SCROLLED_WINDOW (ecc->popup_scrolled_window)));
- gtk_container_set_focus_hadjustment (GTK_CONTAINER (ecc->popup_list),
- gtk_scrolled_window_get_hadjustment (GTK_SCROLLED_WINDOW (ecc->popup_scrolled_window)));
- gtk_widget_show (ecc->popup_list);
-
- g_signal_connect (ecc->popup_window,
- "button_press_event",
- G_CALLBACK (e_cell_combo_button_press),
- ecc);
- /* We use connect_after here so the list updates the selection before
- we hide the popup and update the cell. */
- g_signal_connect_after (ecc->popup_window,
- "button_release_event",
- G_CALLBACK (e_cell_combo_button_release),
- ecc);
- g_signal_connect (ecc->popup_window,
- "key_press_event",
- G_CALLBACK (e_cell_combo_key_press), ecc);
-}
-
-
-/**
- * e_cell_combo_new:
- *
- * Creates a new ECellCombo renderer.
- *
- * Returns: an ECellCombo object.
- */
-ECell *
-e_cell_combo_new (void)
-{
- ECellCombo *ecc = g_object_new (E_CELL_COMBO_TYPE, NULL);
-
- return (ECell*) ecc;
-}
-
-
-/*
- * GObject::dispose method
- */
-static void
-e_cell_combo_dispose (GObject *object)
-{
- ECellCombo *ecc = E_CELL_COMBO (object);
-
- if (ecc->popup_window)
- gtk_widget_destroy (ecc->popup_window);
- ecc->popup_window = NULL;
-
- G_OBJECT_CLASS (parent_class)->dispose (object);
-}
-
-
-
-void
-e_cell_combo_set_popdown_strings (ECellCombo *ecc,
- GList *strings)
-{
- GList *elem;
- GtkWidget *listitem;
-
- g_return_if_fail (E_IS_CELL_COMBO (ecc));
- g_return_if_fail (strings != NULL);
-
- gtk_list_clear_items (GTK_LIST (ecc->popup_list), 0, -1);
- elem = strings;
- while (elem) {
- char *utf8_text = elem->data;
-
- /* We store a copy of the UTF-8 text as data inside the
- listitem, but convert it to the current locale to go in
- the listitem widget. */
- char *locale_text = e_utf8_to_locale_string (utf8_text);
-
- listitem = gtk_list_item_new_with_label (locale_text);
- g_free (locale_text);
-
- gtk_widget_show (listitem);
- gtk_container_add (GTK_CONTAINER (ecc->popup_list), listitem);
-
- g_object_set_data_full (G_OBJECT (listitem),
- E_CELL_COMBO_UTF8_KEY,
- g_strdup (utf8_text), g_free);
-
- elem = elem->next;
- }
-}
-
-
-static gint
-e_cell_combo_do_popup (ECellPopup *ecp,
- GdkEvent *event,
- int row,
- int view_col)
-{
- ECellCombo *ecc = E_CELL_COMBO (ecp);
- guint32 time;
- gint error_code;
-
- e_cell_combo_show_popup (ecc, row, view_col);
- e_cell_combo_select_matching_item (ecc);
-
- if (event->type == GDK_BUTTON_PRESS) {
- GTK_LIST (ecc->popup_list)->drag_selection = TRUE;
- time = event->button.time;
- } else {
- time = event->key.time;
- }
-
- error_code = gdk_pointer_grab (ecc->popup_list->window, TRUE,
- GDK_ENTER_NOTIFY_MASK |
- GDK_BUTTON_PRESS_MASK |
- GDK_BUTTON_RELEASE_MASK |
- GDK_POINTER_MOTION_HINT_MASK |
- GDK_BUTTON1_MOTION_MASK,
- NULL, NULL, time);
- if (error_code != 0)
- g_warning ("Failed to get pointer grab (%i)", error_code);
- gtk_grab_add (ecc->popup_window);
-
- return TRUE;
-}
-
-
-static void
-e_cell_combo_select_matching_item (ECellCombo *ecc)
-{
- ECellPopup *ecp = E_CELL_POPUP (ecc);
- ECellView *ecv = (ECellView*) ecp->popup_cell_view;
- ECellText *ecell_text = E_CELL_TEXT (ecp->child);
- ETableItem *eti = E_TABLE_ITEM (ecp->popup_cell_view->cell_view.e_table_item_view);
- ETableCol *ecol;
- GtkList *list;
- GtkWidget *listitem;
- GList *elem;
- gboolean found = FALSE;
- char *cell_text, *list_item_text;
-
- ecol = e_table_header_get_column (eti->header, ecp->popup_view_col);
- cell_text = e_cell_text_get_text (ecell_text, ecv->e_table_model,
- ecol->col_idx, ecp->popup_row);
-
- list = GTK_LIST (ecc->popup_list);
- elem = list->children;
- while (elem) {
- listitem = GTK_WIDGET (elem->data);
-
- /* We need to compare against the UTF-8 text. */
- list_item_text = g_object_get_data (G_OBJECT (listitem),
- E_CELL_COMBO_UTF8_KEY);
-
- if (list_item_text && !strcmp (list_item_text, cell_text)) {
- found = TRUE;
- gtk_list_select_child (list, listitem);
- gtk_widget_grab_focus (listitem);
- break;
- }
-
- elem = elem->next;
- }
-
- if (!found) {
- gtk_list_unselect_all (list);
- if (list->children)
- gtk_widget_grab_focus (GTK_WIDGET (list->children->data));
- }
-
- e_cell_text_free_text (ecell_text, cell_text);
-}
-
-
-static void
-e_cell_combo_show_popup (ECellCombo *ecc, int row, int view_col)
-{
- gint x, y, width, height, old_width, old_height;
-
- /* This code is practically copied from GtkCombo. */
- old_width = ecc->popup_window->allocation.width;
- old_height = ecc->popup_window->allocation.height;
-
- e_cell_combo_get_popup_pos (ecc, row, view_col, &x, &y, &height, &width);
-
- /* workaround for gtk_scrolled_window_size_allocate bug */
- if (old_width != width || old_height != height) {
- gtk_widget_hide (GTK_SCROLLED_WINDOW (ecc->popup_scrolled_window)->hscrollbar);
- gtk_widget_hide (GTK_SCROLLED_WINDOW (ecc->popup_scrolled_window)->vscrollbar);
- }
-
- gtk_widget_set_uposition (ecc->popup_window, x, y);
- gtk_widget_set_usize (ecc->popup_window, width, height);
- gtk_widget_realize (ecc->popup_window);
- gdk_window_resize (ecc->popup_window->window, width, height);
- gtk_widget_show (ecc->popup_window);
-
- e_cell_popup_set_shown (E_CELL_POPUP (ecc), TRUE);
- d(g_print("%s: popup_shown = TRUE\n", __FUNCTION__));
-}
-
-
-/* Calculates the size and position of the popup window (like GtkCombo). */
-static void
-e_cell_combo_get_popup_pos (ECellCombo *ecc,
- int row,
- int view_col,
- gint *x,
- gint *y,
- gint *height,
- gint *width)
-{
- ECellPopup *ecp = E_CELL_POPUP (ecc);
- ETableItem *eti = E_TABLE_ITEM (ecp->popup_cell_view->cell_view.e_table_item_view);
- GtkWidget *canvas = GTK_WIDGET (GNOME_CANVAS_ITEM (eti)->canvas);
- GtkBin *popwin;
- GtkScrolledWindow *popup;
- GtkRequisition list_requisition;
- gboolean show_vscroll = FALSE, show_hscroll = FALSE;
- gint avail_height, avail_width, min_height, work_height, screen_width;
- gint column_width, row_height, scrollbar_width;
- double x1, y1;
- double wx, wy;
-
- /* This code is practically copied from GtkCombo. */
- popup = GTK_SCROLLED_WINDOW (ecc->popup_scrolled_window);
- popwin = GTK_BIN (ecc->popup_window);
-
- gdk_window_get_origin (canvas->window, x, y);
-
- x1 = e_table_header_col_diff (eti->header, 0, view_col + 1);
- y1 = e_table_item_row_diff (eti, 0, row + 1);
- column_width = e_table_header_col_diff (eti->header, view_col,
- view_col + 1);
- row_height = e_table_item_row_diff (eti, row,
- row + 1);
- gnome_canvas_item_i2w (GNOME_CANVAS_ITEM (eti), &x1, &y1);
-
- gnome_canvas_world_to_window (GNOME_CANVAS (canvas),
- x1,
- y1,
- &wx,
- &wy);
- x1 = wx;
- y1 = wy;
-
- *x += x1;
- /* The ETable positions don't include the grid lines, I think, so we
- add 1. */
- *y += y1 + 1;
-
- scrollbar_width = popup->vscrollbar->requisition.width
- + GTK_SCROLLED_WINDOW_CLASS (GTK_OBJECT_GET_CLASS (popup))->scrollbar_spacing;
-
- avail_height = gdk_screen_height () - *y;
-
- /* We'll use the entire screen width if needed, but we save space for
- the vertical scrollbar in case we need to show that. */
- screen_width = gdk_screen_width ();
- avail_width = screen_width - scrollbar_width;
-
- gtk_widget_size_request (ecc->popup_list, &list_requisition);
- min_height = MIN (list_requisition.height,
- popup->vscrollbar->requisition.height);
- if (!GTK_LIST (ecc->popup_list)->children)
- list_requisition.height += E_CELL_COMBO_LIST_EMPTY_HEIGHT;
-
- /* Calculate the desired width. */
- *width = list_requisition.width
- + 2 * popwin->child->style->xthickness
- + 2 * GTK_CONTAINER (popwin->child)->border_width
- + 2 * GTK_CONTAINER (popup)->border_width
- + 2 * GTK_CONTAINER (GTK_BIN (popup)->child)->border_width
- + 2 * GTK_BIN (popup)->child->style->xthickness;
-
- /* Use at least the same width as the column. */
- if (*width < column_width)
- *width = column_width;
-
- /* If it is larger than the available width, use that instead and show
- the horizontal scrollbar. */
- if (*width > avail_width) {
- *width = avail_width;
- show_hscroll = TRUE;
- }
-
- /* Calculate all the borders etc. that we need to add to the height. */
- work_height = (2 * popwin->child->style->ythickness
- + 2 * GTK_CONTAINER (popwin->child)->border_width
- + 2 * GTK_CONTAINER (popup)->border_width
- + 2 * GTK_CONTAINER (GTK_BIN (popup)->child)->border_width
- + 2 * GTK_BIN (popup)->child->style->xthickness);
-
- /* Add on the height of the horizontal scrollbar if we need it. */
- if (show_hscroll)
- work_height += popup->hscrollbar->requisition.height +
- GTK_SCROLLED_WINDOW_CLASS (GTK_OBJECT_GET_CLASS (popup))->scrollbar_spacing;
-
- /* Check if it fits in the available height. */
- if (work_height + list_requisition.height > avail_height) {
- /* It doesn't fit, so we see if we have the minimum space
- needed. */
- if (work_height + min_height > avail_height
- && *y - row_height > avail_height) {
- /* We don't, so we show the popup above the cell
- instead of below it. */
- avail_height = *y - row_height;
- *y -= (work_height + list_requisition.height
- + row_height);
- if (*y < 0)
- *y = 0;
- }
- }
-
- /* Check if we still need the vertical scrollbar. */
- if (work_height + list_requisition.height > avail_height) {
- *width += scrollbar_width;
- show_vscroll = TRUE;
- }
-
- /* We try to line it up with the right edge of the column, but we don't
- want it to go off the edges of the screen. */
- if (*x > screen_width)
- *x = screen_width;
- *x -= *width;
- if (*x < 0)
- *x = 0;
-
- if (show_vscroll)
- *height = avail_height;
- else
- *height = work_height + list_requisition.height;
-}
-
-
-
-
-/* This handles button press events in the popup window.
- Note that since we have a pointer grab on this window, we also get button
- press events for windows outside the application here, so we hide the popup
- window if that happens. We also get propagated events from child widgets
- which we ignore. */
-static gint
-e_cell_combo_button_press (GtkWidget *popup_window,
- GdkEvent *event,
- ECellCombo *ecc)
-{
- GtkWidget *event_widget;
-
- event_widget = gtk_get_event_widget (event);
-
- /* If the button press was for a widget inside the popup list, but
- not the popup window itself, then we ignore the event and return
- FALSE. Otherwise we will hide the popup.
- Note that since we have a pointer grab on the popup list, button
- presses outside the application will be reported to this window,
- which is why we hide the popup in this case. */
- while (event_widget) {
- event_widget = event_widget->parent;
- if (event_widget == ecc->popup_list)
- return FALSE;
- }
-
- gtk_grab_remove (ecc->popup_window);
- gdk_pointer_ungrab (event->button.time);
- gtk_widget_hide (ecc->popup_window);
-
- e_cell_popup_set_shown (E_CELL_POPUP (ecc), FALSE);
- d(g_print("%s: popup_shown = FALSE\n", __FUNCTION__));
-
- /* We don't want to update the cell here. Since the list is in browse
- mode there will always be one item selected, so when we popup the
- list one item is selected even if it doesn't match the current text
- in the cell. So if you click outside the popup (which is what has
- happened here) it is better to not update the cell. */
- /*e_cell_combo_update_cell (ecc);*/
- e_cell_combo_restart_edit (ecc);
-
- return TRUE;
-}
-
-
-/* This handles button release events in the popup window. If the button is
- released inside the list, we want to hide the popup window and update the
- cell with the new selection. */
-static gint
-e_cell_combo_button_release (GtkWidget *popup_window,
- GdkEventButton *event,
- ECellCombo *ecc)
-{
- GtkWidget *event_widget;
-
- event_widget = gtk_get_event_widget ((GdkEvent*) event);
-
- /* See if the button was released in the list (or its children). */
- while (event_widget && event_widget != ecc->popup_list)
- event_widget = event_widget->parent;
-
- /* If it wasn't, then we just ignore the event. */
- if (event_widget != ecc->popup_list)
- return FALSE;
-
- /* The button was released inside the list, so we hide the popup and
- update the cell to reflect the new selection. */
- gtk_grab_remove (ecc->popup_window);
- gdk_pointer_ungrab (event->time);
- gtk_widget_hide (ecc->popup_window);
-
- e_cell_popup_set_shown (E_CELL_POPUP (ecc), FALSE);
- d(g_print("%s: popup_shown = FALSE\n", __FUNCTION__));
-
- e_cell_combo_update_cell (ecc);
- e_cell_combo_restart_edit (ecc);
-
- return TRUE;
-}
-
-
-/* This handles key press events in the popup window. If the Escape key is
- pressed we hide the popup, and do not change the cell contents. */
-static int
-e_cell_combo_key_press (GtkWidget *popup_window,
- GdkEventKey *event,
- ECellCombo *ecc)
-{
- /* If the Escape key is pressed we hide the popup. */
- if (event->keyval != GDK_Escape
- && event->keyval != GDK_Return
- && event->keyval != GDK_KP_Enter
- && event->keyval != GDK_ISO_Enter
- && event->keyval != GDK_3270_Enter)
- return FALSE;
-
- gtk_grab_remove (ecc->popup_window);
- gdk_pointer_ungrab (event->time);
- gtk_widget_hide (ecc->popup_window);
-
- e_cell_popup_set_shown (E_CELL_POPUP (ecc), FALSE);
- d(g_print("%s: popup_shown = FALSE\n", __FUNCTION__));
-
- if (event->keyval != GDK_Escape)
- e_cell_combo_update_cell (ecc);
-
- e_cell_combo_restart_edit (ecc);
-
- return TRUE;
-}
-
-
-static void
-e_cell_combo_update_cell (ECellCombo *ecc)
-{
- ECellPopup *ecp = E_CELL_POPUP (ecc);
- ECellView *ecv = (ECellView*) ecp->popup_cell_view;
- ECellText *ecell_text = E_CELL_TEXT (ecp->child);
- ETableItem *eti = E_TABLE_ITEM (ecv->e_table_item_view);
- ETableCol *ecol;
- GtkList *list = GTK_LIST (ecc->popup_list);
- GtkListItem *listitem;
- gchar *text, *old_text;
-
- /* Return if no item is selected. */
- if (list->selection == NULL)
- return;
-
- /* Get the text of the selected item. */
- listitem = list->selection->data;
- text = g_object_get_data (G_OBJECT (listitem),
- E_CELL_COMBO_UTF8_KEY);
- g_return_if_fail (text != NULL);
-
- /* Compare it with the existing cell contents. */
- ecol = e_table_header_get_column (eti->header, ecp->popup_view_col);
-
- old_text = e_cell_text_get_text (ecell_text, ecv->e_table_model,
- ecol->col_idx, ecp->popup_row);
-
- /* If they are different, update the cell contents. */
- if (old_text && strcmp (old_text, text)) {
- e_cell_text_set_value (ecell_text, ecv->e_table_model,
- ecol->col_idx, ecp->popup_row, text);
- }
-
- e_cell_text_free_text (ecell_text, old_text);
-}
-
-
-static void
-e_cell_combo_restart_edit (ECellCombo *ecc)
-{
- /* This doesn't work. ETable stops the edit straight-away again. */
-#if 0
- ECellView *ecv = (ECellView*) ecc->popup_cell_view;
- ETableItem *eti = E_TABLE_ITEM (ecv->e_table_item_view);
-
- e_table_item_enter_edit (eti, ecc->popup_view_col, ecc->popup_row);
-#endif
-}
-
-
-
diff --git a/widgets/table/e-cell-combo.h b/widgets/table/e-cell-combo.h
deleted file mode 100644
index 23d5ac26a4..0000000000
--- a/widgets/table/e-cell-combo.h
+++ /dev/null
@@ -1,63 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-cell-combo.h: Combo cell renderer
- * Copyright 2001, Ximian, Inc.
- *
- * Author :
- * Damon Chaplin <damon@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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.
- */
-
-/*
- * ECellCombo - a subclass of ECellPopup used to support popup lists like a
- * GtkCombo widget. It only supports a basic popup list of strings at present,
- * with no auto-completion. The child ECell of the ECellPopup must be an
- * ECellText or subclass.
- */
-
-#ifndef _E_CELL_COMBO_H_
-#define _E_CELL_COMBO_H_
-
-#include <gal/e-table/e-cell-popup.h>
-
-#define E_CELL_COMBO_TYPE (e_cell_combo_get_type ())
-#define E_CELL_COMBO(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), E_CELL_COMBO_TYPE, ECellCombo))
-#define E_CELL_COMBO_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), E_CELL_COMBO_TYPE, ECellComboClass))
-#define E_IS_CELL_COMBO(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), E_CELL_COMBO_TYPE))
-#define E_IS_CELL_COMBO_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), E_CELL_COMBO_TYPE))
-
-
-typedef struct {
- ECellPopup parent;
-
- GtkWidget *popup_window;
- GtkWidget *popup_scrolled_window;
- GtkWidget *popup_list;
-} ECellCombo;
-
-typedef struct {
- ECellPopupClass parent_class;
-} ECellComboClass;
-
-
-GType e_cell_combo_get_type (void);
-ECell *e_cell_combo_new (void);
-
-/* These must be UTF-8. */
-void e_cell_combo_set_popdown_strings (ECellCombo *ecc,
- GList *strings);
-
-#endif /* _E_CELL_COMBO_H_ */
diff --git a/widgets/table/e-cell-date.c b/widgets/table/e-cell-date.c
deleted file mode 100644
index ce2355197b..0000000000
--- a/widgets/table/e-cell-date.c
+++ /dev/null
@@ -1,183 +0,0 @@
-/*
- * e-cell-date.c - Date item for e-table.
- * Copyright 2001, Ximian, Inc.
- *
- * Author:
- * Chris Lahey <clahey@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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 "e-cell-date.h"
-
-#include <sys/time.h>
-#include <time.h>
-#include <unistd.h>
-#include <string.h>
-#include <gal/util/e-util.h>
-#include <gal/widgets/e-unicode.h>
-#include <gal/util/e-i18n.h>
-
-#define PARENT_TYPE e_cell_text_get_type ()
-
-static ECellTextClass *parent_class;
-
-static char *
-ecd_get_text(ECellText *cell, ETableModel *model, int col, int row)
-{
- time_t date = GPOINTER_TO_INT (e_table_model_value_at(model, col, row));
- time_t nowdate = time(NULL);
- time_t yesdate;
- struct tm then, now, yesterday;
- char buf[26];
- char *temp, *ret_val;
- gboolean done = FALSE;
-
- if (date == 0) {
- return g_strdup (_("?"));
- }
-
- localtime_r (&date, &then);
- localtime_r (&nowdate, &now);
-
- if (nowdate - date < 60 * 60 * 8 && nowdate > date) {
- e_strftime_fix_am_pm (buf, 26, _("%l:%M %p"), &then);
- done = TRUE;
- }
-
- if (!done) {
- if (then.tm_mday == now.tm_mday &&
- then.tm_mon == now.tm_mon &&
- then.tm_year == now.tm_year) {
- e_strftime_fix_am_pm (buf, 26, _("Today %l:%M %p"), &then);
- done = TRUE;
- }
- }
- if (!done) {
- yesdate = nowdate - 60 * 60 * 24;
- localtime_r (&yesdate, &yesterday);
- if (then.tm_mday == yesterday.tm_mday &&
- then.tm_mon == yesterday.tm_mon &&
- then.tm_year == yesterday.tm_year) {
-#if 0
- if (nowdate - date < 60 * 60 * 12) {
- e_strftime_fix_am_pm (buf, 26, _("Late Yesterday %l:%M %p"), &then);
- } else {
-#endif
- e_strftime_fix_am_pm (buf, 26, _("Yesterday %l:%M %p"), &then);
-#if 0
- }
-#endif
- done = TRUE;
- }
- }
- if (!done) {
- int i;
- for (i = 2; i < 7; i++) {
- yesdate = nowdate - 60 * 60 * 24 * i;
- localtime_r (&yesdate, &yesterday);
- if (then.tm_mday == yesterday.tm_mday &&
- then.tm_mon == yesterday.tm_mon &&
- then.tm_year == yesterday.tm_year) {
- e_strftime_fix_am_pm (buf, 26, _("%a %l:%M %p"), &then);
- done = TRUE;
- break;
- }
- }
- }
- if (!done) {
- if (then.tm_year == now.tm_year) {
- e_strftime_fix_am_pm (buf, 26, _("%b %d %l:%M %p"), &then);
- } else {
- e_strftime_fix_am_pm (buf, 26, _("%b %d %Y"), &then);
- }
- }
-#if 0
-#ifdef CTIME_R_THREE_ARGS
- ctime_r (&date, buf, 26);
-#else
- ctime_r (&date, buf);
-#endif
-#endif
- temp = buf;
- while ((temp = strstr (temp, " "))) {
- memmove (temp, temp + 1, strlen (temp));
- }
- temp = e_strdup_strip (buf);
- ret_val = e_utf8_from_locale_string (temp);
- g_free (temp);
- return ret_val;
-}
-
-static void
-ecd_free_text(ECellText *cell, char *text)
-{
- g_free(text);
-}
-
-static void
-e_cell_date_class_init (GtkObjectClass *object_class)
-{
- ECellTextClass *ectc = (ECellTextClass *) object_class;
-
- parent_class = g_type_class_ref (PARENT_TYPE);
-
- ectc->get_text = ecd_get_text;
- ectc->free_text = ecd_free_text;
-}
-
-static void
-e_cell_date_init (GtkObject *object)
-{
-}
-
-/**
- * e_cell_date_new:
- * @fontname: font to be used to render on the screen
- * @justify: Justification of the string in the cell.
- *
- * Creates a new ECell renderer that can be used to render dates that
- * that come from the model. The value returned from the model is
- * interpreted as being a time_t.
- *
- * The ECellDate object support a large set of properties that can be
- * configured through the Gtk argument system and allows the user to have
- * a finer control of the way the string is displayed. The arguments supported
- * allow the control of strikeout, bold, color and a date filter.
- *
- * The arguments "strikeout_column", "underline_column", "bold_column"
- * and "color_column" set and return an integer that points to a
- * column in the model that controls these settings. So controlling
- * the way things are rendered is achieved by having special columns
- * in the model that will be used to flag whether the date should be
- * rendered with strikeout, underline, or bolded. In the case of the
- * "color_column" argument, the column in the model is expected to
- * have a string that can be parsed by gdk_color_parse().
- *
- * Returns: an ECell object that can be used to render dates.
- */
-ECell *
-e_cell_date_new (const char *fontname, GtkJustification justify)
-{
- ECellDate *ecd = g_object_new (E_CELL_DATE_TYPE, NULL);
-
- e_cell_text_construct(E_CELL_TEXT(ecd), fontname, justify);
-
- return (ECell *) ecd;
-}
-
-E_MAKE_TYPE(e_cell_date, "ECellDate", ECellDate, e_cell_date_class_init, e_cell_date_init, PARENT_TYPE)
diff --git a/widgets/table/e-cell-date.h b/widgets/table/e-cell-date.h
deleted file mode 100644
index 96d5faa5c3..0000000000
--- a/widgets/table/e-cell-date.h
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * e-cell-date.h - Date item for e-table.
- * Copyright 2001, Ximian, Inc.
- *
- * Authors:
- * Chris Lahey <clahey@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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.
- */
-
-#ifndef _E_CELL_DATE_H_
-#define _E_CELL_DATE_H_
-
-#include <gal/e-table/e-cell-text.h>
-
-G_BEGIN_DECLS
-
-#define E_CELL_DATE_TYPE (e_cell_date_get_type ())
-#define E_CELL_DATE(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), E_CELL_DATE_TYPE, ECellDate))
-#define E_CELL_DATE_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), E_CELL_DATE_TYPE, ECellDateClass))
-#define E_IS_CELL_DATE(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), E_CELL_DATE_TYPE))
-#define E_IS_CELL_DATE_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), E_CELL_DATE_TYPE))
-
-typedef struct {
- ECellText base;
-} ECellDate;
-
-typedef struct {
- ECellTextClass parent_class;
-} ECellDateClass;
-
-GType e_cell_date_get_type (void);
-ECell *e_cell_date_new (const char *fontname, GtkJustification justify);
-
-G_END_DECLS
-
-#endif /* _E_CELL_DATE_H_ */
diff --git a/widgets/table/e-cell-float.c b/widgets/table/e-cell-float.c
deleted file mode 100644
index 133be063b3..0000000000
--- a/widgets/table/e-cell-float.c
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
- * e-cell-float.c - Float item for e-table.
- * Copyright 2001, CodeFactory AB
- * Copyright 2001, Mikael Hallendal <micke@codefactory.se>
- *
- * Derived from e-cell-number by Chris Lahey <clahey@ximian.com>
- * ECellFloat - Float item for e-table.
- *
- * Author:
- * Mikael Hallendal <micke@codefactory.se>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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 <sys/time.h>
-#include <unistd.h>
-#include <gal/util/e-util.h>
-#include <gal/util/e-i18n.h>
-#include "e-cell-float.h"
-
-#define PARENT_TYPE e_cell_text_get_type ()
-
-static ECellTextClass *parent_class;
-
-static char *
-ecf_get_text(ECellText *cell, ETableModel *model, int col, int row)
-{
- gfloat *fvalue;
-
- fvalue = e_table_model_value_at (model, col, row);
-
- return e_format_number_float (*fvalue);
-}
-
-static void
-ecf_free_text(ECellText *cell, char *text)
-{
- g_free(text);
-}
-
-static void
-e_cell_float_class_init (GtkObjectClass *object_class)
-{
- ECellTextClass *ectc = (ECellTextClass *) object_class;
-
- parent_class = g_type_class_ref (PARENT_TYPE);
-
- ectc->get_text = ecf_get_text;
- ectc->free_text = ecf_free_text;
-}
-
-static void
-e_cell_float_init (GtkObject *object)
-{
-}
-
-/**
- * e_cell_float_new:
- * @fontname: font to be used to render on the screen
- * @justify: Justification of the string in the cell.
- *
- * Creates a new ECell renderer that can be used to render floats that
- * that come from the model. The value returned from the model is
- * interpreted as being an int.
- *
- * See ECellText for other features.
- *
- * Returns: an ECell object that can be used to render floats.
- */
-ECell *
-e_cell_float_new (const char *fontname, GtkJustification justify)
-{
- ECellFloat *ecn = g_object_new (E_CELL_FLOAT_TYPE, NULL);
-
- e_cell_text_construct(E_CELL_TEXT(ecn), fontname, justify);
-
- return (ECell *) ecn;
-}
-
-E_MAKE_TYPE(e_cell_float, "ECellFloat", ECellFloat, e_cell_float_class_init, e_cell_float_init, PARENT_TYPE)
diff --git a/widgets/table/e-cell-float.h b/widgets/table/e-cell-float.h
deleted file mode 100644
index 36874406b2..0000000000
--- a/widgets/table/e-cell-float.h
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * e-cell-float.h - Float item for e-table.
- * Copyright 2001, CodeFactory AB
- * Copyright 2001, Mikael Hallendal <micke@codefactory.se>
- *
- * Derived from e-cell-number by Chris Lahey <clahey@ximian.com>
- * ECellFloat - Float item for e-table.
- *
- * Author:
- * Mikael Hallendal <micke@codefactory.se>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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.
- */
-
-#ifndef _E_CELL_FLOAT_H_
-#define _E_CELL_FLOAT_H_
-
-#include <gal/e-table/e-cell-text.h>
-
-G_BEGIN_DECLS
-
-#define E_CELL_FLOAT_TYPE (e_cell_float_get_type ())
-#define E_CELL_FLOAT(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), E_CELL_FLOAT_TYPE, ECellFloat))
-#define E_CELL_FLOAT_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), E_CELL_FLOAT_TYPE, ECellFloatClass))
-#define E_IS_CELL_FLOAT(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), E_CELL_FLOAT_TYPE))
-#define E_IS_CELL_FLOAT_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), E_CELL_FLOAT_TYPE))
-
-typedef struct {
- ECellText base;
-} ECellFloat;
-
-typedef struct {
- ECellTextClass parent_class;
-} ECellFloatClass;
-
-GType e_cell_float_get_type (void);
-ECell *e_cell_float_new (const char *fontname, GtkJustification justify);
-
-G_END_DECLS
-
-#endif /* _E_CELL_FLOAT_H_ */
diff --git a/widgets/table/e-cell-number.c b/widgets/table/e-cell-number.c
deleted file mode 100644
index 8c8887df5a..0000000000
--- a/widgets/table/e-cell-number.c
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- * e-cell-number.c - Number item for e-table.
- * Copyright 2001, Ximian, Inc.
- *
- * Authors:
- * Chris Lahey <clahey@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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 <sys/time.h>
-#include <unistd.h>
-#include <gal/util/e-util.h>
-#include <gal/util/e-i18n.h>
-#include "e-cell-number.h"
-
-#define PARENT_TYPE e_cell_text_get_type ()
-
-static ECellTextClass *parent_class;
-
-static char *
-ecn_get_text(ECellText *cell, ETableModel *model, int col, int row)
-{
- return e_format_number(GPOINTER_TO_INT (e_table_model_value_at(model, col, row)));
-}
-
-static void
-ecn_free_text(ECellText *cell, char *text)
-{
- g_free(text);
-}
-
-static void
-e_cell_number_class_init (GtkObjectClass *object_class)
-{
- ECellTextClass *ectc = (ECellTextClass *) object_class;
-
- parent_class = g_type_class_ref (PARENT_TYPE);
-
- ectc->get_text = ecn_get_text;
- ectc->free_text = ecn_free_text;
-}
-
-static void
-e_cell_number_init (GtkObject *object)
-{
-}
-
-/**
- * e_cell_number_new:
- * @fontname: font to be used to render on the screen
- * @justify: Justification of the string in the cell.
- *
- * Creates a new ECell renderer that can be used to render numbers that
- * that come from the model. The value returned from the model is
- * interpreted as being an int.
- *
- * See ECellText for other features.
- *
- * Returns: an ECell object that can be used to render numbers.
- */
-ECell *
-e_cell_number_new (const char *fontname, GtkJustification justify)
-{
- ECellNumber *ecn = g_object_new (E_CELL_NUMBER_TYPE, NULL);
-
- e_cell_text_construct(E_CELL_TEXT(ecn), fontname, justify);
-
- return (ECell *) ecn;
-}
-
-E_MAKE_TYPE(e_cell_number, "ECellNumber", ECellNumber, e_cell_number_class_init, e_cell_number_init, PARENT_TYPE)
diff --git a/widgets/table/e-cell-number.h b/widgets/table/e-cell-number.h
deleted file mode 100644
index 3cce1ec412..0000000000
--- a/widgets/table/e-cell-number.h
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * e-cell-number.h - Number item for e-table.
- * Copyright 2001, Ximian, Inc.
- *
- * Authors:
- * Chris Lahey <clahey@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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.
- */
-
-#ifndef _E_CELL_NUMBER_H_
-#define _E_CELL_NUMBER_H_
-
-#include <gal/e-table/e-cell-text.h>
-
-G_BEGIN_DECLS
-
-#define E_CELL_NUMBER_TYPE (e_cell_number_get_type ())
-#define E_CELL_NUMBER(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), E_CELL_NUMBER_TYPE, ECellNumber))
-#define E_CELL_NUMBER_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), E_CELL_NUMBER_TYPE, ECellNumberClass))
-#define E_IS_CELL_NUMBER(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), E_CELL_NUMBER_TYPE))
-#define E_IS_CELL_NUMBER_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), E_CELL_NUMBER_TYPE))
-
-typedef struct {
- ECellText base;
-} ECellNumber;
-
-typedef struct {
- ECellTextClass parent_class;
-} ECellNumberClass;
-
-GType e_cell_number_get_type (void);
-ECell *e_cell_number_new (const char *fontname, GtkJustification justify);
-
-G_END_DECLS
-
-#endif /* _E_CELL_NUMBER_H_ */
diff --git a/widgets/table/e-cell-pixbuf.c b/widgets/table/e-cell-pixbuf.c
deleted file mode 100644
index 50c3b2cc7a..0000000000
--- a/widgets/table/e-cell-pixbuf.c
+++ /dev/null
@@ -1,417 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-cell-pixbuf.c - An ECell that displays a GdkPixbuf
- * Copyright 2001, Ximian, Inc.
- *
- * Authors:
- * Vladimir Vukicevic <vladimir@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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 <stdio.h>
-#include <libgnomecanvas/gnome-canvas.h>
-#include "e-cell-pixbuf.h"
-#include <gal/util/e-i18n.h>
-
-#define PARENT_TYPE E_CELL_TYPE
-static ECellClass *parent_class;
-
-typedef struct _ECellPixbufView ECellPixbufView;
-
-struct _ECellPixbufView {
- ECellView cell_view;
- GnomeCanvas *canvas;
-};
-
-/* Object argument IDs */
-enum {
- PROP_0,
-
- PROP_SELECTED_COLUMN,
- PROP_FOCUSED_COLUMN,
- PROP_UNSELECTED_COLUMN
-};
-
-static int
-gnome_print_pixbuf (GnomePrintContext *pc, GdkPixbuf *pixbuf)
-{
- if (gdk_pixbuf_get_has_alpha (pixbuf))
- return gnome_print_rgbaimage (pc,
- gdk_pixbuf_get_pixels (pixbuf),
- gdk_pixbuf_get_width (pixbuf),
- gdk_pixbuf_get_height (pixbuf),
- gdk_pixbuf_get_rowstride (pixbuf));
- else
- return gnome_print_rgbimage (pc,
- gdk_pixbuf_get_pixels (pixbuf),
- gdk_pixbuf_get_width (pixbuf),
- gdk_pixbuf_get_height (pixbuf),
- gdk_pixbuf_get_rowstride (pixbuf));
-}
-
-/*
- * ECellPixbuf functions
- */
-
-ECell *
-e_cell_pixbuf_new (void)
-{
- ECellPixbuf *ecp;
-
- ecp = g_object_new (E_CELL_PIXBUF_TYPE, NULL);
- e_cell_pixbuf_construct (ecp);
-
- return (ECell *) ecp;
-}
-
-void
-e_cell_pixbuf_construct (ECellPixbuf *ecp)
-{
- /* noop */
- return;
-}
-
-/*
- * ECell methods
- */
-
-static ECellView *
-pixbuf_new_view (ECell *ecell, ETableModel *table_model, void *e_table_item_view)
-{
- ECellPixbufView *pixbuf_view = g_new0 (ECellPixbufView, 1);
- ETableItem *eti = E_TABLE_ITEM (e_table_item_view);
- GnomeCanvas *canvas = GNOME_CANVAS_ITEM (eti)->canvas;
-
- pixbuf_view->cell_view.ecell = ecell;
- pixbuf_view->cell_view.e_table_model = table_model;
- pixbuf_view->cell_view.e_table_item_view = e_table_item_view;
- pixbuf_view->canvas = canvas;
-
- return (ECellView *) pixbuf_view;
-}
-
-static void
-pixbuf_kill_view (ECellView *ecell_view)
-{
- ECellPixbufView *pixbuf_view = (ECellPixbufView *) ecell_view;
-
- g_free (pixbuf_view);
-}
-
-static void
-pixbuf_draw (ECellView *ecell_view, GdkDrawable *drawable,
- int model_col, int view_col, int row, ECellFlags flags,
- int x1, int y1, int x2, int y2)
-{
- GdkPixbuf *cell_pixbuf;
- int real_x, real_y, real_w, real_h;
- int pix_w, pix_h;
- ECellPixbuf *ecp;
-
- cell_pixbuf = NULL;
-
- ecp = E_CELL_PIXBUF (ecell_view->ecell);
-
- if (flags & E_CELL_SELECTED) {
- if (GTK_WIDGET_HAS_FOCUS (GNOME_CANVAS_ITEM (ecell_view->e_table_item_view)->canvas)) {
- if (ecp->focused_column != -1)
- cell_pixbuf = (GdkPixbuf *) e_table_model_value_at (ecell_view->e_table_model,
- ecp->focused_column, row);
- } else {
- if (ecp->selected_column != -1)
- cell_pixbuf = (GdkPixbuf *) e_table_model_value_at (ecell_view->e_table_model,
- ecp->selected_column, row);
- }
- } else {
- if (ecp->unselected_column != -1)
- cell_pixbuf = e_table_model_value_at (ecell_view->e_table_model,
- ecp->unselected_column, row);
- }
-
- if (cell_pixbuf == NULL)
- cell_pixbuf = e_table_model_value_at (ecell_view->e_table_model,
- model_col, row);
- /* we can't make sure we really got a pixbuf since, well, it's a Gdk thing */
-
- if (x2 - x1 == 0)
- return;
-
- if (!cell_pixbuf)
- return;
-
- pix_w = gdk_pixbuf_get_width (cell_pixbuf);
- pix_h = gdk_pixbuf_get_height (cell_pixbuf);
-
- /* We center the pixbuf within our allocated space */
- if (x2 - x1 > pix_w) {
- int diff = (x2 - x1) - pix_w;
- real_x = x1 + diff/2;
- real_w = pix_w;
- } else {
- real_x = x1;
- real_w = x2 - x1;
- }
-
- if (y2 - y1 > pix_h) {
- int diff = (y2 - y1) - pix_h;
- real_y = y1 + diff/2;
- real_h = pix_h;
- } else {
- real_y = y1;
- real_h = y2 - y1;
- }
-
-
- gdk_pixbuf_render_to_drawable_alpha (cell_pixbuf,
- drawable,
- 0, 0,
- real_x, real_y,
- real_w, real_h,
- GDK_PIXBUF_ALPHA_FULL,
- 127,
- GDK_RGB_DITHER_NORMAL,
- 0, 0);
-}
-
-static gint
-pixbuf_event (ECellView *ecell_view, GdkEvent *event,
- int model_col, int view_col, int row,
- ECellFlags flags, ECellActions *actions)
-{
- /* noop */
-
- return FALSE;
-}
-
-static gint
-pixbuf_height (ECellView *ecell_view, int model_col, int view_col, int row)
-{
- GdkPixbuf *pixbuf;
- if (row == -1) {
- if (e_table_model_row_count (ecell_view->e_table_model) > 0) {
- row = 0;
- } else {
- return 6;
- }
- }
-
- pixbuf = (GdkPixbuf *) e_table_model_value_at (ecell_view->e_table_model, model_col, row);
- if (!pixbuf)
- return 0;
-
- /* We give ourselves 3 pixels of padding on either side */
- return gdk_pixbuf_get_height (pixbuf) + 6;
-}
-
-/*
- * ECell::print method
- */
-static void
-pixbuf_print (ECellView *ecell_view, GnomePrintContext *context,
- int model_col, int view_col, int row,
- double width, double height)
-{
- GdkPixbuf *pixbuf;
- int scale;
-
- pixbuf = (GdkPixbuf *) e_table_model_value_at (ecell_view->e_table_model, model_col, row);
- if (pixbuf == NULL)
- return;
- scale = gdk_pixbuf_get_height (pixbuf);
-
- gnome_print_gsave(context);
-
- gnome_print_translate (context, 0, (height - scale) / 2);
- gnome_print_scale (context, scale, scale);
- gnome_print_pixbuf (context, pixbuf);
-
- gnome_print_grestore(context);
-}
-
-static gdouble
-pixbuf_print_height (ECellView *ecell_view, GnomePrintContext *context,
- int model_col, int view_col, int row,
- double width)
-{
- GdkPixbuf *pixbuf;
-
- if (row == -1) {
- if (e_table_model_row_count (ecell_view->e_table_model) > 0) {
- row = 0;
- } else {
- return 6;
- }
- }
-
- pixbuf = (GdkPixbuf *) e_table_model_value_at (ecell_view->e_table_model, model_col, row);
- if (!pixbuf)
- return 0;
-
- /* We give ourselves 3 pixels of padding on either side */
- return gdk_pixbuf_get_height (pixbuf);
-}
-
-static gint
-pixbuf_max_width (ECellView *ecell_view, int model_col, int view_col)
-{
- int pw;
- gint num_rows, i;
- gint max_width = -1;
-
- if (model_col == 0) {
- num_rows = e_table_model_row_count (ecell_view->e_table_model);
-
- for (i = 0; i <= num_rows; i++) {
- GdkPixbuf *pixbuf = (GdkPixbuf *) e_table_model_value_at
- (ecell_view->e_table_model,
- model_col,
- i);
- if (!pixbuf)
- continue;
- pw = gdk_pixbuf_get_width (pixbuf);
- if (max_width < pw)
- max_width = pw;
- }
- } else {
- return -1;
- }
-
- return max_width;
-}
-
-static void
-pixbuf_dispose (GObject *object)
-{
- if (G_OBJECT_CLASS (parent_class)->dispose)
- (* G_OBJECT_CLASS (parent_class)->dispose) (object);
-}
-
-static void
-pixbuf_set_property (GObject *object,
- guint prop_id,
- const GValue *value,
- GParamSpec *pspec)
-{
- ECellPixbuf *pixbuf;
-
- pixbuf = E_CELL_PIXBUF (object);
-
- switch (prop_id) {
- case PROP_SELECTED_COLUMN:
- pixbuf->selected_column = g_value_get_int (value);
- break;
-
- case PROP_FOCUSED_COLUMN:
- pixbuf->focused_column = g_value_get_int (value);
- break;
-
- case PROP_UNSELECTED_COLUMN:
- pixbuf->unselected_column = g_value_get_int (value);
- break;
-
- default:
- return;
- }
-}
-
-/* Get_arg handler for the pixbuf item */
-static void
-pixbuf_get_property (GObject *object,
- guint prop_id,
- GValue *value,
- GParamSpec *pspec)
-{
- ECellPixbuf *pixbuf;
-
- pixbuf = E_CELL_PIXBUF (object);
-
- switch (prop_id) {
- case PROP_SELECTED_COLUMN:
- g_value_set_int (value, pixbuf->selected_column);
- break;
-
- case PROP_FOCUSED_COLUMN:
- g_value_set_int (value, pixbuf->focused_column);
- break;
-
- case PROP_UNSELECTED_COLUMN:
- g_value_set_int (value, pixbuf->unselected_column);
- break;
-
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
- break;
- }
-}
-
-static void
-e_cell_pixbuf_init (GtkObject *object)
-{
- ECellPixbuf *ecp = E_CELL_PIXBUF (object);
-
- ecp->selected_column = -1;
- ecp->focused_column = -1;
- ecp->unselected_column = -1;
-}
-
-static void
-e_cell_pixbuf_class_init (GObjectClass *object_class)
-{
- ECellClass *ecc = (ECellClass *) object_class;
-
- object_class->dispose = pixbuf_dispose;
- object_class->set_property = pixbuf_set_property;
- object_class->get_property = pixbuf_get_property;
-
- ecc->new_view = pixbuf_new_view;
- ecc->kill_view = pixbuf_kill_view;
- ecc->draw = pixbuf_draw;
- ecc->event = pixbuf_event;
- ecc->height = pixbuf_height;
- ecc->print = pixbuf_print;
- ecc->print_height = pixbuf_print_height;
- ecc->max_width = pixbuf_max_width;
-
- parent_class = g_type_class_ref (PARENT_TYPE);
-
- g_object_class_install_property (object_class, PROP_SELECTED_COLUMN,
- g_param_spec_int ("selected_column",
- _("Selected Column"),
- /*_( */"XXX blurb" /*)*/,
- 0, G_MAXINT, 0,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_FOCUSED_COLUMN,
- g_param_spec_int ("focused_column",
- _("Focused Column"),
- /*_( */"XXX blurb" /*)*/,
- 0, G_MAXINT, 0,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_UNSELECTED_COLUMN,
- g_param_spec_int ("unselected_column",
- _("Unselected Column"),
- /*_( */"XXX blurb" /*)*/,
- 0, G_MAXINT, 0,
- G_PARAM_READWRITE));
-}
-
-E_MAKE_TYPE (e_cell_pixbuf,
- "ECellPixbuf",
- ECellPixbuf,
- e_cell_pixbuf_class_init,
- e_cell_pixbuf_init,
- PARENT_TYPE)
diff --git a/widgets/table/e-cell-pixbuf.h b/widgets/table/e-cell-pixbuf.h
deleted file mode 100644
index 2f12521d58..0000000000
--- a/widgets/table/e-cell-pixbuf.h
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * e-cell-pixbuf.h - An ECell that displays a GdkPixbuf
- * Copyright 2001, Ximian, Inc.
- *
- * Authors:
- * Vladimir Vukicevic <vladimir@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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.
- */
-
-#ifndef _E_CELL_PIXBUF_H_
-#define _E_CELL_PIXBUF_H_
-
-#include <gal/e-table/e-table.h>
-
-#define E_CELL_PIXBUF_TYPE (e_cell_pixbuf_get_type ())
-#define E_CELL_PIXBUF(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), E_CELL_PIXBUF_TYPE, ECellPixbuf))
-#define E_CELL_PIXBUF_CLASS(k) (G_TYPE_CHECK_INSTANCE_CAST_CLASS ((k), E_CELL_PIXBUF_TYPE, ECellPixbufClass))
-#define E_IS_CELL_PIXBUF(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), E_CELL_PIXBUF_TYPE))
-#define E_IS_CELL_PIXBUF_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), E_CELL_PIXBUF_TYPE))
-
-typedef struct _ECellPixbuf ECellPixbuf;
-typedef struct _ECellPixbufClass ECellPixbufClass;
-
-struct _ECellPixbuf {
- ECell parent;
-
- int selected_column;
- int focused_column;
- int unselected_column;
-};
-
-struct _ECellPixbufClass {
- ECellClass parent_class;
-};
-
-GType e_cell_pixbuf_get_type (void);
-ECell *e_cell_pixbuf_new (void);
-void e_cell_pixbuf_construct (ECellPixbuf *ecp);
-
-#endif
diff --git a/widgets/table/e-cell-popup.c b/widgets/table/e-cell-popup.c
deleted file mode 100644
index 195b6a7aa3..0000000000
--- a/widgets/table/e-cell-popup.c
+++ /dev/null
@@ -1,526 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-cell-popup.c: Popup cell renderer
- * Copyright 2001, Ximian, Inc.
- *
- * Authors:
- * Damon Chaplin <damon@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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. */
-
-/*
- * ECellPopup - an abstract ECell class used to support popup selections like
- * a GtkCombo widget. It contains a child ECell, e.g. an ECellText, but when
- * selected it displays an arrow on the right edge which the user can click to
- * show a popup. Subclasses implement the popup class function to show the
- * popup.
- */
-
-#include <config.h>
-#include <gdk/gdkkeysyms.h>
-#include "gal/util/e-util.h"
-#include "e-table-item.h"
-#include "e-cell-popup.h"
-
-
-#define E_CELL_POPUP_ARROW_WIDTH 16
-#define E_CELL_POPUP_ARROW_XPAD 3
-#define E_CELL_POPUP_ARROW_YPAD 3
-
-
-static void e_cell_popup_class_init (GtkObjectClass *object_class);
-static void e_cell_popup_init (ECellPopup *ecp);
-static void e_cell_popup_dispose (GObject *object);
-
-
-static ECellView* ecp_new_view (ECell *ecell,
- ETableModel *table_model,
- void *e_table_item_view);
-static void ecp_kill_view (ECellView *ecv);
-static void ecp_realize (ECellView *ecv);
-static void ecp_unrealize (ECellView *ecv);
-static void ecp_draw (ECellView *ecv,
- GdkDrawable *drawable,
- int model_col,
- int view_col,
- int row,
- ECellFlags flags,
- int x1,
- int y1,
- int x2,
- int y2);
-static gint ecp_event (ECellView *ecv,
- GdkEvent *event,
- int model_col,
- int view_col,
- int row,
- ECellFlags flags,
- ECellActions *actions);
-static int ecp_height (ECellView *ecv,
- int model_col,
- int view_col,
- int row);
-static void* ecp_enter_edit (ECellView *ecv,
- int model_col,
- int view_col,
- int row);
-static void ecp_leave_edit (ECellView *ecv,
- int model_col,
- int view_col,
- int row,
- void *edit_context);
-static void ecp_print (ECellView *ecv,
- GnomePrintContext *context,
- int model_col,
- int view_col,
- int row,
- double width,
- double height);
-static gdouble ecp_print_height (ECellView *ecv,
- GnomePrintContext *context,
- int model_col,
- int view_col,
- int row,
- double width);
-static int ecp_max_width (ECellView *ecv,
- int model_col,
- int view_col);
-static void ecp_show_tooltip (ECellView *ecv,
- int model_col,
- int view_col,
- int row,
- int col_width,
- ETableTooltip *tooltip);
-static char *ecp_get_bg_color (ECellView *ecell_view, int row);
-
-static gint e_cell_popup_do_popup (ECellPopupView *ecp_view,
- GdkEvent *event,
- int row,
- int model_col);
-
-static ECellClass *parent_class;
-
-
-E_MAKE_TYPE (e_cell_popup, "ECellPopup", ECellPopup, e_cell_popup_class_init,
- e_cell_popup_init, e_cell_get_type())
-
-
-static void
-e_cell_popup_class_init (GtkObjectClass *object_class)
-{
- ECellClass *ecc = (ECellClass *) object_class;
-
- G_OBJECT_CLASS (object_class)->dispose = e_cell_popup_dispose;
-
- ecc->new_view = ecp_new_view;
- ecc->kill_view = ecp_kill_view;
- ecc->realize = ecp_realize;
- ecc->unrealize = ecp_unrealize;
- ecc->draw = ecp_draw;
- ecc->event = ecp_event;
- ecc->height = ecp_height;
- ecc->enter_edit = ecp_enter_edit;
- ecc->leave_edit = ecp_leave_edit;
- ecc->print = ecp_print;
- ecc->print_height = ecp_print_height;
- ecc->max_width = ecp_max_width;
- ecc->show_tooltip = ecp_show_tooltip;
- ecc->get_bg_color = ecp_get_bg_color;
-
- parent_class = g_type_class_ref (E_CELL_TYPE);
-}
-
-
-static void
-e_cell_popup_init (ECellPopup *ecp)
-{
- ecp->popup_shown = FALSE;
- ecp->popup_model = NULL;
-}
-
-
-/**
- * e_cell_popup_new:
- *
- * Creates a new ECellPopup renderer.
- *
- * Returns: an ECellPopup object.
- */
-ECell *
-e_cell_popup_new (void)
-{
- ECellPopup *ecp = g_object_new (E_CELL_POPUP_TYPE, NULL);
-
- return (ECell*) ecp;
-}
-
-
-/*
- * GtkObject::destroy method
- */
-static void
-e_cell_popup_dispose (GObject *object)
-{
- ECellPopup *ecp = E_CELL_POPUP (object);
-
- if (ecp->child)
- g_object_unref (ecp->child);
- ecp->child = NULL;
-
- G_OBJECT_CLASS (parent_class)->dispose (object);
-}
-
-
-
-/*
- * ECell::new_view method
- */
-static ECellView *
-ecp_new_view (ECell *ecell, ETableModel *table_model, void *e_table_item_view)
-{
- ECellPopup *ecp = E_CELL_POPUP (ecell);
- ECellPopupView *ecp_view;
-
- /* We must have a child ECell before we create any views. */
- g_return_val_if_fail (ecp->child != NULL, NULL);
-
- ecp_view = g_new0 (ECellPopupView, 1);
-
- ecp_view->cell_view.ecell = ecell;
- ecp_view->cell_view.e_table_model = table_model;
- ecp_view->cell_view.e_table_item_view = e_table_item_view;
-
- ecp_view->child_view = e_cell_new_view (ecp->child, table_model,
- e_table_item_view);
-
- return (ECellView*) ecp_view;
-}
-
-
-/*
- * ECell::kill_view method
- */
-static void
-ecp_kill_view (ECellView *ecv)
-{
- ECellPopupView *ecp_view = (ECellPopupView *) ecv;
-
- if (ecp_view->child_view)
- e_cell_kill_view (ecp_view->child_view);
- g_free (ecp_view);
-}
-
-
-/*
- * ECell::realize method
- */
-static void
-ecp_realize (ECellView *ecv)
-{
- ECellPopupView *ecp_view = (ECellPopupView *) ecv;
-
- e_cell_realize (ecp_view->child_view);
-
- if (parent_class->realize)
- (* parent_class->realize) (ecv);
-}
-
-
-/*
- * ECell::unrealize method
- */
-static void
-ecp_unrealize (ECellView *ecv)
-{
- ECellPopupView *ecp_view = (ECellPopupView *) ecv;
-
- e_cell_unrealize (ecp_view->child_view);
-
- if (parent_class->unrealize)
- (* parent_class->unrealize) (ecv);
-}
-
-
-/*
- * ECell::draw method
- */
-static void
-ecp_draw (ECellView *ecv, GdkDrawable *drawable,
- int model_col, int view_col, int row, ECellFlags flags,
- int x1, int y1, int x2, int y2)
-{
- ECellPopup *ecp = E_CELL_POPUP (ecv->ecell);
- ECellPopupView *ecp_view = (ECellPopupView *) ecv;
- GtkWidget *canvas = GTK_WIDGET (GNOME_CANVAS_ITEM (ecv->e_table_item_view)->canvas);
- GtkShadowType shadow;
- GdkRectangle rect;
- gboolean show_popup_arrow;
-
- /* Display the popup arrow if we are the cursor cell, or the popup
- is shown for this cell. */
- show_popup_arrow = e_table_model_is_cell_editable (ecv->e_table_model, model_col, row) &&
- (flags & E_CELL_CURSOR ||
- (ecp->popup_shown && ecp->popup_view_col == view_col
- && ecp->popup_row == row
- && ecp->popup_model == ((ECellView *) ecp_view)->e_table_model));
-
- if (flags & E_CELL_CURSOR)
- ecp->popup_arrow_shown = show_popup_arrow;
-
- if (show_popup_arrow) {
- e_cell_draw (ecp_view->child_view, drawable, model_col,
- view_col, row, flags,
- x1, y1, x2 - E_CELL_POPUP_ARROW_WIDTH, y2);
-
- rect.x = x2 - E_CELL_POPUP_ARROW_WIDTH;
- rect.y = y1 + 1;
- rect.width = E_CELL_POPUP_ARROW_WIDTH;
- rect.height = y2 - y1 - 2;
-
- if (ecp->popup_shown)
- shadow = GTK_SHADOW_IN;
- else
- shadow = GTK_SHADOW_OUT;
-
- gtk_paint_box (canvas->style, drawable,
- GTK_STATE_NORMAL, shadow,
- &rect, canvas, "ecellpopup",
- rect.x, rect.y, rect.width, rect.height);
- gtk_paint_arrow (canvas->style, drawable,
- GTK_STATE_NORMAL, shadow,
- &rect, canvas, NULL,
- GTK_ARROW_DOWN, TRUE,
- rect.x + E_CELL_POPUP_ARROW_XPAD,
- rect.y + E_CELL_POPUP_ARROW_YPAD,
- rect.width - E_CELL_POPUP_ARROW_XPAD * 2,
- rect.height - E_CELL_POPUP_ARROW_YPAD * 2);
- } else {
- e_cell_draw (ecp_view->child_view, drawable, model_col,
- view_col, row, flags, x1, y1, x2, y2);
- }
-}
-
-
-/*
- * ECell::event method
- */
-static gint
-ecp_event (ECellView *ecv, GdkEvent *event, int model_col, int view_col,
- int row, ECellFlags flags, ECellActions *actions)
-{
- ECellPopupView *ecp_view = (ECellPopupView *) ecv;
- ECellPopup *ecp = E_CELL_POPUP (ecp_view->cell_view.ecell);
- ETableItem *eti = E_TABLE_ITEM (ecv->e_table_item_view);
- int width;
-
- switch (event->type) {
- case GDK_BUTTON_PRESS:
- if (e_table_model_is_cell_editable (ecv->e_table_model, model_col, row) &&
- flags & E_CELL_CURSOR
- && ecp->popup_arrow_shown) {
- width = e_table_header_col_diff (eti->header, view_col,
- view_col + 1);
-
- g_print ("Event in item popup width: %i button: %g,%g\n",
- width, event->button.x, event->button.y);
-
- /* FIXME: The event coords seem to be relative to the
- text within the cell, so we have to add 4. */
- if (event->button.x + 4 >= width - E_CELL_POPUP_ARROW_WIDTH) {
- return e_cell_popup_do_popup (ecp_view, event, row, view_col);
- }
- }
- break;
- case GDK_KEY_PRESS:
- if (e_table_model_is_cell_editable (ecv->e_table_model, model_col, row) &&
- event->key.state & GDK_MOD1_MASK
- && event->key.keyval == GDK_Down) {
- g_print ("## Alt-Down pressed\n");
- return e_cell_popup_do_popup (ecp_view, event, row, view_col);
- }
- g_print ("Key Press Event ECellPopup\n");
- break;
- default:
- break;
- }
-
- return e_cell_event (ecp_view->child_view, event, model_col, view_col,
- row, flags, actions);
-}
-
-
-/*
- * ECell::height method
- */
-static int
-ecp_height (ECellView *ecv, int model_col, int view_col, int row)
-{
- ECellPopupView *ecp_view = (ECellPopupView *) ecv;
-
- return e_cell_height (ecp_view->child_view, model_col, view_col, row);
-}
-
-
-/*
- * ECellView::enter_edit method
- */
-static void *
-ecp_enter_edit (ECellView *ecv, int model_col, int view_col, int row)
-{
- ECellPopupView *ecp_view = (ECellPopupView *) ecv;
-
- g_print ("In ecp_enter_edit model_col: %i view_col: %i row: %i\n",
- model_col, view_col, row);
-
- return e_cell_enter_edit (ecp_view->child_view, model_col, view_col, row);
-}
-
-
-/*
- * ECellView::leave_edit method
- */
-static void
-ecp_leave_edit (ECellView *ecv, int model_col, int view_col, int row,
- void *edit_context)
-{
- ECellPopupView *ecp_view = (ECellPopupView *) ecv;
-
- g_print ("In ecp_leave_edit model_col: %i view_col: %i row: %i\n",
- model_col, view_col, row);
-
- e_cell_leave_edit (ecp_view->child_view, model_col, view_col, row,
- edit_context);
-}
-
-
-static void
-ecp_print (ECellView *ecv, GnomePrintContext *context,
- int model_col, int view_col, int row, double width, double height)
-{
- ECellPopupView *ecp_view = (ECellPopupView *) ecv;
-
- e_cell_print (ecp_view->child_view, context, model_col, view_col, row,
- width, height);
-}
-
-
-static gdouble
-ecp_print_height (ECellView *ecv, GnomePrintContext *context,
- int model_col, int view_col, int row,
- double width)
-{
- ECellPopupView *ecp_view = (ECellPopupView *) ecv;
-
- return e_cell_print_height (ecp_view->child_view, context, model_col,
- view_col, row, width);
-}
-
-
-static int
-ecp_max_width (ECellView *ecv,
- int model_col,
- int view_col)
-{
- ECellPopupView *ecp_view = (ECellPopupView *) ecv;
-
- return e_cell_max_width (ecp_view->child_view, model_col, view_col);
-}
-
-
-static void
-ecp_show_tooltip (ECellView *ecv,
- int model_col,
- int view_col,
- int row,
- int col_width,
- ETableTooltip *tooltip)
-{
- ECellPopupView *ecp_view = (ECellPopupView *) ecv;
-
- e_cell_show_tooltip (ecp_view->child_view, model_col, view_col, row,
- col_width, tooltip);
-}
-
-static char *
-ecp_get_bg_color (ECellView *ecell_view, int row)
-{
- ECellPopupView *ecp_view = (ECellPopupView *) ecell_view;
-
- return e_cell_get_bg_color (ecp_view->child_view, row);
-}
-
-
-
-ECell*
-e_cell_popup_get_child (ECellPopup *ecp)
-{
- g_return_val_if_fail (E_IS_CELL_POPUP (ecp), NULL);
-
- return ecp->child;
-}
-
-
-void
-e_cell_popup_set_child (ECellPopup *ecp,
- ECell *child)
-{
- g_return_if_fail (E_IS_CELL_POPUP (ecp));
-
- if (ecp->child)
- g_object_unref (ecp->child);
-
- ecp->child = child;
- g_object_ref (child);
-}
-
-
-static gint
-e_cell_popup_do_popup (ECellPopupView *ecp_view,
- GdkEvent *event,
- int row,
- int view_col)
-{
- ECellPopup *ecp = E_CELL_POPUP (ecp_view->cell_view.ecell);
- gint (*popup_func) (ECellPopup *ecp, GdkEvent *event, int row, int view_col);
-
- ecp->popup_cell_view = ecp_view;
-
- popup_func = E_CELL_POPUP_CLASS (GTK_OBJECT_GET_CLASS (ecp))->popup;
-
- ecp->popup_view_col = view_col;
- ecp->popup_row = row;
- ecp->popup_model = ((ECellView *) ecp_view)->e_table_model;
-
- return popup_func ? popup_func (ecp, event, row, view_col) : FALSE;
-}
-
-/* This redraws the popup cell. Only use this if you know popup_view_col and
- popup_row are valid. */
-void
-e_cell_popup_queue_cell_redraw (ECellPopup *ecp)
-{
- ETableItem *eti = E_TABLE_ITEM (ecp->popup_cell_view->cell_view.e_table_item_view);
-
- e_table_item_redraw_range (eti, ecp->popup_view_col, ecp->popup_row,
- ecp->popup_view_col, ecp->popup_row);
-}
-
-void
-e_cell_popup_set_shown (ECellPopup *ecp,
- gboolean shown)
-{
- ecp->popup_shown = shown;
- e_cell_popup_queue_cell_redraw (ecp);
-}
diff --git a/widgets/table/e-cell-popup.h b/widgets/table/e-cell-popup.h
deleted file mode 100644
index 26a7429127..0000000000
--- a/widgets/table/e-cell-popup.h
+++ /dev/null
@@ -1,101 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-cell-popup.h: Popup cell renderer
- * Copyright 2001, Ximian, Inc.
- *
- * Authors:
- * Damon Chaplin <damon@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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.
- */
-
-/*
- * ECellPopup - an ECell used to support popup selections like a GtkCombo
- * widget. It contains a child ECell, e.g. an ECellText, but when selected it
- * displays an arrow on the right edge which the user can click to show a
- * popup. It will support subclassing or signals so that different types of
- * popup can be provided.
- */
-
-#ifndef _E_CELL_POPUP_H_
-#define _E_CELL_POPUP_H_
-
-#include <libgnomecanvas/gnome-canvas.h>
-#include <gal/e-table/e-cell.h>
-
-#define E_CELL_POPUP_TYPE (e_cell_popup_get_type ())
-#define E_CELL_POPUP(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), E_CELL_POPUP_TYPE, ECellPopup))
-#define E_CELL_POPUP_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), E_CELL_POPUP_TYPE, ECellPopupClass))
-#define E_IS_CELL_POPUP(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), E_CELL_POPUP_TYPE))
-#define E_IS_CELL_POPUP_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), E_CELL_POPUP_TYPE))
-
-typedef struct _ECellPopupView ECellPopupView;
-
-typedef struct {
- ECell parent;
-
- ECell *child;
-
- /* This is TRUE if the popup window is shown for the cell being
- edited. While shown we display the arrow indented. */
- gboolean popup_shown;
-
- /* This is TRUE if the popup arrow is shown for the cell being edited.
- This is needed to stop the first click on the cell from popping up
- the popup window. We only popup the window after we have drawn the
- arrow. */
- gboolean popup_arrow_shown;
-
- /* The view in which the popup is shown. */
- ECellPopupView *popup_cell_view;
-
- gint popup_view_col;
- gint popup_row;
- ETableModel *popup_model;
-} ECellPopup;
-
-
-typedef struct {
- ECellClass parent_class;
-
- /* Virtual function for subclasses to override. */
- gint (*popup) (ECellPopup *ecp, GdkEvent *event, int row, int view_col);
-} ECellPopupClass;
-
-
-struct _ECellPopupView {
- ECellView cell_view;
-
- ECellView *child_view;
-};
-
-
-GType e_cell_popup_get_type (void);
-ECell *e_cell_popup_new (void);
-
-/* Get and set the child ECell. */
-ECell *e_cell_popup_get_child (ECellPopup *ecp);
-void e_cell_popup_set_child (ECellPopup *ecp,
- ECell *child);
-
-void e_cell_popup_set_shown (ECellPopup *ecp,
- gboolean shown);
-void e_cell_popup_queue_cell_redraw (ECellPopup *ecp);
-
-void e_cell_popup_set_shown (ECellPopup *ecp,
- gboolean shown);
-void e_cell_popup_queue_cell_redraw (ECellPopup *ecp);
-
-#endif /* _E_CELL_POPUP_H_ */
diff --git a/widgets/table/e-cell-progress.c b/widgets/table/e-cell-progress.c
deleted file mode 100644
index bf7fdd9951..0000000000
--- a/widgets/table/e-cell-progress.c
+++ /dev/null
@@ -1,456 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-cell-progress.c - Progress display cell object.
- * Copyright 1999-2002, Ximian, Inc.
- * Copyright 2001, 2002, Krisztian Pifko <monsta@users.sourceforge.net>
- *
- * Authors:
- * Krisztian Pifko <monsta@users.sourceforge.net>
- *
- * A cell type for displaying progress bars.
- *
- * Derived from ECellToggle of Miguel de Icaza <miguel@ximian.com>.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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.
- */
-
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <string.h>
-
-#include <gtk/gtkenums.h>
-#include <gtk/gtkentry.h>
-#include <gtk/gtkwindow.h>
-#include <gtk/gtksignal.h>
-#include <gdk/gdkkeysyms.h>
-#include <libgnomecanvas/gnome-canvas.h>
-#include "e-cell-progress.h"
-#include "gal/util/e-util.h"
-#include "e-table-item.h"
-
-#define PARENT_TYPE e_cell_get_type ()
-
-typedef struct {
- ECellView cell_view;
- GdkGC *gc;
- GnomeCanvas *canvas;
-} ECellProgressView;
-
-static ECellClass *parent_class;
-
-static void
-eprog_queue_redraw (ECellProgressView *text_view, int view_col, int view_row)
-{
- e_table_item_redraw_range (
- text_view->cell_view.e_table_item_view,
- view_col, view_row, view_col, view_row);
-}
-
-/*
- * ECell::realize method
- */
-static ECellView *
-eprog_new_view (ECell *ecell, ETableModel *table_model, void *e_table_item_view)
-{
- ECellProgressView *progress_view = g_new0 (ECellProgressView, 1);
- ETableItem *eti = E_TABLE_ITEM (e_table_item_view);
- GnomeCanvas *canvas = GNOME_CANVAS_ITEM (eti)->canvas;
-
- progress_view->cell_view.ecell = ecell;
- progress_view->cell_view.e_table_model = table_model;
- progress_view->cell_view.e_table_item_view = e_table_item_view;
- progress_view->canvas = canvas;
-
- return (ECellView *) progress_view;
-}
-
-static void
-eprog_kill_view (ECellView *ecell_view)
-{
- g_free (ecell_view);
-}
-
-static void
-eprog_realize (ECellView *ecell_view)
-{
- ECellProgressView *progress_view = (ECellProgressView *) ecell_view;
-
- progress_view->gc = gdk_gc_new (GTK_WIDGET (progress_view->canvas)->window);
-}
-
-/*
- * ECell::unrealize method
- */
-static void
-eprog_unrealize (ECellView *ecv)
-{
- ECellProgressView *progress_view = (ECellProgressView *) ecv;
-
- gdk_gc_unref (progress_view->gc);
- progress_view->gc = NULL;
-}
-
-static void
-eprog_clear (ECellProgress *progress)
-{
- memset(progress->buffer,0x00,progress->width*progress->height*4);
-}
-
-static void
-eprog_draw_border (ECellProgress *progress, guchar red, guchar green, guchar blue)
-{
- gint i, j, w4, p4, pw4, wpb4, hp1;
-
-/*
- * some speedup
- */
- w4=progress->width*4;
- p4=progress->padding*4;
- pw4=w4*progress->padding;
- wpb4=(progress->width-progress->padding-progress->border)*4;
- hp1=(progress->height-progress->padding-1);
-
- for (i=progress->padding*4;i<(progress->width-progress->padding)*4;i+=4){
- for (j=0;j<progress->border;j++){
- progress->buffer[pw4+j*w4+i]=red;
- progress->buffer[pw4+j*w4+i+1]=green;
- progress->buffer[pw4+j*w4+i+2]=blue;
- progress->buffer[pw4+j*w4+i+3]=255;
- progress->buffer[(progress->height-1-progress->padding)*w4-j*w4+i]=red;
- progress->buffer[(progress->height-1-progress->padding)*w4-j*w4+i+1]=green;
- progress->buffer[(progress->height-1-progress->padding)*w4-j*w4+i+2]=blue;
- progress->buffer[(progress->height-1-progress->padding)*w4-j*w4+i+3]=255;
- }
- }
- for (i=progress->padding+progress->border;i<progress->height-progress->padding-progress->border;i++){
- for (j=0;j<4*progress->border;j+=4){
- progress->buffer[p4+i*w4+j]=red;
- progress->buffer[p4+i*w4+j+1]=green;
- progress->buffer[p4+i*w4+j+2]=blue;
- progress->buffer[p4+i*w4+j+3]=255;
- progress->buffer[i*w4+wpb4+j]=red;
- progress->buffer[i*w4+wpb4+j+1]=green;
- progress->buffer[i*w4+wpb4+j+2]=blue;
- progress->buffer[i*w4+wpb4+j+3]=255;
- }
- }
-}
-
-static void
-eprog_draw_bar (ECellProgress *progress, guchar red, guchar green, guchar blue, gint value)
-{
- gint i, j, w;
-
- w=value*(progress->width-2*(progress->padding+progress->border+1))/progress->max;
- for (i=(progress->padding+progress->border+1)*4;i<(progress->padding+progress->border+1+w)*4;i+=4){
- for (j=0;j<progress->height-2*(progress->padding+progress->border+1);j++){
- progress->buffer[(progress->width*(progress->padding+progress->border+1)*4)+j*progress->width*4+i]=red;
- progress->buffer[(progress->width*(progress->padding+progress->border+1)*4)+j*progress->width*4+i+1]=green;
- progress->buffer[(progress->width*(progress->padding+progress->border+1)*4)+j*progress->width*4+i+2]=blue;
- progress->buffer[(progress->width*(progress->padding+progress->border+1)*4)+j*progress->width*4+i+3]=255;
- }
- }
-}
-
-/*
- * ECell::draw method
- */
-static void
-eprog_draw (ECellView *ecell_view, GdkDrawable *drawable,
- int model_col, int view_col, int row, ECellFlags flags,
- int x1, int y1, int x2, int y2)
-{
- ECellProgress *progress = E_CELL_PROGRESS (ecell_view->ecell);
- gboolean selected;
- GdkPixbuf *image;
- int x, y, width, height;
-
- const int value = GPOINTER_TO_INT (
- e_table_model_value_at (ecell_view->e_table_model, model_col, row));
-
- selected = flags & E_CELL_SELECTED;
-
- if ((value > progress->max)||(value < progress->min)){
- g_warning ("Value from the table model is %d, the states we support are [%d..%d]\n",
- value, progress->min, progress->max);
- return;
- }
-
- image = progress->image;
-
- if ((x2 - x1) < progress->width){
- x = x1;
- width = x2 - x1;
- } else {
- x = x1 + ((x2 - x1) - progress->width) / 2;
- width = progress->width;
- }
-
- if ((y2 - y1) < progress->height){
- y = y1;
- height = y2 - y1;
- } else {
- y = y1 + ((y2 - y1) - progress->height) / 2;
- height = progress->height;
- }
-
- eprog_clear(progress);
-
- eprog_draw_border(progress, progress->red, progress->green, progress->blue);
-
- eprog_draw_bar(progress, progress->red, progress->green, progress->blue, value);
-
- gdk_pixbuf_render_to_drawable_alpha (progress->image, drawable,
- 0, 0,
- x, y,
- progress->width, progress->height,
- GDK_PIXBUF_ALPHA_BILEVEL,
- 128,
- GDK_RGB_DITHER_NORMAL,
- x, y);
-}
-
-static void
-eprog_set_value (ECellProgressView *progress_view, int model_col, int view_col, int row, int value)
-{
- ECell *ecell = progress_view->cell_view.ecell;
- ECellProgress *progress = E_CELL_PROGRESS (ecell);
-
- if (value > progress->max){
- value = progress->max;
- }else if (value < progress->min){
- value = progress->min;
- }
- e_table_model_set_value_at (progress_view->cell_view.e_table_model,
- model_col, row, GINT_TO_POINTER (value));
- eprog_queue_redraw (progress_view, view_col, row);
-}
-
-/*
- * ECell::event method
- */
-static gint
-eprog_event (ECellView *ecell_view, GdkEvent *event, int model_col, int view_col, int row, ECellFlags flags, ECellActions *actions)
-{
- ECellProgressView *progress_view = (ECellProgressView *) ecell_view;
- void *_value = e_table_model_value_at (ecell_view->e_table_model, model_col, row);
- const int value = GPOINTER_TO_INT (_value);
-
-#if 0
- if (!(flags & E_CELL_EDITING))
- return FALSE;
-#endif
-
- switch (event->type){
- case GDK_KEY_PRESS:
- if (event->key.keyval != GDK_space)
- return FALSE;
- /* Fall through */
- case GDK_BUTTON_PRESS:
- if (!e_table_model_is_cell_editable(ecell_view->e_table_model, model_col, row))
- return FALSE;
-
- eprog_set_value (progress_view, model_col, view_col, row, value + 1);
- return TRUE;
-
- default:
- return FALSE;
- }
- return TRUE;
-}
-
-/*
- * ECell::height method
- */
-static int
-eprog_height (ECellView *ecell_view, int model_col, int view_col, int row)
-{
- ECellProgress *progress = E_CELL_PROGRESS (ecell_view->ecell);
-
- return progress->height;
-}
-
-/*
- * ECell::max_width method
- */
-static int
-eprog_max_width (ECellView *ecell_view, int model_col, int view_col)
-{
- ECellProgress *progress = E_CELL_PROGRESS (ecell_view->ecell);
-
- return progress->width;
-}
-
-static void
-eprog_dispose (GObject *object)
-{
- ECellProgress *eprog = E_CELL_PROGRESS (object);
-
- gdk_pixbuf_unref (eprog->image);
- g_free (eprog->image);
- g_free (eprog->buffer);
-
- G_OBJECT_CLASS (parent_class)->dispose (object);
-}
-
-static void
-e_cell_progress_class_init (GObjectClass *object_class)
-{
- ECellClass *ecc = (ECellClass *) object_class;
-
- object_class->dispose = eprog_dispose;
-
- ecc->new_view = eprog_new_view;
- ecc->kill_view = eprog_kill_view;
- ecc->realize = eprog_realize;
- ecc->unrealize = eprog_unrealize;
- ecc->draw = eprog_draw;
- ecc->event = eprog_event;
- ecc->height = eprog_height;
- ecc->max_width = eprog_max_width;
-
- parent_class = g_type_class_ref (PARENT_TYPE);
-}
-
-E_MAKE_TYPE(e_cell_progress, "ECellProgress", ECellProgress, e_cell_progress_class_init, NULL, PARENT_TYPE);
-
-/**
- * e_cell_progress_construct:
- * @eprog: a fresh ECellProgress object
- * @padding: number of pixels used as a padding
- * @border: number of pixels used as a border
- * @min: the minimum value
- * @max: the maximum value
- * @width: the width of the progress bar in pixels
- * @height: the height of the progress bar in pixels
- * @red: the red component of the progress bars rgb color
- * @green: the green component of the progress bars rgb color
- * @blue: the blue component of the progress bars rgb color
- *
- * Constructs the @eprog object with the arguments
- */
-void
-e_cell_progress_construct (ECellProgress *eprog, int padding, int border, int min, int max, int width, int height, guchar red, guchar green, guchar blue)
-{
- eprog->padding = padding;
- eprog->border = border;
- eprog->min = min;
- eprog->max = max;
- eprog->red = red;
- eprog->green = green;
- eprog->blue = blue;
-
- eprog->width = (width<((padding+border)*2+5)) ? ((padding+border)*2+5) : width;
- eprog->height = (height<((padding+border)*2+5)) ? ((padding+border)*2+5) : height;
-
- eprog->buffer=g_new(guchar, eprog->width*eprog->height*4);
-
- eprog_clear(eprog);
- eprog_draw_border(eprog, red, green, blue);
-
- eprog->image = gdk_pixbuf_new_from_data (eprog->buffer,GDK_COLORSPACE_RGB, TRUE, 8, eprog->width, eprog->height, eprog->width*4, NULL, NULL);
-}
-
-/**
- * e_cell_progress_new:
- * @min: the minimum value
- * @max: the maximum value
- * @width: the width of the progress bar in pixels
- * @height: the height of the progress bar in pixels
- *
- * Creates a new ECell renderer that can be used to render progress
- * bars displaying the percentage of the current value between min
- * and max.
- *
- * Returns: an ECell object that can be used to render progress cells.
- */
-ECell *
-e_cell_progress_new (int min, int max, int width, int height)
-{
- ECellProgress *eprog = g_object_new (E_CELL_PROGRESS_TYPE, NULL);
-
- e_cell_progress_construct (eprog, 1, 1, min, max, (width<9) ? 9 : width, (height<9) ? 9 : height, 0x00, 0x00, 0x00);
-
- return (ECell *) eprog;
-}
-
-/**
- * e_cell_progress_set_padding:
- * @eprog: an ECellProgress object
- * @padding: number of pixels used as a padding
- *
- * Sets the padding around the progress bar in the cell.
- */
-void
-e_cell_progress_set_padding (ECellProgress *eprog, int padding)
-{
- eprog->padding = padding;
-
- eprog->width = (eprog->width<((padding+eprog->border)*2+5)) ? ((padding+eprog->border)*2+5) : eprog->width;
- eprog->height = (eprog->height<((padding+eprog->border)*2+5)) ? ((padding+eprog->border)*2+5) : eprog->height;
-
- g_free (eprog->buffer);
- eprog->buffer=g_new (guchar, eprog->width*eprog->height*4);
-
- eprog_clear (eprog);
- eprog_draw_border (eprog, eprog->red, eprog->green, eprog->blue);
-
- eprog->image = gdk_pixbuf_new_from_data (eprog->buffer,GDK_COLORSPACE_RGB, TRUE, 8, eprog->width, eprog->height, eprog->width*4, NULL, NULL);
-}
-
-/**
- * e_cell_progress_set_border:
- * @eprog: an ECellProgress object
- * @border: number of pixels used as a border
- *
- * Sets the border around the progress bar in the cell.
- */
-void
-e_cell_progress_set_border (ECellProgress *eprog, int border)
-{
- eprog->border = border;
-
- eprog->width = (eprog->width<((eprog->padding+border)*2+5)) ? ((eprog->padding+border)*2+5) : eprog->width;
- eprog->height = (eprog->height<((eprog->padding+border)*2+5)) ? ((eprog->padding+border)*2+5) : eprog->height;
-
- g_free (eprog->buffer);
- eprog->buffer=g_new (guchar, eprog->width*eprog->height*4);
-
- eprog_clear (eprog);
- eprog_draw_border (eprog, eprog->red, eprog->green, eprog->blue);
-
- eprog->image = gdk_pixbuf_new_from_data (eprog->buffer,GDK_COLORSPACE_RGB, TRUE, 8, eprog->width, eprog->height, eprog->width*4, NULL, NULL);
-}
-
-/**
- * e_cell_progress_set_color:
- * @eprog: a fresh ECellProgress object
- * @red: the red component of the progress bars rgb color
- * @green: the green component of the progress bars rgb color
- * @blue: the blue component of the progress bars rgb color
- */
-void
-e_cell_progress_set_color (ECellProgress *eprog, guchar red, guchar green, guchar blue)
-{
- eprog->red = red;
- eprog->green = green;
- eprog->blue = blue;
-
- eprog_clear (eprog);
- eprog_draw_border (eprog, red, green, blue);
-}
diff --git a/widgets/table/e-cell-progress.h b/widgets/table/e-cell-progress.h
deleted file mode 100644
index 01a0d0b504..0000000000
--- a/widgets/table/e-cell-progress.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-cell-progress.h - Progress display cell object.
- * Copyright 1999-2002, Ximian, Inc.
- * Copyright 2001, 2002, Krisztian Pifko <monsta@users.sourceforge.net>
- *
- * Authors:
- * Krisztian Pifko <monsta@users.sourceforge.net>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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.
- */
-
-#ifndef _E_CELL_PROGRESS_H_
-#define _E_CELL_PROGRESS_H_
-
-#include <libgnomecanvas/gnome-canvas.h>
-#include <gdk-pixbuf/gdk-pixbuf.h>
-#include <gal/e-table/e-cell.h>
-
-G_BEGIN_DECLS
-
-#define E_CELL_PROGRESS_TYPE (e_cell_progress_get_type ())
-#define E_CELL_PROGRESS(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), E_CELL_PROGRESS_TYPE, ECellProgress))
-#define E_CELL_PROGRESS_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), E_CELL_PROGRESS_TYPE, ECellProgressClass))
-#define E_IS_CELL_PROGRESS(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), E_CELL_PROGRESS_TYPE))
-#define E_IS_CELL_PROGRESS_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), E_CELL_PROGRESS_TYPE))
-
-typedef struct {
- ECell parent;
-
- int padding;
- int border;
- int min;
- int max;
- guchar red;
- guchar green;
- guchar blue;
-
- guchar *buffer;
- GdkPixbuf *image;
-
- int width;
- int height;
-} ECellProgress;
-
-typedef struct {
- ECellClass parent_class;
-} ECellProgressClass;
-
-GType e_cell_progress_get_type (void);
-ECell *e_cell_progress_new (int min, int max, int width, int height);
-void e_cell_progress_construct (ECellProgress *eprog, int padding, int border,
- int min, int max, int width, int height, guchar red, guchar green, guchar blue);
-void e_cell_progress_set_padding (ECellProgress *eprog, int padding);
-void e_cell_progress_set_border (ECellProgress *eprog, int border);
-void e_cell_progress_set_color (ECellProgress *eprog, guchar red, guchar green, guchar blue);
-
-G_END_DECLS
-
-#endif /* _E_CELL_PROGRESS_H_ */
-
-
diff --git a/widgets/table/e-cell-size.c b/widgets/table/e-cell-size.c
deleted file mode 100644
index 1ba8f6d2e6..0000000000
--- a/widgets/table/e-cell-size.c
+++ /dev/null
@@ -1,110 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-cell-size.c: Size item for e-table.
- * Copyright 2001, Ximian, Inc.
- *
- * Authors:
- * Chris Lahey <clahey@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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 <sys/time.h>
-#include <unistd.h>
-#include <gal/util/e-util.h>
-#include "e-cell-size.h"
-
-#define PARENT_TYPE e_cell_text_get_type ()
-
-static ECellTextClass *parent_class;
-
-static char *
-ecd_get_text(ECellText *cell, ETableModel *model, int col, int row)
-{
- gint size = GPOINTER_TO_INT(e_table_model_value_at(model, col, row));
- gfloat fsize;
-
- if (size < 1024) {
- return g_strdup_printf ("%d bytes", size);
- } else {
- fsize = ((gfloat) size) / 1024.0;
- if (fsize < 1024.0) {
- return g_strdup_printf ("%d K", (int)fsize);
- } else {
- fsize /= 1024.0;
- return g_strdup_printf ("%.1f MB", fsize);
- }
- }
-}
-
-static void
-ecd_free_text(ECellText *cell, char *text)
-{
- g_free(text);
-}
-
-static void
-e_cell_size_class_init (GtkObjectClass *object_class)
-{
- ECellTextClass *ectc = (ECellTextClass *) object_class;
-
- parent_class = g_type_class_ref (PARENT_TYPE);
-
- ectc->get_text = ecd_get_text;
- ectc->free_text = ecd_free_text;
-}
-
-static void
-e_cell_size_init (GtkObject *object)
-{
-}
-
-/**
- * e_cell_size_new:
- * @fontname: font to be used to render on the screen
- * @justify: Justification of the string in the cell.
- *
- * Creates a new ECell renderer that can be used to render file sizes
- * that that come from the model. The value returned from the model
- * is interpreted as being a time_t.
- *
- * The ECellSize object support a large set of properties that can be
- * configured through the Gtk argument system and allows the user to
- * have a finer control of the way the string is displayed. The
- * arguments supported allow the control of strikeout, underline,
- * bold, color and a size filter.
- *
- * The arguments "strikeout_column", "underline_column", "bold_column"
- * and "color_column" set and return an integer that points to a
- * column in the model that controls these settings. So controlling
- * the way things are rendered is achieved by having special columns
- * in the model that will be used to flag whether the size should be
- * rendered with strikeout, underline, or bolded. In the case of the
- * "color_column" argument, the column in the model is expected to
- * have a string that can be parsed by gdk_color_parse().
- *
- * Returns: an ECell object that can be used to render file sizes. */
-ECell *
-e_cell_size_new (const char *fontname, GtkJustification justify)
-{
- ECellSize *ecd = g_object_new (E_CELL_SIZE_TYPE, NULL);
-
- e_cell_text_construct(E_CELL_TEXT(ecd), fontname, justify);
-
- return (ECell *) ecd;
-}
-
-E_MAKE_TYPE(e_cell_size, "ECellSize", ECellSize, e_cell_size_class_init, e_cell_size_init, PARENT_TYPE)
diff --git a/widgets/table/e-cell-size.h b/widgets/table/e-cell-size.h
deleted file mode 100644
index 744cc00a98..0000000000
--- a/widgets/table/e-cell-size.h
+++ /dev/null
@@ -1,49 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-cell-size.h: Size item for e-table.
- * Copyright 2001, Ximian, Inc.
- *
- * Authors:
- * Chris Lahey <clahey@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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.
- */
-#ifndef _E_CELL_SIZE_H_
-#define _E_CELL_SIZE_H_
-
-#include <gal/e-table/e-cell-text.h>
-
-G_BEGIN_DECLS
-
-#define E_CELL_SIZE_TYPE (e_cell_size_get_type ())
-#define E_CELL_SIZE(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), E_CELL_SIZE_TYPE, ECellSize))
-#define E_CELL_SIZE_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), E_CELL_SIZE_TYPE, ECellSizeClass))
-#define E_IS_CELL_SIZE(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), E_CELL_SIZE_TYPE))
-#define E_IS_CELL_SIZE_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), E_CELL_SIZE_TYPE))
-
-typedef struct {
- ECellText base;
-} ECellSize;
-
-typedef struct {
- ECellTextClass parent_class;
-} ECellSizeClass;
-
-GType e_cell_size_get_type (void);
-ECell *e_cell_size_new (const char *fontname, GtkJustification justify);
-
-G_END_DECLS
-
-#endif /* _E_CELL_SIZE_H_ */
diff --git a/widgets/table/e-cell-spin-button.c b/widgets/table/e-cell-spin-button.c
deleted file mode 100644
index 9a0a9ce331..0000000000
--- a/widgets/table/e-cell-spin-button.c
+++ /dev/null
@@ -1,670 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-cell-spin-button.c: Spin button item for e-table.
- * Copyright 2001, CodeFactory AB
- * Copyright 2001, Mikael Hallendal <micke@codefactory.se>
- *
- * Authors:
- * Mikael Hallendal <micke@codefactory.se>
- *
- * Celltype for drawing a spinbutton in a cell.
- *
- * Used ECellPopup by Damon Chaplin <damon@ximian.com> as base for
- * buttondrawings.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <gtk/gtksignal.h>
-#include <gal/e-table/e-table-item.h>
-#include <gal/e-table/e-table-model.h>
-#include <gal/e-table/e-cell-float.h>
-#include <gal/e-table/e-cell-number.h>
-#include <gal/util/e-util.h>
-#include "e-cell-spin-button.h"
-
-#define E_CELL_SPIN_BUTTON_ARROW_WIDTH 16
-#define PARENT_TYPE e_cell_get_type ()
-
-static void e_cell_spin_button_class_init (GObjectClass *klass);
-static void e_cell_spin_button_init (GtkObject *object);
-
-static void ecsb_dispose (GObject *object);
-
-/* ECell Functions */
-static ECellView * ecsb_new_view (ECell *ecell,
- ETableModel *etm,
- void *eti_view);
-static void ecsb_realize (ECellView *ecv);
-static void ecsb_kill_view (ECellView *ecv);
-static void ecsb_unrealize (ECellView *ecv);
-static void ecsb_draw (ECellView *ecv,
- GdkDrawable *drawable,
- int model_col,
- int view_col,
- int row,
- ECellFlags flags,
- int x1,
- int y1,
- int x2,
- int y2);
-
-static gint ecsb_event (ECellView *ecv,
- GdkEvent *event,
- int model_col,
- int view_col,
- int row,
- ECellFlags flags,
- ECellActions *actions);
-
-static gint ecsb_height (ECellView *ecv,
- int model_col,
- int view_col,
- int row);
-
-static void * ecsb_enter_edit (ECellView *ecv,
- int model_col,
- int view_col,
- int row);
-
-static void ecsb_leave_edit (ECellView *ecv,
- int model_col,
- int view_col,
- int row,
- void *context);
-static void ecsb_focus (ECellView *ecell_view,
- int model_col,
- int view_col,
- int row,
- int x1,
- int y1,
- int x2,
- int y2);
-static void ecsb_unfocus (ECellView *ecell_view);
-
-static void ecsb_show_tooltip (ECellView *ecv,
- int model_col,
- int view_col,
- int row,
- int col_width,
- ETableTooltip *tooltip);
-
-typedef struct {
- ECellView cell_view;
-
- ECellView *child_view;
-} ECellSpinButtonView;
-
-enum {
- STEP,
- LAST_SIGNAL
-};
-
-static guint signals[LAST_SIGNAL] = { 0 };
-static ECell *parent_class;
-
-static void
-e_cell_spin_button_class_init (GObjectClass *klass)
-{
- ECellClass *ecc = (ECellClass *) klass;
- ECellSpinButtonClass *ecsbc = (ECellSpinButtonClass *) klass;
-
- klass->dispose = ecsb_dispose;
-
- ecc->realize = ecsb_realize;
- ecc->unrealize = ecsb_unrealize;
- ecc->new_view = ecsb_new_view;
- ecc->kill_view = ecsb_kill_view;
- ecc->draw = ecsb_draw;
- ecc->event = ecsb_event;
- ecc->height = ecsb_height;
- ecc->enter_edit = ecsb_enter_edit;
- ecc->leave_edit = ecsb_leave_edit;
- ecc->focus = ecsb_focus;
- ecc->unfocus = ecsb_unfocus; ecc->print = NULL;
- ecc->print_height = NULL;
- ecc->max_width = NULL;
- ecc->show_tooltip = ecsb_show_tooltip;
-
- ecsbc->step = NULL;
-
- parent_class = g_type_class_ref (E_CELL_TYPE);
-
- signals[STEP] =
- g_signal_new ("step",
- G_OBJECT_CLASS_TYPE (klass),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (ECellSpinButtonClass, step),
- NULL, NULL,
- e_marshal_NONE__POINTER_INT_INT_INT,
- G_TYPE_NONE,
- 4, G_TYPE_POINTER, G_TYPE_INT,
- G_TYPE_INT, G_TYPE_INT);
-}
-
-static void
-e_cell_spin_button_init (GtkObject *object)
-{
- ECellSpinButton *ecsb;
-
- g_return_if_fail (object != NULL);
- g_return_if_fail (M_IS_CELL_SPIN_BUTTON (object));
-
- ecsb = E_CELL_SPIN_BUTTON (object);
-
- ecsb->up_pressed = FALSE;
- ecsb->down_pressed = FALSE;
-}
-
-static ECellView *
-ecsb_new_view (ECell *ecell,
- ETableModel *etm,
- void *eti_view)
-{
- ECellSpinButton *ecsb = E_CELL_SPIN_BUTTON (ecell);
- ECellSpinButtonView *ecsb_view;
-
- g_return_val_if_fail (ecsb->child != NULL, NULL);
-
- ecsb_view = g_new0 (ECellSpinButtonView, 1);
-
- ecsb_view->cell_view.ecell = ecell;
- ecsb_view->cell_view.e_table_model = etm;
- ecsb_view->cell_view.e_table_item_view = eti_view;
-
- ecsb_view->child_view = e_cell_new_view (ecsb->child, etm, eti_view);
-
- return (ECellView *) ecsb_view;
-}
-
-static void
-ecsb_realize (ECellView *ecv)
-{
- ECellSpinButtonView *ecsb_view;
-
- g_return_if_fail (ecv != NULL);
-
- ecsb_view = (ECellSpinButtonView *) ecv;
-
- e_cell_realize (ecsb_view->child_view);
-}
-
-static void
-ecsb_kill_view (ECellView *ecv)
-{
- ECellSpinButtonView *ecsb_view;
-
- g_return_if_fail (ecv != NULL);
-
- ecsb_view = (ECellSpinButtonView *) ecv;
-
- if (ecsb_view->child_view) {
- e_cell_kill_view (ecsb_view->child_view);
- }
-
- g_free (ecsb_view);
-}
-
-static void
-ecsb_unrealize (ECellView *ecv)
-{
- ECellSpinButtonView *ecsb_view;
-
- g_return_if_fail (ecv != NULL);
-
- ecsb_view = (ECellSpinButtonView *) ecv;
-
- e_cell_unrealize (ecsb_view->child_view);
-}
-
-static void
-ecsb_draw (ECellView *ecv,
- GdkDrawable *drawable,
- int model_col,
- int view_col,
- int row,
- ECellFlags flags,
- int x1,
- int y1,
- int x2,
- int y2)
-{
- ECellSpinButton *ecsb;
- ECellSpinButtonView *ecsb_view;
- ETableItem *eti;
- GtkWidget *canvas;
- GtkShadowType shadow = GTK_SHADOW_OUT;
- GdkRectangle rect;
-
- g_return_if_fail (ecv != NULL);
-
- ecsb_view = (ECellSpinButtonView *) ecv;
- ecsb = E_CELL_SPIN_BUTTON (ecsb_view->cell_view.ecell);
-
- eti = E_TABLE_ITEM (ecsb_view->cell_view.e_table_item_view);
- canvas = GTK_WIDGET (GNOME_CANVAS_ITEM (eti)->canvas);
-
- if (eti->editing_col == view_col &&
- eti->editing_row == row) {
-
- /* Draw child (Whats shown under the buttons) */
- e_cell_draw (ecsb_view->child_view,
- drawable, model_col, view_col,
- row, flags,
- x1, y1,
- x2 - E_CELL_SPIN_BUTTON_ARROW_WIDTH, y2);
-
- /* Draw down-arrow */
- rect.x = x2 - E_CELL_SPIN_BUTTON_ARROW_WIDTH;
- rect.y = y1 + (y2 - y1) / 2;
- rect.width = E_CELL_SPIN_BUTTON_ARROW_WIDTH;
- rect.height = (y2 - y1) / 2;
-
- if (ecsb->down_pressed) {
- shadow = GTK_SHADOW_IN;
- } else {
- shadow = GTK_SHADOW_OUT;
- }
-
- gtk_paint_box (canvas->style, drawable,
- GTK_STATE_NORMAL, shadow,
- &rect, canvas, "ecellspinbutton_down",
- rect.x, rect.y, rect.width, rect.height);
-
- gtk_paint_arrow (canvas->style, drawable,
- GTK_STATE_NORMAL, shadow,
- &rect, canvas, NULL,
- GTK_ARROW_DOWN, TRUE,
- rect.x,
- rect.y,
- rect.width,
- rect.height);
-
- /* Draw up-arrow */
- rect.y = y1;
-
- if (ecsb->up_pressed) {
- shadow = GTK_SHADOW_IN;
- } else {
- shadow = GTK_SHADOW_OUT;
- }
-
- gtk_paint_box (canvas->style, drawable,
- GTK_STATE_NORMAL, shadow,
- &rect, canvas, "ecellspinbutton_up",
- rect.x, rect.y, rect.width, rect.height);
-
- gtk_paint_arrow (canvas->style, drawable,
- GTK_STATE_NORMAL, shadow,
- &rect, canvas, NULL,
- GTK_ARROW_UP, TRUE,
- rect.x,
- rect.y,
- rect.width,
- rect.height);
- } else {
- /* Draw child */
- e_cell_draw (ecsb_view->child_view,
- drawable, model_col, view_col,
- row, flags,
- x1, y1,
- x2, y2);
- }
-}
-
-static gint
-ecsb_event (ECellView *ecv,
- GdkEvent *event,
- int model_col,
- int view_col,
- int row,
- ECellFlags flags,
- ECellActions *actions)
-{
- ECellSpinButton *ecsb;
- ECellSpinButtonClass *ecsb_class;
- ECellSpinButtonView *ecsb_view;
- ETableItem *eti;
- gint height, width;
-
- g_return_val_if_fail (ecv != NULL, FALSE);
-
- ecsb_view = (ECellSpinButtonView *) ecv;
- ecsb = E_CELL_SPIN_BUTTON (ecsb_view->cell_view.ecell);
- ecsb_class = E_CELL_SPIN_BUTTON_CLASS (GTK_OBJECT_GET_CLASS (ecsb));
- eti = E_TABLE_ITEM (ecsb_view->cell_view.e_table_item_view);
-
- switch (event->type) {
- case GDK_BUTTON_PRESS:
- if (eti->editing_col == view_col &&
- eti->editing_row == row) {
- width = e_table_header_col_diff (eti->header,
- view_col,
- view_col + 1);
- height = e_table_item_row_diff (eti, row, row + 1);
-
- /* Check if inside a button */
- if (event->button.x >= width - E_CELL_SPIN_BUTTON_ARROW_WIDTH) {
- /* Yep, which one? */
- if (event->button.y <= height / 2) {
- ecsb->up_pressed = TRUE;
- g_signal_emit (ecsb,
- signals[STEP], 0,
- ecv,
- STEP_UP,
- view_col,
- row);
- } else {
- ecsb->down_pressed = TRUE;
- g_signal_emit (ecsb,
- signals[STEP], 0,
- ecv,
- STEP_DOWN,
- view_col,
- row);
- }
-
- e_table_item_redraw_range (eti,
- view_col,
- row,
- view_col,
- row);
-
- }
- }
-
- break;
- case GDK_BUTTON_RELEASE:
- ecsb->up_pressed = FALSE;
- ecsb->down_pressed = FALSE;
- e_table_item_redraw_range (eti,
- view_col,
- row,
- view_col,
- row);
- break;
- case GDK_KEY_PRESS:
- break;
- default:
- break;
- }
-
- return e_cell_event (ecsb_view->child_view, event, model_col,
- view_col, row, flags, actions);
-}
-
-static gint
-ecsb_height (ECellView *ecv,
- int model_col,
- int view_col,
- int row)
-{
- ECellSpinButtonView *ecsb_view;
-
- g_return_val_if_fail (ecv != NULL, -1);
-
- ecsb_view = (ECellSpinButtonView *) ecv;
-
- return e_cell_height (ecsb_view->child_view, model_col, view_col, row);
-}
-
-static void *
-ecsb_enter_edit (ECellView *ecv,
- int model_col,
- int view_col,
- int row)
-{
- ECellSpinButtonView *ecsb_view;
-
- g_return_val_if_fail (ecv != NULL, NULL);
-
- ecsb_view = (ECellSpinButtonView *) ecv;
-
- return e_cell_enter_edit (ecsb_view->child_view, model_col,
- view_col, row);
-}
-
-
-static void
-ecsb_leave_edit (ECellView *ecv,
- int model_col,
- int view_col,
- int row,
- void *context)
-{
- ECellSpinButtonView *ecsb_view;
-
- g_return_if_fail (ecv != NULL);
-
- ecsb_view = (ECellSpinButtonView *) ecv;
-
- e_cell_leave_edit (ecsb_view->child_view, model_col, view_col,
- row, context);
-}
-
-static void
-ecsb_focus (ECellView *ecell_view,
- int model_col,
- int view_col,
- int row,
- int x1,
- int y1,
- int x2,
- int y2)
-{
- ECellClass *klass;
- ECellSpinButtonView *ecsb_view;
-
- ecsb_view = (ECellSpinButtonView *) ecell_view;
-
- klass = E_CELL_GET_CLASS (ecell_view->ecell);
-
- if (klass->focus)
- klass->focus (ecell_view, model_col, view_col, row,
- x1, y1, x2, y2);
-}
-
-static void
-ecsb_unfocus (ECellView *ecell_view)
-{
- ECellClass *klass;
- ECellSpinButtonView *ecsb_view;
-
- ecsb_view = (ECellSpinButtonView *) ecell_view;
- klass = E_CELL_GET_CLASS (ecell_view->ecell);
-
- if (klass->unfocus)
- klass->unfocus (ecell_view);
-}
-
-static void
-ecsb_show_tooltip (ECellView *ecv,
- int model_col,
- int view_col,
- int row,
- int col_width,
- ETableTooltip *tooltip)
-{
- ECellSpinButtonView *ecsb_view;
-
- g_return_if_fail (ecv != NULL);
-
- ecsb_view = (ECellSpinButtonView *) ecv;
-
- e_cell_show_tooltip (ecsb_view->child_view, model_col, view_col,
- row, col_width, tooltip);
-}
-
-static void
-ecsb_dispose (GObject *object)
-{
- ECellSpinButton *mcsp;
-
- g_return_if_fail (object != NULL);
- g_return_if_fail (M_IS_CELL_SPIN_BUTTON (object));
-
- mcsp = E_CELL_SPIN_BUTTON (object);
-
- G_OBJECT_CLASS (parent_class)->dispose (object);
-}
-
-ECell *
-e_cell_spin_button_new (gint min,
- gint max,
- gint step,
- ECell *child_cell)
-{
- ECellSpinButton *ecsb;
-
- ecsb = g_object_new (E_CELL_SPIN_BUTTON_TYPE, NULL);
-
- if (!child_cell) {
- child_cell = e_cell_number_new (NULL,
- GTK_JUSTIFY_LEFT);
-
- g_signal_connect (ecsb, "step",
- G_CALLBACK (e_cell_spin_button_step),
- NULL);
- }
-
- ecsb->child = child_cell;
- ecsb->min.i = min;
- ecsb->max.i = max;
- ecsb->step.i = step;
-
- return E_CELL (ecsb);
-}
-
-ECell *
-e_cell_spin_button_new_float (gfloat min,
- gfloat max,
- gfloat step,
- ECell *child_cell)
-{
- ECellSpinButton *ecsb;
-
- ecsb = g_object_new (E_CELL_SPIN_BUTTON_TYPE, NULL);
-
- if (!child_cell) {
- child_cell = e_cell_float_new (NULL, GTK_JUSTIFY_LEFT);
- g_signal_connect (ecsb, "step",
- G_CALLBACK (e_cell_spin_button_step_float),
- NULL);
- }
-
- ecsb->child = child_cell;
- ecsb->min.f = min;
- ecsb->max.f = max;
- ecsb->step.f = step;
-
- return E_CELL (ecsb);
-}
-
-void
-e_cell_spin_button_step (ECellSpinButton *ecsb,
- ECellView *ecv,
- ECellSpinButtonStep direction,
- gint col,
- gint row)
-{
- ECellSpinButtonView *ecsb_view;
-
- ETableModel *etm;
- gint value;
- gint new_value;
- gchar *str_value;
-
- g_return_if_fail (ecsb != NULL);
- g_return_if_fail (M_IS_CELL_SPIN_BUTTON (ecsb));
- g_return_if_fail (ecv != NULL);
-
- ecsb_view = (ECellSpinButtonView *) ecv;
- etm = ecsb_view->cell_view.e_table_model;
-
- value = GPOINTER_TO_INT (e_table_model_value_at (etm, col, row));
- new_value = value;
-
- switch (direction) {
- case STEP_UP:
- new_value = CLAMP (value + ecsb->step.i,
- ecsb->min.i, ecsb->max.i);
- break;
- case STEP_DOWN:
- new_value = CLAMP (value - ecsb->step.i,
- ecsb->min.i, ecsb->max.i);
- break;
- default:
- break;
- };
-
- str_value = g_strdup_printf ("%d", new_value);
-
- e_table_model_set_value_at (etm, col, row, str_value);
-
- g_free (str_value);
-}
-
-void
-e_cell_spin_button_step_float (ECellSpinButton *ecsb,
- ECellView *ecv,
- ECellSpinButtonStep direction,
- gint col,
- gint row)
-{
- ECellSpinButtonView *ecsb_view;
-
- ETableModel *etm;
- gfloat value;
- gfloat new_value;
- gchar *str_value;
-
- g_return_if_fail (ecsb != NULL);
- g_return_if_fail (M_IS_CELL_SPIN_BUTTON (ecsb));
- g_return_if_fail (ecv != NULL);
-
- ecsb_view = (ECellSpinButtonView *) ecv;
- etm = ecsb_view->cell_view.e_table_model;
-
- value = *(gfloat *) e_table_model_value_at (etm, col, row);
-
- switch (direction) {
- case STEP_UP:
- new_value = CLAMP (value + ecsb->step.f,
- ecsb->min.f, ecsb->max.f);
- break;
- case STEP_DOWN:
- new_value = CLAMP (value - ecsb->step.f,
- ecsb->min.f, ecsb->max.f);
- break;
- default:
- new_value = value;
- break;
- };
-
- str_value = g_strdup_printf ("%f", new_value);
-
- e_table_model_set_value_at (etm, col, row, str_value);
-
- g_free (str_value);
-}
-
-E_MAKE_TYPE (e_cell_spin_button, "ECellSpinButton", ECellSpinButton,
- e_cell_spin_button_class_init, e_cell_spin_button_init,
- PARENT_TYPE)
-
diff --git a/widgets/table/e-cell-spin-button.h b/widgets/table/e-cell-spin-button.h
deleted file mode 100644
index 4326c0429c..0000000000
--- a/widgets/table/e-cell-spin-button.h
+++ /dev/null
@@ -1,103 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-cell-spin-button.h: Spin button item for e-table.
- * Copyright 2001, CodeFactory AB
- * Copyright 2001, Mikael Hallendal <micke@codefactory.se>
- *
- * Authors:
- * Mikael Hallendal <micke@codefactory.se>
- *
- * Celltype for drawing a spinbutton in a cell.
- *
- * Used ECellPopup by Damon Chaplin <damon@ximian.com> as base for
- * buttondrawings.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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.
- */
-
-#ifndef __E_CELL_SPIN_BUTTON_H__
-#define __E_CELL_SPIN_BUTTON_H__
-
-#include <glib.h>
-#include <gtk/gtktypeutils.h>
-#include <gal/e-table/e-cell.h>
-
-#define E_CELL_SPIN_BUTTON_TYPE (e_cell_spin_button_get_type ())
-#define E_CELL_SPIN_BUTTON(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), E_CELL_SPIN_BUTTON_TYPE, ECellSpinButton))
-#define E_CELL_SPIN_BUTTON_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), E_CELL_SPIN_BUTTON_TYPE, ECellSpinButtonClass))
-#define M_IS_CELL_SPIN_BUTTON(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), E_CELL_SPIN_BUTTON_TYPE))
-#define M_IS_CELL_SPIN_BUTTON_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), E_CELL_SPIN_BUTTON_TYPE))
-
-typedef union {
- gint i;
- gfloat f;
-} ECellSpinButtonData;
-
-typedef enum {
- STEP_UP,
- STEP_DOWN
-} ECellSpinButtonStep;
-
-typedef struct {
- ECell parent;
-
- ECell *child;
-
- ECellSpinButtonData min;
- ECellSpinButtonData max;
- ECellSpinButtonData step;
-
- gboolean up_pressed;
- gboolean down_pressed;
-
-} ECellSpinButton;
-
-typedef struct {
- ECellClass parent_class;
-
- /* Functions */
- void (*step) (ECellSpinButton *mcsb,
- ECellView *ecv,
- ECellSpinButtonStep direction,
- gint col,
- gint row);
-} ECellSpinButtonClass;
-
-GType e_cell_spin_button_get_type (void);
-ECell * e_cell_spin_button_new (gint min,
- gint max,
- gint step,
- ECell *child_cell);
-
-ECell * e_cell_spin_button_new_float (gfloat min,
- gfloat max,
- gfloat step,
- ECell *child_cell);
-
-
-void e_cell_spin_button_step (ECellSpinButton *mcsb,
- ECellView *ecv,
- ECellSpinButtonStep direction,
- gint col,
- gint row);
-
-void e_cell_spin_button_step_float (ECellSpinButton *mcsb,
- ECellView *ecv,
- ECellSpinButtonStep direction,
- gint col,
- gint row);
-
-#endif /* __E_CELL_SPIN_BUTTON__ */
-
diff --git a/widgets/table/e-cell-text.c b/widgets/table/e-cell-text.c
deleted file mode 100644
index c848a369c1..0000000000
--- a/widgets/table/e-cell-text.c
+++ /dev/null
@@ -1,2329 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-cell-text.c: Text cell renderer.
- * Copyright 1999, 2000, 2001, Ximian, Inc.
- *
- * Authors:
- * Miguel de Icaza <miguel@ximian.com>
- * Chris Lahey <clahey@ximian.com>
- *
- * A lot of code taken from:
- *
- * Text item type for GnomeCanvas widget
- *
- * GnomeCanvas is basically a port of the Tk toolkit's most excellent
- * canvas widget. Tk is copyrighted by the Regents of the University
- * of California, Sun Microsystems, and other parties.
- *
- * Copyright (C) 1998 The Free Software Foundation
- *
- * Author: Federico Mena <federico@nuclecu.unam.mx>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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 <stdio.h>
-#include <ctype.h>
-#include <math.h>
-#include <string.h>
-#include <gdk/gdkx.h> /* for BlackPixel */
-#include <gdk/gdkkeysyms.h>
-#include <gtk/gtk.h>
-#include <libgnomecanvas/gnome-canvas.h>
-#include <libgnomecanvas/gnome-canvas-rect-ellipse.h>
-#include "e-cell-text.h"
-#include "gal/util/e-util.h"
-#include "gal/widgets/e-canvas.h"
-#include "gal/widgets/e-font.h"
-#include "gal/widgets/e-unicode.h"
-#include "e-table-item.h"
-#include "gal/util/e-text-event-processor.h"
-#include "gal/e-text/e-text.h"
-#include "gal/util/e-text-event-processor-emacs-like.h"
-#include "gal/util/e-i18n.h"
-#include "e-table-tooltip.h"
-
-#define d(x)
-#define DO_SELECTION 1
-
-#if d(!)0
-#define e_table_item_leave_edit_(x) (e_table_item_leave_edit((x)), g_print ("%s: e_table_item_leave_edit\n", __FUNCTION__))
-#else
-#define e_table_item_leave_edit_(x) (e_table_item_leave_edit((x)))
-#endif
-
-#define ECT_CLASS(c) (E_CELL_TEXT_CLASS(GTK_OBJECT_GET_CLASS ((c))))
-
-/* This defines a line of text */
-struct line {
- char *text; /* Line's text UTF-8, it is a pointer into the text->text string */
- int length; /* Line's length in BYTES */
- int width; /* Line's width in pixels */
- int ellipsis_length; /* Length before adding ellipsis in BYTES */
-};
-
-/* Object argument IDs */
-enum {
- PROP_0,
-
- PROP_STRIKEOUT_COLUMN,
- PROP_UNDERLINE_COLUMN,
- PROP_BOLD_COLUMN,
- PROP_COLOR_COLUMN,
- PROP_EDITABLE,
- PROP_BG_COLOR_COLUMN
-};
-
-
-enum {
- E_SELECTION_PRIMARY,
- E_SELECTION_CLIPBOARD
-};
-
-static GdkAtom clipboard_atom = GDK_NONE;
-
-#define PARENT_TYPE e_cell_get_type ()
-
-#define TEXT_PAD 4
-
-typedef struct {
- gpointer lines; /* Text split into lines (private field) */
- int num_lines; /* Number of lines of text */
- int max_width;
- int ref_count;
-} ECellTextLineBreaks;
-
-
-typedef struct _CellEdit CellEdit;
-
-typedef struct {
- ECellView cell_view;
- GdkGC *gc;
- EFont *font;
- GdkCursor *i_cursor;
- GdkBitmap *stipple; /* Stipple for text */
-
- GnomeCanvas *canvas;
-
- /*
- * During editing.
- */
- CellEdit *edit;
-
-
- int xofs, yofs; /* This gets added to the x
- and y for the cell text. */
- double ellipsis_width[2]; /* The width of the ellipsis. */
-
-} ECellTextView;
-
-struct _CellEdit {
-
- ECellTextView *text_view;
-
- int model_col, view_col, row;
- int cell_width;
-
- PangoLayout *layout;
-
- char *text;
-
- char *old_text;
-
- /*
- * Where the editing is taking place
- */
-
- int xofs_edit, yofs_edit; /* Offset because of editing.
- This is negative compared
- to the other offsets. */
-
- /* This needs to be reworked a bit once we get line wrapping. */
- int selection_start; /* Start of selection - IN BYTES */
- int selection_end; /* End of selection - IN BYTES */
- gboolean select_by_word; /* Current selection is by word */
-
- /* This section is for drag scrolling and blinking cursor. */
- /* Cursor handling. */
- gint timeout_id; /* Current timeout id for scrolling */
- GTimer *timer; /* Timer for blinking cursor and scrolling */
-
- gint lastx, lasty; /* Last x and y motion events */
- gint last_state; /* Last state */
- gulong scroll_start; /* Starting time for scroll (microseconds) */
-
- gint show_cursor; /* Is cursor currently shown */
- gboolean button_down; /* Is mouse button 1 down */
-
- ETextEventProcessor *tep; /* Text Event Processor */
-
- GtkWidget *invisible; /* For selection handling */
- gboolean has_selection; /* TRUE if we have the selection */
- gchar *primary_selection; /* Primary selection text */
- gint primary_length; /* Primary selection text length in BYTES */
- gchar *clipboard_selection; /* Clipboard selection text */
- gint clipboard_length; /* Clipboard selection text length in BYTES */
-
- guint pointer_in : 1;
- guint default_cursor_shown : 1;
-
- ECellActions actions;
-};
-
-static void e_cell_text_view_command (ETextEventProcessor *tep, ETextEventProcessorCommand *command, gpointer data);
-
-static void e_cell_text_view_get_selection (CellEdit *edit, GdkAtom selection, guint32 time);
-static void e_cell_text_view_supply_selection (CellEdit *edit, guint time, GdkAtom selection, char *data, gint length);
-
-static void _get_tep (CellEdit *edit);
-
-static gint get_position_from_xy (CellEdit *edit, gint x, gint y);
-static gboolean _blink_scroll_timeout (gpointer data);
-
-static void calc_ellipsis (ECellTextView *text_view);
-static void ect_free_color (gchar *color_spec, GdkColor *color, GdkColormap *colormap);
-static GdkColor* e_cell_text_get_color (ECellTextView *cell_view, gchar *color_spec);
-
-static ECellClass *parent_class;
-
-char *
-e_cell_text_get_text (ECellText *cell, ETableModel *model, int col, int row)
-{
- if (ECT_CLASS(cell)->get_text)
- return ECT_CLASS(cell)->get_text (cell, model, col, row);
- else
- return NULL;
-}
-
-void
-e_cell_text_free_text (ECellText *cell, char *text)
-{
- if (ECT_CLASS(cell)->free_text)
- ECT_CLASS(cell)->free_text (cell, text);
-}
-
-void
-e_cell_text_set_value (ECellText *cell, ETableModel *model, int col, int row,
- const char *text)
-{
- if (ECT_CLASS(cell)->set_value)
- ECT_CLASS(cell)->set_value (cell, model, col, row, text);
-}
-
-static char *
-ect_real_get_text (ECellText *cell, ETableModel *model, int col, int row)
-{
- return e_table_model_value_at(model, col, row);
-}
-
-static void
-ect_real_free_text (ECellText *cell, char *text)
-{
-}
-
-/* This is the default method for setting the ETableModel value based on
- the text in the ECellText. This simply uses the text as it is - it assumes
- the value in the model is a char*. Subclasses may parse the text into
- data structures to pass to the model. */
-static void
-ect_real_set_value (ECellText *cell, ETableModel *model, int col, int row,
- const char *text)
-{
- e_table_model_set_value_at (model, col, row, text);
-}
-
-static void
-ect_queue_redraw (ECellTextView *text_view, int view_col, int view_row)
-{
- e_table_item_redraw_range (
- text_view->cell_view.e_table_item_view,
- view_col, view_row, view_col, view_row);
-}
-
-static void
-invisible_finalize (gpointer data,
- GObject *invisible)
-{
- CellEdit *edit = data;
- edit->invisible = NULL;
-}
-
-/*
- * Shuts down the editing process
- */
-static void
-ect_stop_editing (ECellTextView *text_view, gboolean commit)
-{
- CellEdit *edit = text_view->edit;
- int row, view_col, model_col;
- char *old_text, *text;
-
- if (!edit)
- return;
-
- row = edit->row;
- view_col = edit->view_col;
- model_col = edit->model_col;
-
- old_text = edit->old_text;
- text = edit->text;
- if (edit->invisible) {
- g_object_weak_unref (G_OBJECT (edit->invisible), invisible_finalize, edit);
- }
- if (edit->tep)
- g_object_unref (edit->tep);
- if (edit->primary_selection)
- g_free (edit->primary_selection);
- if (edit->clipboard_selection)
- g_free (edit->clipboard_selection);
- if (! edit->default_cursor_shown){
- gdk_window_set_cursor (GTK_WIDGET(text_view->canvas)->window, NULL);
- edit->default_cursor_shown = TRUE;
- }
- if (edit->timeout_id) {
- g_source_remove (edit->timeout_id);
- edit->timeout_id = 0;
- }
- if (edit->timer) {
- g_timer_stop (edit->timer);
- g_timer_destroy (edit->timer);
- edit->timer = NULL;
- }
-
- if (edit->layout)
- g_object_unref (edit->layout);
-
- g_free (edit);
-
- text_view->edit = NULL;
- if (commit) {
- /*
- * Accept the currently edited text. if it's the same as what's in the cell, do nothing.
- */
- ECellView *ecell_view = (ECellView *) text_view;
- ECellText *ect = (ECellText *) ecell_view->ecell;
-
- if (strcmp (old_text, text)) {
- e_cell_text_set_value (ect, ecell_view->e_table_model,
- model_col, row, text);
- }
- }
- g_free (text);
- g_free (old_text);
-
- ect_queue_redraw (text_view, view_col, row);
-}
-
-/*
- * Cancels the edits
- */
-static void
-ect_cancel_edit (ECellTextView *text_view)
-{
- ect_stop_editing (text_view, FALSE);
- e_table_item_leave_edit_ (text_view->cell_view.e_table_item_view);
-}
-
-/*
- * ECell::new_view method
- */
-static ECellView *
-ect_new_view (ECell *ecell, ETableModel *table_model, void *e_table_item_view)
-{
- ECellTextView *text_view = g_new0 (ECellTextView, 1);
- GnomeCanvas *canvas = GNOME_CANVAS_ITEM (e_table_item_view)->canvas;
-
- text_view->cell_view.ecell = ecell;
- text_view->cell_view.e_table_model = table_model;
- text_view->cell_view.e_table_item_view = e_table_item_view;
-
- text_view->canvas = canvas;
-
- text_view->xofs = 0.0;
- text_view->yofs = 0.0;
-
- return (ECellView *)text_view;
-}
-
-/*
- * ECell::kill_view method
- */
-static void
-ect_kill_view (ECellView *ecv)
-{
- ECellTextView *text_view = (ECellTextView *) ecv;
-
- g_free (text_view);
-}
-
-/*
- * ECell::realize method
- */
-static void
-ect_realize (ECellView *ecell_view)
-{
- ECellTextView *text_view = (ECellTextView *) ecell_view;
- ECellText *ect = (ECellText *) ecell_view->ecell;
-
- text_view->gc = gdk_gc_new (GTK_WIDGET (text_view->canvas)->window);
-
- text_view->i_cursor = gdk_cursor_new (GDK_XTERM);
-
- if (ect->font_name){
- text_view->font = e_font_from_gdk_name (ect->font_name);
- }
- if (!text_view->font){
- gdk_font_ref (gtk_style_get_font (GTK_WIDGET (text_view->canvas)->style));
- text_view->font = e_font_from_gdk_font (gtk_style_get_font (GTK_WIDGET (text_view->canvas)->style));
- }
-
- calc_ellipsis (text_view);
-
- if (parent_class->realize)
- (* parent_class->realize) (ecell_view);
-}
-
-/*
- * ECell::unrealize method
- */
-static void
-ect_unrealize (ECellView *ecv)
-{
- ECellTextView *text_view = (ECellTextView *) ecv;
- ECellText *ect = (ECellText*) ecv->ecell;
- GdkColormap *colormap;
-
- gdk_gc_unref (text_view->gc);
- text_view->gc = NULL;
-
- if (text_view->edit){
- ect_cancel_edit (text_view);
- }
-
- if (text_view->font)
- e_font_unref (text_view->font);
- text_view->font = NULL;
-
- if (text_view->stipple)
- gdk_bitmap_unref (text_view->stipple);
-
- gdk_cursor_destroy (text_view->i_cursor);
-
- if (ect->colors) {
- colormap = gtk_widget_get_colormap (GTK_WIDGET (text_view->canvas));
- g_hash_table_foreach (ect->colors, (GHFunc) ect_free_color,
- colormap);
- g_hash_table_destroy (ect->colors);
- ect->colors = NULL;
- }
-
- if (parent_class->unrealize)
- (* parent_class->unrealize) (ecv);
-}
-
-static void
-ect_free_color (gchar *color_spec, GdkColor *color, GdkColormap *colormap)
-{
- g_free (color_spec);
-
- /* This frees the color. Note we don't free it if it is the special
- value. */
- if (color != (GdkColor*) 1) {
- gulong pix = color->pixel;
-
- gdk_colors_free (colormap, &pix, 1, 0);
-
- /* This frees the memory for the GdkColor. */
- gdk_color_free (color);
- }
-}
-
-static PangoLayout *
-build_layout (ECellTextView *text_view, int row, const char *text)
-{
- ECellView *ecell_view = (ECellView *) text_view;
- ECellText *ect = E_CELL_TEXT (ecell_view->ecell);
- PangoLayout *layout;
- gboolean bold, strikeout, underline;
-
- layout = gtk_widget_create_pango_layout (GTK_WIDGET (((GnomeCanvasItem *)ecell_view->e_table_item_view)->canvas), text);
-
- bold = ect->bold_column >= 0 &&
- row >= 0 &&
- e_table_model_value_at(ecell_view->e_table_model, ect->bold_column, row);
- strikeout = ect->strikeout_column >= 0 &&
- row >= 0 &&
- e_table_model_value_at(ecell_view->e_table_model, ect->strikeout_column, row);
- underline = ect->underline_column >= 0 &&
- row >= 0 &&
- e_table_model_value_at(ecell_view->e_table_model, ect->underline_column, row);
-
- if (bold || strikeout || underline) {
- PangoAttrList *attrs;
- int length = strlen (text);
- attrs = pango_attr_list_new ();
- if (bold) {
- PangoAttribute *attr = pango_attr_weight_new (PANGO_WEIGHT_BOLD);
- attr->start_index = 0;
- attr->end_index = length;
-
- pango_attr_list_insert_before (attrs, attr);
- }
- if (strikeout) {
- PangoAttribute *attr = pango_attr_strikethrough_new (TRUE);
- attr->start_index = 0;
- attr->end_index = length;
-
- pango_attr_list_insert_before (attrs, attr);
- }
- if (underline) {
- PangoAttribute *attr = pango_attr_underline_new (TRUE);
- attr->start_index = 0;
- attr->end_index = length;
-
- pango_attr_list_insert_before (attrs, attr);
- }
- pango_layout_set_attributes (layout, attrs);
- pango_attr_list_unref (attrs);
- }
-
- return layout;
-}
-
-static PangoLayout *
-generate_layout (ECellTextView *text_view, int model_col, int view_col, int row)
-{
- ECellView *ecell_view = (ECellView *) text_view;
- ECellText *ect = E_CELL_TEXT (ecell_view->ecell);
- PangoLayout *layout;
- CellEdit *edit = text_view->edit;
-
- if (edit && edit->model_col == model_col && edit->row == row) {
- g_object_ref (edit->layout);
- return edit->layout;
- }
-
- if (row >= 0) {
- char *temp = e_cell_text_get_text(ect, ecell_view->e_table_model, model_col, row);
- layout = build_layout (text_view, row, temp);
- e_cell_text_free_text(ect, temp);
- } else
- layout = build_layout (text_view, row, "Mumbo Jumbo");
-
- return layout;
-}
-
-static void
-draw_pango_rectangle (GdkDrawable *drawable, GdkGC *gc, int x1, int y1, PangoRectangle rect)
-{
- int width = rect.width / PANGO_SCALE;
- int height = rect.height / PANGO_SCALE;
- if (width <= 0)
- width = 1;
- if (height <= 0)
- height = 1;
- gdk_draw_rectangle (drawable, gc, TRUE,
- x1 + rect.x / PANGO_SCALE, y1 + rect.y / PANGO_SCALE, width, height);
-}
-
-static gboolean
-show_pango_rectangle (CellEdit *edit, PangoRectangle rect)
-{
- int x1 = rect.x / PANGO_SCALE;
- int x2 = (rect.x + rect.width) / PANGO_SCALE;
-#if 0
- int y1 = rect.y / PANGO_SCALE;
- int y2 = (rect.y + rect.height) / PANGO_SCALE;
-#endif
-
- int new_xofs_edit = edit->xofs_edit;
- int new_yofs_edit = edit->yofs_edit;
-
- if (x1 < new_xofs_edit)
- new_xofs_edit = x1;
- if (2 + x2 - edit->cell_width > new_xofs_edit)
- new_xofs_edit = 2 + x2 - edit->cell_width;
- if (new_xofs_edit < 0)
- new_xofs_edit = 0;
-
-#if 0
- if (y1 < new_yofs_edit)
- new_yofs_edit = y1;
- if (2 + y2 - edit->cell_height > new_yofs_edit)
- new_yofs_edit = 2 + y2 - edit->cell_height;
- if (new_yofs_edit < 0)
- new_yofs_edit = 0;
-#endif
-
- if (new_xofs_edit != edit->xofs_edit ||
- new_yofs_edit != edit->yofs_edit) {
- edit->xofs_edit = new_xofs_edit;
- edit->yofs_edit = new_yofs_edit;
- return TRUE;
- }
-
- return FALSE;
-}
-
-/*
- * ECell::draw method
- */
-static void
-ect_draw (ECellView *ecell_view, GdkDrawable *drawable,
- int model_col, int view_col, int row, ECellFlags flags,
- int x1, int y1, int x2, int y2)
-{
- PangoLayout *layout;
- ECellTextView *text_view = (ECellTextView *) ecell_view;
- ECellText *ect = E_CELL_TEXT (ecell_view->ecell);
- CellEdit *edit = text_view->edit;
- gboolean selected;
- GdkColor *foreground, *cursor_color;
- GtkWidget *canvas = GTK_WIDGET (text_view->canvas);
- GdkRectangle clip_rect;
- int x_origin, y_origin;
-
- selected = flags & E_CELL_SELECTED;
-
- if (selected) {
- if (flags & E_CELL_FOCUSED)
- foreground = &canvas->style->fg [GTK_STATE_SELECTED];
- else
- foreground = &canvas->style->fg [GTK_STATE_ACTIVE];
- cursor_color = foreground;
- } else {
- foreground = &canvas->style->text [GTK_STATE_NORMAL];
- cursor_color = foreground;
-
- if (ect->color_column != -1) {
- char *color_spec;
- GdkColor *cell_foreground;
-
- color_spec = e_table_model_value_at (ecell_view->e_table_model,
- ect->color_column, row);
- cell_foreground = e_cell_text_get_color (text_view,
- color_spec);
- if (cell_foreground)
- foreground = cell_foreground;
- }
- }
-
- gdk_gc_set_foreground (text_view->gc, foreground);
-
- x1 += 4;
- y1 += 1;
- x2 -= 4;
- y2 -= 1;
-
- x_origin = x1 + ect->x + text_view->xofs - (edit ? edit->xofs_edit : 0);
- y_origin = y1 + ect->y + text_view->yofs - (edit ? edit->yofs_edit : 0);
-
- clip_rect.x = x1;
- clip_rect.y = y1;
- clip_rect.width = x2 - x1;
- clip_rect.height = y2 - y1;
-
- gdk_gc_set_clip_rectangle (text_view->gc, &clip_rect);
- /* clip_rect = &rect;*/
-
- layout = generate_layout (text_view, model_col, view_col, row);
-
- gdk_draw_layout (drawable, text_view->gc,
- x_origin, y_origin,
- layout);
-
- if (edit && edit->view_col == view_col && edit->row == row) {
- if (edit->selection_start != edit->selection_end) {
- int start_index, end_index;
- PangoLayoutLine *line;
- gint *ranges;
- gint n_ranges, i;
- PangoRectangle logical_rect;
- GdkRegion *clip_region = gdk_region_new ();
- GdkRegion *rect_region;
- GdkGC *selection_gc;
- GdkGC *text_gc;
-
- start_index = MIN (edit->selection_start, edit->selection_end);
- end_index = edit->selection_start ^ edit->selection_end ^ start_index;
-
- if (edit->has_selection) {
- selection_gc = canvas->style->base_gc [GTK_STATE_SELECTED];
- text_gc = canvas->style->text_gc[GTK_STATE_SELECTED];
- } else {
- selection_gc = canvas->style->base_gc [GTK_STATE_ACTIVE];
- text_gc = canvas->style->text_gc[GTK_STATE_ACTIVE];
- }
-
- gdk_gc_set_clip_rectangle (selection_gc, &clip_rect);
-
- line = pango_layout_get_lines (layout)->data;
-
- pango_layout_line_get_x_ranges (line, start_index, end_index, &ranges, &n_ranges);
-
- pango_layout_get_extents (layout, NULL, &logical_rect);
-
- for (i=0; i < n_ranges; i++) {
- GdkRectangle sel_rect;
-
- sel_rect.x = x_origin + ranges[2*i] / PANGO_SCALE;
- sel_rect.y = y_origin;
- sel_rect.width = (ranges[2*i + 1] - ranges[2*i]) / PANGO_SCALE;
- sel_rect.height = logical_rect.height / PANGO_SCALE;
-
- gdk_draw_rectangle (drawable, selection_gc, TRUE,
- sel_rect.x, sel_rect.y, sel_rect.width, sel_rect.height);
-
- gdk_region_union_with_rect (clip_region, &sel_rect);
- }
-
- rect_region = gdk_region_rectangle (&clip_rect);
- gdk_region_intersect (clip_region, rect_region);
- gdk_region_destroy (rect_region);
-
- gdk_gc_set_clip_region (text_gc, clip_region);
- gdk_draw_layout (drawable, text_gc,
- x_origin, y_origin,
- layout);
- gdk_gc_set_clip_region (text_gc, NULL);
- gdk_gc_set_clip_region (selection_gc, NULL);
-
- gdk_region_destroy (clip_region);
- g_free (ranges);
- } else {
- if (edit->show_cursor) {
- PangoRectangle strong_pos, weak_pos;
- pango_layout_get_cursor_pos (layout, edit->selection_start, &strong_pos, &weak_pos);
- draw_pango_rectangle (drawable, text_view->gc, x_origin, y_origin, strong_pos);
- if (strong_pos.x != weak_pos.x ||
- strong_pos.y != weak_pos.y ||
- strong_pos.width != weak_pos.width ||
- strong_pos.height != weak_pos.height)
- draw_pango_rectangle (drawable, text_view->gc, x_origin, y_origin, weak_pos);
- }
- }
- }
-
- g_object_unref (layout);
-}
-
-/*
- * Get the background color
- */
-static gchar *
-ect_get_bg_color(ECellView *ecell_view, int row)
-{
- ECellText *ect = E_CELL_TEXT (ecell_view->ecell);
- gchar *color_spec;
-
- if (ect->bg_color_column == -1)
- return NULL;
-
- color_spec = e_table_model_value_at (ecell_view->e_table_model,
- ect->bg_color_column, row);
-
- return color_spec;
-}
-
-
-/*
- * Selects the entire string
- */
-static void
-ect_edit_select_all (ECellTextView *text_view)
-{
- g_assert (text_view->edit);
-
- text_view->edit->selection_start = 0;
- text_view->edit->selection_end = strlen (text_view->edit->text);
-}
-
-static gboolean
-key_begins_editing (GdkEventKey *event)
-{
- if (event->length == 0)
- return FALSE;
-
- return TRUE;
-}
-
-/*
- * ECell::event method
- */
-static gint
-ect_event (ECellView *ecell_view, GdkEvent *event, int model_col, int view_col, int row, ECellFlags flags, ECellActions *actions)
-{
- ECellTextView *text_view = (ECellTextView *) ecell_view;
- ETextEventProcessorEvent e_tep_event;
- gboolean edit_display = FALSE;
- CellEdit *edit = text_view->edit;
- GtkWidget *canvas = GTK_WIDGET (text_view->canvas);
- gint return_val = 0;
- d(gboolean press = FALSE);
-
- if (!(flags & E_CELL_EDITING))
- return 0;
-
- if (edit && edit->view_col == view_col && edit->row == row) {
- edit_display = TRUE;
- }
-
- e_tep_event.type = event->type;
- switch (event->type) {
- case GDK_FOCUS_CHANGE:
- break;
- case GDK_KEY_PRESS: /* Fall Through */
- case GDK_KEY_RELEASE:
- if (event->key.keyval == GDK_Escape){
- ect_cancel_edit (text_view);
- return_val = TRUE;
- break;
- }
-
- if ((!edit_display) &&
- e_table_model_is_cell_editable (ecell_view->e_table_model, model_col, row) &&
- key_begins_editing (&event->key)) {
- e_table_item_enter_edit (text_view->cell_view.e_table_item_view, view_col, row);
- ect_edit_select_all (text_view);
- edit = text_view->edit;
- edit_display = TRUE;
- }
- if (edit_display) {
- GdkEventKey key = event->key;
- if (key.keyval == GDK_KP_Enter || key.keyval == GDK_Return){
- e_table_item_leave_edit_ (text_view->cell_view.e_table_item_view);
- } else {
- e_tep_event.key.time = key.time;
- e_tep_event.key.state = key.state;
- e_tep_event.key.keyval = key.keyval;
-
- /* This is probably ugly hack, but we have to handle UTF-8 input somehow */
-#if 0
- e_tep_event.key.length = key.length;
- e_tep_event.key.string = key.string;
-#else
- e_tep_event.key.string = e_utf8_from_gtk_event_key (canvas, key.keyval, key.string);
- if (e_tep_event.key.string != NULL) {
- e_tep_event.key.length = strlen (e_tep_event.key.string);
- } else {
- e_tep_event.key.length = 0;
- }
-#endif
-
- _get_tep (edit);
- edit->actions = 0;
- return_val = e_text_event_processor_handle_event (edit->tep, &e_tep_event);
- *actions = edit->actions;
- if (e_tep_event.key.string) g_free (e_tep_event.key.string);
- break;
- }
- }
-
- break;
- case GDK_BUTTON_PRESS: /* Fall Through */
- d(press = TRUE);
- case GDK_BUTTON_RELEASE:
- d(g_print ("%s: %s\n", __FUNCTION__, press ? "GDK_BUTTON_PRESS" : "GDK_BUTTON_RELEASE"));
- event->button.x -= 4;
- event->button.y -= 1;
- if ((!edit_display)
- && e_table_model_is_cell_editable (ecell_view->e_table_model, model_col, row)
- && event->type == GDK_BUTTON_RELEASE
- && event->button.button == 1) {
- GdkEventButton button = event->button;
-
- e_table_item_enter_edit (text_view->cell_view.e_table_item_view, view_col, row);
- edit = text_view->edit;
- edit_display = TRUE;
-
- e_tep_event.button.type = GDK_BUTTON_PRESS;
- e_tep_event.button.time = button.time;
- e_tep_event.button.state = button.state;
- e_tep_event.button.button = button.button;
- e_tep_event.button.position = get_position_from_xy (edit, event->button.x, event->button.y);
- _get_tep (edit);
- edit->actions = 0;
- return_val = e_text_event_processor_handle_event (edit->tep,
- &e_tep_event);
- *actions = edit->actions;
- if (event->button.button == 1) {
- if (event->type == GDK_BUTTON_PRESS)
- edit->button_down = TRUE;
- else
- edit->button_down = FALSE;
- }
- edit->lastx = button.x;
- edit->lasty = button.y;
- edit->last_state = button.state;
-
- e_tep_event.button.type = GDK_BUTTON_RELEASE;
- }
- if (edit_display) {
- GdkEventButton button = event->button;
- e_tep_event.button.time = button.time;
- e_tep_event.button.state = button.state;
- e_tep_event.button.button = button.button;
- e_tep_event.button.position = get_position_from_xy (edit, event->button.x, event->button.y);
- _get_tep (edit);
- edit->actions = 0;
- return_val = e_text_event_processor_handle_event (edit->tep,
- &e_tep_event);
- *actions = edit->actions;
- if (event->button.button == 1) {
- if (event->type == GDK_BUTTON_PRESS)
- edit->button_down = TRUE;
- else
- edit->button_down = FALSE;
- }
- edit->lastx = button.x;
- edit->lasty = button.y;
- edit->last_state = button.state;
- }
- break;
- case GDK_MOTION_NOTIFY:
- event->motion.x -= 4;
- event->motion.y -= 1;
- if (edit_display) {
- GdkEventMotion motion = event->motion;
- e_tep_event.motion.time = motion.time;
- e_tep_event.motion.state = motion.state;
- e_tep_event.motion.position = get_position_from_xy (edit, event->motion.x, event->motion.y);
- _get_tep (edit);
- edit->actions = 0;
- return_val = e_text_event_processor_handle_event (edit->tep,
- &e_tep_event);
- *actions = edit->actions;
- edit->lastx = motion.x;
- edit->lasty = motion.y;
- edit->last_state = motion.state;
- }
- break;
- case GDK_ENTER_NOTIFY:
-#if 0
- edit->pointer_in = TRUE;
-#endif
- if (edit_display) {
- if (edit->default_cursor_shown){
- gdk_window_set_cursor (canvas->window, text_view->i_cursor);
- edit->default_cursor_shown = FALSE;
- }
- }
- break;
- case GDK_LEAVE_NOTIFY:
-#if 0
- text_view->pointer_in = FALSE;
-#endif
- if (edit_display) {
- if (! edit->default_cursor_shown){
- gdk_window_set_cursor (canvas->window, NULL);
- edit->default_cursor_shown = TRUE;
- }
- }
- break;
- default:
- break;
- }
-
- if (return_val)
- return return_val;
-#if 0
- if (GNOME_CANVAS_ITEM_CLASS(parent_class)->event)
- return GNOME_CANVAS_ITEM_CLASS(parent_class)->event (item, event);
-#endif
- else
- return 0;
-
-}
-
-/*
- * ECell::height method
- */
-static int
-ect_height (ECellView *ecell_view, int model_col, int view_col, int row)
-{
- ECellTextView *text_view = (ECellTextView *) ecell_view;
- gint height;
- PangoLayout *layout;
-
- layout = generate_layout (text_view, model_col, view_col, row);
- pango_layout_get_pixel_size (layout, NULL, &height);
- g_object_unref (layout);
- return height + 2;
-}
-
-/*
- * ECellView::enter_edit method
- */
-static void *
-ect_enter_edit (ECellView *ecell_view, int model_col, int view_col, int row)
-{
- ECellTextView *text_view = (ECellTextView *) ecell_view;
- CellEdit *edit;
- ECellText *ect = E_CELL_TEXT(ecell_view->ecell);
- char *temp;
-
- edit = g_new (CellEdit, 1);
- text_view->edit = edit;
-
- edit->view_col = -1;
- edit->model_col = -1;
- edit->row = -1;
-
- edit->layout = generate_layout (text_view, model_col, view_col, row);
-
- edit->text_view = text_view;
- edit->model_col = model_col;
- edit->view_col = view_col;
- edit->row = row;
- edit->cell_width = e_table_header_get_column (
- ((ETableItem *)ecell_view->e_table_item_view)->header,
- view_col)->width - 8;
-
- edit->xofs_edit = 0.0;
- edit->yofs_edit = 0.0;
-
- edit->selection_start = 0;
- edit->selection_end = 0;
- edit->select_by_word = FALSE;
-
- edit->timeout_id = g_timeout_add (10, _blink_scroll_timeout, text_view);
- edit->timer = g_timer_new ();
- g_timer_elapsed (edit->timer, &(edit->scroll_start));
- g_timer_start (edit->timer);
-
- edit->lastx = 0;
- edit->lasty = 0;
- edit->last_state = 0;
-
- edit->scroll_start = 0;
- edit->show_cursor = TRUE;
- edit->button_down = FALSE;
-
- edit->tep = NULL;
-
- edit->has_selection = FALSE;
-
- edit->invisible = NULL;
- edit->primary_selection = NULL;
- edit->primary_length = 0;
- edit->clipboard_selection = NULL;
- edit->clipboard_length = 0;
-
- edit->pointer_in = FALSE;
- edit->default_cursor_shown = TRUE;
-
- temp = e_cell_text_get_text(ect, ecell_view->e_table_model, model_col, row);
- edit->old_text = g_strdup (temp);
- e_cell_text_free_text(ect, temp);
- edit->text = g_strdup (edit->old_text);
-
-#if 0
- if (edit->pointer_in){
- if (edit->default_cursor_shown){
- gdk_window_set_cursor (GTK_WIDGET(item->canvas)->window, text_view->i_cursor);
- edit->default_cursor_shown = FALSE;
- }
- }
-#endif
-
- ect_queue_redraw (text_view, view_col, row);
-
- return NULL;
-}
-
-/*
- * ECellView::leave_edit method
- */
-static void
-ect_leave_edit (ECellView *ecell_view, int model_col, int view_col, int row, void *edit_context)
-{
- ECellTextView *text_view = (ECellTextView *) ecell_view;
- CellEdit *edit = text_view->edit;
-
- if (edit){
- ect_stop_editing (text_view, TRUE);
- } else {
- /*
- * We did invoke this leave edit internally
- */
- }
-}
-
-/*
- * ECellView::save_state method
- */
-static void *
-ect_save_state (ECellView *ecell_view, int model_col, int view_col, int row, void *edit_context)
-{
- ECellTextView *text_view = (ECellTextView *) ecell_view;
- CellEdit *edit = text_view->edit;
-
- int *save_state = g_new (int, 2);
-
- save_state[0] = edit->selection_start;
- save_state[1] = edit->selection_end;
- return save_state;
-}
-
-/*
- * ECellView::load_state method
- */
-static void
-ect_load_state (ECellView *ecell_view, int model_col, int view_col, int row, void *edit_context, void *save_state)
-{
- ECellTextView *text_view = (ECellTextView *) ecell_view;
- CellEdit *edit = text_view->edit;
- int length;
- int *selection = save_state;
-
- length = strlen (edit->text);
-
- edit->selection_start = MIN (selection[0], length);
- edit->selection_end = MIN (selection[1], length);
-
- ect_queue_redraw (text_view, view_col, row);
-}
-
-/*
- * ECellView::free_state method
- */
-static void
-ect_free_state (ECellView *ecell_view, int model_col, int view_col, int row, void *save_state)
-{
- g_free (save_state);
-}
-
-static void
-ect_print (ECellView *ecell_view, GnomePrintContext *context,
- int model_col, int view_col, int row,
- double width, double height)
-{
- GnomeFont *font = gnome_font_find ("Helvetica", 12);
- char *string;
- ECellText *ect = E_CELL_TEXT(ecell_view->ecell);
- string = e_cell_text_get_text(ect, ecell_view->e_table_model, model_col, row);
- gnome_print_gsave(context);
- if (gnome_print_moveto(context, 2, 2) == -1)
- /* FIXME */;
- if (gnome_print_lineto(context, width - 2, 2) == -1)
- /* FIXME */;
- if (gnome_print_lineto(context, width - 2, height - 2) == -1)
- /* FIXME */;
- if (gnome_print_lineto(context, 2, height - 2) == -1)
- /* FIXME */;
- if (gnome_print_lineto(context, 2, 2) == -1)
- /* FIXME */;
- if (gnome_print_clip(context) == -1)
- /* FIXME */;
- gnome_print_moveto(context, 2, (height - gnome_font_get_ascender(font) + gnome_font_get_descender(font)) / 2);
- gnome_print_setfont(context, font);
- gnome_print_show(context, string);
- gnome_print_grestore(context);
- e_cell_text_free_text(ect, string);
-}
-
-static gdouble
-ect_print_height (ECellView *ecell_view, GnomePrintContext *context,
- int model_col, int view_col, int row,
- double width)
-{
- return 16;
-}
-
-static int
-ect_max_width (ECellView *ecell_view,
- int model_col,
- int view_col)
-{
- /* New ECellText */
- ECellTextView *text_view = (ECellTextView *) ecell_view;
- int row;
- int number_of_rows;
- int max_width = 0;
-
- number_of_rows = e_table_model_row_count (ecell_view->e_table_model);
-
- for (row = 0; row < number_of_rows; row++) {
- PangoLayout *layout = generate_layout (text_view, model_col, view_col, row);
- int width;
-
- pango_layout_get_pixel_size (layout, &width, NULL);
-
- max_width = MAX (max_width, width);
- g_object_unref (layout);
- }
-
- return max_width + 8;
-}
-
-static int
-ect_max_width_by_row (ECellView *ecell_view,
- int model_col,
- int view_col,
- int row)
-{
- /* New ECellText */
- ECellTextView *text_view = (ECellTextView *) ecell_view;
- int width;
- PangoLayout *layout;
-
- if (row >= e_table_model_row_count (ecell_view->e_table_model))
- return 0;
-
- layout = generate_layout (text_view, model_col, view_col, row);
- pango_layout_get_pixel_size (layout, &width, NULL);
- g_object_unref (layout);
-
- return width + 8;
-}
-
-static gint
-tooltip_event (GtkWidget *window,
- GdkEvent *event,
- ETableTooltip *tooltip)
-{
- gint ret_val = FALSE;
-
- switch (event->type) {
- case GDK_LEAVE_NOTIFY:
- e_canvas_hide_tooltip (E_CANVAS(GNOME_CANVAS_ITEM(tooltip->eti)->canvas));
- break;
- case GDK_BUTTON_PRESS:
- case GDK_BUTTON_RELEASE:
- if (event->type == GDK_BUTTON_RELEASE) {
- e_canvas_hide_tooltip (E_CANVAS(GNOME_CANVAS_ITEM(tooltip->eti)->canvas));
- }
-
- event->button.x = tooltip->cx;
- event->button.y = tooltip->cy;
- g_signal_emit_by_name (tooltip->eti, "event",
- event, &ret_val);
- if (!ret_val)
- gtk_propagate_event (GTK_WIDGET(GNOME_CANVAS_ITEM(tooltip->eti)->canvas), event);
- ret_val = TRUE;
- break;
- case GDK_KEY_PRESS:
- e_canvas_hide_tooltip (E_CANVAS(GNOME_CANVAS_ITEM(tooltip->eti)->canvas));
- g_signal_emit_by_name (tooltip->eti, "event",
- event, &ret_val);
- if (!ret_val)
- gtk_propagate_event (GTK_WIDGET(GNOME_CANVAS_ITEM(tooltip->eti)->canvas), event);
- ret_val = TRUE;
- break;
- default:
- break;
- }
-
- return ret_val;
-}
-
-static void
-ect_show_tooltip (ECellView *ecell_view,
- int model_col,
- int view_col,
- int row,
- int col_width,
- ETableTooltip *tooltip)
-{
- ECellTextView *text_view = (ECellTextView *) ecell_view;
- GtkWidget *canvas;
- double i2c[6];
- ArtPoint origin = {0, 0};
- ArtPoint pixel_origin;
- int canvas_x, canvas_y;
- GnomeCanvasItem *tooltip_text;
- double tooltip_width;
- double tooltip_height;
- double tooltip_x;
- double tooltip_y;
- GnomeCanvasItem *rect;
- ECellText *ect = E_CELL_TEXT(ecell_view->ecell);
- GtkWidget *window;
- PangoLayout *layout;
- int width, height;
-
- tooltip->timer = 0;
-
- layout = generate_layout (text_view, model_col, view_col, row);
-
- pango_layout_get_pixel_size (layout, &width, &height);
- if (width < col_width - 8) {
- return;
- }
-
- gnome_canvas_item_i2c_affine (GNOME_CANVAS_ITEM (tooltip->eti), i2c);
- art_affine_point (&pixel_origin, &origin, i2c);
-
- gdk_window_get_origin (GTK_WIDGET (text_view->canvas)->window,
- &canvas_x, &canvas_y);
- pixel_origin.x += canvas_x;
- pixel_origin.y += canvas_y;
- pixel_origin.x -= (int) gtk_layout_get_hadjustment (GTK_LAYOUT (text_view->canvas))->value;
- pixel_origin.y -= (int) gtk_layout_get_vadjustment (GTK_LAYOUT (text_view->canvas))->value;
-
- window = gtk_window_new (GTK_WINDOW_POPUP);
- gtk_container_set_border_width (GTK_CONTAINER (window), 1);
-
- canvas = e_canvas_new ();
- gtk_container_add (GTK_CONTAINER (window), canvas);
- GTK_WIDGET_UNSET_FLAGS (canvas, GTK_CAN_FOCUS);
- GTK_WIDGET_UNSET_FLAGS (window, GTK_CAN_FOCUS);
-
- rect = gnome_canvas_item_new (gnome_canvas_root (GNOME_CANVAS (canvas)),
- gnome_canvas_rect_get_type (),
- "x1", (double) 0.0,
- "y1", (double) 0.0,
- "x2", (double) width + 4,
- "y2", (double) height,
- "fill_color_gdk", tooltip->background,
- NULL);
-
- tooltip_text = gnome_canvas_item_new (gnome_canvas_root (GNOME_CANVAS (canvas)),
- e_text_get_type (),
- "anchor", GTK_ANCHOR_NW,
-/* "font_gdk", text_view->font, */
- "bold", (gboolean) ect->bold_column >= 0 && e_table_model_value_at(ecell_view->e_table_model, ect->bold_column, row),
- "strikeout", (gboolean) ect->strikeout_column >= 0 && e_table_model_value_at(ecell_view->e_table_model, ect->strikeout_column, row),
- "underline", (gboolean) ect->underline_column >= 0 && e_table_model_value_at(ecell_view->e_table_model, ect->underline_column, row),
- "fill_color_gdk", tooltip->foreground,
- "text", pango_layout_get_text (layout),
- "editable", FALSE,
- "clip_width", (double) width,
- "clip_height", (double) height,
- "clip", TRUE,
- "line_wrap", FALSE,
- "justification", E_CELL_TEXT (text_view->cell_view.ecell)->justify,
- "draw_background", FALSE,
- NULL);
-
- tooltip_width = width;
- tooltip_height = height;
- tooltip_y = tooltip->y;
-
- switch (E_CELL_TEXT (text_view->cell_view.ecell)->justify) {
- case GTK_JUSTIFY_CENTER:
- tooltip_x = - tooltip_width / 2;
- break;
- case GTK_JUSTIFY_RIGHT:
- tooltip_x = tooltip_width / 2;
- break;
- case GTK_JUSTIFY_FILL:
- case GTK_JUSTIFY_LEFT:
- tooltip_x = tooltip->x;
- break;
- }
-
- gnome_canvas_item_move (tooltip_text, 3.0, 1.0);
- gnome_canvas_item_set (rect,
- "x2", (double) tooltip_width + 6,
- "y2", (double) tooltip->row_height + 1,
- NULL);
- gtk_widget_set_usize (window, tooltip_width + 6,
- tooltip->row_height + 1);
- gnome_canvas_set_scroll_region (GNOME_CANVAS (canvas), 0.0, 0.0,
- (double) tooltip_width + 6,
- (double) tooltip_height);
- gtk_widget_show (canvas);
- gtk_widget_realize (window);
- g_signal_connect (window, "event",
- G_CALLBACK (tooltip_event), tooltip);
-
- e_canvas_popup_tooltip (E_CANVAS(text_view->canvas), window, pixel_origin.x + tooltip->x,
- pixel_origin.y + tooltip->y - 1);
-
- return;
-}
-
-/*
- * GtkObject::destroy method
- */
-static void
-ect_finalize (GObject *object)
-{
- ECellText *ect = E_CELL_TEXT (object);
-
- g_free (ect->font_name);
-
- G_OBJECT_CLASS (parent_class)->finalize (object);
-}
-/* Set_arg handler for the text item */
-static void
-ect_set_property (GObject *object,
- guint prop_id,
- const GValue *value,
- GParamSpec *pspec)
-{
- ECellText *text;
-
- text = E_CELL_TEXT (object);
-
- switch (prop_id) {
- case PROP_STRIKEOUT_COLUMN:
- text->strikeout_column = g_value_get_int (value);
- break;
-
- case PROP_UNDERLINE_COLUMN:
- text->underline_column = g_value_get_int (value);
- break;
-
- case PROP_BOLD_COLUMN:
- text->bold_column = g_value_get_int (value);
- break;
-
- case PROP_COLOR_COLUMN:
- text->color_column = g_value_get_int (value);
- break;
-
- case PROP_EDITABLE:
- text->editable = g_value_get_boolean (value);
- break;
-
- case PROP_BG_COLOR_COLUMN:
- text->bg_color_column = g_value_get_int (value);
- break;
-
- default:
- return;
- }
-}
-
-/* Get_arg handler for the text item */
-static void
-ect_get_property (GObject *object,
- guint prop_id,
- GValue *value,
- GParamSpec *pspec)
-{
- ECellText *text;
-
- text = E_CELL_TEXT (object);
-
- switch (prop_id) {
- case PROP_STRIKEOUT_COLUMN:
- g_value_set_int (value, text->strikeout_column);
- break;
-
- case PROP_UNDERLINE_COLUMN:
- g_value_set_int (value, text->underline_column);
- break;
-
- case PROP_BOLD_COLUMN:
- g_value_set_int (value, text->bold_column);
- break;
-
- case PROP_COLOR_COLUMN:
- g_value_set_int (value, text->color_column);
- break;
-
- case PROP_EDITABLE:
- g_value_set_boolean (value, text->editable);
- break;
-
- case PROP_BG_COLOR_COLUMN:
- g_value_set_int (value, text->bg_color_column);
- break;
-
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
- break;
- }
-}
-
-static char *ellipsis_default = NULL;
-static gboolean use_ellipsis_default = TRUE;
-
-static void
-e_cell_text_class_init (GObjectClass *object_class)
-{
- ECellClass *ecc = (ECellClass *) object_class;
- ECellTextClass *ectc = (ECellTextClass *) object_class;
- const char *ellipsis_env;
-
- G_OBJECT_CLASS (object_class)->finalize = ect_finalize;
-
- ecc->new_view = ect_new_view;
- ecc->kill_view = ect_kill_view;
- ecc->realize = ect_realize;
- ecc->unrealize = ect_unrealize;
- ecc->draw = ect_draw;
- ecc->event = ect_event;
- ecc->height = ect_height;
- ecc->enter_edit = ect_enter_edit;
- ecc->leave_edit = ect_leave_edit;
- ecc->save_state = ect_save_state;
- ecc->load_state = ect_load_state;
- ecc->free_state = ect_free_state;
- ecc->print = ect_print;
- ecc->print_height = ect_print_height;
- ecc->max_width = ect_max_width;
- ecc->max_width_by_row = ect_max_width_by_row;
- ecc->show_tooltip = ect_show_tooltip;
- ecc->get_bg_color = ect_get_bg_color;
-
- ectc->get_text = ect_real_get_text;
- ectc->free_text = ect_real_free_text;
- ectc->set_value = ect_real_set_value;
-
- object_class->get_property = ect_get_property;
- object_class->set_property = ect_set_property;
-
- parent_class = g_type_class_ref (PARENT_TYPE);
-
- g_object_class_install_property (object_class, PROP_STRIKEOUT_COLUMN,
- g_param_spec_int ("strikeout_column",
- _("Strikeout Column"),
- /*_( */"XXX blurb" /*)*/,
- 0, G_MAXINT, 0,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_UNDERLINE_COLUMN,
- g_param_spec_int ("underline_column",
- _("Underline Column"),
- /*_( */"XXX blurb" /*)*/,
- 0, G_MAXINT, 0,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_BOLD_COLUMN,
- g_param_spec_int ("bold_column",
- _("Bold Column"),
- /*_( */"XXX blurb" /*)*/,
- 0, G_MAXINT, 0,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_COLOR_COLUMN,
- g_param_spec_int ("color_column",
- _("Color Column"),
- /*_( */"XXX blurb" /*)*/,
- 0, G_MAXINT, 0,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_EDITABLE,
- g_param_spec_boolean ("editable",
- _("Editable"),
- /*_( */"XXX blurb" /*)*/,
- FALSE,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_BG_COLOR_COLUMN,
- g_param_spec_int ("bg_color_column",
- _("BG Color Column"),
- /*_( */"XXX blurb" /*)*/,
- 0, G_MAXINT, 0,
- G_PARAM_READWRITE));
-
- if (!clipboard_atom)
- clipboard_atom = gdk_atom_intern ("CLIPBOARD", FALSE);
-
- ellipsis_env = g_getenv ("GAL_ELLIPSIS");
- if (ellipsis_env) {
- if (*ellipsis_env) {
- ellipsis_default = g_strdup (ellipsis_env);
- } else {
- use_ellipsis_default = FALSE;
- }
- }
-}
-
-static void
-e_cell_text_init (ECellText *ect)
-{
- ect->ellipsis = g_strdup (ellipsis_default);
- ect->use_ellipsis = use_ellipsis_default;
- ect->strikeout_column = -1;
- ect->underline_column = -1;
- ect->bold_column = -1;
- ect->color_column = -1;
- ect->bg_color_column = -1;
- ect->editable = TRUE;
-}
-
-E_MAKE_TYPE(e_cell_text, "ECellText", ECellText, e_cell_text_class_init, e_cell_text_init, PARENT_TYPE)
-
-/**
- * e_cell_text_construct:
- * @cell: The cell to construct
- * @fontname: font to be used to render on the screen
- * @justify: Justification of the string in the cell
- *
- * constructs the ECellText. To be used by subclasses and language
- * bindings.
- *
- * Returns: The ECellText.
- */
-ECell *
-e_cell_text_construct (ECellText *cell, const char *fontname, GtkJustification justify)
-{
- cell->font_name = g_strdup (fontname);
- cell->justify = justify;
- return E_CELL(cell);
-}
-
-/**
- * e_cell_text_new:
- * @fontname: font to be used to render on the screen
- * @justify: Justification of the string in the cell.
- *
- * Creates a new ECell renderer that can be used to render strings that
- * that come from the model. The value returned from the model is
- * interpreted as being a char *.
- *
- * The ECellText object support a large set of properties that can be
- * configured through the Gtk argument system and allows the user to have
- * a finer control of the way the string is displayed. The arguments supported
- * allow the control of strikeout, underline, bold, and color.
- *
- * The arguments "strikeout_column", "underline_column", "bold_column"
- * and "color_column" set and return an integer that points to a
- * column in the model that controls these settings. So controlling
- * the way things are rendered is achieved by having special columns
- * in the model that will be used to flag whether the text should be
- * rendered with strikeout, or bolded. In the case of the
- * "color_column" argument, the column in the model is expected to
- * have a string that can be parsed by gdk_color_parse().
- *
- * Returns: an ECell object that can be used to render strings.
- */
-ECell *
-e_cell_text_new (const char *fontname, GtkJustification justify)
-{
- ECellText *ect = g_object_new (E_CELL_TEXT_TYPE, NULL);
-
- e_cell_text_construct(ect, fontname, justify);
-
- return (ECell *) ect;
-}
-
-
-/* fixme: Handle Font attributes */
-/* position is in BYTES */
-
-static gint
-get_position_from_xy (CellEdit *edit, gint x, gint y)
-{
- int index;
- int trailing;
- const char *text;
- PangoLayout *layout = edit->layout;
- ECellTextView *text_view = edit->text_view;
- ECellText *ect = (ECellText *) ((ECellView *)text_view)->ecell;
-
- x -= (ect->x + text_view->xofs - edit->xofs_edit);
- y -= (ect->y + text_view->yofs - edit->yofs_edit);
-
- pango_layout_xy_to_index (layout, x * PANGO_SCALE, y * PANGO_SCALE, &index, &trailing);
-
- text = pango_layout_get_text (layout);
-
- return g_utf8_offset_to_pointer (text + index, trailing) - text;
-}
-
-#define SCROLL_WAIT_TIME 30000
-
-static gboolean
-_blink_scroll_timeout (gpointer data)
-{
- ECellTextView *text_view = (ECellTextView *) data;
- ECellText *ect = E_CELL_TEXT (((ECellView *)text_view)->ecell);
- CellEdit *edit = text_view->edit;
-
- gulong current_time;
- gboolean scroll = FALSE;
- gboolean redraw = FALSE;
- int width, height;
-
- g_timer_elapsed (edit->timer, &current_time);
-
- if (edit->scroll_start + SCROLL_WAIT_TIME > 1000000) {
- if (current_time > edit->scroll_start - (1000000 - SCROLL_WAIT_TIME) &&
- current_time < edit->scroll_start)
- scroll = TRUE;
- } else {
- if (current_time > edit->scroll_start + SCROLL_WAIT_TIME ||
- current_time < edit->scroll_start)
- scroll = TRUE;
- }
-
- pango_layout_get_pixel_size (edit->layout, &width, &height);
-
- if (scroll && edit->button_down) {
- /* FIXME: Copy this for y. */
- if (edit->lastx - ect->x > edit->cell_width) {
- if (edit->xofs_edit < width - edit->cell_width) {
- edit->xofs_edit += 4;
- if (edit->xofs_edit > width - edit->cell_width + 1)
- edit->xofs_edit = width - edit->cell_width + 1;
- redraw = TRUE;
- }
- }
- if (edit->lastx - ect->x < 0 &&
- edit->xofs_edit > 0) {
- edit->xofs_edit -= 4;
- if (edit->xofs_edit < 0)
- edit->xofs_edit = 0;
- redraw = TRUE;
- }
- if (redraw) {
- ETextEventProcessorEvent e_tep_event;
- e_tep_event.type = GDK_MOTION_NOTIFY;
- e_tep_event.motion.state = edit->last_state;
- e_tep_event.motion.time = 0;
- e_tep_event.motion.position = get_position_from_xy (edit, edit->lastx, edit->lasty);
- _get_tep (edit);
- e_text_event_processor_handle_event (edit->tep,
- &e_tep_event);
- edit->scroll_start = current_time;
- }
- }
-
- if (!((current_time / 500000) % 2)) {
- if (!edit->show_cursor)
- redraw = TRUE;
- edit->show_cursor = TRUE;
- } else {
- if (edit->show_cursor)
- redraw = TRUE;
- edit->show_cursor = FALSE;
- }
- if (redraw){
- ect_queue_redraw (text_view, edit->view_col, edit->row);
- }
- return TRUE;
-}
-
-static int
-next_word (CellEdit *edit, int start)
-{
- char *p;
- int length;
-
- length = strlen (edit->text);
- if (start >= length)
- return length;
-
- p = g_utf8_next_char (edit->text + start);
-
- while (*p && g_unichar_validate (g_utf8_get_char (p))) {
- gunichar unival = g_utf8_get_char (p);
- if (g_unichar_isspace (unival))
- return p - edit->text;
- p = g_utf8_next_char (p);
- }
-
- return p - edit->text;
-}
-
-static int
-_get_position (ECellTextView *text_view, ETextEventProcessorCommand *command)
-{
- int length;
- CellEdit *edit = text_view->edit;
- EFont *font;
- gchar *p;
- int unival;
- int index;
- int trailing;
-
- font = text_view->font;
-
- switch (command->position) {
-
- case E_TEP_VALUE:
- return command->value;
-
- case E_TEP_SELECTION:
- return edit->selection_end;
-
- case E_TEP_START_OF_BUFFER:
- return 0;
-
- /* fixme: this probably confuses TEP */
-
- case E_TEP_END_OF_BUFFER:
- return strlen (edit->text);
-
- case E_TEP_START_OF_LINE:
-
- if (edit->selection_end < 1) return 0;
-
- p = g_utf8_find_prev_char (edit->text, edit->text + edit->selection_end);
-
- if (p == edit->text) return 0;
-
- p = g_utf8_find_prev_char (edit->text, p);
-
- while (p && p > edit->text) {
- if (*p == '\n') return p - edit->text + 1;
- p = g_utf8_find_prev_char (edit->text, p);
- }
-
- return 0;
-
- case E_TEP_END_OF_LINE:
-
- length = strlen (edit->text);
- if (edit->selection_end >= length) return length;
-
- p = g_utf8_next_char (edit->text + edit->selection_end);
-
- while (*p && g_unichar_validate (g_utf8_get_char (p))) {
- if (*p == '\n') return p - edit->text;
- p = g_utf8_next_char (p);
- }
-
- return p - edit->text;
-
- case E_TEP_FORWARD_CHARACTER:
-
- length = strlen (edit->text);
- if (edit->selection_end >= length) return length;
-
- p = g_utf8_next_char (edit->text + edit->selection_end);
-
- return p - edit->text;
-
- case E_TEP_BACKWARD_CHARACTER:
-
- if (edit->selection_end < 1) return 0;
-
- p = g_utf8_find_prev_char (edit->text, edit->text + edit->selection_end);
-
- if (p == NULL) return 0;
-
- return p - edit->text;
-
- case E_TEP_FORWARD_WORD:
- return next_word (edit, edit->selection_end);
-
- case E_TEP_BACKWARD_WORD:
-
- if (edit->selection_end < 1) return 0;
-
- p = g_utf8_find_prev_char (edit->text, edit->text + edit->selection_end);
-
- if (p == edit->text) return 0;
-
- p = g_utf8_find_prev_char (edit->text, p);
-
- while (p && p > edit->text && g_unichar_validate (g_utf8_get_char (p))) {
- unival = g_utf8_get_char (p);
- if (g_unichar_isspace (unival)) {
- return (g_utf8_next_char (p) - edit->text);
- }
- p = g_utf8_find_prev_char (edit->text, p);
- }
-
- return 0;
-
- case E_TEP_FORWARD_LINE:
- pango_layout_move_cursor_visually (edit->layout,
- TRUE,
- edit->selection_end,
- 0,
- TRUE,
- &index,
- &trailing);
- index = g_utf8_offset_to_pointer (edit->text + index, trailing) - edit->text;
- if (index < 0)
- return 0;
- length = strlen (edit->text);
- if (index >= length)
- return length;
- return index;
- case E_TEP_BACKWARD_LINE:
- pango_layout_move_cursor_visually (edit->layout,
- TRUE,
- edit->selection_end,
- 0,
- TRUE,
- &index,
- &trailing);
-
- index = g_utf8_offset_to_pointer (edit->text + index, trailing) - edit->text;
- if (index < 0)
- return 0;
- length = strlen (edit->text);
- if (index >= length)
- return length;
- return index;
- case E_TEP_FORWARD_PARAGRAPH:
- case E_TEP_BACKWARD_PARAGRAPH:
-
- case E_TEP_FORWARD_PAGE:
- case E_TEP_BACKWARD_PAGE:
- return edit->selection_end;
- default:
- return edit->selection_end;
- }
- g_assert_not_reached ();
- return 0; /* Kill warning */
-}
-
-static void
-_delete_selection (ECellTextView *text_view)
-{
- CellEdit *edit = text_view->edit;
- gint length;
- gchar *sp, *ep;
-
- if (edit->selection_end == edit->selection_start) return;
-
- if (edit->selection_end < edit->selection_start) {
- edit->selection_end ^= edit->selection_start;
- edit->selection_start ^= edit->selection_end;
- edit->selection_end ^= edit->selection_start;
- }
-
- sp = edit->text + edit->selection_start;
- ep = edit->text + edit->selection_end;
- length = strlen (ep) + 1;
-
- memmove (sp, ep, length);
-
- edit->selection_end = edit->selection_start;
-}
-
-/* fixme: */
-/* NB! We expect value to be length IN BYTES */
-
-static void
-_insert (ECellTextView *text_view, char *string, int value)
-{
- CellEdit *edit = text_view->edit;
- char *temp;
-
- if (value <= 0) return;
-
- temp = g_new (gchar, strlen (edit->text) + value + 1);
-
- strncpy (temp, edit->text, edit->selection_start);
- strncpy (temp + edit->selection_start, string, value);
- strcpy (temp + edit->selection_start + value, edit->text + edit->selection_end);
-
- g_free (edit->text);
-
- edit->text = temp;
-
- edit->selection_start += value;
- edit->selection_end = edit->selection_start;
-}
-
-static void
-capitalize (CellEdit *edit, int start, int end, ETextEventProcessorCaps type)
-{
- ECellTextView *text_view = edit->text_view;
-
- gboolean first = TRUE;
- int character_length = g_utf8_strlen (edit->text + start, start - end);
- const char *p = edit->text + start;
- const char *text_end = edit->text + end;
- char *new_text = g_new0 (char, character_length * 6 + 1);
- char *output = new_text;
-
- while (p && *p && p < text_end && g_unichar_validate (g_utf8_get_char (p))) {
- gunichar unival = g_utf8_get_char (p);
- gunichar newval = unival;
-
- switch (type) {
- case E_TEP_CAPS_UPPER:
- newval = g_unichar_toupper (unival);
- break;
- case E_TEP_CAPS_LOWER:
- newval = g_unichar_tolower (unival);
- break;
- case E_TEP_CAPS_TITLE:
- if (g_unichar_isalpha (unival)) {
- if (first)
- newval = g_unichar_totitle (unival);
- else
- newval = g_unichar_tolower (unival);
- first = FALSE;
- } else {
- first = TRUE;
- }
- break;
- }
- g_unichar_to_utf8 (newval, output);
- output = g_utf8_next_char (output);
-
- p = g_utf8_next_char (p);
- }
- *output = 0;
-
- edit->selection_end = end;
- edit->selection_start = start;
- _delete_selection (text_view);
-
- _insert (text_view, new_text, output - new_text);
-
- g_free (new_text);
-}
-
-static void
-e_cell_text_view_command (ETextEventProcessor *tep, ETextEventProcessorCommand *command, gpointer data)
-{
- CellEdit *edit = (CellEdit *) data;
- ECellTextView *text_view = edit->text_view;
- ECellText *ect = E_CELL_TEXT (text_view->cell_view.ecell);
-
- gboolean change = FALSE;
- gboolean redraw = FALSE;
-
- int sel_start, sel_end;
- EFont *font;
-
- font = text_view->font;
-
- /* If the EText isn't editable, then ignore any commands that would
- modify the text. */
- if (!ect->editable && (command->action == E_TEP_DELETE
- || command->action == E_TEP_INSERT
- || command->action == E_TEP_PASTE
- || command->action == E_TEP_GET_SELECTION))
- return;
-
- switch (command->action) {
- case E_TEP_MOVE:
- edit->selection_start = _get_position (text_view, command);
- edit->selection_end = edit->selection_start;
- if (edit->timer) {
- g_timer_reset (edit->timer);
- }
- redraw = TRUE;
- break;
- case E_TEP_SELECT:
- edit->selection_end = _get_position (text_view, command);
- sel_start = MIN(edit->selection_start, edit->selection_end);
- sel_end = MAX(edit->selection_start, edit->selection_end);
- if (sel_start != sel_end) {
- e_cell_text_view_supply_selection (edit, command->time, GDK_SELECTION_PRIMARY,
- edit->text + sel_start,
- sel_end - sel_start);
- } else if (edit->timer) {
- g_timer_reset (edit->timer);
- }
- redraw = TRUE;
- break;
- case E_TEP_DELETE:
- if (edit->selection_end == edit->selection_start) {
- edit->selection_end = _get_position (text_view, command);
- }
- _delete_selection (text_view);
- if (edit->timer) {
- g_timer_reset (edit->timer);
- }
- redraw = TRUE;
- change = TRUE;
- break;
-
- case E_TEP_INSERT:
- if (edit->selection_end != edit->selection_start) {
- _delete_selection (text_view);
- }
- _insert (text_view, command->string, command->value);
- if (edit->timer) {
- g_timer_reset (edit->timer);
- }
- redraw = TRUE;
- change = TRUE;
- break;
- case E_TEP_COPY:
- sel_start = MIN(edit->selection_start, edit->selection_end);
- sel_end = MAX(edit->selection_start, edit->selection_end);
- if (sel_start != sel_end) {
- e_cell_text_view_supply_selection (edit, command->time, clipboard_atom,
- edit->text + sel_start,
- sel_end - sel_start);
- }
- if (edit->timer) {
- g_timer_reset (edit->timer);
- }
- break;
- case E_TEP_PASTE:
- e_cell_text_view_get_selection (edit, clipboard_atom, command->time);
- if (edit->timer) {
- g_timer_reset (edit->timer);
- }
- redraw = TRUE;
- change = TRUE;
- break;
- case E_TEP_GET_SELECTION:
- e_cell_text_view_get_selection (edit, GDK_SELECTION_PRIMARY, command->time);
- break;
- case E_TEP_ACTIVATE:
- e_table_item_leave_edit_ (text_view->cell_view.e_table_item_view);
- break;
- case E_TEP_SET_SELECT_BY_WORD:
- edit->select_by_word = command->value;
- break;
- case E_TEP_GRAB:
- edit->actions = E_CELL_GRAB;
- break;
- case E_TEP_UNGRAB:
- edit->actions = E_CELL_UNGRAB;
- break;
- case E_TEP_CAPS:
- if (edit->selection_start == edit->selection_end) {
- capitalize (edit, edit->selection_start, next_word (edit, edit->selection_start), command->value);
- } else {
- int selection_start = MIN (edit->selection_start, edit->selection_end);
- int selection_end = edit->selection_start + edit->selection_end - selection_start; /* Slightly faster than MAX */
- capitalize (edit, selection_start, selection_end, command->value);
- }
- if (edit->timer) {
- g_timer_reset (edit->timer);
- }
- redraw = TRUE;
- change = TRUE;
- break;
- case E_TEP_NOP:
- break;
- }
-
- if (change) {
- if (edit->layout)
- g_object_unref (edit->layout);
- edit->layout = build_layout (text_view, edit->row, edit->text);
- }
-
- if (!edit->button_down) {
- PangoRectangle strong_pos, weak_pos;
- pango_layout_get_cursor_pos (edit->layout, edit->selection_end, &strong_pos, &weak_pos);
- if (strong_pos.x != weak_pos.x ||
- strong_pos.y != weak_pos.y ||
- strong_pos.width != weak_pos.width ||
- strong_pos.height != weak_pos.height) {
- if (show_pango_rectangle (edit, weak_pos))
- redraw = TRUE;
- }
- if (show_pango_rectangle (edit, strong_pos)) {
- redraw = TRUE;
- }
- }
-
- if (redraw){
- ect_queue_redraw (text_view, edit->view_col, edit->row);
- }
-}
-
-#ifdef DO_SELECTION
-static void
-_selection_clear_event (GtkInvisible *invisible,
- GdkEventSelection *event,
- CellEdit *edit)
-{
- if (event->selection == GDK_SELECTION_PRIMARY) {
- g_free (edit->primary_selection);
- edit->primary_selection = NULL;
- edit->primary_length = 0;
-
- edit->has_selection = FALSE;
-#if 0
- gnome_canvas_item_request_update (GNOME_CANVAS_ITEM(text));
-#endif
-
- } else if (event->selection == clipboard_atom) {
- g_free (edit->clipboard_selection);
- edit->clipboard_selection = NULL;
- edit->clipboard_length = 0;
- }
-}
-
-static void
-_selection_get (GtkInvisible *invisible,
- GtkSelectionData *selection_data,
- guint info,
- guint time_stamp,
- CellEdit *edit)
-{
- switch (info) {
- case E_SELECTION_PRIMARY:
- gtk_selection_data_set (selection_data, GDK_SELECTION_TYPE_STRING,
- 8, edit->primary_selection, edit->primary_length);
- break;
- case E_SELECTION_CLIPBOARD:
- gtk_selection_data_set (selection_data, GDK_SELECTION_TYPE_STRING,
- 8, edit->clipboard_selection, edit->clipboard_length);
- break;
- }
-}
-
-/* fixme: What happens, if delivered string is not UTF-8? */
-
-static void
-_selection_received (GtkInvisible *invisible,
- GtkSelectionData *selection_data,
- guint time,
- CellEdit *edit)
-{
- if (selection_data->length < 0 || selection_data->type != GDK_SELECTION_TYPE_STRING) {
- return;
- } else {
- ETextEventProcessorCommand command;
- command.action = E_TEP_INSERT;
- command.position = E_TEP_SELECTION;
- command.string = selection_data->data;
- command.value = selection_data->length;
- command.time = time;
- e_cell_text_view_command (edit->tep, &command, edit);
- }
-}
-
-static GtkWidget *e_cell_text_view_get_invisible (CellEdit *edit)
-{
- if (edit->invisible == NULL) {
- GtkWidget *invisible = gtk_invisible_new ();
- edit->invisible = invisible;
-
- gtk_selection_add_target (invisible,
- GDK_SELECTION_PRIMARY,
- GDK_SELECTION_TYPE_STRING,
- E_SELECTION_PRIMARY);
- gtk_selection_add_target (invisible,
- clipboard_atom,
- GDK_SELECTION_TYPE_STRING,
- E_SELECTION_CLIPBOARD);
-
- g_signal_connect (invisible, "selection_get",
- G_CALLBACK (_selection_get),
- edit);
- g_signal_connect (invisible, "selection_clear_event",
- G_CALLBACK (_selection_clear_event),
- edit);
- g_signal_connect (invisible, "selection_received",
- G_CALLBACK (_selection_received),
- edit);
-
- g_object_weak_ref (G_OBJECT (invisible), invisible_finalize, edit);
- }
- return edit->invisible;
-}
-#endif
-
-static void
-e_cell_text_view_supply_selection (CellEdit *edit, guint time, GdkAtom selection, char *data, gint length)
-{
-#if DO_SELECTION
- gboolean successful;
- GtkWidget *invisible;
-
- invisible = e_cell_text_view_get_invisible (edit);
-
- if (selection == GDK_SELECTION_PRIMARY){
- if (edit->primary_selection) {
- g_free (edit->primary_selection);
- }
- edit->primary_selection = g_strndup (data, length);
- edit->primary_length = length;
- } else if (selection == clipboard_atom) {
- if (edit->clipboard_selection) {
- g_free (edit->clipboard_selection);
- }
- edit->clipboard_selection = g_strndup (data, length);
- edit->clipboard_length = length;
- }
-
- successful = gtk_selection_owner_set (invisible,
- selection,
- time);
-
- if (selection == GDK_SELECTION_PRIMARY)
- edit->has_selection = successful;
-#endif
-}
-
-static void
-e_cell_text_view_get_selection (CellEdit *edit, GdkAtom selection, guint32 time)
-{
-#if DO_SELECTION
- GtkWidget *invisible;
- invisible = e_cell_text_view_get_invisible (edit);
- gtk_selection_convert (invisible,
- selection,
- GDK_SELECTION_TYPE_STRING,
- time);
-#endif
-}
-
-static void
-_get_tep (CellEdit *edit)
-{
- if (!edit->tep) {
- edit->tep = e_text_event_processor_emacs_like_new ();
- g_signal_connect (edit->tep,
- "command",
- G_CALLBACK(e_cell_text_view_command),
- (gpointer) edit);
- }
-}
-
-static void
-calc_ellipsis (ECellTextView *text_view)
-{
- ECellText *ect = E_CELL_TEXT (((ECellView *)text_view)->ecell);
- EFont *font;
-
- font = text_view->font;
- if (font) {
- text_view->ellipsis_width[E_FONT_PLAIN] =
- e_font_utf8_text_width (font, E_FONT_PLAIN,
- ect->ellipsis ? ect->ellipsis : "...",
- ect->ellipsis ? strlen (ect->ellipsis) : 3);
- text_view->ellipsis_width[E_FONT_BOLD] =
- e_font_utf8_text_width (font, E_FONT_BOLD,
- ect->ellipsis ? ect->ellipsis : "...",
- ect->ellipsis ? strlen (ect->ellipsis) : 3);
- }
-}
-
-static GdkColor*
-e_cell_text_get_color (ECellTextView *cell_view, gchar *color_spec)
-{
- ECellText *ect = E_CELL_TEXT (((ECellView*) cell_view)->ecell);
- GdkColormap *colormap;
- GdkColor *color, tmp_color;
-
- /* If the color spec is NULL we use the default color. */
- if (color_spec == NULL)
- return NULL;
-
- /* Create the hash table if we haven't already. */
- if (!ect->colors)
- ect->colors = g_hash_table_new (g_str_hash, g_str_equal);
-
- /* See if we've already allocated the color. Note that we use a
- special value of (GdkColor*) 1 in the hash to indicate that we've
- already tried and failed to allocate the color, so we don't keep
- trying to allocate it. */
- color = g_hash_table_lookup (ect->colors, color_spec);
- if (color == (GdkColor*) 1)
- return NULL;
- if (color)
- return color;
-
- /* Try to parse the color. */
- if (gdk_color_parse (color_spec, &tmp_color)) {
- colormap = gtk_widget_get_colormap (GTK_WIDGET (cell_view->canvas));
-
- /* Try to allocate the color. */
- if (gdk_color_alloc (colormap, &tmp_color))
- color = gdk_color_copy (&tmp_color);
- }
-
- g_hash_table_insert (ect->colors, g_strdup (color_spec),
- color ? color : (GdkColor*) 1);
- return color;
-}
-
diff --git a/widgets/table/e-cell-text.h b/widgets/table/e-cell-text.h
deleted file mode 100644
index 466fc54f1a..0000000000
--- a/widgets/table/e-cell-text.h
+++ /dev/null
@@ -1,108 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-cell-text.h: Text cell renderer.
- * Copyright 1999, 2000, 2001, Ximian, Inc.
- *
- * Authors:
- * Miguel de Icaza <miguel@ximian.com>
- * Chris Lahey <clahey@ximian.com>
- *
- * A lot of code taken from:
- *
- * Text item type for GnomeCanvas widget
- *
- * GnomeCanvas is basically a port of the Tk toolkit's most excellent
- * canvas widget. Tk is copyrighted by the Regents of the University
- * of California, Sun Microsystems, and other parties.
- *
- * Copyright (C) 1998 The Free Software Foundation
- *
- * Author: Federico Mena <federico@nuclecu.unam.mx>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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.
- */
-
-#ifndef _E_CELL_TEXT_H_
-#define _E_CELL_TEXT_H_
-
-#include <libgnomecanvas/gnome-canvas.h>
-#include <gal/e-table/e-cell.h>
-
-G_BEGIN_DECLS
-
-#define E_CELL_TEXT_TYPE (e_cell_text_get_type ())
-#define E_CELL_TEXT(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), E_CELL_TEXT_TYPE, ECellText))
-#define E_CELL_TEXT_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), E_CELL_TEXT_TYPE, ECellTextClass))
-#define E_IS_CELL_TEXT(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), E_CELL_TEXT_TYPE))
-#define E_IS_CELL_TEXT_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), E_CELL_TEXT_TYPE))
-
-typedef struct {
- ECell parent;
-
- GtkJustification justify;
- char *font_name;
-
- double x, y; /* Position at anchor */
-
- gulong pixel; /* Fill color */
-
- /* Clip handling */
- char *ellipsis; /* The ellipsis characters. NULL = "...". */
-
- guint use_ellipsis : 1; /* Whether to use the ellipsis. */
- guint editable : 1; /* Whether the text can be edited. */
-
- int strikeout_column;
- int underline_column;
- int bold_column;
-
- /* This column in the ETable should return a string specifying a color,
- either a color name like "red" or a color spec like "rgb:F/0/0".
- See the XParseColor man page for the formats available. */
- int color_column;
- int bg_color_column;
-
- /* This stores the colors we have allocated. */
- GHashTable *colors;
-} ECellText;
-
-typedef struct {
- ECellClass parent_class;
-
- char *(*get_text) (ECellText *cell, ETableModel *model, int col, int row);
- void (*free_text) (ECellText *cell, char *text);
- void (*set_value) (ECellText *cell, ETableModel *model, int col, int row, const char *text);
-} ECellTextClass;
-
-GType e_cell_text_get_type (void);
-ECell *e_cell_text_new (const char *fontname, GtkJustification justify);
-ECell *e_cell_text_construct(ECellText *cell, const char *fontname, GtkJustification justify);
-
-/* Gets the value from the model and converts it into a string. In ECellText
- itself, the value is assumed to be a char* and so needs no conversion.
- In subclasses the ETableModel value may be a more complicated datatype. */
-char *e_cell_text_get_text (ECellText *cell, ETableModel *model, int col, int row);
-
-/* Frees the value returned by e_cell_text_get_text(). */
-void e_cell_text_free_text (ECellText *cell, char *text);
-
-/* Sets the ETableModel value, based on the given string. */
-void e_cell_text_set_value (ECellText *cell, ETableModel *model, int col, int row, const char *text);
-
-G_END_DECLS
-
-#endif /* _E_CELL_TEXT_H_ */
-
-
diff --git a/widgets/table/e-cell-toggle.c b/widgets/table/e-cell-toggle.c
deleted file mode 100644
index 469a41bde4..0000000000
--- a/widgets/table/e-cell-toggle.c
+++ /dev/null
@@ -1,501 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-cell-toggle.c - Multi-state image toggle cell object.
- * Copyright 1999, 2000, Ximian, Inc.
- *
- * Authors:
- * Miguel de Icaza <miguel@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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 <gtk/gtkenums.h>
-#include <gtk/gtkentry.h>
-#include <gtk/gtkwindow.h>
-#include <gtk/gtksignal.h>
-#include <gdk/gdkkeysyms.h>
-#include <libgnomecanvas/gnome-canvas.h>
-#include "e-cell-toggle.h"
-#include "gal/util/e-util.h"
-#include "gal/widgets/e-hsv-utils.h"
-#include "e-table-item.h"
-
-#define PARENT_TYPE e_cell_get_type ()
-
-typedef struct {
- ECellView cell_view;
- GdkGC *gc;
- GnomeCanvas *canvas;
- GdkPixmap **pixmap_cache;
-} ECellToggleView;
-
-static ECellClass *parent_class;
-
-#define CACHE_SEQ_COUNT 6
-
-static int
-gnome_print_pixbuf (GnomePrintContext *pc, GdkPixbuf *pixbuf)
-{
- if (gdk_pixbuf_get_has_alpha (pixbuf))
- return gnome_print_rgbaimage (pc,
- gdk_pixbuf_get_pixels (pixbuf),
- gdk_pixbuf_get_width (pixbuf),
- gdk_pixbuf_get_height (pixbuf),
- gdk_pixbuf_get_rowstride (pixbuf));
- else
- return gnome_print_rgbimage (pc,
- gdk_pixbuf_get_pixels (pixbuf),
- gdk_pixbuf_get_width (pixbuf),
- gdk_pixbuf_get_height (pixbuf),
- gdk_pixbuf_get_rowstride (pixbuf));
-}
-
-/*
- * ECell::realize method
- */
-static ECellView *
-etog_new_view (ECell *ecell, ETableModel *table_model, void *e_table_item_view)
-{
- ECellToggleView *toggle_view = g_new0 (ECellToggleView, 1);
- ETableItem *eti = E_TABLE_ITEM (e_table_item_view);
- GnomeCanvas *canvas = GNOME_CANVAS_ITEM (eti)->canvas;
- ECellToggle *etog = E_CELL_TOGGLE (ecell);
- int i;
-
- toggle_view->cell_view.ecell = ecell;
- toggle_view->cell_view.e_table_model = table_model;
- toggle_view->cell_view.e_table_item_view = e_table_item_view;
- toggle_view->canvas = canvas;
- toggle_view->pixmap_cache = g_new (GdkPixmap *, etog->n_states * CACHE_SEQ_COUNT);
- for (i = 0; i < etog->n_states * CACHE_SEQ_COUNT; i++)
- toggle_view->pixmap_cache[i] = NULL;
-
- return (ECellView *) toggle_view;
-}
-
-static void
-etog_kill_view (ECellView *ecell_view)
-{
- ECellToggle *etog = E_CELL_TOGGLE (ecell_view->ecell);
- ECellToggleView *toggle_view = (ECellToggleView *) ecell_view;
- int i;
-
- for (i = 0; i < etog->n_states * CACHE_SEQ_COUNT; i++)
- if (toggle_view->pixmap_cache[i])
- gdk_pixmap_unref (toggle_view->pixmap_cache[i]);
- g_free (toggle_view->pixmap_cache);
- g_free (ecell_view);
-}
-
-static void
-etog_realize (ECellView *ecell_view)
-{
- ECellToggleView *toggle_view = (ECellToggleView *) ecell_view;
-
- toggle_view->gc = gdk_gc_new (GTK_WIDGET (toggle_view->canvas)->window);
-}
-
-/*
- * ECell::unrealize method
- */
-static void
-etog_unrealize (ECellView *ecv)
-{
- ECellToggleView *toggle_view = (ECellToggleView *) ecv;
-
- gdk_gc_unref (toggle_view->gc);
- toggle_view->gc = NULL;
-}
-
-#define PIXMAP_CACHE(toggle_view, cache_seq, image_seq) ((toggle_view)->pixmap_cache[(cache_seq) * E_CELL_TOGGLE (((ECellView *) (toggle_view))->ecell)->n_states + (image_seq)])
-
-#define RGB_COLOR(color) (((color).red & 0xff00) << 8 | \
- ((color).green & 0xff00) | \
- ((color).blue & 0xff00) >> 8)
-
-static void
-check_cache (ECellToggleView *toggle_view, int image_seq, int cache_seq)
-{
- ECellView *ecell_view = (ECellView *) toggle_view;
- ECellToggle *etog = E_CELL_TOGGLE (ecell_view->ecell);
-
- if (PIXMAP_CACHE (toggle_view, cache_seq, image_seq) == NULL) {
- GdkPixbuf *image = etog->images[image_seq];
- GdkPixbuf *flat;
- guint32 color = 0xffffff;
- int width = gdk_pixbuf_get_width (image);
- int height = gdk_pixbuf_get_height (image);
-
- PIXMAP_CACHE (toggle_view, cache_seq, image_seq) =
- gdk_pixmap_new (toggle_view->canvas->layout.bin_window, width, height,
- gtk_widget_get_visual (GTK_WIDGET (toggle_view->canvas))->depth);
-
-
- switch (cache_seq % 3) {
- case 0:
- color = RGB_COLOR (GTK_WIDGET (toggle_view->canvas)->style->bg [GTK_STATE_SELECTED]);
- break;
- case 1:
- color = RGB_COLOR (GTK_WIDGET (toggle_view->canvas)->style->bg [GTK_STATE_ACTIVE]);
- break;
- case 2:
- color = RGB_COLOR (GTK_WIDGET (toggle_view->canvas)->style->base [GTK_STATE_NORMAL]);
- break;
- }
-
- if (cache_seq >= 3) {
- double r, g, b, h, s, v;
- r = ((color >> 16) & 0xff) / 255.0f;
- g = ((color >> 8) & 0xff) / 255.0f;
- b = (color & 0xff) / 255.0f;
-
- e_rgb_to_hsv (r, g, b, &h, &s, &v);
-
- if (v - 0.05f < 0) {
- v += 0.05f;
- } else {
- v -= 0.05f;
- }
-
- e_hsv_to_rgb (h, s, v, &r, &g, &b);
-
- color = ((((int)(r * 255.0f)) & 0xff) << 16) +
- ((((int)(g * 255.0f)) & 0xff) << 8) +
- (((int)(b * 255.0f)) & 0xff);
- }
-
- flat = gdk_pixbuf_composite_color_simple (image,
- width, height,
- GDK_INTERP_BILINEAR,
- 255,
- 1,
- color, color);
-
- gdk_pixbuf_render_to_drawable (flat, PIXMAP_CACHE (toggle_view, cache_seq, image_seq),
- toggle_view->gc,
- 0, 0,
- 0, 0,
- width, height,
- GDK_RGB_DITHER_NORMAL,
- 0, 0);
- gdk_pixbuf_unref (flat);
- }
-}
-
-/*
- * ECell::draw method
- */
-static void
-etog_draw (ECellView *ecell_view, GdkDrawable *drawable,
- int model_col, int view_col, int row, ECellFlags flags,
- int x1, int y1, int x2, int y2)
-{
- ECellToggle *toggle = E_CELL_TOGGLE (ecell_view->ecell);
- gboolean selected;
- ECellToggleView *toggle_view = (ECellToggleView *) ecell_view;
- GdkPixmap *pixmap;
- GdkPixbuf *image;
- int x, y, width, height;
- int cache_seq;
-
- const int value = GPOINTER_TO_INT (
- e_table_model_value_at (ecell_view->e_table_model, model_col, row));
-
- selected = flags & E_CELL_SELECTED;
-
- if (value >= toggle->n_states){
- g_warning ("Value from the table model is %d, the states we support are [0..%d)\n",
- value, toggle->n_states);
- return;
- }
-
- if (flags & E_CELL_SELECTED) {
- if (GTK_WIDGET_HAS_FOCUS (toggle_view->canvas))
- cache_seq = 0;
- else
- cache_seq = 1;
- } else
- cache_seq = 2;
-
- if (E_TABLE_ITEM (ecell_view->e_table_item_view)->alternating_row_colors && (row % 2) == 0)
- cache_seq += 3;
-
- check_cache (toggle_view, value, cache_seq);
-
- pixmap = PIXMAP_CACHE (toggle_view, cache_seq, value);
- image = toggle->images[value];
-
- if ((x2 - x1) < gdk_pixbuf_get_width (image)){
- x = x1;
- width = x2 - x1;
- } else {
- x = x1 + ((x2 - x1) - gdk_pixbuf_get_width (image)) / 2;
- width = gdk_pixbuf_get_width (image);
- }
-
- if ((y2 - y1) < gdk_pixbuf_get_height (image)){
- y = y1;
- height = y2 - y1;
- } else {
- y = y1 + ((y2 - y1) - gdk_pixbuf_get_height (image)) / 2;
- height = gdk_pixbuf_get_height (image);
- }
-
- gdk_draw_pixmap (drawable, toggle_view->gc,
- pixmap,
- 0, 0,
- x, y,
- width, height);
-}
-
-static void
-etog_set_value (ECellToggleView *toggle_view, int model_col, int view_col, int row, int value)
-{
- ECell *ecell = toggle_view->cell_view.ecell;
- ECellToggle *toggle = E_CELL_TOGGLE (ecell);
-
- if (value >= toggle->n_states)
- value = 0;
-
- e_table_model_set_value_at (toggle_view->cell_view.e_table_model,
- model_col, row, GINT_TO_POINTER (value));
-}
-
-/*
- * ECell::event method
- */
-static gint
-etog_event (ECellView *ecell_view, GdkEvent *event, int model_col, int view_col, int row, ECellFlags flags, ECellActions *actions)
-{
- ECellToggleView *toggle_view = (ECellToggleView *) ecell_view;
- void *_value = e_table_model_value_at (ecell_view->e_table_model, model_col, row);
- const int value = GPOINTER_TO_INT (_value);
-
-#if 0
- if (!(flags & E_CELL_EDITING))
- return FALSE;
-#endif
-
- switch (event->type){
- case GDK_KEY_PRESS:
- if (event->key.keyval != GDK_space)
- return FALSE;
- /* Fall through */
- case GDK_BUTTON_PRESS:
- if (!e_table_model_is_cell_editable(ecell_view->e_table_model, model_col, row))
- return FALSE;
-
- etog_set_value (toggle_view, model_col, view_col, row, value + 1);
- return TRUE;
-
- default:
- return FALSE;
- }
- return TRUE;
-}
-
-/*
- * ECell::height method
- */
-static int
-etog_height (ECellView *ecell_view, int model_col, int view_col, int row)
-{
- ECellToggle *toggle = E_CELL_TOGGLE (ecell_view->ecell);
-
- return toggle->height;
-}
-
-/*
- * ECell::print method
- */
-static void
-etog_print (ECellView *ecell_view, GnomePrintContext *context,
- int model_col, int view_col, int row,
- double width, double height)
-{
- ECellToggle *toggle = E_CELL_TOGGLE(ecell_view->ecell);
- GdkPixbuf *image;
- const int value = GPOINTER_TO_INT (
- e_table_model_value_at (ecell_view->e_table_model, model_col, row));
-
- if (value >= toggle->n_states){
- g_warning ("Value from the table model is %d, the states we support are [0..%d)\n",
- value, toggle->n_states);
- return;
- }
-
- gnome_print_gsave(context);
-
- image = toggle->images[value];
-
- gnome_print_translate (context, 0, (height - toggle->height) / 2);
- gnome_print_scale (context, toggle->height, toggle->height);
- gnome_print_pixbuf (context, image);
-
- gnome_print_grestore(context);
-}
-
-static gdouble
-etog_print_height (ECellView *ecell_view, GnomePrintContext *context,
- int model_col, int view_col, int row,
- double width)
-{
- ECellToggle *toggle = E_CELL_TOGGLE (ecell_view->ecell);
-
- return toggle->height;
-}
-
-/*
- * ECell::max_width method
- */
-static int
-etog_max_width (ECellView *ecell_view, int model_col, int view_col)
-{
- ECellToggle *toggle = E_CELL_TOGGLE (ecell_view->ecell);
- int max_width = 0;
- int number_of_rows;
- int row;
-
- number_of_rows = e_table_model_row_count (ecell_view->e_table_model);
- for (row = 0; row < number_of_rows; row++) {
- void *value = e_table_model_value_at (ecell_view->e_table_model,
- model_col, row);
- max_width = MAX (max_width, gdk_pixbuf_get_width (toggle->images[GPOINTER_TO_INT (value)]));
- }
-
- return max_width;
-}
-
-static void
-etog_style_set (ECellView *ecell_view, GtkStyle *previous_style)
-{
- ECellToggle *toggle = E_CELL_TOGGLE (ecell_view->ecell);
- ECellToggleView *toggle_view = (ECellToggleView *) ecell_view;
- int i;
-
- for (i = 0; i < toggle->n_states * CACHE_SEQ_COUNT; i++) {
- if (toggle_view->pixmap_cache[i]) {
- gdk_pixmap_unref (toggle_view->pixmap_cache[i]);
- toggle_view->pixmap_cache[i] = NULL;
- }
- }
-}
-
-static void
-etog_finalize (GObject *object)
-{
- ECellToggle *etog = E_CELL_TOGGLE (object);
- int i;
-
- for (i = 0; i < etog->n_states; i++)
- gdk_pixbuf_unref (etog->images [i]);
-
- g_free (etog->images);
-
- etog->images = NULL;
- etog->n_states = 0;
-
- G_OBJECT_CLASS (parent_class)->finalize (object);
-}
-
-static void
-e_cell_toggle_class_init (GtkObjectClass *object_class)
-{
- ECellClass *ecc = (ECellClass *) object_class;
-
- G_OBJECT_CLASS (object_class)->finalize = etog_finalize;
-
- ecc->new_view = etog_new_view;
- ecc->kill_view = etog_kill_view;
- ecc->realize = etog_realize;
- ecc->unrealize = etog_unrealize;
- ecc->draw = etog_draw;
- ecc->event = etog_event;
- ecc->height = etog_height;
- ecc->print = etog_print;
- ecc->print_height = etog_print_height;
- ecc->max_width = etog_max_width;
- ecc->style_set = etog_style_set;
-
- parent_class = g_type_class_ref (PARENT_TYPE);
-}
-
-static void
-e_cell_toggle_init (GtkObject *object)
-{
- ECellToggle *etog = (ECellToggle *) object;
-
- etog->images = NULL;
- etog->n_states = 0;
-}
-
-E_MAKE_TYPE(e_cell_toggle, "ECellToggle", ECellToggle, e_cell_toggle_class_init, e_cell_toggle_init, PARENT_TYPE)
-
-/**
- * e_cell_toggle_construct:
- * @etog: a fresh ECellToggle object
- * @border: number of pixels used as a border
- * @n_states: number of states the toggle will have
- * @images: a collection of @n_states images, one for each state.
- *
- * Constructs the @etog object with the @border, @n_staes, and @images
- * arguments.
- */
-void
-e_cell_toggle_construct (ECellToggle *etog, int border, int n_states, GdkPixbuf **images)
-{
- int max_height = 0;
- int i;
-
- etog->border = border;
- etog->n_states = n_states;
-
- etog->images = g_new (GdkPixbuf *, n_states);
-
- for (i = 0; i < n_states; i++){
- etog->images [i] = images [i];
- gdk_pixbuf_ref (images [i]);
-
- if (gdk_pixbuf_get_height (images [i]) > max_height)
- max_height = gdk_pixbuf_get_height (images [i]);
- }
-
- etog->height = max_height;
-}
-
-/**
- * e_cell_checkbox_new:
- * @border: number of pixels used as a border
- * @n_states: number of states the toggle will have
- * @images: a collection of @n_states images, one for each state.
- *
- * Creates a new ECell renderer that can be used to render toggle
- * buttons with the images specified in @images. The value returned
- * by ETableModel::get_value is typecase into an integer and clamped
- * to the [0..n_states) range. That will select the image rendered.
- *
- * Returns: an ECell object that can be used to render multi-state
- * toggle cells.
- */
-ECell *
-e_cell_toggle_new (int border, int n_states, GdkPixbuf **images)
-{
- ECellToggle *etog = g_object_new (E_CELL_TOGGLE_TYPE, NULL);
-
- e_cell_toggle_construct (etog, border, n_states, images);
-
- return (ECell *) etog;
-}
diff --git a/widgets/table/e-cell-toggle.h b/widgets/table/e-cell-toggle.h
deleted file mode 100644
index 71d9de3883..0000000000
--- a/widgets/table/e-cell-toggle.h
+++ /dev/null
@@ -1,62 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-cell-toggle.h - Multi-state image toggle cell object.
- * Copyright 1999, 2000, Ximian, Inc.
- *
- * Authors:
- * Miguel de Icaza <miguel@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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.
- */
-
-#ifndef _E_CELL_TOGGLE_H_
-#define _E_CELL_TOGGLE_H_
-
-#include <libgnomecanvas/gnome-canvas.h>
-#include <gdk-pixbuf/gdk-pixbuf.h>
-#include <gal/e-table/e-cell.h>
-
-G_BEGIN_DECLS
-
-#define E_CELL_TOGGLE_TYPE (e_cell_toggle_get_type ())
-#define E_CELL_TOGGLE(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), E_CELL_TOGGLE_TYPE, ECellToggle))
-#define E_CELL_TOGGLE_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), E_CELL_TOGGLE_TYPE, ECellToggleClass))
-#define E_IS_CELL_TOGGLE(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), E_CELL_TOGGLE_TYPE))
-#define E_IS_CELL_TOGGLE_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), E_CELL_TOGGLE_TYPE))
-
-typedef struct {
- ECell parent;
-
- int border;
- int n_states;
- GdkPixbuf **images;
-
- int height;
-} ECellToggle;
-
-typedef struct {
- ECellClass parent_class;
-} ECellToggleClass;
-
-GType e_cell_toggle_get_type (void);
-ECell *e_cell_toggle_new (int border, int n_states, GdkPixbuf **images);
-void e_cell_toggle_construct (ECellToggle *etog, int border,
- int n_states, GdkPixbuf **images);
-
-G_END_DECLS
-
-#endif /* _E_CELL_TOGGLE_H_ */
-
-
diff --git a/widgets/table/e-cell-tree.c b/widgets/table/e-cell-tree.c
deleted file mode 100644
index a1b92ba7e6..0000000000
--- a/widgets/table/e-cell-tree.c
+++ /dev/null
@@ -1,777 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-cell-tree.c - Tree cell object.
- * Copyright 1999, 2000, 2001, Ximian, Inc.
- *
- * Authors:
- * Chris Toshok <toshok@ximian.com>
- *
- * A majority of code taken from:
- *
- * the ECellText renderer.
- * Copyright 1998, The Free Software Foundation
- * Copyright 1999, 2000, Ximian, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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 <ctype.h>
-#include <math.h>
-#include <stdio.h>
-
-#include <gdk/gdkx.h> /* for BlackPixel */
-#include <gtk/gtkenums.h>
-#include <gtk/gtkentry.h>
-#include <gtk/gtkwindow.h>
-#include <gtk/gtkinvisible.h>
-#include <gtk/gtksignal.h>
-#include <gdk/gdkkeysyms.h>
-#include <libgnomecanvas/gnome-canvas.h>
-
-#include "e-tree-table-adapter.h"
-#include "e-tree-model.h"
-#include "gal/util/e-util.h"
-#include "e-table-item.h"
-#include "e-cell-tree.h"
-
-#include "tree-expanded.xpm"
-#include "tree-unexpanded.xpm"
-
-#define PARENT_TYPE e_cell_get_type ()
-
-typedef struct {
- ECellView cell_view;
- ECellView *subcell_view;
- GdkGC *gc;
-
- GnomeCanvas *canvas;
-
-} ECellTreeView;
-
-static ECellClass *parent_class;
-
-#define INDENT_AMOUNT 16
-
-static ETreePath
-e_cell_tree_get_node (ETableModel *table_model, int row)
-{
- return e_table_model_value_at (table_model, -1, row);
-}
-
-static ETreeModel*
-e_cell_tree_get_tree_model (ETableModel *table_model, int row)
-{
- return e_table_model_value_at (table_model, -2, row);
-}
-
-static ETreeTableAdapter *
-e_cell_tree_get_tree_table_adapter (ETableModel *table_model, int row)
-{
- return e_table_model_value_at (table_model, -3, row);
-}
-
-static int
-visible_depth_of_node (ETableModel *model, int row)
-{
- ETreeModel *tree_model = e_cell_tree_get_tree_model(model, row);
- ETreeTableAdapter *adapter = e_cell_tree_get_tree_table_adapter(model, row);
- ETreePath path = e_cell_tree_get_node(model, row);
- return (e_tree_model_node_depth (tree_model, path)
- - (e_tree_table_adapter_root_node_is_visible (adapter) ? 0 : 1));
-}
-
-/* If this is changed to not include the width of the expansion pixmap
- if the path is not expandable, then max_width needs to change as
- well. */
-static gint
-offset_of_node (ETableModel *table_model, int row)
-{
- ETreeModel *tree_model = e_cell_tree_get_tree_model(table_model, row);
- ETreePath path = e_cell_tree_get_node(table_model, row);
-
- if (visible_depth_of_node (table_model, row) > 0 ||
- e_tree_model_node_is_expandable(tree_model, path)) {
- return (visible_depth_of_node(table_model, row) + 1) * INDENT_AMOUNT;
- } else {
- return 0;
- }
-}
-
-/*
- * ECell::new_view method
- */
-static ECellView *
-ect_new_view (ECell *ecell, ETableModel *table_model, void *e_table_item_view)
-{
- ECellTree *ect = E_CELL_TREE (ecell);
- ECellTreeView *tree_view = g_new0 (ECellTreeView, 1);
- GnomeCanvas *canvas = GNOME_CANVAS_ITEM (e_table_item_view)->canvas;
-
- tree_view->cell_view.ecell = ecell;
- tree_view->cell_view.e_table_model = table_model;
- tree_view->cell_view.e_table_item_view = e_table_item_view;
-
- /* create our subcell view */
- tree_view->subcell_view = e_cell_new_view (ect->subcell, table_model, e_table_item_view /* XXX */);
-
- tree_view->canvas = canvas;
-
- return (ECellView *)tree_view;
-}
-
-/*
- * ECell::kill_view method
- */
-static void
-ect_kill_view (ECellView *ecv)
-{
- ECellTreeView *tree_view = (ECellTreeView *) ecv;
-
- /* kill our subcell view */
- e_cell_kill_view (tree_view->subcell_view);
-
- g_free (tree_view);
-}
-
-/*
- * ECell::realize method
- */
-static void
-ect_realize (ECellView *ecell_view)
-{
- ECellTreeView *tree_view = (ECellTreeView *) ecell_view;
-
- /* realize our subcell view */
- e_cell_realize (tree_view->subcell_view);
-
- tree_view->gc = gdk_gc_new (GTK_WIDGET (tree_view->canvas)->window);
-
- gdk_gc_set_line_attributes (tree_view->gc, 1,
- GDK_LINE_ON_OFF_DASH, None, None);
- gdk_gc_set_dashes (tree_view->gc, 0, "\1\1", 2);
-
- if (parent_class->realize)
- (* parent_class->realize) (ecell_view);
-}
-
-/*
- * ECell::unrealize method
- */
-static void
-ect_unrealize (ECellView *ecv)
-{
- ECellTreeView *tree_view = (ECellTreeView *) ecv;
-
- /* unrealize our subcell view. */
- e_cell_unrealize (tree_view->subcell_view);
-
- gdk_gc_unref (tree_view->gc);
- tree_view->gc = NULL;
-
- if (parent_class->unrealize)
- (* parent_class->unrealize) (ecv);
-}
-
-/*
- * ECell::draw method
- */
-static void
-ect_draw (ECellView *ecell_view, GdkDrawable *drawable,
- int model_col, int view_col, int row, ECellFlags flags,
- int x1, int y1, int x2, int y2)
-{
- ECellTreeView *tree_view = (ECellTreeView *)ecell_view;
- ETreeModel *tree_model = e_cell_tree_get_tree_model(ecell_view->e_table_model, row);
- ETreeTableAdapter *tree_table_adapter = e_cell_tree_get_tree_table_adapter(ecell_view->e_table_model, row);
- ETreePath node;
- GdkRectangle rect, *clip_rect = NULL;
- GtkWidget *canvas = GTK_WIDGET (tree_view->canvas);
- GdkGC *fg_gc = canvas->style->fg_gc[GTK_STATE_ACTIVE];
- GdkColor *foreground;
- gboolean selected;
-
- int offset, subcell_offset;
-
- selected = flags & E_CELL_SELECTED;
-
- /* only draw the tree effects if we're the active sort */
- if (/* XXX */ TRUE) {
- GdkPixbuf *node_image;
- int node_image_width = 0, node_image_height = 0;
- ETreePath parent_node;
-
- node = e_cell_tree_get_node (ecell_view->e_table_model, row);
-
- offset = offset_of_node (ecell_view->e_table_model, row);
- subcell_offset = offset;
-
- node_image = e_tree_model_icon_at (tree_model, node);
-
- if (node_image) {
- node_image_width = gdk_pixbuf_get_width (node_image);
- node_image_height = gdk_pixbuf_get_height (node_image);
- }
-
- /*
- * Be a nice citizen: clip to the region we are supposed to draw on
- */
- rect.x = x1;
- rect.y = y1;
- rect.width = subcell_offset + node_image_width;
- rect.height = y2 - y1;
-
- gdk_gc_set_clip_rectangle (tree_view->gc, &rect);
- gdk_gc_set_clip_rectangle (fg_gc, &rect);
- clip_rect = &rect;
-
- if (selected) {
- foreground = &canvas->style->text [GTK_STATE_SELECTED];
- } else {
- foreground = &canvas->style->text [GTK_STATE_NORMAL];
- }
-
- gdk_gc_set_foreground (tree_view->gc, foreground);
-
- /* draw our lines */
- if (E_CELL_TREE(tree_view->cell_view.ecell)->draw_lines) {
-
- int depth;
-
- if (visible_depth_of_node (ecell_view->e_table_model, row) > 0
- || e_tree_model_node_get_children (tree_model, node, NULL) > 0)
- gdk_draw_line (drawable, tree_view->gc,
- rect.x + offset - INDENT_AMOUNT / 2 + 1,
- rect.y + rect.height / 2,
- rect.x + offset,
- rect.y + rect.height / 2);
-
- if (visible_depth_of_node (ecell_view->e_table_model, row) != 0) {
- gdk_draw_line (drawable, tree_view->gc,
- rect.x + offset - INDENT_AMOUNT / 2,
- rect.y,
- rect.x + offset - INDENT_AMOUNT / 2,
- (e_tree_model_node_get_next (tree_model, node)
- ? rect.y + rect.height
- : rect.y + rect.height / 2));
- }
-
- /* now traverse back up to the root of the tree, checking at
- each level if the node has siblings, and drawing the
- correct vertical pipe for it's configuration. */
- parent_node = e_tree_model_node_get_parent (tree_model, node);
- offset -= INDENT_AMOUNT;
- depth = visible_depth_of_node (ecell_view->e_table_model, row) - 1;
- while (parent_node && depth != 0) {
- if (e_tree_model_node_get_next(tree_model, parent_node)) {
- gdk_draw_line (drawable, tree_view->gc,
- rect.x + offset - INDENT_AMOUNT / 2,
- rect.y,
- rect.x + offset - INDENT_AMOUNT / 2,
- rect.y + rect.height);
- }
- parent_node = e_tree_model_node_get_parent (tree_model, parent_node);
- depth --;
- offset -= INDENT_AMOUNT;
- }
- }
-
- /* now draw our icon if we're expandable */
- if (e_tree_model_node_is_expandable (tree_model, node)) {
- GdkPixbuf *image;
- int image_width, image_height;
-
- image = (e_tree_table_adapter_node_is_expanded (tree_table_adapter, node)
- ? E_CELL_TREE(tree_view->cell_view.ecell)->open_pixbuf
- : E_CELL_TREE(tree_view->cell_view.ecell)->closed_pixbuf);
-
- image_width = gdk_pixbuf_get_width(image);
- image_height = gdk_pixbuf_get_height(image);
-
- gdk_pixbuf_render_to_drawable_alpha (image,
- drawable,
- 0, 0,
- x1 + subcell_offset - INDENT_AMOUNT / 2 - image_width / 2,
- y1 + (y2 - y1) / 2 - image_height / 2,
- image_width, image_height,
- GDK_PIXBUF_ALPHA_BILEVEL,
- 128,
- GDK_RGB_DITHER_NORMAL,
- image_width, 0);
- }
-
- if (node_image) {
- gdk_pixbuf_render_to_drawable_alpha (node_image,
- drawable,
- 0, 0,
- x1 + subcell_offset,
- y1 + (y2 - y1) / 2 - node_image_height / 2,
- node_image_width, node_image_height,
- GDK_PIXBUF_ALPHA_BILEVEL,
- 128,
- GDK_RGB_DITHER_NORMAL,
- node_image_width, 0);
- subcell_offset += node_image_width;
- }
- }
-
- /* Now cause our subcell to draw its contents, shifted by
- subcell_offset pixels */
- e_cell_draw (tree_view->subcell_view, drawable,
- model_col, view_col, row, flags,
- x1 + subcell_offset, y1, x2, y2);
-
- if (clip_rect) {
- gdk_gc_set_clip_rectangle (tree_view->gc, NULL);
- gdk_gc_set_clip_rectangle (fg_gc, NULL);
- }
-}
-
-/*
- * ECell::event method
- */
-static gint
-ect_event (ECellView *ecell_view, GdkEvent *event, int model_col, int view_col, int row, ECellFlags flags, ECellActions *actions)
-{
- ECellTreeView *tree_view = (ECellTreeView *) ecell_view;
- ETreeModel *tree_model = e_cell_tree_get_tree_model (ecell_view->e_table_model, row);
- ETreeTableAdapter *tree_table_adapter = e_cell_tree_get_tree_table_adapter(ecell_view->e_table_model, row);
- ETreePath node = e_cell_tree_get_node (ecell_view->e_table_model, row);
- int offset = offset_of_node (ecell_view->e_table_model, row);
-
- switch (event->type) {
- case GDK_BUTTON_PRESS: {
- /* if the event happened in our area of control (and
- we care about it), handle it. */
-
- /* only activate the tree control if the click/release happens in the icon's area. */
- if (event->button.x > (offset - INDENT_AMOUNT) && event->button.x < offset) {
- if (e_tree_model_node_is_expandable (tree_model, node)) {
- e_tree_table_adapter_node_set_expanded (tree_table_adapter,
- node,
- !e_tree_table_adapter_node_is_expanded(tree_table_adapter, node));
- return TRUE;
- }
- }
- else if (event->button.x < (offset - INDENT_AMOUNT))
- return FALSE;
- }
- default: {
- gint return_value;
-
- /* modify the event and pass it off to our subcell_view */
- switch (event->type) {
- case GDK_BUTTON_PRESS:
- case GDK_BUTTON_RELEASE:
- case GDK_2BUTTON_PRESS:
- case GDK_3BUTTON_PRESS:
- event->button.x -= offset;
- break;
- case GDK_MOTION_NOTIFY:
- event->motion.x -= offset;
- break;
- default:
- /* nada */
- break;
- }
-
- return_value = e_cell_event(tree_view->subcell_view, event, model_col, view_col, row, flags, actions);
-
- /* modify the event and pass it off to our subcell_view */
- switch (event->type) {
- case GDK_BUTTON_PRESS:
- case GDK_BUTTON_RELEASE:
- case GDK_2BUTTON_PRESS:
- case GDK_3BUTTON_PRESS:
- event->button.x += offset;
- break;
- case GDK_MOTION_NOTIFY:
- event->motion.x += offset;
- break;
- default:
- /* nada */
- break;
- }
-
- return return_value;
- }
- }
-}
-
-/*
- * ECell::height method
- */
-static int
-ect_height (ECellView *ecell_view, int model_col, int view_col, int row)
-{
- ECellTreeView *tree_view = (ECellTreeView *) ecell_view;
-
- return (((e_cell_height (tree_view->subcell_view, model_col, view_col, row)) + 1) / 2) * 2;
-}
-
-/*
- * ECell::max_width method
- */
-static int
-ect_max_width (ECellView *ecell_view, int model_col, int view_col)
-{
- ECellTreeView *tree_view = (ECellTreeView *) ecell_view;
- int row;
- int number_of_rows;
- int max_width = 0;
- int width = 0;
- int subcell_max_width = 0;
- gboolean per_row = e_cell_max_width_by_row_implemented (tree_view->subcell_view);
-
- number_of_rows = e_table_model_row_count (ecell_view->e_table_model);
-
- if (!per_row)
- subcell_max_width = e_cell_max_width (tree_view->subcell_view, model_col, view_col);
-
- for (row = 0; row < number_of_rows; row++) {
- ETreeModel *tree_model = e_cell_tree_get_tree_model(ecell_view->e_table_model, row);
- ETreePath node;
- GdkPixbuf *node_image;
- int node_image_width = 0, node_image_height = 0;
-
- int offset, subcell_offset;
-#if 0
- gboolean expanded, expandable;
- ETreeTableAdapter *tree_table_adapter = e_cell_tree_get_tree_table_adapter(ecell_view->e_table_model, row);
-#endif
-
- node = e_cell_tree_get_node (ecell_view->e_table_model, row);
-
- offset = offset_of_node (ecell_view->e_table_model, row);
- subcell_offset = offset;
-
- node_image = e_tree_model_icon_at (tree_model, node);
-
- if (node_image) {
- node_image_width = gdk_pixbuf_get_width (node_image);
- node_image_height = gdk_pixbuf_get_height (node_image);
- }
-
- width = subcell_offset + node_image_width;
-
- if (per_row)
- width += e_cell_max_width_by_row (tree_view->subcell_view, model_col, view_col, row);
- else
- width += subcell_max_width;
-
-#if 0
- expandable = e_tree_model_node_is_expandable (tree_model, node);
- expanded = e_tree_table_adapter_node_is_expanded (tree_table_adapter, node);
-
- /* This is unnecessary since this is already handled
- by the offset_of_node function. If that changes,
- this will have to change too. */
-
- if (expandable) {
- GdkPixbuf *image;
-
- image = (expanded
- ? E_CELL_TREE(tree_view->cell_view.ecell)->open_pixbuf
- : E_CELL_TREE(tree_view->cell_view.ecell)->closed_pixbuf);
-
- width += gdk_pixbuf_get_width(image);
- }
-#endif
-
- max_width = MAX (max_width, width);
- }
-
- return max_width;
-}
-
-/*
- * ECellView::show_tooltip method
- */
-static void
-ect_show_tooltip (ECellView *ecell_view, int model_col, int view_col, int row,
- int col_width, ETableTooltip *tooltip)
-{
- ECellTreeView *tree_view = (ECellTreeView *) ecell_view;
- ETreeModel *tree_model = e_cell_tree_get_tree_model (ecell_view->e_table_model, row);
- ETreePath node = e_cell_tree_get_node (ecell_view->e_table_model, row);
- int offset = offset_of_node (ecell_view->e_table_model, row);
- GdkPixbuf *node_image;
-
- node_image = e_tree_model_icon_at (tree_model, node);
- if (node_image)
- offset += gdk_pixbuf_get_width (node_image);
-
- tooltip->x += offset;
- e_cell_show_tooltip (tree_view->subcell_view, model_col, view_col, row, col_width - offset, tooltip);
-}
-
-/*
- * ECellView::get_bg_color method
- */
-static char *
-ect_get_bg_color (ECellView *ecell_view, int row)
-{
- ECellTreeView *tree_view = (ECellTreeView *) ecell_view;
-
- return e_cell_get_bg_color (tree_view->subcell_view, row);
-}
-
-/*
- * ECellView::enter_edit method
- */
-static void *
-ect_enter_edit (ECellView *ecell_view, int model_col, int view_col, int row)
-{
- /* just defer to our subcell's view */
- ECellTreeView *tree_view = (ECellTreeView *) ecell_view;
-
- return e_cell_enter_edit (tree_view->subcell_view, model_col, view_col, row);
-}
-
-/*
- * ECellView::leave_edit method
- */
-static void
-ect_leave_edit (ECellView *ecell_view, int model_col, int view_col, int row, void *edit_context)
-{
- /* just defer to our subcell's view */
- ECellTreeView *tree_view = (ECellTreeView *) ecell_view;
-
- e_cell_leave_edit (tree_view->subcell_view, model_col, view_col, row, edit_context);
-}
-
-static void
-ect_print (ECellView *ecell_view, GnomePrintContext *context,
- int model_col, int view_col, int row,
- double width, double height)
-{
- ECellTreeView *tree_view = (ECellTreeView *) ecell_view;
-
- if (/* XXX only if we're the active sort */ TRUE) {
- ETreeModel *tree_model = e_cell_tree_get_tree_model (ecell_view->e_table_model, row);
- ETreeTableAdapter *tree_table_adapter = e_cell_tree_get_tree_table_adapter(ecell_view->e_table_model, row);
- ETreePath node = e_cell_tree_get_node (ecell_view->e_table_model, row);
- int offset = offset_of_node (ecell_view->e_table_model, row);
- int subcell_offset = offset;
- gboolean expandable = e_tree_model_node_is_expandable (tree_model, node);
- gboolean expanded = e_tree_table_adapter_node_is_expanded (tree_table_adapter, node);
-
- /* draw our lines */
- if (E_CELL_TREE(tree_view->cell_view.ecell)->draw_lines) {
- int depth;
-
- if (!e_tree_model_node_is_root (tree_model, node)
- || e_tree_model_node_get_children (tree_model, node, NULL) > 0) {
- gnome_print_moveto (context,
- offset - INDENT_AMOUNT / 2,
- height / 2);
-
- gnome_print_lineto (context,
- offset,
- height / 2);
- }
-
- if (visible_depth_of_node (ecell_view->e_table_model, row) != 0) {
- gnome_print_moveto (context,
- offset - INDENT_AMOUNT / 2,
- height);
- gnome_print_lineto (context,
- offset - INDENT_AMOUNT / 2,
- (e_tree_model_node_get_next (tree_model, node)
- ? 0
- : height / 2));
- }
-
- /* now traverse back up to the root of the tree, checking at
- each level if the node has siblings, and drawing the
- correct vertical pipe for it's configuration. */
- node = e_tree_model_node_get_parent (tree_model, node);
- depth = visible_depth_of_node (ecell_view->e_table_model, row) - 1;
- offset -= INDENT_AMOUNT;
- while (node && depth != 0) {
- if (e_tree_model_node_get_next(tree_model, node)) {
- gnome_print_moveto (context,
- offset - INDENT_AMOUNT / 2,
- height);
- gnome_print_lineto (context,
- offset - INDENT_AMOUNT / 2,
- 0);
- }
- node = e_tree_model_node_get_parent (tree_model, node);
- depth --;
- offset -= INDENT_AMOUNT;
- }
- }
-
- /* now draw our icon if we're expandable */
- if (expandable) {
- double image_matrix [6] = {16, 0, 0, 16, 0, 0};
- GdkPixbuf *image = (expanded
- ? E_CELL_TREE(tree_view->cell_view.ecell)->open_pixbuf
- : E_CELL_TREE(tree_view->cell_view.ecell)->closed_pixbuf);
- int image_width, image_height, image_rowstride;
- guchar *image_pixels;
-
- image_width = gdk_pixbuf_get_width(image);
- image_height = gdk_pixbuf_get_height(image);
- image_pixels = gdk_pixbuf_get_pixels(image);
- image_rowstride = gdk_pixbuf_get_rowstride(image);
-
- image_matrix [4] = subcell_offset - INDENT_AMOUNT / 2 - image_width / 2;
- image_matrix [5] = height / 2 - image_height / 2;
-
- gnome_print_gsave (context);
- gnome_print_concat (context, image_matrix);
-
- gnome_print_rgbaimage (context, image_pixels, image_width, image_height, image_rowstride);
- gnome_print_grestore (context);
- }
-
- gnome_print_stroke (context);
-
- if (gnome_print_translate(context, subcell_offset, 0) == -1)
- /* FIXME */;
- width -= subcell_offset;
- }
-
-
- e_cell_print (tree_view->subcell_view, context, model_col, view_col, row, width, height);
-}
-
-static gdouble
-ect_print_height (ECellView *ecell_view, GnomePrintContext *context,
- int model_col, int view_col, int row,
- double width)
-{
- return 12; /* XXX */
-}
-
-/*
- * GObject::dispose method
- */
-static void
-ect_dispose (GObject *object)
-{
- ECellTree *ect = E_CELL_TREE (object);
-
- /* destroy our subcell */
- if (ect->subcell)
- g_object_unref (ect->subcell);
- ect->subcell = NULL;
-
- if (ect->open_pixbuf)
- gdk_pixbuf_unref (ect->open_pixbuf);
- ect->open_pixbuf = NULL;
-
- if (ect->closed_pixbuf)
- gdk_pixbuf_unref (ect->closed_pixbuf);
- ect->closed_pixbuf = NULL;
-
- G_OBJECT_CLASS (parent_class)->dispose (object);
-}
-
-static void
-e_cell_tree_class_init (GObjectClass *object_class)
-{
- ECellClass *ecc = (ECellClass *) object_class;
-
- object_class->dispose = ect_dispose;
-
- ecc->new_view = ect_new_view;
- ecc->kill_view = ect_kill_view;
- ecc->realize = ect_realize;
- ecc->unrealize = ect_unrealize;
- ecc->draw = ect_draw;
- ecc->event = ect_event;
- ecc->height = ect_height;
- ecc->enter_edit = ect_enter_edit;
- ecc->leave_edit = ect_leave_edit;
- ecc->print = ect_print;
- ecc->print_height = ect_print_height;
- ecc->max_width = ect_max_width;
- ecc->show_tooltip = ect_show_tooltip;
- ecc->get_bg_color = ect_get_bg_color;
-
- parent_class = g_type_class_ref (PARENT_TYPE);
-}
-
-E_MAKE_TYPE(e_cell_tree, "ECellTree", ECellTree, e_cell_tree_class_init, NULL, PARENT_TYPE)
-
-/**
- * e_cell_tree_construct:
- * @ect: the ECellTree we're constructing.
- * @open_pixbuf: pixbuf to be used instead of the '-' icon.
- * @closed_pixbuf: pixbuf to be used instead of the '+' icon.
- * @draw_lines: whether or not to draw the lines between parents/children/siblings.
- * @subcell: the ECell to render to the right of the tree effects.
- *
- * Constructs an ECellTree. used by subclasses that need to
- * initialize a nested ECellTree. See e_cell_tree_new() for more info.
- *
- **/
-void
-e_cell_tree_construct (ECellTree *ect,
- GdkPixbuf *open_pixbuf,
- GdkPixbuf *closed_pixbuf,
- gboolean draw_lines,
- ECell *subcell)
-{
- ect->subcell = subcell;
- if (subcell) {
- g_object_ref (subcell);
- gtk_object_sink (GTK_OBJECT (subcell));
- }
- if (open_pixbuf)
- ect->open_pixbuf = open_pixbuf;
- else
- ect->open_pixbuf = gdk_pixbuf_new_from_xpm_data ((const char **)tree_expanded_xpm);
- if (closed_pixbuf)
- ect->closed_pixbuf = closed_pixbuf;
- else
- ect->closed_pixbuf = gdk_pixbuf_new_from_xpm_data ((const char **)tree_unexpanded_xpm);
-
- ect->draw_lines = draw_lines;
-}
-
-
-/**
- * e_cell_tree_new:
- * @open_pixbuf: pixbuf to be used instead of the '-' icon.
- * @closed_pixbuf: pixbuf to be used instead of the '+' icon.
- * @draw_lines: whether or not to draw the lines between parents/children/siblings.
- * @subcell: the ECell to render to the right of the tree effects.
- *
- * Creates a new ECell renderer that can be used to render tree
- * effects that come from an ETreeModel. Various assumptions are made
- * as to the fact that the ETableModel the ETable this cell is
- * associated with is in fact an ETreeModel. The cell uses special
- * columns to get at structural information (needed to draw the
- * lines/icons.
- *
- * Return value: an ECell object that can be used to render trees.
- **/
-ECell *
-e_cell_tree_new (GdkPixbuf *open_pixbuf,
- GdkPixbuf *closed_pixbuf,
- gboolean draw_lines,
- ECell *subcell)
-{
- ECellTree *ect = g_object_new (E_CELL_TREE_TYPE, NULL);
-
- e_cell_tree_construct (ect, open_pixbuf, closed_pixbuf, draw_lines, subcell);
-
- return (ECell *) ect;
-}
diff --git a/widgets/table/e-cell-tree.h b/widgets/table/e-cell-tree.h
deleted file mode 100644
index 13462ee428..0000000000
--- a/widgets/table/e-cell-tree.h
+++ /dev/null
@@ -1,75 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-cell-tree.h - Tree cell object.
- * Copyright 1999, 2000, 2001, Ximian, Inc.
- *
- * Authors:
- * Chris Toshok <toshok@ximian.com>
- *
- * A majority of code taken from:
- *
- * the ECellText renderer.
- * Copyright 1998, The Free Software Foundation
- * Copyright 1999, 2000, Ximian, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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.
- */
-
-#ifndef _E_CELL_TREE_H_
-#define _E_CELL_TREE_H_
-
-#include <libgnomecanvas/gnome-canvas.h>
-#include <gal/e-table/e-cell.h>
-
-G_BEGIN_DECLS
-
-#define E_CELL_TREE_TYPE (e_cell_tree_get_type ())
-#define E_CELL_TREE(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), E_CELL_TREE_TYPE, ECellTree))
-#define E_CELL_TREE_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), E_CELL_TREE_TYPE, ECellTreeClass))
-#define E_IS_CELL_TREE(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), E_CELL_TREE_TYPE))
-#define E_IS_CELL_TREE_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), E_CELL_TREE_TYPE))
-
-typedef struct {
- ECell parent;
-
- gboolean draw_lines;
-
- GdkPixbuf *open_pixbuf;
- GdkPixbuf *closed_pixbuf;
-
- ECell *subcell;
-} ECellTree;
-
-typedef struct {
- ECellClass parent_class;
-} ECellTreeClass;
-
-GType e_cell_tree_get_type (void);
-ECell *e_cell_tree_new (GdkPixbuf *open_pixbuf,
- GdkPixbuf *closed_pixbuf,
- gboolean draw_lines,
- ECell *subcell);
-void e_cell_tree_construct (ECellTree *ect,
- GdkPixbuf *open_pixbuf,
- GdkPixbuf *closed_pixbuf,
- gboolean draw_lines,
- ECell *subcell);
-
-
-G_END_DECLS
-
-#endif /* _E_CELL_TREE_H_ */
-
-
diff --git a/widgets/table/e-cell-vbox.c b/widgets/table/e-cell-vbox.c
deleted file mode 100644
index ab86e307c9..0000000000
--- a/widgets/table/e-cell-vbox.c
+++ /dev/null
@@ -1,489 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-cell-vbox.c - Vbox cell object.
- * Copyright 1999, 2000, 2001, Ximian, Inc.
- *
- * Authors:
- * Chris Toshok <toshok@ximian.com>
- * Chris Lahey <clahey@ximian.com>
- *
- * A majority of code taken from:
- *
- * the ECellText renderer.
- * Copyright 1999, 2000, Ximian, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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 <ctype.h>
-#include <math.h>
-#include <stdio.h>
-
-#include <gdk/gdkx.h> /* for BlackPixel */
-#include <gtk/gtkenums.h>
-#include <gtk/gtkentry.h>
-#include <gtk/gtkwindow.h>
-#include <gtk/gtkinvisible.h>
-#include <gtk/gtksignal.h>
-#include <gdk/gdkkeysyms.h>
-
-#include "gal/util/e-util.h"
-#include "e-table-item.h"
-#include "e-cell-vbox.h"
-
-#define PARENT_TYPE e_cell_get_type ()
-
-typedef struct {
- ECellView cell_view;
- int subcell_view_count;
- ECellView **subcell_views;
- int *model_cols;
-} ECellVboxView;
-
-static ECellClass *parent_class;
-
-#define INDENT_AMOUNT 16
-
-/*
- * ECell::new_view method
- */
-static ECellView *
-ecv_new_view (ECell *ecell, ETableModel *table_model, void *e_table_item_view)
-{
- ECellVbox *ecv = E_CELL_VBOX (ecell);
- ECellVboxView *vbox_view = g_new0 (ECellVboxView, 1);
- int i;
-
- vbox_view->cell_view.ecell = ecell;
- vbox_view->cell_view.e_table_model = table_model;
- vbox_view->cell_view.e_table_item_view = e_table_item_view;
-
- /* create our subcell view */
- vbox_view->subcell_view_count = ecv->subcell_count;
- vbox_view->subcell_views = g_new (ECellView *, vbox_view->subcell_view_count);
- vbox_view->model_cols = g_new (int, vbox_view->subcell_view_count);
-
- for (i = 0; i < vbox_view->subcell_view_count; i++) {
- vbox_view->subcell_views[i] = e_cell_new_view (ecv->subcells[i], table_model, e_table_item_view /* XXX */);
- vbox_view->model_cols[i] = ecv->model_cols[i];
- }
-
- return (ECellView *)vbox_view;
-}
-
-/*
- * ECell::kill_view method
- */
-static void
-ecv_kill_view (ECellView *ecv)
-{
- ECellVboxView *vbox_view = (ECellVboxView *) ecv;
- int i;
-
- /* kill our subcell view */
- for (i = 0; i < vbox_view->subcell_view_count; i++)
- e_cell_kill_view (vbox_view->subcell_views[i]);
-
- g_free (vbox_view->model_cols);
- g_free (vbox_view->subcell_views);
- g_free (vbox_view);
-}
-
-/*
- * ECell::realize method
- */
-static void
-ecv_realize (ECellView *ecell_view)
-{
- ECellVboxView *vbox_view = (ECellVboxView *) ecell_view;
- int i;
-
- /* realize our subcell view */
- for (i = 0; i < vbox_view->subcell_view_count; i++)
- e_cell_realize (vbox_view->subcell_views[i]);
-
- if (parent_class->realize)
- (* parent_class->realize) (ecell_view);
-}
-
-/*
- * ECell::unrealize method
- */
-static void
-ecv_unrealize (ECellView *ecv)
-{
- ECellVboxView *vbox_view = (ECellVboxView *) ecv;
- int i;
-
- /* unrealize our subcell view. */
- for (i = 0; i < vbox_view->subcell_view_count; i++)
- e_cell_unrealize (vbox_view->subcell_views[i]);
-
- if (parent_class->unrealize)
- (* parent_class->unrealize) (ecv);
-}
-
-/*
- * ECell::draw method
- */
-static void
-ecv_draw (ECellView *ecell_view, GdkDrawable *drawable,
- int model_col, int view_col, int row, ECellFlags flags,
- int x1, int y1, int x2, int y2)
-{
- ECellVboxView *vbox_view = (ECellVboxView *)ecell_view;
-
- int subcell_offset = 0;
- int i;
-
- for (i = 0; i < vbox_view->subcell_view_count; i++) {
- /* Now cause our subcells to draw their contents,
- shifted by subcell_offset pixels */
- int height = e_cell_height (vbox_view->subcell_views[i], vbox_view->model_cols[i], view_col, row);
- e_cell_draw (vbox_view->subcell_views[i], drawable,
- vbox_view->model_cols[i], view_col, row, flags,
- x1, y1 + subcell_offset, x2, y1 + subcell_offset + height);
-
- subcell_offset += e_cell_height (vbox_view->subcell_views[i], vbox_view->model_cols[i], view_col, row);
- }
-}
-
-/*
- * ECell::event method
- */
-static gint
-ecv_event (ECellView *ecell_view, GdkEvent *event, int model_col, int view_col, int row, ECellFlags flags, ECellActions *actions)
-{
- ECellVboxView *vbox_view = (ECellVboxView *)ecell_view;
- int y = 0;
- int i;
- int subcell_offset = 0;
-
- switch (event->type) {
- case GDK_BUTTON_PRESS:
- case GDK_BUTTON_RELEASE:
- case GDK_2BUTTON_PRESS:
- case GDK_3BUTTON_PRESS:
- y = event->button.y;
- break;
- case GDK_MOTION_NOTIFY:
- y = event->motion.y;
- break;
- default:
- /* nada */
- break;
- }
-
-
- for (i = 0; i < vbox_view->subcell_view_count; i++) {
- int height = e_cell_height (vbox_view->subcell_views[i], vbox_view->model_cols[i], view_col, row);
- if (y < subcell_offset + height)
- return e_cell_event(vbox_view->subcell_views[i], event, vbox_view->model_cols[i], view_col, row, flags, actions);
- subcell_offset += height;
- }
- return 0;
-}
-
-/*
- * ECell::height method
- */
-static int
-ecv_height (ECellView *ecell_view, int model_col, int view_col, int row)
-{
- ECellVboxView *vbox_view = (ECellVboxView *)ecell_view;
- int height = 0;
- int i;
-
- for (i = 0; i < vbox_view->subcell_view_count; i++) {
- height += e_cell_height (vbox_view->subcell_views[i], vbox_view->model_cols[i], view_col, row);
- }
- return height;
-}
-
-/*
- * ECell::max_width method
- */
-static int
-ecv_max_width (ECellView *ecell_view, int model_col, int view_col)
-{
- ECellVboxView *vbox_view = (ECellVboxView *)ecell_view;
- int max_width = 0;
- int i;
-
- for (i = 0; i < vbox_view->subcell_view_count; i++) {
- int width = e_cell_max_width (vbox_view->subcell_views[i], vbox_view->model_cols[i], view_col);
- max_width = MAX(width, max_width);
- }
-
- return max_width;
-}
-
-#if 0
-/*
- * ECellView::show_tooltip method
- */
-static void
-ecv_show_tooltip (ECellView *ecell_view, int model_col, int view_col, int row,
- int col_width, ETableTooltip *tooltip)
-{
- ECellVboxView *vbox_view = (ECellVboxView *) ecell_view;
- EVboxModel *vbox_model = e_cell_vbox_get_vbox_model (ecell_view->e_table_model, row);
- EVboxPath node = e_cell_vbox_get_node (ecell_view->e_table_model, row);
- int offset = offset_of_node (ecell_view->e_table_model, row);
- GdkPixbuf *node_image;
-
- node_image = e_vbox_model_icon_at (vbox_model, node);
- if (node_image)
- offset += gdk_pixbuf_get_width (node_image);
-
- tooltip->x += offset;
- e_cell_show_tooltip (vbox_view->subcell_view, model_col, view_col, row, col_width - offset, tooltip);
-}
-
-/*
- * ECellView::get_bg_color method
- */
-static char *
-ecv_get_bg_color (ECellView *ecell_view, int row)
-{
- ECellVboxView *vbox_view = (ECellVboxView *) ecell_view;
-
- return e_cell_get_bg_color (vbox_view->subcell_views[0], row);
-}
-
-/*
- * ECellView::enter_edit method
- */
-static void *
-ecv_enter_edit (ECellView *ecell_view, int model_col, int view_col, int row)
-{
- /* just defer to our subcell's view */
- ECellVboxView *vbox_view = (ECellVboxView *) ecell_view;
-
- return e_cell_enter_edit (vbox_view->subcell_view, model_col, view_col, row);
-}
-
-/*
- * ECellView::leave_edit method
- */
-static void
-ecv_leave_edit (ECellView *ecell_view, int model_col, int view_col, int row, void *edit_context)
-{
- /* just defer to our subcell's view */
- ECellVboxView *vbox_view = (ECellVboxView *) ecell_view;
-
- e_cell_leave_edit (vbox_view->subcell_view, model_col, view_col, row, edit_context);
-}
-
-static void
-ecv_print (ECellView *ecell_view, GnomePrintContext *context,
- int model_col, int view_col, int row,
- double width, double height)
-{
- ECellVboxView *vbox_view = (ECellVboxView *) ecell_view;
-
- if (/* XXX only if we're the active sort */ TRUE) {
- EVboxModel *vbox_model = e_cell_vbox_get_vbox_model (ecell_view->e_table_model, row);
- EVboxTableAdapter *vbox_table_adapter = e_cell_vbox_get_vbox_table_adapter(ecell_view->e_table_model, row);
- EVboxPath node = e_cell_vbox_get_node (ecell_view->e_table_model, row);
- int offset = offset_of_node (ecell_view->e_table_model, row);
- int subcell_offset = offset;
- gboolean expandable = e_vbox_model_node_is_expandable (vbox_model, node);
- gboolean expanded = e_vbox_table_adapter_node_is_expanded (vbox_table_adapter, node);
-
- /* draw our lines */
- if (E_CELL_VBOX(vbox_view->cell_view.ecell)->draw_lines) {
- int depth;
-
- if (!e_vbox_model_node_is_root (vbox_model, node)
- || e_vbox_model_node_get_children (vbox_model, node, NULL) > 0) {
- gnome_print_moveto (context,
- offset - INDENT_AMOUNT / 2,
- height / 2);
-
- gnome_print_lineto (context,
- offset,
- height / 2);
- }
-
- if (visible_depth_of_node (ecell_view->e_table_model, row) != 0) {
- gnome_print_moveto (context,
- offset - INDENT_AMOUNT / 2,
- height);
- gnome_print_lineto (context,
- offset - INDENT_AMOUNT / 2,
- (e_vbox_model_node_get_next (vbox_model, node)
- ? 0
- : height / 2));
- }
-
- /* now traverse back up to the root of the vbox, checking at
- each level if the node has siblings, and drawing the
- correct vertical pipe for it's configuration. */
- node = e_vbox_model_node_get_parent (vbox_model, node);
- depth = visible_depth_of_node (ecell_view->e_table_model, row) - 1;
- offset -= INDENT_AMOUNT;
- while (node && depth != 0) {
- if (e_vbox_model_node_get_next(vbox_model, node)) {
- gnome_print_moveto (context,
- offset - INDENT_AMOUNT / 2,
- height);
- gnome_print_lineto (context,
- offset - INDENT_AMOUNT / 2,
- 0);
- }
- node = e_vbox_model_node_get_parent (vbox_model, node);
- depth --;
- offset -= INDENT_AMOUNT;
- }
- }
-
- /* now draw our icon if we're expandable */
- if (expandable) {
- double image_matrix [6] = {16, 0, 0, 16, 0, 0};
- GdkPixbuf *image = (expanded
- ? E_CELL_VBOX(vbox_view->cell_view.ecell)->open_pixbuf
- : E_CELL_VBOX(vbox_view->cell_view.ecell)->closed_pixbuf);
- int image_width, image_height, image_rowstride;
- guchar *image_pixels;
-
- image_width = gdk_pixbuf_get_width(image);
- image_height = gdk_pixbuf_get_height(image);
- image_pixels = gdk_pixbuf_get_pixels(image);
- image_rowstride = gdk_pixbuf_get_rowstride(image);
-
- image_matrix [4] = subcell_offset - INDENT_AMOUNT / 2 - image_width / 2;
- image_matrix [5] = height / 2 - image_height / 2;
-
- gnome_print_gsave (context);
- gnome_print_concat (context, image_matrix);
-
- gnome_print_rgbaimage (context, image_pixels, image_width, image_height, image_rowstride);
- gnome_print_grestore (context);
- }
-
- gnome_print_stroke (context);
-
- if (gnome_print_translate(context, subcell_offset, 0) == -1)
- /* FIXME */;
- width -= subcell_offset;
- }
-
-
- e_cell_print (vbox_view->subcell_view, context, model_col, view_col, row, width, height);
-}
-
-static gdouble
-ecv_print_height (ECellView *ecell_view, GnomePrintContext *context,
- int model_col, int view_col, int row,
- double width)
-{
- return 12; /* XXX */
-}
-#endif
-
-/*
- * GObject::dispose method
- */
-static void
-ecv_dispose (GObject *object)
-{
- ECellVbox *ecv = E_CELL_VBOX (object);
- int i;
-
- /* destroy our subcell */
- for (i = 0; i < ecv->subcell_count; i++)
- if (ecv->subcells[i])
- g_object_unref (ecv->subcells[i]);
- g_free (ecv->subcells);
- ecv->subcells = NULL;
- ecv->subcell_count = 0;
-
- G_OBJECT_CLASS (parent_class)->dispose (object);
-}
-
-static void
-e_cell_vbox_class_init (GObjectClass *object_class)
-{
- ECellClass *ecc = (ECellClass *) object_class;
-
- object_class->dispose = ecv_dispose;
-
- ecc->new_view = ecv_new_view;
- ecc->kill_view = ecv_kill_view;
- ecc->realize = ecv_realize;
- ecc->unrealize = ecv_unrealize;
- ecc->draw = ecv_draw;
- ecc->event = ecv_event;
- ecc->height = ecv_height;
-#if 0
- ecc->enter_edit = ecv_enter_edit;
- ecc->leave_edit = ecv_leave_edit;
- ecc->print = ecv_print;
- ecc->print_height = ecv_print_height;
-#endif
- ecc->max_width = ecv_max_width;
-#if 0
- ecc->show_tooltip = ecv_show_tooltip;
- ecc->get_bg_color = ecv_get_bg_color;
-#endif
-
- parent_class = g_type_class_ref (PARENT_TYPE);
-}
-
-static void
-e_cell_vbox_init (GtkObject *object)
-{
- ECellVbox *ecv = E_CELL_VBOX (object);
-
- ecv->subcells = NULL;
- ecv->subcell_count = 0;
-}
-
-E_MAKE_TYPE(e_cell_vbox, "ECellVbox", ECellVbox, e_cell_vbox_class_init, e_cell_vbox_init, PARENT_TYPE);
-
-/**
- * e_cell_vbox_new:
- *
- * Creates a new ECell renderer that can be used to render multiple
- * child cells.
- *
- * Return value: an ECell object that can be used to render multiple
- * child cells.
- **/
-ECell *
-e_cell_vbox_new (void)
-{
- ECellVbox *ecv = g_object_new (E_CELL_VBOX_TYPE, NULL);
-
- return (ECell *) ecv;
-}
-
-void
-e_cell_vbox_append (ECellVbox *vbox, ECell *subcell, int model_col)
-{
- vbox->subcell_count ++;
-
- vbox->subcells = g_renew (ECell *, vbox->subcells, vbox->subcell_count);
- vbox->model_cols = g_renew (int, vbox->model_cols, vbox->subcell_count);
-
- vbox->subcells[vbox->subcell_count - 1] = subcell;
- vbox->model_cols[vbox->subcell_count - 1] = model_col;
-
- if (subcell)
- g_object_ref (subcell);
-}
diff --git a/widgets/table/e-cell-vbox.h b/widgets/table/e-cell-vbox.h
deleted file mode 100644
index 93ddc6d25c..0000000000
--- a/widgets/table/e-cell-vbox.h
+++ /dev/null
@@ -1,65 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-cell-vbox.h - Vbox cell object.
- * Copyright 1999 - 2002, Ximian, Inc.
- *
- * Authors:
- * Chris Toshok <toshok@ximian.com>
- * Chris Lahey <clahey@ximina.com
- *
- * A majority of code taken from:
- *
- * the ECellText renderer.
- * Copyright 1999, 2000, Ximian, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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.
- */
-
-#ifndef _E_CELL_VBOX_H_
-#define _E_CELL_VBOX_H_
-
-#include <libgnomecanvas/gnome-canvas.h>
-#include <gal/e-table/e-cell.h>
-
-G_BEGIN_DECLS
-
-#define E_CELL_VBOX_TYPE (e_cell_vbox_get_type ())
-#define E_CELL_VBOX(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), E_CELL_VBOX_TYPE, ECellVbox))
-#define E_CELL_VBOX_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), E_CELL_VBOX_TYPE, ECellVboxClass))
-#define E_IS_CELL_VBOX(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), E_CELL_VBOX_TYPE))
-#define E_IS_CELL_VBOX_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), E_CELL_VBOX_TYPE))
-
-typedef struct {
- ECell parent;
-
- int subcell_count;
- ECell **subcells;
- int *model_cols;
-} ECellVbox;
-
-typedef struct {
- ECellClass parent_class;
-} ECellVboxClass;
-
-GType e_cell_vbox_get_type (void);
-ECell *e_cell_vbox_new (void);
-void e_cell_vbox_append (ECellVbox *vbox,
- ECell *subcell,
- int model_col);
-
-
-G_END_DECLS
-
-#endif /* _E_CELL_VBOX_H_ */
diff --git a/widgets/table/e-cell.c b/widgets/table/e-cell.c
deleted file mode 100644
index 8deeaa654c..0000000000
--- a/widgets/table/e-cell.c
+++ /dev/null
@@ -1,499 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-cell.c - base class for cell renderers in e-table
- * Copyright 1999, 2000, 2001, Ximian, Inc.
- *
- * Authors:
- * Miguel de Icaza <miguel@ximian.com>
- * Chris Lahey <clahey@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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 "e-cell.h"
-#include "gal/util/e-util.h"
-
-#define PARENT_TYPE GTK_TYPE_OBJECT
-
-#define ECVIEW_EC_CLASS(v) (E_CELL_GET_CLASS (v->ecell))
-
-static ECellView *
-ec_new_view (ECell *ecell, ETableModel *table_model, void *e_table_item_view)
-{
- return NULL;
-}
-
-static void
-ec_realize (ECellView *e_cell)
-{
-}
-
-static void
-ec_kill_view (ECellView *ecell_view)
-{
-}
-
-static void
-ec_unrealize (ECellView *e_cell)
-{
-}
-
-static void
-ec_draw (ECellView *ecell_view, GdkDrawable *drawable,
- int model_col, int view_col, int row, ECellFlags flags,
- int x1, int y1, int x2, int y2)
-{
- g_error ("e-cell-draw invoked\n");
-}
-
-static gint
-ec_event (ECellView *ecell_view, GdkEvent *event, int model_col, int view_col, int row, ECellFlags flags, ECellActions *actions)
-{
- g_error ("e-cell-event invoked\n");
- return 0;
-}
-
-static gint
-ec_height (ECellView *ecell_view, int model_col, int view_col, int row)
-{
- g_error ("e-cell-height invoked\n");
- return 0;
-}
-
-static void
-ec_focus (ECellView *ecell_view, int model_col, int view_col, int row, int x1, int y1, int x2, int y2)
-{
- ecell_view->focus_col = view_col;
- ecell_view->focus_row = row;
- ecell_view->focus_x1 = x1;
- ecell_view->focus_y1 = y1;
- ecell_view->focus_x2 = x2;
- ecell_view->focus_y2 = y2;
-}
-
-static void
-ec_unfocus (ECellView *ecell_view)
-{
- ecell_view->focus_col = -1;
- ecell_view->focus_row = -1;
- ecell_view->focus_x1 = -1;
- ecell_view->focus_y1 = -1;
- ecell_view->focus_x2 = -1;
- ecell_view->focus_y2 = -1;
-}
-
-static void *
-ec_enter_edit (ECellView *ecell_view, int model_col, int view_col, int row)
-{
- return NULL;
-}
-
-static void
-ec_leave_edit (ECellView *ecell_view, int model_col, int view_col, int row, void *context)
-{
-}
-
-static void *
-ec_save_state (ECellView *ecell_view, int model_col, int view_col, int row, void *context)
-{
- return NULL;
-}
-
-static void
-ec_load_state (ECellView *ecell_view, int model_col, int view_col, int row, void *context, void *save_state)
-{
-}
-
-static void
-ec_free_state (ECellView *ecell_view, int model_col, int view_col, int row, void *save_state)
-{
-}
-
-static void
-ec_show_tooltip (ECellView *ecell_view, int model_col, int view_col, int row, int col_width, ETableTooltip *tooltip)
-{
- /* Do nothing */
-}
-
-static void
-e_cell_class_init (GtkObjectClass *object_class)
-{
- ECellClass *ecc = (ECellClass *) object_class;
-
- ecc->realize = ec_realize;
- ecc->unrealize = ec_unrealize;
- ecc->new_view = ec_new_view;
- ecc->kill_view = ec_kill_view;
- ecc->draw = ec_draw;
- ecc->event = ec_event;
- ecc->focus = ec_focus;
- ecc->unfocus = ec_unfocus;
- ecc->height = ec_height;
- ecc->enter_edit = ec_enter_edit;
- ecc->leave_edit = ec_leave_edit;
- ecc->save_state = ec_save_state;
- ecc->load_state = ec_load_state;
- ecc->free_state = ec_free_state;
- ecc->print = NULL;
- ecc->print_height = NULL;
- ecc->max_width = NULL;
- ecc->max_width_by_row = NULL;
- ecc->show_tooltip = ec_show_tooltip;
-}
-
-static void
-e_cell_init (GtkObject *object)
-{
-}
-
-E_MAKE_TYPE(e_cell, "ECell", ECell, e_cell_class_init, e_cell_init, PARENT_TYPE)
-
-/**
- * e_cell_event:
- * @ecell_view: The ECellView where the event will be dispatched
- * @event: The GdkEvent.
- * @model_col: the column in the model
- * @view_col: the column in the view
- * @row: the row
- * @flags: flags about the current state
- * @actions: A second return value in case the cell wants to take some action (specifically grabbing & ungrabbing)
- *
- * Dispatches the event @event to the @ecell_view for.
- *
- * Returns: processing state from the GdkEvent handling.
- */
-gint
-e_cell_event (ECellView *ecell_view, GdkEvent *event, int model_col, int view_col, int row, ECellFlags flags, ECellActions *actions)
-{
- return ECVIEW_EC_CLASS(ecell_view)->event (
- ecell_view, event, model_col, view_col, row, flags, actions);
-}
-
-/**
- * e_cell_new_view:
- * @ecell: the Ecell that will create the new view
- * @table_model: the table model the ecell is bound to
- * @e_table_item_view: An ETableItem object (the CanvasItem that reprensents the view of the table)
- *
- * ECell renderers new to be bound to a table_model and to the actual view
- * during their life time to actually render the data. This method is invoked
- * by the ETableItem canvas item to instatiate a new view of the ECell.
- *
- * This is invoked when the ETableModel is attached to the ETableItem (a CanvasItem
- * that can render ETableModels in the screen).
- *
- * Returns: a new ECellView for this @ecell on the @table_model displayed on the @e_table_item_view.
- */
-ECellView *
-e_cell_new_view (ECell *ecell, ETableModel *table_model, void *e_table_item_view)
-{
- return E_CELL_GET_CLASS (ecell)->new_view (
- ecell, table_model, e_table_item_view);
-}
-
-/**
- * e_cell_realize:
- * @ecell_view: The ECellView to be realized.
- *
- * This function is invoked to give a chance to the ECellView to allocate
- * any resources it needs from Gdk, equivalent to the GtkWidget::realize
- * signal.
- */
-void
-e_cell_realize (ECellView *ecell_view)
-{
- ECVIEW_EC_CLASS(ecell_view)->realize (ecell_view);
-}
-
-/**
- * e_cell_kill_view:
- * @ecell_view: view to be destroyed.
- *
- * This method it used to destroy a view of an ECell renderer
- */
-void
-e_cell_kill_view (ECellView *ecell_view)
-{
- ECVIEW_EC_CLASS(ecell_view)->kill_view (ecell_view);
-}
-
-/**
- * e_cell_unrealize:
- * @ecell_view: The ECellView to be unrealized.
- *
- * This function is invoked to give a chance to the ECellView to
- * release any resources it allocated during the realize method,
- * equivalent to the GtkWidget::unrealize signal.
- */
-void
-e_cell_unrealize (ECellView *ecell_view)
-{
- ECVIEW_EC_CLASS(ecell_view)->unrealize (ecell_view);
-}
-
-/**
- * e_cell_draw:
- * @ecell_view: the ECellView to redraw
- * @drawable: draw desination
- * @model_col: the column in the model being drawn.
- * @view_col: the column in the view being drawn (what the model maps to).
- * @row: the row being drawn
- * @flags: rendering flags.
- * @x1: boudary for the rendering
- * @y1: boudary for the rendering
- * @x2: boudary for the rendering
- * @y2: boudary for the rendering
- *
- * This instructs the ECellView to render itself into the drawable. The
- * region to be drawn in given by (x1,y1)-(x2,y2).
- *
- * The most important flags are %E_CELL_SELECTED and %E_CELL_FOCUSED, other
- * flags include alignments and justifications.
- */
-void
-e_cell_draw (ECellView *ecell_view, GdkDrawable *drawable,
- int model_col, int view_col, int row, ECellFlags flags,
- int x1, int y1, int x2, int y2)
-{
- g_return_if_fail (ecell_view != NULL);
- g_return_if_fail (row >= 0);
- g_return_if_fail (row < e_table_model_row_count(ecell_view->e_table_model));
-
- ECVIEW_EC_CLASS(ecell_view)->draw (ecell_view, drawable, model_col, view_col, row, flags, x1, y1, x2, y2);
-}
-
-/**
- * e_cell_print:
- * @ecell_view: the ECellView to redraw
- * @context: The GnomePrintContext where we output our printed data.
- * @model_col: the column in the model being drawn.
- * @view_col: the column in the view being drawn (what the model maps to).
- * @row: the row being drawn
- * @width: width
- * @height: height
- *
- * FIXME:
- */
-void
-e_cell_print (ECellView *ecell_view, GnomePrintContext *context,
- int model_col, int view_col, int row,
- double width, double height)
-{
- if (ECVIEW_EC_CLASS(ecell_view)->print)
- ECVIEW_EC_CLASS(ecell_view)->print (ecell_view, context, model_col, view_col, row, width, height);
-}
-
-/**
- * e_cell_print:
- *
- * FIXME:
- */
-gdouble
-e_cell_print_height (ECellView *ecell_view, GnomePrintContext *context,
- int model_col, int view_col, int row,
- double width)
-{
- if (ECVIEW_EC_CLASS(ecell_view)->print_height)
- return ECVIEW_EC_CLASS(ecell_view)->print_height
- (ecell_view, context, model_col, view_col, row, width);
- else
- return 0.0;
-}
-
-/**
- * e_cell_height:
- * @ecell_view: the ECellView.
- * @model_col: the column in the model
- * @view_col: the column in the view.
- * @row: the row to me measured
- *
- * Returns: the height of the cell at @model_col, @row rendered at
- * @view_col, @row.
- */
-int
-e_cell_height (ECellView *ecell_view, int model_col, int view_col, int row)
-{
- return ECVIEW_EC_CLASS(ecell_view)->height (ecell_view, model_col, view_col, row);
-}
-
-/**
- * e_cell_enter_edit:
- * @ecell_view: the ECellView that will enter editing
- * @model_col: the column in the model
- * @view_col: the column in the view
- * @row: the row
- *
- * Notifies the ECellView that it is about to enter editing mode for
- * @model_col, @row rendered at @view_col, @row.
- */
-void *
-e_cell_enter_edit (ECellView *ecell_view, int model_col, int view_col, int row)
-{
- return ECVIEW_EC_CLASS(ecell_view)->enter_edit (ecell_view, model_col, view_col, row);
-}
-
-/**
- * e_cell_leave_edit:
- * @ecell_view: the ECellView that will leave editing
- * @model_col: the column in the model
- * @view_col: the column in the view
- * @row: the row
- * @edit_context: the editing context
- *
- * Notifies the ECellView that editing is finished at @model_col, @row
- * rendered at @view_col, @row.
- */
-void
-e_cell_leave_edit (ECellView *ecell_view, int model_col, int view_col, int row, void *edit_context)
-{
- ECVIEW_EC_CLASS(ecell_view)->leave_edit (ecell_view, model_col, view_col, row, edit_context);
-}
-
-/**
- * e_cell_save_state:
- * @ecell_view: the ECellView to save
- * @model_col: the column in the model
- * @view_col: the column in the view
- * @row: the row
- * @edit_context: the editing context
- *
- * Returns: The save state.
- *
- * Requests that the ECellView return a void * representing the state
- * of the ECell. This is primarily intended for things like selection
- * or scrolling.
- */
-void *
-e_cell_save_state (ECellView *ecell_view, int model_col, int view_col, int row, void *edit_context)
-{
- if (ECVIEW_EC_CLASS(ecell_view)->save_state)
- return ECVIEW_EC_CLASS(ecell_view)->save_state (ecell_view, model_col, view_col, row, edit_context);
- else
- return NULL;
-}
-
-/**
- * e_cell_load_state:
- * @ecell_view: the ECellView to load
- * @model_col: the column in the model
- * @view_col: the column in the view
- * @row: the row
- * @edit_context: the editing context
- * @save_state: the save state to load from
- *
- * Requests that the ECellView load from the given save state.
- */
-void
-e_cell_load_state (ECellView *ecell_view, int model_col, int view_col, int row, void *edit_context, void *save_state)
-{
- if (ECVIEW_EC_CLASS(ecell_view)->load_state)
- ECVIEW_EC_CLASS(ecell_view)->load_state (ecell_view, model_col, view_col, row, edit_context, save_state);
-}
-
-/**
- * e_cell_load_state:
- * @ecell_view: the ECellView
- * @model_col: the column in the model
- * @view_col: the column in the view
- * @row: the row
- * @edit_context: the editing context
- * @save_state: the save state to free
- *
- * Requests that the ECellView free the given save state.
- */
-void
-e_cell_free_state (ECellView *ecell_view, int model_col, int view_col, int row, void *save_state)
-{
- if (ECVIEW_EC_CLASS(ecell_view)->free_state)
- ECVIEW_EC_CLASS(ecell_view)->free_state (ecell_view, model_col, view_col, row, save_state);
-}
-
-/**
- * e_cell_max_width:
- * @ecell_view: the ECellView that will leave editing
- * @model_col: the column in the model
- * @view_col: the column in the view.
- *
- * Returns: the maximum width for the ECellview at @model_col which
- * is being rendered as @view_col
- */
-int
-e_cell_max_width (ECellView *ecell_view, int model_col, int view_col)
-{
- return ECVIEW_EC_CLASS(ecell_view)->max_width
- (ecell_view, model_col, view_col);
-}
-
-/**
- * e_cell_max_width_by_row:
- * @ecell_view: the ECellView that we are curious about
- * @model_col: the column in the model
- * @view_col: the column in the view.
- * @row: The row in the model.
- *
- * Returns: the maximum width for the ECellview at @model_col which
- * is being rendered as @view_col for the data in @row.
- */
-int
-e_cell_max_width_by_row (ECellView *ecell_view, int model_col, int view_col, int row)
-{
- if (ECVIEW_EC_CLASS(ecell_view)->max_width_by_row)
- return ECVIEW_EC_CLASS(ecell_view)->max_width_by_row
- (ecell_view, model_col, view_col, row);
- else
- return e_cell_max_width (ecell_view, model_col, view_col);
-}
-
-/**
- * e_cell_max_width_by_row_implemented:
- * @ecell_view: the ECellView that we are curious about
- * @model_col: the column in the model
- * @view_col: the column in the view.
- * @row: The row in the model.
- *
- * Returns: the maximum width for the ECellview at @model_col which
- * is being rendered as @view_col for the data in @row.
- */
-gboolean
-e_cell_max_width_by_row_implemented (ECellView *ecell_view)
-{
- return (ECVIEW_EC_CLASS(ecell_view)->max_width_by_row != NULL);
-}
-
-void
-e_cell_show_tooltip (ECellView *ecell_view, int model_col, int view_col,
- int row, int col_width, ETableTooltip *tooltip)
-{
- ECVIEW_EC_CLASS(ecell_view)->show_tooltip
- (ecell_view, model_col, view_col, row, col_width, tooltip);
-}
-
-gchar *
-e_cell_get_bg_color(ECellView *ecell_view, int row)
-{
- if (ECVIEW_EC_CLASS(ecell_view)->get_bg_color)
- return ECVIEW_EC_CLASS(ecell_view)->get_bg_color (ecell_view, row);
- else
- return NULL;
-}
-
-void
-e_cell_style_set(ECellView *ecell_view, GtkStyle *previous_style)
-{
- if (ECVIEW_EC_CLASS(ecell_view)->style_set)
- ECVIEW_EC_CLASS(ecell_view)->style_set (ecell_view, previous_style);
-}
-
diff --git a/widgets/table/e-cell.h b/widgets/table/e-cell.h
deleted file mode 100644
index b6c4e01e71..0000000000
--- a/widgets/table/e-cell.h
+++ /dev/null
@@ -1,222 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-cell.h
- * Copyright 1999, 2000, 2001, Ximian, Inc.
- *
- * Authors:
- * Miguel de Icaza <miguel@ximian.com>
- * Chris Lahey <clahey@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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.
- */
-
-#ifndef _E_CELL_H_
-#define _E_CELL_H_
-
-#include <gdk/gdktypes.h>
-#include <libgnomeprint/gnome-print.h>
-#include <libgnomeprint/gnome-font.h>
-#include <gal/e-table/e-table-model.h>
-#include <gal/e-table/e-table-tooltip.h>
-
-G_BEGIN_DECLS
-
-#define E_CELL_TYPE (e_cell_get_type ())
-#define E_CELL(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), E_CELL_TYPE, ECell))
-#define E_CELL_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), E_CELL_TYPE, ECellClass))
-#define E_CELL_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS((o), E_CELL_TYPE, ECellClass))
-#define E_IS_CELL(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), E_CELL_TYPE))
-#define E_IS_CELL_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), E_CELL_TYPE))
-
-typedef gboolean (*ETableSearchFunc) (gconstpointer haystack,
- const char *needle);
-
-typedef enum {
- E_CELL_SELECTED = 1 << 0,
-
- E_CELL_JUSTIFICATION = 3 << 1,
- E_CELL_JUSTIFY_CENTER = 0 << 1,
- E_CELL_JUSTIFY_LEFT = 1 << 1,
- E_CELL_JUSTIFY_RIGHT = 2 << 1,
- E_CELL_JUSTIFY_FILL = 3 << 1,
-
- E_CELL_ALIGN_LEFT = 1 << 1,
- E_CELL_ALIGN_RIGHT = 1 << 2,
-
- E_CELL_FOCUSED = 1 << 3,
-
- E_CELL_EDITING = 1 << 4,
-
- E_CELL_CURSOR = 1 << 5
-} ECellFlags;
-
-typedef enum {
- E_CELL_GRAB = 1 << 0,
- E_CELL_UNGRAB = 1 << 1
-} ECellActions;
-
-typedef struct {
- GtkObject object;
-} ECell;
-
-typedef struct {
- ECell *ecell;
- ETableModel *e_table_model;
- void *e_table_item_view;
-
- gint focus_x1, focus_y1, focus_x2, focus_y2;
- gint focus_col, focus_row;
-} ECellView;
-
-#define E_CELL_IS_FOCUSED(ecell_view) (ecell_view->focus_x1 != -1)
-
-typedef struct {
- GtkObjectClass parent_class;
-
- ECellView *(*new_view) (ECell *ecell, ETableModel *table_model, void *e_table_item_view);
- void (*kill_view) (ECellView *ecell_view);
-
- void (*realize) (ECellView *ecell_view);
- void (*unrealize) (ECellView *ecell_view);
-
- void (*draw) (ECellView *ecell_view, GdkDrawable *drawable,
- int model_col, int view_col, int row,
- ECellFlags flags, int x1, int y1, int x2, int y2);
- gint (*event) (ECellView *ecell_view, GdkEvent *event, int model_col, int view_col, int row, ECellFlags flags, ECellActions *actions);
- void (*focus) (ECellView *ecell_view, int model_col, int view_col,
- int row, int x1, int y1, int x2, int y2);
- void (*unfocus) (ECellView *ecell_view);
- int (*height) (ECellView *ecell_view, int model_col, int view_col, int row);
-
- void *(*enter_edit) (ECellView *ecell_view, int model_col, int view_col, int row);
- void (*leave_edit) (ECellView *ecell_view, int model_col, int view_col, int row, void *context);
- void *(*save_state) (ECellView *ecell_view, int model_col, int view_col, int row, void *context);
- void (*load_state) (ECellView *ecell_view, int model_col, int view_col, int row, void *context, void *save_state);
- void (*free_state) (ECellView *ecell_view, int model_col, int view_col, int row, void *save_state);
- void (*print) (ECellView *ecell_view, GnomePrintContext *context,
- int model_col, int view_col, int row,
- gdouble width, gdouble height);
- gdouble (*print_height) (ECellView *ecell_view, GnomePrintContext *context,
- int model_col, int view_col, int row, gdouble width);
- int (*max_width) (ECellView *ecell_view, int model_col, int view_col);
- int (*max_width_by_row) (ECellView *ecell_view, int model_col, int view_col, int row);
- void (*show_tooltip) (ECellView *ecell_view, int model_col, int view_col, int row, int col_width, ETableTooltip *tooltip);
- gchar *(*get_bg_color) (ECellView *ecell_view, int row);
-
- void (*style_set) (ECellView *ecell_view, GtkStyle *previous_style);
-} ECellClass;
-
-GType e_cell_get_type (void);
-
-/* View creation methods. */
-ECellView *e_cell_new_view (ECell *ecell,
- ETableModel *table_model,
- void *e_table_item_view);
-void e_cell_kill_view (ECellView *ecell_view);
-
-/* Cell View methods. */
-gint e_cell_event (ECellView *ecell_view,
- GdkEvent *event,
- int model_col,
- int view_col,
- int row,
- ECellFlags flags,
- ECellActions *actions);
-void e_cell_realize (ECellView *ecell_view);
-void e_cell_unrealize (ECellView *ecell_view);
-void e_cell_draw (ECellView *ecell_view,
- GdkDrawable *drawable,
- int model_col,
- int view_col,
- int row,
- ECellFlags flags,
- int x1,
- int y1,
- int x2,
- int y2);
-void e_cell_print (ECellView *ecell_view,
- GnomePrintContext *context,
- int model_col,
- int view_col,
- int row,
- double width,
- double height);
-gdouble e_cell_print_height (ECellView *ecell_view,
- GnomePrintContext *context,
- int model_col,
- int view_col,
- int row,
- gdouble width);
-int e_cell_max_width (ECellView *ecell_view,
- int model_col,
- int view_col);
-int e_cell_max_width_by_row (ECellView *ecell_view,
- int model_col,
- int view_col,
- int row);
-gboolean e_cell_max_width_by_row_implemented (ECellView *ecell_view);
-void e_cell_show_tooltip (ECellView *ecell_view,
- int model_col,
- int view_col,
- int row,
- int col_width,
- ETableTooltip *tooltip);
-gchar *e_cell_get_bg_color (ECellView *ecell_view,
- int row);
-void e_cell_style_set (ECellView *ecell_view,
- GtkStyle *previous_style);
-
-void e_cell_focus (ECellView *ecell_view,
- int model_col,
- int view_col,
- int row,
- int x1,
- int y1,
- int x2,
- int y2);
-void e_cell_unfocus (ECellView *ecell_view);
-int e_cell_height (ECellView *ecell_view,
- int model_col,
- int view_col,
- int row);
-void *e_cell_enter_edit (ECellView *ecell_view,
- int model_col,
- int view_col,
- int row);
-void e_cell_leave_edit (ECellView *ecell_view,
- int model_col,
- int view_col,
- int row,
- void *edit_context);
-void *e_cell_save_state (ECellView *ecell_view,
- int model_col,
- int view_col,
- int row,
- void *edit_context);
-void e_cell_load_state (ECellView *ecell_view,
- int model_col,
- int view_col,
- int row,
- void *edit_context,
- void *state);
-void e_cell_free_state (ECellView *ecell_view,
- int model_col,
- int view_col,
- int row,
- void *state);
-
-G_END_DECLS
-
-#endif /* _E_CELL_H_ */
diff --git a/widgets/table/e-table-click-to-add.c b/widgets/table/e-table-click-to-add.c
deleted file mode 100644
index 9c4d802c1e..0000000000
--- a/widgets/table/e-table-click-to-add.c
+++ /dev/null
@@ -1,562 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-table-click-to-add.c
- * Copyright 2000, 2001, Ximian, Inc.
- *
- * Authors:
- * Chris Lahey <clahey@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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 <gdk/gdkkeysyms.h>
-#include <gtk/gtksignal.h>
-#include <libgnomecanvas/gnome-canvas.h>
-#include <libgnomecanvas/gnome-canvas-util.h>
-#include <libgnomecanvas/gnome-canvas-rect-ellipse.h>
-#include <gdk-pixbuf/gdk-pixbuf.h>
-
-#include "e-table-header.h"
-#include "e-table-click-to-add.h"
-#include "e-table-defines.h"
-#include "e-table-one.h"
-#include "gal/e-text/e-text.h"
-#include "gal/widgets/e-canvas.h"
-#include "gal/widgets/e-canvas-utils.h"
-#include "gal/util/e-util.h"
-#include "gal/util/e-i18n.h"
-#include "gal/util/e-marshal.h"
-
-enum {
- CURSOR_CHANGE,
- LAST_SIGNAL
-};
-
-static guint etcta_signals [LAST_SIGNAL] = { 0 };
-
-#define PARENT_OBJECT_TYPE gnome_canvas_group_get_type ()
-
-#define ELEMENTS(x) (sizeof (x) / sizeof (x[0]))
-
-static GnomeCanvasGroupClass *etcta_parent_class;
-
-enum {
- PROP_0,
- PROP_HEADER,
- PROP_MODEL,
- PROP_MESSAGE,
- PROP_WIDTH,
- PROP_HEIGHT
-};
-
-static void
-etcta_cursor_change (GtkObject *object, gint row, gint col, ETableClickToAdd *etcta)
-{
- g_signal_emit (etcta,
- etcta_signals [CURSOR_CHANGE], 0,
- row, col);
-}
-
-static void
-etcta_add_table_header (ETableClickToAdd *etcta, ETableHeader *header)
-{
- etcta->eth = header;
- if (etcta->eth)
- g_object_ref (etcta->eth);
- if (etcta->row)
- gnome_canvas_item_set(GNOME_CANVAS_ITEM(etcta->row),
- "ETableHeader", header,
- NULL);
-}
-
-static void
-etcta_drop_table_header (ETableClickToAdd *etcta)
-{
- if (!etcta->eth)
- return;
-
- g_object_unref (etcta->eth);
- etcta->eth = NULL;
-}
-
-static void
-etcta_add_one (ETableClickToAdd *etcta, ETableModel *one)
-{
- etcta->one = one;
- if (etcta->one)
- g_object_ref (etcta->one);
- if (etcta->row)
- gnome_canvas_item_set(GNOME_CANVAS_ITEM(etcta->row),
- "ETableModel", one,
- NULL);
- g_object_set(etcta->selection,
- "model", one,
- NULL);
-}
-
-static void
-etcta_drop_one (ETableClickToAdd *etcta)
-{
- if (!etcta->one)
- return;
- g_object_unref (etcta->one);
- etcta->one = NULL;
- g_object_set(etcta->selection,
- "model", NULL,
- NULL);
-}
-
-static void
-etcta_add_model (ETableClickToAdd *etcta, ETableModel *model)
-{
- etcta->model = model;
- if (etcta->model)
- g_object_ref (etcta->model);
-}
-
-static void
-etcta_drop_model (ETableClickToAdd *etcta)
-{
- etcta_drop_one (etcta);
- if (!etcta->model)
- return;
- g_object_unref (etcta->model);
- etcta->model = NULL;
-}
-
-static void
-etcta_add_message (ETableClickToAdd *etcta, char *message)
-{
- etcta->message = g_strdup(message);
-}
-
-static void
-etcta_drop_message (ETableClickToAdd *etcta)
-{
- g_free(etcta->message);
- etcta->message = NULL;
-}
-
-
-static void
-etcta_dispose (GObject *object)
-{
- ETableClickToAdd *etcta = E_TABLE_CLICK_TO_ADD (object);
-
- etcta_drop_table_header (etcta);
- etcta_drop_model (etcta);
- etcta_drop_message (etcta);
- if (etcta->selection)
- g_object_unref (etcta->selection);
- etcta->selection = NULL;
-
- if (G_OBJECT_CLASS (etcta_parent_class)->dispose)
- (*G_OBJECT_CLASS (etcta_parent_class)->dispose) (object);
-}
-
-static void
-etcta_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec)
-{
- GnomeCanvasItem *item;
- ETableClickToAdd *etcta;
-
- item = GNOME_CANVAS_ITEM (object);
- etcta = E_TABLE_CLICK_TO_ADD (object);
-
- switch (prop_id){
- case PROP_HEADER:
- etcta_drop_table_header (etcta);
- etcta_add_table_header (etcta, E_TABLE_HEADER(g_value_get_object (value)));
- break;
- case PROP_MODEL:
- etcta_drop_model (etcta);
- etcta_add_model (etcta, E_TABLE_MODEL(g_value_get_object (value)));
- break;
- case PROP_MESSAGE:
- etcta_drop_message (etcta);
- etcta_add_message (etcta, (char*)g_value_get_string (value));
- break;
- case PROP_WIDTH:
- etcta->width = g_value_get_double (value);
- if (etcta->row)
- gnome_canvas_item_set(etcta->row,
- "minimum_width", etcta->width,
- NULL);
- if (etcta->text)
- gnome_canvas_item_set(etcta->text,
- "width", etcta->width - 4,
- NULL);
- if (etcta->rect)
- gnome_canvas_item_set(etcta->rect,
- "x2", etcta->width - 1,
- NULL);
- break;
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
- return;
-
- }
- gnome_canvas_item_request_update(item);
-}
-
-static void
-etcta_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec)
-{
- ETableClickToAdd *etcta;
-
- etcta = E_TABLE_CLICK_TO_ADD (object);
-
- switch (prop_id){
- case PROP_HEADER:
- g_value_set_object (value, etcta->eth);
- break;
- case PROP_MODEL:
- g_value_set_object (value, etcta->model);
- break;
- case PROP_MESSAGE:
- g_value_set_string (value, g_strdup(etcta->message));
- break;
- case PROP_WIDTH:
- g_value_set_double (value, etcta->width);
- break;
- case PROP_HEIGHT:
- g_value_set_double (value, etcta->height);
- break;
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
- break;
- }
-}
-
-static void
-etcta_realize (GnomeCanvasItem *item)
-{
- ETableClickToAdd *etcta = E_TABLE_CLICK_TO_ADD (item);
-
- etcta->rect = gnome_canvas_item_new(GNOME_CANVAS_GROUP(item),
- gnome_canvas_rect_get_type(),
- "x1", (double) 0,
- "y1", (double) 0,
- "x2", (double) etcta->width - 1,
- "y2", (double) etcta->height - 1,
- "outline_color", "black",
- "fill_color", "white",
- NULL);
-
- etcta->text = gnome_canvas_item_new(GNOME_CANVAS_GROUP(item),
- e_text_get_type(),
- "text", etcta->message ? etcta->message : "",
- "anchor", GTK_ANCHOR_NW,
- "width", etcta->width - 4,
- "draw_background", FALSE,
- NULL);
- e_canvas_item_move_absolute (etcta->text, 2, 2);
-
- if (GNOME_CANVAS_ITEM_CLASS (etcta_parent_class)->realize)
- (*GNOME_CANVAS_ITEM_CLASS (etcta_parent_class)->realize)(item);
-
- e_canvas_item_request_reflow (item);
-}
-
-static void
-etcta_unrealize (GnomeCanvasItem *item)
-{
- if (GNOME_CANVAS_ITEM_CLASS (etcta_parent_class)->unrealize)
- (*GNOME_CANVAS_ITEM_CLASS (etcta_parent_class)->unrealize)(item);
-}
-
-static void finish_editing (ETableClickToAdd *etcta);
-
-static int
-item_key_press (ETableItem *item, int row, int col, GdkEvent *event, ETableClickToAdd *etcta)
-{
- switch (event->key.keyval) {
- case GDK_Return:
- case GDK_KP_Enter:
- case GDK_ISO_Enter:
- case GDK_3270_Enter:
- finish_editing(etcta);
- return TRUE;
- }
- return FALSE;
-}
-
-static void
-set_initial_selection (ETableClickToAdd *etcta)
-{
- e_selection_model_do_something (E_SELECTION_MODEL(etcta->selection),
- 0, e_table_header_prioritized_column (etcta->eth),
- 0);
-}
-
-static void
-finish_editing (ETableClickToAdd *etcta)
-{
- if (etcta->row) {
- ETableModel *one;
-
- e_table_item_leave_edit (E_TABLE_ITEM (etcta->row));
- e_table_one_commit(E_TABLE_ONE(etcta->one));
- etcta_drop_one (etcta);
- gtk_object_destroy(etcta->row);
- etcta->row = NULL;
-
- one = e_table_one_new(etcta->model);
- etcta_add_one (etcta, one);
- g_object_unref (one);
-
- e_selection_model_clear(E_SELECTION_MODEL(etcta->selection));
-
- etcta->row = gnome_canvas_item_new(GNOME_CANVAS_GROUP(etcta),
- e_table_item_get_type(),
- "ETableHeader", etcta->eth,
- "ETableModel", etcta->one,
- "minimum_width", etcta->width,
- "horizontal_draw_grid", TRUE,
- "vertical_draw_grid", TRUE,
- "selection_model", etcta->selection,
- "cursor_mode", E_CURSOR_SPREADSHEET,
- NULL);
-
- g_signal_connect(etcta->row, "key_press",
- G_CALLBACK(item_key_press), etcta);
-
- set_initial_selection (etcta);
- }
-}
-
-/*
- * Handles the events on the ETableClickToAdd, particularly it creates the ETableItem and passes in some events.
- */
-static int
-etcta_event (GnomeCanvasItem *item, GdkEvent *e)
-{
- ETableClickToAdd *etcta = E_TABLE_CLICK_TO_ADD (item);
-
- switch (e->type){
- case GDK_BUTTON_PRESS:
- if (etcta->text) {
- gtk_object_destroy(etcta->text);
- etcta->text = NULL;
- }
- if (etcta->rect) {
- gtk_object_destroy(etcta->rect);
- etcta->rect = NULL;
- }
- if (!etcta->row) {
- ETableModel *one;
-
- one = e_table_one_new(etcta->model);
- etcta_add_one (etcta, one);
- g_object_unref (one);
-
- e_selection_model_clear(E_SELECTION_MODEL(etcta->selection));
-
- etcta->row = gnome_canvas_item_new(GNOME_CANVAS_GROUP(item),
- e_table_item_get_type(),
- "ETableHeader", etcta->eth,
- "ETableModel", etcta->one,
- "minimum_width", etcta->width,
- "horizontal_draw_grid", TRUE,
- "vertical_draw_grid", TRUE,
- "selection_model", etcta->selection,
- "cursor_mode", E_CURSOR_SPREADSHEET,
- NULL);
-
- g_signal_connect(etcta->row, "key_press",
- G_CALLBACK (item_key_press), etcta);
-
- e_canvas_item_grab_focus (GNOME_CANVAS_ITEM(etcta->row), TRUE);
-
- set_initial_selection (etcta);
- }
- break;
-
- case GDK_KEY_PRESS:
- switch (e->key.keyval) {
- case GDK_Tab:
- case GDK_KP_Tab:
- case GDK_ISO_Left_Tab:
- finish_editing (etcta);
- break;
- default:
- return FALSE;
- break;
- }
- break;
-
- default:
- return FALSE;
- }
- return TRUE;
-}
-
-static void
-etcta_reflow (GnomeCanvasItem *item, int flags)
-{
- ETableClickToAdd *etcta = E_TABLE_CLICK_TO_ADD (item);
-
- double old_height = etcta->height;
-
- if (etcta->text) {
- g_object_get(etcta->text,
- "height", &etcta->height,
- NULL);
- etcta->height += 6;
- }
- if (etcta->row) {
- g_object_get(etcta->row,
- "height", &etcta->height,
- NULL);
- }
-
- if (etcta->rect) {
- g_object_set(etcta->rect,
- "y2", etcta->height - 1,
- NULL);
- }
-
- if (old_height != etcta->height)
- e_canvas_item_request_parent_reflow(item);
-}
-
-static void
-etcta_class_init (ETableClickToAddClass *klass)
-{
- GnomeCanvasItemClass *item_class = GNOME_CANVAS_ITEM_CLASS(klass);
- GObjectClass *object_class = G_OBJECT_CLASS(klass);
-
- etcta_parent_class = g_type_class_ref (PARENT_OBJECT_TYPE);
-
- klass->cursor_change = NULL;
-
- object_class->dispose = etcta_dispose;
- object_class->set_property = etcta_set_property;
- object_class->get_property = etcta_get_property;
-
- item_class->realize = etcta_realize;
- item_class->unrealize = etcta_unrealize;
- item_class->event = etcta_event;
-
- g_object_class_install_property (object_class, PROP_HEADER,
- g_param_spec_object ("header",
- _("Header"),
- /*_( */"XXX blurb" /*)*/,
- E_TABLE_HEADER_TYPE,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_MODEL,
- g_param_spec_object ("model",
- _("Model"),
- /*_( */"XXX blurb" /*)*/,
- E_TABLE_MODEL_TYPE,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_MESSAGE,
- g_param_spec_string ("message",
- _("Message"),
- /*_( */"XXX blurb" /*)*/,
- NULL,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_WIDTH,
- g_param_spec_double ("width",
- _("Width"),
- /*_( */"XXX blurb" /*)*/,
- 0.0, G_MAXDOUBLE, 0.0,
- G_PARAM_READWRITE | G_PARAM_LAX_VALIDATION));
-
- g_object_class_install_property (object_class, PROP_HEIGHT,
- g_param_spec_double ("height",
- _("Height"),
- /*_( */"XXX blurb" /*)*/,
- 0.0, G_MAXDOUBLE, 0.0,
- G_PARAM_READABLE | G_PARAM_LAX_VALIDATION));
-
- etcta_signals [CURSOR_CHANGE] =
- g_signal_new ("cursor_change",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (ETableClickToAddClass, cursor_change),
- NULL, NULL,
- e_marshal_VOID__INT_INT,
- G_TYPE_NONE, 2, G_TYPE_INT, G_TYPE_INT);
-}
-
-static void
-etcta_init (GnomeCanvasItem *item)
-{
- ETableClickToAdd *etcta = E_TABLE_CLICK_TO_ADD (item);
-
- etcta->one = NULL;
- etcta->model = NULL;
- etcta->eth = NULL;
-
- etcta->message = NULL;
-
- etcta->row = NULL;
- etcta->text = NULL;
- etcta->rect = NULL;
-
- etcta->selection = e_table_selection_model_new();
- g_signal_connect(etcta->selection, "cursor_changed",
- G_CALLBACK (etcta_cursor_change), etcta);
-
- e_canvas_item_set_reflow_callback(item, etcta_reflow);
-}
-
-E_MAKE_TYPE(e_table_click_to_add, "ETableClickToAdd", ETableClickToAdd, etcta_class_init, etcta_init, PARENT_OBJECT_TYPE)
-
-
-/* The colors in this need to be themefied. */
-/**
- * e_table_click_to_add_commit:
- * @etcta: The %ETableClickToAdd to commit.
- *
- * This routine commits the current thing being edited and returns to
- * just displaying the click to add message.
- **/
-void
-e_table_click_to_add_commit (ETableClickToAdd *etcta)
-{
- if (etcta->row) {
- e_table_one_commit(E_TABLE_ONE(etcta->one));
- etcta_drop_one (etcta);
- gtk_object_destroy(etcta->row);
- etcta->row = NULL;
- }
- if (!etcta->rect) {
- etcta->rect = gnome_canvas_item_new(GNOME_CANVAS_GROUP(etcta),
- gnome_canvas_rect_get_type(),
- "x1", (double) 0,
- "y1", (double) 0,
- "x2", (double) etcta->width - 1,
- "y2", (double) etcta->height - 1,
- "outline_color", "black",
- "fill_color", "white",
- NULL);
- }
- if (!etcta->text) {
- etcta->text = gnome_canvas_item_new(GNOME_CANVAS_GROUP(etcta),
- e_text_get_type(),
- "text", etcta->message ? etcta->message : "",
- "anchor", GTK_ANCHOR_NW,
- "width", etcta->width - 4,
- "draw_background", FALSE,
- NULL);
- e_canvas_item_move_absolute (etcta->text, 3, 3);
- }
-}
diff --git a/widgets/table/e-table-click-to-add.h b/widgets/table/e-table-click-to-add.h
deleted file mode 100644
index f5417e23f9..0000000000
--- a/widgets/table/e-table-click-to-add.h
+++ /dev/null
@@ -1,77 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-table-click-to-add.h
- * Copyright 2000, 2001, Ximian, Inc.
- *
- * Authors:
- * Chris Lahey <clahey@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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.
- */
-
-#ifndef _E_TABLE_CLICK_TO_ADD_H_
-#define _E_TABLE_CLICK_TO_ADD_H_
-
-#include <libxml/tree.h>
-#include <libgnomecanvas/gnome-canvas.h>
-#include <gal/e-table/e-table-header.h>
-#include <gal/e-table/e-table-sort-info.h>
-#include <gal/e-table/e-table-item.h>
-#include <gal/e-table/e-table-selection-model.h>
-
-G_BEGIN_DECLS
-
-#define E_TABLE_CLICK_TO_ADD_TYPE (e_table_click_to_add_get_type ())
-#define E_TABLE_CLICK_TO_ADD(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), E_TABLE_CLICK_TO_ADD_TYPE, ETableClickToAdd))
-#define E_TABLE_CLICK_TO_ADD_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), E_TABLE_CLICK_TO_ADD_TYPE, ETableClickToAddClass))
-#define E_IS_TABLE_CLICK_TO_ADD(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), E_TABLE_CLICK_TO_ADD_TYPE))
-#define E_IS_TABLE_CLICK_TO_ADD_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), E_TABLE_CLICK_TO_ADD_TYPE))
-
-typedef struct {
- GnomeCanvasGroup parent;
-
- ETableModel *one; /* The ETableOne. */
-
- ETableModel *model; /* The backend model. */
- ETableHeader *eth; /* This is just to give to the ETableItem. */
-
- char *message;
-
- GnomeCanvasItem *row; /* If row is NULL, we're sitting with no data and a "Click here" message. */
- GnomeCanvasItem *text; /* If text is NULL, row shouldn't be. */
- GnomeCanvasItem *rect; /* What the heck. Why not. */
-
- gdouble width;
- gdouble height;
-
- ETableSelectionModel *selection;
-} ETableClickToAdd;
-
-typedef struct {
- GnomeCanvasGroupClass parent_class;
-
- /*
- * signals
- */
- void (*cursor_change) (ETableClickToAdd *etcta, gint row, gint col);
-} ETableClickToAddClass;
-
-GType e_table_click_to_add_get_type (void);
-
-void e_table_click_to_add_commit (ETableClickToAdd *etcta);
-
-G_END_DECLS
-
-#endif /* _E_TABLE_CLICK_TO_ADD_H_ */
diff --git a/widgets/table/e-table-col-dnd.h b/widgets/table/e-table-col-dnd.h
deleted file mode 100644
index d31c94ed26..0000000000
--- a/widgets/table/e-table-col-dnd.h
+++ /dev/null
@@ -1,39 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-table-col-dnd.h
- * Copyright 2000, 2001, Ximian, Inc.
- *
- * Authors:
- * Chris Lahey <clahey@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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.
- */
-
-#ifndef _E_TABLE_COL_DND_H_
-#define _E_TABLE_COL_DND_H_
-
-#include <glib.h>
-
-G_BEGIN_DECLS
-
-#define TARGET_ETABLE_COL_TYPE "application/x-etable-column-header"
-
-enum {
- TARGET_ETABLE_COL_HEADER
-};
-
-G_END_DECLS
-
-#endif /* _E_TABLE_COL_DND_H_ */
diff --git a/widgets/table/e-table-col.c b/widgets/table/e-table-col.c
deleted file mode 100644
index 9acc0ba4fd..0000000000
--- a/widgets/table/e-table-col.c
+++ /dev/null
@@ -1,236 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-table-col.c
- * Copyright 1999, 2000, 2001, Ximian, Inc.
- *
- * Authors:
- * Miguel de Icaza <miguel@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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 "e-table-col.h"
-#include "gal/util/e-util.h"
-#include "gal/util/e-i18n.h"
-
-static GObjectClass *parent_class;
-
-enum {
- PROP_0,
- PROP_COMPARE_COL,
-};
-
-static void
-etc_dispose (GObject *object)
-{
- ETableCol *etc = E_TABLE_COL (object);
-
- if (etc->ecell)
- g_object_unref (etc->ecell);
- etc->ecell = NULL;
-
- if (etc->pixbuf)
- gdk_pixbuf_unref (etc->pixbuf);
- etc->pixbuf = NULL;
-
- if (etc->text)
- g_free (etc->text);
- etc->text = NULL;
-
- parent_class->dispose (object);
-}
-
-static void
-etc_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec)
-{
- ETableCol *etc = E_TABLE_COL (object);
-
- switch (prop_id) {
- case PROP_COMPARE_COL:
- etc->compare_col = g_value_get_int (value);
- break;
- default:
- break;
- }
-}
-
-static void
-etc_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec)
-{
- ETableCol *etc = E_TABLE_COL (object);
-
- switch (prop_id) {
- case PROP_COMPARE_COL:
- g_value_set_int (value, etc->compare_col);
- break;
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
- break;
- }
-}
-
-static void
-e_table_col_class_init (GObjectClass *object_class)
-{
- parent_class = g_type_class_peek_parent (object_class);
-
- object_class->dispose = etc_dispose;
- object_class->set_property = etc_set_property;
- object_class->get_property = etc_get_property;
-
- g_object_class_install_property (object_class, PROP_COMPARE_COL,
- g_param_spec_int ("compare_col",
- _( "Width" ),
- "Width",
- 0, G_MAXINT, 0,
- G_PARAM_READWRITE));
-}
-
-static void
-e_table_col_init (ETableCol *etc)
-{
- etc->width = 0;
- etc->sortable = 1;
- etc->groupable = 1;
- etc->justification = GTK_JUSTIFY_LEFT;
- etc->priority = 0;
-}
-
-E_MAKE_TYPE(e_table_col, "ETableCol", ETableCol, e_table_col_class_init, e_table_col_init, G_TYPE_OBJECT)
-
-/**
- * e_table_col_new:
- * @col_idx: the column we represent in the model
- * @text: a title for this column
- * @expansion: FIXME
- * @min_width: minimum width in pixels for this column
- * @ecell: the renderer to be used for this column
- * @compare: comparision function for the elements stored in this column
- * @resizable: whether the column can be resized interactively by the user
- * @priority: FIXME
- *
- * The ETableCol represents a column to be used inside an ETable. The
- * ETableCol objects are inserted inside an ETableHeader (which is just a collection
- * of ETableCols). The ETableHeader is the definition of the order in which
- * columns are shown to the user.
- *
- * The @text argument is the the text that will be shown as a header to the
- * user. @col_idx reflects where the data for this ETableCol object will
- * be fetch from an ETableModel. So even if the user changes the order
- * of the columns being viewed (the ETableCols in the ETableHeader), the
- * column will always point to the same column inside the ETableModel.
- *
- * The @ecell argument is an ECell object that needs to know how to render the
- * data in the ETableModel for this specific row.
- *
- * Returns: the newly created ETableCol object.
- */
-ETableCol *
-e_table_col_new (int col_idx, const char *text, double expansion, int min_width,
- ECell *ecell, GCompareFunc compare, gboolean resizable, gboolean disabled, int priority)
-{
- ETableCol *etc;
-
- g_return_val_if_fail (expansion >= 0, NULL);
- g_return_val_if_fail (min_width >= 0, NULL);
- g_return_val_if_fail (ecell != NULL, NULL);
- g_return_val_if_fail (compare != NULL, NULL);
- g_return_val_if_fail (text != NULL, NULL);
-
- etc = g_object_new (E_TABLE_COL_TYPE, NULL);
-
- etc->is_pixbuf = FALSE;
-
- etc->col_idx = col_idx;
- etc->compare_col = col_idx;
- etc->text = g_strdup (text);
- etc->pixbuf = NULL;
- etc->expansion = expansion;
- etc->min_width = min_width;
- etc->ecell = ecell;
- etc->compare = compare;
- etc->disabled = disabled;
- etc->priority = priority;
-
- etc->selected = 0;
- etc->resizable = resizable;
-
- g_object_ref (etc->ecell);
-
- return etc;
-}
-
-/**
- * e_table_col_new_with_pixbuf:
- * @col_idx: the column we represent in the model
- * @pixbuf: the image to be used for the header
- * @expansion: FIXME
- * @min_width: minimum width in pixels for this column
- * @ecell: the renderer to be used for this column
- * @compare: comparision function for the elements stored in this column
- * @resizable: whether the column can be resized interactively by the user
- *
- * The ETableCol represents a column to be used inside an ETable. The
- * ETableCol objects are inserted inside an ETableHeader (which is just a collection
- * of ETableCols). The ETableHeader is the definition of the order in which
- * columns are shown to the user.
- *
- * The @text argument is the the text that will be shown as a header to the
- * user. @col_idx reflects where the data for this ETableCol object will
- * be fetch from an ETableModel. So even if the user changes the order
- * of the columns being viewed (the ETableCols in the ETableHeader), the
- * column will always point to the same column inside the ETableModel.
- *
- * The @ecell argument is an ECell object that needs to know how to render the
- * data in the ETableModel for this specific row.
- *
- * Returns: the newly created ETableCol object.
- */
-ETableCol *
-e_table_col_new_with_pixbuf (int col_idx, const char *text, GdkPixbuf *pixbuf, double expansion, int min_width,
- ECell *ecell, GCompareFunc compare, gboolean resizable, gboolean disabled, int priority)
-{
- ETableCol *etc;
-
- g_return_val_if_fail (expansion >= 0, NULL);
- g_return_val_if_fail (min_width >= 0, NULL);
- g_return_val_if_fail (ecell != NULL, NULL);
- g_return_val_if_fail (compare != NULL, NULL);
- g_return_val_if_fail (pixbuf != NULL, NULL);
-
- etc = g_object_new (E_TABLE_COL_TYPE, NULL);
-
- etc->is_pixbuf = TRUE;
-
- etc->col_idx = col_idx;
- etc->compare_col = col_idx;
- etc->text = g_strdup(text);
- etc->pixbuf = pixbuf;
- etc->expansion = expansion;
- etc->min_width = min_width;
- etc->ecell = ecell;
- etc->compare = compare;
- etc->disabled = disabled;
- etc->priority = priority;
-
- etc->selected = 0;
- etc->resizable = resizable;
-
- g_object_ref (etc->ecell);
- gdk_pixbuf_ref (etc->pixbuf);
-
- return etc;
-}
diff --git a/widgets/table/e-table-col.h b/widgets/table/e-table-col.h
deleted file mode 100644
index 8f2369c76a..0000000000
--- a/widgets/table/e-table-col.h
+++ /dev/null
@@ -1,101 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-table-col.h
- * Copyright 1999, 2000, 2001, Ximian, Inc.
- *
- * Authors:
- * Miguel de Icaza <miguel@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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.
- */
-
-#ifndef _E_TABLE_COL_H_
-#define _E_TABLE_COL_H_
-
-#include <gdk-pixbuf/gdk-pixbuf.h>
-#include <gal/e-table/e-cell.h>
-
-G_BEGIN_DECLS
-
-#define E_TABLE_COL_TYPE (e_table_col_get_type ())
-#define E_TABLE_COL(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), E_TABLE_COL_TYPE, ETableCol))
-#define E_TABLE_COL_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), E_TABLE_COL_TYPE, ETableColClass))
-#define E_IS_TABLE_COL(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), E_TABLE_COL_TYPE))
-#define E_IS_TABLE_COL_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), E_TABLE_COL_TYPE))
-#define E_TABLE_COL_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS((o), E_TABLE_COL_TYPE, ETableColClass))
-
-typedef enum {
- E_TABLE_COL_ARROW_NONE = 0,
- E_TABLE_COL_ARROW_UP,
- E_TABLE_COL_ARROW_DOWN
-} ETableColArrow;
-
-/*
- * Information about a single column
- */
-typedef struct {
- GObject base;
- char *text;
- GdkPixbuf *pixbuf;
- int min_width;
- int width;
- double expansion;
- short x;
- GCompareFunc compare;
- ETableSearchFunc search;
- unsigned int is_pixbuf:1;
- unsigned int selected:1;
- unsigned int resizable:1;
- unsigned int disabled:1;
- unsigned int sortable:1;
- unsigned int groupable:1;
- int col_idx;
- int compare_col;
- int priority;
-
- GtkJustification justification;
-
- ECell *ecell;
-} ETableCol;
-
-typedef struct {
- GObjectClass parent_class;
-} ETableColClass;
-
-GType e_table_col_get_type (void);
-ETableCol *e_table_col_new (int col_idx,
- const char *text,
- double expansion,
- int min_width,
- ECell *ecell,
- GCompareFunc compare,
- gboolean resizable,
- gboolean disabled,
- int priority);
-ETableCol *e_table_col_new_with_pixbuf (int col_idx,
- const char *text,
- GdkPixbuf *pixbuf,
- double expansion,
- int min_width,
- ECell *ecell,
- GCompareFunc compare,
- gboolean resizable,
- gboolean disabled,
- int priority);
-
-G_END_DECLS
-
-#endif /* _E_TABLE_COL_H_ */
-
diff --git a/widgets/table/e-table-column-specification.c b/widgets/table/e-table-column-specification.c
deleted file mode 100644
index 2e992414d5..0000000000
--- a/widgets/table/e-table-column-specification.c
+++ /dev/null
@@ -1,150 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-table-column-specification.c - Savable specification of a column.
- * Copyright 2000, 2001, Ximian, Inc.
- *
- * Authors:
- * Chris Lahey <clahey@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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 <stdlib.h>
-#include <libxml/parser.h>
-#include <libxml/xmlmemory.h>
-#include "gal/util/e-xml-utils.h"
-#include "gal/util/e-util.h"
-#include "e-table-column-specification.h"
-
-static GObjectClass *etcs_parent_class;
-
-static void
-free_strings (ETableColumnSpecification *etcs)
-{
- g_free(etcs->title);
- etcs->title = NULL;
- g_free(etcs->pixbuf);
- etcs->pixbuf = NULL;
- g_free(etcs->cell);
- etcs->cell = NULL;
- g_free(etcs->compare);
- etcs->compare = NULL;
- g_free(etcs->search);
- etcs->search = NULL;
-}
-
-static void
-etcs_finalize (GObject *object)
-{
- ETableColumnSpecification *etcs = E_TABLE_COLUMN_SPECIFICATION (object);
-
- free_strings(etcs);
-
- etcs_parent_class->finalize (object);
-}
-
-static void
-etcs_class_init (GObjectClass *klass)
-{
- etcs_parent_class = g_type_class_peek_parent (klass);
-
- klass->finalize = etcs_finalize;
-}
-
-static void
-etcs_init (ETableColumnSpecification *specification)
-{
- specification->model_col = 0;
- specification->compare_col = 0;
- specification->title = g_strdup("");
- specification->pixbuf = NULL;
-
- specification->expansion = 0;
- specification->minimum_width = 0;
- specification->resizable = FALSE;
- specification->disabled = FALSE;
-
- specification->cell = NULL;
- specification->compare = NULL;
- specification->search = NULL;
- specification->priority = 0;
-}
-
-E_MAKE_TYPE(e_table_column_specification, "ETableColumnSpecification", ETableColumnSpecification, etcs_class_init, etcs_init, G_TYPE_OBJECT)
-
-ETableColumnSpecification *
-e_table_column_specification_new (void)
-{
- ETableColumnSpecification *etcs = g_object_new (E_TABLE_COLUMN_SPECIFICATION_TYPE, NULL);
-
- return (ETableColumnSpecification *) etcs;
-}
-
-void
-e_table_column_specification_load_from_node (ETableColumnSpecification *etcs,
- const xmlNode *node)
-{
- free_strings(etcs);
-
- etcs->model_col = e_xml_get_integer_prop_by_name (node, "model_col");
- etcs->compare_col = e_xml_get_integer_prop_by_name_with_default (node, "compare_col", etcs->model_col);
- etcs->title = e_xml_get_string_prop_by_name (node, "_title");
- etcs->pixbuf = e_xml_get_string_prop_by_name (node, "pixbuf");
-
- etcs->expansion = e_xml_get_double_prop_by_name (node, "expansion");
- etcs->minimum_width = e_xml_get_integer_prop_by_name (node, "minimum_width");
- etcs->resizable = e_xml_get_bool_prop_by_name (node, "resizable");
- etcs->disabled = e_xml_get_bool_prop_by_name (node, "disabled");
-
- etcs->cell = e_xml_get_string_prop_by_name (node, "cell");
- etcs->compare = e_xml_get_string_prop_by_name (node, "compare");
- etcs->search = e_xml_get_string_prop_by_name (node, "search");
- etcs->priority = e_xml_get_integer_prop_by_name_with_default (node, "priority", 0);
-
- if (etcs->title == NULL)
- etcs->title = g_strdup("");
-}
-
-xmlNode *
-e_table_column_specification_save_to_node (ETableColumnSpecification *specification,
- xmlNode *parent)
-{
- xmlNode *node;
- if (parent)
- node = xmlNewChild(parent, NULL, "ETableColumn", NULL);
- else
- node = xmlNewNode(NULL, "ETableColumn");
-
- e_xml_set_integer_prop_by_name(node, "model_col", specification->model_col);
- if (specification->compare_col != specification->model_col)
- e_xml_set_integer_prop_by_name(node, "compare_col", specification->compare_col);
- e_xml_set_string_prop_by_name(node, "_title", specification->title);
- e_xml_set_string_prop_by_name(node, "pixbuf", specification->pixbuf);
-
- e_xml_set_double_prop_by_name(node, "expansion", specification->expansion);
- e_xml_set_integer_prop_by_name(node, "minimum_width", specification->minimum_width);
- e_xml_set_bool_prop_by_name(node, "resizable", specification->resizable);
- e_xml_set_bool_prop_by_name(node, "disabled", specification->disabled);
-
- e_xml_set_string_prop_by_name(node, "cell", specification->cell);
- e_xml_set_string_prop_by_name(node, "compare", specification->compare);
- e_xml_set_string_prop_by_name(node, "search", specification->search);
- if (specification->priority != 0)
- e_xml_set_integer_prop_by_name (node, "priority", specification->priority);
-
- return node;
-}
-
diff --git a/widgets/table/e-table-column-specification.h b/widgets/table/e-table-column-specification.h
deleted file mode 100644
index 6bf5623398..0000000000
--- a/widgets/table/e-table-column-specification.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-table-column-specification.h
- * Copyright 2000, 2001, Ximian, Inc.
- *
- * Authors:
- * Chris Lahey <clahey@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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.
- */
-
-#ifndef _E_TABLE_COLUMN_SPECIFICATION_H_
-#define _E_TABLE_COLUMN_SPECIFICATION_H_
-
-#include <glib.h>
-#include <glib-object.h>
-#include <libxml/tree.h>
-
-G_BEGIN_DECLS
-
-#define E_TABLE_COLUMN_SPECIFICATION_TYPE (e_table_column_specification_get_type ())
-#define E_TABLE_COLUMN_SPECIFICATION(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), E_TABLE_COLUMN_SPECIFICATION_TYPE, ETableColumnSpecification))
-#define E_TABLE_COLUMN_SPECIFICATION_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), E_TABLE_COLUMN_SPECIFICATION_TYPE, ETableColumnSpecificationClass))
-#define E_IS_TABLE_COLUMN_SPECIFICATION(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), E_TABLE_COLUMN_SPECIFICATION_TYPE))
-#define E_IS_TABLE_COLUMN_SPECIFICATION_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), E_TABLE_COLUMN_SPECIFICATION_TYPE))
-#define E_TABLE_COLUMN_SPECIFICATION_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS((o), E_TABLE_COLUMN_SPECIFICATION_TYPE, ETableColumnSpecificationClass))
-
-typedef struct {
- GObject base;
- int model_col;
- int compare_col;
- char *title;
- char *pixbuf;
-
- double expansion;
- int minimum_width;
- guint resizable : 1;
- guint disabled : 1;
-
- char *cell;
- char *compare;
- char *search;
- int priority;
-} ETableColumnSpecification;
-
-typedef struct {
- GObjectClass parent_class;
-} ETableColumnSpecificationClass;
-
-GType e_table_column_specification_get_type (void);
-
-ETableColumnSpecification *e_table_column_specification_new (void);
-
-void e_table_column_specification_load_from_node (ETableColumnSpecification *state,
- const xmlNode *node);
-xmlNode *e_table_column_specification_save_to_node (ETableColumnSpecification *state,
- xmlNode *parent);
-
-G_END_DECLS
-
-#endif /* _E_TABLE_COLUMN_SPECIFICATION_H_ */
diff --git a/widgets/table/e-table-column.c b/widgets/table/e-table-column.c
deleted file mode 100644
index 514a25e74e..0000000000
--- a/widgets/table/e-table-column.c
+++ /dev/null
@@ -1,291 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-table-column.c
- * Copyright 2000, 2001, Ximian, Inc.
- *
- * Authors:
- * Chris Lahey <clahey@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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 "e-table-column.h"
-
-enum {
- STRUCTURE_CHANGE,
- DIMENSION_CHANGE,
- LAST_SIGNAL
-};
-
-static guint etc_signals [LAST_SIGNAL] = { 0, };
-
-#define PARENT_CLASS GTK_TYPE_OBJECT
-static GtkObjectClass *e_table_column_parent_class;
-
-static void
-e_table_column_finalize (GObject *object)
-{
- ETableColumn *etc = E_TABLE_COLUMN (object);
- const int cols = etc->col_count;
-
- /*
- * Destroy listeners
- */
- for (l = etc->listeners; l; l = l->next)
- g_free (l->data);
- g_slist_free (etc->listeners);
- etc->listeners = NULL;
-
- /*
- * Destroy columns
- */
- for (i = 0; i < cols; i++)
- e_table_column_remove (etc, i);
-
- G_OBJECT_CLASS (e_table_column_parent_class)->finalize (object);
-}
-
-static void
-e_table_column_class_init (GtkObjectClass *object_class)
-{
- G_OBJECT_CLASS (object_class)->finalize = e_table_column_finalize;
-
- e_table_column_parent_class = g_type_class_ref (PARENT_CLASS);
-
- etc_signals [STRUCTURE_CHANGE] =
- g_signal_new ("structure_change",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (ETableColumn, structure_change),
- NULL, NULL,
- e_marshal_NONE__NONE,
- G_TYPE_NONE, 0);
- etc_signals [DIMENSION_CHANGE] =
- g_signal_new ("dimension_change",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (ETableColumn, dimension_change),
- e_marshal_NONE__INT,
- G_TYPE_NONE, 1, G_TYPE_INT);
-}
-
-E_MAKE_TYPE (e_table_column,
- "ETableColumn",
- ETableColumn,
- e_table_column_class_init,
- NULL,
- PARENT_TYPE);
-
-static void
-etc_do_insert (ETableColumn *etc, int pos, ETableCol *val)
-{
- memcpy (&etc->columns [pos+1], &etc->columns [pos],
- sizeof (ETableCol *) * (etc->col_count - pos));
- etc->columns [pos] = val;
-}
-
-void
-e_table_column_add_column (ETableColumn *etc, ETableCol *tc, int pos)
-{
- ETableCol **new_ptr;
-
- g_return_if_fail (etc != NULL);
- g_return_if_fail (E_IS_TABLE_COLUMN (etc));
- g_return_if_fail (tc != NULL);
- g_return_if_fail (pos >= 0 && pos < etc->col_count);
-
- if (pos == -1)
- pos = etc->col_count;
- etc->columns = g_realloc (etc->columns, sizeof (ETableCol *) * (etc->col_count + 1));
- etc_do_insert (etc, pos, tc);
- etc->col_count++;
-
- g_signal_emit (etc, etc_signals [STRUCTURE_CHANGE], 0);
-}
-
-ETableCol *
-e_table_column_get_column (ETableColumn *etc, int column)
-{
- g_return_val_if_fail (etc != NULL, NULL);
- g_return_val_if_fail (E_IS_TABLE_COLUMN (etc), NULL);
-
- if (column < 0)
- return NULL;
-
- if (column >= etc->col_count)
- return NULL;
-
- return etc->columns [column];
-}
-
-int
-e_table_column_count (ETableColumn *etc)
-{
- g_return_val_if_fail (etc != NULL, 0);
- g_return_val_if_fail (E_IS_TABLE_COLUMN (etc), 0);
-
- return etc->col_count;
-}
-
-int
-e_table_column_index (ETableColumn *etc, const char *identifier)
-{
- int i;
-
- g_return_val_if_fail (etc != NULL, 0);
- g_return_val_if_fail (E_IS_TABLE_COLUMN (etc), 0);
- g_return_val_if_fail (identifier != NULL, 0);
-
- for (i = 0; i < etc->col_count; i++){
- ETableCol *tc = etc->columns [i];
-
- if (strcmp (i->id, identifier) == 0)
- return i;
- }
-
- return -1;
-}
-
-int
-e_table_column_get_index_at (ETableColumn *etc, int x_offset)
-{
- int i, total;
-
- g_return_val_if_fail (etc != NULL, 0);
- g_return_val_if_fail (E_IS_TABLE_COLUMN (etc), 0);
- g_return_val_if_fail (identifier != NULL, 0);
-
- total = 0;
- for (i = 0; i < etc->col_count; i++){
- total += etc->columns [i]->width;
-
- if (x_offset < total)
- return i;
- }
-
- return -1;
-}
-
-ETableCol **
-e_table_column_get_columns (ETableColumn *etc)
-{
- ETableCol **ret;
- int i;
-
- g_return_val_if_fail (etc != NULL, 0);
- g_return_val_if_fail (E_IS_TABLE_COLUMN (etc), 0);
-
- ret = g_new (ETableCol *, etc->col_count + 1);
- memcpy (ret, etc->columns, sizeof (ETableCol *) * etc->col_count);
- ret [etc->col_count] = NULL;
-
- return ret;
-}
-
-gboolean
-e_table_column_selection_ok (ETableColumn *etc)
-{
- g_return_val_if_fail (etc != NULL, FALSE);
- g_return_val_if_fail (E_IS_TABLE_COLUMN (etc), FALSE);
-
- return etc->selectable;
-}
-
-int
-ve_table_column_get_selected (ETableColumn *etc)
-{
- int i;
- int selected = 0;
-
- g_return_val_if_fail (etc != NULL, 0);
- g_return_val_if_fail (E_IS_TABLE_COLUMN (etc), 0);
-
- for (i = 0; i < etc->col_count; i++){
- if (etc->columns [i]->selected)
- selected++;
- }
-
- return selected;
-}
-
-int
-e_table_column_total_width (ETableColumn *etc)
-{
- int total;
-
- g_return_val_if_fail (etc != NULL, 0);
- g_return_val_if_fail (E_IS_TABLE_COLUMN (etc), 0);
-
- total = 0;
- for (i = 0; i < etc->col_count; i++)
- total += etc->columns [i].width;
-
- return total;
-}
-
-static void
-etc_do_remove (ETableColumn *etc, int idx)
-{
- memcpy (&etc->columns [idx], &etc->columns [idx+1],
- sizeof (ETableCol *) * etc->col_count - idx);
- etc->col_count--;
-}
-
-void
-e_table_column_move (ETableColumn *etc, int source_index, int target_index)
-{
- g_return_if_fail (etc != NULL);
- g_return_if_fail (E_IS_TABLE_COLUMN (etc));
- g_return_if_fail (source_index >= 0);
- g_return_if_fail (target_index >= 0);
- g_return_if_fail (source_index < etc->col_count);
- g_return_if_fail (target_index < etc->col_count);
-
- old = etc->columns [source_index];
- etc_do_remove (etc, source_index);
- etc_do_insert (etc, target_index, old);
- g_signal_emit (etc, etc_signals [STRUCTURE_CHANGE], 0);
-}
-
-void
-e_table_column_remove (ETableColumn *etc, int idx)
-{
- g_return_if_fail (etc != NULL);
- g_return_if_fail (E_IS_TABLE_COLUMN (etc));
- g_return_if_fail (idx >= 0);
- g_return_if_fail (idx < etc->col_count);
-
- etc_do_remove (etc, idx);
- g_signal_emit (etc, etc_signals [STRUCTURE_CHANGE], 0);
-}
-
-void
-e_table_column_set_selection (ETableColumn *etc, gboolean allow_selection);
-{
-}
-
-void
-e_table_column_set_size (ETableColumn *etc, int idx, int size)
-{
- g_return_if_fail (etc != NULL);
- g_return_if_fail (E_IS_TABLE_COLUMN (etc));
- g_return_if_fail (idx >= 0);
- g_return_if_fail (idx < etc->col_count);
- g_return_if_fail (size > 0);
-
- etc->columns [idx]->width = size;
- g_signal_emit (etc, etc_signals [SIZE_CHANGE], 0, idx);
-}
diff --git a/widgets/table/e-table-config-field.c b/widgets/table/e-table-config-field.c
deleted file mode 100644
index 7c23e10046..0000000000
--- a/widgets/table/e-table-config-field.c
+++ /dev/null
@@ -1,300 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-table-config-field.c
- * Copyright 2000, 2001, Ximian, Inc.
- *
- * Authors:
- * Chris Lahey <clahey@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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 <stdlib.h>
-#include <gtk/gtk.h>
-#include <gtk/gtkbox.h>
-#include "gal/util/e-util.h"
-#include "gal/util/e-i18n.h"
-#include "e-table-config-field.h"
-
-#define PARENT_TYPE (gtk_vbox_get_type())
-
-static GtkVBoxClass *etcf_parent_class;
-
-static void
-etcf_dispose (GObject *object)
-{
- ETableConfigField *etcf = E_TABLE_CONFIG_FIELD (object);
-
- if (etct->spec)
- g_object_unref (etcf->spec);
- etct->spec = NULL;
-
- if (etct->sort_info)
- g_object_unref (etcf->sort_info);
- etct->sort_info = NULL;
-
- G_OBJECT_CLASS (etcf_parent_class)->dispose (object);
-}
-
-static void
-etcf_class_init (GObjectClass *klass)
-{
- etcf_parent_class = g_type_class_ref (PARENT_TYPE);
-
- klass->dispose = etcf_dispose;
-}
-
-static void
-etcf_init (ETableConfigField *etcf)
-{
- etcf->spec = NULL;
- etcf->sort_info = NULL;
-
- etcf->combo = NULL;
- etcf->radio_ascending = NULL;
- etcf->radio_descending = NULL;
- etcf->child_fields = NULL;
-}
-
-E_MAKE_TYPE(e_table_config_field, "ETableConfigField", ETableConfigField, etcf_class_init, etcf_init, PARENT_TYPE)
-
-ETableConfigField *
-e_table_config_field_new (ETableSpecification *spec,
- ETableSortInfo *sort_info,
- gboolean grouping)
-{
- ETableConfigField *etcf = g_object_new (E_TABLE_CONFIG_FIELD_TYPE, NULL);
-
- e_table_config_field_construct (etcf, spec, sort_info, grouping);
-
- return (ETableConfigField *) etcf;
-}
-
-inline static int
-etcf_get_count (ETableConfigField *etcf)
-{
- if (etcf->grouping)
- return e_table_sort_info_grouping_get_count(etcf->sort_info);
- else
- return e_table_sort_info_sorting_get_count(etcf->sort_info);
-}
-
-inline static ETableSortColumn
-etcf_get_nth (ETableConfigField *etcf)
-{
- if (etcf->grouping)
- return e_table_sort_info_grouping_get_nth(etcf->sort_info, etcf->n);
- else
- return e_table_sort_info_sorting_get_nth(etcf->sort_info, etcf->n);
-}
-
-inline static void
-etcf_set_nth (ETableConfigField *etcf, ETableSortColumn column)
-{
- if (etcf->grouping)
- e_table_sort_info_grouping_set_nth(etcf->sort_info, etcf->n, column);
- else
- e_table_sort_info_sorting_set_nth(etcf->sort_info, etcf->n, column);
-}
-
-inline static void
-etcf_truncate (ETableConfigField *etcf)
-{
- if (etcf->grouping)
- e_table_sort_info_grouping_truncate(etcf->sort_info, etcf->n);
- else
- e_table_sort_info_sorting_truncate(etcf->sort_info, etcf->n);
-}
-
-static void
-etcf_set_sensitivity(ETableConfigField *etcf)
-{
- int count = etcf_get_count(etcf);
-
- if (etcf->n >= count) {
- gtk_widget_set_sensitive(etcf->radio_ascending, FALSE);
- gtk_widget_set_sensitive(etcf->radio_descending, FALSE);
- if (etcf->child_fields)
- gtk_widget_set_sensitive(etcf->child_fields, FALSE);
- } else {
- gtk_widget_set_sensitive(etcf->radio_ascending, TRUE);
- gtk_widget_set_sensitive(etcf->radio_descending, TRUE);
- if (etcf->child_fields)
- gtk_widget_set_sensitive(etcf->child_fields, TRUE);
- }
-}
-
-static void
-toggled(GtkWidget *widget, ETableConfigField *etcf)
-{
- int count;
-
- count = etcf_get_count(etcf);
- if (count > etcf->n) {
- ETableSortColumn sort_column;
-
- sort_column = etcf_get_nth(etcf);
- sort_column.ascending = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON(etcf->radio_ascending));
- etcf_set_nth(etcf, sort_column);
- }
-}
-
-static void
-changed(GtkWidget *widget, ETableConfigField *etcf)
-{
- ETableColumnSpecification **column;
- gchar *text;
-
- text = gtk_entry_get_text(GTK_ENTRY(GTK_COMBO(etcf->combo)->entry));
- for (column = etcf->spec->columns; *column; column++) {
- if (!strcmp((*column)->title_, text)) {
- ETableSortColumn sort_column;
-
- sort_column.ascending = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON(etcf->radio_ascending));
- sort_column.column = (*column)->model_col;
-
- etcf_set_nth(etcf, sort_column);
- etcf_set_sensitivity(etcf);
- return;
- }
- }
- etcf_truncate(etcf);
- etcf_set_sensitivity(etcf);
-}
-
-static void
-etcf_setup(ETableConfigField *etcf)
-{
- int count;
- GList *list = NULL;
- ETableColumnSpecification **column;
- ETableColumnSpecification *chosen_column = NULL;
- int model_col = -1;
-
- etcf_set_sensitivity(etcf);
-
- count = etcf_get_count(etcf);
-
- if (count > etcf->n) {
- ETableSortColumn sort_column;
-
- sort_column = etcf_get_nth(etcf);
- model_col = sort_column.column;
- if (sort_column.ascending)
- gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(etcf->radio_ascending), TRUE);
- else
- gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(etcf->radio_descending), TRUE);
- }
-
- for (column = etcf->spec->columns; *column; column++) {
- list = g_list_prepend(list, (*column)->title_);
- if (count > etcf->n && chosen_column == NULL && (*column)->model_col == model_col) {
- chosen_column = *column;
- }
- }
- list = g_list_reverse(list);
- list = g_list_prepend(list, "None");
-
- gtk_combo_set_popdown_strings(GTK_COMBO(etcf->combo), list);
- g_list_free(list);
-
- if (chosen_column) {
- gtk_entry_set_text(GTK_ENTRY(GTK_COMBO(etcf->combo)->entry), chosen_column->title_);
- } else {
- gtk_entry_set_text(GTK_ENTRY(GTK_COMBO(etcf->combo)->entry), "None");
- }
-
- g_signal_connect(GTK_COMBO(etcf->combo)->entry, "changed",
- G_CALLBACK (changed), etcf);
- g_signal_connect(etcf->radio_ascending, "toggled",
- G_CALLBACK (toggled), etcf);
- g_signal_connect(etcf->radio_descending, "toggled",
- G_CALLBACK (toggled), etcf);
-}
-
-static ETableConfigField *
-e_table_config_field_construct_nth (ETableConfigField *etcf,
- ETableSpecification *spec,
- ETableSortInfo *sort_info,
- gboolean grouping,
- int n)
-{
- GtkWidget *frame;
- GtkWidget *internal_hbox;
- GtkWidget *internal_vbox1;
- GtkWidget *internal_vbox2;
-
- etcf->spec = spec;
- g_object_ref (spec);
-
- etcf->sort_info = sort_info;
- g_object_ref (sort_info);
-
- etcf->grouping = grouping;
- etcf->n = n;
-
- gtk_box_set_spacing(GTK_BOX(etcf), 6);
-
- frame = gtk_frame_new(n > 0 ? _("Then By") : (grouping ? _("Group By") : _("Sort By")));
- gtk_box_pack_start(GTK_BOX(etcf), frame, FALSE, FALSE, 0);
-
- internal_hbox = gtk_hbox_new(FALSE, 6);
- gtk_container_add(GTK_CONTAINER(frame), internal_hbox);
- gtk_container_set_border_width(GTK_CONTAINER(internal_hbox), 6);
-
- internal_vbox1 = gtk_vbox_new(FALSE, 6);
- gtk_box_pack_start(GTK_BOX(internal_hbox), internal_vbox1, FALSE, FALSE, 0);
-
- etcf->combo = gtk_combo_new();
- gtk_box_pack_start(GTK_BOX(internal_vbox1), etcf->combo, FALSE, FALSE, 0);
-
- internal_vbox2 = gtk_vbox_new(FALSE, 6);
- gtk_box_pack_start(GTK_BOX(internal_hbox), internal_vbox2, FALSE, FALSE, 0);
-
- etcf->radio_ascending = gtk_radio_button_new_with_label (NULL, _("Ascending"));
- gtk_box_pack_start(GTK_BOX(internal_vbox2), etcf->radio_ascending, FALSE, FALSE, 0);
-
- etcf->radio_descending = gtk_radio_button_new_with_label_from_widget (GTK_RADIO_BUTTON(etcf->radio_ascending), _("Descending"));
- gtk_box_pack_start(GTK_BOX(internal_vbox2), etcf->radio_descending, FALSE, FALSE, 0);
-
- if (n < 3) {
- etcf->child_fields = GTK_WIDGET(g_object_new (E_TABLE_CONFIG_FIELD_TYPE, NULL));
- e_table_config_field_construct_nth(E_TABLE_CONFIG_FIELD(etcf->child_fields), spec, sort_info, grouping, n + 1);
- gtk_box_pack_start(GTK_BOX(etcf), etcf->child_fields, FALSE, FALSE, 0);
- gtk_widget_show(etcf->child_fields);
- } else
- etcf->child_fields = NULL;
-
- etcf_setup(etcf);
-
- gtk_widget_show(etcf->radio_descending);
- gtk_widget_show(etcf->radio_ascending);
- gtk_widget_show(internal_vbox2);
- gtk_widget_show(etcf->combo);
- gtk_widget_show(internal_vbox1);
- gtk_widget_show(internal_hbox);
- gtk_widget_show(frame);
- return etcf;
-}
-
-ETableConfigField *
-e_table_config_field_construct (ETableConfigField *etcf,
- ETableSpecification *spec,
- ETableSortInfo *sort_info,
- gboolean grouping)
-{
- return e_table_config_field_construct_nth(etcf, spec, sort_info, grouping, 0);
-}
diff --git a/widgets/table/e-table-config-field.h b/widgets/table/e-table-config-field.h
deleted file mode 100644
index bb8f540c4a..0000000000
--- a/widgets/table/e-table-config-field.h
+++ /dev/null
@@ -1,69 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-table-config-field.h
- * Copyright 2000, 2001, Ximian, Inc.
- *
- * Authors:
- * Chris Lahey <clahey@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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.
- */
-
-#ifndef _E_TABLE_CONFIG_FIELD_H_
-#define _E_TABLE_CONFIG_FIELD_H_
-
-#include <gtk/gtkvbox.h>
-#include <gal/e-table/e-table-sort-info.h>
-#include <gal/e-table/e-table-specification.h>
-
-G_BEGIN_DECLS
-
-#define E_TABLE_CONFIG_FIELD_TYPE (e_table_config_field_get_type ())
-#define E_TABLE_CONFIG_FIELD(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), E_TABLE_CONFIG_FIELD_TYPE, ETableConfigField))
-#define E_TABLE_CONFIG_FIELD_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), E_TABLE_CONFIG_FIELD_TYPE, ETableConfigFieldClass))
-#define E_IS_TABLE_CONFIG_FIELD(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), E_TABLE_CONFIG_FIELD_TYPE))
-#define E_IS_TABLE_CONFIG_FIELD_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), E_TABLE_CONFIG_FIELD_TYPE))
-
-typedef struct {
- GtkVBox base;
-
- ETableSpecification *spec;
- ETableSortInfo *sort_info;
- guint grouping : 1;
- int n;
-
- GtkWidget *combo;
- GtkWidget *radio_ascending;
- GtkWidget *radio_descending;
-
- GtkWidget *child_fields;
-} ETableConfigField;
-
-typedef struct {
- GtkVBoxClass parent_class;
-} ETableConfigFieldClass;
-
-GType e_table_config_field_get_type (void);
-ETableConfigField *e_table_config_field_new (ETableSpecification *spec,
- ETableSortInfo *sort_info,
- gboolean grouping);
-ETableConfigField *e_table_config_field_construct (ETableConfigField *field,
- ETableSpecification *spec,
- ETableSortInfo *sort_info,
- gboolean grouping);
-
-G_END_DECLS
-
-#endif /* _E_TABLE_CONFIG_FIELD_H_ */
diff --git a/widgets/table/e-table-config-no-group.glade b/widgets/table/e-table-config-no-group.glade
deleted file mode 100644
index 5ba0b329ab..0000000000
--- a/widgets/table/e-table-config-no-group.glade
+++ /dev/null
@@ -1,2039 +0,0 @@
-<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*-->
-<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd">
-
-<glade-interface>
-
-<widget class="GtkDialog" id="dialog-show-fields">
- <property name="title" translatable="yes">Show Fields</property>
- <property name="type">GTK_WINDOW_TOPLEVEL</property>
- <property name="window_position">GTK_WIN_POS_NONE</property>
- <property name="modal">False</property>
- <property name="resizable">True</property>
- <property name="destroy_with_parent">False</property>
- <property name="has_separator">True</property>
-
- <child internal-child="vbox">
- <widget class="GtkVBox" id="dialog-vbox3">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">8</property>
-
- <child internal-child="action_area">
- <widget class="GtkHButtonBox" id="dialog-action_area3">
- <property name="visible">True</property>
- <property name="layout_style">GTK_BUTTONBOX_END</property>
-
- <child>
- <widget class="GtkButton" id="button20">
- <property name="visible">True</property>
- <property name="can_default">True</property>
- <property name="can_focus">True</property>
- <property name="label">gtk-ok</property>
- <property name="use_stock">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="response_id">0</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkButton" id="button22">
- <property name="visible">True</property>
- <property name="can_default">True</property>
- <property name="can_focus">True</property>
- <property name="label">gtk-cancel</property>
- <property name="use_stock">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="response_id">0</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="pack_type">GTK_PACK_END</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkVBox" id="vbox2">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">6</property>
-
- <child>
- <widget class="GtkTable" id="table2">
- <property name="visible">True</property>
- <property name="n_rows">1</property>
- <property name="n_columns">5</property>
- <property name="homogeneous">True</property>
- <property name="row_spacing">6</property>
- <property name="column_spacing">6</property>
-
- <child>
- <widget class="GtkLabel" id="label-available">
- <property name="visible">True</property>
- <property name="label" translatable="yes">A_vailable Fields:</property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">2</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label-displayed">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Sh_ow these fields in order:</property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="left_attach">3</property>
- <property name="right_attach">5</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkTable" id="table3">
- <property name="visible">True</property>
- <property name="n_rows">1</property>
- <property name="n_columns">5</property>
- <property name="homogeneous">True</property>
- <property name="row_spacing">6</property>
- <property name="column_spacing">6</property>
-
- <child>
- <widget class="GtkVBox" id="vbox4">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">6</property>
-
- <child>
- <widget class="Custom" id="custom-available">
- <property name="visible">True</property>
- <property name="creation_function">e_table_proxy_etable_available_new</property>
- <property name="int1">0</property>
- <property name="int2">0</property>
- <property name="last_modification_time">Thu, 21 Feb 2002 05:42:43 GMT</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">2</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkVBox" id="vbox5">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">6</property>
-
- <child>
- <widget class="Custom" id="custom-shown">
- <property name="visible">True</property>
- <property name="creation_function">e_table_proxy_etable_shown_new</property>
- <property name="int1">0</property>
- <property name="int2">0</property>
- <property name="last_modification_time">Thu, 21 Feb 2002 15:52:40 GMT</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkHBox" id="hbox4">
- <property name="visible">True</property>
- <property name="homogeneous">True</property>
- <property name="spacing">6</property>
-
- <child>
- <widget class="GtkButton" id="button-up">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">Move _Up</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkButton" id="button-down">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">Move _Down</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">True</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">True</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="left_attach">3</property>
- <property name="right_attach">5</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkVBox" id="vbox6">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">6</property>
-
- <child>
- <widget class="GtkButton" id="button-add">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">_Add -&gt;</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkButton" id="button-remove">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">&lt;- _Remove</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <placeholder/>
- </child>
- </widget>
- <packing>
- <property name="left_attach">2</property>
- <property name="right_attach">3</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
- </widget>
- </child>
-</widget>
-
-<widget class="GtkDialog" id="dialog-group-by">
- <property name="title" translatable="yes">Group</property>
- <property name="type">GTK_WINDOW_TOPLEVEL</property>
- <property name="window_position">GTK_WIN_POS_NONE</property>
- <property name="modal">False</property>
- <property name="resizable">True</property>
- <property name="destroy_with_parent">False</property>
- <property name="has_separator">True</property>
-
- <child internal-child="vbox">
- <widget class="GtkVBox" id="dialog-vbox4">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">8</property>
-
- <child internal-child="action_area">
- <widget class="GtkHButtonBox" id="dialog-action_area4">
- <property name="visible">True</property>
- <property name="layout_style">GTK_BUTTONBOX_END</property>
-
- <child>
- <widget class="GtkButton" id="button39">
- <property name="visible">True</property>
- <property name="can_default">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">Clear All</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="response_id">0</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkButton" id="button41">
- <property name="visible">True</property>
- <property name="can_default">True</property>
- <property name="can_focus">True</property>
- <property name="label">gtk-ok</property>
- <property name="use_stock">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="response_id">0</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkButton" id="button42">
- <property name="visible">True</property>
- <property name="can_default">True</property>
- <property name="can_focus">True</property>
- <property name="label">gtk-cancel</property>
- <property name="use_stock">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="response_id">0</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="pack_type">GTK_PACK_END</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkVBox" id="vbox24">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">0</property>
-
- <child>
- <widget class="GtkHBox" id="hbox13">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">6</property>
-
- <child>
- <widget class="GtkFrame" id="frame-group-1">
- <property name="visible">True</property>
- <property name="label_xalign">0</property>
- <property name="label_yalign">0.5</property>
- <property name="shadow_type">GTK_SHADOW_ETCHED_IN</property>
-
- <child>
- <widget class="GtkHBox" id="hbox5">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">6</property>
-
- <child>
- <widget class="GtkVBox" id="vbox7">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">0</property>
-
- <child>
- <widget class="Custom" id="group-combo-1">
- <property name="visible">True</property>
- <property name="creation_function">e_table_proxy_gtk_combo_text_new</property>
- <property name="int1">0</property>
- <property name="int2">0</property>
- <property name="last_modification_time">Fri, 19 Jan 2001 04:52:09 GMT</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkCheckButton" id="checkbutton-group-1">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">Show field in View</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="active">False</property>
- <property name="inconsistent">False</property>
- <property name="draw_indicator">True</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkVBox" id="vbox8">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">0</property>
-
- <child>
- <widget class="GtkRadioButton" id="radiobutton-ascending-group-1">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">Ascending</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="active">False</property>
- <property name="inconsistent">False</property>
- <property name="draw_indicator">True</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkRadioButton" id="radiobutton-descending-group-1">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">Descending</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="active">False</property>
- <property name="inconsistent">False</property>
- <property name="draw_indicator">True</property>
- <property name="group">radiobutton-ascending-group-1</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">True</property>
- </packing>
- </child>
- </widget>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label1">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Group Items By</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="type">label_item</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label8">
- <property name="visible">True</property>
- <property name="label" translatable="yes"></property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label9">
- <property name="visible">True</property>
- <property name="label" translatable="yes"></property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label10">
- <property name="visible">True</property>
- <property name="label" translatable="yes"></property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkHBox" id="hbox14">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">6</property>
-
- <child>
- <widget class="GtkLabel" id="label11">
- <property name="visible">True</property>
- <property name="label" translatable="yes"></property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkFrame" id="frame-group-2">
- <property name="visible">True</property>
- <property name="label_xalign">0</property>
- <property name="label_yalign">0.5</property>
- <property name="shadow_type">GTK_SHADOW_ETCHED_IN</property>
-
- <child>
- <widget class="GtkHBox" id="hbox6">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">6</property>
-
- <child>
- <widget class="GtkVBox" id="vbox9">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">0</property>
-
- <child>
- <widget class="Custom" id="group-combo-2">
- <property name="visible">True</property>
- <property name="creation_function">e_table_proxy_gtk_combo_text_new</property>
- <property name="int1">0</property>
- <property name="int2">0</property>
- <property name="last_modification_time">Fri, 19 Jan 2001 04:52:14 GMT</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkCheckButton" id="checkbutton-group-2">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">Show field in View</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="active">False</property>
- <property name="inconsistent">False</property>
- <property name="draw_indicator">True</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkVBox" id="vbox10">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">0</property>
-
- <child>
- <widget class="GtkRadioButton" id="radiobutton-ascending-group-2">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">Ascending</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="active">False</property>
- <property name="inconsistent">False</property>
- <property name="draw_indicator">True</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkRadioButton" id="radiobutton-descending-group-2">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">Descending</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="active">False</property>
- <property name="inconsistent">False</property>
- <property name="draw_indicator">True</property>
- <property name="group">radiobutton-ascending-group-2</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">True</property>
- </packing>
- </child>
- </widget>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label12">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Then By</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="type">label_item</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label19">
- <property name="visible">True</property>
- <property name="label" translatable="yes"></property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label18">
- <property name="visible">True</property>
- <property name="label" translatable="yes"></property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkHBox" id="hbox15">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">6</property>
-
- <child>
- <widget class="GtkLabel" id="label13">
- <property name="visible">True</property>
- <property name="label" translatable="yes"></property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label12">
- <property name="visible">True</property>
- <property name="label" translatable="yes"></property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkFrame" id="frame-group-3">
- <property name="visible">True</property>
- <property name="label_xalign">0</property>
- <property name="label_yalign">0.5</property>
- <property name="shadow_type">GTK_SHADOW_ETCHED_IN</property>
-
- <child>
- <widget class="GtkHBox" id="hbox7">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">6</property>
-
- <child>
- <widget class="GtkVBox" id="vbox11">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">0</property>
-
- <child>
- <widget class="Custom" id="group-combo-3">
- <property name="visible">True</property>
- <property name="creation_function">e_table_proxy_gtk_combo_text_new</property>
- <property name="int1">0</property>
- <property name="int2">0</property>
- <property name="last_modification_time">Fri, 19 Jan 2001 04:52:18 GMT</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkCheckButton" id="checkbutton-group-3">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">Show field in View</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="active">False</property>
- <property name="inconsistent">False</property>
- <property name="draw_indicator">True</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkVBox" id="vbox12">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">0</property>
-
- <child>
- <widget class="GtkRadioButton" id="radiobutton-ascending-group-3">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">Ascending</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="active">False</property>
- <property name="inconsistent">False</property>
- <property name="draw_indicator">True</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkRadioButton" id="radiobutton-descending-group-3">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">Descending</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="active">False</property>
- <property name="inconsistent">False</property>
- <property name="draw_indicator">True</property>
- <property name="group">radiobutton-ascending-group-3</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">True</property>
- </packing>
- </child>
- </widget>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label20">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Then By</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="type">label_item</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label17">
- <property name="visible">True</property>
- <property name="label" translatable="yes"></property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkHBox" id="hbox16">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">6</property>
-
- <child>
- <widget class="GtkLabel" id="label14">
- <property name="visible">True</property>
- <property name="label" translatable="yes"></property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label16">
- <property name="visible">True</property>
- <property name="label" translatable="yes"></property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label15">
- <property name="visible">True</property>
- <property name="label" translatable="yes"></property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkFrame" id="frame-group-4">
- <property name="visible">True</property>
- <property name="label_xalign">0</property>
- <property name="label_yalign">0.5</property>
- <property name="shadow_type">GTK_SHADOW_ETCHED_IN</property>
-
- <child>
- <widget class="GtkHBox" id="hbox8">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">6</property>
-
- <child>
- <widget class="GtkVBox" id="vbox13">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">0</property>
-
- <child>
- <widget class="Custom" id="group-combo-4">
- <property name="visible">True</property>
- <property name="creation_function">e_table_proxy_gtk_combo_text_new</property>
- <property name="int1">0</property>
- <property name="int2">0</property>
- <property name="last_modification_time">Fri, 19 Jan 2001 04:52:21 GMT</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkCheckButton" id="checkbutton-group-4">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">Show field in View</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="active">False</property>
- <property name="inconsistent">False</property>
- <property name="draw_indicator">True</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkVBox" id="vbox14">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">0</property>
-
- <child>
- <widget class="GtkRadioButton" id="radiobutton-ascending-group-4">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">Ascending</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="active">False</property>
- <property name="inconsistent">False</property>
- <property name="draw_indicator">True</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkRadioButton" id="radiobutton-descending-group-4">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">Descending</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="active">False</property>
- <property name="inconsistent">False</property>
- <property name="draw_indicator">True</property>
- <property name="group">radiobutton-ascending-group-4</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">True</property>
- </packing>
- </child>
- </widget>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label21">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Then By</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="type">label_item</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
- </widget>
- </child>
-</widget>
-
-<widget class="GtkDialog" id="dialog-sort">
- <property name="title" translatable="yes">Sort</property>
- <property name="type">GTK_WINDOW_TOPLEVEL</property>
- <property name="window_position">GTK_WIN_POS_NONE</property>
- <property name="modal">False</property>
- <property name="resizable">True</property>
- <property name="destroy_with_parent">False</property>
- <property name="has_separator">True</property>
-
- <child internal-child="vbox">
- <widget class="GtkVBox" id="vbox15">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">8</property>
-
- <child internal-child="action_area">
- <widget class="GtkHButtonBox" id="hbuttonbox1">
- <property name="visible">True</property>
- <property name="layout_style">GTK_BUTTONBOX_END</property>
-
- <child>
- <widget class="GtkButton" id="button43">
- <property name="visible">True</property>
- <property name="can_default">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">Clear All</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="response_id">0</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkButton" id="button44">
- <property name="visible">True</property>
- <property name="can_default">True</property>
- <property name="has_default">True</property>
- <property name="can_focus">True</property>
- <property name="label">gtk-ok</property>
- <property name="use_stock">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="response_id">0</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkButton" id="button45">
- <property name="visible">True</property>
- <property name="can_default">True</property>
- <property name="can_focus">True</property>
- <property name="label">gtk-cancel</property>
- <property name="use_stock">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="response_id">0</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="pack_type">GTK_PACK_END</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkTable" id="table5">
- <property name="visible">True</property>
- <property name="n_rows">4</property>
- <property name="n_columns">1</property>
- <property name="homogeneous">False</property>
- <property name="row_spacing">6</property>
- <property name="column_spacing">6</property>
-
- <child>
- <widget class="GtkFrame" id="frame-sort-4">
- <property name="visible">True</property>
- <property name="label_xalign">0</property>
- <property name="label_yalign">0.5</property>
- <property name="shadow_type">GTK_SHADOW_ETCHED_IN</property>
-
- <child>
- <widget class="GtkHBox" id="hbox9">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">6</property>
-
- <child>
- <widget class="GtkAlignment" id="alignment1">
- <property name="visible">True</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xscale">1</property>
- <property name="yscale">0</property>
-
- <child>
- <widget class="Custom" id="sort-combo-4">
- <property name="visible">True</property>
- <property name="creation_function">e_table_proxy_gtk_combo_text_new</property>
- <property name="int1">0</property>
- <property name="int2">0</property>
- <property name="last_modification_time">Tue, 16 Jan 2001 08:33:52 GMT</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkVBox" id="vbox17">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">0</property>
-
- <child>
- <widget class="GtkRadioButton" id="radiobutton-ascending-sort-4">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">Ascending</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="active">False</property>
- <property name="inconsistent">False</property>
- <property name="draw_indicator">True</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkRadioButton" id="radiobutton-descending-sort-4">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">Descending</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="active">False</property>
- <property name="inconsistent">False</property>
- <property name="draw_indicator">True</property>
- <property name="group">radiobutton-ascending-sort-4</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">True</property>
- </packing>
- </child>
- </widget>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label22">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Then By</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="type">label_item</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">3</property>
- <property name="bottom_attach">4</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkFrame" id="frame-sort-3">
- <property name="visible">True</property>
- <property name="label_xalign">0</property>
- <property name="label_yalign">0.5</property>
- <property name="shadow_type">GTK_SHADOW_ETCHED_IN</property>
-
- <child>
- <widget class="GtkHBox" id="hbox10">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">6</property>
-
- <child>
- <widget class="GtkAlignment" id="alignment2">
- <property name="visible">True</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xscale">1</property>
- <property name="yscale">0</property>
-
- <child>
- <widget class="Custom" id="sort-combo-3">
- <property name="visible">True</property>
- <property name="creation_function">e_table_proxy_gtk_combo_text_new</property>
- <property name="int1">0</property>
- <property name="int2">0</property>
- <property name="last_modification_time">Tue, 16 Jan 2001 05:22:22 GMT</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkVBox" id="vbox19">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">0</property>
-
- <child>
- <widget class="GtkRadioButton" id="radiobutton-ascending-sort-3">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">Ascending</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="active">False</property>
- <property name="inconsistent">False</property>
- <property name="draw_indicator">True</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkRadioButton" id="radiobutton-descending-sort-3">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">Descending</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="active">False</property>
- <property name="inconsistent">False</property>
- <property name="draw_indicator">True</property>
- <property name="group">radiobutton-ascending-sort-3</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">True</property>
- </packing>
- </child>
- </widget>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label23">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Then By</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="type">label_item</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">2</property>
- <property name="bottom_attach">3</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkFrame" id="frame-sort-2">
- <property name="visible">True</property>
- <property name="label_xalign">0</property>
- <property name="label_yalign">0.5</property>
- <property name="shadow_type">GTK_SHADOW_ETCHED_IN</property>
-
- <child>
- <widget class="GtkHBox" id="hbox11">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">6</property>
-
- <child>
- <widget class="GtkAlignment" id="alignment3">
- <property name="visible">True</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xscale">1</property>
- <property name="yscale">0</property>
-
- <child>
- <widget class="Custom" id="sort-combo-2">
- <property name="visible">True</property>
- <property name="creation_function">e_table_proxy_gtk_combo_text_new</property>
- <property name="int1">0</property>
- <property name="int2">0</property>
- <property name="last_modification_time">Tue, 16 Jan 2001 05:22:15 GMT</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkVBox" id="vbox21">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">0</property>
-
- <child>
- <widget class="GtkRadioButton" id="radiobutton-ascending-sort-2">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">Ascending</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="active">False</property>
- <property name="inconsistent">False</property>
- <property name="draw_indicator">True</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkRadioButton" id="radiobutton-descending-sort-2">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">Descending</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="active">False</property>
- <property name="inconsistent">False</property>
- <property name="draw_indicator">True</property>
- <property name="group">radiobutton-ascending-sort-2</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">True</property>
- </packing>
- </child>
- </widget>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label24">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Then By</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="type">label_item</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkFrame" id="frame-sort-1">
- <property name="visible">True</property>
- <property name="label_xalign">0</property>
- <property name="label_yalign">0.5</property>
- <property name="shadow_type">GTK_SHADOW_ETCHED_IN</property>
-
- <child>
- <widget class="GtkHBox" id="hbox12">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">6</property>
-
- <child>
- <widget class="GtkAlignment" id="alignment4">
- <property name="visible">True</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xscale">1</property>
- <property name="yscale">0</property>
-
- <child>
- <widget class="Custom" id="sort-combo-1">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="has_focus">True</property>
- <property name="creation_function">e_table_proxy_gtk_combo_text_new</property>
- <property name="int1">0</property>
- <property name="int2">0</property>
- <property name="last_modification_time">Tue, 16 Jan 2001 05:22:00 GMT</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkVBox" id="vbox23">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">0</property>
-
- <child>
- <widget class="GtkRadioButton" id="radiobutton-ascending-sort-1">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">Ascending</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="active">False</property>
- <property name="inconsistent">False</property>
- <property name="draw_indicator">True</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkRadioButton" id="radiobutton-descending-sort-1">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">Descending</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="active">False</property>
- <property name="inconsistent">False</property>
- <property name="draw_indicator">True</property>
- <property name="group">radiobutton-ascending-sort-1</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">True</property>
- </packing>
- </child>
- </widget>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label25">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Sort Items By</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="type">label_item</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
- </widget>
- </child>
-</widget>
-
-<widget class="GtkDialog" id="e-table-config">
- <property name="visible">True</property>
- <property name="title" translatable="yes">dialog1</property>
- <property name="type">GTK_WINDOW_TOPLEVEL</property>
- <property name="window_position">GTK_WIN_POS_NONE</property>
- <property name="modal">True</property>
- <property name="resizable">True</property>
- <property name="destroy_with_parent">False</property>
- <property name="has_separator">True</property>
-
- <child internal-child="vbox">
- <widget class="GtkVBox" id="dialog-vbox5">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">0</property>
-
- <child internal-child="action_area">
- <widget class="GtkHButtonBox" id="dialog-action_area5">
- <property name="visible">True</property>
- <property name="layout_style">GTK_BUTTONBOX_END</property>
-
- <child>
- <widget class="GtkButton" id="cancelbutton1">
- <property name="visible">True</property>
- <property name="can_default">True</property>
- <property name="can_focus">True</property>
- <property name="label">gtk-cancel</property>
- <property name="use_stock">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="response_id">-6</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkButton" id="applybutton1">
- <property name="visible">True</property>
- <property name="can_default">True</property>
- <property name="can_focus">True</property>
- <property name="label">gtk-apply</property>
- <property name="use_stock">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="response_id">-10</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkButton" id="okbutton1">
- <property name="visible">True</property>
- <property name="can_default">True</property>
- <property name="can_focus">True</property>
- <property name="label">gtk-ok</property>
- <property name="use_stock">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="response_id">-5</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="pack_type">GTK_PACK_END</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkFrame" id="top-frame">
- <property name="border_width">2</property>
- <property name="visible">True</property>
- <property name="label_xalign">0</property>
- <property name="label_yalign">0.5</property>
- <property name="shadow_type">GTK_SHADOW_ETCHED_IN</property>
-
- <child>
- <widget class="GtkTable" id="table1">
- <property name="border_width">2</property>
- <property name="visible">True</property>
- <property name="n_rows">2</property>
- <property name="n_columns">3</property>
- <property name="homogeneous">False</property>
- <property name="row_spacing">2</property>
- <property name="column_spacing">4</property>
-
- <child>
- <widget class="GtkButton" id="button-sort">
- <property name="visible">True</property>
- <property name="can_default">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">_Sort...</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <signal name="clicked" handler="on_sort_clicked"/>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label-sort">
- <property name="visible">True</property>
- <property name="label" translatable="yes"></property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">True</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label4">
- <property name="visible">True</property>
- <property name="label" translatable="yes"></property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="left_attach">2</property>
- <property name="right_attach">3</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label21">
- <property name="visible">True</property>
- <property name="label" translatable="yes"></property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="left_attach">2</property>
- <property name="right_attach">3</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label-fields">
- <property name="visible">True</property>
- <property name="label" translatable="yes"></property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">True</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkButton" id="button-fields">
- <property name="visible">True</property>
- <property name="can_default">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">_Fields Shown...</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <signal name="clicked" handler="on_sort_clicked"/>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
- </packing>
- </child>
- </widget>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label26">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Description</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="type">label_item</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
- </widget>
- </child>
-</widget>
-
-</glade-interface>
diff --git a/widgets/table/e-table-config.c b/widgets/table/e-table-config.c
deleted file mode 100644
index af6e2bee8c..0000000000
--- a/widgets/table/e-table-config.c
+++ /dev/null
@@ -1,1181 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-table-config.c
- * Copyright 2000, 2001, Ximian, Inc.
- *
- * Authors:
- * Chris Lahey <clahey@ximian.com>
- * Miguel de Icaza <miguel@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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.
- */
-/*
- * FIXME:
- * Sort Dialog: when text is selected, the toggle button switches state.
- * Make Clear all work.
- */
-
-#include <config.h>
-
-#include "e-table-config.h"
-
-#include <stdlib.h>
-#include <string.h>
-#include <gtk/gtkdialog.h>
-#include <gtk/gtkentry.h>
-#include <gtk/gtklabel.h>
-#include <gtk/gtktogglebutton.h>
-#include <libgnomeui/gnome-propertybox.h>
-#include <glade/glade.h>
-#include "gal/util/e-util.h"
-#include "gal/util/e-i18n.h"
-#include "gal/widgets/e-unicode.h"
-
-#include <e-table-scrolled.h>
-#include <e-table-without.h>
-#include <e-table-memory-store.h>
-
-
-static GObjectClass *config_parent_class;
-
-enum {
- CHANGED,
- LAST_SIGNAL
-};
-
-enum {
- PROP_0,
- PROP_STATE,
-};
-
-static guint e_table_config_signals [LAST_SIGNAL] = { 0, };
-
-static void
-config_finalize (GObject *object)
-{
- ETableConfig *config = E_TABLE_CONFIG (object);
-
- if (config->state)
- g_object_unref (config->state);
- config->state = NULL;
-
- if (config->source_state)
- g_object_unref (config->source_state);
- config->source_state = NULL;
-
- if (config->source_spec)
- g_object_unref (config->source_spec);
- config->source_spec = NULL;
-
- g_free (config->header);
- config->header = NULL;
-
- g_slist_free (config->column_names);
- config->column_names = NULL;
-
- g_free (config->domain);
- config->domain = NULL;
-
- config_parent_class->finalize (object);
-}
-
-static void
-e_table_config_changed (ETableConfig *config, ETableState *state)
-{
- g_return_if_fail (config != NULL);
- g_return_if_fail (E_IS_TABLE_CONFIG (config));
-
-
- g_signal_emit(G_OBJECT(config), e_table_config_signals [CHANGED], 0, state);
-}
-
-static void
-config_dialog_changed (ETableConfig *config)
-{
- /* enable the apply/ok buttons */
- gtk_dialog_set_response_sensitive (GTK_DIALOG (config->dialog_toplevel),
- GTK_RESPONSE_APPLY, TRUE);
- gtk_dialog_set_response_sensitive (GTK_DIALOG (config->dialog_toplevel),
- GTK_RESPONSE_OK, TRUE);
-}
-
-static void
-config_get_property (GObject *object,
- guint prop_id,
- GValue *value,
- GParamSpec *pspec)
-{
- ETableConfig *config = E_TABLE_CONFIG (object);
-
- switch (prop_id) {
- case PROP_STATE:
- g_value_set_object (value, config->state);
- break;
- default:
- break;
- }
-}
-
-static void
-config_class_init (GObjectClass *object_class)
-{
- ETableConfigClass *klass = E_TABLE_CONFIG_CLASS(object_class);
-
- config_parent_class = g_type_class_peek_parent (klass);
-
- klass->changed = NULL;
-
- object_class->finalize = config_finalize;
- object_class->get_property = config_get_property;
-
- e_table_config_signals [CHANGED] =
- g_signal_new ("changed",
- E_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (ETableConfigClass, changed),
- (GSignalAccumulator) NULL, NULL,
- g_cclosure_marshal_VOID__VOID,
- G_TYPE_NONE, 0);
-
- g_object_class_install_property (object_class, PROP_STATE,
- g_param_spec_object ("state",
- _("State"),
- /*_( */"XXX blurb" /*)*/,
- E_TABLE_STATE_TYPE,
- G_PARAM_READABLE));
-
- glade_init ();
-}
-
-static ETableColumnSpecification *
-find_column_in_spec (ETableSpecification *spec, int model_col)
-{
- ETableColumnSpecification **column;
-
- for (column = spec->columns; *column; column++){
- if ((*column)->disabled)
- continue;
- if ((*column)->model_col != model_col)
- continue;
-
- return *column;
- }
-
- return NULL;
-}
-
-static int
-find_model_column_by_name (ETableSpecification *spec, const char *s)
-{
- ETableColumnSpecification **column;
-
- for (column = spec->columns; *column; column++){
-
- if ((*column)->disabled)
- continue;
- if (g_strcasecmp ((*column)->title, s) == 0)
- return (*column)->model_col;
- }
- return -1;
-}
-
-static void
-update_sort_and_group_config_dialog (ETableConfig *config, gboolean is_sort)
-{
- ETableConfigSortWidgets *widgets;
- int count, i;
-
- if (is_sort){
- count = e_table_sort_info_sorting_get_count (
- config->temp_state->sort_info);
- widgets = &config->sort [0];
- } else {
- count = e_table_sort_info_grouping_get_count (
- config->temp_state->sort_info);
- widgets = &config->group [0];
- }
-
- for (i = 0; i < 4; i++){
- gboolean sensitive = (i <= count);
- char *text = "";
-
- gtk_widget_set_sensitive (widgets [i].frames, sensitive);
-
- /*
- * Sorting is set, auto select the text
- */
- g_signal_handler_block (
- widgets [i].radio_ascending,
- widgets [i].toggled_id);
- g_signal_handler_block (
- widgets [i].combo->entry,
- widgets [i].changed_id);
-
- if (i < count){
- GtkToggleButton *a, *d;
- ETableSortColumn col =
- is_sort
- ? e_table_sort_info_sorting_get_nth (
- config->temp_state->sort_info,
- i)
- : e_table_sort_info_grouping_get_nth (
- config->temp_state->sort_info,
- i);
-
- ETableColumnSpecification *column =
- find_column_in_spec (config->source_spec, col.column);
-
- if (!column){
- /*
- * This is a bug in the programmer
- * stuff, but by the time we arrive
- * here, the user has been given a
- * warning
- */
- continue;
- }
-
- text = dgettext (config->domain, column->title);
-
- /*
- * Update radio buttons
- */
- a = GTK_TOGGLE_BUTTON (
- widgets [i].radio_ascending);
- d = GTK_TOGGLE_BUTTON (
- widgets [i].radio_descending);
-
- gtk_toggle_button_set_active (col.ascending ? a:d, 1);
- } else {
- GtkToggleButton *t;
-
- t = GTK_TOGGLE_BUTTON (
- widgets [i].radio_ascending);
-
- if (is_sort)
- g_assert (widgets [i].radio_ascending != config->group [i].radio_ascending);
- else
- g_assert (widgets [i].radio_ascending != config->sort [i].radio_ascending);
- gtk_toggle_button_set_active (t, 1);
- }
-
- /* Set the text */
- gtk_combo_text_set_text (widgets [i].combo, text);
-
- g_signal_handler_unblock (
- widgets [i].radio_ascending,
- widgets [i].toggled_id);
- g_signal_handler_unblock (
- widgets [i].combo->entry,
- widgets [i].changed_id);
- }
-}
-
-static void
-config_sort_info_update (ETableConfig *config)
-{
- ETableSortInfo *info = config->state->sort_info;
- GString *res;
- int count, i;
-
- count = e_table_sort_info_sorting_get_count (info);
- res = g_string_new ("");
-
- for (i = 0; i < count; i++) {
- ETableSortColumn col = e_table_sort_info_sorting_get_nth (info, i);
- ETableColumnSpecification *column;
-
- column = find_column_in_spec (config->source_spec, col.column);
- if (!column){
- g_warning ("Could not find column model in specification");
- continue;
- }
-
- g_string_append (res, dgettext (config->domain, (column)->title));
- g_string_append_c (res, ' ');
- g_string_append (
- res,
- col.ascending ?
- _("(Ascending)") : _("(Descending)"));
-
- if ((i + 1) != count)
- g_string_append (res, ", ");
- }
-
- if (res->str [0] == 0)
- g_string_append (res, _("Not sorted"));
-
- gtk_label_set_text (GTK_LABEL(config->sort_label), res->str);
-
- g_string_free (res, TRUE);
-}
-
-static void
-config_group_info_update (ETableConfig *config)
-{
- ETableSortInfo *info = config->state->sort_info;
- GString *res;
- int count, i;
-
- if (!e_table_sort_info_get_can_group (info))
- return;
-
- count = e_table_sort_info_grouping_get_count (info);
- res = g_string_new ("");
-
- for (i = 0; i < count; i++) {
- ETableSortColumn col = e_table_sort_info_grouping_get_nth (info, i);
- ETableColumnSpecification *column;
-
- column = find_column_in_spec (config->source_spec, col.column);
- if (!column){
- g_warning ("Could not find model column in specification");
- continue;
- }
-
- g_string_append (res, dgettext (config->domain, (column)->title));
- g_string_append_c (res, ' ');
- g_string_append (
- res,
- col.ascending ?
- _("(Ascending)") : _("(Descending)"));
-
- if ((i+1) != count)
- g_string_append (res, ", ");
- }
- if (res->str [0] == 0)
- g_string_append (res, _("No grouping"));
-
- gtk_label_set_text (GTK_LABEL (config->group_label), res->str);
- g_string_free (res, TRUE);
-}
-
-static void
-setup_fields (ETableConfig *config)
-{
- int i;
-
- e_table_without_show_all (config->available_model);
- e_table_subset_variable_clear (config->shown_model);
-
- if (config->temp_state) {
- for (i = 0; i < config->temp_state->col_count; i++) {
- e_table_subset_variable_add (config->shown_model, config->temp_state->columns[i]);
- e_table_without_hide (config->available_model, (void *) config->temp_state->columns[i]);
- }
- }
-}
-
-static void
-config_fields_info_update (ETableConfig *config)
-{
- ETableColumnSpecification **column;
- GString *res = g_string_new ("");
- int i;
-
- for (i = 0; i < config->state->col_count; i++){
- for (column = config->source_spec->columns; *column; column++){
-
- if ((*column)->disabled)
- continue;
-
- if (config->state->columns [i] != (*column)->model_col)
- continue;
-
- g_string_append (res, dgettext (config->domain, (*column)->title));
- if (column [1])
- g_string_append (res, ", ");
- }
- }
-
- gtk_label_set_text (GTK_LABEL (config->fields_label), res->str);
- g_string_free (res, TRUE);
-}
-
-static void
-do_sort_and_group_config_dialog (ETableConfig *config, gboolean is_sort)
-{
- GtkDialog *dialog;
- int response, running = 1;
-
- config->temp_state = e_table_state_duplicate (config->state);
-
- update_sort_and_group_config_dialog (config, is_sort);
-
- gtk_widget_grab_focus (GTK_WIDGET (
- is_sort
- ? config->sort [0].combo
- : config->group [0].combo));
-
-
- if (is_sort)
- dialog = GTK_DIALOG (config->dialog_sort);
- else
- dialog = GTK_DIALOG (config->dialog_group_by);
-
- gtk_window_set_transient_for (GTK_WINDOW (dialog), GTK_WINDOW (config->dialog_toplevel));
-
- do {
- response = gtk_dialog_run (dialog);
- switch (response){
- case 0: /* clear fields */
- if (is_sort){
- e_table_sort_info_sorting_truncate (
- config->temp_state->sort_info, 0);
- } else {
- e_table_sort_info_grouping_truncate (
- config->temp_state->sort_info, 0);
- }
- update_sort_and_group_config_dialog (config, is_sort);
- continue;
-
- case GTK_RESPONSE_OK:
- g_object_unref (config->state);
- config->state = config->temp_state;
- config->temp_state = 0;
- running = 0;
- config_dialog_changed (config);
- break;
-
- case GTK_RESPONSE_CANCEL:
- g_object_unref (config->temp_state);
- config->temp_state = 0;
- running = 0;
- break;
- }
-
- } while (running);
- gtk_widget_hide (GTK_WIDGET (dialog));
-
- if (is_sort)
- config_sort_info_update (config);
- else
- config_group_info_update (config);
-}
-
-static void
-do_fields_config_dialog (ETableConfig *config)
-{
- int response, running = 1;
-
- config->temp_state = e_table_state_duplicate (config->state);
-
- setup_fields (config);
-
- gtk_window_set_transient_for (GTK_WINDOW (config->dialog_show_fields),
- GTK_WINDOW (config->dialog_toplevel));
-
- do {
- response = gtk_dialog_run (GTK_DIALOG(config->dialog_show_fields));
- switch (response){
- case GTK_RESPONSE_OK:
- g_object_unref (config->state);
- config->state = config->temp_state;
- config->temp_state = 0;
- running = 0;
- config_dialog_changed (config);
- break;
-
- /* CANCEL */
- case GTK_RESPONSE_CANCEL:
- g_object_unref (config->temp_state);
- config->temp_state = 0;
- running = 0;
- break;
- }
-
- } while (running);
- gtk_widget_hide (GTK_WIDGET (config->dialog_show_fields));
-
- config_fields_info_update (config);
-}
-
-
-ETableMemoryStoreColumnInfo store_columns[] = {
- E_TABLE_MEMORY_STORE_STRING,
- E_TABLE_MEMORY_STORE_TERMINATOR
-};
-
-static ETableModel *global_store; /* Glade better not be reentrant any time soon. */
-
-static void
-create_global_store (ETableConfig *config)
-{
- int i;
-
- global_store = e_table_memory_store_new (store_columns);
- for (i = 0; config->source_spec->columns[i]; i++) {
- char *text = g_strdup (dgettext (config->domain,
- config->source_spec->columns[i]->title));
-
- e_table_memory_store_insert_adopt (E_TABLE_MEMORY_STORE (global_store), i, NULL, text);
- }
-}
-
-char *spec = "<ETableSpecification gettext-domain=\"" E_I18N_DOMAIN "\" no-headers=\"true\" cursor-mode=\"line\" "
- " draw-grid=\"false\" draw-focus=\"true\" selection-mode=\"browse\">"
- "<ETableColumn model_col= \"0\" _title=\"Name\" minimum_width=\"30\" resizable=\"true\" cell=\"string\" compare=\"string\"/>"
- "<ETableState> <column source=\"0\"/>"
- "<grouping/>"
- "</ETableState>"
- "</ETableSpecification>";
-
-GtkWidget *e_table_proxy_etable_shown_new (void);
-
-GtkWidget *
-e_table_proxy_etable_shown_new (void)
-{
- ETableModel *model = NULL;
-
- model = e_table_subset_variable_new (global_store);
-
- return e_table_scrolled_new (model, NULL, spec, NULL);
-}
-
-GtkWidget *e_table_proxy_etable_available_new (void);
-
-GtkWidget *
-e_table_proxy_etable_available_new (void)
-{
- ETableModel *model;
-
- model = e_table_without_new (global_store,
- NULL, NULL, NULL, NULL, NULL, NULL, NULL);
-
- e_table_without_show_all (E_TABLE_WITHOUT (model));
-
- return e_table_scrolled_new (model, NULL, spec, NULL);
-}
-
-static void
-config_button_fields (GtkWidget *widget, ETableConfig *config)
-{
- do_fields_config_dialog (config);
-}
-
-static void
-config_button_sort (GtkWidget *widget, ETableConfig *config)
-{
- do_sort_and_group_config_dialog (config, TRUE);
-}
-
-static void
-config_button_group (GtkWidget *widget, ETableConfig *config)
-{
- do_sort_and_group_config_dialog (config, FALSE);
-}
-
-static void
-dialog_destroyed (gpointer data, GObject *where_object_was)
-{
- ETableConfig *config = data;
- g_object_unref (config);
-}
-
-static void
-dialog_response (GtkWidget *dialog, int response_id, ETableConfig *config)
-{
- if (response_id == GTK_RESPONSE_APPLY
- || response_id == GTK_RESPONSE_OK) {
- e_table_config_changed (config, config->state);
- }
-
- if (response_id == GTK_RESPONSE_CANCEL
- || response_id == GTK_RESPONSE_OK) {
- gtk_widget_destroy (dialog);
- }
-}
-
-/*
- * Invoked by the Glade auto-connect code
- */
-GtkWidget *e_table_proxy_gtk_combo_text_new (void);
-GtkWidget *
-e_table_proxy_gtk_combo_text_new (void)
-{
- return gtk_combo_text_new (TRUE);
-}
-
-#if 0
-static GtkWidget *
-configure_dialog (GladeXML *gui, const char *widget_name, ETableConfig *config)
-{
- GtkWidget *w;
-
- w = glade_xml_get_widget (gui, widget_name);
-
- return w;
-}
-#endif
-
-static void
-connect_button (ETableConfig *config, GladeXML *gui, const char *widget_name, GCallback cback)
-{
- GtkWidget *button = glade_xml_get_widget (gui, widget_name);
-
- if (button) {
- g_signal_connect (G_OBJECT (button), "clicked",
- cback, config);
- }
-}
-
-static void
-sort_entry_changed (GtkEntry *entry, ETableConfigSortWidgets *sort)
-{
- ETableConfig *config = sort->e_table_config;
- ETableSortInfo *sort_info = config->temp_state->sort_info;
- ETableConfigSortWidgets *base = &config->sort[0];
- int idx = sort - base;
-
- const char *s = gtk_entry_get_text (entry);
-
- if (s && s [0] && g_hash_table_lookup (sort->combo->elements, s)){
- ETableSortColumn c;
- int col;
-
- col = find_model_column_by_name (config->source_spec, s);
- if (col == -1){
- g_warning ("sort: This should not happen (%s)", s);
- return;
- }
-
- c.ascending = GTK_TOGGLE_BUTTON (
- config->sort [idx].radio_ascending)->active;
- c.column = col;
- e_table_sort_info_sorting_set_nth (sort_info, idx, c);
-
- update_sort_and_group_config_dialog (config, TRUE);
- } else {
- e_table_sort_info_sorting_truncate (sort_info, idx);
- update_sort_and_group_config_dialog (config, TRUE);
- }
-}
-
-static void
-sort_ascending_toggled (GtkToggleButton *t, ETableConfigSortWidgets *sort)
-{
- ETableConfig *config = sort->e_table_config;
- ETableSortInfo *si = config->temp_state->sort_info;
- ETableConfigSortWidgets *base = &config->sort[0];
- int idx = sort - base;
- ETableSortColumn c;
-
- c = e_table_sort_info_sorting_get_nth (si, idx);
- c.ascending = t->active;
- e_table_sort_info_sorting_set_nth (si, idx, c);
-}
-
-static void
-configure_sort_dialog (ETableConfig *config, GladeXML *gui)
-{
- GSList *l;
- int i;
-
- for (i = 0; i < 4; i++){
- char buffer [80];
-
- snprintf (buffer, sizeof (buffer), "sort-combo-%d", i + 1);
- config->sort [i].combo = GTK_COMBO_TEXT (
- glade_xml_get_widget (gui, buffer));
- gtk_widget_show (GTK_WIDGET (config->sort [i].combo));
- gtk_combo_text_add_item (config->sort [i].combo, "", "");
-
- snprintf (buffer, sizeof (buffer), "frame-sort-%d", i + 1);
- config->sort [i].frames =
- glade_xml_get_widget (gui, buffer);
-
- snprintf (
- buffer, sizeof (buffer),
- "radiobutton-ascending-sort-%d", i+1);
- config->sort [i].radio_ascending = glade_xml_get_widget (
- gui, buffer);
-
- snprintf (
- buffer, sizeof (buffer),
- "radiobutton-descending-sort-%d", i+1);
- config->sort [i].radio_descending = glade_xml_get_widget (
- gui, buffer);
-
- config->sort [i].e_table_config = config;
- }
-
- for (l = config->column_names; l; l = l->next){
- char *label = l->data;
-
- for (i = 0; i < 4; i++){
- gtk_combo_text_add_item (config->sort [i].combo,
- dgettext (config->domain, label), label);
- }
- }
-
- /*
- * After we have runtime modified things, signal connect
- */
- for (i = 0; i < 4; i++){
- config->sort [i].changed_id = g_signal_connect (
- config->sort [i].combo->entry,
- "changed", G_CALLBACK (sort_entry_changed),
- &config->sort [i]);
-
- config->sort [i].toggled_id = g_signal_connect (
- config->sort [i].radio_ascending,
- "toggled", G_CALLBACK (sort_ascending_toggled),
- &config->sort [i]);
- }
-}
-
-static void
-group_entry_changed (GtkEntry *entry, ETableConfigSortWidgets *group)
-{
- ETableConfig *config = group->e_table_config;
- ETableSortInfo *sort_info = config->temp_state->sort_info;
- ETableConfigSortWidgets *base = &config->group[0];
- int idx = group - base;
- const char *s = gtk_entry_get_text (entry);
-
- if (s && s [0] && g_hash_table_lookup (group->combo->elements, s)){
- ETableSortColumn c;
- int col;
-
- col = find_model_column_by_name (config->source_spec, s);
- if (col == -1){
- g_warning ("grouping: this should not happen, %s", s);
- return;
- }
-
- c.ascending = GTK_TOGGLE_BUTTON (
- config->group [idx].radio_ascending)->active;
- c.column = col;
- e_table_sort_info_grouping_set_nth (sort_info, idx, c);
-
- update_sort_and_group_config_dialog (config, FALSE);
- } else {
- e_table_sort_info_grouping_truncate (sort_info, idx);
- update_sort_and_group_config_dialog (config, FALSE);
- }
-}
-
-static void
-group_ascending_toggled (GtkToggleButton *t, ETableConfigSortWidgets *group)
-{
- ETableConfig *config = group->e_table_config;
- ETableSortInfo *si = config->temp_state->sort_info;
- ETableConfigSortWidgets *base = &config->group[0];
- int idx = group - base;
- ETableSortColumn c;
-
- c = e_table_sort_info_grouping_get_nth (si, idx);
- c.ascending = t->active;
- e_table_sort_info_grouping_set_nth (si, idx, c);
-}
-
-static void
-configure_group_dialog (ETableConfig *config, GladeXML *gui)
-{
- GSList *l;
- int i;
-
- for (i = 0; i < 4; i++){
- char buffer [80];
-
- snprintf (buffer, sizeof (buffer), "group-combo-%d", i + 1);
- config->group [i].combo = GTK_COMBO_TEXT (
- glade_xml_get_widget (gui, buffer));
- gtk_widget_show (GTK_WIDGET (config->group [i].combo));
-
- gtk_combo_text_add_item (config->group [i].combo, "", "");
-
- snprintf (buffer, sizeof (buffer), "frame-group-%d", i + 1);
- config->group [i].frames =
- glade_xml_get_widget (gui, buffer);
-
- snprintf (
- buffer, sizeof (buffer),
- "radiobutton-ascending-group-%d", i+1);
- config->group [i].radio_ascending = glade_xml_get_widget (
- gui, buffer);
-
- snprintf (
- buffer, sizeof (buffer),
- "radiobutton-descending-group-%d", i+1);
- config->group [i].radio_descending = glade_xml_get_widget (
- gui, buffer);
-
- snprintf (
- buffer, sizeof (buffer),
- "checkbutton-group-%d", i+1);
- config->group [i].view_check = glade_xml_get_widget (
- gui, buffer);
-
- config->group [i].e_table_config = config;
- }
-
-
- for (l = config->column_names; l; l = l->next){
- char *label = l->data;
-
- for (i = 0; i < 4; i++){
- gtk_combo_text_add_item (
- config->group [i].combo,
- dgettext (config->domain, label), label);
- }
- }
-
- /*
- * After we have runtime modified things, signal connect
- */
- for (i = 0; i < 4; i++){
- config->group [i].changed_id = g_signal_connect (
- config->group [i].combo->entry,
- "changed", G_CALLBACK (group_entry_changed),
- &config->group [i]);
-
- config->group [i].toggled_id = g_signal_connect (
- config->group [i].radio_ascending,
- "toggled", G_CALLBACK (group_ascending_toggled),
- &config->group [i]);
- }
-}
-
-static void
-add_column (int model_row, gpointer closure)
-{
- GList **columns = closure;
- *columns = g_list_prepend (*columns, GINT_TO_POINTER (model_row));
-}
-
-static void
-config_button_add (GtkWidget *widget, ETableConfig *config)
-{
- GList *columns = NULL;
- GList *column;
- int count;
- int i;
-
- e_table_selected_row_foreach (config->available, add_column, &columns);
- columns = g_list_reverse (columns);
-
- count = g_list_length (columns);
-
- config->temp_state->columns = g_renew (int, config->temp_state->columns, config->temp_state->col_count + count);
- config->temp_state->expansions = g_renew (double, config->temp_state->expansions, config->temp_state->col_count + count);
- i = config->temp_state->col_count;
- for (column = columns; column; column = column->next) {
- config->temp_state->columns[i] = e_table_subset_view_to_model_row (E_TABLE_SUBSET (config->available_model), GPOINTER_TO_INT (column->data));
- config->temp_state->expansions[i] = config->source_spec->columns[config->temp_state->columns[i]]->expansion;
- i++;
- }
- config->temp_state->col_count += count;
-
- g_list_free (columns);
-
- setup_fields (config);
-}
-
-static void
-config_button_remove (GtkWidget *widget, ETableConfig *config)
-{
- GList *columns = NULL;
- GList *column;
-
- e_table_selected_row_foreach (config->shown, add_column, &columns);
-
- for (column = columns; column; column = column->next) {
- int row = GPOINTER_TO_INT (column->data);
-
- memmove (config->temp_state->columns + row, config->temp_state->columns + row + 1, sizeof (int) * (config->temp_state->col_count - row - 1));
- memmove (config->temp_state->expansions + row, config->temp_state->expansions + row + 1, sizeof (double) * (config->temp_state->col_count - row - 1));
- config->temp_state->col_count --;
- }
- config->temp_state->columns = g_renew (int, config->temp_state->columns, config->temp_state->col_count);
- config->temp_state->expansions = g_renew (double, config->temp_state->expansions, config->temp_state->col_count);
-
- g_list_free (columns);
-
- setup_fields (config);
-}
-
-static void
-config_button_up (GtkWidget *widget, ETableConfig *config)
-{
- GList *columns = NULL;
- GList *column;
- int *new_shown;
- double *new_expansions;
- int next_col;
- double next_expansion;
- int i;
-
- e_table_selected_row_foreach (config->shown, add_column, &columns);
- columns = g_list_reverse (columns);
-
- new_shown = g_new (int, config->temp_state->col_count);
- new_expansions = g_new (double, config->temp_state->col_count);
-
- column = columns;
-
- next_col = config->temp_state->columns[0];
- next_expansion = config->temp_state->expansions[0];
-
- for (i = 1; i < config->temp_state->col_count; i++) {
- if (column && (GPOINTER_TO_INT (column->data) == i)) {
- new_expansions[i - 1] = config->temp_state->expansions[i];
- new_shown[i - 1] = config->temp_state->columns[i];
- column = column->next;
- } else {
- new_shown[i - 1] = next_col;
- next_col = config->temp_state->columns[i];
-
- new_expansions[i - 1] = next_expansion;
- next_expansion = config->temp_state->expansions[i];
- }
- }
-
- new_shown[i - 1] = next_col;
- new_expansions[i - 1] = next_expansion;
-
- g_free (config->temp_state->columns);
- g_free (config->temp_state->expansions);
-
- config->temp_state->columns = new_shown;
- config->temp_state->expansions = new_expansions;
-
- g_list_free (columns);
-
- setup_fields (config);
-}
-
-static void
-config_button_down (GtkWidget *widget, ETableConfig *config)
-{
- GList *columns = NULL;
- GList *column;
- int *new_shown;
- double *new_expansions;
- int next_col;
- double next_expansion;
- int i;
-
- e_table_selected_row_foreach (config->shown, add_column, &columns);
-
- new_shown = g_new (int, config->temp_state->col_count);
- new_expansions = g_new (double, config->temp_state->col_count);
-
- column = columns;
-
- next_col = config->temp_state->columns[config->temp_state->col_count - 1];
- next_expansion = config->temp_state->expansions[config->temp_state->col_count - 1];
-
- for (i = config->temp_state->col_count - 1; i > 0; i--) {
- if (column && (GPOINTER_TO_INT (column->data) == i - 1)) {
- new_expansions[i] = config->temp_state->expansions[i - 1];
- new_shown[i] = config->temp_state->columns[i - 1];
- column = column->next;
- } else {
- new_shown[i] = next_col;
- next_col = config->temp_state->columns[i - 1];
-
- new_expansions[i] = next_expansion;
- next_expansion = config->temp_state->expansions[i - 1];
- }
- }
-
- new_shown[0] = next_col;
- new_expansions[0] = next_expansion;
-
- g_free (config->temp_state->columns);
- g_free (config->temp_state->expansions);
-
- config->temp_state->columns = new_shown;
- config->temp_state->expansions = new_expansions;
-
- g_list_free (columns);
-
- setup_fields (config);
-}
-
-static void
-configure_fields_dialog (ETableConfig *config, GladeXML *gui)
-{
- GtkWidget *scrolled;
-
- scrolled = glade_xml_get_widget (gui, "custom-available");
- config->available = e_table_scrolled_get_table (E_TABLE_SCROLLED (scrolled));
- g_object_get (config->available,
- "model", &config->available_model,
- NULL);
- gtk_widget_show_all (scrolled);
-
- scrolled = glade_xml_get_widget (gui, "custom-shown");
- config->shown = e_table_scrolled_get_table (E_TABLE_SCROLLED (scrolled));
- g_object_get (config->shown,
- "model", &config->shown_model,
- NULL);
- gtk_widget_show_all (scrolled);
-
- connect_button (config, gui, "button-add", G_CALLBACK (config_button_add));
- connect_button (config, gui, "button-remove", G_CALLBACK (config_button_remove));
- connect_button (config, gui, "button-up", G_CALLBACK (config_button_up));
- connect_button (config, gui, "button-down", G_CALLBACK (config_button_down));
-
- setup_fields (config);
-}
-
-static void
-setup_gui (ETableConfig *config)
-{
- GladeXML *gui;
-
- create_global_store (config);
-
- if (e_table_sort_info_get_can_group (config->state->sort_info)) {
- gui = glade_xml_new (ETABLE_GLADEDIR "/e-table-config.glade", NULL, E_I18N_DOMAIN);
- } else {
- gui = glade_xml_new (ETABLE_GLADEDIR "/e-table-config-no-group.glade", NULL, E_I18N_DOMAIN);
- }
-
- g_object_unref (global_store);
-
- config->dialog_toplevel = glade_xml_get_widget (
- gui, "e-table-config");
-
- if (config->header)
- gtk_window_set_title (GTK_WINDOW (config->dialog_toplevel), config->header);
-
- config->dialog_show_fields = glade_xml_get_widget (
- gui, "dialog-show-fields");
- config->dialog_group_by = glade_xml_get_widget (
- gui, "dialog-group-by");
- config->dialog_sort = glade_xml_get_widget (
- gui, "dialog-sort");
-
- config->sort_label = glade_xml_get_widget (
- gui, "label-sort");
- config->group_label = glade_xml_get_widget (
- gui, "label-group");
- config->fields_label = glade_xml_get_widget (
- gui, "label-fields");
-
- connect_button (config, gui, "button-sort", G_CALLBACK (config_button_sort));
- connect_button (config, gui, "button-group", G_CALLBACK (config_button_group));
- connect_button (config, gui, "button-fields", G_CALLBACK (config_button_fields));
-
- configure_sort_dialog (config, gui);
- configure_group_dialog (config, gui);
- configure_fields_dialog (config, gui);
-
- g_object_weak_ref (G_OBJECT (config->dialog_toplevel),
- dialog_destroyed, config);
-
- g_signal_connect (config->dialog_toplevel, "response",
- G_CALLBACK (dialog_response), config);
-
- g_object_unref (gui);
-}
-
-static void
-config_init (ETableConfig *config)
-{
- config->domain = NULL;
-}
-
-ETableConfig *
-e_table_config_construct (ETableConfig *config,
- const char *header,
- ETableSpecification *spec,
- ETableState *state,
- GtkWindow *parent_window)
-{
- ETableColumnSpecification **column;
-
- g_return_val_if_fail (config != NULL, NULL);
- g_return_val_if_fail (header != NULL, NULL);
- g_return_val_if_fail (spec != NULL, NULL);
- g_return_val_if_fail (state != NULL, NULL);
-
- config->source_spec = spec;
- config->source_state = state;
- config->header = g_strdup (header);
-
- g_object_ref (config->source_spec);
- g_object_ref (config->source_state);
-
- config->state = e_table_state_duplicate (state);
-
- config->domain = g_strdup (spec->domain);
-
- for (column = config->source_spec->columns; *column; column++){
- char *label = (*column)->title;
-
- if ((*column)->disabled)
- continue;
-
- config->column_names = g_slist_append (
- config->column_names, label);
- }
-
- setup_gui (config);
-
- if (parent_window)
- gtk_window_set_transient_for (GTK_WINDOW (config->dialog_toplevel),
- parent_window);
-
- config_sort_info_update (config);
- config_group_info_update (config);
- config_fields_info_update (config);
-
- return E_TABLE_CONFIG (config);
-}
-
-/**
- * e_table_config_new:
- * @header: The title of the dialog for the ETableConfig.
- * @spec: The specification for the columns to allow.
- * @state: The current state of the configuration.
- *
- * Creates a new ETable config object.
- *
- * Returns: The config object.
- */
-ETableConfig *
-e_table_config_new (const char *header,
- ETableSpecification *spec,
- ETableState *state,
- GtkWindow *parent_window)
-{
- ETableConfig *config = g_object_new (E_TABLE_CONFIG_TYPE, NULL);
-
- if (e_table_config_construct (config, header, spec, state, parent_window) == NULL){
- g_object_unref (config);
- return NULL;
- }
-
- gtk_widget_show (config->dialog_toplevel);
- return E_TABLE_CONFIG (config);
-}
-
-/**
- * e_table_config_raise:
- * @config: The ETableConfig object.
- *
- * Raises the dialog associated with this ETableConfig object.
- */
-void
-e_table_config_raise (ETableConfig *config)
-{
- gdk_window_raise (GTK_WIDGET (config->dialog_toplevel)->window);
-}
-
-E_MAKE_TYPE(e_table_config, "ETableConfig", ETableConfig, config_class_init, config_init, G_TYPE_OBJECT)
diff --git a/widgets/table/e-table-config.glade b/widgets/table/e-table-config.glade
deleted file mode 100644
index 19602c28af..0000000000
--- a/widgets/table/e-table-config.glade
+++ /dev/null
@@ -1,2107 +0,0 @@
-<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*-->
-<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd">
-
-<glade-interface>
-
-<widget class="GtkDialog" id="dialog-show-fields">
- <property name="title" translatable="yes">Show Fields</property>
- <property name="type">GTK_WINDOW_TOPLEVEL</property>
- <property name="window_position">GTK_WIN_POS_NONE</property>
- <property name="modal">True</property>
- <property name="resizable">True</property>
- <property name="destroy_with_parent">False</property>
- <property name="has_separator">True</property>
-
- <child internal-child="vbox">
- <widget class="GtkVBox" id="dialog-vbox3">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">8</property>
-
- <child internal-child="action_area">
- <widget class="GtkHButtonBox" id="dialog-action_area3">
- <property name="visible">True</property>
- <property name="layout_style">GTK_BUTTONBOX_END</property>
-
- <child>
- <widget class="GtkButton" id="button20">
- <property name="visible">True</property>
- <property name="can_default">True</property>
- <property name="can_focus">True</property>
- <property name="label">gtk-ok</property>
- <property name="use_stock">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="response_id">-5</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkButton" id="button22">
- <property name="visible">True</property>
- <property name="can_default">True</property>
- <property name="can_focus">True</property>
- <property name="label">gtk-cancel</property>
- <property name="use_stock">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="response_id">-6</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="pack_type">GTK_PACK_END</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkVBox" id="vbox2">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">6</property>
-
- <child>
- <widget class="GtkTable" id="table2">
- <property name="visible">True</property>
- <property name="n_rows">1</property>
- <property name="n_columns">5</property>
- <property name="homogeneous">True</property>
- <property name="row_spacing">6</property>
- <property name="column_spacing">6</property>
-
- <child>
- <widget class="GtkLabel" id="label-available">
- <property name="visible">True</property>
- <property name="label" translatable="yes">A_vailable Fields:</property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">2</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label-displayed">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Sh_ow these fields in order:</property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="left_attach">3</property>
- <property name="right_attach">5</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkTable" id="table3">
- <property name="visible">True</property>
- <property name="n_rows">1</property>
- <property name="n_columns">5</property>
- <property name="homogeneous">True</property>
- <property name="row_spacing">6</property>
- <property name="column_spacing">6</property>
-
- <child>
- <widget class="GtkVBox" id="vbox4">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">6</property>
-
- <child>
- <widget class="Custom" id="custom-available">
- <property name="visible">True</property>
- <property name="creation_function">e_table_proxy_etable_available_new</property>
- <property name="int1">0</property>
- <property name="int2">0</property>
- <property name="last_modification_time">Thu, 21 Feb 2002 16:09:53 GMT</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">2</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkVBox" id="vbox5">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">6</property>
-
- <child>
- <widget class="Custom" id="custom-shown">
- <property name="visible">True</property>
- <property name="creation_function">e_table_proxy_etable_shown_new</property>
- <property name="int1">0</property>
- <property name="int2">0</property>
- <property name="last_modification_time">Thu, 21 Feb 2002 16:09:58 GMT</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkHBox" id="hbox4">
- <property name="visible">True</property>
- <property name="homogeneous">True</property>
- <property name="spacing">6</property>
-
- <child>
- <widget class="GtkButton" id="button-up">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">Move _Up</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkButton" id="button-down">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">Move _Down</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">True</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">True</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="left_attach">3</property>
- <property name="right_attach">5</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkVBox" id="vbox6">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">6</property>
-
- <child>
- <widget class="GtkButton" id="button-add">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">_Add -&gt;</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkButton" id="button-remove">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">&lt;- _Remove</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <placeholder/>
- </child>
- </widget>
- <packing>
- <property name="left_attach">2</property>
- <property name="right_attach">3</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
- </widget>
- </child>
-</widget>
-
-<widget class="GtkDialog" id="dialog-group-by">
- <property name="title" translatable="yes">Group</property>
- <property name="type">GTK_WINDOW_TOPLEVEL</property>
- <property name="window_position">GTK_WIN_POS_NONE</property>
- <property name="modal">True</property>
- <property name="resizable">True</property>
- <property name="destroy_with_parent">False</property>
- <property name="has_separator">True</property>
-
- <child internal-child="vbox">
- <widget class="GtkVBox" id="dialog-vbox4">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">8</property>
-
- <child internal-child="action_area">
- <widget class="GtkHButtonBox" id="dialog-action_area4">
- <property name="visible">True</property>
- <property name="layout_style">GTK_BUTTONBOX_END</property>
-
- <child>
- <widget class="GtkButton" id="button39">
- <property name="visible">True</property>
- <property name="can_default">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">Clear All</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="response_id">0</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkButton" id="button41">
- <property name="visible">True</property>
- <property name="can_default">True</property>
- <property name="can_focus">True</property>
- <property name="label">gtk-ok</property>
- <property name="use_stock">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="response_id">-5</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkButton" id="button42">
- <property name="visible">True</property>
- <property name="can_default">True</property>
- <property name="can_focus">True</property>
- <property name="label">gtk-cancel</property>
- <property name="use_stock">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="response_id">-6</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="pack_type">GTK_PACK_END</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkVBox" id="vbox24">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">0</property>
-
- <child>
- <widget class="GtkHBox" id="hbox13">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">6</property>
-
- <child>
- <widget class="GtkFrame" id="frame-group-1">
- <property name="visible">True</property>
- <property name="label_xalign">0</property>
- <property name="label_yalign">0.5</property>
- <property name="shadow_type">GTK_SHADOW_ETCHED_IN</property>
-
- <child>
- <widget class="GtkHBox" id="hbox5">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">6</property>
-
- <child>
- <widget class="GtkVBox" id="vbox7">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">0</property>
-
- <child>
- <widget class="Custom" id="group-combo-1">
- <property name="visible">True</property>
- <property name="creation_function">e_table_proxy_gtk_combo_text_new</property>
- <property name="int1">0</property>
- <property name="int2">0</property>
- <property name="last_modification_time">Fri, 19 Jan 2001 04:52:09 GMT</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkCheckButton" id="checkbutton-group-1">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">Show field in View</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="active">False</property>
- <property name="inconsistent">False</property>
- <property name="draw_indicator">True</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkVBox" id="vbox8">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">0</property>
-
- <child>
- <widget class="GtkRadioButton" id="radiobutton-ascending-group-1">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">Ascending</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="active">False</property>
- <property name="inconsistent">False</property>
- <property name="draw_indicator">True</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkRadioButton" id="radiobutton-descending-group-1">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">Descending</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="active">False</property>
- <property name="inconsistent">False</property>
- <property name="draw_indicator">True</property>
- <property name="group">radiobutton-ascending-group-1</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">True</property>
- </packing>
- </child>
- </widget>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label1">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Group Items By</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="type">label_item</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label8">
- <property name="visible">True</property>
- <property name="label" translatable="yes"></property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label9">
- <property name="visible">True</property>
- <property name="label" translatable="yes"></property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label10">
- <property name="visible">True</property>
- <property name="label" translatable="yes"></property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkHBox" id="hbox14">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">6</property>
-
- <child>
- <widget class="GtkLabel" id="label11">
- <property name="visible">True</property>
- <property name="label" translatable="yes"></property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkFrame" id="frame-group-2">
- <property name="visible">True</property>
- <property name="label_xalign">0</property>
- <property name="label_yalign">0.5</property>
- <property name="shadow_type">GTK_SHADOW_ETCHED_IN</property>
-
- <child>
- <widget class="GtkHBox" id="hbox6">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">6</property>
-
- <child>
- <widget class="GtkVBox" id="vbox9">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">0</property>
-
- <child>
- <widget class="Custom" id="group-combo-2">
- <property name="visible">True</property>
- <property name="creation_function">e_table_proxy_gtk_combo_text_new</property>
- <property name="int1">0</property>
- <property name="int2">0</property>
- <property name="last_modification_time">Fri, 19 Jan 2001 04:52:14 GMT</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkCheckButton" id="checkbutton-group-2">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">Show field in View</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="active">False</property>
- <property name="inconsistent">False</property>
- <property name="draw_indicator">True</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkVBox" id="vbox10">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">0</property>
-
- <child>
- <widget class="GtkRadioButton" id="radiobutton-ascending-group-2">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">Ascending</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="active">False</property>
- <property name="inconsistent">False</property>
- <property name="draw_indicator">True</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkRadioButton" id="radiobutton-descending-group-2">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">Descending</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="active">False</property>
- <property name="inconsistent">False</property>
- <property name="draw_indicator">True</property>
- <property name="group">radiobutton-ascending-group-2</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">True</property>
- </packing>
- </child>
- </widget>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label12">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Then By</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="type">label_item</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label19">
- <property name="visible">True</property>
- <property name="label" translatable="yes"></property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label18">
- <property name="visible">True</property>
- <property name="label" translatable="yes"></property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkHBox" id="hbox15">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">6</property>
-
- <child>
- <widget class="GtkLabel" id="label13">
- <property name="visible">True</property>
- <property name="label" translatable="yes"></property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label12">
- <property name="visible">True</property>
- <property name="label" translatable="yes"></property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkFrame" id="frame-group-3">
- <property name="visible">True</property>
- <property name="label_xalign">0</property>
- <property name="label_yalign">0.5</property>
- <property name="shadow_type">GTK_SHADOW_ETCHED_IN</property>
-
- <child>
- <widget class="GtkHBox" id="hbox7">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">6</property>
-
- <child>
- <widget class="GtkVBox" id="vbox11">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">0</property>
-
- <child>
- <widget class="Custom" id="group-combo-3">
- <property name="visible">True</property>
- <property name="creation_function">e_table_proxy_gtk_combo_text_new</property>
- <property name="int1">0</property>
- <property name="int2">0</property>
- <property name="last_modification_time">Fri, 19 Jan 2001 04:52:18 GMT</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkCheckButton" id="checkbutton-group-3">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">Show field in View</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="active">False</property>
- <property name="inconsistent">False</property>
- <property name="draw_indicator">True</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkVBox" id="vbox12">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">0</property>
-
- <child>
- <widget class="GtkRadioButton" id="radiobutton-ascending-group-3">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">Ascending</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="active">False</property>
- <property name="inconsistent">False</property>
- <property name="draw_indicator">True</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkRadioButton" id="radiobutton-descending-group-3">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">Descending</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="active">False</property>
- <property name="inconsistent">False</property>
- <property name="draw_indicator">True</property>
- <property name="group">radiobutton-ascending-group-3</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">True</property>
- </packing>
- </child>
- </widget>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label20">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Then By</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="type">label_item</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label17">
- <property name="visible">True</property>
- <property name="label" translatable="yes"></property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkHBox" id="hbox16">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">6</property>
-
- <child>
- <widget class="GtkLabel" id="label14">
- <property name="visible">True</property>
- <property name="label" translatable="yes"></property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label16">
- <property name="visible">True</property>
- <property name="label" translatable="yes"></property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label15">
- <property name="visible">True</property>
- <property name="label" translatable="yes"></property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkFrame" id="frame-group-4">
- <property name="visible">True</property>
- <property name="label_xalign">0</property>
- <property name="label_yalign">0.5</property>
- <property name="shadow_type">GTK_SHADOW_ETCHED_IN</property>
-
- <child>
- <widget class="GtkHBox" id="hbox8">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">6</property>
-
- <child>
- <widget class="GtkVBox" id="vbox13">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">0</property>
-
- <child>
- <widget class="Custom" id="group-combo-4">
- <property name="visible">True</property>
- <property name="creation_function">e_table_proxy_gtk_combo_text_new</property>
- <property name="int1">0</property>
- <property name="int2">0</property>
- <property name="last_modification_time">Fri, 19 Jan 2001 04:52:21 GMT</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkCheckButton" id="checkbutton-group-4">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">Show field in View</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="active">False</property>
- <property name="inconsistent">False</property>
- <property name="draw_indicator">True</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkVBox" id="vbox14">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">0</property>
-
- <child>
- <widget class="GtkRadioButton" id="radiobutton-ascending-group-4">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">Ascending</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="active">False</property>
- <property name="inconsistent">False</property>
- <property name="draw_indicator">True</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkRadioButton" id="radiobutton-descending-group-4">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">Descending</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="active">False</property>
- <property name="inconsistent">False</property>
- <property name="draw_indicator">True</property>
- <property name="group">radiobutton-ascending-group-4</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">True</property>
- </packing>
- </child>
- </widget>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label21">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Then By</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="type">label_item</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
- </widget>
- </child>
-</widget>
-
-<widget class="GtkDialog" id="dialog-sort">
- <property name="title" translatable="yes">Sort</property>
- <property name="type">GTK_WINDOW_TOPLEVEL</property>
- <property name="window_position">GTK_WIN_POS_NONE</property>
- <property name="modal">True</property>
- <property name="resizable">True</property>
- <property name="destroy_with_parent">False</property>
- <property name="has_separator">True</property>
-
- <child internal-child="vbox">
- <widget class="GtkVBox" id="vbox15">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">8</property>
-
- <child internal-child="action_area">
- <widget class="GtkHButtonBox" id="hbuttonbox1">
- <property name="visible">True</property>
- <property name="layout_style">GTK_BUTTONBOX_END</property>
-
- <child>
- <widget class="GtkButton" id="button43">
- <property name="visible">True</property>
- <property name="can_default">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">Clear All</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="response_id">0</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkButton" id="button44">
- <property name="visible">True</property>
- <property name="can_default">True</property>
- <property name="has_default">True</property>
- <property name="can_focus">True</property>
- <property name="label">gtk-ok</property>
- <property name="use_stock">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="response_id">-5</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkButton" id="button45">
- <property name="visible">True</property>
- <property name="can_default">True</property>
- <property name="can_focus">True</property>
- <property name="label">gtk-cancel</property>
- <property name="use_stock">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="response_id">-6</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="pack_type">GTK_PACK_END</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkTable" id="table5">
- <property name="visible">True</property>
- <property name="n_rows">4</property>
- <property name="n_columns">1</property>
- <property name="homogeneous">False</property>
- <property name="row_spacing">6</property>
- <property name="column_spacing">6</property>
-
- <child>
- <widget class="GtkFrame" id="frame-sort-4">
- <property name="visible">True</property>
- <property name="label_xalign">0</property>
- <property name="label_yalign">0.5</property>
- <property name="shadow_type">GTK_SHADOW_ETCHED_IN</property>
-
- <child>
- <widget class="GtkHBox" id="hbox9">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">6</property>
-
- <child>
- <widget class="GtkAlignment" id="alignment1">
- <property name="visible">True</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xscale">1</property>
- <property name="yscale">0</property>
-
- <child>
- <widget class="Custom" id="sort-combo-4">
- <property name="visible">True</property>
- <property name="creation_function">e_table_proxy_gtk_combo_text_new</property>
- <property name="int1">0</property>
- <property name="int2">0</property>
- <property name="last_modification_time">Tue, 16 Jan 2001 08:33:52 GMT</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkVBox" id="vbox17">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">0</property>
-
- <child>
- <widget class="GtkRadioButton" id="radiobutton-ascending-sort-4">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">Ascending</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="active">False</property>
- <property name="inconsistent">False</property>
- <property name="draw_indicator">True</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkRadioButton" id="radiobutton-descending-sort-4">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">Descending</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="active">False</property>
- <property name="inconsistent">False</property>
- <property name="draw_indicator">True</property>
- <property name="group">radiobutton-ascending-sort-4</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">True</property>
- </packing>
- </child>
- </widget>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label22">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Then By</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="type">label_item</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">3</property>
- <property name="bottom_attach">4</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkFrame" id="frame-sort-3">
- <property name="visible">True</property>
- <property name="label_xalign">0</property>
- <property name="label_yalign">0.5</property>
- <property name="shadow_type">GTK_SHADOW_ETCHED_IN</property>
-
- <child>
- <widget class="GtkHBox" id="hbox10">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">6</property>
-
- <child>
- <widget class="GtkAlignment" id="alignment2">
- <property name="visible">True</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xscale">1</property>
- <property name="yscale">0</property>
-
- <child>
- <widget class="Custom" id="sort-combo-3">
- <property name="visible">True</property>
- <property name="creation_function">e_table_proxy_gtk_combo_text_new</property>
- <property name="int1">0</property>
- <property name="int2">0</property>
- <property name="last_modification_time">Tue, 16 Jan 2001 05:22:22 GMT</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkVBox" id="vbox19">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">0</property>
-
- <child>
- <widget class="GtkRadioButton" id="radiobutton-ascending-sort-3">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">Ascending</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="active">False</property>
- <property name="inconsistent">False</property>
- <property name="draw_indicator">True</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkRadioButton" id="radiobutton-descending-sort-3">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">Descending</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="active">False</property>
- <property name="inconsistent">False</property>
- <property name="draw_indicator">True</property>
- <property name="group">radiobutton-ascending-sort-3</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">True</property>
- </packing>
- </child>
- </widget>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label23">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Then By</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="type">label_item</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">2</property>
- <property name="bottom_attach">3</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkFrame" id="frame-sort-2">
- <property name="visible">True</property>
- <property name="label_xalign">0</property>
- <property name="label_yalign">0.5</property>
- <property name="shadow_type">GTK_SHADOW_ETCHED_IN</property>
-
- <child>
- <widget class="GtkHBox" id="hbox11">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">6</property>
-
- <child>
- <widget class="GtkAlignment" id="alignment3">
- <property name="visible">True</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xscale">1</property>
- <property name="yscale">0</property>
-
- <child>
- <widget class="Custom" id="sort-combo-2">
- <property name="visible">True</property>
- <property name="creation_function">e_table_proxy_gtk_combo_text_new</property>
- <property name="int1">0</property>
- <property name="int2">0</property>
- <property name="last_modification_time">Tue, 16 Jan 2001 05:22:15 GMT</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkVBox" id="vbox21">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">0</property>
-
- <child>
- <widget class="GtkRadioButton" id="radiobutton-ascending-sort-2">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">Ascending</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="active">False</property>
- <property name="inconsistent">False</property>
- <property name="draw_indicator">True</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkRadioButton" id="radiobutton-descending-sort-2">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">Descending</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="active">False</property>
- <property name="inconsistent">False</property>
- <property name="draw_indicator">True</property>
- <property name="group">radiobutton-ascending-sort-2</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">True</property>
- </packing>
- </child>
- </widget>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label24">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Then By</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="type">label_item</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkFrame" id="frame-sort-1">
- <property name="visible">True</property>
- <property name="label_xalign">0</property>
- <property name="label_yalign">0.5</property>
- <property name="shadow_type">GTK_SHADOW_ETCHED_IN</property>
-
- <child>
- <widget class="GtkHBox" id="hbox12">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">6</property>
-
- <child>
- <widget class="GtkAlignment" id="alignment4">
- <property name="visible">True</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xscale">1</property>
- <property name="yscale">0</property>
-
- <child>
- <widget class="Custom" id="sort-combo-1">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="has_focus">True</property>
- <property name="creation_function">e_table_proxy_gtk_combo_text_new</property>
- <property name="int1">0</property>
- <property name="int2">0</property>
- <property name="last_modification_time">Tue, 16 Jan 2001 05:22:00 GMT</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkVBox" id="vbox23">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">0</property>
-
- <child>
- <widget class="GtkRadioButton" id="radiobutton-ascending-sort-1">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">Ascending</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="active">False</property>
- <property name="inconsistent">False</property>
- <property name="draw_indicator">True</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkRadioButton" id="radiobutton-descending-sort-1">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">Descending</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="active">False</property>
- <property name="inconsistent">False</property>
- <property name="draw_indicator">True</property>
- <property name="group">radiobutton-ascending-sort-1</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">True</property>
- </packing>
- </child>
- </widget>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label25">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Sort Items By</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="type">label_item</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
- </widget>
- </child>
-</widget>
-
-<widget class="GtkDialog" id="e-table-config">
- <property name="visible">True</property>
- <property name="title" translatable="yes">dialog1</property>
- <property name="type">GTK_WINDOW_TOPLEVEL</property>
- <property name="window_position">GTK_WIN_POS_NONE</property>
- <property name="modal">True</property>
- <property name="resizable">True</property>
- <property name="destroy_with_parent">False</property>
- <property name="has_separator">True</property>
-
- <child internal-child="vbox">
- <widget class="GtkVBox" id="dialog-vbox6">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">0</property>
-
- <child internal-child="action_area">
- <widget class="GtkHButtonBox" id="dialog-action_area6">
- <property name="visible">True</property>
- <property name="layout_style">GTK_BUTTONBOX_END</property>
-
- <child>
- <widget class="GtkButton" id="cancelbutton2">
- <property name="visible">True</property>
- <property name="can_default">True</property>
- <property name="can_focus">True</property>
- <property name="label">gtk-cancel</property>
- <property name="use_stock">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="response_id">-6</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkButton" id="applybutton2">
- <property name="visible">True</property>
- <property name="can_default">True</property>
- <property name="can_focus">True</property>
- <property name="label">gtk-apply</property>
- <property name="use_stock">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="response_id">-10</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkButton" id="okbutton2">
- <property name="visible">True</property>
- <property name="can_default">True</property>
- <property name="can_focus">True</property>
- <property name="label">gtk-ok</property>
- <property name="use_stock">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="response_id">-5</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="pack_type">GTK_PACK_END</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkFrame" id="top-frame">
- <property name="border_width">2</property>
- <property name="visible">True</property>
- <property name="label_xalign">0</property>
- <property name="label_yalign">0.5</property>
- <property name="shadow_type">GTK_SHADOW_ETCHED_IN</property>
-
- <child>
- <widget class="GtkTable" id="table1">
- <property name="border_width">2</property>
- <property name="visible">True</property>
- <property name="n_rows">3</property>
- <property name="n_columns">3</property>
- <property name="homogeneous">False</property>
- <property name="row_spacing">2</property>
- <property name="column_spacing">4</property>
-
- <child>
- <widget class="GtkButton" id="button-sort">
- <property name="visible">True</property>
- <property name="can_default">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">_Sort...</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <signal name="clicked" handler="on_sort_clicked"/>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">2</property>
- <property name="bottom_attach">3</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkButton" id="button-group">
- <property name="visible">True</property>
- <property name="can_default">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">_Group By...</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <signal name="clicked" handler="on_group_by_clicked"/>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label-sort">
- <property name="visible">True</property>
- <property name="label" translatable="yes"></property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">True</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">2</property>
- <property name="bottom_attach">3</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkButton" id="button-fields">
- <property name="visible">True</property>
- <property name="can_default">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">_Fields Shown...</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <signal name="clicked" handler="on_group_by_clicked"/>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label-fields">
- <property name="visible">True</property>
- <property name="label" translatable="yes"></property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">True</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label3">
- <property name="visible">True</property>
- <property name="label" translatable="yes"></property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="left_attach">2</property>
- <property name="right_attach">3</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label4">
- <property name="visible">True</property>
- <property name="label" translatable="yes"></property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="left_attach">2</property>
- <property name="right_attach">3</property>
- <property name="top_attach">2</property>
- <property name="bottom_attach">3</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label22">
- <property name="visible">True</property>
- <property name="label" translatable="yes"></property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="left_attach">2</property>
- <property name="right_attach">3</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label-group">
- <property name="visible">True</property>
- <property name="label" translatable="yes"></property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">True</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
- </packing>
- </child>
- </widget>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label26">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Description</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="type">label_item</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
- </widget>
- </child>
-</widget>
-
-</glade-interface>
diff --git a/widgets/table/e-table-config.h b/widgets/table/e-table-config.h
deleted file mode 100644
index 1373fb94de..0000000000
--- a/widgets/table/e-table-config.h
+++ /dev/null
@@ -1,115 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-table-config.h
- * Copyright 2000, 2001, Ximian, Inc.
- *
- * Authors:
- * Chris Lahey <clahey@ximian.com>
- * Miguel de Icaza <miguel@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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.
- */
-
-#ifndef _E_TABLE_CONFIG_H_
-#define _E_TABLE_CONFIG_H_
-
-#include <gal/e-table/e-table-sort-info.h>
-#include <gal/e-table/e-table-specification.h>
-#include <gal/widgets/gtk-combo-text.h>
-#include <gal/e-table/e-table-without.h>
-#include <gal/e-table/e-table-subset-variable.h>
-#include <gal/e-table/e-table.h>
-#include <gtk/gtkwindow.h>
-
-G_BEGIN_DECLS
-
-#define E_TABLE_CONFIG_TYPE (e_table_config_get_type ())
-#define E_TABLE_CONFIG(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), E_TABLE_CONFIG_TYPE, ETableConfig))
-#define E_TABLE_CONFIG_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), E_TABLE_CONFIG_TYPE, ETableConfigClass))
-#define E_IS_TABLE_CONFIG(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), E_TABLE_CONFIG_TYPE))
-#define E_IS_TABLE_CONFIG_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), E_TABLE_CONFIG_TYPE))
-#define E_TABLE_CONFIG_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS((o), E_TABLE_CONFIG_TYPE, ETableConfigClass))
-
-typedef struct {
- GtkComboText *combo;
- GtkWidget *frames;
- GtkWidget *radio_ascending;
- GtkWidget *radio_descending;
- GtkWidget *view_check; /* Only for group dialog */
- guint changed_id, toggled_id;
- void *e_table_config;
-} ETableConfigSortWidgets;
-
-
-typedef struct {
- GObject parent;
-
- char *header;
-
- /*
- * Our various dialog boxes
- */
- GtkWidget *dialog_toplevel;
- GtkWidget *dialog_show_fields;
- GtkWidget *dialog_group_by;
- GtkWidget *dialog_sort;
-
- /*
- * The state we manipulate
- */
- ETableSpecification *source_spec;
- ETableState *source_state, *state, *temp_state;
-
- GtkWidget *sort_label;
- GtkWidget *group_label;
- GtkWidget *fields_label;
-
- ETableConfigSortWidgets sort [4];
- ETableConfigSortWidgets group [4];
-
- ETable *available;
- ETableWithout *available_model;
- ETable *shown;
- ETableSubsetVariable *shown_model;
- char *domain;
-
- /*
- * List of valid column names
- */
- GSList *column_names;
-} ETableConfig;
-
-typedef struct {
- GObjectClass parent_class;
-
- /* Signals */
- void (*changed) (ETableConfig *config);
-} ETableConfigClass;
-
-GType e_table_config_get_type (void);
-ETableConfig *e_table_config_new (const char *header,
- ETableSpecification *spec,
- ETableState *state,
- GtkWindow *parent_window);
-ETableConfig *e_table_config_construct (ETableConfig *etco,
- const char *header,
- ETableSpecification *spec,
- ETableState *state,
- GtkWindow *parent_window);
-void e_table_config_raise (ETableConfig *config);
-
-G_END_DECLS
-
-#endif /* _E_TABLE_CONFIG_H */
diff --git a/widgets/table/e-table-defines.h b/widgets/table/e-table-defines.h
deleted file mode 100644
index 34585789d4..0000000000
--- a/widgets/table/e-table-defines.h
+++ /dev/null
@@ -1,45 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-table-defines.h
- * Copyright 2000, 2001, Ximian, Inc.
- *
- * Authors:
- * Chris Lahey <clahey@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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.
- */
-
-#ifndef __E_TABLE_DEFINES__
-#define __E_TABLE_DEFINES__ 1
-
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
-
-#define BUTTON_HEIGHT 10
-#define BUTTON_PADDING 2
-#define GROUP_INDENT (BUTTON_HEIGHT + (BUTTON_PADDING * 2))
-
-/* Padding around the contents of a header button */
-#define HEADER_PADDING 1
-
-#define MIN_ARROW_SIZE 10
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-
-#endif
diff --git a/widgets/table/e-table-example-1.c b/widgets/table/e-table-example-1.c
deleted file mode 100644
index 37ac85770f..0000000000
--- a/widgets/table/e-table-example-1.c
+++ /dev/null
@@ -1,308 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-table-example-1.c
- * Copyright 2000, 2001, Ximian, Inc.
- *
- * Authors:
- * Chris Lahey <clahey@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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.
- */
-
-/* This code is GPL. */
-#include <stdio.h>
-#include <string.h>
-#include <gdk-pixbuf/gdk-pixbuf.h>
-
-#include "gal/e-util/e-cursors.h"
-#include "e-table-simple.h"
-#include "e-table-header.h"
-#include "e-table-header-item.h"
-#include "e-table-item.h"
-#include "e-cell-text.h"
-#include "e-cell-checkbox.h"
-#include "e-table.h"
-
-#include "table-test.h"
-
-/*
- * One way in which we make it simpler to build an ETableModel is through
- * the ETableSimple class. Instead of creating your own ETableModel
- * class, you simply create a new object of the ETableSimple class. You
- * give it a bunch of functions that act as callbacks.
- *
- * You also get to pass a void * to ETableSimple and it gets passed to
- * your callbacks. This would be for having multiple models of the same
- * type. This is just an example though, so we statically define all the
- * data and ignore the void *data parameter.
- *
- * In our example we will be creating a table model with 6 columns and 10
- * rows. This corresponds to having 6 different types of information and
- * 10 different sets of data in our database.
- *
- * The headers will be hard coded, as will be the example data.
- *
- */
-
-/*
- * There are two different meanings to the word "column". The first is
- * the model column. A model column corresponds to a specific type of
- * data. This is very much like the usage in a database table where a
- * column is a field in the database.
- *
- * The second type of column is a view column. A view column
- * corresponds to a visually displayed column. Each view column
- * corresponds to a specific model column, though a model column may
- * have any number of view columns associated with it, from zero to
- * greater than one.
- *
- * Also, a view column doesn't necessarily depend on only one model
- * column. In some cases, the view column renderer can be given a
- * reference to another column to get extra information about its
- * display.
-*/
-
-#define ROWS 10
-#define COLS 4
-
-#define IMPORTANCE_COLUMN 4
-#define COLOR_COLUMN 5
-
-/*
- * Here we define the initial layout of the table. This is an xml
- * format that allows you to change the initial ordering of the
- * columns or to do sorting or grouping initially. This specification
- * shows all 5 columns, but moves the importance column nearer to the
- * front. It also sorts by the "Full Name" column (ascending.)
- * Sorting and grouping take the model column as their arguments
- * (sorting is specified by the "column" argument to the leaf elemnt.
- */
-
-#define INITIAL_SPEC "<ETableSpecification> \
- <columns-shown> \
- <column> 0 </column> \
- <column> 4 </column> \
- <column> 1 </column> \
- <column> 2 </column> \
- <column> 3 </column> \
- </columns-shown> \
- <grouping> <leaf column=\"1\" ascending=\"true\"/> </grouping> \
-</ETableSpecification>"
-
-char *headers [COLS] = {
- "Email",
- "Full Name",
- "Address",
- "Phone"
-};
-
-/*
- * Virtual Column list:
- * 0 Email
- * 1 Full Name
- * 2 Address
- * 3 Phone
- */
-
-char *table_data [ROWS] [COLS];
-
-/*
- * ETableSimple callbacks
- * These are the callbacks that define the behavior of our custom model.
- */
-
-/*
- * Since our model is a constant size, we can just return its size in
- * the column and row count fields.
- */
-
-/* This function returns the number of columns in our ETableModel. */
-static int
-my_col_count (ETableModel *etc, void *data)
-{
- return COLS;
-}
-
-/* This function returns the number of rows in our ETableModel. */
-static int
-my_row_count (ETableModel *etc, void *data)
-{
- return ROWS;
-}
-
-/* This function returns the value at a particular point in our ETableModel. */
-static void *
-my_value_at (ETableModel *etc, int col, int row, void *data)
-{
- return (void *) table_data [row] [col];
-}
-
-/* This function sets the value at a particular point in our ETableModel. */
-static void
-my_set_value_at (ETableModel *etc, int col, int row, const void *val, void *data)
-{
- g_free (table_data [row] [col]);
- table_data [row] [col] = g_strdup (val);
-}
-
-/* This function returns whether a particular cell is editable. */
-static gboolean
-my_is_cell_editable (ETableModel *etc, int col, int row, void *data)
-{
- return TRUE;
-}
-
-/* This function duplicates the value passed to it. */
-static void *
-my_duplicate_value (ETableModel *etc, int col, const void *value, void *data)
-{
- return g_strdup (value);
-}
-
-/* This function frees the value passed to it. */
-static void
-my_free_value (ETableModel *etc, int col, void *value, void *data)
-{
- g_free (value);
-}
-
-/* This function creates an empty value. */
-static void *
-my_initialize_value (ETableModel *etc, int col, void *data)
-{
- return g_strdup ("");
-}
-
-/* This function reports if a value is empty. */
-static gboolean
-my_value_is_empty (ETableModel *etc, int col, const void *value, void *data)
-{
- return !(value && *(char *)value);
-}
-
-/* This function reports if a value is empty. */
-static char *
-my_value_to_string (ETableModel *etc, int col, const void *value, void *data)
-{
- return g_strdup(value);
-}
-
-/* We create a window containing our new table. */
-static void
-create_table (void)
-{
- GtkWidget *e_table, *window, *frame;
- ECell *cell_left_just;
- ETableHeader *e_table_header;
- int i, j;
- ETableModel *e_table_model = NULL;
-
- /* First we fill in the simple data. */
- for (i = 0; i < ROWS; i++){
- for (j = 0; j < COLS; j++)
- table_data [i] [j] = g_strdup ("");
- }
- /* Next we create our model. This uses the functions we defined
- earlier. */
- e_table_model = e_table_simple_new (
- my_col_count, my_row_count, my_value_at,
- my_set_value_at, my_is_cell_editable,
- my_duplicate_value, my_free_value,
- my_initialize_value, my_value_is_empty,
- my_value_to_string,
- NULL);
- /*
- * 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 (e_table_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 < COLS; i++) {
- /* Create the column. */
- ETableCol *ecol = e_table_col_new (
- i, headers [i],
- 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 a window for our new table. This window
- * will get shown and the person will be able to test their
- * item.
- */
- window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
-
- /* This frame is simply to get a bevel around our table. */
- frame = gtk_frame_new (NULL);
-
- /*
- * 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.
- */
- e_table = e_table_new (e_table_header, e_table_model, INITIAL_SPEC);
-
- /* Build the gtk widget hierarchy. */
- gtk_container_add (GTK_CONTAINER (frame), e_table);
- gtk_container_add (GTK_CONTAINER (window), frame);
-
- /* Size the initial window. */
- gtk_widget_set_usize (window, 200, 200);
-
- /* Show it all. */
- gtk_widget_show_all (window);
-}
-
-/* This is the main function which just initializes gnome and call our create_table function */
-
-int
-main (int argc, char *argv [])
-{
- gnome_init ("TableExample", "TableExample", argc, argv);
- e_cursors_init ();
-
- gtk_widget_push_visual (gdk_rgb_get_visual ());
- gtk_widget_push_colormap (gdk_rgb_get_cmap ());
-
- create_table ();
-
- gtk_main ();
-
- e_cursors_shutdown ();
- return 0;
-}
-
diff --git a/widgets/table/e-table-example-2.c b/widgets/table/e-table-example-2.c
deleted file mode 100644
index 2321e4e7dd..0000000000
--- a/widgets/table/e-table-example-2.c
+++ /dev/null
@@ -1,349 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-table-example-2.c
- * Copyright 2000, 2001, Ximian, Inc.
- *
- * Authors:
- * Chris Lahey <clahey@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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 <stdio.h>
-#include <string.h>
-#include <gdk-pixbuf/gdk-pixbuf.h>
-
-#include "gal/e-util/e-cursors.h"
-#include "e-table-simple.h"
-#include "e-table-header.h"
-#include "e-table-header-item.h"
-#include "e-table-item.h"
-#include "e-cell-text.h"
-#include "e-cell-checkbox.h"
-#include "e-table.h"
-
-#include "table-test.h"
-
-/*
-One way in which we make it simpler to build an ETableModel is through
-the ETableSimple class. Instead of creating your own ETableModel
-class, you simply create a new object of the ETableSimple class. You
-give it a bunch of functions that act as callbacks.
-
-You also get to pass a void * to ETableSimple and it gets passed to
-your callbacks. This would be for having multiple models of the same
-type. This is just an example though, so we statically define all the
-data and ignore the void *data parameter.
-
-In our example we will be creating a table model with 6 columns and 10
-rows. This corresponds to having 6 different types of information and
-10 different sets of data in our database.
-
-The headers will be hard coded, as will be the example data.
-
-*/
-
-/*
- There are two different meanings to the word "column". The first is
- the model column. A model column corresponds to a specific type of
- data. This is very much like the usage in a database table where a
- column is a field in the database.
-
- The second type of column is a view column. A view column
- corresponds to a visually displayed column. Each view column
- corresponds to a specific model column, though a model column may
- have any number of view columns associated with it, from zero to
- greater than one.
-
- Also, a view column doesn't necessarily depend on only one model
- column. In some cases, the view column renderer can be given a
- reference to another column to get extra information about its
- display.
-*/
-
-#define ROWS 10
-#define VIEW_COLS 4
-#define PHYSICAL_COLS 5
-#define VIRTUAL_COLS 6
-
-#define IMPORTANCE_COLUMN 4
-#define COLOR_COLUMN 5
-
-/* Here we define the initial layout of the table. This is an xml
- format that allows you to change the initial ordering of the
- columns or to do sorting or grouping initially. This specification
- shows all 5 columns, but moves the importance column nearer to the
- front. It also sorts by the "Full Name" column (ascending.)
- Sorting and grouping take the model column as their arguments
- (sorting is specified by the "column" argument to the leaf elemnt. */
-#define INITIAL_SPEC "<ETableSpecification> \
- <columns-shown> \
- <column> 0 </column> \
- <column> 4 </column> \
- <column> 1 </column> \
- <column> 2 </column> \
- <column> 3 </column> \
- </columns-shown> \
- <grouping> <leaf column=\"1\" ascending=\"true\"/> </grouping> \
-</ETableSpecification>"
-
-char *headers[VIEW_COLS] = {
- "Email",
- "Full Name",
- "Address",
- "Phone"
-};
-
-/* Virtual Column list:
- 0 Full Name
- 1 Email
- 2 Address
- 3 Phone
- 4 Importance field. This field will be a boolean. It also has a
- special header, so doesn't appear in the headers list.
- 5 Color field. This column is also not displayed. It is also
- not stored in the database. It's calculated based on the
- Importance field.
-*/
-
-char *table_data[ROWS][VIEW_COLS];
-gboolean importance_data[ROWS];
-
-/*
- * ETableSimple callbacks
- * These are the callbacks that define the behavior of our custom model.
- */
-
-/* Since our model is a constant size, we can just return its size in
- the column and row count fields. */
-
-static GdkColor *color1;
-static GdkColor *color2;
-
-static int
-my_col_count (ETableModel *etc, void *data)
-{
- return VIRTUAL_COLS;
-}
-
-static int
-my_row_count (ETableModel *etc, void *data)
-{
- return ROWS;
-}
-
-static void *
-my_value_at (ETableModel *etc, int col, int row, void *data)
-{
- if (col == COLOR_COLUMN){
- if (importance_data[row]){
- return color1;
- } else {
- return color2;
- }
- } else if (col == IMPORTANCE_COLUMN){
- return (gpointer) importance_data[row];
- } else {
- return (void *) table_data [row][col];
- }
-}
-
-static void
-my_set_value_at (ETableModel *etc, int col, int row, const void *val, void *data)
-{
- if (col == COLOR_COLUMN){
- } else if (col == IMPORTANCE_COLUMN){
- importance_data[row] = (gboolean) val;
- } else {
- g_free (table_data [row][col]);
- table_data [row][col] = g_strdup (val);
- }
-}
-
-static gboolean
-my_is_cell_editable (ETableModel *etc, int col, int row, void *data)
-{
- if (col == IMPORTANCE_COLUMN)
- return FALSE;
- else
- return TRUE;
-}
-
-static void *
-my_duplicate_value (ETableModel *etc, int col, const void *value, void *data)
-{
- if (col == COLOR_COLUMN){
- return (void *) value;
- } else if (col == IMPORTANCE_COLUMN){
- return (void *) value;
- } else {
- return g_strdup (value);
- }
-}
-
-static void
-my_free_value (ETableModel *etc, int col, void *value, void *data)
-{
- if (col == COLOR_COLUMN){
- } else if (col == IMPORTANCE_COLUMN){
- } else {
- g_free (value);
- }
-}
-
-static void *
-my_initialize_value (ETableModel *etc, int col, void *data)
-{
- if (col == COLOR_COLUMN){
- return NULL;
- } else if (col == IMPORTANCE_COLUMN){
- return NULL;
- } else {
- return g_strdup ("");
- }
-}
-
-static gboolean
-my_value_is_empty (ETableModel *etc, int col, const void *value, void *data)
-{
- if (col == COLOR_COLUMN){
- return value == NULL;
- } else if (col == IMPORTANCE_COLUMN){
- return value == NULL;
- } else {
- return !(value && *(char *)value);
- }
-}
-
-static char *
-my_value_to_string (ETableModel *etc, int col, const void *value, void *data)
-{
- if (col == COLOR_COLUMN){
- return g_strdup_printf("%d", (int) value);
- } else if (col == IMPORTANCE_COLUMN){
- return g_strdup_printf("%d", (int) value);
- } else {
- return g_strdup(value);
- }
-}
-
-/* We create a window containing our new table. */
-static void
-create_table ()
-{
- GtkWidget *e_table, *window, *frame;
- ECell *cell_left_just;
- ECell *cell_checkbox;
- ETableHeader *e_table_header;
- int i, j;
- ETableModel *e_table_model = NULL;
- ETableCol *ecol;
- GdkPixbuf *pixbuf;
-
- /* First we fill in the simple data. */
- for (i = 0; i < ROWS; i++){
- for (j = 0; j < VIEW_COLS; j++){
- table_data[i][j] = g_strdup ("");
- }
- importance_data[i] = FALSE;
- }
- /* Next we create our model. This uses the functions we defined
- earlier. */
- e_table_model = e_table_simple_new (
- my_col_count, my_row_count, my_value_at,
- my_set_value_at, my_is_cell_editable,
- my_duplicate_value, my_free_value,
- my_initialize_value, my_value_is_empty,
- my_value_to_string,
- NULL);
- /*
- 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 (e_table_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 < VIEW_COLS; i++){
- /* Create the column. */
- ETableCol *ecol = e_table_col_new (
- i, headers [i],
- 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);
- }
-
- /* Next we add a special column for the check box. */
-
- cell_checkbox = e_cell_checkbox_new ();
- pixbuf = gdk_pixbuf_new_from_file ("clip.png");
- ecol = e_table_col_new_with_pixbuf (i, pixbuf, 0.0, 18, cell_checkbox, g_int_compare, TRUE);
- e_table_header_add_column (e_table_header, ecol, i);
-
- /*
- * Setup GUI
- */
- /* Here we create a window for our new table. This window
- will get shown and the person will be able to test their
- item. */
- window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
- /* This frame is simply to get a bevel around our table. */
- frame = gtk_frame_new (NULL);
- /* 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. */
- e_table = e_table_new (e_table_header, e_table_model, INITIAL_SPEC);
-
- /* Build the gtk widget hierarchy. */
- gtk_container_add (GTK_CONTAINER (frame), e_table);
- gtk_container_add (GTK_CONTAINER (window), frame);
-
- /* Size the initial window. */
- gtk_widget_set_usize (window, 200, 200);
- /* Show it all. */
- gtk_widget_show_all (window);
-}
-
-
-
-int
-main (int argc, char *argv [])
-{
- gnome_init ("TableExample", "TableExample", argc, argv);
- e_cursors_init ();
-
- gtk_widget_push_colormap (gdk_rgb_get_cmap ());
-
- create_table ();
-
- gtk_main ();
-
- e_cursors_shutdown ();
- return 0;
-}
diff --git a/widgets/table/e-table-extras.c b/widgets/table/e-table-extras.c
deleted file mode 100644
index 81947a6e94..0000000000
--- a/widgets/table/e-table-extras.c
+++ /dev/null
@@ -1,292 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-table-extras.c - Set of hash table sort of thingies.
- * Copyright 2000, 2001, Ximian, Inc.
- *
- * Authors:
- * Chris Lahey <clahey@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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 <stdlib.h>
-#include <gtk/gtksignal.h>
-#include "gal/util/e-util.h"
-#include "gal/e-table/e-cell-text.h"
-#include "gal/e-table/e-cell-checkbox.h"
-#include "gal/e-table/e-cell-date.h"
-#include "gal/e-table/e-cell-number.h"
-#include "gal/e-table/e-cell-pixbuf.h"
-#include "gal/e-table/e-cell-size.h"
-#include "gal/e-table/e-cell-tree.h"
-#include "e-table-extras.h"
-#include <string.h>
-
-static GObjectClass *ete_parent_class;
-
-static void
-cell_hash_free(gchar *key,
- ECell *cell,
- gpointer user_data)
-{
- g_free(key);
- if (cell)
- g_object_unref(cell);
-}
-
-static void
-pixbuf_hash_free(gchar *key,
- GdkPixbuf *pixbuf,
- gpointer user_data)
-{
- g_free(key);
- if (pixbuf)
- gdk_pixbuf_unref(pixbuf);
-}
-
-static void
-ete_finalize (GObject *object)
-{
- ETableExtras *ete = E_TABLE_EXTRAS (object);
-
- if (ete->cells) {
- g_hash_table_foreach (ete->cells, (GHFunc) cell_hash_free, NULL);
- g_hash_table_destroy (ete->cells);
- }
-
- if (ete->compares) {
- g_hash_table_foreach (ete->compares, (GHFunc) g_free, NULL);
- g_hash_table_destroy (ete->compares);
- }
-
- if (ete->searches) {
- g_hash_table_foreach (ete->searches, (GHFunc) g_free, NULL);
- g_hash_table_destroy (ete->searches);
- }
-
- if (ete->pixbufs) {
- g_hash_table_foreach (ete->pixbufs, (GHFunc) pixbuf_hash_free, NULL);
- g_hash_table_destroy (ete->pixbufs);
- }
-
- ete->cells = NULL;
- ete->compares = NULL;
- ete->searches = NULL;
- ete->pixbufs = NULL;
-
- ete_parent_class->finalize (object);
-}
-
-static void
-ete_class_init (GObjectClass *klass)
-{
- ete_parent_class = g_type_class_peek_parent (klass);
-
- klass->finalize = ete_finalize;
-}
-
-static gint
-e_strint_compare(gconstpointer data1, gconstpointer data2)
-{
- int int1 = atoi(data1);
- int int2 = atoi(data2);
-
- return g_int_compare(GINT_TO_POINTER(int1), GINT_TO_POINTER(int2));
-}
-
-/* UTF-8 strncasecmp - not optimized */
-
-static gint
-g_utf8_strncasecmp (const gchar *s1,
- const gchar *s2,
- guint n)
-{
- gunichar c1, c2;
-
- g_return_val_if_fail (s1 != NULL && g_utf8_validate (s1, -1, NULL), 0);
- g_return_val_if_fail (s2 != NULL && g_utf8_validate (s2, -1, NULL), 0);
-
- while (n && *s1 && *s2)
- {
-
- n -= 1;
-
- c1 = g_unichar_tolower (g_utf8_get_char (s1));
- c2 = g_unichar_tolower (g_utf8_get_char (s2));
-
- /* Collation is locale-dependent, so this totally fails to do the right thing. */
- if (c1 != c2)
- return c1 < c2 ? -1 : 1;
-
- s1 = g_utf8_next_char (s1);
- s2 = g_utf8_next_char (s2);
- }
-
- if (n == 0 || (*s1 == '\0' && *s2 == '\0'))
- return 0;
-
- return *s1 ? 1 : -1;
-}
-
-static gboolean
-e_string_search(gconstpointer haystack, const char *needle)
-{
- int length;
- if (haystack == NULL)
- return FALSE;
-
- length = g_utf8_strlen (needle, -1);
- if (g_utf8_strncasecmp (haystack, needle, length) == 0)
- return TRUE;
- else
- return FALSE;
-}
-
-static void
-ete_init (ETableExtras *extras)
-{
- extras->cells = g_hash_table_new(g_str_hash, g_str_equal);
- extras->compares = g_hash_table_new(g_str_hash, g_str_equal);
- extras->searches = g_hash_table_new(g_str_hash, g_str_equal);
- extras->pixbufs = g_hash_table_new(g_str_hash, g_str_equal);
-
- e_table_extras_add_compare(extras, "string", g_str_compare);
- e_table_extras_add_compare(extras, "collate", g_collate_compare);
- e_table_extras_add_compare(extras, "integer", g_int_compare);
- e_table_extras_add_compare(extras, "string-integer", e_strint_compare);
-
- e_table_extras_add_search(extras, "string", e_string_search);
-
- e_table_extras_add_cell(extras, "checkbox", e_cell_checkbox_new());
- e_table_extras_add_cell(extras, "date", e_cell_date_new (NULL, GTK_JUSTIFY_LEFT));
- e_table_extras_add_cell(extras, "number", e_cell_number_new (NULL, GTK_JUSTIFY_RIGHT));
- e_table_extras_add_cell(extras, "pixbuf", e_cell_pixbuf_new ());
- e_table_extras_add_cell(extras, "size", e_cell_size_new (NULL, GTK_JUSTIFY_RIGHT));
- e_table_extras_add_cell(extras, "string", e_cell_text_new (NULL, GTK_JUSTIFY_LEFT));
- e_table_extras_add_cell(extras, "tree-string", e_cell_tree_new (NULL, NULL, TRUE, e_cell_text_new (NULL, GTK_JUSTIFY_LEFT)));
-}
-
-E_MAKE_TYPE(e_table_extras, "ETableExtras", ETableExtras, ete_class_init, ete_init, G_TYPE_OBJECT)
-
-ETableExtras *
-e_table_extras_new (void)
-{
- ETableExtras *ete = g_object_new (E_TABLE_EXTRAS_TYPE, NULL);
-
- return (ETableExtras *) ete;
-}
-
-void
-e_table_extras_add_cell (ETableExtras *extras,
- char *id,
- ECell *cell)
-{
- gchar *old_key;
- ECell *old_cell;
-
- if (g_hash_table_lookup_extended (extras->cells, id, (gpointer *)&old_key, (gpointer *)&old_cell)) {
- g_hash_table_remove (extras->cells, old_key);
- g_free (old_key);
- if (old_cell)
- g_object_unref (old_cell);
- }
-
- if (cell) {
- g_object_ref (cell);
- gtk_object_sink (GTK_OBJECT (cell));
- }
- g_hash_table_insert (extras->cells, g_strdup(id), cell);
-}
-
-ECell *
-e_table_extras_get_cell (ETableExtras *extras,
- char *id)
-{
- return g_hash_table_lookup(extras->cells, id);
-}
-
-void
-e_table_extras_add_compare (ETableExtras *extras,
- char *id,
- GCompareFunc compare)
-{
- gchar *old_key;
- GCompareFunc old_compare;
-
- if (g_hash_table_lookup_extended (extras->compares, id, (gpointer *)&old_key, (gpointer *)&old_compare)) {
- g_hash_table_remove (extras->compares, old_key);
- g_free (old_key);
- }
-
- g_hash_table_insert(extras->compares, g_strdup(id), (gpointer) compare);
-}
-
-GCompareFunc
-e_table_extras_get_compare (ETableExtras *extras,
- char *id)
-{
- return (GCompareFunc) g_hash_table_lookup(extras->compares, id);
-}
-
-void
-e_table_extras_add_search (ETableExtras *extras,
- char *id,
- ETableSearchFunc search)
-{
- gchar *old_key;
- ETableSearchFunc old_search;
-
- if (g_hash_table_lookup_extended (extras->searches, id, (gpointer *)&old_key, (gpointer *)&old_search)) {
- g_hash_table_remove (extras->searches, old_key);
- g_free (old_key);
- }
-
- g_hash_table_insert(extras->searches, g_strdup(id), search);
-}
-
-ETableSearchFunc
-e_table_extras_get_search (ETableExtras *extras,
- char *id)
-{
- return g_hash_table_lookup(extras->searches, id);
-}
-
-void
-e_table_extras_add_pixbuf (ETableExtras *extras,
- char *id,
- GdkPixbuf *pixbuf)
-{
- gchar *old_key;
- GdkPixbuf *old_pixbuf;
-
- if (g_hash_table_lookup_extended (extras->pixbufs, id, (gpointer *)&old_key, (gpointer *)&old_pixbuf)) {
- g_hash_table_remove (extras->cells, old_key);
- g_free (old_key);
- if (old_pixbuf)
- gdk_pixbuf_unref (old_pixbuf);
- }
-
- if (pixbuf)
- gdk_pixbuf_ref(pixbuf);
- g_hash_table_insert (extras->pixbufs, g_strdup(id), pixbuf);
-}
-
-GdkPixbuf *
-e_table_extras_get_pixbuf (ETableExtras *extras,
- char *id)
-{
- return g_hash_table_lookup(extras->pixbufs, id);
-}
diff --git a/widgets/table/e-table-extras.h b/widgets/table/e-table-extras.h
deleted file mode 100644
index bd478e0bd8..0000000000
--- a/widgets/table/e-table-extras.h
+++ /dev/null
@@ -1,82 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-table-extras.h
- * Copyright 2000, 2001, Ximian, Inc.
- *
- * Authors:
- * Chris Lahey <clahey@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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.
- */
-
-#ifndef _E_TABLE_EXTRAS_H_
-#define _E_TABLE_EXTRAS_H_
-
-#include <glib-object.h>
-#include <gal/e-table/e-cell.h>
-#include <gdk-pixbuf/gdk-pixbuf.h>
-
-G_BEGIN_DECLS
-
-#define E_TABLE_EXTRAS_TYPE (e_table_extras_get_type ())
-#define E_TABLE_EXTRAS(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), E_TABLE_EXTRAS_TYPE, ETableExtras))
-#define E_TABLE_EXTRAS_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), E_TABLE_EXTRAS_TYPE, ETableExtrasClass))
-#define E_IS_TABLE_EXTRAS(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), E_TABLE_EXTRAS_TYPE))
-#define E_IS_TABLE_EXTRAS_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), E_TABLE_EXTRAS_TYPE))
-#define E_TABLE_EXTRAS_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), E_TABLE_EXTRAS_TYPE, ETableExtrasClass))
-
-typedef struct {
- GObject base;
-
- GHashTable *cells;
- GHashTable *compares;
- GHashTable *pixbufs;
- GHashTable *searches;
-} ETableExtras;
-
-typedef struct {
- GObjectClass parent_class;
-} ETableExtrasClass;
-
-GType e_table_extras_get_type (void);
-ETableExtras *e_table_extras_new (void);
-
-void e_table_extras_add_cell (ETableExtras *extras,
- char *id,
- ECell *cell);
-ECell *e_table_extras_get_cell (ETableExtras *extras,
- char *id);
-
-void e_table_extras_add_compare (ETableExtras *extras,
- char *id,
- GCompareFunc compare);
-GCompareFunc e_table_extras_get_compare (ETableExtras *extras,
- char *id);
-
-void e_table_extras_add_search (ETableExtras *extras,
- char *id,
- ETableSearchFunc search);
-ETableSearchFunc e_table_extras_get_search (ETableExtras *extras,
- char *id);
-
-void e_table_extras_add_pixbuf (ETableExtras *extras,
- char *id,
- GdkPixbuf *pixbuf);
-GdkPixbuf *e_table_extras_get_pixbuf (ETableExtras *extras,
- char *id);
-
-G_END_DECLS
-
-#endif /* _E_TABLE_EXTRAS_H_ */
diff --git a/widgets/table/e-table-field-chooser-dialog.c b/widgets/table/e-table-field-chooser-dialog.c
deleted file mode 100644
index d7e725fd12..0000000000
--- a/widgets/table/e-table-field-chooser-dialog.c
+++ /dev/null
@@ -1,224 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-table-field-chooser-dialog.c
- * Copyright 2000, 2001, Ximian, Inc.
- *
- * Authors:
- * Chris Lahey <clahey@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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 "e-table-field-chooser-dialog.h"
-#include "gal/util/e-i18n.h"
-#include "gal/util/e-util.h"
-#include <gtk/gtkstock.h>
-
-static void e_table_field_chooser_dialog_init (ETableFieldChooserDialog *card);
-static void e_table_field_chooser_dialog_class_init (ETableFieldChooserDialogClass *klass);
-static void e_table_field_chooser_dialog_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec);
-static void e_table_field_chooser_dialog_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec);
-static void e_table_field_chooser_dialog_dispose (GObject *object);
-static void e_table_field_chooser_dialog_response (GtkDialog *dialog, gint id);
-
-#define PARENT_TYPE GTK_TYPE_DIALOG
-static GtkDialogClass *parent_class = NULL;
-
-/* The arguments we take */
-enum {
- PROP_0,
- PROP_DND_CODE,
- PROP_FULL_HEADER,
- PROP_HEADER
-};
-
-E_MAKE_TYPE (e_table_field_chooser_dialog,
- "ETableFieldChooserDialog",
- ETableFieldChooserDialog,
- e_table_field_chooser_dialog_class_init,
- e_table_field_chooser_dialog_init,
- PARENT_TYPE);
-
-static void
-e_table_field_chooser_dialog_class_init (ETableFieldChooserDialogClass *klass)
-{
- GObjectClass *object_class;
- GtkDialogClass *dialog_class;
-
- object_class = (GObjectClass*) klass;
- dialog_class = GTK_DIALOG_CLASS (klass);
-
- parent_class = g_type_class_ref (PARENT_TYPE);
-
- object_class->dispose = e_table_field_chooser_dialog_dispose;
- object_class->set_property = e_table_field_chooser_dialog_set_property;
- object_class->get_property = e_table_field_chooser_dialog_get_property;
-
- dialog_class->response = e_table_field_chooser_dialog_response;
-
- g_object_class_install_property (object_class, PROP_DND_CODE,
- g_param_spec_string ("dnd_code",
- _("DnD code"),
- /*_( */"XXX blurb" /*)*/,
- NULL,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_FULL_HEADER,
- g_param_spec_object ("full_header",
- _("Full Header"),
- /*_( */"XXX blurb" /*)*/,
- E_TABLE_HEADER_TYPE,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_HEADER,
- g_param_spec_object ("header",
- _("Header"),
- /*_( */"XXX blurb" /*)*/,
- E_TABLE_HEADER_TYPE,
- G_PARAM_READWRITE));
-}
-
-static void
-e_table_field_chooser_dialog_init (ETableFieldChooserDialog *e_table_field_chooser_dialog)
-{
- GtkWidget *widget;
-
- e_table_field_chooser_dialog->etfc = NULL;
- e_table_field_chooser_dialog->dnd_code = g_strdup("");
- e_table_field_chooser_dialog->full_header = NULL;
- e_table_field_chooser_dialog->header = NULL;
-
- gtk_dialog_add_button(GTK_DIALOG(e_table_field_chooser_dialog),
- GTK_STOCK_CLOSE, GTK_RESPONSE_OK);
-
- gtk_window_set_policy(GTK_WINDOW(e_table_field_chooser_dialog), FALSE, TRUE, FALSE);
-
- widget = e_table_field_chooser_new();
- e_table_field_chooser_dialog->etfc = E_TABLE_FIELD_CHOOSER(widget);
-
- g_object_set(widget,
- "dnd_code", e_table_field_chooser_dialog->dnd_code,
- "full_header", e_table_field_chooser_dialog->full_header,
- "header", e_table_field_chooser_dialog->header,
- NULL);
-
- gtk_box_pack_start(GTK_BOX(GTK_DIALOG(e_table_field_chooser_dialog)->vbox),
- widget, TRUE, TRUE, 0);
-
- gtk_widget_show(GTK_WIDGET(widget));
-
- gtk_window_set_title (GTK_WINDOW (e_table_field_chooser_dialog), _("Add a column..."));
-}
-
-GtkWidget*
-e_table_field_chooser_dialog_new (void)
-{
- GtkWidget *widget = g_object_new (E_TABLE_FIELD_CHOOSER_DIALOG_TYPE, NULL);
- return widget;
-}
-
-static void
-e_table_field_chooser_dialog_dispose (GObject *object)
-{
- ETableFieldChooserDialog *etfcd = E_TABLE_FIELD_CHOOSER_DIALOG (object);
-
- if (etfcd->dnd_code)
- g_free (etfcd->dnd_code);
- etfcd->dnd_code = NULL;
-
- if (etfcd->full_header)
- g_object_unref (etfcd->full_header);
- etfcd->full_header = NULL;
-
- if (etfcd->header)
- g_object_unref (etfcd->header);
- etfcd->header = NULL;
-
- G_OBJECT_CLASS (parent_class)->dispose (object);
-}
-
-static void
-e_table_field_chooser_dialog_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec)
-{
- ETableFieldChooserDialog *etfcd = E_TABLE_FIELD_CHOOSER_DIALOG(object);
- switch (prop_id){
- case PROP_DND_CODE:
- g_free(etfcd->dnd_code);
- etfcd->dnd_code = g_strdup(g_value_get_string (value));
- if (etfcd->etfc)
- g_object_set(etfcd->etfc,
- "dnd_code", etfcd->dnd_code,
- NULL);
- break;
- case PROP_FULL_HEADER:
- if (etfcd->full_header)
- g_object_unref (etfcd->full_header);
- if (g_value_get_object (value))
- etfcd->full_header = E_TABLE_HEADER(g_value_get_object (value));
- else
- etfcd->full_header = NULL;
- if (etfcd->full_header)
- g_object_ref (etfcd->full_header);
- if (etfcd->etfc)
- g_object_set(etfcd->etfc,
- "full_header", etfcd->full_header,
- NULL);
- break;
- case PROP_HEADER:
- if (etfcd->header)
- g_object_unref (etfcd->header);
- if (g_value_get_object (value))
- etfcd->header = E_TABLE_HEADER(g_value_get_object (value));
- else
- etfcd->header = NULL;
- if (etfcd->header)
- g_object_ref (etfcd->header);
- if (etfcd->etfc)
- g_object_set(etfcd->etfc,
- "header", etfcd->header,
- NULL);
- break;
- default:
- break;
- }
-}
-
-static void
-e_table_field_chooser_dialog_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec)
-{
- ETableFieldChooserDialog *etfcd = E_TABLE_FIELD_CHOOSER_DIALOG(object);
- switch (prop_id) {
- case PROP_DND_CODE:
- g_value_set_string (value, g_strdup (etfcd->dnd_code));
- break;
- case PROP_FULL_HEADER:
- g_value_set_object (value, etfcd->full_header);
- break;
- case PROP_HEADER:
- g_value_set_object (value, etfcd->header);
- break;
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
- break;
- }
-}
-
-static void
-e_table_field_chooser_dialog_response (GtkDialog *dialog, int id)
-{
- if (id == GTK_RESPONSE_OK)
- gtk_widget_destroy (GTK_WIDGET (dialog));
-}
diff --git a/widgets/table/e-table-field-chooser-dialog.h b/widgets/table/e-table-field-chooser-dialog.h
deleted file mode 100644
index 83fd5d3738..0000000000
--- a/widgets/table/e-table-field-chooser-dialog.h
+++ /dev/null
@@ -1,79 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-table-field-chooser-dialog.h
- * Copyright 2000, 2001, Ximian, Inc.
- *
- * Authors:
- * Chris Lahey <clahey@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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.
- */
-
-#ifndef __E_TABLE_FIELD_CHOOSER_DIALOG_H__
-#define __E_TABLE_FIELD_CHOOSER_DIALOG_H__
-
-#include <gtk/gtkdialog.h>
-#include <gal/e-table/e-table-field-chooser.h>
-#include <gal/e-table/e-table-header.h>
-
-#ifdef __cplusplus
-extern "C" {
-#pragma }
-#endif /* __cplusplus */
-
-/* ETableFieldChooserDialog - A dialog displaying information about a contact.
- *
- * The following arguments are available:
- *
- * name type read/write description
- * --------------------------------------------------------------------------------
- */
-
-#define E_TABLE_FIELD_CHOOSER_DIALOG_TYPE (e_table_field_chooser_dialog_get_type ())
-#define E_TABLE_FIELD_CHOOSER_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), E_TABLE_FIELD_CHOOSER_DIALOG_TYPE, ETableFieldChooserDialog))
-#define E_TABLE_FIELD_CHOOSER_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), E_TABLE_FIELD_CHOOSER_DIALOG_TYPE, ETableFieldChooserDialogClass))
-#define E_IS_TABLE_FIELD_CHOOSER_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), E_TABLE_FIELD_CHOOSER_DIALOG_TYPE))
-#define E_IS_TABLE_FIELD_CHOOSER_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), E_TABLE_FIELD_CHOOSER_DIALOG_TYPE))
-
-
-typedef struct _ETableFieldChooserDialog ETableFieldChooserDialog;
-typedef struct _ETableFieldChooserDialogClass ETableFieldChooserDialogClass;
-
-struct _ETableFieldChooserDialog
-{
- GtkDialog parent;
-
- /* item specific fields */
- ETableFieldChooser *etfc;
- gchar *dnd_code;
- ETableHeader *full_header;
- ETableHeader *header;
-};
-
-struct _ETableFieldChooserDialogClass
-{
- GtkDialogClass parent_class;
-};
-
-
-GtkWidget *e_table_field_chooser_dialog_new(void);
-GType e_table_field_chooser_dialog_get_type (void);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-
-#endif /* __E_TABLE_FIELD_CHOOSER_DIALOG_H__ */
diff --git a/widgets/table/e-table-field-chooser-item.c b/widgets/table/e-table-field-chooser-item.c
deleted file mode 100644
index cfc73fc102..0000000000
--- a/widgets/table/e-table-field-chooser-item.c
+++ /dev/null
@@ -1,711 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-table-field-chooser-item.c
- * Copyright 2000, 2001, Ximian, Inc.
- *
- * Authors:
- * Chris Lahey <clahey@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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 <string.h>
-#include <gtk/gtksignal.h>
-#include <gtk/gtkdnd.h>
-#include <libgnomecanvas/gnome-canvas.h>
-#include <libgnomecanvas/gnome-canvas-util.h>
-#include <libgnomecanvas/gnome-canvas-polygon.h>
-#include <libgnomecanvas/gnome-canvas-rect-ellipse.h>
-#include <gdk-pixbuf/gdk-pixbuf.h>
-
-#include "gal/util/e-i18n.h"
-#include "gal/util/e-util.h"
-#include "gal/util/e-xml-utils.h"
-#include "gal/widgets/e-canvas.h"
-
-#include "e-table-header.h"
-#include "e-table-col-dnd.h"
-#include "e-table-defines.h"
-#include "e-table-header-utils.h"
-
-#include "e-table-field-chooser-item.h"
-
-#define d(x)
-
-#if 0
-enum {
- BUTTON_PRESSED,
- LAST_SIGNAL
-};
-
-static guint etfci_signals [LAST_SIGNAL] = { 0, };
-#endif
-
-#define PARENT_OBJECT_TYPE gnome_canvas_item_get_type ()
-
-#define ELEMENTS(x) (sizeof (x) / sizeof (x[0]))
-
-static GnomeCanvasItemClass *etfci_parent_class;
-
-static void etfci_drop_table_header (ETableFieldChooserItem *etfci);
-static void etfci_drop_full_header (ETableFieldChooserItem *etfci);
-
-enum {
- PROP_0,
- PROP_FULL_HEADER,
- PROP_HEADER,
- PROP_DND_CODE,
- PROP_WIDTH,
- PROP_HEIGHT
-};
-
-static void
-etfci_dispose (GObject *object)
-{
- ETableFieldChooserItem *etfci = E_TABLE_FIELD_CHOOSER_ITEM (object);
-
- etfci_drop_table_header (etfci);
- etfci_drop_full_header (etfci);
-
- if (etfci->combined_header)
- g_object_unref (etfci->combined_header);
- etfci->combined_header = NULL;
-
- if (etfci->font)
- gdk_font_unref(etfci->font);
- etfci->font = NULL;
-
- if (G_OBJECT_CLASS (etfci_parent_class)->dispose)
- (*G_OBJECT_CLASS (etfci_parent_class)->dispose) (object);
-}
-
-static gint
-etfci_find_button (ETableFieldChooserItem *etfci, double loc)
-{
- int i;
- int count;
- double height = 0;
- GtkStyle *style;
-
- style = GTK_WIDGET (GNOME_CANVAS_ITEM (etfci)->canvas)->style;
-
- count = e_table_header_count(etfci->combined_header);
- for (i = 0; i < count; i++) {
- ETableCol *ecol;
-
- ecol = e_table_header_get_column (etfci->combined_header, i);
- if (ecol->disabled)
- continue;
- height += e_table_header_compute_height (ecol, GTK_WIDGET (GNOME_CANVAS_ITEM (etfci)->canvas));
- if (height > loc)
- return i;
- }
- return MAX(0, count - 1);
-}
-
-static void
-etfci_rebuild_combined (ETableFieldChooserItem *etfci)
-{
- int count;
- GHashTable *hash;
- int i;
-
- if (etfci->combined_header != NULL)
- g_object_unref (etfci->combined_header);
-
- etfci->combined_header = e_table_header_new ();
-
- hash = g_hash_table_new (NULL, NULL);
-
- count = e_table_header_count (etfci->header);
- for (i = 0; i < count; i++) {
- ETableCol *ecol = e_table_header_get_column (etfci->header, i);
- if (ecol->disabled)
- continue;
- g_hash_table_insert (hash, GINT_TO_POINTER (ecol->col_idx), GINT_TO_POINTER (1));
- }
-
- count = e_table_header_count (etfci->full_header);
- for (i = 0; i < count; i++) {
- ETableCol *ecol = e_table_header_get_column (etfci->full_header, i);
- if (ecol->disabled)
- continue;
- if (! (GPOINTER_TO_INT (g_hash_table_lookup (hash, GINT_TO_POINTER (ecol->col_idx)))))
- e_table_header_add_column (etfci->combined_header, ecol, -1);
- }
-
- g_hash_table_destroy (hash);
-}
-
-static void
-etfci_reflow (GnomeCanvasItem *item, gint flags)
-{
- ETableFieldChooserItem *etfci = E_TABLE_FIELD_CHOOSER_ITEM (item);
- double old_height;
- int i;
- int count;
- double height = 0;
- GtkStyle *style;
-
- etfci_rebuild_combined (etfci);
-
- style = GTK_WIDGET (GNOME_CANVAS_ITEM (etfci)->canvas)->style;
-
- old_height = etfci->height;
-
- count = e_table_header_count(etfci->combined_header);
- for (i = 0; i < count; i++) {
- ETableCol *ecol;
-
- ecol = e_table_header_get_column (etfci->combined_header, i);
- if (ecol->disabled)
- continue;
- height += e_table_header_compute_height (ecol, GTK_WIDGET (GNOME_CANVAS_ITEM (etfci)->canvas));
- }
-
- etfci->height = height;
-
- if (old_height != etfci->height)
- e_canvas_item_request_parent_reflow(item);
-
- gnome_canvas_item_request_update(item);
-}
-
-static void
-etfci_update (GnomeCanvasItem *item, double *affine, ArtSVP *clip_path, int flags)
-{
- ETableFieldChooserItem *etfci = E_TABLE_FIELD_CHOOSER_ITEM (item);
- double i2c [6];
- ArtPoint c1, c2, i1, i2;
-
- if (GNOME_CANVAS_ITEM_CLASS (etfci_parent_class)->update)
- (*GNOME_CANVAS_ITEM_CLASS (etfci_parent_class)->update)(item, affine, clip_path, flags);
-
- i1.x = i1.y = 0;
- i2.x = etfci->width;
- i2.y = etfci->height;
-
- gnome_canvas_item_i2c_affine (item, i2c);
- art_affine_point (&c1, &i1, i2c);
- art_affine_point (&c2, &i2, i2c);
-
- if (item->x1 != c1.x ||
- item->y1 != c1.y ||
- item->x2 != c2.x ||
- item->y2 != c2.y)
- {
- gnome_canvas_request_redraw (item->canvas, item->x1, item->y1, item->x2, item->y2);
- item->x1 = c1.x;
- item->y1 = c1.y;
- item->x2 = c2.x;
- item->y2 = c2.y;
-#ifndef NO_WARNINGS
-#warning Group Child bounds !?
-#endif
-#if 0
- gnome_canvas_group_child_bounds (GNOME_CANVAS_GROUP (item->parent), item);
-#endif
- }
- gnome_canvas_request_redraw (item->canvas, item->x1, item->y1, item->x2, item->y2);
-}
-
-static void
-etfci_font_load (ETableFieldChooserItem *etfci)
-{
- if (etfci->font)
- gdk_font_unref (etfci->font);
-
- etfci->font = gtk_style_get_font (GTK_WIDGET(GNOME_CANVAS_ITEM(etfci)->canvas)->style);
- gdk_font_ref(etfci->font);
-}
-
-static void
-etfci_drop_full_header (ETableFieldChooserItem *etfci)
-{
- GObject *header;
-
- if (!etfci->full_header)
- return;
-
- header = G_OBJECT (etfci->full_header);
- if (etfci->full_header_structure_change_id)
- g_signal_handler_disconnect (header, etfci->full_header_structure_change_id);
- if (etfci->full_header_dimension_change_id)
- g_signal_handler_disconnect (header, etfci->full_header_dimension_change_id);
- etfci->full_header_structure_change_id = 0;
- etfci->full_header_dimension_change_id = 0;
-
- if (header)
- g_object_unref (header);
- etfci->full_header = NULL;
- etfci->height = 0;
- e_canvas_item_request_reflow(GNOME_CANVAS_ITEM(etfci));
-}
-
-static void
-full_header_structure_changed (ETableHeader *header, ETableFieldChooserItem *etfci)
-{
- e_canvas_item_request_reflow(GNOME_CANVAS_ITEM(etfci));
-}
-
-static void
-full_header_dimension_changed (ETableHeader *header, int col, ETableFieldChooserItem *etfci)
-{
- e_canvas_item_request_reflow(GNOME_CANVAS_ITEM(etfci));
-}
-
-static void
-etfci_add_full_header (ETableFieldChooserItem *etfci, ETableHeader *header)
-{
- etfci->full_header = header;
- g_object_ref (etfci->full_header);
-
- etfci->full_header_structure_change_id = g_signal_connect (
- header, "structure_change",
- G_CALLBACK(full_header_structure_changed), etfci);
- etfci->full_header_dimension_change_id = g_signal_connect (
- header, "dimension_change",
- G_CALLBACK(full_header_dimension_changed), etfci);
- e_canvas_item_request_reflow(GNOME_CANVAS_ITEM(etfci));
-}
-
-static void
-etfci_drop_table_header (ETableFieldChooserItem *etfci)
-{
- GObject *header;
-
- if (!etfci->header)
- return;
-
- header = G_OBJECT (etfci->header);
- if (etfci->table_header_structure_change_id)
- g_signal_handler_disconnect (header, etfci->table_header_structure_change_id);
- if (etfci->table_header_dimension_change_id)
- g_signal_handler_disconnect (header, etfci->table_header_dimension_change_id);
- etfci->table_header_structure_change_id = 0;
- etfci->table_header_dimension_change_id = 0;
-
- if (header)
- g_object_unref (header);
- etfci->header = NULL;
- etfci->height = 0;
- e_canvas_item_request_reflow(GNOME_CANVAS_ITEM(etfci));
-}
-
-static void
-table_header_structure_changed (ETableHeader *header, ETableFieldChooserItem *etfci)
-{
- e_canvas_item_request_reflow(GNOME_CANVAS_ITEM(etfci));
-}
-
-static void
-table_header_dimension_changed (ETableHeader *header, int col, ETableFieldChooserItem *etfci)
-{
- e_canvas_item_request_reflow(GNOME_CANVAS_ITEM(etfci));
-}
-
-static void
-etfci_add_table_header (ETableFieldChooserItem *etfci, ETableHeader *header)
-{
- etfci->header = header;
- g_object_ref (etfci->header);
-
- etfci->table_header_structure_change_id = g_signal_connect (
- header, "structure_change",
- G_CALLBACK(table_header_structure_changed), etfci);
- etfci->table_header_dimension_change_id = g_signal_connect (
- header, "dimension_change",
- G_CALLBACK(table_header_dimension_changed), etfci);
- e_canvas_item_request_reflow(GNOME_CANVAS_ITEM(etfci));
-}
-
-static void
-etfci_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec)
-{
- GnomeCanvasItem *item;
- ETableFieldChooserItem *etfci;
-
- item = GNOME_CANVAS_ITEM (object);
- etfci = E_TABLE_FIELD_CHOOSER_ITEM (object);
-
- switch (prop_id){
- case PROP_FULL_HEADER:
- etfci_drop_full_header (etfci);
- if (g_value_get_object (value))
- etfci_add_full_header (etfci, E_TABLE_HEADER(g_value_get_object (value)));
- break;
-
- case PROP_HEADER:
- etfci_drop_table_header (etfci);
- if (g_value_get_object (value))
- etfci_add_table_header (etfci, E_TABLE_HEADER(g_value_get_object (value)));
- break;
-
- case PROP_DND_CODE:
- g_free(etfci->dnd_code);
- etfci->dnd_code = g_strdup(g_value_get_string (value));
- break;
-
- case PROP_WIDTH:
- etfci->width = g_value_get_double (value);
- gnome_canvas_item_request_update(item);
- break;
- }
-}
-
-static void
-etfci_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec)
-{
- GnomeCanvasItem *item;
- ETableFieldChooserItem *etfci;
-
- item = GNOME_CANVAS_ITEM (object);
- etfci = E_TABLE_FIELD_CHOOSER_ITEM (object);
-
- switch (prop_id){
-
- case PROP_DND_CODE:
- g_value_set_string (value, g_strdup (etfci->dnd_code));
- break;
- case PROP_WIDTH:
- g_value_set_double (value, etfci->width);
- break;
- case PROP_HEIGHT:
- g_value_set_double (value, etfci->height);
- break;
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
- break;
- }
-}
-
-static void
-etfci_drag_data_get (GtkWidget *widget,
- GdkDragContext *context,
- GtkSelectionData *selection_data,
- guint info,
- guint time,
- ETableFieldChooserItem *etfci)
-{
- if (etfci->drag_col != -1) {
- gchar *string = g_strdup_printf("%d", etfci->drag_col);
- gtk_selection_data_set(selection_data,
- GDK_SELECTION_TYPE_STRING,
- sizeof(string[0]),
- string,
- strlen(string));
- g_free(string);
- }
-}
-
-static void
-etfci_drag_end (GtkWidget *canvas,
- GdkDragContext *context,
- ETableFieldChooserItem *etfci)
-{
- etfci->drag_col = -1;
-}
-
-static void
-etfci_realize (GnomeCanvasItem *item)
-{
- ETableFieldChooserItem *etfci = E_TABLE_FIELD_CHOOSER_ITEM (item);
- GdkWindow *window;
-
- if (GNOME_CANVAS_ITEM_CLASS (etfci_parent_class)-> realize)
- (*GNOME_CANVAS_ITEM_CLASS (etfci_parent_class)->realize)(item);
-
- window = GTK_WIDGET (item->canvas)->window;
-
- if (!etfci->font)
- etfci_font_load (etfci);
-
- etfci->drag_end_id = g_signal_connect (
- item->canvas, "drag_end",
- G_CALLBACK (etfci_drag_end), etfci);
- etfci->drag_data_get_id = g_signal_connect (
- item->canvas, "drag_data_get",
- G_CALLBACK (etfci_drag_data_get), etfci);
- e_canvas_item_request_reflow(GNOME_CANVAS_ITEM(etfci));
-}
-
-static void
-etfci_unrealize (GnomeCanvasItem *item)
-{
- ETableFieldChooserItem *etfci = E_TABLE_FIELD_CHOOSER_ITEM (item);
-
- if (etfci->font)
- gdk_font_unref (etfci->font);
- etfci->font = NULL;
-
- g_signal_handler_disconnect (item->canvas, etfci->drag_end_id);
- etfci->drag_end_id = 0;
- g_signal_handler_disconnect (item->canvas, etfci->drag_data_get_id);
- etfci->drag_data_get_id = 0;
-
- if (GNOME_CANVAS_ITEM_CLASS (etfci_parent_class)->unrealize)
- (*GNOME_CANVAS_ITEM_CLASS (etfci_parent_class)->unrealize)(item);
-}
-
-static void
-etfci_draw (GnomeCanvasItem *item, GdkDrawable *drawable, int x, int y, int width, int height)
-{
- ETableFieldChooserItem *etfci = E_TABLE_FIELD_CHOOSER_ITEM (item);
- GnomeCanvas *canvas = item->canvas;
- int rows;
- int y1, y2;
- int row;
- GtkStyle *style;
- GtkStateType state;
-
- if (etfci->combined_header == NULL)
- return;
-
- rows = e_table_header_count (etfci->combined_header);
-
- style = GTK_WIDGET (canvas)->style;
- state = GTK_WIDGET_STATE (canvas);
-
- y1 = y2 = 0;
- for (row = 0; row < rows; row++, y1 = y2){
- ETableCol *ecol;
-
- ecol = e_table_header_get_column (etfci->combined_header, row);
-
- if (ecol->disabled)
- continue;
-
- y2 += e_table_header_compute_height (ecol, GTK_WIDGET (canvas));
-
- if (y1 > (y + height))
- break;
-
- if (y2 < y)
- continue;
-
- e_table_header_draw_button (drawable, ecol,
- style, state,
- GTK_WIDGET (canvas),
- -x, y1 - y,
- width, height,
- etfci->width, y2 - y1,
- E_TABLE_COL_ARROW_NONE);
- }
-}
-
-static double
-etfci_point (GnomeCanvasItem *item, double x, double y, int cx, int cy,
- GnomeCanvasItem **actual_item)
-{
- *actual_item = item;
- return 0.0;
-}
-
-static gboolean
-etfci_maybe_start_drag (ETableFieldChooserItem *etfci, int x, int y)
-{
- if (!etfci->maybe_drag)
- return FALSE;
-
- if (MAX (abs (etfci->click_x - x),
- abs (etfci->click_y - y)) <= 3)
- return FALSE;
-
- return TRUE;
-}
-
-static void
-etfci_start_drag (ETableFieldChooserItem *etfci, GdkEvent *event, double x, double y)
-{
- GtkWidget *widget = GTK_WIDGET (GNOME_CANVAS_ITEM (etfci)->canvas);
- GtkTargetList *list;
- GdkDragContext *context;
- ETableCol *ecol;
- GdkPixmap *pixmap;
- int drag_col;
- int button_height;
-
- GtkTargetEntry etfci_drag_types [] = {
- { TARGET_ETABLE_COL_TYPE, 0, TARGET_ETABLE_COL_HEADER },
- };
-
- if (etfci->combined_header == NULL)
- return;
-
- drag_col = etfci_find_button(etfci, y);
-
- if (drag_col < 0 || drag_col > e_table_header_count(etfci->combined_header))
- return;
-
- ecol = e_table_header_get_column (etfci->combined_header, drag_col);
-
- if (ecol->disabled)
- return;
-
- etfci->drag_col = ecol->col_idx;
-
- etfci_drag_types[0].target = g_strdup_printf("%s-%s", etfci_drag_types[0].target, etfci->dnd_code);
- d(g_print ("etfci - %s\n", etfci_drag_types[0].target));
- list = gtk_target_list_new (etfci_drag_types, ELEMENTS (etfci_drag_types));
- context = gtk_drag_begin (widget, list, GDK_ACTION_MOVE, 1, event);
- g_free(etfci_drag_types[0].target);
-
- button_height = e_table_header_compute_height (ecol, widget);
- pixmap = gdk_pixmap_new (widget->window, etfci->width, button_height, -1);
-
- e_table_header_draw_button (pixmap, ecol,
- widget->style, GTK_WIDGET_STATE (widget),
- widget,
- 0, 0,
- etfci->width, button_height,
- etfci->width, button_height,
- E_TABLE_COL_ARROW_NONE);
-
- gtk_drag_set_icon_pixmap (context,
- gdk_window_get_colormap (widget->window),
- pixmap,
- NULL,
- etfci->width / 2,
- button_height / 2);
- gdk_pixmap_unref (pixmap);
- etfci->maybe_drag = FALSE;
-}
-
-/*
- * Handles the events on the ETableFieldChooserItem
- */
-static int
-etfci_event (GnomeCanvasItem *item, GdkEvent *e)
-{
- ETableFieldChooserItem *etfci = E_TABLE_FIELD_CHOOSER_ITEM (item);
- GnomeCanvas *canvas = item->canvas;
- int x, y;
-
- switch (e->type){
- case GDK_MOTION_NOTIFY:
- gnome_canvas_w2c (canvas, e->motion.x, e->motion.y, &x, &y);
-
- if (etfci_maybe_start_drag (etfci, x, y))
- etfci_start_drag (etfci, e, x, y);
- break;
-
- case GDK_BUTTON_PRESS:
- gnome_canvas_w2c (canvas, e->button.x, e->button.y, &x, &y);
-
- if (e->button.button == 1){
- etfci->click_x = x;
- etfci->click_y = y;
- etfci->maybe_drag = TRUE;
- }
- break;
-
- case GDK_BUTTON_RELEASE: {
- etfci->maybe_drag = FALSE;
- break;
- }
-
- default:
- return FALSE;
- }
- return TRUE;
-}
-
-static void
-etfci_class_init (GObjectClass *object_class)
-{
- GnomeCanvasItemClass *item_class = (GnomeCanvasItemClass *) object_class;
-
- etfci_parent_class = g_type_class_ref (PARENT_OBJECT_TYPE);
-
- object_class->dispose = etfci_dispose;
- object_class->set_property = etfci_set_property;
- object_class->get_property = etfci_get_property;
-
- item_class->update = etfci_update;
- item_class->realize = etfci_realize;
- item_class->unrealize = etfci_unrealize;
- item_class->draw = etfci_draw;
- item_class->point = etfci_point;
- item_class->event = etfci_event;
-
- g_object_class_install_property (object_class, PROP_DND_CODE,
- g_param_spec_string ("dnd_code",
- _("DnD code"),
- /*_( */"XXX blurb" /*)*/,
- NULL,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_FULL_HEADER,
- g_param_spec_object ("full_header",
- _("Full Header"),
- /*_( */"XXX blurb" /*)*/,
- E_TABLE_HEADER_TYPE,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_HEADER,
- g_param_spec_object ("header",
- _("Header"),
- /*_( */"XXX blurb" /*)*/,
- E_TABLE_HEADER_TYPE,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_WIDTH,
- g_param_spec_double ("width",
- _("Width"),
- /*_( */"XXX blurb" /*)*/,
- 0, G_MAXDOUBLE, 0,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_HEIGHT,
- g_param_spec_double ("height",
- _("Height"),
- /*_( */"XXX blurb" /*)*/,
- 0, G_MAXDOUBLE, 0,
- G_PARAM_READABLE));
-}
-
-static void
-etfci_init (GnomeCanvasItem *item)
-{
- ETableFieldChooserItem *etfci = E_TABLE_FIELD_CHOOSER_ITEM (item);
-
- etfci->full_header = NULL;
- etfci->header = NULL;
- etfci->combined_header = NULL;
-
- etfci->height = etfci->width = 0;
-
- etfci->font = NULL;
-
- etfci->full_header_structure_change_id = 0;
- etfci->full_header_dimension_change_id = 0;
- etfci->table_header_structure_change_id = 0;
- etfci->table_header_dimension_change_id = 0;
-
- etfci->dnd_code = NULL;
-
- etfci->maybe_drag = 0;
- etfci->drag_end_id = 0;
-
- e_canvas_item_set_reflow_callback(item, etfci_reflow);
-}
-
-E_MAKE_TYPE (e_table_field_chooser_item,
- "ETableFieldChooserItem",
- ETableFieldChooserItem,
- etfci_class_init,
- etfci_init,
- PARENT_OBJECT_TYPE);
diff --git a/widgets/table/e-table-field-chooser-item.h b/widgets/table/e-table-field-chooser-item.h
deleted file mode 100644
index 2ed37d37f1..0000000000
--- a/widgets/table/e-table-field-chooser-item.h
+++ /dev/null
@@ -1,75 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-table-field-chooser-item.h
- * Copyright 2000, 2001, Ximian, Inc.
- *
- * Authors:
- * Chris Lahey <clahey@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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.
- */
-
-#ifndef _E_TABLE_FIELD_CHOOSER_ITEM_H_
-#define _E_TABLE_FIELD_CHOOSER_ITEM_H_
-
-#include <libgnomecanvas/gnome-canvas.h>
-#include <libxml/tree.h>
-#include <gal/e-table/e-table-header.h>
-
-G_BEGIN_DECLS
-
-#define E_TABLE_FIELD_CHOOSER_ITEM_TYPE (e_table_field_chooser_item_get_type ())
-#define E_TABLE_FIELD_CHOOSER_ITEM(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), E_TABLE_FIELD_CHOOSER_ITEM_TYPE, ETableFieldChooserItem))
-#define E_TABLE_FIELD_CHOOSER_ITEM_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), E_TABLE_FIELD_CHOOSER_ITEM_TYPE, ETableFieldChooserItemClass))
-#define E_IS_TABLE_FIELD_CHOOSER_ITEM(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), E_TABLE_FIELD_CHOOSER_ITEM_TYPE))
-#define E_IS_TABLE_FIELD_CHOOSER_ITEM_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), E_TABLE_FIELD_CHOOSER_ITEM_TYPE))
-
-typedef struct {
- GnomeCanvasItem parent;
- ETableHeader *full_header;
- ETableHeader *header;
- ETableHeader *combined_header;
-
- double height, width;
-
- GdkFont *font;
-
- /*
- * Ids
- */
- int full_header_structure_change_id, full_header_dimension_change_id;
- int table_header_structure_change_id, table_header_dimension_change_id;
-
- gchar *dnd_code;
-
- /*
- * For dragging columns
- */
- guint maybe_drag:1;
- int click_x, click_y;
- int drag_col;
- guint drag_data_get_id;
- guint drag_end_id;
-} ETableFieldChooserItem;
-
-typedef struct {
- GnomeCanvasItemClass parent_class;
-} ETableFieldChooserItemClass;
-
-GType e_table_field_chooser_item_get_type (void);
-
-G_END_DECLS
-
-#endif /* _E_TABLE_FIELD_CHOOSER_ITEM_H_ */
diff --git a/widgets/table/e-table-field-chooser.c b/widgets/table/e-table-field-chooser.c
deleted file mode 100644
index e5d8510055..0000000000
--- a/widgets/table/e-table-field-chooser.c
+++ /dev/null
@@ -1,282 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-table-field-chooser.c
- * Copyright 2000, 2001, Ximian, Inc.
- *
- * Authors:
- * Chris Lahey <clahey@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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 <gtk/gtksignal.h>
-#include <gtk/gtk.h>
-#include <gtk/gtkbox.h>
-#include <libgnomecanvas/gnome-canvas-rect-ellipse.h>
-#include "e-table-field-chooser.h"
-#include "e-table-field-chooser-item.h"
-#include <gal/util/e-i18n.h>
-#include <gal/util/e-util.h>
-
-static void e_table_field_chooser_init (ETableFieldChooser *card);
-static void e_table_field_chooser_class_init (ETableFieldChooserClass *klass);
-static void e_table_field_chooser_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec);
-static void e_table_field_chooser_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec);
-static void e_table_field_chooser_dispose (GObject *object);
-
-#define PARENT_TYPE GTK_TYPE_VBOX
-static GtkVBoxClass *parent_class = NULL;
-
-/* The arguments we take */
-enum {
- PROP_0,
- PROP_FULL_HEADER,
- PROP_HEADER,
- PROP_DND_CODE
-};
-
-E_MAKE_TYPE (e_table_field_chooser,
- "ETableFieldChooser",
- ETableFieldChooser,
- e_table_field_chooser_class_init,
- e_table_field_chooser_init,
- PARENT_TYPE);
-
-static void
-e_table_field_chooser_class_init (ETableFieldChooserClass *klass)
-{
- GObjectClass *object_class;
- GtkVBoxClass *vbox_class;
-
- object_class = (GObjectClass*) klass;
- vbox_class = (GtkVBoxClass *) klass;
-
- glade_init();
-
- parent_class = g_type_class_ref (GTK_TYPE_VBOX);
-
- object_class->set_property = e_table_field_chooser_set_property;
- object_class->get_property = e_table_field_chooser_get_property;
- object_class->dispose = e_table_field_chooser_dispose;
-
- g_object_class_install_property (object_class, PROP_DND_CODE,
- g_param_spec_string ("dnd_code",
- _("DnD code"),
- /*_( */"XXX blurb" /*)*/,
- NULL,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_FULL_HEADER,
- g_param_spec_object ("full_header",
- _("Full Header"),
- /*_( */"XXX blurb" /*)*/,
- E_TABLE_HEADER_TYPE,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_HEADER,
- g_param_spec_object ("header",
- _("Header"),
- /*_( */"XXX blurb" /*)*/,
- E_TABLE_HEADER_TYPE,
- G_PARAM_READWRITE));
-}
-
-static void allocate_callback(GtkWidget *canvas, GtkAllocation *allocation, ETableFieldChooser *etfc)
-{
- double height;
- etfc->last_alloc = *allocation;
- gnome_canvas_item_set( etfc->item,
- "width", (double) allocation->width,
- NULL );
- g_object_get(etfc->item,
- "height", &height,
- NULL);
- height = MAX(height, allocation->height);
- gnome_canvas_set_scroll_region(GNOME_CANVAS( etfc->canvas ), 0, 0, allocation->width - 1, height - 1);
- gnome_canvas_item_set( etfc->rect,
- "x2", (double) allocation->width,
- "y2", (double) height,
- NULL );
-}
-
-static void resize(GnomeCanvas *canvas, ETableFieldChooser *etfc)
-{
- double height;
- g_object_get(etfc->item,
- "height", &height,
- NULL);
-
- height = MAX(height, etfc->last_alloc.height);
-
- gnome_canvas_set_scroll_region (GNOME_CANVAS(etfc->canvas), 0, 0, etfc->last_alloc.width - 1, height - 1);
- gnome_canvas_item_set( etfc->rect,
- "x2", (double) etfc->last_alloc.width,
- "y2", (double) height,
- NULL );
-}
-
-static void
-e_table_field_chooser_init (ETableFieldChooser *etfc)
-{
- GladeXML *gui;
- GtkWidget *widget;
-
- gui = glade_xml_new (ETABLE_GLADEDIR "/e-table-field-chooser.glade", NULL, PACKAGE);
- etfc->gui = gui;
-
- widget = glade_xml_get_widget(gui, "vbox-top");
- if (!widget) {
- return;
- }
- gtk_widget_reparent(widget,
- GTK_WIDGET(etfc));
-
- gtk_widget_push_colormap (gdk_rgb_get_cmap ());
-
- etfc->canvas = GNOME_CANVAS(glade_xml_get_widget(gui, "canvas-buttons"));
-
- etfc->rect = gnome_canvas_item_new(gnome_canvas_root( GNOME_CANVAS( etfc->canvas ) ),
- gnome_canvas_rect_get_type(),
- "x1", (double) 0,
- "y1", (double) 0,
- "x2", (double) 100,
- "y2", (double) 100,
- "fill_color", "white",
- NULL );
-
- etfc->item = gnome_canvas_item_new(gnome_canvas_root(etfc->canvas),
- e_table_field_chooser_item_get_type(),
- "width", (double) 100,
- "full_header", etfc->full_header,
- "header", etfc->header,
- "dnd_code", etfc->dnd_code,
- NULL );
-
- g_signal_connect( etfc->canvas, "reflow",
- G_CALLBACK ( resize ),
- etfc);
-
- gnome_canvas_set_scroll_region ( GNOME_CANVAS( etfc->canvas ),
- 0, 0,
- 100, 100 );
-
- /* Connect the signals */
- g_signal_connect (etfc->canvas, "size_allocate",
- G_CALLBACK (allocate_callback),
- etfc);
-
- gtk_widget_pop_colormap ();
- gtk_widget_show_all(widget);
-}
-
-static void
-e_table_field_chooser_dispose (GObject *object)
-{
- ETableFieldChooser *etfc = E_TABLE_FIELD_CHOOSER(object);
-
- g_free (etfc->dnd_code);
- etfc->dnd_code = NULL;
-
- if (etfc->full_header)
- g_object_unref (etfc->full_header);
- etfc->full_header = NULL;
-
- if (etfc->header)
- g_object_unref (etfc->header);
- etfc->header = NULL;
-
- if (etfc->gui)
- g_object_unref (etfc->gui);
- etfc->gui = NULL;
-
- if (G_OBJECT_CLASS (parent_class)->dispose)
- (* G_OBJECT_CLASS (parent_class)->dispose) (object);
-}
-
-GtkWidget*
-e_table_field_chooser_new (void)
-{
- GtkWidget *widget = GTK_WIDGET (g_object_new (E_TABLE_FIELD_CHOOSER_TYPE, NULL));
- return widget;
-}
-
-static void
-e_table_field_chooser_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec)
-{
- ETableFieldChooser *etfc = E_TABLE_FIELD_CHOOSER(object);
-
- switch (prop_id){
- case PROP_DND_CODE:
- g_free(etfc->dnd_code);
- etfc->dnd_code = g_strdup(g_value_get_string(value));
- if (etfc->item)
- g_object_set(etfc->item,
- "dnd_code", etfc->dnd_code,
- NULL);
- break;
- case PROP_FULL_HEADER:
- if (etfc->full_header)
- g_object_unref (etfc->full_header);
- if (g_value_get_object (value))
- etfc->full_header = E_TABLE_HEADER(g_value_get_object (value));
- else
- etfc->full_header = NULL;
- if (etfc->full_header)
- g_object_ref (etfc->full_header);
- if (etfc->item)
- g_object_set(etfc->item,
- "full_header", etfc->full_header,
- NULL);
- break;
- case PROP_HEADER:
- if (etfc->header)
- g_object_unref (etfc->header);
- if (g_value_get_object (value))
- etfc->header = E_TABLE_HEADER(g_value_get_object (value));
- else
- etfc->header = NULL;
- if (etfc->header)
- g_object_ref (etfc->header);
- if (etfc->item)
- g_object_set(etfc->item,
- "header", etfc->header,
- NULL);
- break;
- default:
- break;
- }
-}
-
-static void
-e_table_field_chooser_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec)
-{
- ETableFieldChooser *etfc = E_TABLE_FIELD_CHOOSER(object);
-
- switch (prop_id) {
- case PROP_DND_CODE:
- g_value_set_string (value, g_strdup (etfc->dnd_code));
- break;
- case PROP_FULL_HEADER:
- g_value_set_object (value, etfc->full_header);
- break;
- case PROP_HEADER:
- g_value_set_object (value, etfc->header);
- break;
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
- break;
- }
-}
diff --git a/widgets/table/e-table-field-chooser.glade b/widgets/table/e-table-field-chooser.glade
deleted file mode 100644
index f46a8dbd52..0000000000
--- a/widgets/table/e-table-field-chooser.glade
+++ /dev/null
@@ -1,123 +0,0 @@
-<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*-->
-<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd" >
-
-<glade-interface>
- <widget class="GtkDialog" id="dialog-field-chooser">
- <property name="visible">no</property>
- <property name="title" translatable="yes">Field Chooser</property>
- <property name="type">GTK_WINDOW_TOPLEVEL</property>
- <property name="modal">no</property>
- <property name="allow_shrink">no</property>
- <property name="allow_grow">yes</property>
- <property name="window-position">GTK_WIN_POS_NONE</property>
-
- <child internal-child="vbox">
- <widget class="GtkVBox" id="dialog-vbox1">
- <property name="homogeneous">no</property>
- <property name="spacing">8</property>
- <property name="visible">yes</property>
-
- <child internal-child="action_area">
- <widget class="GtkHButtonBox" id="dialog-action_area1">
- <property name="layout_style">GTK_BUTTONBOX_END</property>
- <property name="spacing">8</property>
- <property name="visible">yes</property>
-
- <child>
- <widget class="GtkButton" id="button3">
- <property name="can_default">yes</property>
- <property name="can_focus">yes</property>
- <property name="visible">yes</property>
- <property name="label">gtk-close</property>
- <property name="use_stock">yes</property>
- <property name="use_underline">yes</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">no</property>
- <property name="fill">yes</property>
- <property name="pack_type">GTK_PACK_END</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkVBox" id="vbox-top">
- <property name="homogeneous">no</property>
- <property name="spacing">4</property>
- <property name="visible">yes</property>
-
- <child>
- <widget class="GtkLabel" id="label1">
- <property name="label" translatable="yes">To add a column to your table, drag it into
-the location in which you want it to appear.</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">no</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="visible">yes</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">no</property>
- <property name="fill">no</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkScrolledWindow" id="scrolledwindow1">
- <property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
- <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
- <property name="width-request">200</property>
- <property name="height-request">200</property>
- <property name="visible">yes</property>
-
- <child>
- <widget class="Custom" id="canvas-buttons">
- <property name="creation_function">e_canvas_new</property>
- <property name="int1">0</property>
- <property name="int2">0</property>
- <property name="last_modification_time">Thu, 08 Jun 2000 07:27:33 GMT</property>
- <property name="visible">yes</property>
- </widget>
- </child>
-
- <child internal-child="hscrollbar">
- <widget class="GtkHScrollbar" id="convertwidget1">
- <property name="update_policy">GTK_UPDATE_CONTINUOUS</property>
- <property name="visible">yes</property>
- </widget>
- </child>
-
- <child internal-child="vscrollbar">
- <widget class="GtkVScrollbar" id="convertwidget2">
- <property name="update_policy">GTK_UPDATE_CONTINUOUS</property>
- <property name="visible">yes</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">yes</property>
- <property name="fill">yes</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">yes</property>
- <property name="fill">yes</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">4</property>
- <property name="expand">yes</property>
- <property name="fill">yes</property>
- </packing>
- </child>
- </widget>
-</glade-interface>
diff --git a/widgets/table/e-table-field-chooser.h b/widgets/table/e-table-field-chooser.h
deleted file mode 100644
index 65efeeedbe..0000000000
--- a/widgets/table/e-table-field-chooser.h
+++ /dev/null
@@ -1,79 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-table-field-chooser.h
- * Copyright 2000, 2001, Ximian, Inc.
- *
- * Authors:
- * Chris Lahey <clahey@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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.
- */
-
-#ifndef __E_TABLE_FIELD_CHOOSER_H__
-#define __E_TABLE_FIELD_CHOOSER_H__
-
-#include <glade/glade.h>
-#include <gtk/gtkvbox.h>
-#include <gal/e-table/e-table-header.h>
-
-G_BEGIN_DECLS
-
-/* ETableFieldChooser - A dialog displaying information about a contact.
- *
- * The following arguments are available:
- *
- * name type read/write description
- * --------------------------------------------------------------------------------
- */
-
-#define E_TABLE_FIELD_CHOOSER_TYPE (e_table_field_chooser_get_type ())
-#define E_TABLE_FIELD_CHOOSER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), E_TABLE_FIELD_CHOOSER_TYPE, ETableFieldChooser))
-#define E_TABLE_FIELD_CHOOSER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), E_TABLE_FIELD_CHOOSER_TYPE, ETableFieldChooserClass))
-#define E_IS_TABLE_FIELD_CHOOSER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), E_TABLE_FIELD_CHOOSER_TYPE))
-#define E_IS_TABLE_FIELD_CHOOSER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), E_TABLE_FIELD_CHOOSER_TYPE))
-
-
-typedef struct _ETableFieldChooser ETableFieldChooser;
-typedef struct _ETableFieldChooserClass ETableFieldChooserClass;
-
-struct _ETableFieldChooser
-{
- GtkVBox parent;
-
- /* item specific fields */
- GladeXML *gui;
- GnomeCanvas *canvas;
- GnomeCanvasItem *item;
-
- GnomeCanvasItem *rect;
- GtkAllocation last_alloc;
-
- gchar *dnd_code;
- ETableHeader *full_header;
- ETableHeader *header;
-};
-
-struct _ETableFieldChooserClass
-{
- GtkVBoxClass parent_class;
-};
-
-
-GtkWidget *e_table_field_chooser_new(void);
-GType e_table_field_chooser_get_type (void);
-
-G_END_DECLS
-
-#endif /* __E_TABLE_FIELD_CHOOSER_H__ */
diff --git a/widgets/table/e-table-group-container.c b/widgets/table/e-table-group-container.c
deleted file mode 100644
index dedc291a46..0000000000
--- a/widgets/table/e-table-group-container.c
+++ /dev/null
@@ -1,1512 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-table-group-container.c
- * Copyright 2000, 2001, Ximian, Inc.
- *
- * Authors:
- * Chris Lahey <clahey@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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 <gdk/gdkkeysyms.h>
-#include <gtk/gtksignal.h>
-#include <libgnome/libgnome.h>
-#include <libgnomecanvas/gnome-canvas-rect-ellipse.h>
-#include "e-table-group-container.h"
-#include "e-table-group-leaf.h"
-#include "e-table-item.h"
-#include "gal/util/e-util.h"
-#include "gal/widgets/e-canvas.h"
-#include "gal/widgets/e-canvas-utils.h"
-#include "gal/widgets/e-unicode.h"
-#include "gal/e-text/e-text.h"
-#include "e-table-defines.h"
-
-#define TITLE_HEIGHT 16
-
-#define PARENT_TYPE e_table_group_get_type ()
-
-static GnomeCanvasGroupClass *etgc_parent_class;
-
-/* The arguments we take */
-enum {
- PROP_0,
- PROP_HEIGHT,
- PROP_WIDTH,
- PROP_MINIMUM_WIDTH,
- PROP_FROZEN,
- PROP_TABLE_ALTERNATING_ROW_COLORS,
- PROP_TABLE_HORIZONTAL_DRAW_GRID,
- PROP_TABLE_VERTICAL_DRAW_GRID,
- PROP_TABLE_DRAW_FOCUS,
- PROP_CURSOR_MODE,
- PROP_SELECTION_MODEL,
- PROP_LENGTH_THRESHOLD,
- PROP_UNIFORM_ROW_HEIGHT
-};
-
-typedef struct {
- ETableGroup *child;
- void *key;
- char *string;
- GnomeCanvasItem *text;
- GnomeCanvasItem *rect;
- gint count;
-} ETableGroupContainerChildNode;
-
-static EPrintable *
-etgc_get_printable (ETableGroup *etg);
-
-
-static void
-e_table_group_container_child_node_free (ETableGroupContainer *etgc,
- ETableGroupContainerChildNode *child_node)
-{
- ETableGroup *etg = E_TABLE_GROUP (etgc);
- ETableGroup *child = child_node->child;
-
- gtk_object_destroy (GTK_OBJECT (child));
- e_table_model_free_value (etg->model, etgc->ecol->col_idx,
- child_node->key);
- g_free(child_node->string);
- gtk_object_destroy (GTK_OBJECT (child_node->text));
- gtk_object_destroy (GTK_OBJECT (child_node->rect));
-}
-
-static void
-e_table_group_container_list_free (ETableGroupContainer *etgc)
-{
- ETableGroupContainerChildNode *child_node;
- GList *list;
-
- for (list = etgc->children; list; list = g_list_next (list)) {
- child_node = (ETableGroupContainerChildNode *) list->data;
- e_table_group_container_child_node_free (etgc, child_node);
- }
-
- g_list_free (etgc->children);
- etgc->children = NULL;
-}
-
-static void
-etgc_dispose (GObject *object)
-{
- ETableGroupContainer *etgc = E_TABLE_GROUP_CONTAINER (object);
-
- if (etgc->children)
- e_table_group_container_list_free (etgc);
-
- if (etgc->font)
- gdk_font_unref (etgc->font);
- etgc->font = NULL;
-
- if (etgc->ecol)
- g_object_unref (etgc->ecol);
- etgc->ecol = NULL;
-
- if (etgc->sort_info)
- g_object_unref (etgc->sort_info);
- etgc->sort_info = NULL;
-
- if (etgc->selection_model)
- g_object_unref (etgc->selection_model);
- etgc->selection_model = NULL;
-
- if (etgc->rect)
- gtk_object_destroy (GTK_OBJECT(etgc->rect));
- etgc->rect = NULL;
-
- G_OBJECT_CLASS (etgc_parent_class)->dispose (object);
-}
-
-/**
- * e_table_group_container_construct
- * @parent: The %GnomeCanvasGroup to create a child of.
- * @etgc: The %ETableGroupContainer.
- * @full_header: The full header of the %ETable.
- * @header: The current header of the %ETable.
- * @model: The %ETableModel of the %ETable.
- * @sort_info: The %ETableSortInfo of the %ETable.
- * @n: Which grouping level this is (Starts at 0 and sends n + 1 to any child %ETableGroups.
- *
- * This routine constructs the new %ETableGroupContainer.
- */
-void
-e_table_group_container_construct (GnomeCanvasGroup *parent, ETableGroupContainer *etgc,
- ETableHeader *full_header,
- ETableHeader *header,
- ETableModel *model, ETableSortInfo *sort_info, int n)
-{
- ETableCol *col;
- ETableSortColumn column = e_table_sort_info_grouping_get_nth(sort_info, n);
-
- col = e_table_header_get_column_by_col_idx(full_header, column.column);
- if (col == NULL)
- col = e_table_header_get_column (full_header, e_table_header_count (full_header) - 1);
-
- e_table_group_construct (parent, E_TABLE_GROUP (etgc), full_header, header, model);
- etgc->ecol = col;
- g_object_ref (etgc->ecol);
- etgc->sort_info = sort_info;
- g_object_ref (etgc->sort_info);
- etgc->n = n;
- etgc->ascending = column.ascending;
-
- etgc->font = gtk_style_get_font (GTK_WIDGET (GNOME_CANVAS_ITEM (etgc)->canvas)->style);
-
- gdk_font_ref (etgc->font);
-
- etgc->open = TRUE;
-}
-
-/**
- * e_table_group_container_new
- * @parent: The %GnomeCanvasGroup to create a child of.
- * @full_header: The full header of the %ETable.
- * @header: The current header of the %ETable.
- * @model: The %ETableModel of the %ETable.
- * @sort_info: The %ETableSortInfo of the %ETable.
- * @n: Which grouping level this is (Starts at 0 and sends n + 1 to any child %ETableGroups.
- *
- * %ETableGroupContainer is an %ETableGroup which groups by the nth
- * grouping of the %ETableSortInfo. It creates %ETableGroups as
- * children.
- *
- * Returns: The new %ETableGroupContainer.
- */
-ETableGroup *
-e_table_group_container_new (GnomeCanvasGroup *parent, ETableHeader *full_header,
- ETableHeader *header,
- ETableModel *model, ETableSortInfo *sort_info, int n)
-{
- ETableGroupContainer *etgc;
-
- g_return_val_if_fail (parent != NULL, NULL);
-
- etgc = g_object_new (E_TABLE_GROUP_CONTAINER_TYPE, NULL);
-
- e_table_group_container_construct (parent, etgc, full_header, header,
- model, sort_info, n);
- return E_TABLE_GROUP (etgc);
-}
-
-
-static int
-etgc_event (GnomeCanvasItem *item, GdkEvent *event)
-{
- ETableGroupContainer *etgc = E_TABLE_GROUP_CONTAINER(item);
- gboolean return_val = TRUE;
- gboolean change_focus = FALSE;
- gboolean use_col = FALSE;
- gint start_col = 0;
- gint old_col;
- EFocus direction = E_FOCUS_START;
-
- switch (event->type) {
- case GDK_KEY_PRESS:
- if (event->key.keyval == GDK_Tab ||
- event->key.keyval == GDK_KP_Tab ||
- event->key.keyval == GDK_ISO_Left_Tab) {
- change_focus = TRUE;
- use_col = TRUE;
- start_col = (event->key.state & GDK_SHIFT_MASK) ? -1 : 0;
- direction = (event->key.state & GDK_SHIFT_MASK) ? E_FOCUS_END : E_FOCUS_START;
- } else if (event->key.keyval == GDK_Left ||
- event->key.keyval == GDK_KP_Left) {
- change_focus = TRUE;
- use_col = TRUE;
- start_col = -1;
- direction = E_FOCUS_END;
- } else if (event->key.keyval == GDK_Right ||
- event->key.keyval == GDK_KP_Right) {
- change_focus = TRUE;
- use_col = TRUE;
- start_col = 0;
- direction = E_FOCUS_START;
- } else if (event->key.keyval == GDK_Down ||
- event->key.keyval == GDK_KP_Down) {
- change_focus = TRUE;
- use_col = FALSE;
- direction = E_FOCUS_START;
- } else if (event->key.keyval == GDK_Up ||
- event->key.keyval == GDK_KP_Up) {
- change_focus = TRUE;
- use_col = FALSE;
- direction = E_FOCUS_END;
- } else if (event->key.keyval == GDK_Return ||
- event->key.keyval == GDK_KP_Enter) {
- change_focus = TRUE;
- use_col = FALSE;
- direction = E_FOCUS_START;
- }
- if (change_focus){
- GList *list;
- for (list = etgc->children; list; list = list->next) {
- ETableGroupContainerChildNode *child_node;
- ETableGroup *child;
-
- child_node = (ETableGroupContainerChildNode *)list->data;
- child = child_node->child;
-
- if (e_table_group_get_focus (child)) {
- old_col = e_table_group_get_focus_column (child);
- if (old_col == -1)
- old_col = 0;
- if (start_col == -1)
- start_col = e_table_header_count (e_table_group_get_header (child)) - 1;
-
- if (direction == E_FOCUS_END)
- list = list->prev;
- else
- list = list->next;
-
- if (list) {
- child_node = (ETableGroupContainerChildNode *)list->data;
- child = child_node->child;
- if (use_col)
- e_table_group_set_focus (child, direction, start_col);
- else
- e_table_group_set_focus (child, direction, old_col);
- return 1;
- } else {
- return 0;
- }
- }
- }
- if (direction == E_FOCUS_END)
- list = g_list_last(etgc->children);
- else
- list = etgc->children;
- if (list) {
- ETableGroupContainerChildNode *child_node;
- ETableGroup *child;
-
- child_node = (ETableGroupContainerChildNode *)list->data;
- child = child_node->child;
-
- if (start_col == -1)
- start_col = e_table_header_count (e_table_group_get_header (child)) - 1;
-
- e_table_group_set_focus (child, direction, start_col);
- return 1;
- }
- }
- return_val = FALSE;
- break;
- default:
- return_val = FALSE;
- break;
- }
- if (return_val == FALSE) {
- if (GNOME_CANVAS_ITEM_CLASS(etgc_parent_class)->event)
- return GNOME_CANVAS_ITEM_CLASS (etgc_parent_class)->event (item, event);
- }
- return return_val;
-
-}
-
-/* Realize handler for the text item */
-static void
-etgc_realize (GnomeCanvasItem *item)
-{
- ETableGroupContainer *etgc;
-
- if (GNOME_CANVAS_ITEM_CLASS (etgc_parent_class)->realize)
- (* GNOME_CANVAS_ITEM_CLASS (etgc_parent_class)->realize) (item);
-
- etgc = E_TABLE_GROUP_CONTAINER (item);
-
- e_canvas_item_request_reflow (GNOME_CANVAS_ITEM (etgc));
-}
-
-/* Unrealize handler for the etgc item */
-static void
-etgc_unrealize (GnomeCanvasItem *item)
-{
- ETableGroupContainer *etgc;
-
- etgc = E_TABLE_GROUP_CONTAINER (item);
-
- if (GNOME_CANVAS_ITEM_CLASS (etgc_parent_class)->unrealize)
- (* GNOME_CANVAS_ITEM_CLASS (etgc_parent_class)->unrealize) (item);
-}
-
-static void
-compute_text (ETableGroupContainer *etgc, ETableGroupContainerChildNode *child_node)
-{
- gchar *text;
-
- if (etgc->ecol->text) {
- text = g_strdup_printf ((child_node->count == 1)
- ? _("%s : %s (%d item)")
- : _("%s : %s (%d items)"),
- etgc->ecol->text, child_node->string,
- (gint) child_node->count);
- } else {
- text = g_strdup_printf ((child_node->count == 1)
- ? _("%s (%d item)")
- : _("%s (%d items)"),
- child_node->string,
- (gint) child_node->count);
- }
- gnome_canvas_item_set (child_node->text,
- "text", text,
- NULL);
- g_free (text);
-}
-
-static void
-child_cursor_change (ETableGroup *etg, int row,
- ETableGroupContainer *etgc)
-{
- e_table_group_cursor_change (E_TABLE_GROUP (etgc), row);
-}
-
-static void
-child_cursor_activated (ETableGroup *etg, int row,
- ETableGroupContainer *etgc)
-{
- e_table_group_cursor_activated (E_TABLE_GROUP (etgc), row);
-}
-
-static void
-child_double_click (ETableGroup *etg, int row, int col, GdkEvent *event,
- ETableGroupContainer *etgc)
-{
- e_table_group_double_click (E_TABLE_GROUP (etgc), row, col, event);
-}
-
-static gint
-child_right_click (ETableGroup *etg, int row, int col, GdkEvent *event,
- ETableGroupContainer *etgc)
-{
- return e_table_group_right_click (E_TABLE_GROUP (etgc), row, col, event);
-}
-
-static gint
-child_click (ETableGroup *etg, int row, int col, GdkEvent *event,
- ETableGroupContainer *etgc)
-{
- return e_table_group_click (E_TABLE_GROUP (etgc), row, col, event);
-}
-
-static gint
-child_key_press (ETableGroup *etg, int row, int col, GdkEvent *event,
- ETableGroupContainer *etgc)
-{
- return e_table_group_key_press (E_TABLE_GROUP (etgc), row, col, event);
-}
-
-static gint
-child_start_drag (ETableGroup *etg, int row, int col, GdkEvent *event,
- ETableGroupContainer *etgc)
-{
- return e_table_group_start_drag (E_TABLE_GROUP (etgc), row, col, event);
-}
-
-static ETableGroupContainerChildNode *
-create_child_node (ETableGroupContainer *etgc, void *val)
-{
- ETableGroup *child;
- ETableGroupContainerChildNode *child_node;
- ETableGroup *etg = E_TABLE_GROUP(etgc);
-
- child_node = g_new (ETableGroupContainerChildNode, 1);
- child_node->rect = gnome_canvas_item_new (GNOME_CANVAS_GROUP (etgc),
- gnome_canvas_rect_get_type (),
- "fill_color", "grey70",
- "outline_color", "grey50",
- NULL);
- child_node->text = gnome_canvas_item_new (GNOME_CANVAS_GROUP (etgc),
- e_text_get_type (),
- "anchor", GTK_ANCHOR_SW,
- "fill_color", "black",
- "draw_background", FALSE,
- NULL);
- child = e_table_group_new (GNOME_CANVAS_GROUP (etgc), etg->full_header,
- etg->header, etg->model, etgc->sort_info, etgc->n + 1);
- gnome_canvas_item_set(GNOME_CANVAS_ITEM(child),
- "alternating_row_colors", etgc->alternating_row_colors,
- "horizontal_draw_grid", etgc->horizontal_draw_grid,
- "vertical_draw_grid", etgc->vertical_draw_grid,
- "drawfocus", etgc->draw_focus,
- "cursor_mode", etgc->cursor_mode,
- "selection_model", etgc->selection_model,
- "length_threshold", etgc->length_threshold,
- "uniform_row_height", etgc->uniform_row_height,
- "minimum_width", etgc->minimum_width - GROUP_INDENT,
- NULL);
-
- g_signal_connect (child, "cursor_change",
- G_CALLBACK (child_cursor_change), etgc);
- g_signal_connect (child, "cursor_activated",
- G_CALLBACK (child_cursor_activated), etgc);
- g_signal_connect (child, "double_click",
- G_CALLBACK (child_double_click), etgc);
- g_signal_connect (child, "right_click",
- G_CALLBACK (child_right_click), etgc);
- g_signal_connect (child, "click",
- G_CALLBACK (child_click), etgc);
- g_signal_connect (child, "key_press",
- G_CALLBACK (child_key_press), etgc);
- g_signal_connect (child, "start_drag",
- G_CALLBACK (child_start_drag), etgc);
- child_node->child = child;
- child_node->key = e_table_model_duplicate_value (etg->model, etgc->ecol->col_idx, val);
- child_node->string = e_table_model_value_to_string (etg->model, etgc->ecol->col_idx, val);
- child_node->count = 0;
-
- return child_node;
-}
-
-static void
-etgc_add (ETableGroup *etg, gint row)
-{
- ETableGroupContainer *etgc = E_TABLE_GROUP_CONTAINER (etg);
- void *val = e_table_model_value_at (etg->model, etgc->ecol->col_idx, row);
- GCompareFunc comp = etgc->ecol->compare;
- GList *list = etgc->children;
- ETableGroup *child;
- ETableGroupContainerChildNode *child_node;
- int i = 0;
-
- for (; list; list = g_list_next (list), i++){
- int comp_val;
-
- child_node = list->data;
- comp_val = (*comp)(child_node->key, val);
- if (comp_val == 0) {
- child = child_node->child;
- child_node->count ++;
- e_table_group_add (child, row);
- compute_text (etgc, child_node);
- return;
- }
- if ((comp_val > 0 && etgc->ascending) ||
- (comp_val < 0 && (!etgc->ascending)))
- break;
- }
- child_node = create_child_node (etgc, val);
- child = child_node->child;
- child_node->count = 1;
- e_table_group_add (child, row);
-
- if (list)
- etgc->children = g_list_insert (etgc->children, child_node, i);
- else
- etgc->children = g_list_append (etgc->children, child_node);
-
- compute_text (etgc, child_node);
- e_canvas_item_request_reflow (GNOME_CANVAS_ITEM (etgc));
-}
-
-static void
-etgc_add_array (ETableGroup *etg, const int *array, int count)
-{
- int i;
- ETableGroupContainer *etgc = E_TABLE_GROUP_CONTAINER (etg);
- void *lastval = 0;
- int laststart = 0;
- GCompareFunc comp = etgc->ecol->compare;
- ETableGroupContainerChildNode *child_node;
- ETableGroup *child;
-
- if (count <= 0)
- return;
-
- e_table_group_container_list_free (etgc);
- etgc->children = NULL;
-
- lastval = e_table_model_value_at (etg->model, etgc->ecol->col_idx, array[0]);
-
- for (i = 1; i < count; i++) {
- void *val = e_table_model_value_at (etg->model, etgc->ecol->col_idx, array[i]);
- int comp_val;
-
- comp_val = (*comp)(lastval, val);
- if (comp_val != 0) {
- child_node = create_child_node(etgc, lastval);
- child = child_node->child;
-
- e_table_group_add_array(child, array + laststart, i - laststart);
- child_node->count = i - laststart;
-
- etgc->children = g_list_append (etgc->children, child_node);
- compute_text (etgc, child_node);
- laststart = i;
- lastval = val;
- }
- }
-
- child_node = create_child_node(etgc, lastval);
- child = child_node->child;
-
- e_table_group_add_array(child, array + laststart, i - laststart);
- child_node->count = i - laststart;
-
- etgc->children = g_list_append (etgc->children, child_node);
- compute_text (etgc, child_node);
-
- e_canvas_item_request_reflow (GNOME_CANVAS_ITEM (etgc));
-}
-
-static void
-etgc_add_all (ETableGroup *etg)
-{
- ETableGroupContainer *etgc = E_TABLE_GROUP_CONTAINER (etg);
- ESorter *sorter = etgc->selection_model->sorter;
- int *array;
- int count;
-
- e_sorter_get_sorted_to_model_array(sorter, &array, &count);
-
- etgc_add_array(etg, array, count);
-}
-
-static gboolean
-etgc_remove (ETableGroup *etg, gint row)
-{
- ETableGroupContainer *etgc = E_TABLE_GROUP_CONTAINER(etg);
- GList *list;
-
- for (list = etgc->children ; list; list = g_list_next (list)) {
- ETableGroupContainerChildNode *child_node = list->data;
- ETableGroup *child = child_node->child;
-
- if (e_table_group_remove (child, row)) {
- child_node->count --;
- if (child_node->count == 0) {
- e_table_group_container_child_node_free (etgc, child_node);
- etgc->children = g_list_remove (etgc->children, child_node);
- g_free (child_node);
- } else
- compute_text (etgc, child_node);
-
- e_canvas_item_request_reflow (GNOME_CANVAS_ITEM (etgc));
-
- return TRUE;
- }
- }
- return FALSE;
-}
-
-static int
-etgc_row_count (ETableGroup *etg)
-{
- ETableGroupContainer *etgc = E_TABLE_GROUP_CONTAINER(etg);
- GList *list;
- gint count = 0;
- for (list = etgc->children; list; list = g_list_next(list)) {
- ETableGroup *group = ((ETableGroupContainerChildNode *)list->data)->child;
- gint this_count = e_table_group_row_count(group);
- count += this_count;
- }
- return count;
-}
-
-static void
-etgc_increment (ETableGroup *etg, gint position, gint amount)
-{
- ETableGroupContainer *etgc = E_TABLE_GROUP_CONTAINER(etg);
- GList *list = etgc->children;
-
- for (list = etgc->children ; list; list = g_list_next (list))
- e_table_group_increment (((ETableGroupContainerChildNode *)list->data)->child,
- position, amount);
-}
-
-static void
-etgc_decrement (ETableGroup *etg, gint position, gint amount)
-{
- ETableGroupContainer *etgc = E_TABLE_GROUP_CONTAINER(etg);
- GList *list = etgc->children;
-
- for (list = etgc->children ; list; list = g_list_next (list))
- e_table_group_decrement (((ETableGroupContainerChildNode *)list->data)->child,
- position, amount);
-}
-
-static void
-etgc_set_focus (ETableGroup *etg, EFocus direction, gint view_col)
-{
- ETableGroupContainer *etgc = E_TABLE_GROUP_CONTAINER(etg);
- if (etgc->children) {
- if (direction == E_FOCUS_END)
- e_table_group_set_focus (((ETableGroupContainerChildNode *)g_list_last (etgc->children)->data)->child,
- direction, view_col);
- else
- e_table_group_set_focus (((ETableGroupContainerChildNode *)etgc->children->data)->child,
- direction, view_col);
- }
-}
-
-static gint
-etgc_get_focus_column (ETableGroup *etg)
-{
- ETableGroupContainer *etgc = E_TABLE_GROUP_CONTAINER(etg);
- if (etgc->children) {
- GList *list;
- for (list = etgc->children; list; list = list->next) {
- ETableGroupContainerChildNode *child_node = (ETableGroupContainerChildNode *)list->data;
- ETableGroup *child = child_node->child;
- if (e_table_group_get_focus (child)) {
- return e_table_group_get_focus_column (child);
- }
- }
- }
- return 0;
-}
-
-static void
-etgc_compute_location (ETableGroup *etg, int *x, int *y, int *row, int *col)
-{
- ETableGroupContainer *etgc = E_TABLE_GROUP_CONTAINER(etg);
-
- if (row)
- *row = -1;
- if (col)
- *col = -1;
-
- *x -= GROUP_INDENT;
- *y -= TITLE_HEIGHT;
-
- if (*x >= 0 && *y >= 0 && etgc->children) {
- GList *list;
- for (list = etgc->children; list; list = list->next) {
- ETableGroupContainerChildNode *child_node = (ETableGroupContainerChildNode *)list->data;
- ETableGroup *child = child_node->child;
-
- e_table_group_compute_location (child, x, y, row, col);
- if ((*row != -1) && (*col != -1))
- return;
- }
- }
-}
-
-static void
-etgc_get_cell_geometry (ETableGroup *etg, int *row, int *col, int *x, int *y, int *width, int *height)
-{
- ETableGroupContainer *etgc = E_TABLE_GROUP_CONTAINER(etg);
-
- int ypos;
-
- ypos = 0;
-
- if (etgc->children) {
- GList *list;
- for (list = etgc->children; list; list = list->next) {
- ETableGroupContainerChildNode *child_node = (ETableGroupContainerChildNode *)list->data;
- ETableGroup *child = child_node->child;
- int thisy;
-
- e_table_group_get_cell_geometry (child, row, col, x, &thisy, width, height);
- ypos += thisy;
- if ((*row == -1) || (*col == -1)) {
- ypos += TITLE_HEIGHT;
- *x += GROUP_INDENT;
- *y = ypos;
- return;
- }
- }
- }
-}
-
-static void etgc_thaw (ETableGroup *etg)
-{
- e_canvas_item_request_reflow (GNOME_CANVAS_ITEM(etg));
-}
-
-static void
-etgc_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec)
-{
- ETableGroup *etg = E_TABLE_GROUP (object);
- ETableGroupContainer *etgc = E_TABLE_GROUP_CONTAINER (object);
- GList *list;
-
- switch (prop_id) {
- case PROP_FROZEN:
- if (g_value_get_boolean (value))
- etg->frozen = TRUE;
- else {
- etg->frozen = FALSE;
- etgc_thaw (etg);
- }
- break;
- case PROP_MINIMUM_WIDTH:
- case PROP_WIDTH:
- etgc->minimum_width = g_value_get_double (value);
-
- for (list = etgc->children; list; list = g_list_next (list)) {
- ETableGroupContainerChildNode *child_node = (ETableGroupContainerChildNode *)list->data;
- g_object_set (child_node->child,
- "minimum_width", etgc->minimum_width - GROUP_INDENT,
- NULL);
- }
- break;
- case PROP_LENGTH_THRESHOLD:
- etgc->length_threshold = g_value_get_int (value);
- for (list = etgc->children; list; list = g_list_next (list)) {
- ETableGroupContainerChildNode *child_node = (ETableGroupContainerChildNode *)list->data;
- g_object_set (child_node->child,
- "length_threshold", etgc->length_threshold,
- NULL);
- }
- break;
- case PROP_UNIFORM_ROW_HEIGHT:
- etgc->uniform_row_height = g_value_get_boolean (value);
- for (list = etgc->children; list; list = g_list_next (list)) {
- ETableGroupContainerChildNode *child_node = (ETableGroupContainerChildNode *)list->data;
- g_object_set (child_node->child,
- "uniform_row_height", etgc->uniform_row_height,
- NULL);
- }
- break;
-
- case PROP_SELECTION_MODEL:
- if (etgc->selection_model)
- g_object_unref (etgc->selection_model);
- etgc->selection_model = E_SELECTION_MODEL(g_value_get_object (value));
- if (etgc->selection_model)
- g_object_ref (etgc->selection_model);
- for (list = etgc->children; list; list = g_list_next (list)) {
- ETableGroupContainerChildNode *child_node = (ETableGroupContainerChildNode *)list->data;
- g_object_set (child_node->child,
- "selection_model", etgc->selection_model,
- NULL);
- }
- break;
-
- case PROP_TABLE_ALTERNATING_ROW_COLORS:
- etgc->alternating_row_colors = g_value_get_boolean (value);
- for (list = etgc->children; list; list = g_list_next (list)) {
- ETableGroupContainerChildNode *child_node = (ETableGroupContainerChildNode *)list->data;
- g_object_set (child_node->child,
- "alternating_row_colors", etgc->alternating_row_colors,
- NULL);
- }
- break;
-
- case PROP_TABLE_HORIZONTAL_DRAW_GRID:
- etgc->horizontal_draw_grid = g_value_get_boolean (value);
- for (list = etgc->children; list; list = g_list_next (list)) {
- ETableGroupContainerChildNode *child_node = (ETableGroupContainerChildNode *)list->data;
- g_object_set (child_node->child,
- "horizontal_draw_grid", etgc->horizontal_draw_grid,
- NULL);
- }
- break;
-
- case PROP_TABLE_VERTICAL_DRAW_GRID:
- etgc->vertical_draw_grid = g_value_get_boolean (value);
- for (list = etgc->children; list; list = g_list_next (list)) {
- ETableGroupContainerChildNode *child_node = (ETableGroupContainerChildNode *)list->data;
- g_object_set (child_node->child,
- "vertical_draw_grid", etgc->vertical_draw_grid,
- NULL);
- }
- break;
-
- case PROP_TABLE_DRAW_FOCUS:
- etgc->draw_focus = g_value_get_boolean (value);
- for (list = etgc->children; list; list = g_list_next (list)) {
- ETableGroupContainerChildNode *child_node = (ETableGroupContainerChildNode *)list->data;
- g_object_set (child_node->child,
- "drawfocus", etgc->draw_focus,
- NULL);
- }
- break;
-
- case PROP_CURSOR_MODE:
- etgc->cursor_mode = g_value_get_int (value);
- for (list = etgc->children; list; list = g_list_next (list)) {
- ETableGroupContainerChildNode *child_node = (ETableGroupContainerChildNode *)list->data;
- g_object_set (child_node->child,
- "cursor_mode", etgc->cursor_mode,
- NULL);
- }
- break;
- default:
- break;
- }
-}
-
-static void
-etgc_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec)
-{
- ETableGroup *etg = E_TABLE_GROUP (object);
- ETableGroupContainer *etgc = E_TABLE_GROUP_CONTAINER (object);
-
- switch (prop_id) {
- case PROP_FROZEN:
- g_value_set_boolean (value, etg->frozen);
- break;
- case PROP_HEIGHT:
- g_value_set_double (value, etgc->height);
- break;
- case PROP_WIDTH:
- g_value_set_double (value, etgc->width);
- break;
- case PROP_MINIMUM_WIDTH:
- g_value_set_double (value, etgc->minimum_width);
- break;
- case PROP_UNIFORM_ROW_HEIGHT:
- g_value_set_boolean (value, etgc->uniform_row_height);
- break;
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
- break;
- }
-}
-
-static void
-etgc_class_init (GObjectClass *object_class)
-{
- GnomeCanvasItemClass *item_class = (GnomeCanvasItemClass *) object_class;
- ETableGroupClass *e_group_class = E_TABLE_GROUP_CLASS(object_class);
-
- object_class->dispose = etgc_dispose;
- object_class->set_property = etgc_set_property;
- object_class->get_property = etgc_get_property;
-
- item_class->event = etgc_event;
- item_class->realize = etgc_realize;
- item_class->unrealize = etgc_unrealize;
-
- etgc_parent_class = g_type_class_ref (PARENT_TYPE);
-
- e_group_class->add = etgc_add;
- e_group_class->add_array = etgc_add_array;
- e_group_class->add_all = etgc_add_all;
- e_group_class->remove = etgc_remove;
- e_group_class->increment = etgc_increment;
- e_group_class->decrement = etgc_decrement;
- e_group_class->row_count = etgc_row_count;
- e_group_class->set_focus = etgc_set_focus;
- e_group_class->get_focus_column = etgc_get_focus_column;
- e_group_class->get_printable = etgc_get_printable;
- e_group_class->compute_location = etgc_compute_location;
- e_group_class->get_cell_geometry = etgc_get_cell_geometry;
-
- g_object_class_install_property (object_class, PROP_TABLE_ALTERNATING_ROW_COLORS,
- g_param_spec_boolean ("alternating_row_colors",
- _( "Alternating Row Colors" ),
- _( "Alternating Row Colors" ),
- FALSE,
- G_PARAM_WRITABLE));
-
- g_object_class_install_property (object_class, PROP_TABLE_HORIZONTAL_DRAW_GRID,
- g_param_spec_boolean ("horizontal_draw_grid",
- _( "Horizontal Draw Grid" ),
- _( "Horizontal Draw Grid" ),
- FALSE,
- G_PARAM_WRITABLE));
-
- g_object_class_install_property (object_class, PROP_TABLE_VERTICAL_DRAW_GRID,
- g_param_spec_boolean ("vertical_draw_grid",
- _( "Vertical Draw Grid" ),
- _( "Vertical Draw Grid" ),
- FALSE,
- G_PARAM_WRITABLE));
-
- g_object_class_install_property (object_class, PROP_TABLE_DRAW_FOCUS,
- g_param_spec_boolean ("drawfocus",
- _( "Draw focus" ),
- _( "Draw focus" ),
- FALSE,
- G_PARAM_WRITABLE));
-
- g_object_class_install_property (object_class, PROP_CURSOR_MODE,
- g_param_spec_int ("cursor_mode",
- _( "Cursor mode" ),
- _( "Cursor mode" ),
- E_CURSOR_LINE, E_CURSOR_SPREADSHEET, E_CURSOR_LINE,
- G_PARAM_WRITABLE));
-
- g_object_class_install_property (object_class, PROP_SELECTION_MODEL,
- g_param_spec_object ("selection_model",
- _( "Selection model" ),
- _( "Selection model" ),
- E_SELECTION_MODEL_TYPE,
- G_PARAM_WRITABLE));
-
- g_object_class_install_property (object_class, PROP_LENGTH_THRESHOLD,
- g_param_spec_int ("length_threshold",
- _( "Length Threshold" ),
- _( "Length Threshold" ),
- 0, G_MAXINT, 0,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_UNIFORM_ROW_HEIGHT,
- g_param_spec_boolean ("uniform_row_height",
- _( "Uniform row height" ),
- _( "Uniform row height" ),
- FALSE,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_FROZEN,
- g_param_spec_boolean ("frozen",
- _( "Frozen" ),
- _( "Frozen" ),
- FALSE,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_HEIGHT,
- g_param_spec_double ("height",
- _( "Height" ),
- _( "Height" ),
- 0.0, G_MAXDOUBLE, 0.0,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_WIDTH,
- g_param_spec_double ("width",
- _( "Width" ),
- _( "Width" ),
- 0.0, G_MAXDOUBLE, 0.0,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_MINIMUM_WIDTH,
- g_param_spec_double ("minimum_width",
- _( "Minimum width" ),
- _( "Minimum Width" ),
- 0.0, G_MAXDOUBLE, 0.0,
- G_PARAM_READWRITE));
-}
-
-static void
-etgc_reflow (GnomeCanvasItem *item, gint flags)
-{
- ETableGroupContainer *etgc = E_TABLE_GROUP_CONTAINER(item);
- gboolean frozen;
-
- g_object_get (etgc,
- "frozen", &frozen,
- NULL);
-
- if (frozen)
- return;
-
-
- if (GTK_OBJECT_FLAGS(etgc)& GNOME_CANVAS_ITEM_REALIZED){
- gdouble running_height = 0;
- gdouble running_width = 0;
- gdouble old_height;
- gdouble old_width;
-
- old_height = etgc->height;
- old_width = etgc->width;
- if (etgc->children == NULL){
- } else {
- GList *list;
- gdouble extra_height = 0;
- gdouble item_height = 0;
- gdouble item_width = 0;
-
- if (etgc->font)
- extra_height += etgc->font->ascent + etgc->font->descent + BUTTON_PADDING * 2;
-
- extra_height = MAX(extra_height, BUTTON_HEIGHT + BUTTON_PADDING * 2);
-
- running_height = extra_height;
-
- for ( list = etgc->children; list; list = g_list_next (list)){
- ETableGroupContainerChildNode *child_node = (ETableGroupContainerChildNode *) list->data;
- ETableGroup *child = child_node->child;
-
- g_object_get (child,
- "width", &item_width,
- NULL);
-
- if (item_width > running_width)
- running_width = item_width;
- }
- for ( list = etgc->children; list; list = g_list_next (list)){
- ETableGroupContainerChildNode *child_node = (ETableGroupContainerChildNode *) list->data;
- ETableGroup *child = child_node->child;
- g_object_get (child,
- "height", &item_height,
- NULL);
-
- e_canvas_item_move_absolute (GNOME_CANVAS_ITEM(child_node->text),
- GROUP_INDENT,
- running_height - BUTTON_PADDING);
-
- e_canvas_item_move_absolute (GNOME_CANVAS_ITEM(child),
- GROUP_INDENT,
- running_height);
-
- gnome_canvas_item_set (GNOME_CANVAS_ITEM(child_node->rect),
- "x1", (double) 0,
- "x2", (double) running_width + GROUP_INDENT,
- "y1", (double) running_height - extra_height,
- "y2", (double) running_height + item_height,
- NULL);
-
- running_height += item_height + extra_height;
- }
- running_height -= extra_height;
- }
- if (running_height != old_height || running_width != old_width) {
- etgc->height = running_height;
- etgc->width = running_width;
- e_canvas_item_request_parent_reflow (item);
- }
- }
-}
-
-static void
-etgc_init (GtkObject *object)
-{
- ETableGroupContainer *container = E_TABLE_GROUP_CONTAINER(object);
- container->children = FALSE;
-
- e_canvas_item_set_reflow_callback (GNOME_CANVAS_ITEM(object), etgc_reflow);
-
- container->alternating_row_colors = 1;
- container->horizontal_draw_grid = 1;
- container->vertical_draw_grid = 1;
- container->draw_focus = 1;
- container->cursor_mode = E_CURSOR_SIMPLE;
- container->length_threshold = -1;
- container->selection_model = NULL;
- container->uniform_row_height = FALSE;
-}
-
-E_MAKE_TYPE (e_table_group_container, "ETableGroupContainer", ETableGroupContainer, etgc_class_init, etgc_init, PARENT_TYPE)
-
-void
-e_table_group_apply_to_leafs (ETableGroup *etg, ETableGroupLeafFn fn, void *closure)
-{
- if (E_IS_TABLE_GROUP_CONTAINER (etg)){
- ETableGroupContainer *etgc = E_TABLE_GROUP_CONTAINER (etg);
- GList *list = etgc->children;
-
- /* Protect from unrefs in the callback functions */
- g_object_ref (etg);
-
- for (list = etgc->children; list; list = list->next){
- ETableGroupContainerChildNode *child_node = list->data;
-
- e_table_group_apply_to_leafs (child_node->child, fn, closure);
- }
-
- g_object_unref (etg);
- } else if (E_IS_TABLE_GROUP_LEAF (etg)){
- (*fn) (E_TABLE_GROUP_LEAF (etg)->item, closure);
- } else {
- g_error ("Unknown ETableGroup found: %s",
- g_type_name (G_TYPE_FROM_INSTANCE (etg)));
- }
-}
-
-
-typedef struct {
- ETableGroupContainer *etgc;
- GList *child;
- EPrintable *child_printable;
-} ETGCPrintContext;
-
-#if 0
-#define CHECK(x) if((x) == -1) return -1;
-
-static gint
-gp_draw_rect (GnomePrintContext *context, gdouble x, gdouble y, gdouble width, gdouble height, gdouble r, gdouble g, gdouble b)
-{
- CHECK(gnome_print_moveto(context, x, y));
- CHECK(gnome_print_lineto(context, x + width, y));
- CHECK(gnome_print_lineto(context, x + width, y - height));
- CHECK(gnome_print_lineto(context, x, y - height));
- CHECK(gnome_print_lineto(context, x, y));
- return gnome_print_fill(context);
-}
-#endif
-
-#define CHECK(x) if((x) == -1) return -1;
-
-static gint
-gp_draw_rect (GnomePrintContext *context, gdouble x, gdouble y, gdouble width, gdouble height)
-{
- CHECK(gnome_print_moveto(context, x, y));
- CHECK(gnome_print_lineto(context, x + width, y));
- CHECK(gnome_print_lineto(context, x + width, y - height));
- CHECK(gnome_print_lineto(context, x, y - height));
- CHECK(gnome_print_lineto(context, x, y));
- return gnome_print_fill(context);
-}
-
-#define TEXT_HEIGHT (12)
-#define TEXT_AREA_HEIGHT (TEXT_HEIGHT + 4)
-
-static void
-e_table_group_container_print_page (EPrintable *ep,
- GnomePrintContext *context,
- gdouble width,
- gdouble height,
- gboolean quantize,
- ETGCPrintContext *groupcontext)
-{
- gdouble yd = height;
- gdouble child_height;
- ETableGroupContainerChildNode *child_node;
- GList *child;
- EPrintable *child_printable;
- gchar *string;
- GnomeFont *font = gnome_font_find ("Helvetica", TEXT_HEIGHT);
-
- child_printable = groupcontext->child_printable;
- child = groupcontext->child;
-
- if (child_printable) {
- if (child)
- child_node = child->data;
- else
- child_node = NULL;
- g_object_ref (child_printable);
- } else {
- if (!child) {
- return;
- } else {
- child_node = child->data;
- child_printable = e_table_group_get_printable(child_node->child);
- if (child_printable)
- g_object_ref (child_printable);
- e_printable_reset(child_printable);
- }
- }
-
- while (1) {
- child_height = e_printable_height(child_printable, context, width - 36, yd - TEXT_AREA_HEIGHT, quantize);
-
- if (gnome_print_gsave(context) == -1)
- /* FIXME */;
- if (gnome_print_moveto(context, 0, yd - child_height - TEXT_AREA_HEIGHT) == -1)
- /* FIXME */;
- if (gnome_print_lineto(context, 36, yd - child_height - TEXT_AREA_HEIGHT) == -1)
- /* FIXME */;
- if (gnome_print_lineto(context, 36, yd - TEXT_AREA_HEIGHT) == -1)
- /* FIXME */;
- if (gnome_print_lineto(context, width, yd - TEXT_AREA_HEIGHT) == -1)
- /* FIXME */;
- if (gnome_print_lineto(context, width, yd) == -1)
- /* FIXME */;
- if (gnome_print_lineto(context, 0, yd) == -1)
- /* FIXME */;
- if (gnome_print_lineto(context, 0, yd - child_height - TEXT_AREA_HEIGHT) == -1)
- /* FIXME */;
- if (gnome_print_setrgbcolor(context, .7, .7, .7) == -1)
- /* FIXME */;
- if (gnome_print_fill(context) == -1)
- /* FIXME */;
- if (gnome_print_grestore(context) == -1)
- /* FIXME */;
-
- if (gnome_print_gsave(context) == -1)
- /* FIXME */;
- if (gnome_print_moveto(context, 0, yd - TEXT_AREA_HEIGHT) == -1)
- /* FIXME */;
- if (gnome_print_lineto(context, width, yd - TEXT_AREA_HEIGHT) == -1)
- /* FIXME */;
- if (gnome_print_lineto(context, width, yd) == -1)
- /* FIXME */;
- if (gnome_print_lineto(context, 0, yd) == -1)
- /* FIXME */;
- if (gnome_print_lineto(context, 0, yd - TEXT_AREA_HEIGHT) == -1)
- /* FIXME */;
- if (gnome_print_clip(context) == -1)
- /* FIXME */;
-
- if (gnome_print_moveto(context, 2, yd - (TEXT_AREA_HEIGHT + gnome_font_get_ascender(font) - gnome_font_get_descender(font)) / 2) == -1)
- /* FIXME */;
- if (gnome_print_setfont(context, font))
- /* FIXME */;
- if (groupcontext->etgc->ecol->text)
- string = g_strdup_printf ("%s : %s (%d item%s)",
- groupcontext->etgc->ecol->text,
- child_node->string,
- (gint) child_node->count,
- child_node->count == 1 ? "" : "s");
- else
- string = g_strdup_printf ("%s (%d item%s)",
- child_node->string,
- (gint) child_node->count,
- child_node->count == 1 ? "" : "s");
- if (gnome_print_show(context, string))
- /* FIXME */;
- g_free(string);
- if (gnome_print_grestore(context) == -1)
- /* FIXME */;
-
- if (gnome_print_gsave(context) == -1)
- /* FIXME */;
- if (gnome_print_translate(context, 36, yd - TEXT_AREA_HEIGHT - child_height) == -1)
- /* FIXME */;
- if (gnome_print_moveto(context, 0, 0) == -1)
- /* FIXME */;
- if (gnome_print_lineto(context, width - 36, 0) == -1)
- /* FIXME */;
- if (gnome_print_lineto(context, width - 36, child_height) == -1)
- /* FIXME */;
- if (gnome_print_lineto(context, 0, child_height) == -1)
- /* FIXME */;
- if (gnome_print_lineto(context, 0, 0) == -1)
- /* FIXME */;
- if (gnome_print_clip(context) == -1)
- /* FIXME */;
- e_printable_print_page(child_printable, context, width - 36, child_height, quantize);
- if (gnome_print_grestore(context) == -1)
- /* FIXME */;
-
- gp_draw_rect(context, 0, yd - child_height - TEXT_AREA_HEIGHT + 1, width, 1);
- gp_draw_rect(context, width - 1, yd, 1, yd - child_height - TEXT_AREA_HEIGHT);
- gp_draw_rect(context, 0, yd, 1, yd - child_height - TEXT_AREA_HEIGHT);
-
- yd -= child_height + TEXT_AREA_HEIGHT;
-
- if (e_printable_data_left(child_printable))
- break;
-
- child = child->next;
- if (!child) {
- child_printable = NULL;
- break;
- }
-
- child_node = child->data;
- if (child_printable)
- g_object_unref (child_printable);
- child_printable = e_table_group_get_printable(child_node->child);
- if (child_printable)
- g_object_ref (child_printable);
- e_printable_reset(child_printable);
- }
-
- gp_draw_rect(context, 0, height, width, 1);
-
- if (groupcontext->child_printable)
- g_object_unref (groupcontext->child_printable);
- groupcontext->child_printable = child_printable;
- groupcontext->child = child;
-
-}
-
-static gboolean
-e_table_group_container_data_left (EPrintable *ep,
- ETGCPrintContext *groupcontext)
-{
- g_signal_stop_emission_by_name(ep, "data_left");
- return groupcontext->child != NULL;
-}
-
-static void
-e_table_group_container_reset (EPrintable *ep,
- ETGCPrintContext *groupcontext)
-{
- groupcontext->child = groupcontext->etgc->children;
- if (groupcontext->child_printable)
- g_object_unref (groupcontext->child_printable);
- groupcontext->child_printable = NULL;
-}
-
-static gdouble
-e_table_group_container_height (EPrintable *ep,
- GnomePrintContext *context,
- gdouble width,
- gdouble max_height,
- gboolean quantize,
- ETGCPrintContext *groupcontext)
-{
- gdouble height = 0;
- gdouble child_height;
- gdouble yd = max_height;
- ETableGroupContainerChildNode *child_node;
- GList *child;
- EPrintable *child_printable;
-
- child_printable = groupcontext->child_printable;
- child = groupcontext->child;
-
- if (child_printable)
- g_object_ref (child_printable);
- else {
- if (!child) {
- g_signal_stop_emission_by_name(ep, "height");
- return 0;
- } else {
- child_node = child->data;
- child_printable = e_table_group_get_printable(child_node->child);
- if (child_printable)
- g_object_ref (child_printable);
- e_printable_reset(child_printable);
- }
- }
-
- if (yd != -1 && yd < TEXT_AREA_HEIGHT)
- return 0;
-
- while (1) {
- child_height = e_printable_height(child_printable, context, width - 36, yd - (yd == -1 ? 0 : TEXT_AREA_HEIGHT), quantize);
-
- height += child_height + TEXT_AREA_HEIGHT;
-
- if (yd != -1) {
- if (!e_printable_will_fit(child_printable, context, width - 36, yd - (yd == -1 ? 0 : TEXT_AREA_HEIGHT), quantize)) {
- break;
- }
-
- yd -= child_height + TEXT_AREA_HEIGHT;
- }
-
- child = child->next;
- if (!child) {
- break;
- }
-
- child_node = child->data;
- if (child_printable)
- g_object_unref (child_printable);
- child_printable = e_table_group_get_printable(child_node->child);
- if (child_printable)
- g_object_ref (child_printable);
- e_printable_reset(child_printable);
- }
- if (child_printable)
- g_object_unref (child_printable);
- g_signal_stop_emission_by_name(ep, "height");
- return height;
-}
-
-static gboolean
-e_table_group_container_will_fit (EPrintable *ep,
- GnomePrintContext *context,
- gdouble width,
- gdouble max_height,
- gboolean quantize,
- ETGCPrintContext *groupcontext)
-{
- gboolean will_fit = TRUE;
- gdouble child_height;
- gdouble yd = max_height;
- ETableGroupContainerChildNode *child_node;
- GList *child;
- EPrintable *child_printable;
-
- child_printable = groupcontext->child_printable;
- child = groupcontext->child;
-
- if (child_printable)
- g_object_ref (child_printable);
- else {
- if (!child) {
- g_signal_stop_emission_by_name(ep, "will_fit");
- return will_fit;
- } else {
- child_node = child->data;
- child_printable = e_table_group_get_printable(child_node->child);
- if (child_printable)
- g_object_ref (child_printable);
- e_printable_reset(child_printable);
- }
- }
-
- if (yd != -1 && yd < TEXT_AREA_HEIGHT)
- will_fit = FALSE;
- else {
- while (1) {
- child_height = e_printable_height(child_printable, context, width - 36, yd - (yd == -1 ? 0 : TEXT_AREA_HEIGHT), quantize);
-
- if (yd != -1) {
- if (!e_printable_will_fit(child_printable, context, width - 36, yd - (yd == -1 ? 0 : TEXT_AREA_HEIGHT), quantize)) {
- will_fit = FALSE;
- break;
- }
-
- yd -= child_height + TEXT_AREA_HEIGHT;
- }
-
- child = child->next;
- if (!child) {
- break;
- }
-
- child_node = child->data;
- if (child_printable)
- g_object_unref (child_printable);
- child_printable = e_table_group_get_printable(child_node->child);
- if (child_printable)
- g_object_ref (child_printable);
- e_printable_reset(child_printable);
- }
- }
-
- if (child_printable)
- g_object_unref (child_printable);
-
- g_signal_stop_emission_by_name(ep, "will_fit");
- return will_fit;
-}
-
-static void
-e_table_group_container_printable_destroy (gpointer data,
- GObject *where_object_was)
-
-{
- ETGCPrintContext *groupcontext = data;
-
- g_object_unref (groupcontext->etgc);
- if (groupcontext->child_printable)
- g_object_ref (groupcontext->child_printable);
- g_free(groupcontext);
-}
-
-static EPrintable *
-etgc_get_printable (ETableGroup *etg)
-{
- ETableGroupContainer *etgc = E_TABLE_GROUP_CONTAINER(etg);
- EPrintable *printable = e_printable_new();
- ETGCPrintContext *groupcontext;
-
- groupcontext = g_new(ETGCPrintContext, 1);
- groupcontext->etgc = etgc;
- g_object_ref (etgc);
- groupcontext->child = etgc->children;
- groupcontext->child_printable = NULL;
-
- g_signal_connect (printable,
- "print_page",
- G_CALLBACK(e_table_group_container_print_page),
- groupcontext);
- g_signal_connect (printable,
- "data_left",
- G_CALLBACK(e_table_group_container_data_left),
- groupcontext);
- g_signal_connect (printable,
- "reset",
- G_CALLBACK(e_table_group_container_reset),
- groupcontext);
- g_signal_connect (printable,
- "height",
- G_CALLBACK(e_table_group_container_height),
- groupcontext);
- g_signal_connect (printable,
- "will_fit",
- G_CALLBACK(e_table_group_container_will_fit),
- groupcontext);
- g_object_weak_ref (G_OBJECT (printable),
- e_table_group_container_printable_destroy,
- groupcontext);
-
- return printable;
-}
diff --git a/widgets/table/e-table-group-container.h b/widgets/table/e-table-group-container.h
deleted file mode 100644
index b094167c09..0000000000
--- a/widgets/table/e-table-group-container.h
+++ /dev/null
@@ -1,98 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-table-group-container.h
- * Copyright 2000, 2001, Ximian, Inc.
- *
- * Authors:
- * Chris Lahey <clahey@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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.
- */
-
-#ifndef _E_TABLE_GROUP_CONTAINER_H_
-#define _E_TABLE_GROUP_CONTAINER_H_
-
-#include <libgnomecanvas/gnome-canvas.h>
-#include <gal/e-table/e-table-model.h>
-#include <gal/e-table/e-table-header.h>
-#include <gal/e-table/e-table-group.h>
-#include <gal/e-table/e-table-item.h>
-
-G_BEGIN_DECLS
-
-#define E_TABLE_GROUP_CONTAINER_TYPE (e_table_group_container_get_type ())
-#define E_TABLE_GROUP_CONTAINER(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), E_TABLE_GROUP_CONTAINER_TYPE, ETableGroupContainer))
-#define E_TABLE_GROUP_CONTAINER_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), E_TABLE_GROUP_CONTAINER_TYPE, ETableGroupContainerClass))
-#define E_IS_TABLE_GROUP_CONTAINER(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), E_TABLE_GROUP_CONTAINER_TYPE))
-#define E_IS_TABLE_GROUP_CONTAINER_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), E_TABLE_GROUP_CONTAINER_TYPE))
-
-typedef struct {
- ETableGroup group;
-
- /*
- * The ETableCol used to group this set
- */
- ETableCol *ecol;
- gint ascending;
-
- /*
- * List of ETableGroups we stack
- */
- GList *children;
-
- /*
- * The canvas rectangle that contains the children
- */
- GnomeCanvasItem *rect;
-
- GdkFont *font;
-
- gdouble width, height, minimum_width;
-
- ETableSortInfo *sort_info;
- int n;
- int length_threshold;
-
- ESelectionModel *selection_model;
-
- guint alternating_row_colors : 1;
- guint horizontal_draw_grid : 1;
- guint vertical_draw_grid : 1;
- guint draw_focus : 1;
- guint uniform_row_height : 1;
- ECursorMode cursor_mode;
-
- /*
- * State: the ETableGroup is open or closed
- */
- guint open:1;
-} ETableGroupContainer;
-
-typedef struct {
- ETableGroupClass parent_class;
-} ETableGroupContainerClass;
-
-ETableGroup *e_table_group_container_new (GnomeCanvasGroup *parent, ETableHeader *full_header, ETableHeader *header,
- ETableModel *model, ETableSortInfo *sort_info, int n);
-void e_table_group_container_construct (GnomeCanvasGroup *parent, ETableGroupContainer *etgc,
- ETableHeader *full_header,
- ETableHeader *header,
- ETableModel *model, ETableSortInfo *sort_info, int n);
-
-GType e_table_group_container_get_type (void);
-
-G_END_DECLS
-
-#endif /* _E_TABLE_GROUP_CONTAINER_H_ */
diff --git a/widgets/table/e-table-group-leaf.c b/widgets/table/e-table-group-leaf.c
deleted file mode 100644
index e580fc89fc..0000000000
--- a/widgets/table/e-table-group-leaf.c
+++ /dev/null
@@ -1,686 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-table-group-leaf.c
- * Copyright 2000, 2001, Ximian, Inc.
- *
- * Authors:
- * Chris Lahey <clahey@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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 <gtk/gtksignal.h>
-#include <libgnomecanvas/gnome-canvas-rect-ellipse.h>
-#include "e-table-group-leaf.h"
-#include "e-table-item.h"
-#include "e-table-sorted-variable.h"
-#include "e-table-sorted.h"
-#include "gal/util/e-util.h"
-#include "gal/util/e-i18n.h"
-#include "gal/widgets/e-canvas.h"
-
-#define PARENT_TYPE e_table_group_get_type ()
-
-static GnomeCanvasGroupClass *etgl_parent_class;
-
-/* The arguments we take */
-enum {
- PROP_0,
- PROP_HEIGHT,
- PROP_WIDTH,
- PROP_MINIMUM_WIDTH,
- PROP_FROZEN,
- PROP_TABLE_ALTERNATING_ROW_COLORS,
- PROP_TABLE_HORIZONTAL_DRAW_GRID,
- PROP_TABLE_VERTICAL_DRAW_GRID,
- PROP_TABLE_DRAW_FOCUS,
- PROP_CURSOR_MODE,
- PROP_LENGTH_THRESHOLD,
- PROP_SELECTION_MODEL,
- PROP_UNIFORM_ROW_HEIGHT
-};
-
-static void
-etgl_dispose (GObject *object)
-{
- ETableGroupLeaf *etgl = E_TABLE_GROUP_LEAF(object);
-
- if (etgl->ets) {
- g_object_unref (etgl->ets);
- etgl->ets = NULL;
- }
-
- if (etgl->item) {
- if (etgl->etgl_cursor_change_id != 0)
- g_signal_handler_disconnect (etgl->item,
- etgl->etgl_cursor_change_id);
- if (etgl->etgl_cursor_activated_id != 0)
- g_signal_handler_disconnect (etgl->item,
- etgl->etgl_cursor_activated_id);
- if (etgl->etgl_double_click_id != 0)
- g_signal_handler_disconnect (etgl->item,
- etgl->etgl_double_click_id);
- if (etgl->etgl_right_click_id != 0)
- g_signal_handler_disconnect (etgl->item,
- etgl->etgl_right_click_id);
- if (etgl->etgl_click_id != 0)
- g_signal_handler_disconnect (etgl->item,
- etgl->etgl_click_id);
- if (etgl->etgl_key_press_id != 0)
- g_signal_handler_disconnect (etgl->item,
- etgl->etgl_key_press_id);
- if (etgl->etgl_start_drag_id != 0)
- g_signal_handler_disconnect (etgl->item,
- etgl->etgl_start_drag_id);
-
- etgl->etgl_cursor_change_id = 0;
- etgl->etgl_cursor_activated_id = 0;
- etgl->etgl_double_click_id = 0;
- etgl->etgl_right_click_id = 0;
- etgl->etgl_click_id = 0;
- etgl->etgl_key_press_id = 0;
- etgl->etgl_start_drag_id = 0;
-
- gtk_object_destroy (GTK_OBJECT(etgl->item));
- etgl->item = NULL;
- }
-
- if (etgl->selection_model) {
- g_object_unref (etgl->selection_model);
- etgl->selection_model = NULL;
- }
-
- if (G_OBJECT_CLASS (etgl_parent_class)->dispose)
- G_OBJECT_CLASS (etgl_parent_class)->dispose (object);
-}
-
-static void
-e_table_group_leaf_construct (GnomeCanvasGroup *parent,
- ETableGroupLeaf *etgl,
- ETableHeader *full_header,
- ETableHeader *header,
- ETableModel *model,
- ETableSortInfo *sort_info)
-{
- etgl->is_grouped = e_table_sort_info_grouping_get_count(sort_info) > 0 ? TRUE : FALSE;
-
- if (etgl->is_grouped)
- etgl->ets = E_TABLE_SUBSET(e_table_sorted_variable_new (model,
- full_header,
- sort_info));
- else
- etgl->ets = E_TABLE_SUBSET(e_table_sorted_new (model,
- full_header,
- sort_info));
-
- e_table_group_construct (parent, E_TABLE_GROUP (etgl), full_header, header, model);
-}
-
-/**
- * e_table_group_leaf_new
- * @parent: The %GnomeCanvasGroup to create a child of.
- * @full_header: The full header of the %ETable.
- * @header: The current header of the %ETable.
- * @model: The %ETableModel of the %ETable.
- * @sort_info: The %ETableSortInfo of the %ETable.
- *
- * %ETableGroupLeaf is an %ETableGroup which simply contains an
- * %ETableItem.
- *
- * Returns: The new %ETableGroupLeaf.
- */
-ETableGroup *
-e_table_group_leaf_new (GnomeCanvasGroup *parent,
- ETableHeader *full_header,
- ETableHeader *header,
- ETableModel *model,
- ETableSortInfo *sort_info)
-{
- ETableGroupLeaf *etgl;
-
- g_return_val_if_fail (parent != NULL, NULL);
-
- etgl = g_object_new (E_TABLE_GROUP_LEAF_TYPE, NULL);
-
- e_table_group_leaf_construct (parent, etgl, full_header,
- header, model, sort_info);
- return E_TABLE_GROUP (etgl);
-}
-
-static void
-etgl_cursor_change (GtkObject *object, gint row, ETableGroupLeaf *etgl)
-{
- if (row < E_TABLE_SUBSET(etgl->ets)->n_map)
- e_table_group_cursor_change (E_TABLE_GROUP(etgl),
- E_TABLE_SUBSET(etgl->ets)->map_table[row]);
-}
-
-static void
-etgl_cursor_activated (GtkObject *object, gint view_row, ETableGroupLeaf *etgl)
-{
- if (view_row < E_TABLE_SUBSET(etgl->ets)->n_map)
- e_table_group_cursor_activated (E_TABLE_GROUP(etgl),
- E_TABLE_SUBSET(etgl->ets)->map_table[view_row]);
-}
-
-static void
-etgl_double_click (GtkObject *object, gint model_row, gint model_col, GdkEvent *event,
- ETableGroupLeaf *etgl)
-{
- e_table_group_double_click (E_TABLE_GROUP(etgl), model_row, model_col, event);
-}
-
-static gint
-etgl_key_press (GtkObject *object, gint row, gint col, GdkEvent *event, ETableGroupLeaf *etgl)
-{
- if (row < E_TABLE_SUBSET(etgl->ets)->n_map && row >= 0)
- return e_table_group_key_press (E_TABLE_GROUP(etgl),
- E_TABLE_SUBSET(etgl->ets)->map_table[row],
- col,
- event);
- else
- return 0;
-}
-
-static gint
-etgl_start_drag (GtkObject *object, gint model_row, gint model_col, GdkEvent *event,
- ETableGroupLeaf *etgl)
-{
- return e_table_group_start_drag (E_TABLE_GROUP(etgl), model_row, model_col, event);
-}
-
-static gint
-etgl_right_click (GtkObject *object, gint view_row, gint model_col, GdkEvent *event,
- ETableGroupLeaf *etgl)
-{
- if (view_row < E_TABLE_SUBSET(etgl->ets)->n_map)
- return e_table_group_right_click (E_TABLE_GROUP(etgl),
- E_TABLE_SUBSET(etgl->ets)->map_table[view_row],
- model_col,
- event);
- else
- return 0;
-}
-
-static gint
-etgl_click (GtkObject *object, gint row, gint col, GdkEvent *event, ETableGroupLeaf *etgl)
-{
- if (row < E_TABLE_SUBSET(etgl->ets)->n_map)
- return e_table_group_click (E_TABLE_GROUP(etgl),
- E_TABLE_SUBSET(etgl->ets)->map_table[row],
- col,
- event);
- else
- return 0;
-}
-
-static void
-etgl_reflow (GnomeCanvasItem *item, gint flags)
-{
- ETableGroupLeaf *leaf = E_TABLE_GROUP_LEAF(item);
-
- g_object_get(leaf->item,
- "height", &leaf->height,
- NULL);
- g_object_get(leaf->item,
- "width", &leaf->width,
- NULL);
-
- e_canvas_item_request_parent_reflow (item);
-}
-
-static void
-etgl_realize (GnomeCanvasItem *item)
-{
- ETableGroupLeaf *etgl = E_TABLE_GROUP_LEAF(item);
-
- if (GNOME_CANVAS_ITEM_CLASS (etgl_parent_class)->realize)
- GNOME_CANVAS_ITEM_CLASS (etgl_parent_class)->realize (item);
-
- etgl->item = E_TABLE_ITEM(gnome_canvas_item_new (
- GNOME_CANVAS_GROUP(etgl),
- e_table_item_get_type (),
- "ETableHeader", E_TABLE_GROUP(etgl)->header,
- "ETableModel", etgl->ets,
- "alternating_row_colors", etgl->alternating_row_colors,
- "horizontal_draw_grid", etgl->horizontal_draw_grid,
- "vertical_draw_grid", etgl->vertical_draw_grid,
- "drawfocus", etgl->draw_focus,
- "cursor_mode", etgl->cursor_mode,
- "minimum_width", etgl->minimum_width,
- "length_threshold", etgl->length_threshold,
- "selection_model", etgl->selection_model,
- "uniform_row_height", etgl->uniform_row_height,
- NULL));
-
- etgl->etgl_cursor_change_id = g_signal_connect (etgl->item,
- "cursor_change",
- G_CALLBACK(etgl_cursor_change),
- etgl);
- etgl->etgl_cursor_activated_id = g_signal_connect (etgl->item,
- "cursor_activated",
- G_CALLBACK(etgl_cursor_activated),
- etgl);
- etgl->etgl_double_click_id = g_signal_connect (etgl->item,
- "double_click",
- G_CALLBACK(etgl_double_click),
- etgl);
-
- etgl->etgl_right_click_id = g_signal_connect (etgl->item,
- "right_click",
- G_CALLBACK(etgl_right_click),
- etgl);
- etgl->etgl_click_id = g_signal_connect (etgl->item,
- "click",
- G_CALLBACK(etgl_click),
- etgl);
- etgl->etgl_key_press_id = g_signal_connect (etgl->item,
- "key_press",
- G_CALLBACK(etgl_key_press),
- etgl);
- etgl->etgl_start_drag_id = g_signal_connect (etgl->item,
- "start_drag",
- G_CALLBACK(etgl_start_drag),
- etgl);
-
- e_canvas_item_request_reflow(item);
-}
-
-static void
-etgl_add (ETableGroup *etg, gint row)
-{
- ETableGroupLeaf *etgl = E_TABLE_GROUP_LEAF (etg);
-
- if (E_IS_TABLE_SUBSET_VARIABLE(etgl->ets)) {
- e_table_subset_variable_add (E_TABLE_SUBSET_VARIABLE(etgl->ets), row);
- }
-}
-
-static void
-etgl_add_array (ETableGroup *etg, const gint *array, gint count)
-{
- ETableGroupLeaf *etgl = E_TABLE_GROUP_LEAF (etg);
-
- if (E_IS_TABLE_SUBSET_VARIABLE(etgl->ets)) {
- e_table_subset_variable_add_array (E_TABLE_SUBSET_VARIABLE(etgl->ets), array, count);
- }
-}
-
-static void
-etgl_add_all (ETableGroup *etg)
-{
- ETableGroupLeaf *etgl = E_TABLE_GROUP_LEAF (etg);
-
- if (E_IS_TABLE_SUBSET_VARIABLE(etgl->ets)) {
- e_table_subset_variable_add_all (E_TABLE_SUBSET_VARIABLE(etgl->ets));
- }
-}
-
-static gboolean
-etgl_remove (ETableGroup *etg, gint row)
-{
- ETableGroupLeaf *etgl = E_TABLE_GROUP_LEAF (etg);
-
- if (E_IS_TABLE_SUBSET_VARIABLE(etgl->ets)) {
- return e_table_subset_variable_remove (E_TABLE_SUBSET_VARIABLE(etgl->ets), row);
- }
- return FALSE;
-}
-
-static void
-etgl_increment (ETableGroup *etg, gint position, gint amount)
-{
- ETableGroupLeaf *etgl = E_TABLE_GROUP_LEAF (etg);
-
- if (E_IS_TABLE_SUBSET_VARIABLE(etgl->ets)) {
- e_table_subset_variable_increment (E_TABLE_SUBSET_VARIABLE(etgl->ets), position, amount);
- }
-}
-
-static void
-etgl_decrement (ETableGroup *etg, gint position, gint amount)
-{
- ETableGroupLeaf *etgl = E_TABLE_GROUP_LEAF (etg);
-
- if (E_IS_TABLE_SUBSET_VARIABLE(etgl->ets)) {
- e_table_subset_variable_decrement (E_TABLE_SUBSET_VARIABLE(etgl->ets), position, amount);
- }
-}
-
-static int
-etgl_row_count (ETableGroup *etg)
-{
- ETableGroupLeaf *etgl = E_TABLE_GROUP_LEAF (etg);
-
- return e_table_model_row_count(E_TABLE_MODEL(etgl->ets));
-}
-
-static void
-etgl_set_focus (ETableGroup *etg, EFocus direction, gint view_col)
-{
- ETableGroupLeaf *etgl = E_TABLE_GROUP_LEAF (etg);
-
- if (direction == E_FOCUS_END) {
- e_table_item_set_cursor (etgl->item, view_col, e_table_model_row_count(E_TABLE_MODEL(etgl->ets)) - 1);
- } else {
- e_table_item_set_cursor (etgl->item, view_col, 0);
- }
-}
-
-static gint
-etgl_get_focus_column (ETableGroup *etg)
-{
- ETableGroupLeaf *etgl = E_TABLE_GROUP_LEAF (etg);
-
- return e_table_item_get_focused_column (etgl->item);
-}
-
-static EPrintable *
-etgl_get_printable (ETableGroup *etg)
-{
- ETableGroupLeaf *etgl = E_TABLE_GROUP_LEAF (etg);
-
- return e_table_item_get_printable (etgl->item);
-}
-
-static void
-etgl_compute_location (ETableGroup *etg, int *x, int *y, int *row, int *col)
-{
- ETableGroupLeaf *etgl = E_TABLE_GROUP_LEAF (etg);
-
- e_table_item_compute_location (etgl->item, x, y, row, col);
-}
-
-static void
-etgl_get_cell_geometry (ETableGroup *etg, int *row, int *col, int *x, int *y, int *width, int *height)
-{
- ETableGroupLeaf *etgl = E_TABLE_GROUP_LEAF (etg);
-
- e_table_item_get_cell_geometry (etgl->item, row, col, x, y, width, height);
-}
-
-static void
-etgl_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec)
-{
- ETableGroup *etg = E_TABLE_GROUP (object);
- ETableGroupLeaf *etgl = E_TABLE_GROUP_LEAF (object);
-
- switch (prop_id) {
- case PROP_FROZEN:
- etg->frozen = g_value_get_boolean (value);
- break;
- case PROP_MINIMUM_WIDTH:
- case PROP_WIDTH:
- etgl->minimum_width = g_value_get_double (value);
- if (etgl->item) {
- gnome_canvas_item_set (GNOME_CANVAS_ITEM(etgl->item),
- "minimum_width", etgl->minimum_width,
- NULL);
- }
- break;
- case PROP_LENGTH_THRESHOLD:
- etgl->length_threshold = g_value_get_int (value);
- if (etgl->item) {
- gnome_canvas_item_set (GNOME_CANVAS_ITEM(etgl->item),
- "length_threshold", etgl->length_threshold,
- NULL);
- }
- break;
- case PROP_SELECTION_MODEL:
- if (etgl->selection_model)
- g_object_unref(etgl->selection_model);
- etgl->selection_model = E_SELECTION_MODEL(g_value_get_object (value));
- if (etgl->selection_model) {
- g_object_ref(etgl->selection_model);
- }
- if (etgl->item) {
- gnome_canvas_item_set (GNOME_CANVAS_ITEM(etgl->item),
- "selection_model", etgl->selection_model,
- NULL);
- }
- break;
-
- case PROP_UNIFORM_ROW_HEIGHT:
- etgl->uniform_row_height = g_value_get_boolean (value);
- if (etgl->item) {
- gnome_canvas_item_set (GNOME_CANVAS_ITEM(etgl->item),
- "uniform_row_height", etgl->uniform_row_height,
- NULL);
- }
- break;
-
- case PROP_TABLE_ALTERNATING_ROW_COLORS:
- etgl->alternating_row_colors = g_value_get_boolean (value);
- if (etgl->item) {
- gnome_canvas_item_set (GNOME_CANVAS_ITEM(etgl->item),
- "alternating_row_colors", etgl->alternating_row_colors,
- NULL);
- }
- break;
-
- case PROP_TABLE_HORIZONTAL_DRAW_GRID:
- etgl->horizontal_draw_grid = g_value_get_boolean (value);
- if (etgl->item) {
- gnome_canvas_item_set (GNOME_CANVAS_ITEM(etgl->item),
- "horizontal_draw_grid", etgl->horizontal_draw_grid,
- NULL);
- }
- break;
-
- case PROP_TABLE_VERTICAL_DRAW_GRID:
- etgl->vertical_draw_grid = g_value_get_boolean (value);
- if (etgl->item) {
- gnome_canvas_item_set (GNOME_CANVAS_ITEM(etgl->item),
- "vertical_draw_grid", etgl->vertical_draw_grid,
- NULL);
- }
- break;
-
- case PROP_TABLE_DRAW_FOCUS:
- etgl->draw_focus = g_value_get_boolean (value);
- if (etgl->item) {
- gnome_canvas_item_set (GNOME_CANVAS_ITEM(etgl->item),
- "drawfocus", etgl->draw_focus,
- NULL);
- }
- break;
-
- case PROP_CURSOR_MODE:
- etgl->cursor_mode = g_value_get_int (value);
- if (etgl->item) {
- gnome_canvas_item_set (GNOME_CANVAS_ITEM(etgl->item),
- "cursor_mode", etgl->cursor_mode,
- NULL);
- }
- break;
- default:
- break;
- }
-}
-
-static void
-etgl_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec)
-{
- ETableGroup *etg = E_TABLE_GROUP (object);
- ETableGroupLeaf *etgl = E_TABLE_GROUP_LEAF (object);
-
- switch (prop_id) {
- case PROP_FROZEN:
- g_value_set_boolean (value, etg->frozen);
- break;
- case PROP_HEIGHT:
- g_value_set_double (value, etgl->height);
- break;
- case PROP_WIDTH:
- g_value_set_double (value, etgl->width);
- break;
- case PROP_MINIMUM_WIDTH:
- g_value_set_double (value, etgl->minimum_width);
- break;
- case PROP_UNIFORM_ROW_HEIGHT:
- g_value_set_boolean (value, etgl->uniform_row_height);
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
- break;
- }
-}
-
-static void
-etgl_class_init (GObjectClass *object_class)
-{
- GnomeCanvasItemClass *item_class = (GnomeCanvasItemClass *) object_class;
- ETableGroupClass *e_group_class = E_TABLE_GROUP_CLASS(object_class);
-
- object_class->dispose = etgl_dispose;
- object_class->set_property = etgl_set_property;
- object_class->get_property = etgl_get_property;
-
- item_class->realize = etgl_realize;
-
- etgl_parent_class = g_type_class_ref (PARENT_TYPE);
-
- e_group_class->add = etgl_add;
- e_group_class->add_array = etgl_add_array;
- e_group_class->add_all = etgl_add_all;
- e_group_class->remove = etgl_remove;
- e_group_class->increment = etgl_increment;
- e_group_class->decrement = etgl_decrement;
- e_group_class->row_count = etgl_row_count;
- e_group_class->set_focus = etgl_set_focus;
- e_group_class->get_focus_column = etgl_get_focus_column;
- e_group_class->get_printable = etgl_get_printable;
- e_group_class->compute_location = etgl_compute_location;
- e_group_class->get_cell_geometry = etgl_get_cell_geometry;
-
- g_object_class_install_property (object_class, PROP_TABLE_ALTERNATING_ROW_COLORS,
- g_param_spec_boolean ("alternating_row_colors",
- _( "Alternating Row Colors" ),
- _( "Alternating Row Colors" ),
- FALSE,
- G_PARAM_WRITABLE));
-
- g_object_class_install_property (object_class, PROP_TABLE_HORIZONTAL_DRAW_GRID,
- g_param_spec_boolean ("horizontal_draw_grid",
- _( "Horizontal Draw Grid" ),
- _( "Horizontal Draw Grid" ),
- FALSE,
- G_PARAM_WRITABLE));
-
- g_object_class_install_property (object_class, PROP_TABLE_VERTICAL_DRAW_GRID,
- g_param_spec_boolean ("vertical_draw_grid",
- _( "Vertical Draw Grid" ),
- _( "Vertical Draw Grid" ),
- FALSE,
- G_PARAM_WRITABLE));
-
- g_object_class_install_property (object_class, PROP_TABLE_DRAW_FOCUS,
- g_param_spec_boolean ("drawfocus",
- _( "Draw focus" ),
- _( "Draw focus" ),
- FALSE,
- G_PARAM_WRITABLE));
-
- g_object_class_install_property (object_class, PROP_CURSOR_MODE,
- g_param_spec_int ("cursor_mode",
- _( "Cursor mode" ),
- _( "Cursor mode" ),
- E_CURSOR_LINE, E_CURSOR_SPREADSHEET, E_CURSOR_LINE,
- G_PARAM_WRITABLE));
-
- g_object_class_install_property (object_class, PROP_LENGTH_THRESHOLD,
- g_param_spec_int ("length_threshold",
- _( "Length Threshold" ),
- _( "Length Threshold" ),
- 0, G_MAXINT, 0,
- G_PARAM_WRITABLE));
-
- g_object_class_install_property (object_class, PROP_SELECTION_MODEL,
- g_param_spec_object ("selection_model",
- _( "Selection model" ),
- _( "Selection model" ),
- E_SELECTION_MODEL_TYPE,
- G_PARAM_WRITABLE));
-
- g_object_class_install_property (object_class, PROP_HEIGHT,
- g_param_spec_double ("height",
- _( "Height" ),
- _( "Height" ),
- 0.0, G_MAXDOUBLE, 0.0,
- G_PARAM_READABLE));
-
- g_object_class_install_property (object_class, PROP_WIDTH,
- g_param_spec_double ("width",
- _( "Width" ),
- _( "Width" ),
- 0.0, G_MAXDOUBLE, 0.0,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_MINIMUM_WIDTH,
- g_param_spec_double ("minimum_width",
- _( "Minimum width" ),
- _( "Minimum Width" ),
- 0.0, G_MAXDOUBLE, 0.0,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_FROZEN,
- g_param_spec_boolean ("frozen",
- _( "Frozen" ),
- _( "Frozen" ),
- FALSE,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_UNIFORM_ROW_HEIGHT,
- g_param_spec_boolean ("uniform_row_height",
- _( "Uniform row height" ),
- _( "Uniform row height" ),
- FALSE,
- G_PARAM_READWRITE));
-}
-
-static void
-etgl_init (GtkObject *object)
-{
- ETableGroupLeaf *etgl = E_TABLE_GROUP_LEAF (object);
-
- etgl->width = 1;
- etgl->height = 1;
- etgl->minimum_width = 0;
-
- etgl->ets = NULL;
- etgl->item = NULL;
-
- etgl->etgl_cursor_change_id = 0;
- etgl->etgl_cursor_activated_id = 0;
- etgl->etgl_double_click_id = 0;
- etgl->etgl_right_click_id = 0;
- etgl->etgl_click_id = 0;
- etgl->etgl_key_press_id = 0;
- etgl->etgl_start_drag_id = 0;
-
- etgl->alternating_row_colors = 1;
- etgl->horizontal_draw_grid = 1;
- etgl->vertical_draw_grid = 1;
- etgl->draw_focus = 1;
- etgl->cursor_mode = E_CURSOR_SIMPLE;
- etgl->length_threshold = -1;
-
- etgl->selection_model = NULL;
- etgl->uniform_row_height = FALSE;
-
- e_canvas_item_set_reflow_callback (GNOME_CANVAS_ITEM(object), etgl_reflow);
-}
-
-E_MAKE_TYPE (e_table_group_leaf, "ETableGroupLeaf", ETableGroupLeaf, etgl_class_init, etgl_init, PARENT_TYPE)
diff --git a/widgets/table/e-table-group-leaf.h b/widgets/table/e-table-group-leaf.h
deleted file mode 100644
index 74fdfd8c03..0000000000
--- a/widgets/table/e-table-group-leaf.h
+++ /dev/null
@@ -1,90 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-table-group-leaf.h
- * Copyright 2000, 2001, Ximian, Inc.
- *
- * Authors:
- * Chris Lahey <clahey@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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.
- */
-
-#ifndef _E_TABLE_GROUP_LEAF_H_
-#define _E_TABLE_GROUP_LEAF_H_
-
-#include <libgnomecanvas/gnome-canvas.h>
-#include <gal/e-table/e-table-group.h>
-#include <gal/e-table/e-table-subset.h>
-#include <gal/e-table/e-table-item.h>
-
-G_BEGIN_DECLS
-
-#define E_TABLE_GROUP_LEAF_TYPE (e_table_group_leaf_get_type ())
-#define E_TABLE_GROUP_LEAF(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), E_TABLE_GROUP_LEAF_TYPE, ETableGroupLeaf))
-#define E_TABLE_GROUP_LEAF_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), E_TABLE_GROUP_LEAF_TYPE, ETableGroupLeafClass))
-#define E_IS_TABLE_GROUP_LEAF(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), E_TABLE_GROUP_LEAF_TYPE))
-#define E_IS_TABLE_GROUP_LEAF_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), E_TABLE_GROUP_LEAF_TYPE))
-
-typedef struct {
- ETableGroup group;
-
- /*
- * Item.
- */
- ETableItem *item;
-
- gdouble height;
- gdouble width;
- gdouble minimum_width;
-
- int length_threshold;
-
- ETableSubset *ets;
- guint is_grouped : 1;
-
- guint alternating_row_colors : 1;
- guint horizontal_draw_grid : 1;
- guint vertical_draw_grid : 1;
- guint draw_focus : 1;
- guint uniform_row_height : 1;
- ECursorMode cursor_mode;
-
- int etgl_cursor_change_id;
- int etgl_cursor_activated_id;
- int etgl_double_click_id;
- int etgl_right_click_id;
- int etgl_click_id;
- int etgl_key_press_id;
- int etgl_start_drag_id;
-
- ESelectionModel *selection_model;
-} ETableGroupLeaf;
-
-typedef struct {
- ETableGroupClass parent_class;
-} ETableGroupLeafClass;
-
-ETableGroup *e_table_group_leaf_new (GnomeCanvasGroup *parent,
- ETableHeader *full_header,
- ETableHeader *header,
- ETableModel *model,
- ETableSortInfo *sort_info);
-GType e_table_group_leaf_get_type (void);
-
-
-G_END_DECLS
-
-#endif /* _E_TABLE_GROUP_LEAF_H_ */
-
diff --git a/widgets/table/e-table-group.c b/widgets/table/e-table-group.c
deleted file mode 100644
index 5bc8841cb4..0000000000
--- a/widgets/table/e-table-group.c
+++ /dev/null
@@ -1,712 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-table-group.c
- * Copyright 2000, 2001, Ximian, Inc.
- *
- * Authors:
- * Chris Lahey <clahey@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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 <gtk/gtksignal.h>
-#include <libgnomecanvas/gnome-canvas-rect-ellipse.h>
-#include "e-table-group.h"
-#include "e-table-group-container.h"
-#include "e-table-group-leaf.h"
-#include "e-table-item.h"
-#include "gal/util/e-util.h"
-
-#define PARENT_TYPE gnome_canvas_group_get_type ()
-
-#define ETG_CLASS(e) (E_TABLE_GROUP_CLASS(GTK_OBJECT_GET_CLASS(e)))
-
-static GnomeCanvasGroupClass *etg_parent_class;
-
-enum {
- CURSOR_CHANGE,
- CURSOR_ACTIVATED,
- DOUBLE_CLICK,
- RIGHT_CLICK,
- CLICK,
- KEY_PRESS,
- START_DRAG,
- LAST_SIGNAL
-};
-
-static guint etg_signals [LAST_SIGNAL] = { 0, };
-
-static gboolean etg_get_focus (ETableGroup *etg);
-
-static void
-etg_dispose (GObject *object)
-{
- ETableGroup *etg = E_TABLE_GROUP(object);
-
- if (etg->header) {
- g_object_unref (etg->header);
- etg->header = NULL;
- }
-
- if (etg->full_header) {
- g_object_unref (etg->full_header);
- etg->full_header = NULL;
- }
-
- if (etg->model) {
- g_object_unref (etg->model);
- etg->model = NULL;
- }
-
- if (G_OBJECT_CLASS (etg_parent_class)->dispose)
- G_OBJECT_CLASS (etg_parent_class)->dispose (object);
-}
-
-/**
- * e_table_group_new
- * @parent: The %GnomeCanvasGroup to create a child of.
- * @full_header: The full header of the %ETable.
- * @header: The current header of the %ETable.
- * @model: The %ETableModel of the %ETable.
- * @sort_info: The %ETableSortInfo of the %ETable.
- * @n: The grouping information object to group by.
- *
- * %ETableGroup is a collection of rows of an %ETable. It's a
- * %GnomeCanvasItem. There are two different forms. If n < the
- * number of groupings in the given %ETableSortInfo, then the
- * %ETableGroup will need to contain other %ETableGroups, thus it
- * creates an %ETableGroupContainer. Otherwise, it will just contain
- * an %ETableItem, and thus it creates an %ETableGroupLeaf.
- *
- * Returns: The new %ETableGroup.
- */
-ETableGroup *
-e_table_group_new (GnomeCanvasGroup *parent,
- ETableHeader *full_header,
- ETableHeader *header,
- ETableModel *model,
- ETableSortInfo *sort_info,
- int n)
-{
- g_return_val_if_fail (model != NULL, NULL);
-
- if (n < e_table_sort_info_grouping_get_count(sort_info)) {
- return e_table_group_container_new (parent, full_header, header, model, sort_info, n);
- } else {
- return e_table_group_leaf_new (parent, full_header, header, model, sort_info);
- }
- return NULL;
-}
-
-/**
- * e_table_group_construct
- * @parent: The %GnomeCanvasGroup to create a child of.
- * @etg: The %ETableGroup to construct.
- * @full_header: The full header of the %ETable.
- * @header: The current header of the %ETable.
- * @model: The %ETableModel of the %ETable.
- *
- * This routine does the base construction of the %ETableGroup.
- */
-void
-e_table_group_construct (GnomeCanvasGroup *parent,
- ETableGroup *etg,
- ETableHeader *full_header,
- ETableHeader *header,
- ETableModel *model)
-{
- etg->full_header = full_header;
- g_object_ref (etg->full_header);
- etg->header = header;
- g_object_ref (etg->header);
- etg->model = model;
- g_object_ref (etg->model);
- g_object_set (G_OBJECT (etg),
- "parent", parent,
- NULL);
-}
-
-/**
- * e_table_group_add
- * @etg: The %ETableGroup to add a row to
- * @row: The row to add.
- *
- * This routine adds the given row from the %ETableModel to this set
- * of rows.
- */
-void
-e_table_group_add (ETableGroup *etg,
- gint row)
-{
- g_return_if_fail (etg != NULL);
- g_return_if_fail (E_IS_TABLE_GROUP (etg));
-
- g_assert (ETG_CLASS (etg)->add != NULL);
- ETG_CLASS (etg)->add (etg, row);
-}
-
-/**
- * e_table_group_add_array
- * @etg: The %ETableGroup to add to
- * @array: The array to add.
- * @count: The number of times to add
- *
- * This routine adds all the rows in the array to this set of rows.
- * It assumes that the array is already sorted properly.
- */
-void
-e_table_group_add_array (ETableGroup *etg,
- const int *array,
- int count)
-{
- g_return_if_fail (etg != NULL);
- g_return_if_fail (E_IS_TABLE_GROUP (etg));
-
- g_assert (ETG_CLASS (etg)->add_array != NULL);
- ETG_CLASS (etg)->add_array (etg, array, count);
-}
-
-/**
- * e_table_group_add_all
- * @etg: The %ETableGroup to add to
- *
- * This routine adds all the rows from the %ETableModel to this set
- * of rows.
- */
-void
-e_table_group_add_all (ETableGroup *etg)
-{
- g_return_if_fail (etg != NULL);
- g_return_if_fail (E_IS_TABLE_GROUP (etg));
-
- g_assert (ETG_CLASS (etg)->add_all != NULL);
- ETG_CLASS (etg)->add_all (etg);
-}
-
-/**
- * e_table_group_remove
- * @etg: The %ETableGroup to remove a row from
- * @row: The row to remove.
- *
- * This routine removes the given row from the %ETableModel from this
- * set of rows.
- *
- * Returns: TRUE if the row was deleted and FALSE if the row was not
- * found.
- */
-gboolean
-e_table_group_remove (ETableGroup *etg,
- gint row)
-{
- g_return_val_if_fail (etg != NULL, FALSE);
- g_return_val_if_fail (E_IS_TABLE_GROUP (etg), FALSE);
-
- g_assert (ETG_CLASS (etg)->remove != NULL);
- return ETG_CLASS (etg)->remove (etg, row);
-}
-
-/**
- * e_table_group_increment
- * @etg: The %ETableGroup to increment
- * @position: The position to increment from
- * @amount: The amount to increment.
- *
- * This routine adds amount to all rows greater than or equal to
- * position. This is to handle when a row gets inserted into the
- * model.
- */
-void
-e_table_group_increment (ETableGroup *etg,
- gint position,
- gint amount)
-{
- g_return_if_fail (etg != NULL);
- g_return_if_fail (E_IS_TABLE_GROUP (etg));
-
- g_assert (ETG_CLASS (etg)->increment != NULL);
- ETG_CLASS (etg)->increment (etg, position, amount);
-}
-
-/**
- * e_table_group_increment
- * @etg: The %ETableGroup to decrement
- * @position: The position to decrement from
- * @amount: The amount to decrement
- *
- * This routine removes amount from all rows greater than or equal to
- * position. This is to handle when a row gets deleted from the
- * model.
- */
-void
-e_table_group_decrement (ETableGroup *etg,
- gint position,
- gint amount)
-{
- g_return_if_fail (etg != NULL);
- g_return_if_fail (E_IS_TABLE_GROUP (etg));
-
- g_assert (ETG_CLASS (etg)->decrement != NULL);
- ETG_CLASS (etg)->decrement (etg, position, amount);
-}
-
-/**
- * e_table_group_increment
- * @etg: The %ETableGroup to count
- *
- * This routine calculates the number of rows shown in this group.
- *
- * Returns: The number of rows.
- */
-gint
-e_table_group_row_count (ETableGroup *etg)
-{
- g_return_val_if_fail (etg != NULL, 0);
- g_return_val_if_fail (E_IS_TABLE_GROUP (etg), -1);
-
- g_assert (ETG_CLASS (etg)->row_count != NULL);
- return ETG_CLASS (etg)->row_count (etg);
-}
-
-/**
- * e_table_group_set_focus
- * @etg: The %ETableGroup to set
- * @direction: The direction the focus is coming from.
- * @view_col: The column to set the focus in.
- *
- * Sets the focus to this widget. Places the focus in the view column
- * coming from direction direction.
- */
-void
-e_table_group_set_focus (ETableGroup *etg,
- EFocus direction,
- gint view_col)
-{
- g_return_if_fail (etg != NULL);
- g_return_if_fail (E_IS_TABLE_GROUP (etg));
-
- g_assert (ETG_CLASS (etg)->set_focus != NULL);
- ETG_CLASS (etg)->set_focus (etg, direction, view_col);
-}
-
-/**
- * e_table_group_get_focus
- * @etg: The %ETableGroup to check
- *
- * Calculates if this group has the focus.
- *
- * Returns: TRUE if this group has the focus.
- */
-gboolean
-e_table_group_get_focus (ETableGroup *etg)
-{
- g_return_val_if_fail (etg != NULL, FALSE);
- g_return_val_if_fail (E_IS_TABLE_GROUP (etg), FALSE);
-
- g_assert (ETG_CLASS (etg)->get_focus != NULL);
- return ETG_CLASS (etg)->get_focus (etg);
-}
-
-/**
- * e_table_group_get_focus_column
- * @etg: The %ETableGroup to check
- *
- * Calculates which column in this group has the focus.
- *
- * Returns: The column index (view column).
- */
-gint
-e_table_group_get_focus_column (ETableGroup *etg)
-{
- g_return_val_if_fail (etg != NULL, FALSE);
- g_return_val_if_fail (E_IS_TABLE_GROUP (etg), -1);
-
- g_assert (ETG_CLASS (etg)->get_focus_column != NULL);
- return ETG_CLASS (etg)->get_focus_column (etg);
-}
-
-/**
- * e_table_group_get_printable
- * @etg: %ETableGroup which will be printed
- *
- * This routine creates and returns an %EPrintable that can be used to
- * print the given %ETableGroup.
- *
- * Returns: The %EPrintable.
- */
-EPrintable *
-e_table_group_get_printable (ETableGroup *etg)
-{
- g_return_val_if_fail (etg != NULL, NULL);
- g_return_val_if_fail (E_IS_TABLE_GROUP (etg), NULL);
-
- g_assert (ETG_CLASS (etg)->get_printable != NULL);
- return ETG_CLASS (etg)->get_printable (etg);
-}
-
-/**
- * e_table_group_compute_location
- * @eti: %ETableGroup to look in.
- * @x: A pointer to the x location to find in the %ETableGroup.
- * @y: A pointer to the y location to find in the %ETableGroup.
- * @row: A pointer to the location to store the found row in.
- * @col: A pointer to the location to store the found col in.
- *
- * This routine locates the pixel location (*x, *y) in the
- * %ETableGroup. If that location is in the %ETableGroup, *row and
- * *col are set to the view row and column where it was found. If
- * that location is not in the %ETableGroup, the height of the
- * %ETableGroup is removed from the value y points to.
- */
-void
-e_table_group_compute_location (ETableGroup *etg, int *x, int *y, int *row, int *col)
-{
- g_return_if_fail (etg != NULL);
- g_return_if_fail (E_IS_TABLE_GROUP (etg));
-
- g_assert (ETG_CLASS (etg)->compute_location != NULL);
- ETG_CLASS (etg)->compute_location (etg, x, y, row, col);
-}
-
-/**
- * e_table_group_get_position
- * @eti: %ETableGroup to look in.
- * @x: A pointer to the location to store the found x location in.
- * @y: A pointer to the location to store the found y location in.
- * @row: A pointer to the row number to find.
- * @col: A pointer to the col number to find.
- *
- * This routine finds the view cell (row, col) in the #ETableGroup.
- * If that location is in the #ETableGroup *@x and *@y are set to the
- * upper left hand corner of the cell found. If that location is not
- * in the #ETableGroup, the number of rows in the #ETableGroup is
- * removed from the value row points to.
- */
-void
-e_table_group_get_cell_geometry (ETableGroup *etg,
- int *row,
- int *col,
- int *x,
- int *y,
- int *width,
- int *height)
-{
- g_return_if_fail (etg != NULL);
- g_return_if_fail (E_IS_TABLE_GROUP (etg));
-
- g_assert (ETG_CLASS (etg)->get_cell_geometry != NULL);
- ETG_CLASS (etg)->get_cell_geometry (etg, row, col, x, y, width, height);
-}
-
-/**
- * e_table_group_cursor_change
- * @eti: %ETableGroup to emit the signal on
- * @row: The new cursor row (model row)
- *
- * This routine emits the "cursor_change" signal.
- */
-void
-e_table_group_cursor_change (ETableGroup *e_table_group, gint row)
-{
- g_return_if_fail (e_table_group != NULL);
- g_return_if_fail (E_IS_TABLE_GROUP (e_table_group));
-
- g_signal_emit (e_table_group,
- etg_signals [CURSOR_CHANGE], 0,
- row);
-}
-
-/**
- * e_table_group_cursor_activated
- * @eti: %ETableGroup to emit the signal on
- * @row: The cursor row (model row)
- *
- * This routine emits the "cursor_activated" signal.
- */
-void
-e_table_group_cursor_activated (ETableGroup *e_table_group, gint row)
-{
- g_return_if_fail (e_table_group != NULL);
- g_return_if_fail (E_IS_TABLE_GROUP (e_table_group));
-
- g_signal_emit (e_table_group,
- etg_signals [CURSOR_ACTIVATED], 0,
- row);
-}
-
-/**
- * e_table_group_double_click
- * @eti: %ETableGroup to emit the signal on
- * @row: The row clicked on (model row)
- * @col: The col clicked on (model col)
- * @event: The event that caused this signal
- *
- * This routine emits the "double_click" signal.
- */
-void
-e_table_group_double_click (ETableGroup *e_table_group, gint row, gint col, GdkEvent *event)
-{
- g_return_if_fail (e_table_group != NULL);
- g_return_if_fail (E_IS_TABLE_GROUP (e_table_group));
-
- g_signal_emit (e_table_group,
- etg_signals [DOUBLE_CLICK], 0,
- row, col, event);
-}
-
-/**
- * e_table_group_right_click
- * @eti: %ETableGroup to emit the signal on
- * @row: The row clicked on (model row)
- * @col: The col clicked on (model col)
- * @event: The event that caused this signal
- *
- * This routine emits the "right_click" signal.
- */
-gint
-e_table_group_right_click (ETableGroup *e_table_group, gint row, gint col, GdkEvent *event)
-{
- gint return_val = 0;
-
- g_return_val_if_fail (e_table_group != NULL, 0);
- g_return_val_if_fail (E_IS_TABLE_GROUP (e_table_group), 0);
-
- g_signal_emit (e_table_group,
- etg_signals [RIGHT_CLICK], 0,
- row, col, event, &return_val);
-
- return return_val;
-}
-
-/**
- * e_table_group_click
- * @eti: %ETableGroup to emit the signal on
- * @row: The row clicked on (model row)
- * @col: The col clicked on (model col)
- * @event: The event that caused this signal
- *
- * This routine emits the "click" signal.
- */
-gint
-e_table_group_click (ETableGroup *e_table_group, gint row, gint col, GdkEvent *event)
-{
- gint return_val = 0;
-
- g_return_val_if_fail (e_table_group != NULL, 0);
- g_return_val_if_fail (E_IS_TABLE_GROUP (e_table_group), 0);
-
- g_signal_emit (e_table_group,
- etg_signals [CLICK], 0,
- row, col, event, &return_val);
-
- return return_val;
-}
-
-/**
- * e_table_group_key_press
- * @eti: %ETableGroup to emit the signal on
- * @row: The cursor row (model row)
- * @col: The cursor col (model col)
- * @event: The event that caused this signal
- *
- * This routine emits the "key_press" signal.
- */
-gint
-e_table_group_key_press (ETableGroup *e_table_group, gint row, gint col, GdkEvent *event)
-{
- gint return_val = 0;
-
- g_return_val_if_fail (e_table_group != NULL, 0);
- g_return_val_if_fail (E_IS_TABLE_GROUP (e_table_group), 0);
-
- g_signal_emit (e_table_group,
- etg_signals [KEY_PRESS], 0,
- row, col, event, &return_val);
-
- return return_val;
-}
-
-/**
- * e_table_group_start_drag
- * @eti: %ETableGroup to emit the signal on
- * @row: The cursor row (model row)
- * @col: The cursor col (model col)
- * @event: The event that caused this signal
- *
- * This routine emits the "start_drag" signal.
- */
-gint
-e_table_group_start_drag (ETableGroup *e_table_group, gint row, gint col, GdkEvent *event)
-{
- gint return_val = 0;
-
- g_return_val_if_fail (e_table_group != NULL, 0);
- g_return_val_if_fail (E_IS_TABLE_GROUP (e_table_group), 0);
-
- g_signal_emit (e_table_group,
- etg_signals [START_DRAG], 0,
- row, col, event, &return_val);
-
- return return_val;
-}
-
-/**
- * e_table_group_get_header
- * @eti: %ETableGroup to check
- *
- * This routine returns the %ETableGroup's header.
- *
- * Returns: The %ETableHeader.
- */
-ETableHeader *
-e_table_group_get_header (ETableGroup *etg)
-{
- g_return_val_if_fail (etg != NULL, NULL);
- g_return_val_if_fail (E_IS_TABLE_GROUP (etg), NULL);
-
- return etg->header;
-}
-
-static int
-etg_event (GnomeCanvasItem *item, GdkEvent *event)
-{
- ETableGroup *etg = E_TABLE_GROUP (item);
- gboolean return_val = TRUE;
-
- switch (event->type) {
-
- case GDK_FOCUS_CHANGE:
- etg->has_focus = event->focus_change.in;
- return_val = FALSE;
-
- default:
- return_val = FALSE;
- }
- if (return_val == FALSE){
- if (GNOME_CANVAS_ITEM_CLASS(etg_parent_class)->event)
- return GNOME_CANVAS_ITEM_CLASS(etg_parent_class)->event (item, event);
- }
- return return_val;
-
-}
-
-static gboolean
-etg_get_focus (ETableGroup *etg)
-{
- return etg->has_focus;
-}
-
-static void
-etg_class_init (GObjectClass *object_class)
-{
- GnomeCanvasItemClass *item_class = (GnomeCanvasItemClass *) object_class;
- ETableGroupClass *klass = (ETableGroupClass *) object_class;
-
- object_class->dispose = etg_dispose;
-
- item_class->event = etg_event;
-
- klass->cursor_change = NULL;
- klass->cursor_activated = NULL;
- klass->double_click = NULL;
- klass->right_click = NULL;
- klass->click = NULL;
- klass->key_press = NULL;
- klass->start_drag = NULL;
-
- klass->add = NULL;
- klass->add_array = NULL;
- klass->add_all = NULL;
- klass->remove = NULL;
- klass->row_count = NULL;
- klass->increment = NULL;
- klass->decrement = NULL;
- klass->set_focus = NULL;
- klass->get_focus = etg_get_focus;
- klass->get_printable = NULL;
- klass->compute_location = NULL;
- klass->get_cell_geometry = NULL;
-
- etg_parent_class = g_type_class_ref (PARENT_TYPE);
-
- etg_signals [CURSOR_CHANGE] =
- g_signal_new ("cursor_change",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (ETableGroupClass, cursor_change),
- NULL, NULL,
- e_marshal_NONE__INT,
- G_TYPE_NONE, 1, G_TYPE_INT);
-
- etg_signals [CURSOR_ACTIVATED] =
- g_signal_new ("cursor_activated",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (ETableGroupClass, cursor_activated),
- NULL, NULL,
- e_marshal_NONE__INT,
- G_TYPE_NONE, 1, G_TYPE_INT);
-
- etg_signals [DOUBLE_CLICK] =
- g_signal_new ("double_click",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (ETableGroupClass, double_click),
- NULL, NULL,
- e_marshal_NONE__INT_INT_BOXED,
- G_TYPE_NONE, 3, G_TYPE_INT,
- G_TYPE_INT, GDK_TYPE_EVENT);
-
- etg_signals [RIGHT_CLICK] =
- g_signal_new ("right_click",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (ETableGroupClass, right_click),
- NULL, NULL,
- e_marshal_INT__INT_INT_BOXED,
- G_TYPE_INT, 3, G_TYPE_INT, G_TYPE_INT, GDK_TYPE_EVENT);
-
- etg_signals [CLICK] =
- g_signal_new ("click",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (ETableGroupClass, click),
- NULL, NULL,
- e_marshal_INT__INT_INT_BOXED,
- G_TYPE_INT, 3, G_TYPE_INT,
- G_TYPE_INT, GDK_TYPE_EVENT);
-
- etg_signals [KEY_PRESS] =
- g_signal_new ("key_press",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (ETableGroupClass, key_press),
- NULL, NULL,
- e_marshal_INT__INT_INT_BOXED,
- G_TYPE_INT, 3, G_TYPE_INT,
- G_TYPE_INT, GDK_TYPE_EVENT);
-
- etg_signals [START_DRAG] =
- g_signal_new ("start_drag",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (ETableGroupClass, start_drag),
- NULL, NULL,
- e_marshal_INT__INT_INT_BOXED,
- G_TYPE_INT, 3, G_TYPE_INT,
- G_TYPE_INT, GDK_TYPE_EVENT);
-}
-
-E_MAKE_TYPE (e_table_group, "ETableGroup", ETableGroup, etg_class_init, NULL, PARENT_TYPE)
diff --git a/widgets/table/e-table-group.h b/widgets/table/e-table-group.h
deleted file mode 100644
index 2ecd34efe1..0000000000
--- a/widgets/table/e-table-group.h
+++ /dev/null
@@ -1,178 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-table-group.h
- * Copyright 2000, 2001, Ximian, Inc.
- *
- * Authors:
- * Chris Lahey <clahey@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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.
- */
-
-#ifndef _E_TABLE_GROUP_H_
-#define _E_TABLE_GROUP_H_
-
-#include <libgnomecanvas/gnome-canvas.h>
-#include <gal/e-table/e-table-model.h>
-#include <gal/e-table/e-table-header.h>
-#include <gal/e-table/e-table-sort-info.h>
-#include <gal/e-table/e-table-defines.h>
-#include <gal/util/e-util.h>
-#include <gal/widgets/e-printable.h>
-
-G_BEGIN_DECLS
-
-#define E_TABLE_GROUP_TYPE (e_table_group_get_type ())
-#define E_TABLE_GROUP(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), E_TABLE_GROUP_TYPE, ETableGroup))
-#define E_TABLE_GROUP_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), E_TABLE_GROUP_TYPE, ETableGroupClass))
-#define E_IS_TABLE_GROUP(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), E_TABLE_GROUP_TYPE))
-#define E_IS_TABLE_GROUP_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), E_TABLE_GROUP_TYPE))
-
-typedef struct {
- GnomeCanvasGroup group;
-
- /*
- * The full header.
- */
- ETableHeader *full_header;
- ETableHeader *header;
-
- /*
- * The model we pull data from.
- */
- ETableModel *model;
-
- /*
- * Whether we should add indentation and open/close markers,
- * or if we just act as containers of subtables.
- */
- guint transparent : 1;
-
- guint has_focus : 1;
-
- guint frozen : 1;
-} ETableGroup;
-
-typedef struct {
- GnomeCanvasGroupClass parent_class;
-
- /* Signals */
- void (*cursor_change) (ETableGroup *etg, int row);
- void (*cursor_activated) (ETableGroup *etg, int row);
- void (*double_click) (ETableGroup *etg, int row, int col, GdkEvent *event);
- gint (*right_click) (ETableGroup *etg, int row, int col, GdkEvent *event);
- gint (*click) (ETableGroup *etg, int row, int col, GdkEvent *event);
- gint (*key_press) (ETableGroup *etg, int row, int col, GdkEvent *event);
- gint (*start_drag) (ETableGroup *etg, int row, int col, GdkEvent *event);
-
- /* Virtual functions. */
- void (*add) (ETableGroup *etg, gint row);
- void (*add_array) (ETableGroup *etg, const int *array, int count);
- void (*add_all) (ETableGroup *etg);
- gboolean (*remove) (ETableGroup *etg, gint row);
- gint (*row_count) (ETableGroup *etg);
- void (*increment) (ETableGroup *etg, gint position, gint amount);
- void (*decrement) (ETableGroup *etg, gint position, gint amount);
- void (*set_focus) (ETableGroup *etg, EFocus direction, gint view_col);
- gboolean (*get_focus) (ETableGroup *etg);
- gint (*get_focus_column) (ETableGroup *etg);
- EPrintable *(*get_printable) (ETableGroup *etg);
- void (*compute_location) (ETableGroup *etg, int *x, int *y, int *row, int *col);
- void (*get_cell_geometry) (ETableGroup *etg, int *row, int *col, int *x, int *y, int *width, int *height);
-
-} ETableGroupClass;
-
-/* Virtual functions */
-void e_table_group_add (ETableGroup *etg,
- gint row);
-void e_table_group_add_array (ETableGroup *etg,
- const int *array,
- int count);
-void e_table_group_add_all (ETableGroup *etg);
-gboolean e_table_group_remove (ETableGroup *etg,
- gint row);
-void e_table_group_increment (ETableGroup *etg,
- gint position,
- gint amount);
-void e_table_group_decrement (ETableGroup *etg,
- gint position,
- gint amount);
-gint e_table_group_row_count (ETableGroup *etg);
-void e_table_group_set_focus (ETableGroup *etg,
- EFocus direction,
- gint view_col);
-gboolean e_table_group_get_focus (ETableGroup *etg);
-gint e_table_group_get_focus_column (ETableGroup *etg);
-ETableHeader *e_table_group_get_header (ETableGroup *etg);
-EPrintable *e_table_group_get_printable (ETableGroup *etg);
-void e_table_group_compute_location (ETableGroup *etg,
- int *x,
- int *y,
- int *row,
- int *col);
-void e_table_group_get_cell_geometry (ETableGroup *etg,
- int *row,
- int *col,
- int *x,
- int *y,
- int *width,
- int *height);
-ETableGroup *e_table_group_new (GnomeCanvasGroup *parent,
- ETableHeader *full_header,
- ETableHeader *header,
- ETableModel *model,
- ETableSortInfo *sort_info,
- int n);
-void e_table_group_construct (GnomeCanvasGroup *parent,
- ETableGroup *etg,
- ETableHeader *full_header,
- ETableHeader *header,
- ETableModel *model);
-
-/* For emitting the signals */
-void e_table_group_cursor_change (ETableGroup *etg,
- gint row);
-void e_table_group_cursor_activated (ETableGroup *etg,
- gint row);
-void e_table_group_double_click (ETableGroup *etg,
- gint row,
- gint col,
- GdkEvent *event);
-gint e_table_group_right_click (ETableGroup *etg,
- gint row,
- gint col,
- GdkEvent *event);
-gint e_table_group_click (ETableGroup *etg,
- gint row,
- gint col,
- GdkEvent *event);
-gint e_table_group_key_press (ETableGroup *etg,
- gint row,
- gint col,
- GdkEvent *event);
-gint e_table_group_start_drag (ETableGroup *etg,
- gint row,
- gint col,
- GdkEvent *event);
-GType e_table_group_get_type (void);
-
-typedef void (*ETableGroupLeafFn) (void *e_table_item, void *closure);
-void e_table_group_apply_to_leafs (ETableGroup *etg,
- ETableGroupLeafFn fn,
- void *closure);
-
-G_END_DECLS
-
-#endif /* _E_TABLE_GROUP_H_ */
diff --git a/widgets/table/e-table-header-item.c b/widgets/table/e-table-header-item.c
deleted file mode 100644
index 3735011dc8..0000000000
--- a/widgets/table/e-table-header-item.c
+++ /dev/null
@@ -1,1837 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-table-header-item.c
- * Copyright 1999, 2000, 2001, Ximian, Inc.
- *
- * Authors:
- * Chris Lahey <clahey@ximian.com>
- * Miguel de Icaza (miguel@gnu.org)
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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 "e-table-header-item.h"
-
-#include <string.h>
-#include <gtk/gtksignal.h>
-#include <gtk/gtkdnd.h>
-#include <gtk/gtkimage.h>
-#include <libgnomecanvas/gnome-canvas.h>
-#include <libgnomecanvas/gnome-canvas-util.h>
-#include <libgnomecanvas/gnome-canvas-polygon.h>
-#include <libgnomecanvas/gnome-canvas-rect-ellipse.h>
-#include <gdk-pixbuf/gdk-pixbuf.h>
-#include "gal/widgets/e-cursors.h"
-#include "gal/util/e-i18n.h"
-#include "gal/util/e-util.h"
-#include "gal/util/e-xml-utils.h"
-#include "gal/util/e-marshal.h"
-#include "gal/widgets/e-canvas.h"
-#include "gal/widgets/e-popup-menu.h"
-#include "gal/widgets/e-gui-utils.h"
-#include "e-table-header.h"
-#include "e-table-header-utils.h"
-#include "e-table-col-dnd.h"
-#include "e-table-defines.h"
-#include "e-table-field-chooser-dialog.h"
-#include "e-table-config.h"
-#include "e-table.h"
-
-#include "add-col.xpm"
-#include "remove-col.xpm"
-#include "arrow-up.xpm"
-#include "arrow-down.xpm"
-
-enum {
- BUTTON_PRESSED,
- LAST_SIGNAL
-};
-
-static guint ethi_signals [LAST_SIGNAL] = { 0, };
-
-#define ARROW_DOWN_HEIGHT 16
-#define ARROW_PTR 7
-
-/* Defines the tolerance for proximity of the column division to the cursor position */
-#define TOLERANCE 4
-
-#define ETHI_RESIZING(x) ((x)->resize_col != -1)
-
-#define PARENT_OBJECT_TYPE gnome_canvas_item_get_type ()
-
-#define ELEMENTS(x) (sizeof (x) / sizeof (x[0]))
-#define d(x)
-
-static GnomeCanvasItemClass *ethi_parent_class;
-
-static void ethi_drop_table_header (ETableHeaderItem *ethi);
-
-/*
- * They display the arrows for the drop location.
- */
-
-static GtkWidget *arrow_up, *arrow_down;
-
-/*
- * DnD icons
- */
-static GdkColormap *dnd_colormap;
-static GdkPixmap *remove_col_pixmap, *remove_col_mask;
-static GdkPixmap *add_col_pixmap, *add_col_mask;
-
-enum {
- PROP_0,
- PROP_TABLE_HEADER,
- PROP_FULL_HEADER,
- PROP_DND_CODE,
- PROP_TABLE_FONTSET,
- PROP_SORT_INFO,
- PROP_TABLE,
- PROP_TREE
-};
-
-enum {
- ET_SCROLL_UP = 1 << 0,
- ET_SCROLL_DOWN = 1 << 1,
- ET_SCROLL_LEFT = 1 << 2,
- ET_SCROLL_RIGHT = 1 << 3
-};
-
-static void scroll_off (ETableHeaderItem *ethi);
-static void scroll_on (ETableHeaderItem *ethi, guint scroll_direction);
-
-static void
-ethi_dispose (GObject *object){
- ETableHeaderItem *ethi = E_TABLE_HEADER_ITEM (object);
-
- ethi_drop_table_header (ethi);
-
- scroll_off (ethi);
-
- if (ethi->dnd_code) {
- g_free (ethi->dnd_code);
- ethi->dnd_code = NULL;
- }
-
- if (ethi->sort_info) {
- if (ethi->sort_info_changed_id)
- g_signal_handler_disconnect (ethi->sort_info, ethi->sort_info_changed_id);
- if (ethi->group_info_changed_id)
- g_signal_handler_disconnect (ethi->sort_info, ethi->group_info_changed_id);
- g_object_unref (ethi->sort_info);
- ethi->sort_info = NULL;
- }
-
- if (ethi->full_header)
- g_object_unref (ethi->full_header);
- ethi->full_header = NULL;
-
- if (ethi->config)
- g_object_unref (ethi->config);
- ethi->config = NULL;
-
- if (G_OBJECT_CLASS (ethi_parent_class)->dispose)
- (*G_OBJECT_CLASS (ethi_parent_class)->dispose) (object);
-}
-
-static int
-e_table_header_item_get_height (ETableHeaderItem *ethi)
-{
- ETableHeader *eth;
- int numcols, col;
- int maxheight;
- GtkStyle *style;
-
- g_return_val_if_fail (ethi != NULL, 0);
- g_return_val_if_fail (E_IS_TABLE_HEADER_ITEM (ethi), 0);
-
- eth = ethi->eth;
- numcols = e_table_header_count (eth);
-
- maxheight = 0;
-
- style = GTK_WIDGET (GNOME_CANVAS_ITEM (ethi)->canvas)->style;
-
- for (col = 0; col < numcols; col++) {
- ETableCol *ecol = e_table_header_get_column (eth, col);
- int height;
-
- height = e_table_header_compute_height (ecol,
- GTK_WIDGET (GNOME_CANVAS_ITEM (ethi)->canvas));
-
- if (height > maxheight)
- maxheight = height;
- }
-
- return maxheight;
-}
-
-static void
-ethi_update (GnomeCanvasItem *item, double *affine, ArtSVP *clip_path, int flags)
-{
- ETableHeaderItem *ethi = E_TABLE_HEADER_ITEM (item);
-
- double i2c [6];
- ArtPoint c1, c2, i1, i2;
-
- if (GNOME_CANVAS_ITEM_CLASS (ethi_parent_class)->update)
- (*GNOME_CANVAS_ITEM_CLASS (ethi_parent_class)->update)(item, affine, clip_path, flags);
-
- if (ethi->sort_info)
- ethi->group_indent_width = e_table_sort_info_grouping_get_count(ethi->sort_info) * GROUP_INDENT;
- else
- ethi->group_indent_width = 0;
-
- ethi->width = e_table_header_total_width (ethi->eth) + ethi->group_indent_width;
-
- i1.x = i1.y = 0;
- i2.x = ethi->width;
- i2.y = ethi->height;
-
- gnome_canvas_item_i2c_affine (item, i2c);
- art_affine_point (&c1, &i1, i2c);
- art_affine_point (&c2, &i2, i2c);
-
- if (item->x1 != c1.x ||
- item->y1 != c1.y ||
- item->x2 != c2.x ||
- item->y2 != c2.y)
- {
- gnome_canvas_request_redraw (item->canvas, item->x1, item->y1, item->x2, item->y2);
- item->x1 = c1.x;
- item->y1 = c1.y;
- item->x2 = c2.x;
- item->y2 = c2.y;
-#ifndef NO_WARNINGS
-#warning FOO BAA
-#endif
-#if 0
- gnome_canvas_group_child_bounds (GNOME_CANVAS_GROUP (item->parent), item);
-#endif
- }
- gnome_canvas_request_redraw (item->canvas, item->x1, item->y1, item->x2, item->y2);
-}
-
-static void
-ethi_font_set (ETableHeaderItem *ethi, GdkFont *font)
-{
- if (ethi->font)
- gdk_font_unref (ethi->font);
-
- ethi->font = font;
- gdk_font_ref (font);
-
- ethi->height = e_table_header_item_get_height (ethi);
- e_canvas_item_request_reflow(GNOME_CANVAS_ITEM(ethi));
-}
-
-static void
-ethi_font_load (ETableHeaderItem *ethi, const char *fontname)
-{
- GdkFont *font = NULL;
-
- if (fontname != NULL)
- font = gdk_fontset_load (fontname);
-
- if (font == NULL) {
- font = gtk_style_get_font (GTK_WIDGET (GNOME_CANVAS_ITEM (ethi)->canvas)->style);
- gdk_font_ref (font);
- }
-
- ethi_font_set (ethi, font);
- gdk_font_unref (font);
-}
-
-static void
-ethi_drop_table_header (ETableHeaderItem *ethi)
-{
- GObject *header;
-
- if (!ethi->eth)
- return;
-
- header = G_OBJECT (ethi->eth);
- g_signal_handler_disconnect (header, ethi->structure_change_id);
- g_signal_handler_disconnect (header, ethi->dimension_change_id);
-
- g_object_unref (header);
- ethi->eth = NULL;
- ethi->width = 0;
-}
-
-static void
-structure_changed (ETableHeader *header, ETableHeaderItem *ethi)
-{
- gnome_canvas_item_request_update(GNOME_CANVAS_ITEM(ethi));
-}
-
-static void
-dimension_changed (ETableHeader *header, int col, ETableHeaderItem *ethi)
-{
- gnome_canvas_item_request_update(GNOME_CANVAS_ITEM(ethi));
-}
-
-static void
-ethi_add_table_header (ETableHeaderItem *ethi, ETableHeader *header)
-{
- ethi->eth = header;
- g_object_ref (ethi->eth);
-
- ethi->height = e_table_header_item_get_height (ethi);
-
- ethi->structure_change_id = g_signal_connect (
- header, "structure_change",
- G_CALLBACK (structure_changed), ethi);
- ethi->dimension_change_id = g_signal_connect (
- header, "dimension_change",
- G_CALLBACK (dimension_changed), ethi);
- e_canvas_item_request_reflow(GNOME_CANVAS_ITEM(ethi));
- gnome_canvas_item_request_update (GNOME_CANVAS_ITEM(ethi));
-}
-
-static void
-ethi_sort_info_changed (ETableSortInfo *sort_info, ETableHeaderItem *ethi)
-{
- gnome_canvas_item_request_update (GNOME_CANVAS_ITEM(ethi));
-}
-
-static void
-ethi_set_property (GObject *object,
- guint prop_id,
- const GValue *value,
- GParamSpec *pspec)
-{
- GnomeCanvasItem *item;
- ETableHeaderItem *ethi;
-
- item = GNOME_CANVAS_ITEM (object);
- ethi = E_TABLE_HEADER_ITEM (object);
-
- switch (prop_id){
- case PROP_TABLE_HEADER:
- ethi_drop_table_header (ethi);
- ethi_add_table_header (ethi, E_TABLE_HEADER(g_value_get_object (value)));
- break;
-
- case PROP_FULL_HEADER:
- if (ethi->full_header)
- g_object_unref(ethi->full_header);
- ethi->full_header = E_TABLE_HEADER(g_value_get_object (value));
- if (ethi->full_header)
- g_object_ref(ethi->full_header);
- break;
-
- case PROP_DND_CODE:
- g_free(ethi->dnd_code);
- ethi->dnd_code = g_strdup (g_value_get_string (value));
- break;
-
- case PROP_TABLE_FONTSET:
- ethi_font_load (ethi, g_value_get_string (value));
- break;
-
- case PROP_SORT_INFO:
- if (ethi->sort_info){
- if (ethi->sort_info_changed_id)
- g_signal_handler_disconnect (
- ethi->sort_info,
- ethi->sort_info_changed_id);
-
- if (ethi->group_info_changed_id)
- g_signal_handler_disconnect (
- ethi->sort_info,
- ethi->group_info_changed_id);
- g_object_unref (ethi->sort_info);
- }
- ethi->sort_info = g_value_get_object (value);
- g_object_ref (ethi->sort_info);
- ethi->sort_info_changed_id =
- g_signal_connect (
- ethi->sort_info, "sort_info_changed",
- G_CALLBACK (ethi_sort_info_changed), ethi);
- ethi->group_info_changed_id =
- g_signal_connect (
- ethi->sort_info, "group_info_changed",
- G_CALLBACK(ethi_sort_info_changed), ethi);
- break;
- case PROP_TABLE:
- if (g_value_get_object (value))
- ethi->table = E_TABLE(g_value_get_object (value));
- else
- ethi->table = NULL;
- break;
- case PROP_TREE:
- if (g_value_get_object (value))
- ethi->tree = E_TREE(g_value_get_object (value));
- else
- ethi->tree = NULL;
- break;
- }
- gnome_canvas_item_request_update(item);
-}
-
-static void
-ethi_get_property (GObject *object,
- guint prop_id,
- GValue *value,
- GParamSpec *pspec)
-{
- ETableHeaderItem *ethi;
-
- ethi = E_TABLE_HEADER_ITEM (object);
-
- switch (prop_id){
- case PROP_FULL_HEADER:
- g_value_set_object (value, ethi->full_header);
- break;
- case PROP_DND_CODE:
- g_value_set_string (value, g_strdup (ethi->dnd_code));
- break;
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
- break;
- }
-}
-
-static int
-ethi_find_col_by_x (ETableHeaderItem *ethi, int x)
-{
- const int cols = e_table_header_count (ethi->eth);
- int x1 = 0;
- int col;
-
- d(g_print ("%s:%d: x = %d, x1 = %d\n", __FUNCTION__, __LINE__, x, x1));
-
- x1 += ethi->group_indent_width;
-
- if (x < x1) {
- d(g_print ("%s:%d: Returning 0\n", __FUNCTION__, __LINE__));
- return 0;
- }
-
- for (col = 0; col < cols; col++){
- ETableCol *ecol = e_table_header_get_column (ethi->eth, col);
-
- if ((x >= x1) && (x <= x1 + ecol->width)) {
- d(g_print ("%s:%d: Returning %d\n", __FUNCTION__, __LINE__, col));
- return col;
- }
-
- x1 += ecol->width;
- }
- d(g_print ("%s:%d: Returning %d\n", __FUNCTION__, __LINE__, cols - 1));
- return cols - 1;
-}
-
-static int
-ethi_find_col_by_x_nearest (ETableHeaderItem *ethi, int x)
-{
- const int cols = e_table_header_count (ethi->eth);
- int x1 = 0;
- int col;
-
- x1 += ethi->group_indent_width;
-
- if (x < x1)
- return 0;
-
- for (col = 0; col < cols; col++){
- ETableCol *ecol = e_table_header_get_column (ethi->eth, col);
-
- x1 += (ecol->width / 2);
-
- if (x <= x1)
- return col;
-
- x1 += (ecol->width + 1) / 2;
- }
- return col;
-}
-
-static void
-ethi_remove_drop_marker (ETableHeaderItem *ethi)
-{
- if (ethi->drag_mark == -1)
- return;
-
- gtk_widget_hide (arrow_up);
- gtk_widget_hide (arrow_down);
-
- ethi->drag_mark = -1;
-}
-
-static GtkWidget *
-make_shaped_window_from_xpm (const char **xpm)
-{
- GdkPixbuf *pixbuf;
- GdkPixmap *pixmap;
- GdkBitmap *bitmap;
- GtkWidget *win, *pix;
-
- pixbuf = gdk_pixbuf_new_from_xpm_data (xpm);
- gdk_pixbuf_render_pixmap_and_mask (pixbuf, &pixmap, &bitmap, 128);
- gdk_pixbuf_unref (pixbuf);
-
- gtk_widget_push_colormap (gdk_rgb_get_cmap ());
- win = gtk_window_new (GTK_WINDOW_POPUP);
-
- pix = gtk_image_new_from_pixmap (pixmap, bitmap);
- gtk_widget_realize (win);
- gtk_container_add (GTK_CONTAINER (win), pix);
- gtk_widget_shape_combine_mask (win, bitmap, 0, 0);
- gtk_widget_pop_colormap ();
-
- gdk_pixmap_unref (pixmap);
- gdk_bitmap_unref (bitmap);
-
- return win;
-}
-
-static void
-ethi_add_drop_marker (ETableHeaderItem *ethi, int col, gboolean recreate)
-{
- int rx, ry;
- int x;
-
- if (!recreate && ethi->drag_mark == col)
- return;
-
- ethi->drag_mark = col;
-
- x = e_table_header_col_diff (ethi->eth, 0, col);
- if (col > 0)
- x += ethi->group_indent_width;
-
- if (!arrow_up){
- arrow_up = make_shaped_window_from_xpm (arrow_up_xpm);
- arrow_down = make_shaped_window_from_xpm (arrow_down_xpm);
- }
-
- gdk_window_get_origin (
- GTK_WIDGET (GNOME_CANVAS_ITEM (ethi)->canvas)->window,
- &rx, &ry);
-
- rx -= gtk_layout_get_hadjustment (GTK_LAYOUT (GNOME_CANVAS_ITEM (ethi)->canvas))->value;
- ry -= gtk_layout_get_vadjustment (GTK_LAYOUT (GNOME_CANVAS_ITEM (ethi)->canvas))->value;
-
- gtk_widget_set_uposition (arrow_down, rx + x - ARROW_PTR, ry - ARROW_DOWN_HEIGHT);
- gtk_widget_show_all (arrow_down);
-
- gtk_widget_set_uposition (arrow_up, rx + x - ARROW_PTR, ry + ethi->height);
- gtk_widget_show_all (arrow_up);
-}
-
-#define gray50_width 2
-#define gray50_height 2
-static char gray50_bits [] = {
- 0x02, 0x01, };
-
-static void
-ethi_add_destroy_marker (ETableHeaderItem *ethi)
-{
- double x1;
-
- if (ethi->remove_item)
- gtk_object_destroy (GTK_OBJECT (ethi->remove_item));
-
- if (!ethi->stipple)
- ethi->stipple = gdk_bitmap_create_from_data (
- NULL, gray50_bits, gray50_width, gray50_height);
-
- x1 = (double) e_table_header_col_diff (ethi->eth, 0, ethi->drag_col);
- if (ethi->drag_col > 0)
- x1 += ethi->group_indent_width;
-
- ethi->remove_item = gnome_canvas_item_new (
- GNOME_CANVAS_GROUP (GNOME_CANVAS_ITEM (ethi)->canvas->root),
- gnome_canvas_rect_get_type (),
- "x1", x1 + 1,
- "y1", (double) 1,
- "x2", (double) x1 + e_table_header_col_diff (
- ethi->eth, ethi->drag_col, ethi->drag_col+1) - 2,
-
- "y2", (double) ethi->height - 2,
- "fill_color", "red",
- "fill_stipple", ethi->stipple,
- NULL);
-}
-
-static void
-ethi_remove_destroy_marker (ETableHeaderItem *ethi)
-{
- if (!ethi->remove_item)
- return;
-
- gtk_object_destroy (GTK_OBJECT (ethi->remove_item));
- ethi->remove_item = NULL;
-}
-
-#if 0
-static gboolean
-moved (ETableHeaderItem *ethi, guint col, guint model_col)
-{
- if (col == -1)
- return TRUE;
- ecol = e_table_header_get_column (ethi->eth, col);
- if (ecol->col_idx == model_col)
- return FALSE;
- if (col > 0) {
- ecol = e_table_header_get_column (ethi->eth, col - 1);
- if (ecol->col_idx == model_col)
- return FALSE;
- }
- return TRUE;
-}
-#endif
-
-static void
-do_drag_motion(ETableHeaderItem *ethi,
- GdkDragContext *context,
- gint x,
- gint y,
- guint time,
- gboolean recreate)
-{
- d(g_print("In do_drag_motion\n"));
- d(g_print("x = %d, y = %d, ethi->width = %d, ethi->height = %d\n", x, y, ethi->width, ethi->height));
-
- if ((x >= 0) && (x <= (ethi->width)) &&
- (y >= 0) && (y <= (ethi->height))){
- int col;
- d(g_print("In header\n"));
-
- col = ethi_find_col_by_x_nearest (ethi, x);
-
- if (ethi->drag_col != -1 && (col == ethi->drag_col || col == ethi->drag_col + 1)) {
- if (ethi->drag_col != -1)
- ethi_remove_destroy_marker (ethi);
-
- ethi_remove_drop_marker (ethi);
- gdk_drag_status (context, context->suggested_action, time);
- }
- else if (col != -1){
- if (ethi->drag_col != -1)
- ethi_remove_destroy_marker (ethi);
-
- ethi_add_drop_marker (ethi, col, recreate);
- gdk_drag_status (context, context->suggested_action, time);
- } else {
- ethi_remove_drop_marker (ethi);
- if (ethi->drag_col != -1)
- ethi_add_destroy_marker (ethi);
- }
- } else {
- ethi_remove_drop_marker (ethi);
- if (ethi->drag_col != -1)
- ethi_add_destroy_marker (ethi);
- }
-}
-
-static gboolean
-scroll_timeout (gpointer data)
-{
- ETableHeaderItem *ethi = data;
- int dx = 0;
- GtkAdjustment *h, *v;
- double value;
-
- if (ethi->scroll_direction & ET_SCROLL_RIGHT)
- dx += 20;
- if (ethi->scroll_direction & ET_SCROLL_LEFT)
- dx -= 20;
-
- h = GTK_LAYOUT(GNOME_CANVAS_ITEM (ethi)->canvas)->hadjustment;
- v = GTK_LAYOUT(GNOME_CANVAS_ITEM (ethi)->canvas)->vadjustment;
-
- value = h->value;
-
- gtk_adjustment_set_value(h, CLAMP(h->value + dx, h->lower, h->upper - h->page_size));
-
- if (h->value != value)
- do_drag_motion(ethi,
- ethi->last_drop_context,
- ethi->last_drop_x + h->value,
- ethi->last_drop_y + v->value,
- ethi->last_drop_time,
- TRUE);
-
- return TRUE;
-}
-
-static void
-scroll_on (ETableHeaderItem *ethi, guint scroll_direction)
-{
- if (ethi->scroll_idle_id == 0 || scroll_direction != ethi->scroll_direction) {
- if (ethi->scroll_idle_id != 0)
- g_source_remove (ethi->scroll_idle_id);
- ethi->scroll_direction = scroll_direction;
- ethi->scroll_idle_id = g_timeout_add (100, scroll_timeout, ethi);
- }
-}
-
-static void
-scroll_off (ETableHeaderItem *ethi)
-{
- if (ethi->scroll_idle_id) {
- g_source_remove (ethi->scroll_idle_id);
- ethi->scroll_idle_id = 0;
- }
-}
-
-static void
-context_destroyed (gpointer data)
-{
- ETableHeaderItem *ethi = data;
-
- ethi->last_drop_x = 0;
- ethi->last_drop_y = 0;
- ethi->last_drop_time = 0;
- ethi->last_drop_context = NULL;
- scroll_off (ethi);
-
- g_object_unref (ethi);
-}
-
-static void
-context_connect (ETableHeaderItem *ethi, GdkDragContext *context)
-{
- if (g_dataset_get_data (context, "e-table-header-item") == NULL) {
- g_object_ref (ethi);
- g_dataset_set_data_full (context, "e-table-header-item", ethi, context_destroyed);
- }
-}
-
-static gboolean
-ethi_drag_motion (GtkWidget *widget, GdkDragContext *context,
- gint x, gint y, guint time,
- ETableHeaderItem *ethi)
-{
- char *droptype, *headertype;
- guint direction = 0;
-
- gdk_drag_status (context, 0, time);
-
- droptype = gdk_atom_name (GDK_POINTER_TO_ATOM (context->targets->data));
- headertype = g_strdup_printf ("%s-%s", TARGET_ETABLE_COL_TYPE,
- ethi->dnd_code);
-
- if (strcmp (droptype, headertype) != 0) {
- g_free (headertype);
- return FALSE;
- }
-
- g_free (headertype);
-
- d(g_print ("y = %d, widget->allocation.y = %d, GTK_LAYOUT (widget)->vadjustment->value = %f\n", y, widget->allocation.y, GTK_LAYOUT (widget)->vadjustment->value));
-
- if (x < 20)
- direction |= ET_SCROLL_LEFT;
- if (x > widget->allocation.width - 20)
- direction |= ET_SCROLL_RIGHT;
-
- ethi->last_drop_x = x;
- ethi->last_drop_y = y;
- ethi->last_drop_time = time;
- ethi->last_drop_context = context;
- context_connect (ethi, context);
-
- do_drag_motion (ethi,
- context,
- x + GTK_LAYOUT(widget)->hadjustment->value,
- y + GTK_LAYOUT(widget)->vadjustment->value,
- time,
- FALSE);
-
- if (direction != 0)
- scroll_on (ethi, direction);
- else
- scroll_off (ethi);
-
- return TRUE;
-}
-
-static void
-ethi_drag_end (GtkWidget *canvas, GdkDragContext *context, ETableHeaderItem *ethi)
-{
- if (context->action == 0) {
- e_table_header_remove (ethi->eth, ethi->drag_col);
- gnome_canvas_item_request_update(GNOME_CANVAS_ITEM(ethi));
- }
- ethi_remove_drop_marker (ethi);
- ethi_remove_destroy_marker (ethi);
- ethi->drag_col = -1;
- scroll_off (ethi);
-}
-
-static void
-ethi_drag_data_received (GtkWidget *canvas,
- GdkDragContext *drag_context,
- gint x,
- gint y,
- GtkSelectionData *data,
- guint info,
- guint time,
- ETableHeaderItem *ethi)
-{
- int found = FALSE;
- int count;
- int column;
- int drop_col;
- int i;
-
- if (data->data) {
- count = e_table_header_count(ethi->eth);
- column = atoi(data->data);
- drop_col = ethi->drop_col;
- ethi->drop_col = -1;
-
- if (column >= 0) {
- for (i = 0; i < count; i++) {
- ETableCol *ecol = e_table_header_get_column (ethi->eth, i);
- if (ecol->col_idx == column) {
- e_table_header_move(ethi->eth, i, drop_col);
- found = TRUE;
- break;
- }
- }
- if (!found) {
- count = e_table_header_count(ethi->full_header);
- for (i = 0; i < count; i++) {
- ETableCol *ecol = e_table_header_get_column (ethi->full_header, i);
- if (ecol->col_idx == column) {
- e_table_header_add_column (ethi->eth, ecol, drop_col);
- break;
- }
- }
- }
- }
- }
- ethi_remove_drop_marker (ethi);
- gnome_canvas_item_request_update(GNOME_CANVAS_ITEM(ethi));
-}
-
-static void
-ethi_drag_data_get (GtkWidget *canvas,
- GdkDragContext *context,
- GtkSelectionData *selection_data,
- guint info,
- guint time,
- ETableHeaderItem *ethi)
-{
- if (ethi->drag_col != -1) {
- ETableCol *ecol = e_table_header_get_column (ethi->eth, ethi->drag_col);
-
- gchar *string = g_strdup_printf("%d", ecol->col_idx);
- gtk_selection_data_set(selection_data,
- GDK_SELECTION_TYPE_STRING,
- sizeof(string[0]),
- string,
- strlen(string));
- g_free(string);
- }
-}
-
-static gboolean
-ethi_drag_drop (GtkWidget *canvas,
- GdkDragContext *context,
- gint x,
- gint y,
- guint time,
- ETableHeaderItem *ethi)
-{
- gboolean successful = FALSE;
-
- if ((x >= 0) && (x <= (ethi->width)) &&
- (y >= 0) && (y <= (ethi->height))){
- int col;
-
- col = ethi_find_col_by_x_nearest (ethi, x);
-
- ethi_add_drop_marker (ethi, col, FALSE);
-
- ethi->drop_col = col;
-
- if (col != -1) {
- char *target = g_strdup_printf ("%s-%s", TARGET_ETABLE_COL_TYPE, ethi->dnd_code);
- d(g_print ("ethi - %s\n", target));
- gtk_drag_get_data (canvas, context, gdk_atom_intern(target, FALSE), time);
- g_free (target);
- }
- }
- gtk_drag_finish (context, successful, successful, time);
- scroll_off (ethi);
- return successful;
-}
-
-static void
-ethi_drag_leave (GtkWidget *widget, GdkDragContext *context, guint time, ETableHeaderItem *ethi)
-{
- ethi_remove_drop_marker (ethi);
- if (ethi->drag_col != -1)
- ethi_add_destroy_marker (ethi);
-}
-
-static void
-ethi_realize (GnomeCanvasItem *item)
-{
- ETableHeaderItem *ethi = E_TABLE_HEADER_ITEM (item);
- GdkWindow *window;
- GtkTargetEntry ethi_drop_types [] = {
- { TARGET_ETABLE_COL_TYPE, 0, TARGET_ETABLE_COL_HEADER },
- };
-
-
- if (GNOME_CANVAS_ITEM_CLASS (ethi_parent_class)-> realize)
- (*GNOME_CANVAS_ITEM_CLASS (ethi_parent_class)->realize)(item);
-
- window = GTK_WIDGET (item->canvas)->window;
-
- if (!ethi->font)
- ethi_font_set (ethi, gtk_style_get_font (GTK_WIDGET (item->canvas)->style));
-
- /*
- * Now, configure DnD
- */
- ethi_drop_types[0].target = g_strdup_printf("%s-%s", ethi_drop_types[0].target, ethi->dnd_code);
- gtk_drag_dest_set (GTK_WIDGET (item->canvas), 0,
- ethi_drop_types, ELEMENTS (ethi_drop_types),
- GDK_ACTION_MOVE);
- g_free(ethi_drop_types[0].target);
-
- /* Drop signals */
- ethi->drag_motion_id = g_signal_connect (item->canvas, "drag_motion",
- G_CALLBACK (ethi_drag_motion), ethi);
- ethi->drag_leave_id = g_signal_connect (item->canvas, "drag_leave",
- G_CALLBACK (ethi_drag_leave), ethi);
- ethi->drag_drop_id = g_signal_connect (item->canvas, "drag_drop",
- G_CALLBACK (ethi_drag_drop), ethi);
- ethi->drag_data_received_id = g_signal_connect (item->canvas, "drag_data_received",
- G_CALLBACK (ethi_drag_data_received), ethi);
-
- /* Drag signals */
- ethi->drag_end_id = g_signal_connect (item->canvas, "drag_end",
- G_CALLBACK (ethi_drag_end), ethi);
- ethi->drag_data_get_id = g_signal_connect (item->canvas, "drag_data_get",
- G_CALLBACK (ethi_drag_data_get), ethi);
-
-}
-
-static void
-ethi_unrealize (GnomeCanvasItem *item)
-{
- ETableHeaderItem *ethi = E_TABLE_HEADER_ITEM (item);
-
- gdk_font_unref (ethi->font);
-
- g_signal_handler_disconnect (item->canvas, ethi->drag_motion_id);
- g_signal_handler_disconnect (item->canvas, ethi->drag_leave_id);
- g_signal_handler_disconnect (item->canvas, ethi->drag_drop_id);
- g_signal_handler_disconnect (item->canvas, ethi->drag_data_received_id);
-
- g_signal_handler_disconnect (item->canvas, ethi->drag_end_id);
- g_signal_handler_disconnect (item->canvas, ethi->drag_data_get_id);
-
- gtk_drag_dest_unset (GTK_WIDGET (item->canvas));
-
- if (ethi->stipple){
- gdk_bitmap_unref (ethi->stipple);
- ethi->stipple = NULL;
- }
-
- if (GNOME_CANVAS_ITEM_CLASS (ethi_parent_class)->unrealize)
- (*GNOME_CANVAS_ITEM_CLASS (ethi_parent_class)->unrealize)(item);
-}
-
-static void
-ethi_draw (GnomeCanvasItem *item, GdkDrawable *drawable, int x, int y, int width, int height)
-{
- ETableHeaderItem *ethi = E_TABLE_HEADER_ITEM (item);
- GnomeCanvas *canvas = item->canvas;
- const int cols = e_table_header_count (ethi->eth);
- int x1, x2;
- int col;
- GHashTable *arrows = g_hash_table_new (NULL, NULL);
-
-
- if (ethi->sort_info) {
- int length = e_table_sort_info_grouping_get_count(ethi->sort_info);
- int i;
- for (i = 0; i < length; i++) {
- ETableSortColumn column = e_table_sort_info_grouping_get_nth(ethi->sort_info, i);
- g_hash_table_insert (arrows,
- GINT_TO_POINTER (column.column),
- GINT_TO_POINTER (column.ascending ?
- E_TABLE_COL_ARROW_DOWN :
- E_TABLE_COL_ARROW_UP));
- }
- length = e_table_sort_info_sorting_get_count(ethi->sort_info);
- for (i = 0; i < length; i++) {
- ETableSortColumn column = e_table_sort_info_sorting_get_nth(ethi->sort_info, i);
- g_hash_table_insert (arrows,
- GINT_TO_POINTER (column.column),
- GINT_TO_POINTER (column.ascending ?
- E_TABLE_COL_ARROW_DOWN :
- E_TABLE_COL_ARROW_UP));
- }
- }
-
- ethi->width = e_table_header_total_width (ethi->eth) + ethi->group_indent_width;
- x1 = x2 = 0;
- x2 += ethi->group_indent_width;
- for (col = 0; col < cols; col++, x1 = x2){
- ETableCol *ecol = e_table_header_get_column (ethi->eth, col);
- int col_width;
-
- col_width = ecol->width;
-
- x2 += col_width;
-
- if (x1 > (x + width))
- break;
-
- if (x2 < x)
- continue;
-
- if (x2 <= x1)
- continue;
-
- e_table_header_draw_button (drawable, ecol,
- GTK_WIDGET (canvas)->style,
- GTK_WIDGET_STATE (canvas),
- GTK_WIDGET (canvas),
- x1 - x, -y,
- width, height,
- x2 - x1, ethi->height,
- (ETableColArrow) g_hash_table_lookup (
- arrows, GINT_TO_POINTER (ecol->col_idx)));
- }
-
- g_hash_table_destroy (arrows);
-}
-
-static double
-ethi_point (GnomeCanvasItem *item, double x, double y, int cx, int cy,
- GnomeCanvasItem **actual_item)
-{
- *actual_item = item;
- return 0.0;
-}
-
-/*
- * is_pointer_on_division:
- *
- * Returns whether @pos is a column header division; If @the_total is not NULL,
- * then the actual position is returned here. If @return_ecol is not NULL,
- * then the ETableCol that actually contains this point is returned here
- */
-static gboolean
-is_pointer_on_division (ETableHeaderItem *ethi, int pos, int *the_total, int *return_col)
-{
- const int cols = e_table_header_count (ethi->eth);
- int col, total;
-
- total = 0;
- for (col = 0; col < cols; col++){
- ETableCol *ecol = e_table_header_get_column (ethi->eth, col);
-
- if (col == 0)
- total += ethi->group_indent_width;
-
- total += ecol->width;
-
- if ((total - TOLERANCE < pos)&& (pos < total + TOLERANCE)){
- if (return_col)
- *return_col = col;
- if (the_total)
- *the_total = total;
-
- return TRUE;
- }
-
- if (total > pos + TOLERANCE)
- return FALSE;
- }
-
- return FALSE;
-}
-
-#define convert(c,sx,sy,x,y) gnome_canvas_w2c (c,sx,sy,x,y)
-
-static void
-set_cursor (ETableHeaderItem *ethi, int pos)
-{
- int col;
- GtkWidget *canvas = GTK_WIDGET (GNOME_CANVAS_ITEM (ethi)->canvas);
- gboolean resizable = FALSE;
-
- /* We might be invoked before we are realized */
- if (!canvas->window)
- return;
-
- if (is_pointer_on_division (ethi, pos, NULL, &col)) {
- int last_col = ethi->eth->col_count - 1;
- ETableCol *ecol = e_table_header_get_column (ethi->eth, col);
-
- /* Last column is not resizable */
- if (ecol->resizable && col != last_col) {
- int c = col + 1;
-
- /* Column is not resizable if all columns after it
- are also not resizable */
- for (; c <= last_col; c++){
- ETableCol *ecol2;
-
- ecol2 = e_table_header_get_column (ethi->eth, c);
- if (ecol2->resizable) {
- resizable = TRUE;
- break;
- }
- }
- }
- }
-
- if (resizable)
- e_cursor_set (canvas->window, E_CURSOR_SIZE_X);
- else
- gdk_window_set_cursor (canvas->window, NULL);
- /* e_cursor_set (canvas->window, E_CURSOR_ARROW);*/
-}
-
-static void
-ethi_end_resize (ETableHeaderItem *ethi)
-{
- ethi->resize_col = -1;
- ethi->resize_guide = GINT_TO_POINTER (0);
-
- gnome_canvas_item_request_update (GNOME_CANVAS_ITEM(ethi));
-}
-
-static gboolean
-ethi_maybe_start_drag (ETableHeaderItem *ethi, GdkEventMotion *event)
-{
- if (!ethi->maybe_drag)
- return FALSE;
-
- if (ethi->eth->col_count < 2) {
- ethi->maybe_drag = FALSE;
- return FALSE;
- }
-
- if (MAX (abs (ethi->click_x - event->x),
- abs (ethi->click_y - event->y)) <= 3)
- return FALSE;
-
- return TRUE;
-}
-
-static void
-ethi_start_drag (ETableHeaderItem *ethi, GdkEvent *event)
-{
- GtkWidget *widget = GTK_WIDGET (GNOME_CANVAS_ITEM (ethi)->canvas);
- GtkTargetList *list;
- GdkDragContext *context;
- ETableCol *ecol;
- int col_width;
- GdkPixmap *pixmap;
- int group_indent = 0;
- GHashTable *arrows = g_hash_table_new (NULL, NULL);
-
- GtkTargetEntry ethi_drag_types [] = {
- { TARGET_ETABLE_COL_TYPE, 0, TARGET_ETABLE_COL_HEADER },
- };
-
- ethi->drag_col = ethi_find_col_by_x (ethi, event->motion.x);
-
- if (ethi->drag_col == -1)
- return;
-
- if (ethi->sort_info) {
- int length = e_table_sort_info_grouping_get_count(ethi->sort_info);
- int i;
- for (i = 0; i < length; i++) {
- ETableSortColumn column =
- e_table_sort_info_grouping_get_nth(
- ethi->sort_info, i);
- group_indent ++;
- g_hash_table_insert (
- arrows,
- GINT_TO_POINTER (column.column),
- GINT_TO_POINTER (column.ascending ?
- E_TABLE_COL_ARROW_DOWN :
- E_TABLE_COL_ARROW_UP));
- }
- length = e_table_sort_info_sorting_get_count(ethi->sort_info);
- for (i = 0; i < length; i++) {
- ETableSortColumn column =
- e_table_sort_info_sorting_get_nth (
- ethi->sort_info, i);
-
- g_hash_table_insert (
- arrows,
- GINT_TO_POINTER (column.column),
- GINT_TO_POINTER (column.ascending ?
- E_TABLE_COL_ARROW_DOWN :
- E_TABLE_COL_ARROW_UP));
- }
- }
-
- ethi_drag_types[0].target = g_strdup_printf(
- "%s-%s", ethi_drag_types[0].target, ethi->dnd_code);
- list = gtk_target_list_new (
- ethi_drag_types, ELEMENTS (ethi_drag_types));
- context = gtk_drag_begin (widget, list, GDK_ACTION_MOVE, 1, event);
- g_free(ethi_drag_types[0].target);
-
- ecol = e_table_header_get_column (ethi->eth, ethi->drag_col);
- col_width = ecol->width;
- pixmap = gdk_pixmap_new (widget->window, col_width, ethi->height, -1);
-
- e_table_header_draw_button (
- pixmap, ecol,
- widget->style,
- GTK_WIDGET_STATE (widget),
- widget,
- 0, 0,
- col_width, ethi->height,
- col_width, ethi->height,
- (ETableColArrow) g_hash_table_lookup (
- arrows, GINT_TO_POINTER (ecol->col_idx)));
- gtk_drag_set_icon_pixmap (
- context,
- gdk_window_get_colormap (widget->window),
- pixmap,
- NULL,
- col_width / 2,
- ethi->height / 2);
- gdk_pixmap_unref (pixmap);
-
- ethi->maybe_drag = FALSE;
- g_hash_table_destroy (arrows);
-}
-
-typedef struct {
- ETableHeaderItem *ethi;
- int col;
-} EthiHeaderInfo;
-
-static void
-ethi_popup_sort_ascending(GtkWidget *widget, EthiHeaderInfo *info)
-{
- ETableCol *col;
- int model_col;
- int length;
- int i;
- int found = FALSE;
- ETableHeaderItem *ethi = info->ethi;
-
- col = e_table_header_get_column (ethi->eth, info->col);
- model_col = col->col_idx;
-
- length = e_table_sort_info_grouping_get_count(ethi->sort_info);
- for (i = 0; i < length; i++) {
- ETableSortColumn column = e_table_sort_info_grouping_get_nth (
- ethi->sort_info, i);
-
- if (model_col == column.column){
- column.ascending = 1;
- e_table_sort_info_grouping_set_nth (
- ethi->sort_info, i, column);
- found = 1;
- break;
- }
- }
- if (!found) {
- length = e_table_sort_info_sorting_get_count (
- ethi->sort_info);
- for (i = 0; i < length; i++) {
- ETableSortColumn column =
- e_table_sort_info_sorting_get_nth(
- ethi->sort_info, i);
- if (model_col == column.column){
- column.ascending = 1;
- e_table_sort_info_sorting_set_nth (
- ethi->sort_info, i, column);
- found = 1;
- break;
- }
- }
- }
- if (!found) {
- ETableSortColumn column;
- column.column = model_col;
- column.ascending = 1;
- length = e_table_sort_info_sorting_get_count(ethi->sort_info);
- if (length == 0)
- length++;
- e_table_sort_info_sorting_set_nth(ethi->sort_info, length - 1, column);
- }
-}
-
-static void
-ethi_popup_sort_descending(GtkWidget *widget, EthiHeaderInfo *info)
-{
- ETableCol *col;
- int model_col;
- int length;
- int i;
- int found = FALSE;
- ETableHeaderItem *ethi = info->ethi;
-
- col = e_table_header_get_column (ethi->eth, info->col);
- model_col = col->col_idx;
-
- length = e_table_sort_info_grouping_get_count(ethi->sort_info);
- for (i = 0; i < length; i++) {
- ETableSortColumn column = e_table_sort_info_grouping_get_nth(
- ethi->sort_info, i);
- if (model_col == column.column){
- column.ascending = 0;
- e_table_sort_info_grouping_set_nth(
- ethi->sort_info, i, column);
- found = 1;
- break;
- }
- }
- if (!found) {
- length = e_table_sort_info_sorting_get_count (ethi->sort_info);
- for (i = 0; i < length; i++) {
- ETableSortColumn column =
- e_table_sort_info_sorting_get_nth(
- ethi->sort_info, i);
-
- if (model_col == column.column){
- column.ascending = 0;
- e_table_sort_info_sorting_set_nth (
- ethi->sort_info, i, column);
- found = 1;
- break;
- }
- }
- }
- if (!found) {
- ETableSortColumn column;
- column.column = model_col;
- column.ascending = 0;
- length = e_table_sort_info_sorting_get_count (ethi->sort_info);
- if (length == 0)
- length++;
- e_table_sort_info_sorting_set_nth (
- ethi->sort_info, length - 1, column);
- }
-}
-
-static void
-ethi_popup_unsort(GtkWidget *widget, EthiHeaderInfo *info)
-{
- ETableHeaderItem *ethi = info->ethi;
-
- e_table_sort_info_grouping_truncate(ethi->sort_info, 0);
- e_table_sort_info_sorting_truncate(ethi->sort_info, 0);
-}
-
-static void
-ethi_popup_group_field(GtkWidget *widget, EthiHeaderInfo *info)
-{
- ETableCol *col;
- int model_col;
- ETableHeaderItem *ethi = info->ethi;
- ETableSortColumn column;
-
- col = e_table_header_get_column (ethi->eth, info->col);
- model_col = col->col_idx;
-
- column.column = model_col;
- column.ascending = 1;
- e_table_sort_info_grouping_set_nth(ethi->sort_info, 0, column);
- e_table_sort_info_grouping_truncate(ethi->sort_info, 1);
-}
-
-static void
-ethi_popup_group_box(GtkWidget *widget, EthiHeaderInfo *info)
-{
-}
-
-static void
-ethi_popup_remove_column(GtkWidget *widget, EthiHeaderInfo *info)
-{
- e_table_header_remove(info->ethi->eth, info->col);
-}
-
-static void
-ethi_popup_field_chooser(GtkWidget *widget, EthiHeaderInfo *info)
-{
- GtkWidget *etfcd = e_table_field_chooser_dialog_new();
- g_object_set(etfcd,
- "full_header", info->ethi->full_header,
- "header", info->ethi->eth,
- "dnd_code", info->ethi->dnd_code,
- NULL);
- gtk_widget_show(etfcd);
-}
-
-static void
-ethi_popup_alignment(GtkWidget *widget, EthiHeaderInfo *info)
-{
-}
-
-static void
-ethi_popup_best_fit(GtkWidget *widget, EthiHeaderInfo *info)
-{
- ETableHeaderItem *ethi = info->ethi;
- int width;
-
- g_signal_emit_by_name (ethi->eth,
- "request_width",
- info->col, &width);
- /* Add 10 to stop it from "..."ing */
- e_table_header_set_size (ethi->eth, info->col, width + 10);
-
- gnome_canvas_item_request_update (GNOME_CANVAS_ITEM(ethi));
-
-}
-
-static void
-ethi_popup_format_columns(GtkWidget *widget, EthiHeaderInfo *info)
-{
-}
-
-static void
-config_destroyed (gpointer data, GObject *where_object_was)
-{
- ETableHeaderItem *ethi = data;
- ethi->config = NULL;
-}
-
-static void
-apply_changes (ETableConfig *config, ETableHeaderItem *ethi)
-{
- char *state = e_table_state_save_to_string (config->state);
-
- if (ethi->table)
- e_table_set_state (ethi->table, state);
- if (ethi->tree)
- e_tree_set_state (ethi->tree, state);
- g_free (state);
-}
-
-static void
-ethi_popup_customize_view(GtkWidget *widget, EthiHeaderInfo *info)
-{
- ETableHeaderItem *ethi = info->ethi;
- ETableState *state;
- ETableSpecification *spec;
-
- if (ethi->config)
- e_table_config_raise (E_TABLE_CONFIG (ethi->config));
- else {
- if (ethi->table) {
- state = e_table_get_state_object(ethi->table);
- spec = ethi->table->spec;
- } else if (ethi->tree) {
- state = e_tree_get_state_object(ethi->tree);
- spec = e_tree_get_spec (ethi->tree);
- } else
- return;
-
- ethi->config = e_table_config_new (
- _("Customize Current View"),
- spec, state, NULL);
- g_object_weak_ref (G_OBJECT (ethi->config),
- config_destroyed, ethi);
- g_signal_connect (
- ethi->config, "changed",
- G_CALLBACK (apply_changes), ethi);
- }
-}
-
-static void
-free_popup_info (GtkWidget *w, EthiHeaderInfo *info)
-{
- g_free (info);
-}
-
-/* Bit 1 is always disabled. */
-/* Bit 2 is disabled if not "sortable". */
-/* Bit 4 is disabled if we don't have a pointer to our table object. */
-static EPopupMenu ethi_context_menu [] = {
- E_POPUP_ITEM (N_("Sort Ascending"), G_CALLBACK(ethi_popup_sort_ascending), 2),
- E_POPUP_ITEM (N_("Sort Descending"), G_CALLBACK(ethi_popup_sort_descending), 2),
- E_POPUP_ITEM (N_("Unsort"), G_CALLBACK(ethi_popup_unsort), 0),
- E_POPUP_SEPARATOR,
- E_POPUP_ITEM (N_("Group By This Field"), G_CALLBACK(ethi_popup_group_field), 16),
- E_POPUP_ITEM (N_("Group By Box"), G_CALLBACK(ethi_popup_group_box), 128),
- E_POPUP_SEPARATOR,
- E_POPUP_ITEM (N_("Remove This Column"), G_CALLBACK(ethi_popup_remove_column), 8),
- E_POPUP_ITEM (N_("Add a Column..."), G_CALLBACK(ethi_popup_field_chooser), 0),
- E_POPUP_SEPARATOR,
- E_POPUP_ITEM (N_("Alignment"), G_CALLBACK(ethi_popup_alignment), 128),
- E_POPUP_ITEM (N_("Best Fit"), G_CALLBACK(ethi_popup_best_fit), 2),
- E_POPUP_ITEM (N_("Format Columns..."), G_CALLBACK(ethi_popup_format_columns), 128),
- E_POPUP_SEPARATOR,
- E_POPUP_ITEM (N_("Customize Current View..."), G_CALLBACK(ethi_popup_customize_view), 4),
- E_POPUP_TERMINATOR
-};
-
-static void
-ethi_header_context_menu (ETableHeaderItem *ethi, GdkEventButton *event)
-{
- EthiHeaderInfo *info = g_new(EthiHeaderInfo, 1);
- ETableCol *col;
- GtkMenu *popup;
- info->ethi = ethi;
- info->col = ethi_find_col_by_x (ethi, event->x);
- col = e_table_header_get_column (ethi->eth, info->col);
-
- popup = e_popup_menu_create_with_domain (ethi_context_menu,
- 1 +
- (col->sortable ? 0 : 2) +
- ((ethi->table || ethi->tree) ? 0 : 4) +
- ((e_table_header_count (ethi->eth) > 1) ? 0 : 8),
- ((e_table_sort_info_get_can_group (ethi->sort_info)) ? 0 : 16) +
- 128, info, E_I18N_DOMAIN);
- g_object_ref (popup);
- gtk_object_sink (GTK_OBJECT (popup));
- g_signal_connect (popup, "selection-done",
- G_CALLBACK (free_popup_info), info);
- e_popup_menu (popup, (GdkEvent *) event);
-}
-
-static void
-ethi_button_pressed (ETableHeaderItem *ethi, GdkEventButton *event)
-{
- g_signal_emit (ethi,
- ethi_signals [BUTTON_PRESSED], 0, event);
-}
-
-static void
-ethi_change_sort_state (ETableHeaderItem *ethi, gdouble x)
-{
- ETableCol *col;
- int model_col;
- int length;
- int i;
- int found = FALSE;
-
- col = e_table_header_get_column (ethi->eth, ethi_find_col_by_x (ethi, x));
-
- if (col == NULL)
- return;
-
- model_col = col->col_idx;
-
- length = e_table_sort_info_grouping_get_count(ethi->sort_info);
- for (i = 0; i < length; i++) {
- ETableSortColumn column = e_table_sort_info_grouping_get_nth(ethi->sort_info, i);
- if (model_col == column.column){
- int ascending = column.ascending;
- ascending = ! ascending;
- column.ascending = ascending;
- e_table_sort_info_grouping_set_nth(ethi->sort_info, i, column);
- found = 1;
- break;
- }
- }
-
- if (!col->sortable)
- return;
-
- if (!found) {
- length = e_table_sort_info_sorting_get_count(ethi->sort_info);
- for (i = 0; i < length; i++) {
- ETableSortColumn column = e_table_sort_info_sorting_get_nth(ethi->sort_info, i);
-
- if (model_col == column.column){
- int ascending = column.ascending;
-
- if (ascending == 0){
- /*
- * This means the user has clicked twice
- * already, lets kill sorting now.
- */
- e_table_sort_info_sorting_truncate (ethi->sort_info, i);
- } else {
- ascending = !ascending;
- column.ascending = ascending;
- e_table_sort_info_sorting_set_nth(ethi->sort_info, i, column);
- }
- found = 1;
- break;
- }
- }
- }
-
- if (!found) {
- ETableSortColumn column;
- column.column = model_col;
- column.ascending = 1;
- length = e_table_sort_info_sorting_get_count(ethi->sort_info);
- if (length == 0)
- length++;
- e_table_sort_info_sorting_set_nth(ethi->sort_info, length - 1, column);
- }
-}
-
-/*
- * Handles the events on the ETableHeaderItem, particularly it handles resizing
- */
-static int
-ethi_event (GnomeCanvasItem *item, GdkEvent *e)
-{
- ETableHeaderItem *ethi = E_TABLE_HEADER_ITEM (item);
- GnomeCanvas *canvas = item->canvas;
- const gboolean resizing = ETHI_RESIZING (ethi);
- int x, y, start, col;
- int was_maybe_drag = 0;
-
- switch (e->type){
- case GDK_ENTER_NOTIFY:
- convert (canvas, e->crossing.x, e->crossing.y, &x, &y);
- set_cursor (ethi, x);
- break;
-
- case GDK_LEAVE_NOTIFY:
- gdk_window_set_cursor (GTK_WIDGET (canvas)->window, NULL);
- /* e_cursor_set (GTK_WIDGET (canvas)->window, E_CURSOR_ARROW);*/
- break;
-
- case GDK_MOTION_NOTIFY:
-
- convert (canvas, e->motion.x, e->motion.y, &x, &y);
- if (resizing){
- int new_width;
-
- if (ethi->resize_guide == NULL){
- /* Quick hack until I actually bind the views */
- ethi->resize_guide = GINT_TO_POINTER (1);
-
- gnome_canvas_item_grab (item,
- GDK_POINTER_MOTION_MASK |
- GDK_BUTTON_RELEASE_MASK,
- e_cursor_get (E_CURSOR_SIZE_X),
- e->button.time);
- }
-
- new_width = x - ethi->resize_start_pos;
-
- e_table_header_set_size (ethi->eth, ethi->resize_col, new_width);
-
- gnome_canvas_item_request_update (GNOME_CANVAS_ITEM(ethi));
- } else if (ethi_maybe_start_drag (ethi, &e->motion)){
- ethi_start_drag (ethi, e);
- } else
- set_cursor (ethi, x);
- break;
-
- case GDK_BUTTON_PRESS:
- if (e->button.button > 3)
- return FALSE;
-
- convert (canvas, e->button.x, e->button.y, &x, &y);
-
- if (is_pointer_on_division (ethi, x, &start, &col) && e->button.button == 1){
- ETableCol *ecol;
-
- /*
- * Record the important bits.
- *
- * By setting resize_pos to a non -1 value,
- * we know that we are being resized (used in the
- * other event handlers).
- */
- ecol = e_table_header_get_column (ethi->eth, col);
-
- if (!ecol->resizable)
- break;
- ethi->resize_col = col;
- ethi->resize_start_pos = start - ecol->width;
- ethi->resize_min_width = ecol->min_width;
- } else {
- if (e->button.button == 1){
- ethi->click_x = e->button.x;
- ethi->click_y = e->button.y;
- ethi->maybe_drag = TRUE;
- } else if (e->button.button == 3){
- ethi_header_context_menu (ethi, &e->button);
- } else
- ethi_button_pressed (ethi, &e->button);
- }
- break;
-
- case GDK_2BUTTON_PRESS:
- if (!resizing)
- break;
-
- if (e->button.button != 1)
- break;
- else {
- int width = 0;
- g_signal_emit_by_name (ethi->eth,
- "request_width",
- (int)ethi->resize_col, &width);
- /* Add 10 to stop it from "..."ing */
- e_table_header_set_size (ethi->eth, ethi->resize_col, width + 10);
-
- gnome_canvas_item_request_update (GNOME_CANVAS_ITEM(ethi));
- ethi->maybe_drag = FALSE;
- }
- break;
-
- case GDK_BUTTON_RELEASE: {
- gboolean needs_ungrab = FALSE;
-
- was_maybe_drag = ethi->maybe_drag;
-
- ethi->maybe_drag = FALSE;
-
- if (ethi->resize_col != -1){
- needs_ungrab = (ethi->resize_guide != NULL);
- ethi_end_resize (ethi);
- } else if (was_maybe_drag && ethi->sort_info)
- ethi_change_sort_state (ethi, e->button.x);
-
- if (needs_ungrab)
- gnome_canvas_item_ungrab (item, e->button.time);
-
- break;
- }
-
- default:
- return FALSE;
- }
- return TRUE;
-}
-
-static void
-ethi_class_init (GObjectClass *object_class)
-{
- GnomeCanvasItemClass *item_class = (GnomeCanvasItemClass *) object_class;
-
- ethi_parent_class = g_type_class_ref (PARENT_OBJECT_TYPE);
-
- object_class->dispose = ethi_dispose;
- object_class->set_property = ethi_set_property;
- object_class->get_property = ethi_get_property;
-
- item_class->update = ethi_update;
- item_class->realize = ethi_realize;
- item_class->unrealize = ethi_unrealize;
- item_class->draw = ethi_draw;
- item_class->point = ethi_point;
- item_class->event = ethi_event;
-
- g_object_class_install_property (object_class, PROP_DND_CODE,
- g_param_spec_string ("dnd_code",
- _("DnD code"),
- /*_( */"XXX blurb" /*)*/,
- NULL,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_TABLE_FONTSET,
- g_param_spec_string ("fontset",
- _("Fontset"),
- /*_( */"XXX blurb" /*)*/,
- NULL,
- G_PARAM_WRITABLE));
-
- g_object_class_install_property (object_class, PROP_FULL_HEADER,
- g_param_spec_object ("full_header",
- _("Full Header"),
- /*_( */"XXX blurb" /*)*/,
- E_TABLE_HEADER_TYPE,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_TABLE_HEADER,
- g_param_spec_object ("ETableHeader",
- _("Header"),
- /*_( */"XXX blurb" /*)*/,
- E_TABLE_HEADER_TYPE,
- G_PARAM_WRITABLE));
-
- g_object_class_install_property (object_class, PROP_SORT_INFO,
- g_param_spec_object ("sort_info",
- _("Sort Info"),
- /*_( */"XXX blurb" /*)*/,
- E_TABLE_SORT_INFO_TYPE,
- G_PARAM_WRITABLE));
-
- g_object_class_install_property (object_class, PROP_TABLE,
- g_param_spec_object ("table",
- _("Table"),
- /*_( */"XXX blurb" /*)*/,
- E_TABLE_TYPE,
- G_PARAM_WRITABLE));
-
- g_object_class_install_property (object_class, PROP_TREE,
- g_param_spec_object ("tree",
- _("Tree"),
- /*_( */"XXX blurb" /*)*/,
- E_TREE_TYPE,
- G_PARAM_WRITABLE));
-
- /*
- * Create our pixmaps for DnD
- */
- dnd_colormap = gtk_widget_get_default_colormap ();
- remove_col_pixmap = gdk_pixmap_colormap_create_from_xpm_d (
- NULL, dnd_colormap,
- &remove_col_mask, NULL, remove_col_xpm);
-
- add_col_pixmap = gdk_pixmap_colormap_create_from_xpm_d (
- NULL, dnd_colormap,
- &add_col_mask, NULL, add_col_xpm);
-
- ethi_signals [BUTTON_PRESSED] =
- g_signal_new ("button_pressed",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (ETableHeaderItemClass, button_pressed),
- NULL, NULL,
- e_marshal_NONE__BOXED,
- G_TYPE_NONE, 1, GDK_TYPE_EVENT);
-}
-
-static void
-ethi_init (GnomeCanvasItem *item)
-{
- ETableHeaderItem *ethi = E_TABLE_HEADER_ITEM (item);
-
- ethi->resize_col = -1;
-
- item->x1 = 0;
- item->y1 = 0;
- item->x2 = 0;
- item->y2 = 0;
-
- ethi->drag_col = -1;
- ethi->drag_mark = -1;
-
- ethi->sort_info = NULL;
-
- ethi->sort_info_changed_id = 0;
- ethi->group_info_changed_id = 0;
-
- ethi->group_indent_width = 0;
- ethi->table = NULL;
- ethi->tree = NULL;
-}
-
-E_MAKE_TYPE (e_table_header_item,
- "ETableHeaderItem",
- ETableHeaderItem,
- ethi_class_init,
- ethi_init,
- PARENT_OBJECT_TYPE)
diff --git a/widgets/table/e-table-header-item.h b/widgets/table/e-table-header-item.h
deleted file mode 100644
index 3eebddeefc..0000000000
--- a/widgets/table/e-table-header-item.h
+++ /dev/null
@@ -1,114 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-table-header-item.h
- * Copyright 1999, 2000, 2001, Ximian, Inc.
- *
- * Authors:
- * Chris Lahey <clahey@ximian.com>
- * Miguel de Icaza (miguel@gnu.org)
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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.
- */
-
-#ifndef _E_TABLE_HEADER_ITEM_H_
-#define _E_TABLE_HEADER_ITEM_H_
-
-#include <gal/e-table/e-table.h>
-#include <gal/e-table/e-tree.h>
-#include <libgnomecanvas/gnome-canvas.h>
-#include <libxml/tree.h>
-#include <gal/e-table/e-table-header.h>
-#include <gal/e-table/e-table-sort-info.h>
-
-G_BEGIN_DECLS
-
-#define E_TABLE_HEADER_ITEM_TYPE (e_table_header_item_get_type ())
-#define E_TABLE_HEADER_ITEM(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), E_TABLE_HEADER_ITEM_TYPE, ETableHeaderItem))
-#define E_TABLE_HEADER_ITEM_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), E_TABLE_HEADER_ITEM_TYPE, ETableHeaderItemClass))
-#define E_IS_TABLE_HEADER_ITEM(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), E_TABLE_HEADER_ITEM_TYPE))
-#define E_IS_TABLE_HEADER_ITEM_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), E_TABLE_HEADER_ITEM_TYPE))
-
-typedef struct {
- GnomeCanvasItem parent;
- ETableHeader *eth;
-
- GdkCursor *change_cursor;
-
- short height, width;
- GdkFont *font;
-
- /*
- * Used during resizing; Could be shorts
- */
- int resize_col;
- int resize_start_pos;
- int resize_min_width;
-
- GtkObject *resize_guide;
-
- int group_indent_width;
-
- /*
- * Ids
- */
- int structure_change_id, dimension_change_id;
-
- /*
- * For dragging columns
- */
- guint maybe_drag:1;
- guint dnd_ready:1;
- int click_x, click_y;
- int drag_col, drop_col, drag_mark;
- guint drag_motion_id, drag_end_id, drag_leave_id, drag_drop_id, drag_data_received_id, drag_data_get_id;
- guint sort_info_changed_id, group_info_changed_id;
- GnomeCanvasItem *remove_item;
- GdkBitmap *stipple;
-
- gchar *dnd_code;
-
- /*
- * For column sorting info
- */
- ETableSortInfo *sort_info;
-
- guint scroll_direction : 4;
- int last_drop_x;
- int last_drop_y;
- int last_drop_time;
- GdkDragContext *last_drop_context;
- int scroll_idle_id;
-
- /* For adding fields. */
- ETableHeader *full_header;
- ETable *table;
- ETree *tree;
- void *config;
-} ETableHeaderItem;
-
-typedef struct {
- GnomeCanvasItemClass parent_class;
-
- /*
- * signals
- */
- void (*button_pressed) (ETableHeaderItem *ethi, GdkEventButton *button);
-} ETableHeaderItemClass;
-
-GType e_table_header_item_get_type (void);
-
-G_END_DECLS
-
-#endif /* _E_TABLE_HEADER_ITEM_H_ */
diff --git a/widgets/table/e-table-header-utils.c b/widgets/table/e-table-header-utils.c
deleted file mode 100644
index fdbe5e201b..0000000000
--- a/widgets/table/e-table-header-utils.c
+++ /dev/null
@@ -1,481 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-table-header-utils.h
- * Copyright 2000, 2001, Ximian, Inc.
- *
- * Authors:
- * Chris Lahey <clahey@ximian.com>
- * Miguel de Icaza <miguel@ximian.com>
- * Federico Mena-Quintero <federico@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include "e-table-header-utils.h"
-
-#include <string.h> /* strlen() */
-#include <glib.h>
-#include <gtk/gtkbutton.h>
-#include <gtk/gtkwindow.h>
-#include "e-table-defines.h"
-#include <gal/widgets/e-unicode.h>
-
-
-
-static PangoLayout*
-build_header_layout (GtkWidget *widget, const char *str)
-{
- PangoLayout *layout;
-
- layout = gtk_widget_create_pango_layout (widget, str);
-
-#ifdef FROB_FONT_DESC
- {
- PangoFontDescription *desc;
- desc = pango_font_description_copy (gtk_widget_get_style (widget)->font_desc);
- pango_font_description_set_size (desc,
- pango_font_description_get_size (desc) * 1.2);
-
- pango_font_description_set_weight (desc, PANGO_WEIGHT_BOLD);
- pango_layout_set_font_description (layout, desc);
-
- pango_font_description_free (desc);
- }
-#endif
-
- return layout;
-}
-
-/**
- * e_table_header_compute_height:
- * @ecol: Table column description.
- * @widget: The widget from which to build the PangoLayout.
- *
- * Computes the minimum height required for a table header button.
- *
- * Return value: The height of the button, in pixels.
- **/
-double
-e_table_header_compute_height (ETableCol *ecol, GtkWidget *widget)
-{
- int ythick;
- int height;
- PangoLayout *layout;
-
- g_return_val_if_fail (ecol != NULL, -1);
- g_return_val_if_fail (E_IS_TABLE_COL (ecol), -1);
- g_return_val_if_fail (GTK_IS_WIDGET (widget), -1);
-
- ythick = gtk_widget_get_style (widget)->ythickness;
-
- layout = build_header_layout (widget, ecol->text);
-
- pango_layout_get_pixel_size (layout, NULL, &height);
-
- if (ecol->is_pixbuf) {
- g_assert (ecol->pixbuf != NULL);
- height = MAX (height, gdk_pixbuf_get_height (ecol->pixbuf));
- }
-
- height = MAX (height, MIN_ARROW_SIZE);
-
- height += 2 * (ythick + HEADER_PADDING);
-
- g_object_unref (layout);
-
- return height;
-}
-
-double
-e_table_header_width_extras (GtkStyle *style)
-{
- g_return_val_if_fail (style != NULL, -1);
-
- return 2 * (style->xthickness + HEADER_PADDING);
-}
-
-/* Creates a pixmap that is a composite of a background color and the upper-left
- * corner rectangle of a pixbuf.
- */
-static GdkPixmap *
-make_composite_pixmap (GdkDrawable *drawable, GdkGC *gc,
- GdkPixbuf *pixbuf, GdkColor *bg, int width, int height,
- int dither_xofs, int dither_yofs)
-{
- int pwidth, pheight;
- GdkPixmap *pixmap;
- GdkPixbuf *tmp;
- int color;
-
- pwidth = gdk_pixbuf_get_width (pixbuf);
- pheight = gdk_pixbuf_get_height (pixbuf);
- g_assert (width <= pwidth && height <= pheight);
-
- color = ((bg->red & 0xff00) << 8) | (bg->green & 0xff00) | ((bg->blue & 0xff00) >> 8);
-
- if (width >= pwidth && height >= pheight) {
- tmp = gdk_pixbuf_new (GDK_COLORSPACE_RGB, FALSE, 8, width, height);
- if (!tmp)
- return NULL;
-
- gdk_pixbuf_composite_color (pixbuf, tmp,
- 0, 0,
- width, height,
- 0, 0,
- 1.0, 1.0,
- GDK_INTERP_NEAREST,
- 255,
- 0, 0,
- 16,
- color, color);
- } else {
- int x, y, rowstride;
- GdkPixbuf *fade;
- guchar *pixels;
-
- /* Do a nice fade of the pixbuf down and to the right */
-
- fade = gdk_pixbuf_new (GDK_COLORSPACE_RGB, TRUE, 8, width, height);
- if (!fade)
- return NULL;
-
- gdk_pixbuf_copy_area (pixbuf,
- 0, 0,
- width, height,
- fade,
- 0, 0);
-
- rowstride = gdk_pixbuf_get_rowstride (fade);
- pixels = gdk_pixbuf_get_pixels (fade);
-
- for (y = 0; y < height; y++) {
- guchar *p;
- int yfactor;
-
- p = pixels + y * rowstride;
-
- if (height < pheight)
- yfactor = height - y;
- else
- yfactor = height;
-
- for (x = 0; x < width; x++) {
- int xfactor;
-
- if (width < pwidth)
- xfactor = width - x;
- else
- xfactor = width;
-
- p[3] = ((int) p[3] * xfactor * yfactor / (width * height));
- p += 4;
- }
- }
-
- tmp = gdk_pixbuf_new (GDK_COLORSPACE_RGB, FALSE, 8, width, height);
- if (!tmp) {
- gdk_pixbuf_unref (fade);
- return NULL;
- }
-
- gdk_pixbuf_composite_color (fade, tmp,
- 0, 0,
- width, height,
- 0, 0,
- 1.0, 1.0,
- GDK_INTERP_NEAREST,
- 255,
- 0, 0,
- 16,
- color, color);
-
- gdk_pixbuf_unref (fade);
- }
-
- pixmap = gdk_pixmap_new (drawable, width, height, gdk_rgb_get_visual ()->depth);
- gdk_draw_rgb_image_dithalign (pixmap, gc,
- 0, 0,
- width, height,
- GDK_RGB_DITHER_NORMAL,
- gdk_pixbuf_get_pixels (tmp),
- gdk_pixbuf_get_rowstride (tmp),
- dither_xofs, dither_yofs);
- gdk_pixbuf_unref (tmp);
-
- return pixmap;
-}
-
-/* Default width of the elision arrow in pixels */
-#define ARROW_WIDTH 4
-
-/**
- * e_table_draw_elided_string:
- * @drawable: Destination drawable.
- * @font: Font for the text.
- * @gc: GC to use for drawing.
- * @x: X insertion point for the string.
- * @y: Y insertion point for the string's baseline.
- * @layout: the PangoLayout to draw.
- * @str: the string we're drawing, passed in so we can change the layout if it needs eliding.
- * @max_width: Maximum width in which the string must fit.
- * @center: Whether to center the string in the available area if it does fit.
- *
- * Draws a string, possibly trimming it so that it fits inside the specified
- * maximum width. If it does not fit, an elision indicator is drawn after the
- * last character that does fit.
- **/
-static void
-e_table_draw_elided_string (GdkDrawable *drawable, GdkGC *gc, GtkWidget *widget,
- int x, int y, PangoLayout *layout, char *str,
- int max_width, gboolean center)
-{
- int width;
- int height;
- int index;
- GSList *lines;
- PangoLayoutLine *line;
-
- g_return_if_fail (drawable != NULL);
- g_return_if_fail (gc != NULL);
- g_return_if_fail (layout != NULL);
- g_return_if_fail (max_width >= 0);
-
- pango_layout_get_pixel_size (layout, &width, &height);
-
- gdk_gc_set_clip_rectangle (gc, NULL);
-
- if (width <= max_width) {
- int xpos;
-
- if (center)
- xpos = x + (max_width - width) / 2;
- else
- xpos = x;
-
- gdk_draw_layout (drawable, gc,
- xpos, y,
- layout);
- } else {
- int arrow_width;
- int i;
-
- if (max_width < ARROW_WIDTH + 1)
- arrow_width = max_width - 1;
- else
- arrow_width = ARROW_WIDTH;
-
-
- lines = pango_layout_get_lines (layout);
- line = lines->data;
-
- if (!pango_layout_line_x_to_index (line,
- (max_width - arrow_width) * PANGO_SCALE,
- &index,
- NULL)) {
- g_warning ("pango_layout_line_x_to_index returned false");
- return;
- }
-
- pango_layout_set_text (layout, str, index);
-
- gdk_draw_layout (drawable, gc, x, y, layout);
-
- for (i = 0; i < arrow_width; i++) {
- int h;
-
- h = 2 * i + 1;
-
- gdk_draw_line (drawable, gc,
- x + max_width - i,
- y + height / 2 - i,
- x + max_width - i,
- y + height / 2 + i + 1);
- }
- }
-
- g_object_unref (layout);
-}
-
-static GtkWidget *g_label;
-
-/**
- * e_table_header_draw_button:
- * @drawable: Destination drawable.
- * @ecol: Table column for the header information.
- * @style: Style to use for drawing the button.
- * @state: State of the table widget.
- * @widget: The table widget.
- * @x: Leftmost coordinate of the button.
- * @y: Topmost coordinate of the button.
- * @width: Width of the region to draw.
- * @height: Height of the region to draw.
- * @button_width: Width for the complete button.
- * @button_height: Height for the complete button.
- * @arrow: Arrow type to use as a sort indicator.
- *
- * Draws a button suitable for a table header.
- **/
-void
-e_table_header_draw_button (GdkDrawable *drawable, ETableCol *ecol,
- GtkStyle *style, GtkStateType state,
- GtkWidget *widget,
- int x, int y, int width, int height,
- int button_width, int button_height,
- ETableColArrow arrow)
-{
- int xthick, ythick;
- int inner_x, inner_y;
- int inner_width, inner_height;
- GdkGC *gc;
- char *text;
- PangoLayout *layout;
-
- g_return_if_fail (drawable != NULL);
- g_return_if_fail (ecol != NULL);
- g_return_if_fail (E_IS_TABLE_COL (ecol));
- g_return_if_fail (style != NULL);
- g_return_if_fail (widget != NULL);
- g_return_if_fail (GTK_IS_WIDGET (widget));
- g_return_if_fail (button_width > 0 && button_height > 0);
-
- if (g_label == NULL) {
- GtkWidget *button = gtk_button_new_with_label("Hi");
- GtkWidget *window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
- g_label = GTK_BIN(button)->child;
- gtk_container_add (GTK_CONTAINER (window), button);
- gtk_widget_ensure_style (window);
- gtk_widget_ensure_style (button);
- gtk_widget_ensure_style (g_label);
- }
-
- gc = g_label->style->fg_gc[state];
-
- gdk_gc_set_clip_rectangle (gc, NULL);
-
- xthick = style->xthickness;
- ythick = style->ythickness;
-
- /* Button bevel */
-
- gtk_paint_box (style, drawable, state, GTK_SHADOW_OUT,
- NULL, widget, "button",
- x, y, button_width, button_height);
-
- /* Inside area */
-
- inner_width = button_width - 2 * (xthick + HEADER_PADDING);
- inner_height = button_height - 2 * (ythick + HEADER_PADDING);
-
- if (inner_width < 1 || inner_height < 1)
- return; /* nothing fits */
-
- inner_x = x + xthick + HEADER_PADDING;
- inner_y = y + ythick + HEADER_PADDING;
-
- /* Arrow */
-
- switch (arrow) {
- case E_TABLE_COL_ARROW_NONE:
- break;
-
- case E_TABLE_COL_ARROW_UP:
- case E_TABLE_COL_ARROW_DOWN: {
- int arrow_width, arrow_height;
-
- arrow_width = MIN (MIN_ARROW_SIZE, inner_width);
- arrow_height = MIN (MIN_ARROW_SIZE, inner_height);
-
- gtk_paint_arrow (style, drawable, state,
- GTK_SHADOW_IN, NULL, widget, "header",
- (arrow == E_TABLE_COL_ARROW_UP) ? GTK_ARROW_UP : GTK_ARROW_DOWN,
- TRUE,
- inner_x + inner_width - arrow_width,
- inner_y + (inner_height - arrow_height) / 2,
- arrow_width, arrow_height);
-
- inner_width -= arrow_width + HEADER_PADDING;
- break;
- }
-
- default:
- g_assert_not_reached ();
- return;
- }
-
- if (inner_width < 1)
- return; /* nothing else fits */
-
- layout = build_header_layout (widget, ecol->text);
-
- /* Pixbuf or label */
- if (ecol->is_pixbuf) {
- int pwidth, pheight;
- int clip_width, clip_height;
- int xpos;
- GdkPixmap *pixmap;
-
- g_assert (ecol->pixbuf != NULL);
-
- pwidth = gdk_pixbuf_get_width (ecol->pixbuf);
- pheight = gdk_pixbuf_get_height (ecol->pixbuf);
-
- clip_width = MIN (pwidth, inner_width);
- clip_height = MIN (pheight, inner_height);
-
- xpos = inner_x;
-
- if (inner_width - pwidth > 11) {
- int width;
- int ypos;
-
- pango_layout_get_pixel_size (layout, &width, NULL);
-
- if (width < inner_width - (pwidth + 1)) {
- xpos = inner_x + (inner_width - width - (pwidth + 1)) / 2;
- }
-
- ypos = inner_y;
-
- e_table_draw_elided_string (drawable, gc, widget,
- xpos + pwidth + 1, ypos,
- layout, ecol->text, inner_width - (xpos - inner_x), FALSE);
- }
-
- pixmap = make_composite_pixmap (drawable, gc,
- ecol->pixbuf, &style->bg[state],
- clip_width, clip_height,
- xpos,
- inner_y + (inner_height - clip_height) / 2);
-
- gdk_gc_set_clip_rectangle (gc, NULL);
-
- if (pixmap) {
- gdk_draw_pixmap (drawable, gc, pixmap,
- 0, 0,
- xpos,
- inner_y + (inner_height - clip_height) / 2,
- clip_width, clip_height);
- gdk_pixmap_unref (pixmap);
- }
- } else {
- e_table_draw_elided_string (drawable, gc, widget,
- inner_x, inner_y,
- layout, ecol->text, inner_width, TRUE);
- }
-}
diff --git a/widgets/table/e-table-header-utils.h b/widgets/table/e-table-header-utils.h
deleted file mode 100644
index 38defa9261..0000000000
--- a/widgets/table/e-table-header-utils.h
+++ /dev/null
@@ -1,55 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-table-header-utils.h
- * Copyright 2000, 2001, Ximian, Inc.
- *
- * Authors:
- * Chris Lahey <clahey@ximian.com>
- * Miguel de Icaza <miguel@ximian.com>
- * Federico Mena-Quintero <federico@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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.
- */
-
-#ifndef E_TABLE_HEADER_UTILS_H
-#define E_TABLE_HEADER_UTILS_H
-
-#include <gal/e-table/e-table-col.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
-
-double e_table_header_compute_height (ETableCol *ecol,
- GtkWidget *widget);
-double e_table_header_width_extras (GtkStyle *style);
-void e_table_header_draw_button (GdkDrawable *drawable,
- ETableCol *ecol,
- GtkStyle *style,
- GtkStateType state,
- GtkWidget *widget,
- int x,
- int y,
- int width,
- int height,
- int button_width,
- int button_height,
- ETableColArrow arrow);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif
diff --git a/widgets/table/e-table-header.c b/widgets/table/e-table-header.c
deleted file mode 100644
index d810d61bd1..0000000000
--- a/widgets/table/e-table-header.c
+++ /dev/null
@@ -1,952 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-table-header.c
- * Copyright 1999, 2000, 2001, Ximian, Inc.
- *
- * Authors:
- * Chris Lahey <clahey@ximian.com>
- * Miguel de Icaza <miguel@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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 <string.h>
-#include <glib-object.h>
-#include <gtk/gtkimage.h>
-#include <gal/util/e-util.h>
-#include "e-table-header.h"
-#include "e-table-defines.h"
-#include "gal/util/e-util.h"
-
-/* The arguments we take */
-enum {
- PROP_0,
- PROP_SORT_INFO,
- PROP_WIDTH,
- PROP_WIDTH_EXTRAS
-};
-
-enum {
- STRUCTURE_CHANGE,
- DIMENSION_CHANGE,
- EXPANSION_CHANGE,
- REQUEST_WIDTH,
- LAST_SIGNAL
-};
-
-static void eth_set_size (ETableHeader *eth, int idx, int size);
-static void eth_calc_widths (ETableHeader *eth);
-
-static guint eth_signals [LAST_SIGNAL] = { 0, };
-
-static GObjectClass *e_table_header_parent_class;
-
-struct two_ints {
- int column;
- int width;
-};
-
-static void
-eth_set_width (ETableHeader *eth, int width)
-{
- eth->width = width;
-}
-
-static void
-dequeue (ETableHeader *eth, int *column, int *width)
-{
- GSList *head;
- struct two_ints *store;
- head = eth->change_queue;
- eth->change_queue = eth->change_queue->next;
- if (!eth->change_queue)
- eth->change_tail = NULL;
- store = head->data;
- g_slist_free_1(head);
- if (column)
- *column = store->column;
- if (width)
- *width = store->width;
- g_free(store);
-}
-
-static gboolean
-dequeue_idle (ETableHeader *eth)
-{
- int column, width;
-
- dequeue (eth, &column, &width);
- while (eth->change_queue && ((struct two_ints *) eth->change_queue->data)->column == column)
- dequeue (eth, &column, &width);
-
- if (column == -1)
- eth_set_width (eth, width);
- else if (column < eth->col_count)
- eth_set_size (eth, column, width);
- if (eth->change_queue)
- return TRUE;
- else {
- eth_calc_widths (eth);
- eth->idle = 0;
- return FALSE;
- }
-}
-
-static void
-enqueue (ETableHeader *eth, int column, int width)
-{
- struct two_ints *store;
- store = g_new(struct two_ints, 1);
- store->column = column;
- store->width = width;
-
- eth->change_tail = g_slist_last(g_slist_append(eth->change_tail, store));
- if (!eth->change_queue)
- eth->change_queue = eth->change_tail;
-
- if (!eth->idle) {
- eth->idle = g_idle_add_full(G_PRIORITY_LOW, (GSourceFunc) dequeue_idle, eth, NULL);
- }
-}
-
-void
-e_table_header_set_size (ETableHeader *eth, int idx, int size)
-{
- g_return_if_fail (eth != NULL);
- g_return_if_fail (E_IS_TABLE_HEADER (eth));
-
- enqueue (eth, idx, size);
-}
-
-static void
-eth_do_remove (ETableHeader *eth, int idx, gboolean do_unref)
-{
- if (do_unref)
- g_object_unref (eth->columns [idx]);
-
- memmove (&eth->columns [idx], &eth->columns [idx+1],
- sizeof (ETableCol *) * (eth->col_count - idx - 1));
- eth->col_count--;
-}
-
-static void
-eth_finalize (GObject *object)
-{
- ETableHeader *eth = E_TABLE_HEADER (object);
- const int cols = eth->col_count;
- int i;
-
- if (eth->sort_info) {
- if (eth->sort_info_group_change_id)
- g_signal_handler_disconnect(G_OBJECT(eth->sort_info),
- eth->sort_info_group_change_id);
- g_object_unref(eth->sort_info);
- eth->sort_info = NULL;
- }
-
- if (eth->idle)
- g_source_remove(eth->idle);
- eth->idle = 0;
-
- if (eth->change_queue) {
- g_slist_foreach(eth->change_queue, (GFunc) g_free, NULL);
- g_slist_free(eth->change_queue);
- eth->change_queue = NULL;
- }
-
- /*
- * Destroy columns
- */
- for (i = cols - 1; i >= 0; i--){
- eth_do_remove (eth, i, TRUE);
- }
- g_free (eth->columns);
-
- eth->col_count = 0;
- eth->columns = NULL;
-
- if (e_table_header_parent_class->finalize)
- e_table_header_parent_class->finalize (object);
-}
-
-static void
-eth_group_info_changed(ETableSortInfo *info, ETableHeader *eth)
-{
- enqueue(eth, -1, eth->nominal_width);
-}
-
-static void
-eth_set_property (GObject *object, guint prop_id, const GValue *val, GParamSpec *pspec)
-{
- ETableHeader *eth = E_TABLE_HEADER (object);
-
- switch (prop_id) {
- case PROP_WIDTH:
- eth->nominal_width = g_value_get_double (val);
- enqueue(eth, -1, eth->nominal_width);
- break;
- case PROP_WIDTH_EXTRAS:
- eth->width_extras = g_value_get_double (val);
- enqueue(eth, -1, eth->nominal_width);
- break;
- case PROP_SORT_INFO:
- if (eth->sort_info) {
- if (eth->sort_info_group_change_id)
- g_signal_handler_disconnect(G_OBJECT(eth->sort_info), eth->sort_info_group_change_id);
- g_object_unref (eth->sort_info);
- }
- eth->sort_info = E_TABLE_SORT_INFO(g_value_get_object (val));
- if (eth->sort_info) {
- g_object_ref(eth->sort_info);
- eth->sort_info_group_change_id
- = g_signal_connect(G_OBJECT(eth->sort_info), "group_info_changed",
- G_CALLBACK(eth_group_info_changed), eth);
- }
- enqueue(eth, -1, eth->nominal_width);
- break;
- default:
- break;
- }
-}
-
-static void
-eth_get_property (GObject *object, guint prop_id, GValue *val, GParamSpec *pspec)
-{
- ETableHeader *eth = E_TABLE_HEADER (object);
-
- switch (prop_id) {
- case PROP_SORT_INFO:
- g_value_set_object (val, G_OBJECT(eth->sort_info));
- break;
- case PROP_WIDTH:
- g_value_set_double (val, eth->nominal_width);
- break;
- case PROP_WIDTH_EXTRAS:
- g_value_set_double (val, eth->width_extras);
- break;
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
- break;
- }
-}
-
-static void
-e_table_header_class_init (GObjectClass *object_class)
-{
- ETableHeaderClass *klass = E_TABLE_HEADER_CLASS (object_class);
-
- object_class->finalize = eth_finalize;
- object_class->set_property = eth_set_property;
- object_class->get_property = eth_get_property;
-
- e_table_header_parent_class = g_type_class_peek_parent (object_class);
-
- g_object_class_install_property (
- object_class, PROP_WIDTH,
- g_param_spec_double ("width", "Width", "Width",
- 0.0, G_MAXDOUBLE, 0.0,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (
- object_class, PROP_WIDTH_EXTRAS,
- g_param_spec_double ("width_extras", "Width of Extras", "Width of Extras",
- 0.0, G_MAXDOUBLE, 0.0,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (
- object_class, PROP_SORT_INFO,
- g_param_spec_object ("sort_info", "Sort Info", "Sort Info",
- E_TABLE_SORT_INFO_TYPE,
- G_PARAM_READWRITE));
-
- eth_signals [STRUCTURE_CHANGE] =
- g_signal_new ("structure_change",
- E_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (ETableHeaderClass, structure_change),
- (GSignalAccumulator) NULL, NULL,
- g_cclosure_marshal_VOID__VOID,
- G_TYPE_NONE, 0);
- eth_signals [DIMENSION_CHANGE] =
- g_signal_new ("dimension_change",
- E_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (ETableHeaderClass, dimension_change),
- (GSignalAccumulator) NULL, NULL,
- g_cclosure_marshal_VOID__INT,
- G_TYPE_NONE, 1, G_TYPE_INT);
- eth_signals [EXPANSION_CHANGE] =
- g_signal_new ("expansion_change",
- E_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (ETableHeaderClass, expansion_change),
- (GSignalAccumulator) NULL, NULL,
- g_cclosure_marshal_VOID__VOID,
- G_TYPE_NONE, 0);
- eth_signals [REQUEST_WIDTH] =
- g_signal_new ("request_width",
- E_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (ETableHeaderClass, request_width),
- (GSignalAccumulator) NULL, NULL,
- e_marshal_INT__INT,
- G_TYPE_INT, 1, G_TYPE_INT);
-
- klass->structure_change = NULL;
- klass->dimension_change = NULL;
- klass->expansion_change = NULL;
- klass->request_width = NULL;
-}
-
-static void
-e_table_header_init (ETableHeader *eth)
-{
- eth->col_count = 0;
- eth->width = 0;
-
- eth->sort_info = NULL;
- eth->sort_info_group_change_id = 0;
-
- eth->columns = NULL;
-
- eth->change_queue = NULL;
- eth->change_tail = NULL;
-
- eth->width_extras = 0;
-}
-
-/**
- * e_table_header_new:
- *
- * Returns: A new @ETableHeader object.
- */
-ETableHeader *
-e_table_header_new (void)
-{
-
- return (ETableHeader *) g_object_new (E_TABLE_HEADER_TYPE, NULL);
-}
-
-static void
-eth_update_offsets (ETableHeader *eth)
-{
- int i;
- int x = 0;
-
- for (i = 0; i < eth->col_count; i++){
- ETableCol *etc = eth->columns [i];
-
- etc->x = x;
- x += etc->width;
- }
-}
-
-static void
-eth_do_insert (ETableHeader *eth, int pos, ETableCol *val)
-{
- memmove (&eth->columns [pos+1], &eth->columns [pos],
- sizeof (ETableCol *) * (eth->col_count - pos));
- eth->columns [pos] = val;
- eth->col_count ++;
-}
-
-/**
- * e_table_header_add_column:
- * @eth: the table header to add the column to.
- * @tc: the ETableCol definition
- * @pos: position where the ETableCol will go.
- *
- * This function adds the @tc ETableCol definition into the @eth ETableHeader
- * at position @pos. This is the way you add new ETableCols to the
- * ETableHeader. The header will assume ownership of the @tc; you should not
- * unref it after you add it.
- *
- * This function will emit the "structure_change" signal on the @eth object.
- * The ETableCol is assumed
- */
-void
-e_table_header_add_column (ETableHeader *eth, ETableCol *tc, int pos)
-{
- g_return_if_fail (eth != NULL);
- g_return_if_fail (E_IS_TABLE_HEADER (eth));
- g_return_if_fail (tc != NULL);
- g_return_if_fail (E_IS_TABLE_COL (tc));
- g_return_if_fail (pos >= -1 && pos <= eth->col_count);
-
- if (pos == -1)
- pos = eth->col_count;
- eth->columns = g_realloc (eth->columns, sizeof (ETableCol *) * (eth->col_count + 1));
-
- /*
- * We are the primary owners of the column
- */
- g_object_ref (tc);
-
- eth_do_insert (eth, pos, tc);
-
- enqueue(eth, -1, eth->nominal_width);
- g_signal_emit (G_OBJECT (eth), eth_signals [STRUCTURE_CHANGE], 0);
-}
-
-/**
- * e_table_header_get_column:
- * @eth: the ETableHeader to query
- * @column: the column inside the @eth.
- *
- * Returns: The ETableCol at @column in the @eth object
- */
-ETableCol *
-e_table_header_get_column (ETableHeader *eth, int column)
-{
- g_return_val_if_fail (eth != NULL, NULL);
- g_return_val_if_fail (E_IS_TABLE_HEADER (eth), NULL);
-
- if (column < 0)
- return NULL;
-
- if (column >= eth->col_count)
- return NULL;
-
- return eth->columns [column];
-}
-
-/**
- * e_table_header_get_column_by_col_id:
- * @eth: the ETableHeader to query
- * @col_id: the col_id to search for.
- *
- * Returns: The ETableCol with col_idx = @col_idx in the @eth object
- */
-ETableCol *
-e_table_header_get_column_by_col_idx (ETableHeader *eth, int col_idx)
-{
- int i;
- g_return_val_if_fail (eth != NULL, NULL);
- g_return_val_if_fail (E_IS_TABLE_HEADER (eth), NULL);
-
- for (i = 0; i < eth->col_count; i++) {
- if (eth->columns[i]->col_idx == col_idx) {
- return eth->columns [i];
- }
- }
-
- return NULL;
-}
-
-/**
- * e_table_header_count:
- * @eth: the ETableHeader to query
- *
- * Returns: the number of columns in this ETableHeader.
- */
-int
-e_table_header_count (ETableHeader *eth)
-{
- g_return_val_if_fail (eth != NULL, 0);
- g_return_val_if_fail (E_IS_TABLE_HEADER (eth), 0);
-
- return eth->col_count;
-}
-
-/**
- * e_table_header_index:
- * @eth: the ETableHeader to query
- * @col: the column to fetch.
- *
- * ETableHeaders contain the visual list of columns that the user will
- * view. The visible columns will typically map to different columns
- * in the ETableModel (because the user reordered the data for
- * example).
- *
- * Returns: the column in the model that the @col column
- * in the ETableHeader points to. */
-int
-e_table_header_index (ETableHeader *eth, int col)
-{
- g_return_val_if_fail (eth != NULL, -1);
- g_return_val_if_fail (E_IS_TABLE_HEADER (eth), -1);
- g_return_val_if_fail (col >= 0 && col < eth->col_count, -1);
-
- return eth->columns [col]->col_idx;
-}
-
-/**
- * e_table_header_get_index_at:
- * @eth: the ETableHeader to query
- * @x_offset: a pixel count from the beginning of the ETableHeader
- *
- * This will return the ETableHeader column that would contain
- * the @x_offset pixel.
- *
- * Returns: the column that contains pixel @x_offset, or -1
- * if no column inside this ETableHeader contains that pixel.
- */
-int
-e_table_header_get_index_at (ETableHeader *eth, int x_offset)
-{
- int i, total;
-
- g_return_val_if_fail (eth != NULL, 0);
- g_return_val_if_fail (E_IS_TABLE_HEADER (eth), 0);
-
- total = 0;
- for (i = 0; i < eth->col_count; i++){
- total += eth->columns [i]->width;
-
- if (x_offset < total)
- return i;
- }
-
- return -1;
-}
-
-/**
- * e_table_header_get_columns:
- * @eth: The ETableHeader to query
- *
- * Returns: A NULL terminated array of the ETableCols
- * contained in the ETableHeader @eth. Note that every
- * returned ETableCol in the array has been referenced, to release
- * this information you need to g_free the buffer returned
- * and you need to g_object_unref every element returned
- */
-ETableCol **
-e_table_header_get_columns (ETableHeader *eth)
-{
- ETableCol **ret;
- int i;
-
- g_return_val_if_fail (eth != NULL, 0);
- g_return_val_if_fail (E_IS_TABLE_HEADER (eth), 0);
-
- ret = g_new (ETableCol *, eth->col_count + 1);
- memcpy (ret, eth->columns, sizeof (ETableCol *) * eth->col_count);
- ret [eth->col_count] = NULL;
-
- for (i = 0; i < eth->col_count; i++) {
- g_object_ref(ret[i]);
- }
-
- return ret;
-}
-
-/**
- * e_table_header_get_selected:
- * @eth: The ETableHeader to query
- *
- * Returns: The number of selected columns in the @eth object.
- */
-int
-e_table_header_get_selected (ETableHeader *eth)
-{
- int i;
- int selected = 0;
-
- g_return_val_if_fail (eth != NULL, 0);
- g_return_val_if_fail (E_IS_TABLE_HEADER (eth), 0);
-
- for (i = 0; i < eth->col_count; i++){
- if (eth->columns [i]->selected)
- selected++;
- }
-
- return selected;
-}
-
-/**
- * e_table_header_total_width:
- * @eth: The ETableHeader to query
- *
- * Returns: the number of pixels used by the @eth object
- * when rendered on screen
- */
-int
-e_table_header_total_width (ETableHeader *eth)
-{
- int total, i;
-
- g_return_val_if_fail (eth != NULL, 0);
- g_return_val_if_fail (E_IS_TABLE_HEADER (eth), 0);
-
- total = 0;
- for (i = 0; i < eth->col_count; i++)
- total += eth->columns [i]->width;
-
- return total;
-}
-
-/**
- * e_table_header_min_width:
- * @eth: The ETableHeader to query
- *
- * Returns: the minimum number of pixels required by the @eth object.
- **/
-int
-e_table_header_min_width (ETableHeader *eth)
-{
- int total, i;
-
- g_return_val_if_fail (eth != NULL, 0);
- g_return_val_if_fail (E_IS_TABLE_HEADER (eth), 0);
-
- total = 0;
- for (i = 0; i < eth->col_count; i++)
- total += eth->columns [i]->min_width;
-
- return total;
-}
-
-/**
- * e_table_header_move:
- * @eth: The ETableHeader to operate on.
- * @source_index: the source column to move.
- * @target_index: the target location for the column
- *
- * This function moves the column @source_index to @target_index
- * inside the @eth ETableHeader. The signals "dimension_change"
- * and "structure_change" will be emmited
- */
-void
-e_table_header_move (ETableHeader *eth, int source_index, int target_index)
-{
- ETableCol *old;
-
- g_return_if_fail (eth != NULL);
- g_return_if_fail (E_IS_TABLE_HEADER (eth));
- g_return_if_fail (source_index >= 0);
- g_return_if_fail (target_index >= 0);
- g_return_if_fail (source_index < eth->col_count);
- g_return_if_fail (target_index < eth->col_count + 1); /* Can be moved beyond the last item. */
-
- if (source_index < target_index)
- target_index --;
-
- old = eth->columns [source_index];
- eth_do_remove (eth, source_index, FALSE);
- eth_do_insert (eth, target_index, old);
- eth_update_offsets (eth);
-
- g_signal_emit (G_OBJECT (eth), eth_signals [DIMENSION_CHANGE], 0, eth->width);
- g_signal_emit (G_OBJECT (eth), eth_signals [STRUCTURE_CHANGE], 0);
-}
-
-/**
- * e_table_header_remove:
- * @eth: The ETableHeader to operate on.
- * @idx: the index to the column to be removed.
- *
- * Removes the column at @idx position in the ETableHeader @eth.
- * This emmits the "structure_change" signal on the @eth object.
- */
-void
-e_table_header_remove (ETableHeader *eth, int idx)
-{
- g_return_if_fail (eth != NULL);
- g_return_if_fail (E_IS_TABLE_HEADER (eth));
- g_return_if_fail (idx >= 0);
- g_return_if_fail (idx < eth->col_count);
-
- eth_do_remove (eth, idx, TRUE);
- enqueue(eth, -1, eth->nominal_width);
- g_signal_emit (G_OBJECT (eth), eth_signals [STRUCTURE_CHANGE], 0);
-}
-
-/*
- * FIXME: deprecated?
- */
-void
-e_table_header_set_selection (ETableHeader *eth, gboolean allow_selection)
-{
- g_return_if_fail (eth != NULL);
- g_return_if_fail (E_IS_TABLE_HEADER (eth));
-}
-
-static void
-eth_set_size (ETableHeader *eth, int idx, int size)
-{
- double expansion;
- double old_expansion;
- int min_width;
- int left_width;
- int total_extra;
- int expandable_count;
- int usable_width;
- int i;
- g_return_if_fail (eth != NULL);
- g_return_if_fail (E_IS_TABLE_HEADER (eth));
- g_return_if_fail (idx >= 0);
- g_return_if_fail (idx < eth->col_count);
-
- /* If this column is not resizable, don't do anything. */
- if (!eth->columns[idx]->resizable)
- return;
-
- expansion = 0;
- min_width = 0;
- left_width = 0;
- expandable_count = -1;
-
- /* Calculate usable area. */
- for (i = 0; i < idx; i++) {
- left_width += eth->columns[i]->width;
- }
- /* - 1 to account for the last pixel border. */
- usable_width = eth->width - left_width - 1;
-
- if (eth->sort_info)
- usable_width -= e_table_sort_info_grouping_get_count(eth->sort_info) * GROUP_INDENT;
-
- /* Calculate minimum_width of stuff on the right as well as
- * total usable expansion on the right.
- */
- for (; i < eth->col_count; i++) {
- min_width += eth->columns[i]->min_width + eth->width_extras;
- if (eth->columns[i]->resizable) {
- expansion += eth->columns[i]->expansion;
- expandable_count ++;
- }
- }
- /* If there's no room for anything, don't change. */
- if (expansion == 0)
- return;
-
- /* (1) If none of the columns to the right are expandable, use
- * all the expansion space in this column.
- */
- if(expandable_count == 0) {
- eth->columns[idx]->expansion = expansion;
- for (i = idx + 1; i < eth->col_count; i++) {
- eth->columns[i]->expansion = 0;
- }
-
- g_signal_emit (G_OBJECT (eth), eth_signals [EXPANSION_CHANGE], 0);
- return;
- }
-
- total_extra = usable_width - min_width;
- /* If there's no extra space, set all expansions to 0. */
- if (total_extra <= 0) {
- for (i = idx; i < eth->col_count; i++) {
- eth->columns[i]->expansion = 0;
- }
- g_signal_emit (G_OBJECT (eth), eth_signals [EXPANSION_CHANGE], 0);
- return;
- }
-
- /* If you try to resize smaller than the minimum width, it
- * uses the minimum. */
- if (size < eth->columns[idx]->min_width + eth->width_extras)
- size = eth->columns[idx]->min_width + eth->width_extras;
-
- /* If all the extra space will be used up in this column, use
- * all the expansion and set all others to 0.
- */
- if (size >= total_extra + eth->columns[idx]->min_width + eth->width_extras) {
- eth->columns[idx]->expansion = expansion;
- for (i = idx + 1; i < eth->col_count; i++) {
- eth->columns[i]->expansion = 0;
- }
- g_signal_emit (G_OBJECT (eth), eth_signals [EXPANSION_CHANGE], 0);
- return;
- }
-
- /* The old_expansion used by columns to the right. */
- old_expansion = expansion;
- old_expansion -= eth->columns[idx]->expansion;
- /* Set the new expansion so that it will generate the desired size. */
- eth->columns[idx]->expansion = expansion * (((double)(size - (eth->columns[idx]->min_width + eth->width_extras)))/((double)total_extra));
- /* The expansion left for the columns on the right. */
- expansion -= eth->columns[idx]->expansion;
-
- /* (2) If the old columns to the right didn't have any
- * expansion before, expand them evenly. old_expansion > 0 by
- * expansion = SUM(i=idx to col_count -1,
- * columns[i]->min_width) - columns[idx]->min_width) =
- * SUM(non-negatives).
- */
- if (old_expansion == 0) {
- for (i = idx + 1; i < eth->col_count; i++) {
- if (eth->columns[idx]->resizable) {
- /* expandable_count != 0 by (1) */
- eth->columns[i]->expansion = expansion / expandable_count;
- }
- }
- g_signal_emit (G_OBJECT (eth), eth_signals [EXPANSION_CHANGE], 0);
- return;
- }
-
- /* Remove from total_extra the amount used for this column. */
- total_extra -= size - (eth->columns[idx]->min_width + eth->width_extras);
- for (i = idx + 1; i < eth->col_count; i++) {
- if (eth->columns[idx]->resizable) {
- /* old_expansion != 0 by (2) */
- eth->columns[i]->expansion *= expansion / old_expansion;
- }
- }
- g_signal_emit (G_OBJECT (eth), eth_signals [EXPANSION_CHANGE], 0);
-}
-
-/**
- * e_table_header_col_diff:
- * @eth: the ETableHeader to query.
- * @start_col: the starting column
- * @end_col: the ending column.
- *
- * Computes the number of pixels between the columns @start_col and
- * @end_col.
- *
- * Returns: the number of pixels between @start_col and @end_col on the
- * @eth ETableHeader object
- */
-int
-e_table_header_col_diff (ETableHeader *eth, int start_col, int end_col)
-{
- int total, col;
-
- g_return_val_if_fail (eth != NULL, 0);
- g_return_val_if_fail (E_IS_TABLE_HEADER (eth), 0);
-
- if (start_col < 0)
- start_col = 0;
- if (end_col > eth->col_count)
- end_col = eth->col_count;
-
- total = 0;
- for (col = start_col; col < end_col; col++){
-
- total += eth->columns [col]->width;
- }
-
- return total;
-}
-
-static void
-eth_calc_widths (ETableHeader *eth)
-{
- int i;
- int extra;
- double expansion;
- int last_position = 0;
- double next_position = 0;
- int last_resizable = -1;
- int *widths;
- gboolean changed;
-
- widths = g_new (int, eth->col_count);
-
- /* - 1 to account for the last pixel border. */
- extra = eth->width - 1;
- expansion = 0;
- for (i = 0; i < eth->col_count; i++) {
- extra -= eth->columns[i]->min_width + eth->width_extras;
- if (eth->columns[i]->resizable && eth->columns[i]->expansion > 0)
- last_resizable = i;
- expansion += eth->columns[i]->resizable ? eth->columns[i]->expansion : 0;
- widths[i] = eth->columns[i]->min_width + eth->width_extras;
- }
- if (eth->sort_info)
- extra -= e_table_sort_info_grouping_get_count(eth->sort_info) * GROUP_INDENT;
- if (expansion != 0 && extra > 0) {
- for (i = 0; i < last_resizable; i++) {
- next_position += extra * (eth->columns[i]->resizable ? eth->columns[i]->expansion : 0)/expansion;
- widths[i] += next_position - last_position;
- last_position = next_position;
- }
- widths[i] += extra - last_position;
- }
-
- changed = FALSE;
-
- for (i = 0; i < eth->col_count; i++) {
- if (eth->columns[i]->width != widths[i]) {
- changed = TRUE;
- eth->columns[i]->width = widths[i];
- }
- }
- g_free (widths);
- if (changed)
- g_signal_emit (G_OBJECT (eth), eth_signals [DIMENSION_CHANGE], 0, eth->width);
- eth_update_offsets (eth);
-}
-
-void
-e_table_header_update_horizontal (ETableHeader *eth)
-{
- int i;
- int cols;
-
- cols = eth->col_count;
-
- for (i = 0; i < cols; i++) {
- int width = 0;
-
- g_signal_emit_by_name (G_OBJECT (eth),
- "request_width",
- i, &width);
- eth->columns[i]->min_width = width + 10;
- eth->columns[i]->expansion = 1;
- }
- enqueue(eth, -1, eth->nominal_width);
- g_signal_emit (G_OBJECT (eth), eth_signals [EXPANSION_CHANGE], 0);
-}
-
-E_MAKE_TYPE(e_table_header, "ETableHeader", ETableHeader, e_table_header_class_init, e_table_header_init, G_TYPE_OBJECT)
-
-int
-e_table_header_prioritized_column (ETableHeader *eth)
-{
- int best_model_col = 0;
- int best_priority;
- int i;
- int count;
-
- count = e_table_header_count (eth);
- if (count == 0)
- return -1;
- best_priority = e_table_header_get_column (eth, 0)->priority;
- best_model_col = e_table_header_get_column (eth, 0)->col_idx;
- for (i = 1; i < count; i++) {
- int priority = e_table_header_get_column (eth, i)->priority;
- if (priority > best_priority) {
- best_priority = priority;
- best_model_col = e_table_header_get_column (eth, i)->col_idx;
- }
- }
- return best_model_col;
-}
-
-ETableCol *
-e_table_header_prioritized_column_selected (ETableHeader *eth, ETableColCheckFunc check_func, gpointer user_data)
-{
- ETableCol *best_col = NULL;
- int best_priority = G_MININT;
- int i;
- int count;
-
- count = e_table_header_count (eth);
- if (count == 0)
- return NULL;
- for (i = 1; i < count; i++) {
- ETableCol *col = e_table_header_get_column (eth, i);
- if (col) {
- if ((best_col == NULL || col->priority > best_priority) && check_func (col, user_data)) {
- best_priority = col->priority;
- best_col = col;
- }
- }
- }
- return best_col;
-}
diff --git a/widgets/table/e-table-header.h b/widgets/table/e-table-header.h
deleted file mode 100644
index 3a9ae6a0bf..0000000000
--- a/widgets/table/e-table-header.h
+++ /dev/null
@@ -1,120 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-table-header.h
- * Copyright 1999, 2000, 2001, Ximian, Inc.
- *
- * Authors:
- * Chris Lahey <clahey@ximian.com>
- * Miguel de Icaza <miguel@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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.
- */
-
-#ifndef _E_TABLE_COLUMN_H_
-#define _E_TABLE_COLUMN_H_
-
-#include <glib-object.h>
-#include <gdk/gdk.h>
-#include <gal/e-table/e-table-sort-info.h>
-#include <gal/e-table/e-table-col.h>
-
-G_BEGIN_DECLS
-
-typedef struct _ETableHeader ETableHeader;
-
-#define E_TABLE_HEADER_TYPE (e_table_header_get_type ())
-#define E_TABLE_HEADER(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), E_TABLE_HEADER_TYPE, ETableHeader))
-#define E_TABLE_HEADER_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), E_TABLE_HEADER_TYPE, ETableHeaderClass))
-#define E_IS_TABLE_HEADER(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), E_TABLE_HEADER_TYPE))
-#define E_IS_TABLE_HEADER_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), E_TABLE_HEADER_TYPE))
-#define E_TABLE_HEADER_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS((o), E_TABLE_HEADER_TYPE, ETableHeaderClass))
-
-typedef gboolean (*ETableColCheckFunc) (ETableCol *col, gpointer user_data);
-
-/*
- * A Columnar header.
- */
-struct _ETableHeader {
- GObject base;
-
- int col_count;
- int width;
- int nominal_width;
- int width_extras;
-
- ETableSortInfo *sort_info;
- int sort_info_group_change_id;
-
- ETableCol **columns;
-
- GSList *change_queue, *change_tail;
- gint idle;
-};
-
-typedef struct {
- GObjectClass parent_class;
-
- void (*structure_change) (ETableHeader *eth);
- void (*dimension_change) (ETableHeader *eth, int width);
- void (*expansion_change) (ETableHeader *eth);
- int (*request_width) (ETableHeader *eth, int col);
-} ETableHeaderClass;
-
-GType e_table_header_get_type (void);
-ETableHeader *e_table_header_new (void);
-
-void e_table_header_add_column (ETableHeader *eth,
- ETableCol *tc,
- int pos);
-ETableCol *e_table_header_get_column (ETableHeader *eth,
- int column);
-ETableCol *e_table_header_get_column_by_col_idx (ETableHeader *eth,
- int col_idx);
-int e_table_header_count (ETableHeader *eth);
-int e_table_header_index (ETableHeader *eth,
- int col);
-int e_table_header_get_index_at (ETableHeader *eth,
- int x_offset);
-ETableCol **e_table_header_get_columns (ETableHeader *eth);
-int e_table_header_get_selected (ETableHeader *eth);
-
-int e_table_header_total_width (ETableHeader *eth);
-int e_table_header_min_width (ETableHeader *eth);
-void e_table_header_move (ETableHeader *eth,
- int source_index,
- int target_index);
-void e_table_header_remove (ETableHeader *eth,
- int idx);
-void e_table_header_set_size (ETableHeader *eth,
- int idx,
- int size);
-void e_table_header_set_selection (ETableHeader *eth,
- gboolean allow_selection);
-int e_table_header_col_diff (ETableHeader *eth,
- int start_col,
- int end_col);
-
-void e_table_header_calc_widths (ETableHeader *eth);
-GList *e_table_header_get_selected_indexes (ETableHeader *eth);
-void e_table_header_update_horizontal (ETableHeader *eth);
-int e_table_header_prioritized_column (ETableHeader *eth);
-ETableCol *e_table_header_prioritized_column_selected (ETableHeader *eth,
- ETableColCheckFunc check_func,
- gpointer user_data);
-
-G_END_DECLS
-
-#endif /* _E_TABLE_HEADER_H_ */
-
diff --git a/widgets/table/e-table-item.c b/widgets/table/e-table-item.c
deleted file mode 100644
index 4c03513ee1..0000000000
--- a/widgets/table/e-table-item.c
+++ /dev/null
@@ -1,3645 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-table-item.c
- * Copyright 1999, 2000, 2001, Ximian, Inc.
- *
- * Authors:
- * Chris Lahey <clahey@ximian.com>
- * Miguel de Icaza <miguel@gnu.org>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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.
- */
-
-/*
- * TODO:
- * Add a border to the thing, so that focusing works properly.
- */
-#include <config.h>
-
-#include "e-table-item.h"
-
-#include <X11/Xlib.h>
-
-#include <math.h>
-#include <stdio.h>
-#include <gtk/gtksignal.h>
-#include <gtk/gtkmain.h>
-#include <gdk/gdkkeysyms.h>
-#include "e-table-subset.h"
-#include "e-cell.h"
-#include "gal/widgets/e-hsv-utils.h"
-#include "gal/widgets/e-canvas.h"
-#include "gal/widgets/e-canvas-utils.h"
-#include "gal/util/e-util.h"
-#include "gal/util/e-i18n.h"
-#include <string.h>
-#include <stdlib.h>
-
-#define PARENT_OBJECT_TYPE gnome_canvas_item_get_type ()
-
-#define FOCUSED_BORDER 2
-
-#define d(x)
-
-#if d(!)0
-#define e_table_item_leave_edit_(x) (e_table_item_leave_edit((x)), g_print ("%s: e_table_item_leave_edit\n", __FUNCTION__))
-#else
-#define e_table_item_leave_edit_(x) (e_table_item_leave_edit((x)))
-#endif
-
-/* FIXME: Do an analysis of which cell functions are needed before
- realize and make sure that all of them are doable by all the cells
- and that all of the others are only done after realization. */
-
-static GnomeCanvasItemClass *eti_parent_class;
-
-enum {
- CURSOR_CHANGE,
- CURSOR_ACTIVATED,
- DOUBLE_CLICK,
- RIGHT_CLICK,
- CLICK,
- KEY_PRESS,
- START_DRAG,
- STYLE_SET,
- LAST_SIGNAL
-};
-
-static guint eti_signals [LAST_SIGNAL] = { 0, };
-
-enum {
- PROP_0,
- PROP_TABLE_HEADER,
- PROP_TABLE_MODEL,
- PROP_SELECTION_MODEL,
- PROP_TABLE_ALTERNATING_ROW_COLORS,
- PROP_TABLE_HORIZONTAL_DRAW_GRID,
- PROP_TABLE_VERTICAL_DRAW_GRID,
- PROP_TABLE_DRAW_FOCUS,
- PROP_CURSOR_MODE,
- PROP_LENGTH_THRESHOLD,
- PROP_CURSOR_ROW,
- PROP_UNIFORM_ROW_HEIGHT,
-
- PROP_MINIMUM_WIDTH,
- PROP_WIDTH,
- PROP_HEIGHT
-};
-
-#define DOUBLE_CLICK_TIME 250
-#define TRIPLE_CLICK_TIME 500
-
-
-static int eti_get_height (ETableItem *eti);
-static int eti_row_height (ETableItem *eti, int row);
-static void e_table_item_focus (ETableItem *eti, int col, int row, GdkModifierType state);
-static void eti_cursor_change (ESelectionModel *selection, int row, int col, ETableItem *eti);
-static void eti_cursor_activated (ESelectionModel *selection, int row, int col, ETableItem *eti);
-static void eti_selection_change (ESelectionModel *selection, ETableItem *eti);
-static void eti_selection_row_change (ESelectionModel *selection, int row, ETableItem *eti);
-static void e_table_item_redraw_row (ETableItem *eti, int row);
-
-#define ETI_SINGLE_ROW_HEIGHT(eti) ((eti)->uniform_row_height_cache != -1 ? (eti)->uniform_row_height_cache : eti_row_height((eti), -1))
-#define ETI_MULTIPLE_ROW_HEIGHT(eti,row) ((eti)->height_cache && (eti)->height_cache[(row)] != -1 ? (eti)->height_cache[(row)] : eti_row_height((eti),(row)))
-#define ETI_ROW_HEIGHT(eti,row) ((eti)->uniform_row_height ? ETI_SINGLE_ROW_HEIGHT ((eti)) : ETI_MULTIPLE_ROW_HEIGHT((eti),(row)))
-
-inline static gint
-model_to_view_row(ETableItem *eti, int row)
-{
- int i;
- if (row == -1)
- return -1;
- if (eti->uses_source_model) {
- ETableSubset *etss = E_TABLE_SUBSET(eti->table_model);
- if (eti->row_guess >= 0 && eti->row_guess < etss->n_map) {
- if (etss->map_table[eti->row_guess] == row) {
- return eti->row_guess;
- }
- }
- for (i = 0; i < etss->n_map; i++) {
- if (etss->map_table[i] == row)
- return i;
- }
- return -1;
- } else
- return row;
-}
-
-inline static gint
-view_to_model_row(ETableItem *eti, int row)
-{
- if (eti->uses_source_model) {
- ETableSubset *etss = E_TABLE_SUBSET(eti->table_model);
- if (row >= 0 && row < etss->n_map) {
- eti->row_guess = row;
- return etss->map_table[row];
- } else
- return -1;
- } else
- return row;
-}
-
-inline static gint
-model_to_view_col(ETableItem *eti, int col)
-{
- int i;
- if (col == -1)
- return -1;
- for (i = 0; i < eti->cols; i++) {
- ETableCol *ecol = e_table_header_get_column (eti->header, i);
- if (ecol->col_idx == col)
- return i;
- }
- return -1;
-}
-
-inline static gint
-view_to_model_col(ETableItem *eti, int col)
-{
- ETableCol *ecol = e_table_header_get_column (eti->header, col);
- return ecol ? ecol->col_idx : -1;
-}
-
-static void
-grab_cancelled (ECanvas *canvas, GnomeCanvasItem *item, gpointer data)
-{
- ETableItem *eti = data;
-
- eti->grab_cancelled = TRUE;
-}
-
-inline static void
-eti_grab (ETableItem *eti, guint32 time)
-{
- GnomeCanvasItem *item = GNOME_CANVAS_ITEM (eti);
- d(g_print ("%s: time: %d\n", __FUNCTION__, time));
- if (eti->grabbed_count == 0) {
- eti->gtk_grabbed = FALSE;
- eti->grab_cancelled = FALSE;
- if (e_canvas_item_grab(E_CANVAS (item->canvas),
- item,
- GDK_BUTTON1_MOTION_MASK | GDK_BUTTON2_MOTION_MASK | GDK_BUTTON3_MOTION_MASK
- | GDK_POINTER_MOTION_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK,
- NULL, time,
- grab_cancelled,
- eti) != GrabSuccess) {
- d(g_print ("%s: gtk_grab_add\n", __FUNCTION__));
- gtk_grab_add (GTK_WIDGET (item->canvas));
- eti->gtk_grabbed = TRUE;
- }
- }
- eti->grabbed_count ++;
-}
-
-inline static void
-eti_ungrab (ETableItem *eti, guint32 time)
-{
- GnomeCanvasItem *item = GNOME_CANVAS_ITEM (eti);
- d(g_print ("%s: time: %d\n", __FUNCTION__, time));
- eti->grabbed_count --;
- if (eti->grabbed_count == 0) {
- if (eti->grab_cancelled) {
- eti->grab_cancelled = FALSE;
- } else {
- if (eti->gtk_grabbed) {
- d(g_print ("%s: gtk_grab_remove\n", __FUNCTION__));
- gtk_grab_remove (GTK_WIDGET (item->canvas));
- eti->gtk_grabbed = FALSE;
- }
- gnome_canvas_item_ungrab(item, time);
- eti->grabbed_col = -1;
- eti->grabbed_row = -1;
- }
- }
-}
-
-inline static gboolean
-eti_editing (ETableItem *eti)
-{
- d(g_print("%s: %s\n", __FUNCTION__, (eti->editing_col == -1) ? "false":"true"));
-
- if (eti->editing_col == -1)
- return FALSE;
- else
- return TRUE;
-}
-
-inline static GdkColor *
-eti_get_cell_background_color (ETableItem *eti, int row, int col, gboolean selected, gboolean *allocatedp)
-{
- ECellView *ecell_view = eti->cell_views [col];
- GtkWidget *canvas = GTK_WIDGET(GNOME_CANVAS_ITEM(eti)->canvas);
- GdkColor *background, bg;
- gchar *color_spec = NULL;
- gboolean allocated = FALSE;
-
- if (selected){
- if (GTK_WIDGET_HAS_FOCUS(canvas))
- background = &canvas->style->bg [GTK_STATE_SELECTED];
- else
- background = &canvas->style->bg [GTK_STATE_ACTIVE];
- } else {
- background = &canvas->style->base [GTK_STATE_NORMAL];
- }
-
- color_spec = e_cell_get_bg_color (ecell_view, row);
-
- if (color_spec != NULL) {
- if (gdk_color_parse (color_spec, &bg)) {
- background = gdk_color_copy (&bg);
- allocated = TRUE;
- }
- }
-
- if (eti->alternating_row_colors) {
- if (row % 2) {
-
- } else {
- if (!allocated) {
- background = gdk_color_copy (background);
- allocated = TRUE;
- }
- e_hsv_tweak (background, 0.0f, 0.0f, -0.05f);
- gdk_color_alloc (gtk_widget_get_colormap (GTK_WIDGET (canvas)), background);
- }
- }
- if (allocatedp)
- *allocatedp = allocated;
-
- return background;
-}
-
-inline static GdkColor *
-eti_get_cell_foreground_color (ETableItem *eti, int row, int col, gboolean selected, gboolean *allocated)
-{
- GtkWidget *canvas = GTK_WIDGET(GNOME_CANVAS_ITEM(eti)->canvas);
- GdkColor *foreground;
-
- if (allocated)
- *allocated = FALSE;
-
- if (selected){
- if (GTK_WIDGET_HAS_FOCUS (canvas))
- foreground = &canvas->style->fg [GTK_STATE_SELECTED];
- else
- foreground = &canvas->style->fg [GTK_STATE_ACTIVE];
- } else {
- foreground = &canvas->style->text [GTK_STATE_NORMAL];
- }
-
- return foreground;
-}
-
-static void
-eti_free_save_state (ETableItem *eti)
-{
- if (eti->save_row == -1 ||
- !eti->cell_views_realized)
- return;
-
- e_cell_free_state (eti->cell_views [eti->save_col], view_to_model_col(eti, eti->save_col),
- eti->save_col, eti->save_row, eti->save_state);
- eti->save_row = -1;
- eti->save_col = -1;
- eti->save_state = NULL;
-}
-
-/*
- * During realization, we have to invoke the per-ecell realize routine
- * (On our current setup, we have one e-cell per column.
- *
- * We might want to optimize this to only realize the unique e-cells:
- * ie, a strings-only table, uses the same e-cell for every column, and
- * we might want to avoid realizing each e-cell.
- */
-static void
-eti_realize_cell_views (ETableItem *eti)
-{
- int i;
-
- if (eti->cell_views_realized)
- return;
-
- if (!(GTK_OBJECT_FLAGS(eti) & GNOME_CANVAS_ITEM_REALIZED))
- return;
-
- for (i = 0; i < eti->n_cells; i++)
- e_cell_realize (eti->cell_views [i]);
- eti->cell_views_realized = 1;
-}
-
-static void
-eti_attach_cell_views (ETableItem *eti)
-{
- int i;
-
- g_assert (eti->header);
- g_assert (eti->table_model);
-
- /*
- * Now realize the various ECells
- */
- eti->n_cells = eti->cols;
- eti->cell_views = g_new (ECellView *, eti->n_cells);
-
- for (i = 0; i < eti->n_cells; i++){
- ETableCol *ecol = e_table_header_get_column (eti->header, i);
-
- eti->cell_views [i] = e_cell_new_view (ecol->ecell, eti->table_model, eti);
- }
-
- eti->needs_compute_height = 1;
- e_canvas_item_request_reflow (GNOME_CANVAS_ITEM (eti));
- eti->needs_redraw = 1;
- gnome_canvas_item_request_update (GNOME_CANVAS_ITEM (eti));
-}
-
-/*
- * During unrealization: we invoke every e-cell (one per column in the current
- * setup) to dispose all X resources allocated
- */
-static void
-eti_unrealize_cell_views (ETableItem *eti)
-{
- int i;
-
- if (eti->cell_views_realized == 0)
- return;
-
- eti_free_save_state (eti);
-
- for (i = 0; i < eti->n_cells; i++)
- e_cell_unrealize (eti->cell_views [i]);
- eti->cell_views_realized = 0;
-}
-
-static void
-eti_detach_cell_views (ETableItem *eti)
-{
- int i;
-
- eti_free_save_state (eti);
-
- for (i = 0; i < eti->n_cells; i++){
- e_cell_kill_view (eti->cell_views [i]);
- eti->cell_views [i] = NULL;
- }
-
- g_free (eti->cell_views);
- eti->cell_views = NULL;
- eti->n_cells = 0;
-}
-
-static void
-eti_bounds (GnomeCanvasItem *item, double *x1, double *y1, double *x2, double *y2)
-{
- double i2c [6];
- ArtPoint c1, c2, i1, i2;
- ETableItem *eti = E_TABLE_ITEM (item);
-
- /* Wrong BBox's are the source of redraw nightmares */
-
- gnome_canvas_item_i2c_affine (GNOME_CANVAS_ITEM (eti), i2c);
-
- i1.x = eti->x1;
- i1.y = eti->y1;
- i2.x = eti->x1 + eti->width;
- i2.y = eti->y1 + eti->height;
- art_affine_point (&c1, &i1, i2c);
- art_affine_point (&c2, &i2, i2c);
-
- *x1 = c1.x;
- *y1 = c1.y;
- *x2 = c2.x + 1;
- *y2 = c2.y + 1;
-}
-
-static void
-eti_reflow (GnomeCanvasItem *item, gint flags)
-{
- ETableItem *eti = E_TABLE_ITEM (item);
-
- if (eti->needs_compute_height) {
- int new_height = eti_get_height (eti);
-
- if (new_height != eti->height) {
- eti->height = new_height;
- e_canvas_item_request_parent_reflow (GNOME_CANVAS_ITEM (eti));
- eti->needs_redraw = 1;
- gnome_canvas_item_request_update (GNOME_CANVAS_ITEM (eti));
- }
- eti->needs_compute_height = 0;
- }
- if (eti->needs_compute_width) {
- int new_width = e_table_header_total_width(eti->header);
- if (new_width != eti->width) {
- eti->width = new_width;
- e_canvas_item_request_parent_reflow (GNOME_CANVAS_ITEM (eti));
- eti->needs_redraw = 1;
- gnome_canvas_item_request_update (GNOME_CANVAS_ITEM (eti));
- }
- eti->needs_compute_width = 0;
- }
-}
-
-/*
- * GnomeCanvasItem::update method
- */
-static void
-eti_update (GnomeCanvasItem *item, double *affine, ArtSVP *clip_path, int flags)
-{
- ArtPoint o1, o2;
- ETableItem *eti = E_TABLE_ITEM (item);
-
- if (GNOME_CANVAS_ITEM_CLASS (eti_parent_class)->update)
- (*GNOME_CANVAS_ITEM_CLASS (eti_parent_class)->update)(item, affine, clip_path, flags);
-
- o1.x = item->x1;
- o1.y = item->y1;
- o2.x = item->x2;
- o2.y = item->y2;
-
- eti_bounds (item, &item->x1, &item->y1, &item->x2, &item->y2);
- if (item->x1 != o1.x ||
- item->y1 != o1.y ||
- item->x2 != o2.x ||
- item->y2 != o2.y) {
- gnome_canvas_request_redraw (item->canvas, o1.x, o1.y, o2.x, o2.y);
- eti->needs_redraw = 1;
- }
-
- if (eti->needs_redraw) {
- gnome_canvas_request_redraw (item->canvas, item->x1, item->y1,
- item->x2, item->y2);
- eti->needs_redraw = 0;
- }
-}
-
-/*
- * eti_remove_table_model:
- *
- * Invoked to release the table model associated with this ETableItem
- */
-static void
-eti_remove_table_model (ETableItem *eti)
-{
- if (!eti->table_model)
- return;
-
- g_signal_handler_disconnect (G_OBJECT (eti->table_model),
- eti->table_model_pre_change_id);
- g_signal_handler_disconnect (G_OBJECT (eti->table_model),
- eti->table_model_no_change_id);
- g_signal_handler_disconnect (G_OBJECT (eti->table_model),
- eti->table_model_change_id);
- g_signal_handler_disconnect (G_OBJECT (eti->table_model),
- eti->table_model_row_change_id);
- g_signal_handler_disconnect (G_OBJECT (eti->table_model),
- eti->table_model_cell_change_id);
- g_signal_handler_disconnect (G_OBJECT (eti->table_model),
- eti->table_model_rows_inserted_id);
- g_signal_handler_disconnect (G_OBJECT (eti->table_model),
- eti->table_model_rows_deleted_id);
- g_object_unref (eti->table_model);
- if (eti->source_model)
- g_object_unref (eti->source_model);
-
- eti->table_model_pre_change_id = 0;
- eti->table_model_no_change_id = 0;
- eti->table_model_change_id = 0;
- eti->table_model_row_change_id = 0;
- eti->table_model_cell_change_id = 0;
- eti->table_model_rows_inserted_id = 0;
- eti->table_model_rows_deleted_id = 0;
- eti->table_model = NULL;
- eti->source_model = NULL;
- eti->uses_source_model = 0;
-}
-
-/*
- * eti_remove_table_model:
- *
- * Invoked to release the table model associated with this ETableItem
- */
-static void
-eti_remove_selection_model (ETableItem *eti)
-{
- if (!eti->selection)
- return;
-
- g_signal_handler_disconnect (eti->selection,
- eti->selection_change_id);
- g_signal_handler_disconnect (eti->selection,
- eti->selection_row_change_id);
- g_signal_handler_disconnect (eti->selection,
- eti->cursor_change_id);
- g_signal_handler_disconnect (eti->selection,
- eti->cursor_activated_id);
- g_object_unref (eti->selection);
-
- eti->selection_change_id = 0;
- eti->selection_row_change_id = 0;
- eti->cursor_activated_id = 0;
- eti->selection = NULL;
-}
-
-/*
- * eti_remove_header_model:
- *
- * Invoked to release the header model associated with this ETableItem
- */
-static void
-eti_remove_header_model (ETableItem *eti)
-{
- if (!eti->header)
- return;
-
- g_signal_handler_disconnect (G_OBJECT (eti->header),
- eti->header_structure_change_id);
- g_signal_handler_disconnect (G_OBJECT (eti->header),
- eti->header_dim_change_id);
- g_signal_handler_disconnect (G_OBJECT (eti->header),
- eti->header_request_width_id);
-
- if (eti->cell_views){
- eti_unrealize_cell_views (eti);
- eti_detach_cell_views (eti);
- }
- g_object_unref (eti->header);
-
-
- eti->header_structure_change_id = 0;
- eti->header_dim_change_id = 0;
- eti->header_request_width_id = 0;
- eti->header = NULL;
-}
-
-/*
- * eti_row_height_real:
- *
- * Returns the height used by row @row. This does not include the one-pixel
- * used as a separator between rows
- */
-static int
-eti_row_height_real (ETableItem *eti, int row)
-{
- const int cols = e_table_header_count (eti->header);
- int col;
- int h, max_h;
-
- g_assert (cols == 0 || eti->cell_views);
-
- max_h = 0;
-
- for (col = 0; col < cols; col++){
- h = e_cell_height (eti->cell_views [col], view_to_model_col(eti, col), col, row);
-
- if (h > max_h)
- max_h = h;
- }
- return max_h;
-}
-
-static void
-confirm_height_cache (ETableItem *eti)
-{
- int i;
-
- if (eti->uniform_row_height || eti->height_cache)
- return;
- eti->height_cache = g_new(int, eti->rows);
- for (i = 0; i < eti->rows; i++) {
- eti->height_cache[i] = -1;
- }
-}
-
-static gboolean
-height_cache_idle(ETableItem *eti)
-{
- int changed = 0;
- int i;
- confirm_height_cache(eti);
- for (i = eti->height_cache_idle_count; i < eti->rows; i++) {
- if (eti->height_cache[i] == -1) {
- eti_row_height(eti, i);
- changed ++;
- if (changed >= 20)
- break;
- }
- }
- if (changed >= 20) {
- eti->height_cache_idle_count = i;
- return TRUE;
- }
- eti->height_cache_idle_id = 0;
- return FALSE;
-}
-
-static void
-free_height_cache (ETableItem *eti)
-{
- if (GNOME_CANVAS_ITEM_REALIZED & GTK_OBJECT_FLAGS (eti)) {
- if (eti->height_cache)
- g_free (eti->height_cache);
- eti->height_cache = NULL;
- eti->height_cache_idle_count = 0;
- eti->uniform_row_height_cache = -1;
-
- if (eti->uniform_row_height && eti->height_cache_idle_id != 0) {
- g_source_remove(eti->height_cache_idle_id);
- eti->height_cache_idle_id = 0;
- }
-
- if ((!eti->uniform_row_height) && eti->height_cache_idle_id == 0)
- eti->height_cache_idle_id = g_idle_add_full(G_PRIORITY_LOW, (GSourceFunc) height_cache_idle, eti, NULL);
- }
-}
-
-static void
-calculate_height_cache (ETableItem *eti)
-{
- free_height_cache(eti);
- confirm_height_cache(eti);
-}
-
-
-/*
- * eti_row_height:
- *
- * Returns the height used by row @row. This does not include the one-pixel
- * used as a separator between rows
- */
-static int
-eti_row_height (ETableItem *eti, int row)
-{
- if (eti->uniform_row_height) {
- eti->uniform_row_height_cache = eti_row_height_real (eti, -1);
- return eti->uniform_row_height_cache;
- } else {
- if (!eti->height_cache) {
- calculate_height_cache (eti);
- }
- if (eti->height_cache[row] == -1) {
- eti->height_cache[row] = eti_row_height_real(eti, row);
- if (row > 0 &&
- eti->length_threshold != -1 &&
- eti->rows > eti->length_threshold &&
- eti->height_cache[row] != eti_row_height(eti, 0)) {
- eti->needs_compute_height = 1;
- e_canvas_item_request_reflow(GNOME_CANVAS_ITEM(eti));
- }
- }
- return eti->height_cache[row];
- }
-}
-
-/*
- * eti_get_height:
- *
- * Returns the height of the ETableItem.
- *
- * The ETableItem might compute the whole height by asking every row its
- * size. There is a special mode (designed to work when there are too
- * many rows in the table that performing the previous step could take
- * too long) set by the ETableItem->length_threshold that would determine
- * when the height is computed by using the first row as the size for
- * every other row in the ETableItem.
- */
-static int
-eti_get_height (ETableItem *eti)
-{
- const int rows = eti->rows;
- int height_extra = eti->horizontal_draw_grid ? 1 : 0;
-
- if (rows == 0)
- return 0;
-
- if (eti->uniform_row_height) {
- int row_height = eti_row_height(eti, -1);
- return ((row_height + height_extra) * rows + height_extra);
- } else {
- int height;
- int row;
- if (eti->length_threshold != -1){
- if (rows > eti->length_threshold){
- int row_height = eti_row_height(eti, 0);
- if (eti->height_cache) {
- height = 0;
- for (row = 0; row < rows; row++) {
- if (eti->height_cache[row] == -1) {
- height += (row_height + height_extra) * (rows - row);
- break;
- }
- else
- height += eti->height_cache[row] + height_extra;
- }
- } else
- height = (eti_row_height (eti, 0) + height_extra) * rows;
-
- /*
- * 1 pixel at the top
- */
- return height + height_extra;
- }
- }
-
- height = height_extra;
- for (row = 0; row < rows; row++)
- height += eti_row_height (eti, row) + height_extra;
-
- return height;
- }
-}
-
-static void
-eti_item_region_redraw (ETableItem *eti, int x0, int y0, int x1, int y1)
-{
- GnomeCanvasItem *item = GNOME_CANVAS_ITEM (eti);
- ArtDRect rect;
- double i2c [6];
-
- rect.x0 = x0;
- rect.y0 = y0;
- rect.x1 = x1;
- rect.y1 = y1;
-
- gnome_canvas_item_i2c_affine (item, i2c);
- art_drect_affine_transform (&rect, &rect, i2c);
-
- gnome_canvas_request_redraw (item->canvas, rect.x0, rect.y0, rect.x1, rect.y1);
-}
-
-/*
- * Computes the distance between @start_row and @end_row in pixels
- */
-int
-e_table_item_row_diff (ETableItem *eti, int start_row, int end_row)
-{
- int height_extra = eti->horizontal_draw_grid ? 1 : 0;
-
- if (start_row < 0)
- start_row = 0;
- if (end_row > eti->rows)
- end_row = eti->rows;
-
- if (eti->uniform_row_height) {
- return ((end_row - start_row) * (eti_row_height(eti, -1) + height_extra));
- } else {
- int row, total;
- total = 0;
- for (row = start_row; row < end_row; row++)
- total += eti_row_height (eti, row) + height_extra;
-
- return total;
- }
-}
-
-static void
-eti_get_region (ETableItem *eti,
- int start_col, int start_row,
- int end_col, int end_row,
- int *x1p, int *y1p,
- int *x2p, int *y2p)
-{
- int x1, y1, x2, y2;
-
- x1 = e_table_header_col_diff (eti->header, 0, start_col);
- y1 = e_table_item_row_diff (eti, 0, start_row);
- x2 = x1 + e_table_header_col_diff (eti->header, start_col, end_col + 1);
- y2 = y1 + e_table_item_row_diff (eti, start_row, end_row + 1);
- if (x1p)
- *x1p = x1;
- if (y1p)
- *y1p = y1;
- if (x2p)
- *x2p = x2;
- if (y2p)
- *y2p = y2;
-}
-
-/*
- * eti_request_region_redraw:
- *
- * Request a canvas redraw on the range (start_col, start_row) to (end_col, end_row).
- * This is inclusive (ie, you can use: 0,0-0,0 to redraw the first cell).
- *
- * The @border argument is a number of pixels around the region that should also be queued
- * for redraw. This is typically used by the focus routines to queue a redraw for the
- * border as well.
- */
-static void
-eti_request_region_redraw (ETableItem *eti,
- int start_col, int start_row,
- int end_col, int end_row, int border)
-{
- int x1, y1, x2, y2;
-
- if (eti->rows > 0) {
-
- eti_get_region (eti,
- start_col, start_row,
- end_col, end_row,
- &x1, &y1, &x2, &y2);
-
- eti_item_region_redraw (eti, eti->x1 + x1 - border,
- eti->y1 + y1 - border,
- eti->x1 + x2 + 1 + border,
- eti->y1 + y2 + 1 + border);
- }
-}
-
-/*
- * eti_request_region_show
- *
- * Request a canvas show on the range (start_col, start_row) to (end_col, end_row).
- * This is inclusive (ie, you can use: 0,0-0,0 to show the first cell).
- */
-static void
-eti_request_region_show (ETableItem *eti,
- int start_col, int start_row,
- int end_col, int end_row, int delay)
-{
- int x1, y1, x2, y2;
-
- eti_get_region (eti,
- start_col, start_row,
- end_col, end_row,
- &x1, &y1, &x2, &y2);
-
- if (delay)
- e_canvas_item_show_area_delayed(GNOME_CANVAS_ITEM(eti), x1, y1, x2, y2, delay);
- else
- e_canvas_item_show_area(GNOME_CANVAS_ITEM(eti), x1, y1, x2, y2);
-}
-
-static void
-eti_show_cursor (ETableItem *eti, int delay)
-{
- int cursor_row;
-
- if (!((GTK_OBJECT_FLAGS(eti) & GNOME_CANVAS_ITEM_REALIZED) && eti->cell_views_realized))
- return;
-
- if (eti->frozen_count > 0) {
- eti->queue_show_cursor = TRUE;
- return;
- }
-
-#if 0
- g_object_get(eti->selection,
- "cursor_row", &cursor_row,
- NULL);
-#else
- cursor_row = e_selection_model_cursor_row (eti->selection);
-#endif
-
- d(g_print ("%s: cursor row: %d\n", __FUNCTION__, cursor_row));
-
- if (cursor_row != -1) {
- cursor_row = model_to_view_row (eti, cursor_row);
- eti_request_region_show (eti,
- 0, cursor_row, eti->cols - 1, cursor_row,
- delay);
- }
-}
-
-static void
-eti_check_cursor_on_screen (ETableItem *eti)
-{
- if (eti->cursor_x1 == -1 ||
- eti->cursor_y1 == -1 ||
- eti->cursor_x2 == -1 ||
- eti->cursor_y2 == -1)
- return;
-
- eti->cursor_on_screen = e_canvas_item_area_shown (GNOME_CANVAS_ITEM(eti),
- eti->cursor_x1,
- eti->cursor_y1,
- eti->cursor_x2,
- eti->cursor_y2);
-
- d(g_print ("%s: cursor on screen: %s\n", __FUNCTION__, eti->cursor_on_screen ? "TRUE" : "FALSE"));
-}
-
-static void
-eti_check_cursor_bounds (ETableItem *eti)
-{
- int x1, y1, x2, y2;
- int cursor_row;
-
- if (!((GTK_OBJECT_FLAGS(eti) & GNOME_CANVAS_ITEM_REALIZED) && eti->cell_views_realized))
- return;
-
- if (eti->frozen_count > 0) {
- return;
- }
-
- if (!((GTK_OBJECT_FLAGS(eti) & GNOME_CANVAS_ITEM_REALIZED) && eti->cell_views_realized))
- return;
-
- if (eti->frozen_count > 0) {
- return;
- }
-
- g_object_get(eti->selection,
- "cursor_row", &cursor_row,
- NULL);
-
- if (cursor_row == -1) {
- eti->cursor_x1 = -1;
- eti->cursor_y1 = -1;
- eti->cursor_x2 = -1;
- eti->cursor_y2 = -1;
- eti->cursor_on_screen = TRUE;
- return;
- }
-
- d(g_print ("%s: model cursor row: %d\n", __FUNCTION__, cursor_row));
-
- cursor_row = model_to_view_row (eti, cursor_row);
-
- d(g_print ("%s: cursor row: %d\n", __FUNCTION__, cursor_row));
-
- eti_get_region (eti,
- 0, cursor_row, eti->cols - 1, cursor_row,
- &x1, &y1, &x2, &y2);
- eti->cursor_x1 = x1;
- eti->cursor_y1 = y1;
- eti->cursor_x2 = x2;
- eti->cursor_y2 = y2;
- eti->cursor_on_screen = e_canvas_item_area_shown (GNOME_CANVAS_ITEM(eti), x1, y1, x2, y2);
-
- d(g_print ("%s: cursor on screen: %s\n", __FUNCTION__, eti->cursor_on_screen ? "TRUE" : "FALSE"));
-}
-
-static void
-eti_maybe_show_cursor(ETableItem *eti, int delay)
-{
- d(g_print ("%s: cursor on screen: %s\n", __FUNCTION__, eti->cursor_on_screen ? "TRUE" : "FALSE"));
- if (eti->cursor_on_screen)
- eti_show_cursor (eti, delay);
- eti_check_cursor_bounds (eti);
-}
-
-static gboolean
-eti_idle_show_cursor_cb (gpointer data)
-{
- ETableItem *eti = data;
-
- if (eti->selection) {
- eti_show_cursor (eti, 0);
- eti_check_cursor_bounds (eti);
- }
-
- eti->cursor_idle_id = 0;
- g_object_unref (eti);
- return FALSE;
-}
-
-static void
-eti_idle_maybe_show_cursor(ETableItem *eti)
-{
- d(g_print ("%s: cursor on screen: %s\n", __FUNCTION__, eti->cursor_on_screen ? "TRUE" : "FALSE"));
- if (eti->cursor_on_screen) {
- g_object_ref (eti);
- if (!eti->cursor_idle_id)
- eti->cursor_idle_id = g_idle_add (eti_idle_show_cursor_cb, eti);
- }
-}
-
-static void
-eti_cancel_drag_due_to_model_change (ETableItem *eti)
-{
- if (eti->maybe_in_drag) {
- eti->maybe_in_drag = FALSE;
- if (!eti->maybe_did_something)
- e_selection_model_do_something(E_SELECTION_MODEL (eti->selection), eti->drag_row, eti->drag_col, eti->drag_state);
- }
- if (eti->in_drag) {
- eti->in_drag = FALSE;
- }
-}
-
-static void
-eti_freeze (ETableItem *eti)
-{
- eti->frozen_count ++;
- d(g_print ("%s: %d\n", __FUNCTION__, eti->frozen_count));
-}
-
-static void
-eti_unfreeze (ETableItem *eti)
-{
- g_return_if_fail (eti->frozen_count > 0);
- eti->frozen_count --;
- d(g_print ("%s: %d\n", __FUNCTION__, eti->frozen_count));
- if (eti->frozen_count == 0 && eti->queue_show_cursor) {
- eti_show_cursor (eti, 0);
- eti_check_cursor_bounds (eti);
- eti->queue_show_cursor = FALSE;
- }
-}
-
-/*
- * Callback routine: invoked before the ETableModel suffers a change
- */
-static void
-eti_table_model_pre_change (ETableModel *table_model, ETableItem *eti)
-{
- eti_cancel_drag_due_to_model_change (eti);
- eti_check_cursor_bounds (eti);
- if (eti_editing (eti))
- e_table_item_leave_edit_(eti);
- eti_freeze (eti);
-}
-
-/*
- * Callback routine: invoked when the ETableModel has not suffered a change
- */
-static void
-eti_table_model_no_change (ETableModel *table_model, ETableItem *eti)
-{
- eti_unfreeze (eti);
-}
-
-/*
- * Callback routine: invoked when the ETableModel has suffered a change
- */
-
-static void
-eti_table_model_changed (ETableModel *table_model, ETableItem *eti)
-{
- if (!(GTK_OBJECT_FLAGS(eti) & GNOME_CANVAS_ITEM_REALIZED)) {
- eti_unfreeze (eti);
- return;
- }
-
- eti->rows = e_table_model_row_count (eti->table_model);
-
- free_height_cache(eti);
-
- eti_unfreeze (eti);
-
- eti->needs_compute_height = 1;
- e_canvas_item_request_reflow (GNOME_CANVAS_ITEM (eti));
- eti->needs_redraw = 1;
- gnome_canvas_item_request_update (GNOME_CANVAS_ITEM (eti));
-
- eti_idle_maybe_show_cursor(eti);
-}
-
-static void
-eti_table_model_row_changed (ETableModel *table_model, int row, ETableItem *eti)
-{
- if (!(GTK_OBJECT_FLAGS(eti) & GNOME_CANVAS_ITEM_REALIZED)) {
- eti_unfreeze (eti);
- return;
- }
-
- if ((!eti->uniform_row_height) && eti->height_cache && eti->height_cache[row] != -1 && eti_row_height_real(eti, row) != eti->height_cache[row]) {
- eti_table_model_changed (table_model, eti);
- return;
- }
-
- eti_unfreeze (eti);
-
- e_table_item_redraw_row (eti, row);
-}
-
-static void
-eti_table_model_cell_changed (ETableModel *table_model, int col, int row, ETableItem *eti)
-{
- if (!(GTK_OBJECT_FLAGS(eti) & GNOME_CANVAS_ITEM_REALIZED)) {
- eti_unfreeze (eti);
- return;
- }
-
- if ((!eti->uniform_row_height) && eti->height_cache && eti->height_cache[row] != -1 && eti_row_height_real(eti, row) != eti->height_cache[row]) {
- eti_table_model_changed (table_model, eti);
- return;
- }
-
- eti_unfreeze (eti);
-
- e_table_item_redraw_row (eti, row);
-}
-
-static void
-eti_table_model_rows_inserted (ETableModel *table_model, int row, int count, ETableItem *eti)
-{
- if (!(GTK_OBJECT_FLAGS(eti) & GNOME_CANVAS_ITEM_REALIZED)) {
- eti_unfreeze (eti);
- return;
- }
- eti->rows = e_table_model_row_count (eti->table_model);
-
- if (eti->height_cache) {
- int i;
- eti->height_cache = g_renew(int, eti->height_cache, eti->rows);
- memmove(eti->height_cache + row + count, eti->height_cache + row, (eti->rows - count - row) * sizeof(int));
- for (i = row; i < row + count; i++)
- eti->height_cache[i] = -1;
- }
-
- eti_unfreeze (eti);
-
- eti_idle_maybe_show_cursor(eti);
-
- eti->needs_compute_height = 1;
- e_canvas_item_request_reflow (GNOME_CANVAS_ITEM (eti));
- eti->needs_redraw = 1;
- gnome_canvas_item_request_update (GNOME_CANVAS_ITEM (eti));
-}
-
-static void
-eti_table_model_rows_deleted (ETableModel *table_model, int row, int count, ETableItem *eti)
-{
- if (!(GTK_OBJECT_FLAGS(eti) & GNOME_CANVAS_ITEM_REALIZED)) {
- eti_unfreeze (eti);
- return;
- }
-
- eti->rows = e_table_model_row_count (eti->table_model);
-
- if (eti->height_cache && (eti->rows > row)) {
- memmove(eti->height_cache + row, eti->height_cache + row + count, (eti->rows - row) * sizeof(int));
- }
-
- eti_unfreeze (eti);
-
- eti_idle_maybe_show_cursor(eti);
-
- eti->needs_compute_height = 1;
- e_canvas_item_request_reflow (GNOME_CANVAS_ITEM (eti));
- eti->needs_redraw = 1;
- gnome_canvas_item_request_update (GNOME_CANVAS_ITEM (eti));
-}
-
-/**
- * e_table_item_redraw_range
- * @eti: %ETableItem which will be redrawn
- * @start_col: The first col to redraw.
- * @start_row: The first row to redraw.
- * @end_col: The last col to redraw.
- * @end_row: The last row to redraw.
- *
- * This routine redraws the given %ETableItem in the range given. The
- * range is inclusive at both ends.
- */
-void
-e_table_item_redraw_range (ETableItem *eti,
- int start_col, int start_row,
- int end_col, int end_row)
-{
- int border;
- int cursor_col, cursor_row;
-
- g_return_if_fail (eti != NULL);
- g_return_if_fail (E_IS_TABLE_ITEM (eti));
-
- g_object_get(eti->selection,
- "cursor_col", &cursor_col,
- "cursor_row", &cursor_row,
- NULL);
-
- if ((start_col == cursor_col) ||
- (end_col == cursor_col) ||
- (view_to_model_row(eti, start_row) == cursor_row) ||
- (view_to_model_row(eti, end_row) == cursor_row))
- border = 2;
- else
- border = 0;
-
- eti_request_region_redraw(eti, start_col, start_row, end_col, end_row, border);
-}
-
-static void
-e_table_item_redraw_row (ETableItem *eti,
- int row)
-{
- if (row != -1)
- e_table_item_redraw_range (eti, 0, row, eti->cols - 1, row);
-}
-
-static void
-eti_add_table_model (ETableItem *eti, ETableModel *table_model)
-{
- g_assert (eti->table_model == NULL);
-
- eti->table_model = table_model;
- g_object_ref (eti->table_model);
-
- eti->table_model_pre_change_id = g_signal_connect (
- G_OBJECT (table_model), "model_pre_change",
- G_CALLBACK (eti_table_model_pre_change), eti);
-
- eti->table_model_no_change_id = g_signal_connect (
- G_OBJECT (table_model), "model_no_change",
- G_CALLBACK (eti_table_model_no_change), eti);
-
- eti->table_model_change_id = g_signal_connect (
- G_OBJECT (table_model), "model_changed",
- G_CALLBACK (eti_table_model_changed), eti);
-
- eti->table_model_row_change_id = g_signal_connect (
- G_OBJECT (table_model), "model_row_changed",
- G_CALLBACK (eti_table_model_row_changed), eti);
-
- eti->table_model_cell_change_id = g_signal_connect (
- G_OBJECT (table_model), "model_cell_changed",
- G_CALLBACK (eti_table_model_cell_changed), eti);
-
- eti->table_model_rows_inserted_id = g_signal_connect (
- G_OBJECT (table_model), "model_rows_inserted",
- G_CALLBACK (eti_table_model_rows_inserted), eti);
-
- eti->table_model_rows_deleted_id = g_signal_connect (
- G_OBJECT (table_model), "model_rows_deleted",
- G_CALLBACK (eti_table_model_rows_deleted), eti);
-
- if (eti->header) {
- eti_detach_cell_views (eti);
- eti_attach_cell_views (eti);
- }
-
- if (E_IS_TABLE_SUBSET(table_model)) {
- eti->uses_source_model = 1;
- eti->source_model = E_TABLE_SUBSET(table_model)->source;
- if (eti->source_model)
- g_object_ref(eti->source_model);
- }
-
- eti_freeze (eti);
-
- eti_table_model_changed (table_model, eti);
-}
-
-static void
-eti_add_selection_model (ETableItem *eti, ESelectionModel *selection)
-{
- g_assert (eti->selection == NULL);
-
- eti->selection = selection;
- g_object_ref (eti->selection);
-
- eti->selection_change_id = g_signal_connect (
- selection, "selection_changed",
- G_CALLBACK (eti_selection_change), eti);
-
- eti->selection_row_change_id = g_signal_connect (
- selection, "selection_row_changed",
- G_CALLBACK (eti_selection_row_change), eti);
-
- eti->cursor_change_id = g_signal_connect (
- selection, "cursor_changed",
- G_CALLBACK (eti_cursor_change), eti);
-
- eti->cursor_activated_id = g_signal_connect (
- selection, "cursor_activated",
- G_CALLBACK (eti_cursor_activated), eti);
-
- eti_selection_change(selection, eti);
-}
-
-static void
-eti_header_dim_changed (ETableHeader *eth, int col, ETableItem *eti)
-{
- eti->needs_compute_width = 1;
- e_canvas_item_request_reflow (GNOME_CANVAS_ITEM (eti));
- eti->needs_redraw = 1;
- gnome_canvas_item_request_update (GNOME_CANVAS_ITEM (eti));
-}
-
-static void
-eti_header_structure_changed (ETableHeader *eth, ETableItem *eti)
-{
- eti->cols = e_table_header_count (eti->header);
-
- /*
- * There should be at least one column
- * BUT: then you can't remove all columns from a header and add new ones.
- */
- /*g_assert (eti->cols != 0);*/
-
- if (eti->cell_views){
- eti_unrealize_cell_views (eti);
- eti_detach_cell_views (eti);
- eti_attach_cell_views (eti);
- eti_realize_cell_views (eti);
- } else {
- if (eti->table_model) {
- eti_attach_cell_views (eti);
- eti_realize_cell_views (eti);
- }
- }
- eti->needs_compute_width = 1;
- e_canvas_item_request_reflow (GNOME_CANVAS_ITEM (eti));
- eti->needs_redraw = 1;
- gnome_canvas_item_request_update (GNOME_CANVAS_ITEM (eti));
-}
-
-static int
-eti_request_column_width (ETableHeader *eth, int col, ETableItem *eti)
-{
- int width = 0;
-
- if (eti->cell_views && eti->cell_views_realized) {
- width = e_cell_max_width (eti->cell_views[col], view_to_model_col(eti, col), col);
- }
-
- return width;
-}
-
-static void
-eti_add_header_model (ETableItem *eti, ETableHeader *header)
-{
- g_assert (eti->header == NULL);
-
- eti->header = header;
- g_object_ref (header);
-
- eti_header_structure_changed (header, eti);
-
- eti->header_dim_change_id = g_signal_connect (
- G_OBJECT (header), "dimension_change",
- G_CALLBACK (eti_header_dim_changed), eti);
-
- eti->header_structure_change_id = g_signal_connect (
- G_OBJECT (header), "structure_change",
- G_CALLBACK (eti_header_structure_changed), eti);
-
- eti->header_request_width_id = g_signal_connect
- (G_OBJECT (header), "request_width",
- G_CALLBACK (eti_request_column_width), eti);
-}
-
-/*
- * GObject::dispose method
- */
-static void
-eti_dispose (GObject *object)
-{
- ETableItem *eti = E_TABLE_ITEM (object);
-
- eti_remove_header_model (eti);
- eti_remove_table_model (eti);
- eti_remove_selection_model (eti);
-
- if (eti->height_cache_idle_id) {
- g_source_remove(eti->height_cache_idle_id);
- eti->height_cache_idle_id = 0;
- }
- eti->height_cache_idle_count = 0;
-
- if (eti->cursor_idle_id) {
- g_source_remove(eti->cursor_idle_id);
- eti->cursor_idle_id = 0;
- }
-
- if (eti->height_cache)
- g_free (eti->height_cache);
- eti->height_cache = NULL;
-
- e_canvas_hide_tooltip (E_CANVAS(GNOME_CANVAS_ITEM(eti)->canvas));
- if (eti->tooltip) {
- if (eti->tooltip->background)
- gdk_color_free (eti->tooltip->background);
- eti->tooltip->background = NULL;
-
- if (eti->tooltip->foreground)
- gdk_color_free (eti->tooltip->foreground);
- eti->tooltip->foreground = NULL;
-
- if (eti->tooltip->timer) {
- gtk_timeout_remove (eti->tooltip->timer);
- eti->tooltip->timer = 0;
- }
- g_free (eti->tooltip);
- eti->tooltip = NULL;
- }
-
- if (G_OBJECT_CLASS (eti_parent_class)->dispose)
- (*G_OBJECT_CLASS (eti_parent_class)->dispose) (object);
-}
-
-static void
-eti_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec)
-{
- GnomeCanvasItem *item;
- ETableItem *eti;
- int cursor_col;
-
- item = GNOME_CANVAS_ITEM (object);
- eti = E_TABLE_ITEM (object);
-
- switch (prop_id){
- case PROP_TABLE_HEADER:
- eti_remove_header_model (eti);
- eti_add_header_model (eti, E_TABLE_HEADER(g_value_get_object (value)));
- break;
-
- case PROP_TABLE_MODEL:
- eti_remove_table_model (eti);
- eti_add_table_model (eti, E_TABLE_MODEL(g_value_get_object (value)));
- break;
-
- case PROP_SELECTION_MODEL:
- eti_remove_selection_model (eti);
- if (g_value_get_object (value))
- eti_add_selection_model (eti, E_SELECTION_MODEL(g_value_get_object(value)));
- break;
-
- case PROP_LENGTH_THRESHOLD:
- eti->length_threshold = g_value_get_int (value);
- break;
-
- case PROP_TABLE_ALTERNATING_ROW_COLORS:
- eti->alternating_row_colors = g_value_get_boolean (value);
- break;
-
- case PROP_TABLE_HORIZONTAL_DRAW_GRID:
- eti->horizontal_draw_grid = g_value_get_boolean (value);
- break;
-
- case PROP_TABLE_VERTICAL_DRAW_GRID:
- eti->vertical_draw_grid = g_value_get_boolean (value);
- break;
-
- case PROP_TABLE_DRAW_FOCUS:
- eti->draw_focus = g_value_get_boolean (value);
- break;
-
- case PROP_CURSOR_MODE:
- eti->cursor_mode = g_value_get_int (value);
- break;
-
- case PROP_MINIMUM_WIDTH:
- case PROP_WIDTH:
- if ((eti->minimum_width == eti->width && g_value_get_double(value) > eti->width) ||
- g_value_get_double(value) < eti->width) {
- eti->needs_compute_width = 1;
- e_canvas_item_request_reflow (GNOME_CANVAS_ITEM(eti));
- }
- eti->minimum_width = g_value_get_double (value);
- break;
- case PROP_CURSOR_ROW:
- g_object_get(eti->selection,
- "cursor_col", &cursor_col,
- NULL);
-
- e_table_item_focus (eti, cursor_col != -1 ? cursor_col : 0, view_to_model_row(eti, g_value_get_int (value)), 0);
- break;
- case PROP_UNIFORM_ROW_HEIGHT:
- if (eti->uniform_row_height != g_value_get_boolean (value)) {
- eti->uniform_row_height = g_value_get_boolean (value);
- if (GTK_OBJECT_FLAGS(eti) & GNOME_CANVAS_ITEM_REALIZED) {
- free_height_cache(eti);
- eti->needs_compute_height = 1;
- e_canvas_item_request_reflow (GNOME_CANVAS_ITEM (eti));
- eti->needs_redraw = 1;
- gnome_canvas_item_request_update (GNOME_CANVAS_ITEM (eti));
- }
- }
- break;
- }
- eti->needs_redraw = 1;
- gnome_canvas_item_request_update (GNOME_CANVAS_ITEM(eti));
-}
-
-static void
-eti_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec)
-{
- GnomeCanvasItem *item;
- ETableItem *eti;
- int row;
-
- item = GNOME_CANVAS_ITEM (object);
- eti = E_TABLE_ITEM (object);
-
- switch (prop_id){
- case PROP_WIDTH:
- g_value_set_double (value, eti->width);
- break;
- case PROP_HEIGHT:
- g_value_set_double (value, eti->height);
- break;
- case PROP_MINIMUM_WIDTH:
- g_value_set_double (value, eti->minimum_width);
- break;
- case PROP_CURSOR_ROW:
- g_object_get(eti->selection,
- "cursor_row", &row,
- NULL);
- g_value_set_int (value, model_to_view_row(eti, row));
- break;
- case PROP_UNIFORM_ROW_HEIGHT:
- g_value_set_boolean (value, eti->uniform_row_height);
- break;
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
- break;
- }
-}
-
-static void
-eti_init (GnomeCanvasItem *item)
-{
- ETableItem *eti = E_TABLE_ITEM (item);
-
- eti->editing_col = -1;
- eti->editing_row = -1;
- eti->height = 0;
- eti->width = 0;
- eti->minimum_width = 0;
-
- eti->save_col = -1;
- eti->save_row = -1;
- eti->save_state = NULL;
-
- eti->click_count = 0;
-
- eti->height_cache = NULL;
- eti->height_cache_idle_id = 0;
- eti->height_cache_idle_count = 0;
-
- eti->length_threshold = -1;
- eti->uniform_row_height = FALSE;
-
- eti->uses_source_model = 0;
- eti->source_model = NULL;
-
- eti->row_guess = -1;
- eti->cursor_mode = E_CURSOR_SIMPLE;
-
- eti->selection_change_id = 0;
- eti->selection_row_change_id = 0;
- eti->cursor_change_id = 0;
- eti->cursor_activated_id = 0;
- eti->selection = NULL;
-
- eti->old_cursor_row = -1;
-
- eti->needs_redraw = 0;
- eti->needs_compute_height = 0;
-
- eti->in_key_press = 0;
-
- eti->tooltip = g_new0 (ETableTooltip, 1);
- eti->tooltip->timer = 0;
- eti->tooltip->eti = GNOME_CANVAS_ITEM (eti);
- eti->tooltip->background = NULL;
- eti->tooltip->foreground = NULL;
-
- eti->maybe_did_something = TRUE;
-
- eti->grabbed_count = 0;
- eti->gtk_grabbed = 0;
-
- eti->in_drag = 0;
- eti->maybe_in_drag = 0;
- eti->grabbed = 0;
-
- eti->grabbed_col = -1;
- eti->grabbed_row = -1;
-
- eti->cursor_on_screen = FALSE;
- eti->cursor_x1 = -1;
- eti->cursor_y1 = -1;
- eti->cursor_x2 = -1;
- eti->cursor_y2 = -1;
-
- eti->rows = -1;
-
- eti->frozen_count = 0;
- eti->queue_show_cursor = FALSE;
-
- e_canvas_item_set_reflow_callback (GNOME_CANVAS_ITEM (eti), eti_reflow);
-}
-
-#define gray50_width 2
-#define gray50_height 2
-static const char gray50_bits[] = {
- 0x02, 0x01, };
-
-static void
-adjustment_changed (GtkAdjustment *adjustment, ETableItem *eti)
-{
- eti_check_cursor_on_screen (eti);
-}
-
-static void
-eti_realize (GnomeCanvasItem *item)
-{
- ETableItem *eti = E_TABLE_ITEM (item);
- GtkWidget *canvas_widget = GTK_WIDGET (item->canvas);
- GdkWindow *window;
-
- if (GNOME_CANVAS_ITEM_CLASS (eti_parent_class)->realize)
- (*GNOME_CANVAS_ITEM_CLASS (eti_parent_class)->realize)(item);
-
-
- eti->rows = e_table_model_row_count (eti->table_model);
-
- /*
- * Gdk Resource allocation
- */
- window = canvas_widget->window;
-
- eti->fill_gc = gdk_gc_new (window);
-
- eti->grid_gc = gdk_gc_new (window);
- gdk_gc_set_foreground (eti->grid_gc, &canvas_widget->style->dark [GTK_STATE_NORMAL]);
- eti->focus_gc = gdk_gc_new (window);
- gdk_gc_set_foreground (eti->focus_gc, &canvas_widget->style->bg [GTK_STATE_NORMAL]);
- gdk_gc_set_background (eti->focus_gc, &canvas_widget->style->fg [GTK_STATE_NORMAL]);
- eti->stipple = gdk_bitmap_create_from_data (NULL, gray50_bits, gray50_width, gray50_height);
- gdk_gc_set_ts_origin (eti->focus_gc, 0, 0);
- gdk_gc_set_stipple (eti->focus_gc, eti->stipple);
- gdk_gc_set_fill (eti->focus_gc, GDK_OPAQUE_STIPPLED);
-
- eti->hadjustment_change_id =
- g_signal_connect (gtk_layout_get_hadjustment(GTK_LAYOUT(item->canvas)), "changed",
- G_CALLBACK (adjustment_changed), eti);
- eti->hadjustment_value_change_id =
- g_signal_connect (gtk_layout_get_hadjustment(GTK_LAYOUT(item->canvas)), "value_changed",
- G_CALLBACK (adjustment_changed), eti);
- eti->vadjustment_change_id =
- g_signal_connect (gtk_layout_get_vadjustment(GTK_LAYOUT(item->canvas)), "changed",
- G_CALLBACK (adjustment_changed), eti);
- eti->vadjustment_value_change_id =
- g_signal_connect (gtk_layout_get_vadjustment(GTK_LAYOUT(item->canvas)), "value_changed",
- G_CALLBACK (adjustment_changed), eti);
-
- if (eti->cell_views == NULL)
- eti_attach_cell_views (eti);
-
- eti_realize_cell_views (eti);
-
- free_height_cache(eti);
-
- if (item->canvas->focused_item == NULL && eti->selection) {
- int row;
-
- row = e_selection_model_cursor_row (E_SELECTION_MODEL (eti->selection));
- row = model_to_view_row(eti, row);
- if (row != -1) {
- e_canvas_item_grab_focus (item, FALSE);
- eti_show_cursor (eti, 0);
- eti_check_cursor_bounds (eti);
- }
- }
-
- eti->needs_compute_height = 1;
- eti->needs_compute_width = 1;
- e_canvas_item_request_reflow (GNOME_CANVAS_ITEM (eti));
- eti->needs_redraw = 1;
- gnome_canvas_item_request_update (GNOME_CANVAS_ITEM (eti));
-}
-
-static void
-eti_unrealize (GnomeCanvasItem *item)
-{
- ETableItem *eti = E_TABLE_ITEM (item);
-
- if (eti->grabbed_count > 0) {
- d(g_print ("%s: eti_ungrab\n", __FUNCTION__));
- eti_ungrab (eti, -1);
- }
-
- if (eti_editing (eti))
- e_table_item_leave_edit_(eti);
-
- if (eti->height_cache_idle_id) {
- g_source_remove(eti->height_cache_idle_id);
- eti->height_cache_idle_id = 0;
- }
-
- if (eti->height_cache)
- g_free (eti->height_cache);
- eti->height_cache = NULL;
- eti->height_cache_idle_count = 0;
-
- e_canvas_hide_tooltip (E_CANVAS(GNOME_CANVAS_ITEM(eti)->canvas));
- if (eti->tooltip) {
- if (eti->tooltip->background) {
- gdk_color_free (eti->tooltip->background);
- eti->tooltip->background = NULL;
- }
- if (eti->tooltip->foreground) {
- gdk_color_free (eti->tooltip->foreground);
- eti->tooltip->foreground = NULL;
- }
- if (eti->tooltip->timer) {
- gtk_timeout_remove (eti->tooltip->timer);
- eti->tooltip->timer = 0;
- }
- }
-
- gdk_gc_unref (eti->fill_gc);
- eti->fill_gc = NULL;
- gdk_gc_unref (eti->grid_gc);
- eti->grid_gc = NULL;
- gdk_gc_unref (eti->focus_gc);
- eti->focus_gc = NULL;
- gdk_bitmap_unref (eti->stipple);
- eti->stipple = NULL;
-
- eti_unrealize_cell_views (eti);
-
- eti->height = 0;
-
- g_signal_handler_disconnect(gtk_layout_get_hadjustment(GTK_LAYOUT(item->canvas)),
- eti->hadjustment_change_id);
- g_signal_handler_disconnect(gtk_layout_get_hadjustment(GTK_LAYOUT(item->canvas)),
- eti->hadjustment_value_change_id);
- g_signal_handler_disconnect(gtk_layout_get_vadjustment(GTK_LAYOUT(item->canvas)),
- eti->vadjustment_change_id);
- g_signal_handler_disconnect(gtk_layout_get_vadjustment(GTK_LAYOUT(item->canvas)),
- eti->vadjustment_value_change_id);
-
- if (GNOME_CANVAS_ITEM_CLASS (eti_parent_class)->unrealize)
- (*GNOME_CANVAS_ITEM_CLASS (eti_parent_class)->unrealize)(item);
-}
-
-
-
-static void
-eti_draw (GnomeCanvasItem *item, GdkDrawable *drawable, int x, int y, int width, int height)
-{
- ETableItem *eti = E_TABLE_ITEM (item);
- const int rows = eti->rows;
- const int cols = eti->cols;
- int row, col;
- int first_col, last_col, x_offset;
- int first_row, last_row, y_offset, yd;
- int x1, x2;
- int f_x1, f_x2, f_y1, f_y2;
- gboolean f_found;
- double i2c [6];
- ArtPoint eti_base, eti_base_item, lower_right;
- GtkWidget *canvas = GTK_WIDGET(item->canvas);
- int height_extra = eti->horizontal_draw_grid ? 1 : 0;
-
- /*
- * Find out our real position after grouping
- */
- gnome_canvas_item_i2c_affine (item, i2c);
- eti_base_item.x = eti->x1;
- eti_base_item.y = eti->y1;
- art_affine_point (&eti_base, &eti_base_item, i2c);
-
- eti_base_item.x = eti->x1 + eti->width;
- eti_base_item.y = eti->y1 + eti->height;
- art_affine_point (&lower_right, &eti_base_item, i2c);
-
- /*
- * First column to draw, last column to draw
- */
- first_col = -1;
- last_col = x_offset = 0;
- x1 = x2 = floor (eti_base.x);
- for (col = 0; col < cols; col++, x1 = x2){
- ETableCol *ecol = e_table_header_get_column (eti->header, col);
-
- x2 = x1 + ecol->width;
-
- if (x1 > (x + width))
- break;
- if (x2 < x)
- continue;
- if (first_col == -1){
- x_offset = x1 - x;
- first_col = col;
- }
- }
- last_col = col;
-
- /*
- * Nothing to paint
- */
- if (first_col == -1)
- return;
-
- /*
- * Compute row span.
- */
- if (eti->uniform_row_height) {
- first_row = (y - floor (eti_base.y) - height_extra) / (eti_row_height (eti, -1) + height_extra);
- last_row = (y + height - floor (eti_base.y) ) / (eti_row_height (eti, -1) + height_extra) + 1;
- if (first_row > last_row)
- return;
- y_offset = floor (eti_base.y) - y + height_extra + first_row * (eti_row_height (eti, -1) + height_extra);
- if (first_row < 0)
- first_row = 0;
- if (last_row > eti->rows)
- last_row = eti->rows;
- } else {
- int y1, y2;
-
- y_offset = 0;
- first_row = -1;
-
- y1 = y2 = floor (eti_base.y) + height_extra;
- for (row = 0; row < rows; row++, y1 = y2){
-
- y2 += ETI_ROW_HEIGHT (eti, row) + height_extra;
-
- if (y1 > y + height)
- break;
-
- if (y2 < y)
- continue;
-
- if (first_row == -1){
- y_offset = y1 - y;
- first_row = row;
- }
- }
- last_row = row;
-
- if (first_row == -1)
- return;
- }
-
- if (first_row == -1)
- return;
-
- /*
- * Draw cells
- */
- yd = y_offset;
- f_x1 = f_x2 = f_y1 = f_y2 = -1;
- f_found = FALSE;
-
- if (eti->horizontal_draw_grid && first_row == 0){
- gdk_draw_line (
- drawable, eti->grid_gc,
- eti_base.x - x, yd, eti_base.x + eti->width - x, yd);
- }
-
- yd += height_extra;
-
- for (row = first_row; row < last_row; row++){
- int xd, height;
- gboolean selected;
- gint cursor_col, cursor_row;
-
- height = ETI_ROW_HEIGHT (eti, row);
-
- xd = x_offset;
-/* printf ("paint: %d %d\n", yd, yd + height); */
-
- selected = e_selection_model_is_row_selected(E_SELECTION_MODEL (eti->selection), view_to_model_row(eti,row));
-
- g_object_get(eti->selection,
- "cursor_col", &cursor_col,
- "cursor_row", &cursor_row,
- NULL);
-
- for (col = first_col; col < last_col; col++){
- ETableCol *ecol = e_table_header_get_column (eti->header, col);
- ECellView *ecell_view = eti->cell_views [col];
- gboolean col_selected = selected;
- gboolean cursor = FALSE;
- ECellFlags flags;
- gboolean free_background;
- GdkColor *background;
-
- switch (eti->cursor_mode) {
- case E_CURSOR_SIMPLE:
- case E_CURSOR_SPREADSHEET:
- if (cursor_col == ecol->col_idx && cursor_row == view_to_model_row(eti, row)) {
- col_selected = !col_selected;
- cursor = TRUE;
- }
- break;
- case E_CURSOR_LINE:
- /* Nothing */
- break;
- }
-
- background = eti_get_cell_background_color (eti, row, col, col_selected, &free_background);
-
- gdk_gc_set_foreground (eti->fill_gc, background);
- gdk_draw_rectangle (drawable, eti->fill_gc, TRUE,
- xd, yd, ecol->width, height);
-
- if (free_background)
- gdk_color_free (background);
-
- flags = col_selected ? E_CELL_SELECTED : 0;
- flags |= GTK_WIDGET_HAS_FOCUS(canvas) ? E_CELL_FOCUSED : 0;
- flags |= cursor ? E_CELL_CURSOR : 0;
-
- switch (ecol->justification) {
- case GTK_JUSTIFY_LEFT:
- flags |= E_CELL_JUSTIFY_LEFT;
- break;
- case GTK_JUSTIFY_RIGHT:
- flags |= E_CELL_JUSTIFY_RIGHT;
- break;
- case GTK_JUSTIFY_CENTER:
- flags |= E_CELL_JUSTIFY_CENTER;
- break;
- case GTK_JUSTIFY_FILL:
- flags |= E_CELL_JUSTIFY_FILL;
- break;
- }
-
- e_cell_draw (ecell_view, drawable, ecol->col_idx, col, row, flags,
- xd, yd, xd + ecol->width, yd + height);
-
- if (!f_found) {
- switch (eti->cursor_mode) {
- case E_CURSOR_LINE:
- if (view_to_model_row(eti, row) == cursor_row) {
- f_x1 = floor (eti_base.x) - x;
- f_x2 = floor (lower_right.x) - x;
- f_y1 = yd;
- f_y2 = yd + height;
- f_found = TRUE;
- }
- break;
- case E_CURSOR_SIMPLE:
- case E_CURSOR_SPREADSHEET:
- if (view_to_model_col(eti, col) == cursor_col && view_to_model_row(eti, row) == cursor_row) {
- f_x1 = xd;
- f_x2 = xd + ecol->width;
- f_y1 = yd;
- f_y2 = yd + height;
- f_found = TRUE;
- }
- break;
- }
- }
-
- xd += ecol->width;
- }
- yd += height;
-
- if (eti->horizontal_draw_grid) {
- gdk_draw_line (
- drawable, eti->grid_gc,
- eti_base.x - x, yd, eti_base.x + eti->width - x, yd);
-
- yd++;
- }
- }
-
- if (eti->vertical_draw_grid){
- int xd = x_offset;
-
- for (col = first_col; col <= last_col; col++){
- ETableCol *ecol = e_table_header_get_column (eti->header, col);
-
- gdk_draw_line (
- drawable, eti->grid_gc,
- xd, y_offset, xd, yd - 1);
-
- /*
- * This looks wierd, but it is to draw the last line
- */
- if (ecol)
- xd += ecol->width;
- }
- }
-
- /*
- * Draw focus
- */
- if (eti->draw_focus && f_found) {
- gdk_gc_set_ts_origin (eti->focus_gc, f_x1, f_y1);
- gdk_draw_rectangle (drawable, eti->focus_gc, FALSE,
- f_x1, f_y1, f_x2 - f_x1 - 1, f_y2 - f_y1 - 1);
- }
-}
-
-static double
-eti_point (GnomeCanvasItem *item, double x, double y, int cx, int cy,
- GnomeCanvasItem **actual_item)
-{
- *actual_item = item;
-
- return 0.0;
-}
-
-static gboolean
-find_cell (ETableItem *eti, double x, double y, int *view_col_res, int *view_row_res, double *x1_res, double *y1_res)
-{
- const int cols = eti->cols;
- const int rows = eti->rows;
- gdouble x1, y1, x2, y2;
- int col, row;
-
- int height_extra = eti->horizontal_draw_grid ? 1 : 0;
-
- /* FIXME: this routine is inneficient, fix later */
-
- if (eti->grabbed_col >= 0 && eti->grabbed_row >= 0) {
- *view_col_res = eti->grabbed_col;
- *view_row_res = eti->grabbed_row;
- *x1_res = x - eti->x1 - e_table_header_col_diff (eti->header, 0, eti->grabbed_col);
- *y1_res = y - eti->y1 - e_table_item_row_diff (eti, 0, eti->grabbed_row);
- return TRUE;
- }
-
- if (cols == 0 || rows == 0)
- return FALSE;
-
- x -= eti->x1;
- y -= eti->y1;
-
- x1 = 0;
- for (col = 0; col < cols - 1; col++, x1 = x2){
- ETableCol *ecol = e_table_header_get_column (eti->header, col);
-
- if (x < x1)
- return FALSE;
-
- x2 = x1 + ecol->width;
-
- if (x <= x2)
- break;
- }
-
- if (eti->uniform_row_height) {
- if (y < height_extra)
- return FALSE;
- row = (y - height_extra) / (eti_row_height (eti, -1) + height_extra);
- y1 = row * (eti_row_height (eti, -1) + height_extra) + height_extra;
- if (row >= eti->rows)
- return FALSE;
- } else {
- y1 = y2 = height_extra;
- if (y < height_extra)
- return FALSE;
- for (row = 0; row < rows - 1; row++, y1 = y2){
- y2 += ETI_ROW_HEIGHT (eti, row) + height_extra;
-
- if (y <= y2)
- break;
- }
- }
- *view_col_res = col;
- if (x1_res)
- *x1_res = x - x1;
- *view_row_res = row;
- if (y1_res)
- *y1_res = y - y1;
- return TRUE;
-}
-
-static void
-eti_cursor_move (ETableItem *eti, gint row, gint column)
-{
- e_table_item_leave_edit_(eti);
- e_table_item_focus (eti, view_to_model_col(eti, column), view_to_model_row(eti, row), 0);
-}
-
-static void
-eti_cursor_move_left (ETableItem *eti)
-{
- int cursor_col, cursor_row;
- g_object_get(eti->selection,
- "cursor_col", &cursor_col,
- "cursor_row", &cursor_row,
- NULL);
-
- eti_cursor_move (eti, model_to_view_row(eti, cursor_row), model_to_view_col(eti, cursor_col) - 1);
-}
-
-static void
-eti_cursor_move_right (ETableItem *eti)
-{
- int cursor_col, cursor_row;
- g_object_get(eti->selection,
- "cursor_col", &cursor_col,
- "cursor_row", &cursor_row,
- NULL);
-
- eti_cursor_move (eti, model_to_view_row(eti, cursor_row), model_to_view_col(eti, cursor_col) + 1);
-}
-
-#ifdef DO_TOOLTIPS
-static int
-_do_tooltip (ETableItem *eti)
-{
- ECellView *ecell_view;
- gboolean free_color;
- ETableCol *ecol;
- gboolean selected;
- int cursor_row, cursor_col;
-
- e_canvas_hide_tooltip (E_CANVAS(GNOME_CANVAS_ITEM(eti)->canvas));
-
- if (eti_editing (eti))
- return FALSE;
-
- ecell_view = eti->cell_views[eti->tooltip->col];
-
- eti->tooltip->x = e_table_header_col_diff (eti->header, 0, eti->tooltip->col);
-
- eti->tooltip->y = e_table_item_row_diff (eti, 0, eti->tooltip->row);
- eti->tooltip->row_height = ETI_ROW_HEIGHT (eti, eti->tooltip->row);
-
- selected = e_selection_model_is_row_selected(E_SELECTION_MODEL (eti->selection), view_to_model_row(eti,eti->tooltip->row));
-
- if (eti->tooltip->foreground)
- gdk_color_free (eti->tooltip->foreground);
- if (eti->tooltip->background)
- gdk_color_free (eti->tooltip->background);
-
- switch (eti->cursor_mode) {
- case E_CURSOR_SIMPLE:
- case E_CURSOR_SPREADSHEET:
- ecol = e_table_header_get_column (eti->header, eti->tooltip->col);
-
- g_object_get(eti->selection,
- "cursor_row", &cursor_row,
- "cursor_col", &cursor_col,
- NULL);
-
- if (cursor_col == ecol->col_idx && cursor_row == view_to_model_row(eti, eti->tooltip->row))
- selected = !selected;
- break;
- case E_CURSOR_LINE:
- /* Nothing */
- break;
- }
-
- eti->tooltip->background = eti_get_cell_background_color (eti, eti->tooltip->row, eti->tooltip->col, selected, &free_color);
- if (!free_color)
- eti->tooltip->background = gdk_color_copy(eti->tooltip->background);
-
- eti->tooltip->foreground = eti_get_cell_foreground_color (eti, eti->tooltip->row, eti->tooltip->col, selected, &free_color);
- if (!free_color)
- eti->tooltip->foreground = gdk_color_copy(eti->tooltip->foreground);
-
- e_cell_show_tooltip (ecell_view,
- view_to_model_col (eti, eti->tooltip->col),
- eti->tooltip->col,
- eti->tooltip->row,
- eti->header->columns[eti->tooltip->col]->width,
- eti->tooltip);
- return FALSE;
-}
-#endif
-
-static gint
-eti_e_cell_event (ETableItem *item, ECellView *ecell_view, GdkEvent *event, int time, int model_col, int view_col, int row, ECellFlags flags)
-{
- ECellActions actions = 0;
- gint ret_val;
-
- ret_val = e_cell_event (ecell_view, event, model_col, view_col, row, flags, &actions);
-
- if (actions & E_CELL_GRAB) {
- d(g_print ("%s: eti_grab\n", __FUNCTION__));
- eti_grab (item, time);
- item->grabbed_col = view_col;
- item->grabbed_row = row;
- }
-
- if (actions & E_CELL_UNGRAB) {
- d(g_print ("%s: eti_ungrab\n", __FUNCTION__));
- eti_ungrab (item, time);
- item->grabbed_col = -1;
- item->grabbed_row = -1;
- }
-
- return ret_val;
-}
-
-/* FIXME: cursor */
-static int
-eti_event (GnomeCanvasItem *item, GdkEvent *e)
-{
- ETableItem *eti = E_TABLE_ITEM (item);
- ECellView *ecell_view;
- gint return_val = TRUE;
-#if d(!)0
- gboolean leave = FALSE;
-#endif
-
- switch (e->type){
- case GDK_BUTTON_PRESS: {
- double x1, y1;
- double realx, realy;
- GdkEventButton button;
- int col, row;
- gint cursor_row, cursor_col;
- gint new_cursor_row, new_cursor_col;
- ECellFlags flags = 0;
-
- d(g_print("%s: GDK_BUTTON_PRESS received, button %d\n", __FUNCTION__, e->button.button));
-
- if (eti->tooltip->timer) {
- gtk_timeout_remove (eti->tooltip->timer);
- eti->tooltip->timer = 0;
- }
-
- switch (e->button.button) {
- case 1: /* Fall through. */
- case 2:
- e_canvas_item_grab_focus(GNOME_CANVAS_ITEM(eti), TRUE);
- gnome_canvas_item_w2i (item, &e->button.x, &e->button.y);
-
- realx = e->button.x;
- realy = e->button.y;
-
- if (!find_cell (eti, realx, realy, &col, &row, &x1, &y1)) {
- if (eti_editing (eti))
- e_table_item_leave_edit_(eti);
- return TRUE;
- }
-
- ecell_view = eti->cell_views [col];
- button = *(GdkEventButton *)e;
- button.x = x1;
- button.y = y1;
-
- g_object_get(eti->selection,
- "cursor_row", &cursor_row,
- "cursor_col", &cursor_col,
- NULL);
-
- if (cursor_col == view_to_model_col (eti, col) && cursor_row == view_to_model_row(eti, row)) {
- flags = E_CELL_CURSOR;
- } else {
- flags = 0;
- }
-
- return_val = eti_e_cell_event (eti, ecell_view, (GdkEvent *) &button, button.time, view_to_model_col(eti, col), col, row, flags);
- if (return_val)
- return TRUE;
-
- g_signal_emit (eti, eti_signals [CLICK], 0,
- row, view_to_model_col(eti, col), &button, &return_val);
-
- if (return_val) {
- eti->click_count = 0;
- return TRUE;
- }
-
- g_object_get(eti->selection,
- "cursor_row", &cursor_row,
- "cursor_col", &cursor_col,
- NULL);
-
- eti->maybe_did_something =
- e_selection_model_maybe_do_something(E_SELECTION_MODEL (eti->selection), view_to_model_row(eti, row), view_to_model_col(eti, col), button.state);
- g_object_get(eti->selection,
- "cursor_row", &new_cursor_row,
- "cursor_col", &new_cursor_col,
- NULL);
-
- if (cursor_row != new_cursor_row || cursor_col != new_cursor_col) {
- eti->click_count = 1;
- } else {
- eti->click_count ++;
- eti->row_guess = row;
-
- if ((!eti_editing(eti)) && e_table_model_is_cell_editable(eti->table_model, cursor_col, row)) {
- e_table_item_enter_edit (eti, col, row);
- }
-
- /*
- * Adjust the event positions
- */
-
- if (eti_editing (eti)) {
- return_val = eti_e_cell_event (eti, ecell_view, (GdkEvent *) &button, button.time,
- view_to_model_col(eti, col), col, row, E_CELL_EDITING | E_CELL_CURSOR);
- if (return_val)
- return TRUE;
- }
- }
-
- if (e->button.button == 1) {
- return_val = TRUE;
-
- eti->maybe_in_drag = TRUE;
- eti->drag_row = new_cursor_row;
- eti->drag_col = new_cursor_col;
- eti->drag_x = realx;
- eti->drag_y = realy;
- eti->drag_state = e->button.state;
- eti->grabbed = TRUE;
- d(g_print ("%s: eti_grab\n", __FUNCTION__));
- eti_grab (eti, e->button.time);
- }
-
- break;
- case 3:
- e_canvas_item_grab_focus(GNOME_CANVAS_ITEM(eti), TRUE);
- gnome_canvas_item_w2i (item, &e->button.x, &e->button.y);
- if (!find_cell (eti, e->button.x, e->button.y, &col, &row, &x1, &y1))
- return TRUE;
-
- e_selection_model_right_click_down(E_SELECTION_MODEL (eti->selection), view_to_model_row(eti, row), view_to_model_col(eti, col), 0);
-
- g_signal_emit (eti, eti_signals [RIGHT_CLICK], 0,
- row, view_to_model_col(eti, col), e, &return_val);
- if (!return_val)
- e_selection_model_right_click_up(E_SELECTION_MODEL (eti->selection));
- break;
- case 4:
- case 5:
- return FALSE;
- break;
-
- }
- break;
- }
-
- case GDK_BUTTON_RELEASE: {
- double x1, y1;
- int col, row;
- gint cursor_row, cursor_col;
-
- d(g_print("%s: GDK_BUTTON_RELEASE received, button %d\n", __FUNCTION__, e->button.button));
-
- if (eti->grabbed_count > 0) {
- d(g_print ("%s: eti_ungrab\n", __FUNCTION__));
- eti_ungrab (eti, e->button.time);
- }
-
- if (e->button.button == 1) {
- if (eti->maybe_in_drag) {
- eti->maybe_in_drag = FALSE;
- if (!eti->maybe_did_something)
- e_selection_model_do_something(E_SELECTION_MODEL (eti->selection), eti->drag_row, eti->drag_col, eti->drag_state);
- }
- if (eti->in_drag) {
- eti->in_drag = FALSE;
- }
- }
-
- if (eti->tooltip->timer) {
- gtk_timeout_remove (eti->tooltip->timer);
- eti->tooltip->timer = 0;
- }
- e_canvas_hide_tooltip (E_CANVAS(GNOME_CANVAS_ITEM(eti)->canvas));
- switch (e->button.button) {
- case 1: /* Fall through. */
- case 2:
-
- gnome_canvas_item_w2i (item, &e->button.x, &e->button.y);
-#if d(!)0
- {
- gboolean cell_found = find_cell (eti, e->button.x, e->button.y, &col, &row, &x1, &y1);
- g_print("%s: find_cell(%f, %f) = %s(%d, %d, %f, %f)\n", __FUNCTION__, e->button.x, e->button.y,
- cell_found?"true":"false", col, row, x1, y1);
- }
-#endif
-
- if (!find_cell (eti, e->button.x, e->button.y, &col, &row, &x1, &y1))
- return TRUE;
-
- g_object_get(eti->selection,
- "cursor_row", &cursor_row,
- "cursor_col", &cursor_col,
- NULL);
-
-
- d(g_print("%s: GDK_BUTTON_RELEASE received, button %d, line: %d\n"
- "eti_editing: %s, row:%d:%d, col:%d:%d\n", __FUNCTION__, e->button.button, __LINE__,
- eti_editing(eti)?"true":"false", cursor_row, view_to_model_row(eti, row), cursor_col, view_to_model_col(eti, col)));
-
- if (eti_editing (eti) && cursor_row == view_to_model_row(eti, row) && cursor_col == view_to_model_col(eti, col)){
-
- d(g_print("%s: GDK_BUTTON_RELEASE received, button %d, line: %d\n", __FUNCTION__, e->button.button, __LINE__))
-;
-
- ecell_view = eti->cell_views [col];
-
- /*
- * Adjust the event positions
- */
- e->button.x = x1;
- e->button.y = y1;
-
- return_val = eti_e_cell_event (eti, ecell_view, e, e->button.time,
- view_to_model_col(eti, col), col, row, E_CELL_EDITING | E_CELL_CURSOR);
- }
- break;
- case 3:
- e_selection_model_right_click_up(E_SELECTION_MODEL (eti->selection));
- return_val = TRUE;
- break;
- case 4:
- case 5:
- return FALSE;
- break;
-
- }
- break;
- }
-
- case GDK_2BUTTON_PRESS: {
- int model_col, model_row;
-#if 0
- double x1, y1;
-#endif
-
- d(g_print("%s: GDK_2BUTTON_PRESS received, button %d\n", __FUNCTION__, e->button.button));
-
- if (e->button.button == 5 ||
- e->button.button == 4)
- return FALSE;
-
- /*
- * click_count is so that if you click on two
- * different rows we don't send a double click signal.
- */
-
- if (eti->click_count >= 2) {
-
- gnome_canvas_item_w2i (item, &e->button.x, &e->button.y);
-
-#if 0
- if (!find_cell (eti, e->button.x, e->button.y, &current_col, &current_row, &x1, &y1))
- return TRUE;
-#endif
-
- g_object_get(eti->selection,
- "cursor_row", &model_row,
- "cursor_col", &model_col,
- NULL);
-
- e->button.x -= e_table_header_col_diff (eti->header, 0, model_to_view_col (eti, model_col));
- e->button.y -= e_table_item_row_diff (eti, 0, model_to_view_row (eti, model_row));
-
- if (e->button.button == 1) {
- if (eti->maybe_in_drag) {
- eti->maybe_in_drag = FALSE;
- if (!eti->maybe_did_something)
- e_selection_model_do_something(E_SELECTION_MODEL (eti->selection), eti->drag_row, eti->drag_col, eti->drag_state);
- }
- if (eti->in_drag) {
- eti->in_drag = FALSE;
- }
- if (eti_editing (eti))
- e_table_item_leave_edit_ (eti);
-
- }
-
- if (eti->grabbed_count > 0) {
- d(g_print ("%s: eti_ungrab\n", __FUNCTION__));
- eti_ungrab (eti, e->button.time);
- }
-
- if (model_row != -1 && model_col != -1) {
- g_signal_emit (eti, eti_signals [DOUBLE_CLICK], 0,
- model_row, model_col, e);
- }
- }
- break;
- }
- case GDK_MOTION_NOTIFY: {
- int col, row;
- double x1, y1;
- gint cursor_col, cursor_row;
-
- gnome_canvas_item_w2i (item, &e->motion.x, &e->motion.y);
-
- if (eti->maybe_in_drag) {
- if (abs (e->motion.x - eti->drag_x) >= 3 ||
- abs (e->motion.y - eti->drag_y) >= 3) {
- gint drag_handled;
-
- eti->maybe_in_drag = 0;
- g_signal_emit (eti, eti_signals [START_DRAG], 0,
- eti->drag_row, eti->drag_col, e, &drag_handled);
- if (drag_handled)
- eti->in_drag = 1;
- else
- eti->in_drag = 0;
- }
- }
-
- if (!find_cell (eti, e->motion.x, e->motion.y, &col, &row, &x1, &y1))
- return TRUE;
-
- g_object_get(eti->selection,
- "cursor_row", &cursor_row,
- "cursor_col", &cursor_col,
- NULL);
-
- e_canvas_hide_tooltip (E_CANVAS(GNOME_CANVAS_ITEM(eti)->canvas));
-
-#ifdef DO_TOOLTIPS
- if (!g_getenv ("GAL_DONT_DO_TOOLTIPS")) {
- if (eti->tooltip->timer > 0)
- gtk_timeout_remove (eti->tooltip->timer);
- eti->tooltip->col = col;
- eti->tooltip->row = row;
- eti->tooltip->cx = e->motion.x;
- eti->tooltip->cy = e->motion.y;
- eti->tooltip->timer = gtk_timeout_add (100, (GSourceFunc)_do_tooltip, eti);
- }
-#endif
-
- if (cursor_row == view_to_model_row(eti, row) && cursor_col == view_to_model_col(eti, col)){
- ecell_view = eti->cell_views [col];
-
- /*
- * Adjust the event positions
- */
- e->motion.x = x1;
- e->motion.y = y1;
-
- return_val = eti_e_cell_event (eti, ecell_view, e, e->motion.time,
- view_to_model_col(eti, col), col, row, E_CELL_EDITING | E_CELL_CURSOR);
- }
- break;
- }
-
- case GDK_KEY_PRESS: {
- gint cursor_row, cursor_col;
- gint handled = TRUE;
-
- d(g_print("%s: GDK_KEY_PRESS received, keyval: %d\n", __FUNCTION__, (int) e->key.keyval));
-
- g_object_get(eti->selection,
- "cursor_row", &cursor_row,
- "cursor_col", &cursor_col,
- NULL);
-
- if (eti->tooltip->timer) {
- gtk_timeout_remove (eti->tooltip->timer);
- eti->tooltip->timer = 0;
- }
- e_canvas_hide_tooltip (E_CANVAS(GNOME_CANVAS_ITEM(eti)->canvas));
-
- if (cursor_row == -1 && cursor_col == -1)
- return FALSE;
-
- eti->in_key_press = TRUE;
-
- switch (e->key.keyval){
- case GDK_Left:
- case GDK_KP_Left:
- if (eti_editing (eti)) {
- handled = FALSE;
- break;
- }
-
- g_signal_emit (eti, eti_signals [KEY_PRESS], 0,
- model_to_view_row(eti, cursor_row), cursor_col, e, &return_val);
- if ((!return_val) && eti->cursor_mode != E_CURSOR_LINE && cursor_col != view_to_model_col(eti, 0))
- eti_cursor_move_left (eti);
- return_val = 1;
- break;
-
- case GDK_Right:
- case GDK_KP_Right:
- if (eti_editing (eti)) {
- handled = FALSE;
- break;
- }
-
- g_signal_emit (eti, eti_signals [KEY_PRESS], 0,
- model_to_view_row(eti, cursor_row), cursor_col, e, &return_val);
- if ((!return_val) && eti->cursor_mode != E_CURSOR_LINE && cursor_col != view_to_model_col(eti, eti->cols - 1))
- eti_cursor_move_right (eti);
- return_val = 1;
- break;
-
- case GDK_Up:
- case GDK_KP_Up:
- case GDK_Down:
- case GDK_KP_Down:
- return_val = e_selection_model_key_press(E_SELECTION_MODEL (eti->selection), (GdkEventKey *) e);
- break;
- case GDK_Home:
- case GDK_KP_Home:
- if (eti->cursor_mode != E_CURSOR_LINE) {
- eti_cursor_move (eti, model_to_view_row(eti, cursor_row), 0);
- return_val = TRUE;
- } else
- return_val = e_selection_model_key_press(E_SELECTION_MODEL (eti->selection), (GdkEventKey *) e);
- break;
- case GDK_End:
- case GDK_KP_End:
- if (eti->cursor_mode != E_CURSOR_LINE) {
- eti_cursor_move (eti, model_to_view_row(eti, cursor_row), eti->cols - 1);
- return_val = TRUE;
- } else
- return_val = e_selection_model_key_press(E_SELECTION_MODEL (eti->selection), (GdkEventKey *) e);
- break;
- case GDK_Tab:
- case GDK_KP_Tab:
- case GDK_ISO_Left_Tab:
- if (eti->cursor_mode == E_CURSOR_SPREADSHEET) {
- if ((e->key.state & GDK_SHIFT_MASK) != 0){
- /* shift tab */
- if (cursor_col != view_to_model_col(eti, 0))
- eti_cursor_move_left (eti);
- else if (cursor_row != view_to_model_row(eti, 0))
- eti_cursor_move (eti, model_to_view_row(eti, cursor_row) - 1, eti->cols - 1);
- else
- return_val = FALSE;
- } else {
- if (cursor_col != view_to_model_col (eti, eti->cols - 1))
- eti_cursor_move_right (eti);
- else if (cursor_row != view_to_model_row(eti, eti->rows - 1))
- eti_cursor_move (eti, model_to_view_row(eti, cursor_row) + 1, 0);
- else
- return_val = FALSE;
- }
- g_object_get(eti->selection,
- "cursor_row", &cursor_row,
- "cursor_col", &cursor_col,
- NULL);
-
- if (cursor_col >= 0 && cursor_row >= 0 && return_val &&
- (!eti_editing(eti)) && e_table_model_is_cell_editable(eti->table_model, cursor_col, model_to_view_row (eti, cursor_row))) {
- e_table_item_enter_edit (eti, model_to_view_col(eti, cursor_col), model_to_view_row(eti, cursor_row));
- }
- break;
- } else {
- /* Let tab send you to the next widget. */
- return_val = FALSE;
- break;
- }
-
- case GDK_Return:
- case GDK_KP_Enter:
- case GDK_ISO_Enter:
- case GDK_3270_Enter:
- if (eti_editing (eti)){
- e_table_item_leave_edit_(eti);
-#if 0
- ecell_view = eti->cell_views [eti->editing_col];
- return_val = eti_e_cell_event (eti, ecell_view, e, e->key.time,
- view_to_model_col(eti, eti->editing_col),
- eti->editing_col, eti->editing_row, E_CELL_EDITING | E_CELL_CURSOR);
-#endif
- }
- g_signal_emit (eti, eti_signals [KEY_PRESS], 0,
- model_to_view_row(eti, cursor_row), cursor_col, e, &return_val);
- if (!return_val)
- return_val = e_selection_model_key_press(E_SELECTION_MODEL (eti->selection), (GdkEventKey *) e);
- break;
-
- default:
- handled = FALSE;
- break;
- }
-
- if (!handled) {
- switch (e->key.keyval) {
- case GDK_Scroll_Lock:
- case GDK_Sys_Req:
- case GDK_Shift_L:
- case GDK_Shift_R:
- case GDK_Control_L:
- case GDK_Control_R:
- case GDK_Caps_Lock:
- case GDK_Shift_Lock:
- case GDK_Meta_L:
- case GDK_Meta_R:
- case GDK_Alt_L:
- case GDK_Alt_R:
- case GDK_Super_L:
- case GDK_Super_R:
- case GDK_Hyper_L:
- case GDK_Hyper_R:
- case GDK_ISO_Lock:
- break;
-
- default:
- if (!eti_editing (eti)){
- gint col, row;
- row = model_to_view_row(eti, cursor_row);
- col = model_to_view_col(eti, cursor_col);
- if (col != -1 && row != -1 && e_table_model_is_cell_editable(eti->table_model, cursor_col, row)) {
- e_table_item_enter_edit (eti, col, row);
- }
- }
- if (!eti_editing (eti)){
- g_signal_emit (eti, eti_signals [KEY_PRESS], 0,
- model_to_view_row(eti, cursor_row), cursor_col, e, &return_val);
- if (!return_val)
- e_selection_model_key_press(E_SELECTION_MODEL (eti->selection), (GdkEventKey *) e);
- } else {
- ecell_view = eti->cell_views [eti->editing_col];
- return_val = eti_e_cell_event (eti, ecell_view, e, e->key.time,
- view_to_model_col(eti, eti->editing_col),
- eti->editing_col, eti->editing_row, E_CELL_EDITING | E_CELL_CURSOR);
- if (!return_val)
- e_selection_model_key_press(E_SELECTION_MODEL (eti->selection), (GdkEventKey *) e);
- }
- break;
- }
- }
- eti->in_key_press = FALSE;
- break;
- }
-
- case GDK_KEY_RELEASE: {
- gint cursor_row, cursor_col;
-
- d(g_print("%s: GDK_KEY_RELEASE received, keyval: %d\n", __FUNCTION__, (int) e->key.keyval));
-
- g_object_get(eti->selection,
- "cursor_row", &cursor_row,
- "cursor_col", &cursor_col,
- NULL);
-
- if (cursor_col == -1)
- return FALSE;
-
- if (eti_editing (eti)){
- ecell_view = eti->cell_views [eti->editing_col];
- return_val = eti_e_cell_event (eti, ecell_view, e, e->key.time,
- view_to_model_col(eti, eti->editing_col),
- eti->editing_col, eti->editing_row, E_CELL_EDITING | E_CELL_CURSOR);
- }
- break;
- }
-
- case GDK_LEAVE_NOTIFY:
- d(leave = TRUE);
- case GDK_ENTER_NOTIFY:
- d(g_print("%s: %s received\n", __FUNCTION__, leave ? "GDK_LEAVE_NOTIFY" : "GDK_ENTER_NOTIFY"));
- if (eti->tooltip->timer > 0)
- gtk_timeout_remove (eti->tooltip->timer);
- eti->tooltip->timer = 0;
- break;
-
- case GDK_FOCUS_CHANGE:
- d(g_print("%s: GDK_FOCUS_CHANGE received, %s\n", __FUNCTION__, e->focus_change.in ? "in": "out"));
- if (e->focus_change.in) {
- if (eti->save_row != -1 &&
- eti->save_col != -1 &&
- !eti_editing (eti) &&
- e_table_model_is_cell_editable(eti->table_model, view_to_model_col (eti, eti->save_col), eti->save_row)) {
- e_table_item_enter_edit (eti, eti->save_col, eti->save_row);
- e_cell_load_state (eti->cell_views [eti->editing_col], view_to_model_col(eti, eti->save_col),
- eti->save_col, eti->save_row, eti->edit_ctx, eti->save_state);
- eti_free_save_state (eti);
- }
- } else {
- if (eti_editing (eti)) {
- eti_free_save_state (eti);
-
- eti->save_row = eti->editing_row;
- eti->save_col = eti->editing_col;
- eti->save_state = e_cell_save_state (eti->cell_views [eti->editing_col], view_to_model_col(eti, eti->editing_col),
- eti->editing_col, eti->editing_row, eti->edit_ctx);
- e_table_item_leave_edit_(eti);
- }
- }
-
- default:
- return_val = FALSE;
- }
- /* d(g_print("%s: returning: %s\n", __FUNCTION__, return_val?"true":"false"));*/
-
- return return_val;
-}
-
-static void
-eti_style_set (ETableItem *eti, GtkStyle *previous_style)
-{
- if (!(GTK_OBJECT_FLAGS(eti) & GNOME_CANVAS_ITEM_REALIZED))
- return;
-
- if (eti->cell_views_realized) {
- int i;
- int n_cells = eti->n_cells;
-
- for (i = 0; i < n_cells; i++) {
- e_cell_style_set (eti->cell_views[i], previous_style);
- }
- }
-
- eti->needs_compute_height = 1;
- e_canvas_item_request_reflow (GNOME_CANVAS_ITEM (eti));
- eti->needs_redraw = 1;
- gnome_canvas_item_request_update (GNOME_CANVAS_ITEM (eti));
-
- free_height_cache (eti);
-
- eti_idle_maybe_show_cursor(eti);
-}
-
-static void
-eti_class_init (GObjectClass *object_class)
-{
- GnomeCanvasItemClass *item_class = (GnomeCanvasItemClass *) object_class;
- ETableItemClass *eti_class = (ETableItemClass *) object_class;
-
- eti_parent_class = g_type_class_ref (PARENT_OBJECT_TYPE);
-
- object_class->dispose = eti_dispose;
- object_class->set_property = eti_set_property;
- object_class->get_property = eti_get_property;
-
- item_class->update = eti_update;
- item_class->realize = eti_realize;
- item_class->unrealize = eti_unrealize;
- item_class->draw = eti_draw;
- item_class->point = eti_point;
- item_class->event = eti_event;
-
- eti_class->cursor_change = NULL;
- eti_class->cursor_activated = NULL;
- eti_class->double_click = NULL;
- eti_class->right_click = NULL;
- eti_class->click = NULL;
- eti_class->key_press = NULL;
- eti_class->start_drag = NULL;
- eti_class->style_set = eti_style_set;
-
- g_object_class_install_property (object_class, PROP_TABLE_HEADER,
- g_param_spec_object ("ETableHeader",
- _( "Table header" ),
- _( "Table header" ),
- E_TABLE_HEADER_TYPE,
- G_PARAM_WRITABLE));
-
- g_object_class_install_property (object_class, PROP_TABLE_MODEL,
- g_param_spec_object ("ETableModel",
- _( "Table model" ),
- _( "Table model" ),
- E_TABLE_MODEL_TYPE,
- G_PARAM_WRITABLE));
-
- g_object_class_install_property (object_class, PROP_SELECTION_MODEL,
- g_param_spec_object ("selection_model",
- _( "Selection model" ),
- _( "Selection model" ),
- E_SELECTION_MODEL_TYPE,
- G_PARAM_WRITABLE));
-
- g_object_class_install_property (object_class, PROP_TABLE_ALTERNATING_ROW_COLORS,
- g_param_spec_boolean ("alternating_row_colors",
- _( "Alternating Row Colors" ),
- _( "Alternating Row Colors" ),
- FALSE,
- G_PARAM_WRITABLE));
-
- g_object_class_install_property (object_class, PROP_TABLE_HORIZONTAL_DRAW_GRID,
- g_param_spec_boolean ("horizontal_draw_grid",
- _( "Horizontal Draw Grid" ),
- _( "Horizontal Draw Grid" ),
- FALSE,
- G_PARAM_WRITABLE));
-
- g_object_class_install_property (object_class, PROP_TABLE_VERTICAL_DRAW_GRID,
- g_param_spec_boolean ("vertical_draw_grid",
- _( "Vertical Draw Grid" ),
- _( "Vertical Draw Grid" ),
- FALSE,
- G_PARAM_WRITABLE));
-
- g_object_class_install_property (object_class, PROP_TABLE_DRAW_FOCUS,
- g_param_spec_boolean ("drawfocus",
- _( "Draw focus" ),
- _( "Draw focus" ),
- FALSE,
- G_PARAM_WRITABLE));
-
- g_object_class_install_property (object_class, PROP_CURSOR_MODE,
- g_param_spec_int ("cursor_mode",
- _( "Cursor mode" ),
- _( "Cursor mode" ),
- E_CURSOR_LINE, E_CURSOR_SPREADSHEET, E_CURSOR_LINE,
- G_PARAM_WRITABLE));
-
- g_object_class_install_property (object_class, PROP_LENGTH_THRESHOLD,
- g_param_spec_int ("length_threshold",
- _( "Length Threshold" ),
- _( "Length Threshold" ),
- 0, G_MAXINT, 0,
- G_PARAM_WRITABLE));
-
- g_object_class_install_property (object_class, PROP_MINIMUM_WIDTH,
- g_param_spec_double ("minimum_width",
- _( "Minimum width" ),
- _( "Minimum Width" ),
- 0.0, G_MAXDOUBLE, 0.0,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_WIDTH,
- g_param_spec_double ("width",
- _( "Width" ),
- _( "Width" ),
- 0.0, G_MAXDOUBLE, 0.0,
- G_PARAM_READWRITE));
- g_object_class_install_property (object_class, PROP_HEIGHT,
- g_param_spec_double ("height",
- _( "Height" ),
- _( "Height" ),
- 0.0, G_MAXDOUBLE, 0.0,
- G_PARAM_READABLE));
-
- g_object_class_install_property (object_class, PROP_CURSOR_ROW,
- g_param_spec_int ("cursor_row",
- _( "Cursor row" ),
- _( "Cursor row" ),
- 0, G_MAXINT, 0,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_UNIFORM_ROW_HEIGHT,
- g_param_spec_boolean ("uniform_row_height",
- _( "Uniform row height" ),
- _( "Uniform row height" ),
- FALSE,
- G_PARAM_READWRITE));
-
- eti_signals [CURSOR_CHANGE] =
- g_signal_new ("cursor_change",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (ETableItemClass, cursor_change),
- NULL, NULL,
- e_marshal_NONE__INT,
- G_TYPE_NONE, 1, G_TYPE_INT);
-
- eti_signals [CURSOR_ACTIVATED] =
- g_signal_new ("cursor_activated",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (ETableItemClass, cursor_activated),
- NULL, NULL,
- e_marshal_NONE__INT,
- G_TYPE_NONE, 1, G_TYPE_INT);
-
- eti_signals [DOUBLE_CLICK] =
- g_signal_new ("double_click",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (ETableItemClass, double_click),
- NULL, NULL,
- e_marshal_NONE__INT_INT_BOXED,
- G_TYPE_NONE, 3, G_TYPE_INT,
- G_TYPE_INT, GDK_TYPE_EVENT);
-
- eti_signals [START_DRAG] =
- g_signal_new ("start_drag",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (ETableItemClass, start_drag),
- NULL, NULL,
- e_marshal_INT__INT_INT_BOXED,
- G_TYPE_INT, 3, G_TYPE_INT,
- G_TYPE_INT, GDK_TYPE_EVENT);
-
- eti_signals [RIGHT_CLICK] =
- g_signal_new ("right_click",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (ETableItemClass, right_click),
- NULL, NULL,
- e_marshal_INT__INT_INT_BOXED,
- G_TYPE_INT, 3, G_TYPE_INT,
- G_TYPE_INT, GDK_TYPE_EVENT);
-
- eti_signals [CLICK] =
- g_signal_new ("click",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (ETableItemClass, click),
- NULL, NULL,
- e_marshal_INT__INT_INT_BOXED,
- G_TYPE_INT, 3, G_TYPE_INT,
- G_TYPE_INT, GDK_TYPE_EVENT);
-
- eti_signals [KEY_PRESS] =
- g_signal_new ("key_press",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (ETableItemClass, key_press),
- NULL, NULL,
- e_marshal_INT__INT_INT_BOXED,
- G_TYPE_INT, 3, G_TYPE_INT,
- G_TYPE_INT, GDK_TYPE_EVENT);
-
- eti_signals [STYLE_SET] =
- g_signal_new ("style_set",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (ETableItemClass, style_set),
- NULL, NULL,
- e_marshal_NONE__OBJECT,
- G_TYPE_NONE, 1, GTK_TYPE_STYLE);
-}
-
-E_MAKE_TYPE (e_table_item,
- "ETableItem",
- ETableItem,
- eti_class_init,
- eti_init,
- PARENT_OBJECT_TYPE)
-
-/**
- * e_table_item_set_cursor:
- * @eti: %ETableItem which will have the cursor set.
- * @col: Column to select. -1 means the last column.
- * @row: Row to select. -1 means the last row.
- *
- * This routine sets the cursor of the %ETableItem canvas item.
- */
-void
-e_table_item_set_cursor (ETableItem *eti, int col, int row)
-{
- e_table_item_focus(eti, col, view_to_model_row(eti, row), 0);
-}
-
-static void
-e_table_item_focus (ETableItem *eti, int col, int row, GdkModifierType state)
-{
- g_return_if_fail (eti != NULL);
- g_return_if_fail (E_IS_TABLE_ITEM (eti));
-
- if (row == -1) {
- row = view_to_model_row(eti, eti->rows - 1);
- }
-
- if (col == -1) {
- col = eti->cols - 1;
- }
-
- if (row != -1) {
- e_selection_model_do_something(E_SELECTION_MODEL (eti->selection),
- row, col,
- state);
- }
-}
-
-/**
- * e_table_item_get_focused_column:
- * @eti: %ETableItem which will have the cursor retrieved.
- *
- * This routine gets the cursor of the %ETableItem canvas item.
- *
- * Returns: The current cursor column.
- */
-gint
-e_table_item_get_focused_column (ETableItem *eti)
-{
- int cursor_col;
-
- g_return_val_if_fail (eti != NULL, -1);
- g_return_val_if_fail (E_IS_TABLE_ITEM (eti), -1);
-
- g_object_get(eti->selection,
- "cursor_col", &cursor_col,
- NULL);
-
- return cursor_col;
-}
-
-static void
-eti_cursor_change (ESelectionModel *selection, int row, int col, ETableItem *eti)
-{
- int view_row;
- int view_col;
-
- if (!(GTK_OBJECT_FLAGS(eti) & GNOME_CANVAS_ITEM_REALIZED))
- return;
-
- view_row = model_to_view_row(eti, row);
- view_col = model_to_view_col(eti, col);
-
- if (eti->old_cursor_row != -1 && view_row != eti->old_cursor_row)
- e_table_item_redraw_row (eti, eti->old_cursor_row);
-
- if (view_row == -1 || view_col == -1) {
- e_table_item_leave_edit_(eti);
- eti->old_cursor_row = -1;
- return;
- }
-
- if (! e_table_model_has_change_pending (eti->table_model)) {
- if (!eti->in_key_press) {
- eti_maybe_show_cursor(eti, DOUBLE_CLICK_TIME + 10);
- } else {
- eti_maybe_show_cursor(eti, 0);
- }
- }
-
- e_canvas_item_grab_focus(GNOME_CANVAS_ITEM(eti), FALSE);
- if (eti_editing(eti))
- e_table_item_leave_edit_(eti);
- g_signal_emit (eti, eti_signals [CURSOR_CHANGE], 0,
- view_row);
-
- e_table_item_redraw_row (eti, view_row);
-
- eti->old_cursor_row = view_row;
-}
-
-static void
-eti_cursor_activated (ESelectionModel *selection, int row, int col, ETableItem *eti)
-{
- int view_row;
- int view_col;
-
- if (!(GTK_OBJECT_FLAGS(eti) & GNOME_CANVAS_ITEM_REALIZED))
- return;
-
- view_row = model_to_view_row(eti, row);
- view_col = model_to_view_col(eti, col);
-
- if (view_row != -1 && view_col != -1) {
- if (! e_table_model_has_change_pending (eti->table_model)) {
- if (!eti->in_key_press) {
- eti_show_cursor(eti, DOUBLE_CLICK_TIME + 10);
- } else {
- eti_show_cursor(eti, 0);
- }
- eti_check_cursor_bounds (eti);
- }
- }
-
- if (eti_editing(eti))
- e_table_item_leave_edit_(eti);
-
- if (view_row != -1)
- g_signal_emit (eti, eti_signals [CURSOR_ACTIVATED], 0,
- view_row);
-}
-
-static void
-eti_selection_change (ESelectionModel *selection, ETableItem *eti)
-{
- if (!(GTK_OBJECT_FLAGS(eti) & GNOME_CANVAS_ITEM_REALIZED))
- return;
-
- eti->needs_redraw = TRUE;
- gnome_canvas_item_request_update(GNOME_CANVAS_ITEM(eti));
-}
-
-static void
-eti_selection_row_change (ESelectionModel *selection, int row, ETableItem *eti)
-{
- if (!(GTK_OBJECT_FLAGS(eti) & GNOME_CANVAS_ITEM_REALIZED))
- return;
-
- if (!eti->needs_redraw) {
- e_table_item_redraw_row (eti, model_to_view_row(eti, row));
- }
-}
-
-
-/**
- * e_table_item_enter_edit
- * @eti: %ETableItem which will start being edited
- * @col: The view col to edit.
- * @row: The view row to edit.
- *
- * This routine starts the given %ETableItem editing at the given view
- * column and row.
- */
-void
-e_table_item_enter_edit (ETableItem *eti, int col, int row)
-{
- g_return_if_fail (eti != NULL);
- g_return_if_fail (E_IS_TABLE_ITEM (eti));
-
- d(g_print("%s: %d, %d, eti_editing() = %s\n", __FUNCTION__, col, row, eti_editing(eti)?"true":"false"));
-
- if (eti_editing (eti))
- e_table_item_leave_edit_(eti);
-
- eti->editing_col = col;
- eti->editing_row = row;
-
- eti->edit_ctx = e_cell_enter_edit (eti->cell_views [col], view_to_model_col(eti, col), col, row);
-}
-
-/**
- * e_table_item_leave_edit_
- * @eti: %ETableItem which will stop being edited
- *
- * This routine stops the given %ETableItem from editing.
- */
-void
-e_table_item_leave_edit (ETableItem *eti)
-{
- int col, row;
- void *edit_ctx;
-
- g_return_if_fail (eti != NULL);
- g_return_if_fail (E_IS_TABLE_ITEM (eti));
-
- d(g_print("%s: eti_editing() = %s\n", __FUNCTION__, eti_editing(eti)?"true":"false"));
-
- if (!eti_editing (eti))
- return;
-
- col = eti->editing_col;
- row = eti->editing_row;
- edit_ctx = eti->edit_ctx;
-
- eti->editing_col = -1;
- eti->editing_row = -1;
- eti->edit_ctx = NULL;
-
- e_cell_leave_edit (eti->cell_views [col],
- view_to_model_col(eti, col),
- col, row, edit_ctx);
-}
-
-/**
- * e_table_item_compute_location
- * @eti: %ETableItem to look in.
- * @x: A pointer to the x location to find in the %ETableItem.
- * @y: A pointer to the y location to find in the %ETableItem.
- * @row: A pointer to the location to store the found row in.
- * @col: A pointer to the location to store the found col in.
- *
- * This routine locates the pixel location (*x, *y) in the
- * %ETableItem. If that location is in the %ETableItem, *row and *col
- * are set to the view row and column where it was found. If that
- * location is not in the %ETableItem, the height of the %ETableItem
- * is removed from the value y points to.
- */
-void
-e_table_item_compute_location (ETableItem *eti,
- int *x,
- int *y,
- int *row,
- int *col)
-{
- /* Save the grabbed row but make sure that we don't get flawed
- results because the cursor is grabbed. */
- int grabbed_row = eti->grabbed_row;
- eti->grabbed_row = -1;
-
- if (!find_cell (eti, *x, *y, col, row, NULL, NULL)) {
- *y -= eti->height;
- }
-
- eti->grabbed_row = grabbed_row;
-}
-
-void
-e_table_item_get_cell_geometry (ETableItem *eti,
- int *row,
- int *col,
- int *x,
- int *y,
- int *width,
- int *height)
-{
- if (eti->rows > *row) {
- if (x)
- *x = e_table_header_col_diff (eti->header, 0, *col);
- if (y)
- *y = e_table_item_row_diff (eti, 0, *row);
- if (width)
- *width = e_table_header_col_diff (eti->header, *col, *col + 1);
- if (height)
- *height = ETI_ROW_HEIGHT (eti, *row);
- *row = -1;
- *col = -1;
- } else {
- *row -= eti->rows;
- }
-}
-
-typedef struct {
- ETableItem *item;
- int rows_printed;
-} ETableItemPrintContext;
-
-static gdouble *
-e_table_item_calculate_print_widths (ETableHeader *eth, gdouble width)
-{
- int i;
- double extra;
- double expansion;
- int last_resizable = -1;
- gdouble scale = 1.0L;
- gdouble *widths = g_new(gdouble, e_table_header_count(eth));
- /* - 1 to account for the last pixel border. */
- extra = width - 1;
- expansion = 0;
- for (i = 0; i < eth->col_count; i++) {
- extra -= eth->columns[i]->min_width * scale;
- if (eth->columns[i]->resizable && eth->columns[i]->expansion > 0)
- last_resizable = i;
- expansion += eth->columns[i]->resizable ? eth->columns[i]->expansion : 0;
- widths[i] = eth->columns[i]->min_width * scale;
- }
- for (i = 0; i <= last_resizable; i++) {
- widths[i] += extra * (eth->columns[i]->resizable ? eth->columns[i]->expansion : 0)/expansion;
- }
-
- return widths;
-}
-
-static gdouble
-eti_printed_row_height (ETableItem *eti, gdouble *widths, GnomePrintContext *context, gint row)
-{
- int col;
- int cols = eti->cols;
- gdouble height = 0;
- for (col = 0; col < cols; col++) {
- ECellView *ecell_view = eti->cell_views [col];
- gdouble this_height = e_cell_print_height (ecell_view, context, view_to_model_col(eti, col), col, row,
- widths[col] - 1);
- if (this_height > height)
- height = this_height;
- }
- return height;
-}
-
-#define CHECK(x) if((x) == -1) return -1;
-
-static gint
-gp_draw_rect (GnomePrintContext *context, gdouble x, gdouble y, gdouble width, gdouble height)
-{
- CHECK(gnome_print_moveto(context, x, y));
- CHECK(gnome_print_lineto(context, x + width, y));
- CHECK(gnome_print_lineto(context, x + width, y - height));
- CHECK(gnome_print_lineto(context, x, y - height));
- CHECK(gnome_print_lineto(context, x, y));
- return gnome_print_fill(context);
-}
-
-static void
-e_table_item_print_page (EPrintable *ep,
- GnomePrintContext *context,
- gdouble width,
- gdouble height,
- gboolean quantize,
- ETableItemPrintContext *itemcontext)
-{
- ETableItem *eti = itemcontext->item;
- const int rows = eti->rows;
- const int cols = eti->cols;
- int rows_printed = itemcontext->rows_printed;
- gdouble *widths;
- int row, col;
- gdouble yd = height;
-
- widths = e_table_item_calculate_print_widths (itemcontext->item->header, width);
-
- /*
- * Draw cells
- */
- if (eti->horizontal_draw_grid){
- gp_draw_rect(context, 0, yd, width, 1);
- }
- yd--;
-
- for (row = rows_printed; row < rows; row++){
- gdouble xd = 1, row_height;
-
- row_height = eti_printed_row_height(eti, widths, context, row);
- if (quantize) {
- if (yd - row_height - 1 < 0 && row != rows_printed) {
- break;
- }
- } else {
- if (yd < 0) {
- break;
- }
- }
-
- for (col = 0; col < cols; col++){
- ECellView *ecell_view = eti->cell_views [col];
-
- if (gnome_print_gsave(context) == -1)
- /* FIXME */;
- if (gnome_print_translate(context, xd, yd - row_height) == -1)
- /* FIXME */;
-
- if (gnome_print_moveto(context, 0, 0) == -1)
- /* FIXME */;
- if (gnome_print_lineto(context, widths[col] - 1, 0) == -1)
- /* FIXME */;
- if (gnome_print_lineto(context, widths[col] - 1, row_height) == -1)
- /* FIXME */;
- if (gnome_print_lineto(context, 0, row_height) == -1)
- /* FIXME */;
- if (gnome_print_lineto(context, 0, 0) == -1)
- /* FIXME */;
- if (gnome_print_clip(context) == -1)
- /* FIXME */;
-
- e_cell_print (ecell_view, context, view_to_model_col(eti, col), col, row,
- widths[col] - 1, row_height);
-
- if (gnome_print_grestore(context) == -1)
- /* FIXME */;
-
- xd += widths[col];
- }
- yd -= row_height;
-
- if (eti->horizontal_draw_grid){
- gp_draw_rect(context, 0, yd, width, 1);
- }
- yd--;
- }
-
- itemcontext->rows_printed = row;
-
- if (eti->vertical_draw_grid){
- gdouble xd = 0;
-
- for (col = 0; col < cols; col++){
- gp_draw_rect(context, xd, height, 1, height - yd);
-
- xd += widths[col];
- }
- gp_draw_rect(context, xd, height, 1, height - yd);
- }
-
- g_free (widths);
-}
-
-static gboolean
-e_table_item_data_left (EPrintable *ep,
- ETableItemPrintContext *itemcontext)
-{
- ETableItem *item = itemcontext->item;
- int rows_printed = itemcontext->rows_printed;
-
- g_signal_stop_emission_by_name(ep, "data_left");
- return rows_printed < item->rows;
-}
-
-static void
-e_table_item_reset (EPrintable *ep,
- ETableItemPrintContext *itemcontext)
-{
- itemcontext->rows_printed = 0;
-}
-
-static gdouble
-e_table_item_height (EPrintable *ep,
- GnomePrintContext *context,
- gdouble width,
- gdouble max_height,
- gboolean quantize,
- ETableItemPrintContext *itemcontext)
-{
- ETableItem *item = itemcontext->item;
- const int rows = item->rows;
- int rows_printed = itemcontext->rows_printed;
- gdouble *widths;
- int row;
- gdouble yd = 0;
-
- widths = e_table_item_calculate_print_widths (itemcontext->item->header, width);
-
- /*
- * Draw cells
- */
- yd++;
-
- for (row = rows_printed; row < rows; row++){
- gdouble row_height;
-
- row_height = eti_printed_row_height(item, widths, context, row);
- if (quantize) {
- if (max_height != -1 && yd + row_height + 1 > max_height && row != rows_printed) {
- break;
- }
- } else {
- if (max_height != -1 && yd > max_height) {
- break;
- }
- }
-
- yd += row_height;
-
- yd++;
- }
-
- g_free (widths);
-
- if (max_height != -1 && (!quantize) && yd > max_height)
- yd = max_height;
-
- g_signal_stop_emission_by_name(ep, "height");
- return yd;
-}
-
-static gboolean
-e_table_item_will_fit (EPrintable *ep,
- GnomePrintContext *context,
- gdouble width,
- gdouble max_height,
- gboolean quantize,
- ETableItemPrintContext *itemcontext)
-{
- ETableItem *item = itemcontext->item;
- const int rows = item->rows;
- int rows_printed = itemcontext->rows_printed;
- gdouble *widths;
- int row;
- gdouble yd = 0;
- gboolean ret_val = TRUE;
-
- widths = e_table_item_calculate_print_widths (itemcontext->item->header, width);
-
- /*
- * Draw cells
- */
- yd++;
-
- for (row = rows_printed; row < rows; row++){
- gdouble row_height;
-
- row_height = eti_printed_row_height(item, widths, context, row);
- if (quantize) {
- if (max_height != -1 && yd + row_height + 1 > max_height && row != rows_printed) {
- ret_val = FALSE;
- break;
- }
- } else {
- if (max_height != -1 && yd > max_height) {
- ret_val = FALSE;
- break;
- }
- }
-
- yd += row_height;
-
- yd++;
- }
-
- g_free (widths);
-
- g_signal_stop_emission_by_name(ep, "will_fit");
- return ret_val;
-}
-
-static void
-e_table_item_printable_destroy (gpointer data,
- GObject *where_object_was)
-{
- ETableItemPrintContext *itemcontext = data;
-
- g_object_unref(itemcontext->item);
- g_free(itemcontext);
-}
-
-/**
- * e_table_item_get_printable
- * @eti: %ETableItem which will be printed
- *
- * This routine creates and returns an %EPrintable that can be used to
- * print the given %ETableItem.
- *
- * Returns: The %EPrintable.
- */
-EPrintable *
-e_table_item_get_printable (ETableItem *item)
-{
- EPrintable *printable = e_printable_new();
- ETableItemPrintContext *itemcontext;
-
- itemcontext = g_new(ETableItemPrintContext, 1);
- itemcontext->item = item;
- g_object_ref(item);
- itemcontext->rows_printed = 0;
-
- g_signal_connect (printable,
- "print_page",
- G_CALLBACK(e_table_item_print_page),
- itemcontext);
- g_signal_connect (printable,
- "data_left",
- G_CALLBACK(e_table_item_data_left),
- itemcontext);
- g_signal_connect (printable,
- "reset",
- G_CALLBACK(e_table_item_reset),
- itemcontext);
- g_signal_connect (printable,
- "height",
- G_CALLBACK(e_table_item_height),
- itemcontext);
- g_signal_connect (printable,
- "will_fit",
- G_CALLBACK(e_table_item_will_fit),
- itemcontext);
- g_object_weak_ref (G_OBJECT (printable),
- e_table_item_printable_destroy,
- itemcontext);
-
- return printable;
-}
diff --git a/widgets/table/e-table-item.h b/widgets/table/e-table-item.h
deleted file mode 100644
index ef22cd9ab7..0000000000
--- a/widgets/table/e-table-item.h
+++ /dev/null
@@ -1,227 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-table-item.h
- * Copyright 1999, 2000, 2001, Ximian, Inc.
- *
- * Authors:
- * Chris Lahey <clahey@ximian.com>
- * Miguel de Icaza <miguel@gnu.org>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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.
- */
-
-#ifndef _E_TABLE_ITEM_H_
-#define _E_TABLE_ITEM_H_
-
-#include <libgnomecanvas/gnome-canvas.h>
-#include <gal/e-table/e-table-model.h>
-#include <gal/e-table/e-table-header.h>
-#include <gal/e-table/e-table-defines.h>
-#include <gal/e-table/e-table-tooltip.h>
-#include <gal/widgets/e-selection-model.h>
-#include <gal/widgets/e-printable.h>
-
-G_BEGIN_DECLS
-
-#define E_TABLE_ITEM_TYPE (e_table_item_get_type ())
-#define E_TABLE_ITEM(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), E_TABLE_ITEM_TYPE, ETableItem))
-#define E_TABLE_ITEM_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), E_TABLE_ITEM_TYPE, ETableItemClass))
-#define E_IS_TABLE_ITEM(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), E_TABLE_ITEM_TYPE))
-#define E_IS_TABLE_ITEM_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), E_TABLE_ITEM_TYPE))
-
-typedef struct {
- GnomeCanvasItem parent;
- ETableModel *table_model;
- ETableHeader *header;
-
- ETableModel *source_model;
- ESelectionModel *selection;
-
- int x1, y1;
- int minimum_width, width, height;
-
- int cols, rows;
-
- int click_count;
-
- /*
- * Ids for the signals we connect to
- */
- int header_dim_change_id;
- int header_structure_change_id;
- int header_request_width_id;
- int table_model_pre_change_id;
- int table_model_no_change_id;
- int table_model_change_id;
- int table_model_row_change_id;
- int table_model_cell_change_id;
- int table_model_rows_inserted_id;
- int table_model_rows_deleted_id;
-
- int selection_change_id;
- int selection_row_change_id;
- int cursor_change_id;
- int cursor_activated_id;
-
- guint cursor_idle_id;
-
- /* View row, -1 means unknown */
- int old_cursor_row;
-
- int hadjustment_change_id;
- int hadjustment_value_change_id;
- int vadjustment_change_id;
- int vadjustment_value_change_id;
-
- GdkGC *fill_gc;
- GdkGC *grid_gc;
- GdkGC *focus_gc;
- GdkBitmap *stipple;
-
- guint alternating_row_colors:1;
- guint horizontal_draw_grid:1;
- guint vertical_draw_grid:1;
- guint draw_focus:1;
- guint uniform_row_height:1;
- guint cell_views_realized:1;
-
- guint needs_redraw : 1;
- guint needs_compute_height : 1;
- guint needs_compute_width : 1;
-
- guint uses_source_model : 1;
-
- guint in_key_press : 1;
-
- guint maybe_in_drag : 1;
- guint in_drag : 1;
- guint grabbed : 1;
-
- guint maybe_did_something : 1;
-
- guint cursor_on_screen : 1;
- guint gtk_grabbed : 1;
-
- guint queue_show_cursor : 1;
- guint grab_cancelled : 1;
-
- int frozen_count;
-
- int cursor_x1;
- int cursor_y1;
- int cursor_x2;
- int cursor_y2;
-
- int drag_col;
- int drag_row;
- int drag_x;
- int drag_y;
- guint drag_state;
-
- /*
- * Realized views, per column
- */
- ECellView **cell_views;
- int n_cells;
-
- int *height_cache;
- int uniform_row_height_cache;
- int height_cache_idle_id;
- int height_cache_idle_count;
-
- /*
- * Lengh Threshold: above this, we stop computing correctly
- * the size
- */
- int length_threshold;
-
- gint row_guess;
- ECursorMode cursor_mode;
-
- /*
- * During editing
- */
- int editing_col, editing_row;
- void *edit_ctx;
-
- int save_col, save_row;
- void *save_state;
-
- int grabbed_col, grabbed_row;
- int grabbed_count;
-
- /*
- * Tooltip
- */
- ETableTooltip *tooltip;
-
-} ETableItem;
-
-typedef struct {
- GnomeCanvasItemClass parent_class;
-
- void (*cursor_change) (ETableItem *eti, int row);
- void (*cursor_activated) (ETableItem *eti, int row);
- void (*double_click) (ETableItem *eti, int row, int col, GdkEvent *event);
- gint (*right_click) (ETableItem *eti, int row, int col, GdkEvent *event);
- gint (*click) (ETableItem *eti, int row, int col, GdkEvent *event);
- gint (*key_press) (ETableItem *eti, int row, int col, GdkEvent *event);
- gint (*start_drag) (ETableItem *eti, int row, int col, GdkEvent *event);
- void (*style_set) (ETableItem *eti, GtkStyle *previous_style);
-} ETableItemClass;
-GType e_table_item_get_type (void);
-
-
-/*
- * Focus
- */
-void e_table_item_set_cursor (ETableItem *eti,
- int col,
- int row);
-
-gint e_table_item_get_focused_column (ETableItem *eti);
-
-void e_table_item_leave_edit (ETableItem *eti);
-void e_table_item_enter_edit (ETableItem *eti,
- int col,
- int row);
-
-void e_table_item_redraw_range (ETableItem *eti,
- int start_col,
- int start_row,
- int end_col,
- int end_row);
-
-EPrintable *e_table_item_get_printable (ETableItem *eti);
-void e_table_item_compute_location (ETableItem *eti,
- int *x,
- int *y,
- int *row,
- int *col);
-void e_table_item_get_cell_geometry (ETableItem *eti,
- int *row,
- int *col,
- int *x,
- int *y,
- int *width,
- int *height);
-
-int e_table_item_row_diff (ETableItem *eti,
- int start_row,
- int end_row);
-
-G_END_DECLS
-
-#endif /* _E_TABLE_ITEM_H_ */
diff --git a/widgets/table/e-table-memory-callbacks.c b/widgets/table/e-table-memory-callbacks.c
deleted file mode 100644
index 6cd1b9c8a1..0000000000
--- a/widgets/table/e-table-memory-callbacks.c
+++ /dev/null
@@ -1,208 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-table-memory-callbacks.c
- * Copyright 2000, 2001, Ximian, Inc.
- *
- * Authors:
- * Chris Lahey <clahey@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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 "e-table-memory-callbacks.h"
-#include "gal/util/e-util.h"
-
-static int
-etmc_column_count (ETableModel *etm)
-{
- ETableMemoryCalbacks *etmc = E_TABLE_MEMORY_CALLBACKS(etm);
-
- if (etmc->col_count)
- return etmc->col_count (etm, etmc->data);
- else
- return 0;
-}
-
-static void *
-etmc_value_at (ETableModel *etm, int col, int row)
-{
- ETableMemoryCalbacks *etmc = E_TABLE_MEMORY_CALLBACKS(etm);
-
- if (etmc->value_at)
- return etmc->value_at (etm, col, row, etmc->data);
- else
- return NULL;
-}
-
-static void
-etmc_set_value_at (ETableModel *etm, int col, int row, const void *val)
-{
- ETableMemoryCalbacks *etmc = E_TABLE_MEMORY_CALLBACKS(etm);
-
- if (etmc->set_value_at)
- etmc->set_value_at (etm, col, row, val, etmc->data);
-}
-
-static gboolean
-etmc_is_cell_editable (ETableModel *etm, int col, int row)
-{
- ETableMemoryCalbacks *etmc = E_TABLE_MEMORY_CALLBACKS(etm);
-
- if (etmc->is_cell_editable)
- return etmc->is_cell_editable (etm, col, row, etmc->data);
- else
- return FALSE;
-}
-
-/* The default for etmc_duplicate_value is to return the raw value. */
-static void *
-etmc_duplicate_value (ETableModel *etm, int col, const void *value)
-{
- ETableMemoryCalbacks *etmc = E_TABLE_MEMORY_CALLBACKS(etm);
-
- if (etmc->duplicate_value)
- return etmc->duplicate_value (etm, col, value, etmc->data);
- else
- return (void *)value;
-}
-
-static void
-etmc_free_value (ETableModel *etm, int col, void *value)
-{
- ETableMemoryCalbacks *etmc = E_TABLE_MEMORY_CALLBACKS(etm);
-
- if (etmc->free_value)
- etmc->free_value (etm, col, value, etmc->data);
-}
-
-static void *
-etmc_initialize_value (ETableModel *etm, int col)
-{
- ETableMemoryCalbacks *etmc = E_TABLE_MEMORY_CALLBACKS(etm);
-
- if (etmc->initialize_value)
- return etmc->initialize_value (etm, col, etmc->data);
- else
- return NULL;
-}
-
-static gboolean
-etmc_value_is_empty (ETableModel *etm, int col, const void *value)
-{
- ETableMemoryCalbacks *etmc = E_TABLE_MEMORY_CALLBACKS(etm);
-
- if (etmc->value_is_empty)
- return etmc->value_is_empty (etm, col, value, etmc->data);
- else
- return FALSE;
-}
-
-static char *
-etmc_value_to_string (ETableModel *etm, int col, const void *value)
-{
- ETableMemoryCalbacks *etmc = E_TABLE_MEMORY_CALLBACKS(etm);
-
- if (etmc->value_to_string)
- return etmc->value_to_string (etm, col, value, etmc->data);
- else
- return g_strdup ("");
-}
-
-static void
-etmc_append_row (ETableModel *etm, ETableModel *source, int row)
-{
- ETableMemoryCalbacks *etmc = E_TABLE_MEMORY_CALLBACKS(etm);
-
- if (etmc->append_row)
- etmc->append_row (etm, source, row, etmc->data);
-}
-
-static void
-e_table_memory_callbacks_class_init (GObjectClass *object_class)
-{
- ETableModelClass *model_class = (ETableModelClass *) object_class;
-
- model_class->column_count = etmc_column_count;
- model_class->value_at = etmc_value_at;
- model_class->set_value_at = etmc_set_value_at;
- model_class->is_cell_editable = etmc_is_cell_editable;
- model_class->duplicate_value = etmc_duplicate_value;
- model_class->free_value = etmc_free_value;
- model_class->initialize_value = etmc_initialize_value;
- model_class->value_is_empty = etmc_value_is_empty;
- model_class->value_to_string = etmc_value_to_string;
- model_class->append_row = etmc_append_row;
-
-}
-
-E_MAKE_TYPE(e_table_memory_callbacks, "ETableMemoryCalbacks", ETableMemoryCalbacks, e_table_memory_callbacks_class_init, NULL, E_TABLE_MEMORY_TYPE)
-
-
-/**
- * e_table_memory_callbacks_new:
- * @col_count:
- * @value_at:
- * @set_value_at:
- * @is_cell_editable:
- * @duplicate_value:
- * @free_value:
- * @initialize_value:
- * @value_is_empty:
- * @value_to_string:
- * @data: closure pointer.
- *
- * This initializes a new ETableMemoryCalbacksModel object. ETableMemoryCalbacksModel is
- * an implementaiton of the abstract class ETableModel. The ETableMemoryCalbacksModel
- * is designed to allow people to easily create ETableModels without having
- * to create a new GtkType derived from ETableModel every time they need one.
- *
- * Instead, ETableMemoryCalbacksModel uses a setup based in callback functions, every
- * callback function signature mimics the signature of each ETableModel method
- * and passes the extra @data pointer to each one of the method to provide them
- * with any context they might want to use.
- *
- * Returns: An ETableMemoryCalbacksModel object (which is also an ETableModel
- * object).
- */
-ETableModel *
-e_table_memory_callbacks_new (ETableMemoryCalbacksColumnCountFn col_count,
- ETableMemoryCalbacksValueAtFn value_at,
- ETableMemoryCalbacksSetValueAtFn set_value_at,
- ETableMemoryCalbacksIsCellEditableFn is_cell_editable,
- ETableMemoryCalbacksDuplicateValueFn duplicate_value,
- ETableMemoryCalbacksFreeValueFn free_value,
- ETableMemoryCalbacksInitializeValueFn initialize_value,
- ETableMemoryCalbacksValueIsEmptyFn value_is_empty,
- ETableMemoryCalbacksValueToStringFn value_to_string,
- void *data)
-{
- ETableMemoryCalbacks *et;
-
- et = g_object_new (E_TABLE_MEMORY_CALLBACKS_TYPE, NULL);
-
- et->col_count = col_count;
- et->value_at = value_at;
- et->set_value_at = set_value_at;
- et->is_cell_editable = is_cell_editable;
- et->duplicate_value = duplicate_value;
- et->free_value = free_value;
- et->initialize_value = initialize_value;
- et->value_is_empty = value_is_empty;
- et->value_to_string = value_to_string;
- et->data = data;
-
- return (ETableModel *) et;
- }
diff --git a/widgets/table/e-table-memory-callbacks.h b/widgets/table/e-table-memory-callbacks.h
deleted file mode 100644
index 599ffa01f3..0000000000
--- a/widgets/table/e-table-memory-callbacks.h
+++ /dev/null
@@ -1,91 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-table-memory-callbacks.h
- * Copyright 2000, 2001, Ximian, Inc.
- *
- * Authors:
- * Chris Lahey <clahey@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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.
- */
-
-#ifndef _E_TABLE_MEMORY_CALLBACKS_H_
-#define _E_TABLE_MEMORY_CALLBACKS_H_
-
-#include <gal/e-table/e-table-memory.h>
-
-G_BEGIN_DECLS
-
-#define E_TABLE_MEMORY_CALLBACKS_TYPE (e_table_memory_callbacks_get_type ())
-#define E_TABLE_MEMORY_CALLBACKS(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), E_TABLE_MEMORY_CALLBACKS_TYPE, ETableMemoryCalbacks))
-#define E_TABLE_MEMORY_CALLBACKS_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), E_TABLE_MEMORY_CALLBACKS_TYPE, ETableMemoryCalbacksClass))
-#define E_IS_TABLE_MEMORY_CALLBACKS(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), E_TABLE_MEMORY_CALLBACKS_TYPE))
-#define E_IS_TABLE_MEMORY_CALLBACKS_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), E_TABLE_MEMORY_CALLBACKS_TYPE))
-#define E_TABLE_MEMORY_CALLBACKS_GET_CLASS(k) (G_TYPE_INSTANCE_GET_CLASS((k), E_TABLE_MEMORY_CALLBACKS_TYPE, ETableMemoryCalbacksClass))
-
-typedef int (*ETableMemoryCalbacksColumnCountFn) (ETableModel *etm, void *data);
-typedef void (*ETableMemoryCalbacksAppendRowFn) (ETableModel *etm, ETableModel *model, int row, void *data);
-
-typedef void *(*ETableMemoryCalbacksValueAtFn) (ETableModel *etm, int col, int row, void *data);
-typedef void (*ETableMemoryCalbacksSetValueAtFn) (ETableModel *etm, int col, int row, const void *val, void *data);
-typedef gboolean (*ETableMemoryCalbacksIsCellEditableFn) (ETableModel *etm, int col, int row, void *data);
-
-typedef void *(*ETableMemoryCalbacksDuplicateValueFn) (ETableModel *etm, int col, const void *val, void *data);
-typedef void (*ETableMemoryCalbacksFreeValueFn) (ETableModel *etm, int col, void *val, void *data);
-typedef void *(*ETableMemoryCalbacksInitializeValueFn) (ETableModel *etm, int col, void *data);
-typedef gboolean (*ETableMemoryCalbacksValueIsEmptyFn) (ETableModel *etm, int col, const void *val, void *data);
-typedef char *(*ETableMemoryCalbacksValueToStringFn) (ETableModel *etm, int col, const void *val, void *data);
-
-typedef struct {
- ETableMemory parent;
-
- ETableMemoryCalbacksColumnCountFn col_count;
- ETableMemoryCalbacksAppendRowFn append_row;
-
- ETableMemoryCalbacksValueAtFn value_at;
- ETableMemoryCalbacksSetValueAtFn set_value_at;
- ETableMemoryCalbacksIsCellEditableFn is_cell_editable;
-
- ETableMemoryCalbacksDuplicateValueFn duplicate_value;
- ETableMemoryCalbacksFreeValueFn free_value;
- ETableMemoryCalbacksInitializeValueFn initialize_value;
- ETableMemoryCalbacksValueIsEmptyFn value_is_empty;
- ETableMemoryCalbacksValueToStringFn value_to_string;
- void *data;
-} ETableMemoryCalbacks;
-
-typedef struct {
- ETableMemoryClass parent_class;
-} ETableMemoryCalbacksClass;
-
-GType e_table_memory_callbacks_get_type (void);
-
-ETableModel *e_table_memory_callbacks_new (ETableMemoryCalbacksColumnCountFn col_count,
-
- ETableMemoryCalbacksValueAtFn value_at,
- ETableMemoryCalbacksSetValueAtFn set_value_at,
- ETableMemoryCalbacksIsCellEditableFn is_cell_editable,
-
- ETableMemoryCalbacksDuplicateValueFn duplicate_value,
- ETableMemoryCalbacksFreeValueFn free_value,
- ETableMemoryCalbacksInitializeValueFn initialize_value,
- ETableMemoryCalbacksValueIsEmptyFn value_is_empty,
- ETableMemoryCalbacksValueToStringFn value_to_string,
- void *data);
-
-G_END_DECLS
-
-#endif /* _E_TABLE_MEMORY_CALLBACKS_H_ */
-
diff --git a/widgets/table/e-table-memory-store.c b/widgets/table/e-table-memory-store.c
deleted file mode 100644
index 69765b32ab..0000000000
--- a/widgets/table/e-table-memory-store.c
+++ /dev/null
@@ -1,583 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-table-memory-store.c
- * Copyright 2000, 2001, Ximian, Inc.
- *
- * Authors:
- * Chris Lahey <clahey@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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 <string.h>
-#include "e-table-memory-store.h"
-#include "gal/util/e-util.h"
-
-#define STORE_LOCATOR(etms, col, row) (*((etms)->priv->store + (row) * (etms)->priv->col_count + (col)))
-
-static ETableMemoryClass *parent_class;
-
-struct _ETableMemoryStorePrivate {
- int col_count;
- ETableMemoryStoreColumnInfo *columns;
- void **store;
-};
-
-static void *
-duplicate_value (ETableMemoryStore *etms, int col, const void *val)
-{
- switch (etms->priv->columns[col].type) {
- case E_TABLE_MEMORY_STORE_COLUMN_TYPE_STRING:
- return g_strdup (val);
- case E_TABLE_MEMORY_STORE_COLUMN_TYPE_PIXBUF:
- if (val)
- gdk_pixbuf_ref ((void *) val);
- return (void *) val;
- case E_TABLE_MEMORY_STORE_COLUMN_TYPE_OBJECT:
- if (val)
- g_object_ref ((void *) val);
- return (void *) val;
- case E_TABLE_MEMORY_STORE_COLUMN_TYPE_CUSTOM:
- if (etms->priv->columns[col].custom.duplicate_value)
- return etms->priv->columns[col].custom.duplicate_value (E_TABLE_MODEL (etms), col, val, NULL);
- break;
- default:
- break;
- }
- return (void *) val;
-}
-
-static void
-free_value (ETableMemoryStore *etms, int col, void *value)
-{
- switch (etms->priv->columns[col].type) {
- case E_TABLE_MEMORY_STORE_COLUMN_TYPE_STRING:
- g_free (value);
- break;
- case E_TABLE_MEMORY_STORE_COLUMN_TYPE_PIXBUF:
- if (value)
- gdk_pixbuf_unref (value);
- break;
- case E_TABLE_MEMORY_STORE_COLUMN_TYPE_OBJECT:
- if (value)
- g_object_unref (value);
- break;
- case E_TABLE_MEMORY_STORE_COLUMN_TYPE_CUSTOM:
- if (etms->priv->columns[col].custom.free_value)
- etms->priv->columns[col].custom.free_value (E_TABLE_MODEL (etms), col, value, NULL);
- break;
- default:
- break;
- }
-}
-
-
-static int
-etms_column_count (ETableModel *etm)
-{
- ETableMemoryStore *etms = E_TABLE_MEMORY_STORE(etm);
-
- return etms->priv->col_count;
-}
-
-static void *
-etms_value_at (ETableModel *etm, int col, int row)
-{
- ETableMemoryStore *etms = E_TABLE_MEMORY_STORE(etm);
-
- return STORE_LOCATOR (etms, col, row);
-}
-
-static void
-etms_set_value_at (ETableModel *etm, int col, int row, const void *val)
-{
- ETableMemoryStore *etms = E_TABLE_MEMORY_STORE(etm);
-
- e_table_model_pre_change (etm);
-
- STORE_LOCATOR (etms, col, row) = duplicate_value (etms, col, val);
-
- e_table_model_cell_changed (etm, col, row);
-}
-
-static gboolean
-etms_is_cell_editable (ETableModel *etm, int col, int row)
-{
- ETableMemoryStore *etms = E_TABLE_MEMORY_STORE(etm);
-
- return etms->priv->columns[col].editable;
-}
-
-/* The default for etms_duplicate_value is to return the raw value. */
-static void *
-etms_duplicate_value (ETableModel *etm, int col, const void *value)
-{
- ETableMemoryStore *etms = E_TABLE_MEMORY_STORE(etm);
-
- return duplicate_value (etms, col, value);
-}
-
-static void
-etms_free_value (ETableModel *etm, int col, void *value)
-{
- ETableMemoryStore *etms = E_TABLE_MEMORY_STORE(etm);
-
- free_value (etms, col, value);
-}
-
-static void *
-etms_initialize_value (ETableModel *etm, int col)
-{
- ETableMemoryStore *etms = E_TABLE_MEMORY_STORE(etm);
-
- switch (etms->priv->columns[col].type) {
- case E_TABLE_MEMORY_STORE_COLUMN_TYPE_STRING:
- return g_strdup ("");
- case E_TABLE_MEMORY_STORE_COLUMN_TYPE_PIXBUF:
- return NULL;
- case E_TABLE_MEMORY_STORE_COLUMN_TYPE_CUSTOM:
- case E_TABLE_MEMORY_STORE_COLUMN_TYPE_OBJECT:
- if (etms->priv->columns[col].custom.initialize_value)
- return etms->priv->columns[col].custom.initialize_value (E_TABLE_MODEL (etms), col, NULL);
- break;
- default:
- break;
- }
- return 0;
-}
-
-static gboolean
-etms_value_is_empty (ETableModel *etm, int col, const void *value)
-{
- ETableMemoryStore *etms = E_TABLE_MEMORY_STORE(etm);
-
- switch (etms->priv->columns[col].type) {
- case E_TABLE_MEMORY_STORE_COLUMN_TYPE_STRING:
- return !(value && *(char *) value);
- case E_TABLE_MEMORY_STORE_COLUMN_TYPE_PIXBUF:
- return value == NULL;
- case E_TABLE_MEMORY_STORE_COLUMN_TYPE_CUSTOM:
- case E_TABLE_MEMORY_STORE_COLUMN_TYPE_OBJECT:
- if (etms->priv->columns[col].custom.value_is_empty)
- return etms->priv->columns[col].custom.value_is_empty (E_TABLE_MODEL (etms), col, value, NULL);
- break;
- default:
- break;
- }
- return value == 0;
-}
-
-static char *
-etms_value_to_string (ETableModel *etm, int col, const void *value)
-{
- ETableMemoryStore *etms = E_TABLE_MEMORY_STORE(etm);
-
- switch (etms->priv->columns[col].type) {
- case E_TABLE_MEMORY_STORE_COLUMN_TYPE_STRING:
- return g_strdup (value);
- case E_TABLE_MEMORY_STORE_COLUMN_TYPE_PIXBUF:
- return g_strdup ("");
- case E_TABLE_MEMORY_STORE_COLUMN_TYPE_CUSTOM:
- case E_TABLE_MEMORY_STORE_COLUMN_TYPE_OBJECT:
- if (etms->priv->columns[col].custom.value_is_empty)
- return etms->priv->columns[col].custom.value_to_string (E_TABLE_MODEL (etms), col, value, NULL);
- break;
- default:
- break;
- }
- return g_strdup_printf ("%d", GPOINTER_TO_INT (value));
-}
-
-static void
-etms_append_row (ETableModel *etm, ETableModel *source, int row)
-{
- ETableMemoryStore *etms = E_TABLE_MEMORY_STORE(etm);
- void **new_data;
- int i;
- int row_count;
-
- new_data = g_new (void *, etms->priv->col_count);
-
- for (i = 0; i < etms->priv->col_count; i++) {
- new_data[i] = e_table_model_value_at (source, i, row);
- }
-
- row_count = e_table_model_row_count (E_TABLE_MODEL (etms));
-
- e_table_memory_store_insert_array (etms, row_count, new_data, NULL);
-}
-
-static void
-etms_finalize (GObject *obj)
-{
- ETableMemoryStore *etms = (ETableMemoryStore *) obj;
-
- if (etms->priv) {
- e_table_memory_store_clear (etms);
-
- g_free (etms->priv->columns);
- g_free (etms->priv->store);
- g_free (etms->priv);
- }
-
- if (G_OBJECT_CLASS (parent_class)->finalize)
- G_OBJECT_CLASS (parent_class)->finalize (obj);
-}
-
-static void
-e_table_memory_store_init (ETableMemoryStore *etms)
-{
- etms->priv = g_new (ETableMemoryStorePrivate, 1);
-
- etms->priv->col_count = 0;
- etms->priv->columns = NULL;
- etms->priv->store = NULL;
-}
-
-static void
-e_table_memory_store_class_init (GObjectClass *object_class)
-{
- ETableModelClass *model_class = (ETableModelClass *) object_class;
-
- parent_class = g_type_class_peek_parent (object_class);
-
- object_class->finalize = etms_finalize;
-
- model_class->column_count = etms_column_count;
- model_class->value_at = etms_value_at;
- model_class->set_value_at = etms_set_value_at;
- model_class->is_cell_editable = etms_is_cell_editable;
- model_class->duplicate_value = etms_duplicate_value;
- model_class->free_value = etms_free_value;
- model_class->initialize_value = etms_initialize_value;
- model_class->value_is_empty = etms_value_is_empty;
- model_class->value_to_string = etms_value_to_string;
- model_class->append_row = etms_append_row;
-}
-
-E_MAKE_TYPE(e_table_memory_store, "ETableMemoryStore", ETableMemoryStore, e_table_memory_store_class_init, e_table_memory_store_init, E_TABLE_MEMORY_TYPE)
-
-/**
- * e_table_memory_store_new:
- * @col_count:
- * @value_at:
- * @set_value_at:
- * @is_cell_editable:
- * @duplicate_value:
- * @free_value:
- * @initialize_value:
- * @value_is_empty:
- * @value_to_string:
- * @data: closure pointer.
- *
- * This initializes a new ETableMemoryStoreModel object. ETableMemoryStoreModel is
- * an implementaiton of the abstract class ETableModel. The ETableMemoryStoreModel
- * is designed to allow people to easily create ETableModels without having
- * to create a new GtkType derived from ETableModel every time they need one.
- *
- * Instead, ETableMemoryStoreModel uses a setup based in callback functions, every
- * callback function signature mimics the signature of each ETableModel method
- * and passes the extra @data pointer to each one of the method to provide them
- * with any context they might want to use.
- *
- * Returns: An ETableMemoryStoreModel object (which is also an ETableModel
- * object).
- */
-ETableModel *
-e_table_memory_store_new (ETableMemoryStoreColumnInfo *columns)
-{
- ETableMemoryStore *et = g_object_new (E_TABLE_MEMORY_STORE_TYPE, NULL);
-
- if (e_table_memory_store_construct (et, columns)) {
- return (ETableModel *) et;
- } else {
- g_object_unref (et);
- return NULL;
- }
-}
-
-ETableModel *
-e_table_memory_store_construct (ETableMemoryStore *etms, ETableMemoryStoreColumnInfo *columns)
-{
- int i;
- for (i = 0; columns[i].type != E_TABLE_MEMORY_STORE_COLUMN_TYPE_TERMINATOR; i++)
- /* Intentionally blank */;
- etms->priv->col_count = i;
-
- etms->priv->columns = g_new (ETableMemoryStoreColumnInfo, etms->priv->col_count + 1);
-
- memcpy (etms->priv->columns, columns, (etms->priv->col_count + 1) * sizeof (ETableMemoryStoreColumnInfo));
-
- return E_TABLE_MODEL (etms);
-}
-
-
-void
-e_table_memory_store_adopt_value_at (ETableMemoryStore *etms, int col, int row, void *value)
-{
- e_table_model_pre_change (E_TABLE_MODEL (etms));
-
- STORE_LOCATOR (etms, col, row) = value;
-
- e_table_model_cell_changed (E_TABLE_MODEL (etms), col, row);
-}
-
-/* The size of these arrays is the number of columns. */
-void
-e_table_memory_store_insert_array (ETableMemoryStore *etms, int row, void **store, gpointer data)
-{
- int row_count;
- int i;
-
- row_count = e_table_model_row_count (E_TABLE_MODEL (etms)) + 1;
- if (row == -1)
- row = row_count - 1;
- etms->priv->store = g_realloc (etms->priv->store, etms->priv->col_count * row_count * sizeof (void *));
- memmove (etms->priv->store + etms->priv->col_count * (row + 1),
- etms->priv->store + etms->priv->col_count * row,
- etms->priv->col_count * (row_count - row - 1) * sizeof (void *));
-
- for (i = 0; i < etms->priv->col_count; i++) {
- STORE_LOCATOR(etms, i, row) = duplicate_value(etms, i, store[i]);
- }
-
- e_table_memory_insert (E_TABLE_MEMORY (etms), row, data);
-}
-
-void
-e_table_memory_store_insert (ETableMemoryStore *etms, int row, gpointer data, ...)
-{
- void **store;
- va_list args;
- int i;
-
- store = g_new (void *, etms->priv->col_count + 1);
-
- va_start (args, data);
- for (i = 0; i < etms->priv->col_count; i++) {
- store[i] = va_arg (args, void *);
- }
- va_end (args);
-
- e_table_memory_store_insert_array (etms, row, store, data);
-
- g_free (store);
-}
-
-void
-e_table_memory_store_insert_adopt_array (ETableMemoryStore *etms, int row, void **store, gpointer data)
-{
- int row_count;
- int i;
-
- row_count = e_table_model_row_count (E_TABLE_MODEL (etms)) + 1;
- if (row == -1)
- row = row_count - 1;
- etms->priv->store = g_realloc (etms->priv->store, etms->priv->col_count * row_count * sizeof (void *));
- memmove (etms->priv->store + etms->priv->col_count * (row + 1),
- etms->priv->store + etms->priv->col_count * row,
- etms->priv->col_count * (row_count - row - 1) * sizeof (void *));
-
- for (i = 0; i < etms->priv->col_count; i++) {
- STORE_LOCATOR(etms, i, row) = store[i];
- }
-
- e_table_memory_insert (E_TABLE_MEMORY (etms), row, data);
-}
-
-void
-e_table_memory_store_insert_adopt (ETableMemoryStore *etms, int row, gpointer data, ...)
-{
- void **store;
- va_list args;
- int i;
-
- store = g_new (void *, etms->priv->col_count + 1);
-
- va_start (args, data);
- for (i = 0; i < etms->priv->col_count; i++) {
- store[i] = va_arg (args, void *);
- }
- va_end (args);
-
- e_table_memory_store_insert_adopt_array (etms, row, store, data);
-
- g_free (store);
-}
-
-/**
- * e_table_memory_store_change_array:
- * @etms: the ETabelMemoryStore.
- * @row: the row we're changing.
- * @store: an array of new values to fill the row
- * @data: the new closure to associate with this row.
- *
- * frees existing values associated with a row and replaces them with
- * duplicates of the values in store.
- *
- */
-void
-e_table_memory_store_change_array (ETableMemoryStore *etms, int row, void **store, gpointer data)
-{
- int i;
-
- g_return_if_fail (row >= 0 && row < e_table_model_row_count (E_TABLE_MODEL (etms)));
-
- e_table_model_pre_change (E_TABLE_MODEL (etms));
-
- for (i = 0; i < etms->priv->col_count; i++) {
- free_value (etms, i, STORE_LOCATOR(etms, i, row));
- STORE_LOCATOR(etms, i, row) = duplicate_value(etms, i, store[i]);
- }
-
- e_table_memory_set_data (E_TABLE_MEMORY (etms), row, data);
- e_table_model_row_changed (E_TABLE_MODEL (etms), row);
-}
-
-/**
- * e_table_memory_store_change:
- * @etms: the ETabelMemoryStore.
- * @row: the row we're changing.
- * @data: the new closure to associate with this row.
- *
- * a varargs version of e_table_memory_store_change_array. you must
- * pass in etms->col_count args.
- */
-void
-e_table_memory_store_change (ETableMemoryStore *etms, int row, gpointer data, ...)
-{
- void **store;
- va_list args;
- int i;
-
- g_return_if_fail (row >= 0 && row < e_table_model_row_count (E_TABLE_MODEL (etms)));
-
- store = g_new0 (void *, etms->priv->col_count + 1);
-
- va_start (args, data);
- for (i = 0; i < etms->priv->col_count; i++) {
- store[i] = va_arg (args, void *);
- }
- va_end (args);
-
- e_table_memory_store_change_array (etms, row, store, data);
-
- g_free (store);
-}
-
-/**
- * e_table_memory_store_change_adopt_array:
- * @etms: the ETableMemoryStore
- * @row: the row we're changing.
- * @store: an array of new values to fill the row
- * @data: the new closure to associate with this row.
- *
- * frees existing values for the row and stores the values from store
- * into it. This function differs from
- * e_table_memory_storage_change_adopt_array in that it does not
- * duplicate the data.
- */
-void
-e_table_memory_store_change_adopt_array (ETableMemoryStore *etms, int row, void **store, gpointer data)
-{
- int i;
-
- g_return_if_fail (row >= 0 && row < e_table_model_row_count (E_TABLE_MODEL (etms)));
-
- for (i = 0; i < etms->priv->col_count; i++) {
- free_value (etms, i, STORE_LOCATOR(etms, i, row));
- STORE_LOCATOR(etms, i, row) = store[i];
- }
-
- e_table_memory_set_data (E_TABLE_MEMORY (etms), row, data);
- e_table_model_row_changed (E_TABLE_MODEL (etms), row);
-}
-
-/**
- * e_table_memory_store_change_adopt
- * @etms: the ETabelMemoryStore.
- * @row: the row we're changing.
- * @data: the new closure to associate with this row.
- *
- * a varargs version of e_table_memory_store_change_adopt_array. you
- * must pass in etms->col_count args.
- */
-void
-e_table_memory_store_change_adopt (ETableMemoryStore *etms, int row, gpointer data, ...)
-{
- void **store;
- va_list args;
- int i;
-
- g_return_if_fail (row >= 0 && row < e_table_model_row_count (E_TABLE_MODEL (etms)));
-
- store = g_new0 (void *, etms->priv->col_count + 1);
-
- va_start (args, data);
- for (i = 0; i < etms->priv->col_count; i++) {
- store[i] = va_arg (args, void *);
- }
- va_end (args);
-
- e_table_memory_store_change_adopt_array (etms, row, store, data);
-
- g_free (store);
-}
-
-void
-e_table_memory_store_remove (ETableMemoryStore *etms, int row)
-{
- ETableModel *model;
- int column_count, row_count;
- int i;
-
- model = E_TABLE_MODEL (etms);
- column_count = e_table_model_column_count (model);
-
- for (i = 0; i < column_count; i ++)
- e_table_model_free_value (model, i, e_table_model_value_at (model, i, row));
-
- row_count = e_table_model_row_count (E_TABLE_MODEL (etms)) - 1;
- memmove (etms->priv->store + etms->priv->col_count * row,
- etms->priv->store + etms->priv->col_count * (row + 1),
- etms->priv->col_count * (row_count - row) * sizeof (void *));
- etms->priv->store = g_realloc (etms->priv->store, etms->priv->col_count * row_count * sizeof (void *));
-
- e_table_memory_remove (E_TABLE_MEMORY (etms), row);
-}
-
-void
-e_table_memory_store_clear (ETableMemoryStore *etms)
-{
- ETableModel *model;
- int row_count, column_count;
- int i, j;
-
- model = E_TABLE_MODEL (etms);
- row_count = e_table_model_row_count (model);
- column_count = e_table_model_column_count (model);
-
- for (i = 0; i < row_count; i ++) {
- for (j = 0; j < column_count; j ++) {
- e_table_model_free_value (model, j, e_table_model_value_at (model, j, i));
- }
- }
-
- e_table_memory_clear (E_TABLE_MEMORY (etms));
-
- g_free (etms->priv->store);
- etms->priv->store = NULL;
-}
diff --git a/widgets/table/e-table-memory-store.h b/widgets/table/e-table-memory-store.h
deleted file mode 100644
index 54306da236..0000000000
--- a/widgets/table/e-table-memory-store.h
+++ /dev/null
@@ -1,138 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-table-memory-store.h
- * Copyright 2000, 2001, Ximian, Inc.
- *
- * Authors:
- * Chris Lahey <clahey@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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.
- */
-
-#ifndef _E_TABLE_MEMORY_STORE_H_
-#define _E_TABLE_MEMORY_STORE_H_
-
-#include <gal/e-table/e-table-memory.h>
-#include <gal/e-table/e-table-memory-callbacks.h>
-
-G_BEGIN_DECLS
-
-#define E_TABLE_MEMORY_STORE_TYPE (e_table_memory_store_get_type ())
-#define E_TABLE_MEMORY_STORE(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), E_TABLE_MEMORY_STORE_TYPE, ETableMemoryStore))
-#define E_TABLE_MEMORY_STORE_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), E_TABLE_MEMORY_STORE_TYPE, ETableMemoryStoreClass))
-#define E_IS_TABLE_MEMORY_STORE(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), E_TABLE_MEMORY_STORE_TYPE))
-#define E_IS_TABLE_MEMORY_STORE_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), E_TABLE_MEMORY_STORE_TYPE))
-#define E_TABLE_MEMORY_STORE_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((obj), E_TABLE_MEMORY_STORE_TYPE, ETableMemoryStoreClass))
-
-typedef enum {
- E_TABLE_MEMORY_STORE_COLUMN_TYPE_TERMINATOR,
- E_TABLE_MEMORY_STORE_COLUMN_TYPE_INTEGER,
- E_TABLE_MEMORY_STORE_COLUMN_TYPE_STRING,
- E_TABLE_MEMORY_STORE_COLUMN_TYPE_PIXBUF,
- E_TABLE_MEMORY_STORE_COLUMN_TYPE_OBJECT,
- E_TABLE_MEMORY_STORE_COLUMN_TYPE_CUSTOM
-} ETableMemoryStoreColumnType;
-
-typedef struct {
- ETableMemoryCalbacksDuplicateValueFn duplicate_value;
- ETableMemoryCalbacksFreeValueFn free_value;
- ETableMemoryCalbacksInitializeValueFn initialize_value;
- ETableMemoryCalbacksValueIsEmptyFn value_is_empty;
- ETableMemoryCalbacksValueToStringFn value_to_string;
-} ETableMemoryStoreCustomColumn;
-
-typedef struct {
- ETableMemoryStoreColumnType type;
- ETableMemoryStoreCustomColumn custom;
- guint editable : 1;
-} ETableMemoryStoreColumnInfo;
-
-#define E_TABLE_MEMORY_STORE_TERMINATOR { E_TABLE_MEMORY_STORE_COLUMN_TYPE_TERMINATOR, { NULL }, FALSE }
-#define E_TABLE_MEMORY_STORE_INTEGER { E_TABLE_MEMORY_STORE_COLUMN_TYPE_INTEGER, { NULL }, FALSE }
-#define E_TABLE_MEMORY_STORE_STRING { E_TABLE_MEMORY_STORE_COLUMN_TYPE_STRING, { NULL }, FALSE }
-#define E_TABLE_MEMORY_STORE_PIXBUF { E_TABLE_MEMORY_STORE_COLUMN_TYPE_PIXBUF, { NULL }, FALSE }
-#define E_TABLE_MEMORY_STORE_EDITABLE_STRING { E_TABLE_MEMORY_STORE_COLUMN_TYPE_STRING, { NULL }, TRUE }
-#define E_TABLE_MEMORY_STORE_CUSTOM(editable, duplicate, free, initialize, empty, string) \
- { E_TABLE_MEMORY_STORE_COLUMN_TYPE_CUSTOM, \
- { (duplicate), (free), (initialize), (empty), (string) }, editable }
-#define E_TABLE_MEMORY_STORE_OBJECT(editable, initialize, empty, string) \
- { E_TABLE_MEMORY_STORE_COLUMN_TYPE_CUSTOM, \
- { NULL, NULL, (initialize), (empty), (string) }, editable }
-
-typedef struct _ETableMemoryStorePrivate ETableMemoryStorePrivate;
-
-typedef struct {
- ETableMemory parent;
-
- ETableMemoryStorePrivate *priv;
-} ETableMemoryStore;
-
-typedef struct {
- ETableMemoryClass parent_class;
-} ETableMemoryStoreClass;
-
-GType e_table_memory_store_get_type (void);
-
-/* Object Creation */
-ETableModel *e_table_memory_store_new (ETableMemoryStoreColumnInfo *columns);
-ETableModel *e_table_memory_store_construct (ETableMemoryStore *store,
- ETableMemoryStoreColumnInfo *columns);
-
-/* Adopt a value instead of copying it. */
-void e_table_memory_store_adopt_value_at (ETableMemoryStore *etms,
- int col,
- int row,
- void *value);
-
-/* The size of these arrays is the number of columns. */
-void e_table_memory_store_insert_array (ETableMemoryStore *etms,
- int row,
- void **store,
- gpointer data);
-void e_table_memory_store_insert (ETableMemoryStore *etms,
- int row,
- gpointer data,
- ...);
-void e_table_memory_store_insert_adopt (ETableMemoryStore *etms,
- int row,
- gpointer data,
- ...);
-void e_table_memory_store_insert_adopt_array (ETableMemoryStore *etms,
- int row,
- void **store,
- gpointer data);
-void e_table_memory_store_change_array (ETableMemoryStore *etms,
- int row,
- void **store,
- gpointer data);
-void e_table_memory_store_change (ETableMemoryStore *etms,
- int row,
- gpointer data,
- ...);
-void e_table_memory_store_change_adopt (ETableMemoryStore *etms,
- int row,
- gpointer data,
- ...);
-void e_table_memory_store_change_adopt_array (ETableMemoryStore *etms,
- int row,
- void **store,
- gpointer data);
-void e_table_memory_store_remove (ETableMemoryStore *etms,
- int row);
-void e_table_memory_store_clear (ETableMemoryStore *etms);
-
-G_END_DECLS
-
-#endif /* _E_TABLE_MEMORY_STORE_H_ */
diff --git a/widgets/table/e-table-memory.c b/widgets/table/e-table-memory.c
deleted file mode 100644
index 7d9958bbd6..0000000000
--- a/widgets/table/e-table-memory.c
+++ /dev/null
@@ -1,277 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-table-memory.c
- * Copyright 2000, 2001, Ximian, Inc.
- *
- * Authors:
- * Chris Lahey <clahey@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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 "e-table-memory.h"
-
-#include <stdio.h>
-#include <errno.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <fcntl.h>
-
-#include <libxml/parser.h>
-#include <libxml/xmlmemory.h>
-
-#include "gal/util/e-util.h"
-#include "gal/util/e-xml-utils.h"
-#include <string.h>
-
-static ETableModel *parent_class;
-
-struct ETableMemoryPriv {
- gpointer *data;
- int num_rows;
- gint frozen;
-};
-
-
-/* virtual methods */
-
-static void
-etmm_finalize (GObject *object)
-{
- ETableMemory *etmm = E_TABLE_MEMORY (object);
- ETableMemoryPriv *priv = etmm->priv;
-
- /* XXX lots of stuff to free here */
- if (priv) {
- g_free (priv->data);
- g_free (priv);
- }
- etmm->priv = NULL;
-
- G_OBJECT_CLASS (parent_class)->finalize (object);
-}
-
-static int
-etmm_row_count (ETableModel *etm)
-{
- ETableMemory *etmm = E_TABLE_MEMORY (etm);
-
- return etmm->priv->num_rows;
-}
-
-
-static void
-e_table_memory_class_init (GObjectClass *klass)
-{
- ETableModelClass *table_class = (ETableModelClass *) klass;
-
- parent_class = g_type_class_peek_parent (klass);
-
- klass->finalize = etmm_finalize;
-
- table_class->row_count = etmm_row_count;
-}
-
-static void
-e_table_memory_init (GObject *object)
-{
- ETableMemory *etmm = (ETableMemory *)object;
-
- ETableMemoryPriv *priv;
-
- priv = g_new0 (ETableMemoryPriv, 1);
- etmm->priv = priv;
-
- priv->data = NULL;
- priv->num_rows = 0;
- priv->frozen = 0;
-}
-
-E_MAKE_TYPE(e_table_memory, "ETableMemory", ETableMemory, e_table_memory_class_init, e_table_memory_init, E_TABLE_MODEL_TYPE)
-
-
-
-/**
- * e_table_memory_new
- *
- * XXX docs here.
- *
- * return values: a newly constructed ETableMemory.
- */
-ETableMemory *
-e_table_memory_new (void)
-{
- return g_object_new (E_TABLE_MEMORY_TYPE, NULL);
-}
-
-/**
- * e_table_memory_get_data:
- * @etmm:
- * @row:
- *
- *
- *
- * Return value:
- **/
-gpointer
-e_table_memory_get_data (ETableMemory *etmm, int row)
-{
- g_return_val_if_fail(row >= 0, NULL);
- g_return_val_if_fail(row < etmm->priv->num_rows, NULL);
-
- return etmm->priv->data[row];
-}
-
-/**
- * e_table_memory_set_data:
- * @etmm:
- * @row:
- * @data:
- *
- *
- **/
-void
-e_table_memory_set_data (ETableMemory *etmm, int row, gpointer data)
-{
- g_return_if_fail(row >= 0);
- g_return_if_fail(row < etmm->priv->num_rows);
-
- etmm->priv->data[row] = data;
-}
-
-/**
- * e_table_memory_insert:
- * @table_model:
- * @parent_path:
- * @position:
- * @data:
- *
- *
- *
- * Return value:
- **/
-void
-e_table_memory_insert (ETableMemory *etmm,
- int row,
- gpointer data)
-{
- g_return_if_fail(row >= -1);
- g_return_if_fail(row <= etmm->priv->num_rows);
-
- if (!etmm->priv->frozen)
- e_table_model_pre_change(E_TABLE_MODEL(etmm));
-
- if (row == -1)
- row = etmm->priv->num_rows;
- etmm->priv->data = g_renew(gpointer, etmm->priv->data, etmm->priv->num_rows + 1);
- memmove(etmm->priv->data + row + 1, etmm->priv->data + row, (etmm->priv->num_rows - row) * sizeof (gpointer));
- etmm->priv->data[row] = data;
- etmm->priv->num_rows ++;
- if (!etmm->priv->frozen)
- e_table_model_row_inserted(E_TABLE_MODEL(etmm), row);
-}
-
-
-
-/**
- * e_table_memory_remove:
- * @etable:
- * @path:
- *
- *
- *
- * Return value:
- **/
-gpointer
-e_table_memory_remove (ETableMemory *etmm, int row)
-{
- gpointer ret;
-
- g_return_val_if_fail(row >= 0, NULL);
- g_return_val_if_fail(row < etmm->priv->num_rows, NULL);
-
- if (!etmm->priv->frozen)
- e_table_model_pre_change(E_TABLE_MODEL(etmm));
- ret = etmm->priv->data[row];
- memmove(etmm->priv->data + row, etmm->priv->data + row + 1, (etmm->priv->num_rows - row - 1) * sizeof (gpointer));
- etmm->priv->num_rows --;
- if (!etmm->priv->frozen)
- e_table_model_row_deleted(E_TABLE_MODEL(etmm), row);
- return ret;
-}
-
-/**
- * e_table_memory_clear:
- * @etable:
- * @path:
- *
- *
- *
- * Return value:
- **/
-void
-e_table_memory_clear (ETableMemory *etmm)
-{
- if (!etmm->priv->frozen)
- e_table_model_pre_change(E_TABLE_MODEL(etmm));
- g_free(etmm->priv->data);
- etmm->priv->data = NULL;
- etmm->priv->num_rows = 0;
- if (!etmm->priv->frozen)
- e_table_model_changed(E_TABLE_MODEL(etmm));
-}
-
-/**
- * e_table_memory_freeze:
- * @etmm: the ETableModel to freeze.
- *
- * This function prepares an ETableModel for a period of much change.
- * All signals regarding changes to the table are deferred until we
- * thaw the table.
- *
- **/
-void
-e_table_memory_freeze(ETableMemory *etmm)
-{
- ETableMemoryPriv *priv = etmm->priv;
-
- if (priv->frozen == 0)
- e_table_model_pre_change(E_TABLE_MODEL(etmm));
-
- priv->frozen ++;
-}
-
-/**
- * e_table_memory_thaw:
- * @etmm: the ETableMemory to thaw.
- *
- * This function thaws an ETableMemory. All the defered signals can add
- * up to a lot, we don't know - so we just emit a model_changed
- * signal.
- *
- **/
-void
-e_table_memory_thaw(ETableMemory *etmm)
-{
- ETableMemoryPriv *priv = etmm->priv;
-
- if (priv->frozen > 0)
- priv->frozen --;
- if (priv->frozen == 0) {
- e_table_model_changed(E_TABLE_MODEL(etmm));
- }
-}
diff --git a/widgets/table/e-table-memory.h b/widgets/table/e-table-memory.h
deleted file mode 100644
index c1b3cd45f8..0000000000
--- a/widgets/table/e-table-memory.h
+++ /dev/null
@@ -1,76 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-table-memory.h
- * Copyright 2000, 2001, Ximian, Inc.
- *
- * Authors:
- * Chris Lahey <clahey@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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.
- */
-
-#ifndef _E_TABLE_MEMORY_H_
-#define _E_TABLE_MEMORY_H_
-
-#include <gdk-pixbuf/gdk-pixbuf.h>
-#include <gal/e-table/e-table-model.h>
-
-G_BEGIN_DECLS
-
-#define E_TABLE_MEMORY_TYPE (e_table_memory_get_type ())
-#define E_TABLE_MEMORY(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), E_TABLE_MEMORY_TYPE, ETableMemory))
-#define E_TABLE_MEMORY_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), E_TABLE_MEMORY_TYPE, ETableMemoryClass))
-#define E_IS_TABLE_MEMORY(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), E_TABLE_MEMORY_TYPE))
-#define E_IS_TABLE_MEMORY_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), E_TABLE_MEMORY_TYPE))
-#define E_TABLE_MEMORY_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS((o), E_TABLE_MEMORY_TYPE, ETableMemoryClass))
-
-typedef struct ETableMemory ETableMemory;
-typedef struct ETableMemoryPriv ETableMemoryPriv;
-typedef struct ETableMemoryClass ETableMemoryClass;
-
-struct ETableMemory {
- ETableModel base;
- ETableMemoryPriv *priv;
-};
-
-struct ETableMemoryClass {
- ETableModelClass parent_class;
-};
-
-
-GType e_table_memory_get_type (void);
-void e_table_memory_construct (ETableMemory *etable);
-ETableMemory *e_table_memory_new (void);
-
-/* row operations */
-void e_table_memory_insert (ETableMemory *etable,
- int row,
- gpointer data);
-gpointer e_table_memory_remove (ETableMemory *etable,
- int row);
-void e_table_memory_clear (ETableMemory *etable);
-
-/* Freeze and thaw */
-void e_table_memory_freeze (ETableMemory *etable);
-void e_table_memory_thaw (ETableMemory *etable);
-gpointer e_table_memory_get_data (ETableMemory *etm,
- int row);
-void e_table_memory_set_data (ETableMemory *etm,
- int row,
- gpointer data);
-
-G_END_DECLS
-
-#endif /* _E_TABLE_MEMORY_H */
diff --git a/widgets/table/e-table-model.c b/widgets/table/e-table-model.c
deleted file mode 100644
index dddcace5be..0000000000
--- a/widgets/table/e-table-model.c
+++ /dev/null
@@ -1,579 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-table-model.c
- * Copyright 2000, 2001, Ximian, Inc.
- *
- * Authors:
- * Chris Lahey <clahey@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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 <glib-object.h>
-#include "e-table-model.h"
-#include "gal/util/e-util.h"
-#include "gal/util/e-marshal.h"
-
-#define ETM_CLASS(e) (E_TABLE_MODEL_GET_CLASS (e))
-
-#define d(x)
-
-d(static gint depth = 0;)
-
-
-static GObjectClass *e_table_model_parent_class;
-
-enum {
- MODEL_NO_CHANGE,
- MODEL_CHANGED,
- MODEL_PRE_CHANGE,
- MODEL_ROW_CHANGED,
- MODEL_CELL_CHANGED,
- MODEL_ROWS_INSERTED,
- MODEL_ROWS_DELETED,
- ROW_SELECTION,
- LAST_SIGNAL
-};
-
-static guint e_table_model_signals [LAST_SIGNAL] = { 0, };
-
-/**
- * e_table_model_column_count:
- * @e_table_model: The e-table-model to operate on
- *
- * Returns: the number of columns in the table model.
- */
-int
-e_table_model_column_count (ETableModel *e_table_model)
-{
- g_return_val_if_fail (e_table_model != NULL, 0);
- g_return_val_if_fail (E_IS_TABLE_MODEL (e_table_model), 0);
-
- return ETM_CLASS (e_table_model)->column_count (e_table_model);
-}
-
-
-/**
- * e_table_model_row_count:
- * @e_table_model: the e-table-model to operate on
- *
- * Returns: the number of rows in the Table model.
- */
-int
-e_table_model_row_count (ETableModel *e_table_model)
-{
- g_return_val_if_fail (e_table_model != NULL, 0);
- g_return_val_if_fail (E_IS_TABLE_MODEL (e_table_model), 0);
-
- return ETM_CLASS (e_table_model)->row_count (e_table_model);
-}
-
-/**
- * e_table_model_append_row:
- * @e_table_model: the table model to append the a row to.
- * @source:
- * @row:
- *
- */
-void
-e_table_model_append_row (ETableModel *e_table_model, ETableModel *source, int row)
-{
- g_return_if_fail (e_table_model != NULL);
- g_return_if_fail (E_IS_TABLE_MODEL (e_table_model));
-
- if (ETM_CLASS (e_table_model)->append_row)
- ETM_CLASS (e_table_model)->append_row (e_table_model, source, row);
-}
-
-/**
- * e_table_value_at:
- * @e_table_model: the e-table-model to operate on
- * @col: column in the model to pull data from.
- * @row: row in the model to pull data from.
- *
- * Return value: This function returns the value that is stored
- * by the @e_table_model in column @col and row @row. The data
- * returned can be a pointer or any data value that can be stored
- * inside a pointer.
- *
- * The data returned is typically used by an ECell renderer.
- *
- * The data returned must be valid until the model sends a signal that
- * affect that piece of data. model_changed affects all data.
- * row_changed affects the data in that row. cell_changed affects the
- * data in that cell. rows_deleted affects all data in those rows.
- * rows_inserted and no_change don't affect any data in this way.
- **/
-void *
-e_table_model_value_at (ETableModel *e_table_model, int col, int row)
-{
- g_return_val_if_fail (e_table_model != NULL, NULL);
- g_return_val_if_fail (E_IS_TABLE_MODEL (e_table_model), NULL);
-
- return ETM_CLASS (e_table_model)->value_at (e_table_model, col, row);
-}
-
-/**
- * e_table_model_set_value_at:
- * @e_table_model: the table model to operate on.
- * @col: the column where the data will be stored in the model.
- * @row: the row where the data will be stored in the model.
- * @value: the data to be stored.
- *
- * This function instructs the model to store the value in @data in the
- * the @e_table_model at column @col and row @row. The @data typically
- * comes from one of the ECell rendering objects.
- *
- * There should be an agreement between the Table Model and the user
- * of this function about the data being stored. Typically it will
- * be a pointer to a set of data, or a datum that fits inside a void *.
- */
-void
-e_table_model_set_value_at (ETableModel *e_table_model, int col, int row, const void *value)
-{
- g_return_if_fail (e_table_model != NULL);
- g_return_if_fail (E_IS_TABLE_MODEL (e_table_model));
-
- ETM_CLASS (e_table_model)->set_value_at (e_table_model, col, row, value);
-}
-
-/**
- * e_table_model_is_cell_editable:
- * @e_table_model: the table model to query.
- * @col: column to query.
- * @row: row to query.
- *
- * Returns: %TRUE if the cell in @e_table_model at @col,@row can be
- * edited, %FALSE otherwise
- */
-gboolean
-e_table_model_is_cell_editable (ETableModel *e_table_model, int col, int row)
-{
- g_return_val_if_fail (e_table_model != NULL, FALSE);
- g_return_val_if_fail (E_IS_TABLE_MODEL (e_table_model), FALSE);
-
- return ETM_CLASS (e_table_model)->is_cell_editable (e_table_model, col, row);
-}
-
-
-void *
-e_table_model_duplicate_value (ETableModel *e_table_model, int col, const void *value)
-{
- g_return_val_if_fail (e_table_model != NULL, NULL);
- g_return_val_if_fail (E_IS_TABLE_MODEL (e_table_model), NULL);
-
- if (ETM_CLASS (e_table_model)->duplicate_value)
- return ETM_CLASS (e_table_model)->duplicate_value (e_table_model, col, value);
- else
- return NULL;
-}
-
-void
-e_table_model_free_value (ETableModel *e_table_model, int col, void *value)
-{
- g_return_if_fail (e_table_model != NULL);
- g_return_if_fail (E_IS_TABLE_MODEL (e_table_model));
-
- if (ETM_CLASS (e_table_model)->free_value)
- ETM_CLASS (e_table_model)->free_value (e_table_model, col, value);
-}
-
-gboolean
-e_table_model_has_save_id (ETableModel *e_table_model)
-{
- g_return_val_if_fail (e_table_model != NULL, FALSE);
- g_return_val_if_fail (E_IS_TABLE_MODEL (e_table_model), FALSE);
-
- if (ETM_CLASS (e_table_model)->has_save_id)
- return ETM_CLASS (e_table_model)->has_save_id (e_table_model);
- else
- return FALSE;
-}
-
-char *
-e_table_model_get_save_id (ETableModel *e_table_model, int row)
-{
- g_return_val_if_fail (e_table_model != NULL, "/");
- g_return_val_if_fail (E_IS_TABLE_MODEL (e_table_model), "/");
-
- if (ETM_CLASS (e_table_model)->get_save_id)
- return ETM_CLASS (e_table_model)->get_save_id (e_table_model, row);
- else
- return NULL;
-}
-
-gboolean
-e_table_model_has_change_pending(ETableModel *e_table_model)
-{
- g_return_val_if_fail (e_table_model != NULL, FALSE);
- g_return_val_if_fail (E_IS_TABLE_MODEL (e_table_model), FALSE);
-
- if (ETM_CLASS (e_table_model)->has_change_pending)
- return ETM_CLASS (e_table_model)->has_change_pending (e_table_model);
- else
- return FALSE;
-}
-
-void *
-e_table_model_initialize_value (ETableModel *e_table_model, int col)
-{
- g_return_val_if_fail (e_table_model != NULL, NULL);
- g_return_val_if_fail (E_IS_TABLE_MODEL (e_table_model), NULL);
-
- if (ETM_CLASS (e_table_model)->initialize_value)
- return ETM_CLASS (e_table_model)->initialize_value (e_table_model, col);
- else
- return NULL;
-}
-
-gboolean
-e_table_model_value_is_empty (ETableModel *e_table_model, int col, const void *value)
-{
- g_return_val_if_fail (e_table_model != NULL, FALSE);
- g_return_val_if_fail (E_IS_TABLE_MODEL (e_table_model), FALSE);
-
- if (ETM_CLASS (e_table_model)->value_is_empty)
- return ETM_CLASS (e_table_model)->value_is_empty (e_table_model, col, value);
- else
- return FALSE;
-}
-
-char *
-e_table_model_value_to_string (ETableModel *e_table_model, int col, const void *value)
-{
- g_return_val_if_fail (e_table_model != NULL, NULL);
- g_return_val_if_fail (E_IS_TABLE_MODEL (e_table_model), NULL);
-
- if (ETM_CLASS (e_table_model)->value_to_string)
- return ETM_CLASS (e_table_model)->value_to_string (e_table_model, col, value);
- else
- return g_strdup("");
-}
-
-static void
-e_table_model_finalize (GObject *object)
-{
- if (e_table_model_parent_class->finalize)
- (*e_table_model_parent_class->finalize)(object);
-}
-
-static void
-e_table_model_class_init (GObjectClass *object_class)
-{
- ETableModelClass *klass = E_TABLE_MODEL_CLASS(object_class);
- e_table_model_parent_class = g_type_class_peek_parent (object_class);
-
- object_class->finalize = e_table_model_finalize;
-
- e_table_model_signals [MODEL_NO_CHANGE] =
- g_signal_new ("model_no_change",
- E_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (ETableModelClass, model_no_change),
- (GSignalAccumulator) NULL, NULL,
- g_cclosure_marshal_VOID__VOID,
- G_TYPE_NONE, 0);
-
-
- e_table_model_signals [MODEL_CHANGED] =
- g_signal_new ("model_changed",
- E_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (ETableModelClass, model_changed),
- (GSignalAccumulator) NULL, NULL,
- g_cclosure_marshal_VOID__VOID,
- G_TYPE_NONE, 0);
-
- e_table_model_signals [MODEL_PRE_CHANGE] =
- g_signal_new ("model_pre_change",
- E_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (ETableModelClass, model_pre_change),
- (GSignalAccumulator) NULL, NULL,
- g_cclosure_marshal_VOID__VOID,
- G_TYPE_NONE, 0);
-
- e_table_model_signals [MODEL_ROW_CHANGED] =
- g_signal_new ("model_row_changed",
- E_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (ETableModelClass, model_row_changed),
- (GSignalAccumulator) NULL, NULL,
- g_cclosure_marshal_VOID__INT,
- G_TYPE_NONE, 1, G_TYPE_INT);
-
- e_table_model_signals [MODEL_CELL_CHANGED] =
- g_signal_new ("model_cell_changed",
- E_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (ETableModelClass, model_cell_changed),
- (GSignalAccumulator) NULL, NULL,
- e_marshal_VOID__INT_INT,
- G_TYPE_NONE, 2, G_TYPE_INT, G_TYPE_INT);
-
- e_table_model_signals [MODEL_ROWS_INSERTED] =
- g_signal_new ("model_rows_inserted",
- E_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (ETableModelClass, model_rows_inserted),
- (GSignalAccumulator) NULL, NULL,
- e_marshal_VOID__INT_INT,
- G_TYPE_NONE, 2, G_TYPE_INT, G_TYPE_INT);
-
- e_table_model_signals [MODEL_ROWS_DELETED] =
- g_signal_new ("model_rows_deleted",
- E_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (ETableModelClass, model_rows_deleted),
- (GSignalAccumulator) NULL, NULL,
- e_marshal_VOID__INT_INT,
- G_TYPE_NONE, 2, G_TYPE_INT, G_TYPE_INT);
-
- klass->column_count = NULL;
- klass->row_count = NULL;
- klass->append_row = NULL;
-
- klass->value_at = NULL;
- klass->set_value_at = NULL;
- klass->is_cell_editable = NULL;
-
- klass->has_save_id = NULL;
- klass->get_save_id = NULL;
-
- klass->has_change_pending = NULL;
-
- klass->duplicate_value = NULL;
- klass->free_value = NULL;
- klass->initialize_value = NULL;
- klass->value_is_empty = NULL;
- klass->value_to_string = NULL;
-
- klass->model_no_change = NULL;
- klass->model_changed = NULL;
- klass->model_row_changed = NULL;
- klass->model_cell_changed = NULL;
- klass->model_rows_inserted = NULL;
- klass->model_rows_deleted = NULL;
-}
-
-E_MAKE_TYPE(e_table_model, "ETableModel", ETableModel, e_table_model_class_init, NULL, G_TYPE_OBJECT)
-
-#if d(!)0
-static void
-print_tabs (void)
-{
- int i;
- for (i = 0; i < depth; i++)
- g_print("\t");
-}
-#endif
-
-void
-e_table_model_pre_change (ETableModel *e_table_model)
-{
- g_return_if_fail (e_table_model != NULL);
- g_return_if_fail (E_IS_TABLE_MODEL (e_table_model));
-
- d(print_tabs());
- d(g_print("Emitting pre_change on model 0x%p, a %s.\n", e_table_model, gtk_type_name (GTK_OBJECT(e_table_model)->klass->type)));
- d(depth++);
- g_signal_emit (G_OBJECT (e_table_model),
- e_table_model_signals [MODEL_PRE_CHANGE], 0);
- d(depth--);
-}
-
-/**
- * e_table_model_no_change:
- * @e_table_model: the table model to notify of the lack of a change
- *
- * Use this function to notify any views of this table model that
- * the contents of the table model have changed. This will emit
- * the signal "model_no_change" on the @e_table_model object.
- *
- * It is preferable to use the e_table_model_row_changed() and
- * the e_table_model_cell_changed() to notify of smaller changes
- * than to invalidate the entire model, as the views might have
- * ways of caching the information they render from the model.
- */
-void
-e_table_model_no_change (ETableModel *e_table_model)
-{
- g_return_if_fail (e_table_model != NULL);
- g_return_if_fail (E_IS_TABLE_MODEL (e_table_model));
-
- d(print_tabs());
- d(g_print("Emitting model_no_change on model 0x%p, a %s.\n", e_table_model, gtk_type_name (GTK_OBJECT(e_table_model)->klass->type)));
- d(depth++);
- g_signal_emit (G_OBJECT (e_table_model),
- e_table_model_signals [MODEL_NO_CHANGE], 0);
- d(depth--);
-}
-
-/**
- * e_table_model_changed:
- * @e_table_model: the table model to notify of the change
- *
- * Use this function to notify any views of this table model that
- * the contents of the table model have changed. This will emit
- * the signal "model_changed" on the @e_table_model object.
- *
- * It is preferable to use the e_table_model_row_changed() and
- * the e_table_model_cell_changed() to notify of smaller changes
- * than to invalidate the entire model, as the views might have
- * ways of caching the information they render from the model.
- */
-void
-e_table_model_changed (ETableModel *e_table_model)
-{
- g_return_if_fail (e_table_model != NULL);
- g_return_if_fail (E_IS_TABLE_MODEL (e_table_model));
-
- d(print_tabs());
- d(g_print("Emitting model_changed on model 0x%p, a %s.\n", e_table_model, gtk_type_name (GTK_OBJECT(e_table_model)->klass->type)));
- d(depth++);
- g_signal_emit (G_OBJECT (e_table_model),
- e_table_model_signals [MODEL_CHANGED], 0);
- d(depth--);
-}
-
-/**
- * e_table_model_row_changed:
- * @e_table_model: the table model to notify of the change
- * @row: the row that was changed in the model.
- *
- * Use this function to notify any views of the table model that
- * the contents of row @row have changed in model. This function
- * will emit the "model_row_changed" signal on the @e_table_model
- * object
- */
-void
-e_table_model_row_changed (ETableModel *e_table_model, int row)
-{
- g_return_if_fail (e_table_model != NULL);
- g_return_if_fail (E_IS_TABLE_MODEL (e_table_model));
-
- d(print_tabs());
- d(g_print("Emitting row_changed on model 0x%p, a %s, row %d.\n", e_table_model, gtk_type_name (GTK_OBJECT(e_table_model)->klass->type), row));
- d(depth++);
- g_signal_emit (G_OBJECT (e_table_model),
- e_table_model_signals [MODEL_ROW_CHANGED], 0, row);
- d(depth--);
-}
-
-/**
- * e_table_model_cell_changed:
- * @e_table_model: the table model to notify of the change
- * @col: the column.
- * @row: the row
- *
- * Use this function to notify any views of the table model that
- * contents of the cell at @col,@row has changed. This will emit
- * the "model_cell_changed" signal on the @e_table_model
- * object
- */
-void
-e_table_model_cell_changed (ETableModel *e_table_model, int col, int row)
-{
- g_return_if_fail (e_table_model != NULL);
- g_return_if_fail (E_IS_TABLE_MODEL (e_table_model));
-
- d(print_tabs());
- d(g_print("Emitting cell_changed on model 0x%p, a %s, row %d, col %d.\n", e_table_model, gtk_type_name (GTK_OBJECT(e_table_model)->klass->type), row, col));
- d(depth++);
- g_signal_emit (G_OBJECT (e_table_model),
- e_table_model_signals [MODEL_CELL_CHANGED], 0, col, row);
- d(depth--);
-}
-
-/**
- * e_table_model_rows_inserted:
- * @e_table_model: the table model to notify of the change
- * @row: the row that was inserted into the model.
- * @count: The number of rows that were inserted.
- *
- * Use this function to notify any views of the table model that
- * @count rows at row @row have been inserted into the model. This
- * function will emit the "model_rows_inserted" signal on the
- * @e_table_model object
- */
-void
-e_table_model_rows_inserted (ETableModel *e_table_model, int row, int count)
-{
- g_return_if_fail (e_table_model != NULL);
- g_return_if_fail (E_IS_TABLE_MODEL (e_table_model));
-
- d(print_tabs());
- d(g_print("Emitting row_inserted on model 0x%p, a %s, row %d.\n", e_table_model, gtk_type_name (GTK_OBJECT(e_table_model)->klass->type), row));
- d(depth++);
- g_signal_emit (G_OBJECT (e_table_model),
- e_table_model_signals [MODEL_ROWS_INSERTED], 0, row, count);
- d(depth--);
-}
-
-/**
- * e_table_model_row_inserted:
- * @e_table_model: the table model to notify of the change
- * @row: the row that was inserted into the model.
- *
- * Use this function to notify any views of the table model that the
- * row @row has been inserted into the model. This function will emit
- * the "model_rows_inserted" signal on the @e_table_model object
- */
-void
-e_table_model_row_inserted (ETableModel *e_table_model, int row)
-{
- e_table_model_rows_inserted(e_table_model, row, 1);
-}
-
-/**
- * e_table_model_row_deleted:
- * @e_table_model: the table model to notify of the change
- * @row: the row that was deleted
- * @count: The number of rows deleted
- *
- * Use this function to notify any views of the table model that
- * @count rows at row @row have been deleted from the model. This
- * function will emit the "model_rows_deleted" signal on the
- * @e_table_model object
- */
-void
-e_table_model_rows_deleted (ETableModel *e_table_model, int row, int count)
-{
- g_return_if_fail (e_table_model != NULL);
- g_return_if_fail (E_IS_TABLE_MODEL (e_table_model));
-
- d(print_tabs());
- d(g_print("Emitting row_deleted on model 0x%p, a %s, row %d.\n", e_table_model, gtk_type_name (GTK_OBJECT(e_table_model)->klass->type), row));
- d(depth++);
- g_signal_emit (G_OBJECT (e_table_model),
- e_table_model_signals [MODEL_ROWS_DELETED], 0, row, count);
- d(depth--);
-}
-
-/**
- * e_table_model_row_deleted:
- * @e_table_model: the table model to notify of the change
- * @row: the row that was deleted
- *
- * Use this function to notify any views of the table model that the
- * row @row has been deleted from the model. This function will emit
- * the "model_rows_deleted" signal on the @e_table_model object
- */
-void
-e_table_model_row_deleted (ETableModel *e_table_model, int row)
-{
- e_table_model_rows_deleted(e_table_model, row, 1);
-}
diff --git a/widgets/table/e-table-model.h b/widgets/table/e-table-model.h
deleted file mode 100644
index 6244fa2e7a..0000000000
--- a/widgets/table/e-table-model.h
+++ /dev/null
@@ -1,170 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-table-model.h
- * Copyright 2000, 2001, Ximian, Inc.
- *
- * Authors:
- * Chris Lahey <clahey@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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.
- */
-
-#ifndef _E_TABLE_MODEL_H_
-#define _E_TABLE_MODEL_H_
-
-#include <glib-object.h>
-
-G_BEGIN_DECLS
-
-#define E_TABLE_MODEL_TYPE (e_table_model_get_type ())
-#define E_TABLE_MODEL(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), E_TABLE_MODEL_TYPE, ETableModel))
-#define E_TABLE_MODEL_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), E_TABLE_MODEL_TYPE, ETableModelClass))
-#define E_IS_TABLE_MODEL(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), E_TABLE_MODEL_TYPE))
-#define E_IS_TABLE_MODEL_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), E_TABLE_MODEL_TYPE))
-#define E_TABLE_MODEL_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS((o), E_TABLE_MODEL_TYPE, ETableModelClass))
-
-typedef struct {
- GObject base;
-} ETableModel;
-
-typedef struct {
- GObjectClass parent_class;
-
- /*
- * Virtual methods
- */
- int (*column_count) (ETableModel *etm);
- int (*row_count) (ETableModel *etm);
- void (*append_row) (ETableModel *etm, ETableModel *source, int row);
-
- void *(*value_at) (ETableModel *etm, int col, int row);
- void (*set_value_at) (ETableModel *etm, int col, int row, const void *value);
- gboolean (*is_cell_editable) (ETableModel *etm, int col, int row);
-
- gboolean (*has_save_id) (ETableModel *etm);
- char *(*get_save_id) (ETableModel *etm, int row);
-
- gboolean (*has_change_pending) (ETableModel *etm);
-
- /* Allocate a copy of the given value. */
- void *(*duplicate_value) (ETableModel *etm, int col, const void *value);
- /* Free an allocated value. */
- void (*free_value) (ETableModel *etm, int col, void *value);
- /* Return an allocated empty value. */
- void *(*initialize_value) (ETableModel *etm, int col);
- /* Return TRUE if value is equivalent to an empty cell. */
- gboolean (*value_is_empty) (ETableModel *etm, int col, const void *value);
- /* Return an allocated string. */
- char *(*value_to_string) (ETableModel *etm, int col, const void *value);
-
-
- /*
- * Signals
- */
-
- /*
- * These all come after the change has been made.
- * No changes, cancel pre_change: no_change
- * Major structural changes: model_changed
- * Changes only in a row: row_changed
- * Only changes in a cell: cell_changed
- * A row inserted: row_inserted
- * A row deleted: row_deleted
- */
- void (*model_pre_change) (ETableModel *etm);
-
- void (*model_no_change) (ETableModel *etm);
- void (*model_changed) (ETableModel *etm);
- void (*model_row_changed) (ETableModel *etm, int row);
- void (*model_cell_changed) (ETableModel *etm, int col, int row);
- void (*model_rows_inserted) (ETableModel *etm, int row, int count);
- void (*model_rows_deleted) (ETableModel *etm, int row, int count);
-} ETableModelClass;
-
-GType e_table_model_get_type (void);
-
-/**/
-int e_table_model_column_count (ETableModel *e_table_model);
-const char *e_table_model_column_name (ETableModel *e_table_model,
- int col);
-int e_table_model_row_count (ETableModel *e_table_model);
-void e_table_model_append_row (ETableModel *e_table_model,
- ETableModel *source,
- int row);
-
-/**/
-void *e_table_model_value_at (ETableModel *e_table_model,
- int col,
- int row);
-void e_table_model_set_value_at (ETableModel *e_table_model,
- int col,
- int row,
- const void *value);
-gboolean e_table_model_is_cell_editable (ETableModel *e_table_model,
- int col,
- int row);
-
-/**/
-gboolean e_table_model_has_save_id (ETableModel *etm);
-char *e_table_model_get_save_id (ETableModel *etm,
- int row);
-
-/**/
-gboolean e_table_model_has_change_pending (ETableModel *etm);
-
-
-/**/
-void *e_table_model_duplicate_value (ETableModel *e_table_model,
- int col,
- const void *value);
-void e_table_model_free_value (ETableModel *e_table_model,
- int col,
- void *value);
-void *e_table_model_initialize_value (ETableModel *e_table_model,
- int col);
-gboolean e_table_model_value_is_empty (ETableModel *e_table_model,
- int col,
- const void *value);
-char *e_table_model_value_to_string (ETableModel *e_table_model,
- int col,
- const void *value);
-
-/*
- * Routines for emitting signals on the e_table
- */
-void e_table_model_pre_change (ETableModel *e_table_model);
-void e_table_model_no_change (ETableModel *e_table_model);
-void e_table_model_changed (ETableModel *e_table_model);
-void e_table_model_row_changed (ETableModel *e_table_model,
- int row);
-void e_table_model_cell_changed (ETableModel *e_table_model,
- int col,
- int row);
-void e_table_model_rows_inserted (ETableModel *e_table_model,
-int row,
-int count);
-void e_table_model_rows_deleted (ETableModel *e_table_model,
-int row,
-int count);
-
-/**/
-void e_table_model_row_inserted (ETableModel *e_table_model,
-int row);
-void e_table_model_row_deleted (ETableModel *e_table_model,
-int row);
-
-G_END_DECLS
-
-#endif /* _E_TABLE_MODEL_H_ */
diff --git a/widgets/table/e-table-one.c b/widgets/table/e-table-one.c
deleted file mode 100644
index 24ea978f19..0000000000
--- a/widgets/table/e-table-one.c
+++ /dev/null
@@ -1,239 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-table-one.c
- * Copyright 2000, 2001, Ximian, Inc.
- *
- * Authors:
- * Chris Lahey <clahey@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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 "e-table-one.h"
-#include "gal/util/e-util.h"
-
-static ETableModelClass *parent_class = NULL;
-
-static int
-one_column_count (ETableModel *etm)
-{
- ETableOne *one = E_TABLE_ONE(etm);
-
- if (one->source)
- return e_table_model_column_count(one->source);
- else
- return 0;
-}
-
-static int
-one_row_count (ETableModel *etm)
-{
- return 1;
-}
-
-static void *
-one_value_at (ETableModel *etm, int col, int row)
-{
- ETableOne *one = E_TABLE_ONE(etm);
-
- if (one->data)
- return one->data[col];
- else
- return NULL;
-}
-
-static void
-one_set_value_at (ETableModel *etm, int col, int row, const void *val)
-{
- ETableOne *one = E_TABLE_ONE(etm);
-
- if (one->data && one->source) {
- e_table_model_free_value(one->source, col, one->data[col]);
- one->data[col] = e_table_model_duplicate_value(one->source, col, val);
- }
-}
-
-static gboolean
-one_is_cell_editable (ETableModel *etm, int col, int row)
-{
- ETableOne *one = E_TABLE_ONE(etm);
-
- if (one->source)
- return e_table_model_is_cell_editable(one->source, col, -1);
- else
- return FALSE;
-}
-
-/* The default for one_duplicate_value is to return the raw value. */
-static void *
-one_duplicate_value (ETableModel *etm, int col, const void *value)
-{
- ETableOne *one = E_TABLE_ONE(etm);
-
- if (one->source)
- return e_table_model_duplicate_value(one->source, col, value);
- else
- return (void *)value;
-}
-
-static void
-one_free_value (ETableModel *etm, int col, void *value)
-{
- ETableOne *one = E_TABLE_ONE(etm);
-
- if (one->source)
- e_table_model_free_value(one->source, col, value);
-}
-
-static void *
-one_initialize_value (ETableModel *etm, int col)
-{
- ETableOne *one = E_TABLE_ONE(etm);
-
- if (one->source)
- return e_table_model_initialize_value (one->source, col);
- else
- return NULL;
-}
-
-static gboolean
-one_value_is_empty (ETableModel *etm, int col, const void *value)
-{
- ETableOne *one = E_TABLE_ONE(etm);
-
- if (one->source)
- return e_table_model_value_is_empty (one->source, col, value);
- else
- return FALSE;
-}
-
-static char *
-one_value_to_string (ETableModel *etm, int col, const void *value)
-{
- ETableOne *one = E_TABLE_ONE(etm);
-
- if (one->source)
- return e_table_model_value_to_string (one->source, col, value);
- else
- return g_strdup("");
-}
-
-static void
-one_finalize (GObject *object)
-{
- ETableOne *one = E_TABLE_ONE (object);
-
- if (one->data) {
- int i;
- int col_count;
-
- col_count = e_table_model_column_count(one->source);
-
- for (i = 0; i < col_count; i++)
- e_table_model_free_value(one->source, i, one->data[i]);
- g_free (one->data);
- }
- one->data = NULL;
-
- G_OBJECT_CLASS (parent_class)->finalize (object);
-}
-
-static void
-one_dispose (GObject *object)
-{
- ETableOne *one = E_TABLE_ONE (object);
-
- if (one->source)
- g_object_unref(one->source);
- one->source = NULL;
-
- G_OBJECT_CLASS (parent_class)->dispose (object);
-}
-
-static void
-e_table_one_class_init (GObjectClass *object_class)
-{
- ETableModelClass *model_class = (ETableModelClass *) object_class;
-
- parent_class = g_type_class_peek_parent (object_class);
-
- model_class->column_count = one_column_count;
- model_class->row_count = one_row_count;
- model_class->value_at = one_value_at;
- model_class->set_value_at = one_set_value_at;
- model_class->is_cell_editable = one_is_cell_editable;
- model_class->duplicate_value = one_duplicate_value;
- model_class->free_value = one_free_value;
- model_class->initialize_value = one_initialize_value;
- model_class->value_is_empty = one_value_is_empty;
- model_class->value_to_string = one_value_to_string;
-
- object_class->dispose = one_dispose;
- object_class->finalize = one_finalize;
-}
-
-static void
-e_table_one_init (GObject *object)
-{
- ETableOne *one = E_TABLE_ONE(object);
-
- one->source = NULL;
- one->data = NULL;
-}
-
-E_MAKE_TYPE(e_table_one, "ETableOne", ETableOne, e_table_one_class_init, e_table_one_init, E_TABLE_MODEL_TYPE)
-
-
-ETableModel *
-e_table_one_new (ETableModel *source)
-{
- ETableOne *eto;
- int col_count;
- int i;
-
- eto = g_object_new (E_TABLE_ONE_TYPE, NULL);
- eto->source = source;
-
- col_count = e_table_model_column_count(source);
- eto->data = g_new(void *, col_count);
- for (i = 0; i < col_count; i++) {
- eto->data[i] = e_table_model_initialize_value(source, i);
- }
-
- if (source)
- g_object_ref(source);
-
- return (ETableModel *) eto;
-}
-
-void
-e_table_one_commit (ETableOne *one)
-{
- if (one->source) {
- int empty = TRUE;
- int col;
- int cols = e_table_model_column_count(one->source);
- for (col = 0; col < cols; col++) {
- if (!e_table_model_value_is_empty(one->source, col, one->data[col])) {
- empty = FALSE;
- break;
- }
- }
- if (!empty) {
- e_table_model_append_row(one->source, E_TABLE_MODEL(one), 0);
- }
- }
-}
diff --git a/widgets/table/e-table-one.h b/widgets/table/e-table-one.h
deleted file mode 100644
index 1c8147d779..0000000000
--- a/widgets/table/e-table-one.h
+++ /dev/null
@@ -1,57 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-table-one.h
- * Copyright 2000, 2001, Ximian, Inc.
- *
- * Authors:
- * Chris Lahey <clahey@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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.
- */
-
-#ifndef _E_TABLE_ONE_H_
-#define _E_TABLE_ONE_H_
-
-#include <gal/e-table/e-table-model.h>
-
-G_BEGIN_DECLS
-
-#define E_TABLE_ONE_TYPE (e_table_one_get_type ())
-#define E_TABLE_ONE(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), E_TABLE_ONE_TYPE, ETableOne))
-#define E_TABLE_ONE_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), E_TABLE_ONE_TYPE, ETableOneClass))
-#define E_IS_TABLE_ONE(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), E_TABLE_ONE_TYPE))
-#define E_IS_TABLE_ONE_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), E_TABLE_ONE_TYPE))
-#define E_TABLE_ONE_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((obj), E_TABLE_ONE_TYPE, ETableOneClass))
-
-typedef struct {
- ETableModel parent;
-
- ETableModel *source;
- void **data;
-} ETableOne;
-
-typedef struct {
- ETableModelClass parent_class;
-} ETableOneClass;
-
-GType e_table_one_get_type (void);
-
-ETableModel *e_table_one_new (ETableModel *source);
-void e_table_one_commit (ETableOne *one);
-
-G_END_DECLS
-
-#endif /* _E_TABLE_ONE_H_ */
-
diff --git a/widgets/table/e-table-scrolled.c b/widgets/table/e-table-scrolled.c
deleted file mode 100644
index 1786148c78..0000000000
--- a/widgets/table/e-table-scrolled.c
+++ /dev/null
@@ -1,229 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-table-scrolled.c
- * Copyright 2000, 2001, Ximian, Inc.
- *
- * Authors:
- * Chris Lahey <clahey@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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 <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <stdio.h>
-#include <libgnomecanvas/gnome-canvas.h>
-#include <gtk/gtksignal.h>
-#include <libxml/parser.h>
-#include <libxml/xmlmemory.h>
-
-#include "e-table.h"
-#include "e-table-scrolled.h"
-#include "gal/util/e-i18n.h"
-
-#define COLUMN_HEADER_HEIGHT 16
-
-#define PARENT_TYPE gtk_scrolled_window_get_type ()
-
-static GtkObjectClass *parent_class;
-
-enum {
- PROP_0,
- PROP_TABLE
-};
-
-static void
-e_table_scrolled_init (GtkObject *object)
-{
- ETableScrolled *ets;
- GtkScrolledWindow *scrolled_window;
-
- ets = E_TABLE_SCROLLED (object);
- scrolled_window = GTK_SCROLLED_WINDOW (object);
-
- GTK_WIDGET_SET_FLAGS (ets, GTK_CAN_FOCUS);
-
- ets->table = g_object_new (E_TABLE_TYPE, NULL);
-
- gtk_scrolled_window_set_policy (scrolled_window, GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
- gtk_scrolled_window_set_shadow_type (scrolled_window, GTK_SHADOW_IN);
-}
-
-static void
-e_table_scrolled_real_construct (ETableScrolled *ets)
-{
- gtk_container_add(GTK_CONTAINER(ets), GTK_WIDGET(ets->table));
-
- gtk_widget_show(GTK_WIDGET(ets->table));
-}
-
-ETableScrolled *e_table_scrolled_construct (ETableScrolled *ets,
- ETableModel *etm,
- ETableExtras *ete,
- const char *spec,
- const char *state)
-{
- g_return_val_if_fail(ets != NULL, NULL);
- g_return_val_if_fail(E_IS_TABLE_SCROLLED(ets), NULL);
- g_return_val_if_fail(etm != NULL, NULL);
- g_return_val_if_fail(E_IS_TABLE_MODEL(etm), NULL);
- g_return_val_if_fail(ete == NULL || E_IS_TABLE_EXTRAS(ete), NULL);
- g_return_val_if_fail(spec != NULL, NULL);
-
- e_table_construct(ets->table, etm, ete, spec, state);
-
- e_table_scrolled_real_construct(ets);
-
- return ets;
-}
-
-GtkWidget *e_table_scrolled_new (ETableModel *etm,
- ETableExtras *ete,
- const char *spec,
- const char *state)
-{
- ETableScrolled *ets;
-
- g_return_val_if_fail(etm != NULL, NULL);
- g_return_val_if_fail(E_IS_TABLE_MODEL(etm), NULL);
- g_return_val_if_fail(ete == NULL || E_IS_TABLE_EXTRAS(ete), NULL);
- g_return_val_if_fail(spec != NULL, NULL);
-
- ets = E_TABLE_SCROLLED (gtk_widget_new (e_table_scrolled_get_type (),
- "hadjustment", NULL,
- "vadjustment", NULL,
- NULL));
-
- ets = e_table_scrolled_construct (ets, etm, ete, spec, state);
-
- return GTK_WIDGET (ets);
-}
-
-ETableScrolled *e_table_scrolled_construct_from_spec_file (ETableScrolled *ets,
- ETableModel *etm,
- ETableExtras *ete,
- const char *spec_fn,
- const char *state_fn)
-{
- g_return_val_if_fail(ets != NULL, NULL);
- g_return_val_if_fail(E_IS_TABLE_SCROLLED(ets), NULL);
- g_return_val_if_fail(etm != NULL, NULL);
- g_return_val_if_fail(E_IS_TABLE_MODEL(etm), NULL);
- g_return_val_if_fail(ete == NULL || E_IS_TABLE_EXTRAS(ete), NULL);
- g_return_val_if_fail(spec_fn != NULL, NULL);
-
- e_table_construct_from_spec_file(ets->table, etm, ete, spec_fn, state_fn);
-
- e_table_scrolled_real_construct(ets);
-
- return ets;
-}
-
-GtkWidget *e_table_scrolled_new_from_spec_file (ETableModel *etm,
- ETableExtras *ete,
- const char *spec_fn,
- const char *state_fn)
-{
- ETableScrolled *ets;
-
- g_return_val_if_fail(etm != NULL, NULL);
- g_return_val_if_fail(E_IS_TABLE_MODEL(etm), NULL);
- g_return_val_if_fail(ete == NULL || E_IS_TABLE_EXTRAS(ete), NULL);
- g_return_val_if_fail(spec_fn != NULL, NULL);
-
- ets = E_TABLE_SCROLLED (gtk_widget_new (e_table_scrolled_get_type (),
- "hadjustment", NULL,
- "vadjustment", NULL,
- NULL));
-
- ets = e_table_scrolled_construct_from_spec_file (ets, etm, ete, spec_fn, state_fn);
-
- return GTK_WIDGET (ets);
-}
-
-ETable *
-e_table_scrolled_get_table (ETableScrolled *ets)
-{
- return ets->table;
-}
-
-static void
-ets_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec)
-{
- ETableScrolled *ets = E_TABLE_SCROLLED (object);
-
- switch (prop_id){
- case PROP_TABLE:
- g_value_set_object (value, ets->table);
- break;
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
- break;
- }
-}
-
-/* Grab_focus handler for the scrolled ETable */
-static void
-ets_grab_focus (GtkWidget *widget)
-{
- ETableScrolled *ets;
-
- ets = E_TABLE_SCROLLED (widget);
-
- gtk_widget_grab_focus (GTK_WIDGET (ets->table));
-}
-
-/* Focus handler for the scrolled ETable */
-static gint
-ets_focus (GtkWidget *container, GtkDirectionType direction)
-{
- ETableScrolled *ets;
-
- ets = E_TABLE_SCROLLED (container);
-
- return gtk_widget_child_focus (GTK_WIDGET (ets->table), direction);
-}
-
-static void
-e_table_scrolled_class_init (ETableScrolledClass *class)
-{
- GObjectClass *object_class;
- GtkWidgetClass *widget_class;
- GtkContainerClass *container_class;
-
- object_class = (GObjectClass *) class;
- widget_class = (GtkWidgetClass *) class;
- container_class = (GtkContainerClass *) class;
-
- parent_class = g_type_class_ref (PARENT_TYPE);
-
- object_class->get_property = ets_get_property;
-
- widget_class->grab_focus = ets_grab_focus;
-
- widget_class->focus = ets_focus;
-
- g_object_class_install_property (object_class, PROP_TABLE,
- g_param_spec_object ("table",
- _( "Table" ),
- _( "Table" ),
- E_TABLE_TYPE,
- G_PARAM_READABLE));
-}
-
-E_MAKE_TYPE(e_table_scrolled, "ETableScrolled", ETableScrolled, e_table_scrolled_class_init, e_table_scrolled_init, PARENT_TYPE)
-
diff --git a/widgets/table/e-table-scrolled.h b/widgets/table/e-table-scrolled.h
deleted file mode 100644
index 40de97e99e..0000000000
--- a/widgets/table/e-table-scrolled.h
+++ /dev/null
@@ -1,76 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-table-scrolled.h
- * Copyright 2000, 2001, Ximian, Inc.
- *
- * Authors:
- * Chris Lahey <clahey@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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.
- */
-
-#ifndef _E_TABLE_SCROLLED_H_
-#define _E_TABLE_SCROLLED_H_
-
-#include <gtk/gtkscrolledwindow.h>
-#include <gal/e-table/e-table-model.h>
-#include <gal/e-table/e-table.h>
-
-G_BEGIN_DECLS
-
-#define E_TABLE_SCROLLED_TYPE (e_table_scrolled_get_type ())
-#define E_TABLE_SCROLLED(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), E_TABLE_SCROLLED_TYPE, ETableScrolled))
-#define E_TABLE_SCROLLED_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), E_TABLE_SCROLLED_TYPE, ETableScrolledClass))
-#define E_IS_TABLE_SCROLLED(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), E_TABLE_SCROLLED_TYPE))
-#define E_IS_TABLE_SCROLLED_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), E_TABLE_SCROLLED_TYPE))
-
-typedef struct {
- GtkScrolledWindow parent;
-
- ETable *table;
-} ETableScrolled;
-
-typedef struct {
- GtkScrolledWindowClass parent_class;
-} ETableScrolledClass;
-
-GType e_table_scrolled_get_type (void);
-
-ETableScrolled *e_table_scrolled_construct (ETableScrolled *ets,
- ETableModel *etm,
- ETableExtras *ete,
- const char *spec,
- const char *state);
-GtkWidget *e_table_scrolled_new (ETableModel *etm,
- ETableExtras *ete,
- const char *spec,
- const char *state);
-
-ETableScrolled *e_table_scrolled_construct_from_spec_file (ETableScrolled *ets,
- ETableModel *etm,
- ETableExtras *ete,
- const char *spec_fn,
- const char *state_fn);
-GtkWidget *e_table_scrolled_new_from_spec_file (ETableModel *etm,
- ETableExtras *ete,
- const char *spec_fn,
- const char *state_fn);
-
-ETable *e_table_scrolled_get_table (ETableScrolled *ets);
-
-G_END_DECLS
-
-#endif /* _E_TABLE_SCROLLED_H_ */
-
diff --git a/widgets/table/e-table-search.c b/widgets/table/e-table-search.c
deleted file mode 100644
index c0460e4524..0000000000
--- a/widgets/table/e-table-search.c
+++ /dev/null
@@ -1,223 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-table-search.c
- * Copyright 2000, 2001, Ximian, Inc.
- *
- * Authors:
- * Chris Lahey <clahey@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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 "e-table-search.h"
-#include "gal/util/e-util.h"
-
-#include <string.h>
-
-#define d(x)
-
-d(static gint depth = 0);
-
-struct _ETableSearchPrivate {
- guint timeout_id;
-
- char *search_string;
- gunichar last_character;
-};
-
-static GObjectClass *e_table_search_parent_class;
-
-enum {
- SEARCH_SEARCH,
- SEARCH_ACCEPT,
- LAST_SIGNAL
-};
-
-static guint e_table_search_signals [LAST_SIGNAL] = { 0, };
-
-static gboolean
-e_table_search_search (ETableSearch *e_table_search, char *string, ETableSearchFlags flags)
-{
- gboolean ret_val;
- g_return_val_if_fail (e_table_search != NULL, FALSE);
- g_return_val_if_fail (E_IS_TABLE_SEARCH (e_table_search), FALSE);
-
- g_signal_emit (G_OBJECT (e_table_search),
- e_table_search_signals [SEARCH_SEARCH],
- 0, string, flags, &ret_val);
-
- return ret_val;
-}
-
-static void
-e_table_search_accept (ETableSearch *e_table_search)
-{
- g_return_if_fail (e_table_search != NULL);
- g_return_if_fail (E_IS_TABLE_SEARCH (e_table_search));
-
- g_signal_emit (G_OBJECT (e_table_search),
- e_table_search_signals [SEARCH_ACCEPT], 0);
-}
-
-static gboolean
-ets_accept (gpointer data)
-{
- ETableSearch *ets = data;
- e_table_search_accept (ets);
- g_free (ets->priv->search_string);
-
- ets->priv->timeout_id = 0;
- ets->priv->search_string = g_strdup ("");
- ets->priv->last_character = 0;
-
- return FALSE;
-}
-
-static void
-drop_timeout (ETableSearch *ets)
-{
- if (ets->priv->timeout_id) {
- g_source_remove (ets->priv->timeout_id);
- }
- ets->priv->timeout_id = 0;
-}
-
-static void
-add_timeout (ETableSearch *ets)
-{
- drop_timeout (ets);
- ets->priv->timeout_id = g_timeout_add (1000, ets_accept, ets);
-}
-
-static void
-e_table_search_finalize (GObject *object)
-{
- ETableSearch *ets = (ETableSearch *) object;
-
- drop_timeout (ets);
- g_free (ets->priv->search_string);
- g_free (ets->priv);
-
- if (e_table_search_parent_class->finalize)
- (*e_table_search_parent_class->finalize)(object);
-}
-
-static void
-e_table_search_class_init (GObjectClass *object_class)
-{
- ETableSearchClass *klass = E_TABLE_SEARCH_CLASS(object_class);
- e_table_search_parent_class = g_type_class_peek_parent (klass);
-
- object_class->finalize = e_table_search_finalize;
-
- e_table_search_signals [SEARCH_SEARCH] =
- g_signal_new ("search",
- E_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (ETableSearchClass, search),
- (GSignalAccumulator) NULL, NULL,
- e_marshal_BOOLEAN__STRING_INT,
- G_TYPE_BOOLEAN, 2, G_TYPE_STRING, G_TYPE_INT);
-
- e_table_search_signals [SEARCH_ACCEPT] =
- g_signal_new ("accept",
- E_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (ETableSearchClass, accept),
- (GSignalAccumulator) NULL, NULL,
- g_cclosure_marshal_VOID__VOID,
- G_TYPE_NONE, 0);
-
- klass->search = NULL;
- klass->accept = NULL;
-}
-
-static void
-e_table_search_init (ETableSearch *ets)
-{
- ets->priv = g_new (ETableSearchPrivate, 1);
-
- ets->priv->timeout_id = 0;
- ets->priv->search_string = g_strdup ("");
- ets->priv->last_character = 0;
-}
-
-
-E_MAKE_TYPE(e_table_search, "ETableSearch", ETableSearch, e_table_search_class_init, e_table_search_init, G_TYPE_OBJECT)
-
-ETableSearch *
-e_table_search_new (void)
-{
- ETableSearch *ets = g_object_new (E_TABLE_SEARCH_TYPE, NULL);
-
- return ets;
-}
-
-/**
- * e_table_search_column_count:
- * @e_table_search: The e-table-search to operate on
- *
- * Returns: the number of columns in the table search.
- */
-void
-e_table_search_input_character (ETableSearch *ets, gunichar character)
-{
- char character_utf8[7];
- char *temp_string;
-
- g_return_if_fail (ets != NULL);
- g_return_if_fail (E_IS_TABLE_SEARCH (ets));
-
- character_utf8 [g_unichar_to_utf8 (character, character_utf8)] = 0;
-
- temp_string = g_strdup_printf ("%s%s", ets->priv->search_string, character_utf8);
- if (e_table_search_search (ets, temp_string,
- ets->priv->last_character != 0 ? E_TABLE_SEARCH_FLAGS_CHECK_CURSOR_FIRST : 0)) {
- g_free (ets->priv->search_string);
- ets->priv->search_string = temp_string;
- add_timeout (ets);
- ets->priv->last_character = character;
- return;
- } else {
- g_free (temp_string);
- }
-
- if (character == ets->priv->last_character) {
- if (ets->priv->search_string && e_table_search_search (ets, ets->priv->search_string, 0)) {
- add_timeout (ets);
- }
- }
-}
-
-gboolean
-e_table_search_backspace (ETableSearch *ets)
-{
- char *end;
-
- g_return_val_if_fail (ets != NULL, FALSE);
- g_return_val_if_fail (E_IS_TABLE_SEARCH (ets), FALSE);
-
- if (!ets->priv->search_string ||
- !*ets->priv->search_string)
- return FALSE;
-
- end = ets->priv->search_string + strlen (ets->priv->search_string);
- end = g_utf8_prev_char (end);
- *end = 0;
- ets->priv->last_character = 0;
- add_timeout (ets);
- return TRUE;
-}
diff --git a/widgets/table/e-table-search.h b/widgets/table/e-table-search.h
deleted file mode 100644
index b3cdd9ff41..0000000000
--- a/widgets/table/e-table-search.h
+++ /dev/null
@@ -1,71 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-table-search.h
- * Copyright 2000, 2001, Ximian, Inc.
- *
- * Authors:
- * Chris Lahey <clahey@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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.
- */
-
-#ifndef _E_TABLE_SEARCH_H_
-#define _E_TABLE_SEARCH_H_
-
-#include <gtk/gtkobject.h>
-
-G_BEGIN_DECLS
-
-#define E_TABLE_SEARCH_TYPE (e_table_search_get_type ())
-#define E_TABLE_SEARCH(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), E_TABLE_SEARCH_TYPE, ETableSearch))
-#define E_TABLE_SEARCH_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), E_TABLE_SEARCH_TYPE, ETableSearchClass))
-#define E_IS_TABLE_SEARCH(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), E_TABLE_SEARCH_TYPE))
-#define E_IS_TABLE_SEARCH_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), E_TABLE_SEARCH_TYPE))
-#define E_TABLE_SEARCH_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS((o), E_TABLE_SEARCH_TYPE, ETableSearchClass))
-
-typedef struct _ETableSearchPrivate ETableSearchPrivate;
-
-typedef enum {
- E_TABLE_SEARCH_FLAGS_CHECK_CURSOR_FIRST = 1 << 0
-} ETableSearchFlags;
-
-typedef struct {
- GObject base;
-
- ETableSearchPrivate *priv;
-} ETableSearch;
-
-typedef struct {
- GObjectClass parent_class;
-
- /*
- * Signals
- */
- gboolean (*search) (ETableSearch *ets, char *string /* utf8 */, ETableSearchFlags flags);
- void (*accept) (ETableSearch *ets);
-} ETableSearchClass;
-
-GType e_table_search_get_type (void);
-ETableSearch *e_table_search_new (void);
-
-/**/
-void e_table_search_input_character (ETableSearch *e_table_search,
- gunichar character);
-gboolean e_table_search_backspace (ETableSearch *e_table_search);
-void e_table_search_cancel (ETableSearch *e_table_search);
-
-G_END_DECLS
-
-#endif /* _E_TABLE_SEARCH_H_ */
diff --git a/widgets/table/e-table-selection-model.c b/widgets/table/e-table-selection-model.c
deleted file mode 100644
index 14edf3d6de..0000000000
--- a/widgets/table/e-table-selection-model.c
+++ /dev/null
@@ -1,347 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-table-selection-model.c
- * Copyright 2000, 2001, Ximian, Inc.
- *
- * Authors:
- * Chris Lahey <clahey@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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 "e-table-selection-model.h"
-
-#include <string.h>
-#include <gdk/gdkkeysyms.h>
-
-#include "gal/util/e-i18n.h"
-#include "gal/util/e-util.h"
-
-#define PARENT_TYPE e_selection_model_array_get_type ()
-
-static ESelectionModelArray *parent_class;
-
-static gint etsm_get_row_count (ESelectionModelArray *esm);
-
-enum {
- PROP_0,
- PROP_MODEL,
- PROP_HEADER
-};
-
-static void
-save_to_hash(int model_row, gpointer closure)
-{
- ETableSelectionModel *etsm = closure;
- gchar *key = e_table_model_get_save_id(etsm->model, model_row);
-
- g_hash_table_insert(etsm->hash, key, key);
-}
-
-static void
-free_key(gpointer key, gpointer value, gpointer closure)
-{
- g_free(key);
-}
-
-static void
-free_hash(ETableSelectionModel *etsm)
-{
- if (etsm->hash) {
- g_hash_table_foreach(etsm->hash, free_key, NULL);
- g_hash_table_destroy(etsm->hash);
- etsm->hash = NULL;
- }
- if (etsm->cursor_id)
- g_free(etsm->cursor_id);
- etsm->cursor_id = NULL;
-}
-
-static void
-model_pre_change (ETableModel *etm, ETableSelectionModel *etsm)
-{
- free_hash(etsm);
-
- if (etsm->model && e_table_model_has_save_id (etsm->model)) {
- gint cursor_row;
-
- etsm->hash = g_hash_table_new(g_str_hash, g_str_equal);
- e_selection_model_foreach(E_SELECTION_MODEL(etsm), save_to_hash, etsm);
-
- g_object_get(etsm,
- "cursor_row", &cursor_row,
- NULL);
- g_free (etsm->cursor_id);
- if (cursor_row != -1)
- etsm->cursor_id = e_table_model_get_save_id(etm, cursor_row);
- else
- etsm->cursor_id = NULL;
- }
-}
-
-static gint
-model_changed_idle(ETableSelectionModel *etsm)
-{
- ETableModel *etm = etsm->model;
-
- e_selection_model_clear(E_SELECTION_MODEL(etsm));
-
- if (etsm->cursor_id && etm && e_table_model_has_save_id(etm)) {
- int row_count = e_table_model_row_count(etm);
- int cursor_row = -1;
- int cursor_col = -1;
- int i;
- e_selection_model_array_confirm_row_count(E_SELECTION_MODEL_ARRAY(etsm));
- for (i = 0; i < row_count; i++) {
- char *save_id = e_table_model_get_save_id(etm, i);
- if (g_hash_table_lookup(etsm->hash, save_id))
- e_selection_model_change_one_row(E_SELECTION_MODEL(etsm), i, TRUE);
-
- if (etsm->cursor_id && !strcmp(etsm->cursor_id, save_id)) {
- cursor_row = i;
- cursor_col = e_selection_model_cursor_col(E_SELECTION_MODEL(etsm));
- if (cursor_col == -1) {
- if (etsm->eth) {
- cursor_col = e_table_header_prioritized_column (etsm->eth);
- } else
- cursor_col = 0;
- }
- e_selection_model_change_cursor(E_SELECTION_MODEL(etsm), cursor_row, cursor_col);
- g_free(etsm->cursor_id);
- etsm->cursor_id = NULL;
- }
- g_free(save_id);
- }
- free_hash(etsm);
- e_selection_model_cursor_changed (E_SELECTION_MODEL(etsm), cursor_row, cursor_col);
- e_selection_model_selection_changed (E_SELECTION_MODEL(etsm));
- }
- etsm->model_changed_idle_id = 0;
- return FALSE;
-}
-
-static void
-model_changed(ETableModel *etm, ETableSelectionModel *etsm)
-{
- e_selection_model_clear(E_SELECTION_MODEL(etsm));
- if (!etsm->model_changed_idle_id && etm && e_table_model_has_save_id(etm)) {
- etsm->model_changed_idle_id = g_idle_add_full(G_PRIORITY_HIGH, (GSourceFunc) model_changed_idle, etsm, NULL);
- }
-}
-
-static void
-model_row_changed(ETableModel *etm, int row, ETableSelectionModel *etsm)
-{
- free_hash(etsm);
-}
-
-static void
-model_cell_changed(ETableModel *etm, int col, int row, ETableSelectionModel *etsm)
-{
- free_hash(etsm);
-}
-
-#if 1
-static void
-model_rows_inserted(ETableModel *etm, int row, int count, ETableSelectionModel *etsm)
-{
- e_selection_model_array_insert_rows(E_SELECTION_MODEL_ARRAY(etsm), row, count);
- free_hash(etsm);
-}
-
-static void
-model_rows_deleted(ETableModel *etm, int row, int count, ETableSelectionModel *etsm)
-{
- e_selection_model_array_delete_rows(E_SELECTION_MODEL_ARRAY(etsm), row, count);
- free_hash(etsm);
-}
-
-#else
-
-static void
-model_rows_inserted(ETableModel *etm, int row, int count, ETableSelectionModel *etsm)
-{
- model_changed(etm, etsm);
-}
-
-static void
-model_rows_deleted(ETableModel *etm, int row, int count, ETableSelectionModel *etsm)
-{
- model_changed(etm, etsm);
-}
-#endif
-
-inline static void
-add_model(ETableSelectionModel *etsm, ETableModel *model)
-{
- etsm->model = model;
- if (model) {
- g_object_ref(model);
- etsm->model_pre_change_id = g_signal_connect(G_OBJECT(model), "model_pre_change",
- G_CALLBACK(model_pre_change), etsm);
- etsm->model_changed_id = g_signal_connect(G_OBJECT(model), "model_changed",
- G_CALLBACK(model_changed), etsm);
- etsm->model_row_changed_id = g_signal_connect(G_OBJECT(model), "model_row_changed",
- G_CALLBACK(model_row_changed), etsm);
- etsm->model_cell_changed_id = g_signal_connect(G_OBJECT(model), "model_cell_changed",
- G_CALLBACK(model_cell_changed), etsm);
- etsm->model_rows_inserted_id = g_signal_connect(G_OBJECT(model), "model_rows_inserted",
- G_CALLBACK(model_rows_inserted), etsm);
- etsm->model_rows_deleted_id = g_signal_connect(G_OBJECT(model), "model_rows_deleted",
- G_CALLBACK(model_rows_deleted), etsm);
- }
- e_selection_model_array_confirm_row_count(E_SELECTION_MODEL_ARRAY(etsm));
-}
-
-inline static void
-drop_model(ETableSelectionModel *etsm)
-{
- if (etsm->model) {
- g_signal_handler_disconnect(G_OBJECT(etsm->model),
- etsm->model_pre_change_id);
- g_signal_handler_disconnect(G_OBJECT(etsm->model),
- etsm->model_changed_id);
- g_signal_handler_disconnect(G_OBJECT(etsm->model),
- etsm->model_row_changed_id);
- g_signal_handler_disconnect(G_OBJECT(etsm->model),
- etsm->model_cell_changed_id);
- g_signal_handler_disconnect(G_OBJECT(etsm->model),
- etsm->model_rows_inserted_id);
- g_signal_handler_disconnect(G_OBJECT(etsm->model),
- etsm->model_rows_deleted_id);
-
- g_object_unref(etsm->model);
- }
- etsm->model = NULL;
-}
-
-static void
-etsm_dispose (GObject *object)
-{
- ETableSelectionModel *etsm;
-
- etsm = E_TABLE_SELECTION_MODEL (object);
-
- if (etsm->model_changed_idle_id)
- g_source_remove (etsm->model_changed_idle_id);
- etsm->model_changed_idle_id = 0;
-
- drop_model(etsm);
- free_hash(etsm);
-
- if (G_OBJECT_CLASS(parent_class)->dispose)
- G_OBJECT_CLASS(parent_class)->dispose (object);
-}
-
-static void
-etsm_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec)
-{
- ETableSelectionModel *etsm = E_TABLE_SELECTION_MODEL (object);
-
- switch (prop_id){
- case PROP_MODEL:
- g_value_set_object (value, etsm->model);
- break;
- case PROP_HEADER:
- g_value_set_object (value, etsm->eth);
- break;
- }
-}
-
-static void
-etsm_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec)
-{
- ETableSelectionModel *etsm = E_TABLE_SELECTION_MODEL (object);
-
- switch (prop_id){
- case PROP_MODEL:
- drop_model(etsm);
- add_model(etsm, g_value_get_object (value) ? E_TABLE_MODEL(g_value_get_object (value)) : NULL);
- break;
- case PROP_HEADER:
- etsm->eth = E_TABLE_HEADER (g_value_get_object (value));
- break;
- }
-}
-
-static void
-e_table_selection_model_init (ETableSelectionModel *selection)
-{
- selection->model = NULL;
- selection->hash = NULL;
- selection->cursor_id = NULL;
-
- selection->model_changed_idle_id = 0;
-}
-
-static void
-e_table_selection_model_class_init (ETableSelectionModelClass *klass)
-{
- GObjectClass *object_class;
- ESelectionModelArrayClass *esma_class;
-
- parent_class = g_type_class_ref (PARENT_TYPE);
-
- object_class = G_OBJECT_CLASS(klass);
- esma_class = E_SELECTION_MODEL_ARRAY_CLASS(klass);
-
- object_class->dispose = etsm_dispose;
- object_class->get_property = etsm_get_property;
- object_class->set_property = etsm_set_property;
-
- esma_class->get_row_count = etsm_get_row_count;
-
- g_object_class_install_property (object_class, PROP_MODEL,
- g_param_spec_object ("model",
- _("Model"),
- /*_( */"XXX blurb" /*)*/,
- E_TABLE_MODEL_TYPE,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_HEADER,
- g_param_spec_object ("header",
- _("Header"),
- /*_( */"XXX blurb" /*)*/,
- E_TABLE_HEADER_TYPE,
- G_PARAM_READWRITE));
-}
-
-E_MAKE_TYPE(e_table_selection_model, "ETableSelectionModel", ETableSelectionModel,
- e_table_selection_model_class_init, e_table_selection_model_init, PARENT_TYPE)
-
-/**
- * e_table_selection_model_new
- *
- * This routine creates a new #ETableSelectionModel.
- *
- * Returns: The new #ETableSelectionModel.
- */
-ETableSelectionModel *
-e_table_selection_model_new (void)
-{
- return g_object_new (E_TABLE_SELECTION_MODEL_TYPE, NULL);
-}
-
-static gint
-etsm_get_row_count (ESelectionModelArray *esma)
-{
- ETableSelectionModel *etsm = E_TABLE_SELECTION_MODEL(esma);
-
- if (etsm->model)
- return e_table_model_row_count (etsm->model);
- else
- return 0;
-}
diff --git a/widgets/table/e-table-selection-model.h b/widgets/table/e-table-selection-model.h
deleted file mode 100644
index f3889d6f1b..0000000000
--- a/widgets/table/e-table-selection-model.h
+++ /dev/null
@@ -1,76 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-table-selection-model.h
- * Copyright 2000, 2001, Ximian, Inc.
- *
- * Authors:
- * Chris Lahey <clahey@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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.
- */
-
-#ifndef _E_TABLE_SELECTION_MODEL_H_
-#define _E_TABLE_SELECTION_MODEL_H_
-
-#include <gtk/gtkobject.h>
-#include <gal/widgets/e-selection-model-array.h>
-#include <gal/e-table/e-table-model.h>
-#include <gal/e-table/e-table-header.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
-
-#define E_TABLE_SELECTION_MODEL_TYPE (e_table_selection_model_get_type ())
-#define E_TABLE_SELECTION_MODEL(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), E_TABLE_SELECTION_MODEL_TYPE, ETableSelectionModel))
-#define E_TABLE_SELECTION_MODEL_CLASS(k) (G_TYPE-CHECK_CLASS_CAST((k), E_TABLE_SELECTION_MODEL_TYPE, ETableSelectionModelClass))
-#define E_IS_TABLE_SELECTION_MODEL(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), E_TABLE_SELECTION_MODEL_TYPE))
-#define E_IS_TABLE_SELECTION_MODEL_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), E_TABLE_SELECTION_MODEL_TYPE))
-
-typedef struct {
- ESelectionModelArray base;
-
- ETableModel *model;
- ETableHeader *eth;
-
- guint model_pre_change_id;
- guint model_changed_id;
- guint model_row_changed_id;
- guint model_cell_changed_id;
- guint model_rows_inserted_id;
- guint model_rows_deleted_id;
-
- guint model_changed_idle_id;
-
- guint selection_model_changed : 1;
- guint group_info_changed : 1;
-
- GHashTable *hash;
- char *cursor_id;
-} ETableSelectionModel;
-
-typedef struct {
- ESelectionModelArrayClass parent_class;
-} ETableSelectionModelClass;
-
-GType e_table_selection_model_get_type (void);
-ETableSelectionModel *e_table_selection_model_new (void);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-
-#endif /* _E_TABLE_SELECTION_MODEL_H_ */
diff --git a/widgets/table/e-table-simple.c b/widgets/table/e-table-simple.c
deleted file mode 100644
index b7cf8f66be..0000000000
--- a/widgets/table/e-table-simple.c
+++ /dev/null
@@ -1,289 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-table-simple.c
- * Copyright 2000, 2001, Ximian, Inc.
- *
- * Authors:
- * Chris Lahey <clahey@ximian.com>
- * Miguel de Icaza <miguel.ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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 "e-table-simple.h"
-#include "gal/util/e-util.h"
-
-static int
-simple_column_count (ETableModel *etm)
-{
- ETableSimple *simple = E_TABLE_SIMPLE(etm);
-
- if (simple->col_count)
- return simple->col_count (etm, simple->data);
- else
- return 0;
-}
-
-static int
-simple_row_count (ETableModel *etm)
-{
- ETableSimple *simple = E_TABLE_SIMPLE(etm);
-
- if (simple->row_count)
- return simple->row_count (etm, simple->data);
- else
- return 0;
-}
-
-static void
-simple_append_row (ETableModel *etm, ETableModel *source, int row)
-{
- ETableSimple *simple = E_TABLE_SIMPLE(etm);
-
- if (simple->append_row)
- simple->append_row (etm, source, row, simple->data);
-}
-
-static void *
-simple_value_at (ETableModel *etm, int col, int row)
-{
- ETableSimple *simple = E_TABLE_SIMPLE(etm);
-
- if (simple->value_at)
- return simple->value_at (etm, col, row, simple->data);
- else
- return NULL;
-}
-
-static void
-simple_set_value_at (ETableModel *etm, int col, int row, const void *val)
-{
- ETableSimple *simple = E_TABLE_SIMPLE(etm);
-
- if (simple->set_value_at)
- simple->set_value_at (etm, col, row, val, simple->data);
-}
-
-static gboolean
-simple_is_cell_editable (ETableModel *etm, int col, int row)
-{
- ETableSimple *simple = E_TABLE_SIMPLE(etm);
-
- if (simple->is_cell_editable)
- return simple->is_cell_editable (etm, col, row, simple->data);
- else
- return FALSE;
-}
-
-static gboolean
-simple_has_save_id (ETableModel *etm)
-{
- ETableSimple *simple = E_TABLE_SIMPLE(etm);
-
- if (simple->has_save_id)
- return simple->has_save_id (etm, simple->data);
- else
- return FALSE;
-}
-
-static char *
-simple_get_save_id (ETableModel *etm, int row)
-{
- ETableSimple *simple = E_TABLE_SIMPLE(etm);
-
- if (simple->get_save_id)
- return simple->get_save_id (etm, row, simple->data);
- else
- return NULL;
-}
-
-/* The default for simple_duplicate_value is to return the raw value. */
-static void *
-simple_duplicate_value (ETableModel *etm, int col, const void *value)
-{
- ETableSimple *simple = E_TABLE_SIMPLE(etm);
-
- if (simple->duplicate_value)
- return simple->duplicate_value (etm, col, value, simple->data);
- else
- return (void *)value;
-}
-
-static void
-simple_free_value (ETableModel *etm, int col, void *value)
-{
- ETableSimple *simple = E_TABLE_SIMPLE(etm);
-
- if (simple->free_value)
- simple->free_value (etm, col, value, simple->data);
-}
-
-static void *
-simple_initialize_value (ETableModel *etm, int col)
-{
- ETableSimple *simple = E_TABLE_SIMPLE(etm);
-
- if (simple->initialize_value)
- return simple->initialize_value (etm, col, simple->data);
- else
- return NULL;
-}
-
-static gboolean
-simple_value_is_empty (ETableModel *etm, int col, const void *value)
-{
- ETableSimple *simple = E_TABLE_SIMPLE(etm);
-
- if (simple->value_is_empty)
- return simple->value_is_empty (etm, col, value, simple->data);
- else
- return FALSE;
-}
-
-static char *
-simple_value_to_string (ETableModel *etm, int col, const void *value)
-{
- ETableSimple *simple = E_TABLE_SIMPLE(etm);
-
- if (simple->value_to_string)
- return simple->value_to_string (etm, col, value, simple->data);
- else
- return g_strdup ("");
-}
-
-static void
-e_table_simple_class_init (GObjectClass *object_class)
-{
- ETableModelClass *model_class = (ETableModelClass *) object_class;
-
- model_class->column_count = simple_column_count;
- model_class->row_count = simple_row_count;
- model_class->append_row = simple_append_row;
-
- model_class->value_at = simple_value_at;
- model_class->set_value_at = simple_set_value_at;
- model_class->is_cell_editable = simple_is_cell_editable;
-
- model_class->has_save_id = simple_has_save_id;
- model_class->get_save_id = simple_get_save_id;
-
- model_class->duplicate_value = simple_duplicate_value;
- model_class->free_value = simple_free_value;
- model_class->initialize_value = simple_initialize_value;
- model_class->value_is_empty = simple_value_is_empty;
- model_class->value_to_string = simple_value_to_string;
-}
-
-E_MAKE_TYPE(e_table_simple, "ETableSimple", ETableSimple, e_table_simple_class_init, NULL, E_TABLE_MODEL_TYPE)
-
-/**
- * e_table_simple_new:
- * @col_count:
- * @row_count:
- * @value_at:
- * @set_value_at:
- * @is_cell_editable:
- * @duplicate_value:
- * @free_value:
- * @initialize_value:
- * @value_is_empty:
- * @value_to_string:
- * @data: closure pointer.
- *
- * This initializes a new ETableSimpleModel object. ETableSimpleModel is
- * an implementaiton of the abstract class ETableModel. The ETableSimpleModel
- * is designed to allow people to easily create ETableModels without having
- * to create a new GtkType derived from ETableModel every time they need one.
- *
- * Instead, ETableSimpleModel uses a setup based in callback functions, every
- * callback function signature mimics the signature of each ETableModel method
- * and passes the extra @data pointer to each one of the method to provide them
- * with any context they might want to use.
- *
- * Returns: An ETableSimpleModel object (which is also an ETableModel
- * object).
- */
-ETableModel *
-e_table_simple_new (ETableSimpleColumnCountFn col_count,
- ETableSimpleRowCountFn row_count,
- ETableSimpleAppendRowFn append_row,
-
- ETableSimpleValueAtFn value_at,
- ETableSimpleSetValueAtFn set_value_at,
- ETableSimpleIsCellEditableFn is_cell_editable,
-
- ETableSimpleHasSaveIdFn has_save_id,
- ETableSimpleGetSaveIdFn get_save_id,
-
- ETableSimpleDuplicateValueFn duplicate_value,
- ETableSimpleFreeValueFn free_value,
- ETableSimpleInitializeValueFn initialize_value,
- ETableSimpleValueIsEmptyFn value_is_empty,
- ETableSimpleValueToStringFn value_to_string,
- void *data)
-{
- ETableSimple *et = g_object_new (E_TABLE_SIMPLE_TYPE, NULL);
-
- et->col_count = col_count;
- et->row_count = row_count;
- et->append_row = append_row;
-
- et->value_at = value_at;
- et->set_value_at = set_value_at;
- et->is_cell_editable = is_cell_editable;
-
- et->has_save_id = has_save_id;
- et->get_save_id = get_save_id;
-
- et->duplicate_value = duplicate_value;
- et->free_value = free_value;
- et->initialize_value = initialize_value;
- et->value_is_empty = value_is_empty;
- et->value_to_string = value_to_string;
- et->data = data;
-
- return (ETableModel *) et;
-}
-
-void *
-e_table_simple_string_duplicate_value (ETableModel *etm, int col, const void *val, void *data)
-{
- return g_strdup (val);
-}
-
-void
-e_table_simple_string_free_value (ETableModel *etm, int col, void *val, void *data)
-{
- g_free (val);
-}
-
-void *
-e_table_simple_string_initialize_value (ETableModel *etm, int col, void *data)
-{
- return g_strdup ("");
-}
-
-gboolean
-e_table_simple_string_value_is_empty (ETableModel *etm, int col, const void *val, void *data)
-{
- return !(val && * (char *) val);
-}
-
-char *
-e_table_simple_string_value_to_string (ETableModel *etm, int col, const void *val, void *data)
-{
- return g_strdup (val);
-}
diff --git a/widgets/table/e-table-simple.h b/widgets/table/e-table-simple.h
deleted file mode 100644
index 39800c3118..0000000000
--- a/widgets/table/e-table-simple.h
+++ /dev/null
@@ -1,122 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-table-simple.h
- * Copyright 2000, 2001, Ximian, Inc.
- *
- * Authors:
- * Chris Lahey <clahey@ximian.com>
- * Miguel de Icaza <miguel@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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.
- */
-
-#ifndef _E_TABLE_SIMPLE_H_
-#define _E_TABLE_SIMPLE_H_
-
-#include <gal/e-table/e-table-model.h>
-
-G_BEGIN_DECLS
-
-#define E_TABLE_SIMPLE_TYPE (e_table_simple_get_type ())
-#define E_TABLE_SIMPLE(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), E_TABLE_SIMPLE_TYPE, ETableSimple))
-#define E_TABLE_SIMPLE_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), E_TABLE_SIMPLE_TYPE, ETableSimpleClass))
-#define E_IS_TABLE_SIMPLE(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), E_TABLE_SIMPLE_TYPE))
-#define E_IS_TABLE_SIMPLE_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), E_TABLE_SIMPLE_TYPE))
-#define E_TABLE_SIMPLE_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS((o), E_TABLE_SIMPLE_TYPE, ETableSimpleClass))
-
-typedef int (*ETableSimpleColumnCountFn) (ETableModel *etm, void *data);
-typedef int (*ETableSimpleRowCountFn) (ETableModel *etm, void *data);
-typedef void (*ETableSimpleAppendRowFn) (ETableModel *etm, ETableModel *model, int row, void *data);
-
-typedef void *(*ETableSimpleValueAtFn) (ETableModel *etm, int col, int row, void *data);
-typedef void (*ETableSimpleSetValueAtFn) (ETableModel *etm, int col, int row, const void *val, void *data);
-typedef gboolean (*ETableSimpleIsCellEditableFn) (ETableModel *etm, int col, int row, void *data);
-
-typedef gboolean (*ETableSimpleHasSaveIdFn) (ETableModel *etm, void *data);
-typedef char *(*ETableSimpleGetSaveIdFn) (ETableModel *etm, int row, void *data);
-
-typedef void *(*ETableSimpleDuplicateValueFn) (ETableModel *etm, int col, const void *val, void *data);
-typedef void (*ETableSimpleFreeValueFn) (ETableModel *etm, int col, void *val, void *data);
-typedef void *(*ETableSimpleInitializeValueFn) (ETableModel *etm, int col, void *data);
-typedef gboolean (*ETableSimpleValueIsEmptyFn) (ETableModel *etm, int col, const void *val, void *data);
-typedef char *(*ETableSimpleValueToStringFn) (ETableModel *etm, int col, const void *val, void *data);
-
-typedef struct {
- ETableModel parent;
-
- ETableSimpleColumnCountFn col_count;
- ETableSimpleRowCountFn row_count;
- ETableSimpleAppendRowFn append_row;
-
- ETableSimpleValueAtFn value_at;
- ETableSimpleSetValueAtFn set_value_at;
- ETableSimpleIsCellEditableFn is_cell_editable;
-
- ETableSimpleHasSaveIdFn has_save_id;
- ETableSimpleGetSaveIdFn get_save_id;
-
- ETableSimpleDuplicateValueFn duplicate_value;
- ETableSimpleFreeValueFn free_value;
- ETableSimpleInitializeValueFn initialize_value;
- ETableSimpleValueIsEmptyFn value_is_empty;
- ETableSimpleValueToStringFn value_to_string;
- void *data;
-} ETableSimple;
-
-typedef struct {
- ETableModelClass parent_class;
-} ETableSimpleClass;
-
-GType e_table_simple_get_type (void);
-ETableModel *e_table_simple_new (ETableSimpleColumnCountFn col_count,
- ETableSimpleRowCountFn row_count,
- ETableSimpleAppendRowFn append_row,
- ETableSimpleValueAtFn value_at,
- ETableSimpleSetValueAtFn set_value_at,
- ETableSimpleIsCellEditableFn is_cell_editable,
- ETableSimpleHasSaveIdFn has_save_id,
- ETableSimpleGetSaveIdFn get_save_id,
- ETableSimpleDuplicateValueFn duplicate_value,
- ETableSimpleFreeValueFn free_value,
- ETableSimpleInitializeValueFn initialize_value,
- ETableSimpleValueIsEmptyFn value_is_empty,
- ETableSimpleValueToStringFn value_to_string,
- void *data);
-
-
-/* Helper functions for if your values are all just strings. */
-void *e_table_simple_string_duplicate_value (ETableModel *etm,
- int col,
- const void *val,
- void *data);
-void e_table_simple_string_free_value (ETableModel *etm,
- int col,
- void *val,
- void *data);
-void *e_table_simple_string_initialize_value (ETableModel *etm,
- int col,
- void *data);
-gboolean e_table_simple_string_value_is_empty (ETableModel *etm,
- int col,
- const void *val,
- void *data);
-char *e_table_simple_string_value_to_string (ETableModel *etm,
- int col,
- const void *val,
- void *data);
-
-G_END_DECLS
-
-#endif /* _E_TABLE_SIMPLE_H_ */
diff --git a/widgets/table/e-table-size-test.c b/widgets/table/e-table-size-test.c
deleted file mode 100644
index 05a4245899..0000000000
--- a/widgets/table/e-table-size-test.c
+++ /dev/null
@@ -1,307 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-table-size-test.c
- * Copyright 2000, 2001, Ximian, Inc.
- *
- * Authors:
- * Chris Lahey <clahey@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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 <stdio.h>
-#include <string.h>
-#include <gnome.h>
-#include <gdk-pixbuf/gdk-pixbuf.h>
-#include "gal/e-util/e-cursors.h"
-#include "e-table-simple.h"
-#include "e-table-header.h"
-#include "e-table-header-item.h"
-#include "e-table-item.h"
-#include "e-cell-text.h"
-#include "e-cell-checkbox.h"
-#include "e-table.h"
-
-#include "table-test.h"
-
-/*
- * One way in which we make it simpler to build an ETableModel is through
- * the ETableSimple class. Instead of creating your own ETableModel
- * class, you simply create a new object of the ETableSimple class. You
- * give it a bunch of functions that act as callbacks.
- *
- * You also get to pass a void * to ETableSimple and it gets passed to
- * your callbacks. This would be for having multiple models of the same
- * type. This is just an example though, so we statically define all the
- * data and ignore the void *data parameter.
- *
- * In our example we will be creating a table model with 6 columns and 10
- * rows. This corresponds to having 6 different types of information and
- * 10 different sets of data in our database.
- *
- * The headers will be hard coded, as will be the example data.
- *
- */
-
-/*
- * There are two different meanings to the word "column". The first is
- * the model column. A model column corresponds to a specific type of
- * data. This is very much like the usage in a database table where a
- * column is a field in the database.
- *
- * The second type of column is a view column. A view column
- * corresponds to a visually displayed column. Each view column
- * corresponds to a specific model column, though a model column may
- * have any number of view columns associated with it, from zero to
- * greater than one.
- *
- * Also, a view column doesn't necessarily depend on only one model
- * column. In some cases, the view column renderer can be given a
- * reference to another column to get extra information about its
- * display.
-*/
-
-#define ROWS 5000
-#define COLS 4
-
-#define IMPORTANCE_COLUMN 4
-#define COLOR_COLUMN 5
-
-/*
- * Here we define the initial layout of the table. This is an xml
- * format that allows you to change the initial ordering of the
- * columns or to do sorting or grouping initially. This specification
- * shows all 5 columns, but moves the importance column nearer to the
- * front. It also sorts by the "Full Name" column (ascending.)
- * Sorting and grouping take the model column as their arguments
- * (sorting is specified by the "column" argument to the leaf elemnt.
- */
-
-#define INITIAL_SPEC "<ETableSpecification> \
- <columns-shown> \
- <column> 0 </column> \
- <column> 4 </column> \
- <column> 1 </column> \
- <column> 2 </column> \
- <column> 3 </column> \
- </columns-shown> \
- <grouping> <leaf column=\"1\" ascending=\"true\"/> </grouping> \
-</ETableSpecification>"
-
-char *headers [COLS] = {
- "Email",
- "Full Name",
- "Address",
- "Phone"
-};
-
-/*
- * Virtual Column list:
- * 0 Email
- * 1 Full Name
- * 2 Address
- * 3 Phone
- */
-
-/*
- * ETableSimple callbacks
- * These are the callbacks that define the behavior of our custom model.
- */
-
-/*
- * Since our model is a constant size, we can just return its size in
- * the column and row count fields.
- */
-
-/* This function returns the number of columns in our ETableModel. */
-static int
-my_col_count (ETableModel *etc, void *data)
-{
- return COLS;
-}
-
-/* This function returns the number of rows in our ETableModel. */
-static int
-my_row_count (ETableModel *etc, void *data)
-{
- return ROWS;
-}
-
-/* This function returns the value at a particular point in our ETableModel. */
-static void *
-my_value_at (ETableModel *etc, int col, int row, void *data)
-{
- static guchar t[] = {'A', 0xc3, 0x84, 0xc3, 0x95, 0xc3, 0x94, 0xc3, 0xb5, 0x00};
-
-#if 0
- if (col == 1) return "toshok@ximian.com";
-#else
- if (col == 1) return t;
-#endif
- else if (col == 2) return "Chris Toshok";
- else if (col == 3) return "43 Vicksburg, SF";
- else if (col == 4) return "415-867-5309";
- else return NULL;
-}
-
-/* This function sets the value at a particular point in our ETableModel. */
-static void
-my_set_value_at (ETableModel *etc, int col, int row, const void *val, void *data)
-{
-}
-
-/* This function returns whether a particular cell is editable. */
-static gboolean
-my_is_cell_editable (ETableModel *etc, int col, int row, void *data)
-{
- return FALSE;
-}
-
-/* This function duplicates the value passed to it. */
-static void *
-my_duplicate_value (ETableModel *etc, int col, const void *value, void *data)
-{
- return g_strdup (value);
-}
-
-/* This function frees the value passed to it. */
-static void
-my_free_value (ETableModel *etc, int col, void *value, void *data)
-{
- g_free (value);
-}
-
-/* This function creates an empty value. */
-static void *
-my_initialize_value (ETableModel *etc, int col, void *data)
-{
- return g_strdup ("");
-}
-
-/* This function reports if a value is empty. */
-static gboolean
-my_value_is_empty (ETableModel *etc, int col, const void *value, void *data)
-{
- return !(value && *(char *)value);
-}
-
-/* This function reports if a value is empty. */
-static char *
-my_value_to_string (ETableModel *etc, int col, const void *value, void *data)
-{
- return g_strdup(value);
-}
-
-/* We create a window containing our new table. */
-static void
-create_table (void)
-{
- GtkWidget *e_table, *window, *frame;
- ECell *cell_left_just;
- ETableHeader *e_table_header;
- ETableModel *e_table_model = NULL;
- int i;
-
- /* Next we create our model. This uses the functions we defined
- earlier. */
- e_table_model = e_table_simple_new (
- my_col_count, my_row_count, my_value_at,
- my_set_value_at, my_is_cell_editable,
- my_duplicate_value, my_free_value,
- my_initialize_value, my_value_is_empty,
- my_value_to_string,
- NULL);
- /*
- * 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 (e_table_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 < COLS; i++) {
- /* Create the column. */
- ETableCol *ecol = e_table_col_new (
- i, headers [i],
- 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 a window for our new table. This window
- * will get shown and the person will be able to test their
- * item.
- */
- window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
-
- /* This frame is simply to get a bevel around our table. */
- frame = gtk_frame_new (NULL);
-
- /*
- * 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.
- */
- e_table = e_table_new (e_table_header, e_table_model, INITIAL_SPEC);
-
- /* Build the gtk widget hierarchy. */
- gtk_container_add (GTK_CONTAINER (frame), e_table);
- gtk_container_add (GTK_CONTAINER (window), frame);
-
- /* Size the initial window. */
- gtk_widget_set_usize (window, 300, 200);
-
- /* Show it all. */
- gtk_widget_show_all (window);
-}
-
-/* This is the main function which just initializes gnome and call our create_table function */
-
-int
-main (int argc, char *argv [])
-{
- gnome_init ("TableExample", "TableExample", argc, argv);
- e_cursors_init ();
-
- gtk_widget_push_colormap (gdk_rgb_get_cmap ());
-
- create_table ();
-
- gtk_main ();
-
- e_cursors_shutdown ();
- return 0;
-}
-
diff --git a/widgets/table/e-table-sort-info.c b/widgets/table/e-table-sort-info.c
deleted file mode 100644
index c25acf6d0a..0000000000
--- a/widgets/table/e-table-sort-info.c
+++ /dev/null
@@ -1,481 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-table-sort-info.c
- * Copyright 2000, 2001, Ximian, Inc.
- *
- * Authors:
- * Chris Lahey <clahey@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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 "e-table-sort-info.h"
-
-#include "gal/util/e-util.h"
-#include "gal/util/e-xml-utils.h"
-#include <string.h>
-
-#define ETM_CLASS(e) (E_TABLE_SORT_INFO_GET_CLASS (e))
-
-static GObjectClass *e_table_sort_info_parent_class;
-
-enum {
- SORT_INFO_CHANGED,
- GROUP_INFO_CHANGED,
- LAST_SIGNAL
-};
-
-static guint e_table_sort_info_signals [LAST_SIGNAL] = { 0, };
-
-static void
-etsi_finalize (GObject *object)
-{
- ETableSortInfo *etsi = E_TABLE_SORT_INFO (object);
-
- if (etsi->groupings)
- g_free(etsi->groupings);
- etsi->groupings = NULL;
-
- if (etsi->sortings)
- g_free(etsi->sortings);
- etsi->sortings = NULL;
-
- G_OBJECT_CLASS (e_table_sort_info_parent_class)->finalize (object);
-}
-
-static void
-e_table_sort_info_init (ETableSortInfo *info)
-{
- info->group_count = 0;
- info->groupings = NULL;
- info->sort_count = 0;
- info->sortings = NULL;
- info->frozen = 0;
- info->sort_info_changed = 0;
- info->group_info_changed = 0;
- info->can_group = 1;
-}
-
-static void
-e_table_sort_info_class_init (ETableSortInfoClass *klass)
-{
- GObjectClass * object_class = G_OBJECT_CLASS (klass);
-
- e_table_sort_info_parent_class = g_type_class_peek_parent (klass);
-
- object_class->finalize = etsi_finalize;
-
- e_table_sort_info_signals [SORT_INFO_CHANGED] =
- g_signal_new ("sort_info_changed",
- E_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (ETableSortInfoClass, sort_info_changed),
- (GSignalAccumulator) NULL, NULL,
- g_cclosure_marshal_VOID__VOID,
- G_TYPE_NONE, 0);
-
- e_table_sort_info_signals [GROUP_INFO_CHANGED] =
- g_signal_new ("group_info_changed",
- E_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (ETableSortInfoClass, group_info_changed),
- (GSignalAccumulator) NULL, NULL,
- g_cclosure_marshal_VOID__VOID,
- G_TYPE_NONE, 0);
-
- klass->sort_info_changed = NULL;
- klass->group_info_changed = NULL;
-}
-
-E_MAKE_TYPE(e_table_sort_info, "ETableSortInfo", ETableSortInfo,
- e_table_sort_info_class_init, e_table_sort_info_init, G_TYPE_OBJECT)
-
-static void
-e_table_sort_info_sort_info_changed (ETableSortInfo *info)
-{
- g_return_if_fail (info != NULL);
- g_return_if_fail (E_IS_TABLE_SORT_INFO (info));
-
- if (info->frozen) {
- info->sort_info_changed = 1;
- } else {
- g_signal_emit (G_OBJECT (info), e_table_sort_info_signals [SORT_INFO_CHANGED], 0);
- }
-}
-
-static void
-e_table_sort_info_group_info_changed (ETableSortInfo *info)
-{
- g_return_if_fail (info != NULL);
- g_return_if_fail (E_IS_TABLE_SORT_INFO (info));
-
- if (info->frozen) {
- info->group_info_changed = 1;
- } else {
- g_signal_emit (G_OBJECT (info), e_table_sort_info_signals [GROUP_INFO_CHANGED], 0);
- }
-}
-
-/**
- * e_table_sort_info_freeze:
- * @info: The ETableSortInfo object
- *
- * This functions allows the programmer to cluster various changes to the
- * ETableSortInfo (grouping and sorting) without having the object emit
- * "group_info_changed" or "sort_info_changed" signals on each change.
- *
- * To thaw, invoke the e_table_sort_info_thaw() function, which will
- * trigger any signals that might have been queued.
- */
-void
-e_table_sort_info_freeze (ETableSortInfo *info)
-{
- info->frozen++;
-}
-
-/**
- * e_table_sort_info_thaw:
- * @info: The ETableSortInfo object
- *
- * This functions allows the programmer to cluster various changes to the
- * ETableSortInfo (grouping and sorting) without having the object emit
- * "group_info_changed" or "sort_info_changed" signals on each change.
- *
- * This function will flush any pending signals that might be emited by
- * this object.
- */
-void
-e_table_sort_info_thaw (ETableSortInfo *info)
-{
- info->frozen--;
- if (info->frozen != 0)
- return;
-
- if (info->sort_info_changed) {
- info->sort_info_changed = 0;
- e_table_sort_info_sort_info_changed(info);
- }
- if (info->group_info_changed) {
- info->group_info_changed = 0;
- e_table_sort_info_group_info_changed(info);
- }
-}
-
-/**
- * e_table_sort_info_grouping_get_count:
- * @info: The ETableSortInfo object
- *
- * Returns: the number of grouping criteria in the object.
- */
-guint
-e_table_sort_info_grouping_get_count (ETableSortInfo *info)
-{
- if (info->can_group)
- return info->group_count;
- else
- return 0;
-}
-
-static void
-e_table_sort_info_grouping_real_truncate (ETableSortInfo *info, int length)
-{
- if (length < info->group_count) {
- info->group_count = length;
- }
- if (length > info->group_count) {
- info->groupings = g_realloc(info->groupings, length * sizeof(ETableSortColumn));
- info->group_count = length;
- }
-}
-
-/**
- * e_table_sort_info_grouping_truncate:
- * @info: The ETableSortInfo object
- * @lenght: position where the truncation happens.
- *
- * This routine can be used to reduce or grow the number of grouping
- * criteria in the object.
- */
-void
-e_table_sort_info_grouping_truncate (ETableSortInfo *info, int length)
-{
- e_table_sort_info_grouping_real_truncate(info, length);
- e_table_sort_info_group_info_changed(info);
-}
-
-/**
- * e_table_sort_info_grouping_get_nth:
- * @info: The ETableSortInfo object
- * @n: Item information to fetch.
- *
- * Returns: the description of the @n-th grouping criteria in the @info object.
- */
-ETableSortColumn
-e_table_sort_info_grouping_get_nth (ETableSortInfo *info, int n)
-{
- if (info->can_group && n < info->group_count) {
- return info->groupings[n];
- } else {
- ETableSortColumn fake = {0, 0};
- return fake;
- }
-}
-
-/**
- * e_table_sort_info_grouping_set_nth:
- * @info: The ETableSortInfo object
- * @n: Item information to fetch.
- * @column: new values for the grouping
- *
- * Sets the grouping criteria for index @n to be given by @column (a column number and
- * whether it is ascending or descending).
- */
-void
-e_table_sort_info_grouping_set_nth (ETableSortInfo *info, int n, ETableSortColumn column)
-{
- if (n >= info->group_count) {
- e_table_sort_info_grouping_real_truncate(info, n + 1);
- }
- info->groupings[n] = column;
- e_table_sort_info_group_info_changed(info);
-}
-
-
-/**
- * e_table_sort_info_get_count:
- * @info: The ETableSortInfo object
- *
- * Returns: the number of sorting criteria in the object.
- */
-guint
-e_table_sort_info_sorting_get_count (ETableSortInfo *info)
-{
- return info->sort_count;
-}
-
-static void
-e_table_sort_info_sorting_real_truncate (ETableSortInfo *info, int length)
-{
- if (length < info->sort_count) {
- info->sort_count = length;
- }
- if (length > info->sort_count) {
- info->sortings = g_realloc(info->sortings, length * sizeof(ETableSortColumn));
- info->sort_count = length;
- }
-}
-
-/**
- * e_table_sort_info_sorting_truncate:
- * @info: The ETableSortInfo object
- * @lenght: position where the truncation happens.
- *
- * This routine can be used to reduce or grow the number of sort
- * criteria in the object.
- */
-void
-e_table_sort_info_sorting_truncate (ETableSortInfo *info, int length)
-{
- e_table_sort_info_sorting_real_truncate (info, length);
- e_table_sort_info_sort_info_changed(info);
-}
-
-/**
- * e_table_sort_info_sorting_get_nth:
- * @info: The ETableSortInfo object
- * @n: Item information to fetch.
- *
- * Returns: the description of the @n-th grouping criteria in the @info object.
- */
-ETableSortColumn
-e_table_sort_info_sorting_get_nth (ETableSortInfo *info, int n)
-{
- if (n < info->sort_count) {
- return info->sortings[n];
- } else {
- ETableSortColumn fake = {0, 0};
- return fake;
- }
-}
-
-/**
- * e_table_sort_info_sorting_get_nth:
- * @info: The ETableSortInfo object
- * @n: Item information to fetch.
- * @column: new values for the sorting
- *
- * Sets the sorting criteria for index @n to be given by @column (a
- * column number and whether it is ascending or descending).
- */
-void
-e_table_sort_info_sorting_set_nth (ETableSortInfo *info, int n, ETableSortColumn column)
-{
- if (n >= info->sort_count) {
- e_table_sort_info_sorting_real_truncate(info, n + 1);
- }
- info->sortings[n] = column;
- e_table_sort_info_sort_info_changed(info);
-}
-
-/**
- * e_table_sort_info_new:
- *
- * This creates a new e_table_sort_info object that contains no
- * grouping and no sorting defined as of yet. This object is used
- * to keep track of multi-level sorting and multi-level grouping of
- * the ETable.
- *
- * Returns: A new %ETableSortInfo object
- */
-ETableSortInfo *
-e_table_sort_info_new (void)
-{
- return g_object_new (E_TABLE_SORT_INFO_TYPE, NULL);
-}
-
-/**
- * e_table_sort_info_load_from_node:
- * @info: The ETableSortInfo object
- * @node: pointer to the xmlNode that describes the sorting and grouping information
- * @state_version:
- *
- * This loads the state for the %ETableSortInfo object @info from the
- * xml node @node.
- */
-void
-e_table_sort_info_load_from_node (ETableSortInfo *info,
- xmlNode *node,
- gdouble state_version)
-{
- int i;
- xmlNode *grouping;
-
- if (state_version <= 0.05) {
- i = 0;
- for (grouping = node->xmlChildrenNode; grouping && !strcmp (grouping->name, "group"); grouping = grouping->xmlChildrenNode) {
- ETableSortColumn column;
- column.column = e_xml_get_integer_prop_by_name (grouping, "column");
- column.ascending = e_xml_get_bool_prop_by_name (grouping, "ascending");
- e_table_sort_info_grouping_set_nth(info, i++, column);
- }
- i = 0;
- for (; grouping && !strcmp (grouping->name, "leaf"); grouping = grouping->xmlChildrenNode) {
- ETableSortColumn column;
- column.column = e_xml_get_integer_prop_by_name (grouping, "column");
- column.ascending = e_xml_get_bool_prop_by_name (grouping, "ascending");
- e_table_sort_info_sorting_set_nth(info, i++, column);
- }
- } else {
- for (grouping = node->children; grouping; grouping = grouping->next) {
- ETableSortColumn column;
- gint gcnt = 0;
- gint scnt = 0;
-
- if (grouping->type != XML_ELEMENT_NODE)
- continue;
-
- if (!strcmp (grouping->name, "group")) {
- column.column = e_xml_get_integer_prop_by_name (grouping, "column");
- column.ascending = e_xml_get_bool_prop_by_name (grouping, "ascending");
- e_table_sort_info_grouping_set_nth(info, gcnt++, column);
- } else if (!strcmp (grouping->name, "leaf")) {
- column.column = e_xml_get_integer_prop_by_name (grouping, "column");
- column.ascending = e_xml_get_bool_prop_by_name (grouping, "ascending");
- e_table_sort_info_sorting_set_nth(info, scnt++, column);
- }
- }
- }
- g_signal_emit (G_OBJECT (info), e_table_sort_info_signals [SORT_INFO_CHANGED], 0);
-}
-
-/**
- * e_table_sort_info_save_to_node:
- * @info: The ETableSortInfo object
- * @parent: xmlNode that will be hosting the saved state of the @info object.
- *
- * This function is used
- *
- * Returns: the node that has been appended to @parent as a child containing
- * the sorting and grouping information for this ETableSortInfo object.
- */
-xmlNode *
-e_table_sort_info_save_to_node (ETableSortInfo *info,
- xmlNode *parent)
-{
- xmlNode *grouping;
- xmlNode *node;
- int i;
- const int sort_count = e_table_sort_info_sorting_get_count (info);
- const int group_count = e_table_sort_info_grouping_get_count (info);
-
- grouping = xmlNewChild (parent, NULL, "grouping", NULL);
-
- for (i = 0; i < group_count; i++) {
- ETableSortColumn column = e_table_sort_info_grouping_get_nth(info, i);
- xmlNode *new_node = xmlNewChild(grouping, NULL, "group", NULL);
-
- e_xml_set_integer_prop_by_name (new_node, "column", column.column);
- e_xml_set_bool_prop_by_name (new_node, "ascending", column.ascending);
- node = new_node;
- }
-
- for (i = 0; i < sort_count; i++) {
- ETableSortColumn column = e_table_sort_info_sorting_get_nth(info, i);
- xmlNode *new_node = xmlNewChild(grouping, NULL, "leaf", NULL);
-
- e_xml_set_integer_prop_by_name (new_node, "column", column.column);
- e_xml_set_bool_prop_by_name (new_node, "ascending", column.ascending);
- node = new_node;
- }
-
- return grouping;
-}
-
-ETableSortInfo *
-e_table_sort_info_duplicate (ETableSortInfo *info)
-{
- ETableSortInfo *new_info;
-
- new_info = e_table_sort_info_new();
-
- new_info->group_count = info->group_count;
- new_info->groupings = g_new(ETableSortColumn, new_info->group_count);
- memmove(new_info->groupings, info->groupings, sizeof (ETableSortColumn) * new_info->group_count);
-
- new_info->sort_count = info->sort_count;
- new_info->sortings = g_new(ETableSortColumn, new_info->sort_count);
- memmove(new_info->sortings, info->sortings, sizeof (ETableSortColumn) * new_info->sort_count);
-
- new_info->can_group = info->can_group;
-
- return new_info;
-}
-
-void
-e_table_sort_info_set_can_group (ETableSortInfo *info,
- gboolean can_group)
-{
- info->can_group = can_group;
-}
-
-gboolean
-e_table_sort_info_get_can_group (ETableSortInfo *info)
-{
- return info->can_group;
-}
-
-
diff --git a/widgets/table/e-table-sort-info.h b/widgets/table/e-table-sort-info.h
deleted file mode 100644
index 4710fbd453..0000000000
--- a/widgets/table/e-table-sort-info.h
+++ /dev/null
@@ -1,107 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-table-sort-info.h
- * Copyright 2000, 2001, Ximian, Inc.
- *
- * Authors:
- * Chris Lahey <clahey@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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.
- */
-
-#ifndef _E_TABLE_SORT_INFO_H_
-#define _E_TABLE_SORT_INFO_H_
-
-#include <glib-object.h>
-#include <libxml/tree.h>
-
-G_BEGIN_DECLS
-
-#define E_TABLE_SORT_INFO_TYPE (e_table_sort_info_get_type ())
-#define E_TABLE_SORT_INFO(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), E_TABLE_SORT_INFO_TYPE, ETableSortInfo))
-#define E_TABLE_SORT_INFO_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), E_TABLE_SORT_INFO_TYPE, ETableSortInfoClass))
-#define E_IS_TABLE_SORT_INFO(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), E_TABLE_SORT_INFO_TYPE))
-#define E_IS_TABLE_SORT_INFO_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), E_TABLE_SORT_INFO_TYPE))
-#define E_TABLE_SORT_INFO_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS((o), E_TABLE_SORT_INFO_TYPE, ETableSortInfoClass))
-
-typedef struct _ETableSortColumn ETableSortColumn;
-
-struct _ETableSortColumn {
- guint column : 31;
- guint ascending : 1;
-};
-
-typedef struct {
- GObject base;
-
- gint group_count;
- ETableSortColumn *groupings;
- gint sort_count;
- ETableSortColumn *sortings;
-
- guint frozen : 1;
- guint sort_info_changed : 1;
- guint group_info_changed : 1;
-
- guint can_group : 1;
-} ETableSortInfo;
-
-typedef struct {
- GObjectClass parent_class;
-
- /*
- * Signals
- */
- void (*sort_info_changed) (ETableSortInfo *info);
- void (*group_info_changed) (ETableSortInfo *info);
-} ETableSortInfoClass;
-
-GType e_table_sort_info_get_type (void);
-
-void e_table_sort_info_freeze (ETableSortInfo *info);
-void e_table_sort_info_thaw (ETableSortInfo *info);
-
-guint e_table_sort_info_grouping_get_count (ETableSortInfo *info);
-void e_table_sort_info_grouping_truncate (ETableSortInfo *info,
- int length);
-ETableSortColumn e_table_sort_info_grouping_get_nth (ETableSortInfo *info,
- int n);
-void e_table_sort_info_grouping_set_nth (ETableSortInfo *info,
- int n,
- ETableSortColumn column);
-
-guint e_table_sort_info_sorting_get_count (ETableSortInfo *info);
-void e_table_sort_info_sorting_truncate (ETableSortInfo *info,
- int length);
-ETableSortColumn e_table_sort_info_sorting_get_nth (ETableSortInfo *info,
- int n);
-void e_table_sort_info_sorting_set_nth (ETableSortInfo *info,
- int n,
- ETableSortColumn column);
-
-ETableSortInfo *e_table_sort_info_new (void);
-void e_table_sort_info_load_from_node (ETableSortInfo *info,
- xmlNode *node,
- gdouble state_version);
-xmlNode *e_table_sort_info_save_to_node (ETableSortInfo *info,
- xmlNode *parent);
-ETableSortInfo *e_table_sort_info_duplicate (ETableSortInfo *info);
-void e_table_sort_info_set_can_group (ETableSortInfo *info,
- gboolean can_group);
-gboolean e_table_sort_info_get_can_group (ETableSortInfo *info);
-
-G_END_DECLS
-
-#endif /* _E_TABLE_SORT_INFO_H_ */
diff --git a/widgets/table/e-table-sorted-variable.c b/widgets/table/e-table-sorted-variable.c
deleted file mode 100644
index 1e271f997f..0000000000
--- a/widgets/table/e-table-sorted-variable.c
+++ /dev/null
@@ -1,228 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-table-sorted-variable.c
- * Copyright 2000, 2001, Ximian, Inc.
- *
- * Authors:
- * Chris Lahey <clahey@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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 <stdlib.h>
-#include <string.h>
-#include "gal/util/e-util.h"
-#include "e-table-sorted-variable.h"
-#include "e-table-sorting-utils.h"
-
-#define d(x)
-
-#define INCREMENT_AMOUNT 100
-
-/* maximum insertions between an idle event that we will do without scheduling an idle sort */
-#define ETSV_INSERT_MAX (4)
-
-static ETableSubsetVariableClass *etsv_parent_class;
-
-static void etsv_sort_info_changed (ETableSortInfo *info, ETableSortedVariable *etsv);
-static void etsv_sort (ETableSortedVariable *etsv);
-static void etsv_add (ETableSubsetVariable *etssv, gint row);
-static void etsv_add_all (ETableSubsetVariable *etssv);
-
-static void
-etsv_dispose (GObject *object)
-{
- ETableSortedVariable *etsv = E_TABLE_SORTED_VARIABLE (object);
-
- if (etsv->sort_info_changed_id)
- g_signal_handler_disconnect (G_OBJECT (etsv->sort_info),
- etsv->sort_info_changed_id);
- etsv->sort_info_changed_id = 0;
-
- if (etsv->sort_idle_id) {
- g_source_remove(etsv->sort_idle_id);
- etsv->sort_idle_id = 0;
- }
- if (etsv->insert_idle_id) {
- g_source_remove(etsv->insert_idle_id);
- etsv->insert_idle_id = 0;
- }
-
- if (etsv->sort_info)
- g_object_unref(etsv->sort_info);
- etsv->sort_info = NULL;
-
- if (etsv->full_header)
- g_object_unref(etsv->full_header);
- etsv->full_header = NULL;
-
- G_OBJECT_CLASS (etsv_parent_class)->dispose (object);
-}
-
-static void
-etsv_class_init (GObjectClass *object_class)
-{
- ETableSubsetVariableClass *etssv_class = E_TABLE_SUBSET_VARIABLE_CLASS(object_class);
-
- etsv_parent_class = g_type_class_peek_parent (object_class);
-
- object_class->dispose = etsv_dispose;
-
- etssv_class->add = etsv_add;
- etssv_class->add_all = etsv_add_all;
-}
-
-static void
-etsv_init (ETableSortedVariable *etsv)
-{
- etsv->full_header = NULL;
- etsv->sort_info = NULL;
-
- etsv->sort_info_changed_id = 0;
-
- etsv->sort_idle_id = 0;
- etsv->insert_count = 0;
-}
-
-E_MAKE_TYPE(e_table_sorted_variable, "ETableSortedVariable", ETableSortedVariable, etsv_class_init, etsv_init, E_TABLE_SUBSET_VARIABLE_TYPE)
-
-static gboolean
-etsv_sort_idle(ETableSortedVariable *etsv)
-{
- g_object_ref(etsv);
- etsv_sort(etsv);
- etsv->sort_idle_id = 0;
- etsv->insert_count = 0;
- g_object_unref(etsv);
- return FALSE;
-}
-
-static gboolean
-etsv_insert_idle(ETableSortedVariable *etsv)
-{
- etsv->insert_count = 0;
- etsv->insert_idle_id = 0;
- return FALSE;
-}
-
-
-static void
-etsv_add (ETableSubsetVariable *etssv,
- gint row)
-{
- ETableModel *etm = E_TABLE_MODEL(etssv);
- ETableSubset *etss = E_TABLE_SUBSET(etssv);
- ETableSortedVariable *etsv = E_TABLE_SORTED_VARIABLE (etssv);
- int i;
-
- if (etss->n_map + 1 > etssv->n_vals_allocated) {
- etssv->n_vals_allocated += INCREMENT_AMOUNT;
- etss->map_table = g_realloc (etss->map_table, (etssv->n_vals_allocated) * sizeof(int));
- }
- i = etss->n_map;
- if (etsv->sort_idle_id == 0) {
- /* this is to see if we're inserting a lot of things between idle loops.
- If we are, we're busy, its faster to just append and perform a full sort later */
- etsv->insert_count++;
- if (etsv->insert_count > ETSV_INSERT_MAX) {
- /* schedule a sort, and append instead */
- etsv->sort_idle_id = g_idle_add_full(50, (GSourceFunc) etsv_sort_idle, etsv, NULL);
- } else {
- /* make sure we have an idle handler to reset the count every now and then */
- if (etsv->insert_idle_id == 0) {
- etsv->insert_idle_id = g_idle_add_full(40, (GSourceFunc) etsv_insert_idle, etsv, NULL);
- }
- i = e_table_sorting_utils_insert(etss->source, etsv->sort_info, etsv->full_header, etss->map_table, etss->n_map, row);
- memmove(etss->map_table + i + 1, etss->map_table + i, (etss->n_map - i) * sizeof(int));
- }
- }
- etss->map_table[i] = row;
- etss->n_map++;
-
- e_table_model_row_inserted (etm, i);
-}
-
-static void
-etsv_add_all (ETableSubsetVariable *etssv)
-{
- ETableModel *etm = E_TABLE_MODEL(etssv);
- ETableSubset *etss = E_TABLE_SUBSET(etssv);
- ETableSortedVariable *etsv = E_TABLE_SORTED_VARIABLE (etssv);
- int rows;
- int i;
-
- e_table_model_pre_change(etm);
-
- rows = e_table_model_row_count(etss->source);
-
- if (etss->n_map + rows > etssv->n_vals_allocated){
- etssv->n_vals_allocated += MAX(INCREMENT_AMOUNT, rows);
- etss->map_table = g_realloc (etss->map_table, etssv->n_vals_allocated * sizeof(int));
- }
- for (i = 0; i < rows; i++)
- etss->map_table[etss->n_map++] = i;
-
- if (etsv->sort_idle_id == 0) {
- etsv->sort_idle_id = g_idle_add_full(50, (GSourceFunc) etsv_sort_idle, etsv, NULL);
- }
-
- e_table_model_changed (etm);
-}
-
-ETableModel *
-e_table_sorted_variable_new (ETableModel *source, ETableHeader *full_header, ETableSortInfo *sort_info)
-{
- ETableSortedVariable *etsv = g_object_new (E_TABLE_SORTED_VARIABLE_TYPE, NULL);
- ETableSubsetVariable *etssv = E_TABLE_SUBSET_VARIABLE (etsv);
-
- if (e_table_subset_variable_construct (etssv, source) == NULL){
- g_object_unref (etsv);
- return NULL;
- }
-
- etsv->sort_info = sort_info;
- g_object_ref(etsv->sort_info);
- etsv->full_header = full_header;
- g_object_ref(etsv->full_header);
-
- etsv->sort_info_changed_id = g_signal_connect (G_OBJECT (sort_info), "sort_info_changed",
- G_CALLBACK (etsv_sort_info_changed), etsv);
-
- return E_TABLE_MODEL(etsv);
-}
-
-static void
-etsv_sort_info_changed (ETableSortInfo *info, ETableSortedVariable *etsv)
-{
- etsv_sort(etsv);
-}
-
-static void
-etsv_sort(ETableSortedVariable *etsv)
-{
- ETableSubset *etss = E_TABLE_SUBSET(etsv);
- static int reentering = 0;
- if (reentering)
- return;
- reentering = 1;
-
- e_table_model_pre_change(E_TABLE_MODEL(etsv));
-
- e_table_sorting_utils_sort(etss->source, etsv->sort_info, etsv->full_header, etss->map_table, etss->n_map);
-
- e_table_model_changed (E_TABLE_MODEL(etsv));
- reentering = 0;
-}
diff --git a/widgets/table/e-table-sorted-variable.h b/widgets/table/e-table-sorted-variable.h
deleted file mode 100644
index 546d04b240..0000000000
--- a/widgets/table/e-table-sorted-variable.h
+++ /dev/null
@@ -1,65 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-table-sorted-variable.h
- * Copyright 2000, 2001, Ximian, Inc.
- *
- * Authors:
- * Chris Lahey <clahey@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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.
- */
-
-#ifndef _E_TABLE_SORTED_VARIABLE_H_
-#define _E_TABLE_SORTED_VARIABLE_H_
-
-#include <glib-object.h>
-#include <gal/e-table/e-table-model.h>
-#include <gal/e-table/e-table-subset-variable.h>
-#include <gal/e-table/e-table-sort-info.h>
-#include <gal/e-table/e-table-header.h>
-
-G_BEGIN_DECLS
-
-#define E_TABLE_SORTED_VARIABLE_TYPE (e_table_sorted_variable_get_type ())
-#define E_TABLE_SORTED_VARIABLE(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), E_TABLE_SORTED_VARIABLE_TYPE, ETableSortedVariable))
-#define E_TABLE_SORTED_VARIABLE_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), E_TABLE_SORTED_VARIABLE_TYPE, ETableSortedVariableClass))
-#define E_IS_TABLE_SORTED_VARIABLE(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), E_TABLE_SORTED_VARIABLE_TYPE))
-#define E_IS_TABLE_SORTED_VARIABLE_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), E_TABLE_SORTED_VARIABLE_TYPE))
-#define E_TABLE_SORTED_VARIABLE_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS((o), E_TABLE_SORTED_VARIABLE_TYPE, ETableSortedVariableClass))
-
-typedef struct {
- ETableSubsetVariable base;
-
- ETableSortInfo *sort_info;
-
- ETableHeader *full_header;
-
- int sort_info_changed_id;
- int sort_idle_id;
- int insert_idle_id;
- int insert_count;
-
-} ETableSortedVariable;
-
-typedef struct {
- ETableSubsetVariableClass parent_class;
-} ETableSortedVariableClass;
-
-GType e_table_sorted_variable_get_type (void);
-ETableModel *e_table_sorted_variable_new (ETableModel *etm, ETableHeader *header, ETableSortInfo *sort_info);
-
-G_END_DECLS
-
-#endif /* _E_TABLE_SORTED_VARIABLE_H_ */
diff --git a/widgets/table/e-table-sorted.c b/widgets/table/e-table-sorted.c
deleted file mode 100644
index a5b5acb8cf..0000000000
--- a/widgets/table/e-table-sorted.c
+++ /dev/null
@@ -1,310 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-table-sorted.c
- * Copyright 2000, 2001, Ximian, Inc.
- *
- * Authors:
- * Chris Lahey <clahey@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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 <stdlib.h>
-#include <string.h>
-#include "gal/util/e-util.h"
-#include "e-table-sorted.h"
-#include "e-table-sorting-utils.h"
-
-#define d(x)
-
-#define INCREMENT_AMOUNT 100
-
-/* maximum insertions between an idle event that we will do without scheduling an idle sort */
-#define ETS_INSERT_MAX (4)
-
-static ETableSubsetClass *ets_parent_class;
-
-static void ets_sort_info_changed (ETableSortInfo *info, ETableSorted *ets);
-static void ets_sort (ETableSorted *ets);
-static void ets_proxy_model_changed (ETableSubset *etss, ETableModel *source);
-static void ets_proxy_model_row_changed (ETableSubset *etss, ETableModel *source, int row);
-static void ets_proxy_model_cell_changed (ETableSubset *etss, ETableModel *source, int col, int row);
-static void ets_proxy_model_rows_inserted (ETableSubset *etss, ETableModel *source, int row, int count);
-static void ets_proxy_model_rows_deleted (ETableSubset *etss, ETableModel *source, int row, int count);
-
-static void
-ets_dispose (GObject *object)
-{
- ETableSorted *ets = E_TABLE_SORTED (object);
-
- if (ets->sort_idle_id)
- g_source_remove(ets->sort_idle_id);
- ets->sort_idle_id = 0;
-
- if (ets->insert_idle_id)
- g_source_remove(ets->insert_idle_id);
- ets->insert_idle_id = 0;
-
- if (ets->sort_info) {
- g_signal_handler_disconnect (G_OBJECT (ets->sort_info),
- ets->sort_info_changed_id);
- g_object_unref(ets->sort_info);
- ets->sort_info = NULL;
- }
-
- if (ets->full_header)
- g_object_unref(ets->full_header);
- ets->full_header = NULL;
-
- G_OBJECT_CLASS (ets_parent_class)->dispose (object);
-}
-
-static void
-ets_class_init (GObjectClass *object_class)
-{
- ETableSubsetClass *etss_class = E_TABLE_SUBSET_CLASS(object_class);
-
- ets_parent_class = g_type_class_peek_parent (object_class);
-
- etss_class->proxy_model_changed = ets_proxy_model_changed;
- etss_class->proxy_model_row_changed = ets_proxy_model_row_changed;
- etss_class->proxy_model_cell_changed = ets_proxy_model_cell_changed;
- etss_class->proxy_model_rows_inserted = ets_proxy_model_rows_inserted;
- etss_class->proxy_model_rows_deleted = ets_proxy_model_rows_deleted;
-
- object_class->dispose = ets_dispose;
-}
-
-static void
-ets_init (ETableSorted *ets)
-{
- ets->full_header = NULL;
- ets->sort_info = NULL;
-
- ets->sort_info_changed_id = 0;
-
- ets->sort_idle_id = 0;
- ets->insert_count = 0;
-}
-
-E_MAKE_TYPE(e_table_sorted, "ETableSorted", ETableSorted, ets_class_init, ets_init, E_TABLE_SUBSET_TYPE)
-
-static gboolean
-ets_sort_idle(ETableSorted *ets)
-{
- g_object_ref(ets);
- ets_sort(ets);
- ets->sort_idle_id = 0;
- ets->insert_count = 0;
- g_object_unref(ets);
- return FALSE;
-}
-
-static gboolean
-ets_insert_idle(ETableSorted *ets)
-{
- ets->insert_count = 0;
- ets->insert_idle_id = 0;
- return FALSE;
-}
-
-ETableModel *
-e_table_sorted_new (ETableModel *source, ETableHeader *full_header, ETableSortInfo *sort_info)
-{
- ETableSorted *ets = g_object_new (E_TABLE_SORTED_TYPE, NULL);
- ETableSubset *etss = E_TABLE_SUBSET (ets);
-
- if (ets_parent_class->proxy_model_pre_change)
- (ets_parent_class->proxy_model_pre_change) (etss, source);
-
- if (e_table_subset_construct (etss, source, 0) == NULL){
- g_object_unref (ets);
- return NULL;
- }
-
- ets->sort_info = sort_info;
- g_object_ref(ets->sort_info);
- ets->full_header = full_header;
- g_object_ref(ets->full_header);
-
- ets_proxy_model_changed(etss, source);
-
- ets->sort_info_changed_id = g_signal_connect (G_OBJECT (sort_info), "sort_info_changed",
- G_CALLBACK (ets_sort_info_changed), ets);
-
- return E_TABLE_MODEL(ets);
-}
-
-static void
-ets_sort_info_changed (ETableSortInfo *info, ETableSorted *ets)
-{
- ets_sort(ets);
-}
-
-static void
-ets_proxy_model_changed (ETableSubset *subset, ETableModel *source)
-{
- int rows, i;
-
- rows = e_table_model_row_count(source);
-
- g_free(subset->map_table);
- subset->n_map = rows;
- subset->map_table = g_new(int, rows);
-
- for (i = 0; i < rows; i++) {
- subset->map_table[i] = i;
- }
-
- if (!E_TABLE_SORTED(subset)->sort_idle_id)
- E_TABLE_SORTED(subset)->sort_idle_id = g_idle_add_full(50, (GSourceFunc) ets_sort_idle, subset, NULL);
-
- e_table_model_changed(E_TABLE_MODEL(subset));
-}
-
-static void
-ets_proxy_model_row_changed (ETableSubset *subset, ETableModel *source, int row)
-{
- if (!E_TABLE_SORTED(subset)->sort_idle_id)
- E_TABLE_SORTED(subset)->sort_idle_id = g_idle_add_full(50, (GSourceFunc) ets_sort_idle, subset, NULL);
-
- if (ets_parent_class->proxy_model_row_changed)
- (ets_parent_class->proxy_model_row_changed) (subset, source, row);
-}
-
-static void
-ets_proxy_model_cell_changed (ETableSubset *subset, ETableModel *source, int col, int row)
-{
- ETableSorted *ets = E_TABLE_SORTED(subset);
- if (e_table_sorting_utils_affects_sort(ets->sort_info, ets->full_header, col))
- ets_proxy_model_row_changed(subset, source, row);
- else if (ets_parent_class->proxy_model_cell_changed)
- (ets_parent_class->proxy_model_cell_changed) (subset, source, col, row);
-}
-
-static void
-ets_proxy_model_rows_inserted (ETableSubset *etss, ETableModel *source, int row, int count)
-{
- ETableModel *etm = E_TABLE_MODEL(etss);
- ETableSorted *ets = E_TABLE_SORTED(etss);
- int i;
- gboolean full_change = FALSE;
-
- if (count == 0) {
- e_table_model_no_change (etm);
- return;
- }
-
- if (row != etss->n_map) {
- full_change = TRUE;
- for (i = 0; i < etss->n_map; i++) {
- if (etss->map_table[i] >= row) {
- etss->map_table[i] += count;
- }
- }
- }
-
- etss->map_table = g_realloc (etss->map_table, (etss->n_map + count) * sizeof(int));
-
- for (; count > 0; count --) {
- if (!full_change)
- e_table_model_pre_change (etm);
- i = etss->n_map;
- if (ets->sort_idle_id == 0) {
- /* this is to see if we're inserting a lot of things between idle loops.
- If we are, we're busy, its faster to just append and perform a full sort later */
- ets->insert_count++;
- if (ets->insert_count > ETS_INSERT_MAX) {
- /* schedule a sort, and append instead */
- ets->sort_idle_id = g_idle_add_full(50, (GSourceFunc) ets_sort_idle, ets, NULL);
- } else {
- /* make sure we have an idle handler to reset the count every now and then */
- if (ets->insert_idle_id == 0) {
- ets->insert_idle_id = g_idle_add_full(40, (GSourceFunc) ets_insert_idle, ets, NULL);
- }
- i = e_table_sorting_utils_insert(etss->source, ets->sort_info, ets->full_header, etss->map_table, etss->n_map, row);
- memmove(etss->map_table + i + 1, etss->map_table + i, (etss->n_map - i) * sizeof(int));
- }
- }
- etss->map_table[i] = row;
- etss->n_map++;
- if (!full_change) {
- e_table_model_row_inserted (etm, i);
- }
-
- d(g_print("inserted row %d", row));
- row++;
- }
- if (full_change)
- e_table_model_changed (etm);
- else
- e_table_model_no_change (etm);
- d(e_table_subset_print_debugging(etss));
-}
-
-static void
-ets_proxy_model_rows_deleted (ETableSubset *etss, ETableModel *source, int row, int count)
-{
- ETableModel *etm = E_TABLE_MODEL(etss);
- int i;
- gboolean shift;
- int j;
-
- shift = row == etss->n_map - count;
-
- for (j = 0; j < count; j++) {
- for (i = 0; i < etss->n_map; i++){
- if (etss->map_table[i] == row + j) {
- if (shift)
- e_table_model_pre_change (etm);
- memmove (etss->map_table + i, etss->map_table + i + 1, (etss->n_map - i - 1) * sizeof(int));
- etss->n_map --;
- if (shift)
- e_table_model_row_deleted (etm, i);
- }
- }
- }
- if (!shift) {
- for (i = 0; i < etss->n_map; i++) {
- if (etss->map_table[i] >= row)
- etss->map_table[i] -= count;
- }
-
- e_table_model_changed (etm);
- } else {
- e_table_model_no_change (etm);
- }
-
- d(g_print("deleted row %d count %d", row, count));
- d(e_table_subset_print_debugging(etss));
-}
-
-static void
-ets_sort(ETableSorted *ets)
-{
- ETableSubset *etss = E_TABLE_SUBSET(ets);
- static int reentering = 0;
- if (reentering)
- return;
- reentering = 1;
-
- e_table_model_pre_change(E_TABLE_MODEL(ets));
-
- e_table_sorting_utils_sort(etss->source, ets->sort_info, ets->full_header, etss->map_table, etss->n_map);
-
- e_table_model_changed (E_TABLE_MODEL(ets));
- reentering = 0;
-}
diff --git a/widgets/table/e-table-sorted.h b/widgets/table/e-table-sorted.h
deleted file mode 100644
index e1265b0a08..0000000000
--- a/widgets/table/e-table-sorted.h
+++ /dev/null
@@ -1,65 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-table-sorted.h
- * Copyright 2000, 2001, Ximian, Inc.
- *
- * Authors:
- * Chris Lahey <clahey@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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.
- */
-
-#ifndef _E_TABLE_SORTED_H_
-#define _E_TABLE_SORTED_H_
-
-#include <glib-object.h>
-#include <gal/e-table/e-table-model.h>
-#include <gal/e-table/e-table-subset.h>
-#include <gal/e-table/e-table-sort-info.h>
-#include <gal/e-table/e-table-header.h>
-
-G_BEGIN_DECLS
-
-#define E_TABLE_SORTED_TYPE (e_table_sorted_get_type ())
-#define E_TABLE_SORTED(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), E_TABLE_SORTED_TYPE, ETableSorted))
-#define E_TABLE_SORTED_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), E_TABLE_SORTED_TYPE, ETableSortedClass))
-#define E_IS_TABLE_SORTED(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), E_TABLE_SORTED_TYPE))
-#define E_IS_TABLE_SORTED_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), E_TABLE_SORTED_TYPE))
-#define E_TABLE_SORTED_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((obj), E_TABLE_SORTED_TYPE, ETableSortedClass))
-
-typedef struct {
- ETableSubset base;
-
- ETableSortInfo *sort_info;
-
- ETableHeader *full_header;
-
- int sort_info_changed_id;
- int sort_idle_id;
- int insert_idle_id;
- int insert_count;
-
-} ETableSorted;
-
-typedef struct {
- ETableSubsetClass parent_class;
-} ETableSortedClass;
-
-GType e_table_sorted_get_type (void);
-ETableModel *e_table_sorted_new (ETableModel *etm, ETableHeader *header, ETableSortInfo *sort_info);
-
-G_END_DECLS
-
-#endif /* _E_TABLE_SORTED_H_ */
diff --git a/widgets/table/e-table-sorter.c b/widgets/table/e-table-sorter.c
deleted file mode 100644
index a92af49f4d..0000000000
--- a/widgets/table/e-table-sorter.c
+++ /dev/null
@@ -1,462 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-table-sorter.c
- * Copyright 2000, 2001, Ximian, Inc.
- *
- * Authors:
- * Chris Lahey <clahey@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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 <stdlib.h>
-#include <string.h>
-#include "gal/util/e-i18n.h"
-#include "gal/util/e-util.h"
-#include "e-table-sorter.h"
-
-#define d(x)
-
-/* The arguments we take */
-enum {
- PROP_0,
- PROP_SORT_INFO
-};
-
-#define PARENT_TYPE e_sorter_get_type()
-
-#define INCREMENT_AMOUNT 100
-
-static ESorterClass *parent_class;
-
-static void ets_model_changed (ETableModel *etm, ETableSorter *ets);
-static void ets_model_row_changed (ETableModel *etm, int row, ETableSorter *ets);
-static void ets_model_cell_changed (ETableModel *etm, int col, int row, ETableSorter *ets);
-static void ets_model_rows_inserted (ETableModel *etm, int row, int count, ETableSorter *ets);
-static void ets_model_rows_deleted (ETableModel *etm, int row, int count, ETableSorter *ets);
-static void ets_sort_info_changed (ETableSortInfo *info, ETableSorter *ets);
-static void ets_clean (ETableSorter *ets);
-static void ets_sort (ETableSorter *ets);
-static void ets_backsort (ETableSorter *ets);
-
-static gint ets_model_to_sorted (ESorter *sorter, int row);
-static gint ets_sorted_to_model (ESorter *sorter, int row);
-static void ets_get_model_to_sorted_array (ESorter *sorter, int **array, int *count);
-static void ets_get_sorted_to_model_array (ESorter *sorter, int **array, int *count);
-static gboolean ets_needs_sorting (ESorter *ets);
-
-static void
-ets_dispose (GObject *object)
-{
- ETableSorter *ets = E_TABLE_SORTER (object);
-
- if (ets->sort_info) {
- if (ets->table_model_changed_id)
- g_signal_handler_disconnect (ets->source,
- ets->table_model_changed_id);
- if (ets->table_model_row_changed_id)
- g_signal_handler_disconnect (ets->source,
- ets->table_model_row_changed_id);
- if (ets->table_model_cell_changed_id)
- g_signal_handler_disconnect (ets->source,
- ets->table_model_cell_changed_id);
- if (ets->table_model_rows_inserted_id)
- g_signal_handler_disconnect (ets->source,
- ets->table_model_rows_inserted_id);
- if (ets->table_model_rows_deleted_id)
- g_signal_handler_disconnect (ets->source,
- ets->table_model_rows_deleted_id);
- if (ets->sort_info_changed_id)
- g_signal_handler_disconnect (ets->sort_info,
- ets->sort_info_changed_id);
- if (ets->group_info_changed_id)
- g_signal_handler_disconnect (ets->sort_info,
- ets->group_info_changed_id);
-
- ets->table_model_changed_id = 0;
- ets->table_model_row_changed_id = 0;
- ets->table_model_cell_changed_id = 0;
- ets->table_model_rows_inserted_id = 0;
- ets->table_model_rows_deleted_id = 0;
- ets->sort_info_changed_id = 0;
- ets->group_info_changed_id = 0;
-
- g_object_unref(ets->sort_info);
- ets->sort_info = NULL;
- }
-
- if (ets->full_header)
- g_object_unref(ets->full_header);
- ets->full_header = NULL;
-
- if (ets->source)
- g_object_unref(ets->source);
- ets->source = NULL;
-
- G_OBJECT_CLASS (parent_class)->dispose (object);
-}
-
-static void
-ets_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec)
-{
- ETableSorter *ets = E_TABLE_SORTER (object);
-
- switch (prop_id) {
- case PROP_SORT_INFO:
- if (ets->sort_info) {
- if (ets->sort_info_changed_id)
- g_signal_handler_disconnect(ets->sort_info, ets->sort_info_changed_id);
- if (ets->group_info_changed_id)
- g_signal_handler_disconnect(ets->sort_info, ets->group_info_changed_id);
- g_object_unref(ets->sort_info);
- }
-
- ets->sort_info = E_TABLE_SORT_INFO(g_value_get_object (value));
- g_object_ref(ets->sort_info);
- ets->sort_info_changed_id = g_signal_connect (ets->sort_info, "sort_info_changed",
- G_CALLBACK (ets_sort_info_changed), ets);
- ets->group_info_changed_id = g_signal_connect (ets->sort_info, "group_info_changed",
- G_CALLBACK (ets_sort_info_changed), ets);
-
- ets_clean (ets);
- break;
- default:
- break;
- }
-}
-
-static void
-ets_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec)
-{
- ETableSorter *ets = E_TABLE_SORTER (object);
- switch (prop_id) {
- case PROP_SORT_INFO:
- g_value_set_object (value, ets->sort_info);
- break;
- }
-}
-
-static void
-ets_class_init (ETableSorterClass *klass)
-{
- GObjectClass *object_class = G_OBJECT_CLASS(klass);
- ESorterClass *sorter_class = E_SORTER_CLASS(klass);
-
- parent_class = g_type_class_peek_parent (klass);
-
- object_class->dispose = ets_dispose;
- object_class->set_property = ets_set_property;
- object_class->get_property = ets_get_property;
-
- sorter_class->model_to_sorted = ets_model_to_sorted ;
- sorter_class->sorted_to_model = ets_sorted_to_model ;
- sorter_class->get_model_to_sorted_array = ets_get_model_to_sorted_array ;
- sorter_class->get_sorted_to_model_array = ets_get_sorted_to_model_array ;
- sorter_class->needs_sorting = ets_needs_sorting ;
-
- g_object_class_install_property (object_class, PROP_SORT_INFO,
- g_param_spec_object ("sort_info",
- _("Sort Info"),
- /*_( */"XXX blurb" /*)*/,
- E_TABLE_SORT_INFO_TYPE,
- G_PARAM_READWRITE));
-}
-
-static void
-ets_init (ETableSorter *ets)
-{
- ets->full_header = NULL;
- ets->sort_info = NULL;
- ets->source = NULL;
-
- ets->needs_sorting = -1;
-
- ets->table_model_changed_id = 0;
- ets->table_model_row_changed_id = 0;
- ets->table_model_cell_changed_id = 0;
- ets->table_model_rows_inserted_id = 0;
- ets->table_model_rows_deleted_id = 0;
- ets->sort_info_changed_id = 0;
- ets->group_info_changed_id = 0;
-}
-
-E_MAKE_TYPE(e_table_sorter, "ETableSorter", ETableSorter, ets_class_init, ets_init, PARENT_TYPE)
-
-ETableSorter *
-e_table_sorter_new (ETableModel *source, ETableHeader *full_header, ETableSortInfo *sort_info)
-{
- ETableSorter *ets = g_object_new (E_TABLE_SORTER_TYPE, NULL);
-
- ets->sort_info = sort_info;
- g_object_ref(ets->sort_info);
- ets->full_header = full_header;
- g_object_ref(ets->full_header);
- ets->source = source;
- g_object_ref(ets->source);
-
- ets->table_model_changed_id = g_signal_connect (source, "model_changed",
- G_CALLBACK (ets_model_changed), ets);
- ets->table_model_row_changed_id = g_signal_connect (source, "model_row_changed",
- G_CALLBACK (ets_model_row_changed), ets);
- ets->table_model_cell_changed_id = g_signal_connect (source, "model_cell_changed",
- G_CALLBACK (ets_model_cell_changed), ets);
- ets->table_model_rows_inserted_id = g_signal_connect (source, "model_rows_inserted",
- G_CALLBACK (ets_model_rows_inserted), ets);
- ets->table_model_rows_deleted_id = g_signal_connect (source, "model_rows_deleted",
- G_CALLBACK (ets_model_rows_deleted), ets);
- ets->sort_info_changed_id = g_signal_connect (sort_info, "sort_info_changed",
- G_CALLBACK (ets_sort_info_changed), ets);
- ets->group_info_changed_id = g_signal_connect (sort_info, "group_info_changed",
- G_CALLBACK (ets_sort_info_changed), ets);
-
- return ets;
-}
-
-static void
-ets_model_changed (ETableModel *etm, ETableSorter *ets)
-{
- ets_clean(ets);
-}
-
-static void
-ets_model_row_changed (ETableModel *etm, int row, ETableSorter *ets)
-{
- ets_clean(ets);
-}
-
-static void
-ets_model_cell_changed (ETableModel *etm, int col, int row, ETableSorter *ets)
-{
- ets_clean(ets);
-}
-
-static void
-ets_model_rows_inserted (ETableModel *etm, int row, int count, ETableSorter *ets)
-{
- ets_clean(ets);
-}
-
-static void
-ets_model_rows_deleted (ETableModel *etm, int row, int count, ETableSorter *ets)
-{
- ets_clean(ets);
-}
-
-static void
-ets_sort_info_changed (ETableSortInfo *info, ETableSorter *ets)
-{
- d(g_print ("sort info changed\n"));
- ets_clean(ets);
-}
-
-static ETableSorter *ets_closure;
-static void **vals_closure;
-static int cols_closure;
-static int *ascending_closure;
-static GCompareFunc *compare_closure;
-
-/* FIXME: Make it not cache the second and later columns (as if anyone cares.) */
-
-static int
-qsort_callback(const void *data1, const void *data2)
-{
- gint row1 = *(int *)data1;
- gint row2 = *(int *)data2;
- int j;
- int sort_count = e_table_sort_info_sorting_get_count(ets_closure->sort_info) + e_table_sort_info_grouping_get_count(ets_closure->sort_info);
- int comp_val = 0;
- int ascending = 1;
- for (j = 0; j < sort_count; j++) {
- comp_val = (*(compare_closure[j]))(vals_closure[cols_closure * row1 + j], vals_closure[cols_closure * row2 + j]);
- ascending = ascending_closure[j];
- if (comp_val != 0)
- break;
- }
- if (comp_val == 0) {
- if (row1 < row2)
- comp_val = -1;
- if (row1 > row2)
- comp_val = 1;
- }
- if (!ascending)
- comp_val = -comp_val;
- return comp_val;
-}
-
-static void
-ets_clean(ETableSorter *ets)
-{
- g_free(ets->sorted);
- ets->sorted = NULL;
-
- g_free(ets->backsorted);
- ets->backsorted = NULL;
-
- ets->needs_sorting = -1;
-}
-
-
-static void
-ets_sort(ETableSorter *ets)
-{
- int rows;
- int i;
- int j;
- int cols;
- int group_cols;
-
- if (ets->sorted)
- return;
-
- rows = e_table_model_row_count(ets->source);
- group_cols = e_table_sort_info_grouping_get_count(ets->sort_info);
- cols = e_table_sort_info_sorting_get_count(ets->sort_info) + group_cols;
-
- ets->sorted = g_new(int, rows);
- for (i = 0; i < rows; i++)
- ets->sorted[i] = i;
-
- cols_closure = cols;
- ets_closure = ets;
-
- vals_closure = g_new(void *, rows * cols);
- ascending_closure = g_new(int, cols);
- compare_closure = g_new(GCompareFunc, cols);
-
- for (j = 0; j < cols; j++) {
- ETableSortColumn column;
- ETableCol *col;
-
- if (j < group_cols)
- column = e_table_sort_info_grouping_get_nth(ets->sort_info, j);
- else
- column = e_table_sort_info_sorting_get_nth(ets->sort_info, j - group_cols);
-
- col = e_table_header_get_column_by_col_idx(ets->full_header, column.column);
- if (col == NULL)
- col = e_table_header_get_column (ets->full_header, e_table_header_count (ets->full_header) - 1);
-
- for (i = 0; i < rows; i++) {
- vals_closure[i * cols + j] = e_table_model_value_at (ets->source, col->col_idx, i);
- }
-
- compare_closure[j] = col->compare;
- ascending_closure[j] = column.ascending;
- }
-
- qsort(ets->sorted, rows, sizeof(int), qsort_callback);
-
- g_free(vals_closure);
- g_free(ascending_closure);
- g_free(compare_closure);
-}
-
-static void
-ets_backsort(ETableSorter *ets)
-{
- int i, rows;
-
- if (ets->backsorted)
- return;
-
- ets_sort(ets);
-
- rows = e_table_model_row_count(ets->source);
- ets->backsorted = g_new0(int, rows);
-
- for (i = 0; i < rows; i++) {
- ets->backsorted[ets->sorted[i]] = i;
- }
-}
-
-
-static gint
-ets_model_to_sorted (ESorter *es, int row)
-{
- ETableSorter *ets = E_TABLE_SORTER(es);
- int rows = e_table_model_row_count(ets->source);
-
- g_return_val_if_fail(row >= 0, -1);
- g_return_val_if_fail(row < rows, -1);
-
- if (ets_needs_sorting(es))
- ets_backsort(ets);
-
- if (ets->backsorted)
- return ets->backsorted[row];
- else
- return row;
-}
-
-static gint
-ets_sorted_to_model (ESorter *es, int row)
-{
- ETableSorter *ets = E_TABLE_SORTER(es);
- int rows = e_table_model_row_count(ets->source);
-
- g_return_val_if_fail(row >= 0, -1);
- g_return_val_if_fail(row < rows, -1);
-
- if (ets_needs_sorting(es))
- ets_sort(ets);
-
- if (ets->sorted)
- return ets->sorted[row];
- else
- return row;
-}
-
-static void
-ets_get_model_to_sorted_array (ESorter *es, int **array, int *count)
-{
- ETableSorter *ets = E_TABLE_SORTER(es);
- if (array || count) {
- ets_backsort(ets);
-
- if (array)
- *array = ets->backsorted;
- if (count)
- *count = e_table_model_row_count(ets->source);
- }
-}
-
-static void
-ets_get_sorted_to_model_array (ESorter *es, int **array, int *count)
-{
- ETableSorter *ets = E_TABLE_SORTER(es);
- if (array || count) {
- ets_sort(ets);
-
- if (array)
- *array = ets->sorted;
- if (count)
- *count = e_table_model_row_count(ets->source);
- }
-}
-
-
-static gboolean
-ets_needs_sorting(ESorter *es)
-{
- ETableSorter *ets = E_TABLE_SORTER(es);
- if (ets->needs_sorting < 0) {
- if (e_table_sort_info_sorting_get_count(ets->sort_info) + e_table_sort_info_grouping_get_count(ets->sort_info))
- ets->needs_sorting = 1;
- else
- ets->needs_sorting = 0;
- }
- return ets->needs_sorting;
-}
diff --git a/widgets/table/e-table-sorter.h b/widgets/table/e-table-sorter.h
deleted file mode 100644
index 67be48715a..0000000000
--- a/widgets/table/e-table-sorter.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-table-sorter.h
- * Copyright 2000, 2001, Ximian, Inc.
- *
- * Authors:
- * Chris Lahey <clahey@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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.
- */
-
-#ifndef _E_TABLE_SORTER_H_
-#define _E_TABLE_SORTER_H_
-
-#include <glib-object.h>
-#include <gal/util/e-sorter.h>
-#include <gal/e-table/e-table-model.h>
-#include <gal/e-table/e-table-subset-variable.h>
-#include <gal/e-table/e-table-sort-info.h>
-#include <gal/e-table/e-table-header.h>
-
-G_BEGIN_DECLS
-
-#define E_TABLE_SORTER_TYPE (e_table_sorter_get_type ())
-#define E_TABLE_SORTER(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), E_TABLE_SORTER_TYPE, ETableSorter))
-#define E_TABLE_SORTER_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), E_TABLE_SORTER_TYPE, ETableSorterClass))
-#define E_IS_TABLE_SORTER(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), E_TABLE_SORTER_TYPE))
-#define E_IS_TABLE_SORTER_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), E_TABLE_SORTER_TYPE))
-
-typedef struct {
- ESorter base;
-
- ETableModel *source;
- ETableHeader *full_header;
- ETableSortInfo *sort_info;
-
- /* If needs_sorting is 0, then model_to_sorted and sorted_to_model are no-ops. */
- int needs_sorting;
-
- int *sorted;
- int *backsorted;
-
- int table_model_changed_id;
- int table_model_row_changed_id;
- int table_model_cell_changed_id;
- int table_model_rows_inserted_id;
- int table_model_rows_deleted_id;
- int sort_info_changed_id;
- int group_info_changed_id;
-} ETableSorter;
-
-typedef struct {
- ESorterClass parent_class;
-} ETableSorterClass;
-
-GType e_table_sorter_get_type (void);
-ETableSorter *e_table_sorter_new (ETableModel *etm,
- ETableHeader *full_header,
- ETableSortInfo *sort_info);
-G_END_DECLS
-
-#endif /* _E_TABLE_SORTER_H_ */
diff --git a/widgets/table/e-table-sorting-utils.c b/widgets/table/e-table-sorting-utils.c
deleted file mode 100644
index 80a9564a36..0000000000
--- a/widgets/table/e-table-sorting-utils.c
+++ /dev/null
@@ -1,349 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-table-sorting-utils.c
- * Copyright 2000, 2001, Ximian, Inc.
- *
- * Authors:
- * Chris Lahey <clahey@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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 <string.h>
-#include <e-table-sorting-utils.h>
-#include <gal/util/e-util.h>
-
-#define d(x)
-
-/* This takes source rows. */
-static int
-etsu_compare(ETableModel *source, ETableSortInfo *sort_info, ETableHeader *full_header, int row1, int row2)
-{
- int j;
- int sort_count = e_table_sort_info_sorting_get_count(sort_info);
- int comp_val = 0;
- int ascending = 1;
-
- for (j = 0; j < sort_count; j++) {
- ETableSortColumn column = e_table_sort_info_sorting_get_nth(sort_info, j);
- ETableCol *col;
- col = e_table_header_get_column_by_col_idx(full_header, column.column);
- if (col == NULL)
- col = e_table_header_get_column (full_header, e_table_header_count (full_header) - 1);
- comp_val = (*col->compare)(e_table_model_value_at (source, col->compare_col, row1),
- e_table_model_value_at (source, col->compare_col, row2));
- ascending = column.ascending;
- if (comp_val != 0)
- break;
- }
- if (comp_val == 0) {
- if (row1 < row2)
- comp_val = -1;
- if (row1 > row2)
- comp_val = 1;
- }
- if (!ascending)
- comp_val = -comp_val;
- return comp_val;
-}
-
-typedef struct {
- int cols;
- void **vals;
- int *ascending;
- GCompareFunc *compare;
-} ETableSortClosure;
-
-typedef struct {
- ETreeModel *tree;
- ETableSortInfo *sort_info;
- ETableHeader *full_header;
-} ETreeSortClosure;
-
-/* FIXME: Make it not cache the second and later columns (as if anyone cares.) */
-
-static int
-e_sort_callback(const void *data1, const void *data2, gpointer user_data)
-{
- gint row1 = *(int *)data1;
- gint row2 = *(int *)data2;
- ETableSortClosure *closure = user_data;
- int j;
- int sort_count = closure->cols;
- int comp_val = 0;
- int ascending = 1;
- for (j = 0; j < sort_count; j++) {
- comp_val = (*(closure->compare[j]))(closure->vals[closure->cols * row1 + j], closure->vals[closure->cols * row2 + j]);
- ascending = closure->ascending[j];
- if (comp_val != 0)
- break;
- }
- if (comp_val == 0) {
- if (row1 < row2)
- comp_val = -1;
- if (row1 > row2)
- comp_val = 1;
- }
- if (!ascending)
- comp_val = -comp_val;
- return comp_val;
-}
-
-void
-e_table_sorting_utils_sort(ETableModel *source, ETableSortInfo *sort_info, ETableHeader *full_header, int *map_table, int rows)
-{
- int total_rows;
- int i;
- int j;
- int cols;
- ETableSortClosure closure;
-
- g_return_if_fail(source != NULL);
- g_return_if_fail(E_IS_TABLE_MODEL(source));
- g_return_if_fail(sort_info != NULL);
- g_return_if_fail(E_IS_TABLE_SORT_INFO(sort_info));
- g_return_if_fail(full_header != NULL);
- g_return_if_fail(E_IS_TABLE_HEADER(full_header));
-
- total_rows = e_table_model_row_count(source);
- cols = e_table_sort_info_sorting_get_count(sort_info);
- closure.cols = cols;
-
- closure.vals = g_new(void *, total_rows * cols);
- closure.ascending = g_new(int, cols);
- closure.compare = g_new(GCompareFunc, cols);
-
- for (j = 0; j < cols; j++) {
- ETableSortColumn column = e_table_sort_info_sorting_get_nth(sort_info, j);
- ETableCol *col;
- col = e_table_header_get_column_by_col_idx(full_header, column.column);
- if (col == NULL)
- col = e_table_header_get_column (full_header, e_table_header_count (full_header) - 1);
- for (i = 0; i < rows; i++) {
- closure.vals[map_table[i] * cols + j] = e_table_model_value_at (source, col->compare_col, map_table[i]);
- }
- closure.compare[j] = col->compare;
- closure.ascending[j] = column.ascending;
- }
-
- e_sort(map_table, rows, sizeof(int), e_sort_callback, &closure);
-
- g_free(closure.vals);
- g_free(closure.ascending);
- g_free(closure.compare);
-}
-
-gboolean
-e_table_sorting_utils_affects_sort (ETableSortInfo *sort_info,
- ETableHeader *full_header,
- int col)
-{
- int j;
- int cols;
-
- g_return_val_if_fail(sort_info != NULL, TRUE);
- g_return_val_if_fail(E_IS_TABLE_SORT_INFO(sort_info), TRUE);
- g_return_val_if_fail(full_header != NULL, TRUE);
- g_return_val_if_fail(E_IS_TABLE_HEADER(full_header), TRUE);
-
- cols = e_table_sort_info_sorting_get_count(sort_info);
-
- for (j = 0; j < cols; j++) {
- ETableSortColumn column = e_table_sort_info_sorting_get_nth(sort_info, j);
- ETableCol *tablecol;
- tablecol = e_table_header_get_column_by_col_idx(full_header, column.column);
- if (tablecol == NULL)
- tablecol = e_table_header_get_column (full_header, e_table_header_count (full_header) - 1);
- if (col == tablecol->compare_col)
- return TRUE;
- }
- return FALSE;
-}
-
-
-/* FIXME: This could be done in time log n instead of time n with a binary search. */
-int
-e_table_sorting_utils_insert(ETableModel *source, ETableSortInfo *sort_info, ETableHeader *full_header, int *map_table, int rows, int row)
-{
- int i;
-
- i = 0;
- /* handle insertions when we have a 'sort group' */
- while (i < rows && etsu_compare(source, sort_info, full_header, map_table[i], row) < 0)
- i++;
-
- return i;
-}
-
-/* FIXME: This could be done in time log n instead of time n with a binary search. */
-int
-e_table_sorting_utils_check_position (ETableModel *source, ETableSortInfo *sort_info, ETableHeader *full_header, int *map_table, int rows, int view_row)
-{
- int i;
- int row;
-
- i = view_row;
- row = map_table[i];
-
- i = view_row;
- if (i < rows - 1 && etsu_compare(source, sort_info, full_header, map_table[i + 1], row) < 0) {
- i ++;
- while (i < rows - 1 && etsu_compare(source, sort_info, full_header, map_table[i], row) < 0)
- i ++;
- } else if (i > 0 && etsu_compare(source, sort_info, full_header, map_table[i - 1], row) > 0) {
- i --;
- while (i > 0 && etsu_compare(source, sort_info, full_header, map_table[i], row) > 0)
- i --;
- }
- return i;
-}
-
-
-
-
-/* This takes source rows. */
-static int
-etsu_tree_compare(ETreeModel *source, ETableSortInfo *sort_info, ETableHeader *full_header, ETreePath path1, ETreePath path2)
-{
- int j;
- int sort_count = e_table_sort_info_sorting_get_count(sort_info);
- int comp_val = 0;
- int ascending = 1;
-
- for (j = 0; j < sort_count; j++) {
- ETableSortColumn column = e_table_sort_info_sorting_get_nth(sort_info, j);
- ETableCol *col;
- col = e_table_header_get_column_by_col_idx(full_header, column.column);
- if (col == NULL)
- col = e_table_header_get_column (full_header, e_table_header_count (full_header) - 1);
- comp_val = (*col->compare)(e_tree_model_value_at (source, path1, col->compare_col),
- e_tree_model_value_at (source, path2, col->compare_col));
- ascending = column.ascending;
- if (comp_val != 0)
- break;
- }
- if (!ascending)
- comp_val = -comp_val;
- return comp_val;
-}
-
-static int
-e_sort_tree_callback(const void *data1, const void *data2, gpointer user_data)
-{
- ETreePath *path1 = *(ETreePath *)data1;
- ETreePath *path2 = *(ETreePath *)data2;
- ETreeSortClosure *closure = user_data;
-
- return etsu_tree_compare(closure->tree, closure->sort_info, closure->full_header, path1, path2);
-}
-
-void
-e_table_sorting_utils_tree_sort(ETreeModel *source, ETableSortInfo *sort_info, ETableHeader *full_header, ETreePath *map_table, int count)
-{
- ETableSortClosure closure;
- int cols;
- int i, j;
- int *map;
- ETreePath *map_copy;
- g_return_if_fail(source != NULL);
- g_return_if_fail(E_IS_TREE_MODEL(source));
- g_return_if_fail(sort_info != NULL);
- g_return_if_fail(E_IS_TABLE_SORT_INFO(sort_info));
- g_return_if_fail(full_header != NULL);
- g_return_if_fail(E_IS_TABLE_HEADER(full_header));
-
- cols = e_table_sort_info_sorting_get_count(sort_info);
- closure.cols = cols;
-
- closure.vals = g_new(void *, count * cols);
- closure.ascending = g_new(int, cols);
- closure.compare = g_new(GCompareFunc, cols);
-
- for (j = 0; j < cols; j++) {
- ETableSortColumn column = e_table_sort_info_sorting_get_nth(sort_info, j);
- ETableCol *col;
-
- col = e_table_header_get_column_by_col_idx(full_header, column.column);
- if (col == NULL)
- col = e_table_header_get_column (full_header, e_table_header_count (full_header) - 1);
-
- for (i = 0; i < count; i++) {
- closure.vals[i * cols + j] = e_tree_model_value_at (source, map_table[i], col->compare_col);
- }
- closure.ascending[j] = column.ascending;
- closure.compare[j] = col->compare;
- }
-
- map = g_new(int, count);
- for (i = 0; i < count; i++) {
- map[i] = i;
- }
-
- e_sort(map, count, sizeof(int), e_sort_callback, &closure);
-
- map_copy = g_new(ETreePath, count);
- for (i = 0; i < count; i++) {
- map_copy[i] = map_table[i];
- }
- for (i = 0; i < count; i++) {
- map_table[i] = map_copy[map[i]];
- }
-
- g_free(map);
- g_free(map_copy);
-
- g_free(closure.vals);
- g_free(closure.ascending);
- g_free(closure.compare);
-}
-
-/* FIXME: This could be done in time log n instead of time n with a binary search. */
-int
-e_table_sorting_utils_tree_check_position (ETreeModel *source, ETableSortInfo *sort_info, ETableHeader *full_header, ETreePath *map_table, int count, int old_index)
-{
- int i;
- ETreePath path;
-
- i = old_index;
- path = map_table[i];
-
- if (i < count - 1 && etsu_tree_compare(source, sort_info, full_header, map_table[i + 1], path) < 0) {
- i ++;
- while (i < count - 1 && etsu_tree_compare(source, sort_info, full_header, map_table[i], path) < 0)
- i ++;
- } else if (i > 0 && etsu_tree_compare(source, sort_info, full_header, map_table[i - 1], path) > 0) {
- i --;
- while (i > 0 && etsu_tree_compare(source, sort_info, full_header, map_table[i], path) > 0)
- i --;
- }
- return i;
-}
-
-/* FIXME: This does not pay attention to making sure that it's a stable insert. This needs to be fixed. */
-int
-e_table_sorting_utils_tree_insert(ETreeModel *source, ETableSortInfo *sort_info, ETableHeader *full_header, ETreePath *map_table, int count, ETreePath path)
-{
- size_t start;
- size_t end;
- ETreeSortClosure closure;
-
- closure.tree = source;
- closure.sort_info = sort_info;
- closure.full_header = full_header;
-
- e_bsearch(&path, map_table, count, sizeof(ETreePath), e_sort_tree_callback, &closure, &start, &end);
- return end;
-}
diff --git a/widgets/table/e-table-sorting-utils.h b/widgets/table/e-table-sorting-utils.h
deleted file mode 100644
index 794ead0ac9..0000000000
--- a/widgets/table/e-table-sorting-utils.h
+++ /dev/null
@@ -1,83 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-table-sorting-utils.h
- * Copyright 2000, 2001, Ximian, Inc.
- *
- * Authors:
- * Chris Lahey <clahey@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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.
- */
-
-#ifndef _E_TABLE_SORTING_UTILS_H_
-#define _E_TABLE_SORTING_UTILS_H_
-
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
-
-#include <gal/e-table/e-table-model.h>
-#include <gal/e-table/e-tree-model.h>
-#include <gal/e-table/e-table-sort-info.h>
-#include <gal/e-table/e-table-header.h>
-gboolean e_table_sorting_utils_affects_sort (ETableSortInfo *sort_info,
- ETableHeader *full_header,
- int col);
-
-
-
-void e_table_sorting_utils_sort (ETableModel *source,
- ETableSortInfo *sort_info,
- ETableHeader *full_header,
- int *map_table,
- int rows);
-int e_table_sorting_utils_insert (ETableModel *source,
- ETableSortInfo *sort_info,
- ETableHeader *full_header,
- int *map_table,
- int rows,
- int row);
-int e_table_sorting_utils_check_position (ETableModel *source,
- ETableSortInfo *sort_info,
- ETableHeader *full_header,
- int *map_table,
- int rows,
- int view_row);
-
-
-
-void e_table_sorting_utils_tree_sort (ETreeModel *source,
- ETableSortInfo *sort_info,
- ETableHeader *full_header,
- ETreePath *map_table,
- int count);
-int e_table_sorting_utils_tree_check_position (ETreeModel *source,
- ETableSortInfo *sort_info,
- ETableHeader *full_header,
- ETreePath *map_table,
- int count,
- int old_index);
-int e_table_sorting_utils_tree_insert (ETreeModel *source,
- ETableSortInfo *sort_info,
- ETableHeader *full_header,
- ETreePath *map_table,
- int count,
- ETreePath path);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* _E_TABLE_SORTING_UTILS_H_ */
diff --git a/widgets/table/e-table-specification.c b/widgets/table/e-table-specification.c
deleted file mode 100644
index 53306a1a52..0000000000
--- a/widgets/table/e-table-specification.c
+++ /dev/null
@@ -1,429 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-table-specification.c
- * Copyright 2000, 2001, Ximian, Inc.
- *
- * Authors:
- * Chris Lahey <clahey@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include "e-table-specification.h"
-
-#include <stdlib.h>
-#include <string.h>
-
-#include <libxml/parser.h>
-#include <libxml/xmlmemory.h>
-#include "gal/util/e-util.h"
-#include "gal/util/e-xml-utils.h"
-
-static GObjectClass *etsp_parent_class;
-
-static void
-etsp_finalize (GObject *object)
-{
- ETableSpecification *etsp = E_TABLE_SPECIFICATION (object);
- int i;
-
- if (etsp->columns) {
- for (i = 0; etsp->columns[i]; i++) {
- g_object_unref (etsp->columns[i]);
- }
- g_free (etsp->columns);
- etsp->columns = NULL;
- }
-
- if (etsp->state)
- g_object_unref (etsp->state);
- etsp->state = NULL;
-
- g_free (etsp->click_to_add_message);
- etsp->click_to_add_message = NULL;
-
- g_free (etsp->domain);
- etsp->domain = NULL;
-
- etsp_parent_class->finalize (object);
-}
-
-static void
-etsp_class_init (GObjectClass *klass)
-{
- etsp_parent_class = g_type_class_peek_parent (klass);
-
- klass->finalize = etsp_finalize;
-}
-
-static void
-etsp_init (ETableSpecification *etsp)
-{
- etsp->columns = NULL;
- etsp->state = NULL;
-
- etsp->alternating_row_colors = TRUE;
- etsp->no_headers = FALSE;
- etsp->click_to_add = FALSE;
- etsp->click_to_add_end = FALSE;
- etsp->horizontal_draw_grid = FALSE;
- etsp->vertical_draw_grid = FALSE;
- etsp->draw_focus = TRUE;
- etsp->horizontal_scrolling = FALSE;
- etsp->horizontal_resize = FALSE;
- etsp->allow_grouping = TRUE;
-
- etsp->cursor_mode = E_CURSOR_SIMPLE;
- etsp->selection_mode = GTK_SELECTION_MULTIPLE;
-
- etsp->click_to_add_message = NULL;
- etsp->domain = NULL;
-}
-
-E_MAKE_TYPE (e_table_specification, "ETableSpecification", ETableSpecification, etsp_class_init, etsp_init, G_TYPE_OBJECT)
-
-/**
- * e_table_specification_new:
- *
- * Creates a new %ETableSpecification object. This object is used to hold the
- * information about the rendering information for ETable.
- *
- * Returns: a newly created %ETableSpecification object.
- */
-ETableSpecification *
-e_table_specification_new (void)
-{
- ETableSpecification *etsp = g_object_new (E_TABLE_SPECIFICATION_TYPE, NULL);
-
- return (ETableSpecification *) etsp;
-}
-
-/**
- * e_table_specification_load_from_file:
- * @specification: An ETableSpecification that you want to modify
- * @filename: a filename that contains an ETableSpecification
- *
- * This routine modifies @specification to reflect the state described
- * by the file @filename.
- *
- * Returns: TRUE on success, FALSE on failure.
- */
-gboolean
-e_table_specification_load_from_file (ETableSpecification *specification,
- const char *filename)
-{
- xmlDoc *doc;
- doc = xmlParseFile (filename);
- if (doc) {
- xmlNode *node = xmlDocGetRootElement (doc);
- e_table_specification_load_from_node (specification, node);
- xmlFreeDoc (doc);
- return TRUE;
- }
- return FALSE;
-}
-
-/**
- * e_table_specification_load_from_string:
- * @specification: An ETableSpecification that you want to modify
- * @xml: a stringified representation of an ETableSpecification description.
- *
- * This routine modifies @specification to reflect the state described
- * by @xml. @xml is typically returned by e_table_specification_save_to_string
- * or it can be embedded in your source code.
- *
- * Returns: TRUE on success, FALSE on failure.
- */
-gboolean
-e_table_specification_load_from_string (ETableSpecification *specification,
- const char *xml)
-{
- xmlDoc *doc;
- doc = xmlParseMemory ( (char *) xml, strlen (xml));
- if (doc) {
- xmlNode *node = xmlDocGetRootElement (doc);
- e_table_specification_load_from_node (specification, node);
- xmlFreeDoc (doc);
- return TRUE;
- }
-
- return FALSE;
-}
-
-/**
- * e_table_specification_load_from_node:
- * @specification: An ETableSpecification that you want to modify
- * @node: an xmlNode with an XML ETableSpecification description.
- *
- * This routine modifies @specification to reflect the state described
- * by @node.
- */
-void
-e_table_specification_load_from_node (ETableSpecification *specification,
- const xmlNode *node)
-{
- char *temp;
- xmlNode *children;
- GList *list = NULL, *list2;
- int i;
-
- specification->no_headers = e_xml_get_bool_prop_by_name (node, "no-headers");
- specification->click_to_add = e_xml_get_bool_prop_by_name (node, "click-to-add");
- specification->click_to_add_end = e_xml_get_bool_prop_by_name (node, "click-to-add-end") && specification->click_to_add;
- specification->alternating_row_colors = e_xml_get_bool_prop_by_name_with_default (node, "alternating-row-colors", TRUE);
- specification->horizontal_draw_grid = e_xml_get_bool_prop_by_name (node, "horizontal-draw-grid");
- specification->vertical_draw_grid = e_xml_get_bool_prop_by_name (node, "vertical-draw-grid");
- if (e_xml_get_bool_prop_by_name_with_default(node, "draw-grid", TRUE) ==
- e_xml_get_bool_prop_by_name_with_default(node, "draw-grid", FALSE)) {
- specification->horizontal_draw_grid =
- specification->vertical_draw_grid = e_xml_get_bool_prop_by_name (node, "draw-grid");
- }
- specification->draw_focus = e_xml_get_bool_prop_by_name_with_default (node, "draw-focus", TRUE);
- specification->horizontal_scrolling = e_xml_get_bool_prop_by_name_with_default (node, "horizontal-scrolling", FALSE);
- specification->horizontal_resize = e_xml_get_bool_prop_by_name_with_default (node, "horizontal-resize", FALSE);
- specification->allow_grouping = e_xml_get_bool_prop_by_name_with_default (node, "allow-grouping", TRUE);
-
- specification->selection_mode = GTK_SELECTION_MULTIPLE;
- temp = e_xml_get_string_prop_by_name (node, "selection-mode");
- if (temp && !g_strcasecmp (temp, "single")) {
- specification->selection_mode = GTK_SELECTION_SINGLE;
- } else if (temp && !g_strcasecmp (temp, "browse")) {
- specification->selection_mode = GTK_SELECTION_BROWSE;
- } else if (temp && !g_strcasecmp (temp, "extended")) {
- specification->selection_mode = GTK_SELECTION_EXTENDED;
- }
- g_free (temp);
-
- specification->cursor_mode = E_CURSOR_SIMPLE;
- temp = e_xml_get_string_prop_by_name (node, "cursor-mode");
- if (temp && !g_strcasecmp (temp, "line")) {
- specification->cursor_mode = E_CURSOR_LINE;
- } else if (temp && !g_strcasecmp (temp, "spreadsheet")) {
- specification->cursor_mode = E_CURSOR_SPREADSHEET;
- }
- g_free (temp);
-
- g_free (specification->click_to_add_message);
- specification->click_to_add_message =
- e_xml_get_string_prop_by_name (
- node, "_click-to-add-message");
-
- g_free (specification->domain);
- specification->domain =
- e_xml_get_string_prop_by_name (
- node, "gettext-domain");
- if (specification->domain && !*specification->domain) {
- g_free (specification->domain);
- specification->domain = NULL;
- }
-
- if (specification->state)
- g_object_unref (specification->state);
- specification->state = NULL;
- if (specification->columns) {
- for (i = 0; specification->columns[i]; i++) {
- g_object_unref (specification->columns[i]);
- }
- g_free (specification->columns);
- }
- specification->columns = NULL;
-
- for (children = node->xmlChildrenNode; children; children = children->next) {
- if (!strcmp (children->name, "ETableColumn")) {
- ETableColumnSpecification *col_spec = e_table_column_specification_new ();
-
- g_object_ref (col_spec);
- e_table_column_specification_load_from_node (col_spec, children);
- list = g_list_append (list, col_spec);
- } else if (specification->state == NULL && !strcmp (children->name, "ETableState")) {
- specification->state = e_table_state_new ();
- e_table_state_load_from_node (specification->state, children);
- e_table_sort_info_set_can_group (specification->state->sort_info, specification->allow_grouping);
- }
- }
-
- if (specification->state == NULL) {
- /* Make the default state. */
- specification->state = e_table_state_vanilla (g_list_length (list));
- }
-
- specification->columns = g_new (ETableColumnSpecification *, g_list_length (list) + 1);
- for (list2 = list, i = 0; list2; list2 = g_list_next (list2), i++) {
- specification->columns[i] = list2->data;
- }
- specification->columns[i] = NULL;
- g_list_free (list);
-}
-
-/**
- * e_table_specification_save_to_file:
- * @specification: An %ETableSpecification that you want to save
- * @filename: a file name to store the specification.
- *
- * This routine stores the @specification into @filename.
- *
- * Returns: 0 on success or -1 on error.
- */
-int
-e_table_specification_save_to_file (ETableSpecification *specification,
- const char *filename)
-{
- xmlDoc *doc;
- int ret;
-
- g_return_val_if_fail (specification != NULL, -1);
- g_return_val_if_fail (filename != NULL, -1);
- g_return_val_if_fail (E_IS_TABLE_SPECIFICATION (specification), -1);
-
- if ((doc = xmlNewDoc ("1.0")) == NULL)
- return -1;
-
- xmlDocSetRootElement (doc, e_table_specification_save_to_node (specification, doc));
-
- ret = e_xml_save_file (filename, doc);
-
- xmlFreeDoc (doc);
-
- return ret;
-}
-
-/**
- * e_table_specification_save_to_string:
- * @specification: An %ETableSpecification that you want to stringify
- *
- * Saves the state of @specification to a string.
- *
- * Returns: an g_alloc() allocated string containing the stringified
- * representation of @specification. This stringified representation
- * uses XML as a convenience.
- */
-char *
-e_table_specification_save_to_string (ETableSpecification *specification)
-{
- char *ret_val;
- xmlChar *string;
- int length;
- xmlDoc *doc;
-
- g_return_val_if_fail (specification != NULL, NULL);
- g_return_val_if_fail (E_IS_TABLE_SPECIFICATION (specification), NULL);
-
- doc = xmlNewDoc ("1.0");
- xmlDocSetRootElement (doc, e_table_specification_save_to_node (specification, doc));
- xmlDocDumpMemory (doc, &string, &length);
-
- ret_val = g_strdup (string);
- xmlFree (string);
- return ret_val;
-}
-
-/**
- * e_table_specification_save_to_node:
- * @specification: An ETableSpecification that you want to store.
- * @doc: Node where the specification is saved
- *
- * This routine saves the %ETableSpecification state in the object @specification
- * into the xmlDoc represented by @doc.
- *
- * Returns: The node that has been attached to @doc with the contents
- * of the ETableSpecification.
- */
-xmlNode *
-e_table_specification_save_to_node (ETableSpecification *specification,
- xmlDoc *doc)
-{
- xmlNode *node;
- char *s;
-
- g_return_val_if_fail (doc != NULL, NULL);
- g_return_val_if_fail (specification != NULL, NULL);
- g_return_val_if_fail (E_IS_TABLE_SPECIFICATION (specification), NULL);
-
- node = xmlNewNode (NULL, "ETableSpecification");
- e_xml_set_bool_prop_by_name (node, "no-headers", specification->no_headers);
- e_xml_set_bool_prop_by_name (node, "click-to-add", specification->click_to_add);
- e_xml_set_bool_prop_by_name (node, "click-to-add-end", specification->click_to_add_end && specification->click_to_add);
- e_xml_set_bool_prop_by_name (node, "alternating-row-colors", specification->alternating_row_colors);
- e_xml_set_bool_prop_by_name (node, "horizontal-draw-grid", specification->horizontal_draw_grid);
- e_xml_set_bool_prop_by_name (node, "vertical-draw-grid", specification->vertical_draw_grid);
- e_xml_set_bool_prop_by_name (node, "draw-focus", specification->draw_focus);
- e_xml_set_bool_prop_by_name (node, "horizontal-scrolling", specification->horizontal_scrolling);
- e_xml_set_bool_prop_by_name (node, "horizontal-resize", specification->horizontal_resize);
- e_xml_set_bool_prop_by_name (node, "allow-grouping", specification->allow_grouping);
-
- switch (specification->selection_mode){
- case GTK_SELECTION_SINGLE:
- s = "single";
- break;
- case GTK_SELECTION_BROWSE:
- s = "browse";
- break;
- default:
- case GTK_SELECTION_EXTENDED:
- s = "extended";
- }
- xmlSetProp (node, "selection-mode", s);
- if (specification->cursor_mode == E_CURSOR_LINE)
- s = "line";
- else
- s = "cell";
- xmlSetProp (node, "cursor-mode", s);
-
- xmlSetProp (node, "_click-to-add-message", specification->click_to_add_message);
- xmlSetProp (node, "gettext-domain", specification->domain);
-
- if (specification->columns){
- int i;
-
- for (i = 0; specification->columns [i]; i++)
- e_table_column_specification_save_to_node (
- specification->columns [i],
- node);
- }
-
- if (specification->state)
- e_table_state_save_to_node (specification->state, node);
-
- return node;
-}
-
-/**
- * e_table_specification_duplicate:
- * @spec: specification to duplicate
- *
- * This creates a copy of the %ETableSpecification @spec
- *
- * Returns: The duplicated %ETableSpecification.
- */
-ETableSpecification *
-e_table_specification_duplicate (ETableSpecification *spec)
-{
- ETableSpecification *new_spec;
- char *spec_str;
-
- g_return_val_if_fail (spec != NULL, NULL);
- g_return_val_if_fail (E_IS_TABLE_SPECIFICATION (spec), NULL);
-
- new_spec = e_table_specification_new ();
- spec_str = e_table_specification_save_to_string (spec);
- e_table_specification_load_from_string (new_spec, spec_str);
- g_free (spec_str);
-
- return new_spec;
-}
diff --git a/widgets/table/e-table-specification.h b/widgets/table/e-table-specification.h
deleted file mode 100644
index 961752b9b8..0000000000
--- a/widgets/table/e-table-specification.h
+++ /dev/null
@@ -1,89 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-table-specification.h
- * Copyright 2000, 2001, Ximian, Inc.
- *
- * Authors:
- * Chris Lahey <clahey@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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.
- */
-
-#ifndef _E_TABLE_SPECIFICATION_H_
-#define _E_TABLE_SPECIFICATION_H_
-
-#include <glib-object.h>
-#include <libxml/tree.h>
-#include <gal/widgets/e-selection-model.h>
-#include <gal/e-table/e-table-state.h>
-#include <gal/e-table/e-table-column-specification.h>
-#include <gal/e-table/e-table-defines.h>
-
-G_BEGIN_DECLS
-
-#define E_TABLE_SPECIFICATION_TYPE (e_table_specification_get_type ())
-#define E_TABLE_SPECIFICATION(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), E_TABLE_SPECIFICATION_TYPE, ETableSpecification))
-#define E_TABLE_SPECIFICATION_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), E_TABLE_SPECIFICATION_TYPE, ETableSpecificationClass))
-#define E_IS_TABLE_SPECIFICATION(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), E_TABLE_SPECIFICATION_TYPE))
-#define E_IS_TABLE_SPECIFICATION_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), E_TABLE_SPECIFICATION_TYPE))
-#define E_TABLE_SPECIFICATION_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS((o), E_TABLE_SPECIFICATION_TYPE, ETableSpecificationClass))
-
-typedef struct {
- GObject base;
-
- ETableColumnSpecification **columns;
- ETableState *state;
-
- guint alternating_row_colors : 1;
- guint no_headers : 1;
- guint click_to_add : 1;
- guint click_to_add_end : 1;
- guint horizontal_draw_grid : 1;
- guint vertical_draw_grid : 1;
- guint draw_focus : 1;
- guint horizontal_scrolling : 1;
- guint horizontal_resize : 1;
- guint allow_grouping : 1;
- GtkSelectionMode selection_mode;
- ECursorMode cursor_mode;
-
- char *click_to_add_message;
- char *domain;
-} ETableSpecification;
-
-typedef struct {
- GObjectClass parent_class;
-} ETableSpecificationClass;
-
-GType e_table_specification_get_type (void);
-ETableSpecification *e_table_specification_new (void);
-
-gboolean e_table_specification_load_from_file (ETableSpecification *specification,
- const char *filename);
-gboolean e_table_specification_load_from_string (ETableSpecification *specification,
- const char *xml);
-void e_table_specification_load_from_node (ETableSpecification *specification,
- const xmlNode *node);
-
-int e_table_specification_save_to_file (ETableSpecification *specification,
- const char *filename);
-char *e_table_specification_save_to_string (ETableSpecification *specification);
-xmlNode *e_table_specification_save_to_node (ETableSpecification *specification,
- xmlDoc *doc);
-ETableSpecification *e_table_specification_duplicate (ETableSpecification *spec);
-
-G_END_DECLS
-
-#endif /* _E_TABLE_SPECIFICATION_H_ */
diff --git a/widgets/table/e-table-state.c b/widgets/table/e-table-state.c
deleted file mode 100644
index 4ce1bf6d3a..0000000000
--- a/widgets/table/e-table-state.c
+++ /dev/null
@@ -1,295 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-table-state.c
- * Copyright 2000, 2001, Ximian, Inc.
- *
- * Authors:
- * Chris Lahey <clahey@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <stdlib.h>
-#include <string.h>
-
-#include <libxml/parser.h>
-#include <libxml/xmlmemory.h>
-#include "gal/util/e-util.h"
-#include "gal/util/e-xml-utils.h"
-#include "e-table-state.h"
-
-
-#define STATE_VERSION 0.1
-
-static GObjectClass *etst_parent_class;
-
-static void
-etst_dispose (GObject *object)
-{
- ETableState *etst = E_TABLE_STATE (object);
-
- if (etst->sort_info) {
- g_object_unref (etst->sort_info);
- etst->sort_info = NULL;
- }
-
- G_OBJECT_CLASS (etst_parent_class)->dispose (object);
-}
-
-static void
-etst_finalize (GObject *object)
-{
- ETableState *etst = E_TABLE_STATE (object);
-
- if (etst->columns) {
- g_free (etst->columns);
- etst->columns = NULL;
- }
-
- if (etst->expansions) {
- g_free (etst->expansions);
- etst->expansions = NULL;
- }
-
- G_OBJECT_CLASS (etst_parent_class)->finalize (object);
-}
-
-static void
-etst_class_init (GObjectClass *klass)
-{
- etst_parent_class = g_type_class_peek_parent (klass);
-
- klass->dispose = etst_dispose;
- klass->finalize = etst_finalize;
-}
-
-static void
-etst_init (ETableState *state)
-{
- state->columns = NULL;
- state->expansions = NULL;
- state->sort_info = e_table_sort_info_new();
-}
-
-E_MAKE_TYPE(e_table_state, "ETableState", ETableState, etst_class_init, etst_init, G_TYPE_OBJECT)
-
-ETableState *
-e_table_state_new (void)
-{
- return (ETableState *) g_object_new (E_TABLE_STATE_TYPE, NULL);
-}
-
-ETableState *
-e_table_state_vanilla (int col_count)
-{
- GString *str;
- int i;
- ETableState *res;
-
- str = g_string_new ("<ETableState>\n");
- for (i = 0; i < col_count; i++)
- g_string_append_printf (str, " <column source=\"%d\"/>\n", i);
- g_string_append (str, " <grouping></grouping>\n");
- g_string_append (str, "</ETableState>\n");
-
- res = e_table_state_new ();
- e_table_state_load_from_string (res, str->str);
-
- g_string_free (str, TRUE);
- return res;
-}
-
-gboolean
-e_table_state_load_from_file (ETableState *state,
- const char *filename)
-{
- xmlDoc *doc;
- doc = xmlParseFile (filename);
- if (doc) {
- xmlNode *node = xmlDocGetRootElement(doc);
- e_table_state_load_from_node(state, node);
- xmlFreeDoc(doc);
- return TRUE;
- }
- return FALSE;
-}
-
-void
-e_table_state_load_from_string (ETableState *state,
- const char *xml)
-{
- xmlDoc *doc;
- doc = xmlParseMemory ((char *) xml, strlen(xml));
- if (doc) {
- xmlNode *node = xmlDocGetRootElement(doc);
- e_table_state_load_from_node(state, node);
- xmlFreeDoc(doc);
- }
-}
-
-typedef struct {
- int column;
- double expansion;
-} int_and_double;
-
-void
-e_table_state_load_from_node (ETableState *state,
- const xmlNode *node)
-{
- xmlNode *children;
- GList *list = NULL, *iterator;
- gdouble state_version;
- int i;
-
- state_version = e_xml_get_double_prop_by_name_with_default (
- node, "state-version", STATE_VERSION);
-
- if (state->sort_info)
- g_object_unref (state->sort_info);
-
- state->sort_info = NULL;
- children = node->xmlChildrenNode;
- for (; children; children = children->next) {
- if (!strcmp (children->name, "column")) {
- int_and_double *column_info = g_new(int_and_double, 1);
-
- column_info->column = e_xml_get_integer_prop_by_name(
- children, "source");
- column_info->expansion =
- e_xml_get_double_prop_by_name_with_default(
- children, "expansion", 1);
-
- list = g_list_append (list, column_info);
- } else if (state->sort_info == NULL &&
- !strcmp (children->name, "grouping")) {
- state->sort_info = e_table_sort_info_new();
- e_table_sort_info_load_from_node(
- state->sort_info, children, state_version);
- }
- }
- g_free(state->columns);
- g_free(state->expansions);
- state->col_count = g_list_length(list);
- state->columns = g_new(int, state->col_count);
- state->expansions = g_new(double, state->col_count);
-
- for (iterator = list, i = 0; iterator; i++) {
- int_and_double *column_info = iterator->data;
-
- state->columns [i] = column_info->column;
- state->expansions [i] = column_info->expansion;
- g_free (column_info);
- iterator = g_list_next (iterator);
- }
- g_list_free(list);
-}
-
-void
-e_table_state_save_to_file (ETableState *state,
- const char *filename)
-{
- xmlDoc *doc;
-
- if ((doc = xmlNewDoc ("1.0")) == NULL)
- return;
-
- xmlDocSetRootElement (doc, e_table_state_save_to_node (state, NULL));
-
- e_xml_save_file (filename, doc);
-
- xmlFreeDoc (doc);
-}
-
-char *
-e_table_state_save_to_string (ETableState *state)
-{
- char *ret_val;
- xmlChar *string;
- int length;
- xmlDoc *doc;
-
- doc = xmlNewDoc("1.0");
- xmlDocSetRootElement(doc, e_table_state_save_to_node(state, NULL));
- xmlDocDumpMemory(doc, &string, &length);
- xmlFreeDoc(doc);
-
- ret_val = g_strdup(string);
- xmlFree(string);
- return ret_val;
-}
-
-xmlNode *
-e_table_state_save_to_node (ETableState *state,
- xmlNode *parent)
-{
- int i;
- xmlNode *node;
-
- if (parent)
- node = xmlNewChild (parent, NULL, "ETableState", NULL);
- else
- node = xmlNewNode (NULL, "ETableState");
-
- e_xml_set_double_prop_by_name(node, "state-version", STATE_VERSION);
-
- for (i = 0; i < state->col_count; i++) {
- int column = state->columns[i];
- double expansion = state->expansions[i];
- xmlNode *new_node;
-
- new_node = xmlNewChild(node, NULL, "column", NULL);
- e_xml_set_integer_prop_by_name (new_node, "source", column);
- if (expansion >= -1)
- e_xml_set_double_prop_by_name(new_node, "expansion", expansion);
- }
-
-
- e_table_sort_info_save_to_node(state->sort_info, node);
-
- return node;
-}
-
-/**
- * e_table_state_duplicate:
- * @state: The ETableState to duplicate
- *
- * This creates a copy of the %ETableState @state
- *
- * Returns: The duplicated %ETableState.
- */
-ETableState *
-e_table_state_duplicate (ETableState *state)
-{
- ETableState *new_state;
- char *copy;
-
- g_return_val_if_fail (state != NULL, NULL);
- g_return_val_if_fail (E_IS_TABLE_STATE (state), NULL);
-
- new_state = e_table_state_new ();
- copy = e_table_state_save_to_string (state);
- e_table_state_load_from_string (new_state, copy);
- g_free (copy);
-
- e_table_sort_info_set_can_group
- (new_state->sort_info,
- e_table_sort_info_get_can_group (state->sort_info));
-
- return new_state;
-}
diff --git a/widgets/table/e-table-state.h b/widgets/table/e-table-state.h
deleted file mode 100644
index 47e0c7b9b8..0000000000
--- a/widgets/table/e-table-state.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-table-state.h
- * Copyright 2000, 2001, Ximian, Inc.
- *
- * Authors:
- * Chris Lahey <clahey@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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.
- */
-
-#ifndef _E_TABLE_STATE_H_
-#define _E_TABLE_STATE_H_
-
-#include <glib-object.h>
-#include <libxml/tree.h>
-#include <gal/e-table/e-table-sort-info.h>
-
-G_BEGIN_DECLS
-
-#define E_TABLE_STATE_TYPE (e_table_state_get_type ())
-#define E_TABLE_STATE(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), E_TABLE_STATE_TYPE, ETableState))
-#define E_TABLE_STATE_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), E_TABLE_STATE_TYPE, ETableStateClass))
-#define E_IS_TABLE_STATE(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), E_TABLE_STATE_TYPE))
-#define E_IS_TABLE_STATE_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), E_TABLE_STATE_TYPE))
-#define E_TABLE_STATE_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS((o), E_TABLE_STATE_TYPE, ETableStateClass))
-
-typedef struct {
- GObject base;
-
- ETableSortInfo *sort_info;
- int col_count;
- int *columns;
- double *expansions;
-} ETableState;
-
-typedef struct {
- GObjectClass parent_class;
-} ETableStateClass;
-
-GType e_table_state_get_type (void);
-ETableState *e_table_state_new (void);
-
-ETableState *e_table_state_vanilla (int col_count);
-
-gboolean e_table_state_load_from_file (ETableState *state,
- const char *filename);
-void e_table_state_load_from_string (ETableState *state,
- const char *xml);
-void e_table_state_load_from_node (ETableState *state,
- const xmlNode *node);
-
-void e_table_state_save_to_file (ETableState *state,
- const char *filename);
-char *e_table_state_save_to_string (ETableState *state);
-xmlNode *e_table_state_save_to_node (ETableState *state,
- xmlNode *parent);
-ETableState *e_table_state_duplicate (ETableState *state);
-
-G_END_DECLS
-
-#endif /* _E_TABLE_STATE_H_ */
diff --git a/widgets/table/e-table-subset-variable.c b/widgets/table/e-table-subset-variable.c
deleted file mode 100644
index efe6529806..0000000000
--- a/widgets/table/e-table-subset-variable.c
+++ /dev/null
@@ -1,250 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-table-subset-variable.c
- * Copyright 2000, 2001, Ximian, Inc.
- *
- * Authors:
- * Chris Lahey <clahey@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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 <stdlib.h>
-#include <string.h>
-#include "gal/util/e-util.h"
-#include "e-table-subset-variable.h"
-
-#define ETSSV_CLASS(e) (E_TABLE_SUBSET_VARIABLE_GET_CLASS (e))
-
-#define INCREMENT_AMOUNT 10
-
-static void
-etssv_add (ETableSubsetVariable *etssv,
- gint row)
-{
- ETableModel *etm = E_TABLE_MODEL(etssv);
- ETableSubset *etss = E_TABLE_SUBSET(etssv);
-
- e_table_model_pre_change(etm);
-
- if (etss->n_map + 1 > etssv->n_vals_allocated){
- etssv->n_vals_allocated += INCREMENT_AMOUNT;
- etss->map_table = g_realloc (etss->map_table, etssv->n_vals_allocated * sizeof(int));
- }
-
- etss->map_table[etss->n_map++] = row;
-
- e_table_model_row_inserted (etm, etss->n_map - 1);
-}
-
-static void
-etssv_add_array (ETableSubsetVariable *etssv,
- const gint *array,
- gint count)
-{
- ETableModel *etm = E_TABLE_MODEL(etssv);
- ETableSubset *etss = E_TABLE_SUBSET(etssv);
- int i;
-
- e_table_model_pre_change(etm);
-
- if (etss->n_map + count > etssv->n_vals_allocated){
- etssv->n_vals_allocated += MAX(INCREMENT_AMOUNT, count);
- etss->map_table = g_realloc (etss->map_table, etssv->n_vals_allocated * sizeof(int));
- }
- for (i = 0; i < count; i++)
- etss->map_table[etss->n_map++] = array[i];
-
- e_table_model_changed (etm);
-}
-
-static void
-etssv_add_all (ETableSubsetVariable *etssv)
-{
- ETableModel *etm = E_TABLE_MODEL(etssv);
- ETableSubset *etss = E_TABLE_SUBSET(etssv);
- int rows;
- int i;
-
- e_table_model_pre_change(etm);
-
- rows = e_table_model_row_count(etss->source);
- if (etss->n_map + rows > etssv->n_vals_allocated){
- etssv->n_vals_allocated += MAX(INCREMENT_AMOUNT, rows);
- etss->map_table = g_realloc (etss->map_table, etssv->n_vals_allocated * sizeof(int));
- }
- for (i = 0; i < rows; i++)
- etss->map_table[etss->n_map++] = i;
-
- e_table_model_changed (etm);
-}
-
-static gboolean
-etssv_remove (ETableSubsetVariable *etssv,
- gint row)
-{
- ETableModel *etm = E_TABLE_MODEL(etssv);
- ETableSubset *etss = E_TABLE_SUBSET(etssv);
- int i;
-
- for (i = 0; i < etss->n_map; i++){
- if (etss->map_table[i] == row) {
- e_table_model_pre_change (etm);
- memmove (etss->map_table + i, etss->map_table + i + 1, (etss->n_map - i - 1) * sizeof(int));
- etss->n_map --;
-
- e_table_model_row_deleted (etm, i);
- return TRUE;
- }
- }
- return FALSE;
-}
-
-static void
-etssv_class_init (GObjectClass *object_class)
-{
- ETableSubsetVariableClass *klass = E_TABLE_SUBSET_VARIABLE_CLASS(object_class);
-
- klass->add = etssv_add;
- klass->add_array = etssv_add_array;
- klass->add_all = etssv_add_all;
- klass->remove = etssv_remove;
-}
-
-E_MAKE_TYPE(e_table_subset_variable, "ETableSubsetVariable", ETableSubsetVariable, etssv_class_init, NULL, E_TABLE_SUBSET_TYPE)
-
-ETableModel *
-e_table_subset_variable_construct (ETableSubsetVariable *etssv,
- ETableModel *source)
-{
- if (e_table_subset_construct (E_TABLE_SUBSET(etssv), source, 1) == NULL)
- return NULL;
- E_TABLE_SUBSET(etssv)->n_map = 0;
-
- return E_TABLE_MODEL (etssv);
-}
-
-ETableModel *
-e_table_subset_variable_new (ETableModel *source)
-{
- ETableSubsetVariable *etssv = g_object_new (E_TABLE_SUBSET_VARIABLE_TYPE, NULL);
-
- if (e_table_subset_variable_construct (etssv, source) == NULL){
- g_object_unref (etssv);
- return NULL;
- }
-
- return (ETableModel *) etssv;
-}
-
-void
-e_table_subset_variable_add (ETableSubsetVariable *etssv,
- gint row)
-{
- g_return_if_fail (etssv != NULL);
- g_return_if_fail (E_IS_TABLE_SUBSET_VARIABLE(etssv));
-
- if (ETSSV_CLASS(etssv)->add)
- ETSSV_CLASS (etssv)->add (etssv, row);
-}
-
-void
-e_table_subset_variable_add_array (ETableSubsetVariable *etssv,
- const gint *array,
- gint count)
-{
- g_return_if_fail (etssv != NULL);
- g_return_if_fail (E_IS_TABLE_SUBSET_VARIABLE(etssv));
-
- if (ETSSV_CLASS(etssv)->add_array)
- ETSSV_CLASS (etssv)->add_array (etssv, array, count);
-}
-
-void
-e_table_subset_variable_add_all (ETableSubsetVariable *etssv)
-{
- g_return_if_fail (etssv != NULL);
- g_return_if_fail (E_IS_TABLE_SUBSET_VARIABLE(etssv));
-
- if (ETSSV_CLASS(etssv)->add_all)
- ETSSV_CLASS (etssv)->add_all (etssv);
-}
-
-gboolean
-e_table_subset_variable_remove (ETableSubsetVariable *etssv,
- gint row)
-{
- g_return_val_if_fail (etssv != NULL, FALSE);
- g_return_val_if_fail (E_IS_TABLE_SUBSET_VARIABLE(etssv), FALSE);
-
- if (ETSSV_CLASS(etssv)->remove)
- return ETSSV_CLASS (etssv)->remove (etssv, row);
- else
- return FALSE;
-}
-
-void
-e_table_subset_variable_clear (ETableSubsetVariable *etssv)
-{
- ETableModel *etm = E_TABLE_MODEL(etssv);
- ETableSubset *etss = E_TABLE_SUBSET(etssv);
-
- e_table_model_pre_change (etm);
- etss->n_map = 0;
- g_free (etss->map_table);
- etss->map_table = g_new (unsigned int, 1);
- etssv->n_vals_allocated = 1;
-
- e_table_model_changed (etm);
-}
-
-void
-e_table_subset_variable_increment (ETableSubsetVariable *etssv,
- gint position,
- gint amount)
-{
- int i;
- ETableSubset *etss = E_TABLE_SUBSET(etssv);
- for (i = 0; i < etss->n_map; i++) {
- if (etss->map_table[i] >= position)
- etss->map_table[i] += amount;
- }
-}
-
-void
-e_table_subset_variable_decrement (ETableSubsetVariable *etssv,
- gint position,
- gint amount)
-{
- int i;
- ETableSubset *etss = E_TABLE_SUBSET(etssv);
- for (i = 0; i < etss->n_map; i++) {
- if (etss->map_table[i] >= position)
- etss->map_table[i] -= amount;
- }
-}
-
-void
-e_table_subset_variable_set_allocation (ETableSubsetVariable *etssv,
- gint total)
-{
- ETableSubset *etss = E_TABLE_SUBSET(etssv);
- if (total <= 0)
- total = 1;
- if (total > etss->n_map){
- etss->map_table = g_realloc (etss->map_table, total * sizeof(int));
- }
-}
diff --git a/widgets/table/e-table-subset-variable.h b/widgets/table/e-table-subset-variable.h
deleted file mode 100644
index 2dc0914f9b..0000000000
--- a/widgets/table/e-table-subset-variable.h
+++ /dev/null
@@ -1,82 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-table-subset-variable.h
- * Copyright 2000, 2001, Ximian, Inc.
- *
- * Authors:
- * Chris Lahey <clahey@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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.
- */
-
-#ifndef _E_TABLE_SUBSET_VARIABLE_H_
-#define _E_TABLE_SUBSET_VARIABLE_H_
-
-#include <glib-object.h>
-#include <gal/e-table/e-table-subset.h>
-
-G_BEGIN_DECLS
-
-#define E_TABLE_SUBSET_VARIABLE_TYPE (e_table_subset_variable_get_type ())
-#define E_TABLE_SUBSET_VARIABLE(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), E_TABLE_SUBSET_VARIABLE_TYPE, ETableSubsetVariable))
-#define E_TABLE_SUBSET_VARIABLE_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), E_TABLE_SUBSET_VARIABLE_TYPE, ETableSubsetVariableClass))
-#define E_IS_TABLE_SUBSET_VARIABLE(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), E_TABLE_SUBSET_VARIABLE_TYPE))
-#define E_IS_TABLE_SUBSET_VARIABLE_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), E_TABLE_SUBSET_VARIABLE_TYPE))
-#define E_TABLE_SUBSET_VARIABLE_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS((o), E_TABLE_SUBSET_VARIABLE_TYPE, ETableSubsetVariableClass))
-
-typedef struct {
- ETableSubset base;
-
- int n_vals_allocated;
-} ETableSubsetVariable;
-
-typedef struct {
- ETableSubsetClass parent_class;
-
- void (*add) (ETableSubsetVariable *ets,
- gint row);
- void (*add_array) (ETableSubsetVariable *ets,
- const gint *array,
- gint count);
- void (*add_all) (ETableSubsetVariable *ets);
- gboolean (*remove) (ETableSubsetVariable *ets,
- gint row);
-} ETableSubsetVariableClass;
-
-GType e_table_subset_variable_get_type (void);
-ETableModel *e_table_subset_variable_new (ETableModel *etm);
-ETableModel *e_table_subset_variable_construct (ETableSubsetVariable *etssv,
- ETableModel *source);
-void e_table_subset_variable_add (ETableSubsetVariable *ets,
- gint row);
-void e_table_subset_variable_add_array (ETableSubsetVariable *ets,
- const gint *array,
- gint count);
-void e_table_subset_variable_add_all (ETableSubsetVariable *ets);
-gboolean e_table_subset_variable_remove (ETableSubsetVariable *ets,
- gint row);
-void e_table_subset_variable_clear (ETableSubsetVariable *ets);
-void e_table_subset_variable_increment (ETableSubsetVariable *ets,
- gint position,
- gint amount);
-void e_table_subset_variable_decrement (ETableSubsetVariable *ets,
- gint position,
- gint amount);
-void e_table_subset_variable_set_allocation (ETableSubsetVariable *ets,
- gint total);
-G_END_DECLS
-
-#endif /* _E_TABLE_SUBSET_VARIABLE_H_ */
-
diff --git a/widgets/table/e-table-subset.c b/widgets/table/e-table-subset.c
deleted file mode 100644
index d4a2415f13..0000000000
--- a/widgets/table/e-table-subset.c
+++ /dev/null
@@ -1,471 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-table-subset.c - Implements a table that contains a subset of another table.
- * Copyright 1999, 2000, 2001, Ximian, Inc.
- *
- * Authors:
- * Chris Lahey <clahey@ximian.com>
- * Miguel de Icaza <miguel@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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 <stdlib.h>
-#include "gal/util/e-util.h"
-#include "e-table-subset.h"
-
-static void etss_proxy_model_pre_change_real (ETableSubset *etss, ETableModel *etm);
-static void etss_proxy_model_no_change_real (ETableSubset *etss, ETableModel *etm);
-static void etss_proxy_model_changed_real (ETableSubset *etss, ETableModel *etm);
-static void etss_proxy_model_row_changed_real (ETableSubset *etss, ETableModel *etm, int row);
-static void etss_proxy_model_cell_changed_real (ETableSubset *etss, ETableModel *etm, int col, int row);
-static void etss_proxy_model_rows_inserted_real (ETableSubset *etss, ETableModel *etm, int row, int count);
-static void etss_proxy_model_rows_deleted_real (ETableSubset *etss, ETableModel *etm, int row, int count);
-
-#define d(x)
-
-static ETableModelClass *etss_parent_class;
-
-#define ETSS_CLASS(object) (E_TABLE_SUBSET_GET_CLASS(object))
-
-static gint
-etss_get_view_row (ETableSubset *etss, int row)
-{
- const int n = etss->n_map;
- const int * const map_table = etss->map_table;
- int i;
-
- int end = MIN(etss->n_map, etss->last_access + 10);
- int start = MAX(0, etss->last_access - 10);
- int initial = MAX (MIN (etss->last_access, end), start);
-
- for (i = initial; i < end; i++) {
- if (map_table [i] == row){
- d(g_print("a) Found %d from %d\n", i, etss->last_access));
- etss->last_access = i;
- return i;
- }
- }
-
- for (i = initial - 1; i >= start; i--) {
- if (map_table [i] == row){
- d(g_print("b) Found %d from %d\n", i, etss->last_access));
- etss->last_access = i;
- return i;
- }
- }
-
- for (i = 0; i < n; i++){
- if (map_table [i] == row){
- d(g_print("c) Found %d from %d\n", i, etss->last_access));
- etss->last_access = i;
- return i;
- }
- }
- return -1;
-}
-
-static void
-etss_dispose (GObject *object)
-{
- ETableSubset *etss = E_TABLE_SUBSET (object);
-
- if (etss->source) {
- g_signal_handler_disconnect (G_OBJECT (etss->source),
- etss->table_model_pre_change_id);
- g_signal_handler_disconnect (G_OBJECT (etss->source),
- etss->table_model_no_change_id);
- g_signal_handler_disconnect (G_OBJECT (etss->source),
- etss->table_model_changed_id);
- g_signal_handler_disconnect (G_OBJECT (etss->source),
- etss->table_model_row_changed_id);
- g_signal_handler_disconnect (G_OBJECT (etss->source),
- etss->table_model_cell_changed_id);
- g_signal_handler_disconnect (G_OBJECT (etss->source),
- etss->table_model_rows_inserted_id);
- g_signal_handler_disconnect (G_OBJECT (etss->source),
- etss->table_model_rows_deleted_id);
-
- g_object_unref (etss->source);
- etss->source = NULL;
-
- etss->table_model_changed_id = 0;
- etss->table_model_row_changed_id = 0;
- etss->table_model_cell_changed_id = 0;
- etss->table_model_rows_inserted_id = 0;
- etss->table_model_rows_deleted_id = 0;
- }
-
- G_OBJECT_CLASS (etss_parent_class)->dispose (object);
-}
-
-static void
-etss_finalize (GObject *object)
-{
- ETableSubset *etss = E_TABLE_SUBSET (object);
-
- g_free (etss->map_table);
- etss->map_table = NULL;
-
- G_OBJECT_CLASS (etss_parent_class)->finalize (object);
-}
-
-static int
-etss_column_count (ETableModel *etm)
-{
- ETableSubset *etss = (ETableSubset *)etm;
-
- return e_table_model_column_count (etss->source);
-}
-
-static int
-etss_row_count (ETableModel *etm)
-{
- ETableSubset *etss = (ETableSubset *)etm;
-
- return etss->n_map;
-}
-
-static void *
-etss_value_at (ETableModel *etm, int col, int row)
-{
- ETableSubset *etss = (ETableSubset *)etm;
-
- etss->last_access = row;
- d(g_print("g) Setting last_access to %d\n", row));
- return e_table_model_value_at (etss->source, col, etss->map_table [row]);
-}
-
-static void
-etss_set_value_at (ETableModel *etm, int col, int row, const void *val)
-{
- ETableSubset *etss = (ETableSubset *)etm;
-
- etss->last_access = row;
- d(g_print("h) Setting last_access to %d\n", row));
- e_table_model_set_value_at (etss->source, col, etss->map_table [row], val);
-}
-
-static gboolean
-etss_is_cell_editable (ETableModel *etm, int col, int row)
-{
- ETableSubset *etss = (ETableSubset *)etm;
-
- return e_table_model_is_cell_editable (etss->source, col, etss->map_table [row]);
-}
-
-static gboolean
-etss_has_save_id (ETableModel *etm)
-{
- return TRUE;
-}
-
-static char *
-etss_get_save_id (ETableModel *etm, int row)
-{
- ETableSubset *etss = (ETableSubset *)etm;
-
- if (e_table_model_has_save_id (etss->source))
- return e_table_model_get_save_id (etss->source, etss->map_table [row]);
- else
- return g_strdup_printf ("%d", etss->map_table[row]);
-}
-
-static void
-etss_append_row (ETableModel *etm, ETableModel *source, int row)
-{
- ETableSubset *etss = (ETableSubset *)etm;
- e_table_model_append_row (etss->source, source, row);
-}
-
-static void *
-etss_duplicate_value (ETableModel *etm, int col, const void *value)
-{
- ETableSubset *etss = (ETableSubset *)etm;
-
- return e_table_model_duplicate_value (etss->source, col, value);
-}
-
-static void
-etss_free_value (ETableModel *etm, int col, void *value)
-{
- ETableSubset *etss = (ETableSubset *)etm;
-
- e_table_model_free_value (etss->source, col, value);
-}
-
-static void *
-etss_initialize_value (ETableModel *etm, int col)
-{
- ETableSubset *etss = (ETableSubset *)etm;
-
- return e_table_model_initialize_value (etss->source, col);
-}
-
-static gboolean
-etss_value_is_empty (ETableModel *etm, int col, const void *value)
-{
- ETableSubset *etss = (ETableSubset *)etm;
-
- return e_table_model_value_is_empty (etss->source, col, value);
-}
-
-static char *
-etss_value_to_string (ETableModel *etm, int col, const void *value)
-{
- ETableSubset *etss = (ETableSubset *)etm;
-
- return e_table_model_value_to_string (etss->source, col, value);
-}
-
-static void
-etss_class_init (GObjectClass *object_class)
-{
- ETableSubsetClass *klass = (ETableSubsetClass *) object_class;
- ETableModelClass *table_class = (ETableModelClass *) object_class;
-
- etss_parent_class = g_type_class_peek_parent (klass);
-
- object_class->dispose = etss_dispose;
- object_class->finalize = etss_finalize;
-
- table_class->column_count = etss_column_count;
- table_class->row_count = etss_row_count;
- table_class->append_row = etss_append_row;
-
- table_class->value_at = etss_value_at;
- table_class->set_value_at = etss_set_value_at;
- table_class->is_cell_editable = etss_is_cell_editable;
-
- table_class->has_save_id = etss_has_save_id;
- table_class->get_save_id = etss_get_save_id;
-
- table_class->duplicate_value = etss_duplicate_value;
- table_class->free_value = etss_free_value;
- table_class->initialize_value = etss_initialize_value;
- table_class->value_is_empty = etss_value_is_empty;
- table_class->value_to_string = etss_value_to_string;
-
- klass->proxy_model_pre_change = etss_proxy_model_pre_change_real;
- klass->proxy_model_no_change = etss_proxy_model_no_change_real;
- klass->proxy_model_changed = etss_proxy_model_changed_real;
- klass->proxy_model_row_changed = etss_proxy_model_row_changed_real;
- klass->proxy_model_cell_changed = etss_proxy_model_cell_changed_real;
- klass->proxy_model_rows_inserted = etss_proxy_model_rows_inserted_real;
- klass->proxy_model_rows_deleted = etss_proxy_model_rows_deleted_real;
-}
-
-static void
-etss_init (ETableSubset *etss)
-{
- etss->last_access = 0;
-}
-
-E_MAKE_TYPE(e_table_subset, "ETableSubset", ETableSubset, etss_class_init, etss_init, E_TABLE_MODEL_TYPE)
-
-static void
-etss_proxy_model_pre_change_real (ETableSubset *etss, ETableModel *etm)
-{
- e_table_model_pre_change (E_TABLE_MODEL (etss));
-}
-
-static void
-etss_proxy_model_no_change_real (ETableSubset *etss, ETableModel *etm)
-{
- e_table_model_no_change (E_TABLE_MODEL (etss));
-}
-
-static void
-etss_proxy_model_changed_real (ETableSubset *etss, ETableModel *etm)
-{
- e_table_model_changed (E_TABLE_MODEL (etss));
-}
-
-static void
-etss_proxy_model_row_changed_real (ETableSubset *etss, ETableModel *etm, int row)
-{
- int view_row = etss_get_view_row (etss, row);
- if (view_row != -1)
- e_table_model_row_changed (E_TABLE_MODEL (etss), view_row);
- else
- e_table_model_no_change (E_TABLE_MODEL (etss));
-}
-
-static void
-etss_proxy_model_cell_changed_real (ETableSubset *etss, ETableModel *etm, int col, int row)
-{
- int view_row = etss_get_view_row (etss, row);
- if (view_row != -1)
- e_table_model_cell_changed (E_TABLE_MODEL (etss), col, view_row);
- else
- e_table_model_no_change (E_TABLE_MODEL (etss));
-}
-
-static void
-etss_proxy_model_rows_inserted_real (ETableSubset *etss, ETableModel *etm, int row, int count)
-{
- e_table_model_no_change (E_TABLE_MODEL (etss));
-}
-
-static void
-etss_proxy_model_rows_deleted_real (ETableSubset *etss, ETableModel *etm, int row, int count)
-{
- e_table_model_no_change (E_TABLE_MODEL (etss));
-}
-
-static void
-etss_proxy_model_pre_change (ETableModel *etm, ETableSubset *etss)
-{
- if (ETSS_CLASS(etss)->proxy_model_pre_change)
- (ETSS_CLASS(etss)->proxy_model_pre_change) (etss, etm);
-}
-
-static void
-etss_proxy_model_no_change (ETableModel *etm, ETableSubset *etss)
-{
- if (ETSS_CLASS(etss)->proxy_model_no_change)
- (ETSS_CLASS(etss)->proxy_model_no_change) (etss, etm);
-}
-
-static void
-etss_proxy_model_changed (ETableModel *etm, ETableSubset *etss)
-{
- if (ETSS_CLASS(etss)->proxy_model_changed)
- (ETSS_CLASS(etss)->proxy_model_changed) (etss, etm);
-}
-
-static void
-etss_proxy_model_row_changed (ETableModel *etm, int row, ETableSubset *etss)
-{
- if (ETSS_CLASS(etss)->proxy_model_row_changed)
- (ETSS_CLASS(etss)->proxy_model_row_changed) (etss, etm, row);
-}
-
-static void
-etss_proxy_model_cell_changed (ETableModel *etm, int row, int col, ETableSubset *etss)
-{
- if (ETSS_CLASS(etss)->proxy_model_cell_changed)
- (ETSS_CLASS(etss)->proxy_model_cell_changed) (etss, etm, col, row);
-}
-
-static void
-etss_proxy_model_rows_inserted (ETableModel *etm, int row, int col, ETableSubset *etss)
-{
- if (ETSS_CLASS(etss)->proxy_model_rows_inserted)
- (ETSS_CLASS(etss)->proxy_model_rows_inserted) (etss, etm, row, col);
-}
-
-static void
-etss_proxy_model_rows_deleted (ETableModel *etm, int row, int col, ETableSubset *etss)
-{
- if (ETSS_CLASS(etss)->proxy_model_rows_deleted)
- (ETSS_CLASS(etss)->proxy_model_rows_deleted) (etss, etm, row, col);
-}
-
-ETableModel *
-e_table_subset_construct (ETableSubset *etss, ETableModel *source, int nvals)
-{
- unsigned int *buffer;
- int i;
-
- if (nvals) {
- buffer = (unsigned int *) g_malloc (sizeof (unsigned int) * nvals);
- if (buffer == NULL)
- return NULL;
- } else
- buffer = NULL;
- etss->map_table = buffer;
- etss->n_map = nvals;
- etss->source = source;
- g_object_ref (source);
-
- /* Init */
- for (i = 0; i < nvals; i++)
- etss->map_table [i] = i;
-
- etss->table_model_pre_change_id = g_signal_connect (G_OBJECT (source), "model_pre_change",
- G_CALLBACK (etss_proxy_model_pre_change), etss);
- etss->table_model_no_change_id = g_signal_connect (G_OBJECT (source), "model_no_change",
- G_CALLBACK (etss_proxy_model_no_change), etss);
- etss->table_model_changed_id = g_signal_connect (G_OBJECT (source), "model_changed",
- G_CALLBACK (etss_proxy_model_changed), etss);
- etss->table_model_row_changed_id = g_signal_connect (G_OBJECT (source), "model_row_changed",
- G_CALLBACK (etss_proxy_model_row_changed), etss);
- etss->table_model_cell_changed_id = g_signal_connect (G_OBJECT (source), "model_cell_changed",
- G_CALLBACK (etss_proxy_model_cell_changed), etss);
- etss->table_model_rows_inserted_id = g_signal_connect (G_OBJECT (source), "model_rows_inserted",
- G_CALLBACK (etss_proxy_model_rows_inserted), etss);
- etss->table_model_rows_deleted_id = g_signal_connect (G_OBJECT (source), "model_rows_deleted",
- G_CALLBACK (etss_proxy_model_rows_deleted), etss);
-
- return E_TABLE_MODEL (etss);
-}
-
-ETableModel *
-e_table_subset_new (ETableModel *source, const int nvals)
-{
- ETableSubset *etss = g_object_new (E_TABLE_SUBSET_TYPE, NULL);
-
- if (e_table_subset_construct (etss, source, nvals) == NULL){
- g_object_unref (etss);
- return NULL;
- }
-
- return (ETableModel *) etss;
-}
-
-int
-e_table_subset_model_to_view_row (ETableSubset *ets,
- int model_row)
-{
- int i;
- for (i = 0; i < ets->n_map; i++) {
- if (ets->map_table[i] == model_row)
- return i;
- }
- return -1;
-}
-
-int
-e_table_subset_view_to_model_row (ETableSubset *ets,
- int view_row)
-{
- if (view_row >= 0 && view_row < ets->n_map)
- return ets->map_table[view_row];
- else
- return -1;
-}
-
-ETableModel *
-e_table_subset_get_toplevel (ETableSubset *table)
-{
- g_return_val_if_fail (table != NULL, NULL);
- g_return_val_if_fail (E_IS_TABLE_SUBSET (table), NULL);
-
- if (E_IS_TABLE_SUBSET (table->source))
- return e_table_subset_get_toplevel (E_TABLE_SUBSET (table->source));
- else
- return table->source;
-}
-
-void
-e_table_subset_print_debugging (ETableSubset *table_model)
-{
- int i;
- for (i = 0; i < table_model->n_map; i++) {
- g_print("%8d\n", table_model->map_table[i]);
- }
-}
diff --git a/widgets/table/e-table-subset.h b/widgets/table/e-table-subset.h
deleted file mode 100644
index 505aa6c305..0000000000
--- a/widgets/table/e-table-subset.h
+++ /dev/null
@@ -1,89 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-table-subset.h - Implements a table that contains a subset of another table.
- * Copyright 1999, 2000, 2001, Ximian, Inc.
- *
- * Authors:
- * Chris Lahey <clahey@ximian.com>
- * Miguel de Icaza <miguel@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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.
- */
-
-#ifndef _E_TABLE_SUBSET_H_
-#define _E_TABLE_SUBSET_H_
-
-#include <glib-object.h>
-#include <gal/e-table/e-table-model.h>
-
-G_BEGIN_DECLS
-
-#define E_TABLE_SUBSET_TYPE (e_table_subset_get_type ())
-#define E_TABLE_SUBSET(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), E_TABLE_SUBSET_TYPE, ETableSubset))
-#define E_TABLE_SUBSET_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), E_TABLE_SUBSET_TYPE, ETableSubsetClass))
-#define E_IS_TABLE_SUBSET(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), E_TABLE_SUBSET_TYPE))
-#define E_IS_TABLE_SUBSET_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), E_TABLE_SUBSET_TYPE))
-#define E_TABLE_SUBSET_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), E_TABLE_SUBSET_TYPE, ETableSubsetClass))
-
-typedef struct {
- ETableModel base;
-
- ETableModel *source;
- int n_map;
- int *map_table;
-
- int last_access;
-
- int table_model_pre_change_id;
- int table_model_no_change_id;
- int table_model_changed_id;
- int table_model_row_changed_id;
- int table_model_cell_changed_id;
- int table_model_rows_inserted_id;
- int table_model_rows_deleted_id;
-} ETableSubset;
-
-typedef struct {
- ETableModelClass parent_class;
-
- void (*proxy_model_pre_change) (ETableSubset *etss, ETableModel *etm);
- void (*proxy_model_no_change) (ETableSubset *etss, ETableModel *etm);
- void (*proxy_model_changed) (ETableSubset *etss, ETableModel *etm);
- void (*proxy_model_row_changed) (ETableSubset *etss, ETableModel *etm, int row);
- void (*proxy_model_cell_changed) (ETableSubset *etss, ETableModel *etm, int col, int row);
- void (*proxy_model_rows_inserted) (ETableSubset *etss, ETableModel *etm, int row, int count);
- void (*proxy_model_rows_deleted) (ETableSubset *etss, ETableModel *etm, int row, int count);
-} ETableSubsetClass;
-
-GType e_table_subset_get_type (void);
-ETableModel *e_table_subset_new (ETableModel *etm,
- int n_vals);
-ETableModel *e_table_subset_construct (ETableSubset *ets,
- ETableModel *source,
- int nvals);
-
-int e_table_subset_model_to_view_row (ETableSubset *ets,
- int model_row);
-int e_table_subset_view_to_model_row (ETableSubset *ets,
- int view_row);
-
-ETableModel *e_table_subset_get_toplevel (ETableSubset *table_model);
-
-void e_table_subset_print_debugging (ETableSubset *table_model);
-
-G_END_DECLS
-
-#endif /* _E_TABLE_SUBSET_H_ */
-
diff --git a/widgets/table/e-table-tooltip.h b/widgets/table/e-table-tooltip.h
deleted file mode 100644
index 81c00f9e34..0000000000
--- a/widgets/table/e-table-tooltip.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-table-tooltip.h
- * Copyright 2000, 2001, Ximian, Inc.
- *
- * Authors:
- * Chris Lahey <clahey@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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.
- */
-
-#ifndef _E_TABLE_TOOLTIP_H_
-#define _E_TABLE_TOOLTIP_H_
-
-#include <libgnomecanvas/gnome-canvas.h>
-
-G_BEGIN_DECLS
-
-typedef struct {
- gint timer;
- int col, row;
- int row_height;
- int x, y;
- int cx, cy;
- GdkColor *foreground;
- GdkColor *background;
- GnomeCanvasItem *eti;
-} ETableTooltip;
-
-G_END_DECLS
-
-#endif
diff --git a/widgets/table/e-table-tree.h b/widgets/table/e-table-tree.h
deleted file mode 100644
index 5648fc2f06..0000000000
--- a/widgets/table/e-table-tree.h
+++ /dev/null
@@ -1,48 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-table-tree.h
- * Copyright 2000, 2001, Ximian, Inc.
- *
- * Authors:
- * Chris Lahey <clahey@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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.
- */
-
-#ifndef _E_TABLE_TREE_H_
-#define _E_TABLE_TREE_H_
-
-#include <gal/e-table/e-table-model.h>
-
-G_BEGIN_DECLS
-
-typedef struct {
- char *title;
-
- union {
- ETableModel *table;
- GList *children;
- } u;
-
- guint expanded :1;
- guint is_leaf :1;
-} ETableGroup;
-
-ETableGroup *e_table_group_new (const char *title, ETableModel *table);
-ETableGroup *e_table_group_new_leaf (const char *title);
-
-G_END_DECLS
-
-#endif /* _E_TABLE_TREE_H_ */
diff --git a/widgets/table/e-table-utils.c b/widgets/table/e-table-utils.c
deleted file mode 100644
index 76427ae464..0000000000
--- a/widgets/table/e-table-utils.c
+++ /dev/null
@@ -1,189 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-table-utils.c
- * Copyright 2000, 2001, Ximian, Inc.
- *
- * Authors:
- * Chris Lahey <clahey@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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 "gal/util/e-i18n.h"
-#include "gal/util/e-util.h"
-#include "gal/widgets/e-unicode.h"
-#include "e-table-utils.h"
-#include "e-table-header-utils.h"
-
-ETableHeader *
-e_table_state_to_header (GtkWidget *widget, ETableHeader *full_header, ETableState *state)
-{
- ETableHeader *nh;
- const int max_cols = e_table_header_count (full_header);
- int column;
- GValue *val = g_new0 (GValue, 1);
-
- g_return_val_if_fail (widget, NULL);
- g_return_val_if_fail (full_header, NULL);
- g_return_val_if_fail (state, NULL);
-
- nh = e_table_header_new ();
- g_value_init (val, G_TYPE_DOUBLE);
- g_value_set_double (val, e_table_header_width_extras (widget->style));
- g_object_set_property (G_OBJECT(nh), "width_extras", val);
- g_free (val);
-
- for (column = 0; column < state->col_count; column++) {
- int col;
- double expansion;
- ETableCol *table_col;
-
- col = state->columns[column];
- expansion = state->expansions[column];
-
- if (col >= max_cols)
- continue;
-
- table_col = e_table_header_get_column (full_header, col);
-
- if (expansion >= -1)
- table_col->expansion = expansion;
-
- e_table_header_add_column (nh, table_col, -1);
- }
-
- return nh;
-}
-
-static ETableCol *
-et_col_spec_to_col (ETableColumnSpecification *col_spec,
- ETableExtras *ete,
- const char *domain)
-{
- ETableCol *col = NULL;
- ECell *cell = NULL;
- GCompareFunc compare = NULL;
- ETableSearchFunc search = NULL;
-
- if (col_spec->cell)
- cell = e_table_extras_get_cell(ete, col_spec->cell);
- if (col_spec->compare)
- compare = e_table_extras_get_compare(ete, col_spec->compare);
- if (col_spec->search)
- search = e_table_extras_get_search(ete, col_spec->search);
-
- if (cell && compare) {
- char *title = dgettext (domain, col_spec->title);
-
- title = g_strdup (title);
-
- if (col_spec->pixbuf && *col_spec->pixbuf) {
- GdkPixbuf *pixbuf;
-
- pixbuf = e_table_extras_get_pixbuf(
- ete, col_spec->pixbuf);
- if (pixbuf) {
- col = e_table_col_new_with_pixbuf (
- col_spec->model_col, title,
- pixbuf, col_spec->expansion,
- col_spec->minimum_width,
- cell, compare, col_spec->resizable, col_spec->disabled, col_spec->priority);
- }
- }
- if (col == NULL && col_spec->title && *col_spec->title) {
- col = e_table_col_new (
- col_spec->model_col, title,
- col_spec->expansion, col_spec->minimum_width,
- cell, compare, col_spec->resizable, col_spec->disabled, col_spec->priority);
- }
- col->search = search;
-
- g_free (title);
- }
- if (col && col_spec->compare_col != col_spec->model_col)
- g_object_set (col,
- "compare_col", col_spec->compare_col,
- NULL);
- return col;
-}
-
-ETableHeader *
-e_table_spec_to_full_header (ETableSpecification *spec,
- ETableExtras *ete)
-{
- ETableHeader *nh;
- int column;
-
- g_return_val_if_fail (spec, NULL);
- g_return_val_if_fail (ete, NULL);
-
- nh = e_table_header_new ();
-
- for (column = 0; spec->columns[column]; column++) {
- ETableCol *col = et_col_spec_to_col (
- spec->columns[column], ete, spec->domain);
-
- if (col)
- e_table_header_add_column (nh, col, -1);
- }
-
- return nh;
-}
-
-static gboolean
-check_col (ETableCol *col, gpointer user_data)
-{
- return col->search ? TRUE : FALSE;
-}
-
-ETableCol *
-e_table_util_calculate_current_search_col (ETableHeader *header, ETableHeader *full_header, ETableSortInfo *sort_info, gboolean always_search)
-{
- int i;
- int count;
- ETableCol *col = NULL;
- count = e_table_sort_info_grouping_get_count (sort_info);
- for (i = 0; i < count; i++) {
- ETableSortColumn column = e_table_sort_info_grouping_get_nth(sort_info, i);
-
- col = e_table_header_get_column (full_header, column.column);
-
- if (col && col->search)
- break;
-
- col = NULL;
- }
-
- if (col == NULL) {
- count = e_table_sort_info_sorting_get_count (sort_info);
- for (i = 0; i < count; i++) {
- ETableSortColumn column = e_table_sort_info_sorting_get_nth(sort_info, i);
-
- col = e_table_header_get_column (full_header, column.column);
-
- if (col && col->search)
- break;
-
- col = NULL;
- }
- }
-
- if (col == NULL && always_search) {
- col = e_table_header_prioritized_column_selected (header, check_col, NULL);
- }
-
- return col;
-}
diff --git a/widgets/table/e-table-utils.h b/widgets/table/e-table-utils.h
deleted file mode 100644
index 3c7fd937b6..0000000000
--- a/widgets/table/e-table-utils.h
+++ /dev/null
@@ -1,49 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-table-utils.h
- * Copyright 2000, 2001, Ximian, Inc.
- *
- * Authors:
- * Chris Lahey <clahey@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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.
- */
-
-#ifndef _E_TABLE_UTILS_H_
-#define _E_TABLE_UTILS_H_
-
-#include <gal/e-table/e-table-header.h>
-#include <gal/e-table/e-table-state.h>
-#include <gal/e-table/e-table-specification.h>
-#include <gal/e-table/e-table-extras.h>
-
-G_BEGIN_DECLS
-
-ETableHeader *e_table_state_to_header (GtkWidget *widget,
- ETableHeader *full_header,
- ETableState *state);
-
-ETableHeader *e_table_spec_to_full_header (ETableSpecification *spec,
- ETableExtras *ete);
-
-ETableCol *e_table_util_calculate_current_search_col (ETableHeader *header,
- ETableHeader *full_header,
- ETableSortInfo *sort_info,
- gboolean always_search);
-
-G_END_DECLS
-
-#endif /* _E_TABLE_UTILS_H_ */
-
diff --git a/widgets/table/e-table-without.c b/widgets/table/e-table-without.c
deleted file mode 100644
index e49076be0f..0000000000
--- a/widgets/table/e-table-without.c
+++ /dev/null
@@ -1,392 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-table-without.c
- * Copyright 2000, 2001, Ximian, Inc.
- *
- * Authors:
- * Chris Lahey <clahey@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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 <stdlib.h>
-#include <string.h>
-#include "gal/util/e-util.h"
-#include "e-table-without.h"
-
-#define PARENT_TYPE E_TABLE_SUBSET_TYPE
-
-#define INCREMENT_AMOUNT 10
-
-static ETableSubsetClass *parent_class;
-
-struct _ETableWithoutPrivate {
- GHashTable *hash;
-
- GHashFunc hash_func;
- GCompareFunc compare_func;
-
- ETableWithoutGetKeyFunc get_key_func;
- ETableWithoutDuplicateKeyFunc duplicate_key_func;
- ETableWithoutFreeKeyFunc free_gotten_key_func;
- ETableWithoutFreeKeyFunc free_duplicated_key_func;
-
- void *closure;
-};
-
-static gboolean
-check (ETableWithout *etw, int model_row)
-{
- gboolean ret_val;
- void *key;
- ETableSubset *etss = E_TABLE_SUBSET (etw);
-
- if (etw->priv->get_key_func)
- key = etw->priv->get_key_func (etss->source, model_row, etw->priv->closure);
- else
- key = GINT_TO_POINTER (model_row);
- ret_val = (g_hash_table_lookup (etw->priv->hash, key) != NULL);
- if (etw->priv->free_gotten_key_func)
- etw->priv->free_gotten_key_func (key, etw->priv->closure);
- return ret_val;
-}
-
-static gboolean
-check_with_key (ETableWithout *etw, void *key, int model_row)
-{
- gboolean ret_val;
- void *key2;
- ETableSubset *etss = E_TABLE_SUBSET (etw);
-
- if (etw->priv->get_key_func)
- key2 = etw->priv->get_key_func (etss->source, model_row, etw->priv->closure);
- else
- key2 = GINT_TO_POINTER (model_row);
- if (etw->priv->compare_func)
- ret_val = (etw->priv->compare_func (key, key2));
- else
- ret_val = (key == key2);
- if (etw->priv->free_gotten_key_func)
- etw->priv->free_gotten_key_func (key2, etw->priv->closure);
- return ret_val;
-}
-
-static gint
-etw_view_to_model_row (ETableWithout *etw, int view_row)
-{
- ETableSubset *etss = E_TABLE_SUBSET (etw);
- return etss->map_table[view_row];
-}
-
-static void
-add_row (ETableWithout *etw, int model_row)
-{
- ETableSubset *etss = E_TABLE_SUBSET (etw);
-
- e_table_model_pre_change (E_TABLE_MODEL (etw));
-
- etss->map_table = g_renew (int, etss->map_table, etss->n_map + 1);
-
- etss->map_table[etss->n_map++] = model_row;
-
- e_table_model_row_inserted (E_TABLE_MODEL (etw), etss->n_map - 1);
-}
-
-static void
-remove_row (ETableWithout *etw, int view_row)
-{
- ETableSubset *etss = E_TABLE_SUBSET (etw);
-
- e_table_model_pre_change (E_TABLE_MODEL (etw));
- memmove (etss->map_table + view_row, etss->map_table + view_row + 1, (etss->n_map - view_row - 1) * sizeof (int));
- etss->n_map --;
- e_table_model_row_deleted (E_TABLE_MODEL (etw), view_row);
-}
-
-static void
-delete_hash_element (gpointer key,
- gpointer value,
- gpointer closure)
-{
- ETableWithout *etw = closure;
- if (etw->priv->free_duplicated_key_func)
- etw->priv->free_duplicated_key_func (key, etw->priv->closure);
-}
-
-static void
-etw_dispose (GObject *object)
-{
- ETableWithout *etw = E_TABLE_WITHOUT (object);
-
- if (etw->priv) {
- if (etw->priv->hash) {
- g_hash_table_foreach (etw->priv->hash, delete_hash_element, etw);
- g_hash_table_destroy (etw->priv->hash);
- etw->priv->hash = NULL;
- }
- g_free (etw->priv);
- etw->priv = NULL;
- }
-
- if (G_OBJECT_CLASS (parent_class)->dispose)
- (* G_OBJECT_CLASS (parent_class)->dispose) (object);
-}
-
-static void
-etw_proxy_model_rows_inserted (ETableSubset *etss, ETableModel *etm, int model_row, int count)
-{
- int i;
- ETableWithout *etw = E_TABLE_WITHOUT (etss);
- gboolean shift = FALSE;
-
- /* i is View row */
- if (model_row != etss->n_map) {
- for (i = 0; i < etss->n_map; i++) {
- if (etss->map_table[i] > model_row)
- etss->map_table[i] += count;
- }
- shift = TRUE;
- }
-
- /* i is Model row */
- for (i = model_row; i < model_row + count; i++) {
- if (!check (etw, i)) {
- add_row (etw, i);
- }
- }
- if (shift)
- e_table_model_changed (E_TABLE_MODEL (etw));
- else
- e_table_model_no_change (E_TABLE_MODEL (etw));
-}
-
-static void
-etw_proxy_model_rows_deleted (ETableSubset *etss, ETableModel *etm, int model_row, int count)
-{
- int i; /* View row */
- ETableWithout *etw = E_TABLE_WITHOUT (etss);
- gboolean shift = FALSE;
-
- for (i = 0; i < etss->n_map; i++) {
- if (etss->map_table[i] >= model_row && etss->map_table[i] < model_row + count) {
- remove_row (etw, i);
- i--;
- } else if (etss->map_table[i] >= model_row + count) {
- etss->map_table[i] -= count;
- shift = TRUE;
- }
- }
- if (shift)
- e_table_model_changed (E_TABLE_MODEL (etw));
- else
- e_table_model_no_change (E_TABLE_MODEL (etw));
-}
-
-static void
-etw_proxy_model_changed (ETableSubset *etss, ETableModel *etm)
-{
- int i; /* Model row */
- int j; /* View row */
- int row_count;
- ETableWithout *etw = E_TABLE_WITHOUT (etss);
-
- g_free (etss->map_table);
- row_count = e_table_model_row_count (etm);
- etss->map_table = g_new (int, row_count);
-
- for (i = 0, j = 0; i < row_count; i++) {
- if (!check (etw, i)) {
- etss->map_table[j++] = i;
- }
- }
- etss->n_map = j;
-
- if (parent_class->proxy_model_changed)
- parent_class->proxy_model_changed (etss, etm);
-}
-
-static void
-etw_class_init (ETableWithoutClass *klass)
-{
- ETableSubsetClass *etss_class = E_TABLE_SUBSET_CLASS (klass);
- GObjectClass *object_class = G_OBJECT_CLASS (klass);
-
- parent_class = g_type_class_ref (PARENT_TYPE);
-
- object_class->dispose = etw_dispose;
-
- etss_class->proxy_model_rows_inserted = etw_proxy_model_rows_inserted;
- etss_class->proxy_model_rows_deleted = etw_proxy_model_rows_deleted;
- etss_class->proxy_model_changed = etw_proxy_model_changed;
-}
-
-static void
-etw_init (ETableWithout *etw)
-{
- etw->priv = g_new (ETableWithoutPrivate, 1);
- etw->priv->hash_func = NULL;
- etw->priv->compare_func = NULL;
- etw->priv->get_key_func = NULL;
- etw->priv->duplicate_key_func = NULL;
- etw->priv->free_gotten_key_func = NULL;
- etw->priv->free_duplicated_key_func = NULL;
-}
-
-E_MAKE_TYPE(e_table_without, "ETableWithout", ETableWithout, etw_class_init, etw_init, PARENT_TYPE)
-
-ETableModel *
-e_table_without_construct (ETableWithout *etw,
- ETableModel *source,
- GHashFunc hash_func,
- GCompareFunc compare_func,
- ETableWithoutGetKeyFunc get_key_func,
- ETableWithoutDuplicateKeyFunc duplicate_key_func,
- ETableWithoutFreeKeyFunc free_gotten_key_func,
- ETableWithoutFreeKeyFunc free_duplicated_key_func,
- void *closure)
-{
- if (e_table_subset_construct (E_TABLE_SUBSET(etw), source, 1) == NULL)
- return NULL;
- E_TABLE_SUBSET(etw)->n_map = 0;
-
- etw->priv->hash_func = hash_func;
- etw->priv->compare_func = compare_func;
- etw->priv->get_key_func = get_key_func;
- etw->priv->duplicate_key_func = duplicate_key_func;
- etw->priv->free_gotten_key_func = free_gotten_key_func;
- etw->priv->free_duplicated_key_func = free_duplicated_key_func;
- etw->priv->closure = closure;
-
- etw->priv->hash = g_hash_table_new (etw->priv->hash_func, etw->priv->compare_func);
-
- return E_TABLE_MODEL (etw);
-}
-
-ETableModel *
-e_table_without_new (ETableModel *source,
- GHashFunc hash_func,
- GCompareFunc compare_func,
- ETableWithoutGetKeyFunc get_key_func,
- ETableWithoutDuplicateKeyFunc duplicate_key_func,
- ETableWithoutFreeKeyFunc free_gotten_key_func,
- ETableWithoutFreeKeyFunc free_duplicated_key_func,
- void *closure)
-{
- ETableWithout *etw = g_object_new (E_TABLE_WITHOUT_TYPE, NULL);
-
- if (e_table_without_construct (etw,
- source,
- hash_func,
- compare_func,
- get_key_func,
- duplicate_key_func,
- free_gotten_key_func,
- free_duplicated_key_func,
- closure)
- == NULL) {
- g_object_unref (etw);
- return NULL;
- }
-
- return (ETableModel *) etw;
-}
-
-void e_table_without_hide (ETableWithout *etw,
- void *key)
-{
- int i; /* View row */
- ETableSubset *etss = E_TABLE_SUBSET (etw);
-
- if (etw->priv->duplicate_key_func)
- key = etw->priv->duplicate_key_func (key, etw->priv->closure);
-
- g_hash_table_insert (etw->priv->hash, key, key);
- for (i = 0; i < etss->n_map; i++) {
- if (check_with_key (etw, key, etw_view_to_model_row (etw, i))) {
- remove_row (etw, i);
- i --;
- }
- }
-}
-
-/* An adopted key will later be freed using the free_duplicated_key function. */
-void e_table_without_hide_adopt (ETableWithout *etw,
- void *key)
-{
- int i; /* View row */
- ETableSubset *etss = E_TABLE_SUBSET (etw);
-
- g_hash_table_insert (etw->priv->hash, key, key);
- for (i = 0; i < etss->n_map; i++) {
- if (check_with_key (etw, key, etw_view_to_model_row (etw, i))) {
- remove_row (etw, i);
- i --;
- }
- }
-}
-
-void
-e_table_without_show (ETableWithout *etw,
- void *key)
-{
- int i; /* Model row */
- ETableSubset *etss = E_TABLE_SUBSET (etw);
- int count;
- void *old_key;
-
- count = e_table_model_row_count (etss->source);
-
- for (i = 0; i < count; i++) {
- if (check_with_key (etw, key, i)) {
- add_row (etw, i);
- }
- }
- if (g_hash_table_lookup_extended (etw->priv->hash, key, &old_key, NULL)) {
-#if 0
- if (etw->priv->free_duplicated_key_func)
- etw->priv->free_duplicated_key_func (key, etw->priv->closure);
-#endif
- g_hash_table_remove (etw->priv->hash, key);
- }
-}
-
-void
-e_table_without_show_all (ETableWithout *etw)
-{
- int i; /* Model row */
- int row_count;
- ETableSubset *etss = E_TABLE_SUBSET (etw);
-
- e_table_model_pre_change (E_TABLE_MODEL (etw));
-
- if (etw->priv->hash) {
- g_hash_table_foreach (etw->priv->hash, delete_hash_element, etw);
- g_hash_table_destroy (etw->priv->hash);
- etw->priv->hash = NULL;
- }
- etw->priv->hash = g_hash_table_new (etw->priv->hash_func, etw->priv->compare_func);
-
- row_count = e_table_model_row_count (E_TABLE_MODEL(etss->source));
- g_free (etss->map_table);
- etss->map_table = g_new (int, row_count);
-
- for (i = 0; i < row_count; i++) {
- etss->map_table[i] = i;
- }
- etss->n_map = row_count;
-
- e_table_model_changed (E_TABLE_MODEL (etw));
-}
diff --git a/widgets/table/e-table-without.h b/widgets/table/e-table-without.h
deleted file mode 100644
index 6bcbdcdc65..0000000000
--- a/widgets/table/e-table-without.h
+++ /dev/null
@@ -1,91 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-table-without.h
- * Copyright 2000, 2001, Ximian, Inc.
- *
- * Authors:
- * Chris Lahey <clahey@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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.
- */
-
-#ifndef _E_TABLE_WITHOUT_H_
-#define _E_TABLE_WITHOUT_H_
-
-#include <gtk/gtkobject.h>
-#include <gal/e-table/e-table-subset.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
-
-#define E_TABLE_WITHOUT_TYPE (e_table_without_get_type ())
-#define E_TABLE_WITHOUT(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), E_TABLE_WITHOUT_TYPE, ETableWithout))
-#define E_TABLE_WITHOUT_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), E_TABLE_WITHOUT_TYPE, ETableWithoutClass))
-#define E_IS_TABLE_WITHOUT(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), E_TABLE_WITHOUT_TYPE))
-#define E_IS_TABLE_WITHOUT_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), E_TABLE_WITHOUT_TYPE))
-
-typedef struct _ETableWithoutPrivate ETableWithoutPrivate;
-typedef void *(*ETableWithoutGetKeyFunc) (ETableModel *source,
- int row,
- void *closure);
-typedef void *(*ETableWithoutDuplicateKeyFunc) (const void *key,
- void *closure);
-typedef void (*ETableWithoutFreeKeyFunc) (void *key,
- void *closure);
-
-typedef struct {
- ETableSubset base;
-
- ETableWithoutPrivate *priv;
-} ETableWithout;
-
-typedef struct {
- ETableSubsetClass parent_class;
-
-} ETableWithoutClass;
-
-GType e_table_without_get_type (void);
-ETableModel *e_table_without_new (ETableModel *source,
- GHashFunc hash_func,
- GCompareFunc compare_func,
- ETableWithoutGetKeyFunc get_key_func,
- ETableWithoutDuplicateKeyFunc duplicate_key_func,
- ETableWithoutFreeKeyFunc free_gotten_key_func,
- ETableWithoutFreeKeyFunc free_duplicated_key_func,
- void *closure);
-ETableModel *e_table_without_construct (ETableWithout *etw,
- ETableModel *source,
- GHashFunc hash_func,
- GCompareFunc compare_func,
- ETableWithoutGetKeyFunc get_key_func,
- ETableWithoutDuplicateKeyFunc duplicate_key_func,
- ETableWithoutFreeKeyFunc free_gotten_key_func,
- ETableWithoutFreeKeyFunc free_duplicated_key_func,
- void *closure);
-void e_table_without_hide (ETableWithout *etw,
- void *key);
-void e_table_without_hide_adopt (ETableWithout *etw,
- void *key);
-void e_table_without_show (ETableWithout *etw,
- void *key);
-void e_table_without_show_all (ETableWithout *etw);
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-
-#endif /* _E_TABLE_WITHOUT_H_ */
-
diff --git a/widgets/table/e-table.c b/widgets/table/e-table.c
deleted file mode 100644
index a6c382c757..0000000000
--- a/widgets/table/e-table.c
+++ /dev/null
@@ -1,3264 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-table.c - A graphical view of a Table.
- * Copyright 1999, 2000, 2001, Ximian, Inc.
- *
- * Authors:
- * Chris Lahey <clahey@ximian.com>
- * Miguel de Icaza <miguel@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <stdlib.h>
-#include <string.h>
-#include <stdio.h>
-#include <gdk/gdk.h>
-#include <gdk/gdkkeysyms.h>
-#include <gtk/gtksignal.h>
-#include <libgnomecanvas/gnome-canvas.h>
-#include <libgnomecanvas/gnome-canvas-rect-ellipse.h>
-
-#include "gal/util/e-i18n.h"
-#include "gal/util/e-util.h"
-#include "gal/widgets/e-canvas.h"
-#include "gal/widgets/e-canvas-background.h"
-#include "gal/widgets/e-canvas-vbox.h"
-#include "gal/widgets/e-unicode.h"
-#include "e-table.h"
-#include "e-table-header-item.h"
-#include "e-table-header-utils.h"
-#include "e-table-subset.h"
-#include "e-table-item.h"
-#include "e-table-group.h"
-#include "e-table-group-leaf.h"
-#include "e-table-click-to-add.h"
-#include "e-table-specification.h"
-#include "e-table-state.h"
-#include "e-table-column-specification.h"
-
-#include "e-table-utils.h"
-
-#define COLUMN_HEADER_HEIGHT 16
-
-#define PARENT_TYPE gtk_table_get_type ()
-
-#define d(x)
-
-#if d(!)0
-#define e_table_item_leave_edit_(x) (e_table_item_leave_edit((x)), g_print ("%s: e_table_item_leave_edit\n", __FUNCTION__))
-#else
-#define e_table_item_leave_edit_(x) (e_table_item_leave_edit((x)))
-#endif
-
-static GtkObjectClass *parent_class;
-
-enum {
- CURSOR_CHANGE,
- CURSOR_ACTIVATED,
- SELECTION_CHANGE,
- DOUBLE_CLICK,
- RIGHT_CLICK,
- CLICK,
- KEY_PRESS,
- START_DRAG,
- STATE_CHANGE,
- WHITE_SPACE_EVENT,
-
- TABLE_DRAG_BEGIN,
- TABLE_DRAG_END,
- TABLE_DRAG_DATA_GET,
- TABLE_DRAG_DATA_DELETE,
-
- TABLE_DRAG_LEAVE,
- TABLE_DRAG_MOTION,
- TABLE_DRAG_DROP,
- TABLE_DRAG_DATA_RECEIVED,
-
- LAST_SIGNAL
-};
-
-enum {
- PROP_0,
- PROP_LENGTH_THRESHOLD,
- PROP_MODEL,
- PROP_UNIFORM_ROW_HEIGHT,
- PROP_ALWAYS_SEARCH,
- PROP_USE_CLICK_TO_ADD
-};
-
-enum {
- ET_SCROLL_UP = 1 << 0,
- ET_SCROLL_DOWN = 1 << 1,
- ET_SCROLL_LEFT = 1 << 2,
- ET_SCROLL_RIGHT = 1 << 3
-};
-
-static guint et_signals [LAST_SIGNAL] = { 0 };
-
-static void e_table_fill_table (ETable *e_table, ETableModel *model);
-static gboolean changed_idle (gpointer data);
-
-static void et_grab_focus (GtkWidget *widget);
-
-static void et_drag_begin (GtkWidget *widget,
- GdkDragContext *context,
- ETable *et);
-static void et_drag_end (GtkWidget *widget,
- GdkDragContext *context,
- ETable *et);
-static void et_drag_data_get(GtkWidget *widget,
- GdkDragContext *context,
- GtkSelectionData *selection_data,
- guint info,
- guint time,
- ETable *et);
-static void et_drag_data_delete(GtkWidget *widget,
- GdkDragContext *context,
- ETable *et);
-
-static void et_drag_leave(GtkWidget *widget,
- GdkDragContext *context,
- guint time,
- ETable *et);
-static gboolean et_drag_motion(GtkWidget *widget,
- GdkDragContext *context,
- gint x,
- gint y,
- guint time,
- ETable *et);
-static gboolean et_drag_drop(GtkWidget *widget,
- GdkDragContext *context,
- gint x,
- gint y,
- guint time,
- ETable *et);
-static void et_drag_data_received(GtkWidget *widget,
- GdkDragContext *context,
- gint x,
- gint y,
- GtkSelectionData *selection_data,
- guint info,
- guint time,
- ETable *et);
-
-static gint et_focus (GtkWidget *container, GtkDirectionType direction);
-
-static void scroll_off (ETable *et);
-static void scroll_on (ETable *et, guint scroll_direction);
-
-static void
-et_disconnect_model (ETable *et)
-{
- if (et->model == NULL)
- return;
-
- if (et->table_model_change_id != 0)
- g_signal_handler_disconnect (G_OBJECT (et->model),
- et->table_model_change_id);
- if (et->table_row_change_id != 0)
- g_signal_handler_disconnect (G_OBJECT (et->model),
- et->table_row_change_id);
- if (et->table_cell_change_id != 0)
- g_signal_handler_disconnect (G_OBJECT (et->model),
- et->table_cell_change_id);
- if (et->table_rows_inserted_id != 0)
- g_signal_handler_disconnect (G_OBJECT (et->model),
- et->table_rows_inserted_id);
- if (et->table_rows_deleted_id != 0)
- g_signal_handler_disconnect (G_OBJECT (et->model),
- et->table_rows_deleted_id);
-
- et->table_model_change_id = 0;
- et->table_row_change_id = 0;
- et->table_cell_change_id = 0;
- et->table_rows_inserted_id = 0;
- et->table_rows_deleted_id = 0;
-}
-
-static void
-e_table_state_change (ETable *et)
-{
- g_signal_emit (G_OBJECT (et), et_signals [STATE_CHANGE], 0);
-}
-
-#define CHECK_HORIZONTAL(et) if ((et)->horizontal_scrolling || (et)->horizontal_resize) e_table_header_update_horizontal (et->header);
-
-static void
-clear_current_search_col (ETable *et)
-{
- et->search_col_set = FALSE;
-}
-
-static ETableCol *
-current_search_col (ETable *et)
-{
- if (!et->search_col_set) {
- et->current_search_col =
- e_table_util_calculate_current_search_col (et->header,
- et->full_header,
- et->sort_info,
- et->always_search);
- et->search_col_set = TRUE;
- }
-
- return et->current_search_col;
-}
-
-static void
-et_size_request (GtkWidget *widget, GtkRequisition *request)
-{
- ETable *et = E_TABLE (widget);
- if (GTK_WIDGET_CLASS (parent_class)->size_request)
- GTK_WIDGET_CLASS (parent_class)->size_request (widget, request);
- if (et->horizontal_resize)
- request->width = MAX (request->width, et->header_width);
-}
-
-static void
-set_header_width (ETable *et)
-{
- if (et->horizontal_resize) {
- et->header_width = e_table_header_min_width (et->header);
- gtk_widget_queue_resize (GTK_WIDGET (et));
- }
-}
-
-static void
-structure_changed (ETableHeader *header, ETable *et)
-{
- e_table_state_change (et);
- set_header_width (et);
- clear_current_search_col (et);
-}
-
-static void
-expansion_changed (ETableHeader *header, ETable *et)
-{
- e_table_state_change (et);
- set_header_width (et);
-}
-
-static void
-dimension_changed (ETableHeader *header, int total_width, ETable *et)
-{
- set_header_width (et);
-}
-
-static void
-disconnect_header (ETable *e_table)
-{
- if (e_table->header == NULL)
- return;
-
- if (e_table->structure_change_id)
- g_signal_handler_disconnect (G_OBJECT (e_table->header),
- e_table->structure_change_id);
- if (e_table->expansion_change_id)
- g_signal_handler_disconnect (G_OBJECT (e_table->header),
- e_table->expansion_change_id);
- if (e_table->dimension_change_id)
- g_signal_handler_disconnect (G_OBJECT (e_table->header),
- e_table->dimension_change_id);
-
- g_object_unref(e_table->header);
- e_table->header = NULL;
-}
-
-static void
-connect_header (ETable *e_table, ETableState *state)
-{
- if (e_table->header != NULL)
- disconnect_header (e_table);
-
- e_table->header = e_table_state_to_header (GTK_WIDGET(e_table), e_table->full_header, state);
-
- e_table->structure_change_id =
- g_signal_connect (G_OBJECT (e_table->header), "structure_change",
- G_CALLBACK (structure_changed), e_table);
- e_table->expansion_change_id =
- g_signal_connect (G_OBJECT (e_table->header), "expansion_change",
- G_CALLBACK (expansion_changed), e_table);
- e_table->dimension_change_id =
- g_signal_connect (G_OBJECT (e_table->header), "dimension_change",
- G_CALLBACK (dimension_changed), e_table);
-}
-
-static void
-et_dispose (GObject *object)
-{
- ETable *et = E_TABLE (object);
-
- et_disconnect_model (et);
-
- if (et->search) {
- if (et->search_search_id)
- g_signal_handler_disconnect (G_OBJECT (et->search),
- et->search_search_id);
- if (et->search_accept_id)
- g_signal_handler_disconnect (G_OBJECT (et->search),
- et->search_accept_id);
- g_object_unref (et->search);
- et->search = NULL;
- }
-
- if (et->group_info_change_id) {
- g_signal_handler_disconnect (G_OBJECT (et->sort_info),
- et->group_info_change_id);
- et->group_info_change_id = 0;
- }
-
- if (et->sort_info_change_id) {
- g_signal_handler_disconnect (G_OBJECT (et->sort_info),
- et->sort_info_change_id);
- et->sort_info_change_id = 0;
- }
-
- if (et->reflow_idle_id) {
- g_source_remove(et->reflow_idle_id);
- et->reflow_idle_id = 0;
- }
-
- scroll_off (et);
-
- disconnect_header (et);
-
- if (et->model) {
- g_object_unref (et->model);
- et->model = NULL;
- }
-
- if (et->full_header) {
- g_object_unref (et->full_header);
- et->full_header = NULL;
- }
-
- if (et->sort_info) {
- g_object_unref (et->sort_info);
- et->sort_info = NULL;
- }
-
- if (et->sorter) {
- g_object_unref (et->sorter);
- et->sorter = NULL;
- }
-
- if (et->selection) {
- g_object_unref (et->selection);
- et->selection = NULL;
- }
-
- if (et->spec) {
- g_object_unref (et->spec);
- et->spec = NULL;
- }
-
- if (et->header_canvas != NULL) {
- gtk_widget_destroy (GTK_WIDGET (et->header_canvas));
- et->header_canvas = NULL;
- }
-
- if (et->site != NULL) {
- e_table_drag_source_unset (et);
- et->site = NULL;
- }
-
- if (et->table_canvas != NULL) {
- gtk_widget_destroy (GTK_WIDGET (et->table_canvas));
- et->table_canvas = NULL;
- }
-
- if (et->rebuild_idle_id != 0) {
- g_source_remove (et->rebuild_idle_id);
- et->rebuild_idle_id = 0;
- }
-
- g_free(et->click_to_add_message);
- et->click_to_add_message = NULL;
-
- g_free(et->domain);
- et->domain = NULL;
-
- (*G_OBJECT_CLASS (parent_class)->dispose)(object);
-}
-
-static void
-et_unrealize (GtkWidget *widget)
-{
- scroll_off (E_TABLE (widget));
-
- if (GTK_WIDGET_CLASS (parent_class)->unrealize)
- GTK_WIDGET_CLASS (parent_class)->unrealize (widget);
-}
-
-static gboolean
-check_row (ETable *et, int model_row, int col, ETableSearchFunc search, char *string)
-{
- const void *value;
-
- value = e_table_model_value_at (et->model, col, model_row);
-
- return search (value, string);
-}
-
-static gboolean
-et_search_search (ETableSearch *search, char *string, ETableSearchFlags flags, ETable *et)
-{
- int cursor;
- int rows;
- int i;
- ETableCol *col = current_search_col (et);
-
- if (col == NULL)
- return FALSE;
-
- rows = e_table_model_row_count (et->model);
-
- g_object_get(et->selection,
- "cursor_row", &cursor,
- NULL);
-
- if ((flags & E_TABLE_SEARCH_FLAGS_CHECK_CURSOR_FIRST) && cursor < rows && cursor >= 0 && check_row (et, cursor, col->col_idx, col->search, string))
- return TRUE;
-
- cursor = e_sorter_model_to_sorted (E_SORTER (et->sorter), cursor);
-
- for (i = cursor + 1; i < rows; i++) {
- int model_row = e_sorter_sorted_to_model (E_SORTER (et->sorter), i);
- if (check_row (et, model_row, col->col_idx, col->search, string)) {
- e_selection_model_select_as_key_press(E_SELECTION_MODEL (et->selection), model_row, col->col_idx, GDK_CONTROL_MASK);
- return TRUE;
- }
- }
-
- for (i = 0; i < cursor; i++) {
- int model_row = e_sorter_sorted_to_model (E_SORTER (et->sorter), i);
- if (check_row (et, model_row, col->col_idx, col->search, string)) {
- e_selection_model_select_as_key_press(E_SELECTION_MODEL (et->selection), model_row, col->col_idx, GDK_CONTROL_MASK);
- return TRUE;
- }
- }
-
- cursor = e_sorter_sorted_to_model (E_SORTER (et->sorter), cursor);
-
- /* Check if the cursor row is the only matching row. */
- return (!(flags & E_TABLE_SEARCH_FLAGS_CHECK_CURSOR_FIRST) && cursor < rows && cursor >= 0 && check_row (et, cursor, col->col_idx, col->search, string));
-}
-
-static void
-et_search_accept (ETableSearch *search, ETable *et)
-{
- int cursor;
- ETableCol *col = current_search_col (et);
-
- if (col == NULL)
- return;
-
- g_object_get(et->selection,
- "cursor_row", &cursor,
- NULL);
- e_selection_model_select_as_key_press(E_SELECTION_MODEL (et->selection), cursor, col->col_idx, 0);
-}
-
-static void
-init_search (ETable *e_table)
-{
- if (e_table->search != NULL)
- return;
-
- e_table->search = e_table_search_new();
-
- e_table->search_search_id =
- g_signal_connect (G_OBJECT (e_table->search), "search",
- G_CALLBACK (et_search_search), e_table);
- e_table->search_accept_id =
- g_signal_connect (G_OBJECT (e_table->search), "accept",
- G_CALLBACK (et_search_accept), e_table);
-}
-
-static void
-et_finalize (GObject *object)
-{
- ETable *et = E_TABLE (object);
-
- g_free (et->click_to_add_message);
- et->click_to_add_message = NULL;
-
- g_free(et->domain);
- et->domain = NULL;
- G_OBJECT_CLASS (parent_class)->finalize (object);
-}
-
-static void
-e_table_init (GtkObject *object)
-{
- ETable *e_table = E_TABLE (object);
- GtkTable *gtk_table = GTK_TABLE (object);
-
- GTK_WIDGET_SET_FLAGS (e_table, GTK_CAN_FOCUS);
-
- gtk_table->homogeneous = FALSE;
-
- e_table->sort_info = NULL;
- e_table->group_info_change_id = 0;
- e_table->sort_info_change_id = 0;
- e_table->structure_change_id = 0;
- e_table->expansion_change_id = 0;
- e_table->dimension_change_id = 0;
- e_table->reflow_idle_id = 0;
- e_table->scroll_idle_id = 0;
-
- e_table->alternating_row_colors = 1;
- e_table->horizontal_draw_grid = 1;
- e_table->vertical_draw_grid = 1;
- e_table->draw_focus = 1;
- e_table->cursor_mode = E_CURSOR_SIMPLE;
- e_table->length_threshold = 200;
- e_table->uniform_row_height = FALSE;
-
- e_table->need_rebuild = 0;
- e_table->rebuild_idle_id = 0;
-
- e_table->horizontal_scrolling = FALSE;
- e_table->horizontal_resize = FALSE;
-
- e_table->click_to_add_message = NULL;
- e_table->domain = NULL;
-
- e_table->drop_row = -1;
- e_table->drop_col = -1;
- e_table->site = NULL;
-
- e_table->do_drag = 0;
-
- e_table->sorter = NULL;
- e_table->selection = e_table_selection_model_new();
- e_table->cursor_loc = E_TABLE_CURSOR_LOC_NONE;
- e_table->spec = NULL;
-
- e_table->always_search = g_getenv ("GAL_ALWAYS_SEARCH") ? TRUE : FALSE;
-
- e_table->search = NULL;
- e_table->search_search_id = 0;
- e_table->search_accept_id = 0;
-
- e_table->current_search_col = NULL;
-
- e_table->header_width = 0;
-}
-
-/* Grab_focus handler for the ETable */
-static void
-et_grab_focus (GtkWidget *widget)
-{
- ETable *e_table;
-
- e_table = E_TABLE (widget);
-
- gtk_widget_grab_focus (GTK_WIDGET (e_table->table_canvas));
-}
-
-/* Focus handler for the ETable */
-static gint
-et_focus (GtkWidget *container, GtkDirectionType direction)
-{
- ETable *e_table;
-
- e_table = E_TABLE (container);
-
- if (GTK_CONTAINER (container)->focus_child) {
- gtk_container_set_focus_child (GTK_CONTAINER (container), NULL);
- return FALSE;
- }
-
- return gtk_widget_child_focus (GTK_WIDGET (e_table->table_canvas), direction);
-}
-
-static void
-set_header_canvas_width (ETable *e_table)
-{
- double oldwidth, oldheight, width;
-
- if (!(e_table->header_item && e_table->header_canvas && e_table->table_canvas))
- return;
-
- gnome_canvas_get_scroll_region (GNOME_CANVAS (e_table->table_canvas),
- NULL, NULL, &width, NULL);
- gnome_canvas_get_scroll_region (GNOME_CANVAS (e_table->header_canvas),
- NULL, NULL, &oldwidth, &oldheight);
-
- if (oldwidth != width ||
- oldheight != E_TABLE_HEADER_ITEM (e_table->header_item)->height - 1)
- gnome_canvas_set_scroll_region (
- GNOME_CANVAS (e_table->header_canvas),
- 0, 0, width, /* COLUMN_HEADER_HEIGHT - 1 */
- E_TABLE_HEADER_ITEM (e_table->header_item)->height - 1);
-
-}
-
-static void
-header_canvas_size_allocate (GtkWidget *widget, GtkAllocation *alloc, ETable *e_table)
-{
- set_header_canvas_width (e_table);
-
- /* When the header item is created ->height == 0,
- as the font is only created when everything is realized.
- So we set the usize here as well, so that the size of the
- header is correct */
- if (GTK_WIDGET (e_table->header_canvas)->allocation.height !=
- E_TABLE_HEADER_ITEM (e_table->header_item)->height)
- gtk_widget_set_usize (GTK_WIDGET (e_table->header_canvas), -2,
- E_TABLE_HEADER_ITEM (e_table->header_item)->height);
-}
-
-static void
-group_info_changed (ETableSortInfo *info, ETable *et)
-{
- gboolean will_be_grouped = e_table_sort_info_grouping_get_count(info) > 0;
- clear_current_search_col (et);
- if (et->is_grouped || will_be_grouped) {
- et->need_rebuild = TRUE;
- if (!et->rebuild_idle_id) {
- gtk_object_destroy (GTK_OBJECT (et->group));
- et->group = NULL;
- et->rebuild_idle_id = g_idle_add_full (20, changed_idle, et, NULL);
- }
- }
- e_table_state_change (et);
-}
-
-static void
-sort_info_changed (ETableSortInfo *info, ETable *et)
-{
- clear_current_search_col (et);
- e_table_state_change (et);
-}
-
-static void
-e_table_setup_header (ETable *e_table)
-{
- char *pointer;
- e_table->header_canvas = GNOME_CANVAS (e_canvas_new ());
- GTK_WIDGET_UNSET_FLAGS (e_table->header_canvas, GTK_CAN_FOCUS);
-
- gtk_widget_show (GTK_WIDGET (e_table->header_canvas));
-
- pointer = g_strdup_printf("%p", e_table);
-
- e_table->header_item = gnome_canvas_item_new (
- gnome_canvas_root (e_table->header_canvas),
- e_table_header_item_get_type (),
- "ETableHeader", e_table->header,
- "full_header", e_table->full_header,
- "sort_info", e_table->sort_info,
- "dnd_code", pointer,
- "table", e_table,
- NULL);
-
- g_free(pointer);
-
- g_signal_connect (
- G_OBJECT (e_table->header_canvas), "size_allocate",
- G_CALLBACK (header_canvas_size_allocate), e_table);
-
- gtk_widget_set_usize (GTK_WIDGET (e_table->header_canvas), -2,
- E_TABLE_HEADER_ITEM (e_table->header_item)->height);
-}
-
-static gboolean
-table_canvas_reflow_idle (ETable *e_table)
-{
- gdouble height, width;
- gdouble item_height;
- gdouble oldheight, oldwidth;
- GtkAllocation *alloc = &(GTK_WIDGET (e_table->table_canvas)->allocation);
-
- g_object_get (e_table->canvas_vbox,
- "height", &height,
- "width", &width,
- NULL);
- item_height = height;
- height = MAX ((int)height, alloc->height);
- width = MAX((int)width, alloc->width);
- /* I have no idea why this needs to be -1, but it works. */
- gnome_canvas_get_scroll_region (GNOME_CANVAS (e_table->table_canvas),
- NULL, NULL, &oldwidth, &oldheight);
-
- if (oldwidth != width - 1 ||
- oldheight != height - 1) {
- gnome_canvas_set_scroll_region (GNOME_CANVAS (e_table->table_canvas),
- 0, 0, width - 1, height - 1);
- set_header_canvas_width (e_table);
- }
- e_table->reflow_idle_id = 0;
- return FALSE;
-}
-
-static void
-table_canvas_size_allocate (GtkWidget *widget, GtkAllocation *alloc,
- ETable *e_table)
-{
- gdouble width;
- gdouble height;
- gdouble item_height;
- GValue *val = g_new0 (GValue, 1);
- g_value_init (val, G_TYPE_DOUBLE);
-
- width = alloc->width;
- g_value_set_double (val, width);
- g_object_get (e_table->canvas_vbox,
- "height", &height,
- NULL);
- item_height = height;
- height = MAX ((int)height, alloc->height);
-
- g_object_set (e_table->canvas_vbox,
- "width", width,
- NULL);
- g_object_set_property (G_OBJECT (e_table->header), "width", val);
- g_free (val);
- if (e_table->reflow_idle_id)
- g_source_remove(e_table->reflow_idle_id);
- table_canvas_reflow_idle(e_table);
-}
-
-static void
-table_canvas_reflow (GnomeCanvas *canvas, ETable *e_table)
-{
- if (!e_table->reflow_idle_id)
- e_table->reflow_idle_id = g_idle_add_full (400, (GSourceFunc) table_canvas_reflow_idle, e_table, NULL);
-}
-
-static void
-click_to_add_cursor_change (ETableClickToAdd *etcta, int row, int col, ETable *et)
-{
- if (et->cursor_loc == E_TABLE_CURSOR_LOC_TABLE) {
- e_selection_model_clear(E_SELECTION_MODEL (et->selection));
- }
- et->cursor_loc = E_TABLE_CURSOR_LOC_ETCTA;
-}
-
-static void
-group_cursor_change (ETableGroup *etg, int row, ETable *et)
-{
- ETableCursorLoc old_cursor_loc;
-
- old_cursor_loc = et->cursor_loc;
-
- et->cursor_loc = E_TABLE_CURSOR_LOC_TABLE;
- g_signal_emit (G_OBJECT (et), et_signals [CURSOR_CHANGE], 0, row);
-
- if (old_cursor_loc == E_TABLE_CURSOR_LOC_ETCTA && et->click_to_add)
- e_table_click_to_add_commit(E_TABLE_CLICK_TO_ADD(et->click_to_add));
-}
-
-static void
-group_cursor_activated (ETableGroup *etg, int row, ETable *et)
-{
- g_signal_emit (G_OBJECT (et), et_signals [CURSOR_ACTIVATED], 0, row);
-}
-
-static void
-group_double_click (ETableGroup *etg, int row, int col, GdkEvent *event, ETable *et)
-{
- g_signal_emit (G_OBJECT (et), et_signals [DOUBLE_CLICK], 0, row, col, event);
-}
-
-static gint
-group_right_click (ETableGroup *etg, int row, int col, GdkEvent *event, ETable *et)
-{
- int return_val = 0;
- g_signal_emit (G_OBJECT (et), et_signals [RIGHT_CLICK], 0, row, col, event, &return_val);
- return return_val;
-}
-
-static gint
-group_click (ETableGroup *etg, int row, int col, GdkEvent *event, ETable *et)
-{
- int return_val = 0;
- g_signal_emit (G_OBJECT (et), et_signals [CLICK], 0, row, col, event, &return_val);
- return return_val;
-}
-
-static gint
-group_key_press (ETableGroup *etg, int row, int col, GdkEvent *event, ETable *et)
-{
- int return_val = 0;
- GdkEventKey *key = (GdkEventKey *) event;
- int y, row_local, col_local;
- GtkAdjustment *vadj;
-
- switch (key->keyval) {
- case GDK_Page_Down:
- case GDK_KP_Page_Down:
- vadj = gtk_layout_get_vadjustment (GTK_LAYOUT (et->table_canvas));
- y = CLAMP(vadj->value + (2 * vadj->page_size - 50), 0, vadj->upper);
- y -= vadj->value;
- e_table_get_cell_at (et, 30, y, &row_local, &col_local);
-
- if (row_local == -1)
- row_local = e_table_model_row_count (et->model) - 1;
-
- row_local = e_table_view_to_model_row (et, row_local);
- col_local = e_selection_model_cursor_col (E_SELECTION_MODEL (et->selection));
- e_selection_model_select_as_key_press (E_SELECTION_MODEL (et->selection), row_local, col_local, key->state);
- return_val = 1;
- break;
- case GDK_Page_Up:
- case GDK_KP_Page_Up:
- vadj = gtk_layout_get_vadjustment (GTK_LAYOUT (et->table_canvas));
- y = CLAMP(vadj->value - (vadj->page_size - 50), 0, vadj->upper);
- y -= vadj->value;
- e_table_get_cell_at (et, 30, y, &row_local, &col_local);
-
- if (row_local == -1)
- row_local = 0;
-
- row_local = e_table_view_to_model_row (et, row_local);
- col_local = e_selection_model_cursor_col (E_SELECTION_MODEL (et->selection));
- e_selection_model_select_as_key_press (E_SELECTION_MODEL (et->selection), row_local, col_local, key->state);
- return_val = 1;
- break;
- case GDK_BackSpace:
- init_search (et);
- if (e_table_search_backspace (et->search))
- return TRUE;
- /* Fall through */
- default:
- init_search (et);
- if ((key->state & ~(GDK_SHIFT_MASK | GDK_LOCK_MASK)) == 0
- && ((key->keyval >= GDK_a && key->keyval <= GDK_z) ||
- (key->keyval >= GDK_A && key->keyval <= GDK_Z) ||
- (key->keyval >= GDK_0 && key->keyval <= GDK_9)))
- e_table_search_input_character (et->search, key->keyval);
- g_signal_emit (G_OBJECT (et), et_signals [KEY_PRESS], 0,
- row, col, event, &return_val);
- break;
- }
- return return_val;
-}
-
-static gint
-group_start_drag (ETableGroup *etg, int row, int col, GdkEvent *event, ETable *et)
-{
- int return_val = 0;
- g_signal_emit (G_OBJECT (et), et_signals [START_DRAG], 0,
- row, col, event, &return_val);
- return return_val;
-}
-
-static void
-et_table_model_changed (ETableModel *model, ETable *et)
-{
- et->need_rebuild = TRUE;
- if (!et->rebuild_idle_id) {
- gtk_object_destroy (GTK_OBJECT (et->group));
- et->group = NULL;
- et->rebuild_idle_id = g_idle_add_full (20, changed_idle, et, NULL);
- }
-}
-
-static void
-et_table_row_changed (ETableModel *table_model, int row, ETable *et)
-{
- if (!et->need_rebuild) {
- if (e_table_group_remove (et->group, row))
- e_table_group_add (et->group, row);
- CHECK_HORIZONTAL(et);
- }
-}
-
-static void
-et_table_cell_changed (ETableModel *table_model, int view_col, int row, ETable *et)
-{
- et_table_row_changed (table_model, row, et);
-}
-
-static void
-et_table_rows_inserted (ETableModel *table_model, int row, int count, ETable *et)
-{
- /* This number has already been decremented. */
- int row_count = e_table_model_row_count(table_model);
- if (!et->need_rebuild) {
- int i;
- if (row != row_count - count)
- e_table_group_increment(et->group, row, count);
- for (i = 0; i < count; i++)
- e_table_group_add (et->group, row + i);
- CHECK_HORIZONTAL(et);
- }
-}
-
-static void
-et_table_rows_deleted (ETableModel *table_model, int row, int count, ETable *et)
-{
- int row_count = e_table_model_row_count(table_model);
- if (!et->need_rebuild) {
- int i;
- for (i = 0; i < count; i++)
- e_table_group_remove (et->group, row + i);
- if (row != row_count)
- e_table_group_decrement(et->group, row, count);
- CHECK_HORIZONTAL(et);
- }
-}
-
-static void
-et_build_groups (ETable *et)
-{
- gboolean was_grouped = et->is_grouped;
-
- et->is_grouped = e_table_sort_info_grouping_get_count(et->sort_info) > 0;
-
- et->group = e_table_group_new (GNOME_CANVAS_GROUP (et->canvas_vbox),
- et->full_header,
- et->header,
- et->model,
- et->sort_info,
- 0);
-
- if (et->use_click_to_add_end)
- e_canvas_vbox_add_item_start(E_CANVAS_VBOX(et->canvas_vbox), GNOME_CANVAS_ITEM(et->group));
- else
- e_canvas_vbox_add_item(E_CANVAS_VBOX(et->canvas_vbox), GNOME_CANVAS_ITEM(et->group));
-
- gnome_canvas_item_set(GNOME_CANVAS_ITEM(et->group),
- "alternating_row_colors", et->alternating_row_colors,
- "horizontal_draw_grid", et->horizontal_draw_grid,
- "vertical_draw_grid", et->vertical_draw_grid,
- "drawfocus", et->draw_focus,
- "cursor_mode", et->cursor_mode,
- "length_threshold", et->length_threshold,
- "uniform_row_height", et->uniform_row_height,
- "selection_model", et->selection,
- NULL);
-
- g_signal_connect (G_OBJECT (et->group), "cursor_change",
- G_CALLBACK (group_cursor_change), et);
- g_signal_connect (G_OBJECT (et->group), "cursor_activated",
- G_CALLBACK (group_cursor_activated), et);
- g_signal_connect (G_OBJECT (et->group), "double_click",
- G_CALLBACK (group_double_click), et);
- g_signal_connect (G_OBJECT (et->group), "right_click",
- G_CALLBACK (group_right_click), et);
- g_signal_connect (G_OBJECT (et->group), "click",
- G_CALLBACK (group_click), et);
- g_signal_connect (G_OBJECT (et->group), "key_press",
- G_CALLBACK (group_key_press), et);
- g_signal_connect (G_OBJECT (et->group), "start_drag",
- G_CALLBACK (group_start_drag), et);
-
-
- if (!(et->is_grouped) && was_grouped)
- et_disconnect_model (et);
-
- if (et->is_grouped && (!was_grouped)) {
- et->table_model_change_id = g_signal_connect (G_OBJECT (et->model), "model_changed",
- G_CALLBACK (et_table_model_changed), et);
-
- et->table_row_change_id = g_signal_connect (G_OBJECT (et->model), "model_row_changed",
- G_CALLBACK (et_table_row_changed), et);
-
- et->table_cell_change_id = g_signal_connect (G_OBJECT (et->model), "model_cell_changed",
- G_CALLBACK (et_table_cell_changed), et);
-
- et->table_rows_inserted_id = g_signal_connect (G_OBJECT (et->model), "model_rows_inserted",
- G_CALLBACK (et_table_rows_inserted), et);
-
- et->table_rows_deleted_id = g_signal_connect (G_OBJECT (et->model), "model_rows_deleted",
- G_CALLBACK (et_table_rows_deleted), et);
-
- }
-
- if (et->is_grouped)
- e_table_fill_table (et, et->model);
-}
-
-static gboolean
-changed_idle (gpointer data)
-{
- ETable *et = E_TABLE (data);
-
- if (et->need_rebuild) {
- if (et->group)
- gtk_object_destroy (GTK_OBJECT (et->group));
- et_build_groups(et);
- g_object_set (et->canvas_vbox,
- "width", (double) GTK_WIDGET (et->table_canvas)->allocation.width,
- NULL);
-
- if (GTK_WIDGET_REALIZED(et->table_canvas))
- table_canvas_size_allocate (GTK_WIDGET(et->table_canvas), &GTK_WIDGET(et->table_canvas)->allocation, et);
- }
-
- et->need_rebuild = 0;
- et->rebuild_idle_id = 0;
-
- CHECK_HORIZONTAL(et);
-
- return FALSE;
-}
-
-static void
-et_canvas_realize (GtkWidget *canvas, ETable *e_table)
-{
- gnome_canvas_item_set(
- e_table->white_item,
- "fill_color_gdk", &GTK_WIDGET(e_table->table_canvas)->style->base[GTK_STATE_NORMAL],
- NULL);
-
- CHECK_HORIZONTAL(e_table);
- set_header_width (e_table);
-}
-
-static gint
-white_item_event (GnomeCanvasItem *white_item, GdkEvent *event, ETable *e_table)
-{
- int return_val = 0;
- g_signal_emit (GTK_OBJECT (e_table), et_signals [WHITE_SPACE_EVENT], 0,
- event, &return_val);
- return return_val;
-}
-
-static void
-et_eti_leave_edit (ETable *et)
-{
- GnomeCanvas *canvas = et->table_canvas;
-
- if (GTK_WIDGET_HAS_FOCUS(canvas)) {
- GnomeCanvasItem *item = GNOME_CANVAS(canvas)->focused_item;
-
- if (E_IS_TABLE_ITEM(item)) {
- e_table_item_leave_edit_(E_TABLE_ITEM(item));
- }
- }
-}
-
-static gint
-et_canvas_root_event (GnomeCanvasItem *root, GdkEvent *event, ETable *e_table)
-{
- switch (event->type) {
- case GDK_BUTTON_PRESS:
- case GDK_2BUTTON_PRESS:
- case GDK_BUTTON_RELEASE:
- if (event->button.button != 4 && event->button.button != 5) {
- et_eti_leave_edit (e_table);
- return TRUE;
- }
- break;
- default:
- break;
- }
-
- return FALSE;
-}
-
-/* Finds the first descendant of the group that is an ETableItem and focuses it */
-static void
-focus_first_etable_item (ETableGroup *group)
-{
- GnomeCanvasGroup *cgroup;
- GList *l;
-
- cgroup = GNOME_CANVAS_GROUP (group);
-
- for (l = cgroup->item_list; l; l = l->next) {
- GnomeCanvasItem *i;
-
- i = GNOME_CANVAS_ITEM (l->data);
-
- if (E_IS_TABLE_GROUP (i))
- focus_first_etable_item (E_TABLE_GROUP (i));
- else if (E_IS_TABLE_ITEM (i)) {
- e_table_item_set_cursor (E_TABLE_ITEM (i), 0, 0);
- gnome_canvas_item_grab_focus (i);
- }
- }
-}
-
-/* Handler for focus events in the table_canvas; we have to repaint ourselves
- * always, and also give the focus to some ETableItem if we get focused.
- */
-static gint
-table_canvas_focus_event_cb (GtkWidget *widget, GdkEventFocus *event, gpointer data)
-{
- GnomeCanvas *canvas;
- ETable *etable;
-
- gtk_widget_queue_draw (widget);
-
- if (!event->in)
- return TRUE;
-
- canvas = GNOME_CANVAS (widget);
- etable = E_TABLE (data);
-
- if (!canvas->focused_item && etable->group)
- focus_first_etable_item (etable->group);
-
- return TRUE;
-}
-
-static void
-e_table_setup_table (ETable *e_table, ETableHeader *full_header, ETableHeader *header,
- ETableModel *model)
-{
- e_table->table_canvas = GNOME_CANVAS (e_canvas_new ());
- g_signal_connect (
- G_OBJECT (e_table->table_canvas), "size_allocate",
- G_CALLBACK (table_canvas_size_allocate), e_table);
- g_signal_connect (
- G_OBJECT (e_table->table_canvas), "focus_in_event",
- G_CALLBACK (table_canvas_focus_event_cb), e_table);
- g_signal_connect (
- G_OBJECT (e_table->table_canvas), "focus_out_event",
- G_CALLBACK (table_canvas_focus_event_cb), e_table);
-
- g_signal_connect (
- G_OBJECT (e_table), "drag_begin",
- G_CALLBACK (et_drag_begin), e_table);
- g_signal_connect (
- G_OBJECT (e_table), "drag_end",
- G_CALLBACK (et_drag_end), e_table);
- g_signal_connect (
- G_OBJECT (e_table), "drag_data_get",
- G_CALLBACK (et_drag_data_get), e_table);
- g_signal_connect (
- G_OBJECT (e_table), "drag_data_delete",
- G_CALLBACK (et_drag_data_delete), e_table);
- g_signal_connect (
- G_OBJECT (e_table), "drag_motion",
- G_CALLBACK (et_drag_motion), e_table);
- g_signal_connect (
- G_OBJECT (e_table), "drag_leave",
- G_CALLBACK (et_drag_leave), e_table);
- g_signal_connect (
- G_OBJECT (e_table), "drag_drop",
- G_CALLBACK (et_drag_drop), e_table);
- g_signal_connect (
- G_OBJECT (e_table), "drag_data_received",
- G_CALLBACK (et_drag_data_received), e_table);
-
- g_signal_connect (G_OBJECT(e_table->table_canvas), "reflow",
- G_CALLBACK (table_canvas_reflow), e_table);
-
- gtk_widget_show (GTK_WIDGET (e_table->table_canvas));
-
-
- e_table->white_item = gnome_canvas_item_new(
- gnome_canvas_root(e_table->table_canvas),
- e_canvas_background_get_type(),
- "fill_color_gdk", &GTK_WIDGET(e_table->table_canvas)->style->base[GTK_STATE_NORMAL],
- NULL);
-
- g_signal_connect (G_OBJECT (e_table->white_item), "event",
- G_CALLBACK (white_item_event), e_table);
-
- g_signal_connect (G_OBJECT(e_table->table_canvas), "realize",
- G_CALLBACK(et_canvas_realize), e_table);
-
- g_signal_connect (G_OBJECT(gnome_canvas_root (e_table->table_canvas)), "event",
- G_CALLBACK(et_canvas_root_event), e_table);
-
- e_table->canvas_vbox = gnome_canvas_item_new(
- gnome_canvas_root(e_table->table_canvas),
- e_canvas_vbox_get_type(),
- "spacing", 10.0,
- NULL);
-
- et_build_groups(e_table);
-
- if (e_table->use_click_to_add) {
- e_table->click_to_add = gnome_canvas_item_new (
- GNOME_CANVAS_GROUP(e_table->canvas_vbox),
- e_table_click_to_add_get_type (),
- "header", e_table->header,
- "model", e_table->model,
- "message", e_table->click_to_add_message,
- NULL);
-
- if (e_table->use_click_to_add_end)
- e_canvas_vbox_add_item (
- E_CANVAS_VBOX(e_table->canvas_vbox),
- e_table->click_to_add);
- else
- e_canvas_vbox_add_item_start (
- E_CANVAS_VBOX(e_table->canvas_vbox),
- e_table->click_to_add);
-
- g_signal_connect (
- G_OBJECT (e_table->click_to_add), "cursor_change",
- G_CALLBACK (click_to_add_cursor_change), e_table);
- }
-}
-
-static void
-e_table_fill_table (ETable *e_table, ETableModel *model)
-{
- e_table_group_add_all (e_table->group);
-}
-
-/**
- * e_table_set_state_object:
- * @e_table: The #ETable object to modify
- * @state: The #ETableState to use
- *
- * This routine sets the state of the #ETable from the given
- * #ETableState.
- *
- **/
-void
-e_table_set_state_object(ETable *e_table, ETableState *state)
-{
- GValue *val = g_new0 (GValue, 1);
- g_value_init (val, G_TYPE_DOUBLE);
-
- connect_header (e_table, state);
-
- g_value_set_double (val, (double) (GTK_WIDGET(e_table->table_canvas)->allocation.width));
- g_object_set_property (G_OBJECT (e_table->header), "width", val);
- g_free (val);
-
- if (e_table->sort_info) {
- if (e_table->group_info_change_id)
- g_signal_handler_disconnect (G_OBJECT (e_table->sort_info),
- e_table->group_info_change_id);
- if (e_table->sort_info_change_id)
- g_signal_handler_disconnect (G_OBJECT (e_table->sort_info),
- e_table->sort_info_change_id);
- g_object_unref(e_table->sort_info);
- }
- if (state->sort_info) {
- e_table->sort_info = e_table_sort_info_duplicate(state->sort_info);
- e_table_sort_info_set_can_group (e_table->sort_info, e_table->allow_grouping);
- e_table->group_info_change_id =
- g_signal_connect (G_OBJECT (e_table->sort_info), "group_info_changed",
- G_CALLBACK (group_info_changed), e_table);
- e_table->sort_info_change_id =
- g_signal_connect (G_OBJECT (e_table->sort_info), "sort_info_changed",
- G_CALLBACK (sort_info_changed), e_table);
- }
- else
- e_table->sort_info = NULL;
-
- if (e_table->sorter)
- g_object_set(e_table->sorter,
- "sort_info", e_table->sort_info,
- NULL);
- if (e_table->header_item)
- g_object_set(e_table->header_item,
- "ETableHeader", e_table->header,
- "sort_info", e_table->sort_info,
- NULL);
- if (e_table->click_to_add)
- g_object_set(e_table->click_to_add,
- "header", e_table->header,
- NULL);
-
- e_table->need_rebuild = TRUE;
- if (!e_table->rebuild_idle_id)
- e_table->rebuild_idle_id = g_idle_add_full (20, changed_idle, e_table, NULL);
-}
-
-/**
- * e_table_set_state:
- * @e_table: The #ETable object to modify
- * @state_str: a string representing an #ETableState
- *
- * This routine sets the state of the #ETable from a string.
- *
- **/
-void
-e_table_set_state (ETable *e_table,
- const gchar *state_str)
-{
- ETableState *state;
-
- g_return_if_fail(e_table != NULL);
- g_return_if_fail(E_IS_TABLE(e_table));
- g_return_if_fail(state_str != NULL);
-
- state = e_table_state_new();
- e_table_state_load_from_string(state, state_str);
-
- if (state->col_count > 0)
- e_table_set_state_object(e_table, state);
-
- g_object_unref(state);
-}
-
-/**
- * e_table_load_state:
- * @e_table: The #ETable object to modify
- * @filename: name of the file to use
- *
- * This routine sets the state of the #ETable from a file.
- *
- **/
-void
-e_table_load_state (ETable *e_table,
- const gchar *filename)
-{
- ETableState *state;
-
- g_return_if_fail(e_table != NULL);
- g_return_if_fail(E_IS_TABLE(e_table));
- g_return_if_fail(filename != NULL);
-
- state = e_table_state_new();
- e_table_state_load_from_file(state, filename);
-
- if (state->col_count > 0)
- e_table_set_state_object(e_table, state);
-
- g_object_unref(state);
-}
-
-/**
- * e_table_get_state_object:
- * @e_table: #ETable object to act on
- *
- * Builds an #ETableState corresponding to the current state of the
- * #ETable.
- *
- * Return value:
- * The %ETableState object generated.
- **/
-ETableState *
-e_table_get_state_object (ETable *e_table)
-{
- ETableState *state;
- int full_col_count;
- int i, j;
-
- state = e_table_state_new();
- if (state->sort_info)
- g_object_unref (state->sort_info);
- state->sort_info = e_table->sort_info;
- g_object_ref(state->sort_info);
-
-
- state->col_count = e_table_header_count (e_table->header);
- full_col_count = e_table_header_count (e_table->full_header);
- state->columns = g_new(int, state->col_count);
- state->expansions = g_new(double, state->col_count);
- for (i = 0; i < state->col_count; i++) {
- ETableCol *col = e_table_header_get_column(e_table->header, i);
- state->columns[i] = -1;
- for (j = 0; j < full_col_count; j++) {
- if (col->col_idx == e_table_header_index(e_table->full_header, j)) {
- state->columns[i] = j;
- break;
- }
- }
- state->expansions[i] = col->expansion;
- }
-
- return state;
-}
-
-/**
- * e_table_get_state:
- * @e_table: The #ETable to act on.
- *
- * Builds a state object based on the current state and returns the
- * string corresponding to that state.
- *
- * Return value:
- * A string describing the current state of the #ETable.
- **/
-gchar *e_table_get_state (ETable *e_table)
-{
- ETableState *state;
- gchar *string;
-
- state = e_table_get_state_object(e_table);
- string = e_table_state_save_to_string(state);
- g_object_unref(state);
- return string;
-}
-
-/**
- * e_table_save_state:
- * @e_table: The #ETable to act on
- * @filename: name of the file to save to
- *
- * Saves the state of the @e_table object into the file pointed by
- * @filename.
- *
- **/
-void
-e_table_save_state (ETable *e_table,
- const gchar *filename)
-{
- ETableState *state;
-
- state = e_table_get_state_object(e_table);
- e_table_state_save_to_file(state, filename);
- g_object_unref(state);
-}
-
-static void
-et_selection_model_selection_changed (ETableGroup *etg, ETable *et)
-{
- g_signal_emit (G_OBJECT (et), et_signals [SELECTION_CHANGE], 0);
-}
-
-static void
-et_selection_model_selection_row_changed (ETableGroup *etg, int row, ETable *et)
-{
- g_signal_emit (G_OBJECT (et), et_signals [SELECTION_CHANGE], 0);
-}
-
-static ETable *
-et_real_construct (ETable *e_table, ETableModel *etm, ETableExtras *ete,
- ETableSpecification *specification, ETableState *state)
-{
- int row = 0;
- int col_count, i;
- GValue *val = g_new0 (GValue, 1);
- g_value_init (val, G_TYPE_OBJECT);
-
- if (ete)
- g_object_ref(ete);
- else {
- ete = e_table_extras_new();
- g_object_ref(ete);
- }
-
- e_table->domain = g_strdup (specification->domain);
-
- e_table->use_click_to_add = specification->click_to_add;
- e_table->use_click_to_add_end = specification->click_to_add_end;
- e_table->click_to_add_message = g_strdup (dgettext (e_table->domain, specification->click_to_add_message));
- e_table->alternating_row_colors = specification->alternating_row_colors;
- e_table->horizontal_draw_grid = specification->horizontal_draw_grid;
- e_table->vertical_draw_grid = specification->vertical_draw_grid;
- e_table->draw_focus = specification->draw_focus;
- e_table->cursor_mode = specification->cursor_mode;
- e_table->full_header = e_table_spec_to_full_header(specification, ete);
- g_object_ref (e_table->full_header);
-
- col_count = e_table_header_count (e_table->full_header);
- for (i = 0; i < col_count; i++) {
- ETableCol *col = e_table_header_get_column(e_table->full_header, i);
- if (col && col->search) {
- e_table->current_search_col = col;
- e_table->search_col_set = TRUE;
- break;
- }
- }
-
- e_table->model = etm;
- g_object_ref (etm);
-
- gtk_widget_push_colormap (gdk_rgb_get_cmap ());
-
- connect_header (e_table, state);
- e_table->horizontal_scrolling = specification->horizontal_scrolling;
- e_table->horizontal_resize = specification->horizontal_resize;
- e_table->allow_grouping = specification->allow_grouping;
-
- e_table->sort_info = state->sort_info;
- g_object_ref (state->sort_info);
- e_table_sort_info_set_can_group (e_table->sort_info, e_table->allow_grouping);
-
- e_table->group_info_change_id =
- g_signal_connect (G_OBJECT (e_table->sort_info), "group_info_changed",
- G_CALLBACK (group_info_changed), e_table);
-
- e_table->sort_info_change_id =
- g_signal_connect (G_OBJECT (e_table->sort_info), "sort_info_changed",
- G_CALLBACK (sort_info_changed), e_table);
-
-
- g_value_set_object (val, e_table->sort_info);
- g_object_set_property (G_OBJECT(e_table->header), "sort_info", val);
- g_free (val);
-
- e_table->sorter = e_table_sorter_new(etm, e_table->full_header, e_table->sort_info);
- g_object_ref (e_table->sorter);
-
- g_object_set (e_table->selection,
- "model", etm,
- "selection_mode", specification->selection_mode,
- "cursor_mode", specification->cursor_mode,
- "sorter", e_table->sorter,
- "header", e_table->header,
- NULL);
-
- g_signal_connect(e_table->selection, "selection_changed",
- G_CALLBACK (et_selection_model_selection_changed), e_table);
- g_signal_connect(e_table->selection, "selection_row_changed",
- G_CALLBACK (et_selection_model_selection_row_changed), e_table);
-
- if (!specification->no_headers) {
- e_table_setup_header (e_table);
- }
- e_table_setup_table (e_table, e_table->full_header, e_table->header, etm);
- e_table_fill_table (e_table, etm);
-
- gtk_layout_get_vadjustment (GTK_LAYOUT (e_table->table_canvas))->step_increment = 20;
- gtk_adjustment_changed(gtk_layout_get_vadjustment (GTK_LAYOUT (e_table->table_canvas)));
- gtk_layout_get_hadjustment (GTK_LAYOUT (e_table->table_canvas))->step_increment = 20;
- gtk_adjustment_changed(gtk_layout_get_hadjustment (GTK_LAYOUT (e_table->table_canvas)));
-
- if (!specification->no_headers) {
- /*
- * The header
- */
- gtk_table_attach (GTK_TABLE (e_table), GTK_WIDGET (e_table->header_canvas),
- 0, 1, 0 + row, 1 + row,
- GTK_FILL | GTK_EXPAND,
- GTK_FILL, 0, 0);
- row ++;
- }
- gtk_table_attach (GTK_TABLE (e_table), GTK_WIDGET (e_table->table_canvas),
- 0, 1, 0 + row, 1 + row,
- GTK_FILL | GTK_EXPAND,
- GTK_FILL | GTK_EXPAND,
- 0, 0);
-
- gtk_widget_pop_colormap ();
-
- g_object_unref(ete);
-
- return e_table;
-}
-
-/**
- * e_table_construct:
- * @e_table: The newly created #ETable object.
- * @etm: The model for this table.
- * @ete: An optional #ETableExtras. (%NULL is valid.)
- * @spec_str: The spec.
- * @state_str: An optional state. (%NULL is valid.)
- *
- * This is the internal implementation of e_table_new() for use by
- * subclasses or language bindings. See e_table_new() for details.
- *
- * Return value:
- * The passed in value @e_table or %NULL if there's an error.
- **/
-ETable *
-e_table_construct (ETable *e_table, ETableModel *etm, ETableExtras *ete,
- const char *spec_str, const char *state_str)
-{
- ETableSpecification *specification;
- ETableState *state;
-
- g_return_val_if_fail(e_table != NULL, NULL);
- g_return_val_if_fail(E_IS_TABLE(e_table), NULL);
- g_return_val_if_fail(etm != NULL, NULL);
- g_return_val_if_fail(E_IS_TABLE_MODEL(etm), NULL);
- g_return_val_if_fail(ete == NULL || E_IS_TABLE_EXTRAS(ete), NULL);
- g_return_val_if_fail(spec_str != NULL, NULL);
-
- g_object_ref (etm);
-
- specification = e_table_specification_new();
- g_object_ref (specification);
- if (!e_table_specification_load_from_string(specification, spec_str)) {
- g_object_unref(specification);
- return NULL;
- }
-
- if (state_str) {
- state = e_table_state_new();
- g_object_ref (state);
- e_table_state_load_from_string(state, state_str);
- if (state->col_count <= 0) {
- g_object_unref(state);
- state = specification->state;
- g_object_ref(state);
- }
- } else {
- state = specification->state;
- g_object_ref(state);
- }
-
- e_table = et_real_construct (e_table, etm, ete, specification, state);
-
- e_table->spec = specification;
- g_object_unref(state);
-
- return e_table;
-}
-
-/**
- * e_table_construct_from_spec_file:
- * @e_table: The newly created #ETable object.
- * @etm: The model for this table.
- * @ete: An optional #ETableExtras. (%NULL is valid.)
- * @spec_fn: The filename of the spec.
- * @state_fn: An optional state file. (%NULL is valid.)
- *
- * This is the internal implementation of e_table_new_from_spec_file()
- * for use by subclasses or language bindings. See
- * e_table_new_from_spec_file() for details.
- *
- * Return value:
- * The passed in value @e_table or %NULL if there's an error.
- **/
-ETable *
-e_table_construct_from_spec_file (ETable *e_table, ETableModel *etm, ETableExtras *ete,
- const char *spec_fn, const char *state_fn)
-{
- ETableSpecification *specification;
- ETableState *state;
-
- g_return_val_if_fail(e_table != NULL, NULL);
- g_return_val_if_fail(E_IS_TABLE(e_table), NULL);
- g_return_val_if_fail(etm != NULL, NULL);
- g_return_val_if_fail(E_IS_TABLE_MODEL(etm), NULL);
- g_return_val_if_fail(ete == NULL || E_IS_TABLE_EXTRAS(ete), NULL);
- g_return_val_if_fail(spec_fn != NULL, NULL);
-
- specification = e_table_specification_new();
- if (!e_table_specification_load_from_file(specification, spec_fn)) {
- g_object_unref(specification);
- return NULL;
- }
-
- if (state_fn) {
- state = e_table_state_new();
- if (!e_table_state_load_from_file(state, state_fn)) {
- g_object_unref(state);
- state = specification->state;
- g_object_ref(state);
- }
- if (state->col_count <= 0) {
- g_object_unref(state);
- state = specification->state;
- g_object_ref(state);
- }
- } else {
- state = specification->state;
- g_object_ref(state);
- }
-
- e_table = et_real_construct (e_table, etm, ete, specification, state);
-
- e_table->spec = specification;
- g_object_unref(state);
-
- return e_table;
-}
-
-/**
- * e_table_new:
- * @etm: The model for this table.
- * @ete: An optional #ETableExtras. (%NULL is valid.)
- * @spec: The spec.
- * @state: An optional state. (%NULL is valid.)
- *
- * This function creates an #ETable from the given parameters. The
- * #ETableModel is a table model to be represented. The #ETableExtras
- * is an optional set of pixbufs, cells, and sorting functions to be
- * used when interpreting the spec. If you pass in %NULL it uses the
- * default #ETableExtras. (See e_table_extras_new()).
- *
- * @spec is the specification of the set of viewable columns and the
- * default sorting state and such. @state is an optional string
- * specifying the current sorting state and such. If @state is NULL,
- * then the default state from the spec will be used.
- *
- * Return value:
- * The newly created #ETable or %NULL if there's an error.
- **/
-GtkWidget *
-e_table_new (ETableModel *etm, ETableExtras *ete, const char *spec, const char *state)
-{
- ETable *e_table;
-
- g_return_val_if_fail(etm != NULL, NULL);
- g_return_val_if_fail(E_IS_TABLE_MODEL(etm), NULL);
- g_return_val_if_fail(ete == NULL || E_IS_TABLE_EXTRAS(ete), NULL);
- g_return_val_if_fail(spec != NULL, NULL);
-
- e_table = g_object_new (E_TABLE_TYPE, NULL);
-
- e_table = e_table_construct (e_table, etm, ete, spec, state);
-
- return GTK_WIDGET (e_table);
-}
-
-/**
- * e_table_new_from_spec_file:
- * @etm: The model for this table.
- * @ete: An optional #ETableExtras. (%NULL is valid.)
- * @spec_fn: The filename of the spec.
- * @state_fn: An optional state file. (%NULL is valid.)
- *
- * This is very similar to e_table_new(), except instead of passing in
- * strings you pass in the file names of the spec and state to load.
- *
- * @spec_fn is the filename of the spec to load. If this file doesn't
- * exist, e_table_new_from_spec_file will return %NULL.
- *
- * @state_fn is the filename of the initial state to load. If this is
- * %NULL or if the specified file doesn't exist, the default state
- * from the spec file is used.
- *
- * Return value:
- * The newly created #ETable or %NULL if there's an error.
- **/
-GtkWidget *
-e_table_new_from_spec_file (ETableModel *etm, ETableExtras *ete, const char *spec_fn, const char *state_fn)
-{
- ETable *e_table;
-
- g_return_val_if_fail(etm != NULL, NULL);
- g_return_val_if_fail(E_IS_TABLE_MODEL(etm), NULL);
- g_return_val_if_fail(ete == NULL || E_IS_TABLE_EXTRAS(ete), NULL);
- g_return_val_if_fail(spec_fn != NULL, NULL);
-
- e_table = g_object_new (E_TABLE_TYPE, NULL);
-
- e_table = e_table_construct_from_spec_file (e_table, etm, ete, spec_fn, state_fn);
-
- return GTK_WIDGET (e_table);
-}
-
-#if 0
-static xmlNode *
-et_build_column_spec (ETable *e_table)
-{
- xmlNode *columns_shown;
- gint i;
- gint col_count;
-
- columns_shown = xmlNewNode (NULL, "columns-shown");
-
- col_count = e_table_header_count (e_table->header);
- for (i = 0; i < col_count; i++){
- gchar *text = g_strdup_printf ("%d", e_table_header_index(e_table->header, i));
- xmlNewChild (columns_shown, NULL, "column", text);
- g_free (text);
- }
-
- return columns_shown;
-}
-
-static xmlNode *
-et_build_grouping_spec (ETable *e_table)
-{
- xmlNode *node;
- xmlNode *grouping;
- int i;
- const int sort_count = e_table_sort_info_sorting_get_count (e_table->sort_info);
- const int group_count = e_table_sort_info_grouping_get_count (e_table->sort_info);
-
- grouping = xmlNewNode (NULL, "grouping");
- node = grouping;
-
- for (i = 0; i < group_count; i++) {
- ETableSortColumn column = e_table_sort_info_grouping_get_nth(e_table->sort_info, i);
- xmlNode *new_node = xmlNewChild(node, NULL, "group", NULL);
-
- e_xml_set_integer_prop_by_name (new_node, "column", column.column);
- e_xml_set_integer_prop_by_name (new_node, "ascending", column.ascending);
- node = new_node;
- }
-
- for (i = 0; i < sort_count; i++) {
- ETableSortColumn column = e_table_sort_info_sorting_get_nth(e_table->sort_info, i);
- xmlNode *new_node = xmlNewChild(node, NULL, "leaf", NULL);
-
- e_xml_set_integer_prop_by_name (new_node, "column", column.column);
- e_xml_set_integer_prop_by_name (new_node, "ascending", column.ascending);
- node = new_node;
- }
-
- return grouping;
-}
-
-static xmlDoc *
-et_build_tree (ETable *e_table)
-{
- xmlDoc *doc;
- xmlNode *root;
-
- doc = xmlNewDoc ("1.0");
- if (doc == NULL)
- return NULL;
-
- root = xmlNewDocNode (doc, NULL, "ETableSpecification", NULL);
- xmlDocSetRootElement (doc, root);
- xmlAddChild (root, et_build_column_spec (e_table));
- xmlAddChild (root, et_build_grouping_spec (e_table));
-
- return doc;
-}
-
-gchar *
-e_table_get_specification (ETable *e_table)
-{
- xmlDoc *doc;
- xmlChar *buffer;
- gint size;
-
- g_return_val_if_fail(e_table != NULL, NULL);
- g_return_val_if_fail(E_IS_TABLE(e_table), NULL);
-
- doc = et_build_tree (e_table);
- xmlDocDumpMemory (doc, &buffer, &size);
- xmlFreeDoc (doc);
-
- return buffer;
-}
-
-int
-e_table_set_specification (ETable *e_table, const char *spec)
-{
- xmlDoc *xmlSpec;
- int ret;
-
- g_return_val_if_fail(e_table != NULL, -1);
- g_return_val_if_fail(E_IS_TABLE(e_table), -1);
- g_return_val_if_fail(spec != NULL, -1);
-
- /* doesn't work yet, sigh */
- xmlSpec = xmlParseMemory ((char *)spec, strlen(spec));
- ret = et_real_set_specification(e_table, xmlSpec);
- xmlFreeDoc (xmlSpec);
-
- return ret;
-}
-
-void
-e_table_save_specification (ETable *e_table, const char *filename)
-{
- xmlDoc *doc = et_build_tree (e_table);
-
- g_return_if_fail(e_table != NULL);
- g_return_if_fail(E_IS_TABLE(e_table));
- g_return_if_fail(filename != NULL);
-
- e_xml_save_file (filename, doc);
-
- xmlFreeDoc (doc);
-}
-
-int
-e_table_load_specification (ETable *e_table, gchar *filename)
-{
- xmlDoc *xmlSpec;
- int ret;
-
- g_return_val_if_fail(e_table != NULL, -1);
- g_return_val_if_fail(E_IS_TABLE(e_table), -1);
- g_return_val_if_fail(filename != NULL, -1);
-
- /* doesn't work yet, yay */
- xmlSpec = xmlParseFile (filename);
- ret = et_real_set_specification(e_table, xmlSpec);
- xmlFreeDoc (xmlSpec);
-
- return ret;
-}
-#endif
-
-/**
- * e_table_set_cursor_row:
- * @e_table: The #ETable to set the cursor row of
- * @row: The row number
- *
- * Sets the cursor row and the selection to the given row number.
- **/
-void
-e_table_set_cursor_row (ETable *e_table, int row)
-{
- g_return_if_fail(e_table != NULL);
- g_return_if_fail(E_IS_TABLE(e_table));
- g_return_if_fail(row >= 0);
-
- g_object_set(e_table->selection,
- "cursor_row", row,
- NULL);
-}
-
-/**
- * e_table_get_cursor_row:
- * @e_table: The #ETable to query
- *
- * Calculates the cursor row. -1 means that we don't have a cursor.
- *
- * Return value:
- * Cursor row
- **/
-int
-e_table_get_cursor_row (ETable *e_table)
-{
- int row;
- g_return_val_if_fail(e_table != NULL, -1);
- g_return_val_if_fail(E_IS_TABLE(e_table), -1);
-
- g_object_get(e_table->selection,
- "cursor_row", &row,
- NULL);
- return row;
-}
-
-/**
- * e_table_selected_row_foreach:
- * @e_table: The #ETable to act on
- * @callback: The callback function to call
- * @closure: The value passed to the callback's closure argument
- *
- * Calls the given @callback function once for every selected row.
- *
- * If you change the selection or delete or add rows to the table
- * during these callbacks, problems can occur. A standard thing to do
- * is to create a list of rows or objects the function is called upon
- * and then act upon that list. (In inverse order if it's rows.)
- **/
-void
-e_table_selected_row_foreach (ETable *e_table,
- EForeachFunc callback,
- gpointer closure)
-{
- g_return_if_fail(e_table != NULL);
- g_return_if_fail(E_IS_TABLE(e_table));
-
- e_selection_model_foreach(E_SELECTION_MODEL (e_table->selection),
- callback,
- closure);
-}
-
-/**
- * e_table_selected_count:
- * @e_table: The #ETable to query
- *
- * Counts the number of selected rows.
- *
- * Return value:
- * The number of rows selected.
- **/
-gint
-e_table_selected_count (ETable *e_table)
-{
- g_return_val_if_fail(e_table != NULL, -1);
- g_return_val_if_fail(E_IS_TABLE(e_table), -1);
-
- return e_selection_model_selected_count(E_SELECTION_MODEL (e_table->selection));
-}
-
-/**
- * e_table_select_all:
- * @table: The #ETable to modify
- *
- * Selects all the rows in @table.
- **/
-void
-e_table_select_all (ETable *table)
-{
- g_return_if_fail (table != NULL);
- g_return_if_fail (E_IS_TABLE (table));
-
- e_selection_model_select_all (E_SELECTION_MODEL (table->selection));
-}
-
-/**
- * e_table_invert_selection:
- * @table: The #ETable to modify
- *
- * Inverts the selection in @table.
- **/
-void
-e_table_invert_selection (ETable *table)
-{
- g_return_if_fail (table != NULL);
- g_return_if_fail (E_IS_TABLE (table));
-
- e_selection_model_invert_selection (E_SELECTION_MODEL (table->selection));
-}
-
-
-/**
- * e_table_get_printable:
- * @e_table: #ETable to query
- *
- * Used for printing your #ETable.
- *
- * Return value:
- * The #EPrintable to print.
- **/
-EPrintable *
-e_table_get_printable (ETable *e_table)
-{
- g_return_val_if_fail(e_table != NULL, NULL);
- g_return_val_if_fail(E_IS_TABLE(e_table), NULL);
-
- return e_table_group_get_printable(e_table->group);
-}
-
-/**
- * e_table_right_click_up:
- * @table: The #ETable to modify.
- *
- * Call this function when you're done handling the right click if you
- * return TRUE from the "right_click" signal.
- **/
-void
-e_table_right_click_up (ETable *table)
-{
- e_selection_model_right_click_up(E_SELECTION_MODEL(table->selection));
-}
-
-/**
- * e_table_commit_click_to_add:
- * @table: The #ETable to modify
- *
- * Commits the current values in the click to add to the table.
- **/
-void
-e_table_commit_click_to_add (ETable *table)
-{
- et_eti_leave_edit (table);
- if (table->click_to_add)
- e_table_click_to_add_commit(E_TABLE_CLICK_TO_ADD(table->click_to_add));
-}
-
-static void
-et_get_property (GObject *object,
- guint prop_id,
- GValue *value,
- GParamSpec *pspec)
-{
- ETable *etable = E_TABLE (object);
-
- switch (prop_id){
- case PROP_MODEL:
- g_value_set_object (value, etable->model);
- break;
- case PROP_UNIFORM_ROW_HEIGHT:
- g_value_set_boolean (value, etable->uniform_row_height);
- break;
- case PROP_ALWAYS_SEARCH:
- g_value_set_boolean (value, etable->always_search);
- break;
- case PROP_USE_CLICK_TO_ADD:
- g_value_set_boolean (value, etable->use_click_to_add);
- break;
- default:
- break;
- }
-}
-
-typedef struct {
- char *arg;
- gboolean setting;
-} bool_closure;
-
-static void
-et_set_property (GObject *object,
- guint prop_id,
- const GValue *value,
- GParamSpec *pspec)
-{
- ETable *etable = E_TABLE (object);
-
- switch (prop_id){
- case PROP_LENGTH_THRESHOLD:
- etable->length_threshold = g_value_get_int (value);
- if (etable->group) {
- gnome_canvas_item_set (GNOME_CANVAS_ITEM(etable->group),
- "length_threshold", etable->length_threshold,
- NULL);
- }
- break;
- case PROP_UNIFORM_ROW_HEIGHT:
- etable->uniform_row_height = g_value_get_boolean (value);
- if (etable->group) {
- gnome_canvas_item_set (GNOME_CANVAS_ITEM(etable->group),
- "uniform_row_height", etable->uniform_row_height,
- NULL);
- }
- break;
- case PROP_ALWAYS_SEARCH:
- if (etable->always_search == g_value_get_boolean (value))
- return;
-
- etable->always_search = g_value_get_boolean (value);
- clear_current_search_col (etable);
- break;
- case PROP_USE_CLICK_TO_ADD:
- if (etable->use_click_to_add == g_value_get_boolean (value))
- return;
-
- etable->use_click_to_add = g_value_get_boolean (value);
- clear_current_search_col (etable);
-
- if (etable->use_click_to_add) {
- etable->click_to_add = gnome_canvas_item_new
- (GNOME_CANVAS_GROUP(etable->canvas_vbox),
- e_table_click_to_add_get_type (),
- "header", etable->header,
- "model", etable->model,
- "message", etable->click_to_add_message,
- NULL);
-
- if (etable->use_click_to_add_end)
- e_canvas_vbox_add_item (E_CANVAS_VBOX(etable->canvas_vbox),
- etable->click_to_add);
- else
- e_canvas_vbox_add_item_start (E_CANVAS_VBOX(etable->canvas_vbox),
- etable->click_to_add);
-
- g_signal_connect (G_OBJECT (etable->click_to_add), "cursor_change",
- G_CALLBACK (click_to_add_cursor_change), etable);
- } else {
- gtk_object_destroy (GTK_OBJECT (etable->click_to_add));
- etable->click_to_add = NULL;
- }
- break;
- }
-}
-
-static void
-set_scroll_adjustments (ETable *table,
- GtkAdjustment *hadjustment,
- GtkAdjustment *vadjustment)
-{
- if (vadjustment != NULL) {
- vadjustment->step_increment = 20;
- gtk_adjustment_changed(vadjustment);
- }
- if (hadjustment != NULL) {
- hadjustment->step_increment = 20;
- gtk_adjustment_changed(hadjustment);
- }
-
- if (table->table_canvas != NULL) {
- gtk_layout_set_hadjustment (GTK_LAYOUT(table->table_canvas),
- hadjustment);
- gtk_layout_set_vadjustment (GTK_LAYOUT(table->table_canvas),
- vadjustment);
- }
-
- if (table->header_canvas != NULL)
- gtk_layout_set_hadjustment (GTK_LAYOUT(table->header_canvas),
- hadjustment);
-}
-
-/**
- * e_table_get_next_row:
- * @e_table: The #ETable to query
- * @model_row: The model row to go from
- *
- * This function is used when your table is sorted, but you're using
- * model row numbers. It returns the next row in sorted order as a model row.
- *
- * Return value:
- * The model row number.
- **/
-gint
-e_table_get_next_row (ETable *e_table,
- gint model_row)
-{
- g_return_val_if_fail(e_table != NULL, -1);
- g_return_val_if_fail(E_IS_TABLE(e_table), -1);
-
- if (e_table->sorter) {
- int i;
- i = e_sorter_model_to_sorted(E_SORTER (e_table->sorter), model_row);
- i++;
- if (i < e_table_model_row_count(e_table->model)) {
- return e_sorter_sorted_to_model(E_SORTER (e_table->sorter), i);
- } else
- return -1;
- } else
- if (model_row < e_table_model_row_count(e_table->model) - 1)
- return model_row + 1;
- else
- return -1;
-}
-
-/**
- * e_table_get_prev_row:
- * @e_table: The #ETable to query
- * @model_row: The model row to go from
- *
- * This function is used when your table is sorted, but you're using
- * model row numbers. It returns the previous row in sorted order as
- * a model row.
- *
- * Return value:
- * The model row number.
- **/
-gint
-e_table_get_prev_row (ETable *e_table,
- gint model_row)
-{
- g_return_val_if_fail(e_table != NULL, -1);
- g_return_val_if_fail(E_IS_TABLE(e_table), -1);
-
- if (e_table->sorter) {
- int i;
- i = e_sorter_model_to_sorted(E_SORTER (e_table->sorter), model_row);
- i--;
- if (i >= 0)
- return e_sorter_sorted_to_model(E_SORTER (e_table->sorter), i);
- else
- return -1;
- } else
- return model_row - 1;
-}
-
-/**
- * e_table_model_to_view_row:
- * @e_table: The #ETable to query
- * @model_row: The model row number
- *
- * Turns a model row into a view row.
- *
- * Return value:
- * The view row number.
- **/
-gint
-e_table_model_to_view_row (ETable *e_table,
- gint model_row)
-{
- g_return_val_if_fail(e_table != NULL, -1);
- g_return_val_if_fail(E_IS_TABLE(e_table), -1);
-
- if (e_table->sorter)
- return e_sorter_model_to_sorted(E_SORTER (e_table->sorter), model_row);
- else
- return model_row;
-}
-
-/**
- * e_table_view_to_model_row:
- * @e_table: The #ETable to query
- * @view_row: The view row number
- *
- * Turns a view row into a model row.
- *
- * Return value:
- * The model row number.
- **/
-gint
-e_table_view_to_model_row (ETable *e_table,
- gint view_row)
-{
- g_return_val_if_fail(e_table != NULL, -1);
- g_return_val_if_fail(E_IS_TABLE(e_table), -1);
-
- if (e_table->sorter)
- return e_sorter_sorted_to_model (E_SORTER (e_table->sorter), view_row);
- else
- return view_row;
-}
-
-/**
- * e_table_get_cell_at:
- * @table: An #ETable widget
- * @x: X coordinate for the pixel
- * @y: Y coordinate for the pixel
- * @row_return: Pointer to return the row value
- * @col_return: Pointer to return the column value
- *
- * Return the row and column for the cell in which the pixel at (@x, @y) is
- * contained.
- **/
-void
-e_table_get_cell_at (ETable *table,
- int x, int y,
- int *row_return, int *col_return)
-{
- g_return_if_fail (table != NULL);
- g_return_if_fail (E_IS_TABLE (table));
- g_return_if_fail (row_return != NULL);
- g_return_if_fail (col_return != NULL);
-
- /* FIXME it would be nice if it could handle a NULL row_return or
- * col_return gracefully. */
-
- x += GTK_LAYOUT(table->table_canvas)->hadjustment->value;
- y += GTK_LAYOUT(table->table_canvas)->vadjustment->value;
- e_table_group_compute_location(table->group, &x, &y, row_return, col_return);
-}
-
-/**
- * e_table_get_cell_geometry:
- * @table: The #ETable.
- * @row: The row to get the geometry of.
- * @col: The col to get the geometry of.
- * @x_return: Returns the x coordinate of the upper left hand corner of the cell with respect to the widget.
- * @y_return: Returns the y coordinate of the upper left hand corner of the cell with respect to the widget.
- * @width_return: Returns the width of the cell.
- * @height_return: Returns the height of the cell.
- *
- * Returns the x, y, width, and height of the given cell. These can
- * all be #NULL and they just won't be set.
- **/
-void
-e_table_get_cell_geometry (ETable *table,
- int row, int col,
- int *x_return, int *y_return,
- int *width_return, int *height_return)
-{
- g_return_if_fail (table != NULL);
- g_return_if_fail (E_IS_TABLE (table));
-
- e_table_group_get_cell_geometry(table->group, &row, &col, x_return, y_return, width_return, height_return);
-
- if (x_return)
- (*x_return) -= GTK_LAYOUT(table->table_canvas)->hadjustment->value;
- if (y_return) {
- (*y_return) -= GTK_LAYOUT(table->table_canvas)->vadjustment->value;
- (*y_return) += GTK_WIDGET(table->header_canvas)->allocation.height;
- }
-}
-
-/**
- * e_table_get_selection_model:
- * @table: The #ETable to query
- *
- * Returns the table's #ESelectionModel in case you want to access it
- * directly.
- *
- * Return value:
- * The #ESelectionModel.
- **/
-ESelectionModel *
-e_table_get_selection_model (ETable *table)
-{
- g_return_val_if_fail (table != NULL, NULL);
- g_return_val_if_fail (E_IS_TABLE (table), NULL);
-
- return E_SELECTION_MODEL (table->selection);
-}
-
-struct _ETableDragSourceSite
-{
- GdkModifierType start_button_mask;
- GtkTargetList *target_list; /* Targets for drag data */
- GdkDragAction actions; /* Possible actions */
- GdkColormap *colormap; /* Colormap for drag icon */
- GdkPixmap *pixmap; /* Icon for drag data */
- GdkBitmap *mask;
-
- /* Stored button press information to detect drag beginning */
- gint state;
- gint x, y;
- gint row, col;
-};
-
-typedef enum
-{
- GTK_DRAG_STATUS_DRAG,
- GTK_DRAG_STATUS_WAIT,
- GTK_DRAG_STATUS_DROP
-} GtkDragStatus;
-
-typedef struct _GtkDragDestInfo GtkDragDestInfo;
-typedef struct _GtkDragSourceInfo GtkDragSourceInfo;
-
-struct _GtkDragDestInfo
-{
- GtkWidget *widget; /* Widget in which drag is in */
- GdkDragContext *context; /* Drag context */
- GtkDragSourceInfo *proxy_source; /* Set if this is a proxy drag */
- GtkSelectionData *proxy_data; /* Set while retrieving proxied data */
- gboolean dropped : 1; /* Set after we receive a drop */
- guint32 proxy_drop_time; /* Timestamp for proxied drop */
- gboolean proxy_drop_wait : 1; /* Set if we are waiting for a
- * status reply before sending
- * a proxied drop on.
- */
- gint drop_x, drop_y; /* Position of drop */
-};
-
-struct _GtkDragSourceInfo
-{
- GtkWidget *widget;
- GtkTargetList *target_list; /* Targets for drag data */
- GdkDragAction possible_actions; /* Actions allowed by source */
- GdkDragContext *context; /* drag context */
- GtkWidget *icon_window; /* Window for drag */
- GtkWidget *ipc_widget; /* GtkInvisible for grab, message passing */
- GdkCursor *cursor; /* Cursor for drag */
- gint hot_x, hot_y; /* Hot spot for drag */
- gint button; /* mouse button starting drag */
-
- GtkDragStatus status; /* drag status */
- GdkEvent *last_event; /* motion event waiting for response */
-
- gint start_x, start_y; /* Initial position */
- gint cur_x, cur_y; /* Current Position */
-
- GList *selections; /* selections we've claimed */
-
- GtkDragDestInfo *proxy_dest; /* Set if this is a proxy drag */
-
- guint drop_timeout; /* Timeout for aborting drop */
- guint destroy_icon : 1; /* If true, destroy icon_window
- */
-};
-
-/* Drag & drop stuff. */
-/* Target */
-
-/**
- * e_table_drag_get_data:
- * @table:
- * @row:
- * @col:
- * @context:
- * @target:
- * @time:
- *
- *
- **/
-void
-e_table_drag_get_data (ETable *table,
- int row,
- int col,
- GdkDragContext *context,
- GdkAtom target,
- guint32 time)
-{
- g_return_if_fail(table != NULL);
- g_return_if_fail(E_IS_TABLE(table));
-
- gtk_drag_get_data(GTK_WIDGET(table),
- context,
- target,
- time);
-}
-
-/**
- * e_table_drag_highlight:
- * @table: The #ETable to highlight
- * @row: The row number of the cell to highlight
- * @col: The column number of the cell to highlight
- *
- * Set col to -1 to highlight the entire row. If row is -1, this is
- * identical to e_table_drag_unhighlight().
- **/
-void
-e_table_drag_highlight (ETable *table,
- int row,
- int col)
-{
- g_return_if_fail(table != NULL);
- g_return_if_fail(E_IS_TABLE(table));
-
- if (row != -1) {
- int x, y, width, height;
- if (col == -1) {
- e_table_get_cell_geometry (table, row, 0, &x, &y, &width, &height);
- x = 0;
- width = GTK_WIDGET (table->table_canvas)->allocation.width;
- } else {
- e_table_get_cell_geometry (table, row, col, &x, &y, &width, &height);
- x += GTK_LAYOUT(table->table_canvas)->hadjustment->value;
- }
- y += GTK_LAYOUT(table->table_canvas)->vadjustment->value;
-
- if (table->drop_highlight == NULL) {
- table->drop_highlight =
- gnome_canvas_item_new (gnome_canvas_root (table->table_canvas),
- gnome_canvas_rect_get_type (),
- "fill_color", NULL,
- /* "outline_color", "black",
- "width_pixels", 1,*/
- "outline_color_gdk", &(GTK_WIDGET (table)->style->fg[GTK_STATE_NORMAL]),
- NULL);
- }
- gnome_canvas_item_set (table->drop_highlight,
- "x1", (double) x,
- "x2", (double) x + width - 1,
- "y1", (double) y,
- "y2", (double) y + height - 1,
- NULL);
- } else {
- if (table->drop_highlight) {
- gtk_object_destroy (GTK_OBJECT (table->drop_highlight));
- table->drop_highlight = NULL;
- }
- }
-}
-
-/**
- * e_table_drag_unhighlight:
- * @table: The #ETable to unhighlight
- *
- * Removes the highlight from an #ETable.
- **/
-void
-e_table_drag_unhighlight (ETable *table)
-{
- g_return_if_fail(table != NULL);
- g_return_if_fail(E_IS_TABLE(table));
-
- if (table->drop_highlight) {
- gtk_object_destroy (GTK_OBJECT (table->drop_highlight));
- table->drop_highlight = NULL;
- }
-}
-
-void e_table_drag_dest_set (ETable *table,
- GtkDestDefaults flags,
- const GtkTargetEntry *targets,
- gint n_targets,
- GdkDragAction actions)
-{
- g_return_if_fail(table != NULL);
- g_return_if_fail(E_IS_TABLE(table));
-
- gtk_drag_dest_set(GTK_WIDGET(table),
- flags,
- targets,
- n_targets,
- actions);
-}
-
-void e_table_drag_dest_set_proxy (ETable *table,
- GdkWindow *proxy_window,
- GdkDragProtocol protocol,
- gboolean use_coordinates)
-{
- g_return_if_fail(table != NULL);
- g_return_if_fail(E_IS_TABLE(table));
-
- gtk_drag_dest_set_proxy(GTK_WIDGET(table),
- proxy_window,
- protocol,
- use_coordinates);
-}
-
-/*
- * There probably should be functions for setting the targets
- * as a GtkTargetList
- */
-
-void
-e_table_drag_dest_unset (GtkWidget *widget)
-{
- g_return_if_fail(widget != NULL);
- g_return_if_fail(E_IS_TABLE(widget));
-
- gtk_drag_dest_unset(widget);
-}
-
-/* Source side */
-
-static gint
-et_real_start_drag (ETable *table, int row, int col, GdkEvent *event)
-{
- GtkDragSourceInfo *info;
- GdkDragContext *context;
- ETableDragSourceSite *site;
-
- if (table->do_drag) {
- site = table->site;
-
- site->state = 0;
- context = e_table_drag_begin (table, row, col,
- site->target_list,
- site->actions,
- 1, event);
-
- if (context) {
- info = g_dataset_get_data (context, "gtk-info");
-
- if (info && !info->icon_window) {
- if (site->pixmap)
- gtk_drag_set_icon_pixmap (context,
- site->colormap,
- site->pixmap,
- site->mask, -2, -2);
- else
- gtk_drag_set_icon_default (context);
- }
- }
- return TRUE;
- }
- return FALSE;
-}
-
-/**
- * e_table_drag_source_set:
- * @table: The #ETable to set up as a drag site
- * @start_button_mask: Mask of allowed buttons to start drag
- * @targets: Table of targets for this source
- * @n_targets: Number of targets in @targets
- * @actions: Actions allowed for this source
- *
- * Registers this table as a drag site, and possibly adds default behaviors.
- **/
-void
-e_table_drag_source_set (ETable *table,
- GdkModifierType start_button_mask,
- const GtkTargetEntry *targets,
- gint n_targets,
- GdkDragAction actions)
-{
- ETableDragSourceSite *site;
- GtkWidget *canvas;
-
- g_return_if_fail(table != NULL);
- g_return_if_fail(E_IS_TABLE(table));
-
- canvas = GTK_WIDGET(table->table_canvas);
- site = table->site;
-
- gtk_widget_add_events (canvas,
- gtk_widget_get_events (canvas) |
- GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK |
- GDK_BUTTON_MOTION_MASK | GDK_STRUCTURE_MASK);
-
- table->do_drag = TRUE;
-
- if (site) {
- if (site->target_list)
- gtk_target_list_unref (site->target_list);
- } else {
- site = g_new0 (ETableDragSourceSite, 1);
- table->site = site;
- }
-
- site->start_button_mask = start_button_mask;
-
- if (targets)
- site->target_list = gtk_target_list_new (targets, n_targets);
- else
- site->target_list = NULL;
-
- site->actions = actions;
-}
-
-/**
- * e_table_drag_source_unset:
- * @table: The #ETable to un set up as a drag site
- *
- * Unregisters this #ETable as a drag site.
- **/
-void
-e_table_drag_source_unset (ETable *table)
-{
- ETableDragSourceSite *site;
-
- g_return_if_fail (table != NULL);
- g_return_if_fail (E_IS_TABLE(table));
-
- site = table->site;
-
- if (site) {
- g_free (site);
- table->site = NULL;
- }
- table->do_drag = FALSE;
-}
-
-/* There probably should be functions for setting the targets
- * as a GtkTargetList
- */
-
-/**
- * e_table_drag_begin:
- * @table: The #ETable to drag from
- * @row: The row number of the cell
- * @col: The col number of the cell
- * @targets: The list of targets supported by the drag
- * @actions: The available actions supported by the drag
- * @button: The button held down for the drag
- * @event: The event that initiated the drag
- *
- * Start a drag from this cell.
- *
- * Return value:
- * The drag context.
- **/
-GdkDragContext *
-e_table_drag_begin (ETable *table,
- int row,
- int col,
- GtkTargetList *targets,
- GdkDragAction actions,
- gint button,
- GdkEvent *event)
-{
- g_return_val_if_fail (table != NULL, NULL);
- g_return_val_if_fail (E_IS_TABLE(table), NULL);
-
- table->drag_row = row;
- table->drag_col = col;
-
- return gtk_drag_begin(GTK_WIDGET(table),
- targets,
- actions,
- button,
- event);
-}
-
-static void
-et_drag_begin (GtkWidget *widget,
- GdkDragContext *context,
- ETable *et)
-{
- g_signal_emit (G_OBJECT (et), et_signals [TABLE_DRAG_BEGIN], 0,
- et->drag_row, et->drag_col, context);
-}
-
-static void
-et_drag_end (GtkWidget *widget,
- GdkDragContext *context,
- ETable *et)
-{
- g_signal_emit (G_OBJECT (et), et_signals [TABLE_DRAG_END], 0,
- et->drag_row, et->drag_col, context);
-}
-
-static void
-et_drag_data_get(GtkWidget *widget,
- GdkDragContext *context,
- GtkSelectionData *selection_data,
- guint info,
- guint time,
- ETable *et)
-{
- g_signal_emit (G_OBJECT (et), et_signals [TABLE_DRAG_DATA_GET], 0,
- et->drag_row, et->drag_col, context, selection_data,
- info, time);
-}
-
-static void
-et_drag_data_delete(GtkWidget *widget,
- GdkDragContext *context,
- ETable *et)
-{
- g_signal_emit (G_OBJECT (et), et_signals [TABLE_DRAG_DATA_DELETE], 0,
- et->drag_row, et->drag_col, context);
-}
-
-static gboolean
-do_drag_motion(ETable *et,
- GdkDragContext *context,
- gint x,
- gint y,
- guint time)
-{
- gboolean ret_val;
- int row = -1, col = -1;
- GtkWidget *widget;
-
- widget = GTK_WIDGET (et);
-
- e_table_get_cell_at (et, x, y, &row, &col);
-
- if (row != et->drop_row && col != et->drop_row) {
- g_signal_emit (G_OBJECT (et), et_signals [TABLE_DRAG_LEAVE], 0,
- et->drop_row, et->drop_col, context, time);
- }
- et->drop_row = row;
- et->drop_col = col;
- g_signal_emit (G_OBJECT (et), et_signals [TABLE_DRAG_MOTION], 0,
- et->drop_row, et->drop_col, context, x, y, time, &ret_val);
-
- return ret_val;
-}
-
-static gboolean
-scroll_timeout (gpointer data)
-{
- ETable *et = data;
- int dx = 0, dy = 0;
- GtkAdjustment *h, *v;
- double hvalue, vvalue;
-
- if (et->scroll_direction & ET_SCROLL_DOWN)
- dy += 20;
- if (et->scroll_direction & ET_SCROLL_UP)
- dy -= 20;
-
- if (et->scroll_direction & ET_SCROLL_RIGHT)
- dx += 20;
- if (et->scroll_direction & ET_SCROLL_LEFT)
- dx -= 20;
-
- h = GTK_LAYOUT(et->table_canvas)->hadjustment;
- v = GTK_LAYOUT(et->table_canvas)->vadjustment;
-
- hvalue = h->value;
- vvalue = v->value;
-
- gtk_adjustment_set_value(h, CLAMP(h->value + dx, h->lower, h->upper - h->page_size));
- gtk_adjustment_set_value(v, CLAMP(v->value + dy, v->lower, v->upper - v->page_size));
-
- if (h->value != hvalue ||
- v->value != vvalue)
- do_drag_motion(et,
- et->last_drop_context,
- et->last_drop_x,
- et->last_drop_y,
- et->last_drop_time);
-
-
- return TRUE;
-}
-
-static void
-scroll_on (ETable *et, guint scroll_direction)
-{
- if (et->scroll_idle_id == 0 || scroll_direction != et->scroll_direction) {
- if (et->scroll_idle_id != 0)
- g_source_remove (et->scroll_idle_id);
- et->scroll_direction = scroll_direction;
- et->scroll_idle_id = g_timeout_add (100, scroll_timeout, et);
- }
-}
-
-static void
-scroll_off (ETable *et)
-{
- if (et->scroll_idle_id) {
- g_source_remove (et->scroll_idle_id);
- et->scroll_idle_id = 0;
- }
-}
-
-static void
-context_destroyed (gpointer data)
-{
- ETable *et = data;
- /* if (!GTK_OBJECT_DESTROYED (et)) */
-#ifndef NO_WARNINGS
-#warning FIXME
-#endif
- {
- et->last_drop_x = 0;
- et->last_drop_y = 0;
- et->last_drop_time = 0;
- et->last_drop_context = NULL;
- scroll_off (et);
- }
- g_object_unref (et);
-}
-
-static void
-context_connect (ETable *et, GdkDragContext *context)
-{
- if (g_dataset_get_data (context, "e-table") == NULL) {
- g_object_ref (et);
- g_dataset_set_data_full (context, "e-table", et, context_destroyed);
- }
-}
-
-static void
-et_drag_leave(GtkWidget *widget,
- GdkDragContext *context,
- guint time,
- ETable *et)
-{
- g_signal_emit (G_OBJECT (et), et_signals [TABLE_DRAG_LEAVE], 0,
- et->drop_row, et->drop_col, context, time);
- et->drop_row = -1;
- et->drop_col = -1;
-
- scroll_off (et);
-}
-
-static gboolean
-et_drag_motion(GtkWidget *widget,
- GdkDragContext *context,
- gint x,
- gint y,
- guint time,
- ETable *et)
-{
- gboolean ret_val;
- guint direction = 0;
-
- et->last_drop_x = x;
- et->last_drop_y = y;
- et->last_drop_time = time;
- et->last_drop_context = context;
- context_connect (et, context);
-
- ret_val = do_drag_motion (et,
- context,
- x,
- y,
- time);
-
-
- if (y < 20)
- direction |= ET_SCROLL_UP;
- if (y > widget->allocation.height - 20)
- direction |= ET_SCROLL_DOWN;
- if (x < 20)
- direction |= ET_SCROLL_LEFT;
- if (x > widget->allocation.width - 20)
- direction |= ET_SCROLL_RIGHT;
-
- if (direction != 0)
- scroll_on (et, direction);
- else
- scroll_off (et);
-
- return ret_val;
-}
-
-static gboolean
-et_drag_drop(GtkWidget *widget,
- GdkDragContext *context,
- gint x,
- gint y,
- guint time,
- ETable *et)
-{
- gboolean ret_val;
- int row, col;
-
- e_table_get_cell_at (et, x, y, &row, &col);
-
- if (row != et->drop_row && col != et->drop_row) {
- g_signal_emit (G_OBJECT (et), et_signals [TABLE_DRAG_LEAVE], 0,
- et->drop_row, et->drop_col, context, time);
- g_signal_emit (G_OBJECT (et), et_signals [TABLE_DRAG_MOTION], 0,
- row, col, context, x, y, time, &ret_val);
- }
- et->drop_row = row;
- et->drop_col = col;
- g_signal_emit (G_OBJECT (et), et_signals [TABLE_DRAG_DROP], 0,
- et->drop_row, et->drop_col, context, x, y, time, &ret_val);
- et->drop_row = -1;
- et->drop_col = -1;
-
- scroll_off (et);
-
- return ret_val;
-}
-
-static void
-et_drag_data_received(GtkWidget *widget,
- GdkDragContext *context,
- gint x,
- gint y,
- GtkSelectionData *selection_data,
- guint info,
- guint time,
- ETable *et)
-{
- int row, col;
-
- e_table_get_cell_at (et, x, y, &row, &col);
-
- g_signal_emit (G_OBJECT (et), et_signals [TABLE_DRAG_DATA_RECEIVED], 0,
- row, col, context, x, y, selection_data, info, time);
-}
-
-static void
-e_table_class_init (ETableClass *class)
-{
- GObjectClass *object_class;
- GtkWidgetClass *widget_class;
- GtkContainerClass *container_class;
-
- object_class = (GObjectClass *) class;
- widget_class = (GtkWidgetClass *) class;
- container_class = (GtkContainerClass *) class;
-
- parent_class = g_type_class_peek_parent (class);
-
- object_class->dispose = et_dispose;
- object_class->finalize = et_finalize;
- object_class->set_property = et_set_property;
- object_class->get_property = et_get_property;
-
- widget_class->grab_focus = et_grab_focus;
- widget_class->unrealize = et_unrealize;
- widget_class->size_request = et_size_request;
-
- widget_class->focus = et_focus;
-
- class->cursor_change = NULL;
- class->cursor_activated = NULL;
- class->selection_change = NULL;
- class->double_click = NULL;
- class->right_click = NULL;
- class->click = NULL;
- class->key_press = NULL;
- class->start_drag = et_real_start_drag;
- class->state_change = NULL;
- class->white_space_event = NULL;
-
- class->table_drag_begin = NULL;
- class->table_drag_end = NULL;
- class->table_drag_data_get = NULL;
- class->table_drag_data_delete = NULL;
-
- class->table_drag_leave = NULL;
- class->table_drag_motion = NULL;
- class->table_drag_drop = NULL;
- class->table_drag_data_received = NULL;
-
- et_signals [CURSOR_CHANGE] =
- g_signal_new ("cursor_change",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (ETableClass, cursor_change),
- NULL, NULL,
- e_marshal_NONE__INT,
- G_TYPE_NONE, 1, G_TYPE_INT);
-
- et_signals [CURSOR_ACTIVATED] =
- g_signal_new ("cursor_activated",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (ETableClass, cursor_activated),
- NULL, NULL,
- e_marshal_NONE__INT,
- G_TYPE_NONE, 1, G_TYPE_INT);
-
- et_signals [SELECTION_CHANGE] =
- g_signal_new ("selection_change",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (ETableClass, selection_change),
- NULL, NULL,
- e_marshal_NONE__NONE,
- G_TYPE_NONE, 0);
-
- et_signals [DOUBLE_CLICK] =
- g_signal_new ("double_click",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (ETableClass, double_click),
- NULL, NULL,
- e_marshal_NONE__INT_INT_BOXED,
- G_TYPE_NONE, 3, G_TYPE_INT,
- G_TYPE_INT, GDK_TYPE_EVENT);
-
- et_signals [RIGHT_CLICK] =
- g_signal_new ("right_click",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (ETableClass, right_click),
- NULL, NULL,
- e_marshal_INT__INT_INT_BOXED,
- G_TYPE_INT, 3, G_TYPE_INT,
- G_TYPE_INT, GDK_TYPE_EVENT);
-
- et_signals [CLICK] =
- g_signal_new ("click",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (ETableClass, click),
- NULL, NULL,
- e_marshal_INT__INT_INT_BOXED,
- G_TYPE_INT, 3, G_TYPE_INT,
- G_TYPE_INT, GDK_TYPE_EVENT);
-
- et_signals [KEY_PRESS] =
- g_signal_new ("key_press",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (ETableClass, key_press),
- NULL, NULL,
- e_marshal_INT__INT_INT_BOXED,
- G_TYPE_INT, 3, G_TYPE_INT,
- G_TYPE_INT, GDK_TYPE_EVENT);
-
- et_signals [START_DRAG] =
- g_signal_new ("start_drag",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (ETableClass, start_drag),
- NULL, NULL,
- e_marshal_INT__INT_INT_BOXED,
- G_TYPE_INT, 3, G_TYPE_INT,
- G_TYPE_INT, GDK_TYPE_EVENT);
-
- et_signals [STATE_CHANGE] =
- g_signal_new ("state_change",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (ETableClass, state_change),
- NULL, NULL,
- e_marshal_NONE__NONE,
- G_TYPE_NONE, 0);
-
- et_signals [WHITE_SPACE_EVENT] =
- g_signal_new ("white_space_event",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (ETableClass, white_space_event),
- NULL, NULL,
- e_marshal_INT__BOXED,
- G_TYPE_INT, 1, GDK_TYPE_EVENT);
-
- et_signals[TABLE_DRAG_BEGIN] =
- g_signal_new ("table_drag_begin",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (ETableClass, table_drag_begin),
- NULL, NULL,
- e_marshal_NONE__INT_INT_OBJECT,
- G_TYPE_NONE, 3,
- G_TYPE_INT,
- G_TYPE_INT,
- GDK_TYPE_DRAG_CONTEXT);
- et_signals[TABLE_DRAG_END] =
- g_signal_new ("table_drag_end",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (ETableClass, table_drag_end),
- NULL, NULL,
- e_marshal_NONE__INT_INT_OBJECT,
- G_TYPE_NONE, 3,
- G_TYPE_INT,
- G_TYPE_INT,
- GDK_TYPE_DRAG_CONTEXT);
- et_signals[TABLE_DRAG_DATA_GET] =
- g_signal_new ("table_drag_data_get",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (ETableClass, table_drag_data_get),
- NULL, NULL,
- e_marshal_NONE__INT_INT_OBJECT_BOXED_UINT_UINT,
- G_TYPE_NONE, 6,
- G_TYPE_INT,
- G_TYPE_INT,
- GDK_TYPE_DRAG_CONTEXT,
- GTK_TYPE_SELECTION_DATA,
- G_TYPE_UINT,
- G_TYPE_UINT);
- et_signals[TABLE_DRAG_DATA_DELETE] =
- g_signal_new ("table_drag_data_delete",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (ETableClass, table_drag_data_delete),
- NULL, NULL,
- e_marshal_NONE__INT_INT_OBJECT,
- G_TYPE_NONE, 3,
- G_TYPE_INT,
- G_TYPE_INT,
- GDK_TYPE_DRAG_CONTEXT);
-
- et_signals[TABLE_DRAG_LEAVE] =
- g_signal_new ("table_drag_leave",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (ETableClass, table_drag_leave),
- NULL, NULL,
- e_marshal_NONE__INT_INT_OBJECT_UINT,
- G_TYPE_NONE, 4,
- G_TYPE_INT,
- G_TYPE_INT,
- GDK_TYPE_DRAG_CONTEXT,
- G_TYPE_UINT);
- et_signals[TABLE_DRAG_MOTION] =
- g_signal_new ("table_drag_motion",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (ETableClass, table_drag_motion),
- NULL, NULL,
- e_marshal_BOOLEAN__INT_INT_OBJECT_INT_INT_UINT,
- G_TYPE_BOOLEAN, 6,
- G_TYPE_INT,
- G_TYPE_INT,
- GDK_TYPE_DRAG_CONTEXT,
- G_TYPE_INT,
- G_TYPE_INT,
- G_TYPE_UINT);
- et_signals[TABLE_DRAG_DROP] =
- g_signal_new ("table_drag_drop",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (ETableClass, table_drag_drop),
- NULL, NULL,
- e_marshal_BOOLEAN__INT_INT_OBJECT_INT_INT_UINT,
- G_TYPE_BOOLEAN, 6,
- G_TYPE_INT,
- G_TYPE_INT,
- GDK_TYPE_DRAG_CONTEXT,
- G_TYPE_INT,
- G_TYPE_INT,
- G_TYPE_UINT);
- et_signals[TABLE_DRAG_DATA_RECEIVED] =
- g_signal_new ("table_drag_data_received",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (ETableClass, table_drag_data_received),
- NULL, NULL,
- e_marshal_NONE__INT_INT_OBJECT_INT_INT_BOXED_UINT_UINT,
- G_TYPE_NONE, 8,
- G_TYPE_INT,
- G_TYPE_INT,
- GDK_TYPE_DRAG_CONTEXT,
- G_TYPE_INT,
- G_TYPE_INT,
- GTK_TYPE_SELECTION_DATA,
- G_TYPE_UINT,
- G_TYPE_UINT);
-
- class->set_scroll_adjustments = set_scroll_adjustments;
-
- widget_class->set_scroll_adjustments_signal =
- g_signal_new ("set_scroll_adjustments",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (ETableClass, set_scroll_adjustments),
- NULL, NULL,
- e_marshal_NONE__OBJECT_OBJECT,
- G_TYPE_NONE, 2, GTK_TYPE_ADJUSTMENT, GTK_TYPE_ADJUSTMENT);
-
- g_object_class_install_property (object_class, PROP_LENGTH_THRESHOLD,
- g_param_spec_int ("length_threshold",
- _("Length Threshold"),
- /*_( */"XXX blurb" /*)*/,
- 0, G_MAXINT, 0,
- G_PARAM_WRITABLE));
-
- g_object_class_install_property (object_class, PROP_UNIFORM_ROW_HEIGHT,
- g_param_spec_boolean ("uniform_row_height",
- _("Uniform row height"),
- /*_( */"XXX blurb" /*)*/,
- FALSE,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_ALWAYS_SEARCH,
- g_param_spec_boolean ("always_search",
- _("Always Search"),
- /*_( */"XXX blurb" /*)*/,
- FALSE,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_USE_CLICK_TO_ADD,
- g_param_spec_boolean ("use_click_to_add",
- _("Use click to add"),
- /*_( */"XXX blurb" /*)*/,
- FALSE,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_MODEL,
- g_param_spec_object ("model",
- _("Model"),
- /*_( */"XXX blurb" /*)*/,
- E_TABLE_MODEL_TYPE,
- G_PARAM_READABLE));
-}
-
-E_MAKE_TYPE(e_table, "ETable", ETable, e_table_class_init, e_table_init, PARENT_TYPE)
diff --git a/widgets/table/e-table.dia b/widgets/table/e-table.dia
deleted file mode 100644
index 5aeb01228c..0000000000
--- a/widgets/table/e-table.dia
+++ /dev/null
Binary files differ
diff --git a/widgets/table/e-table.h b/widgets/table/e-table.h
deleted file mode 100644
index f025318905..0000000000
--- a/widgets/table/e-table.h
+++ /dev/null
@@ -1,358 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-table.h - A graphical view of a Table.
- * Copyright 1999, 2000, 2001, Ximian, Inc.
- *
- * Authors:
- * Chris Lahey <clahey@ximian.com>
- * Miguel de Icaza <miguel@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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.
- */
-
-#ifndef _E_TABLE_H_
-#define _E_TABLE_H_
-
-#include <libgnomecanvas/gnome-canvas.h>
-#include <gtk/gtkdnd.h>
-#include <gtk/gtktable.h>
-#include <libxml/tree.h>
-#include <gal/e-table/e-table-model.h>
-#include <gal/e-table/e-table-header.h>
-#include <gal/e-table/e-table-group.h>
-#include <gal/e-table/e-table-sort-info.h>
-#include <gal/e-table/e-table-item.h>
-#include <gal/e-table/e-table-selection-model.h>
-#include <gal/e-table/e-table-extras.h>
-#include <gal/e-table/e-table-specification.h>
-#include <gal/widgets/e-printable.h>
-#include <gal/e-table/e-table-state.h>
-#include <gal/e-table/e-table-sorter.h>
-#include <gal/e-table/e-table-search.h>
-
-G_BEGIN_DECLS
-
-#define E_TABLE_TYPE (e_table_get_type ())
-#define E_TABLE(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), E_TABLE_TYPE, ETable))
-#define E_TABLE_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), E_TABLE_TYPE, ETableClass))
-#define E_IS_TABLE(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), E_TABLE_TYPE))
-#define E_IS_TABLE_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), E_TABLE_TYPE))
-
-typedef struct _ETableDragSourceSite ETableDragSourceSite;
-
-typedef enum {
- E_TABLE_CURSOR_LOC_NONE = 0,
- E_TABLE_CURSOR_LOC_ETCTA = 1 << 0,
- E_TABLE_CURSOR_LOC_TABLE = 1 << 1
-} ETableCursorLoc;
-
-typedef struct {
- GtkTable parent;
-
- ETableModel *model;
-
- ETableHeader *full_header, *header;
-
- GnomeCanvasItem *canvas_vbox;
- ETableGroup *group;
-
- ETableSortInfo *sort_info;
- ETableSorter *sorter;
-
- ETableSelectionModel *selection;
- ETableCursorLoc cursor_loc;
- ETableSpecification *spec;
-
- ETableSearch *search;
-
- ETableCol *current_search_col;
-
- guint search_search_id;
- guint search_accept_id;
-
- int table_model_change_id;
- int table_row_change_id;
- int table_cell_change_id;
- int table_rows_inserted_id;
- int table_rows_deleted_id;
-
- int group_info_change_id;
- int sort_info_change_id;
-
- int structure_change_id;
- int expansion_change_id;
- int dimension_change_id;
-
- int reflow_idle_id;
- int scroll_idle_id;
-
- GnomeCanvas *header_canvas, *table_canvas;
-
- GnomeCanvasItem *header_item, *root;
-
- GnomeCanvasItem *white_item;
-
- gint length_threshold;
-
- gint rebuild_idle_id;
- guint need_rebuild:1;
-
- /*
- * Configuration settings
- */
- guint alternating_row_colors : 1;
- guint horizontal_draw_grid : 1;
- guint vertical_draw_grid : 1;
- guint draw_focus : 1;
- guint row_selection_active : 1;
-
- guint horizontal_scrolling : 1;
- guint horizontal_resize : 1;
-
- guint is_grouped : 1;
-
- guint scroll_direction : 4;
-
- guint do_drag : 1;
-
- guint uniform_row_height : 1;
- guint allow_grouping : 1;
-
- guint always_search : 1;
- guint search_col_set : 1;
-
- char *click_to_add_message;
- GnomeCanvasItem *click_to_add;
- gboolean use_click_to_add;
- gboolean use_click_to_add_end;
-
- ECursorMode cursor_mode;
-
- int drop_row;
- int drop_col;
- GnomeCanvasItem *drop_highlight;
- int last_drop_x;
- int last_drop_y;
- int last_drop_time;
- GdkDragContext *last_drop_context;
-
- int drag_row;
- int drag_col;
- ETableDragSourceSite *site;
-
- int header_width;
-
- char *domain;
-} ETable;
-
-typedef struct {
- GtkTableClass parent_class;
-
- void (*cursor_change) (ETable *et, int row);
- void (*cursor_activated) (ETable *et, int row);
- void (*selection_change) (ETable *et);
- void (*double_click) (ETable *et, int row, int col, GdkEvent *event);
- gint (*right_click) (ETable *et, int row, int col, GdkEvent *event);
- gint (*click) (ETable *et, int row, int col, GdkEvent *event);
- gint (*key_press) (ETable *et, int row, int col, GdkEvent *event);
- gint (*start_drag) (ETable *et, int row, int col, GdkEvent *event);
- void (*state_change) (ETable *et);
- gint (*white_space_event) (ETable *et, GdkEvent *event);
-
- void (*set_scroll_adjustments) (ETable *table,
- GtkAdjustment *hadjustment,
- GtkAdjustment *vadjustment);
-
- /* Source side drag signals */
- void (* table_drag_begin) (ETable *table,
- int row,
- int col,
- GdkDragContext *context);
- void (* table_drag_end) (ETable *table,
- int row,
- int col,
- GdkDragContext *context);
- void (* table_drag_data_get) (ETable *table,
- int row,
- int col,
- GdkDragContext *context,
- GtkSelectionData *selection_data,
- guint info,
- guint time);
- void (* table_drag_data_delete) (ETable *table,
- int row,
- int col,
- GdkDragContext *context);
-
- /* Target side drag signals */
- void (* table_drag_leave) (ETable *table,
- int row,
- int col,
- GdkDragContext *context,
- guint time);
- gboolean (* table_drag_motion) (ETable *table,
- int row,
- int col,
- GdkDragContext *context,
- gint x,
- gint y,
- guint time);
- gboolean (* table_drag_drop) (ETable *table,
- int row,
- int col,
- GdkDragContext *context,
- gint x,
- gint y,
- guint time);
- void (* table_drag_data_received) (ETable *table,
- int row,
- int col,
- GdkDragContext *context,
- gint x,
- gint y,
- GtkSelectionData *selection_data,
- guint info,
- guint time);
-} ETableClass;
-GType e_table_get_type (void);
-ETable *e_table_construct (ETable *e_table,
- ETableModel *etm,
- ETableExtras *ete,
- const char *spec,
- const char *state);
-GtkWidget *e_table_new (ETableModel *etm,
- ETableExtras *ete,
- const char *spec,
- const char *state);
-
-/* Create an ETable using files. */
-ETable *e_table_construct_from_spec_file (ETable *e_table,
- ETableModel *etm,
- ETableExtras *ete,
- const char *spec_fn,
- const char *state_fn);
-GtkWidget *e_table_new_from_spec_file (ETableModel *etm,
- ETableExtras *ete,
- const char *spec_fn,
- const char *state_fn);
-
-/* To save the state */
-gchar *e_table_get_state (ETable *e_table);
-void e_table_save_state (ETable *e_table,
- const gchar *filename);
-ETableState *e_table_get_state_object (ETable *e_table);
-
-/* note that it is more efficient to provide the state at creation time */
-void e_table_set_state (ETable *e_table,
- const gchar *state);
-void e_table_set_state_object (ETable *e_table,
- ETableState *state);
-void e_table_load_state (ETable *e_table,
- const gchar *filename);
-void e_table_set_cursor_row (ETable *e_table,
- int row);
-
-/* -1 means we don't have the cursor. This is in model rows. */
-int e_table_get_cursor_row (ETable *e_table);
-void e_table_selected_row_foreach (ETable *e_table,
- EForeachFunc callback,
- gpointer closure);
-gint e_table_selected_count (ETable *e_table);
-EPrintable *e_table_get_printable (ETable *e_table);
-gint e_table_get_next_row (ETable *e_table,
- gint model_row);
-gint e_table_get_prev_row (ETable *e_table,
- gint model_row);
-gint e_table_model_to_view_row (ETable *e_table,
- gint model_row);
-gint e_table_view_to_model_row (ETable *e_table,
- gint view_row);
-void e_table_get_cell_at (ETable *table,
- int x,
- int y,
- int *row_return,
- int *col_return);
-void e_table_get_cell_geometry (ETable *table,
- int row,
- int col,
- int *x_return,
- int *y_return,
- int *width_return,
- int *height_return);
-
-/* Useful accessor functions. */
-ESelectionModel *e_table_get_selection_model (ETable *table);
-
-/* Drag & drop stuff. */
-/* Target */
-void e_table_drag_get_data (ETable *table,
- int row,
- int col,
- GdkDragContext *context,
- GdkAtom target,
- guint32 time);
-void e_table_drag_highlight (ETable *table,
- int row,
- int col); /* col == -1 to highlight entire row. */
-void e_table_drag_unhighlight (ETable *table);
-void e_table_drag_dest_set (ETable *table,
- GtkDestDefaults flags,
- const GtkTargetEntry *targets,
- gint n_targets,
- GdkDragAction actions);
-void e_table_drag_dest_set_proxy (ETable *table,
- GdkWindow *proxy_window,
- GdkDragProtocol protocol,
- gboolean use_coordinates);
-
-/* There probably should be functions for setting the targets
- * as a GtkTargetList
- */
-void e_table_drag_dest_unset (GtkWidget *widget);
-
-/* Source side */
-void e_table_drag_source_set (ETable *table,
- GdkModifierType start_button_mask,
- const GtkTargetEntry *targets,
- gint n_targets,
- GdkDragAction actions);
-void e_table_drag_source_unset (ETable *table);
-
-/* There probably should be functions for setting the targets
- * as a GtkTargetList
- */
-GdkDragContext *e_table_drag_begin (ETable *table,
- int row,
- int col,
- GtkTargetList *targets,
- GdkDragAction actions,
- gint button,
- GdkEvent *event);
-
-/* selection stuff */
-void e_table_select_all (ETable *table);
-void e_table_invert_selection (ETable *table);
-
-/* This function is only needed in single_selection_mode. */
-void e_table_right_click_up (ETable *table);
-
-void e_table_commit_click_to_add (ETable *table);
-
-void e_table_commit_click_to_add (ETable *table);
-
-G_END_DECLS
-
-#endif /* _E_TABLE_H_ */
-
diff --git a/widgets/table/e-tree-memory-callbacks.c b/widgets/table/e-tree-memory-callbacks.c
deleted file mode 100644
index b6fe3fc375..0000000000
--- a/widgets/table/e-tree-memory-callbacks.c
+++ /dev/null
@@ -1,275 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-tree-memory-callbacks.c
- * Copyright 2000, 2001, Ximian, Inc.
- *
- * Authors:
- * Chris Lahey <clahey@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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 <gtk/gtksignal.h>
-#include "gal/util/e-util.h"
-#include "e-tree-memory-callbacks.h"
-
-#define PARENT_TYPE E_TREE_MEMORY_TYPE
-
-static GdkPixbuf *
-etmc_icon_at (ETreeModel *etm, ETreePath node)
-{
- ETreeMemoryCallbacks *etmc = E_TREE_MEMORY_CALLBACKS(etm);
-
- return etmc->icon_at (etm, node, etmc->model_data);
-}
-
-static int
-etmc_column_count (ETreeModel *etm)
-{
- ETreeMemoryCallbacks *etmc = E_TREE_MEMORY_CALLBACKS(etm);
-
- if (etmc->column_count)
- return etmc->column_count (etm, etmc->model_data);
- else
- return 0;
-}
-
-
-static gboolean
-etmc_has_save_id (ETreeModel *etm)
-{
- ETreeMemoryCallbacks *etmc = E_TREE_MEMORY_CALLBACKS(etm);
-
- if (etmc->has_save_id)
- return etmc->has_save_id (etm, etmc->model_data);
- else
- return FALSE;
-}
-
-static char *
-etmc_get_save_id (ETreeModel *etm, ETreePath node)
-{
- ETreeMemoryCallbacks *etmc = E_TREE_MEMORY_CALLBACKS(etm);
-
- if (etmc->get_save_id)
- return etmc->get_save_id (etm, node, etmc->model_data);
- else
- return NULL;
-}
-
-static gboolean
-etmc_has_get_node_by_id (ETreeModel *etm)
-{
- ETreeMemoryCallbacks *etmc = E_TREE_MEMORY_CALLBACKS(etm);
-
- if (etmc->has_get_node_by_id)
- return etmc->has_get_node_by_id (etm, etmc->model_data);
- else
- return FALSE;
-}
-
-static ETreePath
-etmc_get_node_by_id (ETreeModel *etm, const char *save_id)
-{
- ETreeMemoryCallbacks *etmc = E_TREE_MEMORY_CALLBACKS(etm);
-
- if (etmc->get_node_by_id)
- return etmc->get_node_by_id (etm, save_id, etmc->model_data);
- else
- return NULL;
-}
-
-
-static void *
-etmc_value_at (ETreeModel *etm, ETreePath node, int col)
-{
- ETreeMemoryCallbacks *etmc = E_TREE_MEMORY_CALLBACKS(etm);
-
- return etmc->value_at (etm, node, col, etmc->model_data);
-}
-
-static void
-etmc_set_value_at (ETreeModel *etm, ETreePath node, int col, const void *val)
-{
- ETreeMemoryCallbacks *etmc = E_TREE_MEMORY_CALLBACKS(etm);
-
- etmc->set_value_at (etm, node, col, val, etmc->model_data);
-}
-
-static gboolean
-etmc_is_editable (ETreeModel *etm, ETreePath node, int col)
-{
- ETreeMemoryCallbacks *etmc = E_TREE_MEMORY_CALLBACKS(etm);
-
- return etmc->is_editable (etm, node, col, etmc->model_data);
-}
-
-
-/* The default for etmc_duplicate_value is to return the raw value. */
-static void *
-etmc_duplicate_value (ETreeModel *etm, int col, const void *value)
-{
- ETreeMemoryCallbacks *etmc = E_TREE_MEMORY_CALLBACKS(etm);
-
- if (etmc->duplicate_value)
- return etmc->duplicate_value (etm, col, value, etmc->model_data);
- else
- return (void *)value;
-}
-
-static void
-etmc_free_value (ETreeModel *etm, int col, void *value)
-{
- ETreeMemoryCallbacks *etmc = E_TREE_MEMORY_CALLBACKS(etm);
-
- if (etmc->free_value)
- etmc->free_value (etm, col, value, etmc->model_data);
-}
-
-static void *
-etmc_initialize_value (ETreeModel *etm, int col)
-{
- ETreeMemoryCallbacks *etmc = E_TREE_MEMORY_CALLBACKS(etm);
-
- if (etmc->initialize_value)
- return etmc->initialize_value (etm, col, etmc->model_data);
- else
- return NULL;
-}
-
-static gboolean
-etmc_value_is_empty (ETreeModel *etm, int col, const void *value)
-{
- ETreeMemoryCallbacks *etmc = E_TREE_MEMORY_CALLBACKS(etm);
-
- if (etmc->value_is_empty)
- return etmc->value_is_empty (etm, col, value, etmc->model_data);
- else
- return FALSE;
-}
-
-static char *
-etmc_value_to_string (ETreeModel *etm, int col, const void *value)
-{
- ETreeMemoryCallbacks *etmc = E_TREE_MEMORY_CALLBACKS(etm);
-
- if (etmc->value_to_string)
- return etmc->value_to_string (etm, col, value, etmc->model_data);
- else
- return g_strdup ("");
-}
-
-static void
-e_tree_memory_callbacks_class_init (GtkObjectClass *object_class)
-{
- ETreeModelClass *model_class = (ETreeModelClass *) object_class;
-
- model_class->icon_at = etmc_icon_at;
-
- model_class->column_count = etmc_column_count;
-
- model_class->has_save_id = etmc_has_save_id;
- model_class->get_save_id = etmc_get_save_id;
-
- model_class->has_get_node_by_id = etmc_has_get_node_by_id;
- model_class->get_node_by_id = etmc_get_node_by_id;
-
- model_class->value_at = etmc_value_at;
- model_class->set_value_at = etmc_set_value_at;
- model_class->is_editable = etmc_is_editable;
-
- model_class->duplicate_value = etmc_duplicate_value;
- model_class->free_value = etmc_free_value;
- model_class->initialize_value = etmc_initialize_value;
- model_class->value_is_empty = etmc_value_is_empty;
- model_class->value_to_string = etmc_value_to_string;
-}
-
-E_MAKE_TYPE(e_tree_memory_callbacks, "ETreeMemoryCallbacks", ETreeMemoryCallbacks, e_tree_memory_callbacks_class_init, NULL, PARENT_TYPE)
-
-/**
- * e_tree_memory_callbacks_new:
- *
- * This initializes a new ETreeMemoryCallbacksModel object.
- * ETreeMemoryCallbacksModel is an implementaiton of the somewhat
- * abstract class ETreeMemory. The ETreeMemoryCallbacksModel is
- * designed to allow people to easily create ETreeMemorys without
- * having to create a new GtkType derived from ETreeMemory every time
- * they need one.
- *
- * Instead, ETreeMemoryCallbacksModel uses a setup based in callback functions, every
- * callback function signature mimics the signature of each ETreeModel method
- * and passes the extra @data pointer to each one of the method to provide them
- * with any context they might want to use.
- *
- * ETreeMemoryCallbacks is to ETreeMemory as ETableSimple is to ETableModel.
- *
- * Return value: An ETreeMemoryCallbacks object (which is also an
- * ETreeMemory and thus an ETreeModel object).
- *
- */
-ETreeModel *
-e_tree_memory_callbacks_new (ETreeMemoryCallbacksIconAtFn icon_at,
-
- ETreeMemoryCallbacksColumnCountFn column_count,
-
- ETreeMemoryCallbacksHasSaveIdFn has_save_id,
- ETreeMemoryCallbacksGetSaveIdFn get_save_id,
-
- ETreeMemoryCallbacksHasGetNodeByIdFn has_get_node_by_id,
- ETreeMemoryCallbacksGetNodeByIdFn get_node_by_id,
-
- ETreeMemoryCallbacksValueAtFn value_at,
- ETreeMemoryCallbacksSetValueAtFn set_value_at,
- ETreeMemoryCallbacksIsEditableFn is_editable,
-
- ETreeMemoryCallbacksDuplicateValueFn duplicate_value,
- ETreeMemoryCallbacksFreeValueFn free_value,
- ETreeMemoryCallbacksInitializeValueFn initialize_value,
- ETreeMemoryCallbacksValueIsEmptyFn value_is_empty,
- ETreeMemoryCallbacksValueToStringFn value_to_string,
-
- gpointer model_data)
-{
- ETreeMemoryCallbacks *etmc;
-
- etmc = g_object_new (E_TREE_MEMORY_CALLBACKS_TYPE, NULL);
-
- etmc->icon_at = icon_at;
-
- etmc->column_count = column_count;
-
- etmc->has_save_id = has_save_id;
- etmc->get_save_id = get_save_id;
-
- etmc->has_get_node_by_id = has_get_node_by_id;
- etmc->get_node_by_id = get_node_by_id;
-
- etmc->value_at = value_at;
- etmc->set_value_at = set_value_at;
- etmc->is_editable = is_editable;
-
- etmc->duplicate_value = duplicate_value;
- etmc->free_value = free_value;
- etmc->initialize_value = initialize_value;
- etmc->value_is_empty = value_is_empty;
- etmc->value_to_string = value_to_string;
-
- etmc->model_data = model_data;
-
- return (ETreeModel*)etmc;
-}
-
diff --git a/widgets/table/e-tree-memory-callbacks.h b/widgets/table/e-tree-memory-callbacks.h
deleted file mode 100644
index 0f75fa98be..0000000000
--- a/widgets/table/e-tree-memory-callbacks.h
+++ /dev/null
@@ -1,119 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-tree-memory-callbacks.h
- * Copyright 2000, 2001, Ximian, Inc.
- *
- * Authors:
- * Chris Lahey <clahey@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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.
- */
-
-
-#ifndef _E_TREE_MEMORY_CALLBACKS_H_
-#define _E_TREE_MEMORY_CALLBACKS_H_
-
-#include <gal/e-table/e-tree-memory.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
-
-#define E_TREE_MEMORY_CALLBACKS_TYPE (e_tree_memory_callbacks_get_type ())
-#define E_TREE_MEMORY_CALLBACKS(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), E_TREE_MEMORY_CALLBACKS_TYPE, ETreeMemoryCallbacks))
-#define E_TREE_MEMORY_CALLBACKS_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), E_TREE_MEMORY_CALLBACKS_TYPE, ETreeMemoryCallbacksClass))
-#define E_IS_TREE_MEMORY_CALLBACKS(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), E_TREE_MEMORY_CALLBACKS_TYPE))
-#define E_IS_TREE_MEMORY_CALLBACKS_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), E_TREE_MEMORY_CALLBACKS_TYPE))
-
-
-typedef GdkPixbuf* (*ETreeMemoryCallbacksIconAtFn) (ETreeModel *etree, ETreePath path, void *model_data);
-
-typedef gint (*ETreeMemoryCallbacksColumnCountFn) (ETreeModel *etree, void *model_data);
-
-typedef gboolean (*ETreeMemoryCallbacksHasSaveIdFn) (ETreeModel *etree, void *model_data);
-typedef gchar *(*ETreeMemoryCallbacksGetSaveIdFn) (ETreeModel *etree, ETreePath path, void *model_data);
-
-typedef gboolean (*ETreeMemoryCallbacksHasGetNodeByIdFn) (ETreeModel *etree, void *model_data);
-typedef ETreePath (*ETreeMemoryCallbacksGetNodeByIdFn) (ETreeModel *etree, const char *save_id, void *model_data);
-
-typedef void* (*ETreeMemoryCallbacksValueAtFn) (ETreeModel *etree, ETreePath path, int col, void *model_data);
-typedef void (*ETreeMemoryCallbacksSetValueAtFn) (ETreeModel *etree, ETreePath path, int col, const void *val, void *model_data);
-typedef gboolean (*ETreeMemoryCallbacksIsEditableFn) (ETreeModel *etree, ETreePath path, int col, void *model_data);
-
-typedef void *(*ETreeMemoryCallbacksDuplicateValueFn) (ETreeModel *etm, int col, const void *val, void *data);
-typedef void (*ETreeMemoryCallbacksFreeValueFn) (ETreeModel *etm, int col, void *val, void *data);
-typedef void *(*ETreeMemoryCallbacksInitializeValueFn) (ETreeModel *etm, int col, void *data);
-typedef gboolean (*ETreeMemoryCallbacksValueIsEmptyFn) (ETreeModel *etm, int col, const void *val, void *data);
-typedef char *(*ETreeMemoryCallbacksValueToStringFn) (ETreeModel *etm, int col, const void *val, void *data);
-
-typedef struct {
- ETreeMemory parent;
-
- ETreeMemoryCallbacksIconAtFn icon_at;
-
- ETreeMemoryCallbacksColumnCountFn column_count;
-
- ETreeMemoryCallbacksHasSaveIdFn has_save_id;
- ETreeMemoryCallbacksGetSaveIdFn get_save_id;
-
- ETreeMemoryCallbacksHasGetNodeByIdFn has_get_node_by_id;
- ETreeMemoryCallbacksGetNodeByIdFn get_node_by_id;
-
- ETreeMemoryCallbacksValueAtFn value_at;
- ETreeMemoryCallbacksSetValueAtFn set_value_at;
- ETreeMemoryCallbacksIsEditableFn is_editable;
-
- ETreeMemoryCallbacksDuplicateValueFn duplicate_value;
- ETreeMemoryCallbacksFreeValueFn free_value;
- ETreeMemoryCallbacksInitializeValueFn initialize_value;
- ETreeMemoryCallbacksValueIsEmptyFn value_is_empty;
- ETreeMemoryCallbacksValueToStringFn value_to_string;
-
- gpointer model_data;
-} ETreeMemoryCallbacks;
-
-typedef struct {
- ETreeMemoryClass parent_class;
-} ETreeMemoryCallbacksClass;
-
-GType e_tree_memory_callbacks_get_type (void);
-
-ETreeModel *e_tree_memory_callbacks_new (ETreeMemoryCallbacksIconAtFn icon_at,
-
- ETreeMemoryCallbacksColumnCountFn column_count,
-
- ETreeMemoryCallbacksHasSaveIdFn has_save_id,
- ETreeMemoryCallbacksGetSaveIdFn get_save_id,
-
- ETreeMemoryCallbacksHasGetNodeByIdFn has_get_node_by_id,
- ETreeMemoryCallbacksGetNodeByIdFn get_node_by_id,
-
- ETreeMemoryCallbacksValueAtFn value_at,
- ETreeMemoryCallbacksSetValueAtFn set_value_at,
- ETreeMemoryCallbacksIsEditableFn is_editable,
-
- ETreeMemoryCallbacksDuplicateValueFn duplicate_value,
- ETreeMemoryCallbacksFreeValueFn free_value,
- ETreeMemoryCallbacksInitializeValueFn initialize_value,
- ETreeMemoryCallbacksValueIsEmptyFn value_is_empty,
- ETreeMemoryCallbacksValueToStringFn value_to_string,
-
- gpointer model_data);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* _E_TREE_MEMORY_CALLBACKS_H_ */
diff --git a/widgets/table/e-tree-memory.c b/widgets/table/e-tree-memory.c
deleted file mode 100644
index 3f178455df..0000000000
--- a/widgets/table/e-tree-memory.c
+++ /dev/null
@@ -1,717 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-tree-memory.c
- * Copyright 2000, 2001, Ximian, Inc.
- *
- * Authors:
- * Chris Lahey <clahey@ximian.com>
- * Chris Toshok <toshok@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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 <stdio.h>
-#include <errno.h>
-#include <unistd.h>
-#include <fcntl.h>
-#include <stdlib.h>
-
-#include <libxml/parser.h>
-#include <libxml/xmlmemory.h>
-
-#include "gal/util/e-util.h"
-#include "gal/util/e-xml-utils.h"
-#include "e-tree-memory.h"
-
-#define TREEPATH_CHUNK_AREA_SIZE (30 * sizeof (ETreeMemoryPath))
-
-static ETreeModelClass *parent_class;
-static GMemChunk *node_chunk;
-
-enum {
- FILL_IN_CHILDREN,
- LAST_SIGNAL
-};
-
-static guint signals [LAST_SIGNAL] = { 0, };
-
-typedef struct ETreeMemoryPath ETreeMemoryPath;
-
-struct ETreeMemoryPath {
- gpointer node_data;
-
- guint children_computed : 1;
-
- /* parent/child/sibling pointers */
- ETreeMemoryPath *parent;
- ETreeMemoryPath *next_sibling;
- ETreeMemoryPath *prev_sibling;
- ETreeMemoryPath *first_child;
- ETreeMemoryPath *last_child;
-
- gint num_children;
-};
-
-struct ETreeMemoryPriv {
- ETreeMemoryPath *root;
- gboolean expanded_default; /* whether nodes are created expanded or collapsed by default */
- gint frozen;
- GFunc destroy_func;
- gpointer destroy_user_data;
-};
-
-
-/* ETreeMemoryPath functions */
-
-static inline void
-check_children (ETreeMemory *memory, ETreePath node)
-{
- ETreeMemoryPath *path = node;
- if (!path->children_computed) {
- g_signal_emit (G_OBJECT (memory), signals[FILL_IN_CHILDREN], 0, node);
- path->children_computed = TRUE;
- }
-}
-
-static int
-e_tree_memory_path_depth (ETreeMemoryPath *path)
-{
- int depth = 0;
-
- g_return_val_if_fail(path != NULL, -1);
-
- for ( path = path->parent; path; path = path->parent)
- depth ++;
- return depth;
-}
-
-static void
-e_tree_memory_path_insert (ETreeMemoryPath *parent, int position, ETreeMemoryPath *child)
-{
- g_return_if_fail (position <= parent->num_children && position >= -1);
-
- child->parent = parent;
-
- if (parent->first_child == NULL)
- parent->first_child = child;
-
- if (position == -1 || position == parent->num_children) {
- child->prev_sibling = parent->last_child;
- if (parent->last_child)
- parent->last_child->next_sibling = child;
- parent->last_child = child;
- } else {
- ETreeMemoryPath *c;
- for (c = parent->first_child; c; c = c->next_sibling) {
- if (position == 0) {
- child->next_sibling = c;
- child->prev_sibling = c->prev_sibling;
-
- if (child->next_sibling)
- child->next_sibling->prev_sibling = child;
- if (child->prev_sibling)
- child->prev_sibling->next_sibling = child;
-
- if (parent->first_child == c)
- parent->first_child = child;
- break;
- }
- position --;
- }
- }
-
- parent->num_children++;
-}
-
-static void
-e_tree_path_unlink (ETreeMemoryPath *path)
-{
- ETreeMemoryPath *parent = path->parent;
-
- /* unlink first/last child if applicable */
- if (parent) {
- if (path == parent->first_child)
- parent->first_child = path->next_sibling;
- if (path == parent->last_child)
- parent->last_child = path->prev_sibling;
-
- parent->num_children --;
- }
-
- /* unlink prev/next sibling links */
- if (path->next_sibling)
- path->next_sibling->prev_sibling = path->prev_sibling;
- if (path->prev_sibling)
- path->prev_sibling->next_sibling = path->next_sibling;
-
- path->parent = NULL;
- path->next_sibling = NULL;
- path->prev_sibling = NULL;
-}
-
-
-
-/**
- * e_tree_memory_freeze:
- * @etmm: the ETreeModel to freeze.
- *
- * This function prepares an ETreeModel for a period of much change.
- * All signals regarding changes to the tree are deferred until we
- * thaw the tree.
- *
- **/
-void
-e_tree_memory_freeze(ETreeMemory *etmm)
-{
- ETreeMemoryPriv *priv = etmm->priv;
-
- if (priv->frozen == 0)
- e_tree_model_pre_change(E_TREE_MODEL(etmm));
-
- priv->frozen ++;
-}
-
-/**
- * e_tree_memory_thaw:
- * @etmm: the ETreeMemory to thaw.
- *
- * This function thaws an ETreeMemory. All the defered signals can add
- * up to a lot, we don't know - so we just emit a model_changed
- * signal.
- *
- **/
-void
-e_tree_memory_thaw(ETreeMemory *etmm)
-{
- ETreeMemoryPriv *priv = etmm->priv;
-
- if (priv->frozen > 0)
- priv->frozen --;
- if (priv->frozen == 0) {
- e_tree_model_node_changed(E_TREE_MODEL(etmm), priv->root);
- }
-}
-
-
-/* virtual methods */
-
-static void
-etmm_dispose (GObject *object)
-{
- ETreeMemory *etmm = E_TREE_MEMORY (object);
- ETreeMemoryPriv *priv = etmm->priv;
-
- if (priv) {
- /* XXX lots of stuff to free here */
-
- if (priv->root)
- e_tree_memory_node_remove (etmm, priv->root);
-
- g_free (priv);
- }
- etmm->priv = NULL;
-
- G_OBJECT_CLASS (parent_class)->dispose (object);
-}
-
-static ETreePath
-etmm_get_root (ETreeModel *etm)
-{
- ETreeMemoryPriv *priv = E_TREE_MEMORY(etm)->priv;
- return priv->root;
-}
-
-static ETreePath
-etmm_get_parent (ETreeModel *etm, ETreePath node)
-{
- ETreeMemoryPath *path = node;
- return path->parent;
-}
-
-static ETreePath
-etmm_get_first_child (ETreeModel *etm, ETreePath node)
-{
- ETreeMemoryPath *path = node;
-
- check_children (E_TREE_MEMORY (etm), node);
- return path->first_child;
-}
-
-static ETreePath
-etmm_get_last_child (ETreeModel *etm, ETreePath node)
-{
- ETreeMemoryPath *path = node;
-
- check_children (E_TREE_MEMORY (etm), node);
- return path->last_child;
-}
-
-static ETreePath
-etmm_get_next (ETreeModel *etm, ETreePath node)
-{
- ETreeMemoryPath *path = node;
- return path->next_sibling;
-}
-
-static ETreePath
-etmm_get_prev (ETreeModel *etm, ETreePath node)
-{
- ETreeMemoryPath *path = node;
- return path->prev_sibling;
-}
-
-static gboolean
-etmm_is_root (ETreeModel *etm, ETreePath node)
-{
- ETreeMemoryPath *path = node;
- return e_tree_memory_path_depth (path) == 0;
-}
-
-static gboolean
-etmm_is_expandable (ETreeModel *etm, ETreePath node)
-{
- ETreeMemoryPath *path = node;
-
- check_children (E_TREE_MEMORY (etm), node);
- return path->first_child != NULL;
-}
-
-static guint
-etmm_get_children (ETreeModel *etm, ETreePath node, ETreePath **nodes)
-{
- ETreeMemoryPath *path = node;
- guint n_children;
-
- check_children (E_TREE_MEMORY (etm), node);
-
- n_children = path->num_children;
-
- if (nodes) {
- ETreeMemoryPath *p;
- int i = 0;
-
- (*nodes) = g_new (ETreePath, n_children);
- for (p = path->first_child; p; p = p->next_sibling) {
- (*nodes)[i++] = p;
- }
- }
-
- return n_children;
-}
-
-static guint
-etmm_depth (ETreeModel *etm, ETreePath path)
-{
- return e_tree_memory_path_depth(path);
-}
-
-static gboolean
-etmm_get_expanded_default (ETreeModel *etm)
-{
- ETreeMemory *etmm = E_TREE_MEMORY (etm);
- ETreeMemoryPriv *priv = etmm->priv;
-
- return priv->expanded_default;
-}
-
-static void
-etmm_clear_children_computed (ETreeMemoryPath *path)
-{
- for (path = path->first_child; path; path = path->next_sibling) {
- path->children_computed = FALSE;
- etmm_clear_children_computed (path);
- }
-}
-
-static void
-etmm_node_request_collapse (ETreeModel *etm, ETreePath node)
-{
- if (node)
- etmm_clear_children_computed (node);
-
- if (parent_class->node_request_collapse) {
- parent_class->node_request_collapse (etm, node);
- }
-}
-
-
-static void
-e_tree_memory_class_init (ETreeMemoryClass *klass)
-{
- ETreeModelClass *tree_class = (ETreeModelClass *) klass;
- GObjectClass *object_class = (GObjectClass *) klass;
-
- parent_class = g_type_class_peek_parent (klass);
-
- node_chunk = g_mem_chunk_create (ETreeMemoryPath, TREEPATH_CHUNK_AREA_SIZE, G_ALLOC_AND_FREE);
-
- signals [FILL_IN_CHILDREN] =
- g_signal_new ("fill_in_children",
- E_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (ETreeMemoryClass, fill_in_children),
- (GSignalAccumulator) NULL, NULL,
- g_cclosure_marshal_VOID__POINTER,
- G_TYPE_NONE, 1, G_TYPE_POINTER);
-
- object_class->dispose = etmm_dispose;
-
- tree_class->get_root = etmm_get_root;
- tree_class->get_prev = etmm_get_prev;
- tree_class->get_next = etmm_get_next;
- tree_class->get_first_child = etmm_get_first_child;
- tree_class->get_last_child = etmm_get_last_child;
- tree_class->get_parent = etmm_get_parent;
-
- tree_class->is_root = etmm_is_root;
- tree_class->is_expandable = etmm_is_expandable;
- tree_class->get_children = etmm_get_children;
- tree_class->depth = etmm_depth;
- tree_class->get_expanded_default = etmm_get_expanded_default;
-
- tree_class->node_request_collapse = etmm_node_request_collapse;
-
- klass->fill_in_children = NULL;
-}
-
-static void
-e_tree_memory_init (GObject *object)
-{
- ETreeMemory *etmm = (ETreeMemory *)object;
-
- ETreeMemoryPriv *priv;
-
- priv = g_new0 (ETreeMemoryPriv, 1);
- etmm->priv = priv;
-
- priv->root = NULL;
- priv->frozen = 0;
- priv->expanded_default = 0;
- priv->destroy_func = NULL;
- priv->destroy_user_data = NULL;
-}
-
-E_MAKE_TYPE(e_tree_memory, "ETreeMemory", ETreeMemory, e_tree_memory_class_init, e_tree_memory_init, E_TREE_MODEL_TYPE)
-
-
-
-/**
- * e_tree_memory_construct:
- * @etree:
- *
- *
- **/
-void
-e_tree_memory_construct (ETreeMemory *etmm)
-{
-}
-
-/**
- * e_tree_memory_new
- *
- * XXX docs here.
- *
- * return values: a newly constructed ETreeMemory.
- */
-ETreeMemory *
-e_tree_memory_new (void)
-{
- return (ETreeMemory *) g_object_new (E_TREE_MEMORY_TYPE, NULL);
-}
-
-void
-e_tree_memory_set_expanded_default (ETreeMemory *etree, gboolean expanded)
-{
- etree->priv->expanded_default = expanded;
-}
-
-/**
- * e_tree_memory_node_get_data:
- * @etmm:
- * @node:
- *
- *
- *
- * Return value:
- **/
-gpointer
-e_tree_memory_node_get_data (ETreeMemory *etmm, ETreePath node)
-{
- ETreeMemoryPath *path = node;
-
- g_return_val_if_fail (path, NULL);
-
- return path->node_data;
-}
-
-/**
- * e_tree_memory_node_set_data:
- * @etmm:
- * @node:
- * @node_data:
- *
- *
- **/
-void
-e_tree_memory_node_set_data (ETreeMemory *etmm, ETreePath node, gpointer node_data)
-{
- ETreeMemoryPath *path = node;
-
- g_return_if_fail (path);
-
- path->node_data = node_data;
-}
-
-/**
- * e_tree_memory_node_insert:
- * @tree_model:
- * @parent_path:
- * @position:
- * @node_data:
- *
- *
- *
- * Return value:
- **/
-ETreePath
-e_tree_memory_node_insert (ETreeMemory *tree_model,
- ETreePath parent_node,
- int position,
- gpointer node_data)
-{
- ETreeMemoryPriv *priv;
- ETreeMemoryPath *new_path;
- ETreeMemoryPath *parent_path = parent_node;
-
- g_return_val_if_fail(tree_model != NULL, NULL);
-
- priv = tree_model->priv;
-
- g_return_val_if_fail (parent_path != NULL || priv->root == NULL, NULL);
-
- priv = tree_model->priv;
-
- if (!tree_model->priv->frozen)
- e_tree_model_pre_change(E_TREE_MODEL(tree_model));
-
- new_path = g_chunk_new0 (ETreeMemoryPath, node_chunk);
-
- new_path->node_data = node_data;
- new_path->children_computed = FALSE;
-
- if (parent_path != NULL) {
- e_tree_memory_path_insert (parent_path, position, new_path);
- if (!tree_model->priv->frozen)
- e_tree_model_node_inserted (E_TREE_MODEL(tree_model), parent_path, new_path);
- } else {
- priv->root = new_path;
- if (!tree_model->priv->frozen)
- e_tree_model_node_changed(E_TREE_MODEL(tree_model), new_path);
- }
-
- return new_path;
-}
-
-ETreePath e_tree_memory_node_insert_id (ETreeMemory *etree, ETreePath parent, int position, gpointer node_data, char *id)
-{
- return e_tree_memory_node_insert(etree, parent, position, node_data);
-}
-
-/**
- * e_tree_memory_node_insert_before:
- * @etree:
- * @parent:
- * @sibling:
- * @node_data:
- *
- *
- *
- * Return value:
- **/
-ETreePath
-e_tree_memory_node_insert_before (ETreeMemory *etree,
- ETreePath parent,
- ETreePath sibling,
- gpointer node_data)
-{
- ETreeMemoryPath *child;
- ETreeMemoryPath *parent_path = parent;
- ETreeMemoryPath *sibling_path = sibling;
- int position = 0;
-
- g_return_val_if_fail(etree != NULL, NULL);
-
- if (sibling != NULL) {
- for (child = parent_path->first_child; child; child = child->next_sibling) {
- if (child == sibling_path)
- break;
- position ++;
- }
- } else
- position = parent_path->num_children;
- return e_tree_memory_node_insert (etree, parent, position, node_data);
-}
-
-/* just blows away child data, doesn't take into account unlinking/etc */
-static void
-child_free(ETreeMemory *etree, ETreeMemoryPath *node)
-{
- ETreeMemoryPath *child, *next;
-
- child = node->first_child;
- while (child) {
- next = child->next_sibling;
- child_free(etree, child);
- child = next;
- }
-
- if (etree->priv->destroy_func) {
- etree->priv->destroy_func (node->node_data, etree->priv->destroy_user_data);
- }
-
- g_chunk_free(node, node_chunk);
-}
-
-/**
- * e_tree_memory_node_remove:
- * @etree:
- * @path:
- *
- *
- *
- * Return value:
- **/
-gpointer
-e_tree_memory_node_remove (ETreeMemory *etree, ETreePath node)
-{
- ETreeMemoryPath *path = node;
- ETreeMemoryPath *parent = path->parent;
- ETreeMemoryPath *sibling;
- gpointer ret = path->node_data;
- int old_position = 0;
-
- g_return_val_if_fail(etree != NULL, NULL);
-
- if (!etree->priv->frozen) {
- e_tree_model_pre_change(E_TREE_MODEL(etree));
- for (old_position = 0, sibling = path;
- sibling;
- old_position++, sibling = sibling->prev_sibling)
- /* Empty intentionally*/;
- old_position --;
- }
-
- /* unlink this node - we only have to unlink the root node being removed,
- since the others are only references from this node */
- e_tree_path_unlink (path);
-
- /*printf("removing %d nodes from position %d\n", visible, base);*/
- if (!etree->priv->frozen)
- e_tree_model_node_removed(E_TREE_MODEL(etree), parent, path, old_position);
-
- child_free(etree, path);
-
- if (path == etree->priv->root)
- etree->priv->root = NULL;
-
- if (!etree->priv->frozen)
- e_tree_model_node_deleted(E_TREE_MODEL(etree), path);
-
- return ret;
-}
-
-typedef struct {
- ETreeMemory *memory;
- gpointer closure;
- ETreeMemorySortCallback callback;
-} MemoryAndClosure;
-
-static int
-sort_callback(const void *data1, const void *data2, gpointer user_data)
-{
- ETreePath path1 = *(ETreePath *)data1;
- ETreePath path2 = *(ETreePath *)data2;
- MemoryAndClosure *mac = user_data;
- return (*mac->callback) (mac->memory, path1, path2, mac->closure);
-}
-
-void
-e_tree_memory_sort_node (ETreeMemory *etmm,
- ETreePath node,
- ETreeMemorySortCallback callback,
- gpointer user_data)
-{
- ETreeMemoryPath **children;
- ETreeMemoryPath *child;
- int count;
- int i;
- ETreeMemoryPath *path = node;
- MemoryAndClosure mac;
- ETreeMemoryPath *last;
-
- e_tree_model_pre_change (E_TREE_MODEL (etmm));
-
- i = 0;
- for (child = path->first_child; child; child = child->next_sibling)
- i++;
-
- children = g_new(ETreeMemoryPath *, i);
-
- count = i;
-
- for (child = path->first_child, i = 0;
- child;
- child = child->next_sibling, i++) {
- children[i] = child;
- }
-
- mac.memory = etmm;
- mac.closure = user_data;
- mac.callback = callback;
-
- e_sort (children, count, sizeof (ETreeMemoryPath *), sort_callback, &mac);
-
- path->first_child = NULL;
- last = NULL;
- for (i = 0;
- i < count;
- i++) {
- children[i]->prev_sibling = last;
- if (last)
- last->next_sibling = children[i];
- else
- path->first_child = children[i];
- last = children[i];
- }
- if (last)
- last->next_sibling = NULL;
-
- path->last_child = last;
-
- g_free(children);
-
- e_tree_model_node_changed(E_TREE_MODEL(etmm), node);
-}
-
-void
-e_tree_memory_set_node_destroy_func (ETreeMemory *etmm,
- GFunc destroy_func,
- gpointer user_data)
-{
- etmm->priv->destroy_func = destroy_func;
- etmm->priv->destroy_user_data = user_data;
-}
diff --git a/widgets/table/e-tree-memory.h b/widgets/table/e-tree-memory.h
deleted file mode 100644
index ce0003b60a..0000000000
--- a/widgets/table/e-tree-memory.h
+++ /dev/null
@@ -1,101 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-tree-memory.h
- * Copyright 2000, 2001, Ximian, Inc.
- *
- * Authors:
- * Chris Lahey <clahey@ximian.com>
- * Chris Toshok <toshok@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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.
- */
-
-#ifndef _E_TREE_MEMORY_H_
-#define _E_TREE_MEMORY_H_
-
-#include <gdk-pixbuf/gdk-pixbuf.h>
-#include <gal/e-table/e-tree-model.h>
-
-G_BEGIN_DECLS
-
-#define E_TREE_MEMORY_TYPE (e_tree_memory_get_type ())
-#define E_TREE_MEMORY(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), E_TREE_MEMORY_TYPE, ETreeMemory))
-#define E_TREE_MEMORY_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), E_TREE_MEMORY_TYPE, ETreeMemoryClass))
-#define E_IS_TREE_MEMORY(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), E_TREE_MEMORY_TYPE))
-#define E_IS_TREE_MEMORY_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), E_TREE_MEMORY_TYPE))
-#define E_TREE_MEMORY_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS((o), E_TREE_MEMORY_TYPE, ETreeMemoryClass))
-
-typedef struct ETreeMemory ETreeMemory;
-typedef struct ETreeMemoryPriv ETreeMemoryPriv;
-typedef struct ETreeMemoryClass ETreeMemoryClass;
-
-typedef int (*ETreeMemorySortCallback) (ETreeMemory *etmm, ETreePath path1, ETreePath path2, gpointer closure);
-
-struct ETreeMemory {
- ETreeModel base;
- ETreeMemoryPriv *priv;
-};
-
-struct ETreeMemoryClass {
- ETreeModelClass parent_class;
-
- /* signals */
- void (*fill_in_children) (ETreeMemory *model, ETreePath node);
-};
-
-
-GType e_tree_memory_get_type (void);
-void e_tree_memory_construct (ETreeMemory *etree);
-ETreeMemory *e_tree_memory_new (void);
-
-/* node operations */
-ETreePath e_tree_memory_node_insert (ETreeMemory *etree,
- ETreePath parent,
- int position,
- gpointer node_data);
-ETreePath e_tree_memory_node_insert_id (ETreeMemory *etree,
- ETreePath parent,
- int position,
- gpointer node_data,
- char *id);
-ETreePath e_tree_memory_node_insert_before (ETreeMemory *etree,
- ETreePath parent,
- ETreePath sibling,
- gpointer node_data);
-gpointer e_tree_memory_node_remove (ETreeMemory *etree,
- ETreePath path);
-
-/* Freeze and thaw */
-void e_tree_memory_freeze (ETreeMemory *etree);
-void e_tree_memory_thaw (ETreeMemory *etree);
-void e_tree_memory_set_expanded_default (ETreeMemory *etree,
- gboolean expanded);
-gpointer e_tree_memory_node_get_data (ETreeMemory *etm,
- ETreePath node);
-void e_tree_memory_node_set_data (ETreeMemory *etm,
- ETreePath node,
- gpointer node_data);
-void e_tree_memory_sort_node (ETreeMemory *etm,
- ETreePath node,
- ETreeMemorySortCallback callback,
- gpointer user_data);
-void e_tree_memory_set_node_destroy_func (ETreeMemory *etmm,
- GFunc destroy_func,
- gpointer user_data);
-
-G_END_DECLS
-
-#endif /* _E_TREE_MEMORY_H */
-
diff --git a/widgets/table/e-tree-model.c b/widgets/table/e-tree-model.c
deleted file mode 100644
index 6ca0e17af9..0000000000
--- a/widgets/table/e-tree-model.c
+++ /dev/null
@@ -1,1098 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-tree-model.c
- * Copyright 2000, 2001, Ximian, Inc.
- *
- * Authors:
- * Chris Lahey <clahey@ximian.com>
- * Chris Toshok <toshok@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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 <stdio.h>
-#include <errno.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <fcntl.h>
-
-#include <libxml/parser.h>
-#include <libxml/xmlmemory.h>
-
-#include <gtk/gtksignal.h>
-#include "gal/util/e-util.h"
-#include "gal/util/e-xml-utils.h"
-#include "e-tree-model.h"
-
-#define ETM_CLASS(e) (E_TREE_MODEL_GET_CLASS(e))
-
-#define d(x)
-
-static GObjectClass *parent_class;
-
-enum {
- PRE_CHANGE,
- NO_CHANGE,
- NODE_CHANGED,
- NODE_DATA_CHANGED,
- NODE_COL_CHANGED,
- NODE_INSERTED,
- NODE_REMOVED,
- NODE_DELETED,
- NODE_REQUEST_COLLAPSE,
- LAST_SIGNAL
-};
-
-static guint e_tree_model_signals [LAST_SIGNAL] = {0, };
-
-
-static void
-e_tree_model_class_init (GObjectClass *klass)
-{
- ETreeModelClass *tree_class = (ETreeModelClass *) klass;
-
- parent_class = g_type_class_peek_parent (klass);
-
- e_tree_model_signals [PRE_CHANGE] =
- g_signal_new ("pre_change",
- E_OBJECT_CLASS_TYPE (klass),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (ETreeModelClass, pre_change),
- (GSignalAccumulator) NULL, NULL,
- g_cclosure_marshal_VOID__VOID,
- G_TYPE_NONE, 0);
-
- e_tree_model_signals [NO_CHANGE] =
- g_signal_new ("no_change",
- E_OBJECT_CLASS_TYPE (klass),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (ETreeModelClass, no_change),
- (GSignalAccumulator) NULL, NULL,
- g_cclosure_marshal_VOID__VOID,
- G_TYPE_NONE, 0);
-
- e_tree_model_signals [NODE_CHANGED] =
- g_signal_new ("node_changed",
- E_OBJECT_CLASS_TYPE (klass),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (ETreeModelClass, node_changed),
- (GSignalAccumulator) NULL, NULL,
- g_cclosure_marshal_VOID__POINTER,
- G_TYPE_NONE, 1, G_TYPE_POINTER);
-
- e_tree_model_signals [NODE_DATA_CHANGED] =
- g_signal_new ("node_data_changed",
- E_OBJECT_CLASS_TYPE (klass),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (ETreeModelClass, node_data_changed),
- (GSignalAccumulator) NULL, NULL,
- g_cclosure_marshal_VOID__POINTER,
- G_TYPE_NONE, 1, G_TYPE_POINTER);
-
- e_tree_model_signals [NODE_COL_CHANGED] =
- g_signal_new ("node_col_changed",
- E_OBJECT_CLASS_TYPE (klass),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (ETreeModelClass, node_col_changed),
- (GSignalAccumulator) NULL, NULL,
- e_marshal_VOID__POINTER_INT,
- G_TYPE_NONE, 2, G_TYPE_POINTER, G_TYPE_INT);
-
- e_tree_model_signals [NODE_INSERTED] =
- g_signal_new ("node_inserted",
- E_OBJECT_CLASS_TYPE (klass),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (ETreeModelClass, node_inserted),
- (GSignalAccumulator) NULL, NULL,
- e_marshal_VOID__POINTER_POINTER,
- G_TYPE_NONE, 2, G_TYPE_POINTER, G_TYPE_POINTER);
-
- e_tree_model_signals [NODE_REMOVED] =
- g_signal_new ("node_removed",
- E_OBJECT_CLASS_TYPE (klass),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (ETreeModelClass, node_removed),
- (GSignalAccumulator) NULL, NULL,
- e_marshal_VOID__POINTER_POINTER_INT,
- G_TYPE_NONE, 3, G_TYPE_POINTER, G_TYPE_POINTER, G_TYPE_INT);
-
- e_tree_model_signals [NODE_DELETED] =
- g_signal_new ("node_deleted",
- E_OBJECT_CLASS_TYPE (klass),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (ETreeModelClass, node_deleted),
- (GSignalAccumulator) NULL, NULL,
- g_cclosure_marshal_VOID__POINTER,
- G_TYPE_NONE, 1, G_TYPE_POINTER);
-
- e_tree_model_signals [NODE_REQUEST_COLLAPSE] =
- g_signal_new ("node_request_collapse",
- E_OBJECT_CLASS_TYPE (klass),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (ETreeModelClass, node_request_collapse),
- (GSignalAccumulator) NULL, NULL,
- g_cclosure_marshal_VOID__POINTER,
- G_TYPE_NONE, 1, G_TYPE_POINTER);
-
- tree_class->get_root = NULL;
-
- tree_class->get_parent = NULL;
- tree_class->get_first_child = NULL;
- tree_class->get_last_child = NULL;
- tree_class->get_next = NULL;
- tree_class->get_prev = NULL;
-
- tree_class->is_root = NULL;
- tree_class->is_expandable = NULL;
- tree_class->get_children = NULL;
- tree_class->depth = NULL;
-
- tree_class->icon_at = NULL;
-
- tree_class->get_expanded_default = NULL;
- tree_class->column_count = NULL;
-
- tree_class->has_save_id = NULL;
- tree_class->get_save_id = NULL;
- tree_class->has_get_node_by_id = NULL;
- tree_class->get_node_by_id = NULL;
-
- tree_class->has_change_pending = NULL;
-
- tree_class->value_at = NULL;
- tree_class->set_value_at = NULL;
- tree_class->is_editable = NULL;
-
- tree_class->duplicate_value = NULL;
- tree_class->free_value = NULL;
- tree_class->initialize_value = NULL;
- tree_class->value_is_empty = NULL;
- tree_class->value_to_string = NULL;
-
- tree_class->pre_change = NULL;
- tree_class->no_change = NULL;
- tree_class->node_changed = NULL;
- tree_class->node_data_changed = NULL;
- tree_class->node_col_changed = NULL;
- tree_class->node_inserted = NULL;
- tree_class->node_removed = NULL;
- tree_class->node_deleted = NULL;
- tree_class->node_request_collapse = NULL;
-}
-
-E_MAKE_TYPE(e_tree_model, "ETreeModel", ETreeModel, e_tree_model_class_init, NULL, G_TYPE_OBJECT)
-
-
-/* signals */
-
-/**
- * e_tree_model_node_changed:
- * @tree_model:
- * @node:
- *
- *
- *
- * Return value:
- **/
-void
-e_tree_model_pre_change (ETreeModel *tree_model)
-{
- g_return_if_fail (tree_model != NULL);
- g_return_if_fail (E_IS_TREE_MODEL (tree_model));
-
- d(g_print("Emitting pre_change on model 0x%p, a %s.\n", tree_model, gtk_type_name (GTK_OBJECT(tree_model)->klass->type)));
-
- g_signal_emit (G_OBJECT (tree_model), e_tree_model_signals [PRE_CHANGE], 0);
-}
-
-/**
- * e_tree_model_node_changed:
- * @tree_model:
- * @node:
- *
- *
- *
- * Return value:
- **/
-void
-e_tree_model_no_change (ETreeModel *tree_model)
-{
- g_return_if_fail (tree_model != NULL);
- g_return_if_fail (E_IS_TREE_MODEL (tree_model));
-
- d(g_print("Emitting no_change on model 0x%p, a %s.\n", tree_model, gtk_type_name (GTK_OBJECT(tree_model)->klass->type)));
-
- g_signal_emit (G_OBJECT (tree_model), e_tree_model_signals [NO_CHANGE], 0);
-}
-
-/**
- * e_tree_model_node_changed:
- * @tree_model:
- * @node:
- *
- *
- *
- * Return value:
- **/
-void
-e_tree_model_node_changed (ETreeModel *tree_model, ETreePath node)
-{
- g_return_if_fail (tree_model != NULL);
- g_return_if_fail (E_IS_TREE_MODEL (tree_model));
-
- d(g_print("Emitting node_changed on model 0x%p, a %s.\n", tree_model, gtk_type_name (GTK_OBJECT(tree_model)->klass->type)));
-
- g_signal_emit (G_OBJECT (tree_model), e_tree_model_signals [NODE_CHANGED], 0, node);
-}
-
-/**
- * e_tree_model_node_data_changed:
- * @tree_model:
- * @node:
- *
- *
- *
- * Return value:
- **/
-void
-e_tree_model_node_data_changed (ETreeModel *tree_model, ETreePath node)
-{
- g_return_if_fail (tree_model != NULL);
- g_return_if_fail (E_IS_TREE_MODEL (tree_model));
-
- d(g_print("Emitting node_data_changed on model 0x%p, a %s.\n", tree_model, gtk_type_name (GTK_OBJECT(tree_model)->klass->type)));
-
- g_signal_emit (G_OBJECT (tree_model), e_tree_model_signals [NODE_DATA_CHANGED], 0, node);
-}
-
-/**
- * e_tree_model_node_col_changed:
- * @tree_model:
- * @node:
- *
- *
- *
- * Return value:
- **/
-void
-e_tree_model_node_col_changed (ETreeModel *tree_model, ETreePath node, int col)
-{
- g_return_if_fail (tree_model != NULL);
- g_return_if_fail (E_IS_TREE_MODEL (tree_model));
-
- d(g_print("Emitting node_col_changed on model 0x%p, a %s.\n", tree_model, gtk_type_name (GTK_OBJECT(tree_model)->klass->type)));
-
- g_signal_emit (G_OBJECT (tree_model), e_tree_model_signals [NODE_COL_CHANGED], 0, node, col);
-}
-
-/**
- * e_tree_model_node_inserted:
- * @tree_model:
- * @parent_node:
- * @inserted_node:
- *
- *
- **/
-void
-e_tree_model_node_inserted (ETreeModel *tree_model,
- ETreePath parent_node,
- ETreePath inserted_node)
-{
- g_return_if_fail (tree_model != NULL);
- g_return_if_fail (E_IS_TREE_MODEL (tree_model));
-
- d(g_print("Emitting node_inserted on model 0x%p, a %s.\n", tree_model, gtk_type_name (GTK_OBJECT(tree_model)->klass->type)));
-
- g_signal_emit (G_OBJECT (tree_model), e_tree_model_signals [NODE_INSERTED], 0,
- parent_node, inserted_node);
-}
-
-/**
- * e_tree_model_node_removed:
- * @tree_model:
- * @parent_node:
- * @removed_node:
- *
- *
- **/
-void
-e_tree_model_node_removed (ETreeModel *tree_model, ETreePath parent_node, ETreePath removed_node, int old_position)
-{
- g_return_if_fail (tree_model != NULL);
- g_return_if_fail (E_IS_TREE_MODEL (tree_model));
-
- d(g_print("Emitting node_removed on model 0x%p, a %s.\n", tree_model, gtk_type_name (GTK_OBJECT(tree_model)->klass->type)));
-
- g_signal_emit (G_OBJECT (tree_model), e_tree_model_signals [NODE_REMOVED], 0,
- parent_node, removed_node, old_position);
-}
-
-/**
- * e_tree_model_node_deleted:
- * @tree_model:
- * @deleted_node:
- *
- *
- **/
-void
-e_tree_model_node_deleted (ETreeModel *tree_model, ETreePath deleted_node)
-{
- g_return_if_fail (tree_model != NULL);
- g_return_if_fail (E_IS_TREE_MODEL (tree_model));
-
- d(g_print("Emitting node_deleted on model 0x%p, a %s.\n", tree_model, gtk_type_name (GTK_OBJECT(tree_model)->klass->type)));
-
- g_signal_emit (G_OBJECT (tree_model), e_tree_model_signals [NODE_DELETED], 0, deleted_node);
-}
-
-/**
- * e_tree_model_node_request_collapse:
- * @tree_model:
- * @collapsed_node:
- *
- *
- **/
-void
-e_tree_model_node_request_collapse (ETreeModel *tree_model, ETreePath collapsed_node)
-{
- g_return_if_fail (tree_model != NULL);
- g_return_if_fail (E_IS_TREE_MODEL (tree_model));
-
- d(g_print("Emitting node_request_collapse on model 0x%p, a %s.\n", tree_model, gtk_type_name (GTK_OBJECT(tree_model)->klass->type)));
-
- g_signal_emit (G_OBJECT (tree_model), e_tree_model_signals [NODE_REQUEST_COLLAPSE], 0, collapsed_node);
-}
-
-
-
-/**
- * e_tree_model_new
- *
- * XXX docs here.
- *
- * return values: a newly constructed ETreeModel.
- */
-ETreeModel *
-e_tree_model_new ()
-{
- return (ETreeModel *) g_object_new (E_TREE_MODEL_TYPE, NULL);
-}
-
-/**
- * e_tree_model_get_root
- * @etree: the ETreeModel of which we want the root node.
- *
- * Accessor for the root node of @etree.
- *
- * return values: the ETreePath corresponding to the root node.
- */
-ETreePath
-e_tree_model_get_root (ETreeModel *etree)
-{
- g_return_val_if_fail (etree != NULL, NULL);
- g_return_val_if_fail (E_IS_TREE_MODEL (etree), NULL);
-
- if (ETM_CLASS(etree)->get_root)
- return ETM_CLASS(etree)->get_root(etree);
- else
- return NULL;
-}
-
-/**
- * e_tree_model_node_get_parent:
- * @etree:
- * @path:
- *
- *
- *
- * Return value:
- **/
-ETreePath
-e_tree_model_node_get_parent (ETreeModel *etree, ETreePath node)
-{
- g_return_val_if_fail(etree != NULL, NULL);
- if (ETM_CLASS(etree)->get_parent)
- return ETM_CLASS(etree)->get_parent(etree, node);
- else
- return NULL;
-}
-
-/**
- * e_tree_model_node_get_first_child:
- * @etree:
- * @node:
- *
- *
- *
- * Return value:
- **/
-ETreePath
-e_tree_model_node_get_first_child (ETreeModel *etree, ETreePath node)
-{
- g_return_val_if_fail (etree != NULL, NULL);
- g_return_val_if_fail (E_IS_TREE_MODEL (etree), NULL);
-
- if (ETM_CLASS(etree)->get_first_child)
- return ETM_CLASS(etree)->get_first_child(etree, node);
- else
- return NULL;
-}
-
-/**
- * e_tree_model_node_get_last_child:
- * @etree:
- * @node:
- *
- *
- *
- * Return value:
- **/
-ETreePath
-e_tree_model_node_get_last_child (ETreeModel *etree, ETreePath node)
-{
- g_return_val_if_fail (etree != NULL, NULL);
- g_return_val_if_fail (E_IS_TREE_MODEL (etree), NULL);
-
- if (ETM_CLASS(etree)->get_last_child)
- return ETM_CLASS(etree)->get_last_child(etree, node);
- else
- return NULL;
-}
-
-
-/**
- * e_tree_model_node_get_next:
- * @etree:
- * @node:
- *
- *
- *
- * Return value:
- **/
-ETreePath
-e_tree_model_node_get_next (ETreeModel *etree, ETreePath node)
-{
- g_return_val_if_fail (etree != NULL, NULL);
- g_return_val_if_fail (E_IS_TREE_MODEL (etree), NULL);
-
- if (ETM_CLASS(etree)->get_next)
- return ETM_CLASS(etree)->get_next(etree, node);
- else
- return NULL;
-}
-
-/**
- * e_tree_model_node_get_prev:
- * @etree:
- * @node:
- *
- *
- *
- * Return value:
- **/
-ETreePath
-e_tree_model_node_get_prev (ETreeModel *etree, ETreePath node)
-{
- g_return_val_if_fail (etree != NULL, NULL);
- g_return_val_if_fail (E_IS_TREE_MODEL (etree), NULL);
-
- if (ETM_CLASS(etree)->get_prev)
- return ETM_CLASS(etree)->get_prev(etree, node);
- else
- return NULL;
-}
-
-/**
- * e_tree_model_node_is_root:
- * @etree:
- * @path:
- *
- *
- *
- * Return value:
- **/
-gboolean
-e_tree_model_node_is_root (ETreeModel *etree, ETreePath node)
-{
- g_return_val_if_fail(etree != NULL, FALSE);
-
- if (ETM_CLASS(etree)->is_root)
- return ETM_CLASS(etree)->is_root(etree, node);
- else
- return FALSE;
-}
-
-/**
- * e_tree_model_node_is_expandable:
- * @etree:
- * @path:
- *
- *
- *
- * Return value:
- **/
-gboolean
-e_tree_model_node_is_expandable (ETreeModel *etree, ETreePath node)
-{
- g_return_val_if_fail(etree != NULL, FALSE);
- g_return_val_if_fail(node != NULL, FALSE);
-
- if (ETM_CLASS(etree)->is_expandable)
- return ETM_CLASS(etree)->is_expandable(etree, node);
- else
- return FALSE;
-}
-
-guint
-e_tree_model_node_get_children (ETreeModel *etree, ETreePath node, ETreePath **nodes)
-{
- g_return_val_if_fail(etree != NULL, 0);
- if (ETM_CLASS(etree)->get_children)
- return ETM_CLASS(etree)->get_children (etree, node, nodes);
- else
- return 0;
-}
-
-/**
- * e_tree_model_node_depth:
- * @etree:
- * @path:
- *
- *
- *
- * Return value:
- **/
-guint
-e_tree_model_node_depth (ETreeModel *etree, ETreePath node)
-{
- g_return_val_if_fail (etree != NULL, 0);
- g_return_val_if_fail (E_IS_TREE_MODEL (etree), 0);
-
- if (ETM_CLASS(etree)->depth)
- return ETM_CLASS(etree)->depth(etree, node);
- else
- return 0;
-}
-
-/**
- * e_tree_model_icon_at
- * @etree: The ETreeModel.
- * @path: The ETreePath to the node we're getting the icon of.
- *
- * XXX docs here.
- *
- * return values: the GdkPixbuf associated with this node.
- */
-GdkPixbuf *
-e_tree_model_icon_at (ETreeModel *etree, ETreePath node)
-{
- g_return_val_if_fail (etree != NULL, NULL);
- g_return_val_if_fail (E_IS_TREE_MODEL (etree), NULL);
-
- if (ETM_CLASS(etree)->icon_at)
- return ETM_CLASS(etree)->icon_at (etree, node);
- else
- return NULL;
-}
-
-/**
- * e_tree_model_get_expanded_default
- * @etree: The ETreeModel.
- *
- * XXX docs here.
- *
- * return values: Whether nodes should be expanded by default.
- */
-gboolean
-e_tree_model_get_expanded_default (ETreeModel *etree)
-{
- g_return_val_if_fail (etree != NULL, FALSE);
- g_return_val_if_fail (E_IS_TREE_MODEL (etree), FALSE);
-
- if (ETM_CLASS(etree)->get_expanded_default)
- return ETM_CLASS(etree)->get_expanded_default (etree);
- else
- return FALSE;
-}
-
-/**
- * e_tree_model_column_count
- * @etree: The ETreeModel.
- *
- * XXX docs here.
- *
- * return values: The number of columns
- */
-gint
-e_tree_model_column_count (ETreeModel *etree)
-{
- g_return_val_if_fail (etree != NULL, 0);
- g_return_val_if_fail (E_IS_TREE_MODEL (etree), 0);
-
- if (ETM_CLASS(etree)->column_count)
- return ETM_CLASS(etree)->column_count (etree);
- else
- return 0;
-}
-
-/**
- * e_tree_model_has_save_id
- * @etree: The ETreeModel.
- *
- * XXX docs here.
- *
- * return values: Whether this tree has valid save id data.
- */
-gboolean
-e_tree_model_has_save_id (ETreeModel *etree)
-{
- g_return_val_if_fail (etree != NULL, FALSE);
- g_return_val_if_fail (E_IS_TREE_MODEL (etree), FALSE);
-
- if (ETM_CLASS(etree)->has_save_id)
- return ETM_CLASS(etree)->has_save_id (etree);
- else
- return FALSE;
-}
-
-/**
- * e_tree_model_get_save_id
- * @etree: The ETreeModel.
- * @node: The ETreePath.
- *
- * XXX docs here.
- *
- * return values: The save id for this path.
- */
-gchar *
-e_tree_model_get_save_id (ETreeModel *etree, ETreePath node)
-{
- g_return_val_if_fail (etree != NULL, NULL);
- g_return_val_if_fail (E_IS_TREE_MODEL (etree), NULL);
-
- if (ETM_CLASS(etree)->get_save_id)
- return ETM_CLASS(etree)->get_save_id (etree, node);
- else
- return NULL;
-}
-
-/**
- * e_tree_model_has_get_node_by_id
- * @etree: The ETreeModel.
- *
- * XXX docs here.
- *
- * return values: Whether this tree can quickly get a node from its save id.
- */
-gboolean
-e_tree_model_has_get_node_by_id (ETreeModel *etree)
-{
- g_return_val_if_fail (etree != NULL, FALSE);
- g_return_val_if_fail (E_IS_TREE_MODEL (etree), FALSE);
-
- if (ETM_CLASS(etree)->has_get_node_by_id)
- return ETM_CLASS(etree)->has_get_node_by_id (etree);
- else
- return FALSE;
-}
-
-/**
- * e_tree_model_get_node_by_id
- * @etree: The ETreeModel.
- * @node: The ETreePath.
- *
- * get_node_by_id(get_save_id(node)) should be the original node.
- * Likewise if get_node_by_id is not NULL, then
- * get_save_id(get_node_by_id(string)) should be a copy of the
- * original string.
- *
- * return values: The path for this save id.
- */
-ETreePath
-e_tree_model_get_node_by_id (ETreeModel *etree, const char *save_id)
-{
- g_return_val_if_fail (etree != NULL, NULL);
- g_return_val_if_fail (E_IS_TREE_MODEL (etree), NULL);
-
- if (ETM_CLASS(etree)->get_node_by_id)
- return ETM_CLASS(etree)->get_node_by_id (etree, save_id);
- else
- return NULL;
-}
-
-/**
- * e_tree_model_has_change_pending
- * @etree: The ETreeModel.
- *
- * XXX docs here.
- *
- * return values: Whether this tree has valid save id data.
- */
-gboolean
-e_tree_model_has_change_pending (ETreeModel *etree)
-{
- g_return_val_if_fail (etree != NULL, FALSE);
- g_return_val_if_fail (E_IS_TREE_MODEL (etree), FALSE);
-
- if (ETM_CLASS(etree)->has_change_pending)
- return ETM_CLASS(etree)->has_change_pending (etree);
- else
- return FALSE;
-}
-
-/**
- * e_tree_model_value_at:
- * @etree: The ETreeModel.
- * @node: The ETreePath to the node we're getting the data from.
- * @col: the column to retrieve data from
- *
- * Return value: This function returns the value that is stored by the
- * @etree in column @col and node @node. The data returned can be a
- * pointer or any data value that can be stored inside a pointer.
- *
- * The data returned is typically used by an ECell renderer.
- *
- * The data returned must be valid until the model sends a signal that
- * affect that piece of data. node_changed and node_deleted affect
- * all data in tha t node and all nodes under that node.
- * node_data_changed affects the data in that node. node_col_changed
- * affects the data in that node for that column. node_inserted,
- * node_removed, and no_change don't affect any data in this way.
- **/
-void *
-e_tree_model_value_at (ETreeModel *etree, ETreePath node, int col)
-{
- g_return_val_if_fail (etree != NULL, NULL);
- g_return_val_if_fail (E_IS_TREE_MODEL (etree), NULL);
-
- if (ETM_CLASS(etree)->value_at)
- return ETM_CLASS(etree)->value_at (etree, node, col);
- else
- return NULL;
-}
-
-/**
- * e_tree_model_icon_of_node
- * @etree: The ETreeModel.
- * @path: The ETreePath to the node we're getting the icon of.
- *
- * XXX docs here.
- *
- * return values: the GdkPixbuf associated with this node.
- */
-void
-e_tree_model_set_value_at (ETreeModel *etree, ETreePath node, int col, const void *val)
-{
- g_return_if_fail (etree != NULL);
- g_return_if_fail (E_IS_TREE_MODEL (etree));
-
- if (ETM_CLASS(etree)->set_value_at)
- ETM_CLASS(etree)->set_value_at (etree, node, col, val);
-}
-
-/**
- * e_tree_model_node_is_editable:
- * @etree:
- * @path:
- *
- *
- *
- * Return value:
- **/
-gboolean
-e_tree_model_node_is_editable (ETreeModel *etree, ETreePath node, int col)
-{
- g_return_val_if_fail(etree != NULL, FALSE);
-
- if (ETM_CLASS(etree)->is_editable)
- return ETM_CLASS(etree)->is_editable(etree, node, col);
- else
- return FALSE;
-}
-
-/**
- * e_tree_model_duplicate_value:
- * @etree:
- * @path:
- *
- *
- *
- * Return value:
- **/
-void *
-e_tree_model_duplicate_value (ETreeModel *etree, int col, const void *value)
-{
- g_return_val_if_fail(etree != NULL, NULL);
-
- if (ETM_CLASS(etree)->duplicate_value)
- return ETM_CLASS(etree)->duplicate_value(etree, col, value);
- else
- return NULL;
-}
-
-/**
- * e_tree_model_free_value:
- * @etree:
- * @path:
- *
- *
- *
- * Return value:
- **/
-void
-e_tree_model_free_value (ETreeModel *etree, int col, void *value)
-{
- g_return_if_fail(etree != NULL);
-
- if (ETM_CLASS(etree)->free_value)
- ETM_CLASS(etree)->free_value(etree, col, value);
-}
-
-/**
- * e_tree_model_initialize_value:
- * @etree:
- * @path:
- *
- *
- *
- * Return value:
- **/
-void *
-e_tree_model_initialize_value (ETreeModel *etree, int col)
-{
- g_return_val_if_fail(etree != NULL, NULL);
-
- if (ETM_CLASS(etree)->initialize_value)
- return ETM_CLASS(etree)->initialize_value(etree, col);
- else
- return NULL;
-}
-
-/**
- * e_tree_model_value_is_empty:
- * @etree:
- * @path:
- *
- *
- *
- * Return value:
- **/
-gboolean
-e_tree_model_value_is_empty (ETreeModel *etree, int col, const void *value)
-{
- g_return_val_if_fail(etree != NULL, TRUE);
-
- if (ETM_CLASS(etree)->value_is_empty)
- return ETM_CLASS(etree)->value_is_empty(etree, col, value);
- else
- return TRUE;
-}
-
-/**
- * e_tree_model_value_to_string:
- * @etree:
- * @path:
- *
- *
- *
- * Return value:
- **/
-char *
-e_tree_model_value_to_string (ETreeModel *etree, int col, const void *value)
-{
- g_return_val_if_fail(etree != NULL, g_strdup(""));
-
- if (ETM_CLASS(etree)->value_to_string)
- return ETM_CLASS(etree)->value_to_string(etree, col, value);
- else
- return g_strdup("");
-}
-
-/**
- * e_tree_model_node_traverse:
- * @model:
- * @path:
- * @func:
- * @data:
- *
- *
- **/
-void
-e_tree_model_node_traverse (ETreeModel *model, ETreePath path, ETreePathFunc func, gpointer data)
-{
- ETreePath child;
-
- g_return_if_fail (model != NULL);
- g_return_if_fail (E_IS_TREE_MODEL (model));
- g_return_if_fail (path != NULL);
-
- child = e_tree_model_node_get_first_child (model, path);
-
- while (child) {
- ETreePath next_child;
-
- next_child = e_tree_model_node_get_next (model, child);
- e_tree_model_node_traverse (model, child, func, data);
- if (func (model, child, data))
- return;
-
- child = next_child;
- }
-}
-
-/**
- * e_tree_model_node_traverse_preorder:
- * @model:
- * @path:
- * @func:
- * @data:
- *
- *
- **/
-void
-e_tree_model_node_traverse_preorder (ETreeModel *model, ETreePath path, ETreePathFunc func, gpointer data)
-{
- ETreePath child;
-
- g_return_if_fail (model != NULL);
- g_return_if_fail (E_IS_TREE_MODEL (model));
- g_return_if_fail (path != NULL);
-
- child = e_tree_model_node_get_first_child (model, path);
-
- while (child) {
- ETreePath next_child;
-
- if (func (model, child, data))
- return;
-
- next_child = e_tree_model_node_get_next (model, child);
- e_tree_model_node_traverse_preorder (model, child, func, data);
-
- child = next_child;
- }
-}
-
-/**
- * e_tree_model_node_traverse_preorder:
- * @model:
- * @path:
- * @func:
- * @data:
- *
- *
- **/
-static ETreePath
-e_tree_model_node_real_traverse (ETreeModel *model, ETreePath path, ETreePath end_path, gboolean forward_direction, ETreePathFunc func, gpointer data)
-{
- ETreePath child;
-
- g_return_val_if_fail (model != NULL, NULL);
- g_return_val_if_fail (E_IS_TREE_MODEL (model), NULL);
- g_return_val_if_fail (path != NULL, NULL);
-
- if (forward_direction)
- child = e_tree_model_node_get_first_child (model, path);
- else
- child = e_tree_model_node_get_last_child (model, path);
-
- while (child) {
- ETreePath result;
-
- if (forward_direction && (child == end_path || func (model, child, data)))
- return child;
-
- if ((result = e_tree_model_node_real_traverse (model, child, end_path, forward_direction, func, data)))
- return result;
-
- if (!forward_direction && (child == end_path || func (model, child, data)))
- return child;
-
- if (forward_direction)
- child = e_tree_model_node_get_next (model, child);
- else
- child = e_tree_model_node_get_prev (model, child);
- }
- return NULL;
-}
-
-/**
- * e_tree_model_node_traverse_preorder:
- * @model:
- * @path:
- * @func:
- * @data:
- *
- *
- **/
-ETreePath
-e_tree_model_node_find (ETreeModel *model, ETreePath path, ETreePath end_path, gboolean forward_direction, ETreePathFunc func, gpointer data)
-{
- ETreePath result;
- ETreePath next;
-
- g_return_val_if_fail (model != NULL, NULL);
- g_return_val_if_fail (E_IS_TREE_MODEL (model), NULL);
-
- /* Just search the whole tree in this case. */
- if (path == NULL) {
- ETreePath root;
- root = e_tree_model_get_root (model);
-
- if (forward_direction && (end_path == root || func (model, root, data)))
- return root;
-
- if ((result = e_tree_model_node_real_traverse (model, root, end_path, forward_direction, func, data)))
- return result;
-
- if (!forward_direction && (end_path == root || func (model, root, data)))
- return root;
-
- return NULL;
- }
-
- while (1) {
-
- if (forward_direction) {
- if ((result = e_tree_model_node_real_traverse (model, path, end_path, forward_direction, func, data)))
- return result;
- next = e_tree_model_node_get_next (model, path);
- } else {
- next = e_tree_model_node_get_prev (model, path);
- if (next && (result = e_tree_model_node_real_traverse (model, next, end_path, forward_direction, func, data)))
- return result;
- }
-
- while (next == NULL) {
- path = e_tree_model_node_get_parent (model, path);
-
- if (path == NULL)
- return NULL;
-
- if (forward_direction)
- next = e_tree_model_node_get_next (model, path);
- else
- next = path;
- }
-
- if (end_path == next || func (model, next, data))
- return next;
-
- path = next;
- }
-}
-
diff --git a/widgets/table/e-tree-model.h b/widgets/table/e-tree-model.h
deleted file mode 100644
index c9574388e1..0000000000
--- a/widgets/table/e-tree-model.h
+++ /dev/null
@@ -1,227 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-tree-model.h
- * Copyright 2000, 2001, Ximian, Inc.
- *
- * Authors:
- * Chris Lahey <clahey@ximian.com>
- * Chris Toshok <toshok@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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.
- */
-
-#ifndef _E_TREE_MODEL_H_
-#define _E_TREE_MODEL_H_
-
-#include <gdk-pixbuf/gdk-pixbuf.h>
-#include <glib-object.h>
-
-
-G_BEGIN_DECLS
-
-
-#define E_TREE_MODEL_TYPE (e_tree_model_get_type ())
-#define E_TREE_MODEL(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), E_TREE_MODEL_TYPE, ETreeModel))
-#define E_TREE_MODEL_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), E_TREE_MODEL_TYPE, ETreeModelClass))
-#define E_IS_TREE_MODEL(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), E_TREE_MODEL_TYPE))
-#define E_IS_TREE_MODEL_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), E_TREE_MODEL_TYPE))
-#define E_TREE_MODEL_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS((o), E_TREE_MODEL_TYPE, ETreeModelClass))
-
-typedef void * ETreePath;
-typedef struct ETreeModel ETreeModel;
-typedef struct ETreeModelClass ETreeModelClass;
-typedef gint (*ETreePathCompareFunc)(ETreeModel *model, ETreePath path1, ETreePath path2);
-typedef gboolean (*ETreePathFunc)(ETreeModel *model, ETreePath path, gpointer data);
-
-struct ETreeModel {
- GObject base;
-};
-
-struct ETreeModelClass {
- GObjectClass parent_class;
-
- /*
- * Virtual methods
- */
- ETreePath (*get_root) (ETreeModel *etm);
-
- ETreePath (*get_parent) (ETreeModel *etm, ETreePath node);
- ETreePath (*get_first_child) (ETreeModel *etm, ETreePath node);
- ETreePath (*get_last_child) (ETreeModel *etm, ETreePath node);
- ETreePath (*get_next) (ETreeModel *etm, ETreePath node);
- ETreePath (*get_prev) (ETreeModel *etm, ETreePath node);
-
- gboolean (*is_root) (ETreeModel *etm, ETreePath node);
- gboolean (*is_expandable) (ETreeModel *etm, ETreePath node);
- guint (*get_children) (ETreeModel *etm, ETreePath node, ETreePath **paths);
- guint (*depth) (ETreeModel *etm, ETreePath node);
-
- GdkPixbuf *(*icon_at) (ETreeModel *etm, ETreePath node);
-
- gboolean (*get_expanded_default) (ETreeModel *etm);
- gint (*column_count) (ETreeModel *etm);
-
- gboolean (*has_save_id) (ETreeModel *etm);
- gchar *(*get_save_id) (ETreeModel *etm, ETreePath node);
-
- gboolean (*has_get_node_by_id) (ETreeModel *etm);
- ETreePath (*get_node_by_id) (ETreeModel *etm, const char *save_id);
-
- gboolean (*has_change_pending) (ETreeModel *etm);
-
- /*
- * ETable analogs
- */
- void *(*value_at) (ETreeModel *etm, ETreePath node, int col);
- void (*set_value_at) (ETreeModel *etm, ETreePath node, int col, const void *val);
- gboolean (*is_editable) (ETreeModel *etm, ETreePath node, int col);
-
- void *(*duplicate_value) (ETreeModel *etm, int col, const void *value);
- void (*free_value) (ETreeModel *etm, int col, void *value);
- void *(*initialize_value) (ETreeModel *etm, int col);
- gboolean (*value_is_empty) (ETreeModel *etm, int col, const void *value);
- char *(*value_to_string) (ETreeModel *etm, int col, const void *value);
-
- /*
- * Signals
- */
-
- /* During node_remove, the ETreePath of the child is removed
- * from the tree but is still a valid ETreePath. At
- * node_deleted, the ETreePath is no longer valid.
- */
-
- void (*pre_change) (ETreeModel *etm);
- void (*no_change) (ETreeModel *etm);
- void (*node_changed) (ETreeModel *etm, ETreePath node);
- void (*node_data_changed) (ETreeModel *etm, ETreePath node);
- void (*node_col_changed) (ETreeModel *etm, ETreePath node, int col);
- void (*node_inserted) (ETreeModel *etm, ETreePath parent, ETreePath inserted_node);
- void (*node_removed) (ETreeModel *etm, ETreePath parent, ETreePath removed_node, int old_position);
- void (*node_deleted) (ETreeModel *etm, ETreePath deleted_node);
-
- /* This signal requests that any viewers of the tree that
- * collapse and expand nodes collapse this node.
- */
- void (*node_request_collapse) (ETreeModel *etm, ETreePath node);
-};
-
-
-GType e_tree_model_get_type (void);
-ETreeModel *e_tree_model_new (void);
-
-/* tree traversal operations */
-ETreePath e_tree_model_get_root (ETreeModel *etree);
-ETreePath e_tree_model_node_get_parent (ETreeModel *etree,
- ETreePath path);
-ETreePath e_tree_model_node_get_first_child (ETreeModel *etree,
- ETreePath path);
-ETreePath e_tree_model_node_get_last_child (ETreeModel *etree,
- ETreePath path);
-ETreePath e_tree_model_node_get_next (ETreeModel *etree,
- ETreePath path);
-ETreePath e_tree_model_node_get_prev (ETreeModel *etree,
- ETreePath path);
-
-/* node accessors */
-gboolean e_tree_model_node_is_root (ETreeModel *etree,
- ETreePath path);
-gboolean e_tree_model_node_is_expandable (ETreeModel *etree,
- ETreePath path);
-guint e_tree_model_node_get_children (ETreeModel *etree,
- ETreePath path,
- ETreePath **paths);
-guint e_tree_model_node_depth (ETreeModel *etree,
- ETreePath path);
-GdkPixbuf *e_tree_model_icon_at (ETreeModel *etree,
- ETreePath path);
-gboolean e_tree_model_get_expanded_default (ETreeModel *model);
-gint e_tree_model_column_count (ETreeModel *model);
-gboolean e_tree_model_has_save_id (ETreeModel *model);
-gchar *e_tree_model_get_save_id (ETreeModel *model,
- ETreePath node);
-gboolean e_tree_model_has_get_node_by_id (ETreeModel *model);
-ETreePath e_tree_model_get_node_by_id (ETreeModel *model,
- const char *save_id);
-gboolean e_tree_model_has_change_pending (ETreeModel *model);
-void *e_tree_model_value_at (ETreeModel *etree,
- ETreePath node,
- int col);
-void e_tree_model_set_value_at (ETreeModel *etree,
- ETreePath node,
- int col,
- const void *val);
-gboolean e_tree_model_node_is_editable (ETreeModel *etree,
- ETreePath node,
- int col);
-void *e_tree_model_duplicate_value (ETreeModel *etree,
- int col,
- const void *value);
-void e_tree_model_free_value (ETreeModel *etree,
- int col,
- void *value);
-void *e_tree_model_initialize_value (ETreeModel *etree,
- int col);
-gboolean e_tree_model_value_is_empty (ETreeModel *etree,
- int col,
- const void *value);
-char *e_tree_model_value_to_string (ETreeModel *etree,
- int col,
- const void *value);
-
-/* depth first traversal of path's descendents, calling func on each one */
-void e_tree_model_node_traverse (ETreeModel *model,
- ETreePath path,
- ETreePathFunc func,
- gpointer data);
-void e_tree_model_node_traverse_preorder (ETreeModel *model,
- ETreePath path,
- ETreePathFunc func,
- gpointer data);
-ETreePath e_tree_model_node_find (ETreeModel *model,
- ETreePath path,
- ETreePath end_path,
- gboolean forward_direction,
- ETreePathFunc func,
- gpointer data);
-
-/*
-** Routines for emitting signals on the ETreeModel
-*/
-void e_tree_model_pre_change (ETreeModel *tree_model);
-void e_tree_model_no_change (ETreeModel *tree_model);
-void e_tree_model_node_changed (ETreeModel *tree_model,
- ETreePath node);
-void e_tree_model_node_data_changed (ETreeModel *tree_model,
- ETreePath node);
-void e_tree_model_node_col_changed (ETreeModel *tree_model,
- ETreePath node,
- int col);
-void e_tree_model_node_inserted (ETreeModel *tree_model,
- ETreePath parent_node,
- ETreePath inserted_node);
-void e_tree_model_node_removed (ETreeModel *tree_model,
- ETreePath parent_node,
- ETreePath removed_node,
- int old_position);
-void e_tree_model_node_deleted (ETreeModel *tree_model,
- ETreePath deleted_node);
-void e_tree_model_node_request_collapse (ETreeModel *tree_model,
- ETreePath deleted_node);
-
-
-G_END_DECLS
-
-#endif /* _E_TREE_MODEL_H */
diff --git a/widgets/table/e-tree-scrolled.c b/widgets/table/e-tree-scrolled.c
deleted file mode 100644
index a72a246b69..0000000000
--- a/widgets/table/e-tree-scrolled.c
+++ /dev/null
@@ -1,228 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-tree-scrolled.c
- * Copyright 2000, 2001, Ximian, Inc.
- *
- * Authors:
- * Chris Lahey <clahey@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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 <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <stdio.h>
-#include <libgnomecanvas/gnome-canvas.h>
-#include <gtk/gtksignal.h>
-#include <libxml/parser.h>
-#include <libxml/xmlmemory.h>
-#include <gal/util/e-util.h>
-#include <gal/util/e-i18n.h>
-
-#include "e-tree-scrolled.h"
-
-#define COLUMN_HEADER_HEIGHT 16
-
-#define PARENT_TYPE gtk_scrolled_window_get_type ()
-
-static GtkObjectClass *parent_class;
-
-enum {
- PROP_0,
- PROP_TREE
-};
-
-static void
-e_tree_scrolled_init (GtkObject *object)
-{
- ETreeScrolled *ets;
- GtkScrolledWindow *scrolled_window;
-
- ets = E_TREE_SCROLLED (object);
- scrolled_window = GTK_SCROLLED_WINDOW (object);
-
- GTK_WIDGET_SET_FLAGS (ets, GTK_CAN_FOCUS);
-
- ets->tree = g_object_new (E_TREE_TYPE, NULL);
-
- gtk_scrolled_window_set_policy (scrolled_window, GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
- gtk_scrolled_window_set_shadow_type (scrolled_window, GTK_SHADOW_IN);
-}
-
-static void
-e_tree_scrolled_real_construct (ETreeScrolled *ets)
-{
- gtk_container_add(GTK_CONTAINER(ets), GTK_WIDGET(ets->tree));
-
- gtk_widget_show(GTK_WIDGET(ets->tree));
-}
-
-ETreeScrolled *e_tree_scrolled_construct (ETreeScrolled *ets,
- ETreeModel *etm,
- ETableExtras *ete,
- const char *spec,
- const char *state)
-{
- g_return_val_if_fail(ets != NULL, NULL);
- g_return_val_if_fail(E_IS_TREE_SCROLLED(ets), NULL);
- g_return_val_if_fail(etm != NULL, NULL);
- g_return_val_if_fail(E_IS_TREE_MODEL(etm), NULL);
- g_return_val_if_fail(ete == NULL || E_IS_TABLE_EXTRAS(ete), NULL);
- g_return_val_if_fail(spec != NULL, NULL);
-
- e_tree_construct(ets->tree, etm, ete, spec, state);
-
- e_tree_scrolled_real_construct(ets);
-
- return ets;
-}
-
-GtkWidget *e_tree_scrolled_new (ETreeModel *etm,
- ETableExtras *ete,
- const char *spec,
- const char *state)
-{
- ETreeScrolled *ets;
-
- g_return_val_if_fail(etm != NULL, NULL);
- g_return_val_if_fail(E_IS_TREE_MODEL(etm), NULL);
- g_return_val_if_fail(ete == NULL || E_IS_TABLE_EXTRAS(ete), NULL);
- g_return_val_if_fail(spec != NULL, NULL);
-
- ets = E_TREE_SCROLLED (gtk_widget_new (e_tree_scrolled_get_type (),
- "hadjustment", NULL,
- "vadjustment", NULL,
- NULL));
-
- ets = e_tree_scrolled_construct (ets, etm, ete, spec, state);
-
- return GTK_WIDGET (ets);
-}
-
-ETreeScrolled *e_tree_scrolled_construct_from_spec_file (ETreeScrolled *ets,
- ETreeModel *etm,
- ETableExtras *ete,
- const char *spec_fn,
- const char *state_fn)
-{
- g_return_val_if_fail(ets != NULL, NULL);
- g_return_val_if_fail(E_IS_TREE_SCROLLED(ets), NULL);
- g_return_val_if_fail(etm != NULL, NULL);
- g_return_val_if_fail(E_IS_TREE_MODEL(etm), NULL);
- g_return_val_if_fail(ete == NULL || E_IS_TABLE_EXTRAS(ete), NULL);
- g_return_val_if_fail(spec_fn != NULL, NULL);
-
- e_tree_construct_from_spec_file(ets->tree, etm, ete, spec_fn, state_fn);
-
- e_tree_scrolled_real_construct(ets);
-
- return ets;
-}
-
-GtkWidget *e_tree_scrolled_new_from_spec_file (ETreeModel *etm,
- ETableExtras *ete,
- const char *spec_fn,
- const char *state_fn)
-{
- ETreeScrolled *ets;
-
- g_return_val_if_fail(etm != NULL, NULL);
- g_return_val_if_fail(E_IS_TREE_MODEL(etm), NULL);
- g_return_val_if_fail(ete == NULL || E_IS_TABLE_EXTRAS(ete), NULL);
- g_return_val_if_fail(spec_fn != NULL, NULL);
-
- ets = E_TREE_SCROLLED (gtk_widget_new (e_tree_scrolled_get_type (),
- "hadjustment", NULL,
- "vadjustment", NULL,
- NULL));
- ets = e_tree_scrolled_construct_from_spec_file (ets, etm, ete, spec_fn, state_fn);
-
- return GTK_WIDGET (ets);
-}
-
-ETree *
-e_tree_scrolled_get_tree (ETreeScrolled *ets)
-{
- return ets->tree;
-}
-
-static void
-ets_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec)
-{
- ETreeScrolled *ets = E_TREE_SCROLLED (object);
-
- switch (prop_id){
- case PROP_TREE:
- g_value_set_object (value, ets->tree);
- break;
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
- break;
- }
-}
-
-/* Grab_focus handler for the scrolled ETree */
-static void
-ets_grab_focus (GtkWidget *widget)
-{
- ETreeScrolled *ets;
-
- ets = E_TREE_SCROLLED (widget);
-
- gtk_widget_grab_focus (GTK_WIDGET (ets->tree));
-}
-
-/* Focus handler for the scrolled ETree */
-static gint
-ets_focus (GtkWidget *container, GtkDirectionType direction)
-{
- ETreeScrolled *ets;
-
- ets = E_TREE_SCROLLED (container);
-
- return gtk_widget_child_focus (GTK_WIDGET (ets->tree), direction);
-}
-
-static void
-e_tree_scrolled_class_init (ETreeScrolledClass *class)
-{
- GObjectClass *object_class;
- GtkWidgetClass *widget_class;
- GtkContainerClass *container_class;
-
- object_class = (GObjectClass *) class;
- widget_class = (GtkWidgetClass *) class;
- container_class = (GtkContainerClass *) class;
-
- parent_class = g_type_class_ref (PARENT_TYPE);
-
- object_class->get_property = ets_get_property;
-
- widget_class->grab_focus = ets_grab_focus;
-
- widget_class->focus = ets_focus;
-
- g_object_class_install_property (object_class, PROP_TREE,
- g_param_spec_object ("tree",
- _( "Tree" ),
- _( "Tree" ),
- E_TREE_TYPE,
- G_PARAM_READABLE));
-}
-
-E_MAKE_TYPE(e_tree_scrolled, "ETreeScrolled", ETreeScrolled, e_tree_scrolled_class_init, e_tree_scrolled_init, PARENT_TYPE)
-
diff --git a/widgets/table/e-tree-scrolled.h b/widgets/table/e-tree-scrolled.h
deleted file mode 100644
index f861b71138..0000000000
--- a/widgets/table/e-tree-scrolled.h
+++ /dev/null
@@ -1,75 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-tree-scrolled.h
- * Copyright 2000, 2001, Ximian, Inc.
- *
- * Authors:
- * Chris Lahey <clahey@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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.
- */
-
-#ifndef _E_TREE_SCROLLED_H_
-#define _E_TREE_SCROLLED_H_
-
-#include <gtk/gtkscrolledwindow.h>
-#include <gal/e-table/e-tree-model.h>
-#include <gal/e-table/e-tree.h>
-
-G_BEGIN_DECLS
-
-#define E_TREE_SCROLLED_TYPE (e_tree_scrolled_get_type ())
-#define E_TREE_SCROLLED(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), E_TREE_SCROLLED_TYPE, ETreeScrolled))
-#define E_TREE_SCROLLED_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), E_TREE_SCROLLED_TYPE, ETreeScrolledClass))
-#define E_IS_TREE_SCROLLED(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), E_TREE_SCROLLED_TYPE))
-#define E_IS_TREE_SCROLLED_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), E_TREE_SCROLLED_TYPE))
-
-typedef struct {
- GtkScrolledWindow parent;
-
- ETree *tree;
-} ETreeScrolled;
-
-typedef struct {
- GtkScrolledWindowClass parent_class;
-} ETreeScrolledClass;
-
-GType e_tree_scrolled_get_type (void);
-
-ETreeScrolled *e_tree_scrolled_construct (ETreeScrolled *ets,
- ETreeModel *etm,
- ETableExtras *ete,
- const char *spec,
- const char *state);
-GtkWidget *e_tree_scrolled_new (ETreeModel *etm,
- ETableExtras *ete,
- const char *spec,
- const char *state);
-
-ETreeScrolled *e_tree_scrolled_construct_from_spec_file (ETreeScrolled *ets,
- ETreeModel *etm,
- ETableExtras *ete,
- const char *spec_fn,
- const char *state_fn);
-GtkWidget *e_tree_scrolled_new_from_spec_file (ETreeModel *etm,
- ETableExtras *ete,
- const char *spec_fn,
- const char *state_fn);
-
-ETree *e_tree_scrolled_get_tree (ETreeScrolled *ets);
-
-G_END_DECLS
-
-#endif /* _E_TREE_SCROLLED_H_ */
diff --git a/widgets/table/e-tree-selection-model.c b/widgets/table/e-tree-selection-model.c
deleted file mode 100644
index 8aa8cb3239..0000000000
--- a/widgets/table/e-tree-selection-model.c
+++ /dev/null
@@ -1,802 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-tree-selection-model.c
- * Copyright 2000, 2001, 2003 Ximian, Inc.
- *
- * Authors:
- * Chris Lahey <clahey@ximian.com>
- * Mike Kestner <mkestner@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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 "e-tree-selection-model.h"
-#include <gal/util/e-i18n.h>
-#include <gal/util/e-util.h>
-#include <gdk/gdkkeysyms.h>
-#include <gal/e-table/e-tree-table-adapter.h>
-
-#define PARENT_TYPE e_selection_model_get_type ()
-
-static ESelectionModelClass *parent_class;
-
-enum {
- PROP_0,
- PROP_CURSOR_ROW,
- PROP_CURSOR_COL,
- PROP_MODEL,
- PROP_ETTA,
-};
-
-struct ETreeSelectionModelPriv {
- ETreeTableAdapter *etta;
- ETreeModel *model;
-
- GHashTable *paths;
- ETreePath cursor_path;
- ETreePath start_path;
- gint cursor_col;
- gchar *cursor_save_id;
-
- gint tree_model_pre_change_id;
- gint tree_model_no_change_id;
- gint tree_model_node_changed_id;
- gint tree_model_node_data_changed_id;
- gint tree_model_node_col_changed_id;
- gint tree_model_node_inserted_id;
- gint tree_model_node_removed_id;
- gint tree_model_node_deleted_id;
-};
-
-static gint
-get_cursor_row (ETreeSelectionModel *etsm)
-{
- if (etsm->priv->cursor_path)
- return e_tree_table_adapter_row_of_node(etsm->priv->etta, etsm->priv->cursor_path);
-
- return -1;
-}
-
-static void
-clear_selection (ETreeSelectionModel *etsm)
-{
- g_hash_table_destroy (etsm->priv->paths);
- etsm->priv->paths = g_hash_table_new (NULL, NULL);
-}
-
-static void
-change_one_path (ETreeSelectionModel *etsm, ETreePath path, gboolean grow)
-{
- if (!path)
- return;
-
- if (grow)
- g_hash_table_insert (etsm->priv->paths, path, path);
- else if (g_hash_table_lookup (etsm->priv->paths, path))
- g_hash_table_remove (etsm->priv->paths, path);
-}
-
-static void
-select_single_path (ETreeSelectionModel *etsm, ETreePath path)
-{
- clear_selection (etsm);
- change_one_path(etsm, path, TRUE);
- etsm->priv->cursor_path = path;
- etsm->priv->start_path = NULL;
-}
-
-static void
-select_range (ETreeSelectionModel *etsm, gint start, gint end)
-{
- gint i;
-
- if (start > end) {
- i = start;
- start = end;
- end = i;
- }
-
- for (i = start; i <= end; i++) {
- ETreePath path = e_tree_table_adapter_node_at_row (etsm->priv->etta, i);
- if (path)
- g_hash_table_insert (etsm->priv->paths, path, path);
- }
-}
-
-static void
-free_id (ETreeSelectionModel *etsm)
-{
- g_free (etsm->priv->cursor_save_id);
- etsm->priv->cursor_save_id = NULL;
-}
-
-static void
-restore_cursor (ETreeSelectionModel *etsm, ETreeModel *etm)
-{
- clear_selection (etsm);
- etsm->priv->cursor_path = NULL;
-
- if (etsm->priv->cursor_save_id) {
- etsm->priv->cursor_path = e_tree_model_get_node_by_id (etm, etsm->priv->cursor_save_id);
- if (etsm->priv->cursor_path != NULL && etsm->priv->cursor_col == -1)
- etsm->priv->cursor_col = 0;
-
- select_single_path(etsm, etsm->priv->cursor_path);
- }
-
- e_selection_model_selection_changed(E_SELECTION_MODEL(etsm));
-
- if (etsm->priv->cursor_path) {
- gint cursor_row = get_cursor_row (etsm);
- e_selection_model_cursor_changed(E_SELECTION_MODEL(etsm), cursor_row, etsm->priv->cursor_col);
- } else {
- e_selection_model_cursor_changed(E_SELECTION_MODEL(etsm), -1, -1);
- e_selection_model_cursor_activated(E_SELECTION_MODEL(etsm), -1, -1);
-
- }
-
- free_id (etsm);
-}
-
-static void
-etsm_pre_change (ETreeModel *etm, ETreeSelectionModel *etsm)
-{
- g_free (etsm->priv->cursor_save_id);
- etsm->priv->cursor_save_id = NULL;
-
- if (e_tree_model_has_get_node_by_id (etm) && e_tree_model_has_save_id (etm) && etsm->priv->cursor_path) {
- etsm->priv->cursor_save_id = e_tree_model_get_save_id (etm, etsm->priv->cursor_path);
- }
-}
-
-static void
-etsm_no_change (ETreeModel *etm, ETreeSelectionModel *etsm)
-{
- free_id (etsm);
-}
-
-static void
-etsm_node_changed (ETreeModel *etm, ETreePath node, ETreeSelectionModel *etsm)
-{
- restore_cursor (etsm, etm);
-}
-
-static void
-etsm_node_data_changed (ETreeModel *etm, ETreePath node, ETreeSelectionModel *etsm)
-{
- free_id (etsm);
-}
-
-static void
-etsm_node_col_changed (ETreeModel *etm, ETreePath node, int col, ETreeSelectionModel *etsm)
-{
- free_id (etsm);
-}
-
-static void
-etsm_node_inserted (ETreeModel *etm, ETreePath parent, ETreePath child, ETreeSelectionModel *etsm)
-{
- restore_cursor (etsm, etm);
-}
-
-static void
-etsm_node_removed (ETreeModel *etm, ETreePath parent, ETreePath child, int old_position, ETreeSelectionModel *etsm)
-{
- restore_cursor (etsm, etm);
-}
-
-static void
-etsm_node_deleted (ETreeModel *etm, ETreePath child, ETreeSelectionModel *etsm)
-{
- restore_cursor (etsm, etm);
-}
-
-
-static void
-add_model(ETreeSelectionModel *etsm, ETreeModel *model)
-{
- ETreeSelectionModelPriv *priv = etsm->priv;
-
- priv->model = model;
-
- if (!priv->model)
- return;
-
- g_object_ref(priv->model);
- priv->tree_model_pre_change_id = g_signal_connect_after (G_OBJECT (priv->model), "pre_change",
- G_CALLBACK (etsm_pre_change), etsm);
- priv->tree_model_no_change_id = g_signal_connect_after (G_OBJECT (priv->model), "no_change",
- G_CALLBACK (etsm_no_change), etsm);
- priv->tree_model_node_changed_id = g_signal_connect_after (G_OBJECT (priv->model), "node_changed",
- G_CALLBACK (etsm_node_changed), etsm);
- priv->tree_model_node_data_changed_id = g_signal_connect_after (G_OBJECT (priv->model), "node_data_changed",
- G_CALLBACK (etsm_node_data_changed), etsm);
- priv->tree_model_node_col_changed_id = g_signal_connect_after (G_OBJECT (priv->model), "node_col_changed",
- G_CALLBACK (etsm_node_col_changed), etsm);
- priv->tree_model_node_inserted_id = g_signal_connect_after (G_OBJECT (priv->model), "node_inserted",
- G_CALLBACK (etsm_node_inserted), etsm);
- priv->tree_model_node_removed_id = g_signal_connect_after (G_OBJECT (priv->model), "node_removed",
- G_CALLBACK (etsm_node_removed), etsm);
- priv->tree_model_node_deleted_id = g_signal_connect_after (G_OBJECT (priv->model), "node_deleted",
- G_CALLBACK (etsm_node_deleted), etsm);
-}
-
-static void
-drop_model(ETreeSelectionModel *etsm)
-{
- ETreeSelectionModelPriv *priv = etsm->priv;
-
- if (!priv->model)
- return;
-
- g_signal_handler_disconnect (G_OBJECT (priv->model),
- priv->tree_model_pre_change_id);
- g_signal_handler_disconnect (G_OBJECT (priv->model),
- priv->tree_model_no_change_id);
- g_signal_handler_disconnect (G_OBJECT (priv->model),
- priv->tree_model_node_changed_id);
- g_signal_handler_disconnect (G_OBJECT (priv->model),
- priv->tree_model_node_data_changed_id);
- g_signal_handler_disconnect (G_OBJECT (priv->model),
- priv->tree_model_node_col_changed_id);
- g_signal_handler_disconnect (G_OBJECT (priv->model),
- priv->tree_model_node_inserted_id);
- g_signal_handler_disconnect (G_OBJECT (priv->model),
- priv->tree_model_node_removed_id);
- g_signal_handler_disconnect (G_OBJECT (priv->model),
- priv->tree_model_node_deleted_id);
-
- g_object_unref (priv->model);
- priv->model = NULL;
-
- priv->tree_model_pre_change_id = 0;
- priv->tree_model_no_change_id = 0;
- priv->tree_model_node_changed_id = 0;
- priv->tree_model_node_data_changed_id = 0;
- priv->tree_model_node_col_changed_id = 0;
- priv->tree_model_node_inserted_id = 0;
- priv->tree_model_node_removed_id = 0;
- priv->tree_model_node_deleted_id = 0;
-}
-
-static void
-etsm_dispose (GObject *object)
-{
- ETreeSelectionModel *etsm = E_TREE_SELECTION_MODEL (object);
-
- drop_model(etsm);
-
- if (G_OBJECT_CLASS (parent_class)->dispose)
- (* G_OBJECT_CLASS (parent_class)->dispose) (object);
-}
-
-static void
-etsm_finalize (GObject *object)
-{
- ETreeSelectionModel *etsm = E_TREE_SELECTION_MODEL (object);
-
- if (etsm->priv) {
- clear_selection (etsm);
- g_hash_table_destroy (etsm->priv->paths);
- g_free (etsm->priv);
- etsm->priv = NULL;
- }
-
- if (G_OBJECT_CLASS (parent_class)->finalize)
- (* G_OBJECT_CLASS (parent_class)->finalize) (object);
-}
-
-static void
-etsm_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec)
-{
- ETreeSelectionModel *etsm = E_TREE_SELECTION_MODEL (object);
-
- switch (prop_id){
- case PROP_CURSOR_ROW:
- g_value_set_int (value, get_cursor_row(etsm));
- break;
-
- case PROP_CURSOR_COL:
- g_value_set_int (value, etsm->priv->cursor_col);
- break;
-
- case PROP_MODEL:
- g_value_set_object (value, etsm->priv->model);
- break;
-
- case PROP_ETTA:
- g_value_set_object (value, etsm->priv->etta);
- break;
- }
-}
-
-static void
-etsm_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec)
-{
- ESelectionModel *esm = E_SELECTION_MODEL (object);
- ETreeSelectionModel *etsm = E_TREE_SELECTION_MODEL (object);
-
- switch (prop_id){
- case PROP_CURSOR_ROW:
- e_selection_model_do_something(esm, g_value_get_int (value), etsm->priv->cursor_col, 0);
- break;
-
- case PROP_CURSOR_COL:
- e_selection_model_do_something(esm, get_cursor_row(etsm), g_value_get_int(value), 0);
- break;
-
- case PROP_MODEL:
- drop_model(etsm);
- add_model(etsm, E_TREE_MODEL (g_value_get_object(value)));
- break;
-
- case PROP_ETTA:
- etsm->priv->etta = E_TREE_TABLE_ADAPTER (g_value_get_object (value));
- break;
- }
-}
-
-static gboolean
-etsm_is_path_selected (ETreeSelectionModel *etsm, ETreePath path)
-{
- if (path && g_hash_table_lookup (etsm->priv->paths, path))
- return TRUE;
-
- return FALSE;
-}
-
-/**
- * e_selection_model_is_row_selected
- * @selection: #ESelectionModel to check
- * @n: The row to check
- *
- * This routine calculates whether the given row is selected.
- *
- * Returns: %TRUE if the given row is selected
- */
-static gboolean
-etsm_is_row_selected (ESelectionModel *selection,
- gint row)
-{
- ETreeSelectionModel *etsm = E_TREE_SELECTION_MODEL(selection);
- ETreePath path;
-
- g_return_val_if_fail(row < e_table_model_row_count(E_TABLE_MODEL(etsm->priv->etta)), FALSE);
- g_return_val_if_fail(row >= 0, FALSE);
- g_return_val_if_fail(etsm != NULL, FALSE);
-
- path = e_tree_table_adapter_node_at_row(etsm->priv->etta, row);
- return etsm_is_path_selected (etsm, path);
-}
-
-
-typedef struct {
- ETreeSelectionModel *etsm;
- EForeachFunc callback;
- gpointer closure;
-} ModelAndCallback;
-
-static void
-etsm_row_foreach_cb (gpointer key, gpointer value, gpointer user_data)
-{
- ETreePath path = key;
- ModelAndCallback *mac = user_data;
- int row = e_tree_table_adapter_row_of_node(mac->etsm->priv->etta, path);
- if (row >= 0)
- mac->callback(row, mac->closure);
-}
-
-/**
- * e_selection_model_foreach
- * @selection: #ESelectionModel to traverse
- * @callback: The callback function to call back.
- * @closure: The closure
- *
- * This routine calls the given callback function once for each
- * selected row, passing closure as the closure.
- */
-static void
-etsm_foreach (ESelectionModel *selection,
- EForeachFunc callback,
- gpointer closure)
-{
- ETreeSelectionModel *etsm = E_TREE_SELECTION_MODEL(selection);
- ModelAndCallback mac;
-
- mac.etsm = etsm;
- mac.callback = callback;
- mac.closure = closure;
-
- g_hash_table_foreach(etsm->priv->paths, etsm_row_foreach_cb, &mac);
-}
-
-/**
- * e_selection_model_clear
- * @selection: #ESelectionModel to clear
- *
- * This routine clears the selection to no rows selected.
- */
-static void
-etsm_clear(ESelectionModel *selection)
-{
- ETreeSelectionModel *etsm = E_TREE_SELECTION_MODEL(selection);
-
- clear_selection (etsm);
-
- etsm->priv->cursor_path = NULL;
- e_selection_model_selection_changed(E_SELECTION_MODEL(etsm));
- e_selection_model_cursor_changed(E_SELECTION_MODEL(etsm), -1, -1);
-}
-
-/**
- * e_selection_model_selected_count
- * @selection: #ESelectionModel to count
- *
- * This routine calculates the number of rows selected.
- *
- * Returns: The number of rows selected in the given model.
- */
-static gint
-etsm_selected_count (ESelectionModel *selection)
-{
- ETreeSelectionModel *etsm = E_TREE_SELECTION_MODEL(selection);
-
- return g_hash_table_size (etsm->priv->paths);
-}
-
-static int
-etsm_row_count (ESelectionModel *selection)
-{
- ETreeSelectionModel *etsm = E_TREE_SELECTION_MODEL(selection);
- return e_table_model_row_count(E_TABLE_MODEL(etsm->priv->etta));
-}
-
-/**
- * e_selection_model_select_all
- * @selection: #ESelectionModel to select all
- *
- * This routine selects all the rows in the given
- * #ESelectionModel.
- */
-static void
-etsm_select_all (ESelectionModel *selection)
-{
- ETreeSelectionModel *etsm = E_TREE_SELECTION_MODEL(selection);
- ETreePath root;
-
- root = e_tree_model_get_root(etsm->priv->model);
- if (root == NULL)
- return;
-
- clear_selection (etsm);
- select_range (etsm, 0, etsm_row_count (selection) - 1);
-
- if (etsm->priv->cursor_path == NULL)
- etsm->priv->cursor_path = e_tree_table_adapter_node_at_row(etsm->priv->etta, 0);
-
- e_selection_model_selection_changed(E_SELECTION_MODEL(etsm));
- e_selection_model_cursor_changed(E_SELECTION_MODEL(etsm), get_cursor_row(etsm), etsm->priv->cursor_col);
-}
-
-/**
- * e_selection_model_invert_selection
- * @selection: #ESelectionModel to invert
- *
- * This routine inverts all the rows in the given
- * #ESelectionModel.
- */
-static void
-etsm_invert_selection (ESelectionModel *selection)
-{
- ETreeSelectionModel *etsm = E_TREE_SELECTION_MODEL(selection);
- gint count = etsm_row_count (selection);
- gint i;
-
- for (i = 0; i < count; i++) {
- ETreePath path = e_tree_table_adapter_node_at_row (etsm->priv->etta, i);
- if (!path)
- continue;
- if (g_hash_table_lookup (etsm->priv->paths, path))
- g_hash_table_remove (etsm->priv->paths, path);
- else
- g_hash_table_insert (etsm->priv->paths, path, path);
- }
-
- etsm->priv->cursor_col = -1;
- etsm->priv->cursor_path = NULL;
- etsm->priv->start_path = NULL;
- e_selection_model_selection_changed(E_SELECTION_MODEL(etsm));
- e_selection_model_cursor_changed(E_SELECTION_MODEL(etsm), -1, -1);
-}
-
-static void
-etsm_change_one_row(ESelectionModel *selection, int row, gboolean grow)
-{
- ETreeSelectionModel *etsm = E_TREE_SELECTION_MODEL(selection);
- ETreePath path;
-
- g_return_if_fail(row < e_table_model_row_count(E_TABLE_MODEL(etsm->priv->etta)));
- g_return_if_fail(row >= 0);
- g_return_if_fail(selection != NULL);
-
- path = e_tree_table_adapter_node_at_row(etsm->priv->etta, row);
-
- if (!path)
- return;
-
- change_one_path (etsm, path, grow);
-}
-
-static void
-etsm_change_cursor (ESelectionModel *selection, int row, int col)
-{
- ETreeSelectionModel *etsm;
-
- g_return_if_fail(selection != NULL);
- g_return_if_fail(E_IS_SELECTION_MODEL(selection));
-
- etsm = E_TREE_SELECTION_MODEL(selection);
-
- if (row == -1) {
- etsm->priv->cursor_path = NULL;
- } else {
- etsm->priv->cursor_path = e_tree_table_adapter_node_at_row(etsm->priv->etta, row);
- }
- etsm->priv->cursor_col = col;
-}
-
-static gint
-etsm_cursor_row (ESelectionModel *selection)
-{
- return get_cursor_row(E_TREE_SELECTION_MODEL(selection));
-}
-
-static gint
-etsm_cursor_col (ESelectionModel *selection)
-{
- ETreeSelectionModel *etsm = E_TREE_SELECTION_MODEL(selection);
- return etsm->priv->cursor_col;
-}
-
-static void
-etsm_select_single_row (ESelectionModel *selection, gint row)
-{
- ETreeSelectionModel *etsm = E_TREE_SELECTION_MODEL(selection);
- ETreePath path = e_tree_table_adapter_node_at_row (etsm->priv->etta, row);
-
- g_return_if_fail (path != NULL);
-
- select_single_path (etsm, path);
-
- e_selection_model_selection_changed(E_SELECTION_MODEL(etsm));
-}
-
-static void
-etsm_toggle_single_row (ESelectionModel *selection, gint row)
-{
- ETreeSelectionModel *etsm = E_TREE_SELECTION_MODEL(selection);
- ETreePath path = e_tree_table_adapter_node_at_row(etsm->priv->etta, row);
-
- g_return_if_fail (path);
-
- if (g_hash_table_lookup (etsm->priv->paths, path))
- g_hash_table_remove (etsm->priv->paths, path);
- else
- g_hash_table_insert (etsm->priv->paths, path, path);
-
- etsm->priv->start_path = NULL;
- e_selection_model_selection_changed(E_SELECTION_MODEL(etsm));
-}
-
-static void
-etsm_real_move_selection_end (ETreeSelectionModel *etsm, gint row)
-{
- ETreePath end_path = e_tree_table_adapter_node_at_row (etsm->priv->etta, row);
- gint start;
-
- g_return_if_fail (end_path);
-
- start = e_tree_table_adapter_row_of_node(etsm->priv->etta, etsm->priv->start_path);
- clear_selection (etsm);
- select_range (etsm, start, row);
-}
-
-static void
-etsm_move_selection_end (ESelectionModel *selection, gint row)
-{
- ETreeSelectionModel *etsm = E_TREE_SELECTION_MODEL(selection);
-
- g_return_if_fail (etsm->priv->cursor_path);
-
- etsm_real_move_selection_end (etsm, row);
- e_selection_model_selection_changed(E_SELECTION_MODEL(selection));
-}
-
-static void
-etsm_set_selection_end (ESelectionModel *selection, gint row)
-{
- ETreeSelectionModel *etsm = E_TREE_SELECTION_MODEL(selection);
-
- g_return_if_fail (etsm->priv->cursor_path);
-
- if (!etsm->priv->start_path)
- etsm->priv->start_path = etsm->priv->cursor_path;
- etsm_real_move_selection_end(etsm, row);
- e_selection_model_selection_changed(E_SELECTION_MODEL(etsm));
-}
-
-struct foreach_path_t {
- ETreeForeachFunc callback;
- gpointer closure;
-};
-
-static void
-foreach_path (gpointer key, gpointer value, gpointer data)
-{
- ETreePath path = key;
- struct foreach_path_t *c = data;
- c->callback (path, c->closure);
-}
-
-void
-e_tree_selection_model_foreach (ETreeSelectionModel *etsm, ETreeForeachFunc callback, gpointer closure)
-{
- if (etsm->priv->paths) {
- struct foreach_path_t c;
- c.callback = callback;
- c.closure = closure;
- g_hash_table_foreach(etsm->priv->paths, foreach_path, &c);
- return;
- }
-}
-
-void
-e_tree_selection_model_select_single_path (ETreeSelectionModel *etsm, ETreePath path)
-{
- select_single_path (etsm, path);
-
- e_selection_model_selection_changed(E_SELECTION_MODEL(etsm));
-}
-
-void
-e_tree_selection_model_add_to_selection (ETreeSelectionModel *etsm, ETreePath path)
-{
- change_one_path(etsm, path, TRUE);
-
- e_selection_model_selection_changed(E_SELECTION_MODEL(etsm));
-}
-
-void
-e_tree_selection_model_change_cursor (ETreeSelectionModel *etsm, ETreePath path)
-{
- int row;
-
- etsm->priv->cursor_path = path;
-
- row = get_cursor_row(etsm);
-
- E_SELECTION_MODEL (etsm)->old_selection = -1;
-
- e_selection_model_cursor_changed(E_SELECTION_MODEL(etsm), row, etsm->priv->cursor_col);
- e_selection_model_cursor_activated(E_SELECTION_MODEL(etsm), row, etsm->priv->cursor_col);
-}
-
-ETreePath
-e_tree_selection_model_get_cursor (ETreeSelectionModel *etsm)
-{
- return etsm->priv->cursor_path;
-}
-
-
-static void
-e_tree_selection_model_init (ETreeSelectionModel *etsm)
-{
- ETreeSelectionModelPriv *priv;
- priv = g_new(ETreeSelectionModelPriv, 1);
- etsm->priv = priv;
-
- priv->etta = NULL;
- priv->model = NULL;
-
- priv->paths = g_hash_table_new (NULL, NULL);
-
- priv->cursor_path = NULL;
- priv->start_path = NULL;
- priv->cursor_col = -1;
- priv->cursor_save_id = NULL;
-
- priv->tree_model_pre_change_id = 0;
- priv->tree_model_no_change_id = 0;
- priv->tree_model_node_changed_id = 0;
- priv->tree_model_node_data_changed_id = 0;
- priv->tree_model_node_col_changed_id = 0;
- priv->tree_model_node_inserted_id = 0;
- priv->tree_model_node_removed_id = 0;
- priv->tree_model_node_deleted_id = 0;
-}
-
-static void
-e_tree_selection_model_class_init (ETreeSelectionModelClass *klass)
-{
- GObjectClass *object_class;
- ESelectionModelClass *esm_class;
-
- parent_class = g_type_class_ref (PARENT_TYPE);
-
- object_class = G_OBJECT_CLASS(klass);
- esm_class = E_SELECTION_MODEL_CLASS(klass);
-
- object_class->dispose = etsm_dispose;
- object_class->finalize = etsm_finalize;
- object_class->get_property = etsm_get_property;
- object_class->set_property = etsm_set_property;
-
- esm_class->is_row_selected = etsm_is_row_selected ;
- esm_class->foreach = etsm_foreach ;
- esm_class->clear = etsm_clear ;
- esm_class->selected_count = etsm_selected_count ;
- esm_class->select_all = etsm_select_all ;
- esm_class->invert_selection = etsm_invert_selection ;
- esm_class->row_count = etsm_row_count ;
-
- esm_class->change_one_row = etsm_change_one_row ;
- esm_class->change_cursor = etsm_change_cursor ;
- esm_class->cursor_row = etsm_cursor_row ;
- esm_class->cursor_col = etsm_cursor_col ;
-
- esm_class->select_single_row = etsm_select_single_row ;
- esm_class->toggle_single_row = etsm_toggle_single_row ;
- esm_class->move_selection_end = etsm_move_selection_end ;
- esm_class->set_selection_end = etsm_set_selection_end ;
-
- g_object_class_install_property (object_class, PROP_CURSOR_ROW,
- g_param_spec_int ("cursor_row",
- _("Cursor Row"),
- /*_( */"XXX blurb" /*)*/,
- 0, G_MAXINT, 0,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_CURSOR_COL,
- g_param_spec_int ("cursor_col",
- _("Cursor Column"),
- /*_( */"XXX blurb" /*)*/,
- 0, G_MAXINT, 0,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_MODEL,
- g_param_spec_object ("model",
- _("Model"),
- "XXX blurb",
- E_TREE_MODEL_TYPE,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_ETTA,
- g_param_spec_object ("etta",
- "ETTA",
- "XXX blurb",
- E_TREE_TABLE_ADAPTER_TYPE,
- G_PARAM_READWRITE));
-
-}
-
-ESelectionModel *
-e_tree_selection_model_new (void)
-{
- return g_object_new (E_TREE_SELECTION_MODEL_TYPE, NULL);
-}
-
-E_MAKE_TYPE(e_tree_selection_model, "ETreeSelectionModel", ETreeSelectionModel,
- e_tree_selection_model_class_init, e_tree_selection_model_init, PARENT_TYPE)
diff --git a/widgets/table/e-tree-selection-model.h b/widgets/table/e-tree-selection-model.h
deleted file mode 100644
index 0d3305b93d..0000000000
--- a/widgets/table/e-tree-selection-model.h
+++ /dev/null
@@ -1,77 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-tree-selection-model.h
- * Copyright 2000, 2001, Ximian, Inc.
- *
- * Authors:
- * Chris Lahey <clahey@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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.
- */
-
-#ifndef _E_TREE_SELECTION_MODEL_H_
-#define _E_TREE_SELECTION_MODEL_H_
-
-#include <gdk/gdktypes.h>
-#include <gtk/gtkobject.h>
-#include <gal/util/e-sorter.h>
-#include <gal/widgets/e-selection-model.h>
-#include <gal/e-table/e-tree-model.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
-
-typedef void (*ETreeForeachFunc) (ETreePath path,
- gpointer closure);
-
-typedef struct ETreeSelectionModelPriv ETreeSelectionModelPriv;
-
-#define E_TREE_SELECTION_MODEL_TYPE (e_tree_selection_model_get_type ())
-#define E_TREE_SELECTION_MODEL(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), E_TREE_SELECTION_MODEL_TYPE, ETreeSelectionModel))
-#define E_TREE_SELECTION_MODEL_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), E_TREE_SELECTION_MODEL_TYPE, ETreeSelectionModelClass))
-#define E_IS_TREE_SELECTION_MODEL(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), E_TREE_SELECTION_MODEL_TYPE))
-#define E_IS_TREE_SELECTION_MODEL_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), E_TREE_SELECTION_MODEL_TYPE))
-
-typedef struct {
- ESelectionModel base;
-
- ETreeSelectionModelPriv *priv;
-} ETreeSelectionModel;
-
-typedef struct {
- ESelectionModelClass parent_class;
-} ETreeSelectionModelClass;
-
-
-GType e_tree_selection_model_get_type (void);
-ESelectionModel *e_tree_selection_model_new (void);
-void e_tree_selection_model_foreach (ETreeSelectionModel *etsm,
- ETreeForeachFunc callback,
- gpointer closure);
-void e_tree_selection_model_select_single_path (ETreeSelectionModel *etsm,
- ETreePath path);
-void e_tree_selection_model_add_to_selection (ETreeSelectionModel *etsm,
- ETreePath path);
-void e_tree_selection_model_change_cursor (ETreeSelectionModel *etsm,
- ETreePath path);
-ETreePath e_tree_selection_model_get_cursor (ETreeSelectionModel *etsm);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-
-#endif /* _E_TREE_SELECTION_MODEL_H_ */
diff --git a/widgets/table/e-tree-simple.c b/widgets/table/e-tree-simple.c
deleted file mode 100644
index e8dff1e05a..0000000000
--- a/widgets/table/e-tree-simple.c
+++ /dev/null
@@ -1,208 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-tree-simple.c
- * Copyright 2000, 2001, Ximian, Inc.
- *
- * Authors:
- * Chris Lahey <clahey@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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 "gal/util/e-util.h"
-#include "e-tree-simple.h"
-
-static int
-simple_column_count (ETableModel *etm)
-{
- ETreeSimple *simple = E_TREE_SIMPLE(etm);
-
- if (simple->col_count)
- return simple->col_count (etm, simple->model_data);
- else
- return 0;
-}
-
-/* The default for simple_duplicate_value is to return the raw value. */
-static void *
-simple_duplicate_value (ETableModel *etm, int col, const void *value)
-{
- ETreeSimple *simple = E_TREE_SIMPLE(etm);
-
- if (simple->duplicate_value)
- return simple->duplicate_value (etm, col, value, simple->model_data);
- else
- return (void *)value;
-}
-
-static void
-simple_free_value (ETableModel *etm, int col, void *value)
-{
- ETreeSimple *simple = E_TREE_SIMPLE(etm);
-
- if (simple->free_value)
- simple->free_value (etm, col, value, simple->model_data);
-}
-
-static void *
-simple_initialize_value (ETableModel *etm, int col)
-{
- ETreeSimple *simple = E_TREE_SIMPLE(etm);
-
- if (simple->initialize_value)
- return simple->initialize_value (etm, col, simple->model_data);
- else
- return NULL;
-}
-
-static gboolean
-simple_value_is_empty (ETableModel *etm, int col, const void *value)
-{
- ETreeSimple *simple = E_TREE_SIMPLE(etm);
-
- if (simple->value_is_empty)
- return simple->value_is_empty (etm, col, value, simple->model_data);
- else
- return FALSE;
-}
-
-static char *
-simple_value_to_string (ETableModel *etm, int col, const void *value)
-{
- ETreeSimple *simple = E_TREE_SIMPLE(etm);
-
- if (simple->value_to_string)
- return simple->value_to_string (etm, col, value, simple->model_data);
- else
- return g_strdup ("");
-}
-
-static void *
-simple_value_at (ETreeModel *etm, ETreePath *node, int col)
-{
- ETreeSimple *simple = E_TREE_SIMPLE(etm);
-
- return simple->value_at (etm, node, col, simple->model_data);
-}
-
-static GdkPixbuf *
-simple_icon_at (ETreeModel *etm, ETreePath *node)
-{
- ETreeSimple *simple = E_TREE_SIMPLE(etm);
-
- return simple->icon_at (etm, node, simple->model_data);
-}
-
-static void
-simple_set_value_at (ETreeModel *etm, ETreePath *node, int col, const void *val)
-{
- ETreeSimple *simple = E_TREE_SIMPLE(etm);
-
- simple->set_value_at (etm, node, col, val, simple->model_data);
-}
-
-static gboolean
-simple_is_editable (ETreeModel *etm, ETreePath *node, int col)
-{
- ETreeSimple *simple = E_TREE_SIMPLE(etm);
-
- return simple->is_editable (etm, node, col, simple->model_data);
-}
-
-static void
-e_tree_simple_class_init (GObjectClass *object_class)
-{
- ETreeModelClass *model_class = (ETreeModelClass *) object_class;
- ETableModelClass *table_model_class = (ETableModelClass *) object_class;
-
- table_model_class->column_count = simple_column_count;
- table_model_class->duplicate_value = simple_duplicate_value;
- table_model_class->free_value = simple_free_value;
- table_model_class->initialize_value = simple_initialize_value;
- table_model_class->value_is_empty = simple_value_is_empty;
- table_model_class->value_to_string = simple_value_to_string;
-
- model_class ->icon_at = simple_icon_at;
- model_class ->value_at = simple_value_at;
- model_class ->set_value_at = simple_set_value_at;
- model_class ->is_editable = simple_is_editable;
-}
-
-E_MAKE_TYPE(e_tree_simple, "ETreeSimple", ETreeSimple, e_tree_simple_class_init, NULL, E_TREE_MODEL_TYPE)
-
-/**
- * e_tree_simple_new:
- * @col_count:
- * @duplicate_value:
- * @free_value:
- * @initialize_value:
- * @value_is_empty:
- * @value_to_string:
- * @icon_at:
- * @value_at:
- * @set_value_at:
- * @is_editable:
- * @model_data:
- *
- * This initializes a new ETreeSimpleModel object. ETreeSimpleModel is
- * an implementaiton of the abstract class ETreeModel. The ETreeSimpleModel
- * is designed to allow people to easily create ETreeModels without having
- * to create a new GtkType derived from ETreeModel every time they need one.
- *
- * Instead, ETreeSimpleModel uses a setup based in callback functions, every
- * callback function signature mimics the signature of each ETreeModel method
- * and passes the extra @data pointer to each one of the method to provide them
- * with any context they might want to use.
- *
- * ETreeSimple is to ETreeModel as ETableSimple is to ETableModel.
- *
- * Return value: An ETreeSimple object (which is also an ETreeModel
- * object).
- **/
-ETreeModel *
-e_tree_simple_new (ETableSimpleColumnCountFn col_count,
- ETableSimpleDuplicateValueFn duplicate_value,
- ETableSimpleFreeValueFn free_value,
- ETableSimpleInitializeValueFn initialize_value,
- ETableSimpleValueIsEmptyFn value_is_empty,
- ETableSimpleValueToStringFn value_to_string,
-
- ETreeSimpleIconAtFn icon_at,
- ETreeSimpleValueAtFn value_at,
- ETreeSimpleSetValueAtFn set_value_at,
- ETreeSimpleIsEditableFn is_editable,
-
- gpointer model_data)
-{
- ETreeSimple *etg = g_object_new (E_TREE_SIMPLE_TYPE, NULL);
-
- etg->col_count = col_count;
- etg->duplicate_value = duplicate_value;
- etg->free_value = free_value;
- etg->initialize_value = initialize_value;
- etg->value_is_empty = value_is_empty;
- etg->value_to_string = value_to_string;
-
- etg->icon_at = icon_at;
- etg->value_at = value_at;
- etg->set_value_at = set_value_at;
- etg->is_editable = is_editable;
-
- etg->model_data = model_data;
-
- return (ETreeModel*)etg;
-}
-
diff --git a/widgets/table/e-tree-simple.h b/widgets/table/e-tree-simple.h
deleted file mode 100644
index f9980c9544..0000000000
--- a/widgets/table/e-tree-simple.h
+++ /dev/null
@@ -1,85 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-tree-simple.h
- * Copyright 2000, 2001, Ximian, Inc.
- *
- * Authors:
- * Chris Lahey <clahey@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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.
- */
-
-#ifndef _E_TREE_SIMPLE_H_
-#define _E_TREE_SIMPLE_H_
-
-#include <gal/e-table/e-tree-model.h>
-#include <gal/e-table/e-table-simple.h>
-
-G_BEGIN_DECLS
-
-#define E_TREE_SIMPLE_TYPE (e_tree_simple_get_type ())
-#define E_TREE_SIMPLE(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), E_TREE_SIMPLE_TYPE, ETreeSimple))
-#define E_TREE_SIMPLE_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), E_TREE_SIMPLE_TYPE, ETreeSimpleClass))
-#define E_IS_TREE_SIMPLE(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), E_TREE_SIMPLE_TYPE))
-#define E_IS_TREE_SIMPLE_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), E_TREE_SIMPLE_TYPE))
-#define E_TREE_SIMPLE_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS((o), E_TREE_SIMPLE_TYPE, ETreeSimpleClass))
-
-
-typedef GdkPixbuf* (*ETreeSimpleIconAtFn) (ETreeModel *etree, ETreePath *path, void *model_data);
-typedef void* (*ETreeSimpleValueAtFn) (ETreeModel *etree, ETreePath *path, int col, void *model_data);
-typedef void (*ETreeSimpleSetValueAtFn) (ETreeModel *etree, ETreePath *path, int col, const void *val, void *model_data);
-typedef gboolean (*ETreeSimpleIsEditableFn) (ETreeModel *etree, ETreePath *path, int col, void *model_data);
-
-typedef struct {
- ETreeModel parent;
-
- /* Table methods */
- ETableSimpleColumnCountFn col_count;
- ETableSimpleDuplicateValueFn duplicate_value;
- ETableSimpleFreeValueFn free_value;
- ETableSimpleInitializeValueFn initialize_value;
- ETableSimpleValueIsEmptyFn value_is_empty;
- ETableSimpleValueToStringFn value_to_string;
-
- /* Tree methods */
- ETreeSimpleIconAtFn icon_at;
- ETreeSimpleValueAtFn value_at;
- ETreeSimpleSetValueAtFn set_value_at;
- ETreeSimpleIsEditableFn is_editable;
-
- gpointer model_data;
-} ETreeSimple;
-
-typedef struct {
- ETreeModelClass parent_class;
-} ETreeSimpleClass;
-
-GType e_tree_simple_get_type (void);
-
-ETreeModel *e_tree_simple_new (ETableSimpleColumnCountFn col_count,
- ETableSimpleDuplicateValueFn duplicate_value,
- ETableSimpleFreeValueFn free_value,
- ETableSimpleInitializeValueFn initialize_value,
- ETableSimpleValueIsEmptyFn value_is_empty,
- ETableSimpleValueToStringFn value_to_string,
- ETreeSimpleIconAtFn icon_at,
- ETreeSimpleValueAtFn value_at,
- ETreeSimpleSetValueAtFn set_value_at,
- ETreeSimpleIsEditableFn is_editable,
- gpointer model_data);
-
-G_END_DECLS
-
-#endif /* _E_TREE_SIMPLE_H_ */
diff --git a/widgets/table/e-tree-sorted-variable.c b/widgets/table/e-tree-sorted-variable.c
deleted file mode 100644
index bb73b8b776..0000000000
--- a/widgets/table/e-tree-sorted-variable.c
+++ /dev/null
@@ -1,477 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-tree-sorted-variable.c
- * Copyright 2000, 2001, Ximian, Inc.
- *
- * Authors:
- * Chris Lahey <clahey@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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 <stdlib.h>
-#include <string.h>
-#include "gal/util/e-util.h"
-#include "e-tree-sorted-variable.h"
-
-#define d(x)
-
-#define INCREMENT_AMOUNT 100
-
-/* maximum insertions between an idle event that we will do without scheduling an idle sort */
-#define ETSV_INSERT_MAX (4)
-
-static ETreeModelClass *etsv_parent_class;
-
-struct ETreePath {
- GNode node;
-};
-
-struct ETreeSortedVariablePrivate {
- GNode *root;
-};
-
-static void etsv_proxy_model_changed (ETableModel *etm, ETreeSortedVariable *etsv);
-#if 0
-static void etsv_proxy_model_row_changed (ETableModel *etm, int row, ETreeSortedVariable *etsv);
-static void etsv_proxy_model_cell_changed (ETableModel *etm, int col, int row, ETreeSortedVariable *etsv);
-#endif
-static void etsv_sort_info_changed (ETableSortInfo *info, ETreeSortedVariable *etsv);
-static void etsv_sort (ETreeSortedVariable *etsv);
-static void etsv_add (ETreeSortedVariable *etsv, gint row);
-static void etsv_add_all (ETreeSortedVariable *etsv);
-
-static void
-etsv_dispose (GObject *object)
-{
- ETreeSortedVariable *etsv = E_TREE_SORTED_VARIABLE (object);
-
- if (etsv->table_model_changed_id)
- g_signal_handler_disconnect (G_OBJECT (etss->source),
- etsv->table_model_changed_id);
- etsv->table_model_changed_id = 0;
-
-#if 0
- g_signal_handler_disconnect (etss->source,
- etsv->table_model_row_changed_id);
- g_signal_handler_disconnect (etss->source,
- etsv->table_model_cell_changed_id);
-
- etsv->table_model_row_changed_id = 0;
- etsv->table_model_cell_changed_id = 0;
-#endif
- if (etsv->sort_info_changed_id)
- g_signal_handler_disconnect (etsv->sort_info,
- etsv->sort_info_changed_id);
- etsv->sort_info_changed_id = 0;
-
- if (etsv->sort_idle_id)
- g_source_remove(etsv->sort_idle_id);
- etsv->sort_idle_id = 0;
-
- if (etsv->insert_idle_id)
- g_source_remove(etsv->insert_idle_id);
- etsv->insert_idle_id = 0;
-
- if (etsv->sort_info)
- g_object_unref(etsv->sort_info);
- etsv->sort_info = NULL;
-
- if (etsv->full_header)
- g_object_unref(etsv->full_header);
- etsv->full_header = NULL;
-
- G_OBJECT_CLASS (etsv_parent_class)->dispose (object);
-}
-
-static void
-etsv_class_init (GObjectClass *object_class)
-{
- ETreeSortedVariableClass *etsv_class = E_TREE_MODEL_CLASS(object_class);
-
- etsv_parent_class = g_type_class_peek_parent (object_class);
-
- object_class->dispose = etsv_dispose;
-
- etsv_class->add = etsv_add;
- etsv_class->add_all = etsv_add_all;
-}
-
-static void
-etsv_init (ETreeSortedVariable *etsv)
-{
- etsv->full_header = NULL;
- etsv->sort_info = NULL;
-
- etsv->table_model_changed_id = 0;
- etsv->table_model_row_changed_id = 0;
- etsv->table_model_cell_changed_id = 0;
- etsv->sort_info_changed_id = 0;
-
- etsv->sort_idle_id = 0;
- etsv->insert_count = 0;
-}
-
-E_MAKE_TYPE(e_tree_sorted_variable, "ETreeSortedVariable", ETreeSortedVariable, etsv_class_init, etsv_init, E_TREE_MODEL_TYPE)
-
-static gboolean
-etsv_sort_idle(ETreeSortedVariable *etsv)
-{
- g_object_ref(etsv);
- etsv_sort(etsv);
- etsv->sort_idle_id = 0;
- etsv->insert_count = 0;
- g_object_unref(etsv);
- return FALSE;
-}
-
-static gboolean
-etsv_insert_idle(ETreeSortedVariable *etsv)
-{
- etsv->insert_count = 0;
- etsv->insert_idle_id = 0;
- return FALSE;
-}
-
-
-ETableModel *
-e_tree_sorted_variable_new (ETreeModel *source, ETableHeader *full_header, ETableSortInfo *sort_info)
-{
- ETreeSortedVariable *etsv = g_object_new (E_TREE_SORTED_VARIABLE_TYPE, NULL);
- ETreeSortedVariable *etsv = E_TABLE_SUBSET_VARIABLE (etsv);
-
- if (e_table_subset_variable_construct (etsv, source) == NULL){
- g_object_unref (etsv);
- return NULL;
- }
-
- etsv->sort_info = sort_info;
- g_object_ref(etsv->sort_info);
- etsv->full_header = full_header;
- g_object_ref(etsv->full_header);
-
- etsv->table_model_changed_id = g_signal_connect (source, "model_changed",
- G_CALLBACK (etsv_proxy_model_changed), etsv);
-#if 0
- etsv->table_model_row_changed_id = g_signal_connect (source, "model_row_changed",
- G_CALLBACK (etsv_proxy_model_row_changed), etsv);
- etsv->table_model_cell_changed_id = g_signal_connect (source, "model_cell_changed",
- G_CALLBACK (etsv_proxy_model_cell_changed), etsv);
-#endif
- etsv->sort_info_changed_id = g_signal_connect (sort_info, "sort_info_changed",
- G_CALLBACK (etsv_sort_info_changed), etsv);
-
- return E_TABLE_MODEL(etsv);
-}
-
-static void
-etsv_proxy_model_changed (ETableModel *etm, ETreeSortedVariable *etsv)
-{
- /* FIXME: do_resort (); */
-}
-#if 0
-static void
-etsv_proxy_model_row_changed (ETableModel *etm, int row, ETreeSortedVariable *etsv)
-{
- ETreeSortedVariable *etsv = E_TABLE_SUBSET_VARIABLE(etsv);
-
- if (e_table_subset_variable_remove(etsv, row))
- e_table_subset_variable_add (etsv, row);
-}
-
-static void
-etsv_proxy_model_cell_changed (ETableModel *etm, int col, int row, ETreeSortedVariable *etsv)
-{
- ETreeSortedVariable *etsv = E_TABLE_SUBSET_VARIABLE(etsv);
-
- if (e_table_subset_variable_remove(etsv, row))
- e_table_subset_variable_add (etsv, row);
-}
-#endif
-
-static void
-etsv_sort_info_changed (ETableSortInfo *info, ETreeSortedVariable *etsv)
-{
- etsv_sort(etsv);
-}
-
-/* This takes source rows. */
-static int
-etsv_compare(ETreeSortedVariable *etsv, const ETreePath *path1, const ETreePath *path2)
-{
- int j;
- int sort_count = e_table_sort_info_sorting_get_count(etsv->sort_info);
- int comp_val = 0;
- int ascending = 1;
-
- for (j = 0; j < sort_count; j++) {
- ETableSortColumn column = e_table_sort_info_sorting_get_nth(etsv->sort_info, j);
- ETableCol *col;
- col = e_table_header_get_column_by_col_idx(etsv->full_header, column.column);
- if (col == NULL)
- col = e_table_header_get_column (etsv->full_header, e_table_header_count (etsv->full_header) - 1);
- comp_val = (*col->compare)(e_tree_model_value_at (etsv->source, path1, col->col_idx),
- e_tree_model_value_at (etsv->source, path2, col->col_idx));
- ascending = column.ascending;
- if (comp_val != 0)
- break;
- }
- if (comp_val == 0) {
- if (row1 < row2)
- comp_val = -1;
- if (row1 > row2)
- comp_val = 1;
- }
- if (!ascending)
- comp_val = -comp_val;
- return comp_val;
-}
-
-
-static ETreeSortedVariable *etsv_closure;
-int cols_closure;
-int *ascending_closure;
-int *col_idx_closure;
-GCompareFunc *compare_closure;
-
-static int
-etsv_compare_closure(const ETreePath *path1, const ETreePath *path2)
-{
- int j;
- int sort_count = e_table_sort_info_sorting_get_count(etsv_closure->sort_info);
- int comp_val = 0;
- int ascending = 1;
- for (j = 0; j < sort_count; j++) {
-
- comp_val = (*(compare_closure[j]))(e_tree_model_value_at (etsv_closure->source, path1, col_idx_closure[j]),
- e_tree_model_value_at (etsv_closure->source, path2, col_idx_closure[j]));
- ascending = ascending_closure[j];
- if (comp_val != 0)
- break;
- }
- if (comp_val == 0) {
- if (row1 < row2)
- comp_val = -1;
- if (row1 > row2)
- comp_val = 1;
- }
- if (!ascending)
- comp_val = -comp_val;
- return comp_val;
-}
-
-static int
-qsort_callback(const void *data1, const void *data2)
-{
- GNode *node1 = *(GNode **)data1;
- GNode *node2 = *(GNode **)data2;
- return etsv_compare_closure(node1->data, node2->data);
-}
-
-static int
-qsort_callback_source(const void *data1, const void *data2)
-{
- return etsv_compare_closure(data1, data2);
-}
-
-static void
-etsv_setup_closures(ETreeSortedVariable *etsv)
-{
- int j;
- int cols;
-
- cols = e_table_sort_info_sorting_get_count(etsv->sort_info);
- cols_closure = cols;
- etsv_closure = etsv;
-
- ascending_closure = g_new(int, cols);
- col_idx_closure = g_new(int, cols);
- compare_closure = g_new(GCompareFunc, cols);
-
- for (j = 0; j < cols; j++) {
- ETableSortColumn column = e_table_sort_info_sorting_get_nth(etsv->sort_info, j);
- ETableCol *col;
-
- col = e_table_header_get_column_by_col_idx(etsv->full_header, column.column);
- if (col == NULL) {
- col = e_table_header_get_column (etsv->full_header, e_table_header_count (etsv->full_header) - 1);
- }
-
- ascending_closure[j] = column.ascending;
- col_idx_closure[j] = col->col_idx;
- compare_closure[j] = col->compare;
- }
-}
-
-static void
-etsv_free_closures(ETreeSortedVariable *etsv)
-{
- g_free(ascending_closure);
- g_free(col_idx_closure);
- g_free(compare_closure);
-
-}
-
-static void
-etsv_sort_node(ETreeSortedVariable *etsv, GNode *node)
-{
- gint n;
- gint i;
- GNode **children;
- GNode *child;
- GNode *prev;
-
- n = g_node_n_children(node);
- children = g_new(GNode *, n);
- for (i = 0, child = node->children; child && i; child = child->next, i++) {
- children[i] = child;
- }
- qsort(children, n, sizeof(GNode *), qsort_callback);
-
- prev = NULL;
- for (i = 0; i < n; i++) {
- children[i]->prev = prev;
- if (prev) prev->next = children[i];
- prev = children[i];
- children[i]->next = NULL;
- }
-}
-
-static void
-etsv_sort_tree(ETreeSortedVariable *etsv, GNode *root)
-{
- GNode *childr;
-
- etsv_sort_node(etsv, node);
-
- for (child = node->child; child; child = child->next) {
- etsv_sort_tree(etsv, child);
- }
-}
-
-static void
-etsv_sort(ETreeSortedVariable *etsv)
-{
- static int reentering = 0;
- if (reentering)
- return;
- reentering = 1;
-
- e_table_model_pre_change(E_TABLE_MODEL(etsv));
-
- etsv_setup_closures(etsv);
-
- etsv_sort_tree(etsv, etsv->root);
-
- etsv_free_closures(etsv);
-
- e_table_model_changed (E_TABLE_MODEL(etsv));
- reentering = 0;
-}
-
-static void
-etsv_add_node (ETreeSortedVariable *etsv, ETreePath *path, GNode *root)
-{
- GNode *node;
- GNode *new_node;
- for (node = root; node; node = node->next) {
- if (e_tree_model_node_is_ancestor(etsv->source, path, node->data)) {
- etsv_add_node(etsv, path, node->data);
- return;
- }
- }
- new_node = g_node_new(path);
- for (node = root; node; ) {
- if (e_tree_model_node_is_ancestor(etsv->source, node->data, path)) {
- GNode *next;
- next = node->next;
- g_node_unlink(node);
- g_node_prepend(new_node, node);
- node = next;
- } else
- node = node->next;
- }
-
- etsv_sort_node(etsv, new_node);
-
-
-#if 0
- g_node_prepend(root, new_node);
- etsv_sort_node(etsv, root);
-#else
- /* Insert sort to be a bit faster than the above prepend and then sort. */
- for (node = root; node; node = node->next) {
- if (etsv_compare(etsv, path, node->data) > 0) {
- g_node_insert_before (root, node, new_node);
- return;
- }
- }
- g_node_append(root, new_node);
-#endif
-}
-
-etsv_add(ETreeSortedVariable *etsv, gint row)
-{
- ETreeModel *source = etsv->source;
- ETreePath *path;
-
- path = e_table_model_value_at (E_TABLE_MODEL(source), -1, row);
- etsv_add_node(etsv, path, etsv->root);
-}
-
-/* Optimize by doing the qsorts as we build. But we'll do that later. */
-static void
-etsv_add_all_node (ETreeSortedVariable *etsv, ETreePath *path, GNode *node)
-{
- ETreeModel *source = etsv->source;
- ETreePath **children;
- int n;
- int i;
-
- n = e_tree_model_node_get_children(source, path, &children);
- qsort(children, n, sizeof(ETreePath *), qsort_callback_source);
-
- for (i = n - 1; i >= 0; i--) {
- GNode *new_child = g_node_new(children[i]);
- g_node_prepend(path, new_child);
- etsv_add_all_node (etsv, children[i], new_child)
- }
-
- g_free(children);
-}
-
-static void
-etsv_add_all (ETreeSortedVariable *etsv)
-{
- GNode *node;
- ETreePath *path;
-
- e_table_model_pre_change(etm);
-
- if (etsv->root)
- g_node_destroy(etsv->root);
-
- etsv_setup_closures(etsv);
-
- path = e_tree_model_get_root(etsv->source);
- node = g_node_new(path);
- etsv_add_all_node(etsv, path, node);
- etsv->root = node;
-
- etsv_free_closures(etsv);
-
- e_tree_model_node_changed (etsv, etsv->root);
-}
diff --git a/widgets/table/e-tree-sorted-variable.h b/widgets/table/e-tree-sorted-variable.h
deleted file mode 100644
index 35c4c22ffd..0000000000
--- a/widgets/table/e-tree-sorted-variable.h
+++ /dev/null
@@ -1,85 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-tree-sorted-variable.h
- * Copyright 2000, 2001, Ximian, Inc.
- *
- * Authors:
- * Chris Lahey <clahey@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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.
- */
-
-#ifndef _E_TREE_SORTED_VARIABLE_H_
-#define _E_TREE_SORTED_VARIABLE_H_
-
-#include <glib-object.h>
-#include <gal/e-tree/e-tree-model.h>
-#include <gal/e-table/e-table-subset-variable.h>
-#include <gal/e-table/e-table-sort-info.h>
-#include <gal/e-table/e-table-header.h>
-
-G_BEGIN_DECLS
-
-#define E_TREE_SORTED_VARIABLE_TYPE (e_tree_sorted_variable_get_type ())
-#define E_TREE_SORTED_VARIABLE(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), E_TREE_SORTED_VARIABLE_TYPE, ETreeSortedVariable))
-#define E_TREE_SORTED_VARIABLE_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), E_TREE_SORTED_VARIABLE_TYPE, ETreeSortedVariableClass))
-#define E_IS_TREE_SORTED_VARIABLE(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), E_TREE_SORTED_VARIABLE_TYPE))
-#define E_IS_TREE_SORTED_VARIABLE_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), E_TREE_SORTED_VARIABLE_TYPE))
-#define E_TREE_SORTED_VARIABLE_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((obj), E_TREE_SORTED_VARIABLE_TYPE, ETreeSortedVariableClass))
-
-typedef struct {
- ETreeModel base;
-
- ETableSortInfo *sort_info;
-
- ETableHeader *full_header;
-
- int table_model_changed_id;
- int table_model_row_changed_id;
- int table_model_cell_changed_id;
- int sort_info_changed_id;
- int sort_idle_id;
- int insert_idle_id;
- int insert_count;
-
-} ETreeSortedVariable;
-
-typedef struct {
- ETreeModelClass parent_class;
-} ETreeSortedVariableClass;
-
-GType e_tree_sorted_variable_get_type (void);
-ETableModel *e_tree_sorted_variable_new (ETreeModel *etm,
- ETableHeader *header,
- ETableSortInfo *sort_info);
-
-ETreeModel *e_tree_sorted_get_toplevel (ETreeSortedVariable *tree_model);
-
-void e_tree_sorted_variable_add (ETreeSortedVariable *ets,
- gint row);
-void e_tree_sorted_variable_add_all (ETreeSortedVariable *ets);
-gboolean e_tree_sorted_variable_remove (ETreeSortedVariable *ets,
- gint row);
-void e_tree_sorted_variable_increment (ETreeSortedVariable *ets,
- gint position,
- gint amount);
-void e_tree_sorted_variable_decrement (ETreeSortedVariable *ets,
- gint position,
- gint amount);
-void e_tree_sorted_variable_set_allocation (ETreeSortedVariable *ets,
- gint total);
-G_END_DECLS
-
-#endif /* _E_TREE_SORTED_VARIABLE_H_ */
diff --git a/widgets/table/e-tree-sorted.c b/widgets/table/e-tree-sorted.c
deleted file mode 100644
index 20ecdad63f..0000000000
--- a/widgets/table/e-tree-sorted.c
+++ /dev/null
@@ -1,1390 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-tree-sorted.c
- * Copyright 2000, 2001, Ximian, Inc.
- *
- * Authors:
- * Chris Lahey <clahey@ximian.com>
- * Chris Toshok <toshok@ximian.com>
- *
- * Adapted from the gtree code and ETableModel.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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.
- */
-
-/* FIXME: Overall e-tree-sorted.c needs to be made more efficient. */
-
-
-#include <config.h>
-
-#include "e-tree-sorted.h"
-
-#include <stdio.h>
-#include <errno.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <fcntl.h>
-#include <string.h>
-
-#include <libxml/parser.h>
-#include <libxml/xmlmemory.h>
-
-#include "gal/util/e-util.h"
-#include "gal/util/e-xml-utils.h"
-#include "e-table-sorting-utils.h"
-
-/* maximum insertions between an idle event that we will do without scheduling an idle sort */
-#define ETS_INSERT_MAX (4)
-
-#define TREEPATH_CHUNK_AREA_SIZE (30 * sizeof (ETreeSortedPath))
-
-#define d(x)
-
-static ETreeModel *parent_class;
-static GMemChunk *node_chunk;
-
-enum {
- NODE_RESORTED,
- LAST_SIGNAL
-};
-
-static guint signals [LAST_SIGNAL] = {0, };
-
-typedef struct ETreeSortedPath ETreeSortedPath;
-
-struct ETreeSortedPath {
- ETreePath corresponding;
-
- /* parent/child/sibling pointers */
- ETreeSortedPath *parent;
- gint num_children;
- ETreeSortedPath **children;
- int position;
- int orig_position;
-
- guint needs_resort : 1;
- guint child_needs_resort : 1;
- guint resort_all_children : 1;
- guint needs_regen_to_sort : 1;
-};
-
-struct ETreeSortedPriv {
- ETreeModel *source;
- ETreeSortedPath *root;
-
- ETableSortInfo *sort_info;
- ETableHeader *full_header;
-
- ETreeSortedPath *last_access;
-
- int tree_model_pre_change_id;
- int tree_model_no_change_id;
- int tree_model_node_changed_id;
- int tree_model_node_data_changed_id;
- int tree_model_node_col_changed_id;
- int tree_model_node_inserted_id;
- int tree_model_node_removed_id;
- int tree_model_node_deleted_id;
- int tree_model_node_request_collapse_id;
-
- int sort_info_changed_id;
- int sort_idle_id;
- int insert_idle_id;
- int insert_count;
-
- guint in_resort_idle : 1;
- guint nested_resort_idle : 1;
-};
-
-enum {
- ARG_0,
-
- ARG_SORT_INFO
-};
-
-static void ets_sort_info_changed (ETableSortInfo *sort_info, ETreeSorted *ets);
-static void resort_node (ETreeSorted *ets, ETreeSortedPath *path, gboolean resort_all_children, gboolean needs_regen, gboolean send_signals);
-static void mark_path_needs_resort (ETreeSorted *ets, ETreeSortedPath *path, gboolean needs_rebuild, gboolean resort_all_children);
-static void schedule_resort (ETreeSorted *ets, ETreeSortedPath *path, gboolean needs_regen, gboolean resort_all_children);
-static void free_path (ETreeSortedPath *path);
-static void generate_children(ETreeSorted *ets, ETreeSortedPath *path);
-static void regenerate_children(ETreeSorted *ets, ETreeSortedPath *path);
-
-
-
-/* idle callbacks */
-
-static gboolean
-ets_sort_idle(gpointer user_data)
-{
- ETreeSorted *ets = user_data;
- if (ets->priv->in_resort_idle) {
- ets->priv->nested_resort_idle = TRUE;
- return FALSE;
- }
- ets->priv->in_resort_idle = TRUE;
- if (ets->priv->root) {
- do {
- ets->priv->nested_resort_idle = FALSE;
- resort_node (ets, ets->priv->root, FALSE, FALSE, TRUE);
- } while (ets->priv->nested_resort_idle);
- }
- ets->priv->in_resort_idle = FALSE;
- ets->priv->sort_idle_id = 0;
- return FALSE;
-}
-
-#define ETS_SORT_IDLE_ACTIVATED(ets) ((ets)->priv->sort_idle_id != 0)
-
-inline static void
-ets_stop_sort_idle (ETreeSorted *ets)
-{
- if (ets->priv->sort_idle_id) {
- g_source_remove(ets->priv->sort_idle_id);
- ets->priv->sort_idle_id = 0;
- }
-}
-
-static gboolean
-ets_insert_idle(ETreeSorted *ets)
-{
- ets->priv->insert_count = 0;
- ets->priv->insert_idle_id = 0;
- return FALSE;
-}
-
-
-
-/* Helper functions */
-
-#define CHECK_AROUND_LAST_ACCESS
-
-static inline ETreeSortedPath *
-check_last_access (ETreeSorted *ets, ETreePath corresponding)
-{
-#ifdef CHECK_AROUND_LAST_ACCESS
- ETreeSortedPath *parent;
-#endif
-
- if (ets->priv->last_access == NULL)
- return NULL;
-
- if (ets->priv->last_access == corresponding) {
- d(g_print("Found last access %p at %p.", ets->priv->last_access, ets->priv->last_access));
- return ets->priv->last_access;
- }
-
-#ifdef CHECK_AROUND_LAST_ACCESS
- parent = ets->priv->last_access->parent;
- if (parent && parent->children) {
- int position = ets->priv->last_access->position;
- int end = MIN(parent->num_children, position + 10);
- int start = MAX(0, position - 10);
- int initial = MAX (MIN (position, end), start);
- int i;
-
- for (i = initial; i < end; i++) {
- if (parent->children[i] && parent->children[i]->corresponding == corresponding) {
- d(g_print("Found last access %p at %p.", ets->priv->last_access, parent->children[i]));
- return parent->children[i];
- }
- }
-
- for (i = initial - 1; i >= start; i--) {
- if (parent->children[i] && parent->children[i]->corresponding == corresponding) {
- d(g_print("Found last access %p at %p.", ets->priv->last_access, parent->children[i]));
- return parent->children[i];
- }
- }
- }
-#endif
- return NULL;
-}
-
-static ETreeSortedPath *
-find_path(ETreeSorted *ets, ETreePath corresponding)
-{
- int depth;
- ETreePath *sequence;
- int i;
- ETreeSortedPath *path;
- ETreeSortedPath *check_last;
-
- if (corresponding == NULL)
- return NULL;
-
- check_last = check_last_access (ets, corresponding);
- if (check_last) {
- d(g_print(" (find_path)\n"));
- return check_last;
- }
-
- depth = e_tree_model_node_depth(ets->priv->source, corresponding);
-
- sequence = g_new(ETreePath, depth + 1);
-
- sequence[0] = corresponding;
-
- for (i = 0; i < depth; i++)
- sequence[i + 1] = e_tree_model_node_get_parent(ets->priv->source, sequence[i]);
-
- path = ets->priv->root;
-
- for (i = depth - 1; i >= 0 && path != NULL; i --) {
- int j;
-
- if (path->num_children == -1) {
- path = NULL;
- break;
- }
-
- for (j = 0; j < path->num_children; j++) {
- if (path->children[j]->corresponding == sequence[i]) {
- break;
- }
- }
-
- if (j < path->num_children) {
- path = path->children[j];
- } else {
- path = NULL;
- }
- }
- g_free (sequence);
-
- d(g_print("Didn't find last access %p. Setting to %p. (find_path)\n", ets->priv->last_access, path));
- ets->priv->last_access = path;
-
- return path;
-}
-
-static ETreeSortedPath *
-find_child_path(ETreeSorted *ets, ETreeSortedPath *parent, ETreePath corresponding)
-{
- int i;
-
- if (corresponding == NULL)
- return NULL;
-
- if (parent->num_children == -1) {
- return NULL;
- }
-
- for (i = 0; i < parent->num_children; i++)
- if (parent->children[i]->corresponding == corresponding)
- return parent->children[i];
-
- return NULL;
-}
-
-static ETreeSortedPath *
-find_or_create_path(ETreeSorted *ets, ETreePath corresponding)
-{
- int depth;
- ETreePath *sequence;
- int i;
- ETreeSortedPath *path;
- ETreeSortedPath *check_last;
-
- if (corresponding == NULL)
- return NULL;
-
- check_last = check_last_access (ets, corresponding);
- if (check_last) {
- d(g_print(" (find_or_create_path)\n"));
- return check_last;
- }
-
- depth = e_tree_model_node_depth(ets->priv->source, corresponding);
-
- sequence = g_new(ETreePath, depth + 1);
-
- sequence[0] = corresponding;
-
- for (i = 0; i < depth; i++)
- sequence[i + 1] = e_tree_model_node_get_parent(ets->priv->source, sequence[i]);
-
- path = ets->priv->root;
-
- for (i = depth - 1; i >= 0 && path != NULL; i --) {
- int j;
-
- if (path->num_children == -1) {
- generate_children(ets, path);
- }
-
- for (j = 0; j < path->num_children; j++) {
- if (path->children[j]->corresponding == sequence[i]) {
- break;
- }
- }
-
- if (j < path->num_children) {
- path = path->children[j];
- } else {
- path = NULL;
- }
- }
- g_free (sequence);
-
- d(g_print("Didn't find last access %p. Setting to %p. (find_or_create_path)\n", ets->priv->last_access, path));
- ets->priv->last_access = path;
-
- return path;
-}
-
-static void
-free_children (ETreeSortedPath *path)
-{
- int i;
-
- if (path == NULL)
- return;
-
- for (i = 0; i < path->num_children; i++) {
- free_path(path->children[i]);
- }
-
- g_free(path->children);
- path->children = NULL;
- path->num_children = -1;
-}
-
-static void
-free_path (ETreeSortedPath *path)
-{
- free_children(path);
- g_chunk_free(path, node_chunk);
-}
-
-static ETreeSortedPath *
-new_path (ETreeSortedPath *parent, ETreePath corresponding)
-{
- ETreeSortedPath *path;
-
- path = g_chunk_new0 (ETreeSortedPath, node_chunk);
-
- path->corresponding = corresponding;
- path->parent = parent;
- path->num_children = -1;
- path->children = NULL;
- path->position = -1;
- path->orig_position = -1;
- path->child_needs_resort = 0;
- path->resort_all_children = 0;
- path->needs_resort = 0;
- path->needs_regen_to_sort = 0;
-
- return path;
-}
-
-static gboolean
-reposition_path (ETreeSorted *ets, ETreeSortedPath *path)
-{
- int new_index;
- int old_index = path->position;
- ETreeSortedPath *parent = path->parent;
- gboolean changed = FALSE;
- if (parent) {
- if (ets->priv->sort_idle_id == 0) {
- if (ets->priv->insert_count > ETS_INSERT_MAX) {
- /* schedule a sort, and append instead */
- schedule_resort(ets, parent, TRUE, FALSE);
- } else {
- /* make sure we have an idle handler to reset the count every now and then */
- if (ets->priv->insert_idle_id == 0) {
- ets->priv->insert_idle_id = g_idle_add_full(40, (GSourceFunc) ets_insert_idle, ets, NULL);
- }
-
- new_index = e_table_sorting_utils_tree_check_position
- (E_TREE_MODEL(ets),
- ets->priv->sort_info,
- ets->priv->full_header,
- (ETreePath *) parent->children,
- parent->num_children,
- old_index);
-
- if (new_index > old_index) {
- int i;
- ets->priv->insert_count++;
- memmove(parent->children + old_index, parent->children + old_index + 1, sizeof (ETreePath) * (new_index - old_index));
- parent->children[new_index] = path;
- for (i = old_index; i <= new_index; i++)
- parent->children[i]->position = i;
- changed = TRUE;
- e_tree_model_node_changed(E_TREE_MODEL(ets), parent);
- e_tree_sorted_node_resorted(ets, parent);
- } else if (new_index < old_index) {
- int i;
- ets->priv->insert_count++;
- memmove(parent->children + new_index + 1, parent->children + new_index, sizeof (ETreePath) * (old_index - new_index));
- parent->children[new_index] = path;
- for (i = new_index; i <= old_index; i++)
- parent->children[i]->position = i;
- changed = TRUE;
- e_tree_model_node_changed(E_TREE_MODEL(ets), parent);
- e_tree_sorted_node_resorted(ets, parent);
- }
- }
- } else
- mark_path_needs_resort(ets, parent, TRUE, FALSE);
- }
- return changed;
-}
-
-static void
-regenerate_children(ETreeSorted *ets, ETreeSortedPath *path)
-{
- ETreeSortedPath **children;
- int i;
-
- children = g_new(ETreeSortedPath *, path->num_children);
- for (i = 0; i < path->num_children; i++)
- children[path->children[i]->orig_position] = path->children[i];
- g_free(path->children);
- path->children = children;
-}
-
-static void
-generate_children(ETreeSorted *ets, ETreeSortedPath *path)
-{
- ETreePath child;
- int i;
- int count;
-
- free_children(path);
-
- count = 0;
- for (child = e_tree_model_node_get_first_child(ets->priv->source, path->corresponding);
- child;
- child = e_tree_model_node_get_next(ets->priv->source, child)) {
- count ++;
- }
-
- path->num_children = count;
- path->children = g_new(ETreeSortedPath *, count);
- for (child = e_tree_model_node_get_first_child(ets->priv->source, path->corresponding), i = 0;
- child;
- child = e_tree_model_node_get_next(ets->priv->source, child), i++) {
- path->children[i] = new_path(path, child);
- path->children[i]->position = i;
- path->children[i]->orig_position = i;
- }
- if (path->num_children > 0)
- schedule_resort (ets, path, FALSE, TRUE);
-}
-
-static void
-resort_node (ETreeSorted *ets, ETreeSortedPath *path, gboolean resort_all_children, gboolean needs_regen, gboolean send_signals)
-{
- gboolean needs_resort;
- if (path) {
- needs_resort = path->needs_resort || resort_all_children;
- needs_regen = path->needs_regen_to_sort || needs_regen;
- if (path->num_children > 0) {
- if (needs_resort && send_signals)
- e_tree_model_pre_change(E_TREE_MODEL(ets));
- if (needs_resort) {
- int i;
- d(g_print("Start sort of node %p\n", path));
- if (needs_regen)
- regenerate_children(ets, path);
- d(g_print("Regened sort of node %p\n", path));
- e_table_sorting_utils_tree_sort (E_TREE_MODEL(ets),
- ets->priv->sort_info,
- ets->priv->full_header,
- (ETreePath *) path->children,
- path->num_children);
- d(g_print("Renumbering sort of node %p\n", path));
- for (i = 0; i < path->num_children; i++) {
- path->children[i]->position = i;
- }
- d(g_print("End sort of node %p\n", path));
- }
- if (path->resort_all_children)
- resort_all_children = TRUE;
- if ((resort_all_children || path->child_needs_resort) && path->num_children >= 0) {
- int i;
- for (i = 0; i < path->num_children; i++) {
- resort_node(ets, path->children[i], resort_all_children, needs_regen, send_signals && !needs_resort);
- }
- path->child_needs_resort = 0;
- }
- }
- path->needs_resort = 0;
- path->child_needs_resort = 0;
- path->needs_regen_to_sort = 0;
- path->resort_all_children = 0;
- if (needs_resort && send_signals && path->num_children > 0) {
- e_tree_model_node_changed(E_TREE_MODEL(ets), path);
- e_tree_sorted_node_resorted(ets, path);
- }
- }
-}
-
-static void
-mark_path_child_needs_resort (ETreeSorted *ets, ETreeSortedPath *path)
-{
- if (path == NULL)
- return;
- if (!path->child_needs_resort) {
- path->child_needs_resort = 1;
- mark_path_child_needs_resort (ets, path->parent);
- }
-}
-
-static void
-mark_path_needs_resort (ETreeSorted *ets, ETreeSortedPath *path, gboolean needs_regen, gboolean resort_all_children)
-{
- if (path == NULL)
- return;
- if (path->num_children == 0)
- return;
- path->needs_resort = 1;
- path->needs_regen_to_sort = needs_regen;
- path->resort_all_children = resort_all_children;
- mark_path_child_needs_resort(ets, path->parent);
-}
-
-static void
-schedule_resort (ETreeSorted *ets, ETreeSortedPath *path, gboolean needs_regen, gboolean resort_all_children)
-{
- ets->priv->insert_count = 0;
- if (ets->priv->insert_idle_id != 0) {
- g_source_remove(ets->priv->insert_idle_id);
- ets->priv->insert_idle_id = 0;
- }
-
- if (path == NULL)
- return;
- if (path->num_children == 0)
- return;
-
- mark_path_needs_resort(ets, path, needs_regen, resort_all_children);
- if (ets->priv->sort_idle_id == 0) {
- ets->priv->sort_idle_id = g_idle_add_full(50, (GSourceFunc) ets_sort_idle, ets, NULL);
- } else if (ets->priv->in_resort_idle) {
- ets->priv->nested_resort_idle = TRUE;
- }
-}
-
-
-
-/* virtual methods */
-
-static void
-ets_dispose (GObject *object)
-{
- ETreeSorted *ets = E_TREE_SORTED (object);
- ETreeSortedPriv *priv = ets->priv;
-
- /* FIXME lots of stuff to free here */
- if (!priv) {
- G_OBJECT_CLASS (parent_class)->dispose (object);
- return;
- }
-
- if (priv->source) {
- g_signal_handler_disconnect (G_OBJECT (priv->source),
- priv->tree_model_pre_change_id);
- g_signal_handler_disconnect (G_OBJECT (priv->source),
- priv->tree_model_no_change_id);
- g_signal_handler_disconnect (G_OBJECT (priv->source),
- priv->tree_model_node_changed_id);
- g_signal_handler_disconnect (G_OBJECT (priv->source),
- priv->tree_model_node_data_changed_id);
- g_signal_handler_disconnect (G_OBJECT (priv->source),
- priv->tree_model_node_col_changed_id);
- g_signal_handler_disconnect (G_OBJECT (priv->source),
- priv->tree_model_node_inserted_id);
- g_signal_handler_disconnect (G_OBJECT (priv->source),
- priv->tree_model_node_removed_id);
- g_signal_handler_disconnect (G_OBJECT (priv->source),
- priv->tree_model_node_deleted_id);
- g_signal_handler_disconnect (G_OBJECT (priv->source),
- priv->tree_model_node_request_collapse_id);
-
- g_object_unref (priv->source);
- priv->source = NULL;
-
- priv->tree_model_pre_change_id = 0;
- priv->tree_model_no_change_id = 0;
- priv->tree_model_node_changed_id = 0;
- priv->tree_model_node_data_changed_id = 0;
- priv->tree_model_node_col_changed_id = 0;
- priv->tree_model_node_inserted_id = 0;
- priv->tree_model_node_removed_id = 0;
- priv->tree_model_node_deleted_id = 0;
- priv->tree_model_node_request_collapse_id = 0;
- }
-
- if (priv->sort_info) {
- g_signal_handler_disconnect (G_OBJECT (priv->sort_info),
- priv->sort_info_changed_id);
- priv->sort_info_changed_id = 0;
-
- g_object_unref (priv->sort_info);
- priv->sort_info = NULL;
- }
-
- ets_stop_sort_idle (ets);
- if (ets->priv->insert_idle_id) {
- g_source_remove(ets->priv->insert_idle_id);
- ets->priv->insert_idle_id = 0;
- }
-
- if (priv->full_header)
- g_object_unref(priv->full_header);
-
-}
-
-static void
-ets_finalize (GObject *object)
-{
- ETreeSorted *ets = (ETreeSorted *) object;
-
- if (ets->priv->root)
- free_path(ets->priv->root);
-
- g_free (ets->priv);
- ets->priv = NULL;
-
- G_OBJECT_CLASS (parent_class)->finalize (object);
-}
-
-static ETreePath
-ets_get_root (ETreeModel *etm)
-{
- ETreeSortedPriv *priv = E_TREE_SORTED(etm)->priv;
- if (priv->root == NULL) {
- ETreeSorted *ets = E_TREE_SORTED(etm);
- ETreePath corresponding = e_tree_model_get_root(ets->priv->source);
-
- if (corresponding) {
- priv->root = new_path(NULL, corresponding);
- }
- }
- if (priv->root && priv->root->num_children == -1) {
- generate_children(E_TREE_SORTED(etm), priv->root);
- }
-
- return priv->root;
-}
-
-static ETreePath
-ets_get_parent (ETreeModel *etm, ETreePath node)
-{
- ETreeSortedPath *path = node;
- return path->parent;
-}
-
-static ETreePath
-ets_get_first_child (ETreeModel *etm, ETreePath node)
-{
- ETreeSortedPath *path = node;
- ETreeSorted *ets = E_TREE_SORTED(etm);
-
- if (path->num_children == -1)
- generate_children(ets, path);
-
- if (path->num_children > 0)
- return path->children[0];
- else
- return NULL;
-}
-
-static ETreePath
-ets_get_last_child (ETreeModel *etm, ETreePath node)
-{
- ETreeSortedPath *path = node;
- ETreeSorted *ets = E_TREE_SORTED(etm);
-
- if (path->num_children == -1)
- generate_children(ets, path);
-
- if (path->num_children > 0)
- return path->children[path->num_children - 1];
- else
- return NULL;
-}
-
-static ETreePath
-ets_get_next (ETreeModel *etm, ETreePath node)
-{
- ETreeSortedPath *path = node;
- ETreeSortedPath *parent = path->parent;
- if (parent) {
- if (parent->num_children > path->position + 1)
- return parent->children[path->position + 1];
- else
- return NULL;
- } else
- return NULL;
-}
-
-static ETreePath
-ets_get_prev (ETreeModel *etm, ETreePath node)
-{
- ETreeSortedPath *path = node;
- ETreeSortedPath *parent = path->parent;
- if (parent) {
- if (path->position - 1 >= 0)
- return parent->children[path->position - 1];
- else
- return NULL;
- } else
- return NULL;
-}
-
-static gboolean
-ets_is_root (ETreeModel *etm, ETreePath node)
-{
- ETreeSortedPath *path = node;
- ETreeSorted *ets = E_TREE_SORTED(etm);
-
- return e_tree_model_node_is_root (ets->priv->source, path->corresponding);
-}
-
-static gboolean
-ets_is_expandable (ETreeModel *etm, ETreePath node)
-{
- ETreeSortedPath *path = node;
- ETreeSorted *ets = E_TREE_SORTED(etm);
- gboolean expandable = e_tree_model_node_is_expandable (ets->priv->source, path->corresponding);
-
- if (path->num_children == -1) {
- generate_children(ets, node);
- }
-
- return expandable;
-}
-
-static guint
-ets_get_children (ETreeModel *etm, ETreePath node, ETreePath **nodes)
-{
- ETreeSortedPath *path = node;
- guint n_children;
-
- if (path->num_children == -1) {
- generate_children(E_TREE_SORTED(etm), node);
- }
-
- n_children = path->num_children;
-
- if (nodes) {
- int i;
-
- (*nodes) = g_malloc (sizeof (ETreePath) * n_children);
- for (i = 0; i < n_children; i ++) {
- (*nodes)[i] = path->children[i];
- }
- }
-
- return n_children;
-}
-
-static guint
-ets_depth (ETreeModel *etm, ETreePath node)
-{
- ETreeSortedPath *path = node;
- ETreeSorted *ets = E_TREE_SORTED(etm);
-
- return e_tree_model_node_depth(ets->priv->source, path->corresponding);
-}
-
-static GdkPixbuf *
-ets_icon_at (ETreeModel *etm, ETreePath node)
-{
- ETreeSortedPath *path = node;
- ETreeSorted *ets = E_TREE_SORTED(etm);
-
- return e_tree_model_icon_at(ets->priv->source, path->corresponding);
-}
-
-static gboolean
-ets_get_expanded_default (ETreeModel *etm)
-{
- ETreeSorted *ets = E_TREE_SORTED(etm);
-
- return e_tree_model_get_expanded_default(ets->priv->source);
-}
-
-static gint
-ets_column_count (ETreeModel *etm)
-{
- ETreeSorted *ets = E_TREE_SORTED(etm);
-
- return e_tree_model_column_count(ets->priv->source);
-}
-
-
-static gboolean
-ets_has_save_id (ETreeModel *etm)
-{
- return TRUE;
-}
-
-static gchar *
-ets_get_save_id (ETreeModel *etm, ETreePath node)
-{
- ETreeSorted *ets = E_TREE_SORTED(etm);
- ETreeSortedPath *path = node;
-
- if (e_tree_model_has_save_id(ets->priv->source))
- return e_tree_model_get_save_id(ets->priv->source, path->corresponding);
- else
- return g_strdup_printf("%p", path->corresponding);
-}
-
-static gboolean
-ets_has_get_node_by_id (ETreeModel *etm)
-{
- ETreeSorted *ets = E_TREE_SORTED(etm);
- return e_tree_model_has_get_node_by_id(ets->priv->source);
-}
-
-static ETreePath
-ets_get_node_by_id (ETreeModel *etm, const char *save_id)
-{
- ETreeSorted *ets = E_TREE_SORTED(etm);
- ETreePath node;
-
- node = e_tree_model_get_node_by_id (ets->priv->source, save_id);
-
- return find_path(ets, node);
-}
-
-static gboolean
-ets_has_change_pending (ETreeModel *etm)
-{
- ETreeSorted *ets = E_TREE_SORTED(etm);
-
- return ets->priv->sort_idle_id != 0;
-}
-
-
-static void *
-ets_value_at (ETreeModel *etm, ETreePath node, int col)
-{
- ETreeSorted *ets = E_TREE_SORTED(etm);
- ETreeSortedPath *path = node;
-
- return e_tree_model_value_at(ets->priv->source, path->corresponding, col);
-}
-
-static void
-ets_set_value_at (ETreeModel *etm, ETreePath node, int col, const void *val)
-{
- ETreeSorted *ets = E_TREE_SORTED(etm);
- ETreeSortedPath *path = node;
-
- e_tree_model_set_value_at (ets->priv->source, path->corresponding, col, val);
-}
-
-static gboolean
-ets_is_editable (ETreeModel *etm, ETreePath node, int col)
-{
- ETreeSorted *ets = E_TREE_SORTED(etm);
- ETreeSortedPath *path = node;
-
- return e_tree_model_node_is_editable (ets->priv->source, path->corresponding, col);
-}
-
-
-/* The default for ets_duplicate_value is to return the raw value. */
-static void *
-ets_duplicate_value (ETreeModel *etm, int col, const void *value)
-{
- ETreeSorted *ets = E_TREE_SORTED(etm);
-
- return e_tree_model_duplicate_value (ets->priv->source, col, value);
-}
-
-static void
-ets_free_value (ETreeModel *etm, int col, void *value)
-{
- ETreeSorted *ets = E_TREE_SORTED(etm);
-
- e_tree_model_free_value (ets->priv->source, col, value);
-}
-
-static void *
-ets_initialize_value (ETreeModel *etm, int col)
-{
- ETreeSorted *ets = E_TREE_SORTED(etm);
-
- return e_tree_model_initialize_value (ets->priv->source, col);
-}
-
-static gboolean
-ets_value_is_empty (ETreeModel *etm, int col, const void *value)
-{
- ETreeSorted *ets = E_TREE_SORTED(etm);
-
- return e_tree_model_value_is_empty (ets->priv->source, col, value);
-}
-
-static char *
-ets_value_to_string (ETreeModel *etm, int col, const void *value)
-{
- ETreeSorted *ets = E_TREE_SORTED(etm);
-
- return e_tree_model_value_to_string (ets->priv->source, col, value);
-}
-
-/* Proxy functions */
-
-static void
-ets_proxy_pre_change (ETreeModel *etm, ETreeSorted *ets)
-{
- e_tree_model_pre_change(E_TREE_MODEL(ets));
-}
-
-static void
-ets_proxy_no_change (ETreeModel *etm, ETreeSorted *ets)
-{
- e_tree_model_no_change(E_TREE_MODEL(ets));
-}
-
-static void
-ets_proxy_node_changed (ETreeModel *etm, ETreePath node, ETreeSorted *ets)
-{
- ets->priv->last_access = NULL;
- d(g_print("Setting last access %p. (ets_proxy_node_changed)\n", ets->priv->last_access));
-
- if (e_tree_model_node_is_root(ets->priv->source, node)) {
- ets_stop_sort_idle (ets);
-
- if (ets->priv->root) {
- free_path(ets->priv->root);
- }
- ets->priv->root = new_path(NULL, node);
- e_tree_model_node_changed(E_TREE_MODEL(ets), ets->priv->root);
- return;
- } else {
- ETreeSortedPath *path = find_path(ets, node);
-
- if (path) {
- free_children(path);
- if (!reposition_path(ets, path)) {
- e_tree_model_node_changed(E_TREE_MODEL(ets), path);
- } else {
- e_tree_model_no_change(E_TREE_MODEL(ets));
- }
- } else {
- e_tree_model_no_change(E_TREE_MODEL(ets));
- }
- }
-}
-
-static void
-ets_proxy_node_data_changed (ETreeModel *etm, ETreePath node, ETreeSorted *ets)
-{
- ETreeSortedPath *path = find_path(ets, node);
-
- if (path) {
- if (!reposition_path(ets, path))
- e_tree_model_node_data_changed(E_TREE_MODEL(ets), path);
- else
- e_tree_model_no_change(E_TREE_MODEL(ets));
- } else
- e_tree_model_no_change(E_TREE_MODEL(ets));
-}
-
-static void
-ets_proxy_node_col_changed (ETreeModel *etm, ETreePath node, int col, ETreeSorted *ets)
-{
- ETreeSortedPath *path = find_path(ets, node);
-
- if (path) {
- gboolean changed = FALSE;
- if (e_table_sorting_utils_affects_sort(ets->priv->sort_info, ets->priv->full_header, col))
- changed = reposition_path(ets, path);
- if (!changed)
- e_tree_model_node_col_changed(E_TREE_MODEL(ets), path, col);
- else
- e_tree_model_no_change(E_TREE_MODEL(ets));
- } else
- e_tree_model_no_change(E_TREE_MODEL(ets));
-}
-
-static void
-ets_proxy_node_inserted (ETreeModel *etm, ETreePath parent, ETreePath child, ETreeSorted *ets)
-{
- ETreeSortedPath *parent_path = find_path(ets, parent);
-
- if (parent_path && parent_path->num_children != -1) {
- int i;
- int j;
- ETreeSortedPath *path;
- int position = parent_path->num_children;
- ETreePath counter;
-
- for (counter = e_tree_model_node_get_next(etm, child);
- counter;
- counter = e_tree_model_node_get_next(etm, counter))
- position --;
-
- if (position != parent_path->num_children) {
- for (i = 0; i < parent_path->num_children; i++) {
- if (parent_path->children[i]->orig_position >= position)
- parent_path->children[i]->orig_position++;
- }
- }
-
- i = parent_path->num_children;
- path = new_path(parent_path, child);
- path->orig_position = position;
- if (!ETS_SORT_IDLE_ACTIVATED (ets)) {
- ets->priv->insert_count++;
- if (ets->priv->insert_count > ETS_INSERT_MAX) {
- /* schedule a sort, and append instead */
- schedule_resort(ets, parent_path, TRUE, FALSE);
- } else {
- /* make sure we have an idle handler to reset the count every now and then */
- if (ets->priv->insert_idle_id == 0) {
- ets->priv->insert_idle_id = g_idle_add_full(40, (GSourceFunc) ets_insert_idle, ets, NULL);
- }
- i = e_table_sorting_utils_tree_insert
- (ets->priv->source,
- ets->priv->sort_info,
- ets->priv->full_header,
- (ETreePath *) parent_path->children,
- parent_path->num_children,
- path);
- }
- } else {
- mark_path_needs_resort(ets, parent_path, TRUE, FALSE);
- }
- parent_path->num_children ++;
- parent_path->children = g_renew(ETreeSortedPath *, parent_path->children, parent_path->num_children);
- memmove(parent_path->children + i + 1, parent_path->children + i, (parent_path->num_children - 1 - i) * sizeof(int));
- parent_path->children[i] = path;
- for (j = i; j < parent_path->num_children; j++) {
- parent_path->children[j]->position = j;
- }
- e_tree_model_node_inserted(E_TREE_MODEL(ets), parent_path, parent_path->children[i]);
- } else if (ets->priv->root == NULL && parent == NULL) {
- if (child) {
- ets->priv->root = new_path(NULL, child);
- e_tree_model_node_inserted(E_TREE_MODEL(ets), NULL, ets->priv->root);
- } else {
- e_tree_model_no_change(E_TREE_MODEL(ets));
- }
- } else {
- e_tree_model_no_change(E_TREE_MODEL(ets));
- }
-}
-
-static void
-ets_proxy_node_removed (ETreeModel *etm, ETreePath parent, ETreePath child, int old_position, ETreeSorted *ets)
-{
- ETreeSortedPath *parent_path = find_path(ets, parent);
- ETreeSortedPath *path;
-
- if (parent_path)
- path = find_child_path(ets, parent_path, child);
- else
- path = find_path(ets, child);
-
- d(g_print("Setting last access %p. (ets_proxy_node_removed)\n ", ets->priv->last_access));
- ets->priv->last_access = NULL;
-
- if (path && parent_path && parent_path->num_children != -1) {
- int i;
- for (i = 0; i < parent_path->num_children; i++) {
- if (parent_path->children[i]->orig_position > old_position)
- parent_path->children[i]->orig_position --;
- }
-
- i = path->position;
-
- parent_path->num_children --;
- memmove(parent_path->children + i, parent_path->children + i + 1, sizeof(ETreeSortedPath *) * (parent_path->num_children - i));
- for (; i < parent_path->num_children; i++) {
- parent_path->children[i]->position = i;
- }
- e_tree_model_node_removed(E_TREE_MODEL(ets), parent_path, path, path->position);
- free_path(path);
- } else if (path && path == ets->priv->root) {
- ets->priv->root = NULL;
- e_tree_model_node_removed(E_TREE_MODEL(ets), NULL, path, -1);
- free_path(path);
- }
-}
-
-static void
-ets_proxy_node_deleted (ETreeModel *etm, ETreePath child, ETreeSorted *ets)
-{
- e_tree_model_node_deleted(E_TREE_MODEL(ets), NULL);
-}
-
-static void
-ets_proxy_node_request_collapse (ETreeModel *etm, ETreePath node, ETreeSorted *ets)
-{
- ETreeSortedPath *path = find_path(ets, node);
- if (path) {
- e_tree_model_node_request_collapse(E_TREE_MODEL(ets), path);
- }
-}
-
-static void
-ets_sort_info_changed (ETableSortInfo *sort_info, ETreeSorted *ets)
-{
- schedule_resort(ets, ets->priv->root, TRUE, TRUE);
-}
-
-
-
-/* Initialization and creation */
-
-static void
-e_tree_sorted_class_init (ETreeSortedClass *klass)
-{
- ETreeModelClass *tree_class = E_TREE_MODEL_CLASS (klass);
- GObjectClass *object_class = G_OBJECT_CLASS (klass);
-
- parent_class = g_type_class_peek_parent (klass);
-
- node_chunk = g_mem_chunk_create (ETreeSortedPath, TREEPATH_CHUNK_AREA_SIZE, G_ALLOC_AND_FREE);
-
- klass->node_resorted = NULL;
-
- object_class->dispose = ets_dispose;
- object_class->finalize = ets_finalize;
-
- tree_class->get_root = ets_get_root;
- tree_class->get_parent = ets_get_parent;
- tree_class->get_first_child = ets_get_first_child;
- tree_class->get_last_child = ets_get_last_child;
- tree_class->get_prev = ets_get_prev;
- tree_class->get_next = ets_get_next;
-
- tree_class->is_root = ets_is_root;
- tree_class->is_expandable = ets_is_expandable;
- tree_class->get_children = ets_get_children;
- tree_class->depth = ets_depth;
-
- tree_class->icon_at = ets_icon_at;
-
- tree_class->get_expanded_default = ets_get_expanded_default;
- tree_class->column_count = ets_column_count;
-
- tree_class->has_save_id = ets_has_save_id;
- tree_class->get_save_id = ets_get_save_id;
-
- tree_class->has_get_node_by_id = ets_has_get_node_by_id;
- tree_class->get_node_by_id = ets_get_node_by_id;
-
- tree_class->has_change_pending = ets_has_change_pending;
-
- tree_class->value_at = ets_value_at;
- tree_class->set_value_at = ets_set_value_at;
- tree_class->is_editable = ets_is_editable;
-
- tree_class->duplicate_value = ets_duplicate_value;
- tree_class->free_value = ets_free_value;
- tree_class->initialize_value = ets_initialize_value;
- tree_class->value_is_empty = ets_value_is_empty;
- tree_class->value_to_string = ets_value_to_string;
-
- signals [NODE_RESORTED] =
- g_signal_new ("node_resorted",
- E_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (ETreeSortedClass, node_resorted),
- (GSignalAccumulator) NULL, NULL,
- g_cclosure_marshal_VOID__POINTER,
- G_TYPE_NONE, 1, G_TYPE_POINTER);
-}
-
-static void
-e_tree_sorted_init (GObject *object)
-{
- ETreeSorted *ets = (ETreeSorted *)object;
-
- ETreeSortedPriv *priv;
-
- priv = g_new0 (ETreeSortedPriv, 1);
- ets->priv = priv;
-
- priv->root = NULL;
- priv->source = NULL;
-
- priv->sort_info = NULL;
- priv->full_header = NULL;
-
- priv->last_access = NULL;
-
- priv->tree_model_pre_change_id = 0;
- priv->tree_model_no_change_id = 0;
- priv->tree_model_node_changed_id = 0;
- priv->tree_model_node_data_changed_id = 0;
- priv->tree_model_node_col_changed_id = 0;
- priv->tree_model_node_inserted_id = 0;
- priv->tree_model_node_removed_id = 0;
- priv->tree_model_node_deleted_id = 0;
- priv->tree_model_node_request_collapse_id = 0;
-
- priv->sort_info_changed_id = 0;
- priv->sort_idle_id = 0;
- priv->insert_idle_id = 0;
- priv->insert_count = 0;
-
- priv->in_resort_idle = 0;
- priv->nested_resort_idle = 0;
-}
-
-E_MAKE_TYPE(e_tree_sorted, "ETreeSorted", ETreeSorted, e_tree_sorted_class_init, e_tree_sorted_init, E_TREE_MODEL_TYPE)
-
-/**
- * e_tree_sorted_construct:
- * @etree:
- *
- *
- **/
-void
-e_tree_sorted_construct (ETreeSorted *ets, ETreeModel *source, ETableHeader *full_header, ETableSortInfo *sort_info)
-{
- ets->priv->source = source;
- if (source)
- g_object_ref(source);
-
- ets->priv->full_header = full_header;
- if (full_header)
- g_object_ref(full_header);
-
- e_tree_sorted_set_sort_info (ets, sort_info);
-
- ets->priv->tree_model_pre_change_id = g_signal_connect (G_OBJECT (source), "pre_change",
- G_CALLBACK (ets_proxy_pre_change), ets);
- ets->priv->tree_model_no_change_id = g_signal_connect (G_OBJECT (source), "no_change",
- G_CALLBACK (ets_proxy_no_change), ets);
- ets->priv->tree_model_node_changed_id = g_signal_connect (G_OBJECT (source), "node_changed",
- G_CALLBACK (ets_proxy_node_changed), ets);
- ets->priv->tree_model_node_data_changed_id = g_signal_connect (G_OBJECT (source), "node_data_changed",
- G_CALLBACK (ets_proxy_node_data_changed), ets);
- ets->priv->tree_model_node_col_changed_id = g_signal_connect (G_OBJECT (source), "node_col_changed",
- G_CALLBACK (ets_proxy_node_col_changed), ets);
- ets->priv->tree_model_node_inserted_id = g_signal_connect (G_OBJECT (source), "node_inserted",
- G_CALLBACK (ets_proxy_node_inserted), ets);
- ets->priv->tree_model_node_removed_id = g_signal_connect (G_OBJECT (source), "node_removed",
- G_CALLBACK (ets_proxy_node_removed), ets);
- ets->priv->tree_model_node_deleted_id = g_signal_connect (G_OBJECT (source), "node_deleted",
- G_CALLBACK (ets_proxy_node_deleted), ets);
- ets->priv->tree_model_node_request_collapse_id = g_signal_connect (G_OBJECT (source), "node_request_collapse",
- G_CALLBACK (ets_proxy_node_request_collapse), ets);
-
-}
-
-/**
- * e_tree_sorted_new
- *
- * FIXME docs here.
- *
- * return values: a newly constructed ETreeSorted.
- */
-ETreeSorted *
-e_tree_sorted_new (ETreeModel *source, ETableHeader *full_header, ETableSortInfo *sort_info)
-{
- ETreeSorted *ets = g_object_new (E_TREE_SORTED_TYPE, NULL);
-
- e_tree_sorted_construct(ets, source, full_header, sort_info);
-
- return ets;
-}
-
-ETreePath
-e_tree_sorted_view_to_model_path (ETreeSorted *ets,
- ETreePath view_path)
-{
- ETreeSortedPath *path = view_path;
- if (path) {
- ets->priv->last_access = path;
- d(g_print("Setting last access %p. (e_tree_sorted_view_to_model_path)\n", ets->priv->last_access));
- return path->corresponding;
- } else
- return NULL;
-}
-
-ETreePath
-e_tree_sorted_model_to_view_path (ETreeSorted *ets,
- ETreePath model_path)
-{
- return find_or_create_path(ets, model_path);
-}
-
-int
-e_tree_sorted_orig_position (ETreeSorted *ets,
- ETreePath path)
-{
- ETreeSortedPath *sorted_path = path;
- return sorted_path->orig_position;
-}
-
-int
-e_tree_sorted_node_num_children (ETreeSorted *ets,
- ETreePath path)
-{
- ETreeSortedPath *sorted_path = path;
-
- if (sorted_path->num_children == -1) {
- generate_children(ets, sorted_path);
- }
-
- return sorted_path->num_children;
-}
-
-void
-e_tree_sorted_node_resorted (ETreeSorted *sorted, ETreePath node)
-{
- g_return_if_fail (sorted != NULL);
- g_return_if_fail (E_IS_TREE_SORTED (sorted));
-
- g_signal_emit (G_OBJECT (sorted), signals [NODE_RESORTED], 0, node);
-}
-
-void
-e_tree_sorted_set_sort_info (ETreeSorted *ets, ETableSortInfo *sort_info)
-{
-
- g_return_if_fail (ets != NULL);
-
-
- if (ets->priv->sort_info) {
- if (ets->priv->sort_info_changed_id != 0)
- g_signal_handler_disconnect (G_OBJECT (ets->priv->sort_info),
- ets->priv->sort_info_changed_id);
- ets->priv->sort_info_changed_id = 0;
- g_object_unref (ets->priv->sort_info);
- }
-
- ets->priv->sort_info = sort_info;
- if (sort_info) {
- g_object_ref(sort_info);
- ets->priv->sort_info_changed_id = g_signal_connect (G_OBJECT (ets->priv->sort_info), "sort_info_changed",
- G_CALLBACK (ets_sort_info_changed), ets);
- }
-
- if (ets->priv->root)
- schedule_resort (ets, ets->priv->root, TRUE, TRUE);
-}
-
-ETableSortInfo*
-e_tree_sorted_get_sort_info (ETreeSorted *ets)
-{
- return ets->priv->sort_info;
-}
-
diff --git a/widgets/table/e-tree-sorted.h b/widgets/table/e-tree-sorted.h
deleted file mode 100644
index 41f123dc0b..0000000000
--- a/widgets/table/e-tree-sorted.h
+++ /dev/null
@@ -1,86 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-tree-sorted.h
- * Copyright 2000, 2001, Ximian, Inc.
- *
- * Authors:
- * Chris Lahey <clahey@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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.
- */
-
-#ifndef _E_TREE_SORTED_H_
-#define _E_TREE_SORTED_H_
-
-#include <gdk-pixbuf/gdk-pixbuf.h>
-#include <gal/e-table/e-tree-model.h>
-#include <gal/e-table/e-table-sort-info.h>
-#include <gal/e-table/e-table-header.h>
-
-G_BEGIN_DECLS
-
-#define E_TREE_SORTED_TYPE (e_tree_sorted_get_type ())
-#define E_TREE_SORTED(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), E_TREE_SORTED_TYPE, ETreeSorted))
-#define E_TREE_SORTED_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), E_TREE_SORTED_TYPE, ETreeSortedClass))
-#define E_IS_TREE_SORTED(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), E_TREE_SORTED_TYPE))
-#define E_IS_TREE_SORTED_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), E_TREE_SORTED_TYPE))
-#define E_TREE_SORTED_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS((o), E_TREE_SORTED_TYPE, ETreeSortedClass))
-
-typedef struct ETreeSorted ETreeSorted;
-typedef struct ETreeSortedPriv ETreeSortedPriv;
-typedef struct ETreeSortedClass ETreeSortedClass;
-
-struct ETreeSorted {
- ETreeModel base;
-
- ETreeSortedPriv *priv;
-};
-
-struct ETreeSortedClass {
- ETreeModelClass parent_class;
-
- /* Signals */
- void (*node_resorted) (ETreeSorted *etm, ETreePath node);
-};
-
-
-GType e_tree_sorted_get_type (void);
-void e_tree_sorted_construct (ETreeSorted *etree,
- ETreeModel *source,
- ETableHeader *full_header,
- ETableSortInfo *sort_info);
-ETreeSorted *e_tree_sorted_new (ETreeModel *source,
- ETableHeader *full_header,
- ETableSortInfo *sort_info);
-
-ETreePath e_tree_sorted_view_to_model_path (ETreeSorted *ets,
- ETreePath view_path);
-ETreePath e_tree_sorted_model_to_view_path (ETreeSorted *ets,
- ETreePath model_path);
-int e_tree_sorted_orig_position (ETreeSorted *ets,
- ETreePath path);
-int e_tree_sorted_node_num_children (ETreeSorted *ets,
- ETreePath path);
-
-void e_tree_sorted_node_resorted (ETreeSorted *tree_model,
- ETreePath node);
-
-ETableSortInfo* e_tree_sorted_get_sort_info (ETreeSorted *tree_model);
-void e_tree_sorted_set_sort_info (ETreeSorted *tree_model,
- ETableSortInfo *sort_info);
-
-G_END_DECLS
-
-#endif /* _E_TREE_SORTED_H */
diff --git a/widgets/table/e-tree-table-adapter.c b/widgets/table/e-tree-table-adapter.c
deleted file mode 100644
index 99fa12b532..0000000000
--- a/widgets/table/e-tree-table-adapter.c
+++ /dev/null
@@ -1,1123 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-tree-table-adapter.c
- * Copyright 2000, 2001, Ximian, Inc.
- *
- * Authors:
- * Chris Lahey <clahey@ximian.com>
- * Chris Toshok <toshok@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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.
- */
-
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <stdlib.h>
-#include <string.h>
-
-#include <libxml/tree.h>
-#include <libxml/parser.h>
-#include "gal/util/e-util.h"
-#include "gal/util/e-xml-utils.h"
-#include "e-tree-table-adapter.h"
-#include "e-table-sorting-utils.h"
-
-#define PARENT_TYPE E_TABLE_MODEL_TYPE
-#define d(x)
-
-#define INCREMENT_AMOUNT 100
-
-static ETableModelClass *parent_class;
-
-typedef struct {
- ETreePath path;
- guint32 num_visible_children;
- guint32 index;
-
- guint expanded : 1;
- guint expandable : 1;
- guint expandable_set : 1;
-} node_t;
-
-struct ETreeTableAdapterPriv {
- ETreeModel *source;
- ETableSortInfo *sort_info;
- ETableHeader *header;
-
- int n_map;
- int n_vals_allocated;
- node_t **map_table;
- GHashTable *nodes;
- GNode *root;
-
- guint root_visible : 1;
- guint remap_needed : 1;
-
- int last_access;
-
- int pre_change_id;
- int no_change_id;
- int node_changed_id;
- int node_data_changed_id;
- int node_col_changed_id;
- int node_inserted_id;
- int node_removed_id;
- int node_request_collapse_id;
- int sort_info_changed_id;
-};
-
-static GNode *
-lookup_gnode(ETreeTableAdapter *etta, ETreePath path)
-{
- GNode *gnode;
-
- if (!path)
- return NULL;
-
- gnode = g_hash_table_lookup(etta->priv->nodes, path);
-
- return gnode;
-}
-
-static void
-resize_map(ETreeTableAdapter *etta, int size)
-{
- if (size > etta->priv->n_vals_allocated) {
- etta->priv->n_vals_allocated = MAX(etta->priv->n_vals_allocated + INCREMENT_AMOUNT, size);
- etta->priv->map_table = g_renew (node_t *, etta->priv->map_table, etta->priv->n_vals_allocated);
- }
-
- etta->priv->n_map = size;
-}
-
-static void
-move_map_elements(ETreeTableAdapter *etta, int to, int from, int count)
-{
- if (count <= 0 || from >= etta->priv->n_map)
- return;
- memmove(etta->priv->map_table + to, etta->priv->map_table + from, count * sizeof (node_t *));
- etta->priv->remap_needed = TRUE;
-}
-
-static gint
-fill_map(ETreeTableAdapter *etta, gint index, GNode *gnode)
-{
- GNode *p;
-
- if ((gnode != etta->priv->root) || etta->priv->root_visible)
- etta->priv->map_table[index++] = gnode->data;
-
- for (p = gnode->children; p; p = p->next)
- index = fill_map(etta, index, p);
-
- etta->priv->remap_needed = TRUE;
- return index;
-}
-
-static void
-remap_indices(ETreeTableAdapter *etta)
-{
- int i;
- for (i = 0; i < etta->priv->n_map; i++)
- etta->priv->map_table[i]->index = i;
- etta->priv->remap_needed = FALSE;
-}
-
-static node_t *
-get_node(ETreeTableAdapter *etta, ETreePath path)
-{
- GNode *gnode = lookup_gnode(etta, path);
-
- if (!gnode)
- return NULL;
-
- return (node_t *)gnode->data;
-}
-
-static void
-resort_node(ETreeTableAdapter *etta, GNode *gnode, gboolean recurse)
-{
- node_t *node = (node_t *)gnode->data;
- ETreePath *paths, path;
- GNode *prev, *curr;
- int i, count;
- gboolean sort_needed;
-
- if (node->num_visible_children == 0)
- return;
-
- sort_needed = etta->priv->sort_info && e_table_sort_info_sorting_get_count (etta->priv->sort_info) > 0;
-
- for (i = 0, path = e_tree_model_node_get_first_child(etta->priv->source, node->path); path;
- path = e_tree_model_node_get_next(etta->priv->source, path), i++);
-
- count = i;
- if (count <= 1)
- return;
-
- paths = g_new0(ETreePath, count);
-
- for (i = 0, path = e_tree_model_node_get_first_child(etta->priv->source, node->path); path;
- path = e_tree_model_node_get_next(etta->priv->source, path), i++)
- paths[i] = path;
-
- if (count > 1 && sort_needed)
- e_table_sorting_utils_tree_sort(etta->priv->source, etta->priv->sort_info, etta->priv->header, paths, count);
-
- prev = NULL;
- for (i = 0; i < count; i++) {
- curr = lookup_gnode(etta, paths[i]);
- if (!curr)
- continue;
-
- if (prev)
- prev->next = curr;
- else
- gnode->children = curr;
-
- curr->prev = prev;
- curr->next = NULL;
- prev = curr;
- if (recurse)
- resort_node(etta, curr, recurse);
- }
-
- g_free(paths);
-}
-
-static gint
-get_row(ETreeTableAdapter *etta, ETreePath path)
-{
- node_t *node = get_node(etta, path);
- if (!node)
- return -1;
-
- if (etta->priv->remap_needed)
- remap_indices(etta);
-
- return node->index;
-}
-
-static ETreePath
-get_path (ETreeTableAdapter *etta, int row)
-{
- if (row == -1 && etta->priv->n_map > 0)
- row = etta->priv->n_map - 1;
- else if (row < 0 || row >= etta->priv->n_map)
- return NULL;
-
- return etta->priv->map_table [row]->path;
-}
-
-static void
-kill_gnode(GNode *node, ETreeTableAdapter *etta)
-{
- g_hash_table_remove(etta->priv->nodes, ((node_t *)node->data)->path);
-
- while (node->children) {
- GNode *next = node->children->next;
- kill_gnode(node->children, etta);
- node->children = next;
- }
-
- g_free(node->data);
- if (node == etta->priv->root)
- etta->priv->root = NULL;
- g_node_destroy(node);
-}
-
-static void
-update_child_counts(GNode *gnode, gint delta)
-{
- while (gnode) {
- node_t *node = (node_t *) gnode->data;
- node->num_visible_children += delta;
- gnode = gnode->parent;
- }
-}
-
-static int
-delete_children(ETreeTableAdapter *etta, GNode *gnode)
-{
- node_t *node = (node_t *)gnode->data;
- int to_remove = node ? node->num_visible_children : 0;
-
- if (to_remove == 0)
- return 0;
-
- while (gnode->children) {
- GNode *next = gnode->children->next;
- kill_gnode(gnode->children, etta);
- gnode->children = next;
- }
-
- return to_remove;
-}
-
-static void
-delete_node(ETreeTableAdapter *etta, ETreePath parent, ETreePath path)
-{
- int to_remove = 1;
- int parent_row = get_row(etta, parent);
- int row = get_row(etta, path);
- GNode *gnode = lookup_gnode(etta, path);
- GNode *parent_gnode = lookup_gnode(etta, parent);
-
- e_table_model_pre_change(E_TABLE_MODEL(etta));
-
- if (row == -1) {
- e_table_model_no_change(E_TABLE_MODEL(etta));
- return;
- }
-
- to_remove += delete_children(etta, gnode);
- kill_gnode(gnode, etta);
-
- move_map_elements(etta, row, row + to_remove, etta->priv->n_map - row - to_remove);
- resize_map(etta, etta->priv->n_map - to_remove);
-
- if (parent_gnode != NULL) {
- node_t *parent_node = parent_gnode->data;
- gboolean expandable = e_tree_model_node_is_expandable(etta->priv->source, parent);
-
- update_child_counts(parent_gnode, - to_remove);
- if (parent_node->expandable != expandable) {
- e_table_model_pre_change(E_TABLE_MODEL(etta));
- parent_node->expandable = expandable;
- e_table_model_row_changed(E_TABLE_MODEL(etta), parent_row);
- }
-
- resort_node (etta, parent_gnode, FALSE);
- }
-
- e_table_model_rows_deleted(E_TABLE_MODEL(etta), row, to_remove);
-}
-
-static GNode *
-create_gnode(ETreeTableAdapter *etta, ETreePath path)
-{
- GNode *gnode;
- node_t *node;
-
- node = g_new0(node_t, 1);
- node->path = path;
- node->index = -1;
- node->expanded = e_tree_model_get_expanded_default(etta->priv->source);
- node->expandable = e_tree_model_node_is_expandable(etta->priv->source, path);
- node->expandable_set = 1;
- node->num_visible_children = 0;
- gnode = g_node_new(node);
- g_hash_table_insert(etta->priv->nodes, path, gnode);
- return gnode;
-}
-
-static gint
-insert_children(ETreeTableAdapter *etta, GNode *gnode)
-{
- ETreePath path, tmp;
- int count = 0;
- int pos = 0;
-
- path = ((node_t *)gnode->data)->path;
- for (tmp = e_tree_model_node_get_first_child(etta->priv->source, path);
- tmp;
- tmp = e_tree_model_node_get_next(etta->priv->source, tmp), pos++) {
- GNode *child = create_gnode(etta, tmp);
- node_t *node = (node_t *) child->data;
- if (node->expanded)
- node->num_visible_children = insert_children(etta, child);
- g_node_prepend(gnode, child);
- count += node->num_visible_children + 1;
- }
- g_node_reverse_children(gnode);
- return count;
-}
-
-static void
-generate_tree(ETreeTableAdapter *etta, ETreePath path)
-{
- GNode *gnode;
- node_t *node;
- int size;
-
- e_table_model_pre_change(E_TABLE_MODEL(etta));
-
- g_assert(e_tree_model_node_is_root(etta->priv->source, path));
-
- if (etta->priv->root)
- kill_gnode(etta->priv->root, etta);
- resize_map(etta, 0);
-
- gnode = create_gnode(etta, path);
- node = (node_t *) gnode->data;
- node->expanded = TRUE;
- node->num_visible_children = insert_children(etta, gnode);
- if (etta->priv->sort_info && e_table_sort_info_sorting_get_count(etta->priv->sort_info) > 0)
- resort_node(etta, gnode, TRUE);
-
- etta->priv->root = gnode;
- size = etta->priv->root_visible ? node->num_visible_children + 1 : node->num_visible_children;
- resize_map(etta, size);
- fill_map(etta, 0, gnode);
- e_table_model_changed(E_TABLE_MODEL(etta));
-}
-
-static void
-insert_node(ETreeTableAdapter *etta, ETreePath parent, ETreePath path)
-{
- GNode *gnode, *parent_gnode;
- node_t *node, *parent_node;
- gboolean expandable;
- int size, row;
-
- e_table_model_pre_change(E_TABLE_MODEL(etta));
-
- if (get_node(etta, path)) {
- e_table_model_no_change(E_TABLE_MODEL(etta));
- return;
- }
-
- parent_gnode = lookup_gnode(etta, parent);
- if (!parent_gnode) {
- ETreePath grandparent = e_tree_model_node_get_parent(etta->priv->source, parent);
- if (e_tree_model_node_is_root(etta->priv->source, parent))
- generate_tree(etta, parent);
- else
- insert_node(etta, grandparent, parent);
- return;
- }
-
- parent_node = (node_t *) parent_gnode->data;
-
- if (parent_gnode != etta->priv->root) {
- expandable = e_tree_model_node_is_expandable(etta->priv->source, parent);
- if (parent_node->expandable != expandable) {
- e_table_model_pre_change(E_TABLE_MODEL(etta));
- parent_node->expandable = expandable;
- parent_node->expandable_set = 1;
- e_table_model_row_changed(E_TABLE_MODEL(etta), parent_node->index);
- }
- }
-
- if (!e_tree_table_adapter_node_is_expanded (etta, parent)) {
- e_table_model_no_change(E_TABLE_MODEL(etta));
- return;
- }
-
- gnode = create_gnode(etta, path);
- node = (node_t *) gnode->data;
-
- if (node->expanded)
- node->num_visible_children = insert_children(etta, gnode);
-
- g_node_append(parent_gnode, gnode);
- update_child_counts(parent_gnode, node->num_visible_children + 1);
- resort_node(etta, parent_gnode, FALSE);
- resort_node(etta, gnode, TRUE);
-
- size = node->num_visible_children + 1;
- resize_map(etta, etta->priv->n_map + size);
- if (parent_gnode == etta->priv->root)
- row = 0;
- else {
- gint new_size = parent_node->num_visible_children + 1;
- gint old_size = new_size - size;
- row = parent_node->index;
- move_map_elements(etta, row + new_size, row + old_size, etta->priv->n_map - row - new_size);
- }
- fill_map(etta, row, parent_gnode);
- e_table_model_rows_inserted(E_TABLE_MODEL(etta), get_row(etta, path), size);
-}
-
-static void
-update_node(ETreeTableAdapter *etta, ETreePath path)
-{
- ETreePath parent = e_tree_model_node_get_parent(etta->priv->source, path);
- gboolean expanded = e_tree_table_adapter_node_is_expanded (etta, path);
- if (e_tree_model_node_is_root(etta->priv->source, path))
- generate_tree(etta, path);
- else {
- delete_node(etta, parent, path);
- insert_node(etta, parent, path);
- }
-
- if (expanded != e_tree_model_get_expanded_default (etta->priv->source))
- e_tree_table_adapter_node_set_expanded (etta, path, expanded);
-}
-
-static void
-etta_finalize (GObject *object)
-{
- ETreeTableAdapter *etta = E_TREE_TABLE_ADAPTER (object);
-
- if (etta->priv->root) {
- kill_gnode(etta->priv->root, etta);
- etta->priv->root = NULL;
- }
-
- g_hash_table_destroy (etta->priv->nodes);
-
- g_free (etta->priv->map_table);
-
- g_free (etta->priv);
-
- G_OBJECT_CLASS (parent_class)->finalize (object);
-}
-
-static void
-etta_dispose (GObject *object)
-{
- ETreeTableAdapter *etta = E_TREE_TABLE_ADAPTER (object);
-
- if (etta->priv->sort_info) {
- g_signal_handler_disconnect(G_OBJECT (etta->priv->sort_info),
- etta->priv->sort_info_changed_id);
- g_object_unref(etta->priv->sort_info);
- etta->priv->sort_info = NULL;
- }
-
- if (etta->priv->header) {
- g_object_unref(etta->priv->header);
- etta->priv->header = NULL;
- }
-
- if (etta->priv->source) {
- g_signal_handler_disconnect (G_OBJECT (etta->priv->source),
- etta->priv->pre_change_id);
- g_signal_handler_disconnect (G_OBJECT (etta->priv->source),
- etta->priv->no_change_id);
- g_signal_handler_disconnect (G_OBJECT (etta->priv->source),
- etta->priv->node_changed_id);
- g_signal_handler_disconnect (G_OBJECT (etta->priv->source),
- etta->priv->node_data_changed_id);
- g_signal_handler_disconnect (G_OBJECT (etta->priv->source),
- etta->priv->node_col_changed_id);
- g_signal_handler_disconnect (G_OBJECT (etta->priv->source),
- etta->priv->node_inserted_id);
- g_signal_handler_disconnect (G_OBJECT (etta->priv->source),
- etta->priv->node_removed_id);
- g_signal_handler_disconnect (G_OBJECT (etta->priv->source),
- etta->priv->node_request_collapse_id);
-
- g_object_unref (etta->priv->source);
- etta->priv->source = NULL;
- }
-
- G_OBJECT_CLASS (parent_class)->dispose (object);
-}
-
-static int
-etta_column_count (ETableModel *etm)
-{
- ETreeTableAdapter *etta = (ETreeTableAdapter *)etm;
-
- return e_tree_model_column_count (etta->priv->source);
-}
-
-static gboolean
-etta_has_save_id (ETableModel *etm)
-{
- ETreeTableAdapter *etta = (ETreeTableAdapter *)etm;
-
- return e_tree_model_has_save_id (etta->priv->source);
-}
-
-static gchar *
-etta_get_save_id (ETableModel *etm, int row)
-{
- ETreeTableAdapter *etta = (ETreeTableAdapter *)etm;
-
- return e_tree_model_get_save_id (etta->priv->source, get_path(etta, row));
-}
-
-static gboolean
-etta_has_change_pending (ETableModel *etm)
-{
- ETreeTableAdapter *etta = (ETreeTableAdapter *)etm;
-
- return e_tree_model_has_change_pending (etta->priv->source);
-}
-
-
-static int
-etta_row_count (ETableModel *etm)
-{
- ETreeTableAdapter *etta = (ETreeTableAdapter *)etm;
-
- return etta->priv->n_map;
-}
-
-static void *
-etta_value_at (ETableModel *etm, int col, int row)
-{
- ETreeTableAdapter *etta = (ETreeTableAdapter *)etm;
-
- switch (col) {
- case -1:
- if (row == -1)
- return NULL;
- return get_path (etta, row);
- case -2:
- return etta->priv->source;
- case -3:
- return etta;
- default:
- return e_tree_model_value_at (etta->priv->source, get_path (etta, row), col);
- }
-}
-
-static void
-etta_set_value_at (ETableModel *etm, int col, int row, const void *val)
-{
- ETreeTableAdapter *etta = (ETreeTableAdapter *)etm;
-
- e_tree_model_set_value_at (etta->priv->source, get_path (etta, row), col, val);
-}
-
-static gboolean
-etta_is_cell_editable (ETableModel *etm, int col, int row)
-{
- ETreeTableAdapter *etta = (ETreeTableAdapter *)etm;
-
- return e_tree_model_node_is_editable (etta->priv->source, get_path (etta, row), col);
-}
-
-static void
-etta_append_row (ETableModel *etm, ETableModel *source, int row)
-{
-}
-
-static void *
-etta_duplicate_value (ETableModel *etm, int col, const void *value)
-{
- ETreeTableAdapter *etta = (ETreeTableAdapter *)etm;
-
- return e_tree_model_duplicate_value (etta->priv->source, col, value);
-}
-
-static void
-etta_free_value (ETableModel *etm, int col, void *value)
-{
- ETreeTableAdapter *etta = (ETreeTableAdapter *)etm;
-
- e_tree_model_free_value (etta->priv->source, col, value);
-}
-
-static void *
-etta_initialize_value (ETableModel *etm, int col)
-{
- ETreeTableAdapter *etta = (ETreeTableAdapter *)etm;
-
- return e_tree_model_initialize_value (etta->priv->source, col);
-}
-
-static gboolean
-etta_value_is_empty (ETableModel *etm, int col, const void *value)
-{
- ETreeTableAdapter *etta = (ETreeTableAdapter *)etm;
-
- return e_tree_model_value_is_empty (etta->priv->source, col, value);
-}
-
-static char *
-etta_value_to_string (ETableModel *etm, int col, const void *value)
-{
- ETreeTableAdapter *etta = (ETreeTableAdapter *)etm;
-
- return e_tree_model_value_to_string (etta->priv->source, col, value);
-}
-
-static void
-etta_class_init (ETreeTableAdapterClass *klass)
-{
- ETableModelClass *table_class = (ETableModelClass *) klass;
- GObjectClass *object_class = (GObjectClass *) klass;
-
- parent_class = g_type_class_peek_parent (klass);
-
- object_class->dispose = etta_dispose;
- object_class->finalize = etta_finalize;
-
- table_class->column_count = etta_column_count;
- table_class->row_count = etta_row_count;
- table_class->append_row = etta_append_row;
-
- table_class->value_at = etta_value_at;
- table_class->set_value_at = etta_set_value_at;
- table_class->is_cell_editable = etta_is_cell_editable;
-
- table_class->has_save_id = etta_has_save_id;
- table_class->get_save_id = etta_get_save_id;
-
- table_class->has_change_pending = etta_has_change_pending;
- table_class->duplicate_value = etta_duplicate_value;
- table_class->free_value = etta_free_value;
- table_class->initialize_value = etta_initialize_value;
- table_class->value_is_empty = etta_value_is_empty;
- table_class->value_to_string = etta_value_to_string;
-}
-
-static void
-etta_init (ETreeTableAdapter *etta)
-{
- etta->priv = g_new(ETreeTableAdapterPriv, 1);
-
- etta->priv->source = NULL;
- etta->priv->sort_info = NULL;
-
- etta->priv->n_map = 0;
- etta->priv->n_vals_allocated = 0;
- etta->priv->map_table = NULL;
- etta->priv->nodes = NULL;
- etta->priv->root = NULL;
-
- etta->priv->root_visible = TRUE;
- etta->priv->remap_needed = TRUE;
-
- etta->priv->pre_change_id = 0;
- etta->priv->no_change_id = 0;
- etta->priv->node_changed_id = 0;
- etta->priv->node_data_changed_id = 0;
- etta->priv->node_col_changed_id = 0;
- etta->priv->node_inserted_id = 0;
- etta->priv->node_removed_id = 0;
- etta->priv->node_request_collapse_id = 0;
-}
-
-E_MAKE_TYPE(e_tree_table_adapter, "ETreeTableAdapter", ETreeTableAdapter, etta_class_init, etta_init, PARENT_TYPE)
-
-static void
-etta_proxy_pre_change (ETreeModel *etm, ETreeTableAdapter *etta)
-{
- e_table_model_pre_change(E_TABLE_MODEL(etta));
-}
-
-static void
-etta_proxy_no_change (ETreeModel *etm, ETreeTableAdapter *etta)
-{
- e_table_model_no_change(E_TABLE_MODEL(etta));
-}
-
-static void
-etta_proxy_node_changed (ETreeModel *etm, ETreePath path, ETreeTableAdapter *etta)
-{
- update_node(etta, path);
-
- e_table_model_changed(E_TABLE_MODEL(etta));
-}
-
-static void
-etta_proxy_node_data_changed (ETreeModel *etm, ETreePath path, ETreeTableAdapter *etta)
-{
- int row = get_row(etta, path);
-
- if (row == -1) {
- e_table_model_no_change(E_TABLE_MODEL(etta));
- return;
- }
-
- e_table_model_row_changed(E_TABLE_MODEL(etta), row);
-}
-
-static void
-etta_proxy_node_col_changed (ETreeModel *etm, ETreePath path, int col, ETreeTableAdapter *etta)
-{
- int row = get_row(etta, path);
-
- if (row == -1) {
- e_table_model_no_change(E_TABLE_MODEL(etta));
- return;
- }
-
- e_table_model_cell_changed(E_TABLE_MODEL(etta), col, row);
-}
-
-static void
-etta_proxy_node_inserted (ETreeModel *etm, ETreePath parent, ETreePath child, ETreeTableAdapter *etta)
-{
- if (e_tree_model_node_is_root(etm, child))
- generate_tree(etta, child);
- else
- insert_node(etta, parent, child);
-}
-
-static void
-etta_proxy_node_removed (ETreeModel *etm, ETreePath parent, ETreePath child, int old_position, ETreeTableAdapter *etta)
-{
- delete_node(etta, parent, child);
-}
-
-static void
-etta_proxy_node_request_collapse (ETreeModel *etm, ETreePath node, ETreeTableAdapter *etta)
-{
- e_tree_table_adapter_node_set_expanded(etta, node, FALSE);
-}
-
-static void
-etta_sort_info_changed (ETableSortInfo *sort_info, ETreeTableAdapter *etta)
-{
- e_table_model_pre_change(E_TABLE_MODEL(etta));
- resort_node(etta, etta->priv->root, TRUE);
- fill_map(etta, 0, etta->priv->root);
- e_table_model_changed(E_TABLE_MODEL(etta));
-}
-
-ETableModel *
-e_tree_table_adapter_construct (ETreeTableAdapter *etta, ETreeModel *source, ETableSortInfo *sort_info, ETableHeader *header)
-{
- ETreePath root;
-
- etta->priv->source = source;
- g_object_ref (source);
-
- etta->priv->sort_info = sort_info;
- if (sort_info) {
- g_object_ref(sort_info);
- etta->priv->sort_info_changed_id = g_signal_connect (G_OBJECT (sort_info), "sort_info_changed",
- G_CALLBACK (etta_sort_info_changed), etta);
- }
-
- etta->priv->header = header;
- if (header)
- g_object_ref(header);
-
- etta->priv->nodes = g_hash_table_new(NULL, NULL);
-
- root = e_tree_model_get_root (source);
-
- if (root)
- generate_tree(etta, root);
-
- etta->priv->pre_change_id = g_signal_connect(G_OBJECT(source), "pre_change",
- G_CALLBACK (etta_proxy_pre_change), etta);
- etta->priv->no_change_id = g_signal_connect (G_OBJECT (source), "no_change",
- G_CALLBACK (etta_proxy_no_change), etta);
- etta->priv->node_changed_id = g_signal_connect (G_OBJECT (source), "node_changed",
- G_CALLBACK (etta_proxy_node_changed), etta);
- etta->priv->node_data_changed_id = g_signal_connect (G_OBJECT (source), "node_data_changed",
- G_CALLBACK (etta_proxy_node_data_changed), etta);
- etta->priv->node_col_changed_id = g_signal_connect (G_OBJECT (source), "node_col_changed",
- G_CALLBACK (etta_proxy_node_col_changed), etta);
- etta->priv->node_inserted_id = g_signal_connect (G_OBJECT (source), "node_inserted",
- G_CALLBACK (etta_proxy_node_inserted), etta);
- etta->priv->node_removed_id = g_signal_connect (G_OBJECT (source), "node_removed",
- G_CALLBACK (etta_proxy_node_removed), etta);
- etta->priv->node_request_collapse_id = g_signal_connect (G_OBJECT (source), "node_request_collapse",
- G_CALLBACK (etta_proxy_node_request_collapse), etta);
-
- return E_TABLE_MODEL (etta);
-}
-
-ETableModel *
-e_tree_table_adapter_new (ETreeModel *source, ETableSortInfo *sort_info, ETableHeader *header)
-{
- ETreeTableAdapter *etta = g_object_new (E_TREE_TABLE_ADAPTER_TYPE, NULL);
-
- e_tree_table_adapter_construct (etta, source, sort_info, header);
-
- return (ETableModel *) etta;
-}
-
-typedef struct {
- xmlNode *root;
- gboolean expanded_default;
- ETreeModel *model;
-} TreeAndRoot;
-
-static void
-save_expanded_state_func (gpointer keyp, gpointer value, gpointer data)
-{
- ETreePath path = keyp;
- node_t *node = ((GNode *)value)->data;
- TreeAndRoot *tar = data;
- xmlNode *xmlnode;
-
- if (node->expanded != tar->expanded_default) {
- gchar *save_id = e_tree_model_get_save_id(tar->model, path);
- xmlnode = xmlNewChild (tar->root, NULL, "node", NULL);
- e_xml_set_string_prop_by_name(xmlnode, "id", save_id);
- g_free(save_id);
- }
-}
-
-void
-e_tree_table_adapter_save_expanded_state (ETreeTableAdapter *etta, const char *filename)
-{
- TreeAndRoot tar;
- xmlDocPtr doc;
- xmlNode *root;
-
- g_return_if_fail(etta != NULL);
-
- doc = xmlNewDoc ("1.0");
- root = xmlNewDocNode (doc, NULL, (xmlChar *) "expanded_state", NULL);
- xmlDocSetRootElement (doc, root);
-
- tar.model = etta->priv->source;
- tar.root = root;
- tar.expanded_default = e_tree_model_get_expanded_default(etta->priv->source);
-
- e_xml_set_integer_prop_by_name (root, "vers", 2);
- e_xml_set_bool_prop_by_name (root, "default", tar.expanded_default);
-
- g_hash_table_foreach (etta->priv->nodes, save_expanded_state_func, &tar);
-
- e_xml_save_file (filename, doc);
- xmlFreeDoc (doc);
-}
-
-static xmlDoc *
-open_file (ETreeTableAdapter *etta, const char *filename)
-{
- xmlDoc *doc;
- xmlNode *root;
- int vers;
- gboolean model_default, saved_default;
-
- doc = xmlParseFile (filename);
- if (!doc)
- return NULL;
-
- root = xmlDocGetRootElement (doc);
- if (root == NULL || strcmp (root->name, "expanded_state")) {
- xmlFreeDoc (doc);
- return NULL;
- }
-
- vers = e_xml_get_integer_prop_by_name_with_default (root, "vers", 0);
- if (vers > 2) {
- xmlFreeDoc (doc);
- return NULL;
- }
- model_default = e_tree_model_get_expanded_default (etta->priv->source);
- saved_default = e_xml_get_bool_prop_by_name_with_default (root, "default", !model_default);
- if (saved_default != model_default) {
- xmlFreeDoc (doc);
- return NULL;
- }
-
- return doc;
-}
-
-void
-e_tree_table_adapter_load_expanded_state (ETreeTableAdapter *etta, const char *filename)
-{
- xmlDoc *doc;
- xmlNode *root, *child;
- gboolean model_default;
-
- g_return_if_fail(etta != NULL);
-
- doc = open_file(etta, filename);
- if (!doc)
- return;
-
- root = xmlDocGetRootElement (doc);
-
- e_table_model_pre_change(E_TABLE_MODEL(etta));
-
- model_default = e_tree_model_get_expanded_default(etta->priv->source);
-
- for (child = root->xmlChildrenNode; child; child = child->next) {
- char *id;
- ETreePath path;
-
- if (strcmp (child->name, "node")) {
- d(g_warning ("unknown node '%s' in %s", child->name, filename));
- continue;
- }
-
- id = e_xml_get_string_prop_by_name_with_default (child, "id", "");
-
- if (!strcmp(id, "")) {
- g_free(id);
- continue;
- }
-
- path = e_tree_model_get_node_by_id(etta->priv->source, id);
- if (path)
- e_tree_table_adapter_node_set_expanded(etta, path, !model_default);
- }
-
- xmlFreeDoc (doc);
-
- e_table_model_changed (E_TABLE_MODEL (etta));
-}
-
-void
-e_tree_table_adapter_root_node_set_visible (ETreeTableAdapter *etta, gboolean visible)
-{
- int size;
-
- if (etta->priv->root_visible == visible)
- return;
-
- e_table_model_pre_change (E_TABLE_MODEL(etta));
-
- etta->priv->root_visible = visible;
- if (!visible) {
- ETreePath root = e_tree_model_get_root(etta->priv->source);
- if (root)
- e_tree_table_adapter_node_set_expanded(etta, root, TRUE);
- }
- size = (visible ? 1 : 0) + (etta->priv->root ? ((node_t *)etta->priv->root->data)->num_visible_children : 0);
- resize_map(etta, size);
- if (etta->priv->root)
- fill_map(etta, 0, etta->priv->root);
- e_table_model_changed(E_TABLE_MODEL(etta));
-}
-
-void
-e_tree_table_adapter_node_set_expanded (ETreeTableAdapter *etta, ETreePath path, gboolean expanded)
-{
- GNode *gnode = lookup_gnode(etta, path);
- node_t *node;
- int row;
-
- if (!expanded && e_tree_model_node_is_root (etta->priv->source, path) && !etta->priv->root_visible)
- return;
-
- if (!gnode && expanded) {
- ETreePath parent = e_tree_model_node_get_parent(etta->priv->source, path);
- g_return_if_fail(parent != NULL);
- e_tree_table_adapter_node_set_expanded(etta, parent, expanded);
- gnode = lookup_gnode(etta, path);
- }
- g_return_if_fail(gnode != NULL);
-
- node = (node_t *) gnode->data;
-
- if (expanded == node->expanded)
- return;
-
- node->expanded = expanded;
-
- row = get_row(etta, path);
- if (row == -1)
- return;
-
- e_table_model_pre_change (E_TABLE_MODEL(etta));
- e_table_model_pre_change (E_TABLE_MODEL(etta));
- e_table_model_row_changed(E_TABLE_MODEL(etta), row);
-
-
- if (expanded) {
- int num_children = insert_children(etta, gnode);
- update_child_counts(gnode, num_children);
- if (etta->priv->sort_info && e_table_sort_info_sorting_get_count(etta->priv->sort_info) > 0)
- resort_node(etta, gnode, TRUE);
- resize_map(etta, etta->priv->n_map + num_children);
- move_map_elements(etta, row + 1 + num_children, row + 1, etta->priv->n_map - row - 1 - num_children);
- fill_map(etta, row, gnode);
- if (num_children != 0) {
- e_table_model_rows_inserted(E_TABLE_MODEL(etta), row + 1, num_children);
- } else
- e_table_model_no_change(E_TABLE_MODEL(etta));
- } else {
- int num_children = delete_children(etta, gnode);
- if (num_children == 0) {
- e_table_model_no_change(E_TABLE_MODEL(etta));
- return;
- }
- move_map_elements(etta, row + 1, row + 1 + num_children, etta->priv->n_map - row - 1 - num_children);
- update_child_counts(gnode, - num_children);
- resize_map(etta, etta->priv->n_map - num_children);
- e_table_model_rows_deleted(E_TABLE_MODEL(etta), row + 1, num_children);
- }
-}
-
-void
-e_tree_table_adapter_node_set_expanded_recurse (ETreeTableAdapter *etta, ETreePath path, gboolean expanded)
-{
- ETreePath children;
-
- e_tree_table_adapter_node_set_expanded(etta, path, expanded);
-
- for (children = e_tree_model_node_get_first_child(etta->priv->source, path);
- children;
- children = e_tree_model_node_get_next(etta->priv->source, children)) {
- e_tree_table_adapter_node_set_expanded_recurse(etta, children, expanded);
- }
-}
-
-ETreePath
-e_tree_table_adapter_node_at_row (ETreeTableAdapter *etta, int row)
-{
- return get_path(etta, row);
-}
-
-int
-e_tree_table_adapter_row_of_node (ETreeTableAdapter *etta, ETreePath path)
-{
- return get_row(etta, path);
-}
-
-gboolean
-e_tree_table_adapter_root_node_is_visible(ETreeTableAdapter *etta)
-{
- return etta->priv->root_visible;
-}
-
-void
-e_tree_table_adapter_show_node (ETreeTableAdapter *etta, ETreePath path)
-{
- ETreePath parent;
-
- parent = e_tree_model_node_get_parent(etta->priv->source, path);
-
- while (parent) {
- e_tree_table_adapter_node_set_expanded(etta, parent, TRUE);
- parent = e_tree_model_node_get_parent(etta->priv->source, parent);
- }
-}
-
-gboolean
-e_tree_table_adapter_node_is_expanded (ETreeTableAdapter *etta, ETreePath path)
-{
- node_t *node = get_node(etta, path);
- if (!e_tree_model_node_is_expandable (etta->priv->source, path) || !node)
- return FALSE;
-
- return node->expanded;
-}
-
-void
-e_tree_table_adapter_set_sort_info (ETreeTableAdapter *etta, ETableSortInfo *sort_info)
-{
- if (etta->priv->sort_info) {
- g_signal_handler_disconnect(G_OBJECT(etta->priv->sort_info),
- etta->priv->sort_info_changed_id);
- g_object_unref(etta->priv->sort_info);
- }
-
- etta->priv->sort_info = sort_info;
- if (sort_info) {
- g_object_ref(sort_info);
- etta->priv->sort_info_changed_id = g_signal_connect(G_OBJECT(sort_info), "sort_info_changed",
- G_CALLBACK(etta_sort_info_changed), etta);
- }
-
- if (!etta->priv->root)
- return;
-
- e_table_model_pre_change(E_TABLE_MODEL(etta));
- resort_node(etta, etta->priv->root, TRUE);
- fill_map(etta, 0, etta->priv->root);
- e_table_model_changed(E_TABLE_MODEL(etta));
-}
-
diff --git a/widgets/table/e-tree-table-adapter.h b/widgets/table/e-tree-table-adapter.h
deleted file mode 100644
index a856489a40..0000000000
--- a/widgets/table/e-tree-table-adapter.h
+++ /dev/null
@@ -1,93 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-tree-table-adapter.h
- * Copyright 2000, 2001, Ximian, Inc.
- *
- * Authors:
- * Chris Lahey <clahey@ximian.com>
- * Chris Toshok <toshok@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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.
- */
-
-#ifndef _E_TREE_TABLE_ADAPTER_H_
-#define _E_TREE_TABLE_ADAPTER_H_
-
-#include <glib-object.h>
-#include <gal/e-table/e-table-model.h>
-#include <gal/e-table/e-tree-model.h>
-#include <gal/e-table/e-table-sort-info.h>
-#include <gal/e-table/e-table-header.h>
-
-G_BEGIN_DECLS
-
-#define E_TREE_TABLE_ADAPTER_TYPE (e_tree_table_adapter_get_type ())
-#define E_TREE_TABLE_ADAPTER(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), E_TREE_TABLE_ADAPTER_TYPE, ETreeTableAdapter))
-#define E_TREE_TABLE_ADAPTER_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), E_TREE_TABLE_ADAPTER_TYPE, ETreeTableAdapterClass))
-#define E_IS_TREE_TABLE_ADAPTER(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), E_TREE_TABLE_ADAPTER_TYPE))
-#define E_IS_TREE_TABLE_ADAPTER_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), E_TREE_TABLE_ADAPTER_TYPE))
-#define E_TREE_TABLE_ADAPTER_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((obj), E_TREE_TABLE_ADAPTER_TYPE, ETreeTableAdapterClass))
-
-typedef struct ETreeTableAdapterPriv ETreeTableAdapterPriv;
-
-typedef struct {
- ETableModel base;
-
- ETreeTableAdapterPriv *priv;
-} ETreeTableAdapter;
-
-typedef struct {
- ETableModelClass parent_class;
-} ETreeTableAdapterClass;
-
-GType e_tree_table_adapter_get_type (void);
-ETableModel *e_tree_table_adapter_new (ETreeModel *source,
- ETableSortInfo *sort_info,
- ETableHeader *header);
-ETableModel *e_tree_table_adapter_construct (ETreeTableAdapter *ets,
- ETreeModel *source,
- ETableSortInfo *sort_info,
- ETableHeader *header);
-
-gboolean e_tree_table_adapter_node_is_expanded (ETreeTableAdapter *etta,
- ETreePath path);
-void e_tree_table_adapter_node_set_expanded (ETreeTableAdapter *etta,
- ETreePath path,
- gboolean expanded);
-void e_tree_table_adapter_node_set_expanded_recurse (ETreeTableAdapter *etta,
- ETreePath path,
- gboolean expanded);
-void e_tree_table_adapter_root_node_set_visible (ETreeTableAdapter *etta,
- gboolean visible);
-ETreePath e_tree_table_adapter_node_at_row (ETreeTableAdapter *etta,
- int row);
-int e_tree_table_adapter_row_of_node (ETreeTableAdapter *etta,
- ETreePath path);
-gboolean e_tree_table_adapter_root_node_is_visible (ETreeTableAdapter *etta);
-
-void e_tree_table_adapter_show_node (ETreeTableAdapter *etta,
- ETreePath path);
-
-void e_tree_table_adapter_save_expanded_state (ETreeTableAdapter *etta,
- const char *filename);
-void e_tree_table_adapter_load_expanded_state (ETreeTableAdapter *etta,
- const char *filename);
-
-void e_tree_table_adapter_set_sort_info (ETreeTableAdapter *etta,
- ETableSortInfo *sort_info);
-
-G_END_DECLS
-
-#endif /* _E_TREE_TABLE_ADAPTER_H_ */
diff --git a/widgets/table/e-tree.c b/widgets/table/e-tree.c
deleted file mode 100644
index b3e73523d5..0000000000
--- a/widgets/table/e-tree.c
+++ /dev/null
@@ -1,3294 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-tree.c
- * Copyright 2000, 2001, Ximian, Inc.
- *
- * Authors:
- * Chris Lahey <clahey@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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 <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <stdio.h>
-#include <gdk/gdkkeysyms.h>
-#include <gtk/gtksignal.h>
-#include <libgnomecanvas/gnome-canvas-rect-ellipse.h>
-
-#include <gal/util/e-i18n.h>
-#include <gal/util/e-util.h>
-#include <gal/util/e-marshal.h>
-#include <gal/widgets/e-canvas.h>
-#include <gal/widgets/e-canvas-background.h>
-
-#include <gal/e-table/e-table-column-specification.h>
-#include <gal/e-table/e-table-header-item.h>
-#include <gal/e-table/e-table-header.h>
-#include <gal/e-table/e-table-item.h>
-#include <gal/e-table/e-table-sort-info.h>
-#include <gal/e-table/e-table-utils.h>
-
-#ifdef E_TREE_USE_TREE_SELECTION
-#include <gal/e-table/e-tree-selection-model.h>
-#else
-#include <gal/e-table/e-table-selection-model.h>
-#endif
-
-#include <gal/e-table/e-tree-table-adapter.h>
-
-#include "e-tree.h"
-#include "gal/util/e-marshal.h"
-
-#define COLUMN_HEADER_HEIGHT 16
-
-#define PARENT_TYPE gtk_table_get_type ()
-
-static GtkObjectClass *parent_class;
-
-#define d(x)
-
-#if d(!)0
-#define e_table_item_leave_edit_(x) (e_table_item_leave_edit((x)), g_print ("%s: e_table_item_leave_edit\n", __FUNCTION__))
-#else
-#define e_table_item_leave_edit_(x) (e_table_item_leave_edit((x)))
-#endif
-
-enum {
- CURSOR_CHANGE,
- CURSOR_ACTIVATED,
- SELECTION_CHANGE,
- DOUBLE_CLICK,
- RIGHT_CLICK,
- CLICK,
- KEY_PRESS,
- START_DRAG,
- STATE_CHANGE,
- WHITE_SPACE_EVENT,
-
- TREE_DRAG_BEGIN,
- TREE_DRAG_END,
- TREE_DRAG_DATA_GET,
- TREE_DRAG_DATA_DELETE,
-
- TREE_DRAG_LEAVE,
- TREE_DRAG_MOTION,
- TREE_DRAG_DROP,
- TREE_DRAG_DATA_RECEIVED,
-
- LAST_SIGNAL
-};
-
-enum {
- PROP_0,
- PROP_LENGTH_THRESHOLD,
- PROP_HORIZONTAL_DRAW_GRID,
- PROP_VERTICAL_DRAW_GRID,
- PROP_DRAW_FOCUS,
- PROP_ETTA,
- PROP_UNIFORM_ROW_HEIGHT,
- PROP_ALWAYS_SEARCH
-};
-
-enum {
- ET_SCROLL_UP = 1 << 0,
- ET_SCROLL_DOWN = 1 << 1,
- ET_SCROLL_LEFT = 1 << 2,
- ET_SCROLL_RIGHT = 1 << 3
-};
-
-struct ETreePriv {
- ETreeModel *model;
- ETreeTableAdapter *etta;
-
- ETableHeader *full_header, *header;
-
- guint structure_change_id, expansion_change_id;
-
- ETableSortInfo *sort_info;
- ESorter *sorter;
-
- guint sort_info_change_id, group_info_change_id;
-
- ESelectionModel *selection;
- ETableSpecification *spec;
-
- ETableSearch *search;
-
- ETableCol *current_search_col;
-
- guint search_search_id;
- guint search_accept_id;
-
- int reflow_idle_id;
- int scroll_idle_id;
- int hover_idle_id;
-
- int table_model_change_id;
- int table_row_change_id;
- int table_cell_change_id;
- int table_rows_inserted_id;
- int table_rows_deleted_id;
-
- GnomeCanvas *header_canvas, *table_canvas;
-
- GnomeCanvasItem *header_item, *root;
-
- GnomeCanvasItem *white_item;
- GnomeCanvasItem *item;
-
- gint length_threshold;
-
- /*
- * Configuration settings
- */
- guint alternating_row_colors : 1;
- guint horizontal_draw_grid : 1;
- guint vertical_draw_grid : 1;
- guint draw_focus : 1;
- guint row_selection_active : 1;
-
- guint horizontal_scrolling : 1;
-
- guint scroll_direction : 4;
-
- guint do_drag : 1;
-
- guint uniform_row_height : 1;
-
- guint search_col_set : 1;
- guint always_search : 1;
-
- ECursorMode cursor_mode;
-
- int drop_row;
- ETreePath drop_path;
- int drop_col;
-
- GnomeCanvasItem *drop_highlight;
- int last_drop_x;
- int last_drop_y;
- int last_drop_time;
- GdkDragContext *last_drop_context;
-
- int hover_x;
- int hover_y;
-
- int drag_row;
- ETreePath drag_path;
- int drag_col;
- ETreeDragSourceSite *site;
-
- GList *expanded_list;
-};
-
-static guint et_signals [LAST_SIGNAL] = { 0, };
-
-static void et_grab_focus (GtkWidget *widget);
-
-static void et_drag_begin (GtkWidget *widget,
- GdkDragContext *context,
- ETree *et);
-static void et_drag_end (GtkWidget *widget,
- GdkDragContext *context,
- ETree *et);
-static void et_drag_data_get(GtkWidget *widget,
- GdkDragContext *context,
- GtkSelectionData *selection_data,
- guint info,
- guint time,
- ETree *et);
-static void et_drag_data_delete(GtkWidget *widget,
- GdkDragContext *context,
- ETree *et);
-
-static void et_drag_leave(GtkWidget *widget,
- GdkDragContext *context,
- guint time,
- ETree *et);
-static gboolean et_drag_motion(GtkWidget *widget,
- GdkDragContext *context,
- gint x,
- gint y,
- guint time,
- ETree *et);
-static gboolean et_drag_drop(GtkWidget *widget,
- GdkDragContext *context,
- gint x,
- gint y,
- guint time,
- ETree *et);
-static void et_drag_data_received(GtkWidget *widget,
- GdkDragContext *context,
- gint x,
- gint y,
- GtkSelectionData *selection_data,
- guint info,
- guint time,
- ETree *et);
-
-
-static void scroll_off (ETree *et);
-static void scroll_on (ETree *et, guint scroll_direction);
-static void hover_off (ETree *et);
-static void hover_on (ETree *et, int x, int y);
-
-static void
-et_disconnect_from_etta (ETree *et)
-{
- if (et->priv->table_model_change_id != 0)
- g_signal_handler_disconnect (G_OBJECT (et->priv->etta),
- et->priv->table_model_change_id);
- if (et->priv->table_row_change_id != 0)
- g_signal_handler_disconnect (G_OBJECT (et->priv->etta),
- et->priv->table_row_change_id);
- if (et->priv->table_cell_change_id != 0)
- g_signal_handler_disconnect (G_OBJECT (et->priv->etta),
- et->priv->table_cell_change_id);
- if (et->priv->table_rows_inserted_id != 0)
- g_signal_handler_disconnect (G_OBJECT (et->priv->etta),
- et->priv->table_rows_inserted_id);
- if (et->priv->table_rows_deleted_id != 0)
- g_signal_handler_disconnect (G_OBJECT (et->priv->etta),
- et->priv->table_rows_deleted_id);
-
- et->priv->table_model_change_id = 0;
- et->priv->table_row_change_id = 0;
- et->priv->table_cell_change_id = 0;
- et->priv->table_rows_inserted_id = 0;
- et->priv->table_rows_deleted_id = 0;
-}
-
-static void
-clear_current_search_col (ETree *et)
-{
- et->priv->search_col_set = FALSE;
-}
-
-static ETableCol *
-current_search_col (ETree *et)
-{
- if (!et->priv->search_col_set) {
- et->priv->current_search_col =
- e_table_util_calculate_current_search_col (et->priv->header,
- et->priv->full_header,
- et->priv->sort_info,
- et->priv->always_search);
- et->priv->search_col_set = TRUE;
- }
-
- return et->priv->current_search_col;
-}
-
-static void
-e_tree_state_change (ETree *et)
-{
- g_signal_emit (G_OBJECT (et), et_signals [STATE_CHANGE], 0);
-}
-
-static void
-change_trigger (GtkObject *object, ETree *et)
-{
- e_tree_state_change (et);
-}
-
-static void
-search_col_change_trigger (GtkObject *object, ETree *et)
-{
- clear_current_search_col (et);
- e_tree_state_change (et);
-}
-
-static void
-disconnect_header (ETree *e_tree)
-{
- if (e_tree->priv->header == NULL)
- return;
-
- if (e_tree->priv->structure_change_id)
- g_signal_handler_disconnect (G_OBJECT (e_tree->priv->header),
- e_tree->priv->structure_change_id);
- if (e_tree->priv->expansion_change_id)
- g_signal_handler_disconnect (G_OBJECT (e_tree->priv->header),
- e_tree->priv->expansion_change_id);
- if (e_tree->priv->sort_info) {
- if (e_tree->priv->sort_info_change_id)
- g_signal_handler_disconnect (G_OBJECT (e_tree->priv->sort_info),
- e_tree->priv->sort_info_change_id);
- if (e_tree->priv->group_info_change_id)
- g_signal_handler_disconnect (G_OBJECT (e_tree->priv->sort_info),
- e_tree->priv->group_info_change_id);
-
- g_object_unref(e_tree->priv->sort_info);
- }
- g_object_unref(e_tree->priv->header);
- e_tree->priv->header = NULL;
- e_tree->priv->sort_info = NULL;
-}
-
-static void
-connect_header (ETree *e_tree, ETableState *state)
-{
- GValue *val = g_new0 (GValue, 1);
-
- if (e_tree->priv->header != NULL)
- disconnect_header (e_tree);
-
- e_tree->priv->header = e_table_state_to_header (GTK_WIDGET(e_tree), e_tree->priv->full_header, state);
-
- e_tree->priv->structure_change_id =
- g_signal_connect (G_OBJECT (e_tree->priv->header), "structure_change",
- G_CALLBACK (search_col_change_trigger), e_tree);
- e_tree->priv->expansion_change_id =
- g_signal_connect (G_OBJECT (e_tree->priv->header), "expansion_change",
- G_CALLBACK (change_trigger), e_tree);
-
- if (state->sort_info) {
- e_tree->priv->sort_info = e_table_sort_info_duplicate(state->sort_info);
- e_table_sort_info_set_can_group (e_tree->priv->sort_info, FALSE);
- e_tree->priv->sort_info_change_id =
- g_signal_connect (G_OBJECT (e_tree->priv->sort_info), "sort_info_changed",
- G_CALLBACK (search_col_change_trigger), e_tree);
- e_tree->priv->group_info_change_id =
- g_signal_connect (G_OBJECT (e_tree->priv->sort_info), "group_info_changed",
- G_CALLBACK (search_col_change_trigger), e_tree);
- } else
- e_tree->priv->sort_info = NULL;
-
- g_value_init (val, G_TYPE_OBJECT);
- g_value_set_object (val, e_tree->priv->sort_info);
- g_object_set_property (G_OBJECT(e_tree->priv->header), "sort_info", val);
- g_free (val);
-}
-
-static void
-et_dispose (GObject *object)
-{
- ETree *et = E_TREE (object);
-
- if (et->priv) {
-
- if (et->priv->search) {
- if (et->priv->search_search_id)
- g_signal_handler_disconnect (et->priv->search,
- et->priv->search_search_id);
- if (et->priv->search_accept_id)
- g_signal_handler_disconnect (et->priv->search,
- et->priv->search_accept_id);
- g_object_unref (et->priv->search);
- }
-
- if (et->priv->reflow_idle_id)
- g_source_remove(et->priv->reflow_idle_id);
- et->priv->reflow_idle_id = 0;
-
- scroll_off (et);
- hover_off (et);
- e_free_string_list (et->priv->expanded_list);
-
- et_disconnect_from_etta (et);
-
- g_object_unref (et->priv->etta);
- g_object_unref (et->priv->model);
- g_object_unref (et->priv->full_header);
- disconnect_header (et);
- g_object_unref (et->priv->selection);
- if (et->priv->spec)
- g_object_unref (et->priv->spec);
- et->priv->spec = NULL;
-
- if (et->priv->sorter)
- g_object_unref (et->priv->sorter);
- et->priv->sorter = NULL;
-
- if (et->priv->header_canvas)
- gtk_widget_destroy (GTK_WIDGET (et->priv->header_canvas));
- et->priv->header_canvas = NULL;
-
- if (et->priv->site)
- e_tree_drag_source_unset (et);
-
- gtk_widget_destroy (GTK_WIDGET (et->priv->table_canvas));
-
- g_free(et->priv);
- et->priv = NULL;
- }
-
- if (G_OBJECT_CLASS (parent_class)->dispose)
- G_OBJECT_CLASS (parent_class)->dispose (object);
-}
-
-static void
-et_unrealize (GtkWidget *widget)
-{
- scroll_off (E_TREE (widget));
- hover_off (E_TREE (widget));
-
- if (GTK_WIDGET_CLASS (parent_class)->unrealize)
- GTK_WIDGET_CLASS (parent_class)->unrealize (widget);
-}
-
-typedef struct {
- ETree *et;
- char *string;
-} SearchSearchStruct;
-
-static gboolean
-search_search_callback (ETreeModel *model, ETreePath path, gpointer data)
-{
- SearchSearchStruct *cb_data = data;
- const void *value;
- ETableCol *col = current_search_col (cb_data->et);
-
- value = e_tree_model_value_at (model, path, cb_data->et->priv->current_search_col->col_idx);
-
- return col->search (value, cb_data->string);
-}
-
-static gboolean
-et_search_search (ETableSearch *search, char *string, ETableSearchFlags flags, ETree *et)
-{
- ETreePath cursor;
- ETreePath found;
- SearchSearchStruct cb_data;
- ETableCol *col = current_search_col (et);
-
- if (col == NULL)
- return FALSE;
-
- cb_data.et = et;
- cb_data.string = string;
-
- cursor = e_tree_get_cursor (et);
-
- if (flags & E_TABLE_SEARCH_FLAGS_CHECK_CURSOR_FIRST) {
- const void *value;
-
- value = e_tree_model_value_at (et->priv->model, cursor, col->col_idx);
-
- if (col->search (value, string)) {
- return TRUE;
- }
- }
-
- found = e_tree_model_node_find (et->priv->model, cursor, NULL, E_TREE_FIND_NEXT_FORWARD, search_search_callback, &cb_data);
- if (found == NULL)
- found = e_tree_model_node_find (et->priv->model, NULL, cursor, E_TREE_FIND_NEXT_FORWARD, search_search_callback, &cb_data);
-
- if (found && found != cursor) {
- int model_row;
-
- e_tree_table_adapter_show_node (et->priv->etta, found);
- model_row = e_tree_table_adapter_row_of_node (et->priv->etta, found);
-
- cursor = found;
-
- e_selection_model_select_as_key_press(E_SELECTION_MODEL (et->priv->selection), model_row, col->col_idx, GDK_CONTROL_MASK);
- return TRUE;
- } else if (!(flags & E_TABLE_SEARCH_FLAGS_CHECK_CURSOR_FIRST)) {
- const void *value;
-
- value = e_tree_model_value_at (et->priv->model, cursor, col->col_idx);
-
- return col->search (value, string);
- } else
- return FALSE;
-}
-
-static void
-et_search_accept (ETableSearch *search, ETree *et)
-{
- ETableCol *col = current_search_col (et);
- int cursor;
-
- if (col == NULL)
- return;
-
- g_object_get(et->priv->selection,
- "cursor_row", &cursor,
- NULL);
- e_selection_model_select_as_key_press(E_SELECTION_MODEL (et->priv->selection), cursor, col->col_idx, 0);
-}
-
-static void
-e_tree_init (GtkObject *object)
-{
- ETree *e_tree = E_TREE (object);
- GtkTable *gtk_table = GTK_TABLE (object);
-
- GTK_WIDGET_SET_FLAGS (e_tree, GTK_CAN_FOCUS);
-
- gtk_table->homogeneous = FALSE;
-
- e_tree->priv = g_new(ETreePriv, 1);
-
- e_tree->priv->model = NULL;
- e_tree->priv->etta = NULL;
-
- e_tree->priv->full_header = NULL;
- e_tree->priv->header = NULL;
-
- e_tree->priv->structure_change_id = 0;
- e_tree->priv->expansion_change_id = 0;
- e_tree->priv->sort_info_change_id = 0;
- e_tree->priv->group_info_change_id = 0;
-
- e_tree->priv->sort_info = NULL;
- e_tree->priv->sorter = NULL;
- e_tree->priv->reflow_idle_id = 0;
- e_tree->priv->scroll_idle_id = 0;
- e_tree->priv->hover_idle_id = 0;
-
- e_tree->priv->alternating_row_colors = 1;
- e_tree->priv->horizontal_draw_grid = 1;
- e_tree->priv->vertical_draw_grid = 1;
- e_tree->priv->draw_focus = 1;
- e_tree->priv->cursor_mode = E_CURSOR_SIMPLE;
- e_tree->priv->length_threshold = 200;
- e_tree->priv->uniform_row_height = FALSE;
-
- e_tree->priv->row_selection_active = FALSE;
- e_tree->priv->horizontal_scrolling = FALSE;
-
- e_tree->priv->drop_row = -1;
- e_tree->priv->drop_path = NULL;
- e_tree->priv->drop_col = -1;
- e_tree->priv->drop_highlight = NULL;
-
- e_tree->priv->last_drop_x = 0;
- e_tree->priv->last_drop_y = 0;
- e_tree->priv->last_drop_time = 0;
- e_tree->priv->last_drop_context = NULL;
-
- e_tree->priv->hover_x = 0;
- e_tree->priv->hover_y = 0;
-
- e_tree->priv->drag_row = -1;
- e_tree->priv->drag_path = NULL;
- e_tree->priv->drag_col = -1;
-
- e_tree->priv->expanded_list = NULL;
-
- e_tree->priv->site = NULL;
- e_tree->priv->do_drag = FALSE;
-
-#ifdef E_TREE_USE_TREE_SELECTION
- e_tree->priv->selection = E_SELECTION_MODEL(e_tree_selection_model_new());
-#else
- e_tree->priv->selection = E_SELECTION_MODEL(e_table_selection_model_new());
-#endif
- e_tree->priv->spec = NULL;
-
- e_tree->priv->header_canvas = NULL;
- e_tree->priv->table_canvas = NULL;
-
- e_tree->priv->header_item = NULL;
- e_tree->priv->root = NULL;
-
- e_tree->priv->white_item = NULL;
- e_tree->priv->item = NULL;
-
- e_tree->priv->search = e_table_search_new();
-
- e_tree->priv->search_search_id =
- g_signal_connect (G_OBJECT (e_tree->priv->search), "search",
- G_CALLBACK (et_search_search), e_tree);
- e_tree->priv->search_accept_id =
- g_signal_connect (G_OBJECT (e_tree->priv->search), "accept",
- G_CALLBACK (et_search_accept), e_tree);
-
- e_tree->priv->current_search_col = NULL;
- e_tree->priv->search_col_set = FALSE;
- e_tree->priv->always_search = g_getenv ("GAL_ALWAYS_SEARCH") ? TRUE : FALSE;
-}
-
-/* Grab_focus handler for the ETree */
-static void
-et_grab_focus (GtkWidget *widget)
-{
- ETree *e_tree;
-
- e_tree = E_TREE (widget);
-
- gtk_widget_grab_focus (GTK_WIDGET (e_tree->priv->table_canvas));
-}
-
-/* Focus handler for the ETree */
-static gint
-et_focus (GtkWidget *container, GtkDirectionType direction)
-{
- ETree *e_tree;
-
- e_tree = E_TREE (container);
-
- if (GTK_CONTAINER (container)->focus_child) {
- gtk_container_set_focus_child (GTK_CONTAINER (container), NULL);
- return FALSE;
- }
-
- return gtk_widget_child_focus (GTK_WIDGET (e_tree->priv->table_canvas), direction);
-}
-
-static void
-set_header_canvas_width (ETree *e_tree)
-{
- double oldwidth, oldheight, width;
-
- if (!(e_tree->priv->header_item && e_tree->priv->header_canvas && e_tree->priv->table_canvas))
- return;
-
- gnome_canvas_get_scroll_region (GNOME_CANVAS (e_tree->priv->table_canvas),
- NULL, NULL, &width, NULL);
- gnome_canvas_get_scroll_region (GNOME_CANVAS (e_tree->priv->header_canvas),
- NULL, NULL, &oldwidth, &oldheight);
-
- if (oldwidth != width ||
- oldheight != E_TABLE_HEADER_ITEM (e_tree->priv->header_item)->height - 1)
- gnome_canvas_set_scroll_region (
- GNOME_CANVAS (e_tree->priv->header_canvas),
- 0, 0, width, /* COLUMN_HEADER_HEIGHT - 1 */
- E_TABLE_HEADER_ITEM (e_tree->priv->header_item)->height - 1);
-
-}
-
-static void
-header_canvas_size_allocate (GtkWidget *widget, GtkAllocation *alloc, ETree *e_tree)
-{
- set_header_canvas_width (e_tree);
-
- /* When the header item is created ->height == 0,
- as the font is only created when everything is realized.
- So we set the usize here as well, so that the size of the
- header is correct */
- if (GTK_WIDGET (e_tree->priv->header_canvas)->allocation.height !=
- E_TABLE_HEADER_ITEM (e_tree->priv->header_item)->height)
- gtk_widget_set_usize (GTK_WIDGET (e_tree->priv->header_canvas), -1,
- E_TABLE_HEADER_ITEM (e_tree->priv->header_item)->height);
-}
-
-static void
-e_tree_setup_header (ETree *e_tree)
-{
- char *pointer;
- e_tree->priv->header_canvas = GNOME_CANVAS (e_canvas_new ());
- GTK_WIDGET_UNSET_FLAGS (e_tree->priv->header_canvas, GTK_CAN_FOCUS);
-
- gtk_widget_show (GTK_WIDGET (e_tree->priv->header_canvas));
-
- pointer = g_strdup_printf("%p", e_tree);
-
- e_tree->priv->header_item = gnome_canvas_item_new (
- gnome_canvas_root (e_tree->priv->header_canvas),
- e_table_header_item_get_type (),
- "ETableHeader", e_tree->priv->header,
- "full_header", e_tree->priv->full_header,
- "sort_info", e_tree->priv->sort_info,
- "dnd_code", pointer,
- "tree", e_tree,
- NULL);
-
- g_free(pointer);
-
- g_signal_connect (
- e_tree->priv->header_canvas, "size_allocate",
- G_CALLBACK (header_canvas_size_allocate), e_tree);
-
- gtk_widget_set_usize (GTK_WIDGET (e_tree->priv->header_canvas), -1,
- E_TABLE_HEADER_ITEM (e_tree->priv->header_item)->height);
-}
-
-static gboolean
-tree_canvas_reflow_idle (ETree *e_tree)
-{
- gdouble height, width;
- gdouble item_height;
- gdouble oldheight, oldwidth;
- GtkAllocation *alloc = &(GTK_WIDGET (e_tree->priv->table_canvas)->allocation);
-
- g_object_get (e_tree->priv->item,
- "height", &height,
- "width", &width,
- NULL);
- item_height = height;
- height = MAX ((int)height, alloc->height);
- width = MAX((int)width, alloc->width);
- /* I have no idea why this needs to be -1, but it works. */
- gnome_canvas_get_scroll_region (GNOME_CANVAS (e_tree->priv->table_canvas),
- NULL, NULL, &oldwidth, &oldheight);
-
- if (oldwidth != width - 1 ||
- oldheight != height - 1) {
- gnome_canvas_set_scroll_region (GNOME_CANVAS (e_tree->priv->table_canvas),
- 0, 0, width - 1, height - 1);
- set_header_canvas_width (e_tree);
- }
- e_tree->priv->reflow_idle_id = 0;
- return FALSE;
-}
-
-static void
-tree_canvas_size_allocate (GtkWidget *widget, GtkAllocation *alloc,
- ETree *e_tree)
-{
- gdouble width;
- gdouble height;
- gdouble item_height;
- GValue *val = g_new0 (GValue, 1);
- g_value_init (val, G_TYPE_DOUBLE);
-
- width = alloc->width;
- g_value_set_double (val, width);
- g_object_get (e_tree->priv->item,
- "height", &height,
- NULL);
- item_height = height;
- height = MAX ((int)height, alloc->height);
-
- g_object_set (e_tree->priv->item,
- "width", width,
- NULL);
- g_object_set_property (G_OBJECT (e_tree->priv->header), "width", val);
- g_free (val);
- if (e_tree->priv->reflow_idle_id)
- g_source_remove(e_tree->priv->reflow_idle_id);
- tree_canvas_reflow_idle(e_tree);
-}
-
-static void
-tree_canvas_reflow (GnomeCanvas *canvas, ETree *e_tree)
-{
- if (!e_tree->priv->reflow_idle_id)
- e_tree->priv->reflow_idle_id = g_idle_add_full (400, (GSourceFunc) tree_canvas_reflow_idle, e_tree, NULL);
-}
-
-static void
-item_cursor_change (ETableItem *eti, int row, ETree *et)
-{
- ETreePath path = e_tree_table_adapter_node_at_row(et->priv->etta, row);
- g_signal_emit (et,
- et_signals [CURSOR_CHANGE], 0,
- row, path);
-}
-
-static void
-item_cursor_activated (ETableItem *eti, int row, ETree *et)
-{
- ETreePath path = e_tree_table_adapter_node_at_row(et->priv->etta, row);
- g_signal_emit (et,
- et_signals [CURSOR_ACTIVATED], 0,
- row, path);
- d(g_print("%s: Emitted CURSOR_ACTIVATED signal on row: %d and path: 0x%p\n", __FUNCTION__, row, path));
-}
-
-static void
-item_double_click (ETableItem *eti, int row, int col, GdkEvent *event, ETree *et)
-{
- ETreePath path = e_tree_table_adapter_node_at_row(et->priv->etta, row);
- g_signal_emit (et,
- et_signals [DOUBLE_CLICK], 0,
- row, path, col, event);
-}
-
-static gint
-item_right_click (ETableItem *eti, int row, int col, GdkEvent *event, ETree *et)
-{
- int return_val = 0;
- ETreePath path = e_tree_table_adapter_node_at_row(et->priv->etta, row);
- g_signal_emit (et,
- et_signals [RIGHT_CLICK], 0,
- row, path, col, event, &return_val);
- return return_val;
-}
-
-static gint
-item_click (ETableItem *eti, int row, int col, GdkEvent *event, ETree *et)
-{
- int return_val = 0;
- ETreePath path = e_tree_table_adapter_node_at_row(et->priv->etta, row);
- g_signal_emit (et,
- et_signals [CLICK], 0,
- row, path, col, event, &return_val);
- return return_val;
-}
-
-static gint
-item_key_press (ETableItem *eti, int row, int col, GdkEvent *event, ETree *et)
-{
- int return_val = 0;
- GdkEventKey *key = (GdkEventKey *) event;
- ETreePath path;
- int y, row_local, col_local;
- GtkAdjustment *vadj;
-
- switch (key->keyval) {
- case GDK_Page_Down:
- case GDK_KP_Page_Down:
- vadj = gtk_layout_get_vadjustment (GTK_LAYOUT (et->priv->table_canvas));
- y = CLAMP(vadj->value + (2 * vadj->page_size - 50), 0, vadj->upper);
- y -= vadj->value;
- e_tree_get_cell_at (et, 30, y, &row_local, &col_local);
-
- if (row_local == -1)
- row_local = e_table_model_row_count (E_TABLE_MODEL(et->priv->etta)) - 1;
-
- row_local = e_tree_view_to_model_row (et, row_local);
- col_local = e_selection_model_cursor_col (E_SELECTION_MODEL (et->priv->selection));
- e_selection_model_select_as_key_press (E_SELECTION_MODEL (et->priv->selection), row_local, col_local, key->state);
-
- return_val = 1;
- break;
- case GDK_Page_Up:
- case GDK_KP_Page_Up:
- vadj = gtk_layout_get_vadjustment (GTK_LAYOUT (et->priv->table_canvas));
- y = CLAMP(vadj->value - (vadj->page_size - 50), 0, vadj->upper);
- y -= vadj->value;
- e_tree_get_cell_at (et, 30, y, &row_local, &col_local);
-
- if (row_local == -1)
- row_local = e_table_model_row_count (E_TABLE_MODEL(et->priv->etta)) - 1;
-
- row_local = e_tree_view_to_model_row (et, row_local);
- col_local = e_selection_model_cursor_col (E_SELECTION_MODEL (et->priv->selection));
- e_selection_model_select_as_key_press (E_SELECTION_MODEL (et->priv->selection), row_local, col_local, key->state);
-
- return_val = 1;
- break;
- case '=':
- case GDK_Right:
- case GDK_KP_Right:
- /* Only allow if the Shift modifier is used -- eg. Ctrl-Equal shouldn't be handled. */
- if (key->state & ~(GDK_SHIFT_MASK | GDK_LOCK_MASK))
- break;
- if (row != -1) {
- path = e_tree_table_adapter_node_at_row(et->priv->etta, row);
- if (path)
- e_tree_table_adapter_node_set_expanded (et->priv->etta, path, TRUE);
- }
- return_val = 1;
- break;
- case '-':
- case GDK_Left:
- case GDK_KP_Left:
- /* Only allow if the Shift modifier is used -- eg. Ctrl-Minus shouldn't be handled. */
- if (key->state & ~(GDK_SHIFT_MASK | GDK_LOCK_MASK))
- break;
- if (row != -1) {
- path = e_tree_table_adapter_node_at_row(et->priv->etta, row);
- if (path)
- e_tree_table_adapter_node_set_expanded (et->priv->etta, path, FALSE);
- }
- return_val = 1;
- break;
- case GDK_BackSpace:
- if (e_table_search_backspace (et->priv->search))
- return TRUE;
- /* Fallthrough */
- default:
- if ((key->state & ~(GDK_SHIFT_MASK | GDK_LOCK_MASK)) == 0
- && ((key->keyval >= GDK_a && key->keyval <= GDK_z) ||
- (key->keyval >= GDK_A && key->keyval <= GDK_Z) ||
- (key->keyval >= GDK_0 && key->keyval <= GDK_9))) {
- e_table_search_input_character (et->priv->search, key->keyval);
- }
- path = e_tree_table_adapter_node_at_row(et->priv->etta, row);
- g_signal_emit (et,
- et_signals [KEY_PRESS], 0,
- row, path, col, event, &return_val);
- break;
- }
- return return_val;
-}
-
-static gint
-item_start_drag (ETableItem *eti, int row, int col, GdkEvent *event, ETree *et)
-{
- ETreePath path;
- gint return_val = 0;
-
- path = e_tree_table_adapter_node_at_row(et->priv->etta, row);
-
- g_signal_emit (et,
- et_signals [START_DRAG], 0,
- row, path, col, event, &return_val);
-
- return return_val;
-}
-
-static void
-et_selection_model_selection_changed (ETableSelectionModel *etsm, ETree *et)
-{
- g_signal_emit (et,
- et_signals [SELECTION_CHANGE], 0);
-}
-
-static void
-et_selection_model_selection_row_changed (ETableSelectionModel *etsm, int row, ETree *et)
-{
- g_signal_emit (et,
- et_signals [SELECTION_CHANGE], 0);
-}
-
-static void
-et_build_item (ETree *et)
-{
- et->priv->item = gnome_canvas_item_new(GNOME_CANVAS_GROUP (gnome_canvas_root(et->priv->table_canvas)),
- e_table_item_get_type(),
- "ETableHeader", et->priv->header,
- "ETableModel", et->priv->etta,
- "selection_model", et->priv->selection,
- "alternating_row_colors", et->priv->alternating_row_colors,
- "horizontal_draw_grid", et->priv->horizontal_draw_grid,
- "vertical_draw_grid", et->priv->vertical_draw_grid,
- "drawfocus", et->priv->draw_focus,
- "cursor_mode", et->priv->cursor_mode,
- "length_threshold", et->priv->length_threshold,
- "uniform_row_height", et->priv->uniform_row_height,
- NULL);
-
- g_signal_connect (et->priv->item, "cursor_change",
- G_CALLBACK (item_cursor_change), et);
- g_signal_connect (et->priv->item, "cursor_activated",
- G_CALLBACK (item_cursor_activated), et);
- g_signal_connect (et->priv->item, "double_click",
- G_CALLBACK (item_double_click), et);
- g_signal_connect (et->priv->item, "right_click",
- G_CALLBACK (item_right_click), et);
- g_signal_connect (et->priv->item, "click",
- G_CALLBACK (item_click), et);
- g_signal_connect (et->priv->item, "key_press",
- G_CALLBACK (item_key_press), et);
- g_signal_connect (et->priv->item, "start_drag",
- G_CALLBACK (item_start_drag), et);
-}
-
-static void
-et_canvas_style_set (GtkWidget *widget, GtkStyle *prev_style)
-{
- gnome_canvas_item_set(
- E_TREE(widget)->priv->white_item,
- "fill_color_gdk", &widget->style->base[GTK_STATE_NORMAL],
- NULL);
-}
-
-static gint
-white_item_event (GnomeCanvasItem *white_item, GdkEvent *event, ETree *e_tree)
-{
- int return_val = 0;
- g_signal_emit (e_tree,
- et_signals [WHITE_SPACE_EVENT], 0,
- event, &return_val);
- return return_val;
-}
-
-static gint
-et_canvas_root_event (GnomeCanvasItem *root, GdkEvent *event, ETree *e_tree)
-{
- switch (event->type) {
- case GDK_BUTTON_PRESS:
- case GDK_2BUTTON_PRESS:
- case GDK_BUTTON_RELEASE:
- if (event->button.button != 4 && event->button.button != 5) {
- if (GTK_WIDGET_HAS_FOCUS(root->canvas)) {
- GnomeCanvasItem *item = GNOME_CANVAS(root->canvas)->focused_item;
-
- if (E_IS_TABLE_ITEM(item)) {
- e_table_item_leave_edit_(E_TABLE_ITEM(item));
- return TRUE;
- }
- }
- }
- break;
- default:
- break;
- }
-
- return FALSE;
-}
-
-/* Handler for focus events in the table_canvas; we have to repaint ourselves
- * and give the focus to some ETableItem.
- */
-static gint
-table_canvas_focus_event_cb (GtkWidget *widget, GdkEventFocus *event, gpointer data)
-{
- GnomeCanvas *canvas;
- ETree *tree;
-
- gtk_widget_queue_draw (widget);
-
- if (!event->in)
- return TRUE;
-
- canvas = GNOME_CANVAS (widget);
- tree = E_TREE (data);
-
- if (!canvas->focused_item) {
- e_table_item_set_cursor (E_TABLE_ITEM (tree->priv->item), 0, 0);
- gnome_canvas_item_grab_focus (tree->priv->item);
- }
-
- return TRUE;
-}
-
-static void
-e_tree_setup_table (ETree *e_tree)
-{
- e_tree->priv->table_canvas = GNOME_CANVAS (e_canvas_new ());
- g_signal_connect (
- e_tree->priv->table_canvas, "size_allocate",
- G_CALLBACK (tree_canvas_size_allocate), e_tree);
- g_signal_connect (
- e_tree->priv->table_canvas, "focus_in_event",
- G_CALLBACK (table_canvas_focus_event_cb), e_tree);
- g_signal_connect (
- e_tree->priv->table_canvas, "focus_out_event",
- G_CALLBACK (table_canvas_focus_event_cb), e_tree);
-
- g_signal_connect (
- e_tree->priv->table_canvas, "drag_begin",
- G_CALLBACK (et_drag_begin), e_tree);
- g_signal_connect (
- e_tree->priv->table_canvas, "drag_end",
- G_CALLBACK (et_drag_end), e_tree);
- g_signal_connect (
- e_tree->priv->table_canvas, "drag_data_get",
- G_CALLBACK (et_drag_data_get), e_tree);
- g_signal_connect (
- e_tree->priv->table_canvas, "drag_data_delete",
- G_CALLBACK (et_drag_data_delete), e_tree);
- g_signal_connect (
- e_tree, "drag_motion",
- G_CALLBACK (et_drag_motion), e_tree);
- g_signal_connect (
- e_tree, "drag_leave",
- G_CALLBACK (et_drag_leave), e_tree);
- g_signal_connect (
- e_tree, "drag_drop",
- G_CALLBACK (et_drag_drop), e_tree);
- g_signal_connect (
- e_tree, "drag_data_received",
- G_CALLBACK (et_drag_data_received), e_tree);
-
- g_signal_connect (e_tree->priv->table_canvas, "reflow",
- G_CALLBACK (tree_canvas_reflow), e_tree);
-
- gtk_widget_show (GTK_WIDGET (e_tree->priv->table_canvas));
-
- e_tree->priv->white_item = gnome_canvas_item_new(
- gnome_canvas_root(e_tree->priv->table_canvas),
- e_canvas_background_get_type(),
- "fill_color_gdk", &GTK_WIDGET(e_tree->priv->table_canvas)->style->base[GTK_STATE_NORMAL],
- NULL);
-
- g_signal_connect (e_tree->priv->white_item, "event",
- G_CALLBACK (white_item_event), e_tree);
- g_signal_connect (
- gnome_canvas_root (e_tree->priv->table_canvas), "event",
- G_CALLBACK(et_canvas_root_event), e_tree);
-
- et_build_item(e_tree);
-}
-
-/**
- * e_tree_set_search_column:
- * @e_tree: #ETree object that will be modified
- * @col: Column index to use for searches
- *
- * This routine sets the current search column to be used for keypress
- * searches of the #ETree. If -1 is passed in for column, the current
- * search column is cleared.
- */
-void
-e_tree_set_search_column (ETree *e_tree, gint col)
-{
- if (col == -1) {
- clear_current_search_col (e_tree);
- return;
- }
-
- e_tree->priv->search_col_set = TRUE;
- e_tree->priv->current_search_col = e_table_header_get_column (e_tree->priv->full_header, col);
-}
-
-void
-e_tree_set_state_object(ETree *e_tree, ETableState *state)
-{
- GValue *val = g_new0 (GValue, 1);
- g_value_init (val, G_TYPE_DOUBLE);
-
- connect_header (e_tree, state);
-
- g_value_set_double (val, (double) (GTK_WIDGET(e_tree->priv->table_canvas)->allocation.width));
- g_object_set_property (G_OBJECT (e_tree->priv->header), "width", val);
- g_free (val);
-
- if (e_tree->priv->header_item)
- g_object_set(e_tree->priv->header_item,
- "ETableHeader", e_tree->priv->header,
- "sort_info", e_tree->priv->sort_info,
- NULL);
-
- if (e_tree->priv->item)
- g_object_set(e_tree->priv->item,
- "ETableHeader", e_tree->priv->header,
- NULL);
-
- if (e_tree->priv->etta)
- e_tree_table_adapter_set_sort_info (e_tree->priv->etta, e_tree->priv->sort_info);
-
- e_tree_state_change (e_tree);
-}
-
-/**
- * e_tree_set_state:
- * @e_tree: #ETree object that will be modified
- * @state_str: a string with the XML representation of the #ETableState.
- *
- * This routine sets the state (as described by #ETableState) of the
- * #ETree object.
- */
-void
-e_tree_set_state (ETree *e_tree,
- const gchar *state_str)
-{
- ETableState *state;
-
- g_return_if_fail(e_tree != NULL);
- g_return_if_fail(E_IS_TREE(e_tree));
- g_return_if_fail(state_str != NULL);
-
- state = e_table_state_new();
- e_table_state_load_from_string(state, state_str);
-
- if (state->col_count > 0)
- e_tree_set_state_object(e_tree, state);
-
- g_object_unref(state);
-}
-
-/**
- * e_tree_load_state:
- * @e_tree: #ETree object that will be modified
- * @filename: name of the file containing the state to be loaded into the #ETree
- *
- * An #ETableState will be loaded form the file pointed by @filename into the
- * @e_tree object.
- */
-void
-e_tree_load_state (ETree *e_tree,
- const gchar *filename)
-{
- ETableState *state;
-
- g_return_if_fail(e_tree != NULL);
- g_return_if_fail(E_IS_TREE(e_tree));
- g_return_if_fail(filename != NULL);
-
- state = e_table_state_new();
- e_table_state_load_from_file(state, filename);
-
- if (state->col_count > 0)
- e_tree_set_state_object(e_tree, state);
-
- g_object_unref(state);
-}
-
-/**
- * e_tree_get_state_object:
- * @e_tree: #ETree object to act on
- *
- * Builds an #ETableState corresponding to the current state of the
- * #ETree.
- *
- * Return value:
- * The %ETableState object generated.
- **/
-ETableState *
-e_tree_get_state_object (ETree *e_tree)
-{
- ETableState *state;
- int full_col_count;
- int i, j;
-
- state = e_table_state_new();
- state->sort_info = e_tree->priv->sort_info;
- if (state->sort_info)
- g_object_ref(state->sort_info);
-
- state->col_count = e_table_header_count (e_tree->priv->header);
- full_col_count = e_table_header_count (e_tree->priv->full_header);
- state->columns = g_new(int, state->col_count);
- state->expansions = g_new(double, state->col_count);
- for (i = 0; i < state->col_count; i++) {
- ETableCol *col = e_table_header_get_column(e_tree->priv->header, i);
- state->columns[i] = -1;
- for (j = 0; j < full_col_count; j++) {
- if (col->col_idx == e_table_header_index(e_tree->priv->full_header, j)) {
- state->columns[i] = j;
- break;
- }
- }
- state->expansions[i] = col->expansion;
- }
-
- return state;
-}
-
-/**
- * e_tree_get_state:
- * @e_tree: The #ETree to act on
- *
- * Builds a state object based on the current state and returns the
- * string corresponding to that state.
- *
- * Return value:
- * A string describing the current state of the #ETree.
- **/
-gchar *
-e_tree_get_state (ETree *e_tree)
-{
- ETableState *state;
- gchar *string;
-
- state = e_tree_get_state_object(e_tree);
- string = e_table_state_save_to_string(state);
- g_object_unref(state);
- return string;
-}
-
-/**
- * e_tree_save_state:
- * @e_tree: The #ETree to act on
- * @filename: name of the file to save to
- *
- * Saves the state of the @e_tree object into the file pointed by
- * @filename.
- **/
-void
-e_tree_save_state (ETree *e_tree,
- const gchar *filename)
-{
- ETableState *state;
-
- state = e_tree_get_state_object(e_tree);
- e_table_state_save_to_file(state, filename);
- g_object_unref(state);
-}
-
-/**
- * e_tree_get_spec:
- * @e_tree: The #ETree to query
- *
- * Returns the specification object.
- *
- * Return value:
- **/
-ETableSpecification *
-e_tree_get_spec (ETree *e_tree)
-{
- return e_tree->priv->spec;
-}
-
-static void
-et_table_model_changed (ETableModel *model, ETree *et)
-{
- if (et->priv->horizontal_scrolling)
- e_table_header_update_horizontal(et->priv->header);
-}
-
-static void
-et_table_row_changed (ETableModel *table_model, int row, ETree *et)
-{
- et_table_model_changed (table_model, et);
-}
-
-static void
-et_table_cell_changed (ETableModel *table_model, int view_col, int row, ETree *et)
-{
- et_table_model_changed (table_model, et);
-}
-
-static void
-et_table_rows_inserted (ETableModel *table_model, int row, int count, ETree *et)
-{
- et_table_model_changed (table_model, et);
-}
-
-static void
-et_table_rows_deleted (ETableModel *table_model, int row, int count, ETree *et)
-{
- et_table_model_changed (table_model, et);
-}
-
-static void
-et_connect_to_etta (ETree *et)
-{
- et->priv->table_model_change_id = g_signal_connect (et->priv->etta, "model_changed",
- G_CALLBACK (et_table_model_changed), et);
-
- et->priv->table_row_change_id = g_signal_connect (et->priv->etta, "model_row_changed",
- G_CALLBACK (et_table_row_changed), et);
-
- et->priv->table_cell_change_id = g_signal_connect (et->priv->etta, "model_cell_changed",
- G_CALLBACK (et_table_cell_changed), et);
-
- et->priv->table_rows_inserted_id = g_signal_connect (et->priv->etta, "model_rows_inserted",
- G_CALLBACK (et_table_rows_inserted), et);
-
- et->priv->table_rows_deleted_id = g_signal_connect (et->priv->etta, "model_rows_deleted",
- G_CALLBACK (et_table_rows_deleted), et);
-
-}
-
-static ETree *
-et_real_construct (ETree *e_tree, ETreeModel *etm, ETableExtras *ete,
- ETableSpecification *specification, ETableState *state)
-{
- int row = 0;
-
- if (ete)
- g_object_ref(ete);
- else
- ete = e_table_extras_new();
-
- e_tree->priv->alternating_row_colors = specification->alternating_row_colors;
- e_tree->priv->horizontal_draw_grid = specification->horizontal_draw_grid;
- e_tree->priv->vertical_draw_grid = specification->vertical_draw_grid;
- e_tree->priv->draw_focus = specification->draw_focus;
- e_tree->priv->cursor_mode = specification->cursor_mode;
- e_tree->priv->full_header = e_table_spec_to_full_header(specification, ete);
-
- connect_header (e_tree, state);
-
- e_tree->priv->horizontal_scrolling = specification->horizontal_scrolling;
-
- e_tree->priv->model = etm;
- g_object_ref (etm);
-
- e_tree->priv->etta = E_TREE_TABLE_ADAPTER(e_tree_table_adapter_new(e_tree->priv->model, e_tree->priv->sort_info, e_tree->priv->full_header));
-
- et_connect_to_etta (e_tree);
-
- gtk_widget_push_colormap (gdk_rgb_get_cmap ());
-
- e_tree->priv->sorter = e_sorter_new();
-
- g_object_set (e_tree->priv->selection,
- "sorter", e_tree->priv->sorter,
-#ifdef E_TREE_USE_TREE_SELECTION
- "model", e_tree->priv->model,
- "etta", e_tree->priv->etta,
-#else
- "model", e_tree->priv->etta,
-#endif
- "selection_mode", specification->selection_mode,
- "cursor_mode", specification->cursor_mode,
- NULL);
-
- g_signal_connect(e_tree->priv->selection, "selection_changed",
- G_CALLBACK (et_selection_model_selection_changed), e_tree);
- g_signal_connect(e_tree->priv->selection, "selection_row_changed",
- G_CALLBACK (et_selection_model_selection_row_changed), e_tree);
-
- if (!specification->no_headers) {
- e_tree_setup_header (e_tree);
- }
- e_tree_setup_table (e_tree);
-
- gtk_layout_get_vadjustment (GTK_LAYOUT (e_tree->priv->table_canvas))->step_increment = 20;
- gtk_adjustment_changed(gtk_layout_get_vadjustment (GTK_LAYOUT (e_tree->priv->table_canvas)));
- gtk_layout_get_hadjustment (GTK_LAYOUT (e_tree->priv->table_canvas))->step_increment = 20;
- gtk_adjustment_changed(gtk_layout_get_hadjustment (GTK_LAYOUT (e_tree->priv->table_canvas)));
-
- if (!specification->no_headers) {
- /*
- * The header
- */
- gtk_table_attach (GTK_TABLE (e_tree), GTK_WIDGET (e_tree->priv->header_canvas),
- 0, 1, 0 + row, 1 + row,
- GTK_FILL | GTK_EXPAND,
- GTK_FILL, 0, 0);
- row ++;
- }
- gtk_table_attach (GTK_TABLE (e_tree), GTK_WIDGET (e_tree->priv->table_canvas),
- 0, 1, 0 + row, 1 + row,
- GTK_FILL | GTK_EXPAND,
- GTK_FILL | GTK_EXPAND,
- 0, 0);
-
- gtk_widget_pop_colormap ();
-
- g_object_unref(ete);
-
- return e_tree;
-}
-
-/**
- * e_tree_construct:
- * @e_tree: The newly created #ETree object.
- * @etm: The model for this table.
- * @ete: An optional #ETableExtras. (%NULL is valid.)
- * @spec_str: The spec.
- * @state_str: An optional state. (%NULL is valid.)
- *
- * This is the internal implementation of e_tree_new() for use by
- * subclasses or language bindings. See e_tree_new() for details.
- *
- * Return value:
- * The passed in value @e_tree or %NULL if there's an error.
- **/
-ETree *
-e_tree_construct (ETree *e_tree, ETreeModel *etm, ETableExtras *ete,
- const char *spec_str, const char *state_str)
-{
- ETableSpecification *specification;
- ETableState *state;
-
- g_return_val_if_fail(e_tree != NULL, NULL);
- g_return_val_if_fail(E_IS_TREE(e_tree), NULL);
- g_return_val_if_fail(etm != NULL, NULL);
- g_return_val_if_fail(E_IS_TREE_MODEL(etm), NULL);
- g_return_val_if_fail(ete == NULL || E_IS_TABLE_EXTRAS(ete), NULL);
- g_return_val_if_fail(spec_str != NULL, NULL);
-
- specification = e_table_specification_new();
- e_table_specification_load_from_string(specification, spec_str);
- if (state_str) {
- state = e_table_state_new();
- e_table_state_load_from_string(state, state_str);
- if (state->col_count <= 0) {
- g_object_unref(state);
- state = specification->state;
- g_object_ref(state);
- }
- } else {
- state = specification->state;
- g_object_ref(state);
- }
-
- e_tree = et_real_construct (e_tree, etm, ete, specification, state);
-
- e_tree->priv->spec = specification;
- g_object_unref(state);
-
- return e_tree;
-}
-
-/**
- * e_tree_construct_from_spec_file:
- * @e_tree: The newly created #ETree object.
- * @etm: The model for this tree
- * @ete: An optional #ETableExtras (%NULL is valid.)
- * @spec_fn: The filename of the spec
- * @state_fn: An optional state file (%NULL is valid.)
- *
- * This is the internal implementation of e_tree_new_from_spec_file()
- * for use by subclasses or language bindings. See
- * e_tree_new_from_spec_file() for details.
- *
- * Return value:
- * The passed in value @e_tree or %NULL if there's an error.
- **/
-ETree *
-e_tree_construct_from_spec_file (ETree *e_tree, ETreeModel *etm, ETableExtras *ete,
- const char *spec_fn, const char *state_fn)
-{
- ETableSpecification *specification;
- ETableState *state;
-
- g_return_val_if_fail(e_tree != NULL, NULL);
- g_return_val_if_fail(E_IS_TREE(e_tree), NULL);
- g_return_val_if_fail(etm != NULL, NULL);
- g_return_val_if_fail(E_IS_TREE_MODEL(etm), NULL);
- g_return_val_if_fail(ete == NULL || E_IS_TABLE_EXTRAS(ete), NULL);
- g_return_val_if_fail(spec_fn != NULL, NULL);
-
- specification = e_table_specification_new();
- if (!e_table_specification_load_from_file(specification, spec_fn)) {
- g_object_unref(specification);
- return NULL;
- }
-
- if (state_fn) {
- state = e_table_state_new();
- if (!e_table_state_load_from_file(state, state_fn)) {
- g_object_unref(state);
- state = specification->state;
- g_object_ref(state);
- }
- if (state->col_count <= 0) {
- g_object_unref(state);
- state = specification->state;
- g_object_ref(state);
- }
- } else {
- state = specification->state;
- g_object_ref(state);
- }
-
- e_tree = et_real_construct (e_tree, etm, ete, specification, state);
-
- e_tree->priv->spec = specification;
- g_object_unref(state);
-
- return e_tree;
-}
-
-/**
- * e_tree_new:
- * @etm: The model for this tree
- * @ete: An optional #ETableExtras (%NULL is valid.)
- * @spec: The spec
- * @state: An optional state (%NULL is valid.)
- *
- * This function creates an #ETree from the given parameters. The
- * #ETreeModel is a tree model to be represented. The #ETableExtras
- * is an optional set of pixbufs, cells, and sorting functions to be
- * used when interpreting the spec. If you pass in %NULL it uses the
- * default #ETableExtras. (See e_table_extras_new()).
- *
- * @spec is the specification of the set of viewable columns and the
- * default sorting state and such. @state is an optional string
- * specifying the current sorting state and such. If @state is NULL,
- * then the default state from the spec will be used.
- *
- * Return value:
- * The newly created #ETree or %NULL if there's an error.
- **/
-GtkWidget *
-e_tree_new (ETreeModel *etm, ETableExtras *ete, const char *spec, const char *state)
-{
- ETree *e_tree, *ret_val;
-
- g_return_val_if_fail(etm != NULL, NULL);
- g_return_val_if_fail(E_IS_TREE_MODEL(etm), NULL);
- g_return_val_if_fail(ete == NULL || E_IS_TABLE_EXTRAS(ete), NULL);
- g_return_val_if_fail(spec != NULL, NULL);
-
- e_tree = g_object_new (E_TREE_TYPE, NULL);
-
- ret_val = e_tree_construct (e_tree, etm, ete, spec, state);
-
- if (ret_val == NULL) {
- g_object_unref (e_tree);
- }
-
- return (GtkWidget *) ret_val;
-}
-
-/**
- * e_tree_new_from_spec_file:
- * @etm: The model for this tree.
- * @ete: An optional #ETableExtras. (%NULL is valid.)
- * @spec_fn: The filename of the spec.
- * @state_fn: An optional state file. (%NULL is valid.)
- *
- * This is very similar to e_tree_new(), except instead of passing in
- * strings you pass in the file names of the spec and state to load.
- *
- * @spec_fn is the filename of the spec to load. If this file doesn't
- * exist, e_tree_new_from_spec_file will return %NULL.
- *
- * @state_fn is the filename of the initial state to load. If this is
- * %NULL or if the specified file doesn't exist, the default state
- * from the spec file is used.
- *
- * Return value:
- * The newly created #ETree or %NULL if there's an error.
- **/
-GtkWidget *
-e_tree_new_from_spec_file (ETreeModel *etm, ETableExtras *ete, const char *spec_fn, const char *state_fn)
-{
- ETree *e_tree, *ret_val;
-
- g_return_val_if_fail(etm != NULL, NULL);
- g_return_val_if_fail(E_IS_TREE_MODEL(etm), NULL);
- g_return_val_if_fail(ete == NULL || E_IS_TABLE_EXTRAS(ete), NULL);
- g_return_val_if_fail(spec_fn != NULL, NULL);
-
- e_tree = g_object_new (E_TREE_TYPE, NULL);
-
- ret_val = e_tree_construct_from_spec_file (e_tree, etm, ete, spec_fn, state_fn);
-
- if (ret_val == NULL) {
- g_object_unref (e_tree);
- }
-
- return (GtkWidget *) ret_val;
-}
-
-void
-e_tree_set_cursor (ETree *e_tree, ETreePath path)
-{
-#ifndef E_TREE_USE_TREE_SELECTION
- int row;
-#endif
- g_return_if_fail(e_tree != NULL);
- g_return_if_fail(E_IS_TREE(e_tree));
- g_return_if_fail(path != NULL);
-
-#ifdef E_TREE_USE_TREE_SELECTION
- e_tree_selection_model_select_single_path (E_TREE_SELECTION_MODEL(e_tree->priv->selection), path);
- e_tree_selection_model_change_cursor (E_TREE_SELECTION_MODEL(e_tree->priv->selection), path);
-#else
- row = e_tree_table_adapter_row_of_node(E_TREE_TABLE_ADAPTER(e_tree->priv->etta), path);
-
- if (row == -1)
- return;
-
- g_object_set(e_tree->priv->selection,
- "cursor_row", row,
- NULL);
-#endif
-}
-
-ETreePath
-e_tree_get_cursor (ETree *e_tree)
-{
-#ifdef E_TREE_USE_TREE_SELECTION
- return e_tree_selection_model_get_cursor (E_TREE_SELECTION_MODEL(e_tree->priv->selection));
-#else
- int row;
- ETreePath path;
- g_return_val_if_fail(e_tree != NULL, NULL);
- g_return_val_if_fail(E_IS_TREE(e_tree), NULL);
-
- g_object_get(e_tree->priv->selection,
- "cursor_row", &row,
- NULL);
- if (row == -1)
- return NULL;
- path = e_tree_table_adapter_node_at_row(E_TREE_TABLE_ADAPTER(e_tree->priv->etta), row);
- return path;
-#endif
-}
-
-void
-e_tree_selected_row_foreach (ETree *e_tree,
- EForeachFunc callback,
- gpointer closure)
-{
- g_return_if_fail(e_tree != NULL);
- g_return_if_fail(E_IS_TREE(e_tree));
-
- e_selection_model_foreach(e_tree->priv->selection,
- callback,
- closure);
-}
-
-#ifdef E_TREE_USE_TREE_SELECTION
-void
-e_tree_selected_path_foreach (ETree *e_tree,
- ETreeForeachFunc callback,
- gpointer closure)
-{
- g_return_if_fail(e_tree != NULL);
- g_return_if_fail(E_IS_TREE(e_tree));
-
- e_tree_selection_model_foreach(E_TREE_SELECTION_MODEL (e_tree->priv->selection),
- callback,
- closure);
-}
-
-/* Standard functions */
-static void
-et_foreach_recurse (ETreeModel *model,
- ETreePath path,
- ETreeForeachFunc callback,
- gpointer closure)
-{
- ETreePath child;
-
- callback(path, closure);
-
- child = e_tree_model_node_get_first_child(E_TREE_MODEL(model), path);
- for ( ; child; child = e_tree_model_node_get_next(E_TREE_MODEL(model), child))
- if (child)
- et_foreach_recurse (model, child, callback, closure);
-}
-
-void
-e_tree_path_foreach (ETree *e_tree,
- ETreeForeachFunc callback,
- gpointer closure)
-{
- ETreePath root;
-
- g_return_if_fail(e_tree != NULL);
- g_return_if_fail(E_IS_TREE(e_tree));
-
- root = e_tree_model_get_root (e_tree->priv->model);
-
- if (root)
- et_foreach_recurse (e_tree->priv->model,
- root,
- callback,
- closure);
-}
-#endif
-
-EPrintable *
-e_tree_get_printable (ETree *e_tree)
-{
- g_return_val_if_fail(e_tree != NULL, NULL);
- g_return_val_if_fail(E_IS_TREE(e_tree), NULL);
-
- return e_table_item_get_printable(E_TABLE_ITEM(e_tree->priv->item));
-}
-
-static void
-et_get_property (GObject *object,
- guint prop_id,
- GValue *value,
- GParamSpec *pspec)
-{
- ETree *etree = E_TREE (object);
-
- switch (prop_id){
- case PROP_ETTA:
- g_value_set_object (value, etree->priv->etta);
- break;
- case PROP_UNIFORM_ROW_HEIGHT:
- g_value_set_boolean (value, etree->priv->uniform_row_height);
- break;
- case PROP_ALWAYS_SEARCH:
- g_value_set_boolean (value, etree->priv->always_search);
- break;
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
- break;
- }
-}
-
-typedef struct {
- char *arg;
- gboolean setting;
-} bool_closure;
-
-static void
-et_set_property (GObject *object,
- guint prop_id,
- const GValue *value,
- GParamSpec *pspec)
-{
- ETree *etree = E_TREE (object);
-
- switch (prop_id){
- case PROP_LENGTH_THRESHOLD:
- etree->priv->length_threshold = g_value_get_int (value);
- if (etree->priv->item) {
- gnome_canvas_item_set (GNOME_CANVAS_ITEM(etree->priv->item),
- "length_threshold", etree->priv->length_threshold,
- NULL);
- }
- break;
-
- case PROP_HORIZONTAL_DRAW_GRID:
- etree->priv->horizontal_draw_grid = g_value_get_boolean (value);
- if (etree->priv->item) {
- gnome_canvas_item_set (GNOME_CANVAS_ITEM(etree->priv->item),
- "horizontal_draw_grid", etree->priv->horizontal_draw_grid,
- NULL);
- }
- break;
-
- case PROP_VERTICAL_DRAW_GRID:
- etree->priv->vertical_draw_grid = g_value_get_boolean (value);
- if (etree->priv->item) {
- gnome_canvas_item_set (GNOME_CANVAS_ITEM(etree->priv->item),
- "vertical_draw_grid", etree->priv->vertical_draw_grid,
- NULL);
- }
- break;
-
- case PROP_DRAW_FOCUS:
- etree->priv->draw_focus = g_value_get_boolean (value);
- if (etree->priv->item) {
- gnome_canvas_item_set (GNOME_CANVAS_ITEM(etree->priv->item),
- "drawfocus", etree->priv->draw_focus,
- NULL);
- }
- break;
-
- case PROP_UNIFORM_ROW_HEIGHT:
- etree->priv->uniform_row_height = g_value_get_boolean (value);
- if (etree->priv->item) {
- gnome_canvas_item_set (GNOME_CANVAS_ITEM(etree->priv->item),
- "uniform_row_height", etree->priv->uniform_row_height,
- NULL);
- }
- break;
-
- case PROP_ALWAYS_SEARCH:
- if (etree->priv->always_search == g_value_get_boolean (value))
- return;
- etree->priv->always_search = g_value_get_boolean (value);
- clear_current_search_col (etree);
- break;
- }
-}
-
-static void
-set_scroll_adjustments (ETree *tree,
- GtkAdjustment *hadjustment,
- GtkAdjustment *vadjustment)
-{
- if (vadjustment != NULL) {
- vadjustment->step_increment = 20;
- gtk_adjustment_changed(vadjustment);
- }
- if (hadjustment != NULL) {
- hadjustment->step_increment = 20;
- gtk_adjustment_changed(hadjustment);
- }
-
- if (tree->priv) {
- gtk_layout_set_hadjustment (GTK_LAYOUT(tree->priv->table_canvas),
- hadjustment);
- gtk_layout_set_vadjustment (GTK_LAYOUT(tree->priv->table_canvas),
- vadjustment);
-
- if (tree->priv->header_canvas != NULL)
- gtk_layout_set_hadjustment (GTK_LAYOUT(tree->priv->header_canvas),
- hadjustment);
- }
-}
-
-gint
-e_tree_get_next_row (ETree *e_tree,
- gint model_row)
-{
- g_return_val_if_fail(e_tree != NULL, -1);
- g_return_val_if_fail(E_IS_TREE(e_tree), -1);
-
- if (e_tree->priv->sorter) {
- int i;
- i = e_sorter_model_to_sorted(E_SORTER (e_tree->priv->sorter), model_row);
- i++;
- if (i < e_table_model_row_count(E_TABLE_MODEL(e_tree->priv->etta))) {
- return e_sorter_sorted_to_model(E_SORTER (e_tree->priv->sorter), i);
- } else
- return -1;
- } else
- if (model_row < e_table_model_row_count(E_TABLE_MODEL(e_tree->priv->etta)) - 1)
- return model_row + 1;
- else
- return -1;
-}
-
-gint
-e_tree_get_prev_row (ETree *e_tree,
- gint model_row)
-{
- g_return_val_if_fail(e_tree != NULL, -1);
- g_return_val_if_fail(E_IS_TREE(e_tree), -1);
-
- if (e_tree->priv->sorter) {
- int i;
- i = e_sorter_model_to_sorted(E_SORTER (e_tree->priv->sorter), model_row);
- i--;
- if (i >= 0)
- return e_sorter_sorted_to_model(E_SORTER (e_tree->priv->sorter), i);
- else
- return -1;
- } else
- return model_row - 1;
-}
-
-gint
-e_tree_model_to_view_row (ETree *e_tree,
- gint model_row)
-{
- g_return_val_if_fail(e_tree != NULL, -1);
- g_return_val_if_fail(E_IS_TREE(e_tree), -1);
-
- if (e_tree->priv->sorter)
- return e_sorter_model_to_sorted(E_SORTER (e_tree->priv->sorter), model_row);
- else
- return model_row;
-}
-
-gint
-e_tree_view_to_model_row (ETree *e_tree,
- gint view_row)
-{
- g_return_val_if_fail(e_tree != NULL, -1);
- g_return_val_if_fail(E_IS_TREE(e_tree), -1);
-
- if (e_tree->priv->sorter)
- return e_sorter_sorted_to_model (E_SORTER (e_tree->priv->sorter), view_row);
- else
- return view_row;
-}
-
-
-gboolean
-e_tree_node_is_expanded (ETree *et, ETreePath path)
-{
- g_return_val_if_fail(path, FALSE);
-
- return e_tree_table_adapter_node_is_expanded (et->priv->etta, path);
-}
-
-void
-e_tree_node_set_expanded (ETree *et, ETreePath path, gboolean expanded)
-{
- g_return_if_fail (et != NULL);
- g_return_if_fail (E_IS_TREE(et));
-
- e_tree_table_adapter_node_set_expanded (et->priv->etta, path, expanded);
-}
-
-void
-e_tree_node_set_expanded_recurse (ETree *et, ETreePath path, gboolean expanded)
-{
- g_return_if_fail (et != NULL);
- g_return_if_fail (E_IS_TREE(et));
-
- e_tree_table_adapter_node_set_expanded_recurse (et->priv->etta, path, expanded);
-}
-
-void
-e_tree_root_node_set_visible (ETree *et, gboolean visible)
-{
- g_return_if_fail (et != NULL);
- g_return_if_fail (E_IS_TREE(et));
-
- e_tree_table_adapter_root_node_set_visible (et->priv->etta, visible);
-}
-
-ETreePath
-e_tree_node_at_row (ETree *et, int row)
-{
- ETreePath path;
-
- path = e_tree_table_adapter_node_at_row (et->priv->etta, row);
-
- return path;
-}
-
-int
-e_tree_row_of_node (ETree *et, ETreePath path)
-{
- return e_tree_table_adapter_row_of_node (et->priv->etta, path);
-}
-
-gboolean
-e_tree_root_node_is_visible(ETree *et)
-{
- return e_tree_table_adapter_root_node_is_visible (et->priv->etta);
-}
-
-void
-e_tree_show_node (ETree *et, ETreePath path)
-{
- g_return_if_fail (et != NULL);
- g_return_if_fail (E_IS_TREE(et));
-
- e_tree_table_adapter_show_node (et->priv->etta, path);
-}
-
-void
-e_tree_save_expanded_state (ETree *et, char *filename)
-{
- g_return_if_fail (et != NULL);
- g_return_if_fail (E_IS_TREE(et));
-
- e_tree_table_adapter_save_expanded_state (et->priv->etta, filename);
-}
-
-void
-e_tree_load_expanded_state (ETree *et, char *filename)
-{
- e_tree_table_adapter_load_expanded_state (et->priv->etta, filename);
-}
-
-gint
-e_tree_row_count (ETree *et)
-{
- return e_table_model_row_count (E_TABLE_MODEL(et->priv->etta));
-}
-
-GtkWidget *
-e_tree_get_tooltip (ETree *et)
-{
- return E_CANVAS(et->priv->table_canvas)->tooltip_window;
-}
-
-static ETreePath
-find_next_in_range (ETree *et, gint start, gint end, ETreePathFunc func, gpointer data)
-{
- ETreePath path;
- gint row;
-
- for (row = start; row <= end; row++) {
- path = e_tree_table_adapter_node_at_row (et->priv->etta, row);
- if (func (et->priv->model, path, data))
- return path;
- }
-
- return NULL;
-}
-
-static ETreePath
-find_prev_in_range (ETree *et, gint start, gint end, ETreePathFunc func, gpointer data)
-{
- ETreePath path;
- gint row;
-
- for (row = start; row >= end; row--) {
- path = e_tree_table_adapter_node_at_row (et->priv->etta, row);
- if (func (et->priv->model, path, data))
- return path;
- }
-
- return NULL;
-}
-
-gboolean
-e_tree_find_next (ETree *et, ETreeFindNextParams params, ETreePathFunc func, gpointer data)
-{
- ETreePath cursor, found;
- gint row, row_count;
-
- cursor = e_tree_get_cursor (et);
- row = e_tree_table_adapter_row_of_node (et->priv->etta, cursor);
- row_count = e_table_model_row_count (E_TABLE_MODEL (et->priv->etta));
- if (row == -1)
- row = 0;
-
- if (params & E_TREE_FIND_NEXT_FORWARD)
- found = find_next_in_range (et, row + 1, row_count - 1, func, data);
- else
- found = find_prev_in_range (et, row - 1, 0, func, data);
-
- if (found) {
- e_tree_table_adapter_show_node (et->priv->etta, found);
- e_tree_set_cursor (et, found);
- return TRUE;
- }
-
- if (params & E_TREE_FIND_NEXT_WRAP) {
- if (params & E_TREE_FIND_NEXT_FORWARD)
- found = find_next_in_range (et, 0, row, func, data);
- else
- found = find_prev_in_range (et, row_count - 1, row, func, data);
-
- if (found && found != cursor) {
- e_tree_table_adapter_show_node (et->priv->etta, found);
- e_tree_set_cursor (et, found);
- return TRUE;
- }
- }
-
- return FALSE;
-}
-
-void
-e_tree_right_click_up (ETree *et)
-{
- e_selection_model_right_click_up(et->priv->selection);
-}
-
-/**
- * e_tree_get_model:
- * @et: the ETree
- *
- * Returns the model upon which this ETree is based.
- *
- * Returns: the model
- **/
-ETreeModel *
-e_tree_get_model (ETree *et)
-{
- g_return_val_if_fail (et != NULL, NULL);
- g_return_val_if_fail (E_IS_TREE (et), NULL);
-
- return et->priv->model;
-}
-
-/**
- * e_tree_get_selection_model:
- * @et: the ETree
- *
- * Returns the selection model of this ETree.
- *
- * Returns: the selection model
- **/
-ESelectionModel *
-e_tree_get_selection_model (ETree *et)
-{
- g_return_val_if_fail (et != NULL, NULL);
- g_return_val_if_fail (E_IS_TREE (et), NULL);
-
- return et->priv->selection;
-}
-
-/**
- * e_tree_get_table_adapter:
- * @et: the ETree
- *
- * Returns the table adapter this ETree uses.
- *
- * Returns: the model
- **/
-ETreeTableAdapter *
-e_tree_get_table_adapter (ETree *et)
-{
- g_return_val_if_fail (et != NULL, NULL);
- g_return_val_if_fail (E_IS_TREE (et), NULL);
-
- return et->priv->etta;
-}
-
-
-struct _ETreeDragSourceSite
-{
- GdkModifierType start_button_mask;
- GtkTargetList *target_list; /* Targets for drag data */
- GdkDragAction actions; /* Possible actions */
- GdkColormap *colormap; /* Colormap for drag icon */
- GdkPixmap *pixmap; /* Icon for drag data */
- GdkBitmap *mask;
-
- /* Stored button press information to detect drag beginning */
- gint state;
- gint x, y;
- gint row, col;
-};
-
-typedef enum
-{
- GTK_DRAG_STATUS_DRAG,
- GTK_DRAG_STATUS_WAIT,
- GTK_DRAG_STATUS_DROP
-} GtkDragStatus;
-
-typedef struct _GtkDragDestInfo GtkDragDestInfo;
-typedef struct _GtkDragSourceInfo GtkDragSourceInfo;
-
-struct _GtkDragDestInfo
-{
- GtkWidget *widget; /* Widget in which drag is in */
- GdkDragContext *context; /* Drag context */
- GtkDragSourceInfo *proxy_source; /* Set if this is a proxy drag */
- GtkSelectionData *proxy_data; /* Set while retrieving proxied data */
- gboolean dropped : 1; /* Set after we receive a drop */
- guint32 proxy_drop_time; /* Timestamp for proxied drop */
- gboolean proxy_drop_wait : 1; /* Set if we are waiting for a
- * status reply before sending
- * a proxied drop on.
- */
- gint drop_x, drop_y; /* Position of drop */
-};
-
-struct _GtkDragSourceInfo
-{
- GtkWidget *widget;
- GtkTargetList *target_list; /* Targets for drag data */
- GdkDragAction possible_actions; /* Actions allowed by source */
- GdkDragContext *context; /* drag context */
- GtkWidget *icon_window; /* Window for drag */
- GtkWidget *ipc_widget; /* GtkInvisible for grab, message passing */
- GdkCursor *cursor; /* Cursor for drag */
- gint hot_x, hot_y; /* Hot spot for drag */
- gint button; /* mouse button starting drag */
-
- GtkDragStatus status; /* drag status */
- GdkEvent *last_event; /* motion event waiting for response */
-
- gint start_x, start_y; /* Initial position */
- gint cur_x, cur_y; /* Current Position */
-
- GList *selections; /* selections we've claimed */
-
- GtkDragDestInfo *proxy_dest; /* Set if this is a proxy drag */
-
- guint drop_timeout; /* Timeout for aborting drop */
- guint destroy_icon : 1; /* If true, destroy icon_window
- */
-};
-
-/* Drag & drop stuff. */
-/* Target */
-
-void
-e_tree_drag_get_data (ETree *tree,
- int row,
- int col,
- GdkDragContext *context,
- GdkAtom target,
- guint32 time)
-{
- ETreePath path;
- g_return_if_fail(tree != NULL);
- g_return_if_fail(E_IS_TREE(tree));
-
- path = e_tree_table_adapter_node_at_row(tree->priv->etta, row);
-
- gtk_drag_get_data(GTK_WIDGET(tree),
- context,
- target,
- time);
-
-}
-
-/**
- * e_tree_drag_highlight:
- * @tree:
- * @row:
- * @col:
- *
- * Set col to -1 to highlight the entire row.
- * Set row to -1 to turn off the highlight.
- */
-void
-e_tree_drag_highlight (ETree *tree,
- int row,
- int col)
-{
- g_return_if_fail(tree != NULL);
- g_return_if_fail(E_IS_TREE(tree));
-
- if (row != -1) {
- int x, y, width, height;
- if (col == -1) {
- e_tree_get_cell_geometry (tree, row, 0, &x, &y, &width, &height);
- x = 0;
- width = GTK_WIDGET (tree->priv->table_canvas)->allocation.width;
- } else {
- e_tree_get_cell_geometry (tree, row, col, &x, &y, &width, &height);
- x += GTK_LAYOUT(tree->priv->table_canvas)->hadjustment->value;
- }
- y += GTK_LAYOUT(tree->priv->table_canvas)->vadjustment->value;
-
- if (tree->priv->drop_highlight == NULL) {
- tree->priv->drop_highlight =
- gnome_canvas_item_new (gnome_canvas_root (tree->priv->table_canvas),
- gnome_canvas_rect_get_type (),
- "fill_color", NULL,
- /* "outline_color", "black",
- "width_pixels", 1,*/
- "outline_color_gdk", &(GTK_WIDGET (tree)->style->fg[GTK_STATE_NORMAL]),
- NULL);
- }
- gnome_canvas_item_set (tree->priv->drop_highlight,
- "x1", (double) x,
- "x2", (double) x + width - 1,
- "y1", (double) y,
- "y2", (double) y + height - 1,
- NULL);
- } else {
- gtk_object_destroy (GTK_OBJECT (tree->priv->drop_highlight));
- tree->priv->drop_highlight = NULL;
- }
-}
-
-void
-e_tree_drag_unhighlight (ETree *tree)
-{
- g_return_if_fail(tree != NULL);
- g_return_if_fail(E_IS_TREE(tree));
-
- if (tree->priv->drop_highlight) {
- gtk_object_destroy (GTK_OBJECT (tree->priv->drop_highlight));
- tree->priv->drop_highlight = NULL;
- }
-}
-
-void e_tree_drag_dest_set (ETree *tree,
- GtkDestDefaults flags,
- const GtkTargetEntry *targets,
- gint n_targets,
- GdkDragAction actions)
-{
- g_return_if_fail(tree != NULL);
- g_return_if_fail(E_IS_TREE(tree));
-
- gtk_drag_dest_set(GTK_WIDGET(tree),
- flags,
- targets,
- n_targets,
- actions);
-}
-
-void e_tree_drag_dest_set_proxy (ETree *tree,
- GdkWindow *proxy_window,
- GdkDragProtocol protocol,
- gboolean use_coordinates)
-{
- g_return_if_fail(tree != NULL);
- g_return_if_fail(E_IS_TREE(tree));
-
- gtk_drag_dest_set_proxy(GTK_WIDGET(tree),
- proxy_window,
- protocol,
- use_coordinates);
-}
-
-/*
- * There probably should be functions for setting the targets
- * as a GtkTargetList
- */
-
-void
-e_tree_drag_dest_unset (GtkWidget *widget)
-{
- g_return_if_fail(widget != NULL);
- g_return_if_fail(E_IS_TREE(widget));
-
- gtk_drag_dest_unset(widget);
-}
-
-/* Source side */
-
-static gint
-et_real_start_drag (ETree *tree, int row, ETreePath path, int col, GdkEvent *event)
-{
- GtkDragSourceInfo *info;
- GdkDragContext *context;
- ETreeDragSourceSite *site;
-
- if (tree->priv->do_drag) {
- site = tree->priv->site;
-
- site->state = 0;
- context = e_tree_drag_begin (tree, row, col,
- site->target_list,
- site->actions,
- 1, event);
-
- if (context) {
- info = g_dataset_get_data (context, "gtk-info");
-
- if (info && !info->icon_window) {
- if (site->pixmap)
- gtk_drag_set_icon_pixmap (context,
- site->colormap,
- site->pixmap,
- site->mask, -2, -2);
- else
- gtk_drag_set_icon_default (context);
- }
- }
- return TRUE;
- }
- return FALSE;
-}
-
-void
-e_tree_drag_source_set (ETree *tree,
- GdkModifierType start_button_mask,
- const GtkTargetEntry *targets,
- gint n_targets,
- GdkDragAction actions)
-{
- ETreeDragSourceSite *site;
- GtkWidget *canvas;
-
- g_return_if_fail(tree != NULL);
- g_return_if_fail(E_IS_TREE(tree));
-
- canvas = GTK_WIDGET(tree->priv->table_canvas);
- site = tree->priv->site;
-
- tree->priv->do_drag = TRUE;
-
- gtk_widget_add_events (canvas,
- gtk_widget_get_events (canvas) |
- GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK |
- GDK_BUTTON_MOTION_MASK | GDK_STRUCTURE_MASK);
-
- if (site) {
- if (site->target_list)
- gtk_target_list_unref (site->target_list);
- } else {
- site = g_new0 (ETreeDragSourceSite, 1);
- tree->priv->site = site;
- }
-
- site->start_button_mask = start_button_mask;
-
- if (targets)
- site->target_list = gtk_target_list_new (targets, n_targets);
- else
- site->target_list = NULL;
-
- site->actions = actions;
-}
-
-void
-e_tree_drag_source_unset (ETree *tree)
-{
- ETreeDragSourceSite *site;
-
- g_return_if_fail (tree != NULL);
- g_return_if_fail (E_IS_TREE(tree));
-
- site = tree->priv->site;
-
- if (site) {
- if (site->target_list)
- gtk_target_list_unref (site->target_list);
- g_free (site);
- tree->priv->site = NULL;
- }
-}
-
-/* There probably should be functions for setting the targets
- * as a GtkTargetList
- */
-
-GdkDragContext *
-e_tree_drag_begin (ETree *tree,
- int row,
- int col,
- GtkTargetList *targets,
- GdkDragAction actions,
- gint button,
- GdkEvent *event)
-{
- ETreePath path;
- g_return_val_if_fail (tree != NULL, NULL);
- g_return_val_if_fail (E_IS_TREE(tree), NULL);
-
- path = e_tree_table_adapter_node_at_row(tree->priv->etta, row);
-
- tree->priv->drag_row = row;
- tree->priv->drag_path = path;
- tree->priv->drag_col = col;
-
- return gtk_drag_begin(GTK_WIDGET (tree->priv->table_canvas),
- targets,
- actions,
- button,
- event);
-}
-
-/**
- * e_tree_get_cell_at:
- * @tree: An ETree widget
- * @x: X coordinate for the pixel
- * @y: Y coordinate for the pixel
- * @row_return: Pointer to return the row value
- * @col_return: Pointer to return the column value
- *
- * Return the row and column for the cell in which the pixel at (@x, @y) is
- * contained.
- **/
-void
-e_tree_get_cell_at (ETree *tree,
- int x, int y,
- int *row_return, int *col_return)
-{
- g_return_if_fail (tree != NULL);
- g_return_if_fail (E_IS_TREE (tree));
- g_return_if_fail (row_return != NULL);
- g_return_if_fail (col_return != NULL);
-
- /* FIXME it would be nice if it could handle a NULL row_return or
- * col_return gracefully. */
-
- if (row_return)
- *row_return = -1;
- if (col_return)
- *col_return = -1;
-
- x += GTK_LAYOUT(tree->priv->table_canvas)->hadjustment->value;
- y += GTK_LAYOUT(tree->priv->table_canvas)->vadjustment->value;
- e_table_item_compute_location(E_TABLE_ITEM(tree->priv->item), &x, &y, row_return, col_return);
-}
-
-/**
- * e_tree_get_cell_geometry:
- * @tree: The tree.
- * @row: The row to get the geometry of.
- * @col: The col to get the geometry of.
- * @x_return: Returns the x coordinate of the upper right hand corner of the cell with respect to the widget.
- * @y_return: Returns the y coordinate of the upper right hand corner of the cell with respect to the widget.
- * @width_return: Returns the width of the cell.
- * @height_return: Returns the height of the cell.
- *
- * Computes the data about this cell.
- **/
-void
-e_tree_get_cell_geometry (ETree *tree,
- int row, int col,
- int *x_return, int *y_return,
- int *width_return, int *height_return)
-{
- g_return_if_fail (tree != NULL);
- g_return_if_fail (E_IS_TREE (tree));
- g_return_if_fail (row >= 0);
- g_return_if_fail (col >= 0);
-
- /* FIXME it would be nice if it could handle a NULL row_return or
- * col_return gracefully. */
-
- e_table_item_get_cell_geometry(E_TABLE_ITEM(tree->priv->item), &row, &col, x_return, y_return, width_return, height_return);
-
- if (x_return)
- (*x_return) -= GTK_LAYOUT(tree->priv->table_canvas)->hadjustment->value;
- if (y_return)
- (*y_return) -= GTK_LAYOUT(tree->priv->table_canvas)->vadjustment->value;
-}
-
-static void
-et_drag_begin (GtkWidget *widget,
- GdkDragContext *context,
- ETree *et)
-{
- g_signal_emit (et,
- et_signals [TREE_DRAG_BEGIN], 0,
- et->priv->drag_row,
- et->priv->drag_path,
- et->priv->drag_col,
- context);
-}
-
-static void
-et_drag_end (GtkWidget *widget,
- GdkDragContext *context,
- ETree *et)
-{
- g_signal_emit (et,
- et_signals [TREE_DRAG_END], 0,
- et->priv->drag_row,
- et->priv->drag_path,
- et->priv->drag_col,
- context);
-}
-
-static void
-et_drag_data_get(GtkWidget *widget,
- GdkDragContext *context,
- GtkSelectionData *selection_data,
- guint info,
- guint time,
- ETree *et)
-{
- g_signal_emit (et,
- et_signals [TREE_DRAG_DATA_GET], 0,
- et->priv->drag_row,
- et->priv->drag_path,
- et->priv->drag_col,
- context,
- selection_data,
- info,
- time);
-}
-
-static void
-et_drag_data_delete(GtkWidget *widget,
- GdkDragContext *context,
- ETree *et)
-{
- g_signal_emit (et,
- et_signals [TREE_DRAG_DATA_DELETE], 0,
- et->priv->drag_row,
- et->priv->drag_path,
- et->priv->drag_col,
- context);
-}
-
-static gboolean
-do_drag_motion(ETree *et,
- GdkDragContext *context,
- gint x,
- gint y,
- guint time)
-{
- gboolean ret_val = FALSE;
- int row, col;
- ETreePath path;
- GtkWidget *widget;
-
- widget = GTK_WIDGET (et);
-
- e_tree_get_cell_at (et,
- x,
- y,
- &row,
- &col);
- if (row != et->priv->drop_row && col != et->priv->drop_col) {
- g_signal_emit (et,
- et_signals [TREE_DRAG_LEAVE], 0,
- et->priv->drop_row,
- et->priv->drop_path,
- et->priv->drop_col,
- context,
- time);
- }
-
- path = e_tree_table_adapter_node_at_row(et->priv->etta, row);
-
- et->priv->drop_row = row;
- et->priv->drop_path = path;
- et->priv->drop_col = col;
- g_signal_emit (et,
- et_signals [TREE_DRAG_MOTION], 0,
- et->priv->drop_row,
- et->priv->drop_path,
- et->priv->drop_col,
- context,
- x,
- y,
- time,
- &ret_val);
-
- return ret_val;
-}
-
-static gboolean
-scroll_timeout (gpointer data)
-{
- ETree *et = data;
- int dx = 0, dy = 0;
- GtkAdjustment *v, *h;
- double vvalue, hvalue;
-
- if (et->priv->scroll_direction & ET_SCROLL_DOWN)
- dy += 20;
- if (et->priv->scroll_direction & ET_SCROLL_UP)
- dy -= 20;
-
- if (et->priv->scroll_direction & ET_SCROLL_RIGHT)
- dx += 20;
- if (et->priv->scroll_direction & ET_SCROLL_LEFT)
- dx -= 20;
-
- h = GTK_LAYOUT(et->priv->table_canvas)->hadjustment;
- v = GTK_LAYOUT(et->priv->table_canvas)->vadjustment;
-
- hvalue = h->value;
- vvalue = v->value;
-
- gtk_adjustment_set_value(h, CLAMP(h->value + dx, h->lower, h->upper - h->page_size));
- gtk_adjustment_set_value(v, CLAMP(v->value + dy, v->lower, v->upper - v->page_size));
-
- if (h->value != hvalue ||
- v->value != vvalue)
- do_drag_motion(et,
- et->priv->last_drop_context,
- et->priv->last_drop_x,
- et->priv->last_drop_y,
- et->priv->last_drop_time);
-
-
- return TRUE;
-}
-
-static void
-scroll_on (ETree *et, guint scroll_direction)
-{
- if (et->priv->scroll_idle_id == 0 || scroll_direction != et->priv->scroll_direction) {
- if (et->priv->scroll_idle_id != 0)
- g_source_remove (et->priv->scroll_idle_id);
- et->priv->scroll_direction = scroll_direction;
- et->priv->scroll_idle_id = g_timeout_add (100, scroll_timeout, et);
- }
-}
-
-static void
-scroll_off (ETree *et)
-{
- if (et->priv->scroll_idle_id) {
- g_source_remove (et->priv->scroll_idle_id);
- et->priv->scroll_idle_id = 0;
- }
-}
-
-static gboolean
-hover_timeout (gpointer data)
-{
- ETree *et = data;
- GtkWidget *widget = data;
- int x = et->priv->hover_x;
- int y = et->priv->hover_y;
- int row, col;
- ETreePath path;
-
- e_tree_get_cell_at (et,
- x,
- y,
- &row,
- &col);
-
- path = e_tree_table_adapter_node_at_row(et->priv->etta, row);
- if (path && e_tree_model_node_is_expandable (et->priv->model, path)) {
- if (!e_tree_table_adapter_node_is_expanded (et->priv->etta, path)) {
- if (e_tree_model_has_save_id (et->priv->model) && e_tree_model_has_get_node_by_id (et->priv->model))
- et->priv->expanded_list = g_list_prepend (et->priv->expanded_list, e_tree_model_get_save_id (et->priv->model, path));
- e_tree_table_adapter_node_set_expanded (et->priv->etta, path, TRUE);
- }
- }
-
- return TRUE;
-}
-
-static void
-hover_on (ETree *et, int x, int y)
-{
- et->priv->hover_x = x;
- et->priv->hover_y = y;
- if (et->priv->hover_idle_id != 0)
- g_source_remove (et->priv->hover_idle_id);
- et->priv->hover_idle_id = g_timeout_add (500, hover_timeout, et);
-}
-
-static void
-hover_off (ETree *et)
-{
- if (et->priv->hover_idle_id) {
- g_source_remove (et->priv->hover_idle_id);
- et->priv->hover_idle_id = 0;
- }
-}
-
-static void
-collapse_drag (ETree *et, ETreePath drop)
-{
- GList *list;
-
- /* We only want to leave open parents of the node dropped in. Not the node itself. */
- if (drop) {
- drop = e_tree_model_node_get_parent (et->priv->model, drop);
- }
-
- for (list = et->priv->expanded_list; list; list = list->next) {
- char *save_id = list->data;
- ETreePath path;
-
- path = e_tree_model_get_node_by_id (et->priv->model, save_id);
- if (path) {
- ETreePath search;
- gboolean found = FALSE;
-
- for (search = drop; search; search = e_tree_model_node_get_parent (et->priv->model, search)) {
- if (path == search) {
- found = TRUE;
- break;
- }
- }
-
- if (!found)
- e_tree_table_adapter_node_set_expanded (et->priv->etta, path, FALSE);
- }
- g_free (save_id);
- }
- g_list_free (et->priv->expanded_list);
- et->priv->expanded_list = NULL;
-}
-
-static void
-context_destroyed (gpointer data)
-{
- ETree *et = data;
- if (et->priv) {
- et->priv->last_drop_x = 0;
- et->priv->last_drop_y = 0;
- et->priv->last_drop_time = 0;
- et->priv->last_drop_context = NULL;
- collapse_drag (et, NULL);
- scroll_off (et);
- hover_off (et);
- }
- g_object_unref (et);
-}
-
-static void
-context_connect (ETree *et, GdkDragContext *context)
-{
- if (g_dataset_get_data (context, "e-tree") == NULL) {
- g_object_ref (et);
- g_dataset_set_data_full (context, "e-tree", et, context_destroyed);
- }
-}
-
-static void
-et_drag_leave(GtkWidget *widget,
- GdkDragContext *context,
- guint time,
- ETree *et)
-{
- g_signal_emit (et,
- et_signals [TREE_DRAG_LEAVE], 0,
- et->priv->drop_row,
- et->priv->drop_path,
- et->priv->drop_col,
- context,
- time);
- et->priv->drop_row = -1;
- et->priv->drop_col = -1;
-
- scroll_off (et);
- hover_off (et);
-}
-
-static gboolean
-et_drag_motion(GtkWidget *widget,
- GdkDragContext *context,
- gint x,
- gint y,
- guint time,
- ETree *et)
-{
- int ret_val;
- guint direction = 0;
-
- et->priv->last_drop_x = x;
- et->priv->last_drop_y = y;
- et->priv->last_drop_time = time;
- et->priv->last_drop_context = context;
- context_connect (et, context);
-
- if (et->priv->hover_idle_id != 0) {
- if (abs (et->priv->hover_x - x) > 3 ||
- abs (et->priv->hover_y - y) > 3) {
- hover_on (et, x, y);
- }
- } else {
- hover_on (et, x, y);
- }
-
- ret_val = do_drag_motion (et,
- context,
- x,
- y,
- time);
-
- if (y < 20)
- direction |= ET_SCROLL_UP;
- if (y > widget->allocation.height - 20)
- direction |= ET_SCROLL_DOWN;
- if (x < 20)
- direction |= ET_SCROLL_LEFT;
- if (x > widget->allocation.width - 20)
- direction |= ET_SCROLL_RIGHT;
-
- if (direction != 0)
- scroll_on (et, direction);
- else
- scroll_off (et);
-
- return ret_val;
-}
-
-static gboolean
-et_drag_drop(GtkWidget *widget,
- GdkDragContext *context,
- gint x,
- gint y,
- guint time,
- ETree *et)
-{
- gboolean ret_val = FALSE;
- int row, col;
- ETreePath path;
- e_tree_get_cell_at(et,
- x,
- y,
- &row,
- &col);
- path = e_tree_table_adapter_node_at_row(et->priv->etta, row);
-
- if (row != et->priv->drop_row && col != et->priv->drop_row) {
- g_signal_emit (et,
- et_signals [TREE_DRAG_LEAVE], 0,
- et->priv->drop_row,
- et->priv->drop_path,
- et->priv->drop_col,
- context,
- time);
- g_signal_emit (et,
- et_signals [TREE_DRAG_MOTION], 0,
- row,
- path,
- col,
- context,
- x,
- y,
- time,
- &ret_val);
- }
- et->priv->drop_row = row;
- et->priv->drop_path = path;
- et->priv->drop_col = col;
-
- g_signal_emit (et,
- et_signals [TREE_DRAG_DROP], 0,
- et->priv->drop_row,
- et->priv->drop_path,
- et->priv->drop_col,
- context,
- x,
- y,
- time,
- &ret_val);
-
- et->priv->drop_row = -1;
- et->priv->drop_path = NULL;
- et->priv->drop_col = -1;
-
- collapse_drag (et, path);
-
- scroll_off (et);
- return ret_val;
-}
-
-static void
-et_drag_data_received(GtkWidget *widget,
- GdkDragContext *context,
- gint x,
- gint y,
- GtkSelectionData *selection_data,
- guint info,
- guint time,
- ETree *et)
-{
- int row, col;
- ETreePath path;
- e_tree_get_cell_at(et,
- x,
- y,
- &row,
- &col);
- path = e_tree_table_adapter_node_at_row(et->priv->etta, row);
- g_signal_emit (et,
- et_signals [TREE_DRAG_DATA_RECEIVED], 0,
- row,
- path,
- col,
- context,
- x,
- y,
- selection_data,
- info,
- time);
-}
-
-static void
-e_tree_class_init (ETreeClass *class)
-{
- GObjectClass *object_class;
- GtkWidgetClass *widget_class;
- GtkContainerClass *container_class;
-
- object_class = (GObjectClass *) class;
- widget_class = (GtkWidgetClass *) class;
- container_class = (GtkContainerClass *) class;
-
- parent_class = g_type_class_ref (PARENT_TYPE);
-
- object_class->dispose = et_dispose;
- object_class->set_property = et_set_property;
- object_class->get_property = et_get_property;
-
- widget_class->grab_focus = et_grab_focus;
- widget_class->unrealize = et_unrealize;
- widget_class->style_set = et_canvas_style_set;
- widget_class->focus = et_focus;
-
- class->cursor_change = NULL;
- class->cursor_activated = NULL;
- class->selection_change = NULL;
- class->double_click = NULL;
- class->right_click = NULL;
- class->click = NULL;
- class->key_press = NULL;
- class->start_drag = et_real_start_drag;
- class->state_change = NULL;
- class->white_space_event = NULL;
-
- class->tree_drag_begin = NULL;
- class->tree_drag_end = NULL;
- class->tree_drag_data_get = NULL;
- class->tree_drag_data_delete = NULL;
-
- class->tree_drag_leave = NULL;
- class->tree_drag_motion = NULL;
- class->tree_drag_drop = NULL;
- class->tree_drag_data_received = NULL;
-
- et_signals [CURSOR_CHANGE] =
- g_signal_new ("cursor_change",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (ETreeClass, cursor_change),
- NULL, NULL,
- e_marshal_NONE__INT_POINTER,
- G_TYPE_NONE, 2, G_TYPE_INT, G_TYPE_POINTER);
-
- et_signals [CURSOR_ACTIVATED] =
- g_signal_new ("cursor_activated",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (ETreeClass, cursor_activated),
- NULL, NULL,
- e_marshal_NONE__INT_POINTER,
- G_TYPE_NONE, 2, G_TYPE_INT, G_TYPE_POINTER);
-
- et_signals [SELECTION_CHANGE] =
- g_signal_new ("selection_change",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (ETreeClass, selection_change),
- NULL, NULL,
- e_marshal_NONE__NONE,
- G_TYPE_NONE, 0);
-
- et_signals [DOUBLE_CLICK] =
- g_signal_new ("double_click",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (ETreeClass, double_click),
- NULL, NULL,
- e_marshal_NONE__INT_POINTER_INT_BOXED,
- G_TYPE_NONE, 4, G_TYPE_INT,
- G_TYPE_POINTER, G_TYPE_INT, GDK_TYPE_EVENT);
-
- et_signals [RIGHT_CLICK] =
- g_signal_new ("right_click",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (ETreeClass, right_click),
- NULL, NULL,
- e_marshal_INT__INT_POINTER_INT_BOXED,
- G_TYPE_INT, 4, G_TYPE_INT, G_TYPE_POINTER,
- G_TYPE_INT, GDK_TYPE_EVENT);
-
- et_signals [CLICK] =
- g_signal_new ("click",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (ETreeClass, click),
- NULL, NULL,
- e_marshal_INT__INT_POINTER_INT_BOXED,
- G_TYPE_INT, 4, G_TYPE_INT, G_TYPE_POINTER,
- G_TYPE_INT, GDK_TYPE_EVENT);
-
- et_signals [KEY_PRESS] =
- g_signal_new ("key_press",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (ETreeClass, key_press),
- NULL, NULL,
- e_marshal_INT__INT_POINTER_INT_BOXED,
- G_TYPE_INT, 4, G_TYPE_INT, G_TYPE_POINTER,
- G_TYPE_INT, GDK_TYPE_EVENT);
-
- et_signals [START_DRAG] =
- g_signal_new ("start_drag",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (ETreeClass, start_drag),
- NULL, NULL,
- e_marshal_NONE__INT_POINTER_INT_BOXED,
- G_TYPE_NONE, 4, G_TYPE_INT, G_TYPE_POINTER,
- G_TYPE_INT, GDK_TYPE_EVENT);
-
- et_signals [STATE_CHANGE] =
- g_signal_new ("state_change",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (ETreeClass, state_change),
- NULL, NULL,
- e_marshal_NONE__NONE,
- G_TYPE_NONE, 0);
-
- et_signals [WHITE_SPACE_EVENT] =
- g_signal_new ("white_space_event",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (ETreeClass, white_space_event),
- NULL, NULL,
- e_marshal_INT__POINTER,
- G_TYPE_INT, 1, GDK_TYPE_EVENT);
-
- et_signals[TREE_DRAG_BEGIN] =
- g_signal_new ("tree_drag_begin",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (ETreeClass, tree_drag_begin),
- NULL, NULL,
- e_marshal_NONE__INT_POINTER_INT_BOXED,
- G_TYPE_NONE, 4,
- G_TYPE_INT,
- G_TYPE_POINTER,
- G_TYPE_INT,
- GDK_TYPE_DRAG_CONTEXT);
- et_signals[TREE_DRAG_END] =
- g_signal_new ("tree_drag_end",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (ETreeClass, tree_drag_end),
- NULL, NULL,
- e_marshal_NONE__INT_POINTER_INT_BOXED,
- G_TYPE_NONE, 4,
- G_TYPE_INT,
- G_TYPE_POINTER,
- G_TYPE_INT,
- GDK_TYPE_DRAG_CONTEXT);
- et_signals[TREE_DRAG_DATA_GET] =
- g_signal_new ("tree_drag_data_get",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (ETreeClass, tree_drag_data_get),
- NULL, NULL,
- e_marshal_NONE__INT_POINTER_INT_OBJECT_BOXED_UINT_UINT,
- G_TYPE_NONE, 7,
- G_TYPE_INT,
- G_TYPE_POINTER,
- G_TYPE_INT,
- GDK_TYPE_DRAG_CONTEXT,
- GTK_TYPE_SELECTION_DATA,
- G_TYPE_UINT,
- G_TYPE_UINT);
- et_signals[TREE_DRAG_DATA_DELETE] =
- g_signal_new ("tree_drag_data_delete",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (ETreeClass, tree_drag_data_delete),
- NULL, NULL,
- e_marshal_NONE__INT_POINTER_INT_OBJECT,
- G_TYPE_NONE, 4,
- G_TYPE_INT,
- G_TYPE_POINTER,
- G_TYPE_INT,
- GDK_TYPE_DRAG_CONTEXT);
-
- et_signals[TREE_DRAG_LEAVE] =
- g_signal_new ("tree_drag_leave",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (ETreeClass, tree_drag_leave),
- NULL, NULL,
- e_marshal_NONE__INT_POINTER_INT_OBJECT_UINT,
- G_TYPE_NONE, 5,
- G_TYPE_INT,
- G_TYPE_POINTER,
- G_TYPE_INT,
- GDK_TYPE_DRAG_CONTEXT,
- G_TYPE_UINT);
- et_signals[TREE_DRAG_MOTION] =
- g_signal_new ("tree_drag_motion",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (ETreeClass, tree_drag_motion),
- NULL, NULL,
- e_marshal_BOOLEAN__INT_POINTER_INT_OBJECT_INT_INT_UINT,
- G_TYPE_BOOLEAN, 7,
- G_TYPE_INT,
- G_TYPE_POINTER,
- G_TYPE_INT,
- GDK_TYPE_DRAG_CONTEXT,
- G_TYPE_INT,
- G_TYPE_INT,
- G_TYPE_UINT);
- et_signals[TREE_DRAG_DROP] =
- g_signal_new ("tree_drag_drop",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (ETreeClass, tree_drag_drop),
- NULL, NULL,
- e_marshal_BOOLEAN__INT_POINTER_INT_OBJECT_INT_INT_UINT,
- G_TYPE_BOOLEAN, 7,
- G_TYPE_INT,
- G_TYPE_POINTER,
- G_TYPE_INT,
- GDK_TYPE_DRAG_CONTEXT,
- G_TYPE_INT,
- G_TYPE_INT,
- G_TYPE_UINT);
- et_signals[TREE_DRAG_DATA_RECEIVED] =
- g_signal_new ("tree_drag_data_received",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (ETreeClass, tree_drag_data_received),
- NULL, NULL,
- e_marshal_NONE__INT_POINTER_INT_OBJECT_INT_INT_BOXED_UINT_UINT,
- G_TYPE_NONE, 9,
- G_TYPE_INT,
- G_TYPE_POINTER,
- G_TYPE_INT,
- GDK_TYPE_DRAG_CONTEXT,
- G_TYPE_INT,
- G_TYPE_INT,
- GTK_TYPE_SELECTION_DATA,
- G_TYPE_UINT,
- G_TYPE_UINT);
-
- class->set_scroll_adjustments = set_scroll_adjustments;
-
- widget_class->set_scroll_adjustments_signal =
- g_signal_new ("set_scroll_adjustments",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (ETreeClass, set_scroll_adjustments),
- NULL, NULL,
- e_marshal_NONE__POINTER_POINTER,
- G_TYPE_NONE, 2, GTK_TYPE_ADJUSTMENT,
- GTK_TYPE_ADJUSTMENT);
-
- g_object_class_install_property (object_class, PROP_LENGTH_THRESHOLD,
- g_param_spec_int ("length_threshold",
- _( "Length Threshold" ),
- _( "Length Threshold" ),
- 0, G_MAXINT, 0,
- G_PARAM_WRITABLE));
- g_object_class_install_property (object_class, PROP_HORIZONTAL_DRAW_GRID,
- g_param_spec_boolean ("horizontal_draw_grid",
- _( "Horizontal Draw Grid" ),
- _( "Horizontal Draw Grid" ),
- FALSE,
- G_PARAM_WRITABLE));
- g_object_class_install_property (object_class, PROP_VERTICAL_DRAW_GRID,
- g_param_spec_boolean ("vertical_draw_grid",
- _( "Vertical Draw Grid" ),
- _( "Vertical Draw Grid" ),
- FALSE,
- G_PARAM_WRITABLE));
- g_object_class_install_property (object_class, PROP_DRAW_FOCUS,
- g_param_spec_boolean ("drawfocus",
- _( "Draw focus" ),
- _( "Draw focus" ),
- FALSE,
- G_PARAM_WRITABLE));
-
- g_object_class_install_property (object_class, PROP_ETTA,
- g_param_spec_object ("ETreeTableAdapter",
- _( "ETree table adapter" ),
- _( "ETree table adapter" ),
- E_TREE_TABLE_ADAPTER_TYPE,
- G_PARAM_READABLE));
-
- g_object_class_install_property (object_class, PROP_UNIFORM_ROW_HEIGHT,
- g_param_spec_boolean ("uniform_row_height",
- _( "Uniform row height" ),
- _( "Uniform row height" ),
- FALSE,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_ALWAYS_SEARCH,
- g_param_spec_boolean ("always_search",
- _( "Always search" ),
- _( "Always search" ),
- FALSE,
- G_PARAM_READWRITE));
-}
-
-E_MAKE_TYPE(e_tree, "ETree", ETree, e_tree_class_init, e_tree_init, PARENT_TYPE)
diff --git a/widgets/table/e-tree.h b/widgets/table/e-tree.h
deleted file mode 100644
index 21a755fb3a..0000000000
--- a/widgets/table/e-tree.h
+++ /dev/null
@@ -1,310 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-tree.h
- * Copyright 2000, 2001, Ximian, Inc.
- *
- * Authors:
- * Chris Lahey <clahey@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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.
- */
-
-#ifndef _E_TREE_H_
-#define _E_TREE_H_
-
-#include <gtk/gtkdnd.h>
-#include <gtk/gtktable.h>
-#include <libxml/tree.h>
-#include <libgnomecanvas/gnome-canvas.h>
-#include <gal/widgets/e-printable.h>
-
-#include <gal/e-table/e-table-extras.h>
-#include <gal/e-table/e-table-specification.h>
-#include <gal/e-table/e-table-state.h>
-#include <gal/e-table/e-tree-model.h>
-#include <gal/e-table/e-tree-table-adapter.h>
-
-#define E_TREE_USE_TREE_SELECTION
-
-#ifdef E_TREE_USE_TREE_SELECTION
-#include <gal/e-table/e-tree-selection-model.h>
-#endif
-
-G_BEGIN_DECLS
-
-#define E_TREE_TYPE (e_tree_get_type ())
-#define E_TREE(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), E_TREE_TYPE, ETree))
-#define E_TREE_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), E_TREE_TYPE, ETreeClass))
-#define E_IS_TREE(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), E_TREE_TYPE))
-#define E_IS_TREE_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), E_TREE_TYPE))
-typedef struct _ETreeDragSourceSite ETreeDragSourceSite;
-typedef struct ETreePriv ETreePriv;
-
-typedef struct {
- GtkTable parent;
-
- ETreePriv *priv;
-} ETree;
-
-typedef struct {
- GtkTableClass parent_class;
-
- void (*cursor_change) (ETree *et, int row, ETreePath path);
- void (*cursor_activated) (ETree *et, int row, ETreePath path);
- void (*selection_change) (ETree *et);
- void (*double_click) (ETree *et, int row, ETreePath path, int col, GdkEvent *event);
- gint (*right_click) (ETree *et, int row, ETreePath path, int col, GdkEvent *event);
- gint (*click) (ETree *et, int row, ETreePath path, int col, GdkEvent *event);
- gint (*key_press) (ETree *et, int row, ETreePath path, int col, GdkEvent *event);
- gint (*start_drag) (ETree *et, int row, ETreePath path, int col, GdkEvent *event);
- gint (*state_change) (ETree *et);
- gint (*white_space_event) (ETree *et, GdkEvent *event);
-
- void (*set_scroll_adjustments) (ETree *tree,
- GtkAdjustment *hadjustment,
- GtkAdjustment *vadjustment);
-
- /* Source side drag signals */
- void (* tree_drag_begin) (ETree *tree,
- int row,
- ETreePath path,
- int col,
- GdkDragContext *context);
- void (* tree_drag_end) (ETree *tree,
- int row,
- ETreePath path,
- int col,
- GdkDragContext *context);
- void (* tree_drag_data_get) (ETree *tree,
- int row,
- ETreePath path,
- int col,
- GdkDragContext *context,
- GtkSelectionData *selection_data,
- guint info,
- guint time);
- void (* tree_drag_data_delete) (ETree *tree,
- int row,
- ETreePath path,
- int col,
- GdkDragContext *context);
-
- /* Target side drag signals */
- void (* tree_drag_leave) (ETree *tree,
- int row,
- ETreePath path,
- int col,
- GdkDragContext *context,
- guint time);
- gboolean (* tree_drag_motion) (ETree *tree,
- int row,
- ETreePath path,
- int col,
- GdkDragContext *context,
- gint x,
- gint y,
- guint time);
- gboolean (* tree_drag_drop) (ETree *tree,
- int row,
- ETreePath path,
- int col,
- GdkDragContext *context,
- gint x,
- gint y,
- guint time);
- void (* tree_drag_data_received) (ETree *tree,
- int row,
- ETreePath path,
- int col,
- GdkDragContext *context,
- gint x,
- gint y,
- GtkSelectionData *selection_data,
- guint info,
- guint time);
-} ETreeClass;
-
-GType e_tree_get_type (void);
-ETree *e_tree_construct (ETree *e_tree,
- ETreeModel *etm,
- ETableExtras *ete,
- const char *spec,
- const char *state);
-GtkWidget *e_tree_new (ETreeModel *etm,
- ETableExtras *ete,
- const char *spec,
- const char *state);
-
-/* Create an ETree using files. */
-ETree *e_tree_construct_from_spec_file (ETree *e_tree,
- ETreeModel *etm,
- ETableExtras *ete,
- const char *spec_fn,
- const char *state_fn);
-GtkWidget *e_tree_new_from_spec_file (ETreeModel *etm,
- ETableExtras *ete,
- const char *spec_fn,
- const char *state_fn);
-
-/* To save the state */
-gchar *e_tree_get_state (ETree *e_tree);
-void e_tree_save_state (ETree *e_tree,
- const gchar *filename);
-ETableState *e_tree_get_state_object (ETree *e_tree);
-ETableSpecification *e_tree_get_spec (ETree *e_tree);
-
-/* note that it is more efficient to provide the state at creation time */
-void e_tree_set_search_column (ETree *e_tree,
- gint col);
-void e_tree_set_state (ETree *e_tree,
- const gchar *state);
-void e_tree_set_state_object (ETree *e_tree,
- ETableState *state);
-void e_tree_load_state (ETree *e_tree,
- const gchar *filename);
-void e_tree_set_cursor (ETree *e_tree,
- ETreePath path);
-
-/* NULL means we don't have the cursor. */
-ETreePath e_tree_get_cursor (ETree *e_tree);
-void e_tree_selected_row_foreach (ETree *e_tree,
- EForeachFunc callback,
- gpointer closure);
-#ifdef E_TREE_USE_TREE_SELECTION
-void e_tree_selected_path_foreach (ETree *e_tree,
- ETreeForeachFunc callback,
- gpointer closure);
-void e_tree_path_foreach (ETree *e_tree,
- ETreeForeachFunc callback,
- gpointer closure);
-#endif
-gint e_tree_selected_count (ETree *e_tree);
-EPrintable *e_tree_get_printable (ETree *e_tree);
-gint e_tree_get_next_row (ETree *e_tree,
- gint model_row);
-gint e_tree_get_prev_row (ETree *e_tree,
- gint model_row);
-gint e_tree_model_to_view_row (ETree *e_tree,
- gint model_row);
-gint e_tree_view_to_model_row (ETree *e_tree,
- gint view_row);
-void e_tree_get_cell_at (ETree *tree,
- int x,
- int y,
- int *row_return,
- int *col_return);
-void e_tree_get_cell_geometry (ETree *tree,
- int row,
- int col,
- int *x_return,
- int *y_return,
- int *width_return,
- int *height_return);
-
-/* Useful accessors */
-ETreeModel * e_tree_get_model (ETree *et);
-ESelectionModel *e_tree_get_selection_model (ETree *et);
-ETreeTableAdapter *e_tree_get_table_adapter (ETree *et);
-
-/* Drag & drop stuff. */
-/* Target */
-void e_tree_drag_get_data (ETree *tree,
- int row,
- int col,
- GdkDragContext *context,
- GdkAtom target,
- guint32 time);
-void e_tree_drag_highlight (ETree *tree,
- int row,
- int col); /* col == -1 to highlight entire row. */
-void e_tree_drag_unhighlight (ETree *tree);
-void e_tree_drag_dest_set (ETree *tree,
- GtkDestDefaults flags,
- const GtkTargetEntry *targets,
- gint n_targets,
- GdkDragAction actions);
-void e_tree_drag_dest_set_proxy (ETree *tree,
- GdkWindow *proxy_window,
- GdkDragProtocol protocol,
- gboolean use_coordinates);
-
-/* There probably should be functions for setting the targets
- * as a GtkTargetList
- */
-void e_tree_drag_dest_unset (GtkWidget *widget);
-
-/* Source side */
-void e_tree_drag_source_set (ETree *tree,
- GdkModifierType start_button_mask,
- const GtkTargetEntry *targets,
- gint n_targets,
- GdkDragAction actions);
-void e_tree_drag_source_unset (ETree *tree);
-
-/* There probably should be functions for setting the targets
- * as a GtkTargetList
- */
-GdkDragContext *e_tree_drag_begin (ETree *tree,
- int row,
- int col,
- GtkTargetList *targets,
- GdkDragAction actions,
- gint button,
- GdkEvent *event);
-
-/* Adapter functions */
-gboolean e_tree_node_is_expanded (ETree *et,
- ETreePath path);
-void e_tree_node_set_expanded (ETree *et,
- ETreePath path,
- gboolean expanded);
-void e_tree_node_set_expanded_recurse (ETree *et,
- ETreePath path,
- gboolean expanded);
-void e_tree_root_node_set_visible (ETree *et,
- gboolean visible);
-ETreePath e_tree_node_at_row (ETree *et,
- int row);
-int e_tree_row_of_node (ETree *et,
- ETreePath path);
-gboolean e_tree_root_node_is_visible (ETree *et);
-void e_tree_show_node (ETree *et,
- ETreePath path);
-void e_tree_save_expanded_state (ETree *et,
- char *filename);
-void e_tree_load_expanded_state (ETree *et,
- char *filename);
-int e_tree_row_count (ETree *et);
-GtkWidget *e_tree_get_tooltip (ETree *et);
-
-typedef enum {
- E_TREE_FIND_NEXT_BACKWARD = 0,
- E_TREE_FIND_NEXT_FORWARD = 1 << 0,
- E_TREE_FIND_NEXT_WRAP = 1 << 1
-} ETreeFindNextParams;
-
-gboolean e_tree_find_next (ETree *et,
- ETreeFindNextParams params,
- ETreePathFunc func,
- gpointer data);
-
-/* This function is only needed in single_selection_mode. */
-void e_tree_right_click_up (ETree *et);
-
-
-G_END_DECLS
-
-#endif /* _E_TREE_H_ */
-
diff --git a/widgets/table/image1.png b/widgets/table/image1.png
deleted file mode 100644
index 8326ac241f..0000000000
--- a/widgets/table/image1.png
+++ /dev/null
Binary files differ
diff --git a/widgets/table/image2.png b/widgets/table/image2.png
deleted file mode 100644
index e6a4c75dbe..0000000000
--- a/widgets/table/image2.png
+++ /dev/null
Binary files differ
diff --git a/widgets/table/image3.png b/widgets/table/image3.png
deleted file mode 100644
index 50e16e8620..0000000000
--- a/widgets/table/image3.png
+++ /dev/null
Binary files differ
diff --git a/widgets/table/remove-col.xpm b/widgets/table/remove-col.xpm
deleted file mode 100644
index ff1024f0c9..0000000000
--- a/widgets/table/remove-col.xpm
+++ /dev/null
@@ -1,22 +0,0 @@
-/* XPM */
-static char * remove_col_xpm[] = {
-"16 16 3 1",
-" c None",
-". c #000000",
-"+ c #FF0000",
-"... ...",
-".++. .++.",
-".+++. .+++.",
-" .+++. .+++. ",
-" .+++. .+++. ",
-" .+++..+++. ",
-" .++++++. ",
-" .++++. ",
-" .++++. ",
-" .++++++. ",
-" .+++..+++. ",
-" .+++. .+++. ",
-" .+++. .+++. ",
-".+++. .+++.",
-".++. .++.",
-"... ..."};
diff --git a/widgets/table/sample.table b/widgets/table/sample.table
deleted file mode 100644
index e1909a2bf7..0000000000
--- a/widgets/table/sample.table
+++ /dev/null
@@ -1,45 +0,0 @@
-Col1 Col2 Address Title Dorks
-c1.a c2.a a.a tit-1 DorkA
-c1.b c2.b a.b tit-2 DDork
-c1.c c2.c a.c tit-1 DorkB
-c1.d c2.d a.d tit-2 ADork
-c1.e c2.e a.e tit-1 DorkC
-c1.f c2.f a.f tit-2 UDork
-c1.g c2.g a.g tit-3 Dork---
-j k k tit-1 DorkA
-aaa1 bbb ccc ddd eee
-aaa2 bbb ccc ddd eee
-aaa3 bbb ccc ddd eee
-aaa4 bbb ccc ddd eee
-aaa5 bbb ccc ddd eee
-aaa6 bbb ccc ddd eee
-aaa7 bbb ccc ddd eee
-aaa8 bbb ccc ddd eee
-aaa9 bbb ccc ddd eee
-aaa10 bbb ccc ddd eee
-aaa11 bbb ccc ddd eee
-aaa12 bbb ccc ddd eee
-aaa13 bbb ccc ddd eee
-aaa14 bbb ccc ddd eee
-aaa15 bbb ccc ddd eee
-aaa16 bbb ccc ddd eee
-aaa17 bbb ccc ddd eee
-aaa18 bbb ccc ddd eee
-aaa19 bbb ccc ddd eee
-aaa20 bbb ccc ddd eee
-aaa21 bbb ccc ddd eee
-aaa22 bbb ccc ddd eee
-aaa23 bbb ccc ddd eee
-aaa24 bbb ccc ddd eee
-aaa25 bbb ccc ddd eee
-aaa26 bbb ccc ddd eee
-aaa27 bbb ccc ddd eee
-aaa28 bbb ccc ddd eee
-aaa29 bbb ccc ddd eee
-aaa30 bbb ccc ddd eee
-aaa31 bbb ccc ddd eee
-aaa32 bbb ccc ddd eee
-aaa33 bbb ccc ddd eee
-aaa34 bbb ccc ddd eee
-aaa35 bbb ccc ddd eee
-aaa36 bbb ccc ddd eee
diff --git a/widgets/table/spec.xml b/widgets/table/spec.xml
deleted file mode 100644
index a8e524484c..0000000000
--- a/widgets/table/spec.xml
+++ /dev/null
@@ -1,21 +0,0 @@
-<ETableSpecification no-headers="false" click-to-add="false"
- draw-grid="true" cursor-mode="simple"
- _click-to-add-message="">
- <ETableColumn model_col="0" _title="Email" expansion="1.0" minimum_width="20" resizable="true" cell="cell_left_just" compare="string"/>
- <ETableColumn model_col="1" _title="Full Name" expansion="1.0" minimum_width="20" resizable="true" cell="cell_left_just" compare="string"/>
- <ETableColumn model_col="2" _title="Address" expansion="1.0" minimum_width="20" resizable="true" cell="cell_left_just" compare="string"/>
- <ETableColumn model_col="3" _title="Phone" expansion="1.0" minimum_width="20" resizable="true" cell="cell_left_just" compare="string"/>
- <ETableState>
- <column source="0"/>
- <column source="3"/>
- <column source="1"/>
- <column source="2"/>
- <grouping>
- <group column="2" ascending="true">
- <leaf column="1" ascending="true"/>
- </group>
- </grouping>
- <!-- Column that's been added by hand. Not implemented yet.
- <ETableColumn model_col="custom-string" _title="Custom" expansion="1.0" minimum_widgth="20" resizable="true" cell="string" compare="string"/> -->
- </ETableState>
-</ETableSpecification>
diff --git a/widgets/table/table-test.c b/widgets/table/table-test.c
deleted file mode 100644
index fe211e9d21..0000000000
--- a/widgets/table/table-test.c
+++ /dev/null
@@ -1,62 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * table-test.c
- * Copyright 1999, 2000, 2001, Ximian, Inc.
- *
- * Authors:
- * Miguel de Icaza (miguel@gnu.org)
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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 <stdio.h>
-#include <string.h>
-#include <fcntl.h>
-#include <gnome.h>
-#include "gal/widgets/e-cursors.h"
-#include "table-test.h"
-
-int
-main (int argc, char *argv [])
-{
-
- if (isatty (0)){
- int fd;
-
- close (0);
- fd = open ("sample.table", O_RDONLY);
- if (fd == -1){
- fprintf (stderr, "Could not find sample.table, try feeding a table on stdin");
- exit (1);
- }
- dup2 (fd, 0);
- }
-
- gnome_init ("TableTest", "TableTest", argc, argv);
- e_cursors_init ();
-
-
-/* table_browser_test (); */
-/* multi_cols_test (); */
-/* check_test (); */
-
- e_table_test ();
-
- gtk_main ();
-
- e_cursors_shutdown ();
- return 0;
-}
diff --git a/widgets/table/table-test.h b/widgets/table/table-test.h
deleted file mode 100644
index d0442ca64b..0000000000
--- a/widgets/table/table-test.h
+++ /dev/null
@@ -1,27 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * table-test.c
- * Copyright 2000, 2001, Ximian, Inc.
- *
- * Authors:
- * Miguel de Icaza (miguel@gnu.org)
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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.
- */
-
-void table_browser_test (void);
-void multi_cols_test (void);
-void check_test (void);
-void e_table_test (void);
diff --git a/widgets/table/test-check.c b/widgets/table/test-check.c
deleted file mode 100644
index 7fe4c126e6..0000000000
--- a/widgets/table/test-check.c
+++ /dev/null
@@ -1,221 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * test-check.c
- * Copyright 2000, 2001, Ximian, Inc.
- *
- * Authors:
- * Miguel de Icaza (miguel@gnu.org)
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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 <stdio.h>
-#include <string.h>
-#include <gnome.h>
-#include "e-table-simple.h"
-#include "e-table-header.h"
-#include "e-table-header-item.h"
-#include "e-table-item.h"
-#include "gal/widgets/e-cursors.h"
-#include "gal/widgets/e-canvas-utils.h"
-#include "gal/widgets/e-canvas.h"
-#include "gal/util/e-util.h"
-#include "e-cell-text.h"
-#include "e-cell-checkbox.h"
-
-#include "table-test.h"
-
-#define LINES 4
-
-static struct {
- int value;
- char *string;
-} my_table [LINES] = {
- { 0, "Buy food" },
- { 1, "Breathe " },
- { 0, "Cancel gdb session with shrink" },
- { 1, "Make screenshots" },
-};
-/*
- * ETableSimple callbacks
- */
-static int
-col_count (ETableModel *etc, void *data)
-{
- return 2;
-}
-
-static int
-row_count (ETableModel *etc, void *data)
-{
- return LINES;
-}
-
-static void *
-value_at (ETableModel *etc, int col, int row, void *data)
-{
- g_assert (col < 2);
- g_assert (row < LINES);
-
- if (col == 0)
- return GINT_TO_POINTER (my_table [row].value);
- else
- return my_table [row].string;
-
-}
-
-static void
-set_value_at (ETableModel *etc, int col, int row, const void *val, void *data)
-{
- g_assert (col < 2);
- g_assert (row < LINES);
-
- if (col == 0) {
- my_table [row].value = GPOINTER_TO_INT (val);
- printf ("Value at %d,%d set to %d\n", col, row, GPOINTER_TO_INT (val));
- } else {
- my_table [row].string = g_strdup (val);
- printf ("Value at %d,%d set to %s\n", col, row, (char *) val);
- }
-}
-
-static gboolean
-is_cell_editable (ETableModel *etc, int col, int row, void *data)
-{
- return TRUE;
-}
-
-static void *
-duplicate_value (ETableModel *etc, int col, const void *value, void *data)
-{
- if (col == 0) {
- return (void *) value;
- } else {
- return g_strdup (value);
- }
-}
-
-static void
-free_value (ETableModel *etc, int col, void *value, void *data)
-{
- if (col != 0) {
- g_free (value);
- }
-}
-
-static void *
-initialize_value (ETableModel *etc, int col, void *data)
-{
- if (col == 0)
- return NULL;
- else
- return g_strdup ("");
-}
-
-static gboolean
-value_is_empty (ETableModel *etc, int col, const void *value, void *data)
-{
- if (col == 0)
- return value == NULL;
- else
- return !(value && *(char *)value);
-}
-
-static char *
-value_to_string (ETableModel *etc, int col, const void *value, void *data)
-{
- if (col == 0)
- return g_strdup_printf("%d", (int) value);
- else
- return g_strdup(value);
-}
-
-static void
-set_canvas_size (GnomeCanvas *canvas, GtkAllocation *alloc)
-{
- gnome_canvas_set_scroll_region (canvas, 0, 0, alloc->width, alloc->height);
-}
-
-void
-check_test (void)
-{
- GtkWidget *canvas, *window;
- ETableModel *e_table_model;
- ETableHeader *e_table_header;
- ETableCol *col_0, *col_1;
- ECell *cell_left_just, *cell_image_check;
- GdkPixbuf *pixbuf;
- GnomeCanvasItem *item;
-
- gtk_widget_push_colormap (gdk_rgb_get_cmap ());
-
- e_table_model = e_table_simple_new (
- col_count, row_count, value_at,
- set_value_at, is_cell_editable,
- duplicate_value, free_value,
- initialize_value, value_is_empty,
- value_to_string,
- NULL);
-
- /*
- * Header
- */
- e_table_header = e_table_header_new ();
-
- cell_left_just = e_cell_text_new (e_table_model, NULL, GTK_JUSTIFY_LEFT);
-
- cell_image_check = e_cell_checkbox_new ();
- pixbuf = gdk_pixbuf_new_from_file ("clip.png");
- col_0 = e_table_col_new_with_pixbuf (0, pixbuf, 0.0, 18, cell_image_check, g_int_compare, TRUE);
- gdk_pixbuf_unref (pixbuf);
- e_table_header_add_column (e_table_header, col_0, 0);
-
- col_1 = e_table_col_new (1, "Item Name", 1.0, 20, cell_left_just, g_str_compare, TRUE);
- e_table_header_add_column (e_table_header, col_1, 1);
- e_table_col_set_arrow (col_1, E_TABLE_COL_ARROW_DOWN);
-
- /*
- * GUI
- */
- window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
- canvas = e_canvas_new ();
-
- g_signal_connect (canvas, "size_allocate",
- G_CALLBACK (set_canvas_size), NULL);
-
- gtk_container_add (GTK_CONTAINER (window), canvas);
- gtk_widget_show_all (window);
- gnome_canvas_item_new (
- gnome_canvas_root (GNOME_CANVAS (canvas)),
- e_table_header_item_get_type (),
- "ETableHeader", e_table_header,
- NULL);
-
- item = gnome_canvas_item_new (
- gnome_canvas_root (GNOME_CANVAS (canvas)),
- e_table_item_get_type (),
- "ETableHeader", e_table_header,
- "ETableModel", e_table_model,
- "drawgrid", TRUE,
- "drawfocus", TRUE,
-#if 0
- "spreadsheet", TRUE,
-#endif
- "cursor_mode", E_TABLE_CURSOR_SIMPLE,
- NULL);
- e_canvas_item_move_absolute (item, 0, 30);
-}
-
diff --git a/widgets/table/test-cols.c b/widgets/table/test-cols.c
deleted file mode 100644
index e4873633e5..0000000000
--- a/widgets/table/test-cols.c
+++ /dev/null
@@ -1,265 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * test-cols.c
- * Copyright 2000, 2001, Ximian, Inc.
- *
- * Authors:
- * Miguel de Icaza (miguel@gnu.org)
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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 <stdio.h>
-#include <string.h>
-#include <gnome.h>
-#include "gal/widgets/e-canvas-utils.h"
-#include "gal/widgets/e-canvas.h"
-#include "gal/widgets/e-cursors.h"
-#include "gal/util/e-util.h"
-#include "e-table-simple.h"
-#include "e-table-header.h"
-#include "e-table-header-item.h"
-#include "e-table-item.h"
-#include "e-cell-text.h"
-#include "e-cell-toggle.h"
-
-#include "table-test.h"
-
-#define LINES 4
-
-static struct {
- int value;
- char *string;
-} my_table [LINES] = {
- { 0, "You are not" },
- { 1, "A beautiful and unique " },
- { 0, "Snowflake" },
- { 2, "You are not your wallet" },
-};
-/*
- * ETableSimple callbacks
- */
-static int
-col_count (ETableModel *etc, void *data)
-{
- return 2;
-}
-
-static int
-row_count (ETableModel *etc, void *data)
-{
- return LINES;
-}
-
-static void *
-value_at (ETableModel *etc, int col, int row, void *data)
-{
- g_assert (col < 2);
- g_assert (row < LINES);
-
- if (col == 0)
- return GINT_TO_POINTER (my_table [row].value);
- else
- return my_table [row].string;
-
-}
-
-static void
-set_value_at (ETableModel *etc, int col, int row, const void *val, void *data)
-{
- g_assert (col < 2);
- g_assert (row < LINES);
-
- if (col == 0){
- my_table [row].value = GPOINTER_TO_INT (val);
- printf ("Value at %d,%d set to %d\n", col, row, GPOINTER_TO_INT (val));
- } else {
- my_table [row].string = g_strdup (val);
- printf ("Value at %d,%d set to %s\n", col, row, (char *) val);
- }
-}
-
-static gboolean
-is_cell_editable (ETableModel *etc, int col, int row, void *data)
-{
- return TRUE;
-}
-
-static void *
-duplicate_value (ETableModel *etc, int col, const void *value, void *data)
-{
- if (col == 0){
- return (void *)value;
- } else {
- return g_strdup (value);
- }
-}
-
-static void
-free_value (ETableModel *etc, int col, void *value, void *data)
-{
- if (col != 0){
- g_free (value);
- }
-}
-
-static void *
-initialize_value (ETableModel *etc, int col, void *data)
-{
- if (col == 0)
- return NULL;
- else
- return g_strdup ("");
-}
-
-static gboolean
-value_is_empty (ETableModel *etc, int col, const void *value, void *data)
-{
- if (col == 0)
- return value == NULL;
- else
- return !(value && *(char *)value);
-}
-
-static char *
-value_to_string (ETableModel *etc, int col, const void *value, void *data)
-{
- if (col == 0)
- return g_strdup_printf("%d", (int) value);
- else
- return g_strdup(value);
-}
-
-static void
-set_canvas_size (GnomeCanvas *canvas, GtkAllocation *alloc)
-{
- gnome_canvas_set_scroll_region (canvas, 0, 0, alloc->width, alloc->height);
-}
-
-void
-multi_cols_test (void)
-{
- GtkWidget *canvas, *window;
- ETableModel *e_table_model;
- ETableHeader *e_table_header, *e_table_header_multiple;
- ETableCol *col_0, *col_1;
- ECell *cell_left_just, *cell_image_toggle;
- GnomeCanvasItem *item;
-
- gtk_widget_push_colormap (gdk_rgb_get_cmap ());
-
- e_table_model = e_table_simple_new (
- col_count, row_count, value_at,
- set_value_at, is_cell_editable,
- duplicate_value, free_value,
- initialize_value, value_is_empty,
- value_to_string,
- NULL);
-
- /*
- * Header
- */
- e_table_header = e_table_header_new ();
-
- cell_left_just = e_cell_text_new (e_table_model, NULL, GTK_JUSTIFY_LEFT);
-
- {
- GdkPixbuf **images = g_new (GdkPixbuf *, 3);
- int i;
-
- images [0] = gdk_pixbuf_new_from_file ("image1.png");
- images [1] = gdk_pixbuf_new_from_file ("image2.png");
- images [2] = gdk_pixbuf_new_from_file ("image3.png");
-
- cell_image_toggle = e_cell_toggle_new (0, 3, images);
-
- for (i = 0; i < 3; i++)
- gdk_pixbuf_unref (images [i]);
-
- g_free (images);
- }
-
- col_1 = e_table_col_new (1, "Item Name", 1.0, 20, cell_left_just, g_str_compare, TRUE);
- e_table_header_add_column (e_table_header, col_1, 0);
-
- col_0 = e_table_col_new (0, "A", 0.0, 48, cell_image_toggle, g_int_compare, TRUE);
- e_table_header_add_column (e_table_header, col_0, 1);
-
- /*
- * Second test
- */
- e_table_header_multiple = e_table_header_new ();
- e_table_header_add_column (e_table_header_multiple, col_0, 0);
- e_table_header_add_column (e_table_header_multiple, col_1, 1);
- e_table_header_add_column (e_table_header_multiple, col_1, 2);
-
- /*
- * GUI
- */
- window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
- canvas = e_canvas_new ();
-
- g_signal_connect (canvas, "size_allocate",
- G_CALLBACK (set_canvas_size), NULL);
-
- gtk_container_add (GTK_CONTAINER (window), canvas);
- gtk_widget_show_all (window);
-
- gnome_canvas_item_new (
- gnome_canvas_root (GNOME_CANVAS (canvas)),
- e_table_header_item_get_type (),
- "ETableHeader", e_table_header,
- NULL);
-
- item = gnome_canvas_item_new (
- gnome_canvas_root (GNOME_CANVAS (canvas)),
- e_table_item_get_type (),
- "ETableHeader", e_table_header,
- "ETableModel", e_table_model,
- "drawgrid", TRUE,
- "drawfocus", TRUE,
- "cursor_mode", E_TABLE_CURSOR_SIMPLE,
-#if 0
- "spreadsheet", TRUE,
-#endif
- NULL);
-
- e_canvas_item_move_absolute (item, 0, 30);
-
- gnome_canvas_item_new (
- gnome_canvas_root (GNOME_CANVAS (canvas)),
- e_table_header_item_get_type (),
- "ETableHeader", e_table_header_multiple,
- NULL);
- item = gnome_canvas_item_new (
- gnome_canvas_root (GNOME_CANVAS (canvas)),
- e_table_item_get_type (),
- "ETableHeader", e_table_header_multiple,
- "ETableModel", e_table_model,
- "drawgrid", TRUE,
- "drawfocus", TRUE,
-#if 0
- "spreadsheet", TRUE,
-#endif
- "cursor_mode", E_TABLE_CURSOR_SIMPLE,
- NULL);
- e_canvas_item_move_absolute (item, 300, 30);
-}
-
-
-
-
-
diff --git a/widgets/table/test-table.c b/widgets/table/test-table.c
deleted file mode 100644
index b44b62bf42..0000000000
--- a/widgets/table/test-table.c
+++ /dev/null
@@ -1,478 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * test-table.c
- * Copyright 2000, 2001, Ximian, Inc.
- *
- * Authors:
- * Miguel de Icaza (miguel@gnu.org)
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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 <stdio.h>
-#include <string.h>
-#include <gnome.h>
-#include "gal/widgets/e-cursors.h"
-#include "gal/widgets/e-canvas.h"
-#include "e-table-simple.h"
-#include "e-table-header.h"
-#include "e-table-header-item.h"
-#include "e-table-item.h"
-#include "e-cell-text.h"
-#include "e-table.h"
-#include "e-table-config.h"
-
-#include "table-test.h"
-
-
-
-char buffer [1024];
-char **column_labels;
-char ***table_data;
-int cols = 0;
-int lines = 0;
-int lines_alloc = 0;
-
-static void
-parse_headers (void)
-{
- char *p, *s;
- int in_value = 0, i;
-
- fgets (buffer, sizeof (buffer)-1, stdin);
-
- for (p = buffer; *p; p++){
- if (*p == ' ' || *p == '\t'){
- if (in_value){
- cols++;
- in_value = 0;
- }
- } else
- in_value = 1;
- }
- if (in_value)
- cols++;
-
- if (!cols){
- fprintf (stderr, "No columns in first row\n");
- exit (1);
- }
-
- column_labels = g_new0 (char *, cols);
-
- p = buffer;
- for (i = 0; (s = strtok (p, " \t")) != NULL; i++){
- column_labels [i] = g_strdup (s);
- if (strchr (column_labels [i], '\n'))
- *strchr (column_labels [i], '\n') = 0;
- p = NULL;
- }
-
- printf ("%d headers:\n", cols);
- for (i = 0; i < cols; i++){
- printf ("header %d: %s\n", i, column_labels [i]);
- }
-}
-
-static char **
-load_line (char *buffer, int cols)
-{
- char **line = g_new0 (char *, cols);
- char *p;
- int i;
-
- for (i = 0; i < cols; i++){
- p = strtok (buffer, " \t\n");
- if (p == NULL){
- for (; i < cols; i++)
- line [i] = g_strdup ("");
- return line;
- } else
- line [i] = g_strdup (p);
- buffer = NULL;
- }
- return line;
-}
-
-static void
-append_line (char **line)
-{
- if (lines <= lines_alloc){
- lines_alloc = lines + 50;
- table_data = g_renew (char **, table_data, lines_alloc);
- }
- table_data [lines] = line;
- lines++;
-}
-
-static void
-load_data (void)
-{
- int i;
-
- {
- static int loaded;
-
- if (loaded)
- return;
-
- loaded = TRUE;
- }
-
-
- parse_headers ();
-
- while (fgets (buffer, sizeof (buffer)-1, stdin) != NULL){
- char **line;
-
- if (buffer [0] == '\n')
- continue;
- line = load_line (buffer, cols);
- append_line (line);
- }
-
- for (i = 0; i < lines; i++){
- int j;
-
- printf ("Line %d: ", i);
- for (j = 0; j < cols; j++)
- printf ("[%s] ", table_data [i][j]);
- printf ("\n");
- }
-}
-
-/*
- * ETableSimple callbacks
- */
-static int
-col_count (ETableModel *etc, void *data)
-{
- return cols;
-}
-
-static int
-row_count (ETableModel *etc, void *data)
-{
- return lines;
-}
-
-static void
-append_row (ETableModel *etm, ETableModel *model, int row, void *data)
-{
- abort ();
-}
-
-static void *
-value_at (ETableModel *etc, int col, int row, void *data)
-{
- g_assert (col < cols);
- g_assert (row < lines);
-
- fprintf (stderr, "value_at[%d,%d]\n", col, row);
-
- return (void *) table_data [row][col];
-}
-
-static void
-set_value_at (ETableModel *etc, int col, int row, const void *val, void *data)
-{
- g_assert (col < cols);
- g_assert (row < lines);
-
- g_free (table_data [row][col]);
- table_data [row][col] = g_strdup (val);
-
- printf ("Value at %d,%d set to %s\n", col, row, (char *) val);
-}
-
-static gboolean
-is_cell_editable (ETableModel *etc, int col, int row, void *data)
-{
- return TRUE;
-}
-
-static gboolean
-has_save_id (ETableModel *etm, void *data)
-{
- return FALSE;
-}
-
-static char *
-get_save_id (ETableModel *etm, int row, void *data)
-{
- abort ();
-}
-
-static void *
-duplicate_value (ETableModel *etc, int col, const void *value, void *data)
-{
- return g_strdup (value);
-}
-
-static void
-free_value (ETableModel *etc, int col, void *value, void *data)
-{
- g_free (value);
-}
-
-static void *
-initialize_value (ETableModel *etc, int col, void *data)
-{
- return g_strdup ("");
-}
-
-static gboolean
-value_is_empty (ETableModel *etc, int col, const void *value, void *data)
-{
- return !(value && *(char *)value);
-}
-
-static char *
-value_to_string (ETableModel *etc, int col, const void *value, void *data)
-{
- return g_strdup(value);
-}
-
-#ifdef BIT_ROT
-static void
-set_canvas_size (GnomeCanvas *canvas, GtkAllocation *alloc)
-{
- gnome_canvas_set_scroll_region (canvas, 0, 0, alloc->width, alloc->height);
-}
-
-void
-table_browser_test (void)
-{
- GtkWidget *canvas, *window;
- ETableModel *e_table_model;
- ETableHeader *e_table_header;
- ECell *cell_left_just;
- GnomeCanvasItem *group;
- int i;
- int priority = 20;
-
- load_data ();
-
- /*
- * Data model
- */
- e_table_model = e_table_simple_new (
- col_count, row_count, append_row,
-
- value_at, set_value_at, is_cell_editable,
-
- has_save_id, get_save_id,
-
- duplicate_value, free_value,
- initialize_value, value_is_empty,
- value_to_string,
- NULL);
-
- /*
- * Header
- */
- e_table_header = e_table_header_new ();
- cell_left_just = e_cell_text_new (NULL, GTK_JUSTIFY_LEFT);
-
- for (i = 0; i < cols; i++){
- ETableCol *ecol = e_table_col_new (
- i, column_labels [i],
- 1.0, 20, cell_left_just,
- g_str_compare, TRUE,
- priority);
-
- e_table_header_add_column (e_table_header, ecol, i);
- }
-
- /*
- * Setup GUI
- */
- window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
- canvas = e_canvas_new ();
-
- g_signal_connect (canvas, "size_allocate",
- G_CALLBACK (set_canvas_size), NULL);
-
- gtk_container_add (GTK_CONTAINER (window), canvas);
- gtk_widget_show_all (window);
- gnome_canvas_item_new (
- gnome_canvas_root (GNOME_CANVAS (canvas)),
- e_table_header_item_get_type (),
- "ETableHeader", e_table_header,
- NULL);
-
- group = gnome_canvas_item_new (
- gnome_canvas_root (GNOME_CANVAS (canvas)),
- gnome_canvas_group_get_type (),
- "x", 30.0,
- "y", 30.0,
- NULL);
-
- gnome_canvas_item_new (
- GNOME_CANVAS_GROUP (group),
- e_table_item_get_type (),
- "ETableHeader", e_table_header,
- "ETableModel", e_table_model,
- "drawgrid", TRUE,
- "drawfocus", TRUE,
-#if 0
- "spreadsheet", TRUE,
-#endif
- NULL);
-}
-#endif
-
-static void
-save_spec (GtkWidget *button, ETable *e_table)
-{
-#ifdef BIT_ROT
- e_table_save_specification (e_table, "e-table-test.xml");
-#endif
-}
-
-#ifdef BIT_ROT
-static void
-row_selection_test (ETable *table, int row, gboolean selected)
-{
- if (selected)
- g_print ("Row %d selected\n", row);
- else
- g_print ("Row %d unselected\n", row);
-}
-#endif
-
-static void
-toggle_grid (void *nothing, ETable *etable)
-{
- static gboolean shown;
-
- g_object_get (etable, "drawgrid", &shown, NULL);
- g_object_set (etable, "drawgrid", !shown, NULL);
-}
-
-static void
-do_e_table_demo (const char *state)
-{
- GtkWidget *e_table, *window, *frame, *vbox, *button, *bhide;
- ECell *cell_left_just;
- ETableHeader *full_header;
- int i;
- GString *spec;
-
- /*
- * Data model
- */
- static ETableModel *e_table_model = NULL;
-
- if (e_table_model == NULL)
- e_table_model =
- e_table_simple_new (col_count, row_count, append_row,
- value_at, set_value_at, is_cell_editable,
- has_save_id, get_save_id,
- duplicate_value, free_value,
- initialize_value, value_is_empty,
- value_to_string,
- NULL);
-
- full_header = e_table_header_new ();
- cell_left_just = e_cell_text_new (NULL, GTK_JUSTIFY_LEFT);
-
- spec = g_string_new ("\
-<ETableSpecification \
-cursor-mode=\"line\" \
-selection-mode=\"browse\" \
-draw-focus=\"true\">");
- for (i = 0; i < cols; i++) {
- char *colspec =
- g_strdup_printf ("\
- <ETableColumn model_col=\"%d\" \
-_title=\"%s\" \
-minimum_width=\"20\" \
-resizable=\"true\" \
-cell=\"string\" \
-compare=\"string\"/>\n", i, column_labels[i]);
- g_string_append (spec, colspec);
- g_free (colspec);
- }
- g_string_append (spec, "</ETableSpecification>");
- e_table = e_table_new (e_table_model, NULL, spec->str, state);
-
- /* This makes value_at not called just to determine row height. */
- g_object_set (e_table,
- "uniform_row_height", 1,
- NULL);
-
- g_string_free (spec, TRUE);
-
- window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
- frame = gtk_frame_new (NULL);
-#ifdef BIT_ROT
- g_signal_connect (e_table, "row_selection",
- G_CALLBACK(row_selection_test), NULL);
-#endif
-
- vbox = gtk_vbox_new (FALSE, 0);
- gtk_box_pack_start (GTK_BOX (vbox), e_table, TRUE, TRUE, 0);
- gtk_container_add (GTK_CONTAINER (frame), vbox);
- gtk_container_add (GTK_CONTAINER (window), frame);
-
-#if 0
- /*
- * gadgets
- */
- button = gtk_button_new_with_label ("Save spec");
- g_signal_connect (button, "clicked",
- G_CALLBACK (save_spec), e_table);
- gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0);
-
- bhide = gtk_button_new_with_label ("Toggle Grid");
- g_signal_connect (bhide, "clicked",
- G_CALLBACk (toggle_grid), e_table);
- gtk_box_pack_start (GTK_BOX (vbox), bhide, FALSE, FALSE, 0);
-#endif
-
- gtk_widget_set_usize (window, 400, 200);
- gtk_widget_show_all (window);
-
-#ifdef BIT_ROT
- if (getenv ("TEST")){
- e_table_do_gui_config (NULL, E_TABLE(e_table));
- }
-#endif
-}
-
-void
-e_table_test (void)
-{
- load_data ();
-
- if (1){/*getenv ("DO")){*/
- do_e_table_demo ("\
-<ETableState>\n\
- <column source=\"0\"/>\n\
- <column source=\"1\"/>\n\
- <column source=\"2\"/>\n\
- <column source=\"3\"/>\n\
- <column source=\"4\"/>\n\
- <grouping></grouping>\n\
-</ETableState>");
-#if 0
- do_e_table_demo ("<ETableSpecification> <columns-shown> <column> 0 </column> <column> 0 </column> <column> 1 </column> <column> 2 </column> <column> 3 </column> <column> 4 </column> </columns-shown> <grouping> <group column=\"3\" ascending=\"true\"> <group column=\"4\" ascending=\"false\"> <leaf column=\"2\" ascending=\"true\"/> </group> </group> </grouping> </ETableSpecification>");
- do_e_table_demo ("<ETableSpecification> <columns-shown> <column> 0 </column> <column> 1 </column> <column> 2 </column> <column> 3 </column> <column> 4 </column> </columns-shown> <grouping> <group column=\"4\" ascending=\"true\"> <leaf column=\"2\" ascending=\"true\"/> </group> </grouping> </ETableSpecification>");
- do_e_table_demo ("<ETableSpecification> <columns-shown> <column> 0 </column> <column> 1 </column> <column> 2 </column> <column> 3 </column> <column> 4 </column> </columns-shown> <grouping> <group column=\"3\" ascending=\"true\"> <leaf column=\"2\" ascending=\"true\"/> </group> </grouping> </ETableSpecification>");
-#endif
- }
-}
diff --git a/widgets/table/tree-expanded.xpm b/widgets/table/tree-expanded.xpm
deleted file mode 100644
index d9bda3694d..0000000000
--- a/widgets/table/tree-expanded.xpm
+++ /dev/null
@@ -1,23 +0,0 @@
-/* XPM */
-static char * tree_expanded_xpm[] = {
-"16 16 4 1",
-" c None",
-". c #FFFFFF",
-"* c #000000",
-"+ c #666666",
-" ",
-" ",
-" ",
-" ",
-" +++++++++ ",
-" +.......+ ",
-" +.......+ ",
-" +.......+ ",
-" +.*****.+ ",
-" +.......+ ",
-" +.......+ ",
-" +.......+ ",
-" +++++++++ ",
-" ",
-" ",
-" "};
diff --git a/widgets/table/tree-unexpanded.xpm b/widgets/table/tree-unexpanded.xpm
deleted file mode 100644
index e1b48448ba..0000000000
--- a/widgets/table/tree-unexpanded.xpm
+++ /dev/null
@@ -1,23 +0,0 @@
-/* XPM */
-static char * tree_unexpanded_xpm[] = {
-"16 16 4 1",
-" c None",
-". c #FFFFFF",
-"* c #000000",
-"+ c #666666",
-" ",
-" ",
-" ",
-" ",
-" +++++++++ ",
-" +.......+ ",
-" +...*...+ ",
-" +...*...+ ",
-" +.*****.+ ",
-" +...*...+ ",
-" +...*...+ ",
-" +.......+ ",
-" +++++++++ ",
-" ",
-" ",
-" "};
diff --git a/widgets/text/.cvsignore b/widgets/text/.cvsignore
deleted file mode 100644
index 792b9f5af2..0000000000
--- a/widgets/text/.cvsignore
+++ /dev/null
@@ -1,11 +0,0 @@
-.deps
-.libs
-.pure
-Makefile
-Makefile.in
-*.lo
-*.la
-e-text-test
-e-entry-test
-e-text-model-test
-e-completion-test \ No newline at end of file
diff --git a/widgets/text/e-completion-callbacks.c b/widgets/text/e-completion-callbacks.c
deleted file mode 100644
index 935ba7fb43..0000000000
--- a/widgets/text/e-completion-callbacks.c
+++ /dev/null
@@ -1,96 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-completion-callbacks.c - A callback based ECompletion.
- * Copyright 2003
- *
- * Authors:
- * Chris Toshok <toshok@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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 <string.h>
-#include <stdio.h>
-#include <gtk/gtk.h>
-#include "gal/util/e-util.h"
-#include "e-completion-callbacks.h"
-
-static void e_completion_callbacks_class_init (ECompletionCallbacksClass *klass);
-static void e_completion_callbacks_init (ECompletionCallbacks *complete);
-
-static void callbacks_request_completion (ECompletion *comp, const gchar *search_text, gint pos, gint limit);
-static void callbacks_end_completion (ECompletion *comp);
-
-#define PARENT_TYPE E_COMPLETION_TYPE
-static ECompletionClass *parent_class;
-
-
-
-E_MAKE_TYPE (e_completion_callbacks,
- "ECompletionCallbacks",
- ECompletionCallbacks,
- e_completion_callbacks_class_init,
- e_completion_callbacks_init,
- PARENT_TYPE)
-
-static void
-e_completion_callbacks_class_init (ECompletionCallbacksClass *klass)
-{
- ECompletionClass *comp_class = (ECompletionClass *) klass;
-
- parent_class = g_type_class_ref (PARENT_TYPE);
-
- comp_class->request_completion = callbacks_request_completion;
- comp_class->end_completion = callbacks_end_completion;
-}
-
-static void
-e_completion_callbacks_init (ECompletionCallbacks *complete)
-{
-}
-
-static void
-callbacks_request_completion (ECompletion *comp, const gchar *search_text, gint pos, gint limit)
-{
- ECompletionCallbacks *cc = E_COMPLETION_CALLBACKS (comp);
-
- cc->request_completion (cc, search_text, pos, limit, cc->data);
-}
-
-static void
-callbacks_end_completion (ECompletion *comp)
-{
- ECompletionCallbacks *cc = E_COMPLETION_CALLBACKS (comp);
-
- cc->end_completion (cc, cc->data);
-}
-
-ECompletion*
-e_completion_callbacks_new (ECompletionCallbacksRequestCompletionFn request_completion,
- ECompletionCallbacksEndCompletionFn end_completion,
- gpointer data)
-{
- ECompletionCallbacks *cc;
-
- g_return_val_if_fail (request_completion != NULL, NULL);
- g_return_val_if_fail (end_completion != NULL, NULL);
-
- cc = gtk_type_new (E_COMPLETION_CALLBACKS_TYPE);
-
- cc->request_completion = request_completion;
- cc->end_completion = end_completion;
- cc->data = data;
-}
diff --git a/widgets/text/e-completion-callbacks.h b/widgets/text/e-completion-callbacks.h
deleted file mode 100644
index 57df9cd3e5..0000000000
--- a/widgets/text/e-completion-callbacks.h
+++ /dev/null
@@ -1,68 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-completion-callback.h - A callback based completion object.
- * Copyright 2003, Ximian, Inc.
- *
- * Authors:
- * Chris Toshok <toshok@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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.
- */
-
-#ifndef E_COMPLETION_CALLBACKS_H
-#define E_COMPLETION_CALLBACKS_H
-
-#include <gtk/gtkobject.h>
-#include "e-completion.h"
-
-G_BEGIN_DECLS
-
-#define E_COMPLETION_CALLBACKS_TYPE (e_completion_callbacks_get_type ())
-#define E_COMPLETION_CALLBACKS(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), E_COMPLETION_CALLBACKS_TYPE, ECompletionCallbacks))
-#define E_COMPLETION_CALLBACKS_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), E_COMPLETION_CALLBACKS_TYPE, ECompletionCallbacksClass))
-#define E_IS_COMPLETION_CALLBACKS(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), E_COMPLETION_CALLBACKS_TYPE))
-#define E_IS_COMPLETION_CALLBACKS_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), E_COMPLETION_CALLBACKS_TYPE))
-
-typedef struct _ECompletionCallbacks ECompletionCallbacks;
-typedef struct _ECompletionCallbacksClass ECompletionCallbacksClass;
-struct _ECompletionCallbacksPrivate;
-
-typedef void (*ECompletionCallbacksRequestCompletionFn) (ECompletionCallbacks *comp, const gchar *search_text, gint pos, gint limit, gpointer data);
-typedef void (*ECompletionCallbacksEndCompletionFn) (ECompletionCallbacks *comp, gpointer data);
-
-struct _ECompletionCallbacks {
- ECompletion parent;
-
- ECompletionCallbacksRequestCompletionFn request_completion;
- ECompletionCallbacksEndCompletionFn end_completion;
-
- gpointer data;
-};
-
-struct _ECompletionCallbacksClass {
- ECompletionClass parent_class;
-};
-
-GtkType e_completion_callbacks_get_type (void);
-
-ECompletion* e_completion_callbacks_new (ECompletionCallbacksRequestCompletionFn request_completion,
- ECompletionCallbacksEndCompletionFn end_completion,
- gpointer data);
-
-G_END_DECLS
-
-
-#endif /* E_COMPLETION_CALLBACKS_H */
-
diff --git a/widgets/text/e-completion-match.c b/widgets/text/e-completion-match.c
deleted file mode 100644
index d13ba15973..0000000000
--- a/widgets/text/e-completion-match.c
+++ /dev/null
@@ -1,184 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-completion-match.c
- * Copyright 2000, 2001, Ximian, Inc.
- *
- * Authors:
- * Jon Trowbridge <trow@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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 <string.h>
-#include <gal/widgets/e-unicode.h>
-#include "e-completion-match.h"
-
-static void
-e_completion_match_destroy (ECompletionMatch *match)
-{
- if (match) {
- g_free (match->match_text);
- g_free (match->menu_text);
- if (match->destroy)
- match->destroy (match);
- g_free (match);
- }
-}
-
-void
-e_completion_match_construct (ECompletionMatch *match)
-{
- g_return_if_fail (match != NULL);
-
- match->match_text = NULL;
- match->menu_text = NULL;
- match->score = 0;
- match->sort_major = 0;
- match->sort_minor = 0;
- match->user_data = NULL;
- match->ref = 1;
- match->destroy = NULL;
-}
-
-void
-e_completion_match_ref (ECompletionMatch *match)
-{
- g_return_if_fail (match != NULL);
- g_return_if_fail (match->ref > 0);
-
- ++match->ref;
-}
-
-void
-e_completion_match_unref (ECompletionMatch *match)
-{
- if (match) {
- g_return_if_fail (match->ref > 0);
-
- --match->ref;
- if (match->ref == 0) {
- e_completion_match_destroy (match);
- }
- }
-}
-
-void
-e_completion_match_set_text (ECompletionMatch *match,
- const gchar *match_text,
- const gchar *menu_text)
-{
- g_return_if_fail (match != NULL);
-
- /* We silently drop any entries w/ invalid utf8.
- This is not optimal behavior. */
-
- if (match_text && ! g_utf8_validate (match_text, -1, NULL)) {
- match_text = NULL;
- }
-
- if (menu_text && ! g_utf8_validate (menu_text, -1, NULL)) {
- menu_text = NULL;
- }
-
- if (match->match_text && match->match_text != match_text) {
- g_free (match->match_text);
- }
- match->match_text = g_strdup (match_text);
-
- if (match->menu_text && match->menu_text != menu_text) {
- g_free (match->menu_text);
- }
- match->menu_text = g_strdup (menu_text);
-}
-
-const gchar *
-e_completion_match_get_match_text (ECompletionMatch *match)
-{
- g_return_val_if_fail (match != NULL, NULL);
- return match->match_text;
-}
-
-const gchar *
-e_completion_match_get_menu_text (ECompletionMatch *match)
-{
- g_return_val_if_fail (match != NULL, NULL);
- return match->menu_text;
-}
-
-gint
-e_completion_match_compare (const ECompletionMatch *a, const ECompletionMatch *b)
-{
- gint rv;
-
- /* Deal with NULL arguments. */
- if (!(a || b)) {
- if (!(a && b))
- return 0;
- return a ? -1 : 1;
- }
-
- if ( (rv = (b->sort_major < a->sort_major) - (a->sort_major < b->sort_major)) )
- return rv;
-
- /* Sort the scores high->low. */
- if ( (rv = (b->score > a->score) - (a->score > b->score)) )
- return rv;
-
- if ( (rv = (b->sort_minor < a->sort_minor) - (a->sort_minor < b->sort_minor)) )
- return rv;
-
- return 0;
-}
-
-gint
-e_completion_match_compare_alpha (const ECompletionMatch *a, const ECompletionMatch *b)
-{
- gint rv, rv2;
-
- /* Deal with NULL arguments. */
- if (!(a || b)) {
- if (!(a && b))
- return 0;
- return a ? -1 : 1;
- }
-
- /* The sort_major trumps everything. */
- if ( (rv = (b->sort_major < a->sort_major) - (a->sort_major < b->sort_major)) )
- return rv;
-
- /* Sort the scores high->low. */
- if ( (rv = (b->score > a->score) - (a->score > b->score)) )
- return rv;
-
- /* When the match text is the same, we use the minor fields */
- rv2 = strcmp (a->match_text, b->match_text);
- if ( !rv2 && (rv = (b->sort_minor < a->sort_minor) - (a->sort_minor < b->sort_minor)) )
- return rv;
-
- return strcmp (a->menu_text, b->menu_text);
-}
-
-ECompletionMatch *
-e_completion_match_new (const gchar *match_text, const gchar *menu_text, double score)
-{
- ECompletionMatch *match = g_new0 (ECompletionMatch, 1);
-
- e_completion_match_construct (match);
- e_completion_match_set_text (match, match_text, menu_text);
- match->score = score;
-
- return match;
-}
diff --git a/widgets/text/e-completion-match.h b/widgets/text/e-completion-match.h
deleted file mode 100644
index 162373add4..0000000000
--- a/widgets/text/e-completion-match.h
+++ /dev/null
@@ -1,67 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-completion-match.h
- * Copyright 2000, 2001, Ximian, Inc.
- *
- * Authors:
- * Jon Trowbridge <trow@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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.
- */
-
-#ifndef __E_COMPLETION_MATCH_H__
-#define __E_COMPLETION_MATCH_H__
-
-#include <glib.h>
-#include <gtk/gtkwidget.h>
-
-G_BEGIN_DECLS
-
-typedef struct _ECompletionMatch ECompletionMatch;
-
-struct _ECompletionMatch {
- gchar *match_text; /* in utf8 */
- gchar *menu_text; /* in utf8 */
- double score;
- gint sort_major;
- gint sort_minor;
- gpointer user_data;
-
- gint ref;
- void (*destroy) (ECompletionMatch *);
-};
-
-typedef void (*ECompletionMatchFn) (ECompletionMatch *, gpointer closure);
-
-void e_completion_match_construct (ECompletionMatch *);
-void e_completion_match_ref (ECompletionMatch *);
-void e_completion_match_unref (ECompletionMatch *);
-
-void e_completion_match_set_text (ECompletionMatch *, const gchar *match_text, const gchar *label_text);
-const gchar *e_completion_match_get_match_text (ECompletionMatch *);
-const gchar *e_completion_match_get_menu_text (ECompletionMatch *);
-
-gint e_completion_match_compare (const ECompletionMatch *, const ECompletionMatch *);
-gint e_completion_match_compare_alpha (const ECompletionMatch *, const ECompletionMatch *);
-
-ECompletionMatch *e_completion_match_new (const gchar *match_text, const gchar *menu_text, double score);
-
-
-
-
-G_END_DECLS
-
-#endif /* __E_COMPLETION_MATCH_H__ */
-
diff --git a/widgets/text/e-completion-view.c b/widgets/text/e-completion-view.c
deleted file mode 100644
index f9728de60c..0000000000
--- a/widgets/text/e-completion-view.c
+++ /dev/null
@@ -1,859 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-completion-view.c - A text completion selection widget
- * Copyright 2000, 2001, Ximian, Inc.
- *
- * Authors:
- * Miguel de Icaza <miguel@ximian.com>
- * Adapted by Jon Trowbridge <trow@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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 "e-completion-view.h"
-
-#include <math.h>
-#include <gdk/gdkkeysyms.h>
-#include <gal/e-table/e-table-simple.h>
-#include <gal/e-table/e-table-scrolled.h>
-#include <gal/util/e-i18n.h>
-#include "gal/util/e-marshal.h"
-
-enum {
- E_COMPLETION_VIEW_NONEMPTY,
- E_COMPLETION_VIEW_ADDED,
- E_COMPLETION_VIEW_FULL,
- E_COMPLETION_VIEW_BROWSE,
- E_COMPLETION_VIEW_UNBROWSE,
- E_COMPLETION_VIEW_ACTIVATE,
- E_COMPLETION_VIEW_LAST_SIGNAL
-};
-
-static guint e_completion_view_signals[E_COMPLETION_VIEW_LAST_SIGNAL] = { 0 };
-
-static void e_completion_view_disconnect (ECompletionView *cv);
-static ETable *e_completion_view_table (ECompletionView *cv);
-static void e_completion_view_clear_choices (ECompletionView *cv);
-static void e_completion_view_set_cursor_row (ECompletionView *cv, gint r);
-static void e_completion_view_select (ECompletionView *cv, gint r);
-
-static gint e_completion_view_key_press_handler (GtkWidget *w, GdkEventKey *key_event, gpointer user_data);
-
-static void e_completion_view_class_init (ECompletionViewClass *klass);
-static void e_completion_view_init (ECompletionView *completion);
-static void e_completion_view_dispose (GObject *object);
-
-#define PARENT_TYPE GTK_TYPE_EVENT_BOX
-static GtkObjectClass *parent_class;
-
-
-
-static gint
-e_completion_view_local_key_press_handler (GtkWidget *w, GdkEventKey *ev)
-{
- return e_completion_view_key_press_handler (w, ev, w);
-}
-
-static void
-e_completion_view_paint (GtkWidget *widget, GdkRectangle *area)
-{
- gint i;
-
- g_return_if_fail (widget != NULL);
- g_return_if_fail (E_IS_COMPLETION_VIEW (widget));
- g_return_if_fail (area != NULL);
-
- if (!GTK_WIDGET_DRAWABLE (widget))
- return;
-
- for (i = 0; i < E_COMPLETION_VIEW (widget)->border_width; ++i) {
-
- gdk_draw_rectangle (widget->window,
- widget->style->black_gc,
- FALSE, i, i,
- widget->allocation.width-1-2*i,
- widget->allocation.height-1-2*i);
-
- }
-
-}
-
-#if 0
-static void
-e_completion_view_draw (GtkWidget *widget, GdkRectangle *area)
-{
- GtkBin *bin;
- GdkRectangle child_area;
-
- g_return_if_fail (widget != NULL);
- g_return_if_fail (E_IS_COMPLETION_VIEW (widget));
- g_return_if_fail (area != NULL);
-
- if (GTK_WIDGET_DRAWABLE (widget)) {
- bin = GTK_BIN (widget);
-
- e_completion_view_paint (widget, area);
-
- if (bin->child && gtk_widget_intersect (bin->child, area, &child_area))
- gtk_widget_draw (bin->child, &child_area);
- }
-}
-#endif
-
-static gint
-e_completion_view_expose_event (GtkWidget *widget, GdkEventExpose *event)
-{
- GtkBin *bin;
- GdkEventExpose child_event;
-
- g_return_val_if_fail (widget != NULL, FALSE);
- g_return_val_if_fail (E_IS_COMPLETION_VIEW (widget), FALSE);
- g_return_val_if_fail (event != NULL, FALSE);
-
- if (GTK_WIDGET_DRAWABLE (widget)) {
- bin = GTK_BIN (widget);
-
- e_completion_view_paint (widget, &event->area);
-
- child_event = *event;
- if (bin->child &&
- GTK_WIDGET_NO_WINDOW (bin->child) &&
- gtk_widget_intersect (bin->child, &event->area, &child_event.area))
- gtk_widget_send_expose (bin->child, (GdkEvent*) &child_event);
- }
-
- return FALSE;
-}
-
-static void
-e_completion_view_size_request (GtkWidget *widget, GtkRequisition *requisition)
-{
- GtkBin *bin;
-
- g_return_if_fail (widget != NULL);
- g_return_if_fail (E_IS_COMPLETION_VIEW (widget));
- g_return_if_fail (requisition != NULL);
-
- bin = GTK_BIN (widget);
-
- requisition->width = 2 * E_COMPLETION_VIEW (widget)->border_width;
- requisition->height = 2 * E_COMPLETION_VIEW (widget)->border_width;
-
- if (bin->child && GTK_WIDGET_VISIBLE (bin->child)) {
- GtkRequisition child_requisition;
-
- gtk_widget_size_request (bin->child, &child_requisition);
-
- requisition->width += child_requisition.width;
- requisition->height += child_requisition.height;
- }
-
- requisition->height = MAX (100, requisition->height);
-}
-
-static void
-e_completion_view_size_allocate (GtkWidget *widget, GtkAllocation *allocation)
-{
- GtkBin *bin;
- GtkAllocation child_allocation;
-
- g_return_if_fail (widget != NULL);
- g_return_if_fail (E_IS_COMPLETION_VIEW (widget));
- g_return_if_fail (allocation != NULL);
-
- bin = GTK_BIN (widget);
- widget->allocation = *allocation;
-
- child_allocation.x = E_COMPLETION_VIEW (widget)->border_width;
- child_allocation.width = MAX(0, (gint)allocation->width - child_allocation.x * 2);
-
- child_allocation.y = E_COMPLETION_VIEW (widget)->border_width;
- child_allocation.height = MAX (0, (gint)allocation->height - child_allocation.y * 2);
-
- if (GTK_WIDGET_REALIZED (widget)) {
- gdk_window_move_resize (widget->window,
- allocation->x,
- allocation->y,
- allocation->width,
- allocation->height);
- }
-
- if (bin->child) {
- gtk_widget_size_allocate (bin->child, &child_allocation);
- }
-}
-
-E_MAKE_TYPE (e_completion_view,
- "ECompletionView",
- ECompletionView,
- e_completion_view_class_init,
- e_completion_view_init,
- PARENT_TYPE)
-
-static void
-e_completion_view_class_init (ECompletionViewClass *klass)
-{
- GObjectClass *object_class = (GObjectClass *) klass;
- GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
-
- parent_class = g_type_class_ref (PARENT_TYPE);
-
- e_completion_view_signals[E_COMPLETION_VIEW_NONEMPTY] =
- g_signal_new ("nonempty",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (ECompletionViewClass, nonempty),
- NULL, NULL,
- e_marshal_NONE__NONE,
- G_TYPE_NONE, 0);
-
- e_completion_view_signals[E_COMPLETION_VIEW_ADDED] =
- g_signal_new ("added",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (ECompletionViewClass, added),
- NULL, NULL,
- e_marshal_NONE__NONE,
- G_TYPE_NONE, 0);
-
- e_completion_view_signals[E_COMPLETION_VIEW_FULL] =
- g_signal_new ("full",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (ECompletionViewClass, full),
- NULL, NULL,
- e_marshal_NONE__NONE,
- G_TYPE_NONE, 0);
-
- e_completion_view_signals[E_COMPLETION_VIEW_BROWSE] =
- g_signal_new ("browse",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (ECompletionViewClass, browse),
- NULL, NULL,
- e_marshal_NONE__POINTER,
- G_TYPE_NONE, 1,
- G_TYPE_POINTER);
-
- e_completion_view_signals[E_COMPLETION_VIEW_UNBROWSE] =
- g_signal_new ("unbrowse",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (ECompletionViewClass, unbrowse),
- NULL, NULL,
- e_marshal_NONE__NONE,
- G_TYPE_NONE, 0);
-
- e_completion_view_signals[E_COMPLETION_VIEW_ACTIVATE] =
- g_signal_new ("activate",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (ECompletionViewClass, activate),
- NULL, NULL,
- e_marshal_NONE__POINTER,
- G_TYPE_NONE, 1,
- G_TYPE_POINTER);
-
- object_class->dispose = e_completion_view_dispose;
-
- widget_class->key_press_event = e_completion_view_local_key_press_handler;
- widget_class->expose_event = e_completion_view_expose_event;
- widget_class->size_request = e_completion_view_size_request;
- widget_class->size_allocate = e_completion_view_size_allocate;
-}
-
-static void
-e_completion_view_init (ECompletionView *completion)
-{
- completion->border_width = 2;
- completion->choices = g_ptr_array_new ();
-}
-
-static void
-e_completion_view_dispose (GObject *object)
-{
- ECompletionView *cv = E_COMPLETION_VIEW (object);
-
- e_completion_view_disconnect (cv);
-
- if (cv->choices) {
- e_completion_view_clear_choices (cv);
-
- g_ptr_array_free (cv->choices, TRUE);
- cv->choices = NULL;
- }
-
- if (cv->key_widget) {
- g_signal_handler_disconnect (cv->key_widget, cv->key_signal_id);
- g_object_unref (cv->key_widget);
- cv->key_widget = NULL;
- }
-
- if (cv->completion)
- g_object_unref (cv->completion);
- cv->completion = NULL;
-
- if (G_OBJECT_CLASS (parent_class)->dispose)
- (G_OBJECT_CLASS (parent_class)->dispose) (object);
-}
-
-static void
-e_completion_view_disconnect (ECompletionView *cv)
-{
- g_return_if_fail (cv != NULL);
- g_return_if_fail (E_IS_COMPLETION_VIEW (cv));
-
- if (cv->begin_signal_id)
- g_signal_handler_disconnect (cv->completion, cv->begin_signal_id);
- if (cv->comp_signal_id)
- g_signal_handler_disconnect (cv->completion, cv->comp_signal_id);
- if (cv->end_signal_id)
- g_signal_handler_disconnect (cv->completion, cv->end_signal_id);
-
- cv->begin_signal_id = 0;
- cv->comp_signal_id = 0;
- cv->end_signal_id = 0;
-}
-
-static ETable *
-e_completion_view_table (ECompletionView *cv)
-{
- return e_table_scrolled_get_table (E_TABLE_SCROLLED (cv->table));
-}
-
-static void
-e_completion_view_clear_choices (ECompletionView *cv)
-{
- ECompletionMatch *match;
- GPtrArray *m;
- int i;
-
- g_return_if_fail (E_IS_COMPLETION_VIEW (cv));
-
- m = cv->choices;
- for (i = 0; i < m->len; i++) {
- match = g_ptr_array_index (m, i);
- e_completion_match_unref (match);
- }
- g_ptr_array_set_size (m, 0);
-}
-
-static void
-e_completion_view_set_cursor_row (ECompletionView *cv, gint r)
-{
- ETable *table;
- GtkAdjustment *adj;
- gint x, y1, y2, r1, r2, c;
- double fracline;
- gint iteration_count=0;
-
- g_return_if_fail (cv != NULL);
- g_return_if_fail (E_IS_COMPLETION_VIEW (cv));
-#ifndef G_DISABLE_CHECKS
- /* choices->len is unsigned, but it is reasonable for r to be
- * < 0 */
- if (r > 0) {
- g_return_if_fail (r < cv->choices->len);
- }
-#endif
-
- adj = gtk_scrolled_window_get_vadjustment (GTK_SCROLLED_WINDOW (cv->table));
-
- table = e_completion_view_table (cv);
-
- if (r < 0) {
- e_selection_model_clear (E_SELECTION_MODEL(table->selection));
-
- /* Move back to the top when we clear the selection */
- gtk_adjustment_set_value (adj, adj->lower);
- return;
- }
-
- e_table_set_cursor_row (table, r);
-
- /* OK, now the tricky bit. We try to insure that this row is
- visible. */
-
- /* If we are selecting the first or last row, then it is easy. We just
- cram the vadjustment all the way up/down. */
- if (r == 0) {
- gtk_adjustment_set_value (adj, adj->lower);
- return;
- } else if (r == cv->choices->len - 1) {
- gtk_adjustment_set_value (adj, adj->upper - adj->page_size);
- return;
- }
-
- fracline = ((adj->upper - adj->lower - adj->page_size) / (gint)cv->choices->len) / 4;
-
- while (iteration_count < 100) {
- x = GTK_LAYOUT(table->table_canvas)->hadjustment->value;
- y1 = GTK_LAYOUT(table->table_canvas)->vadjustment->value;
-
- y2 = y1 + cv->table->allocation.height;
-
- e_table_group_compute_location (e_completion_view_table (cv)->group, &x, &y1, &r1, &c);
- e_table_group_compute_location (e_completion_view_table (cv)->group, &x, &y2, &r2, &c);
-
- if (r <= r1) {
- gtk_adjustment_set_value (adj, adj->value - fracline);
- } else if (r >= r2) {
- gtk_adjustment_set_value (adj, adj->value + fracline);
- } else
- return;
-
- ++iteration_count;
- }
-
- g_assert_not_reached ();
-}
-
-static void
-e_completion_view_select (ECompletionView *cv, gint r)
-{
- ECompletionMatch *match;
-
- match = g_ptr_array_index (cv->choices, r);
-
- cv->selection = r;
- e_completion_view_set_cursor_row (cv, r);
- g_signal_emit (cv, e_completion_view_signals[E_COMPLETION_VIEW_ACTIVATE], 0, match);
-}
-
-static gint
-e_completion_view_key_press_handler (GtkWidget *w, GdkEventKey *key_event, gpointer user_data)
-{
- ECompletionView *cv = E_COMPLETION_VIEW (user_data);
- gint dir = 0;
- gboolean key_handled = TRUE, complete_key = FALSE, uncomplete_key = FALSE, is_space = FALSE;
-
- /* FIXME: This is totally lame.
- The ECompletionView should be able to specify multiple completion/uncompletion keys, or just
- have sensible defaults. */
-
- if ((cv->complete_key && key_event->keyval == cv->complete_key)
- || ((key_event->keyval == GDK_n || key_event->keyval == GDK_N) && (key_event->state & GDK_CONTROL_MASK)))
- complete_key = TRUE;
-
- if ((cv->uncomplete_key && key_event->keyval == cv->uncomplete_key)
- || ((key_event->keyval == GDK_p || key_event->keyval == GDK_P) && (key_event->state & GDK_CONTROL_MASK)))
- uncomplete_key = TRUE;
-
- /* Start up a completion.*/
- if (complete_key && !cv->editable) {
- g_signal_emit (cv, e_completion_view_signals[E_COMPLETION_VIEW_BROWSE], 0, NULL);
- goto stop_emission;
- }
-
- /* Stop our completion. */
- if (uncomplete_key && cv->editable && cv->selection < 0) {
- e_completion_view_set_cursor_row (cv, -1);
- g_signal_emit (cv, e_completion_view_signals[E_COMPLETION_VIEW_UNBROWSE], 0);
- goto stop_emission;
- }
-
- if (!cv->editable)
- return FALSE;
-
- switch (key_event->keyval) {
-
- case GDK_n:
- case GDK_N:
- /* We (heart) emacs: treat ctrl-n as down */
- if (! (key_event->state & GDK_CONTROL_MASK))
- return FALSE;
-
- case GDK_Down:
- case GDK_KP_Down:
- dir = 1;
- break;
-
- case GDK_p:
- case GDK_P:
- /* Treat ctrl-p as up */
- if (! (key_event->state & GDK_CONTROL_MASK))
- return FALSE;
-
- case GDK_Up:
- case GDK_KP_Up:
- dir = -1;
- break;
-
- case GDK_Tab:
- /* If our cursor is still up in the entry, move down into
- the popup. Otherwise unbrowse. */
- if (cv->choices->len > 0) {
- if (cv->selection < 0) {
- cv->selection = 0;
- dir = 0;
- } else {
- cv->selection = -1;
- dir = 0;
- key_handled = FALSE;
- }
- }
- break;
-
- case GDK_space:
- case GDK_KP_Space:
- is_space = TRUE;
-
- case GDK_Return:
- case GDK_KP_Enter:
- if (cv->selection < 0) {
- /* We don't have a selection yet, move to the first selection if there is
- more than one option. If there is only one option, select it automatically. */
-
- /* Let space pass through. */
- if (is_space)
- return FALSE;
-
- if (cv->choices->len == 1) {
- e_completion_view_select (cv, 0);
- goto stop_emission;
- } else {
- cv->selection = 0;
- dir = 0;
- }
-
- } else {
- /* Our cursor is down in the pop-up, so we make our selection. */
- e_completion_view_select (cv, cv->selection);
- goto stop_emission;
- }
- break;
-
- case GDK_Escape:
- /* Unbrowse hack */
- cv->selection = -1;
- dir = 0;
- break;
-
- default:
- return FALSE;
- }
-
- cv->selection += dir;
-
- if (cv->selection >= (int)cv->choices->len) {
- cv->selection = cv->choices->len - 1;
- /* Don't re-emit the browse signal */
- goto stop_emission;
- }
-
- e_completion_view_set_cursor_row (cv, cv->selection);
-
- if (cv->selection >= 0)
- g_signal_emit (cv, e_completion_view_signals[E_COMPLETION_VIEW_BROWSE], 0,
- g_ptr_array_index (cv->choices, cv->selection));
- else
- g_signal_emit (cv, e_completion_view_signals[E_COMPLETION_VIEW_UNBROWSE], 0);
-
- stop_emission:
-
- if (key_handled)
- g_signal_stop_emission_by_name (w, "key_press_event");
-
- return key_handled;
-}
-
-static void
-begin_completion_cb (ECompletion *completion, const gchar *txt, gint pos, gint limit, gpointer user_data)
-{
- ECompletionView *cv = E_COMPLETION_VIEW (user_data);
-
- e_table_model_pre_change (cv->model);
- e_completion_view_clear_choices (cv);
- cv->have_all_choices = FALSE;
-
- e_table_model_changed (cv->model);
-}
-
-static void
-completion_cb (ECompletion *completion, ECompletionMatch *match, gpointer user_data)
-{
- ECompletionView *cv = E_COMPLETION_VIEW (user_data);
- gint r = cv->choices->len;
- gboolean first = (cv->choices->len == 0);
-
- e_table_model_pre_change (cv->model);
-
- e_completion_match_ref (match);
- g_ptr_array_add (cv->choices, match);
-
- e_table_model_row_inserted (cv->model, r);
-
- if (first)
- g_signal_emit (cv, e_completion_view_signals[E_COMPLETION_VIEW_NONEMPTY], 0);
-
- g_signal_emit (cv, e_completion_view_signals[E_COMPLETION_VIEW_ADDED], 0);
-}
-
-static void
-end_completion_cb (ECompletion *completion, gpointer user_data)
-{
- ECompletionView *cv = E_COMPLETION_VIEW (user_data);
-
- /* Do a final refresh of the table. */
- e_table_model_pre_change (cv->model);
- e_table_model_changed (cv->model);
-
- cv->have_all_choices = TRUE;
- g_signal_emit (cv, e_completion_view_signals[E_COMPLETION_VIEW_FULL], 0);
-}
-
-/*** Table Callbacks ***/
-
-/* XXX toshok - we need to add sorting to this etable, through the use
- of undisplayed fields of all the sort keys we want to use */
-static char *simple_spec =
-"<ETableSpecification no-headers=\"true\" draw-grid=\"false\" cursor-mode=\"line\" alternating-row-colors=\"false\" gettext-domain=\"" E_I18N_DOMAIN "\">"
-" <ETableColumn model_col=\"0\" _title=\"Node\" expansion=\"1.0\" "
-" minimum_width=\"16\" resizable=\"true\" cell=\"string\" "
-" compare=\"string\"/> "
-" <ETableState> "
-" <column source=\"0\"/> "
-" <grouping></grouping> "
-" </ETableState> "
-"</ETableSpecification>";
-
-static gint
-table_col_count (ETableModel *etm, gpointer data)
-{
- return 1;
-}
-
-static gint
-table_row_count (ETableModel *etm, gpointer data)
-{
- ECompletionView *cv = E_COMPLETION_VIEW (data);
- return cv->choices->len;
-}
-
-static gboolean
-table_is_cell_editable (ETableModel *etm, gint c, gint r, gpointer data)
-{
- return FALSE;
-}
-
-static gpointer
-table_value_at (ETableModel *etm, gint c, gint r, gpointer data)
-{
- ECompletionView *cv = E_COMPLETION_VIEW (data);
- ECompletionMatch *match;
-
- match = g_ptr_array_index (cv->choices, r);
-
- return (gpointer) e_completion_match_get_menu_text (match);
-}
-
-static gchar *
-table_value_to_string (ETableModel *em, gint col, gconstpointer val, gpointer data)
-{
- return (gchar *) val;
-}
-
-static void
-table_click_cb (ETable *et, gint r, gint c, GdkEvent *ev, gpointer data)
-{
- ECompletionView *cv = E_COMPLETION_VIEW (data);
-
- e_completion_view_select (cv, r);
-}
-
-void
-e_completion_view_construct (ECompletionView *cv, ECompletion *completion)
-{
- g_return_if_fail (cv != NULL);
- g_return_if_fail (E_IS_COMPLETION_VIEW (cv));
- g_return_if_fail (completion != NULL);
- g_return_if_fail (E_IS_COMPLETION (completion));
-
- /* Make sure we don't call construct twice. */
- g_return_if_fail (cv->completion == NULL);
-
- GTK_WIDGET_SET_FLAGS (GTK_WIDGET (cv), GTK_CAN_FOCUS);
-
- cv->completion = completion;
- g_object_ref (completion);
-
- cv->begin_signal_id = g_signal_connect (completion,
- "completion_started",
- G_CALLBACK (begin_completion_cb),
- cv);
- cv->comp_signal_id = g_signal_connect (completion,
- "completion_found",
- G_CALLBACK (completion_cb),
- cv);
- cv->end_signal_id = g_signal_connect (completion,
- "completion_finished",
- G_CALLBACK (end_completion_cb),
- cv);
-
- cv->model = e_table_simple_new (table_col_count,
- table_row_count,
- NULL,
-
- table_value_at,
- NULL,
- table_is_cell_editable,
-
- NULL, NULL,
-
- NULL, NULL, NULL, NULL,
- table_value_to_string,
- cv);
-
- cv->table = e_table_scrolled_new (cv->model, NULL, simple_spec, NULL);
- g_object_unref (cv->model);
-
- gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (cv->table), GTK_SHADOW_NONE);
- gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (cv->table), GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC);
-
- gtk_container_add (GTK_CONTAINER (cv), cv->table);
- gtk_widget_show_all (cv->table);
-
- g_signal_connect (e_completion_view_table (cv),
- "click",
- G_CALLBACK (table_click_cb),
- cv);
-
- cv->selection = -1;
-}
-
-GtkWidget *
-e_completion_view_new (ECompletion *completion)
-{
- gpointer p;
-
- g_return_val_if_fail (completion != NULL, NULL);
- g_return_val_if_fail (E_IS_COMPLETION (completion), NULL);
-
- p = g_object_new (E_COMPLETION_VIEW_TYPE, NULL);
-
- e_completion_view_construct (E_COMPLETION_VIEW (p), completion);
-
- return GTK_WIDGET (p);
-}
-
-void
-e_completion_view_connect_keys (ECompletionView *cv, GtkWidget *w)
-{
- g_return_if_fail (cv != NULL);
- g_return_if_fail (E_IS_COMPLETION_VIEW (cv));
- g_return_if_fail (w == NULL || GTK_IS_WIDGET (w));
-
- if (cv->key_widget) {
- g_signal_handler_disconnect (cv->key_widget, cv->key_signal_id);
- g_object_unref (cv->key_widget);
- }
-
- if (w) {
- cv->key_widget = w;
- g_object_ref (w);
-
- cv->key_signal_id = g_signal_connect (w,
- "key_press_event",
- G_CALLBACK (e_completion_view_key_press_handler),
- cv);
- } else {
- cv->key_widget = NULL;
- cv->key_signal_id = 0;
- }
-}
-
-void
-e_completion_view_set_complete_key (ECompletionView *cv, gint keyval)
-{
- g_return_if_fail (cv != NULL);
- g_return_if_fail (E_IS_COMPLETION_VIEW (cv));
-
- cv->complete_key = keyval;
-}
-
-void
-e_completion_view_set_uncomplete_key (ECompletionView *cv, gint keyval)
-{
- g_return_if_fail (cv != NULL);
- g_return_if_fail (E_IS_COMPLETION_VIEW (cv));
-
- cv->uncomplete_key = keyval;
-}
-
-void
-e_completion_view_set_width (ECompletionView *cv, gint width)
-{
- GtkWidget *w;
- gint y, r, dummy, line_height, final_height;
- double drop_room, lines;
-
- g_return_if_fail (cv != NULL);
- g_return_if_fail (E_IS_COMPLETION_VIEW (cv));
- g_return_if_fail (width > 0);
-
- w = GTK_WIDGET (cv);
-
- if (! GTK_WIDGET_REALIZED (w)) {
- gtk_widget_set_usize (w, width, -1);
- return;
- }
-
- /* A Horrible Hack(tm) to figure out the height of a single table row */
-
- for (line_height=5, r=0; r == 0 && line_height < 1000; line_height += 2) {
- dummy = 0;
- e_table_group_compute_location (e_completion_view_table (cv)->group,
- &dummy, &line_height, &r, &dummy);
- }
-
- if (line_height >= 1000) {
- /* Something went wrong, so we make a (possibly very lame) guess */
- line_height = 30;
- }
-
-
- gdk_window_get_origin (w->window, NULL, &y);
- y += w->allocation.y;
-
- lines = 5; /* default maximum */
- lines = MIN (lines, cv->choices->len);
-
- drop_room = (gdk_screen_height () - y) / (double)line_height;
- drop_room = MAX (drop_room, 1);
-
- lines = MIN (lines, drop_room);
-
- /* We reduce the total height by a bit; in practice, this seems to work out well. */
- final_height = (gint) floor (line_height * (0.5 + (float)lines) * 0.97);
- gtk_widget_set_usize (w, width, final_height);
-}
-
-void
-e_completion_view_set_editable (ECompletionView *cv, gboolean x)
-{
- g_return_if_fail (cv != NULL);
- g_return_if_fail (E_IS_COMPLETION_VIEW (cv));
-
- if (x == cv->editable)
- return;
-
- cv->editable = x;
- cv->selection = -1;
- e_completion_view_set_cursor_row (cv, -1);
-}
-
-
diff --git a/widgets/text/e-completion-view.h b/widgets/text/e-completion-view.h
deleted file mode 100644
index 25b2eff645..0000000000
--- a/widgets/text/e-completion-view.h
+++ /dev/null
@@ -1,98 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-completion-view.h - A text completion selection widget
- * Copyright 2000, 2001, Ximian, Inc.
- *
- * Authors:
- * Miguel de Icaza <miguel@ximian.com>
- * Adapted by Jon Trowbridge <trow@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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.
- */
-
-#ifndef E_COMPLETION_VIEW_H
-#define E_COMPLETION_VIEW_H
-
-#include <gtk/gtk.h>
-#include <gal/e-table/e-table.h>
-#include "e-completion.h"
-
-G_BEGIN_DECLS
-
-#define E_COMPLETION_VIEW_TYPE (e_completion_view_get_type ())
-#define E_COMPLETION_VIEW(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), E_COMPLETION_VIEW_TYPE, ECompletionView))
-#define E_COMPLETION_VIEW_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), E_COMPLETION_VIEW_TYPE, ECompletionViewClass))
-#define E_IS_COMPLETION_VIEW(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), E_COMPLETION_VIEW_TYPE))
-#define E_IS_COMPLETION_VIEW_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), E_COMPLETION_VIEW_TYPE))
-
-typedef struct _ECompletionView ECompletionView;
-typedef struct _ECompletionViewClass ECompletionViewClass;
-
-struct _ECompletionView {
- GtkEventBox parent;
-
- ETableModel *model;
- GtkWidget *table;
-
- GPtrArray *choices;
-
- ECompletion *completion;
- guint begin_signal_id;
- guint comp_signal_id;
- guint end_signal_id;
-
- GtkWidget *key_widget;
- guint key_signal_id;
-
- gint complete_key;
- gint uncomplete_key;
-
- gboolean have_all_choices;
-
- gboolean editable;
- gint selection;
-
- gint border_width;
-};
-
-struct _ECompletionViewClass {
- GtkEventBoxClass parent_class;
-
- /* Signals */
- void (*nonempty) (ECompletionView *cv);
- void (*added) (ECompletionView *cv);
- void (*full) (ECompletionView *cv);
- void (*browse) (ECompletionView *cv, ECompletionMatch *match);
- void (*unbrowse) (ECompletionView *cv);
- void (*activate) (ECompletionView *cv, ECompletionMatch *match);
-};
-
-GtkType e_completion_view_get_type (void);
-
-void e_completion_view_construct (ECompletionView *cv, ECompletion *completion);
-GtkWidget *e_completion_view_new (ECompletion *completion);
-
-void e_completion_view_connect_keys (ECompletionView *cv, GtkWidget *w);
-
-void e_completion_view_set_complete_key (ECompletionView *cv, gint keyval);
-void e_completion_view_set_uncomplete_key (ECompletionView *cv, gint keyval);
-
-void e_completion_view_set_width (ECompletionView *cv, gint width);
-void e_completion_view_set_editable (ECompletionView *cv, gboolean);
-
-G_END_DECLS
-
-
-#endif /* E_COMPLETION_H */
diff --git a/widgets/text/e-completion.c b/widgets/text/e-completion.c
deleted file mode 100644
index b243d4db35..0000000000
--- a/widgets/text/e-completion.c
+++ /dev/null
@@ -1,339 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-completion.c - A base class for text completion.
- * Copyright 2000, 2001, Ximian, Inc.
- *
- * Authors:
- * Miguel de Icaza <miguel@ximian.com>
- * Adapted by Jon Trowbridge <trow@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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 <string.h>
-#include <stdio.h>
-#include <gtk/gtk.h>
-#include "e-completion.h"
-#include "gal/util/e-util.h"
-#include "gal/util/e-marshal.h"
-
-enum {
- COMPLETION_STARTED,
- COMPLETION_FOUND,
- COMPLETION_CANCELED,
- COMPLETION_FINISHED,
- LAST_SIGNAL
-};
-
-static guint e_completion_signals[LAST_SIGNAL] = { 0 };
-
-struct _ECompletionPrivate {
- gboolean searching;
- gboolean done_search;
- gchar *search_text;
- GPtrArray *matches;
- gint pos;
- gint limit;
- double min_score, max_score;
-};
-
-static void e_completion_class_init (ECompletionClass *klass);
-static void e_completion_init (ECompletion *complete);
-static void e_completion_dispose (GObject *object);
-
-static void e_completion_add_match (ECompletion *complete, ECompletionMatch *);
-static void e_completion_clear_matches (ECompletion *complete);
-static gboolean e_completion_sort (ECompletion *complete);
-
-#define PARENT_TYPE GTK_TYPE_OBJECT
-static GtkObjectClass *parent_class;
-
-
-
-E_MAKE_TYPE (e_completion,
- "ECompletion",
- ECompletion,
- e_completion_class_init,
- e_completion_init,
- PARENT_TYPE)
-
-static void
-e_completion_class_init (ECompletionClass *klass)
-{
- GObjectClass *object_class = (GObjectClass *) klass;
-
- parent_class = g_type_class_ref (PARENT_TYPE);
-
- e_completion_signals[COMPLETION_STARTED] =
- g_signal_new ("completion_started",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (ECompletionClass, completion_started),
- NULL, NULL,
- e_marshal_NONE__POINTER_INT_INT,
- G_TYPE_NONE, 3,
- G_TYPE_POINTER, G_TYPE_INT, G_TYPE_INT);
-
- e_completion_signals[COMPLETION_FOUND] =
- g_signal_new ("completion_found",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (ECompletionClass, completion_found),
- NULL, NULL,
- e_marshal_NONE__POINTER,
- G_TYPE_NONE, 1,
- G_TYPE_POINTER);
-
- e_completion_signals[COMPLETION_FINISHED] =
- g_signal_new ("completion_finished",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (ECompletionClass, completion_finished),
- NULL, NULL,
- e_marshal_NONE__NONE,
- G_TYPE_NONE, 0);
-
- object_class->dispose = e_completion_dispose;
-}
-
-static void
-e_completion_init (ECompletion *complete)
-{
- complete->priv = g_new0 (struct _ECompletionPrivate, 1);
- complete->priv->matches = g_ptr_array_new ();
-}
-
-static void
-e_completion_dispose (GObject *object)
-{
- ECompletion *complete = E_COMPLETION (object);
-
- if (complete->priv) {
- g_free (complete->priv->search_text);
- complete->priv->search_text = NULL;
-
- e_completion_clear_matches (complete);
-
- g_ptr_array_free (complete->priv->matches, TRUE);
- complete->priv->matches = NULL;
-
- g_free (complete->priv);
- complete->priv = NULL;
- }
-
- if (G_OBJECT_CLASS (parent_class)->dispose)
- (G_OBJECT_CLASS (parent_class)->dispose) (object);
-}
-
-static void
-e_completion_add_match (ECompletion *complete, ECompletionMatch *match)
-{
- g_return_if_fail (complete && E_IS_COMPLETION (complete));
- g_return_if_fail (match != NULL);
-
- g_ptr_array_add (complete->priv->matches, match);
-
- if (complete->priv->matches->len == 1) {
-
- complete->priv->min_score = complete->priv->max_score = match->score;
-
- } else {
-
- complete->priv->min_score = MIN (complete->priv->min_score, match->score);
- complete->priv->max_score = MAX (complete->priv->max_score, match->score);
-
- }
-}
-
-static void
-e_completion_clear_matches (ECompletion *complete)
-{
- ECompletionMatch *match;
- GPtrArray *m;
- int i;
-
- g_return_if_fail (E_IS_COMPLETION (complete));
-
- m = complete->priv->matches;
- for (i = 0; i < m->len; i++) {
- match = g_ptr_array_index (m, i);
- e_completion_match_unref (match);
- }
- g_ptr_array_set_size (m, 0);
-
- complete->priv->min_score = 0;
- complete->priv->max_score = 0;
-}
-
-void
-e_completion_begin_search (ECompletion *complete, const gchar *text, gint pos, gint limit)
-{
- ECompletionClass *klass;
-
- g_return_if_fail (complete != NULL);
- g_return_if_fail (E_IS_COMPLETION (complete));
- g_return_if_fail (text != NULL);
-
- klass = E_COMPLETION_CLASS (GTK_OBJECT_GET_CLASS (complete));
-
- g_free (complete->priv->search_text);
- complete->priv->search_text = g_strdup (text);
-
- complete->priv->pos = pos;
- complete->priv->searching = TRUE;
- complete->priv->done_search = FALSE;
-
- e_completion_clear_matches (complete);
-
- complete->priv->limit = limit > 0 ? limit : G_MAXINT;
-
- g_signal_emit (complete, e_completion_signals[COMPLETION_STARTED], 0, text, pos, limit);
- if (klass->request_completion)
- klass->request_completion (complete, text, pos, limit);
-}
-
-gboolean
-e_completion_searching (ECompletion *complete)
-{
- g_return_val_if_fail (complete != NULL, FALSE);
- g_return_val_if_fail (E_IS_COMPLETION (complete), FALSE);
-
- return complete->priv->searching;
-}
-
-const gchar *
-e_completion_search_text (ECompletion *complete)
-{
- g_return_val_if_fail (complete != NULL, NULL);
- g_return_val_if_fail (E_IS_COMPLETION (complete), NULL);
-
- return complete->priv->search_text;
-}
-
-gint
-e_completion_search_text_pos (ECompletion *complete)
-{
- g_return_val_if_fail (complete != NULL, -1);
- g_return_val_if_fail (E_IS_COMPLETION (complete), -1);
-
- return complete->priv->pos;
-}
-
-gint
-e_completion_match_count (ECompletion *complete)
-{
- g_return_val_if_fail (complete != NULL, 0);
- g_return_val_if_fail (E_IS_COMPLETION (complete), 0);
-
- return complete->priv->matches->len;
-}
-
-void
-e_completion_foreach_match (ECompletion *complete, ECompletionMatchFn fn, gpointer closure)
-{
- GPtrArray *m;
- int i;
-
- g_return_if_fail (complete != NULL);
- g_return_if_fail (E_IS_COMPLETION (complete));
-
- if (fn == NULL)
- return;
-
- m = complete->priv->matches;
- for (i = 0; i < m->len; i++) {
- ECompletionMatch *match = g_ptr_array_index (m, i);
- fn (match, closure);
- }
-}
-
-ECompletion *
-e_completion_new (void)
-{
- return E_COMPLETION (g_object_new (E_COMPLETION_TYPE, NULL));
-}
-
-static gboolean
-e_completion_sort (ECompletion *complete)
-{
- GPtrArray *m;
- int i;
- GList *sort_list = NULL, *j;
- gboolean diff;
-
- m = complete->priv->matches;
-
- for (i = 0; i < m->len; i++)
- sort_list = g_list_append (sort_list,
- g_ptr_array_index (m, i));
-
- sort_list = g_list_sort (sort_list, (GCompareFunc) e_completion_match_compare_alpha);
-
- diff = FALSE;
-
- for (i=0, j=sort_list; i < m->len; i++, j = g_list_next (j)) {
- if (g_ptr_array_index (m, i) == j->data)
- continue;
-
- diff = TRUE;
- g_ptr_array_index (m, i) = j->data;
- }
-
- g_list_free (sort_list);
-
- return diff;
-}
-
-void
-e_completion_found_match (ECompletion *complete, ECompletionMatch *match)
-{
- g_return_if_fail (complete);
- g_return_if_fail (E_IS_COMPLETION (complete));
- g_return_if_fail (match != NULL);
-
- if (! complete->priv->searching) {
- g_warning ("e_completion_found_match(...,\"%s\",...) called outside of a search", match->match_text);
- return;
- }
-
- /* For now, do nothing when we hit the limit --- just don't
- * announce the incoming matches. */
- if (complete->priv->matches->len >= complete->priv->limit) {
- e_completion_match_unref (match);
- return;
- }
-
- e_completion_add_match (complete, match);
-
- g_signal_emit (complete, e_completion_signals[COMPLETION_FOUND], 0, match);
-}
-
-void
-e_completion_end_search (ECompletion *comp)
-{
- g_return_if_fail (comp != NULL);
- g_return_if_fail (E_IS_COMPLETION (comp));
- g_return_if_fail (comp->priv->searching);
-
- if (E_COMPLETION_CLASS (GTK_OBJECT_GET_CLASS (comp))->end_completion) {
- E_COMPLETION_CLASS (GTK_OBJECT_GET_CLASS (comp))->end_completion (comp);
- }
- g_signal_emit (comp, e_completion_signals[COMPLETION_FINISHED], 0);
-
- comp->priv->searching = FALSE;
- comp->priv->done_search = TRUE;
-}
-
diff --git a/widgets/text/e-completion.h b/widgets/text/e-completion.h
deleted file mode 100644
index 74976e579c..0000000000
--- a/widgets/text/e-completion.h
+++ /dev/null
@@ -1,91 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-completion.h - A base class for text completion.
- * Copyright 2000, 2001, Ximian, Inc.
- *
- * Authors:
- * Miguel de Icaza <miguel@ximian.com>
- * Adapted by Jon Trowbridge <trow@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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.
- */
-
-#ifndef E_COMPLETION_H
-#define E_COMPLETION_H
-
-#include <gtk/gtkobject.h>
-#include "e-completion-match.h"
-
-G_BEGIN_DECLS
-
-#define E_COMPLETION_TYPE (e_completion_get_type ())
-#define E_COMPLETION(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), E_COMPLETION_TYPE, ECompletion))
-#define E_COMPLETION_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), E_COMPLETION_TYPE, ECompletionClass))
-#define E_IS_COMPLETION(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), E_COMPLETION_TYPE))
-#define E_IS_COMPLETION_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), E_COMPLETION_TYPE))
-
-typedef struct _ECompletion ECompletion;
-typedef struct _ECompletionClass ECompletionClass;
-struct _ECompletionPrivate;
-
-typedef gboolean (*ECompletionRefineFn) (ECompletion *, ECompletionMatch *, const gchar *search_text, gint pos);
-
-struct _ECompletion {
- GtkObject parent;
-
- struct _ECompletionPrivate *priv;
-};
-
-struct _ECompletionClass {
- GtkObjectClass parent_class;
-
- /* virtual functions */
- void (*request_completion) (ECompletion *comp, const gchar *search_text, gint pos, gint limit);
- void (*end_completion) (ECompletion *comp);
-
- /* Signals */
- void (*completion_started) (ECompletion *comp, const gchar *search_text, gint pos, gint limit);
-
- void (*completion_found) (ECompletion *comp, ECompletionMatch *match);
-
- void (*completion_finished) (ECompletion *comp);
-};
-
-GtkType e_completion_get_type (void);
-
-void e_completion_begin_search (ECompletion *comp, const gchar *text, gint pos, gint limit);
-
-gboolean e_completion_searching (ECompletion *comp);
-gboolean e_completion_refining (ECompletion *comp);
-const gchar *e_completion_search_text (ECompletion *comp);
-gint e_completion_search_text_pos (ECompletion *comp);
-gint e_completion_match_count (ECompletion *comp);
-void e_completion_foreach_match (ECompletion *comp, ECompletionMatchFn fn, gpointer user_data);
-
-ECompletion *e_completion_new (void);
-
-
-
-/* These functions should only be called by derived classes or search callbacks,
- or very bad things might happen. */
-
-void e_completion_found_match (ECompletion *comp, ECompletionMatch *);
-void e_completion_end_search (ECompletion *comp);
-
-G_END_DECLS
-
-
-#endif /* E_COMPLETION_H */
-
diff --git a/widgets/text/e-entry-test.c b/widgets/text/e-entry-test.c
deleted file mode 100644
index d30ba20a9f..0000000000
--- a/widgets/text/e-entry-test.c
+++ /dev/null
@@ -1,83 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-entry-test.c
- * Copyright 2000, 2001, Ximian, Inc.
- *
- * Authors:
- * Chris Lahey <clahey@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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-entry.h"
-#include <gal/util/e-i18n.h>
-
-static void destroy_callback(gpointer data, GObject *where_object_was)
-{
- exit(0);
-}
-
-#if 0
-static void about_callback( GtkWidget *widget, gpointer data )
-{
-
- const gchar *authors[] =
- {
- "Christopher James Lahey <clahey@umich.edu>",
- NULL
- };
-
- GtkWidget *about =
- gnome_about_new ( _( "Minicard Test" ), VERSION,
- _( "Copyright (C) 2000, Helix Code, Inc." ),
- authors,
- _( "This should test the minicard canvas item" ),
- NULL);
- gtk_widget_show (about);
-}
-#endif
-
-int main( int argc, char *argv[] )
-{
- GtkWidget *app;
- GtkWidget *entry;
-
- /* bindtextdomain (PACKAGE, GNOMELOCALEDIR);
- textdomain (PACKAGE);*/
-
- gnome_init( "EEntry Test", VERSION, argc, argv);
- app = gnome_app_new("EEntry Test", NULL);
-
- entry = e_entry_new();
- g_object_set(entry,
- "editable", TRUE,
- "use_ellipsis", TRUE,
- NULL);
- gnome_app_set_contents( GNOME_APP( app ), entry );
-
- /* Connect the signals */
- g_object_weak_ref (G_OBJECT (app),
- destroy_callback, app);
-
- gtk_widget_show_all( app );
-
- gtk_main();
-
- /* Not reached. */
- return 0;
-}
diff --git a/widgets/text/e-entry.c b/widgets/text/e-entry.c
deleted file mode 100644
index fbd708eb66..0000000000
--- a/widgets/text/e-entry.c
+++ /dev/null
@@ -1,1397 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-entry.c - An EText-based entry widget
- * Copyright 2000, 2001, Ximian, Inc.
- *
- * Authors:
- * Chris Lahey <clahey@ximian.com>
- * Jon Trowbridge <trow@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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 <math.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <ctype.h>
-#include <stdio.h>
-#include <gdk/gdkkeysyms.h>
-#include <gtk/gtksignal.h>
-#include <gtk/gtktypebuiltins.h>
-#include <libxml/parser.h>
-#include <libgnomecanvas/gnome-canvas.h>
-#include "gal/util/e-util.h"
-#include "gal/util/e-i18n.h"
-#include "gal/widgets/e-canvas.h"
-#include "gal/widgets/e-canvas-utils.h"
-#include "e-completion-view.h"
-#include "e-text.h"
-#include "e-entry.h"
-
-#define MIN_ENTRY_WIDTH 150
-#define INNER_BORDER 2
-
-#define d(x)
-
-#define PARENT_TYPE gtk_table_get_type ()
-
-static GtkObjectClass *parent_class;
-
-enum {
- E_ENTRY_CHANGED,
- E_ENTRY_ACTIVATE,
- E_ENTRY_POPUP,
- E_ENTRY_COMPLETION_POPUP,
- E_ENTRY_LAST_SIGNAL
-};
-
-static guint e_entry_signals[E_ENTRY_LAST_SIGNAL] = { 0 };
-
-/* Object argument IDs */
-enum {
- PROP_0,
- PROP_MODEL,
- PROP_EVENT_PROCESSOR,
- PROP_TEXT,
- PROP_FONT,
- PROP_FONTSET,
- PROP_FONT_GDK,
- PROP_ANCHOR,
- PROP_JUSTIFICATION,
- PROP_X_OFFSET,
- PROP_Y_OFFSET,
- PROP_FILL_COLOR,
- PROP_FILL_COLOR_GDK,
- PROP_FILL_COLOR_RGBA,
- PROP_FILL_STIPPLE,
- PROP_EDITABLE,
- PROP_USE_ELLIPSIS,
- PROP_ELLIPSIS,
- PROP_LINE_WRAP,
- PROP_BREAK_CHARACTERS,
- PROP_MAX_LINES,
- PROP_ALLOW_NEWLINES,
- PROP_DRAW_BORDERS,
- PROP_DRAW_BACKGROUND,
- PROP_DRAW_BUTTON,
- PROP_EMULATE_LABEL_RESIZE,
- PROP_CURSOR_POS
-};
-
-typedef struct _EEntryPrivate EEntryPrivate;
-struct _EEntryPrivate {
- GtkJustification justification;
-
- guint changed_proxy_tag;
- guint activate_proxy_tag;
- guint popup_proxy_tag;
- /* Data related to completions */
- ECompletion *completion;
- EEntryCompletionHandler handler;
- GtkWidget *completion_view;
- guint nonempty_signal_id;
- guint added_signal_id;
- guint full_signal_id;
- guint browse_signal_id;
- guint unbrowse_signal_id;
- guint activate_signal_id;
- GtkWidget *completion_view_popup;
- gboolean popup_is_visible;
- gchar *pre_browse_text;
- gint completion_delay;
- guint completion_delay_tag;
- gboolean ptr_grab;
- gboolean changed_since_keypress;
- guint changed_since_keypress_tag;
- gint last_completion_pos;
-
- guint draw_borders : 1;
- guint emulate_label_resize : 1;
- guint have_set_transient : 1;
- gint last_width;
-};
-
-static gboolean e_entry_is_empty (EEntry *entry);
-static void e_entry_show_popup (EEntry *entry, gboolean x);
-static void e_entry_start_completion (EEntry *entry);
-static void e_entry_start_delayed_completion (EEntry *entry, gint delay);
-static void e_entry_cancel_delayed_completion (EEntry *entry);
-
-static void
-canvas_size_allocate (GtkWidget *widget, GtkAllocation *alloc,
- EEntry *entry)
-{
- gnome_canvas_set_scroll_region (entry->canvas,
- 0, 0, alloc->width, alloc->height);
- g_object_set (entry->item,
- "clip_width", (double) (alloc->width),
- "clip_height", (double) (alloc->height),
- NULL);
-
- switch (entry->priv->justification) {
- case GTK_JUSTIFY_RIGHT:
- e_canvas_item_move_absolute(GNOME_CANVAS_ITEM(entry->item),
- alloc->width, 0);
- break;
- case GTK_JUSTIFY_CENTER:
- e_canvas_item_move_absolute(GNOME_CANVAS_ITEM(entry->item),
- alloc->width / 2, 0);
- break;
- default:
- e_canvas_item_move_absolute(GNOME_CANVAS_ITEM(entry->item),
- 0, 0);
- break;
- }
-}
-
-static void
-get_borders (EEntry *entry,
- gint *xborder,
- gint *yborder)
-{
- GtkWidget *widget = GTK_WIDGET (entry);
- gint focus_width;
- gboolean interior_focus;
-
- gtk_widget_style_get (widget,
- "interior-focus", &interior_focus,
- "focus-line-width", &focus_width,
- NULL);
-
- *xborder = widget->style->xthickness;
- *yborder = widget->style->ythickness;
-
- if (!interior_focus)
- {
- *xborder += focus_width;
- *yborder += focus_width;
- }
-}
-
-static void
-canvas_size_request (GtkWidget *widget, GtkRequisition *requisition,
- EEntry *entry)
-{
- int xthick, ythick;
- PangoContext *context;
- PangoFontMetrics *metrics;
-
- g_return_if_fail (widget != NULL);
- g_return_if_fail (GNOME_IS_CANVAS (widget));
- g_return_if_fail (requisition != NULL);
-
- if (entry->priv->draw_borders) {
- get_borders (entry, &xthick, &ythick);
- } else {
- xthick = ythick = 0;
- }
-
- if (entry->priv->emulate_label_resize) {
- gdouble width;
- g_object_get (entry->item,
- "text_width", &width,
- NULL);
- requisition->width = 2 + 2 * xthick + width;
- } else {
- requisition->width = 2 + MIN_ENTRY_WIDTH + xthick;
- }
- if (entry->priv->last_width != requisition->width)
- gtk_widget_queue_resize (widget);
- entry->priv->last_width = requisition->width;
-
- d(g_print("%s: width = %d\n", __FUNCTION__, requisition->width));
-
- context = gtk_widget_get_pango_context (widget);
- metrics = pango_context_get_metrics (context, gtk_widget_get_style (widget)->font_desc,
- pango_context_get_language (context));
-
- requisition->height = (2 +
- PANGO_PIXELS (pango_font_metrics_get_ascent (metrics) +
- pango_font_metrics_get_descent (metrics)) +
- 2 * ythick);
-
- pango_font_metrics_unref (metrics);
-}
-
-static gint
-canvas_focus_in_event (GtkWidget *widget, GdkEventFocus *focus, EEntry *entry)
-{
- if (entry->canvas->focused_item != GNOME_CANVAS_ITEM(entry->item))
- gnome_canvas_item_grab_focus(GNOME_CANVAS_ITEM(entry->item));
-
- return FALSE;
-}
-
-static void
-e_entry_text_keypress (EText *text, guint keyval, guint state, EEntry *entry)
-{
- if (entry->priv->changed_since_keypress_tag) {
- gtk_timeout_remove (entry->priv->changed_since_keypress_tag);
- entry->priv->changed_since_keypress_tag = 0;
- }
-
- if (entry->priv->changed_since_keypress
- || (entry->priv->popup_is_visible && e_entry_get_position (entry) != entry->priv->last_completion_pos)) {
- if (e_entry_is_empty (entry)) {
- e_entry_cancel_delayed_completion (entry);
- e_entry_show_popup (entry, FALSE);
- } else if (entry->priv->completion_delay >= 0) {
- int delay;
- delay = entry->priv->popup_is_visible
- ? 1
- : entry->priv->completion_delay;
- e_entry_start_delayed_completion (entry, delay);
- }
- }
- entry->priv->changed_since_keypress = FALSE;
-}
-
-static gint
-changed_since_keypress_timeout_fn (gpointer user_data)
-{
- EEntry *entry = E_ENTRY (user_data);
- entry->priv->changed_since_keypress = FALSE;
- entry->priv->changed_since_keypress_tag = 0;
- return FALSE;
-}
-
-static void
-e_entry_proxy_changed (EText *text, EEntry *entry)
-{
- if (entry->priv->changed_since_keypress_tag)
- gtk_timeout_remove (entry->priv->changed_since_keypress_tag);
- entry->priv->changed_since_keypress = TRUE;
- entry->priv->changed_since_keypress_tag = gtk_timeout_add (20, changed_since_keypress_timeout_fn, entry);
-
- g_signal_emit (entry, e_entry_signals [E_ENTRY_CHANGED], 0);
-}
-
-static void
-e_entry_proxy_activate (EText *text, EEntry *entry)
-{
- g_signal_emit (entry, e_entry_signals [E_ENTRY_ACTIVATE], 0);
-}
-
-static void
-e_entry_proxy_popup (EText *text, GdkEventButton *ev, gint pos, EEntry *entry)
-{
- g_signal_emit (entry, e_entry_signals [E_ENTRY_POPUP], 0, ev, pos);
-}
-
-static void
-e_entry_init (GtkObject *object)
-{
- EEntry *entry = E_ENTRY (object);
- GtkTable *gtk_table = GTK_TABLE (object);
-
- entry->priv = g_new0 (EEntryPrivate, 1);
-
- entry->priv->emulate_label_resize = FALSE;
-
- entry->canvas = GNOME_CANVAS (e_canvas_new ());
-
- g_signal_connect (entry->canvas,
- "size_allocate",
- G_CALLBACK (canvas_size_allocate),
- entry);
-
- g_signal_connect (entry->canvas,
- "size_request",
- G_CALLBACK (canvas_size_request),
- entry);
-
- g_signal_connect (entry->canvas,
- "focus_in_event",
- G_CALLBACK(canvas_focus_in_event),
- entry);
-
- entry->priv->draw_borders = TRUE;
- entry->priv->last_width = -1;
-
- entry->item = E_TEXT(gnome_canvas_item_new(
- gnome_canvas_root (entry->canvas),
- e_text_get_type(),
- "clip", TRUE,
- "fill_clip_rectangle", TRUE,
- "anchor", GTK_ANCHOR_NW,
- "draw_borders", TRUE,
- "draw_background", TRUE,
- "draw_button", FALSE,
- "max_lines", 1,
- "editable", TRUE,
- "allow_newlines", FALSE,
- NULL));
-
- g_signal_connect (entry->item,
- "keypress",
- G_CALLBACK (e_entry_text_keypress),
- entry);
-
- entry->priv->justification = GTK_JUSTIFY_LEFT;
- gtk_table_attach (gtk_table, GTK_WIDGET (entry->canvas),
- 0, 1, 0, 1,
- GTK_EXPAND | GTK_FILL | GTK_SHRINK,
- GTK_EXPAND | GTK_FILL | GTK_SHRINK,
- 0, 0);
- gtk_widget_show (GTK_WIDGET (entry->canvas));
-
- /*
- * Proxy functions: we proxy the changed and activate signals
- * from the item to ourselves
- */
- entry->priv->changed_proxy_tag = g_signal_connect (entry->item,
- "changed",
- G_CALLBACK (e_entry_proxy_changed),
- entry);
- entry->priv->activate_proxy_tag = g_signal_connect (entry->item,
- "activate",
- G_CALLBACK (e_entry_proxy_activate),
- entry);
- entry->priv->popup_proxy_tag = g_signal_connect (entry->item,
- "popup",
- G_CALLBACK (e_entry_proxy_popup),
- entry);
-
- entry->priv->completion_delay = 1;
-}
-
-/**
- * e_entry_construct
- *
- * Constructs the given EEntry.
- *
- **/
-void
-e_entry_construct (EEntry *entry)
-{
- /* Do nothing */
-}
-
-
-/**
- * e_entry_new
- *
- * Creates a new EEntry.
- *
- * Returns: The new EEntry
- **/
-GtkWidget *
-e_entry_new (void)
-{
- EEntry *entry;
- entry = g_object_new (E_ENTRY_TYPE, NULL);
- e_entry_construct (entry);
-
- return GTK_WIDGET (entry);
-}
-
-const gchar *
-e_entry_get_text (EEntry *entry)
-{
- g_return_val_if_fail (entry != NULL && E_IS_ENTRY (entry), NULL);
-
- return e_text_model_get_text (entry->item->model);
-}
-
-void
-e_entry_set_text (EEntry *entry, const gchar *txt)
-{
- g_return_if_fail (entry != NULL && E_IS_ENTRY (entry));
-
- e_text_model_set_text (entry->item->model, txt);
-}
-
-static void
-e_entry_set_text_quiet (EEntry *entry, const gchar *txt)
-{
- g_return_if_fail (entry != NULL && E_IS_ENTRY (entry));
-
- g_signal_handler_block (entry->item, entry->priv->changed_proxy_tag);
- e_entry_set_text (entry, txt);
- g_signal_handler_unblock (entry->item, entry->priv->changed_proxy_tag);
-}
-
-
-void
-e_entry_set_editable (EEntry *entry, gboolean am_i_editable)
-{
- g_return_if_fail (entry != NULL && E_IS_ENTRY (entry));
-
- g_object_set (entry->item, "editable", am_i_editable, NULL);
-}
-
-gint
-e_entry_get_position (EEntry *entry)
-{
- g_return_val_if_fail (entry != NULL && E_IS_ENTRY (entry), -1);
-
- return entry->item->selection_start;
-}
-
-void
-e_entry_set_position (EEntry *entry, gint pos)
-{
- g_return_if_fail (entry != NULL && E_IS_ENTRY (entry));
- if (pos < 0)
- pos = 0;
- else if (pos > e_text_model_get_text_length (entry->item->model))
- pos = e_text_model_get_text_length (entry->item->model);
-
- entry->item->selection_start = entry->item->selection_end = pos;
-}
-
-void
-e_entry_select_region (EEntry *entry, gint pos1, gint pos2)
-{
- gint len;
-
- g_return_if_fail (entry != NULL && E_IS_ENTRY (entry));
-
- len = e_text_model_get_text_length (entry->item->model);
- pos1 = CLAMP (pos1, 0, len);
- pos2 = CLAMP (pos2, 0, len);
-
- entry->item->selection_start = MIN (pos1, pos2);
- entry->item->selection_end = MAX (pos1, pos2);
-}
-
-/** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** **/
-
-/*** Completion-related code ***/
-
-static gboolean
-e_entry_is_empty (EEntry *entry)
-{
- const gchar *txt = e_entry_get_text (entry);
-
- if (txt == NULL)
- return TRUE;
-
- while (*txt) {
- if (!isspace ((gint) *txt))
- return FALSE;
- ++txt;
- }
-
- return TRUE;
-}
-
-static void
-e_entry_show_popup (EEntry *entry, gboolean visible)
-{
- GtkWidget *pop = entry->priv->completion_view_popup;
-
- if (pop == NULL)
- return;
-
- /* The async query can give us a result after the focus was lost by the
- widget. In that case, we don't want to show the pop-up. */
- if (! GTK_WIDGET_HAS_FOCUS (entry->canvas))
- return;
-
- if (visible) {
- GtkAllocation *dim = &(GTK_WIDGET (entry)->allocation);
- gint x, y, xo, yo, fudge;
- const GdkEventMask grab_mask = (GdkEventMask)GDK_BUTTON_PRESS_MASK | GDK_BUTTON_MOTION_MASK | GDK_BUTTON_RELEASE_MASK;
-
- /* Figure out where to put our popup. */
- gdk_window_get_origin (GTK_WIDGET (entry)->window, &xo, &yo);
- x = xo + dim->x;
- y = yo + dim->height + dim->y;
-
- fudge = 1;
- y -= fudge;
-
- gtk_widget_set_uposition (pop, x, y);
- e_completion_view_set_width (E_COMPLETION_VIEW (entry->priv->completion_view), dim->width);
-
- gtk_widget_set_sensitive(pop, TRUE);
- gtk_widget_show (pop);
-
-
- if (getenv ("GAL_E_ENTRY_NO_GRABS_HACK") == NULL && !entry->priv->ptr_grab) {
- entry->priv->ptr_grab = (0 == gdk_pointer_grab (GTK_WIDGET (entry->priv->completion_view)->window, TRUE,
- grab_mask, NULL, NULL, GDK_CURRENT_TIME));
- if (entry->priv->ptr_grab) {
- gtk_grab_add (GTK_WIDGET (entry->priv->completion_view));
- }
- }
-
-
- } else {
-
- gtk_widget_hide (pop);
- /* hack to force the popup to lose focus, which it gets if you click on it */
- gtk_widget_set_sensitive(pop, FALSE);
-
- if (entry->priv->ptr_grab) {
- gdk_pointer_ungrab (GDK_CURRENT_TIME);
- gtk_grab_remove (GTK_WIDGET (entry->priv->completion_view));
- }
-
- entry->priv->ptr_grab = FALSE;
-
- entry->priv->last_completion_pos = -1;
- }
-
- e_completion_view_set_editable (E_COMPLETION_VIEW (entry->priv->completion_view), visible);
-
- if (entry->priv->popup_is_visible != visible) {
- entry->priv->popup_is_visible = visible;
- g_signal_emit (entry, e_entry_signals[E_ENTRY_COMPLETION_POPUP], 0, (gint) visible);
- }
-}
-
-static void
-e_entry_refresh_popup (EEntry *entry)
-{
- if (entry->priv->popup_is_visible)
- e_entry_show_popup (entry, TRUE);
-}
-
-static void
-e_entry_start_completion (EEntry *entry)
-{
- if (entry->priv->completion == NULL)
- return;
-
- if (e_entry_is_empty (entry))
- return;
-
- e_completion_begin_search (entry->priv->completion,
- e_entry_get_text (entry),
- entry->priv->last_completion_pos = e_entry_get_position (entry),
- 0); /* No limit. Probably a bad idea. */
-}
-
-static gboolean
-start_delayed_cb (gpointer user_data)
-{
- EEntry *entry = E_ENTRY (user_data);
- entry->priv->completion_delay_tag = 0;
- e_entry_start_completion (entry);
- return FALSE;
-}
-
-static void
-e_entry_start_delayed_completion (EEntry *entry, gint delay)
-{
- if (delay < 0)
- return;
-
- e_entry_cancel_delayed_completion (entry);
- entry->priv->completion_delay_tag = gtk_timeout_add (MAX (delay, 1), start_delayed_cb, entry);
-}
-
-static void
-e_entry_cancel_delayed_completion (EEntry *entry)
-{
- if (entry->priv->completion == NULL)
- return;
-
- if (entry->priv->completion_delay_tag) {
- gtk_timeout_remove (entry->priv->completion_delay_tag);
- entry->priv->completion_delay_tag = 0;
- }
-}
-
-static void
-nonempty_cb (ECompletionView *view, gpointer user_data)
-{
- EEntry *entry = E_ENTRY (user_data);
-
- e_entry_show_popup (entry, TRUE);
-}
-
-static void
-added_cb (ECompletionView *view, gpointer user_data)
-{
- EEntry *entry = E_ENTRY (user_data);
- e_entry_refresh_popup (entry);
-}
-
-static void
-full_cb (ECompletionView *view, gpointer user_data)
-{
- EEntry *entry = E_ENTRY (user_data);
- gboolean show;
-
- show = GTK_WIDGET_HAS_FOCUS (GTK_WIDGET (entry->canvas)) && view->choices->len > 0;
- e_entry_show_popup (entry, show);
-}
-
-static void
-browse_cb (ECompletionView *view, ECompletionMatch *match, gpointer user_data)
-{
- EEntry *entry = E_ENTRY (user_data);
-
- if (match == NULL) {
- /* Requesting a completion. */
- e_entry_start_completion (entry);
- return;
- }
-
- if (entry->priv->pre_browse_text == NULL)
- entry->priv->pre_browse_text = g_strdup (e_entry_get_text (entry));
-
- /* If there is no other handler in place, echo the selected completion in
- the entry. */
- if (entry->priv->handler == NULL)
- e_entry_set_text_quiet (entry, e_completion_match_get_match_text (match));
-}
-
-static void
-unbrowse_cb (ECompletionView *view, gpointer user_data)
-{
- EEntry *entry = E_ENTRY (user_data);
-
- if (entry->priv->pre_browse_text) {
-
- if (entry->priv->handler == NULL)
- e_entry_set_text_quiet (entry, entry->priv->pre_browse_text);
-
- g_free (entry->priv->pre_browse_text);
- entry->priv->pre_browse_text = NULL;
- }
-
- e_entry_show_popup (entry, FALSE);
-}
-
-static void
-activate_cb (ECompletionView *view, ECompletionMatch *match, gpointer user_data)
-{
- EEntry *entry = E_ENTRY (user_data);
-
- e_entry_cancel_delayed_completion (entry);
-
- g_free (entry->priv->pre_browse_text);
- entry->priv->pre_browse_text = NULL;
- e_entry_show_popup (entry, FALSE);
-
- if (entry->priv->handler)
- entry->priv->handler (entry, match);
- else
- e_entry_set_text (entry, match->match_text);
-
- e_entry_cancel_delayed_completion (entry);
-}
-
-void
-e_entry_enable_completion (EEntry *entry, ECompletion *completion)
-{
- g_return_if_fail (entry != NULL && E_IS_ENTRY (entry));
- g_return_if_fail (completion != NULL && E_IS_COMPLETION (completion));
-
- e_entry_enable_completion_full (entry, completion, -1, NULL);
-}
-
-static void
-button_press_cb (GtkWidget *w, GdkEvent *ev, gpointer user_data)
-{
- EEntry *entry = E_ENTRY (user_data);
- GtkWidget *child;
-
- /* Bail out if our click happened inside of our widget. */
- child = gtk_get_event_widget (ev);
- if (child != w) {
- while (child) {
- if (child == w)
- return;
- child = child->parent;
- }
- }
-
- /* Treat this as an unbrowse */
- unbrowse_cb (E_COMPLETION_VIEW (w), entry);
-}
-
-static void
-cancel_completion_cb (ETextModel *model, gpointer user_data)
-{
- EEntry *entry = E_ENTRY (user_data);
-
- /* If we get the signal from the underlying text model, unbrowse.
- This usually means that the text model itself has done some
- sort of completion, or has otherwise transformed its contents
- in some way that would render any previous completion invalid. */
- unbrowse_cb (E_COMPLETION_VIEW (entry->priv->completion_view), entry);
-}
-
-static gint
-key_press_cb (GtkWidget *w, GdkEventKey *ev, gpointer user_data)
-{
- gint rv = 0;
- /* Forward signal */
- g_signal_emit_by_name (user_data, "key_press_event", ev, &rv);
- return rv;
-}
-
-static gint
-key_release_cb (GtkWidget *w, GdkEventKey *ev, gpointer user_data)
-{
- gint rv = 0;
- /* Forward signal */
- g_signal_emit_by_name (user_data, "key_release_event", ev, &rv);
- return rv;
-}
-
-static void
-e_entry_make_completion_window_transient (EEntry *entry)
-{
- GtkWidget *w;
-
- if (entry->priv->have_set_transient || entry->priv->completion_view_popup == NULL)
- return;
-
- w = GTK_WIDGET (entry)->parent;
- while (w && ! GTK_IS_WINDOW (w))
- w = w->parent;
-
- if (w) {
- gtk_window_set_transient_for (GTK_WINDOW (entry->priv->completion_view_popup),
- GTK_WINDOW (w));
- entry->priv->have_set_transient = 1;
- }
-}
-
-void
-e_entry_enable_completion_full (EEntry *entry, ECompletion *completion, gint delay, EEntryCompletionHandler handler)
-{
- g_return_if_fail (entry != NULL && E_IS_ENTRY (entry));
- g_return_if_fail (completion != NULL && E_IS_COMPLETION (completion));
-
- /* For now, completion can't be changed mid-stream. */
- g_return_if_fail (entry->priv->completion == NULL);
-
- entry->priv->completion = completion;
- g_object_ref (completion);
- gtk_object_sink (GTK_OBJECT (completion));
-
- entry->priv->completion_delay = delay;
- entry->priv->handler = handler;
-
- entry->priv->completion_view = e_completion_view_new (completion);
- /* Make the up and down keys enable and disable completions. */
- e_completion_view_set_complete_key (E_COMPLETION_VIEW (entry->priv->completion_view), GDK_Down);
- e_completion_view_set_uncomplete_key (E_COMPLETION_VIEW (entry->priv->completion_view), GDK_Up);
-
- g_signal_connect_after (entry->priv->completion_view,
- "button_press_event",
- G_CALLBACK (button_press_cb),
- entry);
-
- entry->priv->nonempty_signal_id = g_signal_connect (entry->priv->completion_view,
- "nonempty",
- G_CALLBACK (nonempty_cb),
- entry);
-
- entry->priv->added_signal_id = g_signal_connect (entry->priv->completion_view,
- "added",
- G_CALLBACK (added_cb),
- entry);
-
- entry->priv->full_signal_id = g_signal_connect (entry->priv->completion_view,
- "full",
- G_CALLBACK (full_cb),
- entry);
-
- entry->priv->browse_signal_id = g_signal_connect (entry->priv->completion_view,
- "browse",
- G_CALLBACK (browse_cb),
- entry);
-
- entry->priv->unbrowse_signal_id = g_signal_connect (entry->priv->completion_view,
- "unbrowse",
- G_CALLBACK (unbrowse_cb),
- entry);
-
- entry->priv->activate_signal_id = g_signal_connect (entry->priv->completion_view,
- "activate",
- G_CALLBACK (activate_cb),
- entry);
-
- entry->priv->completion_view_popup = gtk_window_new (GTK_WINDOW_POPUP);
-
- e_entry_make_completion_window_transient (entry);
-
- g_signal_connect (entry->item->model,
- "cancel_completion",
- G_CALLBACK (cancel_completion_cb),
- entry);
-
- g_signal_connect (entry->priv->completion_view_popup,
- "key_press_event",
- G_CALLBACK (key_press_cb),
- entry->canvas);
- g_signal_connect (entry->priv->completion_view_popup,
- "key_release_event",
- G_CALLBACK (key_release_cb),
- entry->canvas);
-
- e_completion_view_connect_keys (E_COMPLETION_VIEW (entry->priv->completion_view),
- GTK_WIDGET (entry->canvas));
-
- g_object_ref (entry->priv->completion_view_popup);
- gtk_object_sink (GTK_OBJECT (entry->priv->completion_view_popup));
- gtk_window_set_policy (GTK_WINDOW (entry->priv->completion_view_popup), TRUE, TRUE, TRUE);
- gtk_container_add (GTK_CONTAINER (entry->priv->completion_view_popup), entry->priv->completion_view);
- gtk_widget_show (entry->priv->completion_view);
-}
-
-gboolean
-e_entry_completion_popup_is_visible (EEntry *entry)
-{
- g_return_val_if_fail (E_IS_ENTRY (entry), FALSE);
-
- return entry->priv->popup_is_visible;
-}
-
-/** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** **/
-
-static void
-et_get_property (GObject *object,
- guint prop_id,
- GValue *value,
- GParamSpec *pspec)
-{
- EEntry *entry = E_ENTRY (object);
- GtkObject *item = GTK_OBJECT (entry->item);
-
- switch (prop_id){
- case PROP_MODEL:
- g_object_get_property (G_OBJECT (item), "model", value);
- break;
- case PROP_EVENT_PROCESSOR:
- g_object_get_property (G_OBJECT (item), "event_processor", value);
- break;
- case PROP_TEXT:
- g_object_get_property (G_OBJECT (item), "text", value);
- break;
-
- case PROP_FONT_GDK:
- g_object_get_property (G_OBJECT (item), "font_gdk", value);
- break;
-
- case PROP_JUSTIFICATION:
- g_object_get_property (G_OBJECT (item), "justification", value);
- break;
-
- case PROP_FILL_COLOR_GDK:
- g_object_get_property (G_OBJECT (item), "fill_color_gdk", value);
- break;
-
- case PROP_FILL_COLOR_RGBA:
- g_object_get_property (G_OBJECT (item), "fill_color_rgba", value);
- break;
-
- case PROP_FILL_STIPPLE:
- g_object_get_property (G_OBJECT (item), "fill_stiple", value);
- break;
-
- case PROP_EDITABLE:
- g_object_get_property (G_OBJECT (item), "editable", value);
- break;
-
- case PROP_USE_ELLIPSIS:
- g_object_get_property (G_OBJECT (item), "use_ellipsis", value);
- break;
-
- case PROP_ELLIPSIS:
- g_object_get_property (G_OBJECT (item), "ellipsis", value);
- break;
-
- case PROP_LINE_WRAP:
- g_object_get_property (G_OBJECT (item), "line_wrap", value);
- break;
-
- case PROP_BREAK_CHARACTERS:
- g_object_get_property (G_OBJECT (item), "break_characters", value);
- break;
-
- case PROP_MAX_LINES:
- g_object_get_property (G_OBJECT (item), "max_lines", value);
- break;
- case PROP_ALLOW_NEWLINES:
- g_object_get_property (G_OBJECT (item), "allow_newlines", value);
- break;
-
- case PROP_DRAW_BORDERS:
- g_value_set_boolean (value, entry->priv->draw_borders);
- break;
-
- case PROP_DRAW_BACKGROUND:
- g_object_get_property (G_OBJECT (item), "draw_background", value);
- break;
-
- case PROP_DRAW_BUTTON:
- g_object_get_property (G_OBJECT (item), "draw_button", value);
- break;
-
- case PROP_EMULATE_LABEL_RESIZE:
- g_value_set_boolean (value, entry->priv->emulate_label_resize);
- break;
-
- case PROP_CURSOR_POS:
- g_object_get_property (G_OBJECT (item), "cursor_pos", value);
-
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
- break;
- }
-}
-
-static void
-et_set_property (GObject *object,
- guint prop_id,
- const GValue *value,
- GParamSpec *pspec)
-{
- EEntry *entry = E_ENTRY (object);
- GtkObject *item = GTK_OBJECT (entry->item);
- GtkAnchorType anchor;
- double width, height;
- gint xthick;
- gint ythick;
- GtkWidget *widget = GTK_WIDGET(entry->canvas);
-
- d(g_print("%s: prop_id: %d\n", __FUNCTION__, prop_id));
-
- switch (prop_id){
- case PROP_MODEL:
- g_object_set_property (G_OBJECT (item), "model", value);
- if (entry->priv->emulate_label_resize)
- gtk_widget_queue_resize (widget);
- break;
-
- case PROP_EVENT_PROCESSOR:
- g_object_set_property (G_OBJECT (item), "event_processor", value);
- break;
-
- case PROP_TEXT:
- g_object_set_property (G_OBJECT (item), "text", value);
- d(g_print("%s: text: %s\n", __FUNCTION__, g_value_get_string (value)));
- if (entry->priv->emulate_label_resize)
- gtk_widget_queue_resize (widget);
- break;
-
- case PROP_FONT:
- g_object_set_property (G_OBJECT (item), "font", value);
- d(g_print("%s: font: %s\n", __FUNCTION__, g_value_get_string (value)));
- if (entry->priv->emulate_label_resize)
- gtk_widget_queue_resize (widget);
- break;
-
- case PROP_FONTSET:
- g_object_set_property (G_OBJECT (item), "fontset", value);
- if (entry->priv->emulate_label_resize)
- gtk_widget_queue_resize (widget);
- break;
-
- case PROP_FONT_GDK:
- g_object_set_property (G_OBJECT (item), "font_gdk", value);
- if (entry->priv->emulate_label_resize)
- gtk_widget_queue_resize (widget);
- break;
-
- case PROP_JUSTIFICATION:
- entry->priv->justification = g_value_get_enum (value);
- g_object_get(item,
- "clip_width", &width,
- "clip_height", &height,
- NULL);
-
- if (entry->priv->draw_borders) {
- xthick = 0;
- ythick = 0;
- } else {
- xthick = widget->style->xthickness;
- ythick = widget->style->ythickness;
- }
-
- switch (entry->priv->justification) {
- case GTK_JUSTIFY_CENTER:
- anchor = GTK_ANCHOR_N;
- e_canvas_item_move_absolute(GNOME_CANVAS_ITEM(entry->item), width / 2, ythick);
- break;
- case GTK_JUSTIFY_RIGHT:
- anchor = GTK_ANCHOR_NE;
- e_canvas_item_move_absolute(GNOME_CANVAS_ITEM(entry->item), width - xthick, ythick);
- break;
- default:
- anchor = GTK_ANCHOR_NW;
- e_canvas_item_move_absolute(GNOME_CANVAS_ITEM(entry->item), xthick, ythick);
- break;
- }
- g_object_set(item,
- "justification", entry->priv->justification,
- "anchor", anchor,
- NULL);
- break;
-
- case PROP_FILL_COLOR:
- g_object_set_property (G_OBJECT (item), "fill_color", value);
- break;
-
- case PROP_FILL_COLOR_GDK:
- g_object_set_property (G_OBJECT (item), "fill_color_gdk", value);
- break;
-
- case PROP_FILL_COLOR_RGBA:
- g_object_set_property (G_OBJECT (item), "fill_color_rgba", value);
- break;
-
- case PROP_FILL_STIPPLE:
- g_object_set_property (G_OBJECT (item), "fill_stiple", value);
- break;
-
- case PROP_EDITABLE:
- g_object_set_property (G_OBJECT (item), "editable", value);
- break;
-
- case PROP_USE_ELLIPSIS:
- g_object_set_property (G_OBJECT (item), "use_ellipsis", value);
- if (entry->priv->emulate_label_resize)
- gtk_widget_queue_resize (widget);
- break;
-
- case PROP_ELLIPSIS:
- g_object_set_property (G_OBJECT (item), "ellipsis", value);
- if (entry->priv->emulate_label_resize)
- gtk_widget_queue_resize (widget);
- break;
-
- case PROP_LINE_WRAP:
- g_object_set_property (G_OBJECT (item), "line_wrap", value);
- if (entry->priv->emulate_label_resize)
- gtk_widget_queue_resize (widget);
- break;
-
- case PROP_BREAK_CHARACTERS:
- g_object_set_property (G_OBJECT (item), "break_characters", value);
- if (entry->priv->emulate_label_resize)
- gtk_widget_queue_resize (widget);
- break;
-
- case PROP_MAX_LINES:
- g_object_set_property (G_OBJECT (item), "max_lines", value);
- if (entry->priv->emulate_label_resize)
- gtk_widget_queue_resize (widget);
- break;
-
- case PROP_ALLOW_NEWLINES:
- g_object_set_property (G_OBJECT (item), "allow_newlines", value);
- break;
-
- case PROP_DRAW_BORDERS:
- if (entry->priv->draw_borders != g_value_get_boolean (value)) {
- entry->priv->draw_borders = g_value_get_boolean (value);
- g_object_set (item,
- "draw_borders", entry->priv->draw_borders,
- NULL);
- gtk_widget_queue_resize (GTK_WIDGET (entry));
- }
- break;
-
- case PROP_CURSOR_POS:
- g_object_set_property (G_OBJECT (item), "cursor_pos", value);
- break;
-
- case PROP_DRAW_BACKGROUND:
- g_object_set_property (G_OBJECT (item), "draw_background", value);
- break;
-
- case PROP_DRAW_BUTTON:
- g_object_set_property (G_OBJECT (item), "draw_button", value);
- break;
-
- case PROP_EMULATE_LABEL_RESIZE:
- if (entry->priv->emulate_label_resize != g_value_get_boolean (value)) {
- entry->priv->emulate_label_resize = g_value_get_boolean (value);
- gtk_widget_queue_resize (widget);
- }
- break;
- }
-}
-
-static void
-e_entry_dispose (GObject *object)
-{
- EEntry *entry = E_ENTRY (object);
-
- if (entry->priv) {
- if (entry->priv->completion_delay_tag)
- gtk_timeout_remove (entry->priv->completion_delay_tag);
-
- if (entry->priv->completion)
- g_object_unref (entry->priv->completion);
-
- if (entry->priv->ptr_grab) {
- gdk_pointer_ungrab (GDK_CURRENT_TIME);
- gtk_grab_remove (GTK_WIDGET (entry->priv->completion_view));
- }
-
- if (entry->priv->completion_view_popup) {
- gtk_widget_destroy (GTK_WIDGET (entry->priv->completion_view_popup));
- g_object_unref (entry->priv->completion_view_popup);
- }
- g_free (entry->priv->pre_browse_text);
-
- if (entry->priv->changed_since_keypress_tag)
- gtk_timeout_remove (entry->priv->changed_since_keypress_tag);
-
- g_free (entry->priv);
- entry->priv = NULL;
- }
-
- if (G_OBJECT_CLASS (parent_class)->dispose)
- (* G_OBJECT_CLASS (parent_class)->dispose) (object);
-}
-
-static void
-e_entry_realize (GtkWidget *widget)
-{
- EEntry *entry;
-
- if (GTK_WIDGET_CLASS (parent_class)->realize)
- (* GTK_WIDGET_CLASS (parent_class)->realize) (widget);
-
- entry = E_ENTRY (widget);
-
- e_entry_make_completion_window_transient (entry);
-
- if (entry->priv->emulate_label_resize) {
- d(g_print("%s: queue_resize\n", __FUNCTION__));
- gtk_widget_queue_resize (GTK_WIDGET (entry->canvas));
- }
-}
-
-static void
-e_entry_class_init (GObjectClass *object_class)
-{
- EEntryClass *klass = E_ENTRY_CLASS(object_class);
- GtkWidgetClass *widget_class = GTK_WIDGET_CLASS(object_class);
-
- parent_class = g_type_class_ref (PARENT_TYPE);
-
- object_class->set_property = et_set_property;
- object_class->get_property = et_get_property;
- object_class->dispose = e_entry_dispose;
-
- widget_class->realize = e_entry_realize;
-
- klass->changed = NULL;
- klass->activate = NULL;
-
- e_entry_signals[E_ENTRY_CHANGED] =
- g_signal_new ("changed",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (EEntryClass, changed),
- NULL, NULL,
- e_marshal_NONE__NONE,
- G_TYPE_NONE, 0);
-
- e_entry_signals[E_ENTRY_ACTIVATE] =
- g_signal_new ("activate",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (EEntryClass, activate),
- NULL, NULL,
- e_marshal_NONE__NONE,
- G_TYPE_NONE, 0);
-
- e_entry_signals[E_ENTRY_POPUP] =
- g_signal_new ("popup",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (EEntryClass, popup),
- NULL, NULL,
- e_marshal_NONE__POINTER_INT,
- G_TYPE_NONE, 2, G_TYPE_POINTER, G_TYPE_INT);
-
- e_entry_signals[E_ENTRY_COMPLETION_POPUP] =
- g_signal_new ("completion_popup",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (EEntryClass, completion_popup),
- NULL, NULL,
- gtk_marshal_NONE__INT,
- G_TYPE_NONE, 1, G_TYPE_INT);
-
- g_object_class_install_property (object_class, PROP_MODEL,
- g_param_spec_object ("model",
- _( "Model" ),
- _( "Model" ),
- E_TYPE_TEXT_MODEL,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_EVENT_PROCESSOR,
- g_param_spec_object ("event_processor",
- _( "Event Processor" ),
- _( "Event Processor" ),
- E_TEXT_EVENT_PROCESSOR_TYPE,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_TEXT,
- g_param_spec_string ("text",
- _( "Text" ),
- _( "Text" ),
- NULL,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_FONT,
- g_param_spec_string ("font",
- _( "Font" ),
- _( "Font" ),
- NULL,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_FONTSET,
- g_param_spec_string ("fontset",
- _( "Fontset" ),
- _( "Fontset" ),
- NULL,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_FONT_GDK,
- g_param_spec_boxed ("font_gdk",
- _( "GDKFont" ),
- _( "GDKFont" ),
- GDK_TYPE_FONT,
- G_PARAM_WRITABLE));
-
- g_object_class_install_property (object_class, PROP_JUSTIFICATION,
- g_param_spec_enum ("justification",
- _( "Justification" ),
- _( "Justification" ),
- GTK_TYPE_JUSTIFICATION, GTK_JUSTIFY_LEFT,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_FILL_COLOR,
- g_param_spec_string ("fill_color",
- _( "Fill color" ),
- _( "Fill color" ),
- NULL,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_FILL_COLOR_GDK,
- g_param_spec_boxed ("fill_color_gdk",
- _( "GDK fill color" ),
- _( "GDK fill color" ),
- GDK_TYPE_COLOR,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_FILL_COLOR_RGBA,
- g_param_spec_uint ("fill_color_rgba",
- _( "GDK fill color" ),
- _( "GDK fill color" ),
- 0, G_MAXUINT, 0,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_FILL_STIPPLE,
- g_param_spec_object ("fill_stipple",
- _( "Fill stipple" ),
- _( "FIll stipple" ),
- GDK_TYPE_WINDOW,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_EDITABLE,
- g_param_spec_boolean ("editable",
- _( "Editable" ),
- _( "Editable" ),
- FALSE,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_USE_ELLIPSIS,
- g_param_spec_boolean ("use_ellipsis",
- _( "Use ellipsis" ),
- _( "Use ellipsis" ),
- FALSE,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_ELLIPSIS,
- g_param_spec_string ("ellipsis",
- _( "Ellipsis" ),
- _( "Ellipsis" ),
- NULL,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_LINE_WRAP,
- g_param_spec_boolean ("line_wrap",
- _( "Line wrap" ),
- _( "Line wrap" ),
- FALSE,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_BREAK_CHARACTERS,
- g_param_spec_string ("break_characters",
- _( "Break characters" ),
- _( "Break characters" ),
- NULL,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_MAX_LINES,
- g_param_spec_int ("max_lines",
- _( "Max lines" ),
- _( "Max lines" ),
- 0, G_MAXINT, 0,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_ALLOW_NEWLINES,
- g_param_spec_boolean ("allow_newlines",
- _( "Allow newlines" ),
- _( "Allow newlines" ),
- FALSE,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_DRAW_BORDERS,
- g_param_spec_boolean ("draw_borders",
- _( "Draw borders" ),
- _( "Draw borders" ),
- FALSE,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_DRAW_BACKGROUND,
- g_param_spec_boolean ("draw_background",
- _( "Draw background" ),
- _( "Draw background" ),
- FALSE,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_DRAW_BUTTON,
- g_param_spec_boolean ("draw_button",
- _( "Draw button" ),
- _( "Draw button" ),
- FALSE,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_CURSOR_POS,
- g_param_spec_int ("cursor_pos",
- _( "Cursor position" ),
- _( "Cursor position" ),
- 0, G_MAXINT, 0,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_EMULATE_LABEL_RESIZE,
- g_param_spec_boolean ("emulate_label_resize",
- _( "Emulate label resize" ),
- _( "Emulate label resize" ),
- FALSE,
- G_PARAM_READWRITE));
-}
-
-E_MAKE_TYPE(e_entry, "EEntry", EEntry, e_entry_class_init, e_entry_init, PARENT_TYPE)
diff --git a/widgets/text/e-entry.h b/widgets/text/e-entry.h
deleted file mode 100644
index 8c1093638b..0000000000
--- a/widgets/text/e-entry.h
+++ /dev/null
@@ -1,87 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-entry.h - An EText-based entry widget
- * Copyright 2000, 2001, Ximian, Inc.
- *
- * Authors:
- * Chris Lahey <clahey@ximian.com>
- * Jon Trowbridge <trow@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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.
- */
-
-#ifndef _E_ENTRY_H_
-#define _E_ENTRY_H_
-
-#include <libgnomecanvas/gnome-canvas.h>
-#include <gtk/gtktable.h>
-#include <libxml/tree.h>
-#include <gal/e-text/e-text.h>
-#include "e-completion.h"
-
-G_BEGIN_DECLS
-
-#define E_ENTRY_TYPE (e_entry_get_type ())
-#define E_ENTRY(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), E_ENTRY_TYPE, EEntry))
-#define E_ENTRY_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), E_ENTRY_TYPE, EEntryClass))
-#define E_IS_ENTRY(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), E_ENTRY_TYPE))
-#define E_IS_ENTRY_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), E_ENTRY_TYPE))
-
-typedef struct _EEntry EEntry;
-typedef struct _EEntryClass EEntryClass;
-struct _EEntryPrivate;
-
-typedef void (*EEntryCompletionHandler) (EEntry *entry, ECompletionMatch *match);
-
-struct _EEntry {
- GtkTable parent;
-
- GnomeCanvas *canvas;
- EText *item;
-
- struct _EEntryPrivate *priv;
-};
-
-struct _EEntryClass {
- GtkTableClass parent_class;
-
- void (* changed) (EEntry *entry);
- void (* activate) (EEntry *entry);
- void (* popup) (EEntry *entry, GdkEventButton *ev, gint pos);
- void (* completion_popup) (EEntry *entry, gint visible);
-};
-
-GtkType e_entry_get_type (void);
-
-void e_entry_construct (EEntry *entry);
-GtkWidget *e_entry_new (void);
-
-const gchar *e_entry_get_text (EEntry *entry);
-void e_entry_set_text (EEntry *entry, const gchar *text);
-
-gint e_entry_get_position (EEntry *entry);
-void e_entry_set_position (EEntry *entry, gint);
-void e_entry_select_region (EEntry *entry, gint start, gint end);
-
-void e_entry_set_editable (EEntry *entry, gboolean editable);
-
-void e_entry_enable_completion (EEntry *entry, ECompletion *completion);
-void e_entry_enable_completion_full (EEntry *entry, ECompletion *completion, gint autocomplete_delay,
- EEntryCompletionHandler handler);
-gboolean e_entry_completion_popup_is_visible (EEntry *entry);
-
-G_END_DECLS
-
-#endif /* _E_ENTRY_H_ */
diff --git a/widgets/text/e-table-text-model.c b/widgets/text/e-table-text-model.c
deleted file mode 100644
index 909a982528..0000000000
--- a/widgets/text/e-table-text-model.c
+++ /dev/null
@@ -1,234 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-table-text-model.c
- * Copyright 2000, 2001, Ximian, Inc.
- *
- * Authors:
- * Chris Lahey <clahey@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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 <ctype.h>
-#include <gtk/gtksignal.h>
-#include <gal/util/e-util.h>
-#include "e-table-text-model.h"
-
-static void e_table_text_model_class_init (ETableTextModelClass *class);
-static void e_table_text_model_init (ETableTextModel *model);
-static void e_table_text_model_dispose (GObject *object);
-
-static const gchar *e_table_text_model_get_text (ETextModel *model);
-static void e_table_text_model_set_text (ETextModel *model, const gchar *text);
-static void e_table_text_model_insert (ETextModel *model, gint postion, const gchar *text);
-static void e_table_text_model_insert_length (ETextModel *model, gint postion, const gchar *text, gint length);
-static void e_table_text_model_delete (ETextModel *model, gint postion, gint length);
-
-#define PARENT_TYPE E_TYPE_TEXT_MODEL
-static GtkObject *parent_class;
-
-
-
-/**
- * e_table_text_model_get_type:
- * @void:
- *
- * Registers the &ETableTextModel class if necessary, and returns the type ID
- * associated to it.
- *
- * Return value: The type ID of the &ETableTextModel class.
- **/
-E_MAKE_TYPE (e_table_text_model,
- "ETableTextModel",
- ETableTextModel,
- e_table_text_model_class_init,
- e_table_text_model_init,
- PARENT_TYPE)
-
-/* Class initialization function for the text item */
-static void
-e_table_text_model_class_init (ETableTextModelClass *klass)
-{
- GObjectClass *object_class;
- ETextModelClass *model_class;
-
- object_class = (GObjectClass *) klass;
- model_class = (ETextModelClass *) klass;
-
- parent_class = g_type_class_ref (PARENT_TYPE);
-
- model_class->get_text = e_table_text_model_get_text;
- model_class->set_text = e_table_text_model_set_text;
- model_class->insert = e_table_text_model_insert;
- model_class->insert_length = e_table_text_model_insert_length;
- model_class->delete = e_table_text_model_delete;
-
- object_class->dispose = e_table_text_model_dispose;
-}
-
-/* Object initialization function for the text item */
-static void
-e_table_text_model_init (ETableTextModel *model)
-{
- model->model = NULL;
- model->row = 0;
- model->model_col = 0;
- model->cell_changed_signal_id = 0;
- model->row_changed_signal_id = 0;
-}
-
-/* Dispose handler for the text item */
-static void
-e_table_text_model_dispose (GObject *object)
-{
- ETableTextModel *model;
-
- g_return_if_fail (object != NULL);
- g_return_if_fail (E_IS_TABLE_TEXT_MODEL (object));
-
- model = E_TABLE_TEXT_MODEL (object);
-
- if (model->model)
- g_assert (GTK_IS_OBJECT (model->model));
-
- if (model->cell_changed_signal_id)
- g_signal_handler_disconnect (model->model,
- model->cell_changed_signal_id);
- model->cell_changed_signal_id = 0;
-
- if (model->row_changed_signal_id)
- g_signal_handler_disconnect (model->model,
- model->row_changed_signal_id);
- model->row_changed_signal_id = 0;
-
- if (model->model)
- g_object_unref (model->model);
- model->model = NULL;
-
- if (G_OBJECT_CLASS (parent_class)->dispose)
- (* G_OBJECT_CLASS (parent_class)->dispose) (object);
-}
-static const gchar *
-e_table_text_model_get_text (ETextModel *text_model)
-{
- ETableTextModel *model = E_TABLE_TEXT_MODEL(text_model);
- if (model->model)
- return (gchar *)e_table_model_value_at (model->model, model->model_col, model->row);
- else
- return "";
-}
-
-static void
-e_table_text_model_set_text (ETextModel *text_model, const gchar *text)
-{
- ETableTextModel *model = E_TABLE_TEXT_MODEL(text_model);
- if (model->model)
- e_table_model_set_value_at (model->model, model->model_col, model->row, (void *) text);
-}
-
-static void
-e_table_text_model_insert (ETextModel *text_model, gint position, const gchar *text)
-{
- ETableTextModel *model = E_TABLE_TEXT_MODEL(text_model);
- if (model->model){
- gchar *temp = (gchar *)e_table_model_value_at (model->model, model->model_col, model->row);
- /* Can't use g_strdup_printf here because on some
- systems printf ("%.*s"); is locale dependent. */
- temp = e_strdup_append_strings (temp, position,
- text, -1,
- temp + position, -1,
- NULL);
- e_table_model_set_value_at (model->model, model->model_col, model->row, temp);
- g_free (temp);
- }
-}
-
-static void
-e_table_text_model_insert_length (ETextModel *text_model, gint position, const gchar *text, gint length)
-{
- ETableTextModel *model = E_TABLE_TEXT_MODEL(text_model);
- if (model->model){
- gchar *temp = (gchar *)e_table_model_value_at (model->model, model->model_col, model->row);
- /* Can't use g_strdup_printf here because on some
- systems printf ("%.*s"); is locale dependent. */
- temp = e_strdup_append_strings (temp, position,
- text, length,
- temp + position, -1,
- NULL);
- e_table_model_set_value_at (model->model, model->model_col, model->row, temp);
- g_free (temp);
- }
-}
-
-static void
-e_table_text_model_delete (ETextModel *text_model, gint position, gint length)
-{
- ETableTextModel *model = E_TABLE_TEXT_MODEL(text_model);
- if (model->model){
- gchar *temp = (gchar *)e_table_model_value_at (model->model, model->model_col, model->row);
- /* Can't use g_strdup_printf here because on some
- systems printf ("%.*s"); is locale dependent. */
- temp = e_strdup_append_strings (temp, position,
- temp + position + length, -1,
- NULL);
- e_table_model_set_value_at (model->model, model->model_col, model->row, temp);
- g_free (temp);
- }
-}
-
-static void
-cell_changed (ETableModel *table_model, int model_col, int row, ETableTextModel *model)
-{
- if (model->model_col == model_col &&
- model->row == row)
- e_text_model_changed (E_TEXT_MODEL(model));
-}
-
-static void
-row_changed (ETableModel *table_model, int row, ETableTextModel *model)
-{
- if (model->row == row)
- e_text_model_changed (E_TEXT_MODEL(model));
-}
-
-ETableTextModel *
-e_table_text_model_new (ETableModel *table_model, int row, int model_col)
-{
- ETableTextModel *model;
-
- g_return_val_if_fail(table_model != NULL, NULL);
- g_return_val_if_fail(E_IS_TABLE_MODEL(table_model), NULL);
-
- model = g_object_new (E_TYPE_TABLE_TEXT_MODEL, NULL);
- model->model = table_model;
- if (model->model){
- g_object_ref (model->model);
- model->cell_changed_signal_id =
- g_signal_connect (model->model,
- "model_cell_changed",
- G_CALLBACK(cell_changed),
- model);
- model->row_changed_signal_id =
- g_signal_connect (model->model,
- "model_row_changed",
- G_CALLBACK(row_changed),
- model);
- }
- model->row = row;
- model->model_col = model_col;
- return model;
-}
-
diff --git a/widgets/text/e-table-text-model.h b/widgets/text/e-table-text-model.h
deleted file mode 100644
index 46e82de1c4..0000000000
--- a/widgets/text/e-table-text-model.h
+++ /dev/null
@@ -1,64 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-table-text-model.h
- * Copyright 2000, 2001, Ximian, Inc.
- *
- * Authors:
- * Chris Lahey <clahey@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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.
- */
-
-#ifndef E_TABLE_TEXT_MODEL_H
-#define E_TABLE_TEXT_MODEL_H
-
-#include <gal/e-text/e-text-model.h>
-#include <gal/e-table/e-table-model.h>
-
-G_BEGIN_DECLS
-
-#define E_TYPE_TABLE_TEXT_MODEL (e_table_text_model_get_type ())
-#define E_TABLE_TEXT_MODEL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), E_TYPE_TABLE_TEXT_MODEL, ETableTextModel))
-#define E_TABLE_TEXT_MODEL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), E_TYPE_TABLE_TEXT_MODEL, ETableTextModelClass))
-#define E_IS_TABLE_TEXT_MODEL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), E_TYPE_TABLE_TEXT_MODEL))
-#define E_IS_TABLE_TEXT_MODEL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), E_TYPE_TABLE_TEXT_MODEL))
-
-typedef struct _ETableTextModel ETableTextModel;
-typedef struct _ETableTextModelClass ETableTextModelClass;
-
-struct _ETableTextModel {
- ETextModel parent;
-
- ETableModel *model;
- int row;
- int model_col;
-
- int cell_changed_signal_id;
- int row_changed_signal_id;
-};
-
-struct _ETableTextModelClass {
- ETextModelClass parent_class;
-
-};
-
-
-/* Standard Gtk function */
-GtkType e_table_text_model_get_type (void);
-ETableTextModel *e_table_text_model_new (ETableModel *table_model, int row, int model_col);
-
-G_END_DECLS
-
-#endif
diff --git a/widgets/text/e-text-model-repos.c b/widgets/text/e-text-model-repos.c
deleted file mode 100644
index 17ffe07578..0000000000
--- a/widgets/text/e-text-model-repos.c
+++ /dev/null
@@ -1,87 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-text-model-repos.c - Standard ETextModelReposFn definitions
- * Copyright 2000, 2001, Ximian, Inc.
- *
- * Authors:
- * Jon Trowbridge <trow@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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 "e-text-model-repos.h"
-
-#define MODEL_CLAMP(model, pos) (CLAMP((pos), 0, strlen((model)->text)))
-
-gint
-e_repos_shift (gint pos, gpointer data)
-{
- EReposShift *info = (EReposShift *) data;
- g_return_val_if_fail (data, -1);
-
- return e_text_model_validate_position (info->model, pos + info->change);
-}
-
-gint
-e_repos_absolute (gint pos, gpointer data)
-{
- EReposAbsolute *info = (EReposAbsolute *) data;
- g_return_val_if_fail (data, -1);
-
- pos = info->pos;
- if (pos < 0) {
- gint len = e_text_model_get_text_length (info->model);
- pos += len + 1;
- }
-
- return e_text_model_validate_position (info->model, pos);
-}
-
-gint
-e_repos_insert_shift (gint pos, gpointer data)
-{
- EReposInsertShift *info = (EReposInsertShift *) data;
- g_return_val_if_fail (data, -1);
-
- if (pos >= info->pos)
- pos += info->len;
-
- return e_text_model_validate_position (info->model, pos);
-}
-
-gint
-e_repos_delete_shift (gint pos, gpointer data)
-{
- EReposDeleteShift *info = (EReposDeleteShift *) data;
- g_return_val_if_fail (data, -1);
-
- if (pos > info->pos + info->len)
- pos -= info->len;
- else if (pos > info->pos)
- pos = info->pos;
-
- return e_text_model_validate_position (info->model, pos);
-}
-
-gint
-e_repos_clamp (gint pos, gpointer data)
-{
- ETextModel *model;
-
- g_return_val_if_fail (data != NULL && E_IS_TEXT_MODEL (data), -1);
- model = E_TEXT_MODEL (data);
-
- return e_text_model_validate_position (model, pos);
-}
diff --git a/widgets/text/e-text-model-repos.h b/widgets/text/e-text-model-repos.h
deleted file mode 100644
index 5f0c93ee6a..0000000000
--- a/widgets/text/e-text-model-repos.h
+++ /dev/null
@@ -1,69 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-text-model-repos.h - Standard ETextModelReposFn definitions
- * Copyright 2000, 2001, Ximian, Inc.
- *
- * Authors:
- * Jon Trowbridge <trow@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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.
- */
-
-#ifndef E_TEXT_MODEL_REPOS_H
-#define E_TEXT_MODEL_REPOS_H
-
-#include "e-text-model.h"
-
-typedef struct {
- ETextModel *model;
- gint change; /* Relative change to position. */
-} EReposShift;
-
-gint e_repos_shift (gint pos, gpointer data);
-
-
-typedef struct {
- ETextModel *model;
- gint pos; /* Position to move to. Negative values count from the end buffer.
- (i.e. -1 puts cursor at the end, -2 one character from end, etc.) */
-} EReposAbsolute;
-
-gint e_repos_absolute (gint pos, gpointer data);
-
-
-typedef struct {
- ETextModel *model;
- gint pos; /* Location of first inserted character. */
- gint len; /* Number of characters inserted. */
-} EReposInsertShift;
-
-gint e_repos_insert_shift (gint pos, gpointer data);
-
-
-typedef struct {
- ETextModel *model;
- gint pos; /* Location of first deleted character. */
- gint len; /* Number of characters deleted. */
-} EReposDeleteShift;
-
-gint e_repos_delete_shift (gint pos, gpointer data);
-
-
-/* For e_repos_clamp, data is a pointer to an ETextModel. The only repositioning
- that occurs is to avoid buffer overruns. */
-
-gint e_repos_clamp (gint pos, gpointer data);
-
-#endif
diff --git a/widgets/text/e-text-model-test.c b/widgets/text/e-text-model-test.c
deleted file mode 100644
index 4913b7774e..0000000000
--- a/widgets/text/e-text-model-test.c
+++ /dev/null
@@ -1,91 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-text-model-test.c
- * Copyright 2000, 2001, Ximian, Inc.
- *
- * Authors:
- * Chris Lahey <clahey@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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 <gnome.h>
-#include <gal/widgets/e-canvas.h>
-#include "e-text-model.h"
-#include "e-text-model-uri.h"
-#include "e-text.h"
-#include <gal/util/e-util.h>
-
-#if 0
-static void
-describe_model (ETextModel *model)
-{
- gint i, N;
- g_return_if_fail (E_IS_TEXT_MODEL (model));
-
- N = e_text_model_object_count (model);
-
- g_print ("text: %s\n", e_text_model_get_text (model));
- g_print ("objs: %d\n", N);
-
- for (i=0; i<N; ++i) {
- gchar *s = e_text_model_strdup_nth_object (model, i);
- g_print ("obj%d: %s\n", i, s);
- g_free (s);
- }
-}
-#endif
-
-int
-main (int argc, gchar **argv)
-{
- GtkWidget *win[2], *canvas[2];
- GnomeCanvasItem *item[2];
- ETextModel *model;
- gint i;
-
- gnome_init ("ETextModelTest", "0.0", argc, argv);
-
- model = e_text_model_uri_new ();
-
- e_text_model_set_text (model, "My favorite website is http://www.ximian.com. My next favorite www.assbarn.com.");
-
- // describe_model (model);
-
- for (i=0; i<2; ++i) {
- win[i] = gtk_window_new (GTK_WINDOW_TOPLEVEL);
-
- gtk_widget_push_colormap (gdk_rgb_get_cmap ());
- canvas[i] = e_canvas_new ();
- gtk_widget_pop_colormap ();
-
- item[i] = gnome_canvas_item_new (gnome_canvas_root (GNOME_CANVAS (canvas[i])),
- e_text_get_type (),
- "model", model,
- "font", "-adobe-helvetica-medium-r-normal--12-120-75-75-p-67-iso8859-1",
- "anchor", GTK_ANCHOR_NORTH,
- "line_wrap", TRUE,
- "width", 150.0,
- "editable", TRUE,
- NULL);
-
- gtk_container_add (GTK_CONTAINER (win[i]), canvas[i]);
- gtk_widget_show_all (win[i]);
- }
-
- gtk_main ();
-
- return 0;
-}
diff --git a/widgets/text/e-text-model-uri.c b/widgets/text/e-text-model-uri.c
deleted file mode 100644
index 858771b481..0000000000
--- a/widgets/text/e-text-model-uri.c
+++ /dev/null
@@ -1,344 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-text-model-uri.c - a text model w/ clickable URIs
- * Copyright 2000, 2001, Ximian, Inc.
- *
- * Authors:
- * Jon Trowbridge <trow@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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 "e-text-model-uri.h"
-
-#include <ctype.h>
-#include <sys/types.h>
-#include <regex.h>
-#include <gtk/gtkmain.h>
-#include <libgnome/gnome-url.h>
-#include <gal/util/e-util.h>
-
-static void e_text_model_uri_class_init (ETextModelURIClass *class);
-static void e_text_model_uri_init (ETextModelURI *model);
-static void e_text_model_uri_dispose (GObject *object);
-
-static void objectify_uris (ETextModelURI *model);
-
-static void e_text_model_uri_objectify (ETextModel *model);
-static gint e_text_model_uri_validate_pos (ETextModel *model, gint pos);
-static gint e_text_model_uri_get_obj_count (ETextModel *model);
-static const gchar *e_text_model_uri_get_nth_object (ETextModel *model, gint i, gint *len);
-static void e_text_model_uri_activate_nth_object (ETextModel *model, gint);
-
-typedef struct _ObjInfo ObjInfo;
-struct _ObjInfo {
- gint offset, len;
-};
-
-#define PARENT_TYPE E_TYPE_TEXT_MODEL
-static GtkObject *parent_class;
-
-E_MAKE_TYPE (e_text_model_uri,
- "ETextModelURI",
- ETextModelURI,
- e_text_model_uri_class_init,
- e_text_model_uri_init,
- PARENT_TYPE)
-
-static void
-e_text_model_uri_class_init (ETextModelURIClass *klass)
-{
- GObjectClass *object_class;
- ETextModelClass *model_class;
-
- object_class = (GObjectClass *) klass;
- model_class = E_TEXT_MODEL_CLASS (klass);
-
- parent_class = g_type_class_ref (PARENT_TYPE);
-
- object_class->dispose = e_text_model_uri_dispose;
-
- model_class->object_activated = e_text_model_uri_activate_nth_object;
-
- model_class->objectify = e_text_model_uri_objectify;
- model_class->validate_pos = e_text_model_uri_validate_pos;
- model_class->obj_count = e_text_model_uri_get_obj_count;
- model_class->get_nth_obj = e_text_model_uri_get_nth_object;
-
-}
-
-static void
-e_text_model_uri_init (ETextModelURI *model)
-{
-
-}
-
-static void
-e_text_model_uri_dispose (GObject *object)
-{
- ETextModelURI *model_uri = E_TEXT_MODEL_URI (object);
- GList *iter;
-
- if (model_uri->objectify_idle) {
- gtk_idle_remove (model_uri->objectify_idle);
- model_uri->objectify_idle = 0;
- }
-
- for (iter = model_uri->uris; iter != NULL; iter = g_list_next (iter))
- g_free (iter->data);
- g_list_free (model_uri->uris);
- model_uri->uris = NULL;
-
- if (G_OBJECT_CLASS (parent_class)->dispose)
- (* G_OBJECT_CLASS (parent_class)->dispose) (object);
-
-}
-
-static const gchar *uri_regex[] = {
- "(((news|telnet|nttp|file|http|ftp|https)://)|(www|ftp))[-A-Za-z0-9\\.]+(:[0-9]*)?/[-A-Za-z0-9_\\$\\.\\+\\!\\*\\(\\),;:@&=\\?/~\\#\\%]*[^]'\\.}>\\) ,\\\"]",
- "(((news|telnet|nttp|file|http|ftp|https)://)|(www|ftp))[-A-Za-z0-9\\.]+[-A-Za-z0-9](:[0-9]*)?",
- "mailto:[A-Za-z0-9_]+@[-A-Za-z0-9_]+\\.[-A-Za-z0-9\\.]+[-A-Za-z0-9]",
- NULL
-};
-static gint regex_count = 0;
-static regex_t *regex_compiled = NULL;
-
-static void
-regex_init (void)
-{
- gint i;
-
- if (regex_count != 0)
- return;
-
- while (uri_regex[regex_count]) ++regex_count;
-
- regex_compiled = g_new0 (regex_t, regex_count);
-
- for (i=0; i<regex_count; ++i) {
- if (regcomp (&regex_compiled[i], uri_regex[i], REG_EXTENDED))
- g_error ("Bad regex?: %s", uri_regex[i]);
- }
-}
-
-
-static void
-objectify_uris (ETextModelURI *model_uri)
-{
- static gboolean objectifying = FALSE;
-
- ETextModel *model = E_TEXT_MODEL (model_uri);
- const gchar *txt;
- GList *iter, *old_uris;
- gint offset, len;
- gboolean found_match;
- regmatch_t match;
- gboolean changed;
-
- if (objectifying)
- return;
-
- objectifying = TRUE;
-
- if (regex_count == 0)
- regex_init ();
-
- txt = e_text_model_get_text (model);
- len = e_text_model_get_text_length (model);
-
- old_uris = model_uri->uris;
- model_uri->uris = NULL;
-
- if (txt) {
- offset = 0;
- found_match = TRUE;
-
- while (offset < len && found_match) {
-
- gint i, so=-1, eo=-1;
-
- found_match = FALSE;
-
- for (i=0; i<regex_count; ++i) {
-
- if (regexec (&regex_compiled[i], txt+offset, 1, &match, 0) == 0) {
-
- /* Take earliest match possible. In case of a tie, take the
- largest possible match. */
- if (!found_match
- || match.rm_so < so
- || (match.rm_so == so && match.rm_eo > eo)) {
- so = match.rm_so;
- eo = match.rm_eo;
- }
- found_match = TRUE;
- }
- }
-
- if (found_match) {
-
- ObjInfo *info = g_new0 (ObjInfo, 1);
- info->offset = offset + so;
- info->len = eo - so;
-
- model_uri->uris = g_list_append (model_uri->uris, info);
-
- offset += eo;
- }
- }
- }
-
- changed = (g_list_length (old_uris) != g_list_length (model_uri->uris));
-
- if (!changed) {
- /* Check that there is a 1-1 correspondence between object positions. */
- GList *jter;
-
- for (iter = model_uri->uris; iter != NULL && !changed; iter = g_list_next (iter)) {
- ObjInfo *info = (ObjInfo *) iter->data;
- found_match = FALSE;
- for (jter = old_uris; jter != NULL && !found_match; jter = g_list_next (jter)) {
- ObjInfo *jnfo = (ObjInfo *) jter->data;
-
- if (info->offset == jnfo->offset && info->len == jnfo->len)
- found_match = TRUE;
- }
- changed = !found_match;
- }
- }
-
- if (changed)
- e_text_model_changed (model);
-
- /* Free old uris */
- for (iter = old_uris; iter != NULL; iter = g_list_next (iter))
- g_free (iter->data);
- g_list_free (old_uris);
-
- objectifying = FALSE;
-}
-
-static gboolean
-objectify_idle_cb (gpointer ptr)
-{
- ETextModelURI *model_uri = E_TEXT_MODEL_URI (ptr);
-
- g_assert (model_uri->objectify_idle);
- objectify_uris (model_uri);
- model_uri->objectify_idle = 0;
-
- return FALSE;
-}
-
-static void
-e_text_model_uri_objectify (ETextModel *model)
-{
- ETextModelURI *model_uri = E_TEXT_MODEL_URI (model);
-
- if (model_uri->objectify_idle == 0)
- model_uri->objectify_idle = gtk_idle_add (objectify_idle_cb, model);
-
- if (E_TEXT_MODEL_CLASS(parent_class)->objectify)
- E_TEXT_MODEL_CLASS(parent_class)->objectify (model);
-}
-
-static void
-objectify_idle_flush (ETextModelURI *model_uri)
-{
- if (model_uri->objectify_idle) {
- gtk_idle_remove (model_uri->objectify_idle);
- model_uri->objectify_idle = 0;
- objectify_uris (model_uri);
- }
-}
-
-static gint
-e_text_model_uri_validate_pos (ETextModel *model, gint pos)
-{
- gint obj_num;
-
- /* Cause us to skip over objects */
-
- obj_num = e_text_model_get_object_at_offset (model, pos);
- if (obj_num != -1) {
- gint pos0, pos1, mp;
- e_text_model_get_nth_object_bounds (model, obj_num, &pos0, &pos1);
- mp = (pos0 + pos1)/2;
- if (pos0 < pos && pos < mp)
- pos = pos1;
- else if (mp <= pos && pos < pos1)
- pos = pos0;
- }
-
-
-
- if (E_TEXT_MODEL_CLASS (parent_class)->validate_pos)
- pos = E_TEXT_MODEL_CLASS (parent_class)->validate_pos (model, pos);
-
- return pos;
-}
-
-static gint
-e_text_model_uri_get_obj_count (ETextModel *model)
-{
- ETextModelURI *model_uri = E_TEXT_MODEL_URI (model);
-
- objectify_idle_flush (model_uri);
-
- return g_list_length (model_uri->uris);
-}
-
-static const gchar *
-e_text_model_uri_get_nth_object (ETextModel *model, gint i, gint *len)
-{
- ETextModelURI *model_uri = E_TEXT_MODEL_URI (model);
- ObjInfo *info;
- const gchar *txt;
-
- objectify_idle_flush (model_uri);
-
- txt = e_text_model_get_text (model);
-
- info = (ObjInfo *) g_list_nth_data (model_uri->uris, i);
- g_return_val_if_fail (info != NULL, NULL);
-
-
- if (len)
- *len = info->len;
- return txt + info->offset;
-}
-
-static void
-e_text_model_uri_activate_nth_object (ETextModel *model, gint i)
-{
- gchar *obj_str;
-
- objectify_idle_flush (E_TEXT_MODEL_URI (model));
-
- obj_str = e_text_model_strdup_nth_object (model, i);
- gnome_url_show (obj_str, NULL);
- g_free (obj_str);
-}
-
-ETextModel *
-e_text_model_uri_new (void)
-{
- return E_TEXT_MODEL (g_object_new (E_TYPE_TEXT_MODEL_URI, NULL));
-}
-
-
-/* $Id$ */
diff --git a/widgets/text/e-text-model-uri.h b/widgets/text/e-text-model-uri.h
deleted file mode 100644
index 64cd7b2a57..0000000000
--- a/widgets/text/e-text-model-uri.h
+++ /dev/null
@@ -1,56 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-text-model-uri.h - a text model w/ clickable URIs
- * Copyright 2000, 2001, Ximian, Inc.
- *
- * Authors:
- * Jon Trowbridge <trow@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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.
- */
-
-#ifndef E_TEXT_MODEL_URI_H
-#define E_TEXT_MODEL_URI_H
-
-#include <gal/e-text/e-text-model.h>
-
-G_BEGIN_DECLS
-
-#define E_TYPE_TEXT_MODEL_URI (e_text_model_uri_get_type ())
-#define E_TEXT_MODEL_URI(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), E_TYPE_TEXT_MODEL_URI, ETextModelURI))
-#define E_TEXT_MODEL_URI_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), E_TYPE_TEXT_MODEL_URI, ETextModelURIClass))
-#define E_IS_TEXT_MODEL_URI(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), E_TYPE_TEXT_MODEL_URI))
-#define E_IS_TEXT_MODEL_URI_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), E_TYPE_TEXT_MODEL_URI))
-
-typedef struct _ETextModelURI ETextModelURI;
-typedef struct _ETextModelURIClass ETextModelURIClass;
-
-struct _ETextModelURI {
- ETextModel item;
- GList *uris;
-
- guint objectify_idle;
-};
-
-struct _ETextModelURIClass {
- ETextModelClass parent_class;
-};
-
-GtkType e_text_model_uri_get_type (void);
-ETextModel *e_text_model_uri_new (void);
-
-G_END_DECLS
-
-#endif
diff --git a/widgets/text/e-text-model.c b/widgets/text/e-text-model.c
deleted file mode 100644
index 0233f14aa7..0000000000
--- a/widgets/text/e-text-model.c
+++ /dev/null
@@ -1,633 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-text-model.c
- * Copyright 2000, 2001, Ximian, Inc.
- *
- * Authors:
- * Chris Lahey <clahey@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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.
- */
-
-#undef PARANOID_DEBUGGING
-
-#include <config.h>
-#include <ctype.h>
-#include <string.h>
-#include <gtk/gtksignal.h>
-#include <gal/util/e-util.h>
-#include "e-text-model-repos.h"
-#include "e-text-model.h"
-#include "gal/util/e-util.h"
-
-#define MAX_LENGTH (2047)
-
-enum {
- E_TEXT_MODEL_CHANGED,
- E_TEXT_MODEL_REPOSITION,
- E_TEXT_MODEL_OBJECT_ACTIVATED,
- E_TEXT_MODEL_CANCEL_COMPLETION,
- E_TEXT_MODEL_LAST_SIGNAL
-};
-
-static guint e_text_model_signals[E_TEXT_MODEL_LAST_SIGNAL] = { 0 };
-
-struct _ETextModelPrivate {
- gchar *text;
- gint len;
-};
-
-static void e_text_model_class_init (ETextModelClass *class);
-static void e_text_model_init (ETextModel *model);
-static void e_text_model_dispose (GObject *object);
-
-static gint e_text_model_real_validate_position (ETextModel *, gint pos);
-static const gchar *e_text_model_real_get_text (ETextModel *model);
-static gint e_text_model_real_get_text_length (ETextModel *model);
-static void e_text_model_real_set_text (ETextModel *model, const gchar *text);
-static void e_text_model_real_insert (ETextModel *model, gint postion, const gchar *text);
-static void e_text_model_real_insert_length (ETextModel *model, gint postion, const gchar *text, gint length);
-static void e_text_model_real_delete (ETextModel *model, gint postion, gint length);
-
-#define PARENT_TYPE G_TYPE_OBJECT
-static GObject *parent_class;
-
-
-
-/**
- * e_text_model_get_type:
- * @void:
- *
- * Registers the &ETextModel class if necessary, and returns the type ID
- * associated to it.
- *
- * Return value: The type ID of the &ETextModel class.
- **/
-E_MAKE_TYPE (e_text_model,
- "ETextModel",
- ETextModel,
- e_text_model_class_init,
- e_text_model_init,
- PARENT_TYPE)
-
-/* Class initialization function for the text item */
-static void
-e_text_model_class_init (ETextModelClass *klass)
-{
- GObjectClass *object_class;
-
- object_class = (GObjectClass *) klass;
-
- parent_class = g_type_class_ref (PARENT_TYPE);
-
- e_text_model_signals[E_TEXT_MODEL_CHANGED] =
- g_signal_new ("changed",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (ETextModelClass, changed),
- NULL, NULL,
- e_marshal_NONE__NONE,
- G_TYPE_NONE, 0);
-
- e_text_model_signals[E_TEXT_MODEL_REPOSITION] =
- g_signal_new ("reposition",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (ETextModelClass, reposition),
- NULL, NULL,
- e_marshal_NONE__POINTER_POINTER,
- G_TYPE_NONE, 2,
- G_TYPE_POINTER, G_TYPE_POINTER);
-
- e_text_model_signals[E_TEXT_MODEL_OBJECT_ACTIVATED] =
- g_signal_new ("object_activated",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (ETextModelClass, object_activated),
- NULL, NULL,
- e_marshal_NONE__INT,
- G_TYPE_NONE, 1,
- G_TYPE_INT);
-
- e_text_model_signals[E_TEXT_MODEL_CANCEL_COMPLETION] =
- g_signal_new ("cancel_completion",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (ETextModelClass, cancel_completion),
- NULL, NULL,
- e_marshal_NONE__NONE,
- G_TYPE_NONE, 0);
-
- /* No default signal handlers. */
- klass->changed = NULL;
- klass->reposition = NULL;
- klass->object_activated = NULL;
-
- klass->validate_pos = e_text_model_real_validate_position;
-
- klass->get_text = e_text_model_real_get_text;
- klass->get_text_len = e_text_model_real_get_text_length;
- klass->set_text = e_text_model_real_set_text;
- klass->insert = e_text_model_real_insert;
- klass->insert_length = e_text_model_real_insert_length;
- klass->delete = e_text_model_real_delete;
-
- /* We explicitly don't define default handlers for these. */
- klass->objectify = NULL;
- klass->obj_count = NULL;
- klass->get_nth_obj = NULL;
-
- object_class->dispose = e_text_model_dispose;
-}
-
-/* Object initialization function for the text item */
-static void
-e_text_model_init (ETextModel *model)
-{
- model->priv = g_new0 (struct _ETextModelPrivate, 1);
- model->priv->text = g_strdup ("");
- model->priv->len = 0;
-}
-
-/* Dispose handler for the text item */
-static void
-e_text_model_dispose (GObject *object)
-{
- ETextModel *model;
-
- g_return_if_fail (object != NULL);
- g_return_if_fail (E_IS_TEXT_MODEL (object));
-
- model = E_TEXT_MODEL (object);
-
- if (model->priv) {
- g_free (model->priv->text);
-
- g_free (model->priv);
- model->priv = NULL;
- }
-
- if (G_OBJECT_CLASS (parent_class)->dispose)
- G_OBJECT_CLASS (parent_class)->dispose (object);
-}
-
-static gint
-e_text_model_real_validate_position (ETextModel *model, gint pos)
-{
- gint len;
-
- if (pos < 0)
- pos = 0;
- else if (pos > ( len = e_text_model_get_text_length (model) ))
- pos = len;
-
- return pos;
-}
-
-static const gchar *
-e_text_model_real_get_text (ETextModel *model)
-{
- if (model->priv->text)
- return model->priv->text;
- else
- return "";
-}
-
-static gint
-e_text_model_real_get_text_length (ETextModel *model)
-{
- if (model->priv->len < 0)
- model->priv->len = strlen (e_text_model_get_text (model));
-
- return model->priv->len;
-}
-
-static void
-e_text_model_real_set_text (ETextModel *model, const gchar *text)
-{
- EReposAbsolute repos;
- gboolean changed = FALSE;
-
- if (text == NULL) {
-
- changed = (model->priv->text != NULL);
-
- g_free (model->priv->text);
- model->priv->text = NULL;
- model->priv->len = -1;
-
- } else if (model->priv->text == NULL || strcmp (model->priv->text, text)) {
-
- g_free (model->priv->text);
- model->priv->text = g_strndup (text, MAX_LENGTH);
- model->priv->len = -1;
-
- changed = TRUE;
- }
-
- if (changed) {
- e_text_model_changed (model);
- repos.model = model;
- repos.pos = -1;
- e_text_model_reposition (model, e_repos_absolute, &repos);
- }
-}
-
-static void
-e_text_model_real_insert (ETextModel *model, gint position, const gchar *text)
-{
- EReposInsertShift repos;
- gchar *new_text;
- gint length;
-
- if (model->priv->len < 0)
- e_text_model_real_get_text_length (model);
- length = strlen(text);
-
- if (length + model->priv->len > MAX_LENGTH)
- length = MAX_LENGTH - model->priv->len;
- if (length <= 0)
- return;
-
- /* Can't use g_strdup_printf here because on some systems
- printf ("%.*s"); is locale dependent. */
- new_text = e_strdup_append_strings (model->priv->text, position,
- text, length,
- model->priv->text + position, -1,
- NULL);
-
- if (model->priv->text)
- g_free (model->priv->text);
-
- model->priv->text = new_text;
-
- if (model->priv->len >= 0)
- model->priv->len += length;
-
- e_text_model_changed (model);
-
- repos.model = model;
- repos.pos = position;
- repos.len = length;
-
- e_text_model_reposition (model, e_repos_insert_shift, &repos);
-}
-
-static void
-e_text_model_real_insert_length (ETextModel *model, gint position, const gchar *text, gint length)
-{
- EReposInsertShift repos;
- gchar *new_text;
-
- if (model->priv->len < 0)
- e_text_model_real_get_text_length (model);
-
- if (length + model->priv->len > MAX_LENGTH)
- length = MAX_LENGTH - model->priv->len;
- if (length <= 0)
- return;
-
- /* Can't use g_strdup_printf here because on some systems
- printf ("%.*s"); is locale dependent. */
- new_text = e_strdup_append_strings (model->priv->text, position,
- text, length,
- model->priv->text + position, -1,
- NULL);
-
- if (model->priv->text)
- g_free (model->priv->text);
- model->priv->text = new_text;
-
- if (model->priv->len >= 0)
- model->priv->len += length;
-
- e_text_model_changed (model);
-
- repos.model = model;
- repos.pos = position;
- repos.len = length;
-
- e_text_model_reposition (model, e_repos_insert_shift, &repos);
-}
-
-static void
-e_text_model_real_delete (ETextModel *model, gint position, gint length)
-{
- EReposDeleteShift repos;
-
- memmove (model->priv->text + position, model->priv->text + position + length, strlen (model->priv->text + position + length) + 1);
-
- if (model->priv->len >= 0)
- model->priv->len -= length;
-
- e_text_model_changed (model);
-
- repos.model = model;
- repos.pos = position;
- repos.len = length;
-
- e_text_model_reposition (model, e_repos_delete_shift, &repos);
-}
-
-void
-e_text_model_changed (ETextModel *model)
-{
- g_return_if_fail (model != NULL);
- g_return_if_fail (E_IS_TEXT_MODEL (model));
-
- /*
- Objectify before emitting any signal.
- While this method could, in theory, do pretty much anything, it is meant
- for scanning objects and converting substrings into embedded objects.
- */
- if (E_TEXT_MODEL_GET_CLASS (model)->objectify)
- E_TEXT_MODEL_GET_CLASS (model)->objectify (model);
-
- g_signal_emit (model,
- e_text_model_signals[E_TEXT_MODEL_CHANGED], 0);
-}
-
-void
-e_text_model_cancel_completion (ETextModel *model)
-{
- g_return_if_fail (E_IS_TEXT_MODEL (model));
-
- g_signal_emit (model, e_text_model_signals[E_TEXT_MODEL_CANCEL_COMPLETION], 0);
-}
-
-void
-e_text_model_reposition (ETextModel *model, ETextModelReposFn fn, gpointer repos_data)
-{
- g_return_if_fail (model != NULL);
- g_return_if_fail (E_IS_TEXT_MODEL (model));
- g_return_if_fail (fn != NULL);
-
- g_signal_emit (model,
- e_text_model_signals[E_TEXT_MODEL_REPOSITION], 0,
- fn, repos_data);
-}
-
-gint
-e_text_model_validate_position (ETextModel *model, gint pos)
-{
- g_return_val_if_fail (model != NULL, 0);
- g_return_val_if_fail (E_IS_TEXT_MODEL (model), 0);
-
- if (E_TEXT_MODEL_GET_CLASS (model)->validate_pos)
- pos = E_TEXT_MODEL_GET_CLASS (model)->validate_pos (model, pos);
-
- return pos;
-}
-
-const gchar *
-e_text_model_get_text (ETextModel *model)
-{
- g_return_val_if_fail (model != NULL, NULL);
- g_return_val_if_fail (E_IS_TEXT_MODEL (model), NULL);
-
- if (E_TEXT_MODEL_GET_CLASS (model)->get_text)
- return E_TEXT_MODEL_GET_CLASS (model)->get_text (model);
-
- return "";
-}
-
-gint
-e_text_model_get_text_length (ETextModel *model)
-{
- g_return_val_if_fail (model != NULL, 0);
- g_return_val_if_fail (E_IS_TEXT_MODEL (model), 0);
-
- if (E_TEXT_MODEL_GET_CLASS (model)->get_text_len (model)) {
-
- gint len = E_TEXT_MODEL_GET_CLASS (model)->get_text_len (model);
-
-#ifdef PARANOID_DEBUGGING
- const gchar *str = e_text_model_get_text (model);
- gint len2 = str ? strlen (str) : 0;
- if (len != len)
- g_error ("\"%s\" length reported as %d, not %d.", str, len, len2);
-#endif
-
- return len;
-
- } else {
- /* Calculate length the old-fashioned way... */
- const gchar *str = e_text_model_get_text (model);
- return str ? strlen (str) : 0;
- }
-}
-
-void
-e_text_model_set_text (ETextModel *model, const gchar *text)
-{
- g_return_if_fail (model != NULL);
- g_return_if_fail (E_IS_TEXT_MODEL (model));
-
- if (E_TEXT_MODEL_GET_CLASS (model)->set_text)
- E_TEXT_MODEL_GET_CLASS (model)->set_text (model, text);
-}
-
-void
-e_text_model_insert (ETextModel *model, gint position, const gchar *text)
-{
- g_return_if_fail (model != NULL);
- g_return_if_fail (E_IS_TEXT_MODEL (model));
-
- if (text == NULL)
- return;
-
- if (E_TEXT_MODEL_GET_CLASS (model)->insert)
- E_TEXT_MODEL_GET_CLASS (model)->insert (model, position, text);
-}
-
-void
-e_text_model_insert_length (ETextModel *model, gint position, const gchar *text, gint length)
-{
- g_return_if_fail (model != NULL);
- g_return_if_fail (E_IS_TEXT_MODEL (model));
- g_return_if_fail (length >= 0);
-
-
- if (text == NULL || length == 0)
- return;
-
- if (E_TEXT_MODEL_GET_CLASS (model)->insert_length)
- E_TEXT_MODEL_GET_CLASS (model)->insert_length (model, position, text, length);
-}
-
-void
-e_text_model_prepend (ETextModel *model, const gchar *text)
-{
- g_return_if_fail (model != NULL);
- g_return_if_fail (E_IS_TEXT_MODEL (model));
-
- if (text == NULL)
- return;
-
- e_text_model_insert (model, 0, text);
-}
-
-void
-e_text_model_append (ETextModel *model, const gchar *text)
-{
- g_return_if_fail (model != NULL);
- g_return_if_fail (E_IS_TEXT_MODEL (model));
-
- if (text == NULL)
- return;
-
- e_text_model_insert (model, e_text_model_get_text_length (model), text);
-}
-
-void
-e_text_model_delete (ETextModel *model, gint position, gint length)
-{
- gint txt_len;
-
- g_return_if_fail (model != NULL);
- g_return_if_fail (E_IS_TEXT_MODEL (model));
- g_return_if_fail (length >= 0);
-
- txt_len = e_text_model_get_text_length (model);
- if (position + length > txt_len)
- length = txt_len - position;
-
- if (length <= 0)
- return;
-
- if (E_TEXT_MODEL_GET_CLASS (model)->delete)
- E_TEXT_MODEL_GET_CLASS (model)->delete (model, position, length);
-}
-
-gint
-e_text_model_object_count (ETextModel *model)
-{
- g_return_val_if_fail (model != NULL, 0);
- g_return_val_if_fail (E_IS_TEXT_MODEL (model), 0);
-
- if (E_TEXT_MODEL_GET_CLASS (model)->obj_count)
- return E_TEXT_MODEL_GET_CLASS (model)->obj_count (model);
-
- return 0;
-}
-
-const gchar *
-e_text_model_get_nth_object (ETextModel *model, gint n, gint *len)
-{
- g_return_val_if_fail (model != NULL, NULL);
- g_return_val_if_fail (E_IS_TEXT_MODEL (model), NULL);
-
- if (n < 0 || n >= e_text_model_object_count (model))
- return NULL;
-
- if (E_TEXT_MODEL_GET_CLASS (model)->get_nth_obj)
- return E_TEXT_MODEL_GET_CLASS (model)->get_nth_obj (model, n, len);
-
- return NULL;
-}
-
-gchar *
-e_text_model_strdup_nth_object (ETextModel *model, gint n)
-{
- const gchar *obj;
- gint len = 0;
-
- g_return_val_if_fail (model != NULL, NULL);
- g_return_val_if_fail (E_IS_TEXT_MODEL (model), NULL);
-
- obj = e_text_model_get_nth_object (model, n, &len);
-
- return obj ? g_strndup (obj, n) : NULL;
-}
-
-void
-e_text_model_get_nth_object_bounds (ETextModel *model, gint n, gint *start, gint *end)
-{
- const gchar *txt = NULL, *obj = NULL;
- gint len = 0;
-
- g_return_if_fail (model != NULL);
- g_return_if_fail (E_IS_TEXT_MODEL (model));
-
- txt = e_text_model_get_text (model);
- obj = e_text_model_get_nth_object (model, n, &len);
-
- g_return_if_fail (obj != NULL);
-
- if (start)
- *start = obj - txt;
- if (end)
- *end = obj - txt + len;
-}
-
-gint
-e_text_model_get_object_at_offset (ETextModel *model, gint offset)
-{
- g_return_val_if_fail (model != NULL, -1);
- g_return_val_if_fail (E_IS_TEXT_MODEL (model), -1);
-
- if (offset < 0 || offset >= e_text_model_get_text_length (model))
- return -1;
-
- /* If an optimized version has been provided, we use it. */
- if (E_TEXT_MODEL_GET_CLASS (model)->obj_at_offset) {
-
- return E_TEXT_MODEL_GET_CLASS (model)->obj_at_offset (model, offset);
-
- } else {
- /* If not, we fake it.*/
-
- gint i, N, pos0, pos1;
-
- N = e_text_model_object_count (model);
-
- for (i = 0; i < N; ++i) {
- e_text_model_get_nth_object_bounds (model, i, &pos0, &pos1);
- if (pos0 <= offset && offset < pos1)
- return i;
- }
-
- }
-
- return -1;
-}
-
-gint
-e_text_model_get_object_at_pointer (ETextModel *model, const gchar *s)
-{
- g_return_val_if_fail (model != NULL, -1);
- g_return_val_if_fail (E_IS_TEXT_MODEL (model), -1);
- g_return_val_if_fail (s != NULL, -1);
-
- return e_text_model_get_object_at_offset (model, s - e_text_model_get_text (model));
-}
-
-void
-e_text_model_activate_nth_object (ETextModel *model, gint n)
-{
- g_return_if_fail (model != NULL);
- g_return_if_fail (E_IS_TEXT_MODEL (model));
- g_return_if_fail (n >= 0);
- g_return_if_fail (n < e_text_model_object_count (model));
-
- g_signal_emit (model, e_text_model_signals[E_TEXT_MODEL_OBJECT_ACTIVATED], 0, n);
-}
-
-ETextModel *
-e_text_model_new (void)
-{
- ETextModel *model = g_object_new (E_TYPE_TEXT_MODEL, NULL);
- return model;
-}
diff --git a/widgets/text/e-text-model.h b/widgets/text/e-text-model.h
deleted file mode 100644
index 2e472ead44..0000000000
--- a/widgets/text/e-text-model.h
+++ /dev/null
@@ -1,113 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-text-model.h
- * Copyright 2000, 2001, Ximian, Inc.
- *
- * Authors:
- * Chris Lahey <clahey@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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.
- */
-
-#ifndef E_TEXT_MODEL_H
-#define E_TEXT_MODEL_H
-
-#include <glib.h>
-#include <gtk/gtkobject.h>
-
-G_BEGIN_DECLS
-
-#define E_TYPE_TEXT_MODEL (e_text_model_get_type ())
-#define E_TEXT_MODEL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), E_TYPE_TEXT_MODEL, ETextModel))
-#define E_TEXT_MODEL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), E_TYPE_TEXT_MODEL, ETextModelClass))
-#define E_IS_TEXT_MODEL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), E_TYPE_TEXT_MODEL))
-#define E_IS_TEXT_MODEL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), E_TYPE_TEXT_MODEL))
-#define E_TEXT_MODEL_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), E_TYPE_TEXT_MODEL_TYPE, ETextModelClass))
-
-typedef struct _ETextModel ETextModel;
-typedef struct _ETextModelClass ETextModelClass;
-
-struct _ETextModelPrivate;
-
-typedef gint (*ETextModelReposFn) (gint, gpointer);
-
-struct _ETextModel {
- GObject item;
-
- struct _ETextModelPrivate *priv;
-};
-
-struct _ETextModelClass {
- GObjectClass parent_class;
-
- /* Signal */
- void (* changed) (ETextModel *model);
- void (* reposition) (ETextModel *model, ETextModelReposFn fn, gpointer repos_fn_data);
- void (* object_activated) (ETextModel *model, gint obj_num);
- void (* cancel_completion) (ETextModel *model);
-
- /* Virtual methods */
-
- gint (* validate_pos) (ETextModel *model, gint pos);
-
- const char *(* get_text) (ETextModel *model);
- gint (* get_text_len) (ETextModel *model);
- void (* set_text) (ETextModel *model, const gchar *text);
- void (* insert) (ETextModel *model, gint position, const gchar *text);
- void (* insert_length) (ETextModel *model, gint position, const gchar *text, gint length);
- void (* delete) (ETextModel *model, gint position, gint length);
-
- void (* objectify) (ETextModel *model);
- gint (* obj_count) (ETextModel *model);
- const gchar *(* get_nth_obj) (ETextModel *model, gint n, gint *len);
- gint (* obj_at_offset) (ETextModel *model, gint offset);
-};
-
-GType e_text_model_get_type (void);
-
-ETextModel *e_text_model_new (void);
-
-void e_text_model_changed (ETextModel *model);
-void e_text_model_cancel_completion (ETextModel *model);
-
-void e_text_model_reposition (ETextModel *model, ETextModelReposFn fn, gpointer repos_data);
-gint e_text_model_validate_position (ETextModel *model, gint pos);
-
-
-/* Functions for manipulating the underlying text. */
-
-const gchar *e_text_model_get_text (ETextModel *model);
-gint e_text_model_get_text_length (ETextModel *model);
-void e_text_model_set_text (ETextModel *model, const gchar *text);
-void e_text_model_insert (ETextModel *model, gint position, const gchar *text);
-void e_text_model_insert_length (ETextModel *model, gint position, const gchar *text, gint length);
-void e_text_model_prepend (ETextModel *model, const gchar *text);
-void e_text_model_append (ETextModel *model, const gchar *text);
-void e_text_model_delete (ETextModel *model, gint position, gint length);
-
-
-/* Functions for accessing embedded objects. */
-
-gint e_text_model_object_count (ETextModel *model);
-const gchar *e_text_model_get_nth_object (ETextModel *model, gint n, gint *len);
-gchar *e_text_model_strdup_nth_object (ETextModel *model, gint n);
-void e_text_model_get_nth_object_bounds (ETextModel *model, gint n, gint *start_pos, gint *end_pos);
-gint e_text_model_get_object_at_offset (ETextModel *model, gint offset);
-gint e_text_model_get_object_at_pointer (ETextModel *model, const gchar *c);
-void e_text_model_activate_nth_object (ETextModel *model, gint n);
-
-G_END_DECLS
-
-#endif
diff --git a/widgets/text/e-text-test.c b/widgets/text/e-text-test.c
deleted file mode 100644
index d10a745d85..0000000000
--- a/widgets/text/e-text-test.c
+++ /dev/null
@@ -1,168 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-text-test.c - E-Text item test program
- * Copyright 2000: Iain Holmes <ih@csd.abdn.ac.uk>
- *
- * Authors:
- * Iain Holmes <ih@csd.abdn.ac.uk>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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 "e-text.h"
-#include <gnome.h>
-#include "gal/widgets/e-canvas.h"
-#include "gal/widgets/e-unicode.h"
-
-GnomeCanvasItem *rect;
-
-static void allocate_callback(GtkWidget *canvas, GtkAllocation *allocation, GnomeCanvasItem *item)
-{
- double height;
- gnome_canvas_item_set( item,
- "width", (double) allocation->width,
- NULL );
- g_object_get(item,
- "height", &height,
- NULL);
- height = MAX(height, allocation->height);
- gnome_canvas_set_scroll_region(GNOME_CANVAS( canvas ), 0, 0, allocation->width, height );
- gnome_canvas_item_set( rect,
- "x2", (double) allocation->width,
- "y2", (double) height,
- NULL );
-}
-
-static void
-reflow (GtkWidget *canvas, GnomeCanvasItem *item)
-{
- double height;
- g_object_get(item,
- "height", &height,
- NULL);
- height = MAX(height, canvas->allocation.height);
- gnome_canvas_set_scroll_region(GNOME_CANVAS( canvas ), 0, 0, canvas->allocation.width, height );
- gnome_canvas_item_set( rect,
- "x2", (double) canvas->allocation.width,
- "y2", (double) height,
- NULL );
-}
-
-static void
-quit_cb (gpointer data, GObject *where_object_was)
-{
- gtk_main_quit ();
-}
-
-static void
-change_text_cb (GtkEntry *entry,
- EText *text)
-{
- gchar *str;
-
- str = e_utf8_gtk_entry_get_text (entry);
- gnome_canvas_item_set (GNOME_CANVAS_ITEM (text),
- "text", str,
- NULL);
-}
-
-static void
-change_font_cb (GtkEntry *entry,
- EText *text)
-{
- gchar *font;
-
- font = gtk_entry_get_text (entry);
- gnome_canvas_item_set (GNOME_CANVAS_ITEM (text),
- "font", font,
- NULL);
-}
-
-int
-main (int argc,
- char **argv)
-{
- GtkWidget *window, *canvas, *scroller, *vbox, *text, *font;
- GtkWidget *frame;
- GnomeCanvasItem *item;
-
- gnome_init ("ETextTest", "0.0.1", argc, argv);
- window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
- gtk_window_set_title (GTK_WINDOW (window), "EText Test");
- g_object_weak_ref (G_OBJECT (window),
- quit_cb, NULL);
-
- gtk_widget_push_colormap (gdk_rgb_get_cmap ());
- canvas = e_canvas_new ();
- gtk_widget_pop_colormap ();
- scroller = gtk_scrolled_window_new (NULL, NULL);
- vbox = gtk_vbox_new (FALSE, 2);
-
- gtk_container_add (GTK_CONTAINER (window), vbox);
- gtk_box_pack_start (GTK_BOX (vbox), scroller, TRUE, TRUE, 2);
- gtk_container_add (GTK_CONTAINER (scroller), canvas);
-
- frame = gtk_frame_new ("Text");
- text = gtk_entry_new ();
- gtk_entry_set_text(GTK_ENTRY(text), "Hello World! This is a really long string to test out the ellipsis stuff.");
- gtk_container_add (GTK_CONTAINER (frame), text);
- gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0);
-
- frame = gtk_frame_new ("Font");
- font = gtk_entry_new ();
- gtk_entry_set_text(GTK_ENTRY(font), "fixed");
- gtk_container_add (GTK_CONTAINER (frame), font);
- gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0);
-
- rect = gnome_canvas_item_new( gnome_canvas_root( GNOME_CANVAS( canvas ) ),
- gnome_canvas_rect_get_type(),
- "x1", (double) 0,
- "y1", (double) 0,
- "x2", (double) 100,
- "y2", (double) 100,
- "fill_color", "white",
- NULL );
-
- item = gnome_canvas_item_new (gnome_canvas_root (GNOME_CANVAS (canvas)),
- e_text_get_type (),
- "text", "Hello World! This is a really long string to test out the ellipsis stuff.",
- "font", "fixed",
- "fill_color", "black",
- "anchor", GTK_ANCHOR_NW,
- "clip", TRUE,
- "use_ellipsis", TRUE,
- "editable", TRUE,
- "line_wrap", TRUE,
- "max_lines", 2,
- "width", 150.0,
- NULL);
-
- g_signal_connect (text, "activate",
- G_CALLBACK (change_text_cb), item);
- g_signal_connect (font, "activate",
- G_CALLBACK (change_font_cb), item);
-
- g_signal_connect (canvas , "size_allocate",
- G_CALLBACK (allocate_callback),
- item );
- g_signal_connect (canvas , "reflow",
- G_CALLBACK (reflow),
- item );
- gnome_canvas_set_scroll_region (GNOME_CANVAS (canvas), 0.0, 0.0, 400.0, 400.0);
- gtk_widget_show_all (window);
- gtk_main ();
-
- return 0;
-}
diff --git a/widgets/text/e-text.c b/widgets/text/e-text.c
deleted file mode 100644
index 2d4ab7fb80..0000000000
--- a/widgets/text/e-text.c
+++ /dev/null
@@ -1,3471 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-text.c - Text item for evolution.
- * Copyright 2000, 2001, Ximian, Inc.
- *
- * Authors:
- * Chris Lahey <clahey@ximian.com>
- * Jon Trowbridge <trow@ximian.com>
- *
- * A majority of code taken from:
- *
- * Text item type for GnomeCanvas widget
- *
- * GnomeCanvas is basically a port of the Tk toolkit's most excellent
- * canvas widget. Tk is copyrighted by the Regents of the University
- * of California, Sun Microsystems, and other parties.
- *
- * Copyright (C) 1998 The Free Software Foundation
- *
- * Author: Federico Mena <federico@nuclecu.unam.mx>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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 "e-text.h"
-
-#include <math.h>
-#include <ctype.h>
-#include <string.h>
-#include <glib-object.h>
-#include <gdk/gdkx.h> /* for BlackPixel */
-#include <gtk/gtkinvisible.h>
-#include <gtk/gtkmain.h>
-#include <gtk/gtkselection.h>
-#include <gtk/gtkwindow.h>
-#include <gtk/gtktypebuiltins.h>
-#include <libgnomecanvas/gnome-canvas-rect-ellipse.h>
-#include <libgnome/gnome-i18n.h>
-#include "gal/util/e-util.h"
-#include "gal/widgets/e-canvas.h"
-#include "gal/widgets/e-canvas-utils.h"
-#include "gal/widgets/e-unicode.h"
-#include "gal/util/e-text-event-processor-emacs-like.h"
-#include "gal/util/e-util.h"
-#include <libart_lgpl/art_affine.h>
-#include <libart_lgpl/art_rgb.h>
-#include <libart_lgpl/art_rgb_bitmap_affine.h>
-
-#define PARENT_TYPE (gnome_canvas_item_get_type())
-
-#define BORDER_INDENT 3
-#define d(x)
-
-enum {
- E_TEXT_CHANGED,
- E_TEXT_ACTIVATE,
- E_TEXT_KEYPRESS,
- E_TEXT_POPUP,
- E_TEXT_STYLE_SET,
- E_TEXT_LAST_SIGNAL
-};
-
-static GQuark e_text_signals[E_TEXT_LAST_SIGNAL] = { 0 };
-
-/* Object argument IDs */
-enum {
- PROP_0,
- PROP_MODEL,
- PROP_EVENT_PROCESSOR,
- PROP_TEXT,
- PROP_BOLD,
- PROP_STRIKEOUT,
- PROP_ANCHOR,
- PROP_JUSTIFICATION,
- PROP_CLIP_WIDTH,
- PROP_CLIP_HEIGHT,
- PROP_CLIP,
- PROP_FILL_CLIP_RECTANGLE,
- PROP_X_OFFSET,
- PROP_Y_OFFSET,
- PROP_FILL_COLOR,
- PROP_FILL_COLOR_GDK,
- PROP_FILL_COLOR_RGBA,
- PROP_FILL_STIPPLE,
- PROP_TEXT_WIDTH,
- PROP_TEXT_HEIGHT,
- PROP_EDITABLE,
- PROP_USE_ELLIPSIS,
- PROP_ELLIPSIS,
- PROP_LINE_WRAP,
- PROP_BREAK_CHARACTERS,
- PROP_MAX_LINES,
- PROP_WIDTH,
- PROP_HEIGHT,
- PROP_DRAW_BORDERS,
- PROP_ALLOW_NEWLINES,
- PROP_DRAW_BACKGROUND,
- PROP_DRAW_BUTTON,
- PROP_CURSOR_POS
-};
-
-
-enum {
- E_SELECTION_PRIMARY,
- E_SELECTION_CLIPBOARD
-};
-enum _TargetInfo {
- TARGET_UTF8_STRING,
- TARGET_UTF8,
- TARGET_COMPOUND_TEXT,
- TARGET_STRING,
- TARGET_TEXT
-};
-
-
-static void e_text_command(ETextEventProcessor *tep, ETextEventProcessorCommand *command, gpointer data);
-
-static void e_text_get_selection(EText *text, GdkAtom selection, guint32 time);
-static void e_text_supply_selection (EText *text, guint time, GdkAtom selection, guchar *data, gint length);
-
-static void e_text_text_model_changed(ETextModel *model, EText *text);
-static void e_text_text_model_reposition (ETextModel *model, ETextModelReposFn fn, gpointer repos_data, gpointer data);
-
-static void _get_tep(EText *text);
-
-static GtkWidget *e_text_get_invisible(EText *text);
-static void _selection_clear_event (GtkInvisible *invisible,
- GdkEventSelection *event,
- EText *text);
-static void _selection_get (GtkInvisible *invisible,
- GtkSelectionData *selection_data,
- guint info,
- guint time_stamp,
- EText *text);
-static void _selection_received (GtkInvisible *invisible,
- GtkSelectionData *selection_data,
- guint time,
- EText *text);
-
-static void calc_height (EText *text);
-
-static gboolean show_pango_rectangle (EText *text, PangoRectangle rect);
-
-
-static GnomeCanvasItemClass *parent_class;
-static GdkAtom clipboard_atom = GDK_NONE;
-
-
-
-/* Dispose handler for the text item */
-
-
-static void
-e_text_style_set (EText *text, GtkStyle *previous_style)
-{
- if ( text->line_wrap ) {
- text->needs_split_into_lines = 1;
- } else {
- text->needs_calc_height = 1;
- }
- e_canvas_item_request_reflow (GNOME_CANVAS_ITEM (text));
-}
-
-static void
-e_text_dispose (GObject *object)
-{
- EText *text;
-
- g_return_if_fail (object != NULL);
- g_return_if_fail (E_IS_TEXT (object));
-
- text = E_TEXT (object);
-
- if (text->tooltip_owner)
- e_canvas_hide_tooltip (E_CANVAS(GNOME_CANVAS_ITEM(text)->canvas));
- text->tooltip_owner = 0;
-
- if (text->model_changed_signal_id)
- g_signal_handler_disconnect (text->model,
- text->model_changed_signal_id);
- text->model_changed_signal_id = 0;
-
- if (text->model_repos_signal_id)
- g_signal_handler_disconnect (text->model,
- text->model_repos_signal_id);
- text->model_repos_signal_id = 0;
-
- if (text->model)
- g_object_unref(text->model);
- text->model = NULL;
-
- if (text->tep_command_id)
- g_signal_handler_disconnect(text->tep,
- text->tep_command_id);
- text->tep_command_id = 0;
-
- if (text->tep)
- g_object_unref (text->tep);
- text->tep = NULL;
-
- if (text->invisible)
- gtk_widget_destroy (text->invisible);
- text->invisible = NULL;
-
- g_free (text->primary_selection);
- text->primary_selection = NULL;
-
- g_free (text->clipboard_selection);
- text->clipboard_selection = NULL;
-
- g_free (text->revert);
- text->revert = NULL;
-
- if (text->stipple)
- gdk_bitmap_unref (text->stipple);
- text->stipple = NULL;
-
- if (text->timeout_id) {
- g_source_remove(text->timeout_id);
- text->timeout_id = 0;
- }
-
- if (text->timer) {
- g_timer_stop(text->timer);
- g_timer_destroy(text->timer);
- text->timer = NULL;
- }
-
- if ( text->tooltip_timeout ) {
- gtk_timeout_remove (text->tooltip_timeout);
- text->tooltip_timeout = 0;
- }
-
- if ( text->dbl_timeout ) {
- gtk_timeout_remove (text->dbl_timeout);
- text->dbl_timeout = 0;
- }
-
- if ( text->tpl_timeout ) {
- gtk_timeout_remove (text->tpl_timeout);
- text->tpl_timeout = 0;
- }
-
- if (text->layout) {
- g_object_unref (text->layout);
- text->layout = NULL;
- }
-
- if (G_OBJECT_CLASS (parent_class)->dispose)
- (* G_OBJECT_CLASS (parent_class)->dispose) (object);
-}
-
-static void
-reset_layout_attrs (EText *text)
-{
- PangoAttrList *attrs = NULL;
- int object_count;
-
- if (text->layout == NULL)
- return;
-
- object_count = e_text_model_object_count (text->model);
-
- if (text->bold || text->strikeout || object_count > 0) {
- int length = 0;
- int i;
-
- attrs = pango_attr_list_new ();
-
- for (i = 0; i < object_count; i++) {
- int start_pos, end_pos;
- PangoAttribute *attr = pango_attr_underline_new (PANGO_UNDERLINE_SINGLE);
-
- e_text_model_get_nth_object_bounds (text->model, i, &start_pos, &end_pos);
-
- attr->start_index = start_pos;
- attr->end_index = end_pos;
-
- pango_attr_list_insert (attrs, attr);
- }
-
- if (text->bold || text->strikeout)
- length = strlen (text->text);
-
- if (text->bold) {
- PangoAttribute *attr = pango_attr_weight_new (PANGO_WEIGHT_BOLD);
- attr->start_index = 0;
- attr->end_index = length;
-
- pango_attr_list_insert_before (attrs, attr);
- }
- if (text->strikeout) {
- PangoAttribute *attr = pango_attr_strikethrough_new (TRUE);
- attr->start_index = 0;
- attr->end_index = length;
-
- pango_attr_list_insert_before (attrs, attr);
- }
- }
- pango_layout_set_attributes (text->layout, attrs);
- if (attrs)
- pango_attr_list_unref (attrs);
- calc_height (text);
-}
-
-static void
-create_layout (EText *text)
-{
- GnomeCanvasItem *item = GNOME_CANVAS_ITEM (text);
-
- if (text->layout)
- return;
-
- text->layout = gtk_widget_create_pango_layout (GTK_WIDGET (item->canvas), text->text);
- if (text->line_wrap)
- pango_layout_set_width (text->layout, text->clip_width < 0 ? -1 : text->clip_width * PANGO_SCALE);
- reset_layout_attrs (text);
-}
-
-static void
-reset_layout (EText *text)
-{
- create_layout (text);
-
- pango_layout_set_text (text->layout, text->text, -1);
- reset_layout_attrs (text);
-
- if (!text->button_down) {
- PangoRectangle strong_pos, weak_pos;
-
- pango_layout_get_cursor_pos (text->layout, text->selection_end, &strong_pos, &weak_pos);
-
- if (strong_pos.x != weak_pos.x ||
- strong_pos.y != weak_pos.y ||
- strong_pos.width != weak_pos.width ||
- strong_pos.height != weak_pos.height)
- show_pango_rectangle (text, weak_pos);
-
- show_pango_rectangle (text, strong_pos);
- }
-}
-
-static void
-e_text_text_model_changed (ETextModel *model, EText *text)
-{
- gint model_len = e_text_model_get_text_length (model);
- text->text = e_text_model_get_text(model);
-
- /* Make sure our selection doesn't extend past the bounds of our text. */
- text->selection_start = CLAMP (text->selection_start, 0, model_len);
- text->selection_end = CLAMP (text->selection_end, 0, model_len);
-
- text->needs_reset_layout = 1;
- text->needs_split_into_lines = 1;
- text->needs_redraw = 1;
- e_canvas_item_request_reflow (GNOME_CANVAS_ITEM(text));
- gnome_canvas_item_request_update (GNOME_CANVAS_ITEM (text));
-
- g_signal_emit (text, e_text_signals[E_TEXT_CHANGED], 0);
-}
-
-static void
-e_text_text_model_reposition (ETextModel *model, ETextModelReposFn fn, gpointer repos_data, gpointer user_data)
-{
- EText *text = E_TEXT (user_data);
- gint model_len = e_text_model_get_text_length (model);
-
- text->selection_start = fn (text->selection_start, repos_data);
- text->selection_end = fn (text->selection_end, repos_data);
-
- /* Our repos function should make sure we don't overrun the buffer, but it never
- hurts to be paranoid. */
- text->selection_start = CLAMP (text->selection_start, 0, model_len);
- text->selection_end = CLAMP (text->selection_end, 0, model_len);
-
- if (text->selection_start > text->selection_end) {
- gint tmp = text->selection_start;
- text->selection_start = text->selection_end;
- text->selection_end = tmp;
- }
-}
-
-static void
-get_bounds (EText *text, double *px1, double *py1, double *px2, double *py2)
-{
- GnomeCanvasItem *item;
- double wx, wy, clip_width, clip_height;
-
- item = GNOME_CANVAS_ITEM (text);
-
- /* Get canvas pixel coordinates for text position */
-
- wx = 0;
- wy = 0;
- gnome_canvas_item_i2w (item, &wx, &wy);
- gnome_canvas_w2c (item->canvas, wx + text->xofs, wy + text->yofs, &text->cx, &text->cy);
- gnome_canvas_w2c (item->canvas, wx, wy, &text->clip_cx, &text->clip_cy);
-
- if (text->clip_width < 0)
- clip_width = text->width;
- else
- clip_width = text->clip_width;
-
- if ( text->clip_height < 0 )
- clip_height = text->height;
- else
- clip_height = text->clip_height;
-
- /* Get canvas pixel coordinates for clip rectangle position */
- text->clip_cwidth = clip_width * item->canvas->pixels_per_unit;
- text->clip_cheight = clip_height * item->canvas->pixels_per_unit;
-
- /* Anchor text */
-
- switch (text->anchor) {
- case GTK_ANCHOR_NW:
- case GTK_ANCHOR_W:
- case GTK_ANCHOR_SW:
- break;
-
- case GTK_ANCHOR_N:
- case GTK_ANCHOR_CENTER:
- case GTK_ANCHOR_S:
- text->cx -= text->width / 2;
- text->clip_cx -= text->clip_cwidth / 2;
- break;
-
- case GTK_ANCHOR_NE:
- case GTK_ANCHOR_E:
- case GTK_ANCHOR_SE:
- text->cx -= text->width;
- text->clip_cx -= text->clip_cwidth;
- break;
- }
-
- switch (text->anchor) {
- case GTK_ANCHOR_NW:
- case GTK_ANCHOR_N:
- case GTK_ANCHOR_NE:
- break;
-
- case GTK_ANCHOR_W:
- case GTK_ANCHOR_CENTER:
- case GTK_ANCHOR_E:
- text->cy -= text->height / 2;
- text->clip_cy -= text->clip_cheight / 2;
- break;
-
- case GTK_ANCHOR_SW:
- case GTK_ANCHOR_S:
- case GTK_ANCHOR_SE:
- text->cy -= text->height;
- text->clip_cy -= text->clip_cheight;
- break;
- }
-
- text->text_cx = text->cx;
- text->text_cy = text->cy;
-
- if (text->draw_borders) {
- text->text_cx += BORDER_INDENT;
- text->text_cy += BORDER_INDENT;
- }
-
- /* Bounds */
-
- if (text->clip) {
- *px1 = text->clip_cx;
- *py1 = text->clip_cy;
- *px2 = text->clip_cx + text->clip_cwidth;
- *py2 = text->clip_cy + text->clip_cheight;
- } else {
- *px1 = text->cx;
- *py1 = text->cy;
- *px2 = text->cx + text->width;
- *py2 = text->cy + text->height;
- }
-}
-
-static void
-calc_height (EText *text)
-{
- GnomeCanvasItem *item;
- int old_height;
- int old_width;
- int width = 0;
- int height = 0;
-
- item = GNOME_CANVAS_ITEM (text);
-
- /* Calculate text dimensions */
-
- old_height = text->height;
- old_width = text->width;
-
- if (text->layout)
- pango_layout_get_pixel_size (text->layout, &width, &height);
-
- text->height = height;
- text->width = width;
-
- if (old_height != text->height || old_width != text->width)
- e_canvas_item_request_parent_reflow(item);
-}
-
-static void
-calc_ellipsis (EText *text)
-{
-#warning "AIEEEE FIX ME. a pango layout per calc_ellipsis sucks"
- int width;
- PangoLayout *layout = gtk_widget_create_pango_layout (GTK_WIDGET (GNOME_CANVAS_ITEM (text)->canvas),
- text->ellipsis ? text->ellipsis : "...");
- pango_layout_get_size (layout, &width, NULL);
-
- text->ellipsis_width = width;
-
- g_object_unref (layout);
-}
-
-static void
-split_into_lines (EText *text)
-{
- text->num_lines = pango_layout_get_line_count (text->layout);
-}
-
-/* Convenience function to set the text's GC's foreground color */
-static void
-set_text_gc_foreground (EText *text)
-{
- if (!text->gc)
- return;
-
- gdk_gc_set_foreground (text->gc, &text->color);
-}
-
-/* Sets the stipple pattern for the text */
-static void
-set_stipple (EText *text, GdkBitmap *stipple, int reconfigure)
-{
- if (text->stipple && !reconfigure)
- gdk_bitmap_unref (text->stipple);
-
- text->stipple = stipple;
- if (stipple && !reconfigure)
- gdk_bitmap_ref (stipple);
-
- if (text->gc) {
- if (stipple) {
- gdk_gc_set_stipple (text->gc, stipple);
- gdk_gc_set_fill (text->gc, GDK_STIPPLED);
- } else
- gdk_gc_set_fill (text->gc, GDK_SOLID);
- }
-}
-
-/* Set_arg handler for the text item */
-static void
-e_text_set_property (GObject *object,
- guint prop_id,
- const GValue *value,
- GParamSpec *pspec)
-{
- GnomeCanvasItem *item;
- EText *text;
- GdkColor color = { 0, 0, 0, 0, };
- GdkColor *pcolor;
- gboolean color_changed;
- int have_pixel;
-
- gboolean needs_update = 0;
- gboolean needs_reflow = 0;
-
- item = GNOME_CANVAS_ITEM (object);
- text = E_TEXT (object);
-
- color_changed = FALSE;
- have_pixel = FALSE;
-
- switch (prop_id) {
- case PROP_MODEL:
-
- if ( text->model_changed_signal_id )
- g_signal_handler_disconnect (text->model,
- text->model_changed_signal_id);
-
- if ( text->model_repos_signal_id )
- g_signal_handler_disconnect (text->model,
- text->model_repos_signal_id);
-
- g_object_unref (text->model);
- text->model = E_TEXT_MODEL (g_value_get_object (value));
- g_object_ref (text->model);
-
- text->model_changed_signal_id =
- g_signal_connect (text->model,
- "changed",
- G_CALLBACK (e_text_text_model_changed),
- text);
-
- text->model_repos_signal_id =
- g_signal_connect (text->model,
- "reposition",
- G_CALLBACK (e_text_text_model_reposition),
- text);
-
- text->text = e_text_model_get_text(text->model);
- g_signal_emit (text, e_text_signals[E_TEXT_CHANGED], 0);
-
- text->needs_split_into_lines = 1;
- needs_reflow = 1;
- break;
-
- case PROP_EVENT_PROCESSOR:
- if ( text->tep && text->tep_command_id )
- g_signal_handler_disconnect(text->tep,
- text->tep_command_id);
- if ( text->tep ) {
- g_object_unref(text->tep);
- }
- text->tep = E_TEXT_EVENT_PROCESSOR(g_value_get_object (value));
- g_object_ref(text->tep);
- text->tep_command_id =
- g_signal_connect(text->tep,
- "command",
- G_CALLBACK(e_text_command),
- text);
- if (!text->allow_newlines)
- g_object_set (text->tep,
- "allow_newlines", FALSE,
- NULL);
- break;
-
- case PROP_TEXT:
- e_text_model_set_text(text->model, g_value_get_string (value));
- break;
-
- case PROP_BOLD:
- text->bold = g_value_get_boolean (value);
- text->style = text->bold ? E_FONT_BOLD : E_FONT_PLAIN;
-
- text->needs_redraw = 1;
- text->needs_recalc_bounds = 1;
- if ( text->line_wrap )
- text->needs_split_into_lines = 1;
- else {
- text->needs_calc_height = 1;
- }
- needs_update = 1;
- needs_reflow = 1;
- break;
-
- case PROP_STRIKEOUT:
- text->strikeout = g_value_get_boolean (value);
- text->needs_redraw = 1;
- needs_update = 1;
- break;
-
- case PROP_ANCHOR:
- text->anchor = g_value_get_enum (value);
- text->needs_recalc_bounds = 1;
- needs_update = 1;
- break;
-
- case PROP_JUSTIFICATION:
- text->justification = g_value_get_enum (value);
- text->needs_redraw = 1;
- needs_update = 1;
- break;
-
- case PROP_CLIP_WIDTH:
- text->clip_width = fabs (g_value_get_double (value));
- calc_ellipsis (text);
- if ( text->line_wrap )
- text->needs_split_into_lines = 1;
- else {
- text->needs_calc_height = 1;
- }
- needs_reflow = 1;
- break;
-
- case PROP_CLIP_HEIGHT:
- text->clip_height = fabs (g_value_get_double (value));
- text->needs_recalc_bounds = 1;
- /* toshok: kind of a hack - set needs_reset_layout
- here so when something about the style/them
- changes, we redraw the text at the proper size/with
- the proper font. */
- text->needs_reset_layout = 1;
- needs_reflow = 1;
- break;
-
- case PROP_CLIP:
- text->clip = g_value_get_boolean (value);
- calc_ellipsis (text);
- if ( text->line_wrap )
- text->needs_split_into_lines = 1;
- else {
- text->needs_calc_height = 1;
- }
- needs_reflow = 1;
- break;
-
- case PROP_FILL_CLIP_RECTANGLE:
- text->fill_clip_rectangle = g_value_get_boolean (value);
- needs_update = 1;
- break;
-
- case PROP_X_OFFSET:
- text->xofs = g_value_get_double (value);
- text->needs_recalc_bounds = 1;
- needs_update = 1;
- break;
-
- case PROP_Y_OFFSET:
- text->yofs = g_value_get_double (value);
- text->needs_recalc_bounds = 1;
- needs_update = 1;
- break;
-
- case PROP_FILL_COLOR:
- if (g_value_get_string (value))
- gdk_color_parse (g_value_get_string (value), &color);
-
- text->rgba = ((color.red & 0xff00) << 16 |
- (color.green & 0xff00) << 8 |
- (color.blue & 0xff00) |
- 0xff);
- color_changed = TRUE;
- break;
-
- case PROP_FILL_COLOR_GDK:
- pcolor = g_value_get_boxed (value);
- if (pcolor) {
- color = *pcolor;
- }
-
- text->rgba = ((color.red & 0xff00) << 16 |
- (color.green & 0xff00) << 8 |
- (color.blue & 0xff00) |
- 0xff);
- color_changed = TRUE;
- break;
-
- case PROP_FILL_COLOR_RGBA:
- text->rgba = g_value_get_uint (value);
- color.red = ((text->rgba >> 24) & 0xff) * 0x101;
- color.green = ((text->rgba >> 16) & 0xff) * 0x101;
- color.blue = ((text->rgba >> 8) & 0xff) * 0x101;
- color_changed = TRUE;
- break;
-
- case PROP_FILL_STIPPLE:
- set_stipple (text, g_value_get_object (value), FALSE);
- text->needs_redraw = 1;
- needs_update = 1;
- break;
-
- case PROP_EDITABLE:
- text->editable = g_value_get_boolean (value);
- text->needs_redraw = 1;
- needs_update = 1;
- break;
-
- case PROP_USE_ELLIPSIS:
- text->use_ellipsis = g_value_get_boolean (value);
- needs_reflow = 1;
- break;
-
- case PROP_ELLIPSIS:
- if (text->ellipsis)
- g_free (text->ellipsis);
-
- text->ellipsis = g_strdup (g_value_get_string (value));
- calc_ellipsis (text);
- needs_reflow = 1;
- break;
-
- case PROP_LINE_WRAP:
- text->line_wrap = g_value_get_boolean (value);
- if (text->line_wrap) {
- if (text->layout) {
- pango_layout_set_width (text->layout, text->width < 0 ? -1 : text->width * PANGO_SCALE);
- }
- }
- text->needs_split_into_lines = 1;
- needs_reflow = 1;
- break;
-
- case PROP_BREAK_CHARACTERS:
- if ( text->break_characters ) {
- g_free(text->break_characters);
- text->break_characters = NULL;
- }
- if ( g_value_get_string (value) )
- text->break_characters = g_strdup( g_value_get_string (value) );
- text->needs_split_into_lines = 1;
- needs_reflow = 1;
- break;
-
- case PROP_MAX_LINES:
- text->max_lines = g_value_get_int (value);
- text->needs_split_into_lines = 1;
- needs_reflow = 1;
- break;
-
- case PROP_WIDTH:
- text->clip_width = fabs (g_value_get_double (value));
- calc_ellipsis (text);
- if ( text->line_wrap ) {
- if (text->layout) {
- pango_layout_set_width (text->layout, text->width < 0 ? -1 : text->width * PANGO_SCALE);
- }
- text->needs_split_into_lines = 1;
- }
- else {
- text->needs_calc_height = 1;
- }
- needs_reflow = 1;
- break;
-
- case PROP_DRAW_BORDERS:
- if (text->draw_borders != g_value_get_boolean (value)) {
- text->draw_borders = g_value_get_boolean (value);
- text->needs_calc_height = 1;
- text->needs_redraw = 1;
- needs_reflow = 1;
- needs_update = 1;
- }
- break;
-
- case PROP_DRAW_BACKGROUND:
- if (text->draw_background != g_value_get_boolean (value)) {
- text->draw_background = g_value_get_boolean (value);
- text->needs_redraw = 1;
- }
- break;
-
- case PROP_DRAW_BUTTON:
- if (text->draw_button != g_value_get_boolean (value)) {
- text->draw_button = g_value_get_boolean (value);
- text->needs_redraw = 1;
- }
- break;
-
- case PROP_ALLOW_NEWLINES:
- text->allow_newlines = g_value_get_boolean (value);
- _get_tep(text);
- g_object_set (text->tep,
- "allow_newlines", g_value_get_boolean (value),
- NULL);
- break;
-
- case PROP_CURSOR_POS: {
- ETextEventProcessorCommand command;
-
- command.action = E_TEP_MOVE;
- command.position = E_TEP_VALUE;
- command.value = g_value_get_int (value);
- command.time = GDK_CURRENT_TIME;
- e_text_command (text->tep, &command, text);
- break;
- }
-
- default:
- return;
- }
-
- if (color_changed) {
- GdkColormap *colormap = gtk_widget_get_colormap (GTK_WIDGET (item->canvas));
-
- text->color = color;
- gdk_rgb_find_color (colormap, &text->color);
-
- if (!item->canvas->aa)
- set_text_gc_foreground (text);
-
- text->needs_redraw = 1;
- needs_update = 1;
- }
-
- if ( needs_reflow )
- e_canvas_item_request_reflow (item);
- if ( needs_update )
- gnome_canvas_item_request_update (item);
-}
-
-/* Get_arg handler for the text item */
-static void
-e_text_get_property (GObject *object,
- guint prop_id,
- GValue *value,
- GParamSpec *pspec)
-{
- EText *text;
-
- text = E_TEXT (object);
-
- switch (prop_id) {
- case PROP_MODEL:
- g_value_set_object (value, text->model);
- break;
-
- case PROP_EVENT_PROCESSOR:
- _get_tep(text);
- g_value_set_object (value, text->tep);
- break;
-
- case PROP_TEXT:
- g_value_set_string (value, g_strdup (text->text));
- break;
-
- case PROP_BOLD:
- g_value_set_boolean (value, text->bold);
- break;
-
- case PROP_STRIKEOUT:
- g_value_set_boolean (value, text->strikeout);
- break;
-
- case PROP_ANCHOR:
- g_value_set_enum (value, text->anchor);
- break;
-
- case PROP_JUSTIFICATION:
- g_value_set_enum (value, text->justification);
- break;
-
- case PROP_CLIP_WIDTH:
- g_value_set_double (value, text->clip_width);
- break;
-
- case PROP_CLIP_HEIGHT:
- g_value_set_double (value, text->clip_height);
- break;
-
- case PROP_CLIP:
- g_value_set_boolean (value, text->clip);
- break;
-
- case PROP_FILL_CLIP_RECTANGLE:
- g_value_set_boolean (value, text->fill_clip_rectangle);
- break;
-
- case PROP_X_OFFSET:
- g_value_set_double (value, text->xofs);
- break;
-
- case PROP_Y_OFFSET:
- g_value_set_double (value, text->yofs);
- break;
-
- case PROP_FILL_COLOR_GDK:
- g_value_set_boxed (value, &text->color);
- break;
-
- case PROP_FILL_COLOR_RGBA:
- g_value_set_uint (value, text->rgba);
- break;
-
- case PROP_FILL_STIPPLE:
- g_value_set_object (value, text->stipple);
- break;
-
- case PROP_TEXT_WIDTH:
- g_value_set_double (value, text->width / text->item.canvas->pixels_per_unit);
- break;
-
- case PROP_TEXT_HEIGHT:
- g_value_set_double (value, text->height / text->item.canvas->pixels_per_unit);
- break;
-
- case PROP_EDITABLE:
- g_value_set_boolean (value, text->editable);
- break;
-
- case PROP_USE_ELLIPSIS:
- g_value_set_boolean (value, text->use_ellipsis);
- break;
-
- case PROP_ELLIPSIS:
- g_value_set_string (value, g_strdup (text->ellipsis));
- break;
-
- case PROP_LINE_WRAP:
- g_value_set_boolean (value, text->line_wrap);
- break;
-
- case PROP_BREAK_CHARACTERS:
- g_value_set_string (value, g_strdup (text->break_characters));
- break;
-
- case PROP_MAX_LINES:
- g_value_set_int (value, text->max_lines);
- break;
-
- case PROP_WIDTH:
- g_value_set_double (value, text->clip_width);
- break;
-
- case PROP_HEIGHT:
- g_value_set_double (value, text->clip && text->clip_height != -1 ? text->clip_height : text->height / text->item.canvas->pixels_per_unit);
- break;
-
- case PROP_DRAW_BORDERS:
- g_value_set_boolean (value, text->draw_borders);
- break;
-
- case PROP_DRAW_BACKGROUND:
- g_value_set_boolean (value, text->draw_background);
- break;
-
- case PROP_DRAW_BUTTON:
- g_value_set_boolean (value, text->draw_button);
- break;
-
- case PROP_ALLOW_NEWLINES:
- g_value_set_boolean (value, text->allow_newlines);
- break;
-
- case PROP_CURSOR_POS:
- g_value_set_int (value, text->selection_start);
- break;
-
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
- break;
- }
-}
-
-/* Update handler for the text item */
-static void
-e_text_reflow (GnomeCanvasItem *item, int flags)
-{
- EText *text;
-
- text = E_TEXT (item);
-
- if (text->needs_reset_layout) {
- reset_layout (text);
- text->needs_reset_layout = 0;
- text->needs_calc_height = 1;
- }
-
- if (text->needs_split_into_lines) {
- split_into_lines (text);
-
- text->needs_split_into_lines = 0;
- text->needs_calc_height = 1;
- }
-
- if ( text->needs_calc_height ) {
- calc_height (text);
- gnome_canvas_item_request_update(item);
- text->needs_calc_height = 0;
- text->needs_recalc_bounds = 1;
- }
-}
-
-/* Update handler for the text item */
-static void
-e_text_update (GnomeCanvasItem *item, double *affine, ArtSVP *clip_path, int flags)
-{
- EText *text;
- double x1, y1, x2, y2;
-
- text = E_TEXT (item);
-
- if (parent_class->update)
- (* parent_class->update) (item, affine, clip_path, flags);
-
- if ( text->needs_recalc_bounds
- || (flags & GNOME_CANVAS_UPDATE_AFFINE)) {
- if (!item->canvas->aa) {
- set_text_gc_foreground (text);
- set_stipple (text, text->stipple, TRUE);
- get_bounds (text, &x1, &y1, &x2, &y2);
- if ( item->x1 != x1 ||
- item->x2 != x2 ||
- item->y1 != y1 ||
- item->y2 != y2 ) {
- gnome_canvas_request_redraw (item->canvas, item->x1, item->y1, item->x2, item->y2);
- item->x1 = x1;
- item->y1 = y1;
- item->x2 = x2;
- item->y2 = y2;
- text->needs_redraw = 1;
- item->canvas->need_repick = TRUE;
- }
- if (!text->fill_clip_rectangle)
- item->canvas->need_repick = TRUE;
- }
- text->needs_recalc_bounds = 0;
- }
- if ( text->needs_redraw ) {
- gnome_canvas_request_redraw (item->canvas, item->x1, item->y1, item->x2, item->y2);
- text->needs_redraw = 0;
- }
-}
-
-/* Realize handler for the text item */
-static void
-e_text_realize (GnomeCanvasItem *item)
-{
- EText *text;
-
- text = E_TEXT (item);
-
- if (parent_class->realize)
- (* parent_class->realize) (item);
-
- create_layout (text);
-
- text->gc = gdk_gc_new (item->canvas->layout.bin_window);
-#ifndef NO_WARNINGS
-#warning Color brokenness ...
-#endif
-#if 0
- gdk_color_context_query_color (item->canvas->cc, &text->color);
- gdk_gc_set_foreground (text->gc, &text->color);
-#endif
-
- text->i_cursor = gdk_cursor_new (GDK_XTERM);
- text->default_cursor = gdk_cursor_new (GDK_LEFT_PTR);
-}
-
-/* Unrealize handler for the text item */
-static void
-e_text_unrealize (GnomeCanvasItem *item)
-{
- EText *text;
-
- text = E_TEXT (item);
-
- gdk_gc_unref (text->gc);
- text->gc = NULL;
-
- gdk_cursor_destroy (text->i_cursor);
- text->i_cursor = NULL;
- gdk_cursor_destroy (text->default_cursor);
- text->default_cursor = NULL;
-
- if (parent_class->unrealize)
- (* parent_class->unrealize) (item);
-}
-
-static void
-_get_tep(EText *text)
-{
- if (!text->tep) {
- text->tep = e_text_event_processor_emacs_like_new();
- text->tep_command_id =
- g_signal_connect(text->tep,
- "command",
- G_CALLBACK(e_text_command),
- text);
- }
-}
-
-static void
-draw_pango_rectangle (GdkDrawable *drawable, GdkGC *gc, int x1, int y1, PangoRectangle rect)
-{
- int width = rect.width / PANGO_SCALE;
- int height = rect.height / PANGO_SCALE;
- if (width <= 0)
- width = 1;
- if (height <= 0)
- height = 1;
- gdk_draw_rectangle (drawable, gc, TRUE,
- x1 + rect.x / PANGO_SCALE, y1 + rect.y / PANGO_SCALE, width, height);
-}
-
-static gboolean
-show_pango_rectangle (EText *text, PangoRectangle rect)
-{
- int x1 = rect.x / PANGO_SCALE;
- int x2 = (rect.x + rect.width) / PANGO_SCALE;
-
- int y1 = rect.y / PANGO_SCALE;
- int y2 = (rect.y + rect.height) / PANGO_SCALE;
-
- int new_xofs_edit = text->xofs_edit;
- int new_yofs_edit = text->yofs_edit;
-
- int clip_width, clip_height;
-
- clip_width = text->clip_width;
- if (clip_width >= 0 && text->draw_borders) {
- clip_width -= 6;
- if (clip_width < 0)
- clip_width = 0;
- }
-
- clip_height = text->clip_height;
-
- if (clip_height >= 0 && text->draw_borders) {
- clip_height -= 6;
- if (clip_height < 0)
- clip_height = 0;
- }
-
- if (x1 < new_xofs_edit)
- new_xofs_edit = x1;
-
- if (y1 < new_yofs_edit)
- new_yofs_edit = y1;
-
- if (clip_width >= 0) {
- if (2 + x2 - clip_width > new_xofs_edit)
- new_xofs_edit = 2 + x2 - clip_width;
- } else {
- new_xofs_edit = 0;
- }
-
- if (clip_height >= 0) {
- if (y2 - clip_height > new_yofs_edit)
- new_yofs_edit = y2 - clip_height;
- } else {
- new_yofs_edit = 0;
- }
-
- if (new_xofs_edit < 0)
- new_xofs_edit = 0;
- if (new_yofs_edit < 0)
- new_yofs_edit = 0;
-
- if (new_xofs_edit != text->xofs_edit ||
- new_yofs_edit != text->yofs_edit) {
- text->xofs_edit = new_xofs_edit;
- text->yofs_edit = new_yofs_edit;
- return TRUE;
- }
-
- return FALSE;
-}
-
-/* Draw handler for the text item */
-static void
-e_text_draw (GnomeCanvasItem *item, GdkDrawable *drawable,
- int x, int y, int width, int height)
-{
- EText *text;
- GdkRectangle rect, *clip_rect;
- int xpos, ypos;
- GdkGC *main_gc;
- GnomeCanvas *canvas;
- GtkWidget *widget;
-
- text = E_TEXT (item);
- canvas = GNOME_CANVAS_ITEM(text)->canvas;
- widget = GTK_WIDGET(canvas);
-
- if (text->draw_background || text->draw_button) {
- main_gc = widget->style->fg_gc[GTK_WIDGET_STATE (widget)];
- } else {
- main_gc = text->gc;
- }
-
- if (text->draw_borders || text->draw_background) {
- gdouble thisx = item->x1 - x;
- gdouble thisy = item->y1 - y;
- gdouble thiswidth, thisheight;
- GtkWidget *widget = GTK_WIDGET(item->canvas);
-
- g_object_get(text,
- "width", &thiswidth,
- "height", &thisheight,
- NULL);
-
- if (text->draw_borders){
-
- gtk_paint_shadow (widget->style, drawable,
- GTK_STATE_NORMAL, GTK_SHADOW_IN,
- NULL, widget, "entry",
- thisx, thisy, thiswidth, thisheight);
-
-#if 1
- if (text->editing) {
- thisx += 1;
- thisy += 1;
- thiswidth -= 2;
- thisheight -= 2;
-
- /*
- * Chris: I am here "filling in" for the additions
- * and substractions done in the previous if (text->editing).
- * but you might have other plans for this. Please enlighten
- * me as to whether it should be:
- * thiswidth + 2 or thiswidth + 1.
- */
- gtk_paint_focus (widget->style, drawable, GTK_STATE_NORMAL,
- NULL, widget, "entry",
- thisx, thisy, thiswidth, thisheight);
- }
-#endif
- }
-
- if (text->draw_background) {
- gtk_paint_flat_box (widget->style, drawable,
- GTK_WIDGET_STATE(widget), GTK_SHADOW_NONE,
- NULL, widget, "entry_bg",
- thisx + widget->style->xthickness,
- thisy + widget->style->ythickness,
- thiswidth - widget->style->xthickness * 2,
- thisheight - widget->style->ythickness * 2);
- }
- }
- if (text->draw_button) {
- GtkWidget *widget;
- int xoff = item->x1 - x;
- int yoff = item->y1 - y;
-
- widget = GTK_WIDGET (item->canvas);
-
- xoff -= widget->allocation.x;
- yoff -= widget->allocation.y;
-
- widget = widget->parent;
-
- while (widget && !GTK_IS_BUTTON(widget)) {
- if (!GTK_WIDGET_NO_WINDOW (widget)) {
- widget = NULL;
- break;
- }
- widget = widget->parent;
- }
- if (widget) {
- GtkButton *button = GTK_BUTTON (widget);
- GtkShadowType shadow_type;
- int thisx, thisy, thisheight, thiswidth;
- int default_spacing;
- GdkRectangle area;
- area.x = 0;
- area.y = 0;
- area.width = width;
- area.height = height;
-
-#define DEFAULT_SPACING 7
-#if 0
- default_spacing = gtk_style_get_prop_experimental (widget->style,
- "GtkButton::default_spacing",
- DEFAULT_SPACING);
-#endif
- default_spacing = 7;
-
- thisx = 0;
- thisy = 0;
- thiswidth = widget->allocation.width - GTK_CONTAINER (widget)->border_width * 2;
- thisheight = widget->allocation.height - GTK_CONTAINER (widget)->border_width * 2;
-
- if (GTK_WIDGET_HAS_DEFAULT (widget) &&
- GTK_BUTTON (widget)->relief == GTK_RELIEF_NORMAL)
- {
- gtk_paint_box (widget->style, drawable,
- GTK_STATE_NORMAL, GTK_SHADOW_IN,
- &area, widget, "buttondefault",
- thisx + xoff, thisy + yoff, thiswidth, thisheight);
- }
-
- if (GTK_WIDGET_CAN_DEFAULT (widget)) {
- thisx += widget->style->xthickness;
- thisy += widget->style->ythickness;
- thiswidth -= 2 * thisx + default_spacing;
- thisheight -= 2 * thisy + default_spacing;
- thisx += (1 + default_spacing) / 2;
- thisy += (1 + default_spacing) / 2;
- }
-
- if (GTK_WIDGET_HAS_FOCUS (widget)) {
- thisx += 1;
- thisy += 1;
- thiswidth -= 2;
- thisheight -= 2;
- }
-
- if (GTK_WIDGET_STATE (widget) == GTK_STATE_ACTIVE)
- shadow_type = GTK_SHADOW_IN;
- else
- shadow_type = GTK_SHADOW_OUT;
-
- if ((button->relief != GTK_RELIEF_NONE) ||
- ((GTK_WIDGET_STATE(widget) != GTK_STATE_NORMAL) &&
- (GTK_WIDGET_STATE(widget) != GTK_STATE_INSENSITIVE)))
- gtk_paint_box (widget->style, drawable,
- GTK_WIDGET_STATE (widget),
- shadow_type, &area, widget, "button",
- thisx + xoff, thisy + yoff, thiswidth, thisheight);
-
- if (GTK_WIDGET_HAS_FOCUS (widget)) {
- thisx -= 1;
- thisy -= 1;
- thiswidth += 2;
- thisheight += 2;
-
- gtk_paint_focus (widget->style, widget->window, GTK_WIDGET_STATE (widget),
- &area, widget, "button",
- thisx + xoff, thisy + yoff, thiswidth - 1, thisheight - 1);
- }
- }
- }
-
- if (!text->text)
- return;
-
- clip_rect = NULL;
- if (text->clip) {
- rect.x = text->clip_cx - x;
- rect.y = text->clip_cy - y;
- rect.width = text->clip_cwidth;
- rect.height = text->clip_cheight;
-
- gdk_gc_set_clip_rectangle (main_gc, &rect);
- clip_rect = &rect;
- }
-
- if (text->stipple)
- gnome_canvas_set_stipple_origin (item->canvas, main_gc);
-
- xpos = text->text_cx;
- ypos = text->text_cy;
-
- xpos -= x;
- ypos -= y;
-
- if (text->editing) {
- xpos -= text->xofs_edit;
- ypos -= text->yofs_edit;
- }
-
- gdk_draw_layout (drawable, main_gc,
- xpos, ypos,
- text->layout);
-
- if (text->editing) {
- if (text->selection_start != text->selection_end) {
- int start_index, end_index;
- PangoLayoutLine *line;
- gint *ranges;
- gint n_ranges, i;
- PangoRectangle logical_rect;
- GdkRegion *clip_region = gdk_region_new ();
- GdkGC *selection_gc;
- GdkGC *text_gc;
-
- start_index = MIN (text->selection_start, text->selection_end);
- end_index = text->selection_start ^ text->selection_end ^ start_index;
-
- if (text->has_selection) {
- selection_gc = widget->style->base_gc [GTK_STATE_SELECTED];
- text_gc = widget->style->text_gc[GTK_STATE_SELECTED];
- } else {
- selection_gc = widget->style->base_gc [GTK_STATE_ACTIVE];
- text_gc = widget->style->text_gc[GTK_STATE_ACTIVE];
- }
-
- gdk_gc_set_clip_rectangle (selection_gc, clip_rect);
-
- line = pango_layout_get_lines (text->layout)->data;
-
- pango_layout_line_get_x_ranges (line, start_index, end_index, &ranges, &n_ranges);
-
- pango_layout_get_extents (text->layout, NULL, &logical_rect);
-
- for (i=0; i < n_ranges; i++) {
- GdkRectangle sel_rect;
-
- sel_rect.x = xpos + ranges[2*i] / PANGO_SCALE;
- sel_rect.y = ypos;
- sel_rect.width = (ranges[2*i + 1] - ranges[2*i]) / PANGO_SCALE;
- sel_rect.height = logical_rect.height / PANGO_SCALE;
-
- gdk_draw_rectangle (drawable, selection_gc, TRUE,
- sel_rect.x, sel_rect.y, sel_rect.width, sel_rect.height);
-
- gdk_region_union_with_rect (clip_region, &sel_rect);
- }
-
- if (clip_rect) {
- GdkRegion *rect_region = gdk_region_rectangle (clip_rect);
- gdk_region_intersect (clip_region, rect_region);
- gdk_region_destroy (rect_region);
- }
-
- gdk_gc_set_clip_region (text_gc, clip_region);
- gdk_draw_layout (drawable, text_gc,
- xpos, ypos,
- text->layout);
-
- gdk_gc_set_clip_region (text_gc, NULL);
- gdk_gc_set_clip_region (selection_gc, NULL);
-
- gdk_region_destroy (clip_region);
- g_free (ranges);
- } else {
- if (text->show_cursor) {
- PangoRectangle strong_pos, weak_pos;
- pango_layout_get_cursor_pos (text->layout, text->selection_start, &strong_pos, &weak_pos);
- draw_pango_rectangle (drawable, main_gc, xpos, ypos, strong_pos);
- if (strong_pos.x != weak_pos.x ||
- strong_pos.y != weak_pos.y ||
- strong_pos.width != weak_pos.width ||
- strong_pos.height != weak_pos.height)
- draw_pango_rectangle (drawable, main_gc, xpos, ypos, weak_pos);
- }
- }
- }
-
-
- if (text->clip) {
- gdk_gc_set_clip_rectangle (main_gc, NULL);
- }
-}
-
-/* Point handler for the text item */
-static double
-e_text_point (GnomeCanvasItem *item, double x, double y,
- int cx, int cy, GnomeCanvasItem **actual_item)
-{
- EText *text;
- double clip_width;
- double clip_height;
-
- text = E_TEXT (item);
-
- *actual_item = item;
-
- /* The idea is to build bounding rectangles for each of the lines of
- * text (clipped by the clipping rectangle, if it is activated) and see
- * whether the point is inside any of these. If it is, we are done.
- * Otherwise, calculate the distance to the nearest rectangle.
- */
-
- if (text->clip_width < 0)
- clip_width = text->width;
- else
- clip_width = text->clip_width;
-
- if ( text->clip_height < 0 )
- clip_height = text->height;
- else
- clip_height = text->clip_height;
-
- /* Get canvas pixel coordinates for clip rectangle position */
- clip_width = clip_width * item->canvas->pixels_per_unit;
- clip_height = clip_height * item->canvas->pixels_per_unit;
-
- if (cx < text->clip_cx ||
- cx > text->clip_cx + clip_width ||
- cy < text->clip_cy ||
- cy > text->clip_cy + clip_height)
- return 1;
-
- if (text->fill_clip_rectangle)
- return 0;
-
- cx -= text->cx;
-
- if (pango_layout_xy_to_index (text->layout, cx, cy, NULL, NULL))
- return 0;
-
- return 1;
-}
-
-/* Bounds handler for the text item */
-static void
-e_text_bounds (GnomeCanvasItem *item, double *x1, double *y1, double *x2, double *y2)
-{
- EText *text;
- double width, height;
-
- text = E_TEXT (item);
-
- *x1 = 0;
- *y1 = 0;
-
- width = text->width;
- height = text->height;
-
- if (text->clip) {
- if (text->clip_width >= 0)
- width = text->clip_width;
- if ( text->clip_height >= 0 )
- height = text->clip_height;
- }
-
- width = width / item->canvas->pixels_per_unit;
- height = height / item->canvas->pixels_per_unit;
-
- switch (text->anchor) {
- case GTK_ANCHOR_NW:
- case GTK_ANCHOR_W:
- case GTK_ANCHOR_SW:
- break;
-
- case GTK_ANCHOR_N:
- case GTK_ANCHOR_CENTER:
- case GTK_ANCHOR_S:
- *x1 -= width / 2.0;
- break;
-
- case GTK_ANCHOR_NE:
- case GTK_ANCHOR_E:
- case GTK_ANCHOR_SE:
- *x1 -= width;
- break;
- }
-
- switch (text->anchor) {
- case GTK_ANCHOR_NW:
- case GTK_ANCHOR_N:
- case GTK_ANCHOR_NE:
- break;
-
- case GTK_ANCHOR_W:
- case GTK_ANCHOR_CENTER:
- case GTK_ANCHOR_E:
- *y1 -= height / 2.0;
- break;
-
- case GTK_ANCHOR_SW:
- case GTK_ANCHOR_S:
- case GTK_ANCHOR_SE:
- *y1 -= height;
- break;
- }
-
- *x2 = *x1 + width;
- *y2 = *y1 + height;
-}
-
-static gint
-get_position_from_xy (EText *text, gint x, gint y)
-{
- int index;
- int trailing;
-
- if (text->draw_borders) {
- x -= BORDER_INDENT;
- y -= BORDER_INDENT;
- }
-
- x -= text->xofs;
- y -= text->yofs;
-
- if (text->editing) {
- x += text->xofs_edit;
- y += text->yofs_edit;
- }
-
- x -= text->cx;
- y -= text->cy;
-
- pango_layout_xy_to_index (text->layout, x * PANGO_SCALE, y * PANGO_SCALE, &index, &trailing);
-
- return g_utf8_offset_to_pointer (text->text + index, trailing) - text->text;
-}
-
-#define SCROLL_WAIT_TIME 30000
-
-static gboolean
-_blink_scroll_timeout (gpointer data)
-{
- EText *text = E_TEXT(data);
- gulong current_time;
- gboolean scroll = FALSE;
- gboolean redraw = FALSE;
-
- g_timer_elapsed(text->timer, &current_time);
-
- if (text->scroll_start + SCROLL_WAIT_TIME > 1000000) {
- if (current_time > text->scroll_start - (1000000 - SCROLL_WAIT_TIME) &&
- current_time < text->scroll_start)
- scroll = TRUE;
- } else {
- if (current_time > text->scroll_start + SCROLL_WAIT_TIME ||
- current_time < text->scroll_start)
- scroll = TRUE;
- }
- if (scroll && text->button_down && text->clip) {
- int old_xofs_edit = text->xofs_edit;
- int old_yofs_edit = text->yofs_edit;
-
- if (text->clip_cwidth >= 0 &&
- text->lastx - text->clip_cx > text->clip_cwidth &&
- text->xofs_edit < text->width - text->clip_cwidth) {
- text->xofs_edit += 4;
- if (text->xofs_edit > text->width - text->clip_cwidth + 1)
- text->xofs_edit = text->width - text->clip_cwidth + 1;
- }
- if (text->lastx - text->clip_cx < 0 &&
- text->xofs_edit > 0) {
- text->xofs_edit -= 4;
- if (text->xofs_edit < 0)
- text->xofs_edit = 0;
- }
-
- if (text->clip_cheight >= 0 &&
- text->lasty - text->clip_cy > text->clip_cheight &&
- text->yofs_edit < text->height - text->clip_cheight) {
- text->yofs_edit += 4;
- if (text->yofs_edit > text->height - text->clip_cheight + 1)
- text->yofs_edit = text->height - text->clip_cheight + 1;
- }
- if (text->lasty - text->clip_cy < 0 &&
- text->yofs_edit > 0) {
- text->yofs_edit -= 4;
- if (text->yofs_edit < 0)
- text->yofs_edit = 0;
- }
-
- if (old_xofs_edit != text->xofs_edit ||
- old_yofs_edit != text->yofs_edit) {
- ETextEventProcessorEvent e_tep_event;
- e_tep_event.type = GDK_MOTION_NOTIFY;
- e_tep_event.motion.state = text->last_state;
- e_tep_event.motion.time = 0;
- e_tep_event.motion.position = get_position_from_xy(text, text->lastx, text->lasty);
- _get_tep(text);
- e_text_event_processor_handle_event (text->tep,
- &e_tep_event);
- text->scroll_start = current_time;
- redraw = TRUE;
- }
- }
-
- if (!((current_time / 500000) % 2)) {
- if (!text->show_cursor)
- redraw = TRUE;
- text->show_cursor = TRUE;
- } else {
- if (text->show_cursor)
- redraw = TRUE;
- text->show_cursor = FALSE;
- }
- if (redraw) {
- text->needs_redraw = 1;
- gnome_canvas_item_request_update (GNOME_CANVAS_ITEM(text));
- }
- return TRUE;
-}
-
-static gboolean
-tooltip_event(GtkWidget *tooltip, GdkEvent *event, EText *text)
-{
- gint ret_val = FALSE;
-
- if (!text->model)
- return FALSE;
-
- switch (event->type) {
- case GDK_LEAVE_NOTIFY:
- e_canvas_hide_tooltip (E_CANVAS(GNOME_CANVAS_ITEM(text)->canvas));
- break;
- case GDK_BUTTON_PRESS:
- case GDK_BUTTON_RELEASE:
- if (event->type == GDK_BUTTON_RELEASE) {
- e_canvas_hide_tooltip (E_CANVAS(GNOME_CANVAS_ITEM(text)->canvas));
- }
- /* Forward events to the text item */
- g_signal_emit_by_name (text, "event", event,
- &ret_val);
- if (!ret_val)
- gtk_propagate_event (GTK_WIDGET(GNOME_CANVAS_ITEM(text)->canvas), event);
- ret_val = TRUE;
- default:
- break;
- }
- return ret_val;
-}
-
-static void
-tooltip_destroy(gpointer data, GObject *where_object_was)
-{
- EText *text = data;
- text->tooltip_owner = FALSE;
- g_object_unref (text);
-}
-
-static gboolean
-_do_tooltip (gpointer data)
-{
-#warning "need to sort out tooltip stuff."
- EText *text = E_TEXT (data);
- struct line *lines;
- GtkWidget *canvas;
- int i;
- int max_width;
- gboolean cut_off;
- double i2c[6];
- ArtPoint origin = {0, 0};
- ArtPoint pixel_origin;
- int canvas_x, canvas_y;
- GnomeCanvasItem *tooltip_text;
- double tooltip_width;
- double tooltip_height;
- double tooltip_x;
- double tooltip_y;
-#if 0
- double x1, x2, y1, y2;
-#endif
- GnomeCanvasItem *rect;
- GtkWidget *tooltip_window; /* GtkWindow for displaying the tooltip */
-
- text->tooltip_count = 0;
-
- if (E_CANVAS(GNOME_CANVAS_ITEM(text)->canvas)->tooltip_window || text->editing || !text->num_lines) {
- text->tooltip_timeout = 0;
- return FALSE;
- }
-
- cut_off = FALSE;
- for ( i = 0; i < text->num_lines; i++ ) {
- PangoLayoutLine *line = pango_layout_get_line (text->layout, i);
- PangoRectangle rect;
-
- pango_layout_line_get_pixel_extents (line, &rect, NULL);
-
- if (rect.width > text->clip_width) {
- cut_off = TRUE;
- break;
- }
- }
- if ( ! cut_off ) {
- text->tooltip_timeout = 0;
- return FALSE;
- }
-
- gnome_canvas_item_i2c_affine(GNOME_CANVAS_ITEM(text), i2c);
- art_affine_point (&pixel_origin, &origin, i2c);
-
- gdk_window_get_origin (GTK_WIDGET(GNOME_CANVAS_ITEM(text)->canvas)->window, &canvas_x, &canvas_y);
- pixel_origin.x += canvas_x;
- pixel_origin.y += canvas_y;
- pixel_origin.x -= (int) gtk_layout_get_hadjustment(GTK_LAYOUT(GNOME_CANVAS_ITEM(text)->canvas))->value;
- pixel_origin.y -= (int) gtk_layout_get_vadjustment(GTK_LAYOUT(GNOME_CANVAS_ITEM(text)->canvas))->value;
-
- tooltip_window = gtk_window_new (GTK_WINDOW_POPUP);
- gtk_container_set_border_width (GTK_CONTAINER (tooltip_window), 1);
-
- canvas = e_canvas_new ();
-
- gtk_container_add (GTK_CONTAINER (tooltip_window), canvas);
-
- /* Get the longest line length */
- pango_layout_get_size (text->layout, &max_width, NULL);
-
- rect = gnome_canvas_item_new (gnome_canvas_root (GNOME_CANVAS (canvas)),
- gnome_canvas_rect_get_type (),
- "x1", (double) 0,
- "y1", (double) 0,
- "x2", (double) max_width + 4,
- "y2", (double) text->height + 4,
- "fill_color", "light gray",
- NULL);
-
- tooltip_text = gnome_canvas_item_new (gnome_canvas_root (GNOME_CANVAS (canvas)),
- e_text_get_type (),
- "anchor", GTK_ANCHOR_NW,
- "bold", text->bold,
- "strikeout", text->strikeout,
- "text", text->text,
- "editable", FALSE,
- "clip_width", text->max_lines != 1 ? text->clip_width : max_width,
- "clip_height", text->max_lines != 1 ? -1 : (double)text->height,
- "clip", TRUE,
- "line_wrap", text->line_wrap,
- "justification", text->justification,
- NULL);
-
-
-
- if (text->draw_borders)
- e_canvas_item_move_absolute(tooltip_text, 1 + BORDER_INDENT, 1 + BORDER_INDENT);
- else
- e_canvas_item_move_absolute(tooltip_text, 1, 1);
-
- create_layout (E_TEXT (tooltip_text));
-
- split_into_lines (E_TEXT(tooltip_text));
- calc_height (E_TEXT(tooltip_text));
-
- gnome_canvas_item_set (tooltip_text,
- "clip_height", (double) E_TEXT(tooltip_text)->height,
- "clip_width", (double) E_TEXT(tooltip_text)->width,
- NULL);
-
- tooltip_width = E_TEXT(tooltip_text)->width;
- tooltip_height = E_TEXT(tooltip_text)->height;
- tooltip_x = 0;
- tooltip_y = 0;
- switch(E_TEXT(tooltip_text)->justification) {
- case GTK_JUSTIFY_CENTER:
- tooltip_x = - tooltip_width / 2;
- break;
- case GTK_JUSTIFY_RIGHT:
- tooltip_x = tooltip_width / 2;
- break;
- case GTK_JUSTIFY_FILL:
- case GTK_JUSTIFY_LEFT:
- tooltip_x = 0;
- break;
- }
- switch(text->anchor) {
- case GTK_ANCHOR_NW:
- case GTK_ANCHOR_N:
- case GTK_ANCHOR_NE:
- break;
-
- case GTK_ANCHOR_W:
- case GTK_ANCHOR_CENTER:
- case GTK_ANCHOR_E:
- tooltip_y -= tooltip_height / 2.0;
- break;
-
- case GTK_ANCHOR_SW:
- case GTK_ANCHOR_S:
- case GTK_ANCHOR_SE:
- tooltip_y -= tooltip_height;
- break;
- }
- switch(E_TEXT(tooltip_text)->anchor) {
- case GTK_ANCHOR_NW:
- case GTK_ANCHOR_W:
- case GTK_ANCHOR_SW:
- break;
-
- case GTK_ANCHOR_N:
- case GTK_ANCHOR_CENTER:
- case GTK_ANCHOR_S:
- tooltip_x -= tooltip_width / 2.0;
- break;
-
- case GTK_ANCHOR_NE:
- case GTK_ANCHOR_E:
- case GTK_ANCHOR_SE:
- tooltip_x -= tooltip_width;
- break;
- }
-
- gnome_canvas_item_set(rect,
- "x2", (double) tooltip_width + 4 + (text->draw_borders ? BORDER_INDENT * 2 : 0),
- "y2", (double) tooltip_height + 4 + (text->draw_borders ? BORDER_INDENT * 2 : 0),
- NULL);
-
- gtk_widget_show (canvas);
- gtk_widget_realize (tooltip_window);
-
- gtk_widget_set_usize (tooltip_window,
- tooltip_width + 4 + (text->draw_borders ? BORDER_INDENT * 2 : 0),
- tooltip_height + 4 + (text->draw_borders ? BORDER_INDENT * 2 : 0));
- gnome_canvas_set_scroll_region (GNOME_CANVAS(canvas), 0.0, 0.0,
- tooltip_width + (text->draw_borders ? BORDER_INDENT * 2 : 0),
- (double)tooltip_height + (text->draw_borders ? BORDER_INDENT * 2 : 0));
- g_signal_connect (tooltip_window, "event",
- G_CALLBACK(tooltip_event), text);
- g_object_weak_ref (G_OBJECT (tooltip_window),
- tooltip_destroy, text);
- g_object_ref (text);
-
- e_canvas_popup_tooltip (E_CANVAS(GNOME_CANVAS_ITEM(text)->canvas),
- tooltip_window,
- pixel_origin.x - 2 + tooltip_x,
- pixel_origin.y - 2 + tooltip_y);
- text->tooltip_owner = TRUE;
-
- text->tooltip_timeout = 0;
-
- return FALSE;
-}
-
-static void
-start_editing (EText *text)
-{
- if (text->editing)
- return;
-
- g_free (text->revert);
- text->revert = g_strdup (text->text);
-
- text->editing = TRUE;
- if (text->pointer_in) {
- if (text->default_cursor_shown && (!text->draw_borders)) {
- gdk_window_set_cursor (GTK_WIDGET (GNOME_CANVAS_ITEM (text)->canvas)->window, text->i_cursor);
- text->default_cursor_shown = FALSE;
- }
- }
- text->select_by_word = FALSE;
- text->xofs_edit = 0;
- text->yofs_edit = 0;
- if (text->timeout_id == 0)
- text->timeout_id = g_timeout_add(10, _blink_scroll_timeout, text);
- text->timer = g_timer_new();
- g_timer_elapsed(text->timer, &(text->scroll_start));
- g_timer_start(text->timer);
-}
-
-void
-e_text_stop_editing (EText *text)
-{
- if (!text->editing)
- return;
-
- g_free (text->revert);
- text->revert = NULL;
-
- text->editing = FALSE;
- if ( (!text->default_cursor_shown) && (!text->draw_borders) ) {
- gdk_window_set_cursor (GTK_WIDGET (GNOME_CANVAS_ITEM (text)->canvas)->window, text->default_cursor);
- text->default_cursor_shown = TRUE;
- }
- if (text->timer) {
- g_timer_stop(text->timer);
- g_timer_destroy(text->timer);
- text->timer = NULL;
- }
-}
-
-void
-e_text_cancel_editing (EText *text)
-{
- if (text->revert)
- e_text_model_set_text(text->model, text->revert);
- e_text_stop_editing (text);
-}
-
-static gboolean
-_click (gpointer data)
-{
- *(gint *)data = 0;
- return FALSE;
-}
-
-static gint
-e_text_event (GnomeCanvasItem *item, GdkEvent *event)
-{
- EText *text = E_TEXT(item);
- ETextEventProcessorEvent e_tep_event;
-
- gint return_val = 0;
-
- if (!text->model)
- return FALSE;
-
- e_tep_event.type = event->type;
- switch (event->type) {
- case GDK_FOCUS_CHANGE:
- if (text->editable) {
- GdkEventFocus *focus_event;
- focus_event = (GdkEventFocus *) event;
- if (focus_event->in) {
- start_editing (text);
- text->show_cursor = FALSE; /* so we'll redraw and the cursor will be shown */
- } else {
- e_text_stop_editing (text);
- if (text->timeout_id) {
- g_source_remove(text->timeout_id);
- text->timeout_id = 0;
- }
- if (text->show_cursor || text->draw_borders) {
- text->show_cursor = FALSE;
- text->needs_redraw = 1;
- gnome_canvas_item_request_update (GNOME_CANVAS_ITEM(text));
- }
- }
- if ( text->line_wrap )
- text->needs_split_into_lines = 1;
- e_canvas_item_request_reflow (GNOME_CANVAS_ITEM(text));
- }
- return_val = 0;
- break;
- case GDK_KEY_PRESS: /* Fall Through */
- case GDK_KEY_RELEASE:
- if (text->editing) {
- GdkEventKey key = event->key;
- gint ret;
-
- e_tep_event.key.time = key.time;
- e_tep_event.key.state = key.state;
- e_tep_event.key.keyval = key.keyval;
-
- /* This is probably ugly hack, but we have to handle UTF-8 input somehow */
-#if 0
- e_tep_event.key.length = key.length;
- e_tep_event.key.string = key.string;
-#else
- e_tep_event.key.string = e_utf8_from_gtk_event_key (GTK_WIDGET (item->canvas), key.keyval, key.string);
- if (e_tep_event.key.string != NULL) {
- e_tep_event.key.length = strlen (e_tep_event.key.string);
- } else {
- e_tep_event.key.length = 0;
- }
-#endif
- _get_tep(text);
- ret = e_text_event_processor_handle_event (text->tep, &e_tep_event);
-
- if (event->type == GDK_KEY_PRESS)
- g_signal_emit (text, e_text_signals[E_TEXT_KEYPRESS], 0,
- e_tep_event.key.keyval, e_tep_event.key.state);
-
-
- if (e_tep_event.key.string)
- g_free (e_tep_event.key.string);
-
-
- return ret;
- }
- break;
- case GDK_BUTTON_PRESS: /* Fall Through */
- case GDK_BUTTON_RELEASE:
- if (text->tooltip_timeout) {
- gtk_timeout_remove (text->tooltip_timeout);
- text->tooltip_timeout = 0;
- }
- e_canvas_hide_tooltip (E_CANVAS(GNOME_CANVAS_ITEM(text)->canvas));
-#if 0
- if ((!text->editing)
- && text->editable
- && event->type == GDK_BUTTON_RELEASE
- && event->button.button == 1) {
- GdkEventButton button = event->button;
-
- e_canvas_item_grab_focus (item, TRUE);
-
- e_tep_event.type = GDK_BUTTON_RELEASE;
- e_tep_event.button.time = button.time;
- e_tep_event.button.state = button.state;
- e_tep_event.button.button = button.button;
- e_tep_event.button.position = get_position_from_xy(text, button.x, button.y);
- _get_tep(text);
- return_val = e_text_event_processor_handle_event (text->tep,
- &e_tep_event);
- e_tep_event.type = GDK_BUTTON_RELEASE;
- }
-#else
- if ((!text->editing)
- && text->editable
- && (event->button.button == 1 ||
- event->button.button == 2)) {
- e_canvas_item_grab_focus (item, TRUE);
- start_editing (text);
- }
-#endif
-
- /* We follow convention and emit popup events on right-clicks. */
- if (event->type == GDK_BUTTON_PRESS && event->button.button == 3) {
- g_signal_emit (text,
- e_text_signals[E_TEXT_POPUP], 0,
- &(event->button),
- get_position_from_xy (text, event->button.x, event->button.y));
-
- break;
- }
-
- /* Create our own double and triple click events,
- as gnome-canvas doesn't forward them to us */
- if (event->type == GDK_BUTTON_PRESS) {
- if (text->dbl_timeout == 0 &&
- text->tpl_timeout == 0) {
- text->dbl_timeout = gtk_timeout_add (200,
- _click,
- &(text->dbl_timeout));
- } else {
- if (text->tpl_timeout == 0) {
- e_tep_event.type = GDK_2BUTTON_PRESS;
- text->tpl_timeout = gtk_timeout_add (200, _click, &(text->tpl_timeout));
- } else {
- e_tep_event.type = GDK_3BUTTON_PRESS;
- }
- }
- }
-
- if (text->editing) {
- GdkEventButton button = event->button;
- e_tep_event.button.time = button.time;
- e_tep_event.button.state = button.state;
- e_tep_event.button.button = button.button;
- e_tep_event.button.position = get_position_from_xy(text, button.x, button.y);
- _get_tep(text);
- return_val = e_text_event_processor_handle_event (text->tep,
- &e_tep_event);
- if (event->button.button == 1) {
- if (event->type == GDK_BUTTON_PRESS)
- text->button_down = TRUE;
- else
- text->button_down = FALSE;
- }
- text->lastx = button.x;
- text->lasty = button.y;
- text->last_state = button.state;
- }
- break;
- case GDK_MOTION_NOTIFY:
- if (text->editing) {
- GdkEventMotion motion = event->motion;
- e_tep_event.motion.time = motion.time;
- e_tep_event.motion.state = motion.state;
- e_tep_event.motion.position = get_position_from_xy(text, motion.x, motion.y);
- _get_tep(text);
- return_val = e_text_event_processor_handle_event (text->tep,
- &e_tep_event);
- text->lastx = motion.x;
- text->lasty = motion.y;
- text->last_state = motion.state;
- }
- break;
- case GDK_ENTER_NOTIFY:
- {
- if ( text->tooltip_count == 0 && text->clip) {
- if (!text->tooltip_timeout)
- text->tooltip_timeout = gtk_timeout_add (1000, _do_tooltip, text);
- }
- text->tooltip_count ++;
- }
-
- text->pointer_in = TRUE;
- if (text->editing || text->draw_borders) {
- if ( text->default_cursor_shown ) {
- gdk_window_set_cursor(GTK_WIDGET(item->canvas)->window, text->i_cursor);
- text->default_cursor_shown = FALSE;
- }
- }
- break;
- case GDK_LEAVE_NOTIFY:
- if (text->tooltip_count > 0)
- text->tooltip_count --;
- if ( text->tooltip_count == 0 && text->clip) {
- if ( text->tooltip_timeout ) {
- gtk_timeout_remove (text->tooltip_timeout);
- text->tooltip_timeout = 0;
- }
- }
-
- text->pointer_in = FALSE;
- if (text->editing || text->draw_borders) {
- if ( ! text->default_cursor_shown ) {
- gdk_window_set_cursor(GTK_WIDGET(item->canvas)->window, text->default_cursor);
- text->default_cursor_shown = TRUE;
- }
- }
- break;
- default:
- break;
- }
- if (return_val)
- return return_val;
- if (GNOME_CANVAS_ITEM_CLASS(parent_class)->event)
- return GNOME_CANVAS_ITEM_CLASS(parent_class)->event(item, event);
- else
- return 0;
-}
-
-/* fixme: */
-
-static int
-next_word (EText *text, int start)
-{
- char *p;
- int length;
-
- length = strlen (text->text);
-
- if (start >= length) {
- return length;
- } else {
- p = g_utf8_next_char (text->text + start);
-
- while (p && *p && g_unichar_validate (g_utf8_get_char (p))) {
- gunichar unival = g_utf8_get_char (p);
- if (g_unichar_isspace (unival)) {
- return p - text->text;
- } else
- p = g_utf8_next_char (p);
- }
- }
-
- return p - text->text;
-}
-
-static int
-_get_position(EText *text, ETextEventProcessorCommand *command)
-{
- int length, obj_num;
- gunichar unival;
- char *p = NULL;
- gint new_pos = 0;
- int index, trailing;
-
- switch (command->position) {
-
- case E_TEP_VALUE:
- new_pos = command->value;
- break;
-
- case E_TEP_SELECTION:
- new_pos = text->selection_end;
- break;
-
- case E_TEP_START_OF_BUFFER:
- new_pos = 0;
- break;
-
- case E_TEP_END_OF_BUFFER:
- new_pos = strlen (text->text);
- break;
-
- case E_TEP_START_OF_LINE:
-
- new_pos = 0;
-
- if (text->selection_end >= 1) {
-
- p = g_utf8_find_prev_char (text->text, text->text + text->selection_end);
- if (p != text->text) {
- p = g_utf8_find_prev_char (text->text, p);
-
- while (p && p > text->text && !new_pos) {
- if (*p == '\n')
- new_pos = p - text->text + 1;
- p = g_utf8_find_prev_char (text->text, p);
- }
- }
- }
-
- break;
-
- case E_TEP_END_OF_LINE:
- new_pos = -1;
- length = strlen (text->text);
-
- if (text->selection_end >= length) {
- new_pos = length;
- } else {
-
- p = g_utf8_next_char (text->text + text->selection_end);
-
- while (p && *p && g_unichar_validate (g_utf8_get_char (p))) {
- if (*p == '\n') {
- new_pos = p - text->text;
- p = NULL;
- } else
- p = g_utf8_next_char (p);
- }
- }
-
- if (new_pos == -1)
- new_pos = p - text->text;
-
- break;
-
- case E_TEP_FORWARD_CHARACTER:
- length = strlen (text->text);
-
- if (text->selection_end >= length) {
- new_pos = length;
- } else {
- p = g_utf8_next_char (text->text + text->selection_end);
- new_pos = p - text->text;
- }
-
- break;
-
- case E_TEP_BACKWARD_CHARACTER:
- new_pos = 0;
- if (text->selection_end >= 1) {
- p = g_utf8_find_prev_char (text->text, text->text + text->selection_end);
-
- if (p != NULL)
- new_pos = p - text->text;
- }
-
- break;
-
- case E_TEP_FORWARD_WORD:
- new_pos = next_word (text, text->selection_end);
- break;
-
- case E_TEP_BACKWARD_WORD:
- new_pos = 0;
- if (text->selection_end >= 1) {
- p = g_utf8_find_prev_char (text->text, text->text + text->selection_end);
- if (p != text->text) {
- p = g_utf8_find_prev_char (text->text, p);
-
- while (p && p > text->text && g_unichar_validate (g_utf8_get_char (p))) {
- unival = g_utf8_get_char (p);
- if (g_unichar_isspace (unival)) {
- new_pos = g_utf8_next_char (p) - text->text;
- p = NULL;
- } else
- p = g_utf8_find_prev_char (text->text, p);
- }
- }
- }
-
- break;
-
- case E_TEP_FORWARD_LINE:
- pango_layout_move_cursor_visually (text->layout,
- TRUE,
- text->selection_end, 0,
- 1,
- &index, &trailing);
- index = g_utf8_offset_to_pointer (text->text + index, trailing) - text->text;
- if (index < 0) {
- new_pos = 0;
- } else {
- length = strlen (text->text);
- if (index >= length)
- new_pos = length;
- else
- new_pos = index;
- }
- break;
-
- case E_TEP_BACKWARD_LINE:
- pango_layout_move_cursor_visually (text->layout,
- TRUE,
- text->selection_end, 0,
- -1,
- &index, &trailing);
- index = g_utf8_offset_to_pointer (text->text + index, trailing) - text->text;
- if (index < 0) {
- new_pos = 0;
- } else {
- length = strlen (text->text);
- if (index >= length)
- new_pos = length;
- else
- new_pos = index;
- }
- break;
-
- case E_TEP_SELECT_WORD:
-
- /* This is a silly hack to cause double-clicking on an object
- to activate that object.
- (Normally, double click == select word, which is why this is here.) */
-
- obj_num = e_text_model_get_object_at_offset (text->model, text->selection_start);
- if (obj_num != -1) {
- e_text_model_activate_nth_object (text->model, obj_num);
- new_pos = text->selection_start;
- break;
- }
-
-
- if (text->selection_end < 1) {
- new_pos = 0;
- break;
- }
-
- p = g_utf8_find_prev_char (text->text, text->text + text->selection_end);
- if (p == text->text) {
- new_pos = 0;
- break;
- }
- p = g_utf8_find_prev_char (text->text, p);
-
- while (p && p > text->text && g_unichar_validate (g_utf8_get_char (p))) {
- unival = g_utf8_get_char (p);
- if (g_unichar_isspace (unival)) {
- p = g_utf8_next_char (p);
- break;
- }
- p = g_utf8_find_prev_char (text->text, p);
- }
-
- if (!p)
- text->selection_start = 0;
- else
- text->selection_start = p - text->text;
-
-
- text->selection_start = e_text_model_validate_position (text->model, text->selection_start);
-
- length = strlen (text->text);
- if (text->selection_end >= length) {
- new_pos = length;
- break;
- }
-
- p = g_utf8_next_char (text->text + text->selection_end);
-
- while (p && *p && g_unichar_validate (g_utf8_get_char (p))) {
- unival = g_utf8_get_char (p);
- if (g_unichar_isspace (unival)) {
- new_pos = p - text->text;
- p = NULL;
- } else
- p = g_utf8_next_char (p);
- }
-
- if (p)
- new_pos = p - text->text;
-
- return new_pos;
-
- case E_TEP_SELECT_ALL:
- text->selection_start = 0;
- new_pos = strlen (text->text);
- break;
-
- case E_TEP_FORWARD_PARAGRAPH:
- case E_TEP_BACKWARD_PARAGRAPH:
-
- case E_TEP_FORWARD_PAGE:
- case E_TEP_BACKWARD_PAGE:
- new_pos = text->selection_end;
- break;
-
- default:
- new_pos = text->selection_end;
- break;
- }
-
- new_pos = e_text_model_validate_position (text->model, new_pos);
-
- return new_pos;
-}
-
-static void
-_delete_selection(EText *text)
-{
- if ( text->selection_start < text->selection_end ) {
- e_text_model_delete(text->model, text->selection_start, text->selection_end - text->selection_start);
-#if 0
- text->selection_end = text->selection_start;
-#endif
- } else {
- e_text_model_delete(text->model, text->selection_end, text->selection_start - text->selection_end);
-#if 0
- text->selection_start = text->selection_end;
-#endif
- }
-}
-
-static void
-_insert(EText *text, char *string, int value)
-{
- if (value > 0) {
- if (!text->allow_newlines) {
- char *i;
- for (i = string; *i; i++) {
- if (*i == '\n') {
- char *new_string = g_malloc (strlen (string) + 1);
- char *j = new_string;
- for (i = string; *i; i++) {
- if (*i != '\n')
- *(j++) = *i;
- }
- *j = 0;
- e_text_model_insert_length(text->model, text->selection_start, new_string, j - new_string);
- g_free (new_string);
- return;
- }
- }
- }
- e_text_model_insert_length(text->model, text->selection_start, string, value);
-
-#if 0
- text->selection_start += value;
- text->selection_end = text->selection_start;
-#endif
- }
-}
-
-static void
-capitalize (EText *text, int start, int end, ETextEventProcessorCaps type)
-{
- gboolean first = TRUE;
- const char *p = text->text + start;
- const char *text_end = text->text + end;
- char *new_text = g_new0 (char, g_utf8_strlen (text->text + start, start - end) * 6);
- char *output = new_text;
-
- while (p && *p && p < text_end && g_unichar_validate (g_utf8_get_char (p))) {
- gunichar unival = g_utf8_get_char (p);
- gunichar newval = unival;
-
- switch (type) {
- case E_TEP_CAPS_UPPER:
- newval = g_unichar_toupper (unival);
- break;
- case E_TEP_CAPS_LOWER:
- newval = g_unichar_tolower (unival);
- break;
- case E_TEP_CAPS_TITLE:
- if (g_unichar_isalpha (unival)) {
- if (first)
- newval = g_unichar_totitle (unival);
- else
- newval = g_unichar_tolower (unival);
- first = FALSE;
- } else {
- first = TRUE;
- }
- break;
- }
- g_unichar_to_utf8 (newval, output);
- output = g_utf8_next_char (output);
-
- p = g_utf8_next_char (p);
- }
- *output = 0;
-
- e_text_model_delete (text->model, start, end - start);
- e_text_model_insert (text->model, start, new_text);
- g_free (new_text);
-}
-
-static void
-e_text_command(ETextEventProcessor *tep, ETextEventProcessorCommand *command, gpointer data)
-{
- EText *text = E_TEXT(data);
- int sel_start, sel_end;
- gboolean changed = TRUE;
-
- switch (command->action) {
- case E_TEP_MOVE:
- text->selection_start = _get_position(text, command);
- text->selection_end = text->selection_start;
- if (text->timer) {
- g_timer_reset(text->timer);
- }
-
- break;
- case E_TEP_SELECT:
- text->selection_start = e_text_model_validate_position (text->model, text->selection_start); /* paranoia */
- text->selection_end = _get_position(text, command);
-
- sel_start = MIN(text->selection_start, text->selection_end);
- sel_end = MAX(text->selection_start, text->selection_end);
-
- sel_start = e_text_model_validate_position (text->model, sel_start);
-
- if (sel_start != sel_end) {
- e_text_supply_selection (text, command->time, GDK_SELECTION_PRIMARY,
- (guchar *) text->text + sel_start, sel_end - sel_start);
- } else if (text->timer) {
- g_timer_reset(text->timer);
- }
-
- break;
- case E_TEP_DELETE:
- if (text->selection_end == text->selection_start) {
- text->selection_end = _get_position(text, command);
- }
- _delete_selection(text);
- if (text->timer) {
- g_timer_reset(text->timer);
- }
- break;
-
- case E_TEP_INSERT:
- if (text->selection_end != text->selection_start) {
- _delete_selection(text);
- }
- _insert(text, command->string, command->value);
- if (text->timer) {
- g_timer_reset(text->timer);
- }
- break;
- case E_TEP_COPY:
- sel_start = MIN(text->selection_start, text->selection_end);
- sel_end = MAX(text->selection_start, text->selection_end);
- if (sel_start != sel_end) {
- e_text_supply_selection (text, command->time, clipboard_atom,
- (guchar *) text->text + sel_start, sel_end - sel_start);
- }
- if (text->timer) {
- g_timer_reset(text->timer);
- }
- changed = FALSE;
- break;
- case E_TEP_PASTE:
- e_text_get_selection (text, clipboard_atom, command->time);
- if (text->timer) {
- g_timer_reset(text->timer);
- }
- break;
- case E_TEP_GET_SELECTION:
- e_text_get_selection (text, GDK_SELECTION_PRIMARY, command->time);
- break;
- case E_TEP_ACTIVATE:
- g_signal_emit (text, e_text_signals[E_TEXT_ACTIVATE], 0);
- if (text->timer) {
- g_timer_reset(text->timer);
- }
- break;
- case E_TEP_SET_SELECT_BY_WORD:
- text->select_by_word = command->value;
- break;
- case E_TEP_GRAB:
- e_canvas_item_grab (E_CANVAS (GNOME_CANVAS_ITEM(text)->canvas),
- GNOME_CANVAS_ITEM(text),
- GDK_BUTTON_RELEASE_MASK | GDK_POINTER_MOTION_MASK,
- text->i_cursor,
- command->time,
- NULL,
- NULL);
- changed = FALSE;
- break;
- case E_TEP_UNGRAB:
- e_canvas_item_ungrab (E_CANVAS (GNOME_CANVAS_ITEM(text)->canvas),
- GNOME_CANVAS_ITEM(text),
- command->time);
- changed = FALSE;
- break;
- case E_TEP_CAPS:
- if (text->selection_start == text->selection_end) {
- capitalize (text, text->selection_start, next_word (text, text->selection_start), command->value);
- } else {
- int selection_start = MIN (text->selection_start, text->selection_end);
- int selection_end = text->selection_start + text->selection_end - selection_start; /* Slightly faster than MAX */
- capitalize (text, selection_start, selection_end, command->value);
- }
- break;
- case E_TEP_NOP:
- changed = FALSE;
- break;
- }
-
- text->needs_redraw = 1;
- gnome_canvas_item_request_update (GNOME_CANVAS_ITEM(text));
-}
-
-static void
-_invisible_destroy (gpointer data, GObject *where_object_was)
-{
- EText *text = E_TEXT (data);
- text->invisible = NULL;
-}
-
-static GtkWidget *
-e_text_get_invisible(EText *text)
-{
- GtkWidget *invisible;
- if (text->invisible) {
- invisible = text->invisible;
- } else {
- static const GtkTargetEntry targets[] = {
- { "UTF8_STRING", 0, TARGET_UTF8_STRING },
- { "UTF-8", 0, TARGET_UTF8 },
- { "COMPOUND_TEXT", 0, TARGET_COMPOUND_TEXT },
- { "STRING", 0, TARGET_STRING },
- { "TEXT", 0, TARGET_TEXT }
- };
- static const gint n_targets = sizeof(targets) / sizeof(targets[0]);
-
- invisible = gtk_invisible_new();
- text->invisible = invisible;
-
- gtk_selection_add_targets (invisible,
- GDK_SELECTION_PRIMARY,
- targets, n_targets);
- gtk_selection_add_targets (invisible,
- clipboard_atom,
- targets, n_targets);
-
- g_signal_connect (invisible, "selection_get",
- G_CALLBACK (_selection_get),
- text);
- g_signal_connect (invisible, "selection_clear_event",
- G_CALLBACK (_selection_clear_event),
- text);
- g_signal_connect (invisible, "selection_received",
- G_CALLBACK (_selection_received),
- text);
-
- g_object_weak_ref (G_OBJECT (invisible),
- _invisible_destroy, text);
- }
- return invisible;
-}
-
-static void
-_selection_clear_event (GtkInvisible *invisible,
- GdkEventSelection *event,
- EText *text)
-{
- if (event->selection == GDK_SELECTION_PRIMARY) {
- g_free (text->primary_selection);
- text->primary_selection = NULL;
- text->primary_length = 0;
-
- text->has_selection = FALSE;
- text->needs_redraw = 1;
- gnome_canvas_item_request_update (GNOME_CANVAS_ITEM(text));
-
- } else if (event->selection == clipboard_atom) {
- g_free (text->clipboard_selection);
- text->clipboard_selection = NULL;
- text->clipboard_length = 0;
- }
-}
-
-static void
-_selection_get (GtkInvisible *invisible,
- GtkSelectionData *selection_data,
- guint info,
- guint time_stamp,
- EText *text)
-{
- char *selection_string;
- int selection_length;
- if (selection_data->selection == GDK_SELECTION_PRIMARY) {
- selection_string = text->primary_selection;
- selection_length = text->primary_length;
- } else /* CLIPBOARD */ {
- selection_string = text->clipboard_selection;
- selection_length = text->clipboard_length;
- }
-
- if (selection_string != NULL) {
- if (info == TARGET_UTF8_STRING) {
- gtk_selection_data_set (selection_data,
- gdk_atom_intern ("UTF8_STRING", FALSE), 8,
- (const guchar *) selection_string,
- selection_length);
- } else if (info == TARGET_UTF8) {
- gtk_selection_data_set (selection_data,
- gdk_atom_intern ("UTF-8", FALSE), 8,
- (const guchar *) selection_string,
- selection_length);
- } else if (info == TARGET_STRING || info == TARGET_TEXT || info == TARGET_COMPOUND_TEXT) {
- gchar *localized_string;
-
- localized_string = e_utf8_to_gtk_string (GTK_WIDGET (GNOME_CANVAS_ITEM(text)->canvas),
- selection_string);
-
- if (info == TARGET_STRING) {
- gtk_selection_data_set (selection_data,
- GDK_SELECTION_TYPE_STRING, 8,
- (const guchar *) localized_string,
- strlen (localized_string));
- } else {
- guchar *text;
- GdkAtom encoding;
- gint format;
- gint new_length;
-
- gdk_string_to_compound_text (localized_string,
- &encoding, &format,
- &text, &new_length);
-
- gtk_selection_data_set (selection_data,
- encoding, format,
- text, new_length);
- gdk_free_compound_text (text);
- }
- g_free (localized_string);
- }
- }
-}
-
-typedef struct {
- guint32 time;
- GdkAtom selection;
-} SelectionAndTime;
-
-static const char *formats[] = {"UTF8_STRING", "UTF-8", "STRING"};
-#define E_STRING_ATOM 2
-static const int format_count = sizeof (formats) / sizeof (formats[0]);
-static GdkAtom atoms[sizeof (formats) / sizeof (formats[0])];
-static int initialized = FALSE;
-
-static inline void
-init_atoms (void)
-{
- int type;
- if (!initialized) {
- for (type = 0; type < format_count; type++)
- atoms[type] = gdk_atom_intern (formats[type], FALSE);
- initialized = TRUE;
- }
-}
-
-static void
-e_text_request_paste (EText *text)
-{
- GdkAtom format_atom;
- GtkWidget *invisible;
- int type = text->last_type_request;
-
- init_atoms ();
-
- format_atom = GDK_NONE;
-
- while (format_atom == GDK_NONE) {
- type ++;
-
- if (type >= format_count) {
- if (text->queued_requests) {
- guint32 *new_time = text->queued_requests->data;
- text->queued_requests = g_list_remove_link (text->queued_requests, text->queued_requests);
- text->last_time_request = *new_time;
- g_free (new_time);
-
- type = -1;
- continue;
- } else {
- text->last_type_request = -1;
- d(g_print ("Setting last_type_request to %d at line %d\n", text->last_type_request, __LINE__));
- text->last_time_request = 0;
- return;
- }
- }
-
- format_atom = atoms [type];
- }
-
- /* This must come before the gtk_selection_convert because sometimes _selection_received is called reentrantly. */
-
- text->last_type_request = type;
- d(g_print ("Setting last_type_request to %d at line %d\n", text->last_type_request, __LINE__));
-
- /* And request the format target for the required selection */
- invisible = e_text_get_invisible(text);
- gtk_selection_convert(invisible,
- text->last_selection_request,
- format_atom,
- text->last_time_request);
-
- return;
-}
-
-static void
-_selection_received (GtkInvisible *invisible,
- GtkSelectionData *selection_data,
- guint time,
- EText *text)
-{
- init_atoms ();
- if (selection_data->length < 0) {
- d(g_print ("Calling e_text_request_paste at line %d\n", __LINE__));
- e_text_request_paste (text);
- return;
- } else if (selection_data->type == atoms[E_STRING_ATOM]) {
- ETextEventProcessorCommand command;
- char *string;
-
- string = e_utf8_from_gtk_string_sized (GTK_WIDGET (GNOME_CANVAS_ITEM(text)->canvas),
- selection_data->data,
- selection_data->length);
- command.action = E_TEP_INSERT;
- command.position = E_TEP_SELECTION;
- command.string = string;
- command.value = strlen (string);
- command.time = time;
- e_text_command(text->tep, &command, text);
- g_free (string);
- } else {
- ETextEventProcessorCommand command;
- command.action = E_TEP_INSERT;
- command.position = E_TEP_SELECTION;
- command.string = selection_data->data;
- command.value = selection_data->length;
- command.time = time;
- e_text_command(text->tep, &command, text);
- }
-
- text->last_type_request = -1;
- d(g_print ("Setting last_type_request to %d at line %d\n", text->last_type_request, __LINE__));
- if (text->queued_requests) {
- SelectionAndTime *new_request = text->queued_requests->data;
- text->queued_requests = g_list_remove_link (text->queued_requests, text->queued_requests);
- text->last_time_request = new_request->time;
- text->last_selection_request = new_request->selection;
- g_free (new_request);
- d(g_print ("Calling e_text_request_paste at line %d\n", __LINE__));
- e_text_request_paste (text);
- }
-}
-
-static void
-e_text_get_selection(EText *text, GdkAtom selection, guint32 time)
-{
- if (text->last_type_request == -1) {
- text->last_time_request = time;
- text->last_selection_request = selection;
- d(g_print ("Calling e_text_request_paste at line %d\n", __LINE__));
- e_text_request_paste (text);
- } else {
- SelectionAndTime *new_request = g_new (SelectionAndTime, 1);
- new_request->time = time;
- new_request->selection = selection;
- /* FIXME: Queue the selection request type as well. */
- text->queued_requests = g_list_append (text->queued_requests, new_request);
- }
-}
-
-static void
-e_text_supply_selection (EText *text, guint time, GdkAtom selection, guchar *data, gint length)
-{
- gboolean successful;
- GtkWidget *invisible;
-
- invisible = e_text_get_invisible(text);
-
- if (selection == GDK_SELECTION_PRIMARY ) {
- g_free (text->primary_selection);
- text->primary_selection = g_strndup(data, length);
- text->primary_length = length;
- } else if (selection == clipboard_atom) {
- g_free (text->clipboard_selection);
- text->clipboard_selection = g_strndup(data, length);
- text->clipboard_length = length;
- }
-
- successful = gtk_selection_owner_set (invisible,
- selection,
- time);
-
- if (selection == GDK_SELECTION_PRIMARY)
- text->has_selection = successful;
-}
-
-#if 0
-static void
-e_text_real_copy_clipboard (EText *text)
-{
- guint32 time;
- gint selection_start_pos;
- gint selection_end_pos;
-
- g_return_if_fail (text != NULL);
- g_return_if_fail (E_IS_TEXT (text));
-
- time = gtk_text_get_event_time (text);
- selection_start_pos = MIN (text->selection_start, text->selection_end);
- selection_end_pos = MAX (text->selection_start, text->selection_end);
-
- if (selection_start_pos != selection_end_pos)
- {
- if (gtk_selection_owner_set (GTK_WIDGET (text->canvas),
- clipboard_atom,
- time))
- text->clipboard_text = "";
- }
-}
-
-static void
-e_text_real_paste_clipboard (EText *text)
-{
- guint32 time;
-
- g_return_if_fail (text != NULL);
- g_return_if_fail (E_IS_TEXT (text));
-
- time = e_text_get_event_time (text);
- if (text->editable)
- gtk_selection_convert (GTK_WIDGET(text->widget),
- clipboard_atom,
- gdk_atom_intern ("COMPOUND_TEXT", FALSE), time);
-}
-#endif
-
-/* Class initialization function for the text item */
-static void
-e_text_class_init (ETextClass *klass)
-{
- GObjectClass *gobject_class;
- GnomeCanvasItemClass *item_class;
-
- gobject_class = (GObjectClass *) klass;
- item_class = (GnomeCanvasItemClass *) klass;
-
- parent_class = g_type_class_ref (PARENT_TYPE);
-
- gobject_class->dispose = e_text_dispose;
- gobject_class->set_property = e_text_set_property;
- gobject_class->get_property = e_text_get_property;
-
- item_class->update = e_text_update;
- item_class->realize = e_text_realize;
- item_class->unrealize = e_text_unrealize;
- item_class->draw = e_text_draw;
- item_class->point = e_text_point;
- item_class->bounds = e_text_bounds;
- item_class->event = e_text_event;
-
- klass->changed = NULL;
- klass->activate = NULL;
-
- e_text_signals[E_TEXT_CHANGED] =
- g_signal_new ("changed",
- G_OBJECT_CLASS_TYPE (gobject_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (ETextClass, changed),
- NULL, NULL,
- e_marshal_NONE__NONE,
- G_TYPE_NONE, 0);
-
- e_text_signals[E_TEXT_ACTIVATE] =
- g_signal_new ("activate",
- G_OBJECT_CLASS_TYPE (gobject_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (ETextClass, activate),
- NULL, NULL,
- e_marshal_NONE__NONE,
- G_TYPE_NONE, 0);
-
- e_text_signals[E_TEXT_KEYPRESS] =
- g_signal_new ("keypress",
- G_OBJECT_CLASS_TYPE (gobject_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (ETextClass, keypress),
- NULL, NULL,
- e_marshal_NONE__INT_INT,
- G_TYPE_NONE, 2, G_TYPE_UINT, G_TYPE_UINT);
-
- e_text_signals[E_TEXT_POPUP] =
- g_signal_new ("popup",
- G_OBJECT_CLASS_TYPE (gobject_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (ETextClass, popup),
- NULL, NULL,
- e_marshal_NONE__POINTER_INT,
- G_TYPE_NONE, 2, G_TYPE_POINTER, G_TYPE_INT);
-
- g_object_class_install_property (gobject_class, PROP_MODEL,
- g_param_spec_object ("model",
- _( "Model" ),
- _( "Model" ),
- E_TYPE_TEXT_MODEL,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (gobject_class, PROP_EVENT_PROCESSOR,
- g_param_spec_object ("event_processor",
- _( "Event Processor" ),
- _( "Event Processor" ),
- E_TEXT_EVENT_PROCESSOR_TYPE,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (gobject_class, PROP_TEXT,
- g_param_spec_string ("text",
- _( "Text" ),
- _( "Text" ),
- NULL,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (gobject_class, PROP_BOLD,
- g_param_spec_boolean ("bold",
- _( "Bold" ),
- _( "Bold" ),
- FALSE,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (gobject_class, PROP_STRIKEOUT,
- g_param_spec_boolean ("strikeout",
- _( "Strikeout" ),
- _( "Strikeout" ),
- FALSE,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (gobject_class, PROP_ANCHOR,
- g_param_spec_enum ("anchor",
- _( "Anchor" ),
- _( "Anchor" ),
- GTK_TYPE_ANCHOR_TYPE, GTK_ANCHOR_CENTER,
- G_PARAM_READWRITE));
-
-
- g_object_class_install_property (gobject_class, PROP_JUSTIFICATION,
- g_param_spec_enum ("justification",
- _( "Justification" ),
- _( "Justification" ),
- GTK_TYPE_JUSTIFICATION, GTK_JUSTIFY_LEFT,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (gobject_class, PROP_CLIP_WIDTH,
- g_param_spec_double ("clip_width",
- _( "Clip Width" ),
- _( "Clip Width" ),
- 0.0, G_MAXDOUBLE, 0.0,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (gobject_class, PROP_CLIP_HEIGHT,
- g_param_spec_double ("clip_height",
- _( "Clip Height" ),
- _( "Clip Height" ),
- 0.0, G_MAXDOUBLE, 0.0,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (gobject_class, PROP_CLIP,
- g_param_spec_boolean ("clip",
- _( "Clip" ),
- _( "Clip" ),
- FALSE,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (gobject_class, PROP_FILL_CLIP_RECTANGLE,
- g_param_spec_boolean ("fill_clip_rectangle",
- _( "Fill clip rectangle" ),
- _( "Fill clip rectangle" ),
- FALSE,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (gobject_class, PROP_X_OFFSET,
- g_param_spec_double ("x_offset",
- _( "X Offset" ),
- _( "X Offset" ),
- 0.0, G_MAXDOUBLE, 0.0,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (gobject_class, PROP_Y_OFFSET,
- g_param_spec_double ("y_offset",
- _( "Y Offset" ),
- _( "Y Offset" ),
- 0.0, G_MAXDOUBLE, 0.0,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (gobject_class, PROP_FILL_COLOR,
- g_param_spec_string ("fill_color",
- _( "Fill color" ),
- _( "Fill color" ),
- NULL,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (gobject_class, PROP_FILL_COLOR_GDK,
- g_param_spec_boxed ("fill_color_gdk",
- _( "GDK fill color" ),
- _( "GDK fill color" ),
- GDK_TYPE_COLOR,
- G_PARAM_READWRITE));
-
-
- g_object_class_install_property (gobject_class, PROP_FILL_COLOR_RGBA,
- g_param_spec_uint ("fill_color_rgba",
- _( "GDK fill color" ),
- _( "GDK fill color" ),
- 0, G_MAXUINT, 0,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (gobject_class, PROP_FILL_STIPPLE,
- g_param_spec_object ("fill_stipple",
- _( "Fill stipple" ),
- _( "FIll stipple" ),
- GDK_TYPE_DRAWABLE,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (gobject_class, PROP_TEXT_WIDTH,
- g_param_spec_double ("text_width",
- _( "Text width" ),
- _( "Text width" ),
- 0.0, G_MAXDOUBLE, 0.0,
- G_PARAM_READABLE));
-
- g_object_class_install_property (gobject_class, PROP_TEXT_HEIGHT,
- g_param_spec_double ("text_height",
- _( "Text height" ),
- _( "Text height" ),
- 0.0, G_MAXDOUBLE, 0.0,
- G_PARAM_READABLE));
-
-
- g_object_class_install_property (gobject_class, PROP_EDITABLE,
- g_param_spec_boolean ("editable",
- _( "Editable" ),
- _( "Editable" ),
- FALSE,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (gobject_class, PROP_USE_ELLIPSIS,
- g_param_spec_boolean ("use_ellipsis",
- _( "Use ellipsis" ),
- _( "Use ellipsis" ),
- FALSE,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (gobject_class, PROP_ELLIPSIS,
- g_param_spec_string ("ellipsis",
- _( "Ellipsis" ),
- _( "Ellipsis" ),
- NULL,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (gobject_class, PROP_LINE_WRAP,
- g_param_spec_boolean ("line_wrap",
- _( "Line wrap" ),
- _( "Line wrap" ),
- FALSE,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (gobject_class, PROP_BREAK_CHARACTERS,
- g_param_spec_string ("break_characters",
- _( "Break characters" ),
- _( "Break characters" ),
- NULL,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (gobject_class, PROP_MAX_LINES,
- g_param_spec_int ("max_lines",
- _( "Max lines" ),
- _( "Max lines" ),
- 0, G_MAXINT, 0,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (gobject_class, PROP_WIDTH,
- g_param_spec_double ("width",
- _( "Width" ),
- _( "Width" ),
- 0.0, G_MAXDOUBLE, 0.0,
- G_PARAM_READWRITE));
-
-
- g_object_class_install_property (gobject_class, PROP_HEIGHT,
- g_param_spec_double ("height",
- _( "Height" ),
- _( "Height" ),
- 0.0, G_MAXDOUBLE, 0.0,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (gobject_class, PROP_DRAW_BORDERS,
- g_param_spec_boolean ("draw_borders",
- _( "Draw borders" ),
- _( "Draw borders" ),
- FALSE,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (gobject_class, PROP_ALLOW_NEWLINES,
- g_param_spec_boolean ("allow_newlines",
- _( "Allow newlines" ),
- _( "Allow newlines" ),
- FALSE,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (gobject_class, PROP_DRAW_BACKGROUND,
- g_param_spec_boolean ("draw_background",
- _( "Draw background" ),
- _( "Draw background" ),
- FALSE,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (gobject_class, PROP_DRAW_BUTTON,
- g_param_spec_boolean ("draw_button",
- _( "Draw button" ),
- _( "Draw button" ),
- FALSE,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (gobject_class, PROP_CURSOR_POS,
- g_param_spec_int ("cursor_pos",
- _( "Cursor position" ),
- _( "Cursor position" ),
- 0, G_MAXINT, 0,
- G_PARAM_READWRITE));
-
- if (!clipboard_atom)
- clipboard_atom = gdk_atom_intern ("CLIPBOARD", FALSE);
-}
-
-/* Object initialization function for the text item */
-static void
-e_text_init (EText *text)
-{
- text->model = e_text_model_new ();
- text->text = e_text_model_get_text (text->model);
- text->layout = NULL;
-
- text->revert = NULL;
-
- text->model_changed_signal_id =
- g_signal_connect (text->model,
- "changed",
- G_CALLBACK (e_text_text_model_changed),
- text);
- text->model_repos_signal_id =
- g_signal_connect (text->model,
- "reposition",
- G_CALLBACK (e_text_text_model_reposition),
- text);
-
- text->anchor = GTK_ANCHOR_CENTER;
- text->justification = GTK_JUSTIFY_LEFT;
- text->clip_width = -1.0;
- text->clip_height = -1.0;
- text->xofs = 0.0;
- text->yofs = 0.0;
-
- text->ellipsis = NULL;
- text->use_ellipsis = FALSE;
- text->ellipsis_width = 0;
-
- text->editable = FALSE;
- text->editing = FALSE;
- text->xofs_edit = 0;
- text->yofs_edit = 0;
-
- text->selection_start = 0;
- text->selection_end = 0;
- text->select_by_word = FALSE;
-
- text->timeout_id = 0;
- text->timer = NULL;
-
- text->lastx = 0;
- text->lasty = 0;
- text->last_state = 0;
-
- text->scroll_start = 0;
- text->show_cursor = TRUE;
- text->button_down = FALSE;
-
- text->tep = NULL;
- text->tep_command_id = 0;
-
- text->has_selection = FALSE;
-
- text->invisible = NULL;
- text->primary_selection = NULL;
- text->primary_length = 0;
- text->clipboard_selection = NULL;
- text->clipboard_length = 0;
-
- text->pointer_in = FALSE;
- text->default_cursor_shown = TRUE;
- text->line_wrap = FALSE;
- text->break_characters = NULL;
- text->max_lines = -1;
- text->tooltip_timeout = 0;
- text->tooltip_count = 0;
- text->tooltip_owner = FALSE;
- text->dbl_timeout = 0;
- text->tpl_timeout = 0;
-
- text->draw_background = FALSE;
- text->draw_button = FALSE;
-
- text->bold = FALSE;
- text->strikeout = FALSE;
-
- text->style = E_FONT_PLAIN;
- text->allow_newlines = TRUE;
-
- text->last_type_request = -1;
- d(g_print ("Setting last_type_request to %d at line %d\n", text->last_type_request, __LINE__));
- text->last_time_request = 0;
- text->queued_requests = NULL;
-
- e_canvas_item_set_reflow_callback(GNOME_CANVAS_ITEM(text), e_text_reflow);
-}
-
-/**
- * e_text_get_type:
- * @void:
- *
- * Registers the &EText class if necessary, and returns the type ID
- * associated to it.
- *
- * Return value: The type ID of the &EText class.
- **/
-E_MAKE_TYPE (e_text,
- "EText",
- EText,
- e_text_class_init,
- e_text_init,
- PARENT_TYPE)
diff --git a/widgets/text/e-text.h b/widgets/text/e-text.h
deleted file mode 100644
index 6a965a5d92..0000000000
--- a/widgets/text/e-text.h
+++ /dev/null
@@ -1,239 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-text.h - Text item for evolution.
- * Copyright 2000, 2001, Ximian, Inc.
- *
- * Authors:
- * Chris Lahey <clahey@ximian.com>
- * Jon Trowbridge <trow@ximian.com>
- *
- * A majority of code taken from:
- *
- * Text item type for GnomeCanvas widget
- *
- * GnomeCanvas is basically a port of the Tk toolkit's most excellent
- * canvas widget. Tk is copyrighted by the Regents of the University
- * of California, Sun Microsystems, and other parties.
- *
- * Copyright (C) 1998 The Free Software Foundation
- *
- * Author: Federico Mena <federico@nuclecu.unam.mx>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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.
- */
-
-#ifndef E_TEXT_H
-#define E_TEXT_H
-
-#include <gtk/gtkobject.h>
-
-#include <gal/widgets/e-font.h>
-#include <gal/util/e-text-event-processor.h>
-#include <gal/e-text/e-text-model.h>
-#include <gal/widgets/e-canvas.h>
-
-G_BEGIN_DECLS
-
-
-/* Text item for the canvas. Text items are positioned by an anchor point and an anchor direction.
- *
- * A clipping rectangle may be specified for the text. The rectangle is anchored at the text's anchor
- * point, and is specified by clipping width and height parameters. If the clipping rectangle is
- * enabled, it will clip the text.
- *
- * In addition, x and y offset values may be specified. These specify an offset from the anchor
- * position. If used in conjunction with the clipping rectangle, these could be used to implement
- * simple scrolling of the text within the clipping rectangle.
- *
- * The following object arguments are available:
- *
- * name type read/write description
- * ------------------------------------------------------------------------------------------
- * text string RW The string of the text label
- * bold boolean RW Bold?
- * anchor GtkAnchorType RW Anchor side for the text
- * justification GtkJustification RW Justification for multiline text
- * fill_color string W X color specification for text
- * fill_color_gdk GdkColor* RW Pointer to an allocated GdkColor
- * fill_stipple GdkBitmap* RW Stipple pattern for filling the text
- * clip_width double RW Width of clip rectangle
- * clip_height double RW Height of clip rectangle
- * clip boolean RW Use clipping rectangle?
- * fill_clip_rect boolean RW Whether the text item represents itself as being the size of the clipping rectangle.
- * x_offset double RW Horizontal offset distance from anchor position
- * y_offset double RW Vertical offset distance from anchor position
- * text_width double R Used to query the width of the rendered text
- * text_height double R Used to query the rendered height of the text
- * width double RW A synonym for clip_width
- * height double R A synonym for text_height
- *
- * These are currently ignored in the AA version:
- * editable boolean RW Can this item be edited
- * use_ellipsis boolean RW Whether to use ellipsises if text gets cut off. Meaningless if clip == false.
- * ellipsis string RW The characters to use as ellipsis. NULL = "...".
- * line_wrap boolean RW Line wrap when not editing.
- * break_characters string RW List of characters to optionally break on.
- * max_lines int RW Number of lines possible when doing line wrap.
- * draw_borders boolean RW Whether to draw borders.
- * draw_background boolean RW Whether to draw the background.
- * draw_button boolean RW This makes EText handle being the child of a button properly and highlighting as it should.
- */
-
-#define E_TYPE_TEXT (e_text_get_type ())
-#define E_TEXT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), E_TYPE_TEXT, EText))
-#define E_TEXT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), E_TYPE_TEXT, ETextClass))
-#define E_IS_TEXT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), E_TYPE_TEXT))
-#define E_IS_TEXT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), E_TYPE_TEXT))
-
-
-typedef struct _EText EText;
-typedef struct _ETextClass ETextClass;
-
-struct _EText {
- GnomeCanvasItem item;
-
- ETextModel *model;
- gint model_changed_signal_id;
- gint model_repos_signal_id;
-
- const gchar *text; /* Text to display --- from the ETextModel */
- PangoLayout *layout;
- int num_lines; /* Number of lines of text */
-
- gchar *revert; /* Text to revert to */
-
- GtkAnchorType anchor; /* Anchor side for text */
- GtkJustification justification; /* Justification for text */
-
- double clip_width; /* Width of optional clip rectangle */
- double clip_height; /* Height of optional clip rectangle */
-
- double xofs, yofs; /* Text offset distance from anchor position */
-
- GdkColor color; /* Fill color */
- GdkBitmap *stipple; /* Stipple for text */
- GdkGC *gc; /* GC for drawing text */
-
- int cx, cy; /* Top-left canvas coordinates for text */
- int text_cx, text_cy; /* Top-left canvas coordinates for text */
- int clip_cx, clip_cy; /* Top-left canvas coordinates for clip rectangle */
- int clip_cwidth, clip_cheight; /* Size of clip rectangle in pixels */
- int max_width; /* Maximum width of text lines */
- int width; /* Rendered text width in pixels */
- int height; /* Rendered text height in pixels */
-
- guint32 rgba; /* RGBA color for text */
- double affine[6]; /* The item -> canvas affine */
-
- char *ellipsis; /* The ellipsis characters. NULL = "...". */
- double ellipsis_width; /* The width of the ellipsis. */
-
- int xofs_edit; /* Offset because of editing */
- int yofs_edit; /* Offset because of editing */
-
- /* This needs to be reworked a bit once we get line wrapping. */
- int selection_start; /* Start of selection IN BYTES */
- int selection_end; /* End of selection IN BYTES */
- gboolean select_by_word; /* Current selection is by word */
-
- /* This section is for drag scrolling and blinking cursor. */
- gint timeout_id; /* Current timeout id for scrolling */
- GTimer *timer; /* Timer for blinking cursor and scrolling */
-
- gint lastx, lasty; /* Last x and y motion events */
- gint last_state; /* Last state */
- gulong scroll_start; /* Starting time for scroll (microseconds) */
-
- gint show_cursor; /* Is cursor currently shown */
- gboolean button_down; /* Is mouse button 1 down */
-
- ETextEventProcessor *tep; /* Text Event Processor */
- gint tep_command_id;
-
- GtkWidget *invisible; /* For selection handling */
- gboolean has_selection; /* TRUE if we have the selection */
- gchar *primary_selection; /* Primary selection text */
- gint primary_length; /* Primary selection text length */
- gchar *clipboard_selection; /* Clipboard selection text */
- gint clipboard_length; /* Clipboard selection text length*/
-
- guint clip : 1; /* Use clip rectangle? */
- guint fill_clip_rectangle : 1; /* Fill the clipping rectangle. */
-
- guint pointer_in : 1; /* Is the pointer currently over us? */
- guint default_cursor_shown : 1; /* Is the default cursor currently shown? */
- guint draw_borders : 1; /* Draw borders? */
- guint draw_background : 1; /* Draw background? */
- guint draw_button : 1; /* Draw button? */
-
- guint line_wrap : 1; /* Do line wrap */
-
- guint needs_redraw : 1; /* Needs redraw */
- guint needs_recalc_bounds : 1; /* Need recalc_bounds */
- guint needs_calc_height : 1; /* Need calc_height */
- guint needs_split_into_lines : 1; /* Needs split_into_lines */
- guint needs_reset_layout : 1; /* Needs split_into_lines */
-
- guint bold : 1;
- guint strikeout : 1;
-
- guint tooltip_owner : 1;
- guint allow_newlines : 1;
-
- guint use_ellipsis : 1; /* Whether to use the ellipsis. */
-
- guint editable : 1; /* Item is editable */
- guint editing : 1; /* Item is currently being edited */
-
- EFontStyle style;
-
- gchar *break_characters; /* Characters to optionally break after */
-
- gint max_lines; /* Max number of lines (-1 = infinite) */
-
- GdkCursor *default_cursor; /* Default cursor (arrow) */
- GdkCursor *i_cursor; /* I beam cursor */
-
- gint tooltip_timeout; /* Timeout for the tooltip */
- gint tooltip_count; /* GDK_ENTER_NOTIFY count. */
-
- gint dbl_timeout; /* Double click timeout */
- gint tpl_timeout; /* Triple click timeout */
-
- gint last_type_request; /* Last selection type requested. */
- guint32 last_time_request; /* The time of the last selection request. */
- GdkAtom last_selection_request; /* The time of the last selection request. */
- GList *queued_requests; /* Queued selection requests. */
-};
-
-struct _ETextClass {
- GnomeCanvasItemClass parent_class;
-
- void (* changed) (EText *text);
- void (* activate) (EText *text);
- void (* keypress) (EText *text, guint keyval, guint state);
- void (* popup) (EText *text, GdkEventButton *ev, gint pos);
- void (* style_set) (EText *text, GtkStyle *previous_style);
-};
-
-
-/* Standard Gtk function */
-GtkType e_text_get_type (void);
-void e_text_cancel_editing (EText *text);
-void e_text_stop_editing (EText *text);
-
-G_END_DECLS
-
-#endif
diff --git a/wombat/ChangeLog b/wombat/ChangeLog
index 931f09a9df..3904410daf 100644
--- a/wombat/ChangeLog
+++ b/wombat/ChangeLog
@@ -1,131 +1,15 @@
-2003-03-28 Ettore Perazzoli <ettore@ximian.com>
+2002-11-26 Ettore Perazzoli <ettore@ximian.com>
- * GNOME_Evolution_WombatLDAP.server.in.in: Add InterfaceCheck
- object.
- * GNOME_Evolution_WombatNOLDAP.server.in.in: Likewise.
+ * wombat-moniker.c (wombat_lookup_interface_check): New function
+ to return a WombatInterfaceCheck object.
+ (wombat_moniker_resolve): Use it to return the interface check
+ object when requested to.
- * wombat-interface-check.c: New, from evolution-1-2-branch.
- * wombat-interface-check.h: Likewise.
+ * wombat-interface-check.c: New.
+ * wombat-interface-check.h: New.
- * wombat.c (setup_pas): Removed argc/argv args.
- (setup_pcs): Likewise.
- (setup_interface_check): New interface to set up the
- InterfaceCheck object.
- (main): Call the latter.
+ * Evolution-Wombat.idl: New interface WombatInterfaceCheck.
-2003-03-13 Dan Winship <danw@ximian.com>
-
- * Makefile.am (GNOME_Evolution_Wombat.server.in.in): Make this
- depend on Makefile so it gets regenerated if you switch from
- --without-openldap to --with-openldap
-
-2003-02-21 Dan Winship <danw@ximian.com>
-
- * Makefile.am (evolution_wombat_LDADD): cleanup
-
-2003-02-19 Chris Toshok <toshok@ximian.com>
-
- * wombat.c (termination_handler): gtk_main_quit =>
- bonobo_main_quit.
-
-2003-02-07 Rodney Dawes <dobey@ximian.com>
-
- * Makefile.am: privlibexecdir not evolibexecdir for the server file
-
-2003-02-06 Dan Winship <danw@ximian.com>
-
- * Makefile.am: cleanup
-
- * wombat.c (main): s/PACKAGE/GETTEXT_PACKAGE/ in gettext init
-
-2003-02-01 Hans Petter Jansson <hpj@ximian.com>
-
- * Makefile.am: Make .server file point to where wombat is now
- installed.
-
-2003-01-29 Rodney Dawes <dobey@ximian.com>
-
- * Makefile.am: Install wombat to
- $(libexecdir)/evolution/$(BASE_VERSION)
-
-2003-01-27 Ettore Perazzoli <ettore@ximian.com>
-
- * Makefile.am: Rename wombat to evolution-wombat.
- * GNOME_Evolution_WombatLDAP.server.in.in: Updated accordingly.
- * GNOME_Evolution_WombatNOLDAP.server.in.in: Likewise.
-
-2003-01-14 Ettore Perazzoli <ettore@ximian.com>
-
- * Makefile.am: Do not dist the .server.in files; just dist the
- .server.in.in ones.
- (EXTRA_DIST): Add GNOME_Evolution_WombatLDAP.server.in.in and
- GNOME_Evolution_WombatNOLDAP.server.in.in
-
-2003-01-06 Dan Winship <danw@ximian.com>
-
- * Makefile.am: Remove idldir definition. It's defined in
- configure.in now.
-
-2002-12-06 Hans Petter Jansson <hpj@ximian.com>
-
- * GNOME_Evolution_WombatNOLDAP.server.in.in: It appears that
- Ettore's @LIBEXECDIR@ change didn't make it in for this file.
- Fixed that.
-
-2002-11-16 Chris Toshok <toshok@ximian.com>
-
- * GNOME_Evolution_WombatLDAP.server.in.in: remove the moniker
- cruft.
-
- * GNOME_Evolution_WombatNOLDAP.server.in.in: same.
-
-2002-11-15 Ettore Perazzoli <ettore@ximian.com>
-
- * Makefile.am: Added rule to create
- GNOME_Evolution_Wombat.server.in from
- GNOME_Evolution_Wombat.server.in.in, substituting @LIBEXECDIR@.
- Also install wombat in $libexecdir instead of $bindir.
-
- * GNOME_Evolution_WombatNOLDAP.server.in.in: Renamed from
- GNOME_Evolution_WombatNOLDAP.server.in. Changed the location from
- "wombat" to "@LIBEXECDIR@/wombat".
-
- * GNOME_Evolution_WombatLDAP.server.in.in: Renamed from
- GNOME_Evolution_WombatLDAP.server.in. Changed the location from
- "wombat" to "@LIBEXECDIR@/wombat".
-
-2002-11-07 Rodrigo Moya <rodrigo@ximian.com>
-
- * wombat.c: re-enabled calendar parts.
-
-2002-11-06 Chris Toshok <toshok@ximian.com>
-
- * Makefile.am (wombat_LDADD): remove libcamel.la from the link for
- the time being.
-
- * wombat.c: ifdef out (#ifdef PENDING_PORT_WORK) the calendar
- stuff, since it doesn't link at the moment - undefined symbols in
- pcs. Also, include gtk.h so the gtk_* in the calendar portions
- will still work.
-
-2002-11-05 Chris Toshok <toshok@ximian.com>
-
- * Makefile.am: change over from .oaf files to .server files and
- remove the moniker stuff from the build.
-
- * wombat.c: port over to gnome2, and nuke all the config moniker
- stuff.
-
- * wombat-moniker.[ch]: remove
-
- * wombat-private-moniker.[ch]: remove
-
- * GNOME_Evolution_WombatLDAP.server.in: rename the oaf.in file to this.
-
- * GNOME_Evolution_WombatNOLDAP.server.in: rename the oaf.in file to this.
-
- * .cvsignore: s/oaf/server
-
2002-08-01 Chris Toshok <toshok@ximian.com>
* wombat.c (last_calendar_gone_cb): remove the annoying fprintf
diff --git a/wombat/Makefile.am b/wombat/Makefile.am
index 311adad020..d95b288c5b 100644
--- a/wombat/Makefile.am
+++ b/wombat/Makefile.am
@@ -1,9 +1,5 @@
INCLUDES = \
-DG_LOG_DOMAIN=\"wombat\" \
- -DPREFIX=\"$(prefix)\" \
- -DSYSCONFDIR=\"$(sysconfdir)\" \
- -DDATADIR=\"$(datadir)\" \
- -DLIBDIR=\"$(libdir)\" \
-I$(top_srcdir)/e-util \
-I$(top_srcdir) \
-I$(top_srcdir)/addressbook/backend \
@@ -13,35 +9,36 @@ INCLUDES = \
-I$(top_builddir)/calendar \
-I$(top_srcdir)/libical/src/libical \
-I$(top_builddir)/libical/src/libical \
+ -DEVOLUTION_DATADIR=\""$(datadir)"\" \
-DEVOLUTION_LOCALEDIR=\""$(localedir)"\" \
$(WOMBAT_CFLAGS)
-IDLS = \
- Evolution-Wombat.idl
+bin_PROGRAMS = \
+ wombat
-IDL_GENERATED_H = \
- Evolution-Wombat.h
+WOMBAT_IDL = Evolution-Wombat.idl
-IDL_GENERATED_C = \
+WOMBAT_IDL_GENERATED = \
+ Evolution-Wombat.h \
Evolution-Wombat-common.c \
Evolution-Wombat-skels.c \
Evolution-Wombat-stubs.c
-IDL_GENERATED = $(IDL_GENERATED_H) $(IDL_GENERATED_C)
+$(WOMBAT_IDL_GENERATED): $(WOMBAT_IDL)
+ $(ORBIT_IDL) -I $(srcdir) -I $(datadir)/idl `$(GNOME_CONFIG) --cflags idl` $(WOMBAT_IDL)
-$(IDL_GENERATED_H): $(IDLS)
- $(ORBIT_IDL) -I $(srcdir) $(IDL_INCLUDES) $(srcdir)/Evolution-Wombat.idl
+idldir = $(datadir)/idl
-$(IDL_GENERATED_C): $(IDL_GENERATED_H)
+idl_DATA = $(WOMBAT_IDL)
-
-privlibexec_PROGRAMS = \
- evolution-wombat
-
-evolution_wombat_SOURCES = \
- $(IDL_GENERATED) \
+wombat_SOURCES = \
+ $(WOMBAT_IDL_GENERATED) \
wombat-interface-check.c \
wombat-interface-check.h \
+ wombat-moniker.c \
+ wombat-moniker.h \
+ wombat-private-moniker.c \
+ wombat-private-moniker.h \
wombat.c
if ENABLE_LDAP
@@ -50,52 +47,50 @@ LDAP_STUFF = \
$(LDAP_LIBS)
endif
-evolution_wombat_LDADD = \
+wombat_LDADD = \
$(top_builddir)/addressbook/backend/pas/libpasfile.a \
$(DB3_LDADD) \
$(LDAP_STUFF) \
$(top_builddir)/addressbook/backend/pas/libpas.a \
$(top_builddir)/addressbook/backend/ebook/libebook.la \
+ $(top_builddir)/camel/libcamel.la \
+ $(top_builddir)/e-util/ename/libename.la \
$(top_builddir)/calendar/pcs/libpcsfile.a \
$(top_builddir)/calendar/pcs/libpcs.a \
$(top_builddir)/calendar/cal-util/libcal-util.la \
+ $(top_builddir)/libical/src/libical/libical-evolution.la \
+ $(top_builddir)/libversit/libversit.a \
$(top_builddir)/e-util/libedb3util.la \
$(top_builddir)/e-util/libeutil.la \
$(top_builddir)/libwombat/libwombat.la \
$(WOMBAT_LIBS)
+oafdir = $(datadir)/oaf
+
if ENABLE_LDAP
-SERVER_IN_FILE=GNOME_Evolution_WombatLDAP.server.in.in
+OAF_IN_FILE=GNOME_Evolution_WombatLDAP.oaf.in
else
-SERVER_IN_FILE=GNOME_Evolution_WombatNOLDAP.server.in.in
+OAF_IN_FILE=GNOME_Evolution_WombatNOLDAP.oaf.in
endif
-GNOME_Evolution_Wombat.server.in.in: $(SERVER_IN_FILE) Makefile
+GNOME_Evolution_Wombat.oaf.in: $(OAF_IN_FILE)
cp $< $@
-server_in_files = GNOME_Evolution_Wombat.server.in.in
-
-server_DATA = $(server_in_files:.server.in.in=.server)
-$(server_in_files:.server.in.in=.server.in): $(server_in_files)
- sed -e "s|\@LIBEXECDIR\@|$(privlibexecdir)|" $< > $@
-
-@INTLTOOL_SERVER_RULE@
+oaf_in_files = GNOME_Evolution_Wombat.oaf.in
+oaf_DATA = $(oaf_in_files:.oaf.in=.oaf)
-idl_DATA = $(IDLS)
+@XML_I18N_MERGE_OAF_RULE@
-EXTRA_DIST = $(server_DATA) \
- $(server_in_files) \
- $(idl_DATA) \
- GNOME_Evolution_WombatLDAP.server.in.in \
- GNOME_Evolution_WombatNOLDAP.server.in.in
+EXTRA_DIST = $(oaf_DATA) $(oaf_in_files) $(idl_DATA) \
+ GNOME_Evolution_WombatLDAP.oaf.in GNOME_Evolution_WombatNOLDAP.oaf.in
if ENABLE_PURIFY
PLINK = $(LIBTOOL) --mode=link $(PURIFY) $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@
-all-local: evolution-wombat.pure
+all-local: wombat.pure
-evolution-wombat.pure: evolution-wombat
- @rm -f evolution-wombat.pure
- $(PLINK) $(evolution_wombat_LDFLAGS) $(evolution_wombat_OBJECTS) $(evolution_wombat_LDADD) $(LIBS)
+wombat.pure: wombat
+ @rm -f wombat.pure
+ $(PLINK) $(wombat_LDFLAGS) $(wombat_OBJECTS) $(wombat_LDADD) $(LIBS)
endif
diff --git a/wombat/wombat-interface-check.c b/wombat/wombat-interface-check.c
index f7766cd218..aae981389a 100644
--- a/wombat/wombat-interface-check.c
+++ b/wombat/wombat-interface-check.c
@@ -4,9 +4,8 @@
* Copyright (C) 2002 Ximian, Inc.
*
* This program 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.
+ * 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
@@ -30,8 +29,8 @@
#include <gal/util/e-util.h>
-#define PARENT_TYPE bonobo_object_get_type ()
-static BonoboObjectClass *parent_class = NULL;
+#define PARENT_TYPE bonobo_x_object_get_type ()
+static BonoboXObjectClass *parent_class = NULL;
static CORBA_char *
@@ -43,15 +42,15 @@ impl__get_interfaceVersion (PortableServer_Servant servant,
static void
-wombat_interface_check_class_init (WombatInterfaceCheckClass *class)
+class_init (WombatInterfaceCheckClass *class)
{
- parent_class = g_type_class_ref (PARENT_TYPE);
+ parent_class = gtk_type_class (PARENT_TYPE);
class->epv._get_interfaceVersion = impl__get_interfaceVersion;
}
static void
-wombat_interface_check_init (WombatInterfaceCheck *interface_check)
+init (WombatInterfaceCheck *interface_check)
{
/* (Nothing to initialize here.) */
}
@@ -60,11 +59,11 @@ wombat_interface_check_init (WombatInterfaceCheck *interface_check)
WombatInterfaceCheck *
wombat_interface_check_new (void)
{
- return g_object_new (WOMBAT_TYPE_INTERFACE_CHECK, NULL);
+ return gtk_type_new (WOMBAT_TYPE_INTERFACE_CHECK);
}
-BONOBO_TYPE_FUNC_FULL (WombatInterfaceCheck,
- GNOME_Evolution_WombatInterfaceCheck,
- PARENT_TYPE,
- wombat_interface_check)
+E_MAKE_X_TYPE (wombat_interface_check, "WombatInterfaceCheck", WombatInterfaceCheck,
+ class_init, init, PARENT_TYPE,
+ POA_GNOME_Evolution_WombatInterfaceCheck__init,
+ GTK_STRUCT_OFFSET (WombatInterfaceCheckClass, epv))
diff --git a/wombat/wombat-interface-check.h b/wombat/wombat-interface-check.h
index 9cd00b5b62..cc0b2e27b5 100644
--- a/wombat/wombat-interface-check.h
+++ b/wombat/wombat-interface-check.h
@@ -4,9 +4,8 @@
* Copyright (C) 2002 Ximian, Inc.
*
* This program 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.
+ * 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
@@ -28,7 +27,7 @@
#include <config.h>
#endif
-#include <bonobo/bonobo-object.h>
+#include <bonobo/bonobo-xobject.h>
#include "Evolution-Wombat.h"
#ifdef __cplusplus
@@ -48,18 +47,18 @@ typedef struct _WombatInterfaceCheckPrivate WombatInterfaceCheckPrivate;
typedef struct _WombatInterfaceCheckClass WombatInterfaceCheckClass;
struct _WombatInterfaceCheck {
- BonoboObject parent;
+ BonoboXObject parent;
};
struct _WombatInterfaceCheckClass {
- BonoboObjectClass parent_class;
+ BonoboXObjectClass parent_class;
POA_GNOME_Evolution_WombatInterfaceCheck__epv epv;
};
-GType wombat_interface_check_get_type (void);
-WombatInterfaceCheck *wombat_interface_check_new (void);
+GtkType wombat_interface_check_get_type (void);
+WombatInterfaceCheck *wombat_interface_check_new (void);
#ifdef __cplusplus
}
diff --git a/wombat/wombat-moniker.c b/wombat/wombat-moniker.c
new file mode 100644
index 0000000000..3b625fb3f6
--- /dev/null
+++ b/wombat/wombat-moniker.c
@@ -0,0 +1,184 @@
+#include <config.h>
+
+#include <bonobo/bonobo-moniker-simple.h>
+#include <bonobo/bonobo-moniker-util.h>
+#include <bonobo/bonobo-exception.h>
+#include <bonobo/bonobo-storage.h>
+
+#include "wombat-moniker.h"
+
+#include "wombat-interface-check.h"
+
+#define DEFAULT_DB_URL "xmldb:" EVOLUTION_DATADIR "/evolution/config.xmldb"
+#define USER_DB_URL "xmldb:~/evolution/config.xmldb"
+
+#define DB_URL (DEFAULT_DB_URL "#" USER_DB_URL)
+
+static Bonobo_Storage
+wombat_root_storage (CORBA_Environment *ev)
+{
+ static BonoboStorage *root = NULL;
+ char *path;
+
+ if (!root) {
+ path = g_strconcat (g_get_home_dir (), "/evolution/config",
+ NULL);
+
+ root = bonobo_storage_open_full (BONOBO_IO_DRIVER_FS, path,
+ Bonobo_Storage_CREATE, 0664,
+ ev);
+
+ g_free (path);
+
+ if (BONOBO_EX (ev) || !root)
+ return CORBA_OBJECT_NIL;
+ }
+
+ return BONOBO_OBJREF (root);
+}
+
+static Bonobo_Storage
+wombat_lookup_storage (const char *name,
+ CORBA_Environment *ev)
+{
+ Bonobo_Storage root;
+
+ if ((root = wombat_root_storage (ev)) == CORBA_OBJECT_NIL)
+ return CORBA_OBJECT_NIL;
+
+ if (!strcmp (name, ""))
+ return bonobo_object_dup_ref (root, ev);
+
+ return Bonobo_Storage_openStorage (root, name, Bonobo_Storage_CREATE,
+ ev);
+}
+
+static Bonobo_Storage
+wombat_lookup_stream (const char *name,
+ CORBA_Environment *ev)
+{
+ Bonobo_Storage root;
+
+ if (!strcmp (name, "")) {
+ bonobo_exception_set (ev, ex_Bonobo_Storage_NotFound);
+ return CORBA_OBJECT_NIL;
+ }
+
+ if ((root = wombat_root_storage (ev)) == CORBA_OBJECT_NIL)
+ return CORBA_OBJECT_NIL;
+
+
+ return Bonobo_Storage_openStream (root, name, Bonobo_Storage_CREATE,
+ ev);
+}
+
+static CORBA_Object
+wombat_lookup_db (CORBA_Environment *ev)
+{
+ static CORBA_Object db = CORBA_OBJECT_NIL;
+
+ if (db == CORBA_OBJECT_NIL)
+ db = bonobo_get_object (DB_URL,
+ "IDL:Bonobo/ConfigDatabase:1.0", ev);
+
+ bonobo_object_dup_ref (db, ev);
+
+ return db;
+}
+
+static CORBA_Object
+wombat_lookup_interface_check (void)
+{
+ static WombatInterfaceCheck *object = NULL;
+ CORBA_Environment ev;
+ CORBA_Object corba_objref;
+
+ if (object == NULL)
+ object = wombat_interface_check_new ();
+
+ bonobo_object_ref (BONOBO_OBJECT (object));
+
+ CORBA_exception_init (&ev);
+ corba_objref = CORBA_Object_duplicate (BONOBO_OBJREF (object), &ev);
+ CORBA_exception_free (&ev);
+
+ return corba_objref;
+}
+
+static Bonobo_Unknown
+wombat_moniker_resolve (BonoboMoniker *moniker,
+ const Bonobo_ResolveOptions *options,
+ const CORBA_char *interface,
+ CORBA_Environment *ev)
+{
+ CORBA_Object db;
+ Bonobo_Moniker parent;
+ const gchar *name;
+ Bonobo_Storage storage;
+ Bonobo_Stream stream;
+
+ parent = bonobo_moniker_get_parent (moniker, ev);
+ if (BONOBO_EX (ev))
+ return CORBA_OBJECT_NIL;
+
+ name = bonobo_moniker_get_name (moniker);
+
+ if (parent != CORBA_OBJECT_NIL) {
+
+ g_warning ("wombat: parent moniker are not supproted");
+
+ bonobo_object_release_unref (parent, ev);
+
+ bonobo_exception_set (ev, ex_Bonobo_Moniker_InterfaceNotFound);
+
+ return CORBA_OBJECT_NIL;
+ }
+
+ if (!strcmp (interface, "IDL:Bonobo/Storage:1.0")) {
+
+ storage = wombat_lookup_storage (name, ev);
+
+ return storage;
+ }
+
+ if (!strcmp (interface, "IDL:Bonobo/Stream:1.0")) {
+
+ stream = wombat_lookup_stream (name, ev);
+
+ return stream;
+ }
+
+ if (!strcmp (interface, "IDL:Bonobo/ConfigDatabase:1.0")) {
+
+ if (strcmp (name, ""))
+ g_warning ("wombat: unused moniker name");
+
+ if ((db = wombat_lookup_db (ev)) != CORBA_OBJECT_NIL)
+ return db;
+ }
+
+ if (!strcmp (interface, "IDL:GNOME/Evolution/WombatInterfaceCheck:1.0"))
+ return wombat_lookup_interface_check ();
+
+ bonobo_exception_set (ev, ex_Bonobo_Moniker_InterfaceNotFound);
+ return CORBA_OBJECT_NIL;
+}
+
+BonoboObject *
+wombat_moniker_factory (BonoboGenericFactory *this,
+ const char *object_id,
+ void *data)
+{
+ g_return_val_if_fail (object_id != NULL, NULL);
+
+ if (!strcmp (object_id, "OAFIID:Bonobo_Moniker_wombat"))
+
+ return BONOBO_OBJECT (bonobo_moniker_simple_new (
+ "wombat:", wombat_moniker_resolve));
+
+ else
+ g_warning ("Failing to manufacture a '%s'", object_id);
+
+ return NULL;
+}
+