Commit graph

264 commits

Author SHA1 Message Date
Rui Matos
1df796ac28 printers: Drop remaining deprecated API usage
https://bugzilla.gnome.org/show_bug.cgi?id=740986
2015-01-08 19:04:53 +01:00
Marek Kasik
da15e2ebcf printers: Remove border around model name
The border was not there in 3.10 and it is not
intended to be there in 3.14.

https://bugzilla.gnome.org/show_bug.cgi?id=740811
2014-11-27 15:24:26 +01:00
Marek Kasik
6be06156e6 printers: Fix spacing in Jobs dialog
Increase spacing in the VBox to 10 as in other dialogs.

https://bugzilla.gnome.org/show_bug.cgi?id=739737
2014-11-25 12:01:17 +01:00
Marek Kasik
49b71fa843 printers: Don't use properties of deprecated widgets
Replace xalign and yalign properties by halign and
valign wherever needed.

https://bugzilla.gnome.org/show_bug.cgi?id=739737
2014-11-25 12:01:17 +01:00
Marek Kasik
a5c6e53f65 printers: Remove usage of deprecated GtkAlignment
Use halign and valign of children instead of adding
GtkAlignment and setting of xalign and yalign.

https://bugzilla.gnome.org/show_bug.cgi?id=739737
2014-11-25 12:01:17 +01:00
Marek Kasik
8c67e72821 printers: Fix padding of a progress text
Set padding of the text "Setting new driver" at runtime so that
it is aligned with other fields properly.

https://bugzilla.gnome.org/show_bug.cgi?id=739737
2014-11-25 12:01:17 +01:00
Marek Kasik
38958903ee printers: Add GtkLabel with printer model name
Place a custom GtkLabel with name of printer model
into "printer-model-button". This is needed for us to be
able to align the text and keep the button filling all available
horizontal space.

https://bugzilla.gnome.org/show_bug.cgi?id=739737
2014-11-25 12:01:17 +01:00
Marek Kasik
66eb1c9164 printers: Don't use methods of deprecated GtkMisc
Use GtkWidget's methods for settings of halign, valign and margin-start
instead of GtkMisc's methods for settings of xalign, yalign and xpad.

https://bugzilla.gnome.org/show_bug.cgi?id=739737
2014-11-25 12:01:17 +01:00
Marek Kasik
15b5045ed3 printers: Don't update alignment padding for dialogs
The update of alignment padding is not needed since gtk+ 3.14.
It was needed for proper alignment of widgets of action area
with those from content area.

https://bugzilla.gnome.org/show_bug.cgi?id=739737
2014-11-25 12:01:17 +01:00
Marek Kasik
2d2f20fe53 printers: Use correct type for window id
Window id should be unsigned int and not int. Also the default
value should be 0 instead of the 631 (a copy paste error).

https://bugzilla.gnome.org/show_bug.cgi?id=740115
2014-11-14 14:32:14 +01:00
Marek Kasik
873c22e9d4 printers: Make driver installation dialog modal
Pass XID of correct window to InstallPrinterDrivers and
InstallPackageNames methods.

https://bugzilla.gnome.org/show_bug.cgi?id=740115
2014-11-14 14:32:11 +01:00
Matthias Clasen
e6c2ac9c92 printers: Improve scrolling in new printers list
In order to automatically keep the selected row scrolled in view,
the treeview must be a direct child of the scrolled window. Make
it so by flipping the order of the stack and the scrolled window.

https://bugzilla.gnome.org/show_bug.cgi?id=739600
2014-11-05 09:44:04 -05:00
Marek Kasik
12c4777c06 printers: Don't crash for URIs with leading "//"
Initialize result of getting of LPD devices early to avoid crash.

https://bugzilla.gnome.org/show_bug.cgi?id=738165
2014-10-10 12:31:07 +02:00
Michael Catanzaro
7b33be9d14 printers: Fix multiple definitions of libprinters_la_CPPFLAGS
CUPS_CPPFLAGS is in AM_CPPFLAGS, so we can just remove the first
definition (which I guess has been ignored).
2014-09-05 22:50:17 -05:00
Marek Kasik
4b64a64124 printers: Add test for canonicalize_device_name()
Add a test which tests function canonicalize_device_name() which
canonicalize name of printer model so it doesn't contain
unwanted strings/characters.
Test data are in canonicalization-test.txt file.

https://bugzilla.gnome.org/show_bug.cgi?id=695564
2014-07-31 11:44:17 +02:00
Marek Kasik
994bc0735a printers: Strip redundant strings from found devices
Remove strings like "foomatic", "series" from names of found devices.
Remove leading, trailing and recurrent dashes.

https://bugzilla.gnome.org/show_bug.cgi?id=695564
2014-07-31 11:44:17 +02:00
Marek Kasik
88fa618aca printers: Add function shift_string_left() and its test
shift_string_left() shifts given string by 1 character to the left.
test-shift.c tests whether function shift_string_left() works correctly.

https://bugzilla.gnome.org/show_bug.cgi?id=695564
2014-07-31 11:44:17 +02:00
Marek Kasik
b43f05f740 printers: Allow adding of JetDirect and LPD printers manually
Check the entered address for AppSocket/HP JetDirect and LPD printers.
If there is a printer found, it has a default name which
will be changed right after user selects model of the printer
in the PPD selection dialog.

https://bugzilla.gnome.org/show_bug.cgi?id=695564
2014-07-31 11:44:16 +02:00
Marek Kasik
7eded1afa5 printers: Add functions for searching for LPD printers
Add pp_host_get_lpd_devices_async() and
pp_host_get_lpd_devices_finish() functions to PpHost class.
pp_host_get_lpd_devices_async() starts searching for LPD printer
on given address.
The test consist in connection to the default port 515 (or the one
given by creator of PpHost) of the address and sending a print job
to it, which in turn returns a status (we test several standard
queue names).
We suppose that there is a LPD printer on the address if a buffer
with zero length is returned (rfc 1179 5.2).

https://bugzilla.gnome.org/show_bug.cgi?id=695564
2014-07-31 11:44:16 +02:00
Marek Kasik
89fe4eda12 printers: Allow to add AppSocket/HP JetDirect printers
Add pp_host_get_socket_devices_async() and
pp_host_get_socket_devices_finish() functions to PpHost class.
pp_host_get_socket_devices_async() starts searching for socket printer
on given address.
The test consist in connection to the default port 9100 (or the one
given by creator of PpHost) of the address.
We suppose that there is an AppSocket/HP JetDirect printer on the address
if the connection succeeds.

See these links for additional info:
http://en.wikipedia.org/wiki/JetDirect
http://www.cups.org/documentation.php/network.html

https://bugzilla.gnome.org/show_bug.cgi?id=695564
2014-07-31 11:44:16 +02:00
Marek Kasik
6576db1a16 printers: Make pp_devices_list_free() generally available
Move pp_devices_list_free() to pp-utils.h and optimize it
using g_list_free_full().

https://bugzilla.gnome.org/show_bug.cgi?id=695564
2014-07-31 11:44:16 +02:00
Marek Kasik
a15c2f831a printers: Don't request port during creation of PpHost
This allows us to distinguish between situations when the port
was specified and when it was not.

https://bugzilla.gnome.org/show_bug.cgi?id=695564
2014-07-31 11:44:16 +02:00
Marek Kasik
8331c88bcd printers: Export name of selected PPD from PPD dialog
Add pp_ppd_selection_dialog_get_ppd_display_name() function
which returns human-readable name of selected PPD.

https://bugzilla.gnome.org/show_bug.cgi?id=695564
2014-07-31 11:44:16 +02:00
Marek Kasik
375c5b0086 printers: Separate canonicalization of device name
Move code for canonicalization of device names to
a separate function for reusability.

https://bugzilla.gnome.org/show_bug.cgi?id=695564
2014-07-31 11:44:16 +02:00
Marek Kasik
190d27b8aa printers: Merge TDevice into PpPrintDevice
PpPrintDevice has grown quite a lot since its introduction.
It contains almost all members of TDevice now.
Merging members of TDevice into PpPrintDevice saves us some work
and allows us to process TDevice's data out of pp-new-printer-dialog.c.

https://bugzilla.gnome.org/show_bug.cgi?id=695564
2014-07-31 11:44:16 +02:00
Christophe Fergeau
08c9ecdffc printers: Use AM_CPPFLAGS rather than INCLUDES
This is deprecated in newer automake versions, and this causes warnings
with automake 1.14:
panels/printers/Makefile.am:3: warning: 'INCLUDES' is the old name for
AM_CPPFLAGS' (or '*_CPPFLAGS')

https://bugzilla.gnome.org/show_bug.cgi?id=732189
2014-06-25 12:46:42 +02:00
Marek Kasik
d32408c051 printers: Ellipsize long names and locations
Ellipsize long names of printers and long location strings
in the printers panel.

https://bugzilla.gnome.org/show_bug.cgi?id=661667
2014-04-30 11:32:42 +02:00
Marek Kasik
d057e16a7f printers: Don't fail when adding Samba printers with spaces
Escape characters in URIs composed for SMB shares since their names
can contain characters which are not allowed in URIs.

https://bugzilla.gnome.org/show_bug.cgi?id=699942
2014-03-28 11:12:01 +01:00
Marek Kasik
3bd0ba44ae printers: Define missing constant
Define HTTP_URI_STATUS_OK if compiling against CUPS 1.6 or lower.
(HTTP_URI_OK was renamed to HTTP_URI_STATUS_OK in CUPS 1.7.)

https://bugzilla.gnome.org/show_bug.cgi?id=725662
2014-03-04 16:47:11 +01:00
Marek Kasik
64ff0dd25a printers: Show connection type of found devices
Parse URIs of devices found by the new printer dialog and
show types of their connections for local printers or
locations for network printers or addresses for network
printers.

https://bugzilla.gnome.org/show_bug.cgi?id=693183
2014-02-28 11:07:51 +01:00
Marek Kasik
352f01bb11 printers: Don't set color for selected text
Show description of selected device in default color
in new printer dialog.

https://bugzilla.gnome.org/show_bug.cgi?id=693183
2014-02-28 11:07:48 +01:00
Marek Kasik
fc0a68430f printers: Set hostname for devices with no hostname
Guess hostname of found device if it was not provided before.

CUPS browses its printers as "PrinterName @ ComputerName" or
"PrinterInfo @ ComputerName" through DNS-SD. Get the last part
of that string and set it as hostname.

HPLIP printers have URIs of form
hp:/net/PrinterModel?ip=IPAddress&port=Port or
hp:/net/PrinterModel?ip=IPAddress.

URIs of other protocols are parsed by httpSeparateURI().

https://bugzilla.gnome.org/show_bug.cgi?id=693183
2014-02-26 12:09:36 +01:00
Marek Kasik
bd1f779608 printers: Delay searching for remote printers
Start to search for remote printers on given hostname after
500ms of user's inactivity instead of GtkSearchEntry's default
150ms (the search is very expensive operation).
Keep filtering devices list after the default 150ms and
search immediately if user activates the search entry.

https://bugzilla.gnome.org/show_bug.cgi?id=694154
2014-02-13 15:50:38 +01:00
Marek Kasik
25f9517656 printers: Don't react to icon-press when searching for new printers
There is no activatable icon in the new printer dialog.

https://bugzilla.gnome.org/show_bug.cgi?id=694154
2014-02-13 15:50:38 +01:00
Marek Kasik
e2e0c505eb printers: Don't show tooltip on clear icon when searching for printers
The clear icon doesn't do what its tooltip says.

https://bugzilla.gnome.org/show_bug.cgi?id=694154
2014-02-13 15:50:38 +01:00
Marek Kasik
22a558ef80 printers: Don't wait for activation to start search
Connect to "search-changed" signal of GtkSearchEntry instead of
"activate" signal when searching for new printers. Cancel previous
searches and start new ones as needed.

https://bugzilla.gnome.org/show_bug.cgi?id=694154
2014-02-13 15:50:37 +01:00
Marek Kasik
ad9c640f5c printers: Use "Default printer" instead of "Default"
Use "Default printer" in the main panel to clarify
what the check button represents.

https://bugzilla.gnome.org/show_bug.cgi?id=706896
2014-02-12 16:18:40 +01:00
Marek Kasik
6d5d28e7d4 printers: Vertically center text for no devices
Move the text "No printers detected." to its own GtkLabel
which is vertically and horizontally centerd and show it
instead of GtkTreeView when no devices were found.

https://bugzilla.gnome.org/show_bug.cgi?id=706897
2014-02-12 16:13:04 +01:00
Marek Kasik
1ed138e957 printers: Remove a memory leak
TDevice and PpPrintDevice structures have "host_name" member which
should be freed too.
2014-01-30 14:21:28 +01:00
Daniel Mustieles
2c5951819d Updated FSF's address 2014-01-29 11:27:38 +01:00
Marek Kasik
69fc7e9fdc printers: Show correct time of print job
g_date_time_new_local() expects month in range 1..12
but localtime() returns month in range 0..11.
g_date_time_new_local() also expects absolute value
for year but localtime() returns number of years since 1900.

Adding 1 to month and 1900 to year fixes this.
2014-01-15 16:59:31 +01:00
Yosef Or Boczko
84c792c7f4 printers: Use margin-start/end instead of margin-left/right
https://bugzilla.gnome.org/show_bug.cgi?id=712661
2013-11-19 22:28:28 +02:00
Jasper St. Pierre
dd52ac9417 Add NoDisplay to all gnome-control-center panel .desktop files
These aren't apps -- they're simply launchers for gnome-control-center.
They should not be shown as apps in the UI at all.

https://bugzilla.gnome.org/show_bug.cgi?id=712246
2013-11-15 08:44:53 -05:00
Rui Matos
b17bd4ea7e printers: Don't leak a couple of dialogs
https://bugzilla.gnome.org/show_bug.cgi?id=708286
2013-10-01 10:05:03 +02:00
Marek Kasik
fa5ed6cd41 printers: Show authenticated Samba servers in the list of new devices
When a Samba server which needs authentication is discovered, add
it to the list of new devices and allow user to authenticate against it
by pressing new "Authenticate" button.
Show only printers available on such a server when authenticated and
remove the server from the list.

https://bugzilla.gnome.org/show_bug.cgi?id=698532
2013-09-03 22:09:40 +02:00
Marek Kasik
03d463379f printers: Simplify freeing of lists of found printers
Create a dedicated function for freeing of PpDevicesList.

https://bugzilla.gnome.org/show_bug.cgi?id=698532
2013-09-03 22:09:39 +02:00
Marek Kasik
da28022da6 printers: Handle cancelling of authentication dialog
Add given Samba server to the list of found devices
if authentication dialog was cancelled.

https://bugzilla.gnome.org/show_bug.cgi?id=698532
2013-09-03 22:09:39 +02:00
Marek Kasik
22f508a7e1 printers: Authenticate Samba servers only when enabled
Add parameter which enables showing of authentication dialog
for Samba servers which need authentication.
Add samba server to the internal list of found devices if it needs
authentication and the authentication is disabled.

https://bugzilla.gnome.org/show_bug.cgi?id=698532
2013-09-03 22:09:39 +02:00
Marek Kasik
edcd8b1c13 printers: Enable use of emblems for printer icons
Use GIcon instead of icon names in PpNewPrinterDialog.

https://bugzilla.gnome.org/show_bug.cgi?id=698532
2013-09-03 22:09:39 +02:00
Marek Kasik
be6523b66c printers: Propagate cancellation of authentication dialog
Return "response_id" of PpAuthenticationDialog in its "response" signal.

https://bugzilla.gnome.org/show_bug.cgi?id=698532
2013-09-03 22:09:39 +02:00