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

Version Path
cosmos-4.1.1-java lib/cosmos/tools/tlm_viewer/widgets/button_widget.rb
cosmos-4.1.1 lib/cosmos/tools/tlm_viewer/widgets/button_widget.rb
cosmos-4.1.0-java lib/cosmos/tools/tlm_viewer/widgets/button_widget.rb
cosmos-4.1.0 lib/cosmos/tools/tlm_viewer/widgets/button_widget.rb
cosmos-4.0.3-java lib/cosmos/tools/tlm_viewer/widgets/button_widget.rb
cosmos-4.0.3-universal-java-1.8 lib/cosmos/tools/tlm_viewer/widgets/button_widget.rb
cosmos-4.0.3 lib/cosmos/tools/tlm_viewer/widgets/button_widget.rb
cosmos-4.0.2-universal-java-1.8 lib/cosmos/tools/tlm_viewer/widgets/button_widget.rb
cosmos-4.0.2 lib/cosmos/tools/tlm_viewer/widgets/button_widget.rb
cosmos-4.0.1-universal-java-1.8 lib/cosmos/tools/tlm_viewer/widgets/button_widget.rb
cosmos-4.0.1 lib/cosmos/tools/tlm_viewer/widgets/button_widget.rb
cosmos-4.0.0-universal-java-1.8 lib/cosmos/tools/tlm_viewer/widgets/button_widget.rb
cosmos-4.0.0 lib/cosmos/tools/tlm_viewer/widgets/button_widget.rb
cosmos-3.9.2 lib/cosmos/tools/tlm_viewer/widgets/button_widget.rb
cosmos-3.9.1 lib/cosmos/tools/tlm_viewer/widgets/button_widget.rb
cosmos-3.8.3 lib/cosmos/tools/tlm_viewer/widgets/button_widget.rb
cosmos-3.8.2 lib/cosmos/tools/tlm_viewer/widgets/button_widget.rb
cosmos-3.8.1 lib/cosmos/tools/tlm_viewer/widgets/button_widget.rb
cosmos-3.8.0 lib/cosmos/tools/tlm_viewer/widgets/button_widget.rb
cosmos-3.7.1 lib/cosmos/tools/tlm_viewer/widgets/button_widget.rb