Skip to content

Commit

Permalink
Open/Save As...: configure enter/double click to run the default action.
Browse files Browse the repository at this point in the history
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@18952 57a11ea4-9604-0410-9ed3-97b8803252fd
  • Loading branch information
gjanssens committed Mar 22, 2010
1 parent 4f01227 commit c928dc6
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
18 changes: 15 additions & 3 deletions src/gnome-utils/dialog-file-access.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand All @@ -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 )
{
Expand Down Expand Up @@ -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)
{
Expand Down Expand Up @@ -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());
Expand Down
2 changes: 2 additions & 0 deletions src/gnome-utils/glade/dialog-file-access.glade
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down

0 comments on commit c928dc6

Please sign in to comment.