Пример #1
0
    def _build_local_toolbar(self):
        toolbar = wx.ToolBar(self.panel,
                             wx.ID_ANY,
                             style=wx.TB_HORIZONTAL | wx.TB_HORZ_TEXT)
        profile_label = Label(toolbar, label="Execution Profile:  ")
        choices = self._test_runner.get_profile_names()
        self.choice = wx.Choice(toolbar, wx.ID_ANY, choices=choices)
        self.choice.SetToolTip(
            wx.ToolTip("Choose which method to use for "
                       "running the tests"))
        toolbar.AddControl(profile_label)
        toolbar.AddControl(self.choice)
        toolbar.AddSeparator()
        report_image = getReportIconBitmap()
        log_image = getLogIconBitmap()
        toolbar.AddTool(ID_SHOW_REPORT,
                        " Report",
                        report_image,
                        shortHelp=localize_shortcuts("View Robot Report in "
                                                     "Browser (CtrlCmd-R)"))
        toolbar.AddTool(ID_SHOW_LOG,
                        " Log",
                        log_image,
                        shortHelp=localize_shortcuts("View Robot Log in"
                                                     " Browser (CtrlCmd-L)"))
        toolbar.AddSeparator()
        # the toolbar API doesn't give us a way to specify padding which
        # is why the label has a couple spaces after the colon. gross,
        # but effective.
        self.savecb = wx.CheckBox(toolbar, ID_AUTOSAVE, " Autosave  ")
        self.savecb.SetToolTip(
            wx.ToolTip("Automatically save all changes "
                       "before running"))
        self.savecb.SetValue(self.auto_save)
        toolbar.AddControl(self.savecb)

        self.pause_after_failure_cb = wx.CheckBox(toolbar, ID_PAUSE_ON_FAILURE,
                                                  " Pause on failure  ")
        self.pause_after_failure_cb.SetToolTip(
            wx.ToolTip("Automatically pause"
                       " after failing "
                       "keyword"))
        self.pause_after_failure_cb.SetValue(False)
        toolbar.AddControl(self.pause_after_failure_cb)

        self.show_log_messages_checkbox = wx.CheckBox(toolbar,
                                                      ID_SHOW_MESSAGE_LOG,
                                                      " Show message log  ")
        self.show_log_messages_checkbox.SetToolTip(
            wx.ToolTip("Show or hide "
                       "message log"))
        self.show_log_messages_checkbox.SetValue(self.show_message_log)
        toolbar.AddControl(self.show_log_messages_checkbox)
        toolbar.EnableTool(ID_SHOW_LOG, False)
        toolbar.EnableTool(ID_SHOW_REPORT, False)
        toolbar.Realize()
        self._bind_toolbar_events(toolbar)
        return toolbar
Пример #2
0
    def _build_local_toolbar(self):
        toolbar = wx.ToolBar(self.panel, wx.ID_ANY,
                             style=wx.TB_HORIZONTAL | wx.TB_HORZ_TEXT)
        profileLabel = Label(toolbar, label="Execution Profile:  ")
        choices = self._test_runner.get_profile_names()
        self.choice = wx.Choice(toolbar, wx.ID_ANY, choices=choices)
        self.choice.SetToolTip(wx.ToolTip("Choose which method to use for "
                                          "running the tests"))
        toolbar.AddControl(profileLabel)
        toolbar.AddControl(self.choice)
        toolbar.AddSeparator()
        reportImage = getReportIconBitmap()
        logImage = getLogIconBitmap()
        # DEBUG wxPhoenix toolbar.AddLabelTool(
        self.MyAddTool(toolbar, ID_SHOW_REPORT, " Report", reportImage,
                       shortHelp=localize_shortcuts("View Robot Report in "
                                                    "Browser (CtrlCmd-R)"))
        self.MyAddTool(toolbar, ID_SHOW_LOG, " Log", logImage,
                       shortHelp=localize_shortcuts("View Robot Log in"
                                                    " Browser (CtrlCmd-L)"))
        toolbar.AddSeparator()
        # the toolbar API doesn't give us a way to specify padding which
        # is why the label has a couple spaces after the colon. gross,
        # but effective.
        self.savecb = wx.CheckBox(toolbar, ID_AUTOSAVE, " Autosave  ")
        self.savecb.SetToolTip(wx.ToolTip("Automatically save all changes "
                                          "before running"))
        self.savecb.SetValue(self.auto_save)
        toolbar.AddControl(self.savecb)

        self.pause_after_failure_cb = wx.CheckBox(toolbar, ID_PAUSE_ON_FAILURE,
                                                  " Pause on failure  ")
        self.pause_after_failure_cb.SetToolTip(wx.ToolTip("Automatically pause"
                                                          " after failing "
                                                          "keyword"))
        self.pause_after_failure_cb.SetValue(False)
        toolbar.AddControl(self.pause_after_failure_cb)

        self.show_log_messages_checkbox = wx.CheckBox(toolbar,
                                                      ID_SHOW_MESSAGE_LOG,
                                                      " Show message log  ")
        self.show_log_messages_checkbox.SetToolTip(wx.ToolTip("Show or hide "
                                                              "message log"))
        self.show_log_messages_checkbox.SetValue(self.show_message_log)
        toolbar.AddControl(self.show_log_messages_checkbox)
        toolbar.EnableTool(ID_SHOW_LOG, False)
        toolbar.EnableTool(ID_SHOW_REPORT, False)
        toolbar.Realize()
        self._bind_toolbar_events(toolbar)
        return toolbar
Пример #3
0
 def _get_platform_specific_shortcut_keys(self):
     return localize_shortcuts(SHORTCUT_KEYS)
Пример #4
0
 def _get_platform_specific_shortcut_keys(self):
     return localize_shortcuts(SHORTCUT_KEYS)
Пример #5
0
#  Licensed under the Apache License, Version 2.0 (the "License");
#  you may not use this file except in compliance with the License.
#  You may obtain a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
#  Unless required by applicable law or agreed to in writing, software
#  distributed under the License is distributed on an "AS IS" BASIS,
#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#  See the License for the specific language governing permissions and
#  limitations under the License.

from robotide.action.shortcut import localize_shortcuts
from robotide.utils import highlightmatcher, html_escape

CTRL_LABEL = localize_shortcuts('CtrlCmd')


class CellInfo(object):
    def __init__(self, cell_content, cell_position, for_loop=False):
        self._cell_content = cell_content
        self._cell_position = cell_position
        self.for_loop = for_loop

    @property
    def content_type(self):
        return self._cell_content.type

    @property
    def cell_type(self):
        return self._cell_position.type