Author Topic: File Open Dialog Default Path  (Read 4982 times)

Offline swbrains

  • Newbie
  • *
  • Posts: 17
  • Karma: +0/-0
File Open Dialog Default Path
« on: June 15, 2011, 01:53:09 AM »
Whenever I click the open file dialog button on the toolbar (or CTRL+O), it defaults to the HippoEdit directory.  Any way to have it match the File Explorer default directory or to specify where to default to?

Thanks!

Offline Arthur

  • Registered User
  • Hero Member
  • *
  • Posts: 653
  • Karma: +1/-0
  • He who is ashamed of asking is afraid of learning.
    • My Blog
Re: File Open Dialog Default Path
« Reply #1 on: June 15, 2011, 02:10:54 AM »
You can make HippoEdit open a certain directory by default on the Open Command.
To do so you need to go to the Tools menu item in the tool bar, then Options -> Document. In the Working Directory specify or navigate to the path you want HippoEdit to use as a start location next time you Ctrl-O.
To match to the file in the File Explorer I think is a redundant request IMHO because you can simply open any file from there, e.g. by HippoEDITging and dropping it into the HE canvas.

Offline alex

  • Developer
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2215
  • Karma: +37/-3
    • HippoEDIT
Re: File Open Dialog Default Path
« Reply #2 on: June 22, 2011, 03:00:39 AM »
Thanks Arthur!

Just want to add, there is another way to maintain initial directory for File Open dialog:
Tools->Options->General->File Open/Save initial directory. If this is not set, Working directory from Document settings or Project setting used.

As far as I remember, it is really missing, synchronization of the Last Used directory and active directory of the File Explorer. Probably because I forget, or decide that these are independent features and should no be mixed... But maybe I will change this (File Explorer active directory would influence Last Used directory) for 1.50. But I do not know if it would be really useful, when last directory would change every time user switches documents and Follow Active document from File Explorer is enabled.. It will behave same like "Use current file dir" for File Open/Save dialog and nobody will be able to understand this...

Offline swu

  • Newbie
  • *
  • Posts: 21
  • Karma: +0/-0
Re: File Open Dialog Default Path
« Reply #3 on: March 09, 2012, 10:00:00 PM »
My setting for File Open/Save is "Current File Directory" but it is not working.  Is this a known bug?  I have lastest 1.49.830 on Vista.

Upon further investigation, I realize HE used the current project file location instead of current file location.  Please fix this behavior.
« Last Edit: March 09, 2012, 10:02:01 PM by swu »

Offline alex

  • Developer
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2215
  • Karma: +37/-3
    • HippoEDIT
Re: File Open Dialog Default Path
« Reply #4 on: March 09, 2012, 10:18:42 PM »
Hello swu,

by me, using 1.49.830, on Window 7, with or without open project works fine. For Current File location or Last used Location. Tested with file Open.

What you have tried:
- File Open or File Save As ?
- What is a folder location your current file is (is the problem consistent or depends on file location)?
- Do you have project open?
- Do you have Working Directory maintained for Project or for Document (global settings)?

BR, Alex

Offline swu

  • Newbie
  • *
  • Posts: 21
  • Karma: +0/-0
Re: File Open Dialog Default Path
« Reply #5 on: March 10, 2012, 03:59:33 AM »
Hi Alex,

Please see how I reproduced the issue:

http://screencast.com/t/zZsOCHcpmPY

thanks.

Offline alex

  • Developer
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2215
  • Karma: +37/-3
    • HippoEDIT
Re: File Open Dialog Default Path
« Reply #6 on: March 10, 2012, 07:04:45 PM »
Hello swu,

please check what you have in Project->Options->Working Directory and in Tools->Options->Document Working Directory.
These settings, if set, overwrite initial directory selection for File Save (but not File Open). Looks like that you have there something.

P.S: I think, to avoid such problems, I will replace current option for This directory with Working Directory option. It will be more logical.

Offline swu

  • Newbie
  • *
  • Posts: 21
  • Karma: +0/-0
Re: File Open Dialog Default Path
« Reply #7 on: March 15, 2012, 12:08:14 AM »
Hi Alex,

I guess my anticipation of 'Project' is a way to gather files that don't belong to a single folder.  If all the project files are under the same directory, I can just use File Explorer to manage them without the trouble setting up a project.

One might argue that project has controls over what files are in/out, but I can use filters and naming for that.

What bothers me is that the current way HE takes care of files in a project by assuming them are all related to the physical location of project management file (*.heprj) .  If I alter the 'Working Directory' of a project, all files managed by the project become orphant as their paths become invalid.

Please reconsider how HE can sovle this usecase:

1. user has 10 files under 3 physical directories.  (e.g. C:\work, C:\home, E:\other)
2. user creates a project which manages above files (e.g. under (C:\Documents\mywork.heprj)
3. user opens/edits 1 of that 10 files (e.g. C:\work\file1.txt), then wantting to save a copy in the same directory (C:\work)

Now HE prompts C:\Documents as the location of new copy, it doesn't matter if I opened C:\home\file2.txt or E:\other\file3.txt.


« Last Edit: March 15, 2012, 01:51:54 AM by swu »

Offline alex

  • Developer
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2215
  • Karma: +37/-3
    • HippoEDIT
Re: File Open Dialog Default Path
« Reply #8 on: March 15, 2012, 01:54:30 AM »
Hi swu,

what do you have as Working directory for your project (Project->Properties->Working Directory) and what as global Working directory (Tools->Options->Document->Working Directory)?

If you change Working Directory in HE (in Projects Settings) and after this file paths became invalid - this is a bug. But should not be.
If you do this manually in project file - hm.. this your fault ;)
« Last Edit: March 15, 2012, 01:57:00 AM by alex »

Offline swu

  • Newbie
  • *
  • Posts: 21
  • Karma: +0/-0
Re: File Open Dialog Default Path
« Reply #9 on: March 15, 2012, 03:10:53 AM »
Hi Alex,

My settings:
Generatl:Document:Working Directory >> empty
Project Working Directory >> empty

I created a test project and added files from different directories:
  C:\testhe\myproj.heprj
  C:\work1\test1.txt
  C:\work1\test1.txt.orig
  C:\work2\test2.txt

The content of the HE project says HE remembers relative path instead of full path  ???,  is there a logical reason for that design?

<XMLConfigSettings>
        <FILEINFO type="ProjectFile"/>
        <Properties>
                <RootDirectory>C:\\TestHE</RootDirectory>
                <CRLFMode>-1</CRLFMode>
        </Properties>
        <NODES>
                <File name="..\\work1\\test1.txt"/>
                <Folder open="true" name="backup">
                        <File name="..\\work1\\test1.txt.orig"/>
                </Folder>
                <File name="..\\work2\\test2.txt"/>
        </NODES>
</XMLConfigSettings>

Offline alex

  • Developer
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2215
  • Karma: +37/-3
    • HippoEDIT
Re: File Open Dialog Default Path
« Reply #10 on: March 15, 2012, 03:58:08 AM »
Quote
The content of the HE project says HE remembers relative path instead of full path  ,  is there a logical reason for that design?
Of course. This is standard way by most of the editors, Visual Studio etc. It allows to store project files into CVSs or move projects.
Files are relative to RootDirectory.

With this test project do you have problem with initial directory when saving files?
I assume you have "Use current file directory" as selection for "File Open/Save initial directory".

How about Working Directory and invalid file paths?

Offline swu

  • Newbie
  • *
  • Posts: 21
  • Karma: +0/-0
Re: File Open Dialog Default Path
« Reply #11 on: March 16, 2012, 04:58:10 AM »
Which path should be project's 'root directory'?  Is it project file's location or project working directory?  (although by experiment I knew the root directory is changed as I enter different working directory for project properties, which is still a surprise to me)

Offline alex

  • Developer
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2215
  • Karma: +37/-3
    • HippoEDIT
Re: File Open Dialog Default Path
« Reply #12 on: March 16, 2012, 04:09:34 PM »
Hello swu,

I will be very graceful, if you would answer my questions also, but not only ask new ones ;)

Yes, if Working directory is set, it value used as RootDirectory, because normally people will have their files closer to it, as to to RootDirectory. So paths will be shorter. If WorkDirectory is empty, than RootDirectory path to project file location.
And what? RootDirectory is a internal variable used by HE, not shown somewhere in UI. If you do not manipulate with project files manually, this should not matter. Or I miss something?

BR, Alex.