Am 03.10.2010 um 16:41 schrieb Jürgen Spitzmüller: > Stephan Witt wrote: >> I'm trying to go for ticket #6861 http://www.lyx.org/trac/ticket/6861 ... >> >> Now I'm wondering about the implementation of >> >> static FileName selectTemplateFile() >> { >> FileDialog dlg(qt_("Select template file")); >> dlg.setButton1(qt_("Documents|#o#O"), toqstr(lyxrc.document_path)); >> dlg.setButton1(qt_("Templates|#T#t"), toqstr(lyxrc.template_path)); >> >> FileDialog::Result result = dlg.open(toqstr(lyxrc.template_path), >> QStringList(qt_("LyX Documents (*.lyx)"))); >> >> if (result.first == FileDialog::Later) >> return FileName(); >> if (result.second.isEmpty()) >> return FileName(); >> return FileName(fromqstr(result.second)); >> } >> >> The two calls to setButton1() look really strange. > > A typo, I suppose. The dialog should have two buttons, one pointing to the > template directory, the other one to the documents directory. > >> Why does nobody care here? > > Huh?
Sorry, sometimes my English is limited and the I tend to be too short. I meant, now there is only one button - no pointer to the document directory... I expected, some user should note that. >> If I assume the 2nd call should be setButton2... > > Yes. > >> Is it of any use to provide lyxrc.template_path twice? >> Once in the sidebar and again in the presetted path? > > I don't understand. Where is it provided twice? The button target is the same as the start directory. (First argument of dlg.open) > The long term goal, I think, would be to get rid of the buttons and use the > sidebar only. The buttons and the sidebar are "alternatives" - an implementation detail. >> I'd expect lyxrc.template_path in Button1 and sys-template-path in Button2. > > What is sys-template-path? The location of the templates inside the install directory. The other one is the location of the templates inside the user dir. Or I didn't understand something... The problem I want to solve is the following: The mac bundle is not traversable via the open dialog. So you cannot reach the system examples and templates. The work-around would be to create symlinks in the user directory. The target of the symlinks would be the location of the system templates for "New from template". For the normal open the examples location would be the other target. Stephan
