Skip to content

Commit

Permalink
Set focus for problems and synthesis views
Browse files Browse the repository at this point in the history
Ref #276
  • Loading branch information
algorys committed Mar 17, 2018
1 parent 38e8d2a commit d56c18c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions alignak_app/qobjects/app_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,9 @@ def initialize(self):

if settings.get_config('Alignak-app', 'problems', boolean=True):
self.panel_widget.tab_widget.setCurrentIndex(1)
self.panel_widget.problems_widget.line_search.setFocus()
else:
self.panel_widget.line_search.setFocus()

def mousePressEvent(self, event): # pragma: no cover - not testable
""" QWidget.mousePressEvent(QMouseEvent) """
Expand Down
4 changes: 2 additions & 2 deletions test/test_app_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ def test_default_view_is_problems(self):

under_test.initialize()

self.assertEqual(False, settings.get_config('Alignak-app', 'problems', boolean=True))
self.assertFalse(settings.get_config('Alignak-app', 'problems', boolean=True))
self.assertEqual(0, under_test.panel_widget.tab_widget.currentIndex())

# Make "Problems" as default view
Expand All @@ -129,7 +129,7 @@ def test_default_view_is_problems(self):
under_test = AppQMainWindow()
under_test.initialize()

self.assertEqual(True, settings.get_config('Alignak-app', 'problems', boolean=True))
self.assertTrue(settings.get_config('Alignak-app', 'problems', boolean=True))
self.assertEqual(1, under_test.panel_widget.tab_widget.currentIndex())

# Reset settings
Expand Down

0 comments on commit d56c18c

Please sign in to comment.