- modify default_printer.patch to show a network default printer in the
case of no local default printer - Resolves: #478400
This commit is contained in:
parent
d5f2f55635
commit
ce5c764b63
@ -1,12 +1,76 @@
|
||||
--- modules/printbackends/cups/gtkprintbackendcups.c 2009-01-01 20:41:58.000000000 +0100
|
||||
+++ modules/printbackends/cups/gtkprintbackendcups.c 2009-01-19 13:31:59.000000000 +0100
|
||||
@@ -1303,7 +1303,8 @@ cups_request_printer_list_cb (GtkPrintBa
|
||||
else if (strcmp (attr->name, "printer-type") == 0)
|
||||
{
|
||||
got_printer_type = TRUE;
|
||||
- if (attr->values[0].integer & 0x00020000)
|
||||
+ if ((attr->values[0].integer & 0x00020000) &&
|
||||
+ !(attr->values[0].integer & 0x00000002))
|
||||
+++ modules/printbackends/cups/gtkprintbackendcups.c 2009-01-21 13:54:39.000000000 +0100
|
||||
@@ -1103,6 +1103,7 @@ cups_request_printer_list_cb (GtkPrintBa
|
||||
ipp_t *response;
|
||||
gboolean list_has_changed;
|
||||
GList *removed_printer_checklist;
|
||||
+ gchar *remote_default_printer = NULL;
|
||||
|
||||
GDK_THREADS_ENTER ();
|
||||
|
||||
@@ -1190,6 +1191,7 @@ cups_request_printer_list_cb (GtkPrintBa
|
||||
gboolean is_accepting_jobs = TRUE;
|
||||
gboolean default_printer = FALSE;
|
||||
gboolean got_printer_type = FALSE;
|
||||
+ gboolean remote_printer = FALSE;
|
||||
|
||||
/* Skip leading attributes until we hit a printer...
|
||||
*/
|
||||
@@ -1307,6 +1309,11 @@ cups_request_printer_list_cb (GtkPrintBa
|
||||
default_printer = TRUE;
|
||||
else
|
||||
default_printer = FALSE;
|
||||
+
|
||||
+ if (attr->values[0].integer & 0x00000002)
|
||||
+ remote_printer = TRUE;
|
||||
+ else
|
||||
+ remote_printer = FALSE;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1330,8 +1337,16 @@ cups_request_printer_list_cb (GtkPrintBa
|
||||
{
|
||||
if (default_printer && !cups_backend->got_default_printer)
|
||||
{
|
||||
- cups_backend->got_default_printer = TRUE;
|
||||
- cups_backend->default_printer = g_strdup (printer_name);
|
||||
+ if (!remote_printer)
|
||||
+ {
|
||||
+ cups_backend->got_default_printer = TRUE;
|
||||
+ cups_backend->default_printer = g_strdup (printer_name);
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ if (remote_default_printer == NULL)
|
||||
+ remote_default_printer = g_strdup (printer_name);
|
||||
+ }
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -1552,6 +1567,26 @@ done:
|
||||
|
||||
gtk_print_backend_set_list_done (backend);
|
||||
|
||||
+ if (!cups_backend->got_default_printer && remote_default_printer != NULL)
|
||||
+ {
|
||||
+ cups_backend->default_printer = g_strdup (remote_default_printer);
|
||||
+ cups_backend->got_default_printer = TRUE;
|
||||
+ g_free (remote_default_printer);
|
||||
+
|
||||
+ if (cups_backend->default_printer != NULL)
|
||||
+ {
|
||||
+ GtkPrinter *default_printer = NULL;
|
||||
+ default_printer = gtk_print_backend_find_printer (GTK_PRINT_BACKEND (cups_backend),
|
||||
+ cups_backend->default_printer);
|
||||
+ if (default_printer != NULL)
|
||||
+ {
|
||||
+ gtk_printer_set_is_default (default_printer, TRUE);
|
||||
+ g_signal_emit_by_name (GTK_PRINT_BACKEND (cups_backend),
|
||||
+ "printer-status-changed", default_printer);
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
GDK_THREADS_LEAVE ();
|
||||
}
|
||||
|
||||
|
@ -16,7 +16,7 @@
|
||||
Summary: The GIMP ToolKit (GTK+), a library for creating GUIs for X
|
||||
Name: gtk2
|
||||
Version: %{base_version}
|
||||
Release: 2%{?dist}
|
||||
Release: 3%{?dist}
|
||||
License: LGPLv2+
|
||||
Group: System Environment/Libraries
|
||||
Source: http://download.gnome.org/sources/gtk+/2.15/gtk+-%{version}.tar.bz2
|
||||
@ -297,6 +297,11 @@ rm -rf $RPM_BUILD_ROOT
|
||||
%{_datadir}/gtk-2.0
|
||||
|
||||
%changelog
|
||||
* Wed Jan 28 2009 Marek Kasik <mkasik@redhat.com> - 2.15.2-3
|
||||
- modify default_printer.patch to show a network default printer
|
||||
in the case of no local default printer
|
||||
- Resolves: #478400
|
||||
|
||||
* Tue Jan 27 2009 Matthias Clasen <mclasen@redhat.com> - 2.15.2-2
|
||||
- Fix togglebuttons causing crashes
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user