Goal of this commit is to not overwhelm UI when a lot of printers is added
to CUPS. You can reproduce this situation when you add e.g. 30 printers using
lpadmin. Th UI stops to respond for some time.
To do so, the printer entries are not deleted every time there is a request
for updating of the list of printers but only new printer entries are added
and printer entries of deleted printers are removed. Other printer
entries are just updated by new method pp_printer_entry_update().
Which, by the way, is almost whole taken from pp_printer_entry_new().
This needed to add sort function for the list of printer entries. It sorts
printers according to their names not taking case into account.
In the similar manner, the filter function was extended to not show printers
which are being deleted. This needs a list of names of deleted printers
which we keep until they are really deleted.
One important thing here is the "reference" object which points to the panel
itself via its "self" key. We pass this object to the pp_printer_delete_async()'s
callback so it knows whether it can remove the printer's name from the list
of deleted printers (once the panel is being destroyed it clears the key itself).
Remove GSource used for real deletion of a printer when
the "Undo" notification was dismissed.
Also set the timout id of the notitification to 0 when triggered.
Replace cancel_notification_timeout() with one line.
The issue fixed here could be reproduced this way:
1) Open Printers panel
2) Remove a printer
3) Press back button to go to overview
4) Wait 10 seconds
5) Return to the printers panel
6) Close gnome-control-center
Result:
Critical warning on removal of non-existing GSource
Callback for handling of "notification-dismiss-button" got its
parameters swapped. This resulted in crash when user closed
notification about deleted printer.
This commit converts the on_notification_dismissed() function
to accept swapped arguments as was probably intended.
Make the panel class provide a cancellable that will be cancelled when the panel
is destroyed. Panel implementations can use this and not have to mangage the
cancellable themselves. Consolidate cases where panels had multiple cancellables
that were all being used for this behaviour.
This fixes an issue when on_get_job_attributes_cb()
was called after Printers panel has been finished.
It adds a GCancellable to pp_job_get_attributes_async()
calls.
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
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
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
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
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
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
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
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
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
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
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.enhttps://bugzilla.gnome.org/show_bug.cgi?id=693187
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
We were actualizing the whole printers collection everytime
something should change.
These patch introduces a HashTable keyed by the unique printer.name,
which allows us to access individual instances of PpPrinterEntry.
https://bugzilla.gnome.org/show_bug.cgi?id=779079
The previous implementation of the panel was unable to individually
update a PpPrinterEntry jobs count and its PpJobsDialog.
These changes make the job notifications trigger updates in the
PpPrinterEntry UIs, keeping track of job events on the go.
https://bugzilla.gnome.org/show_bug.cgi?id=779079
This dialog handles the editing of printer properties such as
name, location, automatic discovery of driver, manual selection
of printer driver, and manual selection of ppd file.
https://bugzilla.gnome.org/show_bug.cgi?id=767600
This commit introduces the following regressions:
- no possibility of renaming properties such as printer names,
location, or changing model/driver. This issue is going to be
solved nextly by the introduction of the PpDetailsDialog.
https://bugzilla.gnome.org/show_bug.cgi?id=767600
This patch introduces a change to the Lock/Unlock logic. From now
on, unlocking the panel causes the "Lock" button to turn into the
"Add Printer" button.
https://bugzilla.gnome.org/show_bug.cgi?id=767600