visualruby 3.0.6 → 3.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.vr_settings.yaml +7 -2
- data/bin/main/ProjectTree.rb +1 -1
- data/bin/main/VR_ENV_GLOBAL.rb +0 -16
- data/bin/main/glade/VR_ENV_GLOBAL.glade +0 -13
- data/bin/tools/VR_Tools.rb +2 -1
- data/examples/filetreeview/.vr_settings.yaml +4 -4
- data/examples/filetreeview/bin/ProjectTree.rb +29 -2
- data/examples/filetreeview/bin/glade/ProjectTreeGUI.glade +8 -4
- data/examples/filetreeview/img/folder.png +0 -0
- data/examples/filetreeview/img/glade.png +0 -0
- data/examples/filetreeview/img/gtk-edit.png +0 -0
- data/examples/filetreeview/img/png.png +0 -0
- data/examples/filetreeview/img/rb.png +0 -0
- data/examples/filetreeview/img/unknown.png +0 -0
- data/vrlib/lib/treeview/FileTreeView.rb +2 -2
- metadata +7 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d0443266e80ba38d5d4306551773250b1d022c92
|
4
|
+
data.tar.gz: f42b42ad7a29ca0a5dde7b15d58e2e65d3e2ca83
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7c43c8e1f36352949b7f5d6d014b8be08420266d2922a9fabc18700f5b27571a405832192cb6d1ab4aedac3ebc360de66eaa0c17394401344fcb04fc8508723d
|
7
|
+
data.tar.gz: 7274f357de6a1d4b8c606c9218d70fb8354195bb5386e63860a305715c129fec8c00e1ff900f5ae65a7e70f6c5d3d4d894e276ef6ed4f5a9dcfe0187b69ebc65
|
data/.vr_settings.yaml
CHANGED
@@ -10,14 +10,19 @@ open_files:
|
|
10
10
|
- "/home/eric/vrp/vr3/examples/active_record/active_record.rb"
|
11
11
|
- "/home/eric/vrp/vr3/vr.gemspec"
|
12
12
|
- "/home/eric/vrp/vr3/bin/main/VR_ENV_GLOBAL.rb"
|
13
|
+
- "/home/eric/vrp/vr3/bin/tools/VR_Tools.rb"
|
14
|
+
- "/home/eric/vrp/vr3/vrlib/lib/treeview/FileTreeView.rb"
|
15
|
+
- "/home/eric/vrp/vr3/bin/main/ProjectTree.rb"
|
13
16
|
open_folders:
|
14
17
|
- "/home/eric/vrp/vr3"
|
15
18
|
- "/home/eric/vrp/vr3/bin"
|
16
19
|
- "/home/eric/vrp/vr3/bin/main"
|
20
|
+
- "/home/eric/vrp/vr3/bin/tools"
|
17
21
|
- "/home/eric/vrp/vr3/vrlib"
|
18
22
|
- "/home/eric/vrp/vr3/vrlib/lib"
|
19
|
-
|
20
|
-
|
23
|
+
- "/home/eric/vrp/vr3/vrlib/lib/treeview"
|
24
|
+
current_file: "/home/eric/vrp/vr3/bin/main/ProjectTree.rb"
|
25
|
+
current_line: 12
|
21
26
|
rdoc_command_line: rdoc -x README -x /*.glade -x /*.yaml -x /*.gemspec -x /*.css
|
22
27
|
builder: !ruby/object:Gtk::Builder {}
|
23
28
|
top_level_window: false
|
data/bin/main/ProjectTree.rb
CHANGED
@@ -9,7 +9,7 @@ class ProjectTree < VR::FileTreeView #(change name)
|
|
9
9
|
path = $VR_ENV_GLOBAL.projects_home
|
10
10
|
icon_path = File.expand_path(File.join(File.path(__FILE__), "..", "..", "..", "img"))
|
11
11
|
super(path, icon_path)
|
12
|
-
@
|
12
|
+
@validation_block = proc { |folder| has_settings_file?(folder) }
|
13
13
|
open_folders($VR_ENV_GLOBAL.projects_home_open_folders)
|
14
14
|
end
|
15
15
|
|
data/bin/main/VR_ENV_GLOBAL.rb
CHANGED
@@ -46,22 +46,6 @@ class VR_ENV_GLOBAL
|
|
46
46
|
return true
|
47
47
|
end
|
48
48
|
|
49
|
-
def buttonFindGlade__clicked(*a)
|
50
|
-
alert "This will search for <b>glade.exe</b> in your home folder. It is only useful for MS Windows systems.", :parent => self
|
51
|
-
ar = Dir.glob(File.join(Dir.home, "**", "glade.exe"))
|
52
|
-
if ar.empty?
|
53
|
-
alert "glade.exe not found", parent: self
|
54
|
-
else
|
55
|
-
str = ""
|
56
|
-
ar.each { |file| str = str + file + "\n" }
|
57
|
-
if alert("Found files:\n\n" + str + "\n\nEither enter full filename or add to your PATH to make it work.",
|
58
|
-
:parent => self,
|
59
|
-
:button_yes => "Use First")
|
60
|
-
@builder[:glade_path].text = ar[0]
|
61
|
-
end
|
62
|
-
end
|
63
|
-
end
|
64
|
-
|
65
49
|
def buttonCancel__clicked(*args)
|
66
50
|
@builder["window1"].destroy
|
67
51
|
end
|
@@ -98,19 +98,6 @@
|
|
98
98
|
<property name="position">1</property>
|
99
99
|
</packing>
|
100
100
|
</child>
|
101
|
-
<child>
|
102
|
-
<object class="GtkButton" id="buttonFindGlade">
|
103
|
-
<property name="label" translatable="yes">Find</property>
|
104
|
-
<property name="visible">True</property>
|
105
|
-
<property name="can_focus">True</property>
|
106
|
-
<property name="receives_default">True</property>
|
107
|
-
</object>
|
108
|
-
<packing>
|
109
|
-
<property name="expand">False</property>
|
110
|
-
<property name="fill">True</property>
|
111
|
-
<property name="position">2</property>
|
112
|
-
</packing>
|
113
|
-
</child>
|
114
101
|
</object>
|
115
102
|
<packing>
|
116
103
|
<property name="left_attach">1</property>
|
data/bin/tools/VR_Tools.rb
CHANGED
@@ -10,7 +10,8 @@ module VR_Tools
|
|
10
10
|
begin
|
11
11
|
IO.popen(cmd)
|
12
12
|
rescue
|
13
|
-
alert("The following command couldn't run:\n\n<b>#{cmd}</b>\n\nCheck the path in Tools > Settings"
|
13
|
+
alert("The following command couldn't run:\n\n<b>#{cmd}</b>\n\nCheck the path in Tools > Settings." +
|
14
|
+
"\n\nIn MS Windows you may need to add the 'start' command i.e. <b>'start glade'</b>")
|
14
15
|
end
|
15
16
|
end
|
16
17
|
|
@@ -1,7 +1,9 @@
|
|
1
1
|
--- !ruby/object:VR_ENV
|
2
|
+
vr_yaml_file: ".vr_settings.yaml"
|
2
3
|
width: 1337
|
3
4
|
height: 691
|
4
5
|
panel_pos: 490
|
6
|
+
notebook_panel_position: 400
|
5
7
|
run_command_line: ruby main.rb
|
6
8
|
open_files:
|
7
9
|
- "/home/eric/vrp/vr3/examples/filetreeview/main.rb"
|
@@ -10,11 +12,9 @@ open_files:
|
|
10
12
|
open_folders:
|
11
13
|
- "/home/eric/vrp/vr3/examples/filetreeview"
|
12
14
|
- "/home/eric/vrp/vr3/examples/filetreeview/bin"
|
13
|
-
- "/home/eric/vrp/vr3/examples/filetreeview/
|
15
|
+
- "/home/eric/vrp/vr3/examples/filetreeview/img"
|
14
16
|
current_file: "/home/eric/vrp/vr3/examples/filetreeview/bin/ProjectTree.rb"
|
17
|
+
current_line: 12
|
15
18
|
rdoc_command_line: rdoc -x README
|
16
|
-
vr_yaml_file: ".vr_settings.yaml"
|
17
|
-
notebook_panel_position: 400
|
18
|
-
current_line: 11
|
19
19
|
settings_file_version: 1
|
20
20
|
filename: ".vr_settings.yaml"
|
@@ -1,3 +1,16 @@
|
|
1
|
+
# This demonstrates the VR::FileTreeView class. You can configure it using a glob and a
|
2
|
+
# validation block. It will only include the files and folders designated in the glob
|
3
|
+
# and that have the vaildation block return true.
|
4
|
+
#
|
5
|
+
# It does this:
|
6
|
+
#
|
7
|
+
# files = Dir.glob(folder_path, glob)
|
8
|
+
# files = files.select &@validation_block
|
9
|
+
#
|
10
|
+
# It takes the root of the file tree as the first argument, and a path to the icon files
|
11
|
+
# to display next to the files and folders. THe icons are named according to the extension.
|
12
|
+
# For example, 'rb.png' will display next to files with a '.rb' extension.
|
13
|
+
|
1
14
|
|
2
15
|
class ProjectTree < VR::FileTreeView #(change name)
|
3
16
|
|
@@ -6,8 +19,11 @@ class ProjectTree < VR::FileTreeView #(change name)
|
|
6
19
|
include GladeGUI
|
7
20
|
|
8
21
|
def initialize()
|
9
|
-
|
10
|
-
|
22
|
+
root_path = File.join(ENV["HOME"], "visualruby")
|
23
|
+
icon_path = File.join(File.dirname(__FILE__), "/../img")
|
24
|
+
glob = "*"
|
25
|
+
super(root_path, icon_path, glob)
|
26
|
+
@validation_block = proc { |folder| has_settings_file?(folder) }
|
11
27
|
end
|
12
28
|
|
13
29
|
def self__row_activated(_self, path, col)
|
@@ -19,4 +35,15 @@ class ProjectTree < VR::FileTreeView #(change name)
|
|
19
35
|
end
|
20
36
|
end
|
21
37
|
|
38
|
+
|
39
|
+
def has_settings_file?(path)
|
40
|
+
Find.find(path) do |file|
|
41
|
+
if File.basename(file) == ".vr_settings.yaml"
|
42
|
+
return true
|
43
|
+
end
|
44
|
+
end
|
45
|
+
return false
|
46
|
+
end
|
47
|
+
|
48
|
+
|
22
49
|
end
|
@@ -1,5 +1,5 @@
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
-
<!-- Generated with glade 3.
|
2
|
+
<!-- Generated with glade 3.16.1 -->
|
3
3
|
<interface>
|
4
4
|
<requires lib="gtk+" version="3.0"/>
|
5
5
|
<object class="GtkWindow" id="window1">
|
@@ -8,8 +8,8 @@
|
|
8
8
|
<property name="title" translatable="yes">FileTreeView Demo</property>
|
9
9
|
<property name="modal">True</property>
|
10
10
|
<property name="window_position">center</property>
|
11
|
-
<property name="default_width">
|
12
|
-
<property name="default_height">
|
11
|
+
<property name="default_width">460</property>
|
12
|
+
<property name="default_height">700</property>
|
13
13
|
<child>
|
14
14
|
<object class="GtkBox" id="box1">
|
15
15
|
<property name="visible">True</property>
|
@@ -48,7 +48,11 @@
|
|
48
48
|
<object class="GtkLabel" id="label3">
|
49
49
|
<property name="visible">True</property>
|
50
50
|
<property name="can_focus">False</property>
|
51
|
-
<property name="
|
51
|
+
<property name="margin_left">10</property>
|
52
|
+
<property name="margin_right">10</property>
|
53
|
+
<property name="margin_top">10</property>
|
54
|
+
<property name="margin_bottom">10</property>
|
55
|
+
<property name="label" translatable="yes">This filetreeview shows only the folders that contain the hidden file, .vr_settings. This is how a visualruby project is identified. You will only be able to select valid visualruby project folders. </property>
|
52
56
|
<property name="wrap">True</property>
|
53
57
|
</object>
|
54
58
|
</child>
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
@@ -5,7 +5,7 @@ module VR
|
|
5
5
|
|
6
6
|
include GladeGUI
|
7
7
|
|
8
|
-
attr_accessor :root, :glob, :
|
8
|
+
attr_accessor :root, :glob, :validation_block
|
9
9
|
|
10
10
|
def initialize(root = Dir.pwd, icon_path = nil, glob = "*")
|
11
11
|
@root = root
|
@@ -36,7 +36,7 @@ module VR
|
|
36
36
|
def fill_folder(parent_iter)
|
37
37
|
model.remove(parent_iter.first_child) #remove dummy record
|
38
38
|
files = Dir.glob(File.join(parent_iter[id(:path)],@glob))
|
39
|
-
files = files.select &@
|
39
|
+
files = files.select &@validation_block if @validation_block
|
40
40
|
files.each do |fn|
|
41
41
|
add_file(fn, parent_iter)
|
42
42
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: visualruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.0.
|
4
|
+
version: 3.0.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Eric Cunningham
|
@@ -136,6 +136,12 @@ files:
|
|
136
136
|
- "./examples/filetreeview/bin/ProjectTree.rb"
|
137
137
|
- "./examples/filetreeview/bin/ProjectTreeGUI.rb"
|
138
138
|
- "./examples/filetreeview/bin/glade/ProjectTreeGUI.glade"
|
139
|
+
- "./examples/filetreeview/img/folder.png"
|
140
|
+
- "./examples/filetreeview/img/glade.png"
|
141
|
+
- "./examples/filetreeview/img/gtk-edit.png"
|
142
|
+
- "./examples/filetreeview/img/png.png"
|
143
|
+
- "./examples/filetreeview/img/rb.png"
|
144
|
+
- "./examples/filetreeview/img/unknown.png"
|
139
145
|
- "./examples/filetreeview/main.rb"
|
140
146
|
- "./examples/listview/.vr_settings.yaml"
|
141
147
|
- "./examples/listview/bin/SongListView.rb"
|