Skip to content

Commit

Permalink
Merge pull request #410 from NaturalHistoryMuseum/feature/406-boxes-view
Browse files Browse the repository at this point in the history
[#406] how Boxes view on creating new document
  • Loading branch information
quicklizard99 committed Dec 12, 2016
2 parents 4e42030 + a1e21c6 commit e3e4874
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ This is an overview of major changes. Refer to the git repository for a full log

Version 0.1.35
-------------
- #406 Show Boxes view on creating new document
- #405 Remove qtpy
- #401 Support new pyzbar and pylibdmtx
- #397 Couple of problems with keyboard shortcuts box
Expand Down
3 changes: 3 additions & 0 deletions inselect/gui/main_window.py
Original file line number Diff line number Diff line change
Expand Up @@ -723,6 +723,9 @@ def empty_document(self, checked=False):
self.setWindowFilePath(None)
self.info_widget.set_document(None)

# Show view tab
self.show_tab(index=0)

self.sync_ui()

def closeEvent(self, event):
Expand Down
15 changes: 14 additions & 1 deletion inselect/tests/gui/test_active_view.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
import unittest

from pathlib import Path

from .gui_test import GUITest


TESTDATA = Path(__file__).parent.parent / 'test_data'


class TestActiveView(GUITest):
"""Basic tests of the MainWindow's active view.
"""
Expand All @@ -20,7 +25,7 @@ def test_select_view(self):

def test_select_next_tab(self):
"Next tab is selected"
self.window.show_tab(0)
self.window.show_tab(index=0)
self.window.next_previous_tab(next=True)
self.assertEqual(1, self.window.views.currentIndex())

Expand All @@ -36,5 +41,13 @@ def test_select_next_tab(self):
self.assertEqual(0, self.window.views.currentIndex())


def test_close(self):
"User closes document and Inselect shows Boxes tab"
self.window.open_file(path=TESTDATA.joinpath('shapes.inselect'))
self.window.show_tab(index=1)
self.window.close()
self.assertEqual(0, self.window.views.currentIndex())


if __name__ == '__main__':
unittest.main()

0 comments on commit e3e4874

Please sign in to comment.