make sticky keys and slow keys dialog more HIG compliant and usable
2005-03-23 Carlos Garnacho Parro <carlosg@gnome.org> * gnome-settings-accessibility-keyboard.c: make sticky keys and slow keys dialog more HIG compliant and usable (selectable text, no separator, making ESC key close the dialog, separation between widgets, etc...)
This commit is contained in:
parent
49601b934d
commit
9266532462
2 changed files with 43 additions and 61 deletions
|
@ -1,3 +1,10 @@
|
||||||
|
2005-03-23 Carlos Garnacho Parro <carlosg@gnome.org>
|
||||||
|
|
||||||
|
* gnome-settings-accessibility-keyboard.c: make sticky keys and slow
|
||||||
|
keys dialog more HIG compliant and usable (selectable text, no
|
||||||
|
separator, making ESC key close the dialog, separation between
|
||||||
|
widgets, etc...)
|
||||||
|
|
||||||
2005-06-06 Rodrigo Moya <rodrigo@novell.com>
|
2005-06-06 Rodrigo Moya <rodrigo@novell.com>
|
||||||
|
|
||||||
* GNOME_Settings_Daemon.server.in: added name and description
|
* GNOME_Settings_Daemon.server.in: added name and description
|
||||||
|
|
|
@ -48,10 +48,6 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static int xkbEventBase;
|
static int xkbEventBase;
|
||||||
static GtkWidget *ax_slowkeys_dialog = NULL;
|
|
||||||
static GtkWidget *ax_slowkeys_dialog_hbox = NULL;
|
|
||||||
static GtkWidget *ax_stickykeys_dialog = NULL;
|
|
||||||
static GtkWidget *ax_stickykeys_dialog_hbox = NULL;
|
|
||||||
static gboolean stickykeys_shortcut_val;
|
static gboolean stickykeys_shortcut_val;
|
||||||
static gboolean slowkeys_shortcut_val;
|
static gboolean slowkeys_shortcut_val;
|
||||||
|
|
||||||
|
@ -299,6 +295,7 @@ ax_response_callback (gint response_id, guint revert_controls_mask, gboolean ena
|
||||||
|
|
||||||
switch (response_id)
|
switch (response_id)
|
||||||
{
|
{
|
||||||
|
case GTK_RESPONSE_DELETE_EVENT:
|
||||||
case GTK_RESPONSE_REJECT:
|
case GTK_RESPONSE_REJECT:
|
||||||
case GTK_RESPONSE_CANCEL:
|
case GTK_RESPONSE_CANCEL:
|
||||||
{
|
{
|
||||||
|
@ -353,59 +350,38 @@ static void
|
||||||
ax_stickykeys_response (GtkDialog *dialog, gint response_id, gpointer data)
|
ax_stickykeys_response (GtkDialog *dialog, gint response_id, gpointer data)
|
||||||
{
|
{
|
||||||
gboolean *enabled = data;
|
gboolean *enabled = data;
|
||||||
|
|
||||||
if (ax_response_callback (response_id, XkbStickyKeysMask, *enabled))
|
if (ax_response_callback (response_id, XkbStickyKeysMask, *enabled))
|
||||||
{
|
gtk_widget_destroy (GTK_WIDGET (dialog));
|
||||||
gtk_widget_destroy (ax_stickykeys_dialog);
|
|
||||||
ax_stickykeys_dialog = NULL;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
ax_slowkeys_response (GtkDialog *dialog, gint response_id, gpointer data)
|
ax_slowkeys_response (GtkDialog *dialog, gint response_id, gpointer data)
|
||||||
{
|
{
|
||||||
gboolean *enabled = data;
|
gboolean *enabled = data;
|
||||||
|
|
||||||
if (ax_response_callback (response_id, XkbSlowKeysMask, *enabled))
|
if (ax_response_callback (response_id, XkbSlowKeysMask, *enabled))
|
||||||
{
|
gtk_widget_destroy (GTK_WIDGET (dialog));
|
||||||
gtk_widget_destroy (ax_slowkeys_dialog);
|
|
||||||
ax_slowkeys_dialog = NULL;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static GtkWidget*
|
static GtkWidget*
|
||||||
warning_dialog_post (GtkWidget *dialog, GtkWidget **hbox, GCallback response,
|
warning_dialog_post (GCallback response, gboolean *enabled,
|
||||||
gboolean *enabled, gchar *title, gchar *user_action_string, gchar *query)
|
gchar *title, gchar *user_action_string, gchar *query)
|
||||||
{
|
{
|
||||||
GtkWidget *label;
|
GtkWidget *dialog;
|
||||||
gchar *label_markup_string = g_strconcat ("<span weight=\"bold\" size=\"larger\">",
|
|
||||||
query, "</span>\n\n", user_action_string, NULL);
|
|
||||||
|
|
||||||
if (!dialog)
|
dialog = gtk_message_dialog_new (NULL, 0,
|
||||||
{
|
GTK_MESSAGE_WARNING,
|
||||||
dialog = gtk_dialog_new_with_buttons (title, NULL, 0,
|
GTK_BUTTONS_OK_CANCEL,
|
||||||
GTK_STOCK_CANCEL,
|
query);
|
||||||
GTK_RESPONSE_REJECT,
|
gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog), user_action_string);
|
||||||
GTK_STOCK_HELP,
|
gtk_dialog_add_button (GTK_DIALOG (dialog), GTK_STOCK_HELP, GTK_RESPONSE_HELP);
|
||||||
GTK_RESPONSE_HELP,
|
gtk_window_set_title (GTK_WINDOW (dialog), title);
|
||||||
GTK_STOCK_OK,
|
|
||||||
GTK_RESPONSE_OK,
|
gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_OK);
|
||||||
NULL);
|
|
||||||
g_signal_connect (G_OBJECT (dialog),
|
g_signal_connect (G_OBJECT (dialog), "response",
|
||||||
"response",
|
G_CALLBACK (response), enabled);
|
||||||
G_CALLBACK (response),
|
|
||||||
enabled);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
gtk_widget_destroy (*hbox);
|
|
||||||
}
|
|
||||||
*hbox = gtk_hbox_new (FALSE, 10);
|
|
||||||
gtk_container_add (GTK_CONTAINER (*hbox), gtk_image_new_from_stock (GTK_STOCK_DIALOG_WARNING, GTK_ICON_SIZE_DIALOG));
|
|
||||||
label = gtk_label_new (NULL);
|
|
||||||
gtk_label_set_line_wrap (GTK_LABEL (label), TRUE);
|
|
||||||
gtk_label_set_markup (GTK_LABEL (label), label_markup_string);
|
|
||||||
g_free (label_markup_string);
|
|
||||||
gtk_container_add (GTK_CONTAINER (*hbox), label);
|
|
||||||
gtk_container_add (GTK_CONTAINER (GTK_DIALOG (dialog)->vbox), *hbox);
|
|
||||||
gtk_widget_show_all (dialog);
|
gtk_widget_show_all (dialog);
|
||||||
|
|
||||||
return dialog;
|
return dialog;
|
||||||
|
@ -415,29 +391,28 @@ static void
|
||||||
ax_slowkeys_warning_dialog_post (gboolean enabled)
|
ax_slowkeys_warning_dialog_post (gboolean enabled)
|
||||||
{
|
{
|
||||||
slowkeys_shortcut_val = enabled;
|
slowkeys_shortcut_val = enabled;
|
||||||
ax_slowkeys_dialog = warning_dialog_post (ax_slowkeys_dialog,
|
warning_dialog_post ((GCallback) ax_slowkeys_response,
|
||||||
&ax_slowkeys_dialog_hbox,
|
&slowkeys_shortcut_val,
|
||||||
(GCallback) ax_slowkeys_response,
|
_("Slow Keys Alert"),
|
||||||
&slowkeys_shortcut_val,
|
_("You just held down the Shift key for 8 seconds. This is the shortcut "
|
||||||
_("Slow Keys Alert"),
|
"for the Slow Keys feature, which affects the way your keyboard works."),
|
||||||
_("You just held down the Shift key for 8 seconds. This is the shortcut for the Slow Keys feature, which affects the way your keyboard works."),
|
enabled ? _("Do you want to activate Slow Keys?") :
|
||||||
enabled ? _("Do you want to activate Slow Keys?") :
|
_("Do you want to deactivate Slow Keys?"));
|
||||||
_("Do you want to deactivate Slow Keys?"));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
ax_stickykeys_warning_dialog_post (gboolean enabled)
|
ax_stickykeys_warning_dialog_post (gboolean enabled)
|
||||||
{
|
{
|
||||||
stickykeys_shortcut_val = enabled;
|
stickykeys_shortcut_val = enabled;
|
||||||
ax_stickykeys_dialog = warning_dialog_post (ax_stickykeys_dialog,
|
warning_dialog_post ((GCallback) ax_stickykeys_response,
|
||||||
&ax_stickykeys_dialog_hbox,
|
&stickykeys_shortcut_val,
|
||||||
(GCallback) ax_stickykeys_response,
|
_("Sticky Keys Alert"),
|
||||||
&stickykeys_shortcut_val,
|
enabled ? _("You just pressed the Shift key 5 times in a row. This is the shortcut "
|
||||||
_("Sticky Keys Alert"),
|
"for the Sticky Keys feature, which affects the way your keyboard works.") :
|
||||||
enabled ? _("You just pressed the Shift key 5 times in a row. This is the shortcut for the Sticky Keys feature, which affects the way your keyboard works.") :
|
_("You just pressed two keys at once, or pressed the Shift key 5 times in a row. "
|
||||||
_("You just pressed two keys at once, or pressed the Shift key 5 times in a row. This turns off the Sticky Keys feature, which affects the way your keyboard works."),
|
"This turns off the Sticky Keys feature, which affects the way your keyboard works."),
|
||||||
enabled ? _("Do you want to activate Sticky Keys?") :
|
enabled ? _("Do you want to activate Sticky Keys?") :
|
||||||
_("Do you want to deactivate Sticky Keys?"));
|
_("Do you want to deactivate Sticky Keys?"));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue