Commit graph

415 commits

Author SHA1 Message Date
Benjamin Berg
a9d8ec5747 Move printers panel tests into tests folder 2018-04-17 15:26:59 +02:00
Benjamin Berg
c2f601a9d4 Move common panel code from shell/ to panel/common
This creates a new static library called libwidget which the shell links
against.
2018-04-17 15:26:59 +02:00
Benjamin Berg
e1593b3c02 shell: Remove CcEditableEntry, it is not used anywhere 2018-04-17 14:59:31 +02:00
Felipe Borges
8879cd476a printers: Fix crash when panel is closed quickly
Fix a user-after-free while testing the connectivity to a cups
server. This is similar to the fix in commit 1d72a0b.

This is an addition to the changes introduced in commit 2ff5cfd
which allowed the connection testing to be cancellable.

Fixes #51
Fixes https://bugzilla.gnome.org/794632
2018-04-09 13:26:55 +02:00
Georges Basile Stavracas Neto
28ad1d1602 printers: Cache CUPS D-Bus proxy 2018-04-06 22:23:39 -03:00
Marek Kasik
5663a8189c Printers: Fix closing of Jobs dialog
When user presses Esc key on Jobs dialog when there
is a job which needs authentication then the dialog
is not closed. This commit fixes this issue.
2018-03-05 17:02:44 +01:00
Marek Kasik
1225766e1f Printers: Don't focus non-realized widgets
This commit removes focusing of widgets in authentication dialog
which could happen when user traverses Jobs dialog via Tab key
if there are some jobs which need authentication.
Lets rely on standard focus chain.
2018-03-05 17:02:41 +01:00
Marek Kasik
873c2c6839 Printers: Add commandline action "show-jobs"
Add action "show-jobs" to printers panel which
gets printer name as a parameter and shows user
jobs dialog.
Syntax for trigerring this action looks like:
"gnome-control-center printers show-jobs my-local-printer".

https://bugzilla.gnome.org/show_bug.cgi?id=758170
2018-02-26 14:33:30 +01:00
Marek Kasik
91328078fe Printers: Fix GVariant handling
Some const strings taken from GVariants were used
after their GVariants were unreffed.

https://bugzilla.gnome.org/show_bug.cgi?id=758170
2018-02-26 14:33:27 +01:00
Piotr Drąg
7265bd53a0 Add translator comments to .desktop files
Icons are confusing translators, and gettext
is unlikely to get fixed any time soon.
2018-02-23 18:49:35 +01:00
Marek Kasik
ee1b9a8729 Printers: Make jobs dialog wider
Request width of 720 pixels for jobs dialog and
constrain maximal number of character in displayed
jobs titles to 40 chars. Ellipsize at the end
if the job title is longer.

https://bugzilla.gnome.org/show_bug.cgi?id=758170
2018-02-20 01:13:16 +01:00
Marek Kasik
aa0819894f Printers: Add commandline action "authenticate-jobs"
Add action "authenticate-jobs" to printers panel which
gets printer name as a parameter and asks user for
credentials.
Syntax for trigerring this action looks like:
"gnome-control-center printers authenticate-jobs my-local-printer".

https://bugzilla.gnome.org/show_bug.cgi?id=758170
2018-02-20 01:13:13 +01:00
Marek Kasik
212b8a6504 Printers: Add method for authentication of jobs to PpPrinterEntry
This commit adds method for triggerring of authentication of print jobs
to PpPrinterEntry. This is needed for asking for authentication of jobs
of a printer from the main panel.

https://bugzilla.gnome.org/show_bug.cgi?id=758170
2018-02-20 01:13:09 +01:00
Marek Kasik
1be3901b67 Printers: Add authentication dialog for print jobs
This commit adds popup dialog to jobs dialog which can be accessed
if there is a print job which needs authentication.
Clicking "Authenticate" button will reveal this dialog
where user can enter credential info for the actual printer
and clicking the "Authenticate" in it will authenticate all
print jobs of this printer which needs authentication info
and will send them for printing.

https://bugzilla.gnome.org/show_bug.cgi?id=758170
2018-02-20 01:13:06 +01:00
Marek Kasik
90e306df20 Printers: Get "job-hold-until" attribute for jobs
Get "job-hold-until" attribute when getting list of jobs. If it has value
"auth-info-required" then get "auth-info-required" attribute of the printer
and store it in PpJob's "auth-info-required" property.

https://bugzilla.gnome.org/show_bug.cgi?id=758170
2018-02-20 01:13:03 +01:00
Marek Kasik
589a1cf615 Printers: Add ability to authenticate print jobs
Add pp_job_authenticate_async() and pp_job_authenticate_finish()
methods for authentication of PpJob.
This commit also adds "auth-info-required" property to PpJob

https://bugzilla.gnome.org/show_bug.cgi?id=758170
2018-02-20 01:12:19 +01:00
Felipe Borges
2ff5cfd6aa printers: Make the cups connection test cancellable
Currently gnome-control-center could crash whenever a connection
test is interrupted by the disposal of the Printers panel.

Searching in the g-c-c shell for any query that could match the
Printers panel would instantiate the CcPrintersPanel class. Since
we perform a connection test to the printing server as soon as this
object is created, a fast disposal of the panel (by choosing another
search result) would cause the whole application to crash.

https://bugzilla.gnome.org/show_bug.cgi?id=792753
2018-02-09 13:27:25 +01:00
Felipe Borges
db9017bf30 printers: Hide header buttons when there's no printer server
There's no reason to "Unlock" the panel and/or "Add" a new printer
if there's no printer server available.

This patch sets the visibility of the "headerbar-buttons" based on
whether the current visible stack page in the panel is the
"no-cups-page".

https://bugzilla.gnome.org/show_bug.cgi?id=778599
2018-02-05 14:21:05 +01:00
Felipe Borges
34565466a2 printers: Don't show duplicates while renaming printer
During the time it took to rename a printer asynchronously, we had
cases where two entries were shown for the same printer: one with
the old name and another with a new name.

Now we signal from DetailsDialog to the given PrinterEntry which
passes it along to the main panel object. The CcPrintersPanel object
blacklists the renamed printer old name.

https://bugzilla.gnome.org/show_bug.cgi?id=790361
2018-02-05 14:15:10 +01:00
Iñigo Martínez
0dd386f405 build: Migrate from Intltool to Gettext
Recent versions of Gettext are able to translate several formats
that are used in GNOME applications. This patch migrates from
Intltool to Gettext by using meson's i18n features.

https://bugzilla.gnome.org/show_bug.cgi?id=787588
2018-01-23 10:49:31 +01:00
Iñigo Martínez
dc0988d47c build: Remove autotools
To avoid the burden of maintaining multiple build systems, this
patch removes autotools support.

https://bugzilla.gnome.org/show_bug.cgi?id=785414
2018-01-18 12:20:08 +01:00
Piotr Drąg
b65e31323a panels: Remove soft hyphens from .desktop files
With the old shell gone, there is no need to work around cut off panel
names (bug #647087). As it stands now, it only confuses translators
(invisible characters are hard to, well, see).

https://bugzilla.gnome.org/show_bug.cgi?id=792629
2018-01-18 00:12:04 -02:00
Iñigo Martínez
32edd6789e build: Port to meson build system
Meson is a build system focused on speed an ease of use, which
helps speeding up the software development. This patch adds meson
support along autotools.

https://bugzilla.gnome.org/show_bug.cgi?id=785414
2018-01-17 20:09:35 -02:00
Felipe Borges
5d4cb8ea9c printer: Don't show the supply level bar by default
We were checking for the ink supply level at the callback of the
supply bar "draw" signal. This way we were making the the widget
visible, causing it to allocate vertical space even when it isn't
desired.

Now we check for the supply level before setting the visiblity of
the supply level widget.

https://bugzilla.gnome.org/show_bug.cgi?id=790667
2017-11-21 17:28:15 +01:00
Felipe Borges
950ca7f5cc printers: Allow printer name and location labels to hexpand
Since the main control-center window can now be resized, there's
no reason for us to constrain the printer name and location labels
from expanding horizontally.

https://bugzilla.gnome.org/show_bug.cgi?id=790665
2017-11-21 17:18:56 +01:00
Felipe Borges
fb43d37899 printers: Set default text and sensitivity for the Jobs button
This way we make sure that the right size is allocated at the
creation time and no undesirable resizes occur after a refresh.

https://bugzilla.gnome.org/show_bug.cgi?id=790663
2017-11-21 17:12:15 +01:00
Felipe Borges
614fb9e27a printers: Make sure IPP_STATE_IDLE is defined
This changes are necessary because we don't require cups >= 1.4,
due to downstreams still shipping old cups versions.

The IPP_STATE_IDLE symbol has been introduced in cups 1.7. The
IPP_IDLE constant has been deprecated.

https://bugzilla.gnome.org/show_bug.cgi?id=789397
2017-10-24 12:34:54 +02:00
Alexandre Franke
9db096e6e6 Add translator comment 2017-08-27 14:19:50 +02:00
Felipe Borges
c776ab1808 printers: Apply the vertical spacing standard
Settings panels are given 32px above and below their content
and 32px vertical space between major sections. 12px space is
placed below headings.

https://bugzilla.gnome.org/show_bug.cgi?id=786384
2017-08-24 15:23:41 +02:00
Felipe Borges
6a6f4b71d9 printers: Wrap GtkListBox inside a GtkBox
In order to vertically align the printers panel content by the
same standards as the other panels, we should set the GtkListBox
top and bottom margins to 32px.

This commit wraps GtkListBox inside a GtkBox to handle the Gtk+
issues discussed in Bug 773459 regarding the background of ListBox
margins.

This commit can be cleanly reverted once the issue is fixed in
Gtk+.

https://bugzilla.gnome.org/show_bug.cgi?id=786384
2017-08-24 15:23:41 +02:00
Rui Matos
535c5d1fa2 printers: Disconnect the search bar from the shell's key-press-event
Using g_connect_object() ensures the disconnection happens when the
search bar is finalized.

https://bugzilla.gnome.org/show_bug.cgi?id=786603
2017-08-23 14:30:20 +02:00
Felipe Borges
272bad14a0 printers: The scrolled window should vertically expand
In the new Shell the Printers panel scrolled window doesn't
necessarily fills the whole vertical space available.

https://bugzilla.gnome.org/show_bug.cgi?id=786674
2017-08-23 11:08:02 +02:00
Felipe Borges
756eb883df printers: Fix visibility guard for the printer "Model" label
This is a typo related to the fix at commit 7d25444.
2017-07-25 14:49:41 +02:00
Felipe Borges
7d254442a0 printers: Fix visibility guard for the printer "Model" label
We just present the printer "Model" when printer_make_and_model
is different than NULL OR not an empty string.

We were using the wrong logic operator in the conditional that
toggles the visibility of this info.
2017-07-20 13:35:38 +02:00
Mohammed Sadiq
d5110977da printers: Check if printer name is NULL
This was causing a segfault when the user clicks the cancel button
on add new printer dialog (in case when no printers are listed, and no
printers are added).

output from sanitizer:

==22669==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000000 (pc 0x7fe1c7a4d409 bp 0x7ffd179f6410 sp 0x7ffd179f6410 T0)
    #0 0x7fe1c7a4d408 in g_str_hash /home/sadiq/jhbuild/checkout/glib/glib/ghash.c:1882
    #1 0x7fe1c7a4c814 in g_hash_table_lookup_node /home/sadiq/jhbuild/checkout/glib/glib/ghash.c:379
    #2 0x7fe1c7a4c814 in g_hash_table_lookup /home/sadiq/jhbuild/checkout/glib/glib/ghash.c:1153
    #3 0x55cef023a121 in new_printer_dialog_response_cb /home/sadiq/jhbuild/checkout/gnome-control-center/panels/printers/cc-printers-panel.c:914

https://bugzilla.gnome.org/show_bug.cgi?id=783406
2017-06-23 13:32:42 +02:00
Felipe Borges
0d0b42eb50 printers: Hide supply level bar when there is no inklevel data
https://bugzilla.gnome.org/show_bug.cgi?id=779702
2017-06-15 15:39:22 +02:00
Felipe Borges
ee42831fcd printers: Add print "Test Page" button to Options Dialog
https://bugzilla.gnome.org/show_bug.cgi?id=779708
2017-06-14 10:45:25 +02:00
Felipe Borges
995d64292d printers: Introduce pp_printer_print_file_async
An asynchronous wrapper to print files.

https://bugzilla.gnome.org/show_bug.cgi?id=779708
2017-06-14 10:45:25 +02:00
Felipe Borges
00a45b3d70 printers: Use headerbar in PpOptionsDialog
https://bugzilla.gnome.org/show_bug.cgi?id=779708
2017-05-29 19:29:28 +02:00
Felipe Borges
ca2d97f76a printers: Drop PpOptionsDialog action_area
There's no need for the dialog action_area since we are moving
towards a header bar dialog.

https://bugzilla.gnome.org/show_bug.cgi?id=779708
2017-05-29 19:29:28 +02:00
Michael Catanzaro
50160be2c6 printers: Move options dialog spinner out of the action area
For an infinitesimal amount of time after opening the options dialog, a
spinner is displayed at the start of the action area while the dialog
loads asynchronously. Display the spinner in the center of the dialog
instead, using a GtkStack to switch between spinner mode and normal
mode. Test by removing the calls to printer_get_ppd_async(),
get_named_dest_async(), and get_ipp_attributes_async() from the bottom
of populate_options().

Why? (1) It looks better this way. (2) Need to stop using the action
area in order to switch to a header bar.

https://bugzilla.gnome.org/show_bug.cgi?id=755713

https://bugzilla.gnome.org/show_bug.cgi?id=779708
2017-05-29 19:25:51 +02:00
Felipe Borges
6dcf057a53 printers: Scroll view to show newly added Printer
In scenarios with a long list of printers, it might be difficult
to find a newly added printer.

This patch make the view scroll to the allocated position of the
printer entry.

https://bugzilla.gnome.org/show_bug.cgi?id=779506
2017-05-29 17:49:11 +02:00
Felipe Borges
f3141e430b printers: Drop "select_new_printer" property leftover
The select_new_printer property used to be an indicator whether
the view should change to present the newly added printer.

With the Printers presented as a list in the new design, there's
no need for this flag.

https://bugzilla.gnome.org/show_bug.cgi?id=779506
2017-05-29 17:34:55 +02:00
Piotr Drąg
21d697cbe5 printers: Use Unicode quotation marks in a translatable string
See https://developer.gnome.org/hig/stable/typography.html

https://bugzilla.gnome.org/show_bug.cgi?id=772199
2017-05-26 16:10:47 +02:00
Felipe Borges
e5624f90bf printers: Add 10s timeout for printer removal
Dismisses the Printer removal notification after 10 seconds,
removing the printer permanently.

The 10 seconds value is taken from the online-accounts panel.

https://bugzilla.gnome.org/show_bug.cgi?id=693187
2017-05-26 13:16:39 +02:00
Felipe Borges
f065f5005f printers: Allow undoing deletion of a printer
Instead of directly applying the deletion of a printer, we should
follow the GNOME in-app notification deletion guidelines.

This patch introduces the in-app notification following the HIG[0]
for the deletion of a printer. It allows to "undo" the deletion.

The default behavior for these notification is to dismiss a previous
notification. In doing so, when deleting multiple printers, the
"Undo" button only restores the last deleted one. We don't do batch/
bulk removal in the printers panel.

[0] https://developer.gnome.org/hig/stable/in-app-notifications.html.en

https://bugzilla.gnome.org/show_bug.cgi?id=693187
2017-05-26 13:16:39 +02:00
Felipe Borges
5aca01cd65 printers: Remove printers asynchronously
Introduce pp_printer_delete_async ()

https://bugzilla.gnome.org/show_bug.cgi?id=693187
2017-05-26 13:16:36 +02:00
Felipe Borges
870b4e7190 printers: Filter the printer-location in the search
Show printer search results where the searched string matches
the printer-location.

https://bugzilla.gnome.org/show_bug.cgi?id=779656
2017-05-10 11:04:29 +02:00
Felipe Borges
34aedbe992 printers: Add search capabilities to the panel
Due to the recent changes towards the new design, it became slightly
harder to find a printer given a long list of entries.

This patch introduces search capabilities to the panel, filtering
based on the printer name.

https://bugzilla.gnome.org/show_bug.cgi?id=779656
2017-05-09 15:52:12 +02:00
Felipe Borges
e26756d7e3 printers: Make printers-list a GtkListBox
By making the printers list a GtkListBox instead of a GtkBox, we
can use listbox's capabilities for sorting and filter.

https://bugzilla.gnome.org/show_bug.cgi?id=779656
2017-05-09 15:47:04 +02:00