delorie.com/archives/browse.cgi   search  
Mail Archives: geda-user/2012/07/08/00:24:48

X-Authentication-Warning: delorie.com: mail set sender to geda-user-bounces using -f
X-Recipient: geda-user AT delorie DOT com
Date: Sat, 7 Jul 2012 21:18:30 -0700
From: Andrew Poelstra <asp11 AT sfu DOT ca>
To: geda-user AT delorie DOT com
Subject: Re: [geda-user] gtk hid file chooser problems
Message-ID: <20120708041830.GD1637@malakian.lan>
References: <4FF8B79E DOT 6000503 AT cox DOT net>
MIME-Version: 1.0
In-Reply-To: <4FF8B79E.6000503@cox.net>
User-Agent: Mutt/1.5.20 (2009-12-10)
Reply-To: geda-user AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: geda-user AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

On Sat, Jul 07, 2012 at 03:26:38PM -0700, Eric Brombaugh wrote:
> Hello list,
> 
> I'm a long-time user who's been off list for a while. I'm running
> the latest snapshot pcb-20110918. The tools have been "just working"
> for so long that I haven't needed any support. However, that changed
> recently when I updated my main linux machine to Fedora 17. F17 is
> GTK 3 based and it appears that the behavior of the file chooser
> dialog has changed in that it no longer defaults to the current
> directory when gtk_file_chooser_set_current_folder() isn't called to
> set it. Instead it presents you with a useless list of recently
> accessed files.
>

Yes, it's very, very irritating.
 
> On many apps this isn't a problem because they must always
> explicitly set the default, but the PCB gtk hid only calls the
> gtk_file_chooser_set_current_folder() function if there's a valid
> Settings.FilePath which usually isn't the case for me. That means
> every time I want to load a netlist or modified layout I have to
> navigate down to my working directory from the home directory.
> 
> 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?

>     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);
> ++  }
> 
> A similar fix is needed in the ghid_dialog_file_select_save() function.
> 
> I've been out of touch so long that there may be a more current
> source repo than that listed on the pcb.geda-project.org downloads
> page and this problem may have already been addressed. If so sorry
> for the noise.
>

Nope, it's still a current problem. It hasn't been fixed because
it seemed like it would make pcb inconsistent with other Gtk+
applications (we just use vi here, we wouldn't know ;)...).

But I'd like to have a default directory again, and if everyone
else is doing it, I'm happy to.

-- 
Andrew Poelstra
Email: asp11 at sfu.ca OR apoelstra at wpsoftware.net
Web:   http://www.wpsoftware.net/andrew
"You shouldn't trust every quote you read on the Internet." -- Socrates

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019