mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-11-06 00:30:08 +00:00
Simplify, make it build against cups 1.1. (#350329)
2006-08-15 Matthias Clasen <mclasen@redhat.com> * modules/printbackends/cups/gtkprintbackendcups.c (create_pickone_option): Simplify, make it build against cups 1.1. (#350329)
This commit is contained in:
parent
dd0aab11cc
commit
430a9d5ea8
@ -1,5 +1,8 @@
|
||||
2006-08-15 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* modules/printbackends/cups/gtkprintbackendcups.c (create_pickone_option):
|
||||
Simplify, make it build against cups 1.1. (#350329)
|
||||
|
||||
* gtk/gtkliststore.c (gtk_list_store_insert_with_values):
|
||||
Fix a typo in the docs. (#349501, Carlos GUSLiBu)
|
||||
|
||||
|
@ -1,5 +1,8 @@
|
||||
2006-08-15 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* modules/printbackends/cups/gtkprintbackendcups.c (create_pickone_option):
|
||||
Simplify, make it build against cups 1.1. (#350329)
|
||||
|
||||
* gtk/gtkliststore.c (gtk_list_store_insert_with_values):
|
||||
Fix a typo in the docs. (#349501, Carlos GUSLiBu)
|
||||
|
||||
|
@ -1824,18 +1824,19 @@ available_choices (ppd_file_t *ppd,
|
||||
return option->num_choices - num_conflicts + add_auto;
|
||||
}
|
||||
|
||||
#if HAVE_CUPS_API_1_2
|
||||
static GtkPrinterOption *
|
||||
create_pickone_option_custom (ppd_file_t *ppd_file,
|
||||
ppd_option_t *ppd_option,
|
||||
ppd_coption_t *coption,
|
||||
const gchar *gtk_name)
|
||||
create_pickone_option (ppd_file_t *ppd_file,
|
||||
ppd_option_t *ppd_option,
|
||||
const gchar *gtk_name)
|
||||
{
|
||||
GtkPrinterOption *option;
|
||||
ppd_choice_t **available;
|
||||
char *label;
|
||||
int n_choices;
|
||||
int i;
|
||||
#ifdef HAVE_CUPS_API_1_2
|
||||
ppd_coption_t *coption;
|
||||
#endif
|
||||
|
||||
g_assert (ppd_option->ui == PPD_UI_PICKONE);
|
||||
|
||||
@ -1844,15 +1845,20 @@ create_pickone_option_custom (ppd_file_t *ppd_file,
|
||||
n_choices = available_choices (ppd_file, ppd_option, &available, g_str_has_prefix (gtk_name, "gtk-"));
|
||||
if (n_choices > 0)
|
||||
{
|
||||
ppd_cparam_t *cparam;
|
||||
|
||||
label = get_option_text (ppd_file, ppd_option);
|
||||
|
||||
/* right now only support one parameter per custom option
|
||||
* if more than one print warning and only offer the default choices
|
||||
*/
|
||||
|
||||
label = get_option_text (ppd_file, ppd_option);
|
||||
|
||||
#ifdef HAVE_CUPS_API_1_2
|
||||
coption = ppdFindCustomOption (ppd_file, ppd_option->keyword);
|
||||
|
||||
if (coption)
|
||||
{
|
||||
ppd_cparam_t *cparam;
|
||||
|
||||
cparam = ppdFirstCustomParam (coption);
|
||||
|
||||
if (ppdNextCustomParam (coption) == NULL)
|
||||
@ -1893,6 +1899,7 @@ create_pickone_option_custom (ppd_file_t *ppd_file,
|
||||
else
|
||||
g_warning ("Not Supported: PPD Custom Option has more than one parameter");
|
||||
}
|
||||
#endif /* HAVE_CUPS_API_1_2 */
|
||||
|
||||
if (!option)
|
||||
option = gtk_printer_option_new (gtk_name, label,
|
||||
@ -1924,19 +1931,6 @@ create_pickone_option_custom (ppd_file_t *ppd_file,
|
||||
|
||||
return option;
|
||||
}
|
||||
#endif /* HAVE_CUPS_API_1_2 */
|
||||
|
||||
static GtkPrinterOption *
|
||||
create_pickone_option (ppd_file_t *ppd_file,
|
||||
ppd_option_t *ppd_option,
|
||||
const gchar *gtk_name)
|
||||
{
|
||||
GtkPrinterOption *option;
|
||||
|
||||
option = create_pickone_option_custom (ppd_file, ppd_option, NULL, gtk_name);
|
||||
|
||||
return option;
|
||||
}
|
||||
|
||||
static GtkPrinterOption *
|
||||
create_boolean_option (ppd_file_t *ppd_file,
|
||||
@ -2019,11 +2013,6 @@ handle_option (GtkPrinterOptionSet *set,
|
||||
GtkPrinterOption *option;
|
||||
char *name;
|
||||
|
||||
#ifdef HAVE_CUPS_API_1_2
|
||||
ppd_coption_t *coption = NULL;
|
||||
coption = ppdFindCustomOption (ppd_file, ppd_option->keyword);
|
||||
#endif
|
||||
|
||||
if (STRING_IN_TABLE (ppd_option->keyword, cups_option_blacklist))
|
||||
return;
|
||||
|
||||
@ -2032,12 +2021,7 @@ handle_option (GtkPrinterOptionSet *set,
|
||||
option = NULL;
|
||||
if (ppd_option->ui == PPD_UI_PICKONE)
|
||||
{
|
||||
#ifdef HAVE_CUPS_API_1_2
|
||||
if (coption)
|
||||
option = create_pickone_option_custom (ppd_file, ppd_option, coption, name);
|
||||
else
|
||||
#endif
|
||||
option = create_pickone_option (ppd_file, ppd_option, name);
|
||||
option = create_pickone_option (ppd_file, ppd_option, name);
|
||||
}
|
||||
else if (ppd_option->ui == PPD_UI_BOOLEAN)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user