Fix a few more cases where an operator should not show in the search menu.

This commit is contained in:
Brecht Van Lommel
2013-04-26 02:44:21 +00:00
parent 0731932eb8
commit e77729f5dd
6 changed files with 38 additions and 17 deletions

View File

@@ -34,6 +34,10 @@ class ConsoleExec(Operator):
bl_idname = "console.execute"
bl_label = "Console Execute"
@classmethod
def poll(cls, context):
return (context.area and context.area.type == 'CONSOLE')
def execute(self, context):
sc = context.space_data
@@ -54,6 +58,10 @@ class ConsoleAutocomplete(Operator):
bl_idname = "console.autocomplete"
bl_label = "Console Autocomplete"
@classmethod
def poll(cls, context):
return (context.area and context.area.type == 'CONSOLE')
def execute(self, context):
sc = context.space_data
module = _lang_module_get(sc)
@@ -72,6 +80,10 @@ class ConsoleCopyAsScript(Operator):
bl_idname = "console.copy_as_script"
bl_label = "Copy to Clipboard (as script)"
@classmethod
def poll(cls, context):
return (context.area and context.area.type == 'CONSOLE')
def execute(self, context):
sc = context.space_data
@@ -91,6 +103,10 @@ class ConsoleBanner(Operator):
bl_idname = "console.banner"
bl_label = "Console Banner"
@classmethod
def poll(cls, context):
return (context.area and context.area.type == 'CONSOLE')
def execute(self, context):
sc = context.space_data
@@ -119,6 +135,10 @@ class ConsoleLanguage(Operator):
maxlen=32,
)
@classmethod
def poll(cls, context):
return (context.area and context.area.type == 'CONSOLE')
def execute(self, context):
sc = context.space_data