r18952 - gnucash/trunk/src/gnome-utils - Open/Save As...: configure enter/double click to run the default action.
Geert Janssens
gjanssens at code.gnucash.org
Mon Mar 22 16:31:10 EDT 2010
Author: gjanssens
Date: 2010-03-22 16:31:10 -0400 (Mon, 22 Mar 2010)
New Revision: 18952
Trac: http://svn.gnucash.org/trac/changeset/18952
Modified:
gnucash/trunk/src/gnome-utils/dialog-file-access.c
gnucash/trunk/src/gnome-utils/glade/dialog-file-access.glade
Log:
Open/Save As...: configure enter/double click to run the default action.
Modified: gnucash/trunk/src/gnome-utils/dialog-file-access.c
===================================================================
--- gnucash/trunk/src/gnome-utils/dialog-file-access.c 2010-03-22 14:44:56 UTC (rev 18951)
+++ gnucash/trunk/src/gnome-utils/dialog-file-access.c 2010-03-22 20:31:10 UTC (rev 18952)
@@ -42,9 +42,6 @@
#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 @@
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 )
{
@@ -96,6 +98,14 @@
}
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)
{
FileAccessWindow* faw;
@@ -283,6 +293,8 @@
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());
Modified: gnucash/trunk/src/gnome-utils/glade/dialog-file-access.glade
===================================================================
--- gnucash/trunk/src/gnome-utils/glade/dialog-file-access.glade 2010-03-22 14:44:56 UTC (rev 18951)
+++ gnucash/trunk/src/gnome-utils/glade/dialog-file-access.glade 2010-03-22 20:31:10 UTC (rev 18952)
@@ -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>
More information about the gnucash-changes
mailing list