Hi Abdel, Vincent, Richard and other developers,
Abdel, Could you be a little more detailed in how you think we could
bring in the session framework?
From what I understand, the session management framework (SMF) allows
us to enter some state parameters as hooks which are called by the
desktop session to restart LyX upon crash.
Have you worked with KATE (KDE Advanced Text Editor)? There you can
group sets of related documents into a session (as Vincent mentioned).
This definition differs from Qt's notion of session which is not at the
app level but the desktop level.
Here is a use case:
1. I start LyX and begin copy-pasting material from a group of reports
into one master document - a research paper. These form a logical group
and LyX can, right now, open them all *if* these were the last files
that were open the last time I used LyX. Suppose that was indeed the case.
2. I finish my work and decide to pull up another group of documents
related to a petition I'm writing. Right now, I'd have to,
(a) close-all
(b) open each petition-related lyx doc one by one
3. Instead, if I could group these files into a lyx-document session
named "Petition", then I could choose this session (say from the file
menu), and LyX would close all open files that are not part of the
Petition session and open the others that are. With one command I have
just the set of documents that I'd like to work with.
IIUC, the Qt session management framework lets me reprogram (to some
extent) the shutdown hooks (QApplication::commitData() etc.) and the
restart hooks (QSessionManager::setRestartCommand()) so that *at LyX
startup* the previous set of open documents can be restored. The
named-sessions feature once implemented should be
From your description, it seems you are referring to the QSettings
class for storing info about open files etc. If this is the case, sorry
I didn't make the connection to the Qt SMF earlier - while their
functionality overlaps, I believe they aren't the same.
If we agree on using QSettings, we will still need (a pruned version
of) LyX::Session for doing the work of opening the files etc., isn't it?
-- Manoj
Abdelrazak Younes wrote:
Vincent van Ravesteijn - TNW wrote:
IIUC we should be careful to distinguish the application session from
the document session. The LyX application is a part of the windows/
linux/mac desktop and is handed a session manager from the desktop
overlord for clean startup and shutdown. But for named document
sessions, LyX plays the role of the overlord that should issue a
session-handle to its minion documents. My feeling is that the document
sessions have a much simpler spec than the Qt session framework and we
might be better of writing our own (simpler) classes.
Please correct me if I am wrong.
Hello Manoj,
It seems that I missed this reply, sorry about that (and thanks to
Vincent for noticing it).
So, short answer, Qt session framework is really sufficient and flexible
enough for all our needs, plus it is cross platform and uses native
files (or register) in the proper location on all platforms. You have to
see Qt session framework as a simple database; you can have code names
for the sessions you are talking about, no problem about that, really.
Having a simple home made class is already what we have now with the
session class. But it is simple now because I removed most of the code
that were present in the 1.5 days. If I had the time, I would simply
kill it now. Be careful to not reproduce the same mistake.
Abdel.
PS: this mail is not to dismiss your proposal, this is just my opinion,
FWIW :-)