Commit graph

23 commits

Author SHA1 Message Date
Maksym Hazevych
5b988a6943 Replace all occurrences of 'gtk_widget_hide'
Replace all occurrences of 'gtk_widget_hide(smth)' with
'gtk_widget_set_visible(smth, FALSE)'.
2023-03-29 14:26:55 +13:00
Maksym Hazevych
d831e5cb48 Replace all occurrences of 'gtk_widget_show'
Replace all occurrences of 'gtk_widget_show(smth)' with
'gtk_widget_set_visible(smth, TRUE)'.
2023-03-29 14:26:55 +13:00
Brandon Nielsen
7c5beecc97 printers: Use a GtkDropDown in PpOptionsDialog
PpPpdOptionWidget and PpIppOptionWidget both use combo boxes for
certain types of selections. With GTK4, combo boxes no longer
support scrolling[0], which in turn causes problems setting some
things in the PpOptionsDialog[1].

This replaces instances of GtkComboBox with GtkDropDown which do
support scrolling. This change was applied to both PpIppOptionWidget
and PpPpdOptionWidget as both are used in PpOptions dialog.

Since the configuration values passed to CUPS can no longer be stored
in a GtkTreeModel alongside the displayed values, some logic changes
to update_widget_real in PpPpdOptionWidget to maintain the reference
to the ppd_option_t so the selected index can be mapped to the
configuration value.

[0] - https://gitlab.gnome.org/GNOME/gtk/-/issues/3674
[1] - https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/1704
2022-04-05 11:52:00 -03:00
Georges Basile Stavracas Neto
8141af469c printers: Port to GTK4
Fortunately for us GtkTreeView still operates pretty
much exactly like in GTK3. Other than that, it's a
dense junction of all that we've done so far to port
other panels.
2021-12-14 22:34:21 -03:00
Robert Ancell
ae1a37b009 printers: Remove use of gtk_widget_show_all
It is removed in GTK 4.
2020-11-26 16:02:57 +00:00
Robert Ancell
b2c5056031 printers: Use g_autoptr 2020-09-22 21:23:04 +00:00
Robert Ancell
ec23d22ada printers: Use g_clear_object 2020-09-22 21:23:04 +00:00
Robert Ancell
287aee4371 printers: Don't initialize classes members to NULL/0/FALSE
These are the default values.
2020-07-02 16:20:25 +00:00
Robert Ancell
4502673b6c printers: Connect signals with g_signal_connect_object in swapped form 2020-03-30 16:18:50 +13:00
Robert Ancell
e9b9966e7d printers: Use g_autoptr with strings 2019-02-05 10:26:15 +13:00
Robert Ancell
47cd15d911 printers: Use self variable to match coding style 2019-01-30 11:33:28 +13:00
Robert Ancell
85604ab4f0 printers: Simplify finalize/dispose methods
Use g_clear_* functions to simplify code and ensure values are set to NULL after freeing.
2019-01-30 11:33:28 +13:00
Robert Ancell
4042cb5d33 printers: Replace GObject boilerplace with G_DECLARE_TYPE 2019-01-30 11:33:28 +13:00
Robert Ancell
ed78a6a120 printers: Fix double free / leak due to copy-paste error 2018-07-30 15:31:45 +12:00
Marek Kasik
b5b421288c printers: Fix setting of page size
Set 'PageSize' instead of 'media' for new printers since we use PPD
for construction of the combo for selecting of default paper size.
Previously, we've been setting 'media' attribute for new printers.
Attribute 'media' is used by IPP but we set paper size using 'PageSize'
which comes from PPD in the options dialog. Sometimes (quite often) IPP
gets priority over PPD in print systems. Therefore there was inconsistency
of what user set as default paper size on the options dialog and what was used.

Also don't mark IPP and user's local options as default in PpPPDOptionWidget
since it should use just PPD (we can change PPD values only in this widget).
Since we use PPD for setting of paper size in the options dialog, we shouldn't
show a value which user does not change actually (IPP's 'media' vs. PPD's
'PageSize').

https://bugzilla.gnome.org/show_bug.cgi?id=748569
2015-06-12 16:23:45 +02:00
Marek Kasik
30a743a94c printers: Update printer options correctly
Set 'ppd_filename_set' and 'destination_set' always to FALSE
before requesting the destination and updated PPD file so we can
distinguish when we have all information needed for update
of the PpPPDOptionWidget.

https://bugzilla.redhat.com/show_bug.cgi?id=1211580
2015-04-16 15:14:07 +02:00
Rui Matos
1df796ac28 printers: Drop remaining deprecated API usage
https://bugzilla.gnome.org/show_bug.cgi?id=740986
2015-01-08 19:04:53 +01:00
Daniel Mustieles
2c5951819d Updated FSF's address 2014-01-29 11:27:38 +01:00
Yosef Or Boczko
d49a097b3e printer: drop GtkStock
https://bugzilla.gnome.org/show_bug.cgi?id=704178
2013-07-19 15:57:53 +03:00
Marek Kasik
76d18ec85d printers: Don't crash after changing an option
Use GCancellable when setting a new value of an option.
This prevents Printers panel from crash caused by
calling of option widget's callback on finalized widget.

https://bugzilla.gnome.org/show_bug.cgi?id=694874
2013-03-04 12:05:18 +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
6f8b9e8825 printers: Allow printer_get_ppd_async() to get PPD from remote host
Adds host_name and port parameters to printer_get_ppd_async(). If host_name
is NULL then it gets the PPD from local CUPS server. (#683229)
2012-09-04 14:09:05 +02:00
Marek Kasik
7ae3027b47 printer: Add "Options" dialog
Add Options dialog which allows users to set more options than current dialog.
The dialog reads printer's PPD file and add its options to the dialog together
with some preselected IPP options (#678637).
All operations in the dialog are asynchronous.
During implementation of this, the option for setting allowed users was removed
because this is not suitable for this panel (the option is intended for
administrators).
2012-07-16 15:26:33 +02:00