Commit Graph

119 Commits

Author SHA1 Message Date
Benjamin Otte
9e91b6557a cups: Add hack to work around gcc warning
gcc warns if you switch on values that are not part of the enum you're
switching on. So handle those cases in the default handler by using if
statments.

PS: Someone file a bug against cups about this?
2010-11-18 17:45:14 +01:00
Marek Kasik
5045337162 Parse lpoptions correctly
Parse options job-sheets, job-hold-until and sides correctly.
Add get_lpoption_name() for translation of lpoption names to
gtk option names. Usable for options which values don't need
conversion (e.g. number-up, number-up-layout, job-billing
and job-priority).
Rename array option_names to ppd_option_names to reflect its
purpose better. Rename get_option_name() to get_ppd_option_name()
because of the same reason.
(cherry picked from commit 95e69afea8)
2010-10-16 01:11:44 -04:00
Philip Withnall
818ef9aaf6 Miscellaneous string fixes
Mostly capitalisation fixes. Closes: bgo#528257
2010-08-29 19:05:26 +01:00
Benjamin Otte
53cf3d2edc cups: Fix cast warnings 2010-08-07 15:35:50 +02:00
Benjamin Otte
fafc457a01 cups: Fix cast warnings 2010-07-26 11:58:23 +02:00
Marek Kasik
c1c3670711 Don't handle CUPS' "connecting-to-device" state reason
CUPS backend shouldn't handle "connecting-to-device" state reason.
It shows "Printer '%s' may not be connected" for this state,
which is not true in almost all cases. Better is to use
"printer-state-message" which contains correct message (#622011).
(cherry picked from commit 998459afb7)
2010-06-26 14:24:34 -04:00
Marek Kasik
52c7ad6de3 Test connection to all given addresses when printing
Go to the next address given by CUPS if we fail to connect to
previous address (#603637).
(cherry picked from commit f8ac123192)
2010-06-10 09:50:59 -04:00
Colin Walters
c8262d39fa Use g_source_set_name for all custom GSources in GTK+
Naming the sources allows easier debugging with e.g. SystemTap
probes.

https://bugzilla.gnome.org/show_bug.cgi?id=620511
2010-06-03 21:32:06 -04:00
Marek Kasik
45a83fdbeb Honor PPD reading over listing of printers
Reading of PPD files collides with getting list of printers.
It helps to give higher priority to getting of PPDs than to
getting list of printers (#614581).
2010-05-24 16:54:34 +02:00
Marek Kasik
59e5e2dd5b Define httpGetHostname() for CUPS 1.1 and lower
Function httpGetHostname() is in CUPS since version 1.2, that is why we need
its equivalent for lower versions of CUPS (#610176).
2010-03-17 10:14:24 +01:00
Christian Persch
efa90e4182 Allow getting the printer's hard margins
Adds a way to get the unprintable area of the printer. Bug #468989.
2009-12-01 17:39:01 +01:00
Nicola Fontana
1e1131c959 Do not use static GTypeInfo and GInterfaceInfo
Either g_type_register_static_simple (used by G_DEFINE_TYPE_EXTENDED)
and G_IMPLEMENT_INTERFACE use automatic variables for GTypeInfo and
GInterfaceInfo structs, while tutorials and source code often use
static variables. This commit consistently adopts the former method.

https://bugzilla.gnome.org/show_bug.cgi?id=600158
2009-11-06 01:21:09 +01:00
Marek Kasik
50e784c405 Rotate number-up layout according to orientation when printing
Number-up layout has to be rotated differently since rotation in
"landscape" and "reversed landscape" mode was changed.
2009-10-27 16:53:43 +01:00
Marek Kasik
dd52987d1f Speed up printer listing in the print dialog
Use shorter timeout for connection testing to avoid A 3-6 second
delay before the printers appear. Bug 594643
2009-09-30 12:43:40 -04:00
Marek Kasik
a3e0766218 Add support for 'auth-info' attribute to the CUPS backend
Check for 'auth-info-required' attribute from printer attributes to
find out whether an authentization of user is needed.
Change password dialog of print backend to be able to require informations
requested thru 'auth-info-required' (#566522).
2009-09-24 15:34:56 +02:00
Marek Kasik
5f4915f624 Don't hang print dialog when remote CUPS printer is not available
This patch tests availability of remote host before getting ppd file
for selected printer (#586207). It also adds a state message for
failure of getting details.
2009-09-23 14:35:26 +02:00
Matthias Clasen
13147323d7 Forgotten part of the lpi change 2009-08-30 11:11:46 -04:00
Marek Kasik
3b336186ee Add CUPS events as soon as possible when printing
CUPS events are added in prepare part of the main loop. These
events are initialized before their addition (#434318, #586466).
2009-08-29 21:32:01 -04:00
Marek Kasik
3dc377a2ca Correctly select default printer when there is more than one (CUPS)
Select a local default printer if there is one instead of a remote
default printer (specified by the "printer-type" CUPS attribute)
(#591549).
2009-08-18 13:22:23 +02:00
Marek Kasik
94bc87c637 Get default cover sheets from each printer separately
Fixes bug #590309.
Add default_cover_before string and default_cover_after string
to GtkPrinterCups and fill it when getting list of printers.
2009-08-05 10:34:27 +02:00
Marek Kasik
961ab2e5c1 Print in correct order when printing 4 pages per sheet to landscape
Rotates page layout according to selected paper orientation
when printing through CUPS backend (#420335).
2009-06-04 18:49:29 +02:00
mark@ecs.vuw.ac.nz
1eff9aba24 Signalize that CUPS connection is available when EISCONN occurs
Add test for EISCONN error when testing whether a connection to CUPS server
is available (#576678 - patch by mark@ecs.vuw.ac.nz).

Signed-off-by: Marek Kasik <mkasik@redhat.com>
2009-05-19 16:08:21 +02:00
Marek Kasik
91190ce281 Add ability to print in number-up mode for file backend and lpr backend
GtkPrintOperation is now able to render multiple pages per sheet by its
own. The most important changes are in these functions:
  * increment_page_sequence
  * prepare_data
  * common_render_page
  * print_pages_idle
Patch also changes set of choices for 2 pages per sheet mode when
landscape orientation is used to "Top to bottom" and "Bottom to top".
2009-05-13 18:28:42 +02:00
Behdad Esfahbod
a398c840be Add git.mk to generate .gitignore files
Add four new doc templates that were not in repository.
2009-05-04 14:29:21 -04:00
Marek Kasik
2c5ae21cdc Adds authentication support of CUPS backend
Adds authentication support of CUPS backend against CUPS server.
Print dialog is now capable to ask user for password and pass it
to the CUPS server. It is also possible to authenticate user
through Kerberos (GSS-API) (#384940).
2009-04-21 14:24:32 +02:00
Marek Kasik
84125f1325 Bug 568571 – Asian am/pm format on cups print backend's time parsing
2009-02-12  Marek Kasik  <mkasik@redhat.com>

	Bug 568571 – Asian am/pm format on cups print backend's time parsing

	* modules/printbackends/cups/gtkprintbackendcups.c: Add Asian am/pm
	format into formats recognized by CUPS backend

svn path=/trunk/; revision=22319
2009-02-12 12:12:30 +00:00
Takao Fujiwara
16c207c27f Bug 571015 libprintbackend-cups has unlocalized strings
2009-02-10  Takao Fujiwara  <takao.fujiwara@sun.com>

	Bug 571015  libprintbackend-cups has unlocalized strings

	* modules/printbackends/cups/gtkprintbackendcups.c:
	Added a translator comment with the request of translators.


svn path=/trunk/; revision=22304
2009-02-10 17:32:47 +00:00
Takao Fujiwara
a4a9790285 Bug 571015 libprintbackend-cups has unlocalized strings
2009-02-09  Takao Fujiwara  <takao.fujiwara@sun.com>

	Bug 571015  libprintbackend-cups has unlocalized strings

	Reviewed by Matthias Clasen  <mclasen@redhat.com>

	* modules/printbackends/cups/gtkprintbackendcups.c (handle_option):
	Add translatable strings from ppd files.


svn path=/trunk/; revision=22294
2009-02-09 05:39:37 +00:00
Marek Kasik
6dbb29a5d4 Bug 561801 - "scheduled printing" doesn't function as expected
2009-01-21  Marek Kasik  <mkasik@redhat.com>
	Bug 561801 - "scheduled printing" doesn't function as expected

	* gtk/gtkprintunixdialog: Add tooltip.
	* modules/printbackends/cups/gtkprintbackendcups.c: Add conversion
	  from local time to utc time for scheduled printing.

svn path=/trunk/; revision=22158
2009-01-21 15:03:14 +00:00
Marek Kasik
a3b07ac981 Bug 339714 - Set printer dpi on cairo ps/pdf surfaces when printing
2008-10-30  Marek Kasik  <mkasik@redhat.com>

	Bug 339714 - Set printer dpi on cairo ps/pdf surfaces when printing

	* gtk/gtk.symbols
	* gtk/gtkprintsettings.c
	* gtk/gtkprintsettings.h
	* docs/reference/gtk/gtk-sections.txt
	* modules/printbackends/file/gtkprintbackendfile.c
	* modules/printbackends/test/gtkprintbackendtest.c
	* modules/printbackends/cups/gtkprintbackendcups.c
	* modules/printbackends/lpr/gtkprintbackendlpr.c:
	Added lpi (lines per inch) setting to GtkPrintSettings and support
	for anamorphic dpi. Surface fallback resolution is set to 2*lpi.

svn path=/trunk/; revision=21733
2008-10-30 16:24:27 +00:00
Matthias Clasen
8ec27f7760 Bug 346903 – gtk_enumerate_printers needs events to complete
2008-09-17  Matthias Clasen  <mclasen@redhat.com>

        Bug 346903 – gtk_enumerate_printers needs events to complete

        * gtk/gtkprintbackend.h:
        * gtk/gtkprintbackend.c: Add a GtkPrintBackend::status property.

        * modules/printbackends/cups/gtkcupsutils.h:
        * modules/printbackends/cups/gtkcupsutils.c: Turn the connection
        test into a tristate available/unavailable/in progress.

        * modules/printbackends/cups/gtkprintbackendcups.c: Use a single
        connection test instance for getting the default printer and for
        getting the printer list. Set the GtkPrintBackend::status property
        according to the result of the connection test. Use the printer-type
        attribute to find the default printer, if cups supports it.

        * gtk/gtkprinter.c: When enumerating printers, give up when
        the backend status is 'unavailable'.

        * gtk/gtkprintunixdialog.c (printer_status_cb): Select the printer
        when it is the default and nothing else has been selected yet.


svn path=/trunk/; revision=21417
2008-09-17 22:07:10 +00:00
Marek Kasik
7c56db21d8 Bug 551378 - Print dialog: should try UDS when fetching PPD for localhost
2008-09-11  Marek Kasik  <mkasik@redhat.com>

	Bug 551378 - Print dialog: should try UDS when fetching PPD for
	localhost

	* modules/printbackends/cups/gtkprintbackendcups.c: Add ability
	to get PPD file from CUPS through Unix domain socket

svn path=/trunk/; revision=21345
2008-09-11 08:47:56 +00:00
Matthias Clasen
bcfd615759 Improve one string
svn path=/trunk/; revision=21212
2008-08-27 19:22:26 +00:00
Matthias Clasen
9278d262ac Use gdk_threads_add_timeout_seconds where appropriate
svn path=/trunk/; revision=21202
2008-08-26 02:39:12 +00:00
Matthias Clasen
7b84657f42 Add translator hints to many strings
svn path=/trunk/; revision=21200
2008-08-25 21:46:58 +00:00
Marek Kasik
6e7941db6d Bug 535158 – can't rearrange the order of multi pages per side
2008-08-21  Marek Kasik  <mkasik@redhat.com>

	Bug 535158 – can't rearrange the order of multi pages per side

	* gtk/gtkprinter.c
	* gtk/gtkprinter.h
	* gtk/gtkprintunixdialog.c
	* gtk/gtkprintsettings.c
	* gtk/gtkprintsettings.h
	* gtk/gtkenums.h
	* modules/printbackends/cups/gtkprintbackendcups.c: Allow user to
	specify layout of pages per sheet in number-up mode

svn path=/trunk/; revision=21175
2008-08-21 10:25:27 +00:00
Matthias Clasen
a50b2ee48f Add translator hints
svn path=/trunk/; revision=21113
2008-08-14 03:12:58 +00:00
Matthias Clasen
6f789132c5 Fix build with old cups
svn path=/trunk/; revision=21079
2008-08-11 19:59:50 +00:00
Michael Natterer
8fda215cc0 remove return value, this function returns void.
2008-08-06  Michael Natterer  <mitch@imendio.com>

	* modules/printbackends/cups/gtkcupsutils.c
	(gtk_cups_connection_test_free): remove return value, this
	function returns void.


svn path=/trunk/; revision=21022
2008-08-06 11:59:35 +00:00
Matthias Clasen
e9d978dff9 Bug 424207 – printing hangs on unreachable cups server
svn path=/trunk/; revision=20923
2008-07-31 23:56:17 +00:00
Sebastien Bacher
862fde72de don't try free gettext() values,
fix a printing dialog crasher (bug 544390)

svn path=/trunk/; revision=20904
2008-07-24 12:56:59 +00:00
Andre Klapper
4346194869 Bug 543915 - translation issues
2008-07-20  Andre Klapper  <a9016009@gmx.de>

	Bug 543915 - translation issues

	* modules/printbackends/cups/gtkprintbackendcups.c:
	Add translator comments for several strings.


svn path=/trunk/; revision=20872
2008-07-20 22:03:32 +00:00
Matthias Clasen
cf68d46c64 Add a forgotten hunk
svn path=/trunk/; revision=20861
2008-07-18 15:51:06 +00:00
Matthias Clasen
4946240780 Bug 339591 – Detect list of availible cover pages
Patch by Marek Kasik:
        * modules/printbackends/cups/gtkprintbackendcups.c: Get the list of
        available cover pages and the default front and back cover pages
        from the cups server.


svn path=/trunk/; revision=20839
2008-07-15 17:45:18 +00:00
Matthias Clasen
1eb96eadfc Bug 384940 – handle rejecting jobs and authentication meaningfully
Patch by Marek Kasik, icons by Mike Langlie:
        * gtk/gtk.symbols:
        * gtk/gtkprintbackend.h:
        * gtk/gtkprinter.[hc]: Add new paused and accepting-jobs properties
        and getters/setters.

        * gtk/gtkstock.h:
        * gtk/gtkiconfactory.c:
        * gtk/Makefile.am:
        * gtk/stock-icons/{16,24}/gtk-print-paused.{png,svg}: New icon.

        * modules/printbackends/cups/gtkprintbackendcups.c:
        * gtk/gtkprintunixdialog.c: Handle paused and job-rejecting
        printers.


svn path=/trunk/; revision=20838
2008-07-15 17:34:34 +00:00
Cody Russell
57223c9a05 Revert name change
svn path=/trunk/; revision=20724
2008-07-01 22:57:50 +00:00
Cody Russell
fce9c8b7d4 Practically everything changed.
2008-06-30  Cody Russell  <bratsche@gnome.org>

        * Practically everything changed.

        Change	all references	of GIMP	Toolkit	(and variations	of it)
        to GTK+	Toolkit, showing no mercy at all to our	beloved
	ancestry. (#540529)


svn path=/trunk/; revision=20709
2008-06-30 23:01:56 +00:00
Johan Dahlin
d97cdbdf53 Include "config.h" instead of <config.h> Command used: find -name
2008-06-21  Johan Dahlin  <jdahlin@async.com.br>

    * *.[ch]: Include "config.h" instead of <config.h>
    Command used:
    find -name \*.[ch]|xargs perl -p -i -e 's/^#include <config.h>/#include "config.h"/g'
    Rubberstamped by Mitch and Tim


svn path=/trunk/; revision=20669
2008-06-22 14:28:52 +00:00
Matthias Clasen
e242d89ed3 Really fix printer URI construction
svn path=/trunk/; revision=20360
2008-06-12 13:03:35 +00:00
Michael Natterer
c8e67f3cc6 gtk/Makefile.am add a single-include header for the unix print stuff.
2008-05-29  Michael Natterer  <mitch@imendio.org>

	* gtk/Makefile.am
	* gtk/gtkunixprint.h: add a single-include header for the unix
	print stuff.

	* gtk/gtkpagesetupunixdialog.h
	* gtk/gtkprinter.h
	* gtk/gtkprintjob.h
	* gtk/gtkprintunixdialog.h: add single-include guards that #error
	out if GTK_DISABLE_SINGLE_INCLUDES is defined and any of these
	files is included individually.

	* gtk/gtkprintbackend.h
	* gtk/gtkprinter-private.h
	* modules/printbackends/cups/gtkprintbackendcups.c
	* modules/printbackends/cups/gtkprintercups.h
	* modules/printbackends/lpr/gtkprintbackendlpr.c
	* tests/buildertest.c
	* tests/defaultvaluetest.c
	* docs/tools/widgets.c: include <gtk/gtkunixprint.h> instead of
	individual files.


svn path=/trunk/; revision=20230
2008-05-29 09:34:53 +00:00