[Python] Context sensitive recent files list

Shared Libraries
Forum rules
For sharing working examples of macros / scripts. These can be in any script language supported by OpenOffice.org [Basic, Python, Netbean] or as source code files in Java or C# even - but requires the actual source code listing. This section is not for asking questions about writing your own macros.
Post Reply
hanya
Volunteer
Posts: 885
Joined: Fri Nov 23, 2007 9:27 am
Location: Japan

[Python] Context sensitive recent files list

Post by hanya »

This is an example implementation of the context sensitive recent files list in Python.
"Recent Files 2" menu is shown next position of the existing "Recent Files" of the File menu of Writer, Calc, Drawing, Impress, Master Document, HTML and Formula. And it shows files list including only the same kind of the current document.
There is the example to implement PopupMenuController in C++ in the OOoWiki, but there is the difference to implement it in Python.
The PopupMenuController is not instantiated through com.sun.star.lang.XInitialization interface, but it is instantiated through python __init__ method. You need to get some arguments passed as tuple of com.sun.star.beans.PropertyValue like the following:

Code: Select all

	def __init__(self, ctx, *args):
The file list of the history can be found /org.openoffice.Office.Common/History node in the configuration.
The list of filter names is taken from com.sun.star.document.FilterFactory service and the documentation can be read in the Office Development chapter fo the DevGuide.
AnotherRecentFilesList-0.0.6.oxt.zip
Remove "zip" file extension before installation.
(5.91 KiB) Downloaded 498 times
Please, edit this thread's initial post and add "[Solved]" to the subject line if your problem has been solved.
Apache OpenOffice 4-dev on Xubuntu 14.04
hanya
Volunteer
Posts: 885
Joined: Fri Nov 23, 2007 9:27 am
Location: Japan

Re: [Python]Context sensitive recent files list

Post by hanya »

Dummy post to remove from the unanswered list.
Please, edit this thread's initial post and add "[Solved]" to the subject line if your problem has been solved.
Apache OpenOffice 4-dev on Xubuntu 14.04
Post Reply