naksh 0.2.0
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.
- data/AUTHORS +1 -0
- data/COPYING +674 -0
- data/COPYING-DOCS +15 -0
- data/README.md +45 -0
- data/Rakefile +129 -0
- data/TODO +19 -0
- data/bin/naksh +2 -0
- data/data/default.mo +0 -0
- data/data/default.po +16 -0
- data/data/default2.mo +0 -0
- data/data/default2.po +27 -0
- data/data/starter.pot +29 -0
- data/docs/bash_flow.dia +0 -0
- data/docs/gtk_manual.txt +13 -0
- data/docs/master_plan.dia +0 -0
- data/docs/master_plan.png +0 -0
- data/docs/master_plan.svg +74 -0
- data/docs/master_plan.svgz +0 -0
- data/docs/userguide/en/about.xml +42 -0
- data/docs/userguide/en/gnu-fdl-1.2.xml +543 -0
- data/docs/userguide/en/naksh.xml +881 -0
- data/docs/userguide/en/naksh_start_window.png +0 -0
- data/docs/userguide/en/old_naksh.xml +180 -0
- data/docs/userguide/en/userguide-en.omf +37 -0
- data/lib/naksh.rb +165 -0
- data/lib/naksh/buffer.rb +153 -0
- data/lib/naksh/command_handling.rb +117 -0
- data/lib/naksh/commands/bash/README +2 -0
- data/lib/naksh/commands/bash/echo.nkc.rb +50 -0
- data/lib/naksh/commands/bsd.rb +25 -0
- data/lib/naksh/commands/dos.rb +25 -0
- data/lib/naksh/commands/fuse.rb +25 -0
- data/lib/naksh/commands/gnu.rb +30 -0
- data/lib/naksh/commands/gnu/README +2 -0
- data/lib/naksh/commands/gnu/cat.nkc.rb +50 -0
- data/lib/naksh/commands/gnu/cd.nkc.rb +11 -0
- data/lib/naksh/commands/gnu/echo.documentation.json +57 -0
- data/lib/naksh/commands/gnu/echo.documentation.rb +60 -0
- data/lib/naksh/commands/gnu/echo.nkc.rb +52 -0
- data/lib/naksh/commands/gnu/ls.nkc.rb +11 -0
- data/lib/naksh/commands/gnu/mv.nkc.rb +15 -0
- data/lib/naksh/commands/gnu/pwd.nkc.rb +11 -0
- data/lib/naksh/commands/naksh/addpath.nkc.rb +15 -0
- data/lib/naksh/commands/naksh/broken.nkc.rb +10 -0
- data/lib/naksh/commands/naksh/empty.nkc.rb +4 -0
- data/lib/naksh/commands/naksh/exit.nkc.rb +10 -0
- data/lib/naksh/commands/naksh/help.nkc.rb +21 -0
- data/lib/naksh/commands/naksh/man.nkc.rb +8 -0
- data/lib/naksh/commands/ruby.rb +31 -0
- data/lib/naksh/commands/unix.rb +131 -0
- data/lib/naksh/configuration/gconf.rb +51 -0
- data/lib/naksh/configuration/hash.rb +38 -0
- data/lib/naksh/defaults.rb +40 -0
- data/lib/naksh/history.rb +85 -0
- data/lib/naksh/interfaces.rb +59 -0
- data/lib/naksh/interfaces/fox.rb +49 -0
- data/lib/naksh/interfaces/gtk.rb +103 -0
- data/lib/naksh/interfaces/gtk/abtwin.rb +53 -0
- data/lib/naksh/interfaces/gtk/gnomeapp.rb +31 -0
- data/lib/naksh/interfaces/gtk/helpwin.rb +70 -0
- data/lib/naksh/interfaces/gtk/io.rb +94 -0
- data/lib/naksh/interfaces/gtk/mainwin.rb +56 -0
- data/lib/naksh/interfaces/gtk/mainwin/console.rb +121 -0
- data/lib/naksh/interfaces/gtk/mainwin/main_menu.rb +143 -0
- data/lib/naksh/interfaces/gtk/optwin.rb +78 -0
- data/lib/naksh/interfaces/tab.rb +58 -0
- data/lib/naksh/interfaces/wxw.rb +75 -0
- data/lib/naksh/interfaces/wxw/abtwin.rb +38 -0
- data/lib/naksh/interfaces/wxw/helpwin.rb +40 -0
- data/lib/naksh/interfaces/wxw/io.rb +61 -0
- data/lib/naksh/interfaces/wxw/mainwin.rb +42 -0
- data/lib/naksh/interfaces/wxw/mainwin/main_menu.rb +126 -0
- data/lib/naksh/interfaces/wxw/mainwin/sessions.rb +49 -0
- data/lib/naksh/interfaces/wxw/optwin.rb +37 -0
- data/lib/naksh/path_entry.rb +101 -0
- data/lib/naksh/regexp.rb +31 -0
- data/lib/naksh/session.rb +72 -0
- data/lib/naksh/stdlibext.rb +48 -0
- data/lib/naksh/syntax.rb +57 -0
- data/lib/naksh/syntax/bash.rb +219 -0
- data/lib/naksh/syntax/bash/antlr/bottomup.g +24 -0
- data/lib/naksh/syntax/bash/antlr/topdown.g +52 -0
- data/lib/naksh/syntax/bash/dhaka/evaluator.rb +353 -0
- data/lib/naksh/syntax/bash/dhaka/grammar.rb +71 -0
- data/lib/naksh/syntax/bash/dhaka/lexer.rb +52 -0
- data/lib/naksh/syntax/bash/treetop/bash.treetop +17 -0
- data/lib/old/abbr_call.rb +39 -0
- data/lib/old/autocomplete.rb +29 -0
- data/lib/old/command.rb +106 -0
- data/lib/old/command_holder.rb +75 -0
- data/lib/old/commands.rb +24 -0
- data/lib/old/old_executor.rb +95 -0
- data/lib/old/options.rb +31 -0
- data/lib/old/rush.rb +113 -0
- data/lib/old/sortissimo.rb +205 -0
- data/lib/old/systems.rb +25 -0
- data/lib/old/systems/ruby.rb +26 -0
- data/lib/old/un.rb +240 -0
- data/lib/rust/Rakefile +6 -0
- data/lib/rust/commands/builtins.rb +46 -0
- data/lib/rust/commands/builtins/cd.rb +17 -0
- data/lib/rust/commands/builtins/exit.rb +13 -0
- data/lib/rust/commands/builtins/help.rb +14 -0
- data/lib/rust/commands/builtins/parser.rb +13 -0
- data/lib/rust/commands/builtins/pwd.rb +13 -0
- data/lib/rust/commands/builtins/type.rb +13 -0
- data/lib/rust/commands/commands/ls.rb +13 -0
- data/lib/rust/commands/commands/read.rb +13 -0
- data/lib/rust/commands/commands/rm.rb +14 -0
- data/lib/rust/commands/commands/test.rb +20 -0
- data/lib/rust/helpers/array.rb +10 -0
- data/lib/rust/helpers/command_center.rb +78 -0
- data/lib/rust/helpers/constants.rb +58 -0
- data/lib/rust/helpers/io.rb +132 -0
- data/lib/rust/helpers/parser.rb +45 -0
- data/lib/rust/helpers/rush_control.rb +40 -0
- data/lib/rust/helpers/string.rb +50 -0
- data/lib/rust/helpers/trollop.rb +475 -0
- data/lib/rust/parsers/bash.rb +220 -0
- data/lib/rust/parsers/bash/stdlibext.rb +32 -0
- data/lib/rust/parsers/ren.rb +57 -0
- data/lib/rust/rust.rb +75 -0
- data/lib/rust/syntax/command.rb +23 -0
- data/lib/rust/syntax/paths.rb +31 -0
- data/lib/rust/syntax/pipes.rb +148 -0
- data/naksh.gemspec +55 -0
- data/test/naksh/arg_parser.rspec.rb +27 -0
- data/test/naksh/commands/bash/echo.rspec.rb +32 -0
- data/test/naksh/commands/sortlist +127 -0
- data/test/naksh/external_command.rspec.rb +46 -0
- data/test/naksh/send_error.rspec.rb +60 -0
- data/test/naksh/suggest.rspec.rb +38 -0
- data/test/naksh/syntax/bash.rspec.rb +69 -0
- data/test/naksh/syntax/bash/execute.rspec.rb +51 -0
- data/test/naksh/syntax/rspec.rb +63 -0
- data/test/run_rspecs.rb +20 -0
- metadata +217 -0
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
#!/usr/local/bin/ruby
|
|
2
|
+
# 2011 Mahmut Bulut
|
|
3
|
+
|
|
4
|
+
# This file is part of Naksh.
|
|
5
|
+
#
|
|
6
|
+
# Naksh is free software: you can redistribute it and/or modify
|
|
7
|
+
# it under the terms of the GNU General Public License as published by
|
|
8
|
+
# the Free Software Foundation, either version 3 of the License, or
|
|
9
|
+
# (at your option) any later version.
|
|
10
|
+
#
|
|
11
|
+
# Naksh is distributed in the hope that it will be useful,
|
|
12
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
13
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
14
|
+
# GNU General Public License for more details.
|
|
15
|
+
#
|
|
16
|
+
# You should have received a copy of the GNU General Public License
|
|
17
|
+
# along with Naksh. If not, see <http://www.gnu.org/licenses/>.
|
|
18
|
+
|
|
19
|
+
module Naksh
|
|
20
|
+
module Interfaces
|
|
21
|
+
class Tab
|
|
22
|
+
|
|
23
|
+
@@tabs=Array.new
|
|
24
|
+
|
|
25
|
+
def Tab.tabs
|
|
26
|
+
@@tabs
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
def Tab.tabs= new_tab_set
|
|
30
|
+
@@tabs=new_tab_set
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
def initialize session=nil
|
|
35
|
+
|
|
36
|
+
@@tabs<<self
|
|
37
|
+
|
|
38
|
+
@number = @@tabs.length
|
|
39
|
+
@session = session
|
|
40
|
+
|
|
41
|
+
self
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
attr_accessor :session
|
|
45
|
+
attr_reader :number,
|
|
46
|
+
:textbox
|
|
47
|
+
def textbox= new_textbox
|
|
48
|
+
@textbox = new_textbox
|
|
49
|
+
|
|
50
|
+
class<<new_textbox
|
|
51
|
+
TAB = self
|
|
52
|
+
end
|
|
53
|
+
self
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
end
|
|
57
|
+
end
|
|
58
|
+
end
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
#!/usr/local/bin/ruby
|
|
2
|
+
# 2011 Mahmut Bulut
|
|
3
|
+
|
|
4
|
+
# This file is part of Naksh.
|
|
5
|
+
#
|
|
6
|
+
# Naksh is free software: you can redistribute it and/or modify
|
|
7
|
+
# it under the terms of the GNU General Public License as published by
|
|
8
|
+
# the Free Software Foundation, either version 3 of the License, or
|
|
9
|
+
# (at your option) any later version.
|
|
10
|
+
#
|
|
11
|
+
# Naksh is distributed in the hope that it will be useful,
|
|
12
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
13
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
14
|
+
# GNU General Public License for more details.
|
|
15
|
+
#
|
|
16
|
+
# You should have received a copy of the GNU General Public License
|
|
17
|
+
# along with Naksh. If not, see <http://www.gnu.org/licenses/>.
|
|
18
|
+
|
|
19
|
+
require 'wx'
|
|
20
|
+
|
|
21
|
+
# the IDs are not random, they're 2 letters of their messages in lowercase for no reason
|
|
22
|
+
|
|
23
|
+
module Naksh
|
|
24
|
+
module Interfaces
|
|
25
|
+
module Wxw
|
|
26
|
+
|
|
27
|
+
require 'naksh/interfaces/wxw/io.rb'
|
|
28
|
+
|
|
29
|
+
class MainApp<Wx::App
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
def on_init
|
|
33
|
+
require 'naksh/interfaces/wxw/mainwin.rb'
|
|
34
|
+
require 'naksh/interfaces/wxw/helpwin.rb'
|
|
35
|
+
require 'naksh/interfaces/wxw/optwin.rb'
|
|
36
|
+
require 'naksh/interfaces/wxw/abtwin.rb'
|
|
37
|
+
Wxw.preloaded_sessions.each do |i|
|
|
38
|
+
Wxw.new_tab(i,true)
|
|
39
|
+
end
|
|
40
|
+
true
|
|
41
|
+
end
|
|
42
|
+
end
|
|
43
|
+
@app=MainApp.new
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
def Wx.new_prompt
|
|
47
|
+
@console.buffer.text<<"\n"<<Naksh.replace_vars(Naksh.config['/interface/tty/prompt'])
|
|
48
|
+
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
def Wxw.preloaded_sessions
|
|
53
|
+
r=@preloaded_sessions
|
|
54
|
+
@preloaded_sessions=nil
|
|
55
|
+
r
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
#run the Wx GUI with main window
|
|
59
|
+
def Wxw.run(*a)
|
|
60
|
+
@preloaded_sessions=a
|
|
61
|
+
@app.main_loop
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
def Wxw.quit return_value=nil
|
|
66
|
+
@mainwin.destroy
|
|
67
|
+
#MainApp.exit_main_loop
|
|
68
|
+
return_value
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
end
|
|
73
|
+
end
|
|
74
|
+
end
|
|
75
|
+
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
#!/usr/local/bin/ruby
|
|
2
|
+
# 2011 Mahmut Bulut
|
|
3
|
+
|
|
4
|
+
# This file is part of Naksh.
|
|
5
|
+
#
|
|
6
|
+
# Naksh is free software: you can redistribute it and/or modify
|
|
7
|
+
# it under the terms of the GNU General Public License as published by
|
|
8
|
+
# the Free Software Foundation, either version 3 of the License, or
|
|
9
|
+
# (at your option) any later version.
|
|
10
|
+
#
|
|
11
|
+
# Naksh is distributed in the hope that it will be useful,
|
|
12
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
13
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
14
|
+
# GNU General Public License for more details.
|
|
15
|
+
#
|
|
16
|
+
# You should have received a copy of the GNU General Public License
|
|
17
|
+
# along with Naksh. If not, see <http://www.gnu.org/licenses/>.
|
|
18
|
+
|
|
19
|
+
require 'wx'
|
|
20
|
+
require 'wx_sugar'
|
|
21
|
+
|
|
22
|
+
module Naksh
|
|
23
|
+
module Interfaces
|
|
24
|
+
module Wxw
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
@abtwin=nil
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
def Wxw.about
|
|
31
|
+
@abtwin
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
end
|
|
37
|
+
end
|
|
38
|
+
end
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
#!/usr/local/bin/ruby
|
|
2
|
+
# 2011 Mahmut Bulut
|
|
3
|
+
|
|
4
|
+
# This file is part of Naksh.
|
|
5
|
+
#
|
|
6
|
+
# Naksh is free software: you can redistribute it and/or modify
|
|
7
|
+
# it under the terms of the GNU General Public License as published by
|
|
8
|
+
# the Free Software Foundation, either version 3 of the License, or
|
|
9
|
+
# (at your option) any later version.
|
|
10
|
+
#
|
|
11
|
+
# Naksh is distributed in the hope that it will be useful,
|
|
12
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
13
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
14
|
+
# GNU General Public License for more details.
|
|
15
|
+
#
|
|
16
|
+
# You should have received a copy of the GNU General Public License
|
|
17
|
+
# along with Naksh. If not, see <http://www.gnu.org/licenses/>.
|
|
18
|
+
|
|
19
|
+
require 'wx'
|
|
20
|
+
require 'wx_sugar'
|
|
21
|
+
|
|
22
|
+
module Naksh
|
|
23
|
+
module Interfaces
|
|
24
|
+
module Wxw
|
|
25
|
+
|
|
26
|
+
def Wxw.setup_helpwin
|
|
27
|
+
@helpwin=nil
|
|
28
|
+
0
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
def Wxw.help
|
|
33
|
+
@helpwin
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
end
|
|
39
|
+
end
|
|
40
|
+
end
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
#!/usr/local/bin/ruby
|
|
2
|
+
# 2011 Mahmut Bulut
|
|
3
|
+
|
|
4
|
+
# This file is part of Naksh.
|
|
5
|
+
#
|
|
6
|
+
# Naksh is free software: you can redistribute it and/or modify
|
|
7
|
+
# it under the terms of the GNU General Public License as published by
|
|
8
|
+
# the Free Software Foundation, either version 3 of the License, or
|
|
9
|
+
# (at your option) any later version.
|
|
10
|
+
#
|
|
11
|
+
# Naksh is distributed in the hope that it will be useful,
|
|
12
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
13
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
14
|
+
# GNU General Public License for more details.
|
|
15
|
+
#
|
|
16
|
+
# You should have received a copy of the GNU General Public License
|
|
17
|
+
# along with Naksh. If not, see <http://www.gnu.org/licenses/>.
|
|
18
|
+
|
|
19
|
+
require 'wx'
|
|
20
|
+
|
|
21
|
+
module Naksh
|
|
22
|
+
module Interfaces
|
|
23
|
+
module Wxw
|
|
24
|
+
|
|
25
|
+
# duplicate of the current input, modifications are ignored
|
|
26
|
+
# if the user pressed `return' right now, this is what would be
|
|
27
|
+
# sent to syntax.execute
|
|
28
|
+
def Wxw.in
|
|
29
|
+
@in
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
def Wxw.in= str
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
@out=Object.new
|
|
39
|
+
class<<@out
|
|
40
|
+
def print(*a)
|
|
41
|
+
$stderr.puts 'printing to output not yet implemented'
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
end
|
|
46
|
+
end
|
|
47
|
+
@err=@out
|
|
48
|
+
def Wxw.out
|
|
49
|
+
@out
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
def Wxw.err
|
|
54
|
+
@err
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
end
|
|
60
|
+
end
|
|
61
|
+
end
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
#!/usr/local/bin/ruby
|
|
2
|
+
# 2011 Mahmut Bulut
|
|
3
|
+
|
|
4
|
+
# This file is part of Naksh.
|
|
5
|
+
#
|
|
6
|
+
# Naksh is free software: you can redistribute it and/or modify
|
|
7
|
+
# it under the terms of the GNU General Public License as published by
|
|
8
|
+
# the Free Software Foundation, either version 3 of the License, or
|
|
9
|
+
# (at your option) any later version.
|
|
10
|
+
#
|
|
11
|
+
# Naksh is distributed in the hope that it will be useful,
|
|
12
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
13
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
14
|
+
# GNU General Public License for more details.
|
|
15
|
+
#
|
|
16
|
+
# You should have received a copy of the GNU General Public License
|
|
17
|
+
# along with Naksh. If not, see <http://www.gnu.org/licenses/>.
|
|
18
|
+
|
|
19
|
+
require 'wx'
|
|
20
|
+
|
|
21
|
+
module Naksh
|
|
22
|
+
module Interfaces
|
|
23
|
+
module Wxw
|
|
24
|
+
|
|
25
|
+
@mainwin=Wx::Frame.new(nil,:title=>_('Naksh Terminal Emulator'),:name=>'mainwin')
|
|
26
|
+
@mainwin.create_status_bar
|
|
27
|
+
require 'naksh/interfaces/wxw/mainwin/main_menu.rb'
|
|
28
|
+
@notebook=Wx::Notebook.new(@mainwin,28258,:name=>'main_notebook')
|
|
29
|
+
require 'naksh/interfaces/wxw/mainwin/sessions.rb'
|
|
30
|
+
@mainwin.centre
|
|
31
|
+
@mainwin.show
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
#the principal Terminal Emulator window
|
|
36
|
+
def Wxw.main
|
|
37
|
+
@mainwin
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
end
|
|
41
|
+
end
|
|
42
|
+
end
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
#!/usr/local/bin/ruby
|
|
2
|
+
# 2011 Mahmut Bulut
|
|
3
|
+
|
|
4
|
+
# This file is part of Naksh.
|
|
5
|
+
#
|
|
6
|
+
# Naksh is free software: you can redistribute it and/or modify
|
|
7
|
+
# it under the terms of the GNU General Public License as published by
|
|
8
|
+
# the Free Software Foundation, either version 3 of the License, or
|
|
9
|
+
# (at your option) any later version.
|
|
10
|
+
#
|
|
11
|
+
# Naksh is distributed in the hope that it will be useful,
|
|
12
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
13
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
14
|
+
# GNU General Public License for more details.
|
|
15
|
+
#
|
|
16
|
+
# You should have received a copy of the GNU General Public License
|
|
17
|
+
# along with Naksh. If not, see <http://www.gnu.org/licenses/>.
|
|
18
|
+
|
|
19
|
+
require 'wx'
|
|
20
|
+
|
|
21
|
+
module Naksh
|
|
22
|
+
module Interfaces
|
|
23
|
+
module Wxw
|
|
24
|
+
menus=Wx::MenuBar.new
|
|
25
|
+
file_menu=Wx::Menu.new
|
|
26
|
+
file_menu.append_item Wx::MenuItem.new(file_menu,28261,_('&New Session'),_('Open a new tab. This starts a new (separate) shell instance'),Wx::ITEM_NORMAL,nil)
|
|
27
|
+
@mainwin.evt_menu 28261 do |*a|
|
|
28
|
+
Wxw.new_tab(Naksh::Session.new)
|
|
29
|
+
end
|
|
30
|
+
file_menu.append_item Wx::MenuItem.new(file_menu,26223,_('&Fork Session'),_('Open a new tab while keeping history and variables from the current tab'),Wx::ITEM_NORMAL,nil)
|
|
31
|
+
@mainwin.evt_menu 26223 do |*a|
|
|
32
|
+
Wxw.new_tab(p(@notebook.get_current_page)::TAB.session.fork)
|
|
33
|
+
end
|
|
34
|
+
file_menu.append_item Wx::MenuItem.new(file_menu,25452,_('&Close Tab'),_('Close the current tab'),Wx::ITEM_NORMAL,nil)
|
|
35
|
+
@mainwin.evt_menu 25452 do |*a|
|
|
36
|
+
@notebook.remove_page @notebook.get_current_page
|
|
37
|
+
end
|
|
38
|
+
file_menu.append_item Wx::MenuItem.new(file_menu,28528,_('&Open Session'),_('Restart the shell and load history and stored variables from a file'),Wx::ITEM_NORMAL,nil)
|
|
39
|
+
@mainwin.evt_menu 28528 do |*a|
|
|
40
|
+
$stderr.puts 'session load is not yet implemented'
|
|
41
|
+
end
|
|
42
|
+
file_menu.append_item Wx::MenuItem.new(file_menu,29558,_('&Save Session As'),_('Store history and variables to a file'),Wx::ITEM_NORMAL,nil)
|
|
43
|
+
@mainwin.evt_menu 29558 do |*a|
|
|
44
|
+
$stderr.puts 'session save is not yet implemented'
|
|
45
|
+
end
|
|
46
|
+
file_menu.append_item Wx::MenuItem.new(file_menu,Wx::ID_SEPARATOR,'','',Wx::ITEM_SEPARATOR,nil)
|
|
47
|
+
file_menu.append_item Wx::MenuItem.new(file_menu,29810,_('Close to &Tray'),_('Close the application window, leaving an icon in the system tray'),Wx::ITEM_NORMAL,nil)
|
|
48
|
+
@mainwin.evt_menu 29810 do |*a|
|
|
49
|
+
$stderr.puts 'closing to tray is not yet implemented'
|
|
50
|
+
end
|
|
51
|
+
file_menu.append_item Wx::MenuItem.new(file_menu,29045,_('&Quit'),_('Close Naksh completely'),Wx::ITEM_NORMAL,nil)
|
|
52
|
+
@mainwin.evt_menu 29045 do |*a|
|
|
53
|
+
Naksh.quit
|
|
54
|
+
end
|
|
55
|
+
menus.append file_menu,'&File'
|
|
56
|
+
edit_menu=Wx::Menu.new
|
|
57
|
+
edit_menu.append_item Wx::MenuItem.new(edit_menu,25461,_('Cu&t'),_('Cut the selection'),Wx::ITEM_NORMAL,nil)
|
|
58
|
+
@mainwin.evt_menu 25461 do |*a|
|
|
59
|
+
$stderr.puts 'text editing functions are not yet implemented'
|
|
60
|
+
end
|
|
61
|
+
edit_menu.append_item Wx::MenuItem.new(edit_menu,25456,_('&Copy'),_('Copy the selection'),Wx::ITEM_NORMAL,nil)
|
|
62
|
+
@mainwin.evt_menu 25456 do |*a|
|
|
63
|
+
$stderr.puts 'text editing functions are not yet implemented'
|
|
64
|
+
end
|
|
65
|
+
edit_menu.append_item Wx::MenuItem.new(edit_menu,28769,_('&Paste'),_('Paste the clipboard'),Wx::ITEM_NORMAL,nil)
|
|
66
|
+
@mainwin.evt_menu 28769 do |*a|
|
|
67
|
+
$stderr.puts 'text editing functions are not yet implemented'
|
|
68
|
+
end
|
|
69
|
+
edit_menu.append_item Wx::MenuItem.new(edit_menu,25708,_('&Delete'),_('Delete the selected text'),Wx::ITEM_NORMAL,nil)
|
|
70
|
+
@mainwin.evt_menu 25708 do |*a|
|
|
71
|
+
$stderr.puts 'text editing functions are not yet implemented'
|
|
72
|
+
end
|
|
73
|
+
edit_menu.append_item Wx::MenuItem.new(edit_menu,29537,_('Select &All'),_('Select all text in the current tab'),Wx::ITEM_NORMAL,nil)
|
|
74
|
+
@mainwin.evt_menu 29537 do |*a|
|
|
75
|
+
$stderr.puts 'text editing functions are not yet implemented'
|
|
76
|
+
end
|
|
77
|
+
edit_menu.append_item Wx::MenuItem.new(edit_menu,Wx::ID_SEPARATOR,'','',Wx::ITEM_SEPARATOR,nil)
|
|
78
|
+
edit_menu.append_item Wx::MenuItem.new(edit_menu,28786,_('&Preferences'),_('Configure the application'),Wx::ITEM_NORMAL,nil)
|
|
79
|
+
@mainwin.evt_menu 28786 do |*a|
|
|
80
|
+
Naksh.interface.options.show
|
|
81
|
+
end
|
|
82
|
+
menus.append edit_menu,'&Edit'
|
|
83
|
+
view_menu=Wx::Menu.new
|
|
84
|
+
view_menu.append_item Wx::MenuItem.new(view_menu,29556,_('Status Bar'),_('Show or hide the status bar in the current window'),Wx::ITEM_NORMAL,nil)
|
|
85
|
+
@mainwin.evt_menu 29556 do |*a|
|
|
86
|
+
#Naksh.config['/interface/gui/statusbar']=????
|
|
87
|
+
$stderr.puts 'GUI meddling not yet implemented'
|
|
88
|
+
end
|
|
89
|
+
view_menu.append_item Wx::MenuItem.new(view_menu,Wx::ID_SEPARATOR,'','',Wx::ITEM_SEPARATOR,nil)
|
|
90
|
+
tab_bar_opt_menu=Wx::Menu.new
|
|
91
|
+
tab_bar_opt_menu.append_item Wx::MenuItem.new(tab_bar_opt_menu,29544,_('Always Show'),_('Always display the tab bar'),Wx::ITEM_NORMAL,nil)
|
|
92
|
+
@mainwin.evt_menu 29544 do |*a|
|
|
93
|
+
Naksh.config['/interface/gui/tabbar']='always'
|
|
94
|
+
$stderr.puts 'GUI meddling not yet implemented'
|
|
95
|
+
end
|
|
96
|
+
tab_bar_opt_menu.append_item Wx::MenuItem.new(tab_bar_opt_menu,26729,_('Always Hide'),_('Never display the tab bar'),Wx::ITEM_NORMAL,nil)
|
|
97
|
+
@mainwin.evt_menu 26729 do |*a|
|
|
98
|
+
Naksh.config['/interface/gui/tabbar']='never'
|
|
99
|
+
$stderr.puts 'GUI meddling not yet implemented'
|
|
100
|
+
end
|
|
101
|
+
tab_bar_opt_menu.append_item Wx::MenuItem.new(tab_bar_opt_menu,29549,_('Sometimes Show'),_('Display the tab bar only when multiple tabs are open'),Wx::ITEM_NORMAL,nil)
|
|
102
|
+
@mainwin.evt_menu 29549 do |*a|
|
|
103
|
+
Naksh.config['/interface/gui/tabbar']='sometimes'
|
|
104
|
+
$stderr.puts 'GUI meddling not yet implemented'
|
|
105
|
+
end
|
|
106
|
+
view_menu.append_item Wx::MenuItem.new(view_menu,29794,_('Tab Bar'),'',Wx::ITEM_NORMAL,tab_bar_opt_menu)
|
|
107
|
+
menus.append view_menu,'&View'
|
|
108
|
+
search_menu=Wx::Menu.new
|
|
109
|
+
search_menu.append_item Wx::MenuItem.new(search_menu,26217,_('&Find'),_('Search for text'),Wx::ITEM_NORMAL,nil)
|
|
110
|
+
search_menu.append_item Wx::MenuItem.new(search_menu,27753,_('Go To &Line'),_('Go to a specific line'),Wx::ITEM_NORMAL,nil)
|
|
111
|
+
menus.append search_menu,'&Search'
|
|
112
|
+
help_menu=Wx::Menu.new
|
|
113
|
+
help_menu.append_item Wx::MenuItem.new(help_menu,26725,_('&Contents'),_('Open the Naksh Manual'),Wx::ITEM_NORMAL,nil)
|
|
114
|
+
@mainwin.evt_menu 26725 do |*a|
|
|
115
|
+
Naksh.interface.help.show
|
|
116
|
+
end
|
|
117
|
+
help_menu.append_item Wx::MenuItem.new(help_menu,24930,_('&About'),_('About this application'),Wx::ITEM_NORMAL,nil)
|
|
118
|
+
@mainwin.evt_menu 24930 do |*a|
|
|
119
|
+
Naksh.interface.about.show
|
|
120
|
+
end
|
|
121
|
+
menus.append help_menu,'&Help'
|
|
122
|
+
@mainwin.set_menu_bar menus
|
|
123
|
+
|
|
124
|
+
end
|
|
125
|
+
end
|
|
126
|
+
end
|