On 04/21/2016 04:38 AM, D M German wrote:
> By the way, there is one annoyance that drives me crazy. I would like
> some way to override xournal default directory to indicate it is the
> current one.

If your config file has the line ui.default_path=  empty (or no such 
line) then the default path should be the current one.

However, upon opening or saving a file, the default path for that 
session becomes the last path used (as seems convenient, if you're 
somehow just running xournal from your home directory but really want to 
work on a bunch of files that live elsewhere).

What's slightly problematic is that saving preferences (or auto-saving 
them on close) then remembers that last directory as the new default 
one. I'm not too keen on adding a config file option or other mechanism 
to prevent this behavior, seems too complicated. If like me you don't 
auto-save preferences then you might just need to clean up your config 
file manually from time to time if you notice that xournal has acquired 
a weird default directory. If you do auto-save preferences then 
presumably you don't mind xournal remembering where you were last using 
it :)

> I tend to execute xournal from the command line, and I would like it to 
> create a file in the local directory.

This is a different issue -- pre-creating new files. My workflow so far 
has been to "touch filename.xoj" in advance while the keyboard is still 
around, then start xournal with no specified filename; I can't load the 
empty .xoj (error) but I can select that filename with the pen when 
saving a yet-unnamed file. (Of course my ui.default_path line is empty 
in the config file so it does start with the current directory).

But I like your idea that one should be able to just create a new file 
by specifying its name on the command line or even in the open dialog.

So: I committed some code on the git/cvs repositories (not thoroughly 
tested) adding an option to the config file, called autocreate_new_xoj
(save preferences to add the appropriate line then set it to true; I 
didn't bother putting any UI for it).

With this option on, if you try to open a .xoj file that doesn't exist 
(whether by specifying it on the command line or by typing a filename in 
File->Open), instead of an error message you'll get a blank document 
that already has the requested name (so File->Save will create it 
without prompting for a file name, and if you use auto-saves, the 
autosaves will be created with that name). (The file itself will only 
actually get created when you save).

To preserve from involuntary uses, there's a few sanity checks:
- this only happens if the filename ends in .xoj, and lives in a 
directory that exists (or current directory).
- a warning pop-up is shown, just in case the user in fact wanted to 
open an existing file but made a typo.

I checked that various scenarios (non-existent file was opened and so 
ends up in recently used list but never got saved; non-existent file was 
edited and an auto-save file was generated but we killed xournal before 
saving; etc.) work in the way you'd expect, but perhaps didn't do a 
super-complete investigation of all possible edge cases.

> The current use case is as follows:
>
> 1. Run xournal in the directory where I want my files to be saved.
> 2. Save file:
>     Start navigating to the current directory (this takes a loonnng time
>     depending on where I am saving the file)
> 3. Unfold laptop to type the filename.
> 4. Finally save.
>
> What I would like is the following:
>
> 1. Run xournal with some command options indicating that the file to be
>     created. If no path, it should be in the current directory
> 2. Save file:
>     The file dialog shows the indicated directory/filename. Simply save.

Easy: get the updated version, add the appropriate line to your config 
file, just run "xournal my_new_file.xoj", you'll get a warning about the 
file not existing yet, but save file will just create it without asking 
for a file name again.

Let me know if this works as intended or if you spot some undesirable 
side effect.
Denis

-- 
Denis Auroux
UC Berkeley, Department of Mathematics
817 Evans Hall, Berkeley CA 94720-3840, USA
aur...@math.berkeley.edu

------------------------------------------------------------------------------
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
_______________________________________________
Xournal-devel mailing list
Xournal-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/xournal-devel

Reply via email to