Class: Cosmos::ScreenshotbuttonWidget
- Includes:
- Widget
- Defined in:
- lib/cosmos/tools/tlm_viewer/widgets/screenshotbutton_widget.rb
Instance Attribute Summary
Attributes included from Widget
#item, #item_name, #limits_set, #limits_state, #packet, #packet_name, #polling_period, #screen, #settings, #target_name, #value, #value_type
Instance Method Summary collapse
-
#initialize(parent_layout, button_text = 'Screenshot', screenshot_directory = nil) ⇒ ScreenshotbuttonWidget
constructor
A new instance of ScreenshotbuttonWidget.
Methods included from Widget
#context_menu, #get_tooltip_text, included, #process_settings, #set_setting, #set_subsetting, #shutdown, #update_widget
Constructor Details
#initialize(parent_layout, button_text = 'Screenshot', screenshot_directory = nil) ⇒ ScreenshotbuttonWidget
Returns a new instance of ScreenshotbuttonWidget.
19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/cosmos/tools/tlm_viewer/widgets/screenshotbutton_widget.rb', line 19 def initialize (parent_layout, = 'Screenshot', screenshot_directory = nil) super(nil, nil, nil, nil, .to_s) if screenshot_directory @screenshot_directory = screenshot_directory else @screenshot_directory = System.paths['LOGS'] end parent_layout.addWidget(self) if parent_layout connect(SIGNAL('clicked()')) do filename = File.join(@screenshot_directory, File.([@screen.full_name], '.png')) Screenshot.screenshot_window(@screen.window, filename) end end |