@@ -49,16 +49,20 @@ class DisplayIndicator(object):
49 :return: The custom proxy object for the display indicator page.
49 :return: The custom proxy object for the display indicator page.
52− # TODO open the indicator directly if it is displayed in the menu.
52+ if self.is_indicator_icon_visible():
53+ return self._main_window.open_indicator_page(
54+ 'indicator-rotation-lock')
56+ return self._open_indicator_with_icon_not_visible()
58+ def _open_indicator_with_icon_not_visible(self):
53 # open any displayed indicator.
59 # open any displayed indicator.
54 self._main_window.open_indicator_page('indicator-datetime')
60 self._main_window.open_indicator_page('indicator-datetime')
55 self._make_indicator_icon_visible()
61 self._make_indicator_icon_visible()
56 indicator_rotation_icon = self._main_window.select_single(
62 indicator_rotation_icon = self._main_window.select_single(
57 objectName='indicator-rotation-lock-panelItem')
63 objectName='indicator-rotation-lock-panelItem')
58 self._main_window.pointing_device.click_object(indicator_rotation_icon)
64 self._main_window.pointing_device.click_object(indicator_rotation_icon)
59− indicators_menu = self._main_window.select_single('IndicatorsMenu')
60− indicators_menu.fullyOpened.wait_for(True)
61− return self._main_window.select_single(
65+ return self._main_window.wait_select_single(
62 objectName='indicator-rotation-lock-page')
66 objectName='indicator-rotation-lock-page')
64 def _make_indicator_icon_visible(self):
68 def _make_indicator_icon_visible(self):