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
25
class
ShortcutPlugin
(
Plugin
):
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_actions
unregister_actions()
43
if
self.
_window
_window:
44
self.
_window
_window.close(self.
notebook
notebook)
45
46
def
_create_menu
(self):
47
self.
unregister_actions
unregister_actions()
48
self.
register_action
register_action(
ActionInfo
(
'Tools'
,
49
'Create RIDE Desktop Shortcut'
,
50
self.
OnViewShortcutCreate
OnViewShortcutCreate,
51
position=85))
52
53
def
OnViewShortcutCreate
(self, event):
54
self.
call_creator
call_creator(self.
notebook
notebook)
55
# self.disable()
56
57
def
call_creator
(self, notebook):
58
return
postinstall.caller(notebook.GetParent(), sys.platform.lower())
robotide.action.actioninfo.ActionInfo
Used to create menu entries, keyboard shortcuts and/or toolbar buttons.
Definition:
actioninfo.py:176
robotide.pluginapi.plugin.Plugin
Entry point to RIDE plugin API – all plugins must extend this class.
Definition:
plugin.py:50
robotide.pluginapi.plugin.Plugin.notebook
notebook
Definition:
plugin.py:59
robotide.pluginapi.plugin.Plugin.register_action
def register_action(self, action_info)
Registers a menu entry and optionally a shortcut and a toolbar icon.
Definition:
plugin.py:205
robotide.pluginapi.plugin.Plugin.unregister_actions
def unregister_actions(self)
Unregisters all actions registered by this plugin.
Definition:
plugin.py:230
robotide.postinstall.desktopshortcut.ShortcutPlugin
Creator of RIDE Desktop Shortcuts.
Definition:
desktopshortcut.py:25
robotide.postinstall.desktopshortcut.ShortcutPlugin._window
_window
Definition:
desktopshortcut.py:32
robotide.postinstall.desktopshortcut.ShortcutPlugin.__init__
def __init__(self, app)
Definition:
desktopshortcut.py:27
robotide.postinstall.desktopshortcut.ShortcutPlugin.call_creator
def call_creator(self, notebook)
Definition:
desktopshortcut.py:57
robotide.postinstall.desktopshortcut.ShortcutPlugin._close
def _close(self)
Definition:
desktopshortcut.py:35
robotide.postinstall.desktopshortcut.ShortcutPlugin.OnViewShortcutCreate
def OnViewShortcutCreate(self, event)
Definition:
desktopshortcut.py:53
robotide.postinstall.desktopshortcut.ShortcutPlugin.disable
def disable(self)
Called by RIDE when the plugin is disabled.
Definition:
desktopshortcut.py:41
robotide.postinstall.desktopshortcut.ShortcutPlugin._create_menu
def _create_menu(self)
Definition:
desktopshortcut.py:46
robotide.postinstall.desktopshortcut.ShortcutPlugin.enable
def enable(self)
This method is called by RIDE when the plugin is enabled.
Definition:
desktopshortcut.py:38
src
robotide
postinstall
desktopshortcut.py
Generated by
1.9.1