11.7. GUI support

11.7.1. ProgDlg

Manages a progress bar dialog.

11.7.1.1. ProgDlg.new([title], [task])

Creates a new ProgDlg progress dialog.

11.7.1.1.1. Arguments
title (optional)

Title of the new window, defaults to "Progress".

task (optional)

Current task, defaults to "".

11.7.1.1.2. Returns

The newly created ProgDlg object.

11.7.1.2. progdlg:update(progress, [task])

Appends text.

11.7.1.2.1. Arguments
progress

Part done ( e.g. 0.75 ).

task (optional)

Current task, defaults to "".

11.7.1.2.2. Errors
  • GUI not available

  • Cannot be called for something not a ProgDlg

  • Progress value out of range (must be between 0.0 and 1.0)

11.7.1.3. progdlg:stopped()

Checks whether the user has pressed the stop button.

11.7.1.3.1. Returns

true if the user has asked to stop the progress.

11.7.1.4. progdlg:close()

Closes the progress dialog.

11.7.1.4.1. Errors
  • GUI not available

11.7.2. TextWindow

Manages a text window.

11.7.2.1. TextWindow.new([title])

Creates a new TextWindow text window.

11.7.2.1.1. Arguments
title (optional)

Title of the new window.

11.7.2.1.2. Returns

The newly created TextWindow object.

11.7.2.1.3. Errors
  • GUI not available

11.7.2.2. textwindow:set_atclose(action)

Set the function that will be called when the text window closes.

11.7.2.2.1. Arguments
action

A Lua function to be executed when the user closes the text window.

11.7.2.2.2. Returns

The TextWindow object.

11.7.2.2.3. Errors
  • GUI not available

11.7.2.3. textwindow:set(text)

Sets the text.

11.7.2.3.1. Arguments
text

The text to be used.

11.7.2.3.2. Returns

The TextWindow object.

11.7.2.3.3. Errors
  • GUI not available

11.7.2.4. textwindow:append(text)

Appends text

11.7.2.4.1. Arguments
text

The text to be appended

11.7.2.4.2. Returns

The TextWindow object.

11.7.2.4.3. Errors
  • GUI not available

11.7.2.5. textwindow:prepend(text)

Prepends text

11.7.2.5.1. Arguments
text

The text to be appended

11.7.2.5.2. Returns

The TextWindow object.

11.7.2.5.3. Errors
  • GUI not available

11.7.2.6. textwindow:clear()

Erases all text in the window.

11.7.2.6.1. Returns

The TextWindow object.

11.7.2.6.2. Errors
  • GUI not available

11.7.2.7. textwindow:get_text()

Get the text of the window

11.7.2.7.1. Returns

The TextWindow's text.

11.7.2.7.2. Errors
  • GUI not available

11.7.2.8. textwindow:set_editable([editable])

Make this text window editable.

11.7.2.8.1. Arguments
editable (optional)

A boolean flag, defaults to true.

11.7.2.8.2. Returns

The TextWindow object.

11.7.2.8.3. Errors
  • GUI not available

11.7.2.9. textwindow:add_button(label, function)

Adds a button to the text window.

11.7.2.9.1. Arguments
label

The label of the button

function

The Lua function to be called when clicked

11.7.2.9.2. Returns

The TextWindow object.

11.7.2.9.3. Errors
  • GUI not available

11.7.3. Global Functions

11.7.3.1. gui_enabled()

Checks whether the GUI facility is enabled.

11.7.3.1.1. Returns

A boolean: true if it is enabled, false if it isn't.

11.7.3.2. register_menu(name, action, [group])

Register a menu item in one of the main menus.

11.7.3.2.1. Arguments
name

The name of the menu item. The submenus are to be separated by '/'s. (string)

action

The function to be called when the menu item is invoked. (function taking no arguments and returning nothing)

group (optional)

The menu group into which the menu item is to be inserted. If omitted, defaults to MENU_STAT_GENERIC. One of:

  • MENU_STAT_UNSORTED (Statistics),

  • MENU_STAT_GENERIC (Statistics, first section),

  • MENU_STAT_CONVERSATION (Statistics/Conversation List),

  • MENU_STAT_ENDPOINT (Statistics/Endpoint List),

  • MENU_STAT_RESPONSE (Statistics/Service Response Time),

  • MENU_STAT_TELEPHONY (Telephony),

  • MENU_STAT_TELEPHONY_GSM (Telephony/GSM),

  • MENU_STAT_TELEPHONY_LTE (Telephony/LTE),

  • MENU_STAT_TELEPHONY_SCTP (Telephony/SCTP),

  • MENU_ANALYZE (Analyze),

  • MENU_ANALYZE_CONVERSATION (Analyze/Conversation Filter),

  • MENU_TOOLS_UNSORTED (Tools). (number)

11.7.3.3. new_dialog(title, action, ...)

Pops up a new dialog

11.7.3.3.1. Arguments
title

Title of the dialog's window.

action

Action to be performed when OK'd.

...

A series of strings to be used as labels of the dialog's fields.

11.7.3.3.2. Errors
  • GUI not available

  • At least one field required

  • All fields must be strings

11.7.3.4. retap_packets()

Rescan all packets and just run taps - don't reconstruct the display.

11.7.3.5. copy_to_clipboard(text)

Copy a string into the clipboard.

11.7.3.5.1. Arguments
text

The string to be copied into the clipboard.

11.7.3.6. open_capture_file(filename, filter)

Open and display a capture file.

11.7.3.6.1. Arguments
filename

The name of the file to be opened.

filter

A filter to be applied as the file gets opened.

11.7.3.7. get_filter()

Get the main filter text.

11.7.3.8. set_filter(text)

Set the main filter text.

11.7.3.8.1. Arguments
text

The filter's text.

11.7.3.9. set_color_filter_slot(row, text)

Set packet-coloring rule for the current session.

11.7.3.9.1. Arguments
row

The index of the desired color in the temporary coloring rules list.

text

Display filter for selecting packets to be colorized.

11.7.3.10. apply_filter()

Apply the filter in the main filter box.

11.7.3.11. reload()

Reload the current capture file.

11.7.3.12. browser_open_url(url)

Open an url in a browser.

11.7.3.12.1. Arguments
url

The url.

11.7.3.13. browser_open_data_file(filename)

Open a file in a browser.

11.7.3.13.1. Arguments
filename

The file name.