Class: Roebe::GUI::UniversalWidgets::WlanInformationCenter

Inherits:
Base
  • Object
show all
Includes:
UniversalWidgets::BaseModule
Defined in:
lib/roebe/gui/universal_widgets/wlan_information_center/wlan_information_center.rb

Overview

Roebe::GUI::UniversalWidgets::WlanInformationCenter

Constant Summary collapse

TITLE =
#

TITLE

#
'Wlan Information Center'
WIDTH =
#

WIDTH

#
'60% or minimum 1280px'
HEIGHT =
#

HEIGHT

#
'30% or minimum 880px'
USE_THIS_FONT =
#

USE_THIS_FONT

#
:dejavu_condensed_18
LARGER_FONT =
#

LARGER_FONT

#
:hack_25
SMALLER_FONT =
#

SMALLER_FONT

#
:hack_20
HASH_DESIGNATED_KEY_COMBINATIONS =
#

HASH_DESIGNATED_KEY_COMBINATIONS

Add useful key-combinations to the following Hash.

#
{
  'alt+1':  'activate_this_tab(1)',
  'alt+2':  'activate_this_tab(2)',
  'alt+3':  'activate_this_tab(3)',
  'alt+4':  'activate_this_tab(4)',
  'alt+5':  'activate_this_tab(5)',
  'alt+6':  'activate_this_tab(6)',
  'alt+7':  'activate_this_tab(7)',
  'alt+8':  'activate_this_tab(8)',
  'alt+9':  'activate_this_tab(9)'
}

Constants inherited from Base

Base::COLOURS, Base::HOME_DIRECTORY_OF_USER_X, Base::N, Base::NAMESPACE

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#actions, #append_this_onto_that_file, #append_what_into, #be_silent, #be_verbose?, #beautiful_url, #burlywood, #call_next, #chdir, #cheerful_guy, #cliner, #complex_esystem, #convert_global_env, #copy_directory, #copy_file, #cornflowerblue, #create_directory, #crimson, #current_month?, #current_time?, #current_year?, #cyan, #darkcyan, #darkgreen, #darkkhaki, #darkslateblue, #deeppink, #delete_symlink, #do_not_use_the_base_colours, #do_use_the_base_colours, #e, #ecomment, #editor_to_use?, #efancy, #eimp, #emphasis, #ensure_main_encoding, #ensure_utf_encoding, #eparse, #erev, #esteelblue, #etomato, #ewarn, #exit_program, #firebrick, #get_current_day, #get_current_month, #get_files_and_directories, #get_files_from, #get_german_name_for_this_weekday, #gold, #green, #grey, #hh_mm_ss, #hh_mm_ss_day_month_year, #home_dir?, #home_directory_of_user_x?, #infer_the_namespace, #internal_hash?, #is_a_directory?, #is_a_file?, #is_a_jpg_file?, #is_an_image_file?, #is_archive?, #is_audio_file?, #is_in_studium_dir?, #is_multimedia_file?, #is_on_roebe?, #is_on_windows?, #is_studium_available?, #is_symlink?, #is_this_a_ruby_file?, #is_video_file?, #iso_encoding?, #le, #left_colour, #lightblue, #lightgreen, #lightseagreen, #lightsteelblue, #lime, #limegreen, #localhost_to_data, #log_directory?, #main_encoding?, #mediumorchid, #mediumpurple, #mediumseagreen, #mediumslateblue, #mediumspringgreen, #mediumturquoise, #mkdir_p, #mv, #n_days_in_this_month, #n_pages_in_this_pdf_file?, #namespace?, #no_file_exists_at, #ogrey, #olive, #olivedrab, #open_in_browser, #opne, #opnesystem, #opnn, #orange, #orchid, #orev, #palegoldenrod, #palevioletred, #pink, #powderblue, #programs_dir?, #project_base_dir?, #random_html_colour, #rds, #read_file_in_iso_encoding, #read_file_via_the_default_encoding, #read_lines_via_iso_encoding, #readlines_with_main_encoding, #red, #register_sigint, #remove, #remove_directory, #remove_file, #rename_kde_konsole_tab, #replace_localhost_with_data, #report_pwd, #require_rescue, #reset_the_internal_hash, #return_all_directories_from_this_directory, #return_all_files_from_this_directory, #return_current_directory, #return_dd_mm_yyyy, #return_file_or_directory_of, #return_files_from_pwd, #return_last_part_of_the_current_directory, #return_utc, #rev, #right_arrow?, #right_colour, #roebe_log_directory?, #rosybrown, #royalblue, #ruby_base_directory?, #run_in_background, #run_rcfiles_then_run_ata_via_qdbus, #sandybrown, #sdir, #seagreen, #set_be_verbose, #set_xorg_buffer, #sfancy, #sfile, #show_help, #silent_redirection?, #simp, #simple_esystem, #skyblue, #slateblue, #slategray, #springgreen, #steelblue, #string_italic, #swarn, #symlink, #teal, #temp_dir?, #to_camelcase, #to_counted_hash, #tomato, #touch, #try_to_require_the_beautiful_url_gem, #try_to_require_the_html_template, #try_to_require_the_open_gem, #try_to_require_the_program_information_gem, #try_to_require_the_xorg_buffer, #use_colours?, #verbose_truth, #weekday?, #word_wrap, #write_what_into, #yellow

Methods included from Base::CommandlineArguments

#append_onto_the_commandline_arguments, #clear_commandline_arguments, #commandline_arguments?, #commandline_arguments_as_string?, #commandline_arguments_without_leading_hyphens?, #first_argument?, #first_argument_without_leading_hyphens?, #has_an_argument_been_passed?, #remove_hyphened_arguments_from_the_commandline_arguments, #return_commandline_arguments_with_leading_hyphens, #second_argument?, #set_commandline_arguments

Constructor Details

#initialize(commandline_arguments = nil, run_already = true) ⇒ WlanInformationCenter

#

initialize

#


82
83
84
85
86
87
88
89
90
91
92
93
94
# File 'lib/roebe/gui/universal_widgets/wlan_information_center/wlan_information_center.rb', line 82

def initialize(
    commandline_arguments = nil,
    run_already           = true
  )
  super(:vertical) if use_gtk3?
  determine_the_GUI_to_be_used(commandline_arguments) # This must come first, even before reset().
  reset
  set_commandline_arguments(
    commandline_arguments
  )
  on_delete_event_quit_the_application
  run if run_already
end

Class Method Details

.[](i = ARGV) ⇒ Object

#

Roebe::GUI::UniversalWidgets::WlanInformationCenter[]

#


747
748
749
# File 'lib/roebe/gui/universal_widgets/wlan_information_center/wlan_information_center.rb', line 747

def self.[](i = ARGV)
  new(i)
end

.run(i = ARGV) ⇒ Object

#

Roebe::GUI::Gtk::WlanInformationCenter.run

#


719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
# File 'lib/roebe/gui/universal_widgets/wlan_information_center/wlan_information_center.rb', line 719

def self.run(
    i = ARGV
  )
  require 'gtk_paradise/run'
  _ = ::Roebe::GUI::Gtk::WlanInformationCenter.new(i)
  r = ::Gtk.run
  _.set_parent_widget(r) # Must come before we enable the key-combinations.
  _.enable_these_key_combinations(HASH_DESIGNATED_KEY_COMBINATIONS)
  r << _
  r.automatic_size_then_automatic_title
  r.enable_quick_exit
  r.set_background :white
  r.add_shortcut(1, 'focus_on_tab(1)', :strg)
  r.add_shortcut(2, 'focus_on_tab(2)', :strg)
  r.add_shortcut(3, 'focus_on_tab(3)', :strg)
  r.add_shortcut(4, 'focus_on_tab(4)', :strg)
  r.add_shortcut(5, 'focus_on_tab(5)', :strg)
  r.add_shortcut(6, 'focus_on_tab(6)', :strg)
  r.add_shortcut(7, 'focus_on_tab(7)', :strg)
  r.add_shortcut(8, 'focus_on_tab(8)', :strg)
  r.add_shortcut(9, 'focus_on_tab(9)', :strg)
  r.maximize
  r.top_left_then_run
end

Instance Method Details

#activate_this_tab(i = 1) ⇒ Object Also known as: focus_on_tab

#

activate_this_tab

#


148
149
150
# File 'lib/roebe/gui/universal_widgets/wlan_information_center/wlan_information_center.rb', line 148

def activate_this_tab(i = 1)
  @notebook.focus_on_this_tab(i.to_i - 1)
end

#border_size?Boolean

#

border_size?

#

Returns:

  • (Boolean)


437
438
439
# File 'lib/roebe/gui/universal_widgets/wlan_information_center/wlan_information_center.rb', line 437

def border_size?
  2
end

#connect_the_skeletonObject

#

connect_the_skeleton (connect tag)

#


461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
# File 'lib/roebe/gui/universal_widgets/wlan_information_center/wlan_information_center.rb', line 461

def connect_the_skeleton
  abort_on_exception

  bottom_box = create_vbox
  text = left_aligned_label(
         'This is the bottom interface. We need to use '\
         'a notebook here eventually.')
  text.make_selectable
  bottom_box.minimal(text,2)
  box1 = create_hbox
  text = left_aligned_label('The default home ESSID is')
  text.make_selectable
  box1.minimal(text, 4)
  essid_text = selectable_text('<b>'+return_home_essid?+'</b>')
  box1.minimal(
    essid_text, 2
  )
  bottom_box.minimal(box1, 2)
  # ======================================================================= #
  # Add a horizontal-spacer next:
  # ======================================================================= #
  bottom_box.minimal(gtk_hspacer,                             2)
  bottom_box.minimal(@hbox_ESSID_to_use,                      2)
  bottom_box.minimal(@wlan_interface_to_use,                  2)
  bottom_box.minimal(return_scan_for_available_ESSIDS_widget, 2)
  bottom_box.minimal(return_hbox_with_some_buttons, 2)
  @notebook.add_page('Default', bottom_box)
  @notebook.add_page('Laptop',  return_box_for_the_laptop)
  @notebook.add_page('Startup', return_components_for_the_third_widget)
  @notebook.add_page('Ping-utility', return_the_ping_widget)
  box_for_the_commands = create_vbox
  entry_for_the_command = create_entry
  entry_for_the_command.bblack1
  entry_for_the_command.very_light_yellowish_background
  button_run_command = button('Run the command')
  button_run_command.set_name('button1')
  entry_for_the_command.enable_enter_event
  entry_for_the_command.on_enter {
    cmd = entry_for_the_command.text?.to_s
    e cmd
    result = `#{cmd}`
    set_buffer_text(result)
  }
  button_run_command.on_clicked {
    cmd = entry_for_the_command.text?.to_s
    e cmd
    result = `#{cmd}`
    set_buffer_text(result)
  }
  box_for_the_commands.minimal(entry_for_the_command, 2)
  box_for_the_commands.minimal(button_run_command,    2)
  @notebook.add_page('run-cmd', box_for_the_commands)
  @notebook.add_page('Results', @scrolled_window)
  draggable1 = draggable_up_to_bottom_movement(
    @header,
    @notebook
  )
  draggable1.set_border_width(2)

  window = create_window_or_runner(nil, width?, height?, title?)
  window << draggable1

  properly_prepare_this_window(window,
    {
      title:       title?,
      font:        font?,
      width:       width?,
      height:      height?,
      padding:     padding?,
      border_size: border_size?
    }
  )
  window.show_all
  window.top_left
  do_all_startup_related_actions
  run_main
end

#consider_loading_the_essid_automatically_if_we_are_on_a_roebe_host_systemObject

#

consider_loading_the_essid_automatically_if_we_are_on_a_roebe_host_system

We may re-use the ESSID for my home system here.

#


702
703
704
705
706
707
# File 'lib/roebe/gui/universal_widgets/wlan_information_center/wlan_information_center.rb', line 702

def consider_loading_the_essid_automatically_if_we_are_on_a_roebe_host_system
  @entry_use_this_wlan_interface.set_text('wlan0')
  if ::Roebe.is_on_roebe?
    @entry_for_essid.set_text(return_home_essid?)
  end
end

#create_the_buttonsObject

#

create_the_buttons

#


616
617
618
619
620
621
622
623
624
625
626
627
628
# File 'lib/roebe/gui/universal_widgets/wlan_information_center/wlan_information_center.rb', line 616

def create_the_buttons
  # ======================================================================= #
  # === @button_1
  # ======================================================================= #
  cmd = return_the_text_for_button_1_showing_the_ip_link_set_command
  @button_1 = button(cmd)
  @button_1.set_name('button1')
  @button_1.text_is_on_the_left_side
  @button_1.on_clicked {
    do_actions_associated_with_button_1(@button_1)
  }
  @button_1.on_hover(:lightgreen)
end

#create_the_comboboxesObject

#

create_the_comboboxes

#


327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
# File 'lib/roebe/gui/universal_widgets/wlan_information_center/wlan_information_center.rb', line 327

def create_the_comboboxes
  # ======================================================================= #
  # === @combo_box_entry_available_essids
  # ======================================================================= #
  @combo_box_entry_available_essids = create_combo_box_entry { :use_tearoffs } # Accept only Strings.
  @combo_box_entry_available_essids.set_has_frame(true)
  @combo_box_entry_available_essids.append_text(
    '[Not yet scanned]'
  )
  @combo_box_entry_available_essids.first_is_active
  @combo_box_entry_available_essids.pad5px
  @combo_box_entry_available_essids.on_changed {
    sync_the_combo_box_entry_onto_the_correct_entry
  }
end

#create_the_entriesObject

#

create_the_entries (entries tag, entry tag)

#


633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
# File 'lib/roebe/gui/universal_widgets/wlan_information_center/wlan_information_center.rb', line 633

def create_the_entries
  # ======================================================================= #
  # === @entry_use_this_wlan_interface
  # ======================================================================= #
  @entry_use_this_wlan_interface = create_entry('wlan0')
  @entry_use_this_wlan_interface.center
  @entry_use_this_wlan_interface.bblack1
  @entry_use_this_wlan_interface.css_class('small_border')
  @entry_use_this_wlan_interface.very_light_yellowish_background
  @entry_use_this_wlan_interface.hint = 'This entry can be used to '\
    'designate the main wlan interface in use. Normally this '\
    'defaults to <b>wlan0</b>.'
  @entry_use_this_wlan_interface.on_changed {
    update_button_1_with_the_new_name_of_the_wlan_interface
  }
  # ======================================================================= #
  # === @entry_for_essid
  # ======================================================================= #
  @entry_for_essid = entry_with_secondary_icon_name('network-wireless')
  @entry_for_essid.center
  @entry_for_essid.bblack1
  @entry_for_essid.very_light_yellowish_background
  @entry_for_essid.hint =
    'Here you can set your ESSID, the one for your wirelass '\
    'connection.'
end

#create_the_headerObject

#

create_the_header (header tag)

#


380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
# File 'lib/roebe/gui/universal_widgets/wlan_information_center/wlan_information_center.rb', line 380

def create_the_header
  # ======================================================================= #
  # === @header
  # ======================================================================= #
  @header = default_header { :with_close_button }
  @header.title = TITLE
  @header.set_font LARGER_FONT
  @header.bblack1
  event_button = create_event_box(image_network_wireless_signal_excellent_symbolic)
  event_button.hint = 'Click on this icon to connect via "dhclient".'
  event_button.on_clicked {
    do_connect
  }
  @header << event_button
end

#create_the_notebookObject

#

create_the_notebook

#


188
189
190
191
192
193
# File 'lib/roebe/gui/universal_widgets/wlan_information_center/wlan_information_center.rb', line 188

def create_the_notebook
  # ======================================================================= #
  # === @notebook
  # ======================================================================= #
  @notebook = default_notebook
end

#create_the_scrolled_windowObject

#

create_the_scrolled_window

#


372
373
374
375
# File 'lib/roebe/gui/universal_widgets/wlan_information_center/wlan_information_center.rb', line 372

def create_the_scrolled_window
  @scrolled_window = create_scrolled_window(create_text_view(create_text_buffer))
  @scrolled_window.width_height(400, 200)
end

#create_the_skeletonObject

#

create_the_skeleton (create tag, skeleton tag)

#


686
687
688
689
690
691
692
693
694
695
# File 'lib/roebe/gui/universal_widgets/wlan_information_center/wlan_information_center.rb', line 686

def create_the_skeleton
  create_the_entries
  create_the_buttons # Should come after .create_the_entries()
  create_the_comboboxes
  create_the_header
  create_the_notebook
  create_the_scrolled_window
  @hbox_ESSID_to_use = return_ESSID_to_use_widget
  @wlan_interface_to_use = return_wlan_interface_to_use
end

#do_actions_associated_with_button_1(button_1) ⇒ Object

#

do_actions_associated_with_button_1

#


155
156
157
158
159
160
161
# File 'lib/roebe/gui/universal_widgets/wlan_information_center/wlan_information_center.rb', line 155

def do_actions_associated_with_button_1(button_1)
  cmd = 'ip link set '+@entry_use_this_wlan_interface.text.to_s+' up'
  button_1.set_text(cmd)
  e cmd
  result = `#{cmd}`
  set_buffer_text(result)
end
#
#


444
445
446
447
448
449
450
451
452
453
454
455
456
# File 'lib/roebe/gui/universal_widgets/wlan_information_center/wlan_information_center.rb', line 444

def do_all_startup_related_actions
  consider_loading_the_essid_automatically_if_we_are_on_a_roebe_host_system
  Thread.new {
    sleep 0.0010
    @entry_for_essid.do_focus
    @entry_for_essid.deselect_everything
    # @entry_for_essid.select_region(-1, 1)
  }
  Thread.new {
    sleep 0.5
    do_populate_the_combobox_with_discovered_entries
  }
end

#do_connectObject

#

do_connect

#


234
235
236
# File 'lib/roebe/gui/universal_widgets/wlan_information_center/wlan_information_center.rb', line 234

def do_connect
  esystem(return_main_dhclient_command)
end

#do_populate_the_combobox_with_discovered_entriesObject Also known as: scan_for_available_essids

#

do_populate_the_combobox_with_discovered_entries

#


250
251
252
253
254
255
256
257
# File 'lib/roebe/gui/universal_widgets/wlan_information_center/wlan_information_center.rb', line 250

def do_populate_the_combobox_with_discovered_entries
  new_array = do_scan_for_available_essids
  @combo_box_entry_available_essids.clear
  @combo_box_entry_available_essids.populate_with_this_array(
    new_array
  )
  @combo_box_entry_available_essids.first_is_active
end

#do_reset_to_the_default_valuesObject

#

do_reset_to_the_default_values

#


269
270
271
# File 'lib/roebe/gui/universal_widgets/wlan_information_center/wlan_information_center.rb', line 269

def do_reset_to_the_default_values
  consider_loading_the_essid_automatically_if_we_are_on_a_roebe_host_system
end

#do_scan_againObject

#

do_scan_again

#


262
263
264
# File 'lib/roebe/gui/universal_widgets/wlan_information_center/wlan_information_center.rb', line 262

def do_scan_again
  do_populate_the_combobox_with_discovered_entries
end

#do_scan_for_available_essidsObject

#

do_scan_for_available_essids

Delegate onto Roebe::Wlan.

An alternative would be to simply call:

array = @wlan.available_essid_devices?
#


361
362
363
364
365
366
367
# File 'lib/roebe/gui/universal_widgets/wlan_information_center/wlan_information_center.rb', line 361

def do_scan_for_available_essids
  array_result = []
  array_result << @wlan.scan_for_available_essids
  array_result.flatten!
  array_result.sort!
  return array_result # This will be an Array such as ["UPC1371722", "3HuiTube_2.4Ghz_2C48"]
end

#entry_use_this_wlan_interface?Boolean

#

entry_use_this_wlan_interface?

#

Returns:

  • (Boolean)


412
413
414
# File 'lib/roebe/gui/universal_widgets/wlan_information_center/wlan_information_center.rb', line 412

def entry_use_this_wlan_interface?
  @entry_use_this_wlan_interface
end

#handle_CSS_rulesObject

#

handle_CSS_rules (CSS tag)

#


129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
# File 'lib/roebe/gui/universal_widgets/wlan_information_center/wlan_information_center.rb', line 129

def handle_CSS_rules
  use_gtk_paradise_project_css_file
  append_project_css_file
  more_CSS_then_apply_it '

.small_border { border: 2px solid steelblue; }

'
  more_CSS_from(
    Roebe.project_base_directory?+
    'gui/universal_widgets/'\
    'wlan_information_center/wlan_information_center.css'
  )

end

#padding?Boolean

#

padding?

#

Returns:

  • (Boolean)


430
431
432
# File 'lib/roebe/gui/universal_widgets/wlan_information_center/wlan_information_center.rb', line 430

def padding?
  0
end

#resetObject

#

reset (reset tag)

#


99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
# File 'lib/roebe/gui/universal_widgets/wlan_information_center/wlan_information_center.rb', line 99

def reset
  super() if respond_to?(:super)
  reset_the_shared_module # This can come early.
  reset_the_base_module
  reset_the_internal_variables
  infer_the_namespace
  # ======================================================================= #
  # === @configuration
  # ======================================================================= #
  @configuration = [true, __dir__, namespace?]
  # ======================================================================= #
  # === Set the title, width, height and the font in use.
  # ======================================================================= #
  title_width_height_font(TITLE, WIDTH, HEIGHT, USE_THIS_FONT)
  if use_gtk3?
    handle_CSS_rules
  end
  infer_the_size_automatically
end

#reset_the_shared_moduleObject

#

reset_the_shared_module

This method can be used for ruby-gtk3 and ruby-libui, among other toolkits.

#


178
179
180
181
182
183
# File 'lib/roebe/gui/universal_widgets/wlan_information_center/wlan_information_center.rb', line 178

def reset_the_shared_module
  # ======================================================================= #
  # === @wlan
  # ======================================================================= #
  @wlan = Roebe::Wlan.new(:do_not_run_yet)
end

#return_box_for_the_laptopObject

#

return_box_for_the_laptop

#


198
199
200
201
202
203
204
205
206
207
208
209
210
211
# File 'lib/roebe/gui/universal_widgets/wlan_information_center/wlan_information_center.rb', line 198

def return_box_for_the_laptop
  box_for_the_laptop = create_vbox
  box_for_the_laptop.minimal(
    left_aligned_text(
      'This section is for laptop-related aspects.'
    ), 12
  )
  box_hbox_small = create_hbox
  box_hbox_small.minimal(
    return_button_assume_laptop, 2
  )
  box_for_the_laptop.minimal(box_hbox_small, 5)
  return box_for_the_laptop
end

#return_button_assume_laptopObject

#

return_button_assume_laptop

#


216
217
218
219
220
221
222
223
224
225
226
227
228
229
# File 'lib/roebe/gui/universal_widgets/wlan_information_center/wlan_information_center.rb', line 216

def return_button_assume_laptop
  # ======================================================================= #
  # Add the "Assume laptop" button next:
  # ======================================================================= #
  button_assume_laptop = bold_button('💻 Assume laptop')
  button_assume_laptop.clear_background
  button_assume_laptop.css_class('fancy_button')
  button_assume_laptop.hint = 'Click this button to '\
    '<b>set the ESSID to my home network</b>.'
  button_assume_laptop.on_clicked {
    @entry_for_essid.set_text(@wlan.main_essid?)
  }
  return button_assume_laptop
end

#return_components_for_the_third_widgetObject

#

return_components_for_the_third_widget

This is the tab-entry available under ‘Startup’.

#


544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
# File 'lib/roebe/gui/universal_widgets/wlan_information_center/wlan_information_center.rb', line 544

def return_components_for_the_third_widget
  frame_run_the_following_commands = create_frame
  frame_run_the_following_commands.set_border_width(5)
  hbox_frame = create_vbox
  hbox_frame.minimal(
    text('Run the following commands: '), 5
  )
  # ======================================================================= #
  # === button 1
  # ======================================================================= #
  label_entry_number = bold_label(' 1 ')
  hbox = create_hbox
  hbox.minimal(label_entry_number, 0)
  hbox.maximal(@button_1, 0)
  hbox_frame.minimal(hbox, 2)
  # ======================================================================= #
  # === button 2
  # ======================================================================= #
  cmd = 'wpa_passphrase 1aaaaaaaaa >> /etc/wpa_supplicant.conf'
  label_entry_number = bold_label(' 2 ')
  button_2 = create_button(cmd)
  button_2.set_name('button1')
  button_2.text_is_on_the_left_side
  button_2.on_clicked {
    esystem cmd
  }
  button_2.on_hover(:lightgreen)
  hbox = create_hbox
  hbox.minimal(label_entry_number, 0)
  hbox.maximal(button_2, 0)
  hbox_frame.minimal(hbox, 2)
  # ======================================================================= #
  # === button 3
  # ======================================================================= #
  cmd = 'wpa_supplicant -B -D wext -i '+@entry_use_this_wlan_interface.text.to_s+' -c /etc/wpa_supplicant.conf'
  label_entry_number = bold_label(' 3 ')
  button_3 = button(cmd)
  button_3.set_name('button1')
  button_3.text_is_on_the_left_side
  button_3.on_clicked {
    esystem cmd
  }
  button_3.on_hover(:lightgreen)
  hbox = create_hbox
  hbox.minimal(label_entry_number, 0)
  hbox.maximal(button_3, 0)
  hbox_frame.minimal(hbox, 2)
  # ======================================================================= #
  # === button 4
  # ======================================================================= #
  cmd = return_main_dhclient_command
  label_entry_number = bold_label(' 4 ')
  button_4 = create_button(cmd)
  button_4.set_name('button1')
  button_4.text_is_on_the_left_side
  button_4.on_clicked {
    esystem cmd
  }
  button_4.on_hover(:lightgreen)
  hbox = create_hbox
  hbox.minimal(label_entry_number, 0)
  hbox.maximal(button_4, 0)
  hbox_frame.minimal(hbox, 2)
  hbox_frame.set_border_width(6)

  frame_run_the_following_commands.add(hbox_frame)
  return frame_run_the_following_commands
end

#return_ESSID_to_use_widgetObject

#

return_ESSID_to_use_widget

#


399
400
401
402
403
404
405
406
407
# File 'lib/roebe/gui/universal_widgets/wlan_information_center/wlan_information_center.rb', line 399

def return_ESSID_to_use_widget
  hbox = create_hbox
  label = bold_label(
    'ESSID to use: '
  )
  hbox.minimal(label,            2)
  hbox.maximal(@entry_for_essid, 2)
  return hbox
end

#return_hbox_with_some_buttonsObject

#

return_hbox_with_some_buttons

#


276
277
278
279
280
281
282
283
284
285
286
287
# File 'lib/roebe/gui/universal_widgets/wlan_information_center/wlan_information_center.rb', line 276

def return_hbox_with_some_buttons
  hbox = create_hbox
  button_reset_to_the_default = button('_Reset to the default values', self, :use_mnemonics) {
    :do_reset_to_the_default_values
  }
  button_reset_to_the_default.hint = 'This will reset to the default '\
    'values again.'
  button_reset_to_the_default.bblack1
  button_reset_to_the_default.set_name('button1')
  hbox.minimal(button_reset_to_the_default, 2)
  return hbox
end

#return_home_essid?Boolean

#

return_home_essid?

#

Returns:

  • (Boolean)


292
293
294
# File 'lib/roebe/gui/universal_widgets/wlan_information_center/wlan_information_center.rb', line 292

def return_home_essid?
  ::Roebe::Wlan::HOME_ESSID.to_s
end

#return_main_dhclient_command(i = entry_use_this_wlan_interface? ) ⇒ Object

#

return_main_dhclient_command

#


241
242
243
244
245
# File 'lib/roebe/gui/universal_widgets/wlan_information_center/wlan_information_center.rb', line 241

def return_main_dhclient_command(
    i = entry_use_this_wlan_interface?
  )
  "dhclient #{i.text?}"
end

#return_scan_for_available_ESSIDS_widgetObject

#

return_scan_for_available_ESSIDS_widget

#


299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
# File 'lib/roebe/gui/universal_widgets/wlan_information_center/wlan_information_center.rb', line 299

def return_scan_for_available_ESSIDS_widget
  box = create_hbox
  use_this_label = left_aligned_bold_label('Scan for available ESSIDs')
  box.minimal(use_this_label, 2)
  # ======================================================================= #
  # Next, we used to put an emoji into the label, which was
  # 📶 - the "Antenna with Bar" emoji. Since as of 14.05.2021
  # we will use an image instead.
  # ======================================================================= #
  use_this_image = network_cellular_signal_excellent_symbolic_symbolic
  use_this_image.set_hexpand(true)
  # ======================================================================= #
  # Next, the event-box that scans for available ESSIDs.
  # ======================================================================= #
  event_box = create_event_box(use_this_image)
  event_box.hint = 'Click on this button to scan for the '\
    'available ESSIDs again.'
  event_box.on_clicked {
    do_scan_again
  }
  box.minimal(event_box,                         2)
  box.minimal(@combo_box_entry_available_essids, 2)
  return box
end

#return_the_ping_widgetObject

#

return_the_ping_widget

#


679
680
681
# File 'lib/roebe/gui/universal_widgets/wlan_information_center/wlan_information_center.rb', line 679

def return_the_ping_widget
  ::Gtk::PingWidget.new
end
#
#


672
673
674
# File 'lib/roebe/gui/universal_widgets/wlan_information_center/wlan_information_center.rb', line 672

def return_the_text_for_button_1_showing_the_ip_link_set_command
  return 'ip link set '+@entry_use_this_wlan_interface.text.to_s+' up'
end

#return_wlan_interface_to_useObject

#

return_wlan_interface_to_use

#


419
420
421
422
423
424
425
# File 'lib/roebe/gui/universal_widgets/wlan_information_center/wlan_information_center.rb', line 419

def return_wlan_interface_to_use
  box = create_hbox
  label = bold_label('wlan-interface name: ')
  box.minimal(label)
  box.maximal(@entry_use_this_wlan_interface)
  return box
end

#runObject

#

run (run tag)

#


712
713
714
# File 'lib/roebe/gui/universal_widgets/wlan_information_center/wlan_information_center.rb', line 712

def run
  run_super
end

#set_buffer_text(i) ⇒ Object

#

set_buffer_text

#


166
167
168
169
170
# File 'lib/roebe/gui/universal_widgets/wlan_information_center/wlan_information_center.rb', line 166

def set_buffer_text(i)
  i = i.to_s
  e i
  @scrolled_window.set_text(i)
end

#smaller_font?Boolean

#

smaller_font?

#

Returns:

  • (Boolean)


122
123
124
# File 'lib/roebe/gui/universal_widgets/wlan_information_center/wlan_information_center.rb', line 122

def smaller_font?
  SMALLER_FONT
end

#sync_the_combo_box_entry_onto_the_correct_entryObject

#

sync_the_combo_box_entry_onto_the_correct_entry

#


346
347
348
349
# File 'lib/roebe/gui/universal_widgets/wlan_information_center/wlan_information_center.rb', line 346

def sync_the_combo_box_entry_onto_the_correct_entry
  new_text = @combo_box_entry_available_essids.text?.to_s
  @entry_for_essid.set_text(new_text)
end

#update_button_1_with_the_new_name_of_the_wlan_interfaceObject

#

update_button_1_with_the_new_name_of_the_wlan_interface

#


663
664
665
666
667
# File 'lib/roebe/gui/universal_widgets/wlan_information_center/wlan_information_center.rb', line 663

def update_button_1_with_the_new_name_of_the_wlan_interface
  if @button_1
    @button_1.set_text(return_the_text_for_button_1_showing_the_ip_link_set_command)
  end
end