visualruby 3.2.2 → 3.2.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 471487097b28ac84f9b91f6cdbded31e11f871b7
4
- data.tar.gz: 1b62e86d75a8be09a9b82c75138470b9a5c2865f
3
+ metadata.gz: ea28638629e02704ffff8783f60a749017345073
4
+ data.tar.gz: 4b3d828f553f07c3d39abf83a16222027220856a
5
5
  SHA512:
6
- metadata.gz: db3f477a72929229e187c0a06565c3bf697a2474705869be6a708a3d42010c95d58c3fc7157630d946b124db750ffa254f0bfd5dae670b37855374862ab2f320
7
- data.tar.gz: 4ea888126ac4ba0b4a4c2ae7fd386db675a556e496078be5255719240f6c01bda83a1e467e1ff023d939996471373151be551ba28d452f21b1c1dd54963438b5
6
+ metadata.gz: afd365c9fbbf5615f28083f63f50e4aac7d9194b5b5205d2665c485b1f2f358d41ef2e97401a125c116cb96663b0c84d405b369d7953250550c3b3bef3728565
7
+ data.tar.gz: 0c62889a4aa774e79094208fc3c68ef9e4798d91bdda0fb08df4c4e616e0efd02941a3093e2348fc7fe8a0be1f906fe465562365e167f01899ed94393c1a4824
@@ -15,15 +15,16 @@ open_files:
15
15
  - "/home/eric/vrp/vr3/src/main/VR_Main.rb"
16
16
  - "/home/eric/vrp/vr3/lib/GladeGUI.rb"
17
17
  - "/home/eric/vrp/vr3/lib/vrlib.rb"
18
- - "/home/eric/vrp/vr3/lib/ActLikeAHash.rb"
18
+ - "/home/eric/vrp/vr3/lib/treeview/FileTreeView.rb"
19
+ - "/home/eric/vrp/vr3/src/editor/VR_Document.rb"
19
20
  open_folders:
20
21
  - "/home/eric/vrp/vr3"
21
- - "/home/eric/vrp/vr3/lib"
22
22
  - "/home/eric/vrp/vr3/site"
23
23
  - "/home/eric/vrp/vr3/src"
24
+ - "/home/eric/vrp/vr3/src/editor"
24
25
  - "/home/eric/vrp/vr3/src/main"
25
- current_file: "/home/eric/vrp/vr3/vr"
26
- current_line: 17
26
+ current_file: "/home/eric/vrp/vr3/src/main/VR_Main.rb"
27
+ current_line: 218
27
28
  rdoc_command_line: yardoc lib - site/*.*
28
29
  builder: !ruby/object:Gtk::Builder {}
29
30
  top_level_window: false
@@ -10,12 +10,13 @@ open_files:
10
10
  - "/home/eric/vrp/vr3/examples/golf_handicap/src/Handicap.rb"
11
11
  - "/home/eric/vrp/vr3/examples/golf_handicap/src/Score.rb"
12
12
  - "/home/eric/vrp/vr3/examples/golf_handicap/golf_handicap.gemspec"
13
+ - "/home/eric/vrp/vr3/examples/golf_handicap/src/LoadGolfer.rb"
13
14
  open_folders:
14
15
  - "/home/eric/vrp/vr3/examples/golf_handicap"
15
16
  - "/home/eric/vrp/vr3/examples/golf_handicap/src"
16
17
  - "/home/eric/vrp/vr3/examples/golf_handicap/src/glade"
17
- current_file: "/home/eric/vrp/vr3/examples/golf_handicap/golf_handicap.gemspec"
18
- current_line: 4
18
+ current_file: "/home/eric/vrp/vr3/examples/golf_handicap/src/Score.rb"
19
+ current_line: 38
19
20
  rdoc_command_line: rdoc -x README
20
21
  builder: !ruby/object:Gtk::Builder {}
21
22
  top_level_window: false
@@ -40,10 +40,6 @@ class Handicap
40
40
  end
41
41
  end
42
42
 
43
- def buttonChange__clicked(*a)
44
- load_new_golfer
45
- end
46
-
47
43
  def buttonAdd__clicked(*a)
48
44
  if row = @view.selected_rows.first
49
45
  course = row[:course]
@@ -80,6 +76,13 @@ class Handicap
80
76
  score_array[0].handicap = count > 0 ? x[0..x.index(".")+1] : "n/a" if score_array[0]
81
77
  end
82
78
 
79
+ def buttonChangeGolfer__clicked(*a)
80
+ @view = nil # so it doesn't save contents
81
+ VR::save_yaml(self)
82
+ @builder[:window1].destroy
83
+ load_new_golfer
84
+ end
85
+
83
86
 
84
87
  def window1__delete_event(*)
85
88
  @view = nil
@@ -0,0 +1,27 @@
1
+ def load_new_golfer
2
+ files = []
3
+ names = []
4
+ Dir[File.expand_path('~/visualruby/golf_handicap/**/*.yaml')].each do |file_name|
5
+ files << file_name
6
+ names << File.basename(file_name, ".*")
7
+ end
8
+
9
+ answer = files.empty? ? false : alert("Choose Golfer:", choices: names, button_no: "New Golfer")
10
+
11
+ if answer.is_a?(String)
12
+ load_file = files[names.index(answer)]
13
+ elsif answer == false
14
+ golfer_name = alert("Enter Name of Golfer to Create a new Handicap File:",
15
+ input_text: "",
16
+ button_yes: "Add Golfer"
17
+ )
18
+ exit unless golfer_name.is_a?(String)
19
+ exit unless golfer_name.length > 2
20
+ load_file = golfer_name.downcase.tr("^a-z\s", '').gsub(" ", "_") + ".yaml"
21
+ else
22
+ exit
23
+ end
24
+
25
+ VR::load_yaml(Handicap, load_file).show_glade
26
+
27
+ end
@@ -47,32 +47,6 @@
47
47
  <property name="position">1</property>
48
48
  </packing>
49
49
  </child>
50
- <child>
51
- <object class="GtkButtonBox" id="buttonbox2">
52
- <property name="visible">True</property>
53
- <property name="can_focus">False</property>
54
- <property name="orientation">vertical</property>
55
- <property name="layout_style">center</property>
56
- <child>
57
- <object class="GtkButton" id="buttonChange">
58
- <property name="label" translatable="yes">Change</property>
59
- <property name="visible">True</property>
60
- <property name="can_focus">True</property>
61
- <property name="receives_default">True</property>
62
- </object>
63
- <packing>
64
- <property name="expand">False</property>
65
- <property name="fill">True</property>
66
- <property name="position">0</property>
67
- </packing>
68
- </child>
69
- </object>
70
- <packing>
71
- <property name="expand">False</property>
72
- <property name="fill">True</property>
73
- <property name="position">2</property>
74
- </packing>
75
- </child>
76
50
  <child>
77
51
  <object class="GtkFrame" id="frame1">
78
52
  <property name="visible">True</property>
@@ -106,7 +80,7 @@
106
80
  <packing>
107
81
  <property name="expand">False</property>
108
82
  <property name="fill">True</property>
109
- <property name="position">3</property>
83
+ <property name="position">2</property>
110
84
  </packing>
111
85
  </child>
112
86
  </object>
@@ -139,6 +113,19 @@
139
113
  <property name="can_focus">False</property>
140
114
  <property name="spacing">5</property>
141
115
  <property name="layout_style">end</property>
116
+ <child>
117
+ <object class="GtkButton" id="buttonChangeGolfer">
118
+ <property name="label" translatable="yes">Change Golfer</property>
119
+ <property name="visible">True</property>
120
+ <property name="can_focus">True</property>
121
+ <property name="receives_default">True</property>
122
+ </object>
123
+ <packing>
124
+ <property name="expand">False</property>
125
+ <property name="fill">True</property>
126
+ <property name="position">0</property>
127
+ </packing>
128
+ </child>
142
129
  <child>
143
130
  <object class="GtkButton" id="buttonAdd">
144
131
  <property name="label" translatable="yes">Add Score</property>
@@ -92,28 +92,28 @@ class VR_Document < GtkSource::View
92
92
  apply_tag_to_line(line-1, @hilight, nil)
93
93
  end
94
94
 
95
- def comment()
95
+
96
+ def insert_before_selected(text)
96
97
  return unless buffer.has_selection?
97
98
  s,e = get_selected_lines()
98
99
  (s..e).each do |i|
99
100
  iter, iter_end = get_line_iters(i)
100
- iter_end.offset = iter.offset+1
101
- chr = buffer.get_text(iter, iter_end, false)
102
- buffer.insert(iter, "#")
103
- end
104
- end
105
-
106
- def un_comment()
101
+ buffer.insert(iter, text)
102
+ end
103
+ end
104
+
105
+ def delete_before_selected(text)
107
106
  return unless buffer.has_selection?
108
107
  s,e = get_selected_lines()
109
108
  (s..e).each do |i|
110
109
  iter, iter_end = get_line_iters(i)
111
110
  next if iter_end.offset <= iter.offset + 1
112
- iter_end.offset = iter.offset+1
111
+ iter_end.offset = iter.offset + text.size
113
112
  chr = buffer.get_text(iter, iter_end, false)
114
- buffer.delete(iter, iter_end) if chr == "#"
113
+ buffer.delete(iter, iter_end) if chr == text
115
114
  end
116
- end
115
+ end
116
+
117
117
 
118
118
  def get_selected_lines()
119
119
  return unless buffer.has_selection?
@@ -209,28 +209,20 @@ class VR_Main
209
209
  VR_Tools.back_up()
210
210
  end
211
211
 
212
- def toolIndent__clicked(*a)
213
- press_key(65289) #tab
212
+ def toolIndent__clicked(*a)
213
+ @tabs.docs[@tabs.page].insert_before_selected(" " * $VR_ENV_GLOBAL.tab_spaces.to_i )
214
214
  end
215
215
 
216
- def toolUnIndent__clicked(*a)
217
- press_key(65056, :shift_mask) # shift+tab
216
+ def toolUnIndent__clicked(*a)
217
+ @tabs.docs[@tabs.page].delete_before_selected(" " * $VR_ENV_GLOBAL.tab_spaces.to_i)
218
218
  end
219
219
 
220
- def press_key(keyval, mask = nil)
221
- evt = Gdk::EventKey.new(:key_press)
222
- evt.state = mask if mask
223
- evt.keyval = keyval
224
- @tabs.docs[@tabs.page].signal_emit(:key_press_event, evt)
220
+ def toolComment__clicked(*a)
221
+ @tabs.docs[@tabs.page].insert_before_selected("# ")
225
222
  end
226
223
 
227
-
228
- def toolComment__clicked(*a)
229
- @tabs.docs[@tabs.page].comment()
230
- end
231
-
232
- def toolUnComment__clicked(*a)
233
- @tabs.docs[@tabs.page].un_comment()
224
+ def toolUnComment__clicked(*a)
225
+ @tabs.docs[@tabs.page].delete_before_selected("# ")
234
226
  end
235
227
 
236
228
  def toolRun__clicked(*a)
@@ -1 +1 @@
1
- VERSION = "3.2.2"
1
+ VERSION = "3.2.3"
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.2.2
4
+ version: 3.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eric Cunningham
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir:
10
10
  - "."
11
11
  cert_chain: []
12
- date: 2018-05-12 00:00:00.000000000 Z
12
+ date: 2018-05-19 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: gtk3
@@ -133,6 +133,7 @@ files:
133
133
  - "./examples/filetreeview/main.rb"
134
134
  - "./examples/golf_handicap/.vr_settings.yaml"
135
135
  - "./examples/golf_handicap/src/Handicap.rb"
136
+ - "./examples/golf_handicap/src/LoadGolfer.rb"
136
137
  - "./examples/golf_handicap/src/Score.rb"
137
138
  - "./examples/golf_handicap/src/glade/Handicap.glade"
138
139
  - "./examples/golf_handicap/src/glade/Score.glade"