forked from AuroraMiddleware/gtk
Improve accessibility of the print dialog
Add accessible name and description to the "Pages" and "At" entries, and improve focus handling. (#577964)
This commit is contained in:
parent
45ac4f2523
commit
b9355968fc
@ -1121,16 +1121,9 @@ setup_print_at (GtkPrintUnixDialog *dialog)
|
|||||||
|
|
||||||
priv->updating_print_at = TRUE;
|
priv->updating_print_at = TRUE;
|
||||||
|
|
||||||
if (gtk_printer_option_has_choice (option, "at"))
|
|
||||||
{
|
|
||||||
gtk_widget_set_sensitive (priv->print_at_radio, TRUE);
|
|
||||||
gtk_widget_set_sensitive (priv->print_at_entry, TRUE);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
gtk_widget_set_sensitive (priv->print_at_radio, FALSE);
|
|
||||||
gtk_widget_set_sensitive (priv->print_at_entry, FALSE);
|
gtk_widget_set_sensitive (priv->print_at_entry, FALSE);
|
||||||
}
|
gtk_widget_set_sensitive (priv->print_at_radio,
|
||||||
|
gtk_printer_option_has_choice (option, "at"));
|
||||||
|
|
||||||
gtk_widget_set_sensitive (priv->print_hold_radio,
|
gtk_widget_set_sensitive (priv->print_hold_radio,
|
||||||
gtk_printer_option_has_choice (option, "on-hold"));
|
gtk_printer_option_has_choice (option, "on-hold"));
|
||||||
@ -1149,8 +1142,7 @@ setup_print_at (GtkPrintUnixDialog *dialog)
|
|||||||
|
|
||||||
option = gtk_printer_option_set_lookup (priv->options, "gtk-print-time-text");
|
option = gtk_printer_option_set_lookup (priv->options, "gtk-print-time-text");
|
||||||
if (option != NULL)
|
if (option != NULL)
|
||||||
gtk_entry_set_text (GTK_ENTRY (priv->print_at_entry),
|
gtk_entry_set_text (GTK_ENTRY (priv->print_at_entry), option->value);
|
||||||
option->value);
|
|
||||||
|
|
||||||
|
|
||||||
priv->updating_print_at = FALSE;
|
priv->updating_print_at = FALSE;
|
||||||
@ -1687,7 +1679,7 @@ gtk_print_unix_dialog_style_set (GtkWidget *widget,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
update_range_sensitivity (GtkWidget *button,
|
update_entry_sensitivity (GtkWidget *button,
|
||||||
GtkWidget *range)
|
GtkWidget *range)
|
||||||
{
|
{
|
||||||
gboolean active;
|
gboolean active;
|
||||||
@ -1840,13 +1832,15 @@ create_main_page (GtkPrintUnixDialog *dialog)
|
|||||||
0, 0);
|
0, 0);
|
||||||
entry = gtk_entry_new ();
|
entry = gtk_entry_new ();
|
||||||
gtk_widget_set_tooltip_text (entry, range_tooltip);
|
gtk_widget_set_tooltip_text (entry, range_tooltip);
|
||||||
|
atk_object_set_name (gtk_widget_get_accessible (entry), _("Pages"));
|
||||||
|
atk_object_set_description (gtk_widget_get_accessible (entry), range_tooltip);
|
||||||
priv->page_range_entry = entry;
|
priv->page_range_entry = entry;
|
||||||
gtk_widget_show (entry);
|
gtk_widget_show (entry);
|
||||||
gtk_table_attach (GTK_TABLE (table), entry,
|
gtk_table_attach (GTK_TABLE (table), entry,
|
||||||
1, 2, 2, 3, GTK_FILL, 0,
|
1, 2, 2, 3, GTK_FILL, 0,
|
||||||
0, 0);
|
0, 0);
|
||||||
g_signal_connect (radio, "toggled", G_CALLBACK (update_range_sensitivity), entry);
|
g_signal_connect (radio, "toggled", G_CALLBACK (update_entry_sensitivity), entry);
|
||||||
update_range_sensitivity (radio, entry);
|
update_entry_sensitivity (radio, entry);
|
||||||
|
|
||||||
table = gtk_table_new (3, 2, FALSE);
|
table = gtk_table_new (3, 2, FALSE);
|
||||||
gtk_table_set_row_spacings (GTK_TABLE (table), 6);
|
gtk_table_set_row_spacings (GTK_TABLE (table), 6);
|
||||||
@ -2768,7 +2762,8 @@ create_job_page (GtkPrintUnixDialog *dialog)
|
|||||||
_("A_t:"));
|
_("A_t:"));
|
||||||
|
|
||||||
/* Translators: Ability to parse the am/pm format depends on actual locale.
|
/* Translators: Ability to parse the am/pm format depends on actual locale.
|
||||||
* You can remove the am/pm values below for your locale if they are not supported.
|
* You can remove the am/pm values below for your locale if they are not
|
||||||
|
* supported.
|
||||||
*/
|
*/
|
||||||
at_tooltip = _("Specify the time of print,\n e.g. 15:30, 2:35 pm, 14:15:20, 11:46:30 am, 4 pm");
|
at_tooltip = _("Specify the time of print,\n e.g. 15:30, 2:35 pm, 14:15:20, 11:46:30 am, 4 pm");
|
||||||
gtk_widget_set_tooltip_text (radio, at_tooltip);
|
gtk_widget_set_tooltip_text (radio, at_tooltip);
|
||||||
@ -2780,12 +2775,17 @@ create_job_page (GtkPrintUnixDialog *dialog)
|
|||||||
|
|
||||||
entry = gtk_entry_new ();
|
entry = gtk_entry_new ();
|
||||||
gtk_widget_set_tooltip_text (entry, at_tooltip);
|
gtk_widget_set_tooltip_text (entry, at_tooltip);
|
||||||
|
atk_object_set_name (gtk_widget_get_accessible (entry), _("At"));
|
||||||
|
atk_object_set_description (gtk_widget_get_accessible (entry), at_tooltip);
|
||||||
priv->print_at_entry = entry;
|
priv->print_at_entry = entry;
|
||||||
gtk_widget_show (entry);
|
gtk_widget_show (entry);
|
||||||
gtk_table_attach (GTK_TABLE (table), entry,
|
gtk_table_attach (GTK_TABLE (table), entry,
|
||||||
1, 2, 1, 2, GTK_FILL, 0,
|
1, 2, 1, 2, GTK_FILL, 0,
|
||||||
0, 0);
|
0, 0);
|
||||||
|
|
||||||
|
g_signal_connect (radio, "toggled", G_CALLBACK (update_entry_sensitivity), entry);
|
||||||
|
update_entry_sensitivity (radio, entry);
|
||||||
|
|
||||||
/* Translators: this is one of the choices for the print at option
|
/* Translators: this is one of the choices for the print at option
|
||||||
* in the print dialog. It means that the print job will not be
|
* in the print dialog. It means that the print job will not be
|
||||||
* printed until it explicitly gets 'released'.
|
* printed until it explicitly gets 'released'.
|
||||||
|
Loading…
Reference in New Issue
Block a user