X-Authentication-Warning: delorie.com: mail set sender to geda-user-bounces using -f X-Recipient: geda-user AT delorie DOT com X-CT-Class: Clean X-CT-Score: 0.00 X-CT-RefID: str=0001.0A020206.4FF9B5D9.0051,ss=1,re=0.000,fgs=0 X-CT-Spam: 0 X-Authority-Analysis: v=1.1 cv=2cp5XZ03M2vnUJocAhlMkaMaDoAobX7R+Csg6TPaHnA= c=1 sm=1 a=8iEie87WbnsA:10 a=lmw7g597DrEA:10 a=G8Uczd0VNMoA:10 a=vIu8Bjv99zA89b1LPaaZoA==:17 a=6rXUY_8zWbdTUySbBCkA:9 a=wPNLvfGTeEIA:10 a=lUqTm3R3J3oGoWlmmj0A:9 a=QEXdDO2ut3YA:10 a=vIu8Bjv99zA89b1LPaaZoA==:117 X-CM-Score: 0.00 Authentication-Results: cox.net; none Message-ID: <4FF9B5D9.5050809@cox.net> Date: Sun, 08 Jul 2012 09:31:21 -0700 From: Eric Brombaugh User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:13.0) Gecko/20120615 Thunderbird/13.0.1 MIME-Version: 1.0 To: geda-user AT delorie DOT com Subject: [geda-user] [PATCH] gtk hid file chooser problems References: <4FF8B79E DOT 6000503 AT cox DOT net> <20120708041830 DOT GD1637 AT malakian DOT lan> In-Reply-To: <20120708041830.GD1637@malakian.lan> Content-Type: multipart/mixed; boundary="------------080304000309030508030705" Reply-To: geda-user AT delorie DOT com This is a multi-part message in MIME format. --------------080304000309030508030705 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit On 07/07/2012 09:18 PM, Andrew Poelstra wrote: > On Sat, Jul 07, 2012 at 03:26:38PM -0700, Eric Brombaugh wrote: >> >> To fix this, I added the following code to src/hid/gtk/gui-dialog.c >> in the ghid_dialog_file_select_open() function: > > Cool. Can you post a patch in proper diff format for us to apply? Attached, taken against the latest git. Eric --------------080304000309030508030705 Content-Type: text/plain; charset=UTF-8; name="pcb_file_chooser_patch.txt" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="pcb_file_chooser_patch.txt" diff --git a/src/hid/gtk/gui-dialog.c b/src/hid/gtk/gui-dialog.c index 247b961..2c27fcf 100644 --- a/src/hid/gtk/gui-dialog.c +++ b/src/hid/gtk/gui-dialog.c @@ -330,6 +330,15 @@ ghid_dialog_file_select_open (gchar * title, gchar ** path, gchar * shortcuts) if (path && *path) gtk_file_chooser_set_current_folder (GTK_FILE_CHOOSER (dialog), *path); + else + { + gchar *default_path; + gchar *uri; + default_path = g_file_new_for_path (g_get_current_dir()); + uri = g_file_get_uri (default_path); + gtk_file_chooser_set_current_folder_uri (GTK_FILE_CHOOSER (dialog), uri); + g_free (uri); + } if (shortcuts && *shortcuts) { @@ -406,6 +415,15 @@ ghid_dialog_file_select_multiple(gchar * title, gchar ** path, gchar * shortcuts if (path && *path) gtk_file_chooser_set_current_folder (GTK_FILE_CHOOSER (dialog), *path); + else + { + gchar *default_path; + gchar *uri; + default_path = g_file_new_for_path (g_get_current_dir()); + uri = g_file_get_uri (default_path); + gtk_file_chooser_set_current_folder_uri (GTK_FILE_CHOOSER (dialog), uri); + g_free (uri); + } if (shortcuts && *shortcuts) { @@ -461,6 +479,15 @@ ghid_dialog_file_select_save (gchar * title, gchar ** path, gchar * file, if (path && *path && **path) gtk_file_chooser_set_current_folder (GTK_FILE_CHOOSER (dialog), *path); + else + { + gchar *default_path; + gchar *uri; + default_path = g_file_new_for_path (g_get_current_dir()); + uri = g_file_get_uri (default_path); + gtk_file_chooser_set_current_folder_uri (GTK_FILE_CHOOSER (dialog), uri); + g_free (uri); + } if (file && *file) { --------------080304000309030508030705--