Robot Framework Integrated Development Environment (RIDE)
desktopshortcut.py
Go to the documentation of this file.
1 # Copyright 2008-2015 Nokia Networks
2 # Copyright 2016- Robot Framework Foundation
3 #
4 # Licensed under the Apache License, Version 2.0 (the "License");
5 # you may not use this file except in compliance with the License.
6 # You may obtain a copy of the License at
7 #
8 # http://www.apache.org/licenses/LICENSE-2.0
9 #
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
15 
16 import atexit
17 import sys
18 
19 from ..pluginapi import Plugin
20 from ..action import ActionInfo
21 from ..postinstall import __main__ as postinstall
22 
23 
24 
26 
27  def __init__(self, app):
28  Plugin.__init__(self, app, default_settings={
29  'desktop_shortcut_exists': False,
30  'initial_project': None
31  })
32  self._window_window = None
33  atexit.register(self._close_close)
34 
35  def _close(self):
36  pass
37 
38  def enable(self):
39  self._create_menu()
40 
41  def disable(self):
42  self.unregister_actionsunregister_actions()
43  if self._window_window:
44  self._window_window.close(self.notebooknotebook)
45 
46  def _create_menu(self):
47  self.unregister_actionsunregister_actions()
48  self.register_actionregister_action(ActionInfo('Tools',
49  'Create RIDE Desktop Shortcut',
50  self.OnViewShortcutCreateOnViewShortcutCreate,
51  position=85))
52 
53  def OnViewShortcutCreate(self, event):
54  self.call_creatorcall_creator(self.notebooknotebook)
55  # self.disable()
56 
57  def call_creator(self, notebook):
58  return postinstall.caller(notebook.GetParent(), sys.platform.lower())
Used to create menu entries, keyboard shortcuts and/or toolbar buttons.
Definition: actioninfo.py:176
Entry point to RIDE plugin API – all plugins must extend this class.
Definition: plugin.py:50
def register_action(self, action_info)
Registers a menu entry and optionally a shortcut and a toolbar icon.
Definition: plugin.py:205
def unregister_actions(self)
Unregisters all actions registered by this plugin.
Definition: plugin.py:230
def disable(self)
Called by RIDE when the plugin is disabled.
def enable(self)
This method is called by RIDE when the plugin is enabled.