Commit Graph

136 Commits

Author SHA1 Message Date
Jan Rękorajski
f807f7834f print dialog: Fix authentication logic
Reset state of CUPS requests correctly during authentization and
check CUPS requests for errors.
Don't initialize variables holding password and username with empty
string (#664640).
2011-12-14 14:09:48 +01:00
Benjamin Berg
94782e914c Fix polling for new data in cups print backend (bug #599664) 2011-08-06 10:37:21 +02:00
Javier Jardón
32e00d1f43 Use AM_CPPFLAGS instead the obsolete INCLUDES 2011-07-06 15:58:32 +01:00
Benjamin Otte
0bfb663d0c cups: Fix unused variable warning when not using colord 2011-06-10 15:01:04 +02:00
Richard Hughes
9bff51e538 Add optional colord support to the CUPS print module
This functionality adds a new 'Printer Profile' entry to the 'Color' page in the
UNIX print dialog if colord support is enabled.

This shows the user what color profile will be used for the settings they have
selected, and if no profile or the default profile is going to be used.

We are deliberately not allowing the user to _change_ the selected profile, as
the ICC profile is an implementation detail, and we should not change the other
print settings based on the characterization state.

The OpenICC group broadly recommend showing the profile that is used, so that
power users can be sure the correct profile is being used at the right time.

Normal users won't care, as they don't know how horrible the color match is
without profiling the printer and media.
2011-06-09 18:31:02 +01:00
Marek Kasik
9a0700e20c Check whether a resolution has been set in GtkPrintSettings
If resolution has not been set then use default resolution from ppd.

https://bugzilla.gnome.org/show_bug.cgi?id=635254
2011-03-21 11:11:09 -04:00
Matthias Clasen
524ce69bcb Bump the version to 3.0.0
At the same time, change the library sonames for -3.0 to just -3.
This is necessary since the 2.99 releases installed libraries like
libgtk-3.0.so.0.9903.0, and we want to prevent the library version
number from jumping back. So 3.0 will have libgtk-3.so.0.0.0.
2011-02-10 14:41:02 -05:00
Matthias Clasen
645650ae24 Silence unused variable warnings in the cups printbackend 2011-01-30 02:16:18 -05:00
Benjamin Otte
d1ecd28695 cups: Someone can neither type, read compiler output and run tests.
Being able to do one of these would have caught this.
2011-01-03 16:25:18 +01:00
Matthias Clasen
7537907baf cups printbackend: create a pdf surface when appropriate
This should address bug 560177.
Based on a patch by Adrian Johnson.
2011-01-03 09:34:04 -05:00
Adrian Johnson
856cc65f63 Set "accepts-pdf" property to true only if supported by the print backend 2011-01-03 08:14:34 -05:00
Matthias Clasen
07d49ee56a Merge libgdk and libgtk
This commit does a number of things:
- remove some dead wchar configury from configure.ac and gdkconfig.h
- repurpose gdkconfig.h as header that contains GDK_WINDOWING_foo
  macros for each included backend, include it in gdk.h and install
  it in $includedir instead of below $libdir
- drop the backend from the library names
- build libgdk-3.0.la as a convenience lib and include it in libgtk-3.0.la
It does not yet enable building multiple backends at the same time.
2010-12-21 12:06:55 -05:00
Matthias Clasen
8105125369 Remove sealed members from GtkPrintJob
Also add accessors for these members, and use them in print backends.
2010-12-18 17:45:31 -05:00
Benjamin Otte
9e31ef616d 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-10-18 19:22:44 +02:00
Marek Kasik
95e69afea8 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.
2010-10-15 17:01:16 -04:00
Christian Dywan
e9a7a2104b Use and print note for key only if there are credentials
Otherwise key might be printed uninitialized.
2010-10-08 16:03:49 +02:00
Benjamin Otte
efefc4e794 cups: Fix compile warnings with --enable-debug 2010-09-27 20:48:43 +02:00
Tor Lillqvist
801875b805 Replace gtk_debug_flags with getter and setter functions
Preferrably should be made just into a local variable for libgtk like
_gdk_debug_flags for libgdk. But for now used by
gtk/tests/textbuffer.c and modules/printbackends/cups/gtkprintbackendcups.c.
2010-09-08 21:31:34 +03:00
Philip Withnall
5fa4a05ccc Miscellaneous string fixes
Mostly capitalisation fixes. Closes: bgo#528257
2010-08-22 15:06:45 +01:00
Matthias Clasen
0cb1f9a180 Make print backends use standard icon names for printers
This is to make the print dialog work with the previous commit.
See bug 626474.
2010-08-18 18:27:39 -04:00
Benjamin Otte
c90ba0a3be cups: Fix cast warnings 2010-07-26 16:42:46 +02:00
Marek Kasik
998459afb7 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).
2010-06-24 09:27:16 +02:00
Colin Walters
95bc0f5405 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:49:22 -04:00
Marek Kasik
f8ac123192 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).
2010-06-03 10:13:17 +02:00
Marek Kasik
33097d65b7 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:39:19 +02:00
Matthias Clasen
7447ef0fc2 Make 3.0 parallel-installable to 2.x
In particular, rename

  - libraries to lib*-3.0.so
  - pc files to *-3.0.pc
  - include paths to /usr/include/gtk-3.0/*
  - module paths to /usr/lib/gtk-3.0/*
  - rc files names to gtk-3.0/gtkrc
  - commandline utilities to *-3.0
  - adjust documentation

Also change the install location for unix-print headers to
/usr/include/gtk-3.0/unix-print/gtk.
2010-05-08 01:18:53 -04: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