Commit graph

63 commits

Author SHA1 Message Date
Marek Kasik
da9b74061f printers: Install selected printer when the row is activated
Allow user to install printer by activating a row with a found device.

https://bugzilla.gnome.org/show_bug.cgi?id=748206
2015-06-10 11:35:04 +02:00
Marek Kasik
bfd6423dc9 printers: Set focus of the 'New printer dialog' correctly
Show the 'New printer dialog' after setting transient parent for it
so that the warning about missing transient parent is not shown
to the user and the dialog is correctly focused.

https://bugzilla.gnome.org/show_bug.cgi?id=748206
2015-06-10 11:34:57 +02: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
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
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
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
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
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
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
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
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
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
bba624e9d3 printers: Don't move to beginning of list of new devices
Don't reset position of tree view containing new devices when
an actualization of the tree view is required.

https://bugzilla.gnome.org/show_bug.cgi?id=693185
2013-05-21 16:24:19 +02:00
Marek Kasik
d7f31fc41c printers: Search for samba printers in new printer dialog
Search for samba printers on local network or on specified
host. The new printer dialog asks for password for a samba
server if it is needed for listing printers on it. User is
asked for selection of driver from local database during
addition of new samba printer.

https://bugzilla.gnome.org/show_bug.cgi?id=683229
2013-02-15 18:23:56 +01:00
Cosimo Cecchi
3064425711 printers: use a GResource for GtkBuilder UI definition
https://bugzilla.gnome.org/show_bug.cgi?id=691132
2013-01-07 10:57:15 +01:00
Marek Kasik
1eb906515f printers: Use GPLv2+ for files created by Marek Kasik
This commit is related to the bug #683420.
2012-09-11 15:02:26 +02:00
Marek Kasik
45ba8e89e8 printers: Redesign of new printer dialog
This commit implements design changes from
https://live.gnome.org/Design/SystemSettings/Printers.

The new printer dialog gets informations about connected devices
from CUPS server asynchronously and separately for each backend now.

Entering an address into the entry and pressing the icon inside
the entry or enter starts to detect printers on the entered host.

Entering a text which is a substring of a name of a device or its location
filters the list to contain just devicess with the string in it (e.g. Canon
will keep devices with "Canon" in their name).

The PpNewPrinterDialog is regular object now. It emits signal "pre-response"
when dialog is closed and a printer is being added and signal "response" when
the new printer was added, addition of the new printer failed or the dialog was
cancelled.
This commit removes FirewallD support from new printer dialog. (#683229)
2012-09-04 14:09:06 +02:00
Marek Kasik
cc2e15a592 printers: Move common constants to pp-utils.h
Move constants which are used in more than one source file
to pp-utils.h. (#683229)
2012-09-04 14:09:05 +02:00
Jiri Popelka
fa5e27d320 Use CUPS-1.6 IPP API getter/setter functions.
CUPS 1.6 makes various structures private and
introduces these ippGet and ippSet functions
for all of the fields in these structures.
http://www.cups.org/str.php?L3928

We define our own accessors when
building against CUPS < 1.6. (#679759)
(modified by Marek Kasik)
2012-08-08 14:35:58 +02:00
Bastien Nocera
82aa5d0130 printers: Fix small memory leak
https://bugzilla.gnome.org/show_bug.cgi?id=673151
2012-04-13 14:58:59 +02:00
Marek Kasik
5272bcc06d printers: Use PrinterAddOption method to set media size
Use new cups-pk-helper's method PrinterAddOption for setting
default media size for new printers. This fixes problem with
setting default media size (#672694).
2012-04-13 13:09:38 +02:00
Robert Ancell
1aace205fc printers: Check if device_info is NULL (I don't think it can be but was requested in bugzilla) 2012-03-01 09:34:11 +11:00
Robert Ancell
bda149fdd0 printers: Convert unnecessary use of GDBusProxy to using GDBusConnection directly 2012-03-01 09:34:11 +11:00
Robert Ancell
7dd5ae6b94 printers: Port to GDBus 2012-03-01 09:34:11 +11:00
Matthias Clasen
9dbc562777 Printers: Fix more floating variant madness
Floating references were _such_ a good idea...
2012-02-13 23:19:27 -05:00
Marek Kasik
7aae99aea9 Printers: Remove some warnings
Properly initialize a GValue with G_VALUE_INIT.
Remove unused code.
2012-01-24 13:34:24 +01:00
Marek Kasik
5e4e429cd0 Printers: Use g_error_free() instead of g_clear_error ()
Replace g_clear_error() with more appropriate g_error_free()
where suitable. (#658581)
2012-01-23 16:40:36 +01:00
Marek Kasik
e5747afe41 Printers: Don't allow "/" in printer name
Remove "/" from allowed characters so that models which contain
this character can be added successfully (#661774).
2011-11-08 13:07:03 +01:00
Bastien Nocera
34dadb5ac3 printers: Avoid dereferencing NULL variable
If line is NULL, then buffer is NULL, and buffer[0] points
to nowhere.
2011-10-20 15:50:00 +01:00
Marek Kasik
619364ff1a Printers: Don't add redundant prefix
Don't add prefix "-default" to options set by
PrinterAddOptionDefault method, it is added automatically.
2011-10-14 14:47:39 +02:00
Marek Kasik
4665e84df4 Printers: Don't hide address entry
Don't hide address entry when there is not firewalld available.
It is still possible that firewall is set up correctly and user
should be able to enter address of his network printer and
install it (rhbz #743694).
2011-10-11 16:32:06 +02:00
Bastien Nocera
0e119e480a printers: Fix build on systems without LC_PAPER
By using gtk_paper_size_get_default() directly to do all
the hard work for us.

https://bugzilla.gnome.org/show_bug.cgi?id=660692
2011-10-03 12:29:49 +01:00
Marek Kasik
92b64f1cab Printers: Hide spinner after search
Don't show spinner after search for new printers (#659753).
2011-09-23 16:06:23 +02:00
Marek Kasik
0d86715c01 Printers: Show that no printer was found
Notify user that no local/network printer was found after search (#659725).
2011-09-23 14:53:04 +02:00
Marek Kasik
ffff7a7deb Printers: Match lower-case properly
The lower-cased string needs to be checked against a lower-case
string, or it's never going to match (found by Bastien Nocera in
gnome-settings-daemon).
2011-09-19 14:00:10 +02:00
Marek Kasik
df913a7cf7 Printers: Use system-config-printer's MissingExecutables method
If available, use DBus method MissingExecutables which finds executables
needed by new printer. This method is available in system-config-printer
since version 1.3.5 (#654742). User is offered installation of packages
containing those missing executables then.
2011-08-03 16:27:11 +02:00
Marek Kasik
eb18692613 Printers: Use system-config-printer's GroupPhysicalDevices method
If available, use DBus method GroupPhysicalDevices which removes duplicates
from list of found devices. This method is available in system-config-printer
since version 1.3.5 (#654742).
2011-08-02 17:11:25 +02:00
Marek Kasik
8951bc41a7 Printers: Use system-config-printer's GetBestDrivers method
If available, use DBus method GetBestDriver which determines the best PPD file
for the given printer. This method is available in system-config-printer
since version 1.3.5 (#654742).
2011-08-02 14:20:29 +02:00
Marek Kasik
7962a25ecf Printers: Open firewall for required connections when searching for printers
This commit enables services mdns, ipp, ipp-client and samba-client on
firewall for 5 minutes for detection of network printers (#648784).
It enables required services permanently for printers selected by user
for addition then. It shows a notification for the permanent enable.
It uses firewalld, so if it is not installed or running it shows a warning
message to the user in the place where discovered printers will be shown
(both local and network). The warning disappears after the finish of
printers discovery (but not from network part if no printer was found).
2011-07-27 13:33:48 +02:00