From cb02a6e5c779df721a4a0bedc1bcaa1ff820b2bc Mon Sep 17 00:00:00 2001 From: Dave Peticolas Date: Fri, 24 Mar 2000 22:33:40 +0000 Subject: [PATCH] *** empty log message *** git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@2115 57a11ea4-9604-0410-9ed3-97b8803252fd --- ChangeLog | 4 + Makefile.common | 2 +- Makefile.init.in | 1 + po/de.po | 65 +++- po/en_GB.po | 49 ++- po/fr.po | 66 +++- po/gnucash.pot | 48 ++- po/sv.po | 56 +++- src/gnome/glade-cb-gnc-dialogs.h | 14 +- src/gnome/glade-gnc-dialogs.c | 295 ++++++++++++++++-- src/gnome/glade-gnc-dialogs.h | 1 + src/gnome/gnc-dialogs.glade | 476 +++++++++++++++++++++++++++-- src/gnome/print-session.c | 115 ++++++- src/gnome/print-session.h | 11 + src/scm/printing/print-check.scm | 10 +- src/scm/qif-import/qif-objects.scm | 8 +- src/scm/qif-import/qif-to-gnc.scm | 37 ++- 17 files changed, 1130 insertions(+), 128 deletions(-) diff --git a/ChangeLog b/ChangeLog index 3da56e4140..df721c49ba 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2000-03-24 Dave Peticolas + * Makefile.common: add the value of DEFS to the compile flags + + * Makefile.init.in: get the value for DEFS. + * src/register/numcell.c: new cell for entering numbers. Handles accelerators for increasing/decreasing the number and remembers the largest number for auto-filling. diff --git a/Makefile.common b/Makefile.common index 0834df1d14..9cd23e2867 100644 --- a/Makefile.common +++ b/Makefile.common @@ -23,7 +23,7 @@ MOTIF_OBJS += $(addprefix obj/motif/,${MOTIF_SRCS:.c=.o}) QT_OBJS := $(addprefix obj/qt/,${COMMON_SRCS:.c=.o}) QT_OBJS += $(addprefix obj/qt/,${QT_SRCS:.cpp=.o}) -CFLAGS += -pg +CFLAGS += -pg ${DEFS} ifdef GNOME_CONFIG_BIN GNOME_CFLAGS += $(shell ${GNOME_CONFIG_BIN} --cflags gnomeui) diff --git a/Makefile.init.in b/Makefile.init.in index 0ed37814ec..9bfadcd802 100644 --- a/Makefile.init.in +++ b/Makefile.init.in @@ -27,6 +27,7 @@ CC = @CC@ CXX = @CXX@ CFLAGS = @CFLAGS@ CPPFLAGS = @CPPFLAGS@ +DEFS = @DEFS@ INSTALL = @INSTALL@ RANLIB = @RANLIB@ INSTALL_DATA = @INSTALL_DATA@ diff --git a/po/de.po b/po/de.po index 64742b59f3..05c98f3809 100644 --- a/po/de.po +++ b/po/de.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: gnucash 1.3.1\n" -"POT-Creation-Date: 2000-03-23 03:24-0800\n" +"POT-Creation-Date: 2000-03-24 14:08-0800\n" "PO-Revision-Date: 2000-03-16 15:20+0100\n" "Last-Translator: Jan-Uwe Finck \n" "Language-Team: LANGUAGE \n" @@ -1424,7 +1424,7 @@ msgstr "Einstellungen" msgid "Price" msgstr "Preis" -#: messages-i18n.c:314 +#: messages-i18n.c:314 src/gnome/glade-gnc-dialogs.c:978 msgid "Print" msgstr "Drucken" @@ -2686,7 +2686,7 @@ msgstr "W #: src/gnome/glade-gnc-dialogs.c:182 msgid "Radix format:" -msgstr "Darstellungsformat" +msgstr "Darstellungsformat:" #: src/gnome/glade-gnc-dialogs.c:191 msgid "Date format:" @@ -2758,7 +2758,7 @@ msgstr "QIF Kategorie" #: src/gnome/glade-gnc-dialogs.c:415 msgid "Categories" -msgstr "Kategorien Anzeigen" +msgstr "Kategorien" #: src/gnome/glade-gnc-dialogs.c:564 msgid "Selected account:" @@ -2777,25 +2777,62 @@ msgstr "Kontoart:" msgid "Mutual" msgstr "Investmentfonds" -#: src/gnome/glade-gnc-dialogs.c:763 +#: src/gnome/glade-gnc-dialogs.c:786 +msgid "Print Dialog" +msgstr "" + +#: src/gnome/glade-gnc-dialogs.c:794 #, fuzzy -msgid "Print Check" -msgstr "Scheck" +msgid "Print Setup" +msgstr "Scheck drucken" + +#: src/gnome/glade-gnc-dialogs.c:815 +#, fuzzy +msgid "Printer:" +msgstr "Drucken" + +#: src/gnome/glade-gnc-dialogs.c:823 +msgid "Paper size:" +msgstr "" + +#: src/gnome/glade-gnc-dialogs.c:831 +msgid "Pages to print:" +msgstr "" + +#: src/gnome/glade-gnc-dialogs.c:876 +msgid "All" +msgstr "" -#: src/gnome/glade-gnc-dialogs.c:778 +#: src/gnome/glade-gnc-dialogs.c:884 #, fuzzy -msgid "Select Printer" +msgid "Selected" msgstr "Datei auswählen" -#: src/gnome/glade-gnc-dialogs.c:785 +#: src/gnome/glade-gnc-dialogs.c:906 #, fuzzy -msgid "Preview" -msgstr "Preis" +msgid "From:" +msgstr "Von" + +#: src/gnome/glade-gnc-dialogs.c:921 +#, fuzzy +msgid "To:" +msgstr "Zu" -#: src/gnome/print-session.c:118 +#: src/gnome/glade-gnc-dialogs.c:943 src/gnome/glade-gnc-dialogs.c:950 #, fuzzy +msgid "Select..." +msgstr "Alle auswählen" + +#: src/gnome/glade-gnc-dialogs.c:986 +msgid "Preview" +msgstr "Vorschau" + +#: src/gnome/print-session.c:220 msgid "You must select a printer first." -msgstr "Wählen sie ein Konto zum Ausbuchen" +msgstr "Sie müssen erst einen Drucker auswählen" + +#~ msgid "Select Printer" +#~ msgstr "Drucker auswählen" #~ msgid "Failed to load QIF file. Are you sure it's a QIF file?" #~ msgstr "" diff --git a/po/en_GB.po b/po/en_GB.po index 95b1d40464..78e6f92530 100644 --- a/po/en_GB.po +++ b/po/en_GB.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: gnucash 1.3.0\n" -"POT-Creation-Date: 2000-03-23 03:24-0800\n" +"POT-Creation-Date: 2000-03-24 14:08-0800\n" "PO-Revision-Date: 2000-03-06 11:20+0000\n" "Last-Translator: David Woodhouse \n" "Language-Team: LANGUAGE \n" @@ -1344,7 +1344,7 @@ msgstr "" msgid "Price" msgstr "" -#: messages-i18n.c:314 +#: messages-i18n.c:314 src/gnome/glade-gnc-dialogs.c:978 msgid "Print" msgstr "" @@ -2678,19 +2678,52 @@ msgstr "" msgid "Mutual" msgstr "" -#: src/gnome/glade-gnc-dialogs.c:763 +#: src/gnome/glade-gnc-dialogs.c:786 +msgid "Print Dialog" +msgstr "" + +#: src/gnome/glade-gnc-dialogs.c:794 +#, fuzzy +msgid "Print Setup" +msgstr "Cheque" + +#: src/gnome/glade-gnc-dialogs.c:815 #, fuzzy -msgid "Print Check" +msgid "Printer:" msgstr "Cheque" -#: src/gnome/glade-gnc-dialogs.c:778 -msgid "Select Printer" +#: src/gnome/glade-gnc-dialogs.c:823 +msgid "Paper size:" +msgstr "" + +#: src/gnome/glade-gnc-dialogs.c:831 +msgid "Pages to print:" +msgstr "" + +#: src/gnome/glade-gnc-dialogs.c:876 +msgid "All" +msgstr "" + +#: src/gnome/glade-gnc-dialogs.c:884 +msgid "Selected" +msgstr "" + +#: src/gnome/glade-gnc-dialogs.c:906 +msgid "From:" +msgstr "" + +#: src/gnome/glade-gnc-dialogs.c:921 +msgid "To:" +msgstr "" + +#: src/gnome/glade-gnc-dialogs.c:943 src/gnome/glade-gnc-dialogs.c:950 +msgid "Select..." msgstr "" -#: src/gnome/glade-gnc-dialogs.c:785 +#: src/gnome/glade-gnc-dialogs.c:986 msgid "Preview" msgstr "" -#: src/gnome/print-session.c:118 +#: src/gnome/print-session.c:220 msgid "You must select a printer first." msgstr "" diff --git a/po/fr.po b/po/fr.po index 204226871e..35e8c3da67 100644 --- a/po/fr.po +++ b/po/fr.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: gnucash 1.3.3\n" -"POT-Creation-Date: 2000-03-23 03:24-0800\n" +"POT-Creation-Date: 2000-03-24 14:08-0800\n" "PO-Revision-Date: 2000-03-23 22:24+0200\n" "Last-Translator: Yannick LE NY \n" "Language-Team: LANGUAGE \n" @@ -291,7 +291,8 @@ msgstr "Le chargement du fichier QIF a #: messages-i18n.c:45 msgid "QIF file load failed. Check settings and reload." -msgstr "Le chargement du fichier QIF a échoué.Vérifiez les paramètres et rechargez" +msgstr "" +"Le chargement du fichier QIF a échoué.Vérifiez les paramètres et rechargez" #: messages-i18n.c:46 msgid "The source for price quotes" @@ -1438,7 +1439,7 @@ msgstr "Pr msgid "Price" msgstr "Cours" -#: messages-i18n.c:314 +#: messages-i18n.c:314 src/gnome/glade-gnc-dialogs.c:978 msgid "Print" msgstr "Imprimer" @@ -2627,8 +2628,8 @@ msgid "" "The background color for an active transaction in multi-line mode and the " "auto modes" msgstr "" -"L'arrière-plan en couleur pour une répartition active en mode multi lignes et " -"en modes auto" +"L'arrière-plan en couleur pour une répartition active en mode multi lignes " +"et en modes auto" #: po/guile_strings.txt:278 msgid "This is a multi choice option." @@ -2796,22 +2797,63 @@ msgstr "Type de compte:" msgid "Mutual" msgstr "Fonds communs" -#: src/gnome/glade-gnc-dialogs.c:763 -msgid "Print Check" +#: src/gnome/glade-gnc-dialogs.c:786 +msgid "Print Dialog" +msgstr "" + +#: src/gnome/glade-gnc-dialogs.c:794 +#, fuzzy +msgid "Print Setup" msgstr "Imprimer chèque" -#: src/gnome/glade-gnc-dialogs.c:778 -msgid "Select Printer" -msgstr "Sélectionner une imprimante" +#: src/gnome/glade-gnc-dialogs.c:815 +#, fuzzy +msgid "Printer:" +msgstr "Imprimer" + +#: src/gnome/glade-gnc-dialogs.c:823 +msgid "Paper size:" +msgstr "" + +#: src/gnome/glade-gnc-dialogs.c:831 +msgid "Pages to print:" +msgstr "" + +#: src/gnome/glade-gnc-dialogs.c:876 +msgid "All" +msgstr "" -#: src/gnome/glade-gnc-dialogs.c:785 +#: src/gnome/glade-gnc-dialogs.c:884 +#, fuzzy +msgid "Selected" +msgstr "Sélectionner un fichier" + +#: src/gnome/glade-gnc-dialogs.c:906 +#, fuzzy +msgid "From:" +msgstr "Depuis" + +#: src/gnome/glade-gnc-dialogs.c:921 +#, fuzzy +msgid "To:" +msgstr "Vers" + +#: src/gnome/glade-gnc-dialogs.c:943 src/gnome/glade-gnc-dialogs.c:950 +#, fuzzy +msgid "Select..." +msgstr "Tout sélectionner" + +#: src/gnome/glade-gnc-dialogs.c:986 msgid "Preview" msgstr "Prévisualisation" -#: src/gnome/print-session.c:118 +#: src/gnome/print-session.c:220 msgid "You must select a printer first." msgstr "Vous devez dabord sélectionner une imprimante." +#~ msgid "Select Printer" +#~ msgstr "Sélectionner une imprimante" + #~ msgid "Failed to load QIF file. Are you sure it's a QIF file?" #~ msgstr "" #~ "Erreur de chargement du fichier QIF. Etes-vous sûr que c'est un fichier QIF?" diff --git a/po/gnucash.pot b/po/gnucash.pot index 158522ca07..1cbfe97523 100644 --- a/po/gnucash.pot +++ b/po/gnucash.pot @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" -"POT-Creation-Date: 2000-03-23 03:24-0800\n" +"POT-Creation-Date: 2000-03-24 14:08-0800\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -1341,7 +1341,7 @@ msgstr "" msgid "Price" msgstr "" -#: messages-i18n.c:314 +#: messages-i18n.c:314 src/gnome/glade-gnc-dialogs.c:978 msgid "Print" msgstr "" @@ -2666,18 +2666,50 @@ msgstr "" msgid "Mutual" msgstr "" -#: src/gnome/glade-gnc-dialogs.c:763 -msgid "Print Check" +#: src/gnome/glade-gnc-dialogs.c:786 +msgid "Print Dialog" msgstr "" -#: src/gnome/glade-gnc-dialogs.c:778 -msgid "Select Printer" +#: src/gnome/glade-gnc-dialogs.c:794 +msgid "Print Setup" msgstr "" -#: src/gnome/glade-gnc-dialogs.c:785 +#: src/gnome/glade-gnc-dialogs.c:815 +msgid "Printer:" +msgstr "" + +#: src/gnome/glade-gnc-dialogs.c:823 +msgid "Paper size:" +msgstr "" + +#: src/gnome/glade-gnc-dialogs.c:831 +msgid "Pages to print:" +msgstr "" + +#: src/gnome/glade-gnc-dialogs.c:876 +msgid "All" +msgstr "" + +#: src/gnome/glade-gnc-dialogs.c:884 +msgid "Selected" +msgstr "" + +#: src/gnome/glade-gnc-dialogs.c:906 +msgid "From:" +msgstr "" + +#: src/gnome/glade-gnc-dialogs.c:921 +msgid "To:" +msgstr "" + +#: src/gnome/glade-gnc-dialogs.c:943 src/gnome/glade-gnc-dialogs.c:950 +msgid "Select..." +msgstr "" + +#: src/gnome/glade-gnc-dialogs.c:986 msgid "Preview" msgstr "" -#: src/gnome/print-session.c:118 +#: src/gnome/print-session.c:220 msgid "You must select a printer first." msgstr "" diff --git a/po/sv.po b/po/sv.po index ff53f2a14d..5cc4f61f55 100644 --- a/po/sv.po +++ b/po/sv.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: 1.3.2\n" -"POT-Creation-Date: 2000-03-23 03:24-0800\n" +"POT-Creation-Date: 2000-03-24 14:08-0800\n" "PO-Revision-Date: 2000-03-02 10:23+0100\n" "Last-Translator: Dennis Björklund \n" "Language-Team: Sv \n" @@ -1444,7 +1444,7 @@ msgstr "Inst msgid "Price" msgstr "Pris" -#: messages-i18n.c:314 +#: messages-i18n.c:314 src/gnome/glade-gnc-dialogs.c:978 msgid "Print" msgstr "Utskrift" @@ -2821,22 +2821,62 @@ msgstr "Kontotyp" msgid "Mutual" msgstr "Aktiefond" -#: src/gnome/glade-gnc-dialogs.c:763 +#: src/gnome/glade-gnc-dialogs.c:786 +msgid "Print Dialog" +msgstr "" + +#: src/gnome/glade-gnc-dialogs.c:794 #, fuzzy -msgid "Print Check" +msgid "Print Setup" msgstr "Check" -#: src/gnome/glade-gnc-dialogs.c:778 +#: src/gnome/glade-gnc-dialogs.c:815 +#, fuzzy +msgid "Printer:" +msgstr "Utskrift" + +#: src/gnome/glade-gnc-dialogs.c:823 +msgid "Paper size:" +msgstr "" + +#: src/gnome/glade-gnc-dialogs.c:831 +msgid "Pages to print:" +msgstr "" + +#: src/gnome/glade-gnc-dialogs.c:876 +msgid "All" +msgstr "" + +#: src/gnome/glade-gnc-dialogs.c:884 #, fuzzy -msgid "Select Printer" +msgid "Selected" msgstr "Välj allt" -#: src/gnome/glade-gnc-dialogs.c:785 +#: src/gnome/glade-gnc-dialogs.c:906 +#, fuzzy +msgid "From:" +msgstr "Från" + +#: src/gnome/glade-gnc-dialogs.c:921 +#, fuzzy +msgid "To:" +msgstr "Till" + +#: src/gnome/glade-gnc-dialogs.c:943 src/gnome/glade-gnc-dialogs.c:950 +#, fuzzy +msgid "Select..." +msgstr "Välj allt" + +#: src/gnome/glade-gnc-dialogs.c:986 #, fuzzy msgid "Preview" msgstr "Pris" -#: src/gnome/print-session.c:118 +#: src/gnome/print-session.c:220 #, fuzzy msgid "You must select a printer first." msgstr "Du måste välja ett konto att städa upp." + +#, fuzzy +#~ msgid "Select Printer" +#~ msgstr "Välj allt" diff --git a/src/gnome/glade-cb-gnc-dialogs.h b/src/gnome/glade-cb-gnc-dialogs.h index 55970d4a64..c5afa7535f 100644 --- a/src/gnome/glade-cb-gnc-dialogs.h +++ b/src/gnome/glade-cb-gnc-dialogs.h @@ -65,13 +65,25 @@ gnc_ui_print_dialog_select_printer_cb (GtkButton *button, gpointer user_data); void -gnc_ui_print_dialog_preview_cb (GtkButton *button, +gnc_ui_print_dialog_select_paper_cb (GtkButton *button, gpointer user_data); void gnc_ui_print_dialog_ok_cb (GtkButton *button, gpointer user_data); +void +gnc_ui_print_dialog_preview_cb (GtkButton *button, + gpointer user_data); + void gnc_ui_print_dialog_cancel_cb (GtkButton *button, gpointer user_data); + +void +gnc_ui_paper_dialog_ok_cb (GtkButton *button, + gpointer user_data); + +void +gnc_ui_paper_dialog_cancel_cb (GtkButton *button, + gpointer user_data); diff --git a/src/gnome/glade-gnc-dialogs.c b/src/gnome/glade-gnc-dialogs.c index b247926028..000640b69d 100644 --- a/src/gnome/glade-gnc-dialogs.c +++ b/src/gnome/glade-gnc-dialogs.c @@ -753,41 +753,220 @@ create_Print_Dialog (void) { GtkWidget *Print_Dialog; GtkWidget *dialog_vbox4; - GtkWidget *vbox6; + GtkWidget *frame4; + GtkWidget *hbox12; + GtkWidget *vbox7; + GtkWidget *label690; + GtkWidget *label691; + GtkWidget *label692; + GtkWidget *label695; + GtkWidget *vbox8; + GtkWidget *printer_entry; + GtkWidget *paper_entry; + GtkWidget *hbox13; + GSList *hbox13_group = NULL; + GtkWidget *radiobutton1; + GtkWidget *radiobutton2; + GtkWidget *label693; + GtkWidget *hbox14; + GtkWidget *label696; + GtkWidget *entry3; + GtkWidget *label697; + GtkWidget *entry4; + GtkWidget *vbox9; GtkWidget *button12; - GtkWidget *button13; + GtkWidget *button17; + GtkWidget *label694; + GtkWidget *label698; GtkWidget *dialog_action_area4; GtkWidget *button9; + GtkWidget *button13; GtkWidget *button11; - Print_Dialog = gnome_dialog_new (_("Print Check"), NULL); + Print_Dialog = gnome_dialog_new (_("Print Dialog"), NULL); gtk_object_set_data (GTK_OBJECT (Print_Dialog), "Print_Dialog", Print_Dialog); - gtk_window_set_policy (GTK_WINDOW (Print_Dialog), FALSE, FALSE, FALSE); + gtk_window_set_policy (GTK_WINDOW (Print_Dialog), TRUE, TRUE, FALSE); dialog_vbox4 = GNOME_DIALOG (Print_Dialog)->vbox; gtk_object_set_data (GTK_OBJECT (Print_Dialog), "dialog_vbox4", dialog_vbox4); gtk_widget_show (dialog_vbox4); - vbox6 = gtk_vbox_new (FALSE, 0); - gtk_widget_ref (vbox6); - gtk_object_set_data_full (GTK_OBJECT (Print_Dialog), "vbox6", vbox6, + frame4 = gtk_frame_new (_("Print Setup")); + gtk_widget_ref (frame4); + gtk_object_set_data_full (GTK_OBJECT (Print_Dialog), "frame4", frame4, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (frame4); + gtk_box_pack_start (GTK_BOX (dialog_vbox4), frame4, TRUE, TRUE, 0); + + hbox12 = gtk_hbox_new (FALSE, 0); + gtk_widget_ref (hbox12); + gtk_object_set_data_full (GTK_OBJECT (Print_Dialog), "hbox12", hbox12, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (hbox12); + gtk_container_add (GTK_CONTAINER (frame4), hbox12); + + vbox7 = gtk_vbox_new (TRUE, 0); + gtk_widget_ref (vbox7); + gtk_object_set_data_full (GTK_OBJECT (Print_Dialog), "vbox7", vbox7, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (vbox7); + gtk_box_pack_start (GTK_BOX (hbox12), vbox7, TRUE, TRUE, 5); + + label690 = gtk_label_new (_("Printer:")); + gtk_widget_ref (label690); + gtk_object_set_data_full (GTK_OBJECT (Print_Dialog), "label690", label690, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (label690); + gtk_box_pack_start (GTK_BOX (vbox7), label690, FALSE, FALSE, 5); + gtk_misc_set_alignment (GTK_MISC (label690), 1, 0.5); + + label691 = gtk_label_new (_("Paper size:")); + gtk_widget_ref (label691); + gtk_object_set_data_full (GTK_OBJECT (Print_Dialog), "label691", label691, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (label691); + gtk_box_pack_start (GTK_BOX (vbox7), label691, FALSE, FALSE, 0); + gtk_misc_set_alignment (GTK_MISC (label691), 1, 0.5); + + label692 = gtk_label_new (_("Pages to print:")); + gtk_widget_ref (label692); + gtk_object_set_data_full (GTK_OBJECT (Print_Dialog), "label692", label692, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (label692); + gtk_box_pack_start (GTK_BOX (vbox7), label692, FALSE, FALSE, 0); + gtk_misc_set_alignment (GTK_MISC (label692), 1, 0.5); + + label695 = gtk_label_new (""); + gtk_widget_ref (label695); + gtk_object_set_data_full (GTK_OBJECT (Print_Dialog), "label695", label695, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (label695); + gtk_box_pack_start (GTK_BOX (vbox7), label695, FALSE, FALSE, 0); + + vbox8 = gtk_vbox_new (TRUE, 0); + gtk_widget_ref (vbox8); + gtk_object_set_data_full (GTK_OBJECT (Print_Dialog), "vbox8", vbox8, (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (vbox6); - gtk_box_pack_start (GTK_BOX (dialog_vbox4), vbox6, TRUE, TRUE, 0); + gtk_widget_show (vbox8); + gtk_box_pack_start (GTK_BOX (hbox12), vbox8, TRUE, TRUE, 0); - button12 = gtk_button_new_with_label (_("Select Printer")); + printer_entry = gtk_entry_new (); + gtk_widget_ref (printer_entry); + gtk_object_set_data_full (GTK_OBJECT (Print_Dialog), "printer_entry", printer_entry, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (printer_entry); + gtk_box_pack_start (GTK_BOX (vbox8), printer_entry, FALSE, FALSE, 5); + gtk_entry_set_editable (GTK_ENTRY (printer_entry), FALSE); + + paper_entry = gtk_entry_new (); + gtk_widget_ref (paper_entry); + gtk_object_set_data_full (GTK_OBJECT (Print_Dialog), "paper_entry", paper_entry, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (paper_entry); + gtk_box_pack_start (GTK_BOX (vbox8), paper_entry, FALSE, FALSE, 0); + gtk_entry_set_editable (GTK_ENTRY (paper_entry), FALSE); + + hbox13 = gtk_hbox_new (FALSE, 0); + gtk_widget_ref (hbox13); + gtk_object_set_data_full (GTK_OBJECT (Print_Dialog), "hbox13", hbox13, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (hbox13); + gtk_box_pack_start (GTK_BOX (vbox8), hbox13, TRUE, TRUE, 0); + + radiobutton1 = gtk_radio_button_new_with_label (hbox13_group, _("All")); + hbox13_group = gtk_radio_button_group (GTK_RADIO_BUTTON (radiobutton1)); + gtk_widget_ref (radiobutton1); + gtk_object_set_data_full (GTK_OBJECT (Print_Dialog), "radiobutton1", radiobutton1, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (radiobutton1); + gtk_box_pack_start (GTK_BOX (hbox13), radiobutton1, FALSE, FALSE, 0); + + radiobutton2 = gtk_radio_button_new_with_label (hbox13_group, _("Selected")); + hbox13_group = gtk_radio_button_group (GTK_RADIO_BUTTON (radiobutton2)); + gtk_widget_ref (radiobutton2); + gtk_object_set_data_full (GTK_OBJECT (Print_Dialog), "radiobutton2", radiobutton2, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (radiobutton2); + gtk_box_pack_start (GTK_BOX (hbox13), radiobutton2, FALSE, FALSE, 0); + + label693 = gtk_label_new (""); + gtk_widget_ref (label693); + gtk_object_set_data_full (GTK_OBJECT (Print_Dialog), "label693", label693, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (label693); + gtk_box_pack_start (GTK_BOX (hbox13), label693, FALSE, FALSE, 0); + + hbox14 = gtk_hbox_new (FALSE, 0); + gtk_widget_ref (hbox14); + gtk_object_set_data_full (GTK_OBJECT (Print_Dialog), "hbox14", hbox14, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (hbox14); + gtk_box_pack_start (GTK_BOX (vbox8), hbox14, TRUE, TRUE, 0); + + label696 = gtk_label_new (_("From:")); + gtk_widget_ref (label696); + gtk_object_set_data_full (GTK_OBJECT (Print_Dialog), "label696", label696, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (label696); + gtk_box_pack_start (GTK_BOX (hbox14), label696, FALSE, FALSE, 5); + + entry3 = gtk_entry_new_with_max_length (5); + gtk_widget_ref (entry3); + gtk_object_set_data_full (GTK_OBJECT (Print_Dialog), "entry3", entry3, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (entry3); + gtk_box_pack_start (GTK_BOX (hbox14), entry3, FALSE, FALSE, 0); + gtk_widget_set_usize (entry3, 80, -2); + + label697 = gtk_label_new (_("To:")); + gtk_widget_ref (label697); + gtk_object_set_data_full (GTK_OBJECT (Print_Dialog), "label697", label697, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (label697); + gtk_box_pack_start (GTK_BOX (hbox14), label697, FALSE, FALSE, 5); + + entry4 = gtk_entry_new_with_max_length (5); + gtk_widget_ref (entry4); + gtk_object_set_data_full (GTK_OBJECT (Print_Dialog), "entry4", entry4, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (entry4); + gtk_box_pack_start (GTK_BOX (hbox14), entry4, FALSE, FALSE, 0); + gtk_widget_set_usize (entry4, 80, -2); + + vbox9 = gtk_vbox_new (TRUE, 0); + gtk_widget_ref (vbox9); + gtk_object_set_data_full (GTK_OBJECT (Print_Dialog), "vbox9", vbox9, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (vbox9); + gtk_box_pack_start (GTK_BOX (hbox12), vbox9, TRUE, TRUE, 5); + + button12 = gtk_button_new_with_label (_("Select...")); gtk_widget_ref (button12); gtk_object_set_data_full (GTK_OBJECT (Print_Dialog), "button12", button12, (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show (button12); - gtk_box_pack_start (GTK_BOX (vbox6), button12, FALSE, FALSE, 0); + gtk_box_pack_start (GTK_BOX (vbox9), button12, TRUE, FALSE, 5); - button13 = gtk_button_new_with_label (_("Preview")); - gtk_widget_ref (button13); - gtk_object_set_data_full (GTK_OBJECT (Print_Dialog), "button13", button13, + button17 = gtk_button_new_with_label (_("Select...")); + gtk_widget_ref (button17); + gtk_object_set_data_full (GTK_OBJECT (Print_Dialog), "button17", button17, (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (button13); - gtk_box_pack_start (GTK_BOX (vbox6), button13, FALSE, FALSE, 0); + gtk_widget_show (button17); + gtk_box_pack_start (GTK_BOX (vbox9), button17, FALSE, FALSE, 0); + + label694 = gtk_label_new (""); + gtk_widget_ref (label694); + gtk_object_set_data_full (GTK_OBJECT (Print_Dialog), "label694", label694, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (label694); + gtk_box_pack_start (GTK_BOX (vbox9), label694, FALSE, FALSE, 0); + + label698 = gtk_label_new (""); + gtk_widget_ref (label698); + gtk_object_set_data_full (GTK_OBJECT (Print_Dialog), "label698", label698, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (label698); + gtk_box_pack_start (GTK_BOX (vbox9), label698, FALSE, FALSE, 0); dialog_action_area4 = GNOME_DIALOG (Print_Dialog)->action_area; gtk_object_set_data (GTK_OBJECT (Print_Dialog), "dialog_action_area4", dialog_action_area4); @@ -795,7 +974,8 @@ create_Print_Dialog (void) gtk_button_box_set_layout (GTK_BUTTON_BOX (dialog_action_area4), GTK_BUTTONBOX_SPREAD); gtk_button_box_set_spacing (GTK_BUTTON_BOX (dialog_action_area4), 8); - gnome_dialog_append_button (GNOME_DIALOG (Print_Dialog), GNOME_STOCK_BUTTON_OK); + gnome_dialog_append_button_with_pixmap (GNOME_DIALOG (Print_Dialog), + _("Print"), GNOME_STOCK_PIXMAP_PRINT); button9 = g_list_last (GNOME_DIALOG (Print_Dialog)->buttons)->data; gtk_widget_ref (button9); gtk_object_set_data_full (GTK_OBJECT (Print_Dialog), "button9", button9, @@ -803,6 +983,14 @@ create_Print_Dialog (void) gtk_widget_show (button9); GTK_WIDGET_SET_FLAGS (button9, GTK_CAN_DEFAULT); + gnome_dialog_append_button (GNOME_DIALOG (Print_Dialog), _("Preview")); + button13 = g_list_last (GNOME_DIALOG (Print_Dialog)->buttons)->data; + gtk_widget_ref (button13); + gtk_object_set_data_full (GTK_OBJECT (Print_Dialog), "button13", button13, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (button13); + GTK_WIDGET_SET_FLAGS (button13, GTK_CAN_DEFAULT); + gnome_dialog_append_button (GNOME_DIALOG (Print_Dialog), GNOME_STOCK_BUTTON_CANCEL); button11 = g_list_last (GNOME_DIALOG (Print_Dialog)->buttons)->data; gtk_widget_ref (button11); @@ -814,12 +1002,15 @@ create_Print_Dialog (void) gtk_signal_connect (GTK_OBJECT (button12), "clicked", GTK_SIGNAL_FUNC (gnc_ui_print_dialog_select_printer_cb), Print_Dialog); - gtk_signal_connect (GTK_OBJECT (button13), "clicked", - GTK_SIGNAL_FUNC (gnc_ui_print_dialog_preview_cb), + gtk_signal_connect (GTK_OBJECT (button17), "clicked", + GTK_SIGNAL_FUNC (gnc_ui_print_dialog_select_paper_cb), Print_Dialog); gtk_signal_connect (GTK_OBJECT (button9), "clicked", GTK_SIGNAL_FUNC (gnc_ui_print_dialog_ok_cb), Print_Dialog); + gtk_signal_connect (GTK_OBJECT (button13), "clicked", + GTK_SIGNAL_FUNC (gnc_ui_print_dialog_preview_cb), + Print_Dialog); gtk_signal_connect (GTK_OBJECT (button11), "clicked", GTK_SIGNAL_FUNC (gnc_ui_print_dialog_cancel_cb), Print_Dialog); @@ -827,3 +1018,69 @@ create_Print_Dialog (void) return Print_Dialog; } +GtkWidget* +create_Paper_Size_Selector_Dialog (void) +{ + GtkWidget *Paper_Size_Selector_Dialog; + GtkWidget *dialog_vbox5; + GtkWidget *paperselector1; + GtkWidget *dialog_action_area5; + GtkWidget *button18; + GtkWidget *button19; + GtkWidget *button20; + + Paper_Size_Selector_Dialog = gnome_dialog_new (NULL, NULL); + gtk_object_set_data (GTK_OBJECT (Paper_Size_Selector_Dialog), "Paper_Size_Selector_Dialog", Paper_Size_Selector_Dialog); + gtk_window_set_policy (GTK_WINDOW (Paper_Size_Selector_Dialog), FALSE, FALSE, FALSE); + + dialog_vbox5 = GNOME_DIALOG (Paper_Size_Selector_Dialog)->vbox; + gtk_object_set_data (GTK_OBJECT (Paper_Size_Selector_Dialog), "dialog_vbox5", dialog_vbox5); + gtk_widget_show (dialog_vbox5); + + paperselector1 = gnome_paper_selector_new (); + gtk_widget_ref (paperselector1); + gtk_object_set_data_full (GTK_OBJECT (Paper_Size_Selector_Dialog), "paperselector1", paperselector1, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (paperselector1); + gtk_box_pack_start (GTK_BOX (dialog_vbox5), paperselector1, TRUE, TRUE, 0); + + dialog_action_area5 = GNOME_DIALOG (Paper_Size_Selector_Dialog)->action_area; + gtk_object_set_data (GTK_OBJECT (Paper_Size_Selector_Dialog), "dialog_action_area5", dialog_action_area5); + gtk_widget_show (dialog_action_area5); + gtk_button_box_set_layout (GTK_BUTTON_BOX (dialog_action_area5), GTK_BUTTONBOX_SPREAD); + gtk_button_box_set_spacing (GTK_BUTTON_BOX (dialog_action_area5), 8); + + gnome_dialog_append_button (GNOME_DIALOG (Paper_Size_Selector_Dialog), GNOME_STOCK_BUTTON_OK); + button18 = g_list_last (GNOME_DIALOG (Paper_Size_Selector_Dialog)->buttons)->data; + gtk_widget_ref (button18); + gtk_object_set_data_full (GTK_OBJECT (Paper_Size_Selector_Dialog), "button18", button18, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (button18); + GTK_WIDGET_SET_FLAGS (button18, GTK_CAN_DEFAULT); + + gnome_dialog_append_button (GNOME_DIALOG (Paper_Size_Selector_Dialog), GNOME_STOCK_BUTTON_APPLY); + button19 = g_list_last (GNOME_DIALOG (Paper_Size_Selector_Dialog)->buttons)->data; + gtk_widget_ref (button19); + gtk_object_set_data_full (GTK_OBJECT (Paper_Size_Selector_Dialog), "button19", button19, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (button19); + GTK_WIDGET_SET_FLAGS (button19, GTK_CAN_DEFAULT); + + gnome_dialog_append_button (GNOME_DIALOG (Paper_Size_Selector_Dialog), GNOME_STOCK_BUTTON_CANCEL); + button20 = g_list_last (GNOME_DIALOG (Paper_Size_Selector_Dialog)->buttons)->data; + gtk_widget_ref (button20); + gtk_object_set_data_full (GTK_OBJECT (Paper_Size_Selector_Dialog), "button20", button20, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (button20); + GTK_WIDGET_SET_FLAGS (button20, GTK_CAN_DEFAULT); + + gtk_signal_connect (GTK_OBJECT (button18), "clicked", + GTK_SIGNAL_FUNC (gnc_ui_paper_dialog_ok_cb), + Paper_Size_Selector_Dialog); + gtk_signal_connect (GTK_OBJECT (button20), "clicked", + GTK_SIGNAL_FUNC (gnc_ui_paper_dialog_cancel_cb), + Paper_Size_Selector_Dialog); + + return Paper_Size_Selector_Dialog; +} + diff --git a/src/gnome/glade-gnc-dialogs.h b/src/gnome/glade-gnc-dialogs.h index a82a888e62..e5b2cf6c5e 100644 --- a/src/gnome/glade-gnc-dialogs.h +++ b/src/gnome/glade-gnc-dialogs.h @@ -6,3 +6,4 @@ GtkWidget* create_QIF_File_Import_Dialog (void); GtkWidget* create_QIF_Import_Account_Picker (void); GtkWidget* create_Print_Preview_Dialog (void); GtkWidget* create_Print_Dialog (void); +GtkWidget* create_Paper_Size_Selector_Dialog (void); diff --git a/src/gnome/gnc-dialogs.glade b/src/gnome/gnc-dialogs.glade index 87be81fa9e..1a71305a48 100644 --- a/src/gnome/gnc-dialogs.glade +++ b/src/gnome/gnc-dialogs.glade @@ -1027,12 +1027,12 @@ Equity GnomeDialog Print Dialog - Print Check + Print Dialog GTK_WINDOW_TOPLEVEL GTK_WIN_POS_NONE False - False - False + True + True False False False @@ -1050,37 +1050,400 @@ Equity - GtkVBox - vbox6 - False - 0 + GtkFrame + frame4 + + 0 + GTK_SHADOW_ETCHED_IN 0 True True + + GtkHBox + hbox12 + False + 0 + + + GtkVBox + vbox7 + True + 0 + + 5 + True + True + + + + GtkLabel + label690 + + GTK_JUSTIFY_CENTER + False + 1 + 0.5 + 0 + 0 + + 5 + False + False + + + + + GtkLabel + label691 + + GTK_JUSTIFY_CENTER + False + 1 + 0.5 + 0 + 0 + + 0 + False + False + + + + + GtkLabel + label692 + + GTK_JUSTIFY_CENTER + False + 1 + 0.5 + 0 + 0 + + 0 + False + False + + + + + GtkLabel + label695 + + GTK_JUSTIFY_CENTER + False + 0.5 + 0.5 + 0 + 0 + + 0 + False + False + + + + + + GtkVBox + vbox8 + True + 0 + + 0 + True + True + + + + GtkEntry + printer_entry + True + False + True + 0 + + + 5 + False + False + + + + + GtkEntry + paper_entry + True + False + True + 0 + + + 0 + False + False + + + + + GtkHBox + hbox13 + False + 0 + + 0 + True + True + + + + GtkRadioButton + radiobutton1 + True + + False + True + + 0 + False + False + + + + + GtkRadioButton + radiobutton2 + True + + False + True + + 0 + False + False + + + + + GtkLabel + label693 + + GTK_JUSTIFY_CENTER + False + 0.5 + 0.5 + 0 + 0 + + 0 + False + False + + + + + + GtkHBox + hbox14 + False + 0 + + 0 + True + True + + + + GtkLabel + label696 + + GTK_JUSTIFY_CENTER + False + 0.5 + 0.5 + 0 + 0 + + 5 + False + False + + + + + GtkEntry + entry3 + 80 + True + True + True + 5 + + + 0 + False + False + + + + + GtkLabel + label697 + + GTK_JUSTIFY_CENTER + False + 0.5 + 0.5 + 0 + 0 + + 5 + False + False + + + + + GtkEntry + entry4 + 80 + True + True + True + 5 + + + 0 + False + False + + + + + + + GtkVBox + vbox9 + True + 0 + + 5 + True + True + + + + GtkButton + button12 + True + + clicked + gnc_ui_print_dialog_select_printer_cb + Print_Dialog + Wed, 22 Mar 2000 22:41:57 GMT + + + + 5 + True + False + + + + + GtkButton + button17 + True + + clicked + gnc_ui_print_dialog_select_paper_cb + Print_Dialog + Thu, 23 Mar 2000 18:45:59 GMT + + + + 0 + False + False + + + + + GtkLabel + label694 + + GTK_JUSTIFY_CENTER + False + 0.5 + 0.5 + 0 + 0 + + 0 + False + False + + + + + GtkLabel + label698 + + GTK_JUSTIFY_CENTER + False + 0.5 + 0.5 + 0 + 0 + + 0 + False + False + + + + + + + + GtkHButtonBox + GnomeDialog:action_area + dialog-action_area4 + GTK_BUTTONBOX_SPREAD + 8 + 85 + 27 + 7 + 0 + + 0 + False + True + GTK_PACK_END + + GtkButton - button12 + button9 + True True clicked - gnc_ui_print_dialog_select_printer_cb + gnc_ui_print_dialog_ok_cb Print_Dialog - Wed, 22 Mar 2000 22:41:57 GMT + Wed, 22 Mar 2000 22:42:13 GMT - - - 0 - False - False - + + GNOME_STOCK_PIXMAP_PRINT GtkButton button13 + True True clicked @@ -1089,18 +1452,63 @@ Equity Wed, 22 Mar 2000 22:42:05 GMT - - 0 - False - False - + + + + GtkButton + button11 + True + True + + clicked + gnc_ui_print_dialog_cancel_cb + Print_Dialog + Wed, 22 Mar 2000 22:42:20 GMT + + GNOME_STOCK_BUTTON_CANCEL + + + + + GnomeDialog + Paper Size Selector Dialog + GTK_WINDOW_TOPLEVEL + GTK_WIN_POS_NONE + False + False + False + False + False + False + + + GtkVBox + GnomeDialog:vbox + dialog-vbox5 + False + 8 + + 4 + True + True + + + + GnomePaperSelector + paperselector1 + + 0 + True + True + + GtkHButtonBox GnomeDialog:action_area - dialog-action_area4 + dialog-action_area5 GTK_BUTTONBOX_SPREAD 8 85 @@ -1116,28 +1524,36 @@ Equity GtkButton - button9 + button18 True True clicked - gnc_ui_print_dialog_ok_cb - Print_Dialog - Wed, 22 Mar 2000 22:42:13 GMT + gnc_ui_paper_dialog_ok_cb + Paper_Size_Selector_Dialog + Thu, 23 Mar 2000 18:55:42 GMT GNOME_STOCK_BUTTON_OK GtkButton - button11 + button19 + True + True + GNOME_STOCK_BUTTON_APPLY + + + + GtkButton + button20 True True clicked - gnc_ui_print_dialog_cancel_cb - Print_Dialog - Wed, 22 Mar 2000 22:42:20 GMT + gnc_ui_paper_dialog_cancel_cb + Paper_Size_Selector_Dialog + Thu, 23 Mar 2000 18:55:14 GMT GNOME_STOCK_BUTTON_CANCEL diff --git a/src/gnome/print-session.c b/src/gnome/print-session.c index 6a4ed05ee9..b2d1f80ca0 100644 --- a/src/gnome/print-session.c +++ b/src/gnome/print-session.c @@ -17,11 +17,15 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * \********************************************************************/ +#define _GNU_SOURCE + #include "config.h" +#include #include #include "print-session.h" +#include "ui-callbacks.h" #ifdef HAVE_LIBGNOMEPRINT @@ -33,7 +37,8 @@ gnc_ui_print_preview_create(PrintSession * ps) { "preview_canvas"); ppd->session = ps; ppd->pc = - gnome_print_preview_new (GNOME_CANVAS(ppd->canvas), "US-Letter"); + gnome_print_preview_new (GNOME_CANVAS(ppd->canvas), + ps->paper); gtk_object_set_data(GTK_OBJECT(ppd->toplevel), "print_preview_struct", ppd); @@ -70,17 +75,75 @@ gnc_ui_print_preview_destroy(PrintPreviewDialog * ppd) { PrintDialog * gnc_ui_print_dialog_create(PrintSession * ps) { PrintDialog * pcd = g_new0(PrintDialog, 1); + char * printer_string; + pcd->toplevel = create_Print_Dialog(); pcd->session = ps; + pcd->paper_entry = gtk_object_get_data(GTK_OBJECT(pcd->toplevel), + "paper_entry"); + + pcd->printer_entry = gtk_object_get_data(GTK_OBJECT(pcd->toplevel), + "printer_entry"); + gtk_object_set_data(GTK_OBJECT(pcd->toplevel), "print_struct", pcd); + if(ps->printer->driver) { + if(ps->printer->filename) { + asprintf(&printer_string, "(%s) %s", + ps->printer->driver, ps->printer->filename); + } + else { + printer_string = ps->printer->driver; + } + } + else { + printer_string = "(none)"; + } + + gtk_entry_set_text(GTK_ENTRY(pcd->paper_entry), ps->paper); + gtk_entry_set_text(GTK_ENTRY(pcd->printer_entry), printer_string); gtk_widget_show_all(pcd->toplevel); return pcd; } +void +gnc_ui_paper_dialog_cancel_cb(GtkWidget * widg, gpointer user_data) { + gtk_object_set_data(GTK_OBJECT(user_data), "quit-cause", + GINT_TO_POINTER(0)); + gtk_main_quit(); +} + +void +gnc_ui_paper_dialog_ok_cb(GtkWidget * widg, gpointer user_data) { + gtk_object_set_data(GTK_OBJECT(user_data), "quit-cause", + GINT_TO_POINTER(1)); + gtk_main_quit(); +} + + +char * +gnc_ui_paper_dialog_new_modal() { + GtkWidget * dialog = create_Paper_Size_Selector_Dialog(); + GtkWidget * papersel = gtk_object_get_data(GTK_OBJECT(dialog), + "paperselector1"); + char * newpaper = NULL; + + gtk_window_set_modal(GTK_WINDOW(dialog), TRUE); + gtk_widget_show_all(dialog); + gtk_main(); + + if(GPOINTER_TO_INT(gtk_object_get_data(GTK_OBJECT(dialog), "quit-cause"))) { + newpaper = strdup(gnome_paper_selector_get_name + (GNOME_PAPER_SELECTOR(papersel))); + } + gtk_widget_destroy(dialog); + + return newpaper; +} + void gnc_ui_print_dialog_destroy(PrintDialog * pcd) { @@ -92,11 +155,50 @@ gnc_ui_print_dialog_destroy(PrintDialog * pcd) { void gnc_ui_print_dialog_select_printer_cb(GtkWidget * widget, gpointer user_data) { - PrintDialog * pcd; + PrintDialog * pcd; + GnomePrinter * printer; + char * printer_string; + if(user_data) { pcd = gtk_object_get_data(GTK_OBJECT(user_data), "print_struct"); - pcd->session->printer = + printer = gnome_printer_dialog_new_modal(); + + if(printer) { + pcd->session->printer = printer; + + if(pcd->session->printer->driver) { + if(pcd->session->printer->filename) { + asprintf(&printer_string, "(%s) %s", + pcd->session->printer->driver, + pcd->session->printer->filename); + } + else { + printer_string = pcd->session->printer->driver; + } + } + else { + printer_string = "(none)"; + } + + gtk_entry_set_text(GTK_ENTRY(pcd->printer_entry), printer_string); + } + } +} + +void +gnc_ui_print_dialog_select_paper_cb(GtkWidget * widget, gpointer user_data) { + PrintDialog * pcd; + char * paper; + + if(user_data) { + pcd = gtk_object_get_data(GTK_OBJECT(user_data), "print_struct"); + paper = + gnc_ui_paper_dialog_new_modal(); + if(paper) { + pcd->session->paper = paper; + gtk_entry_set_text(GTK_ENTRY(pcd->paper_entry), pcd->session->paper); + } } } @@ -139,8 +241,10 @@ gnc_print_session_create() { /* this is about the most basic we can get */ ps->meta = gnome_print_meta_new(); - ps->default_font = gnome_font_new("Courier", 13); - + ps->default_font = gnome_font_new("Courier", 12); + ps->printer = gnome_printer_new_generic_ps("gnucash-output.ps"); + ps->paper = g_strdup(gnome_paper_name_default()); + gnome_print_setrgbcolor(GNOME_PRINT_CONTEXT(ps->meta), 0.0, 0.0, 0.0); gnome_print_setfont(GNOME_PRINT_CONTEXT(ps->meta), @@ -153,6 +257,7 @@ void gnc_print_session_destroy(PrintSession * ps) { gtk_object_unref(GTK_OBJECT(ps->meta)); gtk_object_unref(GTK_OBJECT(ps->default_font)); + g_free(ps->paper); g_free(ps); } diff --git a/src/gnome/print-session.h b/src/gnome/print-session.h index b3a0012b8b..e357fcef66 100644 --- a/src/gnome/print-session.h +++ b/src/gnome/print-session.h @@ -40,6 +40,7 @@ typedef struct { GnomePrintMeta * meta; GnomePrinter * printer; GnomeFont * default_font; + char * paper; } PrintSession; typedef struct { @@ -51,6 +52,8 @@ typedef struct { typedef struct { GtkWidget * toplevel; + GtkWidget * printer_entry; + GtkWidget * paper_entry; PrintSession * session; } PrintDialog; @@ -63,6 +66,12 @@ typedef int PrintDialog; #endif +/* paper selector dialog */ +void gnc_ui_paper_dialog_cancel_cb(GtkWidget * widg, gpointer user_data); +void gnc_ui_paper_dialog_ok_cb(GtkWidget * widg, gpointer user_data); +char * gnc_ui_paper_dialog_new_modal(); + + /* print preview dialog stuff */ PrintPreviewDialog * gnc_ui_print_preview_create(PrintSession * ps); void gnc_ui_print_preview_OK_cb(GtkWidget * widget, gpointer user_data); @@ -74,6 +83,8 @@ void gnc_ui_print_dialog_destroy(PrintDialog * pcd); void gnc_ui_print_dialog_select_printer_cb(GtkWidget * widget, gpointer user_data); +void gnc_ui_print_dialog_select_paper_cb(GtkWidget * widget, + gpointer user_data); void gnc_ui_print_dialog_preview_cb(GtkWidget * widget, gpointer user_data); void gnc_ui_print_dialog_ok_cb(GtkWidget * widget, gpointer user_data); void gnc_ui_print_dialog_cancel_cb(GtkWidget * widget, gpointer user_data); diff --git a/src/scm/printing/print-check.scm b/src/scm/printing/print-check.scm index 3402145a9a..d1d26e793d 100644 --- a/src/scm/printing/print-check.scm +++ b/src/scm/printing/print-check.scm @@ -14,11 +14,11 @@ ;; text origin, (0,0) at lower left of page, in inches, for ;; US-Letter format paper. (define quicken-check-3up-at-top-us-letter - '((payee . (1.0625 9.625)) - (amount-words . (1.0625 9.325)) - (amount-number . (6.5 9.625)) - (date . (6.5 10.1)) - (memo . (1.0625 8.15)))) + '((payee . (1.25 9.5625)) + (amount-words . (1.25 9.1875)) + (amount-number . (7.0 9.625)) + (date . (7.0 10.0625)) + (memo . (0.75 8.0625)))) (define (gnc:print-check payee amount date memo) (let* ((int-part (inexact->exact (truncate amount))) diff --git a/src/scm/qif-import/qif-objects.scm b/src/scm/qif-import/qif-objects.scm index 9f070bd889..997f51ef6f 100644 --- a/src/scm/qif-import/qif-objects.scm +++ b/src/scm/qif-import/qif-objects.scm @@ -142,7 +142,7 @@ (define (make-simple-class 'qif-split - '(category class memo amount category-is-account? mark))) + '(category class memo amount category-is-account? matching-cleared mark))) (define (qif-split:category self) (simple-obj-getter self 'category)) @@ -183,6 +183,12 @@ (define (qif-split:set-mark! self value) (simple-obj-setter self 'mark value)) +(define (qif-split:matching-cleared self) + (simple-obj-getter self 'matching-cleared)) + +(define (qif-split:set-matching-cleared! self value) + (simple-obj-setter self 'matching-cleared value)) + (define (qif-split:category-is-account? self) (simple-obj-getter self 'category-is-account?)) diff --git a/src/scm/qif-import/qif-to-gnc.scm b/src/scm/qif-import/qif-to-gnc.scm index 72a1f4767a..128045b302 100644 --- a/src/scm/qif-import/qif-to-gnc.scm +++ b/src/scm/qif-import/qif-to-gnc.scm @@ -286,11 +286,10 @@ (qif-split:memo (car (qif-xtn:splits qif-xtn))))) (let ((cleared (qif-xtn:cleared qif-xtn))) - (cond ((eq? 'cleared cleared) - (gnc:split-set-reconcile gnc-near-split #\c)) - ((eq? 'reconciled cleared) - (gnc:split-set-reconcile gnc-near-split #\r)))) - + (if (or + (eq? 'cleared cleared) + (eq? 'reconciled cleared)) + (gnc:split-set-reconcile gnc-near-split #\c))) ;; iterate over QIF splits (for-each @@ -375,12 +374,13 @@ (list-ref far-acct-info 1)) (set! far-acct (hash-ref gnc-acct-hash far-acct-name)))) - ;; set the reconcile status - (let ((cleared (qif-xtn:cleared qif-xtn))) - (cond ((eq? 'cleared cleared) - (gnc:split-set-reconcile gnc-far-split #\c)) - ((eq? 'reconciled cleared) - (gnc:split-set-reconcile gnc-far-split #\r)))) + ;; set the reconcile status. I thought I could set using + ;; the quicken type, but it looks like #\r reconcile + ;; states aren't preserved across gnucash save/restores. + (let ((cleared (qif-split:matching-cleared qif-split))) + (if (or (eq? 'cleared cleared) + (eq? 'reconciled cleared)) + (gnc:split-set-reconcile gnc-far-split #\c))) ;; finally, plug the splits into the accounts (gnc:transaction-append-split gnc-xtn gnc-far-split) @@ -405,11 +405,13 @@ (lambda (split) (if (not (qif-split:mark split)) (if (qif-split:category-is-account? split) - (begin + (begin (qif-split:set-mark! split #t) - (qif-import:mark-matching-split split xtn qif-file qif-files)) - (qif-split:set-mark! split #t)))) - (qif-xtn:splits xtn)) + (qif-split:set-matching-cleared! + split + (qif-import:mark-matching-split split xtn qif-file qif-files)) + (qif-split:set-mark! split #t))))) + (qif-xtn:splits xtn)) (qif-xtn:set-mark! xtn #t)) (define (qif-import:mark-matching-split split xtn qif-file qif-files) @@ -419,6 +421,7 @@ (amount (- (qif-split:amount split))) (memo (qif-split:memo split)) (bank-xtn? (qif-xtn:bank-xtn? xtn)) + (cleared? #f) (done #f)) (if bank-xtn? @@ -450,6 +453,7 @@ (begin ;;; (display "found ")(write (car splits))(newline) (qif-split:set-mark! (car splits) #t) + (set! cleared? (qif-xtn:cleared (car xtns))) (set! done #t) (let ((all-marked #t)) (for-each @@ -466,7 +470,8 @@ (xtn-loop (cdr xtns))))) (if (and (not done) (not (null? (cdr files)))) - (file-loop (cdr files)))))) + (file-loop (cdr files)))) + cleared?))