aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSrinivasa Ragavan <sragavan@src.gnome.org>2007-02-12 14:11:14 +0800
committerSrinivasa Ragavan <sragavan@src.gnome.org>2007-02-12 14:11:14 +0800
commit9862306af9b5019372cbcb6693b5ae1d56297776 (patch)
tree25b7efb0d1b3478601a172e289f0360df96c0f0a
parent0670e0a9070dac6359d34822f7433e9502fc1d22 (diff)
downloadgsoc2013-evolution-9862306af9b5019372cbcb6693b5ae1d56297776.tar
gsoc2013-evolution-9862306af9b5019372cbcb6693b5ae1d56297776.tar.gz
gsoc2013-evolution-9862306af9b5019372cbcb6693b5ae1d56297776.tar.bz2
gsoc2013-evolution-9862306af9b5019372cbcb6693b5ae1d56297776.tar.lz
gsoc2013-evolution-9862306af9b5019372cbcb6693b5ae1d56297776.tar.xz
gsoc2013-evolution-9862306af9b5019372cbcb6693b5ae1d56297776.tar.zst
gsoc2013-evolution-9862306af9b5019372cbcb6693b5ae1d56297776.zip
Print migration updates from Ebby Wiselyn.
svn path=/trunk/; revision=33201
-rw-r--r--addressbook/ChangeLog14
-rw-r--r--addressbook/gui/component/addressbook-view.c4
-rw-r--r--addressbook/gui/widgets/e-addressbook-view.c24
-rw-r--r--addressbook/printing/e-contact-print.c82
-rw-r--r--calendar/ChangeLog8
-rw-r--r--calendar/gui/print.c96
-rw-r--r--e-util/ChangeLog9
-rw-r--r--e-util/e-print.c183
-rw-r--r--e-util/e-print.h10
-rw-r--r--mail/ChangeLog9
-rw-r--r--mail/em-folder-browser.c2
-rw-r--r--mail/em-folder-view.c16
-rw-r--r--mail/em-format-html-print.c17
-rw-r--r--plugins/print-message/ChangeLog7
-rw-r--r--plugins/print-message/print-message.c24
-rw-r--r--shell/ChangeLog6
-rw-r--r--shell/apps_evolution_shell.schemas.in.in297
-rw-r--r--widgets/misc/ChangeLog8
-rw-r--r--widgets/misc/e-printable.c7
-rw-r--r--widgets/misc/e-printable.h13
-rw-r--r--widgets/table/ChangeLog7
-rw-r--r--widgets/table/e-cell-text.c2
-rw-r--r--widgets/table/e-cell-toggle.c14
23 files changed, 303 insertions, 556 deletions
diff --git a/addressbook/ChangeLog b/addressbook/ChangeLog
index 6fbd1dffc0..481a42f626 100644
--- a/addressbook/ChangeLog
+++ b/addressbook/ChangeLog
@@ -1,3 +1,17 @@
+2007-02-12 Srinivasa Ragavan <sragavan@novell.com>
+
+ ** Print migration updates from Ebby Wiselyn.
+
+ * gui/component/addressbook-view.c: (print_cb), (print_preview_cb):
+ * gui/widgets/e-addressbook-view.c: (print),
+ (e_contact_print_button), (eab_view_print),
+ (eab_view_print_preview):
+ * printing/e-contact-print.c: (e_contact_print_contact),
+ (complete_sequence), (book_view_loaded), (print_func),
+ (e_contact_print_response), (e_contact_print_dialog_new),
+ (e_contact_print_contact_dialog_new),
+ (e_contact_print_contact_list_dialog_new), (contact_draw_page):
+
2007-02-08 Srinivasa Ragavan <sragavan@novell.com>
** Fix for bug #332908
diff --git a/addressbook/gui/component/addressbook-view.c b/addressbook/gui/component/addressbook-view.c
index 21b7cbd2f7..79bf25183e 100644
--- a/addressbook/gui/component/addressbook-view.c
+++ b/addressbook/gui/component/addressbook-view.c
@@ -193,7 +193,7 @@ print_cb (BonoboUIComponent *uih, void *user_data, const char *path)
AddressbookView *view = (AddressbookView *) user_data;
EABView *v = get_current_view (view);
if (v)
- eab_view_print(v, 1);
+ eab_view_print (v, 0);
}
static void
@@ -202,7 +202,7 @@ print_preview_cb (BonoboUIComponent *uih, void *user_data, const char *path)
AddressbookView *view = (AddressbookView *) user_data;
EABView *v = get_current_view (view);
if (v)
- eab_view_print_preview(v);
+ eab_view_print_preview (v);
}
static void
diff --git a/addressbook/gui/widgets/e-addressbook-view.c b/addressbook/gui/widgets/e-addressbook-view.c
index d52602ec62..471f5c3157 100644
--- a/addressbook/gui/widgets/e-addressbook-view.c
+++ b/addressbook/gui/widgets/e-addressbook-view.c
@@ -881,8 +881,8 @@ print (EPopup *ep, EPopupItem *pitem, void *data)
e_contact_print_response (dialog, GTK_RESPONSE_OK, NULL);
} else {
GList *contacts = get_contact_list(t);
-
- gtk_widget_show(e_contact_print_contact_list_dialog_new(contacts));
+ dialog = e_contact_print_contact_list_dialog_new (contacts);
+ e_contact_print_response (dialog, GTK_RESPONSE_OK, NULL);
g_list_free(contacts);
}
}
@@ -1748,9 +1748,6 @@ e_contact_print_button(GtkDialog *dialog, gint response, gpointer data)
gtk_widget_destroy(dialog);
g_object_unref (print);
- g_object_unref (settings);
- g_object_unref (page_setup);
- g_object_unref (paper_size);
}
static void
@@ -1867,7 +1864,7 @@ eab_view_print(EABView *view, int preview)
EContactPrintDialogWeakData *weak_data;
/* FIXME: Allow range selection in table views, as in minicard view */
- dialog = e_print_get_dialog (_("Print cards"), GNOME_PRINT_DIALOG_COPIES);
+ dialog = e_print_get_dialog (_("Print cards"), 0);
g_object_get(view->widget, "table", &etable, NULL);
printable = e_table_get_printable(etable);
@@ -1901,14 +1898,21 @@ eab_view_print_preview(EABView *view)
if (view->view_type == EAB_VIEW_MINICARD) {
char *query;
EBook *book;
- GtkWidget *print;
+ GtkWidget *dialog;
g_object_get (view->model,
"query", &query,
"book", &book,
NULL);
- GList *list = get_selected_contacts (view);
+
+ GList *list = get_selected_contacts (view);
+ if (list != NULL)
+ dialog = e_contact_print_contact_list_dialog_new (list);
+ else
+ dialog = e_contact_print_dialog_new (book, query, list);
+ e_contact_print_response (dialog, GTK_RESPONSE_APPLY, NULL);
e_free_object_list (list);
+ g_free (query);
}else if (view->view_type == EAB_VIEW_TABLE) {
GtkWidget *dialog;
EPrintable *printable;
@@ -1916,7 +1920,7 @@ eab_view_print_preview(EABView *view)
EContactPrintDialogWeakData *weak_data;
/* FIXME: Allow range selection in table views, as in minicard view */
- dialog = e_print_get_dialog (_("Print cards"), GNOME_PRINT_DIALOG_COPIES);
+ dialog = e_print_get_dialog (_("Print cards"), 0);
g_object_get(view->widget, "table", &etable, NULL);
printable = e_table_get_printable(etable);
@@ -1932,7 +1936,7 @@ eab_view_print_preview(EABView *view)
weak_data->table = view->widget;
weak_data->printable = G_OBJECT (printable);
g_object_weak_ref (G_OBJECT (dialog), e_contact_print_destroy, weak_data);
- e_contact_print_button (dialog, GTK_RESPONSE_OK, NULL);
+ e_contact_print_button (dialog, GTK_RESPONSE_APPLY, NULL);
}
}
diff --git a/addressbook/printing/e-contact-print.c b/addressbook/printing/e-contact-print.c
index 16c219fe1e..51d2171f9f 100644
--- a/addressbook/printing/e-contact-print.c
+++ b/addressbook/printing/e-contact-print.c
@@ -64,6 +64,7 @@ typedef struct _ContactPrintItem ContactPrintItem;
struct _EContactPrintContext
{
GtkPrintContext *pc;
+ GtkPrintOperation *print;
GnomePrintJob *master;
PangoLayout *pl;
gdouble x;
@@ -78,6 +79,7 @@ struct _EContactPrintContext
gboolean uses_book;
int type;
+ gint response_id;
EBook *book;
EBookQuery *query;
@@ -98,6 +100,9 @@ struct _ContactPrintItem
static void
contact_draw_page (GtkPrintOperation *print, GtkPrintContext *context, gint page_nr, ContactPrintItem *cpi);
+static void
+print_func (EBookView *book_view, const GList *contacts, EContactPrintContext *ctxt);
+
static double
get_font_height (PangoFontDescription *font)
{
@@ -360,7 +365,7 @@ e_contact_print_contact (EContact *contact, EContactPrintContext *ctxt)
e_contact_pretty_name (field));
xoff += get_font_width(ctxt, ctxt->style->body_font, e_contact_pretty_name (field));
- e_contact_output(ctxt, ctxt->style->body_font, ctxt->x + xoff, ctxt->y, -1, ": ");
+ e_contact_output(ctxt, ctxt->style->body_font, ctxt->x + xoff, ctxt->y + 5, -1, ": ");
xoff += get_font_width(ctxt, ctxt->style->body_font, ": ");
e_contact_output(ctxt,
@@ -448,13 +453,13 @@ complete_sequence (EBookView *book_view, EBookViewStatus status, EContactPrintCo
g_object_unref(ctxt->pc);
g_object_unref(ctxt->pl);
- if (ctxt->book)
+ if (ctxt->book)
g_object_unref(ctxt->book);
-
+
g_free(ctxt->character);
if (ctxt->query)
e_book_query_unref (ctxt->query);
- g_list_foreach(ctxt->contacts, (GFunc) g_object_unref, NULL);
+ g_list_foreach(ctxt->contacts, (GFunc) g_object_unref, NULL);
g_list_free(ctxt->contacts);
pango_font_description_free(ctxt->style->headings_font);
pango_font_description_free(ctxt->style->body_font);
@@ -462,7 +467,6 @@ complete_sequence (EBookView *book_view, EBookViewStatus status, EContactPrintCo
pango_font_description_free(ctxt->style->footer_font);
pango_font_description_free(ctxt->letter_heading_font);
g_free(ctxt->style);
- g_free(ctxt);
}
static int
@@ -504,10 +508,27 @@ book_view_loaded (EBook *book, EBookStatus status, EBookView *book_view, EContac
"contacts_added",
G_CALLBACK(create_contact),
ctxt);
-
+ g_signal_connect(book_view,
+ "sequence_complete",
+ G_CALLBACK(print_func),
+ ctxt);
e_book_view_start (book_view);
}
+static void
+print_func (EBookView *book_view, const GList *contacts, EContactPrintContext *ctxt)
+{
+ GtkPrintSettings *settings;
+ settings = gtk_print_settings_new ();
+ /* runs a print dialog, emittings signals */
+ if(ctxt->response_id == GTK_RESPONSE_APPLY)
+ gtk_print_operation_run (ctxt->print, GTK_PRINT_OPERATION_ACTION_PREVIEW, NULL, NULL);
+ else
+ gtk_print_operation_run (ctxt->print, GTK_PRINT_OPERATION_ACTION_PRINT_DIALOG, NULL, NULL);
+ settings = gtk_print_operation_get_print_settings (ctxt->print);
+ e_print_save_settings (settings);
+}
+
static void
e_contact_do_print_contacts (EBook *book, EBookQuery *query, EContactPrintContext *ctxt)
{
@@ -725,7 +746,6 @@ void
e_contact_print_response(GtkWidget *dialog, gint response_id, gpointer data)
{
GtkPrintSettings *settings;
- GtkPrintOperation *print;
GtkPrintOperationResult res;
GtkPaperSize *paper_size;
GtkPageSetup *page_setup;
@@ -770,10 +790,10 @@ e_contact_print_response(GtkWidget *dialog, gint response_id, gpointer data)
page_setup = gtk_page_setup_new ();
paper_size = gtk_paper_size_new ("iso_a4"); /* FIXME paper size hardcoded */
gtk_page_setup_set_paper_size (page_setup, paper_size);
- print = gtk_print_operation_new ();
- gtk_print_operation_set_default_page_setup (print, page_setup);
- gtk_print_operation_set_n_pages (print, 1);
- gtk_print_settings_set_print_pages (settings, GTK_PRINT_PAGES_ALL);
+ ctxt->print = gtk_print_operation_new ();
+ gtk_print_operation_set_default_page_setup (ctxt->print, page_setup);
+ gtk_print_operation_set_n_pages (ctxt->print, 1);
+ gtk_print_settings_set_print_pages (settings, GTK_PRINT_PAGES_ALL);
/* style information */
e_contact_build_style(style, settings);
@@ -790,6 +810,7 @@ e_contact_print_response(GtkWidget *dialog, gint response_id, gpointer data)
get_font_height (ctxt->style->headings_font)*1.5);
ctxt->book = book;
ctxt->query = query;
+ ctxt->response_id = response_id;
cpi->uses_book = uses_book;
cpi->uses_list = uses_list;
cpi->settings = settings;
@@ -798,20 +819,25 @@ e_contact_print_response(GtkWidget *dialog, gint response_id, gpointer data)
cpi->ctxt->contacts = NULL;
cpi->contact_list= contact_list;
cpi->book = book;
- e_contact_do_print_contacts (book, query, ctxt);
-
- /* runs the print dialog , emitting signals */
- g_signal_connect (print, "draw_page",G_CALLBACK (contact_draw_page), cpi);
- if (response_id == GTK_RESPONSE_APPLY) {
- res = gtk_print_operation_run (print, GTK_PRINT_OPERATION_ACTION_PREVIEW, NULL, NULL);
+ gtk_print_operation_set_print_settings (ctxt->print, settings);
+ g_signal_connect (ctxt->print, "draw_page",G_CALLBACK (contact_draw_page), cpi);
+
+ if (!uses_book) {
+ if(ctxt->response_id == GTK_RESPONSE_APPLY)
+ gtk_print_operation_run (ctxt->print, GTK_PRINT_OPERATION_ACTION_PREVIEW, NULL, NULL);
+ else
+ gtk_print_operation_run (ctxt->print, GTK_PRINT_OPERATION_ACTION_PRINT_DIALOG, NULL, NULL);
+ settings = gtk_print_operation_get_print_settings (ctxt->print);
+ e_print_save_settings (settings);
}
else
- res = gtk_print_operation_run (print, GTK_PRINT_OPERATION_ACTION_PRINT_DIALOG, NULL, NULL);
- g_object_unref (settings);
- g_object_unref (print);
- g_object_unref (paper_size);
- g_object_unref (page_setup);
- g_object_unref (cpi);
+ e_contact_do_print_contacts (book, query, ctxt);
+
+ g_object_unref (cpi);
+ if (!uses_book) {
+ g_object_unref (ctxt->print);
+ g_free (ctxt);
+ }
gtk_widget_destroy (dialog);
}
@@ -823,7 +849,7 @@ e_contact_print_dialog_new(EBook *book, char *query, GList *list)
GList *copied_list = NULL;
GList *l;
- dialog = e_print_get_dialog(_("Print contacts"), GNOME_PRINT_DIALOG_RANGE | GNOME_PRINT_DIALOG_COPIES);
+ dialog = e_print_get_dialog(_("Print contacts"), 0);
if (list != NULL) {
copied_list = g_list_copy (list);
@@ -849,7 +875,7 @@ e_contact_print_contact_dialog_new(EContact *contact)
{
GtkWidget *dialog;
- dialog = e_print_get_dialog(_("Print contact"), GNOME_PRINT_DIALOG_COPIES);
+ dialog = e_print_get_dialog(_("Print contact"), 0);
contact = e_contact_duplicate(contact);
g_object_set_data(G_OBJECT(dialog), "contact", contact);
g_object_set_data(G_OBJECT(dialog), "uses_list", GINT_TO_POINTER (FALSE));
@@ -870,13 +896,13 @@ e_contact_print_contact_list_dialog_new(GList *list)
GList *l;
if (list == NULL)
- return NULL;
+ return NULL;
copied_list = g_list_copy (list);
for (l = copied_list; l; l = l->next)
l->data = e_contact_duplicate (E_CONTACT (l->data));
- dialog = e_print_get_dialog(_("Print contact"), GNOME_PRINT_DIALOG_COPIES);
+ dialog = e_print_get_dialog(_("Print contact"), 0);
g_object_set_data(G_OBJECT(dialog), "contact_list", copied_list);
g_object_set_data(G_OBJECT(dialog), "uses_list", GINT_TO_POINTER (TRUE));
@@ -892,7 +918,6 @@ e_contact_print_contact_list_dialog_new(GList *list)
static void
contact_draw_page (GtkPrintOperation *print, GtkPrintContext *context, gint page_nr, ContactPrintItem *cpi)
{
- cairo_t *cr;
EBookView *view;
EBookViewStatus status;
@@ -905,6 +930,7 @@ contact_draw_page (GtkPrintOperation *print, GtkPrintContext *context, gint page
}
else if (cpi->uses_list) {
+ cpi->ctxt->contacts = cpi->contact_list;
complete_sequence(NULL, E_BOOK_VIEW_STATUS_OK, cpi->ctxt);
}
else {
diff --git a/calendar/ChangeLog b/calendar/ChangeLog
index ea05f7c425..50078014e0 100644
--- a/calendar/ChangeLog
+++ b/calendar/ChangeLog
@@ -1,3 +1,11 @@
+2007-02-12 Srinivasa Ragavan <sragavan@novell.com>
+
+ ** Print migration updates from Ebby Wiselyn
+
+ * gui/print.c: (print_day_view), (print_calendar), (print_comp),
+ (print_table), (comp_draw_page), (cal_draw_page),
+ (table_draw_page), (create_custom_widget), (apply_custom_widget):
+
2007-01-22 Srinivasa Ragavan <sragavan@novell.com>
Committing GtkPrint migration from Ebby Wiselyn.
diff --git a/calendar/gui/print.c b/calendar/gui/print.c
index b1f23d7cc2..e9629c0648 100644
--- a/calendar/gui/print.c
+++ b/calendar/gui/print.c
@@ -112,9 +112,6 @@ static PrintCompItem *
evo_calendar_print_data_new (GtkPrintContext *pc, PrintCompItem *pci);
static void
-evo_calendar_print_data_free (EvoCalendarPrintRenderer *pr);
-
-static void
comp_draw_page (GtkPrintOperation *print,
GtkPrintContext *context,
gint page_nr,
@@ -135,6 +132,8 @@ evo_calendar_print_renderer_get_width (EvoCalendarPrintRenderer *pr,
PangoFontDescription *font,
const char *text);
+GObject* create_custom_widget (GtkPrintOperation *print, GtkWidget *range);
+static void apply_custom_widget (GtkPrintOperation *print, GtkWidget *dialog, PrintCalItem *cpi);
static PrintCalItem *
evo_calendar_print_cal_data_new (GtkPrintContext *pc, PrintCalItem *pcali)
{
@@ -2169,8 +2168,6 @@ print_day_view (EvoCalendarPrintRenderer *pr, GnomeCalendar *gcal, time_t date,
print_text_size_bold (pr, buf, ALIGN_LEFT,
left + 4, todo, top + 32, top + 32 + 18);
- cr = gtk_print_context_get_cairo_context (pr->pc);
-
date = time_add_day_with_zone (date, 1, zone);
}
}
@@ -2642,7 +2639,6 @@ print_calendar (GnomeCalendar *gcal, gboolean preview, time_t date,
g_return_if_fail (GNOME_IS_CALENDAR (gcal));
view = (int) default_view;
- range = range_selector_new (gpd, date, &view);
pcali = g_new0 (PrintCalItem, 1);
pcali->gcal = g_new0 (GnomeCalendar, 1);
@@ -2651,17 +2647,17 @@ print_calendar (GnomeCalendar *gcal, gboolean preview, time_t date,
paper_size = gtk_paper_size_new ("iso_a4");
page_setup = gtk_page_setup_new();
gtk_page_setup_set_paper_size(page_setup, paper_size);
+ range = range_selector_new (gpd, date, &view);
settings = gtk_print_settings_new ();
- settings = e_print_load_config ();
- gpd = e_print_get_dialog_with_config (_("ebby"),GNOME_PRINT_DIALOG_RANGE | GNOME_PRINT_DIALOG_COPIES, settings );
- gtk_print_unix_dialog_add_custom_tab (GTK_PRINT_UNIX_DIALOG (gpd), range,gtk_label_new (_("range")));
+ settings = e_print_load_settings ();
+ gpd = e_print_get_dialog_with_config (_("Print Item"), 0, settings);
t = gtk_paper_size_get_default_top_margin (paper_size, GTK_UNIT_POINTS);
r = gtk_paper_size_get_default_right_margin (paper_size, GTK_UNIT_POINTS);
w = gtk_paper_size_get_width (paper_size, GTK_UNIT_POINTS);
h = gtk_paper_size_get_height (paper_size, GTK_UNIT_POINTS);
-
+
pcali->b = h * (1.0 - TEMP_MARGIN);
pcali->l = r * TEMP_MARGIN;
pcali->t = t * (1.0 - TEMP_MARGIN);
@@ -2670,31 +2666,28 @@ print_calendar (GnomeCalendar *gcal, gboolean preview, time_t date,
pcali->gcal = gcal;
pcali->date = date;
- settings = gtk_print_unix_dialog_get_settings (GTK_PRINT_UNIX_DIALOG (gpd));
gtk_print_operation_set_default_page_setup (print, page_setup);
gtk_print_operation_set_n_pages (print, 1);
-
+
/* FIX ME ,Allow it to use the default settings for the first time */
- /* gtk_print_operation_set_print_settings (print, settings); */
+ gtk_print_operation_set_print_settings (print, settings);
- /* Runs the print dialog, recursively, emitting signals */
+ g_signal_connect (print, "create-custom-widget", G_CALLBACK (create_custom_widget), range);
+ g_signal_connect (print, "custom-widget-apply", G_CALLBACK (apply_custom_widget), NULL);
g_signal_connect (print, "draw_page", G_CALLBACK (cal_draw_page), pcali);
+
+ /* Runs the print dialog, recursively, emitting signals */
if (preview)
gtk_print_operation_run (print, GTK_PRINT_OPERATION_ACTION_PREVIEW, NULL, NULL);
else
- res = gtk_print_operation_run (print,GTK_PRINT_OPERATION_ACTION_PRINT_DIALOG, NULL, NULL);
+ res = gtk_print_operation_run (print, GTK_PRINT_OPERATION_ACTION_PRINT_DIALOG, NULL, NULL);
/* Save the user configured settings back to the gconf */
settings = gtk_print_operation_get_print_settings (print);
- e_print_save_config (settings);
+ e_print_save_settings (settings);
if (res == GTK_PRINT_OPERATION_RESULT_APPLY) {
- g_object_unref (settings);
- g_object_unref (page_setup);
- g_object_unref (paper_size);
- g_object_unref (print);
- g_object_unref (paper_size);
- g_object_unref (page_setup);
+ g_object_unref (print);
}
else if (res == GTK_PRINT_OPERATION_RESULT_ERROR) {
/* FIX ME */
@@ -2726,8 +2719,8 @@ print_comp (ECalComponent *comp, ECal *client, gboolean preview)
gtk_page_setup_set_paper_size(page_setup, paper_size);
settings = gtk_print_settings_new ();
- settings = e_print_load_config ();
- gpd = e_print_get_dialog_with_config (_("Print Item"), GNOME_PRINT_DIALOG_COPIES, settings);
+ settings = e_print_load_settings ();
+ gpd = e_print_get_dialog_with_config (_("Print Item"), 0, settings);
/* Values using the print context , used in comp_draw_page */
t = gtk_paper_size_get_default_top_margin (paper_size, GTK_UNIT_POINTS);
@@ -2745,7 +2738,7 @@ print_comp (ECalComponent *comp, ECal *client, gboolean preview)
gtk_print_operation_set_n_pages (print, 1);
/* FIX ME ,Allow it to use the default settings for the first time */
- /* gtk_print_operation_set_print_settings (print, settings); */
+ gtk_print_operation_set_print_settings (print, settings);
g_signal_connect (print, "draw_page", G_CALLBACK (comp_draw_page), pci);
@@ -2759,13 +2752,10 @@ print_comp (ECalComponent *comp, ECal *client, gboolean preview)
/* Saves the user configuration in gconf */
settings = gtk_print_operation_get_print_settings (print);
- e_print_save_config (settings);
+ e_print_save_settings (settings);
if (res == GTK_PRINT_OPERATION_RESULT_APPLY) {
- g_object_unref (settings);
g_object_unref (print);
- g_object_unref (page_setup);
- g_object_unref (paper_size);
}
else if ( res == GTK_PRINT_OPERATION_RESULT_ERROR) {
/* FIX ME */
@@ -2836,9 +2826,8 @@ print_table (ETable *etable, const char *dialog_title, const char *print_header,
pti->paper_width = r - l;
pti->paper_height= t + 10;
- settings = e_print_load_config ();
- gpd = e_print_get_dialog_with_config (dialog_title, GNOME_PRINT_DIALOG_COPIES, settings);
- settings = gtk_print_settings_new ();
+ settings = e_print_load_settings ();
+ gpd = e_print_get_dialog_with_config (dialog_title, 0, settings);
printable = e_table_get_printable (etable);
g_object_ref (printable);
@@ -2850,11 +2839,11 @@ print_table (ETable *etable, const char *dialog_title, const char *print_header,
gtk_print_operation_set_n_pages (print, 1);
/* FIX ME ,Allow it to use the default settings for the first time */
- /* gtk_print_operation_set_print_settings (print, settings); */
+ gtk_print_operation_set_print_settings (print, settings);
/* runs the dialog emitting the signals based on user response */
g_signal_connect (print, "draw_page", G_CALLBACK (table_draw_page), pti);
- if (preview)
+ if (!preview)
res = gtk_print_operation_run (print, GTK_PRINT_OPERATION_ACTION_PRINT_DIALOG, NULL, NULL);
else
gtk_print_operation_run (print, GTK_PRINT_OPERATION_ACTION_PREVIEW, NULL, NULL);
@@ -2862,27 +2851,25 @@ print_table (ETable *etable, const char *dialog_title, const char *print_header,
/* Saves the user configuration in gconf */
settings = gtk_print_operation_get_print_settings (print);
- e_print_save_config (settings);
+ e_print_save_settings (settings);
if (res == GTK_PRINT_OPERATION_RESULT_APPLY) {
- g_object_unref (settings);
g_object_unref (print);
- g_object_unref (page_setup);
- g_object_unref (paper_size);
}
else if ( res == GTK_PRINT_OPERATION_RESULT_ERROR) {
/* FIX ME */
}
}
-
-void comp_draw_page (GtkPrintOperation *print, GtkPrintContext *context, gint page_nr, PrintCompItem *pci)
+static void
+comp_draw_page (GtkPrintOperation *print, GtkPrintContext *context, gint page_nr, PrintCompItem *pci)
{
pci = evo_calendar_print_data_new (context, pci);
print_comp_item (pci);
}
-void cal_draw_page (GtkPrintOperation *print1, GtkPrintContext *context, gint page_nr1, PrintCalItem *pcali)
+static void
+cal_draw_page(GtkPrintOperation *print1, GtkPrintContext *context, gint page_nr1, PrintCalItem *pcali)
{
pcali = evo_calendar_print_cal_data_new (context, pcali);
@@ -2901,12 +2888,11 @@ void cal_draw_page (GtkPrintOperation *print1, GtkPrintContext *context, gint pa
break;
default:
g_assert_not_reached ();
- }
-
-
+ }
}
-void table_draw_page (GtkPrintOperation *print, GtkPrintContext *context, gint page_nr, PrintTableItem *pti)
+static void
+table_draw_page (GtkPrintOperation *print, GtkPrintContext *context, gint page_nr, PrintTableItem *pti)
{
pti->context = context;
@@ -2920,7 +2906,27 @@ void table_draw_page (GtkPrintOperation *print, GtkPrintContext *context, gint p
} while (e_printable_data_left (pti->printable));
}
+/*
+ * This callback creates a custom widget that gets inserted into the
+ * print operation dialog, the custom widget contains the range,
+ * day, view, month, or year
+ */
+GObject* create_custom_widget (GtkPrintOperation *print,GtkWidget *range)
+{
+ return range;
+}
+/*
+ * Read the information from the custom widget and print day, view, or
+ * month based on user selection
+ */
+static void
+apply_custom_widget (GtkPrintOperation *print, GtkWidget *dialog, PrintCalItem *cpi)
+{
+ gchar str;
+ str = e_dialog_editable_get (dialog);
+ printf("%sValue of Radio Button \n", str);
+}
diff --git a/e-util/ChangeLog b/e-util/ChangeLog
index 9945df293d..e18a3bc65a 100644
--- a/e-util/ChangeLog
+++ b/e-util/ChangeLog
@@ -1,3 +1,12 @@
+2007-02-12 Srinivasa Ragavan <sragavan@novell.com>
+
+ ** Print settings revamp from Matthew Barnes
+
+ * e-print.c: (pack_settings), (unpack_settings),
+ (e_print_load_settings), (e_print_save_settings),
+ (print_dialog_response), (e_print_get_dialog):
+ * e-print.h:
+
2007-01-27 Andre Klapper <a9016009@gmx.de>
* e-html-utils.c: (e_text_to_html_full):
diff --git a/e-util/e-print.c b/e-util/e-print.c
index 33eecca14b..edec919eac 100644
--- a/e-util/e-print.c
+++ b/e-util/e-print.c
@@ -19,155 +19,89 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
*/
+#include "e-print.h"
+
#include <stdio.h>
#include <string.h>
-#include <gconf/gconf-client.h>
-#include "e-print.h"
#include <gtk/gtk.h>
#include <gtk/gtkprintunixdialog.h>
-#define PRINTER "/apps/evolution/shell/printer"
-#define SCALE "/apps/evolution/shell/scale"
-#define PRINT_PAGES "/apps/evolution/shell/print_pages"
-#define PAGE_RANGES "/apps/evolution/shell/page_ranges"
-#define PAGE_SET "/apps/evolution/shell/page_set"
-#define COLLATE "/apps/evolution/shell/collate"
-#define REVERSE "/apps/evolution/shell/reverse"
-#define N_COPIES "/apps/evolution/shell/n_copies"
-#define LPR_COMMANDLINE "/apps/evolution/shell/lpr_commandline"
-#define OUTPUT_URI "/apps/evolution/shell/output_uri"
-#define OUTPUT_FILE_FORMAT "/apps/evolution/shell/output_file_format"
-
-/* Loads the print settings that were saved previously */
+#include <gconf/gconf-client.h>
+#define PRINTING "/apps/evolution/shell/printing"
+static void
+pack_settings (const gchar *key, const gchar *value, GSList **p_list)
+{
+ gchar *item;
+ item = g_strdup_printf ("%s=%s", key, value);
+ *p_list = g_slist_prepend (*p_list, item);
+}
+static void
+unpack_settings (gchar *item, GtkPrintSettings *settings)
+{
+ gchar *cp, *key, *value;
+ cp = strchr (item, '=');
+ if (cp == NULL)
+ return;
+ *cp ++ = '\0';
+ key = g_strstrip (item);
+ value = g_strstrip (cp);
+ gtk_print_settings_set (settings, key, value);
+ g_free (item);
+}
GtkPrintSettings *
-e_print_load_config (void)
+e_print_load_settings (void)
{
- GConfClient *gconf;
+ GConfClient *client;
GtkPrintSettings *settings;
- gchar *printer_name;
- gchar *collate;
- gchar *n_copies;
- gchar *print_pages;
- gchar *page_set;
- gchar *scale;
- gchar *output_uri;
- gchar *output_file_format;
- gchar *reverse;
- gchar *page_ranges;
- gchar *lpr_commandline;
+ GSList *list;
+ GError *error = NULL;
+ client = gconf_client_get_default ();
settings = gtk_print_settings_new ();
- gconf = gconf_client_get_default ();
-
- printer_name = gconf_client_get_string (gconf, PRINTER, NULL);
- gtk_print_settings_set (settings, "printer", printer_name);
-
- n_copies = gconf_client_get_string (gconf, N_COPIES, NULL);
- gtk_print_settings_set (settings, "n-copies",n_copies);
-
- collate = gconf_client_get_string (gconf, COLLATE, NULL);
- gtk_print_settings_set (settings, "collate", collate);
-
- lpr_commandline = gconf_client_get_string (gconf, LPR_COMMANDLINE, NULL);
- gtk_print_settings_set (settings, "lpr-commandline", lpr_commandline);
-
- print_pages = gconf_client_get_string (gconf, PRINT_PAGES, NULL);
- gtk_print_settings_set (settings, "print-pages", print_pages);
-
- page_set = gconf_client_get_string (gconf, PAGE_SET, NULL);
- gtk_print_settings_set (settings, "page-set", page_set);
-
- output_uri = gconf_client_get_string (gconf, OUTPUT_URI, NULL);
- gtk_print_settings_set (settings, "output-uri", output_uri);
-
- output_file_format = gconf_client_get_string (gconf, OUTPUT_FILE_FORMAT, NULL);
- gtk_print_settings_set (settings, "output-file-format",output_file_format);
-
- reverse = gconf_client_get_string (gconf, REVERSE, NULL);
- gtk_print_settings_set (settings, "reverse", reverse);
-
- scale = gconf_client_get_string (gconf, SCALE, NULL);
- gtk_print_settings_set (settings, "scale", scale);
-
- page_ranges = gconf_client_get_string (gconf, PAGE_RANGES, NULL);
- gtk_print_settings_set (settings, "page-ranges", page_ranges);
-
- g_free (printer_name);
- g_free (collate);
- g_free (n_copies);
- g_free (print_pages);
- g_free (page_set);
- g_free (scale);
- g_free (output_uri);
- g_free (output_file_format);
- g_free (reverse);
- g_free (page_ranges);
- g_free (lpr_commandline);
- g_object_unref (gconf);
+ list = gconf_client_get_list (
+ client, PRINTING, GCONF_VALUE_STRING, &error);
+ if (error == NULL) {
+ g_slist_foreach (list, (GFunc) unpack_settings, settings);
+ g_slist_free (list);
+ } else {
+ g_warning ("%s: %s", G_STRFUNC, error->message);
+ g_error_free (error);
+ }
+ g_object_unref (client);
return settings;
}
/* Saves the print settings */
void
-e_print_save_config (GtkPrintSettings *settings)
+e_print_save_settings (GtkPrintSettings *settings)
{
- GConfClient *gconf;
- const gchar *printer_name;
- const gchar *collate;
- const gchar *n_copies;
- const gchar *print_pages;
- const gchar *page_set;
- const gchar *scale;
- const gchar *output_uri;
- const gchar *output_file_format;
- const gchar *reverse;
- const gchar *page_ranges;
- const gchar *lpr_commandline;
-
- gconf = gconf_client_get_default ();
- printer_name = gtk_print_settings_get (settings, "printer");
- gconf_client_set_string (gconf, PRINTER, printer_name, NULL);
-
- scale = gtk_print_settings_get (settings, "scale");
- gconf_client_set_string (gconf, SCALE, scale, NULL);
-
- page_set = gtk_print_settings_get (settings, "page-set");
- gconf_client_set_string (gconf, PAGE_SET, page_set, NULL);
-
- print_pages = gtk_print_settings_get (settings, "print-pages");
- gconf_client_set_string (gconf, PRINT_PAGES, print_pages, NULL);
-
- lpr_commandline = gtk_print_settings_get (settings, "lpr-commandline");
- gconf_client_set_string (gconf, LPR_COMMANDLINE, lpr_commandline, NULL);
+ GConfClient *client;
+ GSList *list = NULL;
+ GError *error = NULL;
- collate = gtk_print_settings_get (settings, "collate");
- gconf_client_set_string (gconf, COLLATE, collate, NULL);
+ client = gconf_client_get_default ();
- output_uri = gtk_print_settings_get (settings, "output-uri");
- gconf_client_set_string (gconf, OUTPUT_URI, output_uri, NULL);
-
- output_file_format = gtk_print_settings_get (settings, "output-file-format");
- gconf_client_set_string (gconf, OUTPUT_FILE_FORMAT, output_file_format, NULL);
-
- reverse = gtk_print_settings_get (settings, "reverse");
- gconf_client_set_string (gconf, REVERSE, reverse, NULL);
-
- n_copies = gtk_print_settings_get (settings, "n_copies");
- gconf_client_set_string (gconf, N_COPIES, n_copies, NULL);
-
- page_ranges = gtk_print_settings_get (settings, "page-ranges");
- gconf_client_set_string (gconf, PAGE_RANGES, "page-ranges",NULL);
-
- g_object_unref (gconf);
+ gtk_print_settings_foreach (
+ settings, (GtkPrintSettingsFunc) pack_settings, &list);
+ gconf_client_set_list (
+ client, PRINTING, GCONF_VALUE_STRING, list, &error);
+ if (error != NULL) {
+ g_warning ("%s: %s", G_STRFUNC, error->message);
+ g_error_free (error);
+ }
+ g_slist_foreach (list, (GFunc) g_free, NULL);
+ g_slist_free (list);
+
+ g_object_unref (client);
}
static void
print_dialog_response(GtkWidget *widget, int resp, gpointer data)
{
if (resp == GTK_RESPONSE_OK) {
- e_print_save_config (gtk_print_unix_dialog_get_settings(GTK_PRINT_UNIX_DIALOG (widget)));
+ e_print_save_settings (gtk_print_unix_dialog_get_settings(GTK_PRINT_UNIX_DIALOG (widget)));
}
}
@@ -178,7 +112,8 @@ e_print_get_dialog (const char *title, int flags)
GtkPrintSettings *settings;
GtkWidget *dialog;
- settings = e_print_load_config ();
+ settings = gtk_print_settings_new ();
+ settings = e_print_load_settings ();
dialog = e_print_get_dialog_with_config (title, flags, settings);
g_object_unref (settings);
return dialog;
diff --git a/e-util/e-print.h b/e-util/e-print.h
index c8ca551203..8ae99a2900 100644
--- a/e-util/e-print.h
+++ b/e-util/e-print.h
@@ -19,17 +19,15 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
*/
-#include <gtk/gtk.h>
-#include <libgnomeprint/gnome-print.h>
-#include <libgnomeprintui/gnome-print-dialog.h>
-
#ifndef __E_PRINT__
#define __E_PRINT__
+#include <gtk/gtk.h>
+
G_BEGIN_DECLS
-GtkPrintSettings *e_print_load_config (void);
-void e_print_save_config (GtkPrintSettings *settings);
+GtkPrintSettings *e_print_load_settings (void);
+void e_print_save_settings (GtkPrintSettings *settings);
GtkWidget *e_print_get_dialog (const char *title, int flags);
GtkWidget *e_print_get_dialog_with_config (const char *title, int flags, GtkPrintSettings *settings);
diff --git a/mail/ChangeLog b/mail/ChangeLog
index a1ca779205..f6139a86ef 100644
--- a/mail/ChangeLog
+++ b/mail/ChangeLog
@@ -1,3 +1,12 @@
+2007-02-12 Srinivasa Ragavan <sragavan@novell.com>
+
+ ** Print migration updates from Ebby Wiselyn
+
+ * em-folder-browser.c:
+ * em-folder-view.c: (emfv_print_response), (em_folder_view_print):
+ * em-format-html-print.c: (efhp_footer_cb), (emfhp_complete),
+ (mail_draw_page):
+
2007-02-10 Duarte Loreto <happyguy_pt@hotmail.com>
* default/pt/Inbox: Updated welcome message to 2.8 version
diff --git a/mail/em-folder-browser.c b/mail/em-folder-browser.c
index e176c27d80..c94baeb759 100644
--- a/mail/em-folder-browser.c
+++ b/mail/em-folder-browser.c
@@ -48,8 +48,6 @@
#undef interface
#endif
-#include <libgnomeprintui/gnome-print-dialog.h>
-
#include "mail-mt.h"
#include "mail-ops.h"
#include "mail-tools.h"
diff --git a/mail/em-folder-view.c b/mail/em-folder-view.c
index a1f24b1c8c..933382d4e1 100644
--- a/mail/em-folder-view.c
+++ b/mail/em-folder-view.c
@@ -44,8 +44,6 @@
#include <libgnome/gnome-url.h>
-#include <libgnomeprintui/gnome-print-dialog.h>
-
#include <gconf/gconf-client.h>
#include <camel/camel-mime-message.h>
@@ -2144,8 +2142,12 @@ emfv_print_response(GtkWidget *w, int resp, struct _print_data *data)
g_object_unref(print);
break;
}
- g_object_unref (data->emfv);
- g_object_unref (data->settings);
+
+ if (w)
+ gtk_widget_destroy (w);
+
+ g_object_unref (data->emfv);
+ g_object_unref (data->settings);
camel_object_unref (data->folder);
g_free (data->uid);
g_free (data);
@@ -2170,7 +2172,7 @@ int em_folder_view_print(EMFolderView *emfv, int preview)
data = g_malloc0(sizeof(*data));
data->emfv = emfv;
g_object_ref(emfv);
- data->settings = e_print_load_config ();
+ data->settings = e_print_load_settings ();
data->preview = preview;
data->folder = emfv->folder;
camel_object_ref(data->folder);
@@ -2179,13 +2181,13 @@ int em_folder_view_print(EMFolderView *emfv, int preview)
if (preview) {
GtkDialog *dialog = (GtkDialog *)e_print_get_dialog_with_config (_("Print Message"),
- GNOME_PRINT_DIALOG_COPIES, data->settings);
+ 0, data->settings);
gtk_dialog_set_default_response (dialog, GTK_RESPONSE_APPLY);
e_dialog_set_transient_for ((GtkWindow *) dialog, (GtkWidget *) emfv);
emfv_print_response(dialog, GTK_RESPONSE_APPLY, data);
} else {
GtkDialog *dialog = (GtkDialog *)e_print_get_dialog_with_config (_("Print Message"),
- GNOME_PRINT_DIALOG_COPIES, data->settings);
+ 0, data->settings);
gtk_dialog_set_default_response (dialog, GTK_RESPONSE_OK);
e_dialog_set_transient_for ((GtkWindow *) dialog, (GtkWidget *) emfv);
emfv_print_response (dialog, GTK_RESPONSE_OK, data);
diff --git a/mail/em-format-html-print.c b/mail/em-format-html-print.c
index 34ddd2fac8..a527ded879 100644
--- a/mail/em-format-html-print.c
+++ b/mail/em-format-html-print.c
@@ -26,10 +26,8 @@
#endif
#include <string.h>
-
#include <libgnomeprint/gnome-print-job.h>
#include <libgnomeprintui/gnome-print-job-preview.h>
-
#include <gtkhtml/gtkhtml.h>
#include <gtk/gtkwindow.h>
@@ -152,9 +150,8 @@ efhp_footer_cb(GtkHTML *html, GtkPrintContext *print_context, double x, double y
cairo_set_font_size (cr, 6);
cairo_show_text (cr, text);
cairo_restore(cr);
- cairo_show_page (cr);
g_free(text);
- info->page_num++;
+ info->page_num++;
}
}
@@ -171,11 +168,12 @@ emfhp_complete(EMFormatHTMLPrint *efhp, void *data)
struct footer_info info;
page_setup = gtk_page_setup_new ();
- paper_size = gtk_paper_size_new ("iso_a4");/*FIXME paper size hard coded */
+ paper_size = gtk_paper_size_new ("iso_a4");/*FIXME paper size hardcoded */
print = gtk_print_operation_new ();
gtk_page_setup_set_paper_size (page_setup, paper_size);
- settings = e_print_load_config ();
+ settings = e_print_load_settings ();
+ gtk_print_operation_set_print_settings (print, settings);
/* running the dialog */
gtk_print_operation_set_default_page_setup (print, page_setup);
gtk_print_operation_set_n_pages (print, 1);
@@ -193,11 +191,9 @@ emfhp_complete(EMFormatHTMLPrint *efhp, void *data)
gtk_print_operation_run (print, GTK_PRINT_OPERATION_ACTION_PRINT_DIALOG, NULL, NULL);
else
gtk_print_operation_run (print, GTK_PRINT_OPERATION_ACTION_PREVIEW, NULL, NULL);
+ settings = gtk_print_operation_get_print_settings (print);
+ e_print_save_settings (settings);
g_object_unref (print);
- g_object_unref (settings);
- g_object_unref (paper_size);
- g_object_unref (page_setup);
- g_object_unref (efhp);
}
static void
@@ -218,7 +214,6 @@ mail_draw_page (GtkPrintOperation *print, GtkPrintContext *context, gint page_nr
} else {
gtk_html_print_page (mdi->efhp->formathtml.html, context);
}
- g_object_unref(mdi->efhp);
}
int em_format_html_print_print(EMFormatHTMLPrint *efhp, EMFormatHTML *source, struct GtkPrintSettings *settings, int preview)
diff --git a/plugins/print-message/ChangeLog b/plugins/print-message/ChangeLog
index 5275c39b71..22020bc06d 100644
--- a/plugins/print-message/ChangeLog
+++ b/plugins/print-message/ChangeLog
@@ -1,3 +1,10 @@
+2007-02-12 Srinivasa Ragavan <sragavan@novell.com>
+
+ ** Print migration updates from Ebby Wiselyn
+
+ * print-message.c: (print_response), (org_gnome_print_message),
+ (org_gnome_print_preview):
+
2005-12-12 Harish Krishnaswamy <kharish@novell.com>
* Makefile.am: Fix make-clean issues.
diff --git a/plugins/print-message/print-message.c b/plugins/print-message/print-message.c
index 531882239b..087aa82370 100644
--- a/plugins/print-message/print-message.c
+++ b/plugins/print-message/print-message.c
@@ -19,7 +19,7 @@
*
*/
-
+#include <gtk/gtk.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
@@ -40,7 +40,7 @@
void org_gnome_compose_print_message (EPlugin *ep, EMMenuTargetWidget *t);
struct _print_data {
- GnomePrintConfig *config;
+ GtkPrintSettings *config;
CamelMimeMessage *msg;
int preview;
};
@@ -51,9 +51,9 @@ print_response (GtkWidget *w, int resp, struct _print_data *data)
EMFormatHTMLPrint *print;
switch (resp) {
- case GNOME_PRINT_DIALOG_RESPONSE_PREVIEW:
+ case GTK_RESPONSE_APPLY:
data->preview = TRUE;
- case GNOME_PRINT_DIALOG_RESPONSE_PRINT:
+ case GTK_RESPONSE_OK:
print = em_format_html_print_new();
em_format_html_print_raw_message(print, data->config, data->msg, data->preview);
g_object_unref(print);
@@ -63,7 +63,7 @@ print_response (GtkWidget *w, int resp, struct _print_data *data)
if (w)
gtk_widget_destroy(w);
- e_print_save_config (data->config);
+ e_print_save_settings (data->config);
g_object_unref(data->config);
g_free(data);
@@ -80,16 +80,14 @@ org_gnome_print_message (EPlugin *ep, EMMenuTargetWidget *t)
GtkDialog *dialog;
data = g_malloc0(sizeof(*data));
- data->config = e_print_load_config ();
+ data->config = e_print_load_settings ();
data->preview = 0;
data->msg = e_msg_composer_get_message (composer, 1);
- dialog = (GtkDialog *)e_print_get_dialog_with_config (_("Print Message"), GNOME_PRINT_DIALOG_COPIES, data->config);
- gtk_dialog_set_default_response(dialog, GNOME_PRINT_DIALOG_RESPONSE_PRINT);
+ dialog = (GtkDialog *)e_print_get_dialog_with_config (_("Print Message"), 0, data->config);
+ gtk_dialog_set_default_response(dialog, GTK_RESPONSE_OK);
e_dialog_set_transient_for ((GtkWindow *) dialog, (GtkWidget *) composer);
- g_signal_connect(dialog, "response", G_CALLBACK(print_response), data);
- gtk_widget_show((GtkWidget *)dialog);
-
+ print_response (dialog, GTK_RESPONSE_OK, data);
}
void org_gnome_print_preview (EPlugin *ep, EMMenuTargetWidget *t);
@@ -101,12 +99,12 @@ org_gnome_print_preview (EPlugin *ep, EMMenuTargetWidget *t)
struct _print_data *data;
data = g_malloc0(sizeof(*data));
- data->config = e_print_load_config ();
+ data->config = e_print_load_settings ();
data->preview = 0;
data->msg = e_msg_composer_get_message (composer, 1);
- print_response(NULL, GNOME_PRINT_DIALOG_RESPONSE_PREVIEW, data);
+ print_response(NULL, GTK_RESPONSE_APPLY, data);
}
diff --git a/shell/ChangeLog b/shell/ChangeLog
index 8055a429ed..01769364f3 100644
--- a/shell/ChangeLog
+++ b/shell/ChangeLog
@@ -1,3 +1,9 @@
+2007-02-12 Srinivasa Ragavan <sragavan@novell.com>
+
+ ** Rewrite of print settings schema from Matthew Barnes
+
+ * apps_evolution_shell.schemas.in.in:
+
2007-02-09 William Jon McCann <mccann@jhu.edu>
* e-shell-nm-glib.c: Fix the build. Fixes #403744
diff --git a/shell/apps_evolution_shell.schemas.in.in b/shell/apps_evolution_shell.schemas.in.in
index 96467f5de0..f7d1e71f98 100644
--- a/shell/apps_evolution_shell.schemas.in.in
+++ b/shell/apps_evolution_shell.schemas.in.in
@@ -204,302 +204,17 @@
</locale>
</schema>
- <!-- Print defaults -->
+ <!-- Print settings -->
<schema>
- <key>/schemas/apps/evolution/shell/print_config</key>
- <applyto>/apps/evolution/shell/print_config</applyto>
+ <key>/schemas/apps/evolution/shell/printing</key>
+ <applyto>/apps/evolution/shell/printing</applyto>
<owner>evolution</owner>
- <type>string</type>
- <locale name="C">
- <short>Printer settings</short>
- <long>A GNOME Print description of the current printer settings</long>
- </locale>
- </schema>
-
-
- <schema>
- <key>/schemas/apps/evolution/shell/printer</key>
- <applyto>/apps/evolution/shell/printer</applyto>
- <owner>evolution</owner>
- <type>string</type>
- <default>printer</default>
- <locale name="C">
- <short></short>
- <long>A GNOME Print description of the current printer settings</long>
- </locale>
- </schema>
-
- <schema>
- <key>/schemas/apps/evolution/shell/orientation</key>
- <applyto>/apps/evolution/shell/orientation</applyto>
- <owner>evolution</owner>
- <type>int</type>
- <default>2</default>
- <locale name="C">
- <short>Printer settings</short>
- <long>A GNOME Print description of the current printer settings</long>
- </locale>
- </schema>
-
-
- <schema>
- <key>/schemas/apps/evolution/shell/paper_size</key>
- <applyto>/apps/evolution/shell/paper_size</applyto>
- <owner>evolution</owner>
- <type>int</type>
- <default>GTK_PAPER_NAME_A3</default>
- <locale name="C">
- <short>Printer settings</short>
- <long>A GNOME Print description of the current printer settings</long>
- </locale>
- </schema>
-
-
- <schema>
- <key>/schemas/apps/evolution/shell/paper_width</key>
- <applyto>/apps/evolution/shell/paper_width</applyto>
- <owner>evolution</owner>
- <type>double</type>
- <default>5</default>
- <locale name="C">
- <short>Printer settings</short>
- <long>A GNOME Print description of the current printer settings</long>
- </locale>
- </schema>
-
-
- <schema>
- <key>/schemas/apps/evolution/shell/paper_height</key>
- <applyto>/apps/evolution/shell/paper_height</applyto>
- <owner>evolution</owner>
- <type>double</type>
- <default>5</default>
- <locale name="C">
- <short>Printer settings</short>
- <long>A GNOME Print description of the current printer settings</long>
- </locale>
- </schema>
-
-
- <schema>
- <key>/schemas/apps/evolution/shell/duplex</key>
- <applyto>/apps/evolution/shell/duplex</applyto>
- <owner>evolution</owner>
- <type>int</type>
- <default>1</default>
- <locale name="C">
- <short>Printer settings</short>
- <long>A GNOME Print description of the current printer settings</long>
- </locale>
- </schema>
-
-
- <schema>
- <key>/schemas/apps/evolution/shell/quality</key>
- <applyto>/apps/evolution/shell/quality</applyto>
- <owner>evolution</owner>
- <type>int</type>
- <default>1</default>
- <locale name="C">
- <short>Printer settings</short>
- <long>A GNOME Print description of the current printer settings</long>
- </locale>
- </schema>
-
-
- <schema>
- <key>/schemas/apps/evolution/shell/n_copies</key>
- <applyto>/apps/evolution/shell/n_copies</applyto>
- <owner>evolution</owner>
- <type>int</type>
- <default>10</default>
- <locale name="C">
- <short>Printer settings</short>
- <long>A GNOME Print description of the current printer settings</long>
- </locale>
- </schema>
-
-
- <schema>
- <key>/schemas/apps/evolution/shell/number_up</key>_
- <applyto>/apps/evolution/shell/number_up</applyto>
- <owner>evolution</owner>
- <type>int</type>
- <default>10</default>
- <locale name="C">
- <short>Printer settings</short>
- <long>A GNOME Print description of the current printer settings</long>
- </locale>
- </schema>
-
-
- <schema>
- <key>/schemas/apps/evolution/shell/resolution</key>
- <applyto>/apps/evolution/shell/resolution</applyto>
- <owner>evolution</owner>
- <type>int</type>
- <default>50</default>
- <locale name="C">
- <short>Printer settings</short>
- <long>A GNOME Print description of the current printer settings</long>
- </locale>
- </schema>
-
-
- <schema>
- <key>/schemas/apps/evolution/shell/scale</key>
- <applyto>/apps/evolution/shell/scale</applyto>
- <owner>evolution</owner>
- <type>double</type>
- <default>50.0</default>
- <locale name="C">
- <short>Printer settings</short>
- <long>A GNOME Print description of the current printer settings</long>
- </locale>
- </schema>
-
-
- <schema>
- <key>/schemas/apps/evolution/shell/print_pages</key>
- <applyto>/apps/evolution/shell/print_pages</applyto>
- <owner>evolution</owner>
- <type>int</type>
- <default>3</default>
- <locale name="C">
- <short>Printer settings</short>
- <long>A GNOME Print description of the current printer settings</long>
- </locale>
- </schema>
-
-
- <schema>
- <key>/schemas/apps/evolution/shell/page_ranges</key>
- <applyto>/apps/evolution/shell/page_ranges</applyto>
- <owner>evolution</owner>
- <type>int</type>
- <default>5</default>
- <locale name="C">
- <short>Printer settings</short>
- <long>A GNOME Print description of the current printer settings</long>
- </locale>
- </schema>
-
-
- <schema>
- <key>/schemas/apps/evolution/shell/page_set</key>
- <applyto>/apps/evolution/shell/page_set</applyto>
- <owner>evolution</owner>
- <type>int</type>
- <default>5</default>
- <locale name="C">
- <short>Printer settings</short>
- <long>A GNOME Print description of the current printer settings</long>
- </locale>
- </schema>
-
-
- <schema>
- <key>/schemas/apps/evolution/shell/default_source</key>
- <applyto>/apps/evolution/shell/default_source</applyto>
- <owner>evolution</owner>
- <type>string</type>
- <default>"/home/ebby/Desktop/"</default>
- <locale name="C">
- <short>Printer settings</short>
- <long>A GNOME Print description of the current printer settings</long>
- </locale>
- </schema>
-
-
- <schema>
- <key>/schemas/apps/evolution/shell/media_type</key>
- <applyto>/apps/evolution/shell/media_type</applyto>
- <owner>evolution</owner>
- <type>string</type>
- <default>"iso_a3"</default>
- <locale name="C">
- <short>Printer settings</short>
- <long>A GNOME Print description of the current printer settings</long>
- </locale>
- </schema>
-
-
- <schema>
- <key>/schemas/apps/evolution/shell/dither</key>
- <applyto>/apps/evolution/shell/dither</applyto>
- <owner>evolution</owner>
- <type>string</type>
- <default>"dither"</default>
- <locale name="C">
- <short>Printer settings</short>
- <long>A GNOME Print description of the current printer settings</long>
- </locale>
- </schema>
-
-
- <schema>
- <key>/schemas/apps/evolution/shell/finishings</key>
- <applyto>/apps/evolution/shell/finishings</applyto>
- <owner>evolution</owner>
- <type>string</type>
- <default>"finish"</default>
- <locale name="C">
- <short>Printer settings</short>
- <long>A GNOME Print description of the current printer settings</long>
- </locale>
- </schema>
-
- <schema>
- <key>/schemas/apps/evolution/shell/output_bin</key>
- <applyto>/apps/evolution/shell/output_bin</applyto>
- <owner>evolution</owner>
- <type>string</type>
- <default>"/home/ebby/Desktop"</default>
- <locale name="C">
- <short>Printer settings</short>
- <long>A GNOME Print description of the current printer settings</long>
- </locale>
- </schema>
-
-
- <schema>
- <key>/schemas/apps/evolution/shell/reverse</key>
- <applyto>/apps/evolution/shell/reverse</applyto>
- <owner>evolution</owner>
- <type>bool</type>
- <default>TRUE</default>
- <locale name="C">
- <short>Printer settings</short>
- <long>A GNOME Print description of the current printer settings</long>
- </locale>
- </schema>
-
-
- <schema>
- <key>/schemas/apps/evolution/shell/collate</key>
- <applyto>/apps/evolution/shell/collate</applyto>
- <owner>evolution</owner>
- <type>bool</type>
- <default>TRUE</default>
- <locale name="C">
- <short>Printer settings</short>
- <long>A GNOME Print description of the current printer settings</long>
- </locale>
- </schema>
-
-
- <schema>
- <key>/schemas/apps/evolution/shell/use_color</key>
- <applyto>/apps/evolution/shell/use_color</applyto>
- <owner>evolution</owner>
- <type>bool</type>
- <default>TRUE</default>
+ <type>list</type>
+ <list_type>string</list_type>
<locale name="C">
- <short>Printer settings</short>
- <long>A GNOME Print description of the current printer settings</long>
+ <long>A string description of the current printer settings</long>
</locale>
</schema>
-
</schemalist>
</gconfschemafile>
diff --git a/widgets/misc/ChangeLog b/widgets/misc/ChangeLog
index 635a24c065..7763bc034a 100644
--- a/widgets/misc/ChangeLog
+++ b/widgets/misc/ChangeLog
@@ -1,3 +1,11 @@
+2007-02-12 Srinivasa Ragavan <sragavan@novell.com>
+
+ ** Print migration updates from Ebby Wiselyn
+
+ * e-printable.c: (e_printable_print_page), (e_printable_height),
+ (e_printable_will_fit):
+ * e-printable.h:
+
2007-01-08 Harish Krishnaswamy <kharish@novell.com>
* e-filter-bar.c: (build_items): Initialize ESearchBarItem
diff --git a/widgets/misc/e-printable.c b/widgets/misc/e-printable.c
index ed12c9e488..b9d9221404 100644
--- a/widgets/misc/e-printable.c
+++ b/widgets/misc/e-printable.c
@@ -31,6 +31,7 @@
#include "e-printable.h"
+
#define EP_CLASS(e) ((EPrintableClass *)((GtkObject *)e)->klass)
#define PARENT_TYPE GTK_TYPE_OBJECT
@@ -126,7 +127,7 @@ e_printable_new(void)
void
e_printable_print_page (EPrintable *e_printable,
- GnomePrintContext *context,
+ GtkPrintContext *context,
gdouble width,
gdouble height,
gboolean quantized)
@@ -169,7 +170,7 @@ e_printable_reset (EPrintable *e_printable)
gdouble
e_printable_height (EPrintable *e_printable,
- GnomePrintContext *context,
+ GtkPrintContext *context,
gdouble width,
gdouble max_height,
gboolean quantized)
@@ -192,7 +193,7 @@ e_printable_height (EPrintable *e_printable,
gboolean
e_printable_will_fit (EPrintable *e_printable,
- GnomePrintContext *context,
+ GtkPrintContext *context,
gdouble width,
gdouble max_height,
gboolean quantized)
diff --git a/widgets/misc/e-printable.h b/widgets/misc/e-printable.h
index 0c665f89c2..2d3140c99f 100644
--- a/widgets/misc/e-printable.h
+++ b/widgets/misc/e-printable.h
@@ -26,6 +26,7 @@
#include <gtk/gtkobject.h>
#include <libgnomeprint/gnome-print.h>
+#include <gtk/gtk.h>
G_BEGIN_DECLS
@@ -46,10 +47,10 @@ typedef struct {
* Signals
*/
- void (*print_page) (EPrintable *etm, GnomePrintContext *context, gdouble width, gdouble height, gboolean quantized);
+ void (*print_page) (EPrintable *etm, GtkPrintContext *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);
+ gdouble (*height) (EPrintable *etm, GtkPrintContext *context, gdouble width, gdouble max_height, gboolean quantized);
/* e_printable_will_fit (ep, ...) should be equal in value to
* (e_printable_print_page (ep, ...),
@@ -58,7 +59,7 @@ typedef struct {
* position of the printable.
*/
- gboolean (*will_fit) (EPrintable *etm, GnomePrintContext *context, gdouble width, gdouble max_height, gboolean quantized);
+ gboolean (*will_fit) (EPrintable *etm, GtkPrintContext *context, gdouble width, gdouble max_height, gboolean quantized);
} EPrintableClass;
GtkType e_printable_get_type (void);
@@ -68,19 +69,19 @@ EPrintable *e_printable_new (void);
/*
* Routines for emitting signals on the e_table */
void e_printable_print_page (EPrintable *e_printable,
- GnomePrintContext *context,
+ GtkPrintContext *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,
+ GtkPrintContext *context,
gdouble width,
gdouble max_height,
gboolean quantized);
gboolean e_printable_will_fit (EPrintable *e_printable,
- GnomePrintContext *context,
+ GtkPrintContext *context,
gdouble width,
gdouble max_height,
gboolean quantized);
diff --git a/widgets/table/ChangeLog b/widgets/table/ChangeLog
index ed89bd823e..50319c8bd3 100644
--- a/widgets/table/ChangeLog
+++ b/widgets/table/ChangeLog
@@ -1,3 +1,10 @@
+2007-02-12 Srinivasa Ragavan <sragavan@novell.com>
+
+ ** Print migration updates from Ebby Wiselyn
+
+ * e-cell-toggle.c:
+ * e-cell-text.c:
+
2007-02-08 Matthew Barnes <mbarnes@redhat.com>
** Fixes bug #357216
diff --git a/widgets/table/e-cell-text.c b/widgets/table/e-cell-text.c
index 88dd215636..8df67aca24 100644
--- a/widgets/table/e-cell-text.c
+++ b/widgets/table/e-cell-text.c
@@ -1380,7 +1380,7 @@ ect_print (ECellView *ecell_view, GtkPrintContext *context,
cairo_line_to (cr, MIN (2 + text_width, width - 2), ly + text_height + 6);
}
cairo_set_line_width (cr, (double)pango_font_metrics_get_underline_thickness (font_metrics)/(double)PANGO_SCALE);
- cairo_stroke (cr);
+ cairo_stroke (cr);
}
if (strikeout) {
diff --git a/widgets/table/e-cell-toggle.c b/widgets/table/e-cell-toggle.c
index dda87efcae..1ee06c15ea 100644
--- a/widgets/table/e-cell-toggle.c
+++ b/widgets/table/e-cell-toggle.c
@@ -295,25 +295,25 @@ etog_print (ECellView *ecell_view, GtkPrintContext *context,
GdkPixbuf *image;
double image_width, image_height;
const int value = GPOINTER_TO_INT (
- e_table_model_value_at (ecell_view->e_table_model, model_col, row));
+ e_table_model_value_at (ecell_view->e_table_model, model_col, row));
cairo_t *cr;
- if (value >= toggle->n_states){
+ 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);
+ value, toggle->n_states);
return;
}
cr = gtk_print_context_get_cairo_context (context);
cairo_save(cr);
- image = toggle->images[value];
+ image = toggle->images[value];
cairo_translate (cr, 0 , 0);
image = gdk_pixbuf_add_alpha (image, TRUE, 255, 255, 255);
- image_width = (double)gdk_pixbuf_get_width (image);
+ image_width = (double)gdk_pixbuf_get_width (image);
image_height = (double)gdk_pixbuf_get_height (image);
cairo_rectangle (cr, image_width / 7, image_height / 3,
- image_width - image_width / 4,
- image_width - image_height / 7);
+ image_width - image_width / 4,
+ image_width - image_height / 7);
cairo_clip (cr);
gdk_cairo_set_source_pixbuf (cr, image, 0, image_height / 4);
cairo_paint (cr);