backup_paradise 1.3.1
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of backup_paradise might be problematic. Click here for more details.
- checksums.yaml +7 -0
- data/README.md +408 -0
- data/backup_paradise.gemspec +50 -0
- data/bin/backup_for_ingrid +10 -0
- data/bin/backup_paradise +7 -0
- data/bin/windows_backup_paradise +9 -0
- data/doc/README.gen +368 -0
- data/doc/TODO.md +130 -0
- data/lib/backup_paradise/actions/README.md +2 -0
- data/lib/backup_paradise/actions/backup.rb +62 -0
- data/lib/backup_paradise/base/base.rb +502 -0
- data/lib/backup_paradise/base/colours.rb +137 -0
- data/lib/backup_paradise/base/namespace.rb +16 -0
- data/lib/backup_paradise/base/tab.rb +47 -0
- data/lib/backup_paradise/colours/colours.rb +88 -0
- data/lib/backup_paradise/constants/constants.rb +162 -0
- data/lib/backup_paradise/gui/glimmer/libui/backup_for_ingrid/backup_for_ingrid.rb +87 -0
- data/lib/backup_paradise/gui/gtk2/OLD_backup.rb +220 -0
- data/lib/backup_paradise/gui/gtk3/simple_backup_widget/create.rb +70 -0
- data/lib/backup_paradise/gui/gtk3/simple_backup_widget/misc.rb +33 -0
- data/lib/backup_paradise/gui/gtk3/simple_backup_widget/simple_backup_widget.rb +160 -0
- data/lib/backup_paradise/gui/libui/backup_for_ingrid/backup_for_ingrid.rb +99 -0
- data/lib/backup_paradise/gui/libui/simple_backup_widget/simple_backup_widget.rb +119 -0
- data/lib/backup_paradise/gui/shared_code/simple_backup_widget/simple_backup_widget_module.rb +587 -0
- data/lib/backup_paradise/gui/tk/backup.rb +108 -0
- data/lib/backup_paradise/images/BACKUP_IMAGE.png +0 -0
- data/lib/backup_paradise/images/right_arrow.png +0 -0
- data/lib/backup_paradise/project/project.rb +40 -0
- data/lib/backup_paradise/requires/require_the_backup_paradise_project.rb +18 -0
- data/lib/backup_paradise/requires/require_yaml.rb +7 -0
- data/lib/backup_paradise/tab/tab.rb +87 -0
- data/lib/backup_paradise/toplevel_methods/cliner.rb +16 -0
- data/lib/backup_paradise/toplevel_methods/config.rb +86 -0
- data/lib/backup_paradise/toplevel_methods/create_and_remove.rb +63 -0
- data/lib/backup_paradise/toplevel_methods/e.rb +16 -0
- data/lib/backup_paradise/toplevel_methods/esystem.rb +19 -0
- data/lib/backup_paradise/toplevel_methods/files_and_directories.rb +181 -0
- data/lib/backup_paradise/toplevel_methods/help.rb +93 -0
- data/lib/backup_paradise/toplevel_methods/misc.rb +153 -0
- data/lib/backup_paradise/toplevel_methods/mountpoint.rb +188 -0
- data/lib/backup_paradise/toplevel_methods/opnn.rb +27 -0
- data/lib/backup_paradise/utility_scripts/backup/backup.rb +1901 -0
- data/lib/backup_paradise/version/version.rb +19 -0
- data/lib/backup_paradise/windows/README.md +1 -0
- data/lib/backup_paradise/windows/windows.rb +101 -0
- data/lib/backup_paradise/www/backup.cgi +63 -0
- data/lib/backup_paradise/yaml/config.yml +82 -0
- data/lib/backup_paradise.rb +5 -0
- data/test/testing_toplevel_functionality.rb +11 -0
- metadata +194 -0
@@ -0,0 +1,160 @@
|
|
1
|
+
#!/usr/bin/ruby -w
|
2
|
+
# Encoding: UTF-8
|
3
|
+
# frozen_string_literal: true
|
4
|
+
# =========================================================================== #
|
5
|
+
# === BackupParadise::GUI::Gtk::SimpleBackupWidget
|
6
|
+
#
|
7
|
+
# This is a simple gtk3-widget that can be used to quickly back up data
|
8
|
+
# to an external USB device (or a second harddisc).
|
9
|
+
# =========================================================================== #
|
10
|
+
# require 'backup_paradise/gui/gtk3/simple_backup_widget/simple_backup_widget.rb'
|
11
|
+
# BackupParadise::GUI::Gtk::SimpleBackupWidget.run
|
12
|
+
# =========================================================================== #
|
13
|
+
require 'gtk_paradise/require_gtk3'
|
14
|
+
|
15
|
+
module BackupParadise
|
16
|
+
|
17
|
+
module GUI
|
18
|
+
|
19
|
+
module Gtk
|
20
|
+
|
21
|
+
class SimpleBackupWidget < ::Gtk::BaseModuleBox # === BackupParadise::GUI::Gtk::SimpleBackupWidget
|
22
|
+
|
23
|
+
require 'backup_paradise/gui/shared_code/simple_backup_widget/simple_backup_widget_module.rb'
|
24
|
+
include BackupParadise::GUI::SimpleBackupWidgetModule
|
25
|
+
|
26
|
+
require 'backup_paradise/gui/gtk3/simple_backup_widget/create.rb'
|
27
|
+
require 'backup_paradise/gui/gtk3/simple_backup_widget/misc.rb'
|
28
|
+
|
29
|
+
# ========================================================================= #
|
30
|
+
# === initialize
|
31
|
+
# ========================================================================= #
|
32
|
+
def initialize(
|
33
|
+
commandline_arguments = ARGV,
|
34
|
+
run_already = true
|
35
|
+
)
|
36
|
+
super(:vertical)
|
37
|
+
set_border_width(0)
|
38
|
+
reset
|
39
|
+
set_commandline_arguments(
|
40
|
+
commandline_arguments
|
41
|
+
)
|
42
|
+
run if run_already
|
43
|
+
end
|
44
|
+
|
45
|
+
# ========================================================================= #
|
46
|
+
# === reset (reset tag)
|
47
|
+
# ========================================================================= #
|
48
|
+
def reset
|
49
|
+
reset_the_internal_variables
|
50
|
+
infer_the_namespace
|
51
|
+
# ======================================================================= #
|
52
|
+
# === @configuration
|
53
|
+
# ======================================================================= #
|
54
|
+
@configuration = [true, __dir__, namespace?]
|
55
|
+
reset_shared_module
|
56
|
+
set_use_this_font(USE_THIS_FONT)
|
57
|
+
handle_CSS
|
58
|
+
infer_the_size_automatically
|
59
|
+
end
|
60
|
+
|
61
|
+
# ========================================================================= #
|
62
|
+
# === handle_CSS (CSS tag, css tag)
|
63
|
+
# ========================================================================= #
|
64
|
+
def handle_CSS
|
65
|
+
use_gtk_paradise_project_css_file
|
66
|
+
apply_these_CSS_rules '
|
67
|
+
.dotted_steelblue_border {
|
68
|
+
border: 2px dotted steelblue;
|
69
|
+
}
|
70
|
+
|
71
|
+
.the_backup_button {
|
72
|
+
border: 3px dotted royalblue;
|
73
|
+
padding: 8px;
|
74
|
+
margin: 4px;
|
75
|
+
color: darkgreen;
|
76
|
+
font-weight: bold;
|
77
|
+
}
|
78
|
+
|
79
|
+
.the_backup_button:hover {
|
80
|
+
color: forestgreen;
|
81
|
+
font-weight: bold;
|
82
|
+
}
|
83
|
+
|
84
|
+
.the_backup_button_for_ingrid {
|
85
|
+
border: 2px dotted royalblue;
|
86
|
+
padding: 5px;
|
87
|
+
margin: 2px;
|
88
|
+
color: royalblue;
|
89
|
+
font-weight: bold;
|
90
|
+
}
|
91
|
+
|
92
|
+
.the_backup_button_for_ingrid_button:hover {
|
93
|
+
color: steelblue;
|
94
|
+
font-weight: bold;
|
95
|
+
}
|
96
|
+
|
97
|
+
'
|
98
|
+
end
|
99
|
+
|
100
|
+
# ========================================================================= #
|
101
|
+
# === connect_skeleton (connect tag)
|
102
|
+
# ========================================================================= #
|
103
|
+
def connect_skeleton
|
104
|
+
abort_on_exception
|
105
|
+
header_bar = return_default_header_bar { :with_close_button_and_inferred_title }
|
106
|
+
header_bar.spacing = 10
|
107
|
+
header_bar.add_left(@button_choose_file)
|
108
|
+
header_bar.add_left(@button_backup_audio)
|
109
|
+
@spinner = default_spinner
|
110
|
+
@spinner.is_inactive
|
111
|
+
header_bar.add_right(@spinner)
|
112
|
+
button = icon_theme_image('daytime-sunset-symbolic.symbolic')
|
113
|
+
button.hint = 'Click this icon to show which devices are mounted and '\
|
114
|
+
'update the combo-box showing all mounted devices.'
|
115
|
+
button.on_clicked {
|
116
|
+
scan_for_mountpoints_then_update_the_appropriate_combo_box
|
117
|
+
}
|
118
|
+
header_bar.add_left(button)
|
119
|
+
minimal(header_bar, 1)
|
120
|
+
minimal(horizontal_separator, 1)
|
121
|
+
minimal(@grid, 1)
|
122
|
+
minimal(horizontal_separator, 1)
|
123
|
+
hbox = gtk_hbox
|
124
|
+
_ = BackupParadise.project_base_directory?+'images/right_arrow.png'
|
125
|
+
if File.exist? _
|
126
|
+
hbox.minimal(image(_), 5)
|
127
|
+
end
|
128
|
+
hbox.maximal(@button_backup)
|
129
|
+
minimal(hbox)
|
130
|
+
minimal(horizontal_separator)
|
131
|
+
if is_on_roebe?
|
132
|
+
minimal(@button_ingrid)
|
133
|
+
minimal(horizontal_separator)
|
134
|
+
end
|
135
|
+
minimal(@label_showing_results)
|
136
|
+
minimal(horizontal_separator)
|
137
|
+
sync_the_combo_box_values_onto_the_entries_below
|
138
|
+
do_handle_the_proper_syncing_when_the_combo_box_entries_are_changed
|
139
|
+
end
|
140
|
+
|
141
|
+
# ========================================================================= #
|
142
|
+
# === run_file_chooser_dialog
|
143
|
+
# ========================================================================= #
|
144
|
+
def run_file_chooser_dialog(
|
145
|
+
_ = @file_chooser_dialog
|
146
|
+
)
|
147
|
+
if _ and (_.run == ::Gtk::ResponseType::ACCEPT)
|
148
|
+
filename = _.filename
|
149
|
+
e "filename = #{filename}"
|
150
|
+
e "uri = #{_.uri}"
|
151
|
+
entry_left?.set_text(filename)
|
152
|
+
@file_chooser_dialog.destroy
|
153
|
+
end
|
154
|
+
end
|
155
|
+
|
156
|
+
end; end; end; end
|
157
|
+
|
158
|
+
if __FILE__ == $PROGRAM_NAME
|
159
|
+
BackupParadise::GUI::Gtk::SimpleBackupWidget.run
|
160
|
+
end # backupwidget
|
@@ -0,0 +1,99 @@
|
|
1
|
+
#!/usr/bin/ruby -w
|
2
|
+
# Encoding: UTF-8
|
3
|
+
# frozen_string_literal: true
|
4
|
+
# =========================================================================== #
|
5
|
+
# === BackupParadise::GUI::LibUI::BackupForIngrid
|
6
|
+
# =========================================================================== #
|
7
|
+
# require 'backup_paradise/gui/libui/backup_for_ingrid/backup_for_ingrid.rb'
|
8
|
+
# BackupParadise::GUI::LibUI::BackupForIngrid.new
|
9
|
+
# =========================================================================== #
|
10
|
+
module BackupParadise
|
11
|
+
|
12
|
+
module GUI
|
13
|
+
|
14
|
+
module LibUI
|
15
|
+
|
16
|
+
class BackupForIngrid # === BackupParadise::GUI::LibUI::BackupForIngrid
|
17
|
+
|
18
|
+
require 'libui_paradise'
|
19
|
+
include LibuiParadise::Extensions
|
20
|
+
|
21
|
+
require 'backup_paradise/gui/shared_code/simple_backup_widget/simple_backup_widget_module.rb'
|
22
|
+
include BackupParadise::GUI::SimpleBackupWidgetModule
|
23
|
+
|
24
|
+
alias e puts
|
25
|
+
|
26
|
+
# ========================================================================= #
|
27
|
+
# === TITLE
|
28
|
+
# ========================================================================= #
|
29
|
+
TITLE = 'Backup Widget'
|
30
|
+
|
31
|
+
# ========================================================================= #
|
32
|
+
# === WIDTH
|
33
|
+
# ========================================================================= #
|
34
|
+
WIDTH = '25% or minimum 380px'
|
35
|
+
|
36
|
+
# ========================================================================= #
|
37
|
+
# === HEIGHT
|
38
|
+
# ========================================================================= #
|
39
|
+
HEIGHT = 100
|
40
|
+
|
41
|
+
# ========================================================================= #
|
42
|
+
# === initialize
|
43
|
+
# ========================================================================= #
|
44
|
+
def initialize(
|
45
|
+
run_already = true
|
46
|
+
)
|
47
|
+
reset
|
48
|
+
run if run_already
|
49
|
+
end
|
50
|
+
|
51
|
+
# ========================================================================= #
|
52
|
+
# === reset (reset tag)
|
53
|
+
# ========================================================================= #
|
54
|
+
def reset
|
55
|
+
set_title(TITLE)
|
56
|
+
set_width(WIDTH)
|
57
|
+
set_height(HEIGHT)
|
58
|
+
end
|
59
|
+
|
60
|
+
# ========================================================================= #
|
61
|
+
# === run
|
62
|
+
# ========================================================================= #
|
63
|
+
def run
|
64
|
+
window = ui_padded_main_window(title?, width?, height?, 0)
|
65
|
+
outer_vbox = padded_vbox
|
66
|
+
# ======================================================================= #
|
67
|
+
# First add the two buttons on top:
|
68
|
+
# ======================================================================= #
|
69
|
+
hbox_on_top = padded_hbox
|
70
|
+
button_backup_for_ingrid = button(
|
71
|
+
"Backup c:\\ingrid\\"
|
72
|
+
)
|
73
|
+
button_backup_for_ingrid.on_clicked {
|
74
|
+
backup_ingrid_directory
|
75
|
+
popup_message(window, 'Backup finished!')
|
76
|
+
}
|
77
|
+
button_quit = quit_button
|
78
|
+
# ======================================================================= #
|
79
|
+
# Add the backup-button next:
|
80
|
+
# ======================================================================= #
|
81
|
+
hbox_on_top.maximal(button_backup_for_ingrid)
|
82
|
+
outer_vbox.add_hsep
|
83
|
+
hbox_on_top.maximal(button_quit)
|
84
|
+
outer_vbox.add_hsep
|
85
|
+
outer_vbox.add(
|
86
|
+
LibuiParadise.draw_rectangle(width?, 50, :steelblue)
|
87
|
+
)
|
88
|
+
outer_vbox.add_hsep
|
89
|
+
outer_vbox.maximal(hbox_on_top)
|
90
|
+
outer_vbox.add_hsep
|
91
|
+
window.add(outer_vbox)
|
92
|
+
window.intelligent_exit
|
93
|
+
end
|
94
|
+
|
95
|
+
end; end; end; end
|
96
|
+
|
97
|
+
if __FILE__ == $PROGRAM_NAME
|
98
|
+
BackupParadise::GUI::LibUI::BackupForIngrid.new
|
99
|
+
end
|
@@ -0,0 +1,119 @@
|
|
1
|
+
#!/usr/bin/ruby -w
|
2
|
+
# Encoding: UTF-8
|
3
|
+
# frozen_string_literal: true
|
4
|
+
# =========================================================================== #
|
5
|
+
# === BackupParadise::GUI::LibUI::SimpleBackupWidget
|
6
|
+
# =========================================================================== #
|
7
|
+
module BackupParadise
|
8
|
+
|
9
|
+
module GUI
|
10
|
+
|
11
|
+
module LibUI
|
12
|
+
|
13
|
+
class SimpleBackupWidget # === BackupParadise::GUI::LibUI::SimpleBackupWidget
|
14
|
+
|
15
|
+
require 'libui_paradise'
|
16
|
+
include LibuiParadise::Extensions
|
17
|
+
|
18
|
+
require 'backup_paradise/gui/shared_code/simple_backup_widget/simple_backup_widget_module.rb'
|
19
|
+
include BackupParadise::GUI::SimpleBackupWidgetModule
|
20
|
+
|
21
|
+
# ========================================================================= #
|
22
|
+
# === initialize
|
23
|
+
# ========================================================================= #
|
24
|
+
def initialize(
|
25
|
+
run_already = true
|
26
|
+
)
|
27
|
+
reset
|
28
|
+
run if run_already
|
29
|
+
end
|
30
|
+
|
31
|
+
# ========================================================================= #
|
32
|
+
# === reset (reset tag)
|
33
|
+
# ========================================================================= #
|
34
|
+
def reset
|
35
|
+
reset_shared_module
|
36
|
+
end
|
37
|
+
|
38
|
+
# ========================================================================= #
|
39
|
+
# === create_the_grid (grid tag)
|
40
|
+
# ========================================================================= #
|
41
|
+
def create_the_grid
|
42
|
+
# ======================================================================= #
|
43
|
+
# === @grid
|
44
|
+
# ======================================================================= #
|
45
|
+
@grid = default_grid
|
46
|
+
label_backup_from = text('Backup from:')
|
47
|
+
label_backup_from.make_bold
|
48
|
+
label_backup_from.hint = 'Input which directory '\
|
49
|
+
'you wish to back up. Use the combo-box entry '\
|
50
|
+
'below this widget, or the entry below '\
|
51
|
+
'that combo-box.'
|
52
|
+
# left, top, xspan, yspan, hexpand, halign, vexpand, valign
|
53
|
+
# 0, 0, 2, 1, 0, 0, 1, 0
|
54
|
+
@grid.grid_append(label_backup_from, 0, 0, 1, 1, 0, 0.5, 1, 0)
|
55
|
+
|
56
|
+
label_backup_onto = text('Backup onto:')
|
57
|
+
label_backup_onto.make_bold
|
58
|
+
label_backup_onto.hint = 'Input the target device onto which we will '\
|
59
|
+
'copy the data onto.'
|
60
|
+
@grid.grid_append(label_backup_onto, 1, 0, 1, 1, 0, 0.5, 1, 0)
|
61
|
+
|
62
|
+
# ======================================================================= #
|
63
|
+
# Next we will add the two main combo-boxes.
|
64
|
+
# ======================================================================= #
|
65
|
+
@grid.grid_append(@combo_box_backup_from, 0, 1, 1, 1, 0, 0.5, 1, 0)
|
66
|
+
@grid.grid_append(@combo_box_backup_onto, 1, 1, 1, 1, 0, 0.5, 1, 0)
|
67
|
+
|
68
|
+
@grid.grid_append(@entry1_for_the_backup_from_value, 0, 2, 1, 1, 0, 0.5, 1, 0)
|
69
|
+
@grid.grid_append(@entry2_for_the_backup_onto_value, 1, 2, 1, 1, 0, 0.5, 1, 0)
|
70
|
+
end
|
71
|
+
|
72
|
+
# ========================================================================= #
|
73
|
+
# === connect_skeleton
|
74
|
+
# ========================================================================= #
|
75
|
+
def connect_skeleton
|
76
|
+
window = ui_padded_main_window(
|
77
|
+
title?,
|
78
|
+
width?,
|
79
|
+
height?,
|
80
|
+
0
|
81
|
+
)
|
82
|
+
outer_vbox = padded_vbox
|
83
|
+
button_quit = quit_button
|
84
|
+
hbox = padded_hbox
|
85
|
+
hbox.minimal(choose_file_button?)
|
86
|
+
hbox.minimal(backup_audio_button?)
|
87
|
+
hbox.minimal(text(title?))
|
88
|
+
outer_vbox.minimal(hbox)
|
89
|
+
outer_vbox.minimal(@grid)
|
90
|
+
|
91
|
+
outer_vbox.minimal(backup_button?)
|
92
|
+
outer_vbox.minimal(backup_ingrid_button?) if is_on_roebe?
|
93
|
+
outer_vbox.minimal(button_quit)
|
94
|
+
|
95
|
+
outer_vbox.minimal(horizontal_separator)
|
96
|
+
outer_vbox.minimal(@label_showing_results)
|
97
|
+
outer_vbox.minimal(horizontal_separator)
|
98
|
+
|
99
|
+
window.add(outer_vbox)
|
100
|
+
sync_the_combo_box_values_onto_the_entries_below
|
101
|
+
window.intelligent_exit
|
102
|
+
end
|
103
|
+
|
104
|
+
# ========================================================================= #
|
105
|
+
# === create_skeleton
|
106
|
+
# ========================================================================= #
|
107
|
+
def create_skeleton
|
108
|
+
create_the_entries # Put this early on.
|
109
|
+
create_the_combo_boxes
|
110
|
+
create_the_buttons
|
111
|
+
create_the_label_showing_results
|
112
|
+
create_the_grid
|
113
|
+
end
|
114
|
+
|
115
|
+
end; end; end; end
|
116
|
+
|
117
|
+
if __FILE__ == $PROGRAM_NAME
|
118
|
+
BackupParadise::GUI::LibUI::SimpleBackupWidget.new
|
119
|
+
end
|