roebe 0.5.191 → 0.6.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +89 -41
- data/bin/create_my_directories +2 -2
- data/bin/{ruby_dhcpcd → dhcpcd_wrapper} +1 -1
- data/bin/start_lighty +1 -1
- data/doc/README.gen +78 -15
- data/doc/core/array.md +24 -23
- data/doc/core/gem_and_gemspec.md +12 -11
- data/doc/core/hash.md +6 -0
- data/doc/core/misc.md +23 -20
- data/doc/core/regex.md +1 -1
- data/doc/core/stderr.md +16 -0
- data/doc/deprecations/deprecations.md +2 -1
- data/doc/statistics/statistics.md +1 -0
- data/lib/roebe/actions/actions.rb +80 -0
- data/lib/roebe/base/colours.rb +52 -19
- data/lib/roebe/base/misc.rb +30 -1
- data/lib/roebe/base/opnn.rb +7 -0
- data/lib/roebe/browser/output_url_then_open_in_browser.rb +18 -15
- data/lib/roebe/classes/alltagsgeschichte.rb +1 -1
- data/lib/roebe/classes/at.rb +2 -2
- data/lib/roebe/classes/auto_rename_file_based_on_its_creation_date.rb +24 -12
- data/lib/roebe/classes/books/books.rb +234 -142
- data/lib/roebe/classes/books/finished_books/finished_books.rb +10 -3
- data/lib/roebe/classes/books/menu.rb +25 -16
- data/lib/roebe/classes/books/sanitize_this_book_path/sanitize_this_book_path.rb +0 -1
- data/lib/roebe/classes/check_yaml.rb +15 -11
- data/lib/roebe/classes/compile_kernel.rb +3 -1
- data/lib/roebe/classes/contacts/contacts.rb +104 -0
- data/lib/roebe/classes/contacts/gui/universal_widgets/contacts.rb +168 -0
- data/lib/roebe/classes/contacts/shared_code.rb +344 -0
- data/lib/roebe/classes/copy_kernel_config.rb +5 -3
- data/lib/roebe/classes/create_desktop_file.rb +1 -1
- data/lib/roebe/classes/create_file_skeleton/constants.rb +1 -1
- data/lib/roebe/classes/create_file_skeleton/generate_ruby_string.rb +20 -20
- data/lib/roebe/classes/create_file_skeleton/reset.rb +19 -16
- data/lib/roebe/classes/create_my_directories.rb +12 -10
- data/lib/roebe/classes/dhcpcd/{dhcpcd.rb → dhcpcd_wrapper.rb} +137 -95
- data/lib/roebe/classes/dhcpcd/kill_dhcpcd.rb +2 -2
- data/lib/roebe/classes/do_install.rb +7 -6
- data/lib/roebe/classes/done.rb +1 -1
- data/lib/roebe/classes/downcase_extension.rb +4 -4
- data/lib/roebe/classes/email.rb +44 -40
- data/lib/roebe/classes/enable.rb +1 -1
- data/lib/roebe/classes/generate_alsa_conf.rb +4 -4
- data/lib/roebe/classes/generate_overview_of_the_locally_available_books.rb +5 -3
- data/lib/roebe/classes/github.rb +1 -1
- data/lib/roebe/classes/kde/install_this_konsole_theme.rb +1 -1
- data/lib/roebe/classes/{handle_lighttpd.rb → lighttpd/lighttpd_wrapper.rb} +55 -47
- data/lib/roebe/classes/make_gem.rb +49 -35
- data/lib/roebe/classes/mbl.rb +6 -4
- data/lib/roebe/classes/readme_generator/readme_generator.rb +597 -1
- data/lib/roebe/classes/remove_trailing_newline.rb +82 -0
- data/lib/roebe/classes/report_how_many_files_are_in_this_directory.rb +83 -0
- data/lib/roebe/classes/rxinitrc/constants.rb +7 -5
- data/lib/roebe/classes/rxinitrc/rxinitrc.rb +8 -4
- data/lib/roebe/classes/set_background.rb +14 -0
- data/lib/roebe/classes/show_ten_aliases.rb +15 -3
- data/lib/roebe/classes/simple_boot_script.rb +1 -1
- data/lib/roebe/classes/size_of.rb +9 -7
- data/lib/roebe/classes/tales_from_the_crypt.rb +1 -1
- data/lib/roebe/classes/update.rb +4 -11
- data/lib/roebe/classes/upload_to_imgur.rb +64 -35
- data/lib/roebe/commandline/misc.rb +28 -28
- data/lib/roebe/constants/array_install_these_gem_projects.rb +1 -1
- data/lib/roebe/constants/constants.rb +8 -1
- data/lib/roebe/constants/emojis.rb +0 -19
- data/lib/roebe/constants/file_and_directory_constants.rb +2 -2
- data/lib/roebe/constants/misc.rb +10 -2
- data/lib/roebe/constants/roebe.rb +2 -0
- data/lib/roebe/custom_methods/module.rb +45 -16
- data/lib/roebe/fonts/fonts.rb +39 -0
- data/lib/roebe/gui/universal_widgets/books/books.rb +232 -0
- data/lib/roebe/hello_world/hello_world.rb +0 -0
- data/lib/roebe/irb/clean_irbrc +1 -0
- data/lib/roebe/math/log10.rb +3 -3
- data/lib/roebe/math/the_collatz_problem.rb +104 -0
- data/lib/roebe/{toplevel_methods/lighttpd.rb → requires/require_lighttpd.rb} +2 -2
- data/lib/roebe/shell/shell/shell.rb +6 -6
- data/lib/roebe/shell_scripts/README.md +0 -0
- data/lib/roebe/shell_scripts/bashrc +0 -0
- data/lib/roebe/shell_scripts/konsole_tabs.sh +6 -0
- data/lib/roebe/shell_scripts/lfs/001_binutils_1.sh +10 -2
- data/lib/roebe/shell_scripts/lfs/002_gcc_1.sh +33 -3
- data/lib/roebe/shell_scripts/lfs/003_linux_1.sh +1 -0
- data/lib/roebe/shell_scripts/lfs/004_glibc_1.sh +5 -2
- data/lib/roebe/shell_scripts/lfs/005_libstdc++_1.sh +8 -1
- data/lib/roebe/shell_scripts/lfs/007_ncurses_2.sh +5 -2
- data/lib/roebe/shell_scripts/lfs/020_xz_2.sh +5 -4
- data/lib/roebe/shell_scripts/lfs/022_gcc_2.sh +15 -1
- data/lib/roebe/shell_scripts/lfs/025_ruby_2.sh +13 -0
- data/lib/roebe/shell_scripts/lfs/README.md +0 -0
- data/lib/roebe/shell_scripts/lfs/lfs_build_variables.sh +56 -16
- data/lib/roebe/toplevel_methods/module_methods.rb +5 -3
- data/lib/roebe/toplevel_methods/to_mp3.rb +1 -1
- data/lib/roebe/version/version.rb +2 -2
- data/lib/roebe/wasm/README.md +7 -0
- data/lib/roebe/wasm/enable_simple_puts_output.rb +9 -0
- data/lib/roebe/wasm/wasm_examples.html +43 -0
- data/lib/roebe/www/LEDS/LEDS.rb +35 -25
- data/lib/roebe/www/RNA/RNA.cgi +42 -1
- data/lib/roebe/www/algorithms/algorithms.rb +40 -0
- data/lib/roebe/www/analytical_chemistry/content.md +6 -0
- data/lib/roebe/www/animals/animals.cgi +25 -0
- data/lib/roebe/www/bioanalytik/bioanalytik.cgi +90 -0
- data/lib/roebe/www/biotechnology/biotechnology.rb +39 -3
- data/lib/roebe/www/cellbiology/cellbiology.rb +19 -2
- data/lib/roebe/www/chemistry/S/303/244uren_Basen_und_der_pH_Wert/S/303/244uren_Basen_und_der_pH_Wert.cgi +242 -0
- data/lib/roebe/www/chemistry/chemistry.rb +10 -258
- data/lib/roebe/www/chemistry/css_rules.css +67 -0
- data/lib/roebe/www/chemistry/die_quantenzahlen/die_quantenzahlen.cgi +123 -0
- data/lib/roebe/www/chemistry/funktionelle_gruppen_in_der_chemie/funktionelle_gruppen_in_der_chemie.cgi +52 -0
- data/lib/roebe/www/chrome_and_chromium/chrome_and_chromium.rb +37 -42
- data/lib/roebe/www/chromium +1 -0
- data/lib/roebe/www/cognitive_biology/cognitive_biology.cgi +18 -3
- data/lib/roebe/www/erste_hilfe/erste_hilfe.cgi +215 -62
- data/lib/roebe/www/fonts/fonts.cgi +245 -0
- data/lib/roebe/www/genomics/genomics.rb +4 -0
- data/lib/roebe/www/hardware/computersysteme/computersysteme.rb +117 -102
- data/lib/roebe/www/hardware/netzteile/netzteile.cgi +94 -0
- data/lib/roebe/www/immunology/immunology.rb +131 -7
- data/lib/roebe/www/insekten/insekten.md +27 -0
- data/lib/roebe/www/lighttpd/autogenerated_lighttpd.conf +7 -3
- data/lib/roebe/www/lighttpd/configuration/index.conf +7 -4
- data/lib/roebe/www/lighttpd/lighttpd.rb +6 -6
- data/lib/roebe/www/linux/antiX/antiX.rb +7 -4
- data/lib/roebe/www/linux/linux.rb +9 -11
- data/lib/roebe/www/linux/linuxmint/linuxmint.rb +33 -0
- data/lib/roebe/www/linux/slackware/slackware.rb +136 -27
- data/lib/roebe/www/linux/void/void.rb +34 -8
- data/lib/roebe/www/linux_commands/linux_commands.rb +6 -6
- data/lib/roebe/www/lyrics/lyrics.rb +1 -1
- data/lib/roebe/www/metabolic_pathways/metabolic_pathways.rb +5 -1
- data/lib/roebe/www/microbiology/microbiology.rb +17 -2
- data/lib/roebe/www/mikrobielle_physiologie/mikrobielle_physiologie.cgi +1086 -2
- data/lib/roebe/www/mitochondria/mitochondria.cgi +16 -2
- data/lib/roebe/www/module_www.rb +2 -3
- data/lib/roebe/www/neurobiology/neurobiology.rb +20 -3
- data/lib/roebe/www/pdf/pdf.rb +13 -0
- data/lib/roebe/www/physics/physics.rb +20 -4
- data/lib/roebe/www/physiology/physiology.rb +5 -1
- data/lib/roebe/www/play_this_video_file/play_this_video_file.cgi +1 -1
- data/lib/roebe/www/programming_advice/programming_advice.cgi +36 -0
- data/lib/roebe/www/programming_advice/programming_advice.md +358 -0
- data/lib/roebe/www/psychologie/psychologie.rb +7 -1
- data/lib/roebe/www/science/science.rb +6 -0
- data/lib/roebe/www/sex_and_reproduction/sex_and_reproduction.cgi +18 -2
- data/lib/roebe/www/statistik/statistik.rb +6 -1
- data/lib/roebe/www/structural_biology/structural_biology.cgi +18 -0
- data/lib/roebe/www/the_cell_cycle/the_cell_cycle.cgi +27 -0
- data/lib/roebe/www/video/video.rb +1 -1
- data/lib/roebe/www/virology/virology.rb +12 -1
- data/lib/roebe/www/war_in_Ukraine_2022/war_in_Ukraine_2022.rb +70 -28
- data/lib/roebe/www/waschmaschinen/waschmaschinen.rb +5 -4
- data/lib/roebe/www/xfce/xfce.cgi +5 -4
- data/lib/roebe/www/xorg/xorg.rb +3 -202
- data/lib/roebe/www/yeast/yeast.rb +4 -2
- data/lib/roebe/www/yubiko/yubiko.cgi +49 -0
- data/lib/roebe/yaml/{autostart_these_programs.yml → autostart_these_programs/autostart_these_programs.yml} +7 -6
- data/lib/roebe/yaml/books/favourite_books.yml +11 -9
- data/lib/roebe/yaml/directory_structure.yml +2 -0
- data/lib/roebe/yaml/use_this_editor/use_this_editor.yml +1 -0
- metadata +39 -20
- data/lib/roebe/classes/readme_generator/constants.rb +0 -21
- data/lib/roebe/classes/readme_generator/initialize.rb +0 -38
- data/lib/roebe/classes/readme_generator/misc.rb +0 -548
- data/lib/roebe/classes/readme_generator/reset.rb +0 -28
- data/lib/roebe/classes/readme_generator/run.rb +0 -20
- data/lib/roebe/shell_scripts/lfs/lfs_variables.sh +0 -31
- data/lib/roebe/www/cognitive_biology/cognitive_biology.html +0 -40634
- data/lib/roebe/www/mikrobielle_physiologie/mikrobielle_physiologie.rb +0 -1055
- data/lib/roebe/www/programming_advice/programming_advice.yml +0 -31
- data/lib/roebe/yaml/main_editor.yml +0 -1
@@ -28,7 +28,9 @@ class CompileKernel < Base
|
|
28
28
|
|
29
29
|
include FileUtils::Verbose
|
30
30
|
|
31
|
-
|
31
|
+
begin
|
32
|
+
require 'rbt/toplevel_methods/archive_related_code.rb'
|
33
|
+
rescue LoadError; end
|
32
34
|
|
33
35
|
# ========================================================================= #
|
34
36
|
# === SRC_DIR
|
@@ -0,0 +1,104 @@
|
|
1
|
+
#!/usr/bin/ruby -w
|
2
|
+
# Encoding: UTF-8
|
3
|
+
# frozen_string_literal: true
|
4
|
+
# ============================================================================ #
|
5
|
+
# === Roebe::Contacts
|
6
|
+
#
|
7
|
+
# Usage example:
|
8
|
+
#
|
9
|
+
# Roebe::Contacts.new(ARGV)
|
10
|
+
#
|
11
|
+
# ============================================================================ #
|
12
|
+
# require 'roebe/classes/contacts/contacts.rb'
|
13
|
+
# =========================================================================== #
|
14
|
+
require 'roebe/base/base.rb'
|
15
|
+
|
16
|
+
module Roebe
|
17
|
+
|
18
|
+
class Contacts < Base # === Roebe::Contacts
|
19
|
+
|
20
|
+
require 'roebe/classes/contacts/shared_code.rb'
|
21
|
+
include Roebe::Contacts::SharedCode
|
22
|
+
|
23
|
+
# ========================================================================== #
|
24
|
+
# === initialize
|
25
|
+
# ========================================================================== #
|
26
|
+
def initialize(
|
27
|
+
commandline_arguments = nil,
|
28
|
+
run_already = true
|
29
|
+
)
|
30
|
+
reset
|
31
|
+
set_commandline_arguments(
|
32
|
+
commandline_arguments
|
33
|
+
)
|
34
|
+
run if run_already
|
35
|
+
end
|
36
|
+
|
37
|
+
# ========================================================================== #
|
38
|
+
# === reset (reset tag)
|
39
|
+
# ========================================================================== #
|
40
|
+
def reset
|
41
|
+
super()
|
42
|
+
infer_the_namespace
|
43
|
+
reset_the_shared_module
|
44
|
+
end
|
45
|
+
|
46
|
+
# ========================================================================== #
|
47
|
+
# === show_help (help tag)
|
48
|
+
# ========================================================================== #
|
49
|
+
def show_help
|
50
|
+
e
|
51
|
+
e 'No documented help-options are available for this class.'
|
52
|
+
e
|
53
|
+
end
|
54
|
+
|
55
|
+
# ========================================================================== #
|
56
|
+
# === show_all_contacts_on_the_commandline
|
57
|
+
# ========================================================================== #
|
58
|
+
def show_all_contacts_on_the_commandline
|
59
|
+
orev 'These contacts are available:'
|
60
|
+
e
|
61
|
+
@dataset.each_with_index {|inner_array, index| index += 1
|
62
|
+
name = inner_array[0]
|
63
|
+
phone_number = inner_array[1]
|
64
|
+
email = inner_array[2]
|
65
|
+
birth_date = inner_array[3]
|
66
|
+
residence = inner_array[4]
|
67
|
+
_ICQ = inner_array[5]
|
68
|
+
e lightgreen(index.to_s)
|
69
|
+
e
|
70
|
+
e ' '+royalblue('Name: ')+rev+name.to_s
|
71
|
+
unless phone_number.nil? or phone_number.empty?
|
72
|
+
e ' '+rev+' Phone number: '+olive(phone_number.to_s)
|
73
|
+
end
|
74
|
+
e ' '+rev+' Birth date: '+steelblue(birth_date.to_s) unless birth_date.nil? or birth_date.to_s.empty?
|
75
|
+
e ' '+rev+' Residence: '+steelblue(residence.to_s) unless residence.nil? or residence.empty?
|
76
|
+
e ' '+rev+' Email: '+steelblue(email.to_s) unless email.nil? or email.empty?
|
77
|
+
e
|
78
|
+
}
|
79
|
+
e
|
80
|
+
end
|
81
|
+
|
82
|
+
# ========================================================================== #
|
83
|
+
# === Roebe::Contacts[]
|
84
|
+
# ========================================================================== #
|
85
|
+
def self.[](i = ARGV)
|
86
|
+
new(i)
|
87
|
+
end
|
88
|
+
|
89
|
+
end
|
90
|
+
|
91
|
+
# ============================================================================ #
|
92
|
+
# === Roebe.contacts
|
93
|
+
# ============================================================================ #
|
94
|
+
def self.contacts(
|
95
|
+
i = ARGV
|
96
|
+
)
|
97
|
+
Roebe::Contacts.new(i)
|
98
|
+
end
|
99
|
+
|
100
|
+
end
|
101
|
+
|
102
|
+
if __FILE__ == $PROGRAM_NAME
|
103
|
+
Roebe.contacts(ARGV)
|
104
|
+
end # contacts
|
@@ -0,0 +1,168 @@
|
|
1
|
+
#!/usr/bin/ruby -w
|
2
|
+
# Encoding: UTF-8
|
3
|
+
# frozen_string_literal: true
|
4
|
+
# =========================================================================== #
|
5
|
+
# === Roebe::GUI::UniversalWidgets::Contacts
|
6
|
+
#
|
7
|
+
# Usage example:
|
8
|
+
#
|
9
|
+
# Roebe::GUI::UniversalWidgets::Contacts.new(ARGV)
|
10
|
+
#
|
11
|
+
# =========================================================================== #
|
12
|
+
# require 'roebe/classes/contacts/gui/universal_widgets/contacts.rb'
|
13
|
+
# Roebe::GUI::UniversalWidgets::Contacts.new
|
14
|
+
# =========================================================================== #
|
15
|
+
require 'roebe/base/base.rb'
|
16
|
+
|
17
|
+
module Roebe
|
18
|
+
|
19
|
+
module GUI
|
20
|
+
|
21
|
+
module UniversalWidgets
|
22
|
+
|
23
|
+
class Contacts < ::Roebe::Base # === Roebe::GUI::UniversalWidgets::Contacts
|
24
|
+
|
25
|
+
require 'universal_widgets/base_module/base_module.rb'
|
26
|
+
include ::UniversalWidgets::BaseModule
|
27
|
+
|
28
|
+
require 'roebe/classes/contacts/shared_code.rb'
|
29
|
+
include Roebe::Contacts::SharedCode
|
30
|
+
|
31
|
+
# ========================================================================= #
|
32
|
+
# === initialize
|
33
|
+
# ========================================================================= #
|
34
|
+
def initialize(
|
35
|
+
commandline_arguments = nil
|
36
|
+
)
|
37
|
+
super(:vertical) if use_gtk3?
|
38
|
+
determine_the_GUI_to_be_used(commandline_arguments) # This must come first, even before reset().
|
39
|
+
reset
|
40
|
+
set_commandline_arguments(
|
41
|
+
commandline_arguments
|
42
|
+
)
|
43
|
+
on_delete_event_quit_the_application
|
44
|
+
do_use_the_GUI_mode
|
45
|
+
default_run_logic
|
46
|
+
end
|
47
|
+
|
48
|
+
# ========================================================================= #
|
49
|
+
# === reset (reset tag)
|
50
|
+
# ========================================================================= #
|
51
|
+
def reset
|
52
|
+
super()
|
53
|
+
reset_the_base_module
|
54
|
+
reset_the_internal_variables
|
55
|
+
infer_the_namespace
|
56
|
+
reset_the_shared_module
|
57
|
+
# ======================================================================= #
|
58
|
+
# === @configuration
|
59
|
+
# ======================================================================= #
|
60
|
+
@configuration = [true, __dir__, namespace?]
|
61
|
+
# ======================================================================= #
|
62
|
+
# === Set the title, width, height and the font in use.
|
63
|
+
# ======================================================================= #
|
64
|
+
title_width_height_font(TITLE, WIDTH, HEIGHT, USE_THIS_FONT)
|
65
|
+
if use_gtk3?
|
66
|
+
handle_CSS_rules
|
67
|
+
end
|
68
|
+
infer_the_size_automatically
|
69
|
+
end
|
70
|
+
|
71
|
+
# ========================================================================= #
|
72
|
+
# === smaller_font?
|
73
|
+
# ========================================================================= #
|
74
|
+
def smaller_font?
|
75
|
+
SMALLER_FONT
|
76
|
+
end
|
77
|
+
|
78
|
+
# ========================================================================= #
|
79
|
+
# === handle_CSS_rules
|
80
|
+
# ========================================================================= #
|
81
|
+
def handle_CSS_rules
|
82
|
+
use_gtk_paradise_project_css_file
|
83
|
+
append_project_css_file
|
84
|
+
more_CSS_then_apply_it '
|
85
|
+
|
86
|
+
.css_for_the_main_scrolled_window {
|
87
|
+
border: 10px solid darkblue;
|
88
|
+
border-radius: 14px;
|
89
|
+
padding: 2px;
|
90
|
+
margin: 2px;
|
91
|
+
}
|
92
|
+
|
93
|
+
'
|
94
|
+
end; alias handle_ad_hoc_CSS_rules handle_CSS_rules # === handle_ad_hoc_CSS_rules
|
95
|
+
|
96
|
+
# ========================================================================= #
|
97
|
+
# === show_debug_information
|
98
|
+
# ========================================================================= #
|
99
|
+
def show_debug_information(e)
|
100
|
+
pp e if DEBUG
|
101
|
+
end; alias debug show_debug_information # === debug
|
102
|
+
|
103
|
+
# ========================================================================= #
|
104
|
+
# === padding?
|
105
|
+
# ========================================================================= #
|
106
|
+
def padding?
|
107
|
+
2
|
108
|
+
end
|
109
|
+
|
110
|
+
# ========================================================================= #
|
111
|
+
# === border_size?
|
112
|
+
# ========================================================================= #
|
113
|
+
def border_size?
|
114
|
+
2
|
115
|
+
end
|
116
|
+
|
117
|
+
# ========================================================================= #
|
118
|
+
# === connect_the_skeleton (connect tag)
|
119
|
+
# ========================================================================= #
|
120
|
+
def connect_the_skeleton
|
121
|
+
abort_on_exception
|
122
|
+
|
123
|
+
window = create_window_or_runner(nil, width?, height?, title?)
|
124
|
+
window << @scrolled_window
|
125
|
+
|
126
|
+
properly_prepare_this_window(window,
|
127
|
+
{
|
128
|
+
title: title?,
|
129
|
+
font: font?,
|
130
|
+
width: width?,
|
131
|
+
height: height?,
|
132
|
+
padding: padding?,
|
133
|
+
border_size: border_size?
|
134
|
+
}
|
135
|
+
)
|
136
|
+
window.show_all
|
137
|
+
window.top_left
|
138
|
+
run_main
|
139
|
+
end; alias connect_skeleton connect_the_skeleton # === connect_skeleton
|
140
|
+
|
141
|
+
# ========================================================================= #
|
142
|
+
# === Roebe::GUI::Gtk::Contacts.run
|
143
|
+
# ========================================================================= #
|
144
|
+
def self.run(
|
145
|
+
i = ARGV
|
146
|
+
)
|
147
|
+
require 'gtk_paradise/run'
|
148
|
+
_ = ::Roebe::GUI::Gtk::Contacts.new(i)
|
149
|
+
r = ::Gtk.run
|
150
|
+
r << _
|
151
|
+
r.automatic_size_then_automatic_title
|
152
|
+
r.enable_quick_exit
|
153
|
+
r.set_background :white
|
154
|
+
r.top_left_then_run
|
155
|
+
end
|
156
|
+
|
157
|
+
# ========================================================================= #
|
158
|
+
# === Roebe::GUI::UniversalWidgets::Contacts[]
|
159
|
+
# ========================================================================= #
|
160
|
+
def self.[](i = ARGV)
|
161
|
+
new(i)
|
162
|
+
end
|
163
|
+
|
164
|
+
end; end; end; end
|
165
|
+
|
166
|
+
if __FILE__ == $PROGRAM_NAME
|
167
|
+
Roebe::GUI::UniversalWidgets::Contacts.new(ARGV)
|
168
|
+
end # guishell
|
@@ -0,0 +1,344 @@
|
|
1
|
+
#!/usr/bin/ruby -w
|
2
|
+
# Encoding: UTF-8
|
3
|
+
# frozen_string_literal: true
|
4
|
+
# ============================================================================ #
|
5
|
+
# require 'roebe/classes/contacts/shared_code.rb'
|
6
|
+
# include Roebe::Contacts::SharedCode
|
7
|
+
# =========================================================================== #
|
8
|
+
require 'roebe/base/base.rb'
|
9
|
+
|
10
|
+
module Roebe
|
11
|
+
|
12
|
+
class Contacts < Base # === Roebe::Contacts
|
13
|
+
|
14
|
+
module SharedCode
|
15
|
+
|
16
|
+
# ========================================================================== #
|
17
|
+
# === N
|
18
|
+
# ========================================================================== #
|
19
|
+
N = "\n"
|
20
|
+
|
21
|
+
# ========================================================================== #
|
22
|
+
# === WIDTH
|
23
|
+
# ========================================================================== #
|
24
|
+
WIDTH = '85% or minimum 1800px'
|
25
|
+
|
26
|
+
# ========================================================================== #
|
27
|
+
# === HEIGHT
|
28
|
+
# ========================================================================== #
|
29
|
+
HEIGHT = '45% or minimum 800px'
|
30
|
+
|
31
|
+
# ========================================================================== #
|
32
|
+
# === USE_THIS_FONT
|
33
|
+
#
|
34
|
+
# This constant is only truly useful in a GUI-setting.
|
35
|
+
# ========================================================================== #
|
36
|
+
USE_THIS_FONT = :hack_22 # :dejavu_condensed_20
|
37
|
+
|
38
|
+
# ========================================================================== #
|
39
|
+
# === FILE_CONTACTS
|
40
|
+
#
|
41
|
+
# This file is hardcoded, defaulting to my home setup.
|
42
|
+
#
|
43
|
+
# Here the contact information from:
|
44
|
+
#
|
45
|
+
# bl $PERSONAL_YAML/yaml/contacts.yml
|
46
|
+
#
|
47
|
+
# ========================================================================== #
|
48
|
+
FILE_CONTACTS =
|
49
|
+
'/home/x/data/personal/yaml/contacts.yml'
|
50
|
+
|
51
|
+
# ========================================================================== #
|
52
|
+
# === TITLE
|
53
|
+
#
|
54
|
+
# This constants is in particular used for the GUI component.
|
55
|
+
# ========================================================================== #
|
56
|
+
TITLE = 'Contacts'
|
57
|
+
|
58
|
+
# ========================================================================== #
|
59
|
+
# === DEBUG
|
60
|
+
#
|
61
|
+
# This constant is mostly useful in a GUI setting, so for the commandline
|
62
|
+
# variant it is not too terribly useful.
|
63
|
+
# ========================================================================== #
|
64
|
+
DEBUG = false
|
65
|
+
|
66
|
+
# ========================================================================== #
|
67
|
+
# === create_and_fill_the_list_store
|
68
|
+
#
|
69
|
+
# Create our @list_store data here in this method.
|
70
|
+
# ========================================================================== #
|
71
|
+
def create_and_fill_the_list_store
|
72
|
+
@list_store = ::Gtk::ListStore.new(
|
73
|
+
*[String] * 6
|
74
|
+
)
|
75
|
+
contact_info?.each { |entry|
|
76
|
+
show_debug_information(entry) # Show debug information here.
|
77
|
+
iter = @list_store.append
|
78
|
+
iter.set_value(0, entry[0])
|
79
|
+
iter.set_value(1, entry[1].to_s) unless entry[1].nil?
|
80
|
+
iter.set_value(2, entry[2].to_s) unless entry[2].nil?
|
81
|
+
iter.set_value(3, entry[3].to_s) unless entry[3].nil?
|
82
|
+
# ===================================================================== #
|
83
|
+
# Entry number 4 is the "Wohnort", but we may have done this
|
84
|
+
# incorrectly for some entries.
|
85
|
+
# ===================================================================== #
|
86
|
+
unless entry[4].nil?
|
87
|
+
wohnort = entry[4]
|
88
|
+
if wohnort.is_a? Hash
|
89
|
+
if wohnort.has_key? 'phone'
|
90
|
+
iter.set_value(1, wohnort.delete('phone'))
|
91
|
+
end
|
92
|
+
end
|
93
|
+
wohnort = wohnort.to_s
|
94
|
+
iter.set_value(4, wohnort)
|
95
|
+
end
|
96
|
+
_ = entry[5].to_s
|
97
|
+
_ = '---' if _.empty?
|
98
|
+
iter.set_value(5, _)
|
99
|
+
}
|
100
|
+
end
|
101
|
+
|
102
|
+
# ========================================================================== #
|
103
|
+
# === create_cell_renderer
|
104
|
+
# ========================================================================== #
|
105
|
+
def create_cell_renderer
|
106
|
+
@renderer = create_cell_renderer_text
|
107
|
+
@renderer.editable = true
|
108
|
+
@renderer.set_property('background', 'white')
|
109
|
+
@renderer.set_cell_background('slateblue') # This makes the blue border.
|
110
|
+
end
|
111
|
+
|
112
|
+
# ========================================================================== #
|
113
|
+
# === create_note_viewer_at_bottom
|
114
|
+
# ========================================================================== #
|
115
|
+
def create_note_viewer_at_bottom
|
116
|
+
@text_buffer = create_text_buffer
|
117
|
+
@text_buffer.set_text('')
|
118
|
+
@text_view_at_bottom = create_text_view(@text_buffer)
|
119
|
+
@text_view_at_bottom.set_editable(true)
|
120
|
+
end
|
121
|
+
|
122
|
+
# ========================================================================== #
|
123
|
+
# === create_the_required_tree_view
|
124
|
+
#
|
125
|
+
# Our tree view will be created by this method.
|
126
|
+
# ========================================================================== #
|
127
|
+
def create_the_required_tree_view
|
128
|
+
@tree_view = create_tree_view(@list_store)
|
129
|
+
@tree_view.set_name('treeview1')
|
130
|
+
@tree_view << ['Name', @renderer, text: 0]
|
131
|
+
@tree_view << ['Telefon Nummer', @renderer, text: 1]
|
132
|
+
::Gtk.custom_treeview_widget( # This will be inserted in an absolute way.
|
133
|
+
@tree_view, 1, :phone, 'Telefon Nummer'
|
134
|
+
)
|
135
|
+
@tree_view << ['Email', @renderer, text: 2]
|
136
|
+
@tree_view << ['Geburtstag', @renderer, text: 3]
|
137
|
+
@tree_view << ['Wohnort', @renderer, text: 4]
|
138
|
+
@tree_view << ['ICQ Nummer', @renderer, text: 5]
|
139
|
+
@tree_view.hadjustment = ::Gtk::Adjustment.new(0.0, 0.0, 105.0, 0.2, 1.0, 1.0)
|
140
|
+
@tree_view.clickable_headers
|
141
|
+
@tree_view.enable_drag_and_drop # Enable drag and drop support of the treeview.
|
142
|
+
@tree_view.on_button_press_event { |widget, event|
|
143
|
+
# ===================================================================== #
|
144
|
+
# Show some information if the user clicks on this.
|
145
|
+
# ===================================================================== #
|
146
|
+
button_press_event = Gdk::EventType::BUTTON2_PRESS
|
147
|
+
if (event.event_type == button_press_event) and (event.button == 1) # event.event_type.name
|
148
|
+
Cliner.cliner
|
149
|
+
s = @tree_view.selection.selected
|
150
|
+
string = ''.dup
|
151
|
+
string << s[0]+N if s[0]
|
152
|
+
string << s[1]+N if s[1]
|
153
|
+
string << s[2]+N if s[2]
|
154
|
+
string << s[3]+N if s[3]
|
155
|
+
string << s[4]+N if s[4]
|
156
|
+
string << s[5]+N if s[5]
|
157
|
+
e string
|
158
|
+
Cliner.cliner
|
159
|
+
e
|
160
|
+
end
|
161
|
+
}
|
162
|
+
@tree_view.on_key_press_event { |widget, event|
|
163
|
+
case Gdk::Keyval.to_name(event.keyval)
|
164
|
+
when 'Return','KP_Enter' # enter drücken
|
165
|
+
e 'ENTER DR*CT - brauch ma des?'
|
166
|
+
end
|
167
|
+
}
|
168
|
+
@tree_view.on_button_press_event { |widget, event|
|
169
|
+
this_gdk_event = :button_press
|
170
|
+
if event.event_type == this_gdk_event # normaler mouse button
|
171
|
+
@tree_view.selection.unselect_all if event.button == 3
|
172
|
+
end
|
173
|
+
}
|
174
|
+
@tree_view.the_header_can_be_dragged
|
175
|
+
columns = @tree_view.columns?
|
176
|
+
handle_sorting(columns)
|
177
|
+
end
|
178
|
+
|
179
|
+
# ========================================================================== #
|
180
|
+
# === handle_sorting
|
181
|
+
# ========================================================================== #
|
182
|
+
def handle_sorting(
|
183
|
+
columns = @tree_view.columns?
|
184
|
+
)
|
185
|
+
# ======================================================================== #
|
186
|
+
# Enable sorting for some of the entries next.
|
187
|
+
# ======================================================================== #
|
188
|
+
columns[0].sortable_based_on(0)
|
189
|
+
columns[2].sortable_based_on(2) # This sorts based on the email.
|
190
|
+
columns[3].sortable_based_on(3) # This sorts based on the date-of-birth.
|
191
|
+
columns[4].sortable_based_on(4) # This sorts based on the "Wohnort" aka location.
|
192
|
+
end
|
193
|
+
|
194
|
+
# ========================================================================== #
|
195
|
+
# === use_the_commandline?
|
196
|
+
# ========================================================================== #
|
197
|
+
def use_the_commandline?
|
198
|
+
@internal_hash[:mode] == :commandline
|
199
|
+
end
|
200
|
+
|
201
|
+
# ========================================================================== #
|
202
|
+
# === mode?
|
203
|
+
# ========================================================================== #
|
204
|
+
def mode?
|
205
|
+
@internal_hash[:mode]
|
206
|
+
end
|
207
|
+
|
208
|
+
# ========================================================================== #
|
209
|
+
# === dataset?
|
210
|
+
# ========================================================================== #
|
211
|
+
def dataset?
|
212
|
+
@dataset
|
213
|
+
end; alias contact_info? dataset? # === contact_info?
|
214
|
+
|
215
|
+
# ========================================================================== #
|
216
|
+
# === menu (menu tag)
|
217
|
+
# ========================================================================== #
|
218
|
+
def menu(
|
219
|
+
i = commandline_arguments?
|
220
|
+
)
|
221
|
+
if i.is_a? Array
|
222
|
+
i.each {|entry| menu(entry) }
|
223
|
+
else
|
224
|
+
case i
|
225
|
+
# ====================================================================== #
|
226
|
+
# === contacts --GUI
|
227
|
+
# ====================================================================== #
|
228
|
+
when /^-?-?GUI$/i
|
229
|
+
start_the_GUI_interface
|
230
|
+
exit_program
|
231
|
+
# ====================================================================== #
|
232
|
+
# === help
|
233
|
+
# ====================================================================== #
|
234
|
+
when /help/
|
235
|
+
show_help
|
236
|
+
end
|
237
|
+
end
|
238
|
+
end
|
239
|
+
|
240
|
+
# ========================================================================== #
|
241
|
+
# === reset_the_shared_module
|
242
|
+
# ========================================================================== #
|
243
|
+
def reset_the_shared_module
|
244
|
+
# ======================================================================== #
|
245
|
+
# === @dataset
|
246
|
+
# ======================================================================== #
|
247
|
+
@dataset = nil
|
248
|
+
# ======================================================================== #
|
249
|
+
# We'll always ensure that the dataset from the contacts file is
|
250
|
+
# available here.
|
251
|
+
# ======================================================================== #
|
252
|
+
load_the_dataset_from_the_contacts_file
|
253
|
+
# ======================================================================== #
|
254
|
+
# :mode can be :commandline or :GUI
|
255
|
+
# ======================================================================== #
|
256
|
+
@internal_hash[:mode] = :commandline
|
257
|
+
end
|
258
|
+
|
259
|
+
# ========================================================================== #
|
260
|
+
# === file_contacts?
|
261
|
+
# ========================================================================== #
|
262
|
+
def file_contacts?
|
263
|
+
FILE_CONTACTS
|
264
|
+
end
|
265
|
+
|
266
|
+
# ========================================================================== #
|
267
|
+
# === load_the_dataset_from_the_contacts_file
|
268
|
+
# ========================================================================== #
|
269
|
+
def load_the_dataset_from_the_contacts_file(
|
270
|
+
i = file_contacts?
|
271
|
+
)
|
272
|
+
if File.exist? i
|
273
|
+
@dataset = YAML.load_file(i)
|
274
|
+
else
|
275
|
+
opnn; no_file_exists_at(i)
|
276
|
+
end
|
277
|
+
end; alias load_the_contacts_file load_the_dataset_from_the_contacts_file # === load_the_contacts_file
|
278
|
+
|
279
|
+
# ========================================================================== #
|
280
|
+
# === create_the_skeleton (create tag, skeleton tag)
|
281
|
+
# ========================================================================== #
|
282
|
+
def create_the_skeleton
|
283
|
+
if use_gtk3?
|
284
|
+
create_and_fill_the_list_store
|
285
|
+
create_cell_renderer
|
286
|
+
create_note_viewer_at_bottom
|
287
|
+
create_the_required_tree_view # Should come after the list store was filled.
|
288
|
+
create_the_default_scrolled_window # This should come last.
|
289
|
+
end
|
290
|
+
end; alias create_skeleton create_the_skeleton # === create_skeleton
|
291
|
+
|
292
|
+
# ========================================================================== #
|
293
|
+
# === start_the_GUI_interface
|
294
|
+
# ========================================================================== #
|
295
|
+
def start_the_GUI_interface
|
296
|
+
do_use_the_GUI_mode
|
297
|
+
require 'roebe/classes/contacts/gui/universal_widgets/contacts.rb'
|
298
|
+
Roebe::GUI::UniversalWidgets::Contacts.new
|
299
|
+
end
|
300
|
+
|
301
|
+
# ========================================================================== #
|
302
|
+
# === do_use_the_GUI_mode
|
303
|
+
# ========================================================================== #
|
304
|
+
def do_use_the_GUI_mode
|
305
|
+
@internal_hash[:mode] = :GUI
|
306
|
+
end
|
307
|
+
|
308
|
+
# ========================================================================== #
|
309
|
+
# === create_the_default_scrolled_window
|
310
|
+
# ========================================================================== #
|
311
|
+
def create_the_default_scrolled_window
|
312
|
+
widget = drag_via_up_and_down(@tree_view, @text_view_at_bottom)
|
313
|
+
@scrolled_window = create_scrolled_window(widget) { :automatic }
|
314
|
+
@scrolled_window.css_class('css_for_the_main_scrolled_window')
|
315
|
+
end
|
316
|
+
|
317
|
+
# ========================================================================== #
|
318
|
+
# === run (run tag)
|
319
|
+
# ========================================================================== #
|
320
|
+
def run
|
321
|
+
default_run_logic
|
322
|
+
end
|
323
|
+
|
324
|
+
# ========================================================================== #
|
325
|
+
# === default_run_logic
|
326
|
+
# ========================================================================== #
|
327
|
+
def default_run_logic
|
328
|
+
do_decide_what_to_do_after_the_dataset_has_been_initialized if @dataset
|
329
|
+
end
|
330
|
+
|
331
|
+
# ========================================================================== #
|
332
|
+
# === do_decide_what_to_do_after_the_dataset_has_been_initialized
|
333
|
+
# ========================================================================== #
|
334
|
+
def do_decide_what_to_do_after_the_dataset_has_been_initialized
|
335
|
+
# We'll always pass it through the menu-interface here.
|
336
|
+
if use_the_commandline?
|
337
|
+
menu
|
338
|
+
show_all_contacts_on_the_commandline
|
339
|
+
else
|
340
|
+
run_super
|
341
|
+
end
|
342
|
+
end
|
343
|
+
|
344
|
+
end; end; end
|
@@ -38,15 +38,17 @@ class CopyKernelConfig < Base # === Roebe::CopyKernelConfig
|
|
38
38
|
# === run
|
39
39
|
# ========================================================================= #
|
40
40
|
def run
|
41
|
-
opne steelblue('Copying')+
|
42
|
-
|
41
|
+
opne steelblue('Copying')+rev+
|
42
|
+
' the old kernel-config towards '+
|
43
|
+
sfile('/usr/src/linux/.config')+
|
44
|
+
rev+' next.'
|
43
45
|
if File.symlink? '/usr/src/linux'
|
44
46
|
version = File.readlink('/usr/src/linux').split('-').last
|
45
47
|
opne 'The linux kernel version is: '+
|
46
48
|
royalblue(version)
|
47
49
|
end
|
48
50
|
esystem 'zcat /proc/config.gz > /usr/src/linux/.config'
|
49
|
-
|
51
|
+
opne 'Now you could run:'
|
50
52
|
e
|
51
53
|
e royalblue('make oldconfig')
|
52
54
|
e
|
@@ -138,7 +138,7 @@ class CreateDesktopFile < Roebe::Base # === Roebe::CreateDesktopFile.new
|
|
138
138
|
# ========================================================================= #
|
139
139
|
def consider_creating_this_directory(i)
|
140
140
|
unless File.exist? i
|
141
|
-
opne "Creating #{sdir(i)} next."
|
141
|
+
opne "#{rev}Creating #{sdir(i)} #{rev}next."
|
142
142
|
FileUtils.mkdir_p(i)
|
143
143
|
end
|
144
144
|
end
|
@@ -15,7 +15,7 @@ class CreateFileSkeleton < Base # === Roebe::CreateFileSkeleton
|
|
15
15
|
# ========================================================================= #
|
16
16
|
# === Roebe::CreateFileSkeleton::THRESHOLD
|
17
17
|
# ========================================================================= #
|
18
|
-
THRESHOLD =
|
18
|
+
THRESHOLD = 76
|
19
19
|
|
20
20
|
# ========================================================================= #
|
21
21
|
# === USE_THIS_ENCODING
|