hi, Below "close" in the File menu, a "close all" could be extremely convenient... I know, it's not necessary... But it is like "save a copy"... an extra level of application "intelligence" ("intuitiveness").. If it's there, everyone like is, even uses it, but if it's not, people will argue, oh, nobody needs that... "Close all" is a key functionality for those who have working sessions... groups of documents that she or he opens at once... and wants to close them at once, too.. when it comes to that... We already have "save a copy" ! :) Peter - - - thank you for developing Libreoffice & Writer - - - -
PS: just an additional note... "Close" is at a very good place in the File menu!!! (below Recent Documents, in the top 1 section) I remember some programs (applications) that have "close" down-down in the FILE menu... and it is a pain in the A to get down there -- especially given that the X in the window's right corner (forget Mac) offers itself as a quick and easy way... So, this part needs NO change, cause it's great already :)
Thanks for the suggestion, Peter. What would be the difference with using "Exit LibreOffice" and its shortcut Ctrl + Q ?
(In reply to Stéphane Guillou (stragu) from comment #2) > Thanks for the suggestion, Peter. > What would be the difference with using "Exit LibreOffice" and its shortcut > Ctrl + Q ? Hi, The difference would be that you would be able to do what you actually want to do... When you want to close all your documents (your current working session), you don't have to exit Libreoffice, as a workaround. It is, sure, possible to close all of them like that, but leaving an application (exiting) is a totally different thing than closing a bunch of documents. Not to mention being able to have a popup window for confirmation... which could allow to close all but a few (later on)... The confirmation window could anyway list all the docs to be closed, even if all of them have been saved. BUT, to answer your question: You don't want to exit your application, you want to close the files open at the moment. It's 2 different things. ALSO: when you close them, you'll land on the visual 'recent files list' surface, which is a good thing... and you couldn't get there otherwise, but by exiting, opening, and closing the blank document :) :) Now, once again, I'm not talking about something without which life and work stops on the planet :) I'm talking about a next level of UI intelligence (intuitiveness), and a smooth workflow.
[Automated Action] NeedInfo-To-Unconfirmed
Thanks for clarifying. On which operating system are you? Because how the Start Center and components behave might differ slightly. (In reply to peter josvai from comment #3) > and you couldn't get there otherwise, but by exiting, opening, and closing > the blank document :) :) It should be possible to open directly the Start Center (the grey document icon in your applications), no need to create a new document then close it. UX/Design team, thoughts on a "close all documents and open start center" command? I think that, once more, this fits into your original request in bug 117237. If we are able to keep track of a group of documents aka a "session", we should also be able to close them all at once.
I wonder is all means all or just all from the current module, ie. Writer. Related is bug 133542 "Pressing CTRL+W with a single document open closes LibreOffice" rejected as CloseWin behaves differently from CloseDoc. Some wisdom in bug 85978 comment 15 (File > New is not the same as Window > New). Binding the close all function to the session idea is interesting. But then you cannot close all (random) documents.
(In reply to Stéphane Guillou (stragu) from comment #5) > Thanks for clarifying. > On which operating system are you? Because how the Start Center and > components behave might differ slightly. > > (In reply to peter josvai from comment #3) > > and you couldn't get there otherwise, but by exiting, opening, and closing > > the blank document :) :) > It should be possible to open directly the Start Center (the grey document > icon in your applications), no need to create a new document then close it. > > UX/Design team, thoughts on a "close all documents and open start center" > command? > I think that, once more, this fits into your original request in bug 117237. > If we are able to keep track of a group of documents aka a "session", we > should also be able to close them all at once. I'm on Linux, Debian based... Star Center cannot be accessed via the grey icon, unfortunately.. (I've checked it on 2 machines) But the point, I believe, is not getting to the Start Center... but to handle groups of documents as sessions... Per program module, i.e. Writer (Heiko)... Start Center is just a device which could lead to sessions... Closing documents at once could lead to grouping them in the recent documents list... by two separators... which could be the start of something, still... But all roads seem to slope toward Sessions, somehow :)
I'm not sure this is important enough to merit a slot on the file menu by default. How about a command for closing all the documents which the user can, optionally, place on a menu? Peter, do you find that sufficient?
Many different programs (like Krita and others) use this concept about « Close all » function and this feature comes in handy when you want to close any open session but continue to use the sotfware already open. In relation to what Peter was saying, it’s true that the various functions are often grouped together by logic at the end of the file menu : Close, Close all and Exit program.
(In reply to Eyal Rozenberg from comment #9) > I'm not sure this is important enough to merit a slot on the file menu by > default. Indeed. Esp. since there is a quit, and restarting is fast enough..
We discussed the topic in the design meeting. The requested command could be implemented but not added to the UI (just for customization). It should close documents from all modules as it intends to re-open the start center. Alternatively, and probably the better solution, is to show the start center while modules are open, see bug 77590. Adding a UNO command is not too difficult, prototypes are likely in the resolved issues at the META ticket. Hossein, please add some code pointer how to close all open documents.
Let's begin with the commands to "close a document" and "quit" LibreOffice. Finding the implementation of the "close", and "quit" commands in LibreOffice code starts from finding their UNO commands: Close document: .uno:CloseDoc Quit LibreOffice: .uno:Quit Development/DispatchCommands https://wiki.documentfoundation.org/Development/DispatchCommands Looking into the list of dispatch commands, one can find .uno:CloseDocs, which looks like a similar command but works for multiple documents. It was even removed in the past with 08f4ecd5823c420bb7157c238460d50f1f1f9791 as it was unused, but it was then reverted back with b9b2ab0f9f1ad91bba899068d2be7fc7767f41c9. These are implemented in sfx2/source/appl/appserv.cxx. When testing .uno:CloseDocs with this BASIC code while having a few Writer pages open with unsaved data, I see LibreOffice hangs: Sub basicIDE Set oDispatch = CreateUnoService("com.sun.star.frame.DispatchHelper") Dim args(0) As New com.sun.star.beans.PropertyValue oDispatch.executeDispatch(StarDesktop.ActiveFrame, ".uno:CloseDocs", "", 0, args) End Sub I think the best would be starting from this part of the code in sfx2/source/appl/appserv.cxx, and try to reuse parts from "case SID_QUITAPP": case SID_CLOSEDOCS: { ... } When there is some unsaved data, it should be asked about weather to save or not, for each of the files with unsaved data.
Hi, thank you very much for the code pointers. I am currently an assignee and please feel free to point out my mistakes. Since, the new uno command will close all documents and open the start center, Should the new uno command name be ".uno:RestartApp" ? Currently, the old implementation in case SID_CLOSEDOCS, have a bug with indexing. The idea of this implementation seems to be to iterate over all the frames even if one of the frames fails to close. But since xTasks is a reference, xTasks->getCount() also reduces with every frames closed, which leads to not all documents closing. I have fixed it but should I submit a patch for SID_CLOSEDOCS separate from this bug? SID_CLOSEDOC, have an accelerator shortcut, "ctrl + f4". When using this shortcut it closes the document for one type and also prompts for unsaved changes and also starts the start center in case of the last document. Iterating over the Object Shells to execute the slot SID_CLOSEDOC closes every document, prompts dialogs for unsaved changes but it doesn't automatically start the start center like using the shortcut. The case SID_RESTARTAPP, will implemented be in appserv.cxx, MiscExec_Impl. At the moment, I am currently learning for manually dispatching and looking for what have started the closedispatcher in case of the using the shortcuts like (ctrl+f4 , ctrl+w) since closedispatcher.cxx is responsible for loading the start center into the last frame.
Sorry, after re-reading the comments, I have understood the requirements wrong. The requirement of the command is only to close all open documents, but not include automatically relaunching the start center. I will submit it soon. comment 12 -> It should close documents from all modules as it intends to re-open the start center -> as it intends to re-open.
AungKhantOo committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/9d9cd7804919c518ed12875a81f520bee878d737 tdf#159380 Add an UNO command to close all documents It will be available in 25.2.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Thanks for the patch, AungKhantOo! If you are finished with it, please set this report to "resolved - fixed". Added to release notes: https://wiki.documentfoundation.org/index.php?title=ReleaseNotes%2F25.2&type=revision&diff=756430&oldid=756411 Verified in: Version: 25.2.0.0.alpha0+ (X86_64) / LibreOffice Community Build ID: 97833217ebacd77d01b8e06ee1eb05cc06c17afc CPU threads: 8; OS: Linux 6.5; UI render: default; VCL: gtk3 Locale: en-AU (en_AU.UTF-8); UI: en-US Calc: CL threaded
(In reply to Stéphane Guillou (stragu) from comment #17) > Thanks for the patch, AungKhantOo! > > If you are finished with it, please set this report to "resolved - fixed". > > Added to release notes: > https://wiki.documentfoundation.org/index.php?title=ReleaseNotes%2F25. > 2&type=revision&diff=756430&oldid=756411 > > Verified in: > > Version: 25.2.0.0.alpha0+ (X86_64) / LibreOffice Community > Build ID: 97833217ebacd77d01b8e06ee1eb05cc06c17afc > CPU threads: 8; OS: Linux 6.5; UI render: default; VCL: gtk3 > Locale: en-AU (en_AU.UTF-8); UI: en-US > Calc: CL threaded Thank you, it still need a couple of fixes for now at the moment.
AungKhantOo committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/07a166790b6c6c0b0bce96ce25d970a636ba55d6 tdf#159380 Fix for Add an UNO command to close all documents It will be available in 25.2.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.