summaryrefslogtreecommitdiff
path: root/panels/printers
Commit message (Collapse)AuthorAgeFilesLines
* Change PpPPDSelectionDialog to GtkDialogBrandon Nielsen2021-01-085-119/+92
| | | | | | | | | | | The dialog is now displayed by calling gtk_dialog_run and gtk_window_set_transient_for in the window displaying the dialog. Cleanup is handled using gtk_widget_destroy. Destructors in the windows using the dialog no longer cleanup the dialog as it is assumed it will be either cleaned up after the response callback, or handled by the destroy_with_parent property set on the dialog itself.
* printers: Make PpJobRow widgetRobert Ancell2020-12-146-98/+257
|
* printers: Clear up use of gpointer valueRobert Ancell2020-12-141-3/+3
|
* printers: Remove use of gtk_widget_show_allRobert Ancell2020-11-2610-14/+30
| | | | It is removed in GTK 4.
* printers: Ensure objects are destroyed when dialog destroyedRobert Ancell2020-11-241-0/+2
|
* printers: Remove redundant variable set to NULLRobert Ancell2020-11-241-1/+0
|
* printers: Cancel adding printer if PPD dialog is cancelledRobert Ancell2020-11-241-0/+5
|
* printers: Fix string leaks in new printer dialogRobert Ancell2020-11-241-2/+2
|
* printers: Make printers panel have a smaller minimum width.Robert Ancell2020-11-191-0/+1
| | | | Allow the ink-level to overlap with the buttons.
* printers: Remove dead PPD dialog codeRobert Ancell2020-11-101-6/+0
|
* printers: Fix autoptr object not being initialized to NULL.Robert Ancell2020-11-021-1/+1
| | | | | | Won't cause a problem in this case but should be done for safety. Introduced in ad226b420c656a055602136ff1feaa6ba919d039
* printers: Fix leak of printer name in callbacks.Robert Ancell2020-10-293-7/+7
| | | | | | printer_set_ppd_async and printer_set_ppd_file_async copy the printer name, but this isn't freed in any cases that use these callback (the string isn't even used at all).
* printers: Use g_autoptr with GThreadRobert Ancell2020-10-301-26/+6
|
* printers: Add methods for getting printer name and locationRobert Ancell2020-10-295-211/+76
| | | | Remove the GObject properties that aren't type safe.
* printers: Do not cleanup task after getting busMarek Kasik2020-10-291-1/+2
| | | | | | Use g_steal_pointer() on task in get_bus_cb() in pp-printer.c to not invalidate a pointer passed to a DBus call. Cleanup the task in callback of the DBus call.
* printers: Add pp_job_new and associated methods.Robert Ancell2020-10-275-152/+62
| | | | | | | | The previous code was leaking a string (job title), used an integer pointer instead of an integer for an id and requited a lot of memory management for a string array. There was a lot of boilerplate code required for property management which was not being used much. This is why type safe methods are a much better idea than GObject properties. :)
* Code cleanup as per HACKING.Brandon Nielsen2020-09-251-72/+60
|
* Consumers clean up the PPD list, not the dialog itself.Brandon Nielsen2020-09-251-2/+0
|
* Spaces over tabs.Brandon Nielsen2020-09-251-18/+18
|
* component: PpPPDSelectionDialogBrandon Nielsen2020-09-254-50/+75
| | | | | | | | | | | G_IS_OBJECT checks fail when calling g_signal_connect_object because PpPPDSelectionDialog is a struct, not a type descending from G_OBJECT. This makes the changes required for PpPPDSelectionDialog to be a GObject, and defines PpPPDSelectionDialog as a GObject. It also updates consumers of PpPPDSelectionDialog to destroy created PpPPDSelectionDialogs as GObjects. https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/1126
* printers: Use a shared PpCups objectRobert Ancell2020-09-221-19/+11
|
* printers: Fix location where GTask is unreffedRobert Ancell2020-09-221-2/+1
|
* printers: Don't pass PpJob references aroundRobert Ancell2020-09-221-2/+2
| | | | An internal GTask will hold a reference to it for the duration of the async calls.
* printers: Don't pass PpNewPrinter references aroundRobert Ancell2020-09-221-4/+2
| | | | An internal GTask will hold a reference to it for the duration of the async calls.
* printers: Don't pass PpCups references aroundRobert Ancell2020-09-222-36/+16
| | | | An internal GTask will hold a reference to it for the duration of the async calls.
* printers: Don't pass PpHost references aroundRobert Ancell2020-09-221-28/+16
| | | | | | An internal GTask will hold a reference to it for the duration of the async calls. Correctly unref these objects in finalize.
* printers: Don't pass PpSamba references aroundRobert Ancell2020-09-221-16/+7
| | | | An internal GTask will hold a reference to it for the duration of the async calls.
* printers: Don't pass PpPrinter references aroundRobert Ancell2020-09-223-11/+5
| | | | An internal GTask will hold a reference to it for the duration of the async call.
* printers: Fix PpPrinter reference leaksRobert Ancell2020-09-222-2/+2
| | | | They were not unreferenced in the callback.
* printers: Don't pass PpMaintenanceCommand references aroundRobert Ancell2020-09-223-24/+11
| | | | An internal GTask will hold a reference to it for the duration of the async call.
* printers: Don't pass GFile references aroundRobert Ancell2020-09-221-2/+1
| | | | An internal GTask will hold a reference to it for the duration of the async call.
* printers: Don't pass GDBusConnection references aroundRobert Ancell2020-09-225-38/+16
| | | | An internal GTask will hold a reference to it for the duration of the async call.
* printers: Use g_autoptrRobert Ancell2020-09-2210-87/+41
|
* printers: Use g_clear_objectRobert Ancell2020-09-225-56/+25
|
* Replace whitelist/blacklist termsRobert Ancell2020-07-211-22/+22
| | | | | For rationale see here: https://chromium.googlesource.com/chromium/src/+/master/styleguide/inclusive_code.md#racially-neutral
* Fix minor typosYuri Chornoivan2020-07-205-13/+13
|
* printers: Replace PpDevicesList with standard GPtrArrayRobert Ancell2020-07-207-197/+135
|
* printers: Remove unused finalize methodsRobert Ancell2020-07-023-23/+0
|
* printers: Remove unused class membersRobert Ancell2020-07-028-56/+10
|
* printers: Don't initialize classes members to NULL/0/FALSERobert Ancell2020-07-024-65/+0
| | | | These are the default values.
* printers: Fix crash on closeRobert Ancell2020-06-301-2/+3
| | | | It was calling g_free on an object and a warning trying to set a NULL object.
* printers: Update GtkListBox of printers consecutivelyMarek Kasik2020-06-223-65/+240
| | | | | | | | | | | | | | | | | | | | | | | 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).
* printers: Clear GSource id when printer removal finishesMarek Kasik2020-06-081-15/+8
| | | | | | | | | | | | | | | | | | 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
* printers: Do not crash due to wrong argumentMarek Kasik2020-06-031-6/+3
| | | | | | | | 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.
* printers: Do not authenticate SMB servers when search field is editedElia Geretto2020-05-121-1/+1
| | | | | | | | | | | | | | | When the search field in the "Add Printer" dialog is edited, no authentication with a remote SMB server should be attempted. The server should just be added to the list and marked with "Server requires authentication". The user can then authenticate the server by clicking on it. The behavior described above is probably the intended one when the code was written, since there is no closure registered for the "authentication-required" signal in the function this commit modifies. This commit should simply restore the intended behavior. Resolves: https://gitlab.gnome.org/GNOME/gnome-control-center/issues/755
* printers: Remove nesting on a GVariant iterationRobert Ancell2020-03-301-29/+31
|
* printers: Simplify D-Bus error case branchesRobert Ancell2020-03-301-148/+127
|
* printers: Replace D-Bus unrefs with g_autoptrRobert Ancell2020-03-301-2/+1
| | | | This case could leak the GDBusConnection
* printers: Replace D-Bus unrefs with g_autoptrRobert Ancell2020-03-301-20/+11
|
* printers: Remove unnecessary checks on result of g_variant_getRobert Ancell2020-03-302-147/+129
| | | | This always returns a value or hits an assertion.