andreikop / enki

A text editor for programmers
http://enki-editor.org
GNU General Public License v2.0
161 stars 38 forks source link

File browser path isn't restored between a quit/restart of Enki #210

Closed bjones1 closed 10 years ago

bjones1 commented 10 years ago

After a quit and restart, the file browser's path is set to the path of the currently selected file, rather than its value on shutdown. It would be nice to preserve its value.

andreikop commented 10 years ago

If you had closed it and opened again, it means you are starting new coding session. Your brain lost some context, like

If you have lost this context, I'd like Enki also lose it to be in sync.

Could you explain, what is your case? Why do you want to restore file browser path?

bjones1 commented 10 years ago

To me, the path I was working in is like a project -- the location of all the files I'm interested in editing. So, restoring it to me feels like auto-loading my last open "project"; I'm immediately ready to begin work, rather than switching to the "project" directory first.

bjones1 commented 10 years ago

Awesome! Thanks.

bjones1 commented 10 years ago

Oops, unit tests fail, I assume due to these changes. See below.

A related question: should I have posted this as a separate issue, or is commenting on a closed but related issue better?

C:\Users\bjones\Documents\enki_all\enki\tests\test_core>test_uisavefiles.py
EEEEEE
======================================================================
ERROR: test_1 (__main__.Test)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\Users\bjones\Documents\enki_all\enki\tests\test_core\..\base.py", lin
e 160, in tearDown
    core.term()
  File "C:\Users\bjones\Documents\enki_all\enki\tests\..\enki\core\core.py", lin
e 143, in term
    plugin.del_()
  File "C:\Users\bjones\Documents\enki_all\enki\tests\..\enki\plugins\filebrowse
r.py", line 53, in del_
    core.config()['FileBrowser']['LastPath'] = self.dock.currentPath()
  File "C:\Users\bjones\Documents\enki_all\enki\tests\..\enki\plugins\filebrowse
r.py", line 666, in currentPath
    return self._tree.currentPath()
AttributeError: 'NoneType' object has no attribute 'currentPath'

======================================================================
ERROR: test_2 (__main__.Test)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\Users\bjones\Documents\enki_all\enki\tests\test_core\..\base.py", lin
e 160, in tearDown
    core.term()
  File "C:\Users\bjones\Documents\enki_all\enki\tests\..\enki\core\core.py", lin
e 143, in term
    plugin.del_()
  File "C:\Users\bjones\Documents\enki_all\enki\tests\..\enki\plugins\filebrowse
r.py", line 53, in del_
    core.config()['FileBrowser']['LastPath'] = self.dock.currentPath()
  File "C:\Users\bjones\Documents\enki_all\enki\tests\..\enki\plugins\filebrowse
r.py", line 666, in currentPath
    return self._tree.currentPath()
AttributeError: 'NoneType' object has no attribute 'currentPath'

======================================================================
ERROR: test_3 (__main__.Test)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\Users\bjones\Documents\enki_all\enki\tests\test_core\..\base.py", lin
e 160, in tearDown
    core.term()
  File "C:\Users\bjones\Documents\enki_all\enki\tests\..\enki\core\core.py", lin
e 143, in term
    plugin.del_()
  File "C:\Users\bjones\Documents\enki_all\enki\tests\..\enki\plugins\filebrowse
r.py", line 53, in del_
    core.config()['FileBrowser']['LastPath'] = self.dock.currentPath()
  File "C:\Users\bjones\Documents\enki_all\enki\tests\..\enki\plugins\filebrowse
r.py", line 666, in currentPath
    return self._tree.currentPath()
AttributeError: 'NoneType' object has no attribute 'currentPath'

======================================================================
ERROR: test_4 (__main__.Test)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\Users\bjones\Documents\enki_all\enki\tests\test_core\..\base.py", lin
e 160, in tearDown
    core.term()
  File "C:\Users\bjones\Documents\enki_all\enki\tests\..\enki\core\core.py", lin
e 143, in term
    plugin.del_()
  File "C:\Users\bjones\Documents\enki_all\enki\tests\..\enki\plugins\filebrowse
r.py", line 53, in del_
    core.config()['FileBrowser']['LastPath'] = self.dock.currentPath()
  File "C:\Users\bjones\Documents\enki_all\enki\tests\..\enki\plugins\filebrowse
r.py", line 666, in currentPath
    return self._tree.currentPath()
AttributeError: 'NoneType' object has no attribute 'currentPath'

======================================================================
ERROR: test_5 (__main__.Test)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\Users\bjones\Documents\enki_all\enki\tests\test_core\..\base.py", lin
e 160, in tearDown
    core.term()
  File "C:\Users\bjones\Documents\enki_all\enki\tests\..\enki\core\core.py", lin
e 143, in term
    plugin.del_()
  File "C:\Users\bjones\Documents\enki_all\enki\tests\..\enki\plugins\filebrowse
r.py", line 53, in del_
    core.config()['FileBrowser']['LastPath'] = self.dock.currentPath()
  File "C:\Users\bjones\Documents\enki_all\enki\tests\..\enki\plugins\filebrowse
r.py", line 666, in currentPath
    return self._tree.currentPath()
AttributeError: 'NoneType' object has no attribute 'currentPath'

======================================================================
ERROR: test_6 (__main__.Test)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\Users\bjones\Documents\enki_all\enki\tests\test_core\..\base.py", lin
e 160, in tearDown
    core.term()
  File "C:\Users\bjones\Documents\enki_all\enki\tests\..\enki\core\core.py", lin
e 143, in term
    plugin.del_()
  File "C:\Users\bjones\Documents\enki_all\enki\tests\..\enki\plugins\filebrowse
r.py", line 53, in del_
    core.config()['FileBrowser']['LastPath'] = self.dock.currentPath()
  File "C:\Users\bjones\Documents\enki_all\enki\tests\..\enki\plugins\filebrowse
r.py", line 666, in currentPath
    return self._tree.currentPath()
AttributeError: 'NoneType' object has no attribute 'currentPath'

----------------------------------------------------------------------
Ran 6 tests in 1.222s

FAILED (errors=6)