xboard-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [XBoard-devel] Some suggestions for new features


From: Hans Aberg
Subject: Re: [XBoard-devel] Some suggestions for new features
Date: Mon, 27 Feb 2012 11:02:39 +0100

On 27 Feb 2012, at 09:40, h.g. muller wrote:

> I bumped this to the xboard-devel list, because it had degenerated into a 
> private
> discussion when it was no longer about the original bug report, and I think it
> would deserve a wider audience. I will address some more of the points later.

That is OK. For those not in the private discussion :-), it is the question of 
the behavior when multiple copies of Xboard can run at the same time. Probably 
quite tricky to resolve, but nevertheless discussed.


> At 00:29 27-2-2012 +0100, Hans Aberg wrote:
> 
>> On 26 Feb 2012, at 23:31, address@hidden wrote:
>> 
>> > Op Zo, 26 februari, 2012 9:40 pm schreef Hans Aberg:
>> >> In Xcode, there are templates which can be used to create projects.
>> >> Templates are normally not saved to, but there probably is some way to
>> >> create them. Projects are what one normally works with, containing
>> >> information about which files are included, how to compile, etc.
>> >>
>> >> So following that, one might have an option -template <file>, which looks
>> >> for template files also in say ~/share/xboard/ and
>> >> /usr/local/share/xboard/. Templates should not be saved to, but there
>> >> should be a way to create them.
>> >>
>> >> Then an option -project <file>, which just looks for the file in a single
>> >> location, and saves certain data when changed.
>> >>
>> >> Xboard might then have such templates in /usr/local/share/xboard/ for
>> >> variants.
>> >>
>> >> This approach is also similar to that of Bison, which has skeleton files
>> >> in /usr/local/share/bison/ for different output languages, etc. They are
>> >> processed using M4.
>> >
>> > Well, XBoard already allows you to do such things with the -ini <file>
>> > option. This is equivalent to the -project you propose, because it reads
>> > the settings from the file, and then later saves them back on it.
>> >
>> > To achieve the effect of your -template option, one just specifies
>> > different settings files for loading and saving:
>> >
>> > xboard -ini <template> -saveSettingsFile <project>
>> >
>> > The latter option only changes the name to save on, without reading the
>> > file, and even does that when the file did not exist. The -ini option
>> > reads the file, and sets the save name (but only if the file existed), but
>> > the save name is later overruled. (Last option wins in case of multiply
>> > defined settings.)
>> 
>> It depends on what type of GUI behavior you want. If it should be possible 
>> to run several main windows at the same time, only data common to those 
>> should be saved in .xboardrc. The other stuff should be in project files.
> 
> It seems impossible to know what settings should be considered common, and 
> which particular to the project. I expect it to be different for each user.

It may be something that can only be resolved over time, by experience. In 
Xcode, the general preferences, that is, what corresponds to .xboardrc, is 
about general behavior, style, key bindings, modules (additional downloaded 
packages). The project file then contains information about what files are in 
the project, how to compile it, and so on.

In Xboard, .xboardrc might contain for example lists of engines and templates, 
key bindings common to all projects.

>> But .xboardrc could contain all info it has now, which is used if one does 
>> not open using a template or project file. If one opens using a project 
>> file, then info special in that one should be saved to that one. If one 
>> opens using a template file, Xboard should ask for a project file to save 
>> the data in.
> 
> It seems this will require very complex accounting in XBoard for what option 
> came from where, and it is not obvious to me there would be any user benefit. 
> On the contrary, it seems annoying that when I am working on a 'project' (say 
> using XBoard for a Xiangqi tournament), and imported some template for that 
> which came with the install for XBoard, that when I change some setting that 
> did not happen to come with the template (e.g. I want to have 'Animate 
> Moving' off because I happen to be only interested in Xiangqi bullet games) 
> would now be saved in the common settings. (Where it would then be 
> overwritten when I use XBoard for another project, so that next time I return 
> to the Xiangqi project, I would have to set it again.)
> 
> It seems much more natural to consider any setting change the user makes 
> while in a Xiangqi project to only affect future runs of that project.

Indeed, that is the situation in Xcode:

In Xcode, you never use a template to change anything in a project, only to 
create a new project. One can also think of admitting to create a new template 
from a project by means of an explicit file. This simplifies, but also imposes 
some limitations.

So the idea is that if you start with a template for Xiangqi tournament that 
came with the install, then changes in settings relating that the information 
in that template should be saved in a project file. The next time, you open the 
project file instead of the template file.

One type of behavior is that when opening a template, Xboard also requires one 
to indicate a project file. The template is then copied over to the new project 
file, which is used to save changes to. This is how Xcode works.

Another behavior might be that one can open with a template and run. If there 
are some changes, then when one quits, Xboard asks one to create a project 
file. This is bit more complicated, because one must keep track of when the 
data has changed.

A perhaps simpler variation of this might be, in addition to, or as replacement 
of, .xboardrc, have a directory .xboardrc.d/, which can contain a sequence of 
init file (current X11 on OS X has a directory .xinitrc.d/ which replaces the 
file .xinitrc). So, in this variation, if one starts with the Xiangqi template, 
one would automatically get a project file in .xboardrc.d/ to which the data is 
saved, though it might be useful to be able to create ones own project file. In 
order to disambiguate between different template files with the same name, but 
indifferent directories, the project files in .xboardrc.d/ might be saved in a 
sequence of subdirectories corresponding to the full path of the template file.

Hans





reply via email to

[Prev in Thread] Current Thread [Next in Thread]