visualruby 1.0.19 → 3.0.2
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/Splash.rb +40 -0
- data/bin/editor/VR_Document.rb +81 -74
- data/bin/editor/VR_TabSearch.rb +5 -7
- data/bin/editor/VR_Tabs.rb +57 -36
- data/bin/editor/VR_TextShell.rb +12 -34
- data/bin/editor/VR_TextViewCommon.rb +9 -28
- data/bin/main/NewProjectGUI.rb +14 -13
- data/bin/main/OpenProject.rb +69 -0
- data/bin/main/ProjectChooserView.rb +3 -2
- data/bin/main/ProjectTree.rb +25 -0
- data/bin/main/RubygemsAPI.rb +15 -11
- data/bin/main/VR_ENV.rb +38 -60
- data/bin/main/VR_ENV_GLOBAL.rb +45 -44
- data/bin/main/VR_File_Tree.rb +29 -21
- data/bin/main/VR_Local_Gem_Tree.rb +4 -19
- data/bin/main/VR_Main.rb +128 -144
- data/bin/main/VR_Remote_Gem_Tree.rb +6 -19
- data/bin/main/glade/NewProjectGUI.glade +94 -98
- data/bin/main/glade/OpenProject.glade +259 -0
- data/bin/main/glade/RubygemsAPI.glade +98 -62
- data/bin/main/glade/VR_ENV.glade +46 -55
- data/bin/main/glade/VR_ENV_GLOBAL.glade +251 -180
- data/bin/main/glade/VR_File_Tree.glade +25 -16
- data/bin/main/glade/VR_Local_Gem_Tree.glade +16 -8
- data/bin/main/glade/VR_Main.glade +410 -449
- data/bin/main/glade/VR_Remote_Gem_Tree.glade +33 -31
- data/bin/tools/VR_Tools.rb +60 -46
- data/{visualruby_examples → examples}/active_record/active_record.rb +16 -10
- data/{visualruby_examples → examples}/active_record/bin/ChoosePerson.rb +7 -0
- data/examples/active_record/bin/Person.rb +21 -0
- data/examples/active_record/bin/glade/ChoosePerson.glade +89 -0
- data/examples/active_record/bin/glade/Person.glade +197 -0
- data/{visualruby_examples → examples}/active_record/db/development.sqlite3 +0 -0
- data/{visualruby_examples → examples}/active_record2/bin/CompanyGUI.rb +7 -7
- data/{visualruby_examples → examples}/active_record2/bin/Employee.rb +0 -0
- data/{visualruby_examples → examples}/active_record2/bin/Employer.rb +0 -0
- data/{visualruby_examples → examples}/active_record2/bin/Paycheck.rb +0 -0
- data/examples/active_record2/bin/glade/CompanyGUI.glade +149 -0
- data/examples/active_record2/bin/glade/Employee.glade +126 -0
- data/{visualruby_examples → examples}/active_record2/bin/glade/Employer.glade +0 -0
- data/{visualruby_examples → examples}/active_record2/bin/glade/Paycheck.glade +0 -0
- data/{visualruby_examples → examples}/active_record2/db/development.sqlite3 +0 -0
- data/{visualruby_examples → examples}/active_record2/main.rb +15 -9
- data/examples/alert_box/bin/AlertBoxDemo.rb +80 -0
- data/examples/alert_box/bin/glade/AlertBoxDemo.glade +234 -0
- data/examples/alert_box/main.rb +12 -0
- data/{visualruby_examples → examples}/all_widgets/bin/AllWidgets.rb +18 -10
- data/{visualruby_examples → examples}/all_widgets/bin/glade/AllWidgets.glade +52 -16
- data/{visualruby_examples → examples}/all_widgets/bin/splash.png +0 -0
- data/examples/all_widgets/main.rb +12 -0
- data/{visualruby_examples → examples}/calculator/bin/Calculator.rb +23 -22
- data/{visualruby_examples → examples}/calculator/bin/glade/Calculator.glade +81 -51
- data/examples/calculator/main.rb +13 -0
- data/examples/child_window/bin/ChildWindowDemo.rb +52 -0
- data/examples/child_window/bin/ModalWindow.rb +9 -0
- data/examples/child_window/bin/ModelessWindow.rb +9 -0
- data/examples/child_window/bin/MyChildClass.rb +21 -0
- data/examples/child_window/bin/glade/ChildWindowDemo.glade +87 -0
- data/examples/child_window/bin/glade/ModalWindow.glade +61 -0
- data/examples/child_window/bin/glade/ModelessWindow.glade +61 -0
- data/{visualruby_examples → examples}/child_window/bin/glade/MyChildClass.glade +14 -12
- data/examples/child_window/main.rb +12 -0
- data/{visualruby_examples → examples}/drag_drop/bin/DragDropDemo.rb +9 -10
- data/examples/drag_drop/bin/glade/DragDropDemo.glade +161 -0
- data/{visualruby_examples → examples}/drag_drop/img/folder.png +0 -0
- data/{visualruby_examples → examples}/drag_drop/img/glade.png +0 -0
- data/{visualruby_examples → examples}/drag_drop/img/gtk-edit.png +0 -0
- data/{visualruby_examples → examples}/drag_drop/img/obj.png +0 -0
- data/{visualruby_examples → examples}/drag_drop/img/png.png +0 -0
- data/{visualruby_examples → examples}/drag_drop/img/rb.png +0 -0
- data/{visualruby_examples → examples}/drag_drop/img/ruby.png +0 -0
- data/{visualruby_examples → examples}/drag_drop/img/unknown.png +0 -0
- data/examples/drag_drop/main.rb +11 -0
- data/examples/filetreeview/bin/ProjectTree.rb +32 -0
- data/examples/filetreeview/bin/ProjectTreeGUI.rb +28 -0
- data/examples/filetreeview/bin/glade/ProjectTreeGUI.glade +156 -0
- data/examples/filetreeview/main.rb +13 -0
- data/{visualruby_examples → examples}/listview/bin/SongListView.rb +24 -20
- data/{visualruby_examples → examples}/listview/bin/SongListViewGUI.rb +12 -11
- data/{visualruby_examples → examples}/listview/bin/audio-x-generic.png +0 -0
- data/examples/listview/bin/glade/SongListViewGUI.glade +195 -0
- data/examples/listview/main.rb +10 -0
- data/examples/listview_objects/bin/DataObject.rb +53 -0
- data/{visualruby_examples → examples}/listview_objects/bin/ListViewObjects.rb +7 -4
- data/examples/listview_objects/bin/ListViewObjectsGUI.rb +26 -0
- data/examples/listview_objects/bin/glade/DataObject.glade +196 -0
- data/examples/listview_objects/bin/glade/ListViewObjectsGUI.glade +87 -0
- data/examples/listview_objects/main.rb +12 -0
- data/examples/settings_file/bin/MainApp.rb +38 -0
- data/examples/settings_file/bin/SavableSettings.rb +39 -0
- data/examples/settings_file/bin/glade/MainApp.glade +87 -0
- data/examples/settings_file/bin/glade/SavableSettings.glade +162 -0
- data/examples/settings_file/main.rb +14 -0
- data/examples/settings_file/settings.yaml +15 -0
- data/examples/simple_ruby_gui/bin/DataObjectGUI.rb +21 -0
- data/examples/simple_ruby_gui/bin/glade/DataObjectGUI.glade +195 -0
- data/examples/simple_ruby_gui/main.rb +16 -0
- data/{visualruby_examples → examples}/treeview/bin/MyClass.rb +1 -5
- data/examples/treeview/bin/glade/MyClass.glade +24 -0
- data/examples/treeview/main.rb +13 -0
- data/skeleton/document/New.glade +3 -4
- data/skeleton/document/NewWindow.rb +1 -1
- data/skeleton/project/bin/MyClass.rb +2 -2
- data/skeleton/project/bin/glade/MyClass.glade +12 -26
- data/skeleton/project/main.rb +4 -8
- data/vr +41 -37
- data/vrlib/lib/Alert.rb +67 -0
- data/vrlib/lib/DragDrop.rb +90 -0
- data/vrlib/lib/GladeGUI.rb +433 -0
- data/vrlib/lib/IconHash.rb +18 -0
- data/vrlib/lib/SavableClass.rb +56 -0
- data/vrlib/lib/SimpleComboBoxEntry.rb +8 -0
- data/vrlib/lib/glade/Alert.glade +119 -0
- data/vrlib/lib/treeview/FileTreeView.rb +113 -0
- data/vrlib/lib/treeview/IterMethods.rb +82 -0
- data/vrlib/lib/treeview/ListView.rb +85 -0
- data/vrlib/lib/treeview/TreeView.rb +43 -0
- data/vrlib/lib/treeview/ViewCommon.rb +370 -0
- data/vrlib/lib/treeview/columns/CalendarCol.rb +89 -0
- data/vrlib/lib/treeview/columns/CellRendererCombo.rb +66 -0
- data/vrlib/lib/treeview/columns/CellRendererDate.rb +45 -0
- data/vrlib/lib/treeview/columns/CellRendererObject.rb +57 -0
- data/vrlib/lib/treeview/columns/CellRendererPhone.rb +45 -0
- data/vrlib/lib/treeview/columns/CellRendererPixbuf.rb +16 -0
- data/vrlib/lib/treeview/columns/CellRendererProgress.rb +17 -0
- data/vrlib/lib/treeview/columns/CellRendererSpin.rb +37 -0
- data/vrlib/lib/treeview/columns/CellRendererText.rb +38 -0
- data/vrlib/lib/treeview/columns/CellRendererToggle.rb +47 -0
- data/vrlib/lib/treeview/columns/ComboCol.rb +43 -0
- data/vrlib/lib/treeview/columns/CurrencyCol.rb +23 -0
- data/vrlib/lib/treeview/columns/DateCol.rb +20 -0
- data/vrlib/lib/treeview/columns/ImageCol.rb +27 -0
- data/vrlib/lib/treeview/columns/ProgressCol.rb +27 -0
- data/vrlib/lib/treeview/columns/SpinCol.rb +11 -0
- data/vrlib/lib/treeview/columns/TextCol.rb +65 -0
- data/vrlib/lib/treeview/columns/TreeViewColumn.rb +93 -0
- data/{bin/main/glade/ProjectChooserGUI.glade → vrlib/lib/treeview/columns/glade/CalendarCol.glade} +71 -63
- data/{bin/main/glade/Splash.glade → vrlib/lib/treeview/columns/glade/ImageCol.glade} +5 -6
- data/vrlib/lib/treeview/columns/glade/TextCol.glade +82 -0
- data/vrlib/rdoc_replace.yaml +77 -0
- data/vrlib/vrlib.rb +7 -0
- metadata +163 -136
- data/bin/editor/glade/VR_Document.glade +0 -160
- data/bin/main/ProjectChooserGUI.rb +0 -41
- data/bin/main/Splash.rb +0 -22
- data/visualruby_examples/active_record/.vr_settings.yaml +0 -47
- data/visualruby_examples/active_record/bin/Person.rb +0 -13
- data/visualruby_examples/active_record/bin/glade/ChoosePerson.glade +0 -61
- data/visualruby_examples/active_record/bin/glade/Person.glade +0 -148
- data/visualruby_examples/active_record2/.vr_settings.yaml +0 -16
- data/visualruby_examples/active_record2/bin/glade/CompanyGUI.glade +0 -167
- data/visualruby_examples/active_record2/bin/glade/Employee.glade +0 -123
- data/visualruby_examples/all_widgets/.vr_settings.yaml +0 -13
- data/visualruby_examples/all_widgets/main.rb +0 -14
- data/visualruby_examples/calculator/.vr_settings.yaml +0 -11
- data/visualruby_examples/calculator/main.rb +0 -13
- data/visualruby_examples/child_window/.vr_settings.yaml +0 -16
- data/visualruby_examples/child_window/bin/ChildWindowDemo.rb +0 -39
- data/visualruby_examples/child_window/bin/MyChildClass.rb +0 -40
- data/visualruby_examples/child_window/bin/glade/ChildWindowDemo.glade +0 -101
- data/visualruby_examples/child_window/main.rb +0 -13
- data/visualruby_examples/drag_drop/.vr_settings.yaml +0 -12
- data/visualruby_examples/drag_drop/bin/glade/DragDropDemo.glade +0 -143
- data/visualruby_examples/drag_drop/main.rb +0 -14
- data/visualruby_examples/listview/.vr_settings.yaml +0 -12
- data/visualruby_examples/listview/bin/glade/SongListViewGUI.glade +0 -220
- data/visualruby_examples/listview/main.rb +0 -19
- data/visualruby_examples/listview_objects/.vr_settings.yaml +0 -16
- data/visualruby_examples/listview_objects/bin/DataObject.rb +0 -32
- data/visualruby_examples/listview_objects/bin/DataObjectGUI.rb +0 -41
- data/visualruby_examples/listview_objects/bin/ListViewObjectsGUI.rb +0 -18
- data/visualruby_examples/listview_objects/bin/glade/DataObject.glade +0 -198
- data/visualruby_examples/listview_objects/bin/glade/ListViewObjectsGUI.glade +0 -102
- data/visualruby_examples/listview_objects/main.rb +0 -13
- data/visualruby_examples/simple_ruby_gui/.vr_settings.yaml +0 -16
- data/visualruby_examples/simple_ruby_gui/bin/DataObjectGUI.rb +0 -20
- data/visualruby_examples/simple_ruby_gui/bin/glade/DataObjectGUI.glade +0 -163
- data/visualruby_examples/simple_ruby_gui/main.rb +0 -16
- data/visualruby_examples/treeview/.vr_settings.yaml +0 -12
- data/visualruby_examples/treeview/bin/glade/MyClass.glade +0 -48
- data/visualruby_examples/treeview/main.rb +0 -14
|
@@ -1,75 +1,77 @@
|
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<!-- Generated with glade 3.16.1 -->
|
|
2
3
|
<interface>
|
|
3
|
-
<requires lib="gtk+" version="
|
|
4
|
-
<!-- interface-naming-policy project-wide -->
|
|
4
|
+
<requires lib="gtk+" version="3.10"/>
|
|
5
5
|
<object class="GtkMenu" id="popGem">
|
|
6
6
|
<property name="visible">True</property>
|
|
7
|
+
<property name="can_focus">False</property>
|
|
7
8
|
<child>
|
|
8
9
|
<object class="GtkMenuItem" id="popOpenRubygemsPage">
|
|
10
|
+
<property name="use_action_appearance">False</property>
|
|
9
11
|
<property name="visible">True</property>
|
|
12
|
+
<property name="can_focus">False</property>
|
|
10
13
|
<property name="tooltip_text" translatable="yes">Open this gem's page on rubygems.org</property>
|
|
11
14
|
<property name="label" translatable="yes">Open rubygems Project Page</property>
|
|
12
15
|
<property name="use_underline">True</property>
|
|
13
|
-
<signal name="activate" handler="popOpenRubygemsPage_clicked"/>
|
|
14
16
|
</object>
|
|
15
17
|
</child>
|
|
16
18
|
<child>
|
|
17
19
|
<object class="GtkMenuItem" id="popOpenHomepage">
|
|
20
|
+
<property name="use_action_appearance">False</property>
|
|
18
21
|
<property name="visible">True</property>
|
|
22
|
+
<property name="can_focus">False</property>
|
|
19
23
|
<property name="tooltip_text" translatable="yes">Open gem's homepage in the default web browser.</property>
|
|
20
24
|
<property name="label" translatable="yes">Open Homepage</property>
|
|
21
25
|
<property name="use_underline">True</property>
|
|
22
|
-
<signal name="activate" handler="popOpenHomepage_clicked"/>
|
|
23
26
|
</object>
|
|
24
27
|
</child>
|
|
25
28
|
<child>
|
|
26
29
|
<object class="GtkMenuItem" id="popYank">
|
|
30
|
+
<property name="use_action_appearance">False</property>
|
|
27
31
|
<property name="visible">True</property>
|
|
32
|
+
<property name="can_focus">False</property>
|
|
28
33
|
<property name="tooltip_text" translatable="yes">Removes the gem from rubygems.org so nobody can download it.</property>
|
|
29
34
|
<property name="label" translatable="yes">Yank Gem From rubygems.org</property>
|
|
30
35
|
<property name="use_underline">True</property>
|
|
31
|
-
<signal name="activate" handler="popYank_clicked"/>
|
|
32
36
|
</object>
|
|
33
37
|
</child>
|
|
34
38
|
</object>
|
|
35
39
|
<object class="GtkWindow" id="window1">
|
|
40
|
+
<property name="can_focus">False</property>
|
|
36
41
|
<property name="window_position">center-on-parent</property>
|
|
37
|
-
<signal name="destroy" handler="destroy_window"/>
|
|
38
42
|
<child>
|
|
39
|
-
<object class="
|
|
43
|
+
<object class="GtkBox" id="box2">
|
|
40
44
|
<property name="visible">True</property>
|
|
45
|
+
<property name="can_focus">False</property>
|
|
46
|
+
<property name="orientation">vertical</property>
|
|
41
47
|
<child>
|
|
42
|
-
<object class="
|
|
48
|
+
<object class="GtkLabel" id="label2">
|
|
43
49
|
<property name="visible">True</property>
|
|
44
|
-
<
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
<property name="use_markup">True</property>
|
|
50
|
-
<property name="wrap">True</property>
|
|
51
|
-
</object>
|
|
52
|
-
<packing>
|
|
53
|
-
<property name="padding">15</property>
|
|
54
|
-
<property name="position">0</property>
|
|
55
|
-
</packing>
|
|
56
|
-
</child>
|
|
57
|
-
<child>
|
|
58
|
-
<object class="GtkProgressBar" id="progressbar1">
|
|
59
|
-
<property name="visible">True</property>
|
|
60
|
-
</object>
|
|
61
|
-
<packing>
|
|
62
|
-
<property name="expand">False</property>
|
|
63
|
-
<property name="padding">20</property>
|
|
64
|
-
<property name="position">1</property>
|
|
65
|
-
</packing>
|
|
66
|
-
</child>
|
|
50
|
+
<property name="can_focus">False</property>
|
|
51
|
+
<property name="label" translatable="yes"><big><big>Contacting Rubygems.org...</big></big>
|
|
52
|
+
Please wait while the names of your gems are downloaded. Yanking old versions of your gems, makes this process faster. This is currently not shown!</property>
|
|
53
|
+
<property name="use_markup">True</property>
|
|
54
|
+
<property name="wrap">True</property>
|
|
67
55
|
</object>
|
|
68
56
|
<packing>
|
|
57
|
+
<property name="expand">True</property>
|
|
58
|
+
<property name="fill">True</property>
|
|
69
59
|
<property name="padding">15</property>
|
|
70
60
|
<property name="position">0</property>
|
|
71
61
|
</packing>
|
|
72
62
|
</child>
|
|
63
|
+
<child>
|
|
64
|
+
<object class="GtkProgressBar" id="progressbar1">
|
|
65
|
+
<property name="visible">True</property>
|
|
66
|
+
<property name="can_focus">False</property>
|
|
67
|
+
</object>
|
|
68
|
+
<packing>
|
|
69
|
+
<property name="expand">False</property>
|
|
70
|
+
<property name="fill">True</property>
|
|
71
|
+
<property name="padding">20</property>
|
|
72
|
+
<property name="position">1</property>
|
|
73
|
+
</packing>
|
|
74
|
+
</child>
|
|
73
75
|
</object>
|
|
74
76
|
</child>
|
|
75
77
|
</object>
|
data/bin/tools/VR_Tools.rb
CHANGED
|
@@ -1,57 +1,32 @@
|
|
|
1
|
-
module VR_Tools
|
|
1
|
+
module VR_Tools
|
|
2
|
+
|
|
3
|
+
def VR_Tools.clear_events
|
|
4
|
+
while (Gtk.events_pending?)
|
|
5
|
+
Gtk.main_iteration
|
|
6
|
+
end
|
|
7
|
+
end
|
|
2
8
|
|
|
3
9
|
def VR_Tools.popen(cmd)
|
|
4
10
|
begin
|
|
5
11
|
IO.popen(cmd)
|
|
6
12
|
rescue
|
|
7
|
-
|
|
13
|
+
alert("The following command couldn't run:\n\n<b>#{cmd}</b>\n\nCheck the path in Tools > Settings")
|
|
8
14
|
end
|
|
9
15
|
end
|
|
10
16
|
|
|
11
|
-
# def VR_Tools.sudo_command(command)
|
|
12
|
-
# @pass ||= ""
|
|
13
|
-
# if @pass.strip() == ""
|
|
14
|
-
# @pass = VR::Dialog.input_box("Enter System Password:")
|
|
15
|
-
# end
|
|
16
|
-
# result = command + "\n" + `echo #{@pass} | sudo -S #{command}`
|
|
17
|
-
# @pass = "" if result.include? "incorrect password"
|
|
18
|
-
# return result
|
|
19
|
-
# end
|
|
20
|
-
|
|
21
|
-
def VR_Tools.create_desktop_launcher()
|
|
22
|
-
command = "vr " + Dir.pwd
|
|
23
|
-
name = File.basename(Dir.pwd) + " Project"
|
|
24
|
-
str = <<END
|
|
25
17
|
|
|
26
|
-
#!/usr/bin/env xdg-open
|
|
27
|
-
|
|
28
|
-
[Desktop Entry]
|
|
29
|
-
Version=1.0
|
|
30
|
-
Type=Application
|
|
31
|
-
Terminal=false
|
|
32
|
-
Icon[en_US]=gnome-panel-launcher
|
|
33
|
-
Name[en_US]=#{name}
|
|
34
|
-
Exec=#{command}
|
|
35
|
-
Comment[en_US]=Opens a Visual Ruby project
|
|
36
|
-
Name=#{name}
|
|
37
|
-
Comment=Opens a Visual Ruby project
|
|
38
|
-
Icon=gnome-panel-launcher
|
|
39
|
-
|
|
40
|
-
END
|
|
41
|
-
return unless File.directory?(ENV["HOME"] + "/Desktop")
|
|
42
|
-
fn = ENV["HOME"] + "/Desktop/" + name + ".desktop"
|
|
43
|
-
File.open(fn,"w") { |f| f.puts(str) }
|
|
44
|
-
File.chmod(0755, fn)
|
|
45
|
-
VR::Dialog.message_box("Created launcher:\n" + name + "\non your computer's desktop")
|
|
46
|
-
end
|
|
47
18
|
|
|
48
19
|
def VR_Tools.back_up()
|
|
49
20
|
path = File.join(ENV["HOME"], "visualruby_backup", Dir.pwd.gsub(ENV["HOME"], ""))
|
|
50
21
|
t = Time.now
|
|
51
22
|
out_dir = path + "/" + Dir.pwd.split("/").last + " Backup " + t.month().to_s + '-' + t.day().to_s + "-" + t.year().to_s + " at " + t.strftime('%I %M%p')
|
|
52
23
|
copy_recursively(Dir.pwd, out_dir)
|
|
53
|
-
|
|
24
|
+
alert "Files backed up to: \n\n" + path
|
|
54
25
|
end
|
|
26
|
+
|
|
27
|
+
def VR_Tools.copy_skeleton_project(path)
|
|
28
|
+
VR_Tools.copy_recursively(File.dirname(__FILE__) + "/../../skeleton/project", path)
|
|
29
|
+
end
|
|
55
30
|
|
|
56
31
|
def VR_Tools.copy_recursively(from, out_dir)
|
|
57
32
|
Find.find(from) do |path|
|
|
@@ -67,7 +42,7 @@ END
|
|
|
67
42
|
end
|
|
68
43
|
end
|
|
69
44
|
end
|
|
70
|
-
|
|
45
|
+
|
|
71
46
|
def self.create_gemspec()
|
|
72
47
|
main_file = $VR_ENV.run_command_line.split(" ")[1]
|
|
73
48
|
main_path = "."
|
|
@@ -87,21 +62,25 @@ Gem::Specification.new do |s|
|
|
|
87
62
|
s.homepage = "http://www.yoursite.org/" # optional
|
|
88
63
|
s.description = "Full description here" # optional
|
|
89
64
|
s.executables = ['#{main_file}'] # i.e. 'vr' (optional, blank if library project)
|
|
90
|
-
s.default_executable =
|
|
65
|
+
s.default_executable = '#{main_file}' # i.e. 'vr' (optional, blank if library project)
|
|
91
66
|
s.bindir = [#{bindir}] # optional, default = bin
|
|
92
67
|
s.require_paths = [#{libdir}] # optional, default = lib
|
|
93
68
|
s.files = Dir.glob(File.join("**", "*.{rb,glade}"))
|
|
94
69
|
s.rubyforge_project = "nowarning" # supress warning message
|
|
95
70
|
end
|
|
96
71
|
END
|
|
97
|
-
name =
|
|
72
|
+
name = File.basename(Dir.pwd).downcase + ".gemspec"
|
|
98
73
|
if File.file?(name)
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
74
|
+
unless alert("Do you want to overwrite existing file?:\n<b>#{name}</b>?",
|
|
75
|
+
:headline => "File Already Exists", :button_yes => "Overwrite", :button_no => "Cancel", :width => 400)
|
|
76
|
+
return false
|
|
77
|
+
end
|
|
78
|
+
end
|
|
79
|
+
file_name = File.join(Dir.pwd,name)
|
|
80
|
+
File.open(file_name, "w") { |f| f.puts(str) }
|
|
81
|
+
return file_name
|
|
103
82
|
end
|
|
104
|
-
|
|
83
|
+
#
|
|
105
84
|
#this works on Dir.pwd that's maybe different from project
|
|
106
85
|
def VR_Tools.replace_html_in_docs()
|
|
107
86
|
return if not File.file? "rdoc_replace.yaml"
|
|
@@ -117,5 +96,40 @@ END
|
|
|
117
96
|
end
|
|
118
97
|
|
|
119
98
|
end
|
|
99
|
+
# def VR_Tools.sudo_command(command)
|
|
100
|
+
# @pass ||= ""
|
|
101
|
+
# if @pass.strip() == ""
|
|
102
|
+
# @pass = VR::Dialog.input_box("Enter System Password:")
|
|
103
|
+
# end
|
|
104
|
+
# result = command + "\n" + `echo #{@pass} | sudo -S #{command}`
|
|
105
|
+
# @pass = "" if result.include? "incorrect password"
|
|
106
|
+
# return result
|
|
107
|
+
# end
|
|
120
108
|
|
|
109
|
+
# def VR_Tools.create_desktop_launcher()
|
|
110
|
+
# command = "vr " + Dir.pwd
|
|
111
|
+
# name = File.basename(Dir.pwd) + " Project"
|
|
112
|
+
# str = <<END
|
|
113
|
+
#
|
|
114
|
+
##!/usr/bin/env xdg-open
|
|
115
|
+
#
|
|
116
|
+
#[Desktop Entry]
|
|
117
|
+
#Version=1.0
|
|
118
|
+
#Type=Application
|
|
119
|
+
#Terminal=false
|
|
120
|
+
#Icon[en_US]=gnome-panel-launcher
|
|
121
|
+
#Name[en_US]=#{name}
|
|
122
|
+
#Exec=#{command}
|
|
123
|
+
#Comment[en_US]=Opens a Visual Ruby project
|
|
124
|
+
#Name=#{name}
|
|
125
|
+
#Comment=Opens a Visual Ruby project
|
|
126
|
+
#Icon=gnome-panel-launcher
|
|
127
|
+
#
|
|
128
|
+
#END
|
|
129
|
+
# return unless File.directory?(ENV["HOME"] + "/Desktop")
|
|
130
|
+
# fn = ENV["HOME"] + "/Desktop/" + name + ".desktop"
|
|
131
|
+
# File.open(fn,"w") { |f| f.puts(str) }
|
|
132
|
+
# File.chmod(0755, fn)
|
|
133
|
+
# alert("Created launcher:\n" + name + "\non your computer's desktop")
|
|
134
|
+
# end
|
|
121
135
|
|
|
@@ -1,21 +1,27 @@
|
|
|
1
|
-
require 'vrlib.rb'
|
|
2
|
-
require 'active_record'
|
|
3
1
|
|
|
4
|
-
#make program output in real time so errors visible in VR.
|
|
5
|
-
STDOUT.sync = true
|
|
6
|
-
STDERR.sync = true
|
|
7
2
|
|
|
8
|
-
#
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
3
|
+
# ignore -- this is for development, same as require 'vrlib'
|
|
4
|
+
require File.exists?("./../../vrlib/vrlib.rb") ? "./../../vrlib/vrlib.rb" : "vrlib"
|
|
5
|
+
|
|
6
|
+
begin
|
|
7
|
+
require 'active_record'
|
|
8
|
+
require 'sqlite3'
|
|
9
|
+
rescue LoadError
|
|
10
|
+
alert "You must install activerecord gem to use this example. " +
|
|
11
|
+
"Just enter at command prompt:\n\n<b>gem install activerecord\ngem install sqlite3</b>"
|
|
12
|
+
exit
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
# from require_all gem:
|
|
16
|
+
require_rel 'bin/'
|
|
17
|
+
|
|
12
18
|
|
|
13
19
|
ActiveRecord::Base.establish_connection(
|
|
14
20
|
:adapter => "sqlite3",
|
|
15
21
|
:database => "db/development.sqlite3",
|
|
16
22
|
)
|
|
17
23
|
|
|
18
|
-
ChoosePerson.new.
|
|
24
|
+
ChoosePerson.new.show_glade()
|
|
19
25
|
|
|
20
26
|
|
|
21
27
|
#ActiveRecord::Schema.define do
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
class Person < ActiveRecord::Base
|
|
2
|
+
|
|
3
|
+
include GladeGUI
|
|
4
|
+
|
|
5
|
+
def before_show
|
|
6
|
+
@builder[:labelName].label = "<big>#{name}</big>"
|
|
7
|
+
set_glade_all() # updates entry boxes
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
# this is what shows in the listview
|
|
11
|
+
def to_s
|
|
12
|
+
"#{self.name} (#{self.email}) #{self.phone}"
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
def buttonSave__clicked(*a)
|
|
16
|
+
get_glade_all #sets name, address, phone etc. from glade
|
|
17
|
+
save!
|
|
18
|
+
@builder[:window1].destroy
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
end
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<!-- Generated with glade 3.16.1 -->
|
|
3
|
+
<interface>
|
|
4
|
+
<requires lib="gtk+" version="3.0"/>
|
|
5
|
+
<object class="GtkWindow" id="window1">
|
|
6
|
+
<property name="can_focus">False</property>
|
|
7
|
+
<property name="title" translatable="yes">Active Record Demo</property>
|
|
8
|
+
<property name="window_position">center</property>
|
|
9
|
+
<property name="default_width">450</property>
|
|
10
|
+
<property name="default_height">300</property>
|
|
11
|
+
<child>
|
|
12
|
+
<object class="GtkBox" id="box1">
|
|
13
|
+
<property name="visible">True</property>
|
|
14
|
+
<property name="can_focus">False</property>
|
|
15
|
+
<property name="margin_left">20</property>
|
|
16
|
+
<property name="margin_right">20</property>
|
|
17
|
+
<property name="margin_top">20</property>
|
|
18
|
+
<property name="margin_bottom">20</property>
|
|
19
|
+
<property name="orientation">vertical</property>
|
|
20
|
+
<child>
|
|
21
|
+
<object class="GtkLabel" id="label1">
|
|
22
|
+
<property name="visible">True</property>
|
|
23
|
+
<property name="can_focus">False</property>
|
|
24
|
+
<property name="label" translatable="yes"><big><big>Choose Person:</big></big></property>
|
|
25
|
+
<property name="use_markup">True</property>
|
|
26
|
+
</object>
|
|
27
|
+
<packing>
|
|
28
|
+
<property name="expand">False</property>
|
|
29
|
+
<property name="fill">True</property>
|
|
30
|
+
<property name="position">0</property>
|
|
31
|
+
</packing>
|
|
32
|
+
</child>
|
|
33
|
+
<child>
|
|
34
|
+
<object class="GtkScrolledWindow" id="scrolledwindow1">
|
|
35
|
+
<property name="visible">True</property>
|
|
36
|
+
<property name="can_focus">True</property>
|
|
37
|
+
<child>
|
|
38
|
+
<placeholder/>
|
|
39
|
+
</child>
|
|
40
|
+
</object>
|
|
41
|
+
<packing>
|
|
42
|
+
<property name="expand">True</property>
|
|
43
|
+
<property name="fill">True</property>
|
|
44
|
+
<property name="position">1</property>
|
|
45
|
+
</packing>
|
|
46
|
+
</child>
|
|
47
|
+
<child>
|
|
48
|
+
<object class="GtkButtonBox" id="buttonbox1">
|
|
49
|
+
<property name="visible">True</property>
|
|
50
|
+
<property name="can_focus">False</property>
|
|
51
|
+
<property name="spacing">10</property>
|
|
52
|
+
<property name="layout_style">end</property>
|
|
53
|
+
<child>
|
|
54
|
+
<object class="GtkButton" id="buttonCancel">
|
|
55
|
+
<property name="label" translatable="yes">Cancel</property>
|
|
56
|
+
<property name="visible">True</property>
|
|
57
|
+
<property name="can_focus">True</property>
|
|
58
|
+
<property name="receives_default">True</property>
|
|
59
|
+
</object>
|
|
60
|
+
<packing>
|
|
61
|
+
<property name="expand">False</property>
|
|
62
|
+
<property name="fill">True</property>
|
|
63
|
+
<property name="position">0</property>
|
|
64
|
+
</packing>
|
|
65
|
+
</child>
|
|
66
|
+
<child>
|
|
67
|
+
<object class="GtkButton" id="buttonShow">
|
|
68
|
+
<property name="label" translatable="yes">Show</property>
|
|
69
|
+
<property name="visible">True</property>
|
|
70
|
+
<property name="can_focus">True</property>
|
|
71
|
+
<property name="receives_default">True</property>
|
|
72
|
+
</object>
|
|
73
|
+
<packing>
|
|
74
|
+
<property name="expand">False</property>
|
|
75
|
+
<property name="fill">True</property>
|
|
76
|
+
<property name="position">1</property>
|
|
77
|
+
</packing>
|
|
78
|
+
</child>
|
|
79
|
+
</object>
|
|
80
|
+
<packing>
|
|
81
|
+
<property name="expand">False</property>
|
|
82
|
+
<property name="fill">True</property>
|
|
83
|
+
<property name="position">2</property>
|
|
84
|
+
</packing>
|
|
85
|
+
</child>
|
|
86
|
+
</object>
|
|
87
|
+
</child>
|
|
88
|
+
</object>
|
|
89
|
+
</interface>
|
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<!-- Generated with glade 3.16.1 -->
|
|
3
|
+
<interface>
|
|
4
|
+
<requires lib="gtk+" version="3.0"/>
|
|
5
|
+
<object class="GtkWindow" id="window1">
|
|
6
|
+
<property name="width_request">460</property>
|
|
7
|
+
<property name="can_focus">False</property>
|
|
8
|
+
<property name="window_position">center</property>
|
|
9
|
+
<child>
|
|
10
|
+
<object class="GtkBox" id="box1">
|
|
11
|
+
<property name="visible">True</property>
|
|
12
|
+
<property name="can_focus">False</property>
|
|
13
|
+
<property name="margin_left">20</property>
|
|
14
|
+
<property name="margin_right">20</property>
|
|
15
|
+
<property name="margin_top">20</property>
|
|
16
|
+
<property name="margin_bottom">20</property>
|
|
17
|
+
<property name="orientation">vertical</property>
|
|
18
|
+
<property name="spacing">10</property>
|
|
19
|
+
<child>
|
|
20
|
+
<object class="GtkLabel" id="labelName">
|
|
21
|
+
<property name="visible">True</property>
|
|
22
|
+
<property name="can_focus">False</property>
|
|
23
|
+
<property name="yalign">0.4699999988079071</property>
|
|
24
|
+
<property name="label" translatable="yes">Person</property>
|
|
25
|
+
<property name="use_markup">True</property>
|
|
26
|
+
</object>
|
|
27
|
+
<packing>
|
|
28
|
+
<property name="expand">True</property>
|
|
29
|
+
<property name="fill">True</property>
|
|
30
|
+
<property name="padding">10</property>
|
|
31
|
+
<property name="position">0</property>
|
|
32
|
+
</packing>
|
|
33
|
+
</child>
|
|
34
|
+
<child>
|
|
35
|
+
<object class="GtkGrid" id="grid1">
|
|
36
|
+
<property name="visible">True</property>
|
|
37
|
+
<property name="can_focus">False</property>
|
|
38
|
+
<property name="row_spacing">8</property>
|
|
39
|
+
<property name="column_spacing">5</property>
|
|
40
|
+
<child>
|
|
41
|
+
<object class="GtkLabel" id="label1">
|
|
42
|
+
<property name="visible">True</property>
|
|
43
|
+
<property name="can_focus">False</property>
|
|
44
|
+
<property name="xalign">1</property>
|
|
45
|
+
<property name="label" translatable="yes">Name:</property>
|
|
46
|
+
</object>
|
|
47
|
+
<packing>
|
|
48
|
+
<property name="left_attach">0</property>
|
|
49
|
+
<property name="top_attach">0</property>
|
|
50
|
+
<property name="width">1</property>
|
|
51
|
+
<property name="height">1</property>
|
|
52
|
+
</packing>
|
|
53
|
+
</child>
|
|
54
|
+
<child>
|
|
55
|
+
<object class="GtkLabel" id="label2">
|
|
56
|
+
<property name="visible">True</property>
|
|
57
|
+
<property name="can_focus">False</property>
|
|
58
|
+
<property name="xalign">1</property>
|
|
59
|
+
<property name="label" translatable="yes">Address:</property>
|
|
60
|
+
</object>
|
|
61
|
+
<packing>
|
|
62
|
+
<property name="left_attach">0</property>
|
|
63
|
+
<property name="top_attach">1</property>
|
|
64
|
+
<property name="width">1</property>
|
|
65
|
+
<property name="height">1</property>
|
|
66
|
+
</packing>
|
|
67
|
+
</child>
|
|
68
|
+
<child>
|
|
69
|
+
<object class="GtkLabel" id="label3">
|
|
70
|
+
<property name="visible">True</property>
|
|
71
|
+
<property name="can_focus">False</property>
|
|
72
|
+
<property name="xalign">1</property>
|
|
73
|
+
<property name="label" translatable="yes">Phone Number:</property>
|
|
74
|
+
</object>
|
|
75
|
+
<packing>
|
|
76
|
+
<property name="left_attach">0</property>
|
|
77
|
+
<property name="top_attach">2</property>
|
|
78
|
+
<property name="width">1</property>
|
|
79
|
+
<property name="height">1</property>
|
|
80
|
+
</packing>
|
|
81
|
+
</child>
|
|
82
|
+
<child>
|
|
83
|
+
<object class="GtkLabel" id="label4">
|
|
84
|
+
<property name="visible">True</property>
|
|
85
|
+
<property name="can_focus">False</property>
|
|
86
|
+
<property name="xalign">1</property>
|
|
87
|
+
<property name="label" translatable="yes">Email:</property>
|
|
88
|
+
</object>
|
|
89
|
+
<packing>
|
|
90
|
+
<property name="left_attach">0</property>
|
|
91
|
+
<property name="top_attach">3</property>
|
|
92
|
+
<property name="width">1</property>
|
|
93
|
+
<property name="height">1</property>
|
|
94
|
+
</packing>
|
|
95
|
+
</child>
|
|
96
|
+
<child>
|
|
97
|
+
<object class="GtkEntry" id="name">
|
|
98
|
+
<property name="visible">True</property>
|
|
99
|
+
<property name="can_focus">True</property>
|
|
100
|
+
<property name="hexpand">True</property>
|
|
101
|
+
</object>
|
|
102
|
+
<packing>
|
|
103
|
+
<property name="left_attach">1</property>
|
|
104
|
+
<property name="top_attach">0</property>
|
|
105
|
+
<property name="width">1</property>
|
|
106
|
+
<property name="height">1</property>
|
|
107
|
+
</packing>
|
|
108
|
+
</child>
|
|
109
|
+
<child>
|
|
110
|
+
<object class="GtkEntry" id="address">
|
|
111
|
+
<property name="visible">True</property>
|
|
112
|
+
<property name="can_focus">True</property>
|
|
113
|
+
<property name="hexpand">True</property>
|
|
114
|
+
</object>
|
|
115
|
+
<packing>
|
|
116
|
+
<property name="left_attach">1</property>
|
|
117
|
+
<property name="top_attach">1</property>
|
|
118
|
+
<property name="width">1</property>
|
|
119
|
+
<property name="height">1</property>
|
|
120
|
+
</packing>
|
|
121
|
+
</child>
|
|
122
|
+
<child>
|
|
123
|
+
<object class="GtkEntry" id="phone">
|
|
124
|
+
<property name="visible">True</property>
|
|
125
|
+
<property name="can_focus">True</property>
|
|
126
|
+
<property name="hexpand">True</property>
|
|
127
|
+
</object>
|
|
128
|
+
<packing>
|
|
129
|
+
<property name="left_attach">1</property>
|
|
130
|
+
<property name="top_attach">2</property>
|
|
131
|
+
<property name="width">1</property>
|
|
132
|
+
<property name="height">1</property>
|
|
133
|
+
</packing>
|
|
134
|
+
</child>
|
|
135
|
+
<child>
|
|
136
|
+
<object class="GtkEntry" id="email">
|
|
137
|
+
<property name="visible">True</property>
|
|
138
|
+
<property name="can_focus">True</property>
|
|
139
|
+
<property name="hexpand">True</property>
|
|
140
|
+
</object>
|
|
141
|
+
<packing>
|
|
142
|
+
<property name="left_attach">1</property>
|
|
143
|
+
<property name="top_attach">3</property>
|
|
144
|
+
<property name="width">1</property>
|
|
145
|
+
<property name="height">1</property>
|
|
146
|
+
</packing>
|
|
147
|
+
</child>
|
|
148
|
+
</object>
|
|
149
|
+
<packing>
|
|
150
|
+
<property name="expand">False</property>
|
|
151
|
+
<property name="fill">True</property>
|
|
152
|
+
<property name="position">1</property>
|
|
153
|
+
</packing>
|
|
154
|
+
</child>
|
|
155
|
+
<child>
|
|
156
|
+
<object class="GtkButtonBox" id="buttonbox1">
|
|
157
|
+
<property name="visible">True</property>
|
|
158
|
+
<property name="can_focus">False</property>
|
|
159
|
+
<property name="spacing">10</property>
|
|
160
|
+
<property name="layout_style">end</property>
|
|
161
|
+
<child>
|
|
162
|
+
<object class="GtkButton" id="buttonCancel">
|
|
163
|
+
<property name="label" translatable="yes">Cancel</property>
|
|
164
|
+
<property name="visible">True</property>
|
|
165
|
+
<property name="can_focus">True</property>
|
|
166
|
+
<property name="receives_default">True</property>
|
|
167
|
+
</object>
|
|
168
|
+
<packing>
|
|
169
|
+
<property name="expand">False</property>
|
|
170
|
+
<property name="fill">True</property>
|
|
171
|
+
<property name="position">0</property>
|
|
172
|
+
</packing>
|
|
173
|
+
</child>
|
|
174
|
+
<child>
|
|
175
|
+
<object class="GtkButton" id="buttonSave">
|
|
176
|
+
<property name="label" translatable="yes">Save</property>
|
|
177
|
+
<property name="visible">True</property>
|
|
178
|
+
<property name="can_focus">True</property>
|
|
179
|
+
<property name="receives_default">True</property>
|
|
180
|
+
</object>
|
|
181
|
+
<packing>
|
|
182
|
+
<property name="expand">False</property>
|
|
183
|
+
<property name="fill">True</property>
|
|
184
|
+
<property name="position">1</property>
|
|
185
|
+
</packing>
|
|
186
|
+
</child>
|
|
187
|
+
</object>
|
|
188
|
+
<packing>
|
|
189
|
+
<property name="expand">False</property>
|
|
190
|
+
<property name="fill">True</property>
|
|
191
|
+
<property name="position">2</property>
|
|
192
|
+
</packing>
|
|
193
|
+
</child>
|
|
194
|
+
</object>
|
|
195
|
+
</child>
|
|
196
|
+
</object>
|
|
197
|
+
</interface>
|
|
Binary file
|