Sha256: 9614a31fd5dbad87f27a7c28c5ea794357cf9138e30076cb041e04d24b07c269

Contents?: true

Size: 1.34 KB

Versions: 2

Compression:

Stored size: 1.34 KB

Contents

# frozen_string_literal: true

module SSHTunnel
  module UI
    module Windows
      module Tunnels
        class DeleteWindow < Gtk::Window

          # Register the class in the GLib world
          type_register

          class << self

            def init
              # Set the template from the resources binary
              set_template resource: '/com/ungtb10d/ssh-hull/ui/tunnels/delete_window.glade'

              bind_template_child 'button_submit'
              bind_template_child 'button_cancel'
            end

          end

          include SSHTunnel::UI::Helpers::Common::ModalHelper
          include SSHTunnel::UI::Helpers::Common::TranslationHelper


          def initialize(application, window, tunnel)
            super

            # Set window title
            set_title t('window.tunnel.remove', tunnel: tunnel.name)

            # Set instance variables
            @tunnel = tunnel
            @host   = tunnel.parent
          end


          private


            def bind_submit_button
              button_submit.label = t('button.submit')
              button_submit.signal_connect :clicked do
                @host.remove_tunnel(@tunnel)
                @application.config.save!
                @window.reload_tunnels_treeview(@host)
                close
              end
            end

        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
ssh-hull-2.0 lib/ssh-hull/ui/windows/tunnels/delete_window.rb
ssh-hull-1.0.0 lib/ssh-hull/ui/windows/tunnels/delete_window.rb