Commit graph

124 commits

Author SHA1 Message Date
Felipe Borges
66c7f45307 printers: List new printers ASAP in the "Add Printer" dialog
List a printer in the "Add Printer" dialog as soon as it is
discovered. The header subtitle "Searching for Printers"
denotes that the Search is not done yet.

https://bugzilla.gnome.org/show_bug.cgi?id=760783
2016-12-02 15:10:56 +01:00
Felipe Borges
116f763831 printers: Redesign loading page in the "Add Printer" dialog
This is a redesign based on the newest mockups available at
https://wiki.gnome.org/Design/SystemSettings/Printers#Guidelines

The spinner is displayed while search is taking place AND nothing
has been found. Ongoing search is indicated by the sub-heading.

https://bugzilla.gnome.org/show_bug.cgi?id=760783
2016-10-11 16:55:11 +02:00
Felipe Borges
8f57e4dfc7 printers: Move "Add Printer" dialog buttons to header bar
It also renames the "Authenticate" button to "Unlock".
This is a redesign based on the newest mockups available at
https://wiki.gnome.org/Design/SystemSettings/Printers#Guidelines

https://bugzilla.gnome.org/show_bug.cgi?id=760783
2016-09-22 11:32:53 +02:00
Felipe Borges
ac6b1acc1f printers: avoid crashes when searching for printers w/ special chars
Since the dialog considers just  the hostname part from the URL,
unespacing the url avoids a backend crash.

https://bugzilla.gnome.org/show_bug.cgi?id=754248
2015-09-14 17:47:15 +02:00
Marek Kasik
cb07ee03a0 printers: Use GtkListStore for device list
Remove the GList holding printing devices and use already present
GtkListStore for this in the New printer dialog.

This avoids us to install wrong printer when there is more devices
with the same name since we have GtkTreeIter of the selected row.

Use GtkTreeModelFilter for filtering of current devices.

Update test for canonicalize_device_name() since I had to change one
of its parameters.

https://bugzilla.gnome.org/show_bug.cgi?id=749830
2015-08-03 16:56:41 +02:00
Marek Kasik
60bf057bab printers: Merge device-class and is-network-device properties
'device-class' property of PpPrintDevice can contain "network"
or "direct" values. This information can be stored in already
present property 'is-network-device' as well.

https://bugzilla.gnome.org/show_bug.cgi?id=749830
2015-07-30 16:28:09 +02:00
Marek Kasik
7b21b22eef printers: Make PpPrintDevice a regular class
Create class PpPrintDevice with properties taken
from the original PpPrintDevice structure.

https://bugzilla.gnome.org/show_bug.cgi?id=749830
2015-07-30 16:28:06 +02:00
Marek Kasik
48ef91a0b9 printers: Fix compile-time warning
pp-new-printer-dialog.c:673:18: warning: 'device' may be used uninitialized
in this function [-Wmaybe-uninitialized]
2015-07-29 15:48:08 +02:00
Marek Kasik
68e92988a8 printers: Cache pointer to devices-treeview
Store device-treeview in PpNewPrinterDialogPrivate so we
don't need to search for it each time we need it.

https://bugzilla.gnome.org/show_bug.cgi?id=749830
2015-07-27 16:28:39 +02:00
Marek Kasik
c26553ed3e printers: Use macro for getting widgets from builder
Use macro for getting widgets from builder in the New printer dialog.

https://bugzilla.gnome.org/show_bug.cgi?id=749830
2015-07-27 16:28:36 +02:00
Marek Kasik
880cc01550 printers: Don't show the same device multiple times
Pass all discovered devices to 'GroupPhysicalDevices' instead of just
the devices already present in the list and the newly discovered ones.
Replace an existing device in the list if there is a better device
(e.g. replace 'usb:' by 'hp:' device).

https://bugzilla.gnome.org/show_bug.cgi?id=693186
2015-07-13 12:07:59 +02:00
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