summaryrefslogtreecommitdiff
path: root/python/__init__.py
diff options
context:
space:
mode:
authorRusty Wagner <rusty@vector35.com>2016-09-19 23:57:39 -0400
committerRusty Wagner <rusty@vector35.com>2016-09-19 23:57:39 -0400
commit91c9990b0f51864f60e71d4004cfb2eb75154eb8 (patch)
treef82f2bdb9a4e6253c98797347b918634834184dc /python/__init__.py
parent1364a9bc7b3887441540cd27685c1addb028afb3 (diff)
Add API for showing a message box in the UI
Diffstat (limited to 'python/__init__.py')
-rw-r--r--python/__init__.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/python/__init__.py b/python/__init__.py
index 23059068..c8880648 100644
--- a/python/__init__.py
+++ b/python/__init__.py
@@ -10193,6 +10193,7 @@ class InteractionHandler(object):
self._cb.getOpenFileNameInput = self._cb.getOpenFileNameInput.__class__(self._get_open_filename_input)
self._cb.getSaveFileNameInput = self._cb.getSaveFileNameInput.__class__(self._get_save_filename_input)
self._cb.getDirectoryNameInput = self._cb.getDirectoryNameInput.__class__(self._get_directory_name_input)
+ self._cb.showMessageBox = self._cb.showMessageBox.__class__(self._show_message_box)
def register(self):
self.__class__._interaction_handler = self
@@ -10305,6 +10306,12 @@ class InteractionHandler(object):
except:
log_error(traceback.format_exc())
+ def _show_message_box(self, ctxt, title, text, buttons, icon):
+ try:
+ return self.show_message_box(title, text, buttons, icon)
+ except:
+ log_error(traceback.format_exc())
+
def show_plain_text_report(self, view, title, contents):
pass
@@ -10343,6 +10350,9 @@ class InteractionHandler(object):
def get_directory_name_input(self, prompt, default_name):
return get_text_line_input(title, "Select Directory")
+ def show_message_box(self, title, text, buttons, icon):
+ return CancelButton
+
class _DestructionCallbackHandler:
def __init__(self):
self._cb = core.BNObjectDestructionCallbacks()
@@ -10743,6 +10753,9 @@ def get_directory_name_input(prompt, default_name = ""):
core.BNFreeString(ctypes.cast(value, ctypes.POINTER(ctypes.c_byte)))
return result
+def show_message_box(title, text, buttons = core.OKButtonSet, icon = core.InformationIcon):
+ return core.BNShowMessageBox(title, text, buttons, icon)
+
bundled_plugin_path = core.BNGetBundledPluginDirectory()
user_plugin_path = core.BNGetUserPluginDirectory()