Have the Post date widget grab the focus by default when opening the post invoice dialog.

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@18639 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Geert Janssens 2010-02-10 22:55:11 +00:00
parent fb8d635294
commit 625af3b4e7
3 changed files with 19 additions and 1 deletions

View File

@ -323,6 +323,9 @@ gnc_dialog_dates_acct_question_parented (GtkWidget *parent, const char *message,
gtk_widget_show_all (ddc->dialog); gtk_widget_show_all (ddc->dialog);
/* Set the focus on the date widget */
gnc_date_grab_focus (GNC_DATE_EDIT (ddc->post_date));
ddc->retval = FALSE; ddc->retval = FALSE;
while (gtk_dialog_run (GTK_DIALOG (ddc->dialog)) == GTK_RESPONSE_OK) { while (gtk_dialog_run (GTK_DIALOG (ddc->dialog)) == GTK_RESPONSE_OK) {
/* If reponse is OK but flag is not set, try again */ /* If reponse is OK but flag is not set, try again */

View File

@ -1198,7 +1198,7 @@ gnc_date_edit_get_flags (GNCDateEdit *gde)
/** /**
* gnc_date_set_activates_default: * gnc_date_set_activates_default:
* @gde: The date editor to modity * @gde: The date editor to modify
* @state: The new state for this widget. * @state: The new state for this widget.
* *
* Extracts the editable field from a GNCDateEdit widget, and sets it * Extracts the editable field from a GNCDateEdit widget, and sets it
@ -1214,7 +1214,21 @@ gnc_date_activates_default (GNCDateEdit *gde, gboolean state)
gtk_entry_set_activates_default(GTK_ENTRY(gde->date_entry), state); gtk_entry_set_activates_default(GTK_ENTRY(gde->date_entry), state);
} }
/**
* gnc_date_grab_focus:
* @gde: The date editor to modify
* @state: The new state for this widget.
*
* Sets the focus to the Editable field.
**/
void
gnc_date_grab_focus (GNCDateEdit *gde)
{
if (!gde)
return;
gtk_widget_grab_focus (gde->date_entry);
}
/** Sets the editable field from a GNCDateEdit widget as the target /** Sets the editable field from a GNCDateEdit widget as the target
* for the specified label's access key. * for the specified label's access key.
* *

View File

@ -134,6 +134,7 @@ void gnc_date_edit_set_flags (GNCDateEdit *gde,
int gnc_date_edit_get_flags (GNCDateEdit *gde); int gnc_date_edit_get_flags (GNCDateEdit *gde);
void gnc_date_activates_default (GNCDateEdit *gde, gboolean state); void gnc_date_activates_default (GNCDateEdit *gde, gboolean state);
void gnc_date_grab_focus (GNCDateEdit *gde);
void gnc_date_make_mnemonic_target (GNCDateEdit *gde, GtkWidget *label); void gnc_date_make_mnemonic_target (GNCDateEdit *gde, GtkWidget *label);
#endif #endif