y_support 2.0.16 → 2.0.17
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/y_support/kde.rb +0 -47
- data/lib/y_support/version.rb +1 -1
- data/lib/y_support/x.rb +47 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 10a3213c28c3bf0979906e9cb5ab9f68ee4eafbf
|
4
|
+
data.tar.gz: 63c23e808be62cd1490384e7a3cf6e7939400dbe
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d321fb398e16a46bf622fb2f1a2db07c4b5a1da735c1a5c9fb72e86373619568662e5dc9e4327bf9350e7eb15471f6dca4c56549f30a519582331a1e95e9942e
|
7
|
+
data.tar.gz: bef7becb10032eba4142e1dcdd7b4c2dfa4d7bcc1f54fa0361f1306100985dc2fc959fcd4f4a4ac003a6dbbdbee2b490e4839c858894ecd16121a8ddb524affc
|
data/lib/y_support/kde.rb
CHANGED
@@ -8,52 +8,5 @@ module YSupport::KDE
|
|
8
8
|
def show_file_with_kioclient( fɴ_with_path )
|
9
9
|
system "sleep 0.2; kioclient exec 'file:%s'" % fɴ_with_path
|
10
10
|
end
|
11
|
-
|
12
|
-
# Dialog box querying for a string.
|
13
|
-
#
|
14
|
-
def query_box( dialog_text, prompt: '> ', title_bar: 'User input required', &block )
|
15
|
-
title_bar_text = title_bar
|
16
|
-
prompt_label_text = prompt
|
17
|
-
|
18
|
-
w = Gtk::Window.new( Gtk::Window::TOPLEVEL )
|
19
|
-
w.set_title( title_bar_text )
|
20
|
-
w.border_width = 10
|
21
|
-
w.signal_connect 'delete_event' do Gtk.main_quit end # cc
|
22
|
-
|
23
|
-
tlabel_widget = Gtk::Label.new( dialog_text )
|
24
|
-
plabel_widget = Gtk::Label.new( prompt_label_text )
|
25
|
-
ebox_widget = Gtk::Entry.new
|
26
|
-
ebox_widget.visibility = true # cc
|
27
|
-
|
28
|
-
hbox = Gtk::HBox.new(false, 5) # cc
|
29
|
-
hbox.pack_start_defaults( plabel_widget ) # cc
|
30
|
-
hbox.pack_start_defaults( ebox_widget )
|
31
|
-
vbox = Gtk::VBox.new(false, 5)
|
32
|
-
vbox.pack_start_defaults( tlabel_widget )
|
33
|
-
vbox.pack_start_defaults( hbox )
|
34
|
-
w.add(vbox)
|
35
|
-
|
36
|
-
ebox_widget.signal_connect("key-release-event") do |sender, event| # cc
|
37
|
-
kn = Gdk::Keyval.to_name(k = event.keyval)
|
38
|
-
if kn == "Return"
|
39
|
-
block.( sender.text )
|
40
|
-
Gtk.main_quit
|
41
|
-
end
|
42
|
-
end
|
43
|
-
|
44
|
-
w.show_all # cc
|
45
|
-
Gtk.main
|
46
|
-
end
|
47
|
-
|
48
|
-
# Message box.
|
49
|
-
#
|
50
|
-
def message_box( message="Press any key to close this window!" )
|
51
|
-
w = Gtk::Window.new
|
52
|
-
w.add_events Gdk::Event::KEY_PRESS
|
53
|
-
w.add Gtk::Label.new( message )
|
54
|
-
w.signal_connect "key-release-event" do Gtk.main_quit end
|
55
|
-
w.set_default_size( 600, 120 ).show_all
|
56
|
-
Gtk.main
|
57
|
-
end
|
58
11
|
end
|
59
12
|
end # module YSupport::KDE
|
data/lib/y_support/version.rb
CHANGED
data/lib/y_support/x.rb
CHANGED
@@ -13,5 +13,52 @@ module YSupport::X
|
|
13
13
|
def echo_secondary_clipboard( string )
|
14
14
|
system 'echo -n "' + string + '" | xsel -s -i'
|
15
15
|
end
|
16
|
+
|
17
|
+
# Dialog box querying for a string.
|
18
|
+
#
|
19
|
+
def query_box( dialog_text, prompt: '> ', title_bar: 'User input required', &block )
|
20
|
+
title_bar_text = title_bar
|
21
|
+
prompt_label_text = prompt
|
22
|
+
|
23
|
+
w = Gtk::Window.new( Gtk::Window::TOPLEVEL )
|
24
|
+
w.set_title( title_bar_text )
|
25
|
+
w.border_width = 10
|
26
|
+
w.signal_connect 'delete_event' do Gtk.main_quit end # cc
|
27
|
+
|
28
|
+
tlabel_widget = Gtk::Label.new( dialog_text )
|
29
|
+
plabel_widget = Gtk::Label.new( prompt_label_text )
|
30
|
+
ebox_widget = Gtk::Entry.new
|
31
|
+
ebox_widget.visibility = true # cc
|
32
|
+
|
33
|
+
hbox = Gtk::HBox.new(false, 5) # cc
|
34
|
+
hbox.pack_start_defaults( plabel_widget ) # cc
|
35
|
+
hbox.pack_start_defaults( ebox_widget )
|
36
|
+
vbox = Gtk::VBox.new(false, 5)
|
37
|
+
vbox.pack_start_defaults( tlabel_widget )
|
38
|
+
vbox.pack_start_defaults( hbox )
|
39
|
+
w.add(vbox)
|
40
|
+
|
41
|
+
ebox_widget.signal_connect("key-release-event") do |sender, event| # cc
|
42
|
+
kn = Gdk::Keyval.to_name(k = event.keyval)
|
43
|
+
if kn == "Return"
|
44
|
+
block.( sender.text )
|
45
|
+
Gtk.main_quit
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
49
|
+
w.show_all # cc
|
50
|
+
Gtk.main
|
51
|
+
end
|
52
|
+
|
53
|
+
# Message box.
|
54
|
+
#
|
55
|
+
def message_box( message="Press any key to close this window!" )
|
56
|
+
w = Gtk::Window.new
|
57
|
+
w.add_events Gdk::Event::KEY_PRESS
|
58
|
+
w.add Gtk::Label.new( message )
|
59
|
+
w.signal_connect "key-release-event" do Gtk.main_quit end
|
60
|
+
w.set_default_size( 600, 120 ).show_all
|
61
|
+
Gtk.main
|
62
|
+
end
|
16
63
|
end
|
17
64
|
end # module YSupport::X
|