def add_to_recent_file_list(self, filename):
# Add the item to the recent files list - if it already exists.
# Otherwise it will be added later after writing the file.
uri = pycam.Utils.URIHandler(filename)
if uri.exists():
# skip this, if the recent manager is not available (e.g. GTK 2.12.1 on Windows)
if self.recent_manager:
if self.recent_manager.has_item(uri.get_url()):
try:
self.recent_manager.remove_item(uri.get_url())
except GObject.GError:
pass
self.recent_manager.add_item(uri.get_url())
# store the directory of the last loaded file
if uri.is_local():
self.last_dirname = os.path.dirname(uri.get_local_path())
评论列表
文章目录