After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 616323 - SessionSaver improvements
SessionSaver improvements
Status: RESOLVED OBSOLETE
Product: gedit-plugins
Classification: Other
Component: General
3.8.x
Other Linux
: Normal normal
: ---
Assigned To: Gedit maintainers
Gedit maintainers
: 644608 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2010-04-20 18:01 UTC by Adi Roiban
Modified: 2020-11-24 10:17 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
attached pach (29.02 KB, patch)
2010-04-20 18:35 UTC, Adi Roiban
none Details | Review
Session Saver improvements (25.14 KB, patch)
2010-05-22 06:35 UTC, Garrett Regier
none Details | Review

Description Adi Roiban 2010-04-20 18:01:57 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)
Comment 1 Ignacio Casal Quinteiro (nacho) 2010-04-20 18:16:21 UTC
Hi, thanks for your work, though would be easier to review if you could attach the git format patch here.
Comment 2 Adi Roiban 2010-04-20 18:35:55 UTC
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.
Comment 3 Ignacio Casal Quinteiro (nacho) 2010-04-28 09:35:14 UTC
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.
Comment 4 Adi Roiban 2010-04-28 15:45:46 UTC
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):
  • File "/usr/lib/gedit-2/plugins/pythonconsole/console.py", line 298 in __run
    r = eval(command, self.namespace, self.namespace)
  • File "<string>", line 1 in <module>
AttributeError: 'gedit.Document' object has no attribute 'get_location'

Cheers,
Adi
Comment 5 Ignacio Casal Quinteiro (nacho) 2010-04-28 15:50:16 UTC
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.
Comment 6 Garrett Regier 2010-05-22 06:35:11 UTC
Created attachment 161701 [details] [review]
Session Saver improvements
Comment 7 jessevdk@gmail.com 2012-01-09 12:24:22 UTC
*** Bug 644608 has been marked as a duplicate of this bug. ***
Comment 8 Nelson Benitez 2013-08-12 09:21:21 UTC
* 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
Comment 9 Ignacio Casal Quinteiro (nacho) 2013-08-12 09:24:53 UTC
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.
Comment 10 Nelson Benitez 2013-08-12 12:14:06 UTC
(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.
Comment 11 Benjamin Danon 2013-08-21 21:49:40 UTC
I updated my repository :) and now I’m reviewing the garrett's patch to include all theses features in a new patch : bug 706488
Comment 12 Sébastien Wilmet 2020-11-24 10:17:24 UTC
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.