arcadia 0.6.0 → 0.7.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README +40 -11
- data/conf/arcadia.conf +43 -3
- data/conf/arcadia.res.rb +201 -0
- data/ext/ae-dir-projects/ae-dir-projects.conf +18 -0
- data/ext/ae-dir-projects/ae-dir-projects.rb +880 -0
- data/ext/ae-editor/ae-editor.conf +3 -1
- data/ext/ae-editor/ae-editor.rb +380 -296
- data/ext/ae-file-history/ae-file-history.conf +2 -2
- data/ext/ae-file-history/ae-file-history.rb +20 -39
- data/ext/ae-search-in-files/ae-search-in-files.rb +2 -1
- data/lib/a-commons.rb +4 -0
- data/lib/a-contracts.rb +8 -0
- data/lib/a-core.rb +56 -28
- data/lib/a-tkcommons.rb +127 -88
- metadata +138 -144
data/README
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
= Arcadia Ruby Ide
|
2
|
-
version 0.
|
2
|
+
version 0.7.0
|
3
3
|
|
4
4
|
by Antonio Galeone
|
5
|
-
on
|
5
|
+
on Jul 22, 2009
|
6
6
|
|
7
7
|
|
8
8
|
== About
|
@@ -17,8 +17,28 @@ Some of Arcadia ruby ide project features include:
|
|
17
17
|
* Highly extensibility architecture.
|
18
18
|
|
19
19
|
== In this release
|
20
|
-
|
21
|
-
|
20
|
+
[New extensions]
|
21
|
+
- project drawer
|
22
|
+
|
23
|
+
[Improvements]
|
24
|
+
ae-file-history :
|
25
|
+
- tree "auto expand" if it only has one child
|
26
|
+
- describe better what "sync" means, somehow.
|
27
|
+
|
28
|
+
ae-search-in-files :
|
29
|
+
- make it so that you don't have to click on one of the search
|
30
|
+
entries to be able to use the mouse scrollwheel to scroll up and down.
|
31
|
+
|
32
|
+
ae-editor :
|
33
|
+
- auto completion of current word based on words within the current window also
|
34
|
+
like textmate's hitting escape.
|
35
|
+
- added "ctrl +o" shortcut that opens the filesystem dialog
|
36
|
+
in the directory that file you’re on is.
|
37
|
+
|
38
|
+
commons :
|
39
|
+
- make "do you want to exit" optional
|
40
|
+
|
41
|
+
|
22
42
|
|
23
43
|
|
24
44
|
== How to install
|
@@ -75,11 +95,16 @@ These are same editor short-cut:
|
|
75
95
|
|
76
96
|
- Double-Click on line number set or unset a debug breakpoint
|
77
97
|
|
98
|
+
==== Project drawer
|
99
|
+
It is a navigational tree:
|
100
|
+
- open or create dir as project
|
101
|
+
- make commons file system activity (by contextual menu)
|
102
|
+
|
78
103
|
==== File history
|
79
104
|
The last used files are organizing in tree so you can reopen them or there
|
80
105
|
directory by clicking on the tree node.
|
81
106
|
|
82
|
-
==== Rad Palette
|
107
|
+
==== Rad Palette (instable)
|
83
108
|
It contain the wrapper components for the tk gui building.
|
84
109
|
It is in very unstabled and incomplete state.
|
85
110
|
The first component is a TkTopLevel wrapper, when you click on it a new form is created and a
|
@@ -91,7 +116,7 @@ On the palette there are also two button, one for deselect and other for copy fr
|
|
91
116
|
created widget. The copy action copy also the code into the clipboard, so you can copy the
|
92
117
|
code rapresenting the gui into the embedded editor or into external editor.
|
93
118
|
|
94
|
-
==== Rad Object Inspector
|
119
|
+
==== Rad Object Inspector (instable)
|
95
120
|
It is for modify the widget property at runtime
|
96
121
|
|
97
122
|
==== Debug
|
@@ -111,7 +136,8 @@ under ~/.arcadia directory. The format of property definition are:
|
|
111
136
|
I include into distribution also the BWidget lib (under tcl directory) so
|
112
137
|
are require realy only the standard tcl tk lib (tested on tcl tk 8.4 & tcl tk 8.5).
|
113
138
|
I have tested arcadia with ruby 1.8.4, 1.8.5, 1.8.6, 1.8.7 on
|
114
|
-
* Archlinux
|
139
|
+
* Archlinux
|
140
|
+
* Ubuntu
|
115
141
|
* FreeBsd6.x, FreeBsd7.x,
|
116
142
|
* Vector linux 5.*,
|
117
143
|
* Windows 2000/XP,
|
@@ -119,8 +145,8 @@ I have tested arcadia with ruby 1.8.4, 1.8.5, 1.8.6, 1.8.7 on
|
|
119
145
|
by ash.exe exec "/bin/rebaseall").
|
120
146
|
If you will test arcadia on other operating system sends me an e-mail.
|
121
147
|
|
122
|
-
==Developers information
|
123
|
-
Released on arcadia web site (http://arcadia.rubyforge.org)
|
148
|
+
==Developers e general information
|
149
|
+
Released on arcadia web site (http://arcadia.rubyforge.org)
|
124
150
|
|
125
151
|
|
126
152
|
|
@@ -128,6 +154,9 @@ Released on arcadia web site (http://arcadia.rubyforge.org) a first drawing of "
|
|
128
154
|
Arcadia is released under the Ruby License
|
129
155
|
|
130
156
|
== Contacts
|
131
|
-
For questions:
|
157
|
+
For all questions:
|
132
158
|
antonio-galeone@rubyforge.org
|
133
|
-
|
159
|
+
|
160
|
+
For bugs, support request, features request:
|
161
|
+
http://groups.google.it/group/arcadia-ruby-ide
|
162
|
+
http://rubyforge.org/projects/arcadia
|
data/conf/arcadia.conf
CHANGED
@@ -11,10 +11,11 @@ arm::layout.splitter.length=10
|
|
11
11
|
#layout.split.1=0.0r70%
|
12
12
|
#layout.split.2=0.0c20%
|
13
13
|
|
14
|
-
layout.split=1,2
|
14
|
+
layout.split=1,2,3,4
|
15
15
|
layout.split.1=0.0c20%
|
16
16
|
layout.split.2=0.1r70%
|
17
|
-
|
17
|
+
layout.split.3=0.1c60%
|
18
|
+
layout.split.4=0.0r60%
|
18
19
|
|
19
20
|
#layout.split=1,2,3
|
20
21
|
#layout.split.1=0.0c20%
|
@@ -22,6 +23,7 @@ layout.split.2=0.1r70%
|
|
22
23
|
#layout.split.3=0.1r70%
|
23
24
|
|
24
25
|
#:::::::::::::::: layout ::::::::::::::::::::::<end>
|
26
|
+
confirm-on-exit=no
|
25
27
|
#:::::::::::::::::::::::::::::::::::::::::::::::::<begin>
|
26
28
|
font.h1=
|
27
29
|
font.h2=
|
@@ -102,7 +104,7 @@ tabpanel.borderwidth=1
|
|
102
104
|
tabpanel.font=>>>font
|
103
105
|
|
104
106
|
titletabpanel.=>>>tabpanel
|
105
|
-
titletabpanel.borderwidth=
|
107
|
+
titletabpanel.borderwidth=1
|
106
108
|
titletabpanel.font=>>>font.h3+++ bold
|
107
109
|
titletabpanel.arcradius=0
|
108
110
|
|
@@ -167,6 +169,14 @@ edit.insertbackground=#ff8000
|
|
167
169
|
edit.relief=flat
|
168
170
|
edit.borderwidth=0
|
169
171
|
|
172
|
+
text.=>>>edit
|
173
|
+
text.insertbackground=#000000
|
174
|
+
text.insertborderwidth=0
|
175
|
+
#text.insertofftime=200
|
176
|
+
#text.insertontime=200
|
177
|
+
text.insertofftime=0
|
178
|
+
text.insertontime=0
|
179
|
+
text.insertwidth=3
|
170
180
|
|
171
181
|
combobox.=>>>edit
|
172
182
|
combobox.background=>>>panel.background
|
@@ -222,6 +232,35 @@ hightlight.16.background=#b3c1d9
|
|
222
232
|
hightlight.16.borderwidth=2
|
223
233
|
hightlight.16.relief=groove
|
224
234
|
|
235
|
+
#:::::::::::::::::::::::::::::::::::::::::::::::::<end>
|
236
|
+
#:::::::::::::::::::: menu ::::::::::::::::::::::<begin>
|
237
|
+
#user_menu.contexts=File2
|
238
|
+
#user_menu.File2.context_path=/
|
239
|
+
#user_menu.File2=open,new,save,quit
|
240
|
+
|
241
|
+
#user_menu.File2.open.name=open
|
242
|
+
#user_menu.File2.open.hint=Open
|
243
|
+
#user_menu.File2.open.caption=Open
|
244
|
+
#user_menu.File2.open.image_data=OPEN_GIF
|
245
|
+
#user_menu.File2.open.event_class=OpenBufferEvent
|
246
|
+
|
247
|
+
#user_menu.File2.new.name=new
|
248
|
+
#user_menu.File2.new.hint=New
|
249
|
+
#user_menu.File2.new.caption=New
|
250
|
+
#user_menu.File2.new.image_data=NEW_GIF
|
251
|
+
#user_menu.File2.new.event_class=NewBufferEvent
|
252
|
+
#
|
253
|
+
#user_menu.File2.save.name=save
|
254
|
+
#user_menu.File2.save.hint=Save
|
255
|
+
#user_menu.File2.save.caption=Save
|
256
|
+
#user_menu.File2.save.image_data=BACKUP_GIF
|
257
|
+
#user_menu.File2.save.event_class=SaveBufferEvent
|
258
|
+
#
|
259
|
+
#user_menu.File2.quit.name=quit
|
260
|
+
#user_menu.File2.quit.hint=Quit
|
261
|
+
#user_menu.File2.quit.caption=Quit
|
262
|
+
#user_menu.File2.quit.image_data=EXIT_STORY_GIF
|
263
|
+
#user_menu.File2.quit.event_class=QuitEvent
|
225
264
|
#:::::::::::::::::::::::::::::::::::::::::::::::::<end>
|
226
265
|
#:::::::::::::::: toolbar ::::::::::::::::::::::<begin>
|
227
266
|
user_toolbar.contexts=file,run,debug
|
@@ -293,6 +332,7 @@ user_toolbar_show=yes
|
|
293
332
|
|
294
333
|
#:::::::::::::::: splash group ::::::::::::::::::::::<begin>
|
295
334
|
splash.show=yes
|
335
|
+
#splash.show=no
|
296
336
|
splash.title.font=Courier 28 bold
|
297
337
|
splash.subtitle.font=Courier 10 bold
|
298
338
|
splash.version.font=Courier 9
|
data/conf/arcadia.res.rb
CHANGED
@@ -76,6 +76,153 @@ eOrchFJmU6gkxRpkIilUqp9T1RGFM9WdNrmZqipdyjaYWYcF9Xo1aRfw3qN/
|
|
76
76
|
Ww6O27drYcOJiYLkKjWy5MmUIxQAADs=
|
77
77
|
EOS
|
78
78
|
|
79
|
+
ARCADIA_RING_GIF=<<EOS
|
80
|
+
R0lGODlhfAB8AOf/AAABAAIABQYAAAQABgACAAcAAAABDgUAFAADBgkBAAAB
|
81
|
+
HQACFAUCBwEEAAMBGQYDCQIFAQsBEA4BCQoDAREAEAQHAwkFCwwFAwAJAgoJ
|
82
|
+
ABEHAAcKBhAJBwUNAA0KDwoMCA0MAAsNChILFg8OAw4QDBURAA8TABgQBRAS
|
83
|
+
DxMVEhoVABIYABYXACEXDRcZFxgcABwbABscGiMfABoiAB4hACUgCSMgEB8h
|
84
|
+
Hh4nACQmACglACQrACkrADArAC8vACkxADYwAjk0ADM2AC05ADs6ADU9ADdB
|
85
|
+
AUE/BD5CAEU8MkVCADxBJjxGAEJPAFFLAEdOAEtNA09MCU5NFldVAFFXAE1a
|
86
|
+
AFhXC1hXHFhYFVpXJFNgAGBeAFlbPVxhAGRhEmBrAGVpBmhoHmptA25sG3Bu
|
87
|
+
L2Z2AHVwF211AnR2An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dKKhGFX3Ys2XapysMBIB4Xy1zSNF2oL4nb4zYu5x3qgGwa
|
1580
|
+
EXkiZmd/BQMDdh1DRh4XRSoKBgKLbEJLHoR8JxoEjEtNm1krGgCZTUCDk6eC
|
1581
|
+
q0udLSdvrrS4ubghADs=
|
1582
|
+
EOS
|
@@ -0,0 +1,18 @@
|
|
1
|
+
name=dir_projects
|
2
|
+
frames=0.0
|
3
|
+
frames.labels=Dir Projects
|
4
|
+
frames.names=dir_projects
|
5
|
+
active=yes
|
6
|
+
require=ext/ae-dir-projects/ae-dir-projects
|
7
|
+
class=DirProjects
|
8
|
+
|
9
|
+
file.name=arcadia.projects
|
10
|
+
length=35
|
11
|
+
font=courier 11
|
12
|
+
font.bold=courier 11 bold
|
13
|
+
color.background=#ffffff
|
14
|
+
color.foreground=#000000
|
15
|
+
freebsd::font=courier 12 italic
|
16
|
+
freebsd::font.bold=courier 12 bold
|
17
|
+
win::font={Courier New} 9
|
18
|
+
win::font.bold={Courier New} 9 bold
|
@@ -0,0 +1,880 @@
|
|
1
|
+
#
|
2
|
+
# ae-dir-projects.rb - Arcadia Ruby ide
|
3
|
+
# by Antonio Galeone <antonio-galeone@rubyforge.org>
|
4
|
+
#
|
5
|
+
# §require_dir_ref=../..
|
6
|
+
# §require_omissis=conf/arcadia.init
|
7
|
+
# §require_omissis=lib/a-commons
|
8
|
+
# §require_omissis=lib/a-tkcommons
|
9
|
+
# §require_omissis=lib/a-core
|
10
|
+
|
11
|
+
|
12
|
+
|
13
|
+
class Project
|
14
|
+
attr_accessor :dir
|
15
|
+
attr_accessor :loaded
|
16
|
+
attr_reader :cache_dirs
|
17
|
+
def initialize(_dir)
|
18
|
+
@dir = _dir
|
19
|
+
@loaded = false
|
20
|
+
@cache_dirs = Array.new
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
class DirProjects < ArcadiaExt
|
25
|
+
include Autils
|
26
|
+
attr_reader :htree
|
27
|
+
|
28
|
+
def sync_on
|
29
|
+
@sync = true
|
30
|
+
select_file_without_event(@last_file) if @last_file
|
31
|
+
end
|
32
|
+
|
33
|
+
def sync_off
|
34
|
+
@sync = false
|
35
|
+
end
|
36
|
+
|
37
|
+
def on_before_build(_event)
|
38
|
+
Arcadia.attach_listener(self, BufferRaisedEvent)
|
39
|
+
Arcadia.attach_listener(self, SaveAsBufferEvent)
|
40
|
+
end
|
41
|
+
|
42
|
+
def on_build(_event)
|
43
|
+
@projects = Hash.new
|
44
|
+
@node_parent = Hash.new
|
45
|
+
@num_childrens_of = Hash.new
|
46
|
+
@h_stack = Array.new
|
47
|
+
@opened_folder = Array.new
|
48
|
+
#--- button_box
|
49
|
+
@button_box = Tk::BWidget::ButtonBox.new(self.frame.hinner_frame){
|
50
|
+
homogeneous true
|
51
|
+
spacing 0
|
52
|
+
padx 0
|
53
|
+
pady 0
|
54
|
+
background Arcadia.conf('panel.background')
|
55
|
+
}.place('x'=>32,'height'=> 28)
|
56
|
+
|
57
|
+
@button_box.add(Arcadia.style('toolbarbutton').update({
|
58
|
+
'name'=>'new_proj',
|
59
|
+
'anchor' => 'nw',
|
60
|
+
'command'=>proc{self.do_new_project},
|
61
|
+
'helptext'=>'New dir Project',
|
62
|
+
'image'=> TkPhotoImage.new('dat' => NEW_GIF)})
|
63
|
+
)
|
64
|
+
|
65
|
+
@button_box.add(Arcadia.style('toolbarbutton').update({
|
66
|
+
'name'=>'open_proj',
|
67
|
+
'anchor' => 'nw',
|
68
|
+
'command'=>proc{self.do_open_project},
|
69
|
+
'helptext'=>'Open dir as Project',
|
70
|
+
'image'=> TkPhotoImage.new('dat' => OPEN_GIF)})
|
71
|
+
)
|
72
|
+
#--- button_box
|
73
|
+
|
74
|
+
@cb_sync = TkCheckButton.new(self.frame.hinner_frame, Arcadia.style('checkbox')){
|
75
|
+
text 'Sync'
|
76
|
+
justify 'left'
|
77
|
+
indicatoron 0
|
78
|
+
offrelief 'raised'
|
79
|
+
image TkPhotoImage.new('dat' => SYNCICON20_GIF)
|
80
|
+
#pack('anchor'=>'n')
|
81
|
+
place('x' => 0,'y' => 0,'height' => 26)
|
82
|
+
}
|
83
|
+
|
84
|
+
Tk::BWidget::DynamicHelp::add(@cb_sync,
|
85
|
+
'text'=>'Link open editors with content in the Navigator')
|
86
|
+
|
87
|
+
do_check = proc {
|
88
|
+
if @cb_sync.cget('onvalue')==@cb_sync.cget('variable').value.to_i
|
89
|
+
sync_on
|
90
|
+
else
|
91
|
+
sync_off
|
92
|
+
end
|
93
|
+
}
|
94
|
+
@sync = false
|
95
|
+
@cb_sync.command(do_check)
|
96
|
+
@font = Arcadia.conf('treeitem.font')
|
97
|
+
@font_b = "#{Arcadia.conf('treeitem.font')} bold"
|
98
|
+
@selecting_node = false
|
99
|
+
do_select_item = proc{|_tree, _selected|
|
100
|
+
if File.exist?(node2file(_selected))
|
101
|
+
if File.ftype(node2file(_selected)) == 'file'
|
102
|
+
_sync_val = @sync
|
103
|
+
@sync = false
|
104
|
+
begin
|
105
|
+
Arcadia.process_event(OpenBufferTransientEvent.new(self,'file'=>node2file(_selected)))
|
106
|
+
ensure
|
107
|
+
@sync = _sync_val
|
108
|
+
end
|
109
|
+
elsif !_selected.nil? && @htree.open?(_selected)
|
110
|
+
@htree.close_tree(_selected)
|
111
|
+
elsif !_selected.nil?
|
112
|
+
@htree.open_tree(_selected,false)
|
113
|
+
end
|
114
|
+
else
|
115
|
+
shure_delete_node(_selected)
|
116
|
+
end
|
117
|
+
}
|
118
|
+
|
119
|
+
|
120
|
+
do_open_folder_cmd = proc{|_node| do_open_folder(_node)}
|
121
|
+
do_close_folder_cmd = proc{|_node| do_close_folder(_node)}
|
122
|
+
|
123
|
+
# @htree = Tk::BWidget::Tree.new(self.frame.hinner_frame, Arcadia.style('treepanel')){
|
124
|
+
@htree = Tk::BWidget::Tree.new(self.frame.hinner_frame, Arcadia.style('treepanel')){
|
125
|
+
showlines false
|
126
|
+
deltay 18
|
127
|
+
opencmd do_open_folder_cmd
|
128
|
+
closecmd do_close_folder_cmd
|
129
|
+
selectcommand do_select_item
|
130
|
+
}
|
131
|
+
|
132
|
+
class << @htree
|
133
|
+
def open?(node)
|
134
|
+
bool(self.itemcget(tagid(node), 'open'))
|
135
|
+
end
|
136
|
+
|
137
|
+
def areabind(context, *args)
|
138
|
+
if TkComm._callback_entry?(args[0]) || !block_given?
|
139
|
+
cmd = args.shift
|
140
|
+
else
|
141
|
+
cmd = Proc.new
|
142
|
+
end
|
143
|
+
_bind_for_event_class(Event_for_Items, [path, 'bindArea'],
|
144
|
+
context, cmd, *args)
|
145
|
+
self
|
146
|
+
end
|
147
|
+
|
148
|
+
def areabind_append(context, *args)
|
149
|
+
if TkComm._callback_entry?(args[0]) || !block_given?
|
150
|
+
cmd = args.shift
|
151
|
+
else
|
152
|
+
cmd = Proc.new
|
153
|
+
end
|
154
|
+
_bind_append_for_event_class(Event_for_Items, [path, 'bindArea'],
|
155
|
+
context, cmd, *args)
|
156
|
+
self
|
157
|
+
end
|
158
|
+
|
159
|
+
def areabind_remove(*args)
|
160
|
+
_bind_remove_for_event_class(Event_for_Items, [path, 'bindArea'], *args)
|
161
|
+
self
|
162
|
+
end
|
163
|
+
|
164
|
+
def areabindinfo(*args)
|
165
|
+
_bindinfo_for_event_class(Event_for_Items, [path, 'bindArea'], *args)
|
166
|
+
end
|
167
|
+
end
|
168
|
+
_wrapper = TkScrollWidget.new(@htree)
|
169
|
+
_wrapper.show(0,26)
|
170
|
+
_wrapper.show_v_scroll
|
171
|
+
_wrapper.show_h_scroll
|
172
|
+
self.pop_up_menu_tree
|
173
|
+
@image_kdir = TkPhotoImage.new('dat' => BOOK_GIF)
|
174
|
+
@image_kdir_closed = TkPhotoImage.new('dat' => FOLDER_GIF)
|
175
|
+
@image_kfile_rb = TkPhotoImage.new('dat' => RUBY_DOCUMENT_GIF)
|
176
|
+
@image_kfile = TkPhotoImage.new('dat' => DOCUMENT_GIF)
|
177
|
+
self.load_projects
|
178
|
+
@htree.areabind_append('KeyPress'){|e| key_press(e[1])}
|
179
|
+
end
|
180
|
+
|
181
|
+
def key_press(_e)
|
182
|
+
case _e.keysym
|
183
|
+
when 'F5'
|
184
|
+
_selected = self.selected
|
185
|
+
do_refresh(_selected)
|
186
|
+
end
|
187
|
+
end
|
188
|
+
|
189
|
+
def on_after_build(_event)
|
190
|
+
self.frame.show
|
191
|
+
end
|
192
|
+
|
193
|
+
def node2file(_node)
|
194
|
+
if _node[0..0]=='{' && _node[-1..-1]=='}'
|
195
|
+
return _node[1..-2]
|
196
|
+
else
|
197
|
+
return _node
|
198
|
+
end
|
199
|
+
end
|
200
|
+
|
201
|
+
def file2node(_file)
|
202
|
+
if _file.include?("\s")
|
203
|
+
return "{#{_file}}"
|
204
|
+
else
|
205
|
+
return _file
|
206
|
+
end
|
207
|
+
end
|
208
|
+
|
209
|
+
def do_close_folder(_node, _close=false)
|
210
|
+
@opened_folder.delete(_node)
|
211
|
+
@htree.close_tree(_node) if _close
|
212
|
+
end
|
213
|
+
|
214
|
+
def do_open_folder(_node, _open=false)
|
215
|
+
proj = @projects[_node]
|
216
|
+
if proj && !proj.loaded
|
217
|
+
n = load_tree_from_dir(_node)
|
218
|
+
proj.loaded = true
|
219
|
+
else
|
220
|
+
proj = project_of_node(_node)
|
221
|
+
if !proj.cache_dirs.include?(_node)
|
222
|
+
load_tree_from_dir(_node)
|
223
|
+
proj.cache_dirs << _node
|
224
|
+
end
|
225
|
+
if @num_childrens_of[_node] == 1
|
226
|
+
child = @htree.nodes(_node)[0]
|
227
|
+
if File.ftype(node2file(child)) == 'directory'
|
228
|
+
@htree.open_tree(child,false)
|
229
|
+
@opened_folder << child if !@opened_folder.include?(child)
|
230
|
+
end
|
231
|
+
# elsif @num_childrens_of[_node] > 1
|
232
|
+
# @htree.nodes(_node).each{|child|
|
233
|
+
# if @opened_folder.include?(child)
|
234
|
+
# load_tree_from_dir(child)
|
235
|
+
# do_open_folder(child, true)
|
236
|
+
# end
|
237
|
+
# }
|
238
|
+
end
|
239
|
+
end
|
240
|
+
@opened_folder << _node if !@opened_folder.include?(_node)
|
241
|
+
@htree.open_tree(_node,false) if _open
|
242
|
+
end
|
243
|
+
|
244
|
+
def load_tree_from_dir(_node, _reset = false)
|
245
|
+
@htree.delete(@htree.nodes(_node)) if _reset
|
246
|
+
if @htree.exist?(_node)
|
247
|
+
childrens = Dir.entries(node2file(_node))
|
248
|
+
childrens_dir = Array.new
|
249
|
+
childrens_file = Array.new
|
250
|
+
@num_childrens_of[_node] = childrens.length-2
|
251
|
+
childrens.sort.each{|c|
|
252
|
+
if c != '.' && c != '..'
|
253
|
+
child = File.join(node2file(_node),c)
|
254
|
+
fty = File.ftype(node2file(child))
|
255
|
+
if fty == "file"
|
256
|
+
childrens_file << child
|
257
|
+
#add_node(_node, child, fty)
|
258
|
+
elsif fty == "directory"
|
259
|
+
childrens_dir << child
|
260
|
+
#add_node(_node, child, fty)
|
261
|
+
end
|
262
|
+
end
|
263
|
+
}
|
264
|
+
childrens_dir.each{|child|
|
265
|
+
add_node(_node, child, "directory")
|
266
|
+
}
|
267
|
+
childrens_file.each{|child|
|
268
|
+
add_node(_node, child, "file")
|
269
|
+
}
|
270
|
+
end
|
271
|
+
end
|
272
|
+
|
273
|
+
def pop_up_menu_tree
|
274
|
+
@pop_up_tree = TkMenu.new(
|
275
|
+
:parent=>@htree,
|
276
|
+
:tearoff=>0,
|
277
|
+
:title => 'Menu tree'
|
278
|
+
)
|
279
|
+
@pop_up_tree.configure(Arcadia.style('menu'))
|
280
|
+
#----- new submenu
|
281
|
+
sub_new = TkMenu.new(
|
282
|
+
:parent=>@pop_up,
|
283
|
+
:tearoff=>0,
|
284
|
+
:title => 'New'
|
285
|
+
)
|
286
|
+
sub_new.configure(Arcadia.style('menu'))
|
287
|
+
sub_new.insert('end',
|
288
|
+
:command,
|
289
|
+
:label=>'New dir Project',
|
290
|
+
:hidemargin => false,
|
291
|
+
:command=> proc{do_new_project}
|
292
|
+
)
|
293
|
+
|
294
|
+
sub_new.insert('end',
|
295
|
+
:command,
|
296
|
+
:label=>'New folder',
|
297
|
+
:hidemargin => false,
|
298
|
+
:command=> proc{
|
299
|
+
_selected = self.selected
|
300
|
+
p _selected
|
301
|
+
if _selected
|
302
|
+
do_new_folder(_selected)
|
303
|
+
end
|
304
|
+
}
|
305
|
+
)
|
306
|
+
|
307
|
+
sub_new.insert('end',
|
308
|
+
:command,
|
309
|
+
:label=>'New file',
|
310
|
+
:hidemargin => false,
|
311
|
+
:command=> proc{
|
312
|
+
_selected = self.selected
|
313
|
+
if _selected
|
314
|
+
do_new_file(_selected)
|
315
|
+
end
|
316
|
+
}
|
317
|
+
)
|
318
|
+
|
319
|
+
@pop_up_tree.insert('end',
|
320
|
+
:cascade,
|
321
|
+
:label=>'New',
|
322
|
+
:menu=>sub_new,
|
323
|
+
:hidemargin => false
|
324
|
+
)
|
325
|
+
#-----------------
|
326
|
+
#----- refactor submenu
|
327
|
+
sub_ref = TkMenu.new(
|
328
|
+
:parent=>@pop_up,
|
329
|
+
:tearoff=>0,
|
330
|
+
:title => 'Ref'
|
331
|
+
)
|
332
|
+
sub_ref.configure(Arcadia.style('menu'))
|
333
|
+
sub_ref.insert('end',
|
334
|
+
:command,
|
335
|
+
:label=>'Rename',
|
336
|
+
:hidemargin => false,
|
337
|
+
:command=> proc{
|
338
|
+
_selected = self.selected
|
339
|
+
if _selected
|
340
|
+
do_rename(_selected)
|
341
|
+
end
|
342
|
+
}
|
343
|
+
)
|
344
|
+
sub_ref.insert('end',
|
345
|
+
:command,
|
346
|
+
:label=>'Move',
|
347
|
+
:hidemargin => false,
|
348
|
+
:command=> proc{
|
349
|
+
_selected = self.selected
|
350
|
+
if _selected
|
351
|
+
_idir = File.split(_selected)[0]
|
352
|
+
_dir=Tk.chooseDirectory('initialdir'=>_idir,'mustexist'=>true)
|
353
|
+
do_move(_selected, _dir) if _dir && File.exists?(_dir)
|
354
|
+
end
|
355
|
+
}
|
356
|
+
)
|
357
|
+
@pop_up_tree.insert('end',
|
358
|
+
:cascade,
|
359
|
+
:label=>'Refactor',
|
360
|
+
:menu=>sub_ref,
|
361
|
+
:hidemargin => false
|
362
|
+
)
|
363
|
+
|
364
|
+
|
365
|
+
#-----------------
|
366
|
+
|
367
|
+
@pop_up_tree.insert('end',
|
368
|
+
:command,
|
369
|
+
:label=>'Open dir as Project',
|
370
|
+
:hidemargin => false,
|
371
|
+
:command=> proc{do_open_project}
|
372
|
+
)
|
373
|
+
@pop_up_tree.insert('end',
|
374
|
+
:command,
|
375
|
+
:label=>'Close Project',
|
376
|
+
:hidemargin => false,
|
377
|
+
:command=> proc{
|
378
|
+
_selected = self.selected
|
379
|
+
if _selected
|
380
|
+
#p _selected
|
381
|
+
do_close_project(_selected)
|
382
|
+
end
|
383
|
+
}
|
384
|
+
)
|
385
|
+
@pop_up_tree.insert('end',
|
386
|
+
:command,
|
387
|
+
:label=>'Refresh',
|
388
|
+
:hidemargin => false,
|
389
|
+
:command=> proc{
|
390
|
+
_selected = self.selected
|
391
|
+
do_refresh(_selected)
|
392
|
+
}
|
393
|
+
)
|
394
|
+
@pop_up_tree.insert('end',
|
395
|
+
:command,
|
396
|
+
:label=>'Delete',
|
397
|
+
:hidemargin => false,
|
398
|
+
:command=> proc{
|
399
|
+
_selected = self.selected
|
400
|
+
if _selected
|
401
|
+
do_delete(_selected)
|
402
|
+
end
|
403
|
+
}
|
404
|
+
)
|
405
|
+
@htree.areabind_append("Button-3",
|
406
|
+
proc{|x,y|
|
407
|
+
_x = TkWinfo.pointerx(@htree)
|
408
|
+
_y = TkWinfo.pointery(@htree)
|
409
|
+
@pop_up_tree.popup(_x,_y)
|
410
|
+
},
|
411
|
+
"%x %y")
|
412
|
+
end
|
413
|
+
|
414
|
+
def selected
|
415
|
+
if @htree.selection_get[0].length >0
|
416
|
+
_selected = ""
|
417
|
+
@htree.selection_get[0].each{|_block|
|
418
|
+
_selected = _selected + _block.to_s + "\s"
|
419
|
+
}
|
420
|
+
_selected = _selected.strip
|
421
|
+
else
|
422
|
+
_selected = @htree.selection_get[0]
|
423
|
+
end
|
424
|
+
return _selected
|
425
|
+
end
|
426
|
+
|
427
|
+
def do_new_project(_parent_folder_node=nil)
|
428
|
+
if _parent_folder_node.nil?
|
429
|
+
_parent_folder_node=Tk.chooseDirectory
|
430
|
+
end
|
431
|
+
if _parent_folder_node && File.exists?(node2file(_parent_folder_node)) && File.ftype(node2file(_parent_folder_node)) == 'directory'
|
432
|
+
tmp_node_name = "#{node2file(_parent_folder_node)}#{File::SEPARATOR}_new_project_"
|
433
|
+
tree_parent = _parent_folder_node
|
434
|
+
add_temp_node('root',tmp_node_name,'project')
|
435
|
+
_verify_cmd = proc{|_text|
|
436
|
+
_ret = 0
|
437
|
+
begin
|
438
|
+
new_dir_name = "#{_parent_folder_node}#{File::SEPARATOR}#{_text}"
|
439
|
+
if !File.exists?(new_dir_name)
|
440
|
+
Dir.mkdir(new_dir_name)
|
441
|
+
add_project(new_dir_name)
|
442
|
+
end
|
443
|
+
_ret = 1
|
444
|
+
ensure
|
445
|
+
@htree.delete(file2node(tmp_node_name))
|
446
|
+
end
|
447
|
+
return _ret
|
448
|
+
}
|
449
|
+
# @htree.textbind('KeyPress', proc{|e|
|
450
|
+
# p 'pippo'})
|
451
|
+
@htree.edit(tmp_node_name, tmp_node_name.split(File::SEPARATOR)[-1], _verify_cmd, 1)
|
452
|
+
end
|
453
|
+
|
454
|
+
end
|
455
|
+
|
456
|
+
def do_open_project(_proj_name=nil)
|
457
|
+
if _proj_name.nil?
|
458
|
+
_proj_name=Tk.chooseDirectory
|
459
|
+
add_project(_proj_name) if _proj_name && File.exists?(_proj_name)
|
460
|
+
end
|
461
|
+
end
|
462
|
+
|
463
|
+
def do_close_project(_proj_name)
|
464
|
+
if _proj_name
|
465
|
+
del_project(_proj_name)
|
466
|
+
end
|
467
|
+
end
|
468
|
+
|
469
|
+
def do_new_folder(_parent_folder_node)
|
470
|
+
if File.exists?(node2file(_parent_folder_node)) && File.ftype(node2file(_parent_folder_node)) == 'directory'
|
471
|
+
tmp_node_name = "#{node2file(_parent_folder_node)}#{File::SEPARATOR}_new_folder_"
|
472
|
+
add_temp_node(_parent_folder_node,tmp_node_name,'directory')
|
473
|
+
@htree.open_tree(_parent_folder_node,false)
|
474
|
+
_verify_cmd = proc{|_text|
|
475
|
+
_ret = 0
|
476
|
+
begin
|
477
|
+
new_dir_name = "#{node2file(_parent_folder_node)}#{File::SEPARATOR}#{_text}"
|
478
|
+
if !File.exists?(new_dir_name)
|
479
|
+
Dir.mkdir(new_dir_name)
|
480
|
+
add_node(_parent_folder_node,new_dir_name,'directory')
|
481
|
+
end
|
482
|
+
_ret = 1
|
483
|
+
ensure
|
484
|
+
@htree.delete(file2node(tmp_node_name))
|
485
|
+
shure_select_node(new_dir_name)
|
486
|
+
end
|
487
|
+
return _ret
|
488
|
+
}
|
489
|
+
@htree.edit(tmp_node_name, tmp_node_name.split(File::SEPARATOR)[-1], _verify_cmd, 1)
|
490
|
+
end
|
491
|
+
end
|
492
|
+
|
493
|
+
def do_new_file(_parent_folder_node)
|
494
|
+
if File.exists?(node2file(_parent_folder_node)) && File.ftype(node2file(_parent_folder_node)) == 'directory'
|
495
|
+
tmp_node_name = "#{node2file(_parent_folder_node)}#{File::SEPARATOR}_new_file_"
|
496
|
+
add_temp_node(_parent_folder_node,tmp_node_name,"file")
|
497
|
+
@htree.open_tree(_parent_folder_node,false)
|
498
|
+
_verify_cmd = proc{|_text|
|
499
|
+
_ret = 0
|
500
|
+
begin
|
501
|
+
new_file_name = "#{node2file(_parent_folder_node)}#{File::SEPARATOR}#{_text}"
|
502
|
+
if !File.exists?(new_file_name)
|
503
|
+
File.new(new_file_name, "w").close
|
504
|
+
add_node(_parent_folder_node,new_file_name,"file")
|
505
|
+
#Arcadia.process_event(OpenBufferEvent.new(self,'file'=>_node))
|
506
|
+
end
|
507
|
+
_ret = 1
|
508
|
+
ensure
|
509
|
+
@htree.delete(file2node(tmp_node_name))
|
510
|
+
end
|
511
|
+
return _ret
|
512
|
+
}
|
513
|
+
@htree.edit(tmp_node_name, tmp_node_name.split(File::SEPARATOR)[-1], _verify_cmd, 1)
|
514
|
+
end
|
515
|
+
end
|
516
|
+
|
517
|
+
def do_refresh(_node)
|
518
|
+
if _node.nil?
|
519
|
+
@projects.keys.each{|proj|
|
520
|
+
if !File.exists?(proj)
|
521
|
+
del_project(proj)
|
522
|
+
else
|
523
|
+
do_refresh(proj)
|
524
|
+
end
|
525
|
+
}
|
526
|
+
elsif @htree.exist?(_node)
|
527
|
+
opened = @opened_folder.include?(_node)
|
528
|
+
@htree.close_tree(_node)
|
529
|
+
nodes = @htree.nodes(_node)
|
530
|
+
shure_delete_node(nodes) if nodes
|
531
|
+
proj = @projects[_node]
|
532
|
+
if proj && proj.loaded
|
533
|
+
proj.loaded = false
|
534
|
+
proj.cache_dirs.clear
|
535
|
+
else
|
536
|
+
proj = project_of_node(_node)
|
537
|
+
if proj
|
538
|
+
proj.cache_dirs.delete(_node)
|
539
|
+
end
|
540
|
+
end
|
541
|
+
do_open_folder(_node, opened) if opened
|
542
|
+
nodes.each{|n|
|
543
|
+
if File.exists?(n) && File.ftype(node2file(n)) == 'directory'
|
544
|
+
do_refresh(n)
|
545
|
+
end
|
546
|
+
}
|
547
|
+
end
|
548
|
+
end
|
549
|
+
|
550
|
+
def do_move(_source, _destination, _interactive = true)
|
551
|
+
_msg = "Move #{_source} to #{_destination}?"
|
552
|
+
if !_interactive || Arcadia.dialog(self,'type'=>'yes_no', 'level'=>'warning','title' => 'Confirm move', 'msg'=>_msg)=='yes'
|
553
|
+
if File.exists?(_source)
|
554
|
+
type = File.ftype(node2file(_source))
|
555
|
+
source_basename = _source.split(File::SEPARATOR)[-1]
|
556
|
+
if type == 'directory'
|
557
|
+
des_path = File.join(_destination,source_basename)
|
558
|
+
if File.exists?(des_path) || Dir.mkdir(des_path)
|
559
|
+
entries = Dir.entries(_source)
|
560
|
+
entries.delete('.')
|
561
|
+
entries.delete('..')
|
562
|
+
entries.each{|en|
|
563
|
+
full_en = File.join(_source,en)
|
564
|
+
do_move(full_en, des_path, false)
|
565
|
+
}
|
566
|
+
Dir.delete(_source)
|
567
|
+
if @projects[_source]
|
568
|
+
del_project(_source)
|
569
|
+
end
|
570
|
+
end
|
571
|
+
else
|
572
|
+
new_file = File.join(_destination,source_basename)
|
573
|
+
if File.rename(_source, new_file)
|
574
|
+
# evento
|
575
|
+
Arcadia.process_event(MoveBufferEvent.new(self,'old_file'=>_source,'new_file'=>new_file))
|
576
|
+
end
|
577
|
+
end
|
578
|
+
if _interactive
|
579
|
+
do_refresh(File.split(_source)[0])
|
580
|
+
do_refresh(_destination)
|
581
|
+
end
|
582
|
+
end
|
583
|
+
end
|
584
|
+
end
|
585
|
+
|
586
|
+
def do_rename(_source)
|
587
|
+
old_file_name = node2file(_source)
|
588
|
+
if File.exists?(old_file_name)
|
589
|
+
source_dir = File.split(old_file_name)[0]
|
590
|
+
_verify_cmd = proc{|_text|
|
591
|
+
_ret = 0
|
592
|
+
begin
|
593
|
+
new_file_name = "#{source_dir}#{File::SEPARATOR}#{_text}"
|
594
|
+
#p "new_file_name=#{new_file_name}"
|
595
|
+
#p "old_file_name=#{old_file_name}"
|
596
|
+
if !File.exists?(new_file_name)
|
597
|
+
if File.rename(old_file_name, new_file_name)
|
598
|
+
# evento
|
599
|
+
Arcadia.process_event(MoveBufferEvent.new(self,'old_file'=>old_file_name,'new_file'=>new_file_name))
|
600
|
+
end
|
601
|
+
end
|
602
|
+
_ret = 1
|
603
|
+
ensure
|
604
|
+
shure_delete_node(_source)
|
605
|
+
do_refresh(source_dir)
|
606
|
+
end
|
607
|
+
return _ret
|
608
|
+
}
|
609
|
+
@htree.edit(_source, _source.split(File::SEPARATOR)[-1], _verify_cmd, 1)
|
610
|
+
end
|
611
|
+
end
|
612
|
+
|
613
|
+
def do_delete(_node, _interactive = true)
|
614
|
+
if File.exists?(node2file(_node))
|
615
|
+
type = File.ftype(node2file(_node))
|
616
|
+
if type == 'directory'
|
617
|
+
_msg = "Delete #{_node} directory ?"
|
618
|
+
else
|
619
|
+
_msg = "Delete #{_node} file ?"
|
620
|
+
end
|
621
|
+
if !_interactive || Arcadia.dialog(self,'type'=>'yes_no', 'level'=>'warning','title' => 'Confirm delete', 'msg'=>_msg)=='yes'
|
622
|
+
delete_node = true
|
623
|
+
if type == 'directory'
|
624
|
+
entries = Dir.entries(node2file(_node))
|
625
|
+
entries.delete('.')
|
626
|
+
entries.delete('..')
|
627
|
+
is_project = @htree.exist?(_node) && @htree.parent(_node)=='root'
|
628
|
+
if entries.length > 0
|
629
|
+
_msg2 = "#{_node} isn't empty. Shure to delete all sub entries ?"
|
630
|
+
entries.each{|en|
|
631
|
+
_msg2 = "#{_msg2}\n#{en}"
|
632
|
+
}
|
633
|
+
if !_interactive || Arcadia.dialog(self,'type'=>'yes_no', 'level'=>'warning','title' => 'Confirm deletion', 'msg'=>_msg2)=='yes'
|
634
|
+
entries.each{|en|
|
635
|
+
do_delete(File.join(node2file(_node),en),false)
|
636
|
+
}
|
637
|
+
Dir.delete(node2file(_node))
|
638
|
+
else
|
639
|
+
delete_node = false
|
640
|
+
end
|
641
|
+
else
|
642
|
+
Dir.delete(node2file(_node))
|
643
|
+
end
|
644
|
+
if is_project && delete_node
|
645
|
+
delete_node = false
|
646
|
+
del_project(_node)
|
647
|
+
end
|
648
|
+
else
|
649
|
+
Arcadia.process_event(CloseBufferEvent.new(self,'file'=>node2file(_node)))
|
650
|
+
File.delete(node2file(_node))
|
651
|
+
end
|
652
|
+
shure_delete_node(_node) if delete_node
|
653
|
+
end
|
654
|
+
end
|
655
|
+
end
|
656
|
+
|
657
|
+
def project_of_node(_node)
|
658
|
+
project = _node
|
659
|
+
while !@node_parent[project].nil? && @node_parent[project] != 'root'
|
660
|
+
project = @node_parent[project]
|
661
|
+
end
|
662
|
+
return @projects[project]
|
663
|
+
end
|
664
|
+
|
665
|
+
def add_node(_parent, _node, _kind)
|
666
|
+
return if @htree.exist?(_node)
|
667
|
+
@node_parent[_node] = _parent
|
668
|
+
_name = _node.split(File::SEPARATOR)[-1]
|
669
|
+
_drawcross = 'auto'
|
670
|
+
if _kind == "project" || _kind == "directory"
|
671
|
+
num = Dir.entries(_node).length-2
|
672
|
+
if num > 0
|
673
|
+
_drawcross = 'always'
|
674
|
+
end
|
675
|
+
end
|
676
|
+
@htree.insert('end', _parent ,_node, {
|
677
|
+
'text' => _name ,
|
678
|
+
'helptext' => _node,
|
679
|
+
'drawcross'=>_drawcross,
|
680
|
+
'deltax'=>-1,
|
681
|
+
'image'=> image(_kind, _node)
|
682
|
+
}.update(Arcadia.style('treeitem'))
|
683
|
+
)
|
684
|
+
if _kind == "project" || _kind == "directory"
|
685
|
+
if @opened_folder.include?(_node)
|
686
|
+
do_open_folder(_node, true)
|
687
|
+
end
|
688
|
+
end
|
689
|
+
end
|
690
|
+
|
691
|
+
def add_temp_node(_parent, _node, _kind)
|
692
|
+
return if @htree.exist?(_node)
|
693
|
+
_name = _node.split(File::SEPARATOR)[-1]
|
694
|
+
_drawcross = 'auto'
|
695
|
+
@htree.insert('end', _parent ,_node, {
|
696
|
+
'text' => _name ,
|
697
|
+
'helptext' => _node,
|
698
|
+
'drawcross'=>_drawcross,
|
699
|
+
'deltax'=>-1,
|
700
|
+
'image'=> image(_kind, _node)
|
701
|
+
}.update(Arcadia.style('treeitem'))
|
702
|
+
)
|
703
|
+
end
|
704
|
+
|
705
|
+
def add_project(_dir)
|
706
|
+
add_node('root', _dir, "project")
|
707
|
+
@projects[_dir] = Project.new(_dir)
|
708
|
+
add_project_to_file(_dir)
|
709
|
+
end
|
710
|
+
|
711
|
+
def shure_delete_node(_node)
|
712
|
+
if _node.length>1 || @htree.exist?(_node)
|
713
|
+
_sc = @htree.cget('selectcommand')
|
714
|
+
begin
|
715
|
+
@htree.configure('selectcommand'=>nil)
|
716
|
+
@htree.delete(_node)
|
717
|
+
ensure
|
718
|
+
@htree.configure('selectcommand'=>_sc)
|
719
|
+
end
|
720
|
+
end
|
721
|
+
end
|
722
|
+
|
723
|
+
def shure_select_node(_node)
|
724
|
+
return if @selecting_node
|
725
|
+
@selecting_node = true
|
726
|
+
_proc = @htree.selectcommand
|
727
|
+
@htree.selectcommand(nil)
|
728
|
+
begin
|
729
|
+
@htree.selection_clear
|
730
|
+
@htree.selection_add(_node)
|
731
|
+
@htree.see(_node)
|
732
|
+
ensure
|
733
|
+
@htree.selectcommand(_proc)
|
734
|
+
@selecting_node = false
|
735
|
+
end
|
736
|
+
end
|
737
|
+
|
738
|
+
def del_project(_dir)
|
739
|
+
shure_delete_node(file2node(_dir))
|
740
|
+
@projects.delete(_dir)
|
741
|
+
del_project_from_file(_dir)
|
742
|
+
end
|
743
|
+
|
744
|
+
|
745
|
+
def load_projects
|
746
|
+
f = File::open(projects_file,'r')
|
747
|
+
begin
|
748
|
+
_lines = f.readlines.collect!{| line | line.chomp}
|
749
|
+
ensure
|
750
|
+
f.close unless f.nil?
|
751
|
+
end
|
752
|
+
_lines.each{|_line|
|
753
|
+
if _line.length > 0 && _line[0] != '#' && FileTest.directory?(_line)
|
754
|
+
add_project(_line)
|
755
|
+
end
|
756
|
+
}
|
757
|
+
end
|
758
|
+
|
759
|
+
def add_project_to_file(_project)
|
760
|
+
f = File::open(projects_file,'r')
|
761
|
+
begin
|
762
|
+
_lines = f.readlines.collect!{| line | line.chomp}
|
763
|
+
ensure
|
764
|
+
f.close unless f.nil?
|
765
|
+
end
|
766
|
+
if !_lines.include?(_project)
|
767
|
+
f = File.new(projects_file, "w")
|
768
|
+
begin
|
769
|
+
_lines.each{|_line|
|
770
|
+
f.syswrite(_line+"\n")
|
771
|
+
}
|
772
|
+
f.syswrite(_project+"\n")
|
773
|
+
ensure
|
774
|
+
f.close unless f.nil?
|
775
|
+
end
|
776
|
+
end
|
777
|
+
end
|
778
|
+
|
779
|
+
def del_project_from_file(_project)
|
780
|
+
# p "del_project_from_file =>#{_project}"
|
781
|
+
# p projects_file
|
782
|
+
f = File::open(projects_file,'r')
|
783
|
+
begin
|
784
|
+
_lines = f.readlines.collect!{| line | line.chomp}
|
785
|
+
ensure
|
786
|
+
f.close unless f.nil?
|
787
|
+
end
|
788
|
+
f = File.new(projects_file, "w")
|
789
|
+
begin
|
790
|
+
_lines.each{|_line|
|
791
|
+
if _line != _project
|
792
|
+
p _line
|
793
|
+
f.syswrite(_line+"\n")
|
794
|
+
end
|
795
|
+
}
|
796
|
+
ensure
|
797
|
+
f.close unless f.nil?
|
798
|
+
end
|
799
|
+
end
|
800
|
+
|
801
|
+
|
802
|
+
def projects_file
|
803
|
+
if !defined?(@arcadia_projects_file)
|
804
|
+
@arcadia_projects_file = @arcadia.local_dir+'/'+conf('file.name')
|
805
|
+
if !File.exist?(@arcadia_projects_file)
|
806
|
+
dir,fil =File.split(File.expand_path(@arcadia_projects_file))
|
807
|
+
if !File.exist?(dir)
|
808
|
+
Dir.mkdir(dir)
|
809
|
+
end
|
810
|
+
f = File.new(@arcadia_projects_file, "w+")
|
811
|
+
begin
|
812
|
+
f.syswrite("#Projects conf\n") if f
|
813
|
+
ensure
|
814
|
+
f.close unless f.nil?
|
815
|
+
end
|
816
|
+
end
|
817
|
+
|
818
|
+
end
|
819
|
+
return @arcadia_projects_file
|
820
|
+
end
|
821
|
+
|
822
|
+
|
823
|
+
def select_file_without_event(_file)
|
824
|
+
_file_node_rif = File.expand_path(_file)
|
825
|
+
steps = _file_node_rif.split(File::SEPARATOR)
|
826
|
+
j = 0
|
827
|
+
max = steps.length-1
|
828
|
+
path = ''
|
829
|
+
while j < max
|
830
|
+
if path.strip.length > 0 && path.strip != File::SEPARATOR
|
831
|
+
path = path + File::SEPARATOR
|
832
|
+
end
|
833
|
+
if path.strip.length == 0 && _file_node_rif[0..0] == File::SEPARATOR
|
834
|
+
path = File::SEPARATOR
|
835
|
+
end
|
836
|
+
path = path + steps[j]
|
837
|
+
if @htree.exist?(path)
|
838
|
+
@htree.open_tree(path, false)
|
839
|
+
end
|
840
|
+
j=j+1
|
841
|
+
end
|
842
|
+
if @htree.exist?(_file_node_rif)
|
843
|
+
shure_select_node(_file_node_rif)
|
844
|
+
end
|
845
|
+
end
|
846
|
+
|
847
|
+
def on_buffer_raised(_event)
|
848
|
+
return if _event.file.nil?
|
849
|
+
@last_file = _event.file
|
850
|
+
if @sync
|
851
|
+
select_file_without_event(_event.file)
|
852
|
+
end
|
853
|
+
end
|
854
|
+
|
855
|
+
def on_before_save_as_buffer(_event)
|
856
|
+
_selected = self.selected
|
857
|
+
if _selected
|
858
|
+
tpy = File.ftype(node2file(_selected))
|
859
|
+
if tpy == 'directory'
|
860
|
+
Dir.chdir(_selected)
|
861
|
+
elsif tpy == 'file'
|
862
|
+
Dir.chdir(File.dirname(_selected))
|
863
|
+
end
|
864
|
+
end
|
865
|
+
end
|
866
|
+
|
867
|
+
def image(_kind, _label='.rb')
|
868
|
+
if _kind == 'directory'
|
869
|
+
return @image_kdir
|
870
|
+
elsif _kind == 'project'
|
871
|
+
return @image_kdir_closed
|
872
|
+
elsif _kind == 'file' && _label.include?('.rb')
|
873
|
+
return @image_kfile_rb
|
874
|
+
else
|
875
|
+
return @image_kfile
|
876
|
+
end
|
877
|
+
end
|
878
|
+
|
879
|
+
|
880
|
+
end
|