Open/Save As...: configure enter/double click to run the default action.

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@18952 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Geert Janssens 2010-03-22 20:31:10 +00:00
parent 4f01227882
commit c928dc6a26
2 changed files with 17 additions and 3 deletions

View File

@ -42,9 +42,6 @@ static QofLogModule log_module = GNC_MOD_GUI;
#define FILE_ACCESS_OPEN 0
#define FILE_ACCESS_SAVE_AS 1
void gnc_ui_file_access_response_cb( GtkDialog *, gint, GtkDialog * );
static void cb_uri_type_changed_cb( GtkComboBox* cb );
typedef struct FileAccessWindow
{
/* Parts of the dialog */
@ -61,6 +58,11 @@ typedef struct FileAccessWindow
GtkEntry* tf_password;
} FileAccessWindow;
void gnc_ui_file_access_file_activated_cb( GtkFileChooser *chooser,
FileAccessWindow *faw );
void gnc_ui_file_access_response_cb( GtkDialog *, gint, GtkDialog * );
static void cb_uri_type_changed_cb( GtkComboBox* cb );
static gchar*
geturl( FileAccessWindow* faw )
{
@ -95,6 +97,14 @@ geturl( FileAccessWindow* faw )
return url;
}
void
gnc_ui_file_access_file_activated_cb( GtkFileChooser *chooser, FileAccessWindow *faw )
{
g_return_if_fail( chooser != NULL );
gnc_ui_file_access_response_cb( GTK_DIALOG(faw->dialog), GTK_RESPONSE_OK, NULL );
}
void
gnc_ui_file_access_response_cb(GtkDialog *dialog, gint response, GtkDialog *unused)
{
@ -283,6 +293,8 @@ gnc_ui_file_access( int type )
fileChooser = GTK_FILE_CHOOSER_WIDGET(gtk_file_chooser_widget_new( fileChooserAction ));
faw->fileChooser = GTK_FILE_CHOOSER(fileChooser);
gtk_container_add( GTK_CONTAINER(align), GTK_WIDGET(fileChooser) );
g_object_connect( G_OBJECT(faw->fileChooser), "signal::file-activated",
gnc_ui_file_access_file_activated_cb, faw, NULL );
uri_type_container = glade_xml_get_widget( xml, "vb_uri_type_container" );
faw->cb_uri_type = GTK_COMBO_BOX(gtk_combo_box_new_text());

View File

@ -248,6 +248,8 @@
<property name="response_id">-5</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="can_default">True</property>
<property name="has_default">True</property>
<property name="receives_default">True</property>
<property name="use_stock">True</property>
</widget>