GNOME Bugzilla – Bug 616323
SessionSaver improvements
Last modified: 2020-11-24 10:17:24 UTC
Hi, I have done some changes for the SessionSaver plugin. My changes are here: https://code.edge.launchpad.net/~adiroiban/gedit-plugins/autosession-improvements And a diff is here: https://code.edge.launchpad.net/~adiroiban/gedit-plugins/autosession-improvements/+merge/23784 Those are the changes accumulated while using SessionSaver and getting annoyed by it's problems. Maybe not all changes are wanted by all users. Here is the list of changes: * Remove unused callbacks from ComboBox model. * Save and open session using only the keyboard * Close dialog with Esc key * Save dialog will select the current session (if it exists) * Opening a saved session will close the session manager dialog * There are also many formating chages (long lines, unused imports, deprecated code ... etc)
Hi, thanks for your work, though would be easier to review if you could attach the git format patch here.
Created attachment 159186 [details] [review] attached pach Here is the attached patch generated using 'git format-patch HEAD^' To bad we still need to work with patch files rather than merging branches. Trying to attach this file generated two times a 500 Internal server error.
Review of attachment 159186 [details] [review]: Thanks for the patch. I added some comments bellow. ::: plugins/sessionsaver/__init__.py @@ +3,3 @@ # Copyright (C) 2006-2007 - Steve Frécinaux <code@istique.net> # +# Adi Roiban 2009-2010 - https://launchpad.net/~adiroiban Please follow the same layout to add the copyright. @@ +53,3 @@ + action="FileSessionSave"/> + name="FileSessionSaveMenu" + <menuitem I'd prefer things like string menuitems defined in the same line @@ +78,3 @@ + _("_Save current session"), None, + "FileSessionSave", gtk.STOCK_SAVE_AS, + ( I'd prefer to not leave on line with only the onpen ( @@ -165,2 @@ gedit.commands.load_uris(window, session.files, None, 0) -# ex:ts=4:et: Why did you remove this? @@ +211,3 @@ + + if helper is None: + helper = window.get_data(self.WINDOW_DATA_KEY) Could you use get_location() instead of get_uri() ? @@ +219,3 @@ + def on_tab_added(self, window, tab): + document = tab.get_document() + if (document.get_uri() is not None): Same here, use get_location @@ +223,3 @@ + 'save', self.on_document_save) + + def on_document_save(self, document, uri, encoding, flags): This has changed, now it takes different params ::: plugins/sessionsaver/dialogs.py @@ +4,3 @@ # Copyright (c) 2007 - Steve Frécinaux <code@istique.net> +# +# Adi Roiban 2009-2010 - https://launchpad.net/~adiroiban layout @@ -202,2 @@ self.destroy() -# ex:ts=4:et: Do not remove this. ::: plugins/sessionsaver/store.py @@ +3,3 @@ # Copyright (C) 2006-2007 - Steve Frécinaux <code@istique.net> # +# Adi Roiban 2009-2010 - https://launchpad.net/~adiroiban layout @@ +48,3 @@ + (gobject.TYPE_PYOBJECT, )), + (gobject.TYPE_PYOBJECT, )), + "session-added": (gobject.SIGNAL_RUN_LAST, gobject.TYPE_NONE, not sure why you changed here the indentation @@ -155,3 @@ self.add(self._current_session) -# ex:ts=4:et: - Do not remove this please.
Hi, I will fix the copyright lines and will put back the "# ex:ts=4:et:" line. Sorry for all those unneeded changes. Is Document.get_location() available in Gedit 2.28 ? >>> window.get_active_document().get_location() Traceback (most recent call last):
+ Trace 221593
r = eval(command, self.namespace, self.namespace)
Cheers, Adi
probably no, it should be in 2.30. In git we already removed get_uri, so that's the reason we can't apply the patch with get_uri.
Created attachment 161701 [details] [review] Session Saver improvements
*** Bug 644608 has been marked as a duplicate of this bug. ***
* ping * for requesting a review of garrett's patch. I miss the session saver functionality, I got used to it while using notepad++ editor in windows, where this functionality is included by default, that is, when you open the editor you have there all the tabs you had opened when you closed it. I think the functionality should be included by default in gedit too, but meanwhile a plugin is fine, but the gedit sessionsaver plugin seems to be such broken that even the gedit-plugins fedora package does not include it from a long time, from [1]: * Mon Apr 30 2007 Trond Danielsen <trond.danielsen@gmail.com> - 2.18.0-2 - Disable buggy session saver plugin. - Removed static libraries. [1] http://arm.koji.fedoraproject.org/koji/buildinfo?buildID=136360
We removed the session plugin from the gedit-plugins package since none of us was maintaining it. AFAIK somebody resurrected the plugin and put it in its own repository but not sure about it. We welcome of course somebody to resurrect the plugin and put it again into shape.
(In reply to comment #9) > We removed the session plugin from the gedit-plugins package since none of us > was maintaining it. AFAIK somebody resurrected the plugin and put it in its own > repository but not sure about it. We welcome of course somebody to resurrect > the plugin and put it again into shape. Understood, thanks for the quick response!, the repository you talk about seems to be this: https://github.com/sphax3d/gedit-sessionsaver I've just cloned it and tested it and it's not working either, I will look into getting it into shape and get back to you then.
I updated my repository :) and now I’m reviewing the garrett's patch to include all theses features in a new patch : bug 706488
Mass-closing of all gedit-plugins bugzilla tickets. Special "code" to find again all those gedit-plugins bugzilla tickets that were open before the mass-closing: 2bfe1b0590a78457e1f1a6a90fb975f5878cb60064ccfe1d7db76ca0da52f0f3 By searching the above sha256sum in bugzilla, the gedit contributors can find again the tickets. We may be interested to do so when we work on a specific area of the code, to at least know the known problems and possible enhancements. We do this mass-closing because bugzilla.gnome.org is being replaced by gitlab.gnome.org.