Sha256: fbf7777f64fcf17ea66e0998785ebb6824ddeea95b3973ffa039639e1d8be0a1
Contents?: true
Size: 1.18 KB
Versions: 40
Compression:
Stored size: 1.18 KB
Contents
# encoding: ascii-8bit # Copyright 2014 Ball Aerospace & Technologies Corp. # All Rights Reserved. # # This program is free software; you can modify and/or redistribute it # under the terms of the GNU General Public License # as published by the Free Software Foundation; version 3 with # attribution addendums as found in the LICENSE.txt # This file contains the implementation of the ButtonWidget class. require 'cosmos' require 'cosmos/tools/tlm_viewer/widgets/widget' require 'cosmos/gui/utilities/script_module_gui' module Cosmos class ButtonWidget < Qt::PushButton include Widget def initialize (parent_layout, button_text, string_to_eval) super() setText(button_text.to_s) connect(SIGNAL('clicked()')) do begin @screen.instance_eval(string_to_eval.to_s) rescue DRb::DRbConnError Qt::MessageBox.warning(parent.parentWidget, 'Error', "Error Connecting to Command and Telemetry Server") rescue Exception => error Qt::MessageBox.warning(parent.parentWidget, 'Error', "#{error.class} : #{error.message}") end end parent_layout.addWidget(self) if parent_layout end end end # module Cosmos
Version data entries
40 entries across 40 versions & 1 rubygems