Commit graph

25 commits

Author SHA1 Message Date
Robert Ancell
509beee6dc printers: Fix leak of printer name in callbacks.
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).
2020-10-29 23:10:05 +00:00
Brandon Nielsen
26e8f11566 component: PpPPDSelectionDialog
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
2020-09-25 01:59:57 +00:00
Robert Ancell
b994237acd printers: Remove unused class members 2020-07-02 16:20:25 +00:00
Robert Ancell
d4b47bd9ff printers: Sort variables 2019-09-10 00:18:53 +00:00
Robert Ancell
1b999f36e2 printers: Use gtk_stack_set_visible_child instead of names 2019-09-10 00:18:53 +00:00
Robert Ancell
2c28987e41 printers: Connect signals in swapped form 2019-09-10 00:18:53 +00:00
Robert Ancell
d4adf67549 printers: use gtk_dialog_run 2019-09-10 00:18:53 +00:00
Robert Ancell
a50ce39689 printers: Drop unused class structure 2019-09-10 00:18:53 +00:00
Robert Ancell
3a027bddd0 printers: Set transient window externally to dialog code 2019-09-10 00:18:53 +00:00
Robert Ancell
fcde07c770 printers: Remove pp_details_dialog_free, use gtk_widget_destroy 2019-09-10 00:18:53 +00:00
Robert Ancell
fb92795854 printers: Make .ui filename match the .c filename 2019-09-10 00:18:53 +00:00
Robert Ancell
e9b9966e7d printers: Use g_autoptr with strings 2019-02-05 10:26:15 +13:00
Robert Ancell
2c6eb2b4fd printers: Fix GCancellable leak
Use the dialog cancellable instead of leaking one each time the PPD is set.
2019-01-30 11:41:07 +13:00
Robert Ancell
e20fd185c8 printers: Use dialog cancellable in async call
Otherwise this could crash if the dialog is destroyed before the PPD is set.
2019-01-30 11:41:07 +13:00
Robert Ancell
3dda349aa3 printers: Use a single GCancellable for PpDetailsDialog
The cancellable is only used to cancel when the dialog is destroyed, so you can
share it for all calls.
2019-01-30 11:41:07 +13:00
Robert Ancell
4042cb5d33 printers: Replace GObject boilerplace with G_DECLARE_TYPE 2019-01-30 11:33:28 +13:00
Robert Ancell
55d47bc83e printers: Plug memory leaks 2018-06-25 22:53:10 +00:00
Robert Ancell
a64ef75ad7 Simplify use of GCancellable
g_cancellable_cancell can be called without checking for a NULL value.
Use g_clear_object instead of g_object_unref
2018-06-01 21:03:19 +00:00
Benjamin Berg
e1593b3c02 shell: Remove CcEditableEntry, it is not used anywhere 2018-04-17 14:59:31 +02: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
Felipe Borges
4cfb211761 printers: Ellipsize the "Details Dialog" title
Printers with long names were causing the "Printer Details Dialog"
to expande horizontally.

This patch ellipsizes the custom title of the dialog.

https://bugzilla.gnome.org/show_bug.cgi?id=779071
2017-02-26 12:49:43 +01:00
Felipe Borges
ca30e0ead9 printers: Use async rename method
pp_printer_rename_async is better than the old printer_rename
utility.

The PpDetailsDialog doesn't need to do anything in the callback
since we are emiting the "printer-changed" signal when the dialog
is closed.

https://bugzilla.gnome.org/show_bug.cgi?id=769114
2017-02-22 17:05:50 +01:00
Felipe Borges
5fa1dede21 printers: Do not apply rename/location changes in focus-out-event
Since we are already applying the changing in the PpDetailsDialog
when it gets closed, there's no need to apply these changes in
the focus-out-event of its respective GtkEntries.

https://bugzilla.gnome.org/show_bug.cgi?id=769114
2017-02-22 17:05:50 +01:00
Felipe Borges
6bfc60b779 printers: Make the printer address always sensitive
This patch individually updates the sensitivity of the
PpDetailsDialog child widgets, so we can leave the printer
address label always sensitive.

https://bugzilla.gnome.org/show_bug.cgi?id=778682
2017-02-15 15:56:32 +01:00
Felipe Borges
7e3d89e13a printers: Introduce PpDetailsDialog
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
2017-02-13 19:40:09 +01:00