From nochoice at xs4all.nl Thu Sep 1 10:46:29 2005 From: nochoice at xs4all.nl (Jonathan Maasland) Date: Thu Sep 1 08:39:14 2005 Subject: [FR-devel] Configurator renderer (prefs dialog) In-Reply-To: <4316161E.9090907@moldus.org> References: <431505D8.7010202@xs4all.nl> <43155409.1070301@moldus.org> <43157DC7.3060807@xs4all.nl> <4315836E.9080908@moldus.org> <4315FD0B.2060705@xs4all.nl> <4316161E.9090907@moldus.org> Message-ID: <43171445.7080004@xs4all.nl> Skipped content of type multipart/alternative-------------- next part -------------- Index: plugins/rubyide_tools_fox_configurator/fox_configurator.rb =================================================================== RCS file: /var/cvs/freeride/freeride/plugins/rubyide_tools_fox_configurator/fox_configurator.rb,v retrieving revision 1.6 diff -b -u -r1.6 fox_configurator.rb --- plugins/rubyide_tools_fox_configurator/fox_configurator.rb 20 Feb 2005 08:04:01 -0000 1.6 +++ plugins/rubyide_tools_fox_configurator/fox_configurator.rb 1 Sep 2005 12:08:28 -0000 @@ -176,7 +176,7 @@ LAYOUT_BOTTOM|LAYOUT_FILL_X|PACK_UNIFORM_WIDTH) apply_btn = FXButton.new(btn_box, "&Apply", nil, self, 0, LAYOUT_RIGHT|FRAME_RAISED|FRAME_THICK, 0, 0, 0, 0, 20, 20) - FXButton.new(btn_box, "&Cancel", nil, self, FXDialogBox::ID_CANCEL, + cancel_btn = FXButton.new(btn_box, "&Cancel", nil, self, 0, LAYOUT_RIGHT|FRAME_RAISED|FRAME_THICK, 0, 0, 0, 0, 20, 20) ok_btn = FXButton.new(btn_box, "&OK", nil, self, 0, LAYOUT_RIGHT|FRAME_RAISED|FRAME_THICK, 0, 0, 0, 0, 20, 20) @@ -192,6 +192,12 @@ config_slot = @config_tree.getItemData(item) config_slot.manager.set_config_properties(config_slot) end + @current_cfg_slot = nil + self.handle(self,MKUINT(FXDialogBox::ID_CANCEL,SEL_COMMAND),nil) + end + + cancel_btn.connect(SEL_COMMAND) do |sender, sel, scn| + @current_cfg_slot = nil self.handle(self,MKUINT(FXDialogBox::ID_CANCEL,SEL_COMMAND),nil) end self.create @@ -231,10 +237,16 @@ end def on_selected(sender,sel,item) - config_slot = @config_tree.getItemData(item) - @config_title.text = config_slot.attr_description - @config_frame.current = config_slot.attr_pane_idx - config_slot.manager.get_config_properties(config_slot) + if @current_cfg_slot and @current_cfg_slot.manager.modified?(@current_cfg_slot) + if @plugin["/system/ui/commands/App/Services/YesNoDialog/"].invoke( + @plugin, "Save changes?", "Would you like to save your changes") == "yes" + @current_cfg_slot.manager.set_config_properties(@current_cfg_slot) + end + end + @current_cfg_slot = @config_tree.getItemData(item) + @config_title.text = @current_cfg_slot.attr_description + @config_frame.current = @current_cfg_slot.attr_pane_idx + @current_cfg_slot.manager.get_config_properties(@current_cfg_slot) end ## Index: plugins/rubyide_fox_gui/editpane_configurator.rb =================================================================== RCS file: /var/cvs/freeride/freeride/plugins/rubyide_fox_gui/editpane_configurator.rb,v retrieving revision 1.12 diff -b -u -r1.12 editpane_configurator.rb --- plugins/rubyide_fox_gui/editpane_configurator.rb 10 Mar 2005 13:21:21 -0000 1.12 +++ plugins/rubyide_fox_gui/editpane_configurator.rb 1 Sep 2005 12:08:30 -0000 @@ -94,13 +94,7 @@ # init all default settings for preferences init_all_config - # Create a new Style store for Ruby where user specific settings - # will be saved - @styles = StyleStore.new('RubyStyles') - STYLES.each_key { |style_name| - prop_name = 'style_'+style_name.downcase - @styles[style_name] = @ep_plugin.properties[prop_name].dup - } + init_styles @styles_changed = [] # create the config pane UI. Parent it to the main window for now @@ -251,18 +245,32 @@ pcfg['colors&fonts'].attr_description = 'Settings Editor Colorizing and Fonts' pcfg['colors&fonts'].attr_frame = color_pane + reload_styles - # and now apply the color settings to the scintilla widget in the dialog box - # Make sure to setup the default font first - _set_controller_style('DEFAULT',@styles['DEFAULT']) - @controller.set_style_clear_all - @styles.each { |style| _set_controller_style(style.name, style) } - @styles_changed = [] - - # mimic a click on the first style in the lit to get the - # Ui updated - onCmdShowStyle(@style_lb,nil,nil) + end # of initialize + def modified?(config_slot) + case config_slot.name + when 'Editor' + return ( + @ep_plugin.properties['cursor_blinking'] != @cb.check or + @ep_plugin.properties['cursor_blinking_period'] != @cbms.text.to_i or + @ep_plugin.properties['cursor_fore'] != @cfore.rgba or + @ep_plugin.properties['cursor_width'] != @cw.value or + @ep_plugin.properties['line_wraping'] != @lw.check or + @ep_plugin.properties['code_folding'] != @cf.check or + @ep_plugin.properties['line_numbers'] != @ln.check or + @ep_plugin.properties['indent_guides'] != @ig.check or + @ep_plugin.properties['eol'] != @eol.check or + @ep_plugin.properties['white_space'] != @ws.check or + @ep_plugin.properties['open_dir_policy'] != @odp.getCurrentItem + ) + when 'colors&fonts' + return ( + @ep_plugin.properties['fxdefault_fontdesc'] != @fxdefault_fontdesc or + @styles_changed.size > 0 + ) + end end ## @@ -398,6 +406,15 @@ end + # Create a new Style store for Ruby where user specific settings will be saved + def init_styles + @styles = StyleStore.new('RubyStyles') + STYLES.each_key { |style_name| + prop_name = 'style_'+style_name.downcase + @styles[style_name] = @ep_plugin.properties[prop_name].dup + } + end + ## # get_properties is a method called by the configurator plugin # whenever the configuration panel of a given plugin is dislayed @@ -426,6 +443,8 @@ when 'colors&fonts' @ftn.text = @ep_plugin.properties['style_default'].font.gsub(/&/,'&&') @fts.text = @ep_plugin.properties['style_default'].size.to_s + init_styles + reload_styles else # should never be there! @@ -436,6 +455,18 @@ private + # apply the color settings to the scintilla widget in the dialog box + # Make sure to setup the default font first + def reload_styles + _set_controller_style('DEFAULT',@styles['DEFAULT']) + @controller.set_style_clear_all + @styles.each { |style| _set_controller_style(style.name, style) } + @styles_changed = [] + # mimic a click on the first style in the list to get the + # Ui updated + onCmdShowStyle(@style_lb,nil,nil) + end + def _set_controller_style(style_name,style) @controller.set_style(style_name, style) @styles_changed << style_name Index: plugins/rubyide_tools_fox_debugger/fox_debugger_configurator.rb =================================================================== RCS file: /var/cvs/freeride/freeride/plugins/rubyide_tools_fox_debugger/fox_debugger_configurator.rb,v retrieving revision 1.6 diff -b -u -r1.6 fox_debugger_configurator.rb --- plugins/rubyide_tools_fox_debugger/fox_debugger_configurator.rb 20 Feb 2005 08:04:01 -0000 1.6 +++ plugins/rubyide_tools_fox_debugger/fox_debugger_configurator.rb 1 Sep 2005 12:08:30 -0000 @@ -125,6 +125,17 @@ @dbg_plugin.log_info << "Getting Debugger/Run properties" end + ## + # + def modified?(config_slot) + return (@dbg_plugin.properties['path_to_ruby'] != @ptr.text or + @dbg_plugin.properties['cmd_line_options'] != @clo.text or + @dbg_plugin.properties['working_dir'] != @wd.text or + @dbg_plugin.properties['config_before_running'] != @dbr.check or + @dbg_plugin.properties['save_before_running'] != @sbr.check or + @dbg_plugin.properties['run_in_terminal'] != @rit.check) + end + end #Class ConfiguratorRenderer end From laurent at moldus.org Thu Sep 1 09:36:37 2005 From: laurent at moldus.org (Laurent Julliard) Date: Thu Sep 1 09:29:54 2005 Subject: [FR-devel] Configurator renderer (prefs dialog) In-Reply-To: <43171445.7080004@xs4all.nl> References: <431505D8.7010202@xs4all.nl> <43155409.1070301@moldus.org> <43157DC7.3060807@xs4all.nl> <4315836E.9080908@moldus.org> <4315FD0B.2060705@xs4all.nl> <4316161E.9090907@moldus.org> <43171445.7080004@xs4all.nl> Message-ID: <431703E5.6010201@moldus.org> Jonathan Maasland wrote: > Well I fixed the configurator and the color/fonts bug. Patch is attached. > > I added a modified? method to the two configurators we have at the > moment, editpane_configurator.rb and fox_debugger_configurator.rb. > To fox_configurator.rb I added the code to check if modified? is true > and ask the user to save. > > Also I moved some code around in editpane_configurator.rb, creating two > new methods: init_styles and reload_styles. Finishing touch was calling > the methods in the right places. > > I believe I've tested the patch fully, so I'm (as always) curious to > your reaction. > > Thanks > Jonathan > Works really great! The only thing I'm wondering is what we should do when one modifies a panel and then click on Cancel. Right now FreeRIDE doesn't ask for any confirmation as opposed to what happens when you switch from one panel to another... Should we also ask for confirmation when clicking on Cancel while viewing a modified panel? Laurent From nochoice at xs4all.nl Thu Sep 1 13:13:01 2005 From: nochoice at xs4all.nl (Jonathan Maasland) Date: Thu Sep 1 11:05:39 2005 Subject: [FR-devel] Configurator renderer (prefs dialog) In-Reply-To: <431703E5.6010201@moldus.org> References: <431505D8.7010202@xs4all.nl> <43155409.1070301@moldus.org> <43157DC7.3060807@xs4all.nl> <4315836E.9080908@moldus.org> <4315FD0B.2060705@xs4all.nl> <4316161E.9090907@moldus.org> <43171445.7080004@xs4all.nl> <431703E5.6010201@moldus.org> Message-ID: <4317369D.9030409@xs4all.nl> Laurent Julliard wrote: > Works really great! The only thing I'm wondering is what we should do > when one modifies a panel and then click on Cancel. Right now > FreeRIDE doesn't ask for any confirmation as opposed to what happens > when you switch from one panel to another... Should we also ask for > confirmation when clicking on Cancel while viewing a modified panel? > > Laurent > _______________________________________________ > Freeride-devel mailing list > Freeride-devel@rubyforge.org > http://rubyforge.org/mailman/listinfo/freeride-devel > > imho I don't think we should ask for confirmation, it's a Cancel button, that's what it does, it cancels the dialog. just my 2 cents Thanks for looking at the patch so fast. Jonathan From laurent at moldus.org Fri Sep 2 04:49:06 2005 From: laurent at moldus.org (Laurent Julliard) Date: Fri Sep 2 04:42:19 2005 Subject: [FR-devel] Configurator renderer (prefs dialog) In-Reply-To: <4317369D.9030409@xs4all.nl> References: <431505D8.7010202@xs4all.nl> <43155409.1070301@moldus.org> <43157DC7.3060807@xs4all.nl> <4315836E.9080908@moldus.org> <4315FD0B.2060705@xs4all.nl> <4316161E.9090907@moldus.org> <43171445.7080004@xs4all.nl> <431703E5.6010201@moldus.org> <4317369D.9030409@xs4all.nl> Message-ID: <43181202.6070908@moldus.org> Jonathan Maasland wrote: > > imho I don't think we should ask for confirmation, it's a Cancel button, > that's what it does, it cancels the dialog. > just my 2 cents > > Thanks for looking at the patch so fast. > > Jonathan Ok, let's keep it that way. Patch has been applied and committed to CVS. laurent From wxruby at qualitycode.com Sat Sep 3 15:46:32 2005 From: wxruby at qualitycode.com (Kevin Smith) Date: Sat Sep 3 15:40:09 2005 Subject: [FR-devel] Configurator renderer (prefs dialog) In-Reply-To: <43181202.6070908@moldus.org> References: <431505D8.7010202@xs4all.nl> <43155409.1070301@moldus.org> <43157DC7.3060807@xs4all.nl> <4315836E.9080908@moldus.org> <4315FD0B.2060705@xs4all.nl> <4316161E.9090907@moldus.org> <43171445.7080004@xs4all.nl> <431703E5.6010201@moldus.org> <4317369D.9030409@xs4all.nl> <43181202.6070908@moldus.org> Message-ID: <4319FD98.8080103@qualitycode.com> Laurent Julliard wrote: > Jonathan Maasland wrote: > >> >> imho I don't think we should ask for confirmation, it's a Cancel button, >> that's what it does, it cancels the dialog. >> just my 2 cents >> >> Thanks for looking at the patch so fast. >> >> Jonathan > > > Ok, let's keep it that way. Patch has been applied and committed to CVS. Sorry I didn't reply to the earlier message. My undestanding of the typical tab-config dialog is that switching tabs implies save, not cancel. If I understood correctly, you're doing the opposite for FR. I think your decision not to confirm for the Cancel button is good. Kevin From nochoice at xs4all.nl Sat Sep 3 19:25:59 2005 From: nochoice at xs4all.nl (Jonathan Maasland) Date: Sat Sep 3 17:18:25 2005 Subject: [FR-devel] Configurator renderer (prefs dialog) In-Reply-To: <4319FD98.8080103@qualitycode.com> References: <431505D8.7010202@xs4all.nl> <43155409.1070301@moldus.org> <43157DC7.3060807@xs4all.nl> <4315836E.9080908@moldus.org> <4315FD0B.2060705@xs4all.nl> <4316161E.9090907@moldus.org> <43171445.7080004@xs4all.nl> <431703E5.6010201@moldus.org> <4317369D.9030409@xs4all.nl> <43181202.6070908@moldus.org> <4319FD98.8080103@qualitycode.com> Message-ID: <431A3107.50501@xs4all.nl> Kevin Smith wrote: > Sorry I didn't reply to the earlier message. My undestanding of the > typical tab-config dialog is that switching tabs implies save, not > cancel. If I understood correctly, you're doing the opposite for FR. That used to be the case. The patch causes FR to ask the user if he wants to save changes (if any were made) when the user switches tabs. Jonathan From wxruby at qualitycode.com Sat Sep 3 17:36:56 2005 From: wxruby at qualitycode.com (Kevin Smith) Date: Sat Sep 3 17:30:29 2005 Subject: [FR-devel] Configurator renderer (prefs dialog) In-Reply-To: <431A3107.50501@xs4all.nl> References: <431505D8.7010202@xs4all.nl> <43155409.1070301@moldus.org> <43157DC7.3060807@xs4all.nl> <4315836E.9080908@moldus.org> <4315FD0B.2060705@xs4all.nl> <4316161E.9090907@moldus.org> <43171445.7080004@xs4all.nl> <431703E5.6010201@moldus.org> <4317369D.9030409@xs4all.nl> <43181202.6070908@moldus.org> <4319FD98.8080103@qualitycode.com> <431A3107.50501@xs4all.nl> Message-ID: <431A1778.1050006@qualitycode.com> Jonathan Maasland wrote: > That used to be the case. The patch causes FR to ask the user if he > wants to save changes (if any were made) when the user switches tabs. Ok. Most tab config dialogs silently save when the users switches tabs. I'm not sure which behavior is "better", but silence definitely seems to be more standard. Thanks for the clarification. Kevin From nochoice at xs4all.nl Sun Sep 4 07:48:33 2005 From: nochoice at xs4all.nl (Jonathan Maasland) Date: Sun Sep 4 05:40:51 2005 Subject: [FR-devel] Multiple interpreters patch Message-ID: <431ADF11.8000304@xs4all.nl> First off, sorry for the long email but I thought it best to be thorough. I finished building a sub-panel for the Debugger/Run configurator. The new pane allows you to configure multiple Ruby interpreters. At the moment only the interpreter named 'default' is used, however when the time is there for run-targets support (that is when I've finished building project-support) having multiple interpreters configured could be useful. I haven't been able to test this code on Windows so it might be broken there. (I hope to be able to test this next week) The changes I've made to existing code were quite small. In rubyide_tools_fox_debugger/fox_debugger_configurator.rb I disabled the path_to_ruby textfield, getting and setting this value and the appropriate property now happens in the new subpanel when configuring 'default'. In rubyide_tools_fox_script_runner/script_runner.rb and rubyide_tools_debugger/debugger.rb: Both files declare the method find_ruby. I just about copied the method to the new subpanel. When the all_plugins_loaded state is reached and no 'default' is configured the method get_default_ruby_path is executed. If no executable named 'ruby' was found an error-message is presented immediately (ie. before you can edit something). Therefore when executing the script_runner (or debugger), if the 'path_to_ruby' property is empty no ruby was found and the same error message can be shown again. Alot of code is actually not needed but there just in case someone decided to rename/unlink ruby or doesn't have ruby in PATH. I don't know why anyone would want to rename/unlink ruby, but assumption is an error so the code to handle this case is present. One issue that did occur occasionally was as segfault: /home/jonathan/ruby-dev/freeride/test/freeride/./plugins/rubyide_tools_source_parser/simple_parser.rb:127: [BUG] Segmentation fault This sometimes happens when I get the error message of not finding ruby and when I wait before clicking OK. I haven't been able to establish a direct relation to the changes I made so this might just be an unrelated bug. I'll investigate into this further next week. One final thing. The new file fox_ruby_configurator.rb needs to be placed in plugins/rubyide_tools_fox_debugger/ I'm looking forward to your reaction(s) Thanks Jonathan -------------- next part -------------- ? debug_config.patch ? plugins/rubyide_tools_fox_debugger/fox_ruby_configurator.rb Index: plugins/rubyide_tools_debugger/debugger.rb =================================================================== RCS file: /var/cvs/freeride/freeride/plugins/rubyide_tools_debugger/debugger.rb,v retrieving revision 1.31 diff -b -u -r1.31 debugger.rb --- plugins/rubyide_tools_debugger/debugger.rb 29 Mar 2005 21:51:16 -0000 1.31 +++ plugins/rubyide_tools_debugger/debugger.rb 4 Sep 2005 09:04:28 -0000 @@ -172,9 +172,10 @@ # before running the command make sure that the ruby # interpreter is here or ask the user to specify a path - unless find_ruby || FileTest.exist?(ruby_path) + unless FileTest.exist?(ruby_path) @cmd_mgr.command('App/Services/MessageBox').invoke("Where is Ruby?", - "I can't find the Ruby interpreter '#{ruby_path}'. Please configure the path to ruby in the Debugger/Run preference box") + "I can't find the default Ruby interpreter. Please configure the path to ruby in the Debugger/Run preference box") + return end command = "#{ruby_path} -C \"#{exec_dir}\" -r \"#{drb_file}\" -r \"#{debuggee_file}\" \"#{file}\" #{exec_args}" @@ -732,23 +733,6 @@ STDOUT end - def find_ruby - if RUBY_PLATFORM =~ /(mswin32|mingw32)/ - ruby_names = ['ruby.bat', 'ruby.exe'] - path_sep = ';' - else - ruby_names = ['ruby'] - path_sep = ':' - end - ENV['PATH'].split(path_sep).each do |dir| - ruby_names.each do |f| - fullpath = File.join(dir,f) - return fullpath if File.exist?(fullpath) - end - end - return nil - end - end # class Debugger ## Index: plugins/rubyide_tools_fox_debugger/fox_debugger_configurator.rb =================================================================== RCS file: /var/cvs/freeride/freeride/plugins/rubyide_tools_fox_debugger/fox_debugger_configurator.rb,v retrieving revision 1.7 diff -b -u -r1.7 fox_debugger_configurator.rb --- plugins/rubyide_tools_fox_debugger/fox_debugger_configurator.rb 2 Sep 2005 08:41:32 -0000 1.7 +++ plugins/rubyide_tools_fox_debugger/fox_debugger_configurator.rb 4 Sep 2005 09:04:31 -0000 @@ -22,6 +22,7 @@ end require 'fox12/colors' +require 'rubyide_tools_fox_debugger/fox_ruby_configurator' module FreeRIDE module FoxRenderer @@ -46,7 +47,7 @@ GROUPBOX_TITLE_LEFT|FRAME_RIDGE|LAYOUT_FILL_X|LAYOUT_FILL_Y) group1_frm = FXVerticalFrame.new(group1, FRAME_NONE|LAYOUT_FILL_X|LAYOUT_FILL_Y) FXLabel.new(group1_frm,"Path to ruby:",nil,JUSTIFY_LEFT|LAYOUT_TOP|LAYOUT_LEFT) - @ptr = FXTextField.new(group1_frm, 2, nil, 0, (LAYOUT_TOP|LAYOUT_FILL_X|LAYOUT_FILL_COLUMN|FRAME_THICK)) + @ptr = FXTextField.new(group1_frm, 2, nil, 0, (LAYOUT_TOP|LAYOUT_FILL_X|LAYOUT_FILL_COLUMN|TEXTFIELD_NORMAL)) FXLabel.new(group1_frm,"Command line options:",nil,JUSTIFY_LEFT|LAYOUT_TOP|LAYOUT_LEFT) @clo = FXTextField.new(group1_frm, 2, nil, 0, (LAYOUT_TOP|LAYOUT_FILL_X|LAYOUT_FILL_COLUMN|FRAME_THICK)) FXLabel.new(group1_frm,"Working directory:",nil,JUSTIFY_LEFT|LAYOUT_TOP|LAYOUT_LEFT) @@ -82,11 +83,14 @@ pcfg.attr_description = 'Debugger/Run Settings' pcfg.attr_frame = config_pane + @ruby_configurator = RubyConfiguratorRenderer.new(plugin) + @ptr.disable # Is now being set by the ruby_configurator + # Sample sub-items (not used) - pcfg['subitem1'].attr_icon = nil - pcfg['subitem1'].attr_label = 'An unused sub-pane' - pcfg['subitem1'].attr_description = 'A sample configuration sub-pane' - pcfg['subitem1'].attr_frame = nil + # pcfg['subitem1'].attr_icon = nil + # pcfg['subitem1'].attr_label = 'An unused sub-pane' + # pcfg['subitem1'].attr_description = 'A sample configuration sub-pane' + # pcfg['subitem1'].attr_frame = nil end ## @@ -98,12 +102,17 @@ # in case there are several configuration pane for the same plugin # def set_config_properties(config_slot) - @dbg_plugin.properties['path_to_ruby'] = @ptr.text + case config_slot.name + when 'Debugger' + #@dbg_plugin.properties['path_to_ruby'] = @ptr.text @dbg_plugin.properties['cmd_line_options'] = @clo.text @dbg_plugin.properties['working_dir'] = @wd.text @dbg_plugin.properties['config_before_running'] = @dbr.check @dbg_plugin.properties['save_before_running'] = @sbr.check @dbg_plugin.properties['run_in_terminal'] = @rit.check + when 'Ruby' + @ruby_configurator.save_properties + end @dbg_plugin.log_info << "Setting Debugger/Run properties" end @@ -116,24 +125,35 @@ # in case there are several configuration pane for the same plugin # def get_config_properties(config_slot) + case config_slot.name + when 'Debugger' @ptr.text = @dbg_plugin.properties['path_to_ruby'] || "" @clo.text = @dbg_plugin.properties['cmd_line_options'] || "" @wd.text = @dbg_plugin.properties['working_dir'] || "" @dbr.check = @dbg_plugin.properties['config_before_running'] || false @sbr.check = @dbg_plugin.properties['save_before_running'] || false @rit.check = @dbg_plugin.properties['run_in_terminal'] || false + when 'Ruby' + @ruby_configurator.load_properties + end @dbg_plugin.log_info << "Getting Debugger/Run properties" end ## # def modified?(config_slot) + case config_slot.name + when 'Debugger' return (@dbg_plugin.properties['path_to_ruby'] != @ptr.text or @dbg_plugin.properties['cmd_line_options'] != @clo.text or @dbg_plugin.properties['working_dir'] != @wd.text or @dbg_plugin.properties['config_before_running'] != @dbr.check or @dbg_plugin.properties['save_before_running'] != @sbr.check or - @dbg_plugin.properties['run_in_terminal'] != @rit.check) + @dbg_plugin.properties['run_in_terminal'] != @rit.check + ) + when 'Ruby' + return @ruby_configurator.modified? + end end end #Class ConfiguratorRenderer Index: plugins/rubyide_tools_fox_script_runner/script_runner.rb =================================================================== RCS file: /var/cvs/freeride/freeride/plugins/rubyide_tools_fox_script_runner/script_runner.rb,v retrieving revision 1.27 diff -b -u -r1.27 script_runner.rb --- plugins/rubyide_tools_fox_script_runner/script_runner.rb 19 Feb 2005 14:41:28 -0000 1.27 +++ plugins/rubyide_tools_fox_script_runner/script_runner.rb 4 Sep 2005 09:04:41 -0000 @@ -130,7 +130,7 @@ starter_file = File.join("#{@plugin.plugin_configuration.full_base_path}","script_starter.rb") end ruby_path = dbg_plugin.properties['path_to_ruby'] - ruby_path = 'ruby' if (ruby_path == '' || ruby_path == nil) + #ruby_path = 'ruby' if (ruby_path == '' || ruby_path == nil) exec_args = dbg_plugin.properties['cmd_line_options'] exec_dir = dbg_plugin.properties['working_dir'] exec_dir = File.expand_path(File.dirname(file)) if (exec_dir == '' || exec_dir == nil) @@ -138,9 +138,9 @@ # before running the command make sure that the ruby # interpreter is here or ask the user to specify a path - unless find_ruby || FileTest.exist?(ruby_path) + unless FileTest.exist?(ruby_path) cmd_mgr.command('App/Services/MessageBox').invoke("Where is Ruby?", - "I can't find the Ruby interpreter '#{ruby_path}'. Please configure the path to ruby in the Debugger/Run preference box") + "I can't find the Ruby interpreter. Please configure the path to ruby in the Debugger/Run preference box") return end @@ -358,23 +358,6 @@ end end - def find_ruby - if RUBY_PLATFORM =~ /(mswin32|mingw32)/ - ruby_names = ['ruby.bat', 'ruby.exe'] - path_sep = ';' - else - ruby_names = ['ruby'] - path_sep = ':' - end - ENV['PATH'].split(path_sep).each do |dir| - ruby_names.each do |f| - fullpath = File.join(dir,f) - return fullpath if File.exist?(fullpath) - end - end - return nil - end - end end -------------- next part -------------- # Purpose: Setup and initialize the Ruby-interpreters configuration pane # # Authors: Jonathan Maasland < nochoice AT xs4all.nl > # Partially based on: fox_debugger_configurator.rb # by Laurent Julliard and Richard Kilmer # # This file is part of the FreeRIDE project # # This application is free software; you can redistribute it and/or # modify it under the terms of the Ruby license defined in the # COPYING file. # # Copyright (c) 2005 Jonathan Maasland. All rights reserved. # begin require 'rubygems' require_gem 'fxruby', '>= 1.2.0' rescue LoadError require 'fox12' end module FreeRIDE module FoxRenderer module DebuggerRenderFox class RubyConfiguratorRenderer include Fox def initialize(plugin) @plugin = plugin @dbg_plugin = plugin['/plugins/rubyide_tools_debugger'].manager @main = plugin['/system/ui/fox/FXMainWindow'].data # Construct the ruby-interpreters configuration subpanel # Parent it to the main window rubypanel = FXHorizontalFrame.new(@main, FRAME_NONE|LAYOUT_FILL_X|LAYOUT_FILL_Y) group = FXGroupBox.new(rubypanel, "Configured Ruby Interpreters", GROUPBOX_TITLE_LEFT|FRAME_RIDGE|LAYOUT_FILL_X|LAYOUT_FILL_Y) group_frame = FXHorizontalFrame.new(group, FRAME_NONE|LAYOUT_FILL_Y|LAYOUT_FILL_X) # Create the left part of the panel list_frame = FXVerticalFrame.new(group_frame, FRAME_NONE|LAYOUT_FILL_Y) @irv_list = FXList.new(list_frame, nil, 0, LAYOUT_FILL_X|LAYOUT_FILL_Y|LIST_NORMAL) do |lst| lst.connect(SEL_CHANGED, method(:onCmdChangeSel)) end button_frame = FXHorizontalFrame.new(list_frame, LAYOUT_FILL_X) FXButton.new(button_frame, "Add") do |button| button.connect(SEL_COMMAND, method(:onCmdAdd)) end @remove_btn = FXButton.new(button_frame, "Remove") do |button| button.connect(SEL_COMMAND, method(:onCmdRemove)) end # Create the interpreter settings-view (right part) group_frame2 = FXVerticalFrame.new(group_frame, LAYOUT_FILL_X|LAYOUT_FILL_Y) FXLabel.new(group_frame2, "Name:") @rb_name = FXTextField.new(group_frame2, 15, nil, 0, LAYOUT_FILL_X|TEXTFIELD_NORMAL) @rb_name.connect(SEL_COMMAND, method(:name_changed)) FXLabel.new(group_frame2, "Version:") @rb_ver = FXTextField.new(group_frame2, 15, nil, 0, LAYOUT_FILL_X|TEXTFIELD_NORMAL) @rb_ver.disable FXLabel.new(group_frame2, "Executable:") tmp_panel = FXHorizontalFrame.new(group_frame2, LAYOUT_FILL_X) @rb_exec = FXTextField.new(tmp_panel, 15, nil, 0, LAYOUT_FILL_X|TEXTFIELD_NORMAL) @rb_exec.connect(SEL_COMMAND, method(:tf_changed)) FXButton.new(tmp_panel, "...", nil, nil, 0, BUTTON_NORMAL|LAYOUT_RIGHT) do |button| button.connect(SEL_COMMAND, method(:onCmdBrowseRuby)) end FXLabel.new(group_frame2, "Path:") tmp_panel = FXHorizontalFrame.new(group_frame2, LAYOUT_FILL_X) @rb_path = FXTextField.new(tmp_panel, 25, nil, 0, LAYOUT_FILL_X|TEXTFIELD_NORMAL) @rb_path.connect(SEL_COMMAND, method(:tf_changed)) FXButton.new(tmp_panel, "...", nil, nil, 0, BUTTON_NORMAL|LAYOUT_RIGHT) do |button| button.connect(SEL_COMMAND, method(:onCmdBrowsePath)) end rubypanel.create rubypanel.hide pcfg = plugin['configurator/Debugger'] pcfg['Ruby'].attr_icon = nil pcfg['Ruby'].attr_label = 'Installed Ruby interpreters' pcfg['Ruby'].attr_description = 'Add or remove installed Ruby interpreters' pcfg['Ruby'].attr_frame = rubypanel # Ensure that the 'default' ruby interpreter is present or create it plugin["/system/state/all_plugins_loaded"].subscribe do |event, slot| if slot.data == true # Check if the default interpreter is already configured found = false interpreters = @dbg_plugin.properties["interpreters"] if interpreters interpreters.each_key do |key| found = true if key == "default" end end unless found # Try and setup the default ruby interpreter ruby_command = get_default_ruby_path if ruby_command @rb_path.text, @rb_exec.text = extract_path_and_exec(ruby_command) @rb_name.text = "default" s = { "default" => get_settings } @dbg_plugin.properties["interpreters"] = s @dbg_plugin.properties["path_to_ruby"] = s["default"]["command"] else @plugin['/system/ui/commands/App/Services/MessageBox'].invoke(@plugin, "Where is Ruby?", "I can't find the Ruby interpreter. " + "Please configure the path to ruby in the Debugger/Run preference box") end end end end end # Called by the DebuggerConfigurator to load the settings in the gui # The default interpreter is unique in that it always exists and it's # name is always 'default' # # All settings are stored in a hash # The given name for the interpreter is the key, it's value is # a hash containing the settings def load_properties @irv_list.clearItems interpreters = @dbg_plugin.properties['interpreters'] unless interpreters interpreters = { 'default' => get_new_settings } interpreters['default']['name'] = 'default' end interpreters.each do |key, value| idx = @irv_list.appendItem(key) @irv_list.setItemData(idx, value) end @irv_list.selectItem(0) # Adding true to the above statement should fire a SEL_CHANGED event # for the list, it does not however :( onCmdChangeSel(nil, nil, 0) @modified = false @plugin.log_info << "Loaded Debugger/Ruby properties" end ## # Called by DebuggerConfigurator to save the settings def save_properties # Save all changes in the list @irv_list.setItemData(@selected_idx, get_settings) @irv_list.setItemText(@selected_idx, @rb_name.text) rubies = Hash.new @irv_list.numItems.times do |idx| rubies[ @irv_list.getItemText(idx) ] = @irv_list.getItemData(idx) end @dbg_plugin.properties["interpreters"] = rubies @dbg_plugin.properties["path_to_ruby"] = rubies['default']['command'] @modified = false @plugin.log_info << "Saved Debugger/Ruby properties" end # Called by DebuggerConfigurator def modified? return @modified end private # Searches PATH for a file named ruby and returns the path to it, or nil def get_default_ruby_path if PLATFORM =~ /(mswin32|mingw32)/ path_delim = ";" ruby_names = [ "ruby.bat", "ruby.exe" ] else path_delim = ":" ruby_names = [ "ruby" ] end ENV['PATH'].split(path_delim).each do |path_entry| ruby_names.each do |name| full_path = File.join(path_entry, name) if File.exists?(full_path) @plugin.log_debug << "Using #{full_path} as the default ruby interpreter" return full_path end end end @plugin.log_info << "Unable to find a default ruby interpreter" @no_default_ruby_found = true return nil end # Attempt to run a ruby command using the currently provided settings. # If no executable name is provided this method will try 'ruby' as a default # # If succesful the ruby's version output is returned. # If an error occurred, false is returned def try_settings if @rb_path.text == '' and @rb_exec.text == '' @rb_ver.text = '' return false end if @rb_path.text == '' ruby_exec = @rb_exec.text else ruby_exec = File.join(@rb_path.text, @rb_exec.text) if(!(File.exists?(ruby_exec) and File.executable?(ruby_exec))) @plugin['/system/ui/commands/App/Services/MessageBox'].invoke(@plugin, "Error", "Could not find or execute #{ruby_exec}") @rb_ver.text = '' return false end end cmd = "#{ruby_exec} -v -e \"puts 'helloWorld'\"" begin output = `#{cmd}` rescue @plugin['/system/ui/commands/App/Services/MessageBox'].invoke(@plugin, "Error", "Error executing #{ruby_exec}") @rb_ver.text = '' return false end ver, line = output.split("\n") if((ver and line) and (ver =~ /ruby/) and (line == "helloWorld")) @rb_ver.text = ver return true else error_msg = "Error executing #{ruby_exec}" error_msg += "Command output was\n#{output}" if output != '' @plugin['/system/ui/commands/App/Services/MessageBox'].invoke(@plugin, "Error", error_msg) @rb_ver.text = '' return false end end # Returns a hash containing the current values in the ui def get_settings rv = { "name" => @rb_name.text, "exec" => @rb_exec.text, "path" => @rb_path.text, "command" => File.join(@rb_path.text , @rb_exec.text), "version" => @rb_ver.text } rv["command"] = @rb_exec.text if @rb_path.text == '' return rv end # Returns a hash containing the default settings def get_new_settings rv = { "name" => "unnamed", "path" => "" } if @no_default_ruby_found rv['exec'] = '' rv['command'] = '' else rv['exec'] = 'ruby' rv['command'] = 'ruby' end return rv end # Method returns an array of two elements # The first is the path, the second the name of the executable def extract_path_and_exec(full_path) full_path.match("(.*#{File::SEPARATOR})([^#{File::SEPARATOR}]*)") [ $1, $2 ] end def name_changed(sender, sel, ptr) if @rb_name.text == '' # Find the number to append to the default 'unnamed' name last_unnamed_nr = 0 idx = -1 while( (idx = @irv_list.findItem( 'unnamed', idx, SEARCH_FORWARD|SEARCH_PREFIX|SEARCH_NOWRAP)) != -1) @irv_list.getItemText(idx) =~ /unnamed([\d]*)/ if $1 and $1.length > 0 last_unnamed_nr = $1.to_i if($1.to_i > last_unnamed_nr) end idx += 1 end @rb_name.text = "unnamed#{last_unnamed_nr+1}" end @irv_list.setItemText(@selected_idx, @rb_name.text) end def tf_changed(sender, sel, ptr) @modified = true exec_empty = false if @rb_exec.text == '' exec_empty = true @rb_exec.text = 'ruby' end if !try_settings and exec_empty @rb_exec.text = '' end end def onCmdBrowsePath(sender, sel, ptr) dlg = FXDirDialog.new(@main, "Select the path to ruby") if dlg.execute != 0 @rb_path.text = dlg.getDirectory try_settings end end def onCmdBrowseRuby(sender, sel, ptr) dlg = FXFileDialog.new(@main, "Select the ruby executable") dlg.setPatternList("Files starting with ruby (ruby*)\nAll files (*)") dlg.setDirectory(@rb_path.text) if File.exists?(@rb_path.text) if dlg.execute != 0 @rb_path.text, @rb_exec.text = extract_path_and_exec(dlg.getFilename) @modified = true try_settings end end def onCmdAdd(sender, sel, ptr) new_settings = get_new_settings new_idx = @irv_list.appendItem(new_settings['name']) @irv_list.setItemData(new_idx, new_settings) @irv_list.killSelection @irv_list.selectItem(new_idx) onCmdChangeSel(nil, nil, new_idx) @modified = true end def onCmdRemove(sender, sel, ptr) @irv_list.removeItem(@selected_idx) @irv_list.setCurrentItem(0) @irv_list.selectItem(0, true) # Set @selected_idx to false so onCmdChangeSel doesn't try to save changes @selected_idx = false onCmdChangeSel(nil, nil, 0) @modified = true end # Called when the list-selection changes # ptr is the index of the new selection def onCmdChangeSel(sender, sel, ptr) # @selected_idx still points to the old selection, so we can use to # save the current ui-settings if(@selected_idx) # and @irv_list.numItems-1 >= @selected_idx) @irv_list.setItemText(@selected_idx, @rb_name.text) @irv_list.setItemData(@selected_idx, get_settings) end if @irv_list.getItemText(ptr) == 'default' @remove_btn.disable @rb_name.disable else @rb_name.enable @remove_btn.enable end settings = @irv_list.getItemData(ptr) @rb_name.text = settings['name'] @rb_path.text = settings['path'] @rb_exec.text = settings['exec'] try_settings @selected_idx = ptr end end end end end From laurent at moldus.org Mon Sep 5 02:08:27 2005 From: laurent at moldus.org (Laurent Julliard) Date: Mon Sep 5 02:01:29 2005 Subject: [FR-devel] Multiple interpreters patch In-Reply-To: <431ADF11.8000304@xs4all.nl> References: <431ADF11.8000304@xs4all.nl> Message-ID: <431BE0DB.7030300@moldus.org> Jonathan, Your patch looks good to me. If you don't mind I'll defer committing the changes to the CVS repo until you have tested it on Win32. Let me know when you are done testing it. Thanks! Laurent From nochoice at xs4all.nl Fri Sep 9 18:15:48 2005 From: nochoice at xs4all.nl (Jonathan Maasland) Date: Fri Sep 9 16:07:31 2005 Subject: [FR-devel] Multiple interpreters patch In-Reply-To: <431BE0DB.7030300@moldus.org> References: <431ADF11.8000304@xs4all.nl> <431BE0DB.7030300@moldus.org> Message-ID: <43220994.9040105@xs4all.nl> Sorry I haven't responded sooner. Today was the first oppurtunity I had to test the code on Windows. As could be expected I found a couple a glitches. I attached a completely new patch, made against the current cvs-tree. Also the new fox_ruby_configurator.rb is attached. Next monday I'll start working on project-support. I don't know how long I'll need but I'm hoping for a week and a half or less. You'll be hearing from me soon :) Jonathan Laurent Julliard wrote: > Jonathan, > > Your patch looks good to me. If you don't mind I'll defer committing > the changes to the CVS repo until you have tested it on Win32. Let me > know when you are done testing it. > > Thanks! > > Laurent > _______________________________________________ > Freeride-devel mailing list > Freeride-devel@rubyforge.org > http://rubyforge.org/mailman/listinfo/freeride-devel > > -------------- next part -------------- ? new_debugger.patch ? plugins/rubyide_tools_fox_debugger/fox_ruby_configurator.rb Index: plugins/rubyide_tools_debugger/debugger.rb =================================================================== RCS file: /var/cvs/freeride/freeride/plugins/rubyide_tools_debugger/debugger.rb,v retrieving revision 1.31 diff -b -u -r1.31 debugger.rb --- plugins/rubyide_tools_debugger/debugger.rb 29 Mar 2005 21:51:16 -0000 1.31 +++ plugins/rubyide_tools_debugger/debugger.rb 9 Sep 2005 19:49:36 -0000 @@ -172,9 +172,9 @@ # before running the command make sure that the ruby # interpreter is here or ask the user to specify a path - unless find_ruby || FileTest.exist?(ruby_path) + unless FileTest.exist?(ruby_path) @cmd_mgr.command('App/Services/MessageBox').invoke("Where is Ruby?", - "I can't find the Ruby interpreter '#{ruby_path}'. Please configure the path to ruby in the Debugger/Run preference box") + "I can't find the default Ruby interpreter. Please configure the path to ruby in the Debugger/Run preference box") end command = "#{ruby_path} -C \"#{exec_dir}\" -r \"#{drb_file}\" -r \"#{debuggee_file}\" \"#{file}\" #{exec_args}" @@ -732,23 +732,6 @@ STDOUT end - def find_ruby - if RUBY_PLATFORM =~ /(mswin32|mingw32)/ - ruby_names = ['ruby.bat', 'ruby.exe'] - path_sep = ';' - else - ruby_names = ['ruby'] - path_sep = ':' - end - ENV['PATH'].split(path_sep).each do |dir| - ruby_names.each do |f| - fullpath = File.join(dir,f) - return fullpath if File.exist?(fullpath) - end - end - return nil - end - end # class Debugger ## Index: plugins/rubyide_tools_fox_debugger/fox_debugger_configurator.rb =================================================================== RCS file: /var/cvs/freeride/freeride/plugins/rubyide_tools_fox_debugger/fox_debugger_configurator.rb,v retrieving revision 1.7 diff -b -u -r1.7 fox_debugger_configurator.rb --- plugins/rubyide_tools_fox_debugger/fox_debugger_configurator.rb 2 Sep 2005 08:41:32 -0000 1.7 +++ plugins/rubyide_tools_fox_debugger/fox_debugger_configurator.rb 9 Sep 2005 19:49:39 -0000 @@ -22,6 +22,7 @@ end require 'fox12/colors' +require 'rubyide_tools_fox_debugger/fox_ruby_configurator' module FreeRIDE module FoxRenderer @@ -46,7 +47,8 @@ GROUPBOX_TITLE_LEFT|FRAME_RIDGE|LAYOUT_FILL_X|LAYOUT_FILL_Y) group1_frm = FXVerticalFrame.new(group1, FRAME_NONE|LAYOUT_FILL_X|LAYOUT_FILL_Y) FXLabel.new(group1_frm,"Path to ruby:",nil,JUSTIFY_LEFT|LAYOUT_TOP|LAYOUT_LEFT) - @ptr = FXTextField.new(group1_frm, 2, nil, 0, (LAYOUT_TOP|LAYOUT_FILL_X|LAYOUT_FILL_COLUMN|FRAME_THICK)) + @ptr = FXTextField.new(group1_frm, 2, nil, 0, (LAYOUT_TOP|LAYOUT_FILL_X|LAYOUT_FILL_COLUMN|TEXTFIELD_NORMAL)) + @ptr.disable FXLabel.new(group1_frm,"Command line options:",nil,JUSTIFY_LEFT|LAYOUT_TOP|LAYOUT_LEFT) @clo = FXTextField.new(group1_frm, 2, nil, 0, (LAYOUT_TOP|LAYOUT_FILL_X|LAYOUT_FILL_COLUMN|FRAME_THICK)) FXLabel.new(group1_frm,"Working directory:",nil,JUSTIFY_LEFT|LAYOUT_TOP|LAYOUT_LEFT) @@ -82,11 +84,14 @@ pcfg.attr_description = 'Debugger/Run Settings' pcfg.attr_frame = config_pane + # Construct the ruby-interpreter configuration sub-panel + @ruby_configurator = RubyConfiguratorRenderer.new(plugin) + # Sample sub-items (not used) - pcfg['subitem1'].attr_icon = nil - pcfg['subitem1'].attr_label = 'An unused sub-pane' - pcfg['subitem1'].attr_description = 'A sample configuration sub-pane' - pcfg['subitem1'].attr_frame = nil + #pcfg['subitem1'].attr_icon = nil + #pcfg['subitem1'].attr_label = 'An unused sub-pane' + #pcfg['subitem1'].attr_description = 'A sample configuration sub-pane' + #pcfg['subitem1'].attr_frame = nil end ## @@ -98,12 +103,16 @@ # in case there are several configuration pane for the same plugin # def set_config_properties(config_slot) - @dbg_plugin.properties['path_to_ruby'] = @ptr.text + case config_slot.name + when 'Debugger' @dbg_plugin.properties['cmd_line_options'] = @clo.text @dbg_plugin.properties['working_dir'] = @wd.text @dbg_plugin.properties['config_before_running'] = @dbr.check @dbg_plugin.properties['save_before_running'] = @sbr.check @dbg_plugin.properties['run_in_terminal'] = @rit.check + when 'Ruby' + @ruby_configurator.save_properties + end @dbg_plugin.log_info << "Setting Debugger/Run properties" end @@ -116,24 +125,44 @@ # in case there are several configuration pane for the same plugin # def get_config_properties(config_slot) + case config_slot.name + when 'Debugger' @ptr.text = @dbg_plugin.properties['path_to_ruby'] || "" @clo.text = @dbg_plugin.properties['cmd_line_options'] || "" @wd.text = @dbg_plugin.properties['working_dir'] || "" @dbr.check = @dbg_plugin.properties['config_before_running'] || false @sbr.check = @dbg_plugin.properties['save_before_running'] || false @rit.check = @dbg_plugin.properties['run_in_terminal'] || false + when 'Ruby' + @ruby_configurator.load_properties + end @dbg_plugin.log_info << "Getting Debugger/Run properties" end ## # def modified?(config_slot) - return (@dbg_plugin.properties['path_to_ruby'] != @ptr.text or - @dbg_plugin.properties['cmd_line_options'] != @clo.text or - @dbg_plugin.properties['working_dir'] != @wd.text or - @dbg_plugin.properties['config_before_running'] != @dbr.check or - @dbg_plugin.properties['save_before_running'] != @sbr.check or - @dbg_plugin.properties['run_in_terminal'] != @rit.check) + case config_slot.name + when 'Debugger' + return !( cmp_prop('path_to_ruby', @ptr.text) and + cmp_prop('cmd_line_options', @clo.text) and + cmp_prop('working_dir', @wd.text) and + cmp_prop('config_before_running', @dbr.check, false) and + cmp_prop('save_before_running', @sbr.check, false) and + cmp_prop('run_in_terminal', @rit.check, false) + ) + when 'Ruby' + return @ruby_configurator.modified? + end + end + + ## + # Method compares the property with name prop_name to val + # if the named property is nil, then val is compared to the default value + def cmp_prop(prop_name, val, default='') + p = @dbg_plugin.properties[prop_name] + return val==p if p + return val==default end end #Class ConfiguratorRenderer Index: plugins/rubyide_tools_fox_script_runner/script_runner.rb =================================================================== RCS file: /var/cvs/freeride/freeride/plugins/rubyide_tools_fox_script_runner/script_runner.rb,v retrieving revision 1.27 diff -b -u -r1.27 script_runner.rb --- plugins/rubyide_tools_fox_script_runner/script_runner.rb 19 Feb 2005 14:41:28 -0000 1.27 +++ plugins/rubyide_tools_fox_script_runner/script_runner.rb 9 Sep 2005 19:49:42 -0000 @@ -130,7 +130,7 @@ starter_file = File.join("#{@plugin.plugin_configuration.full_base_path}","script_starter.rb") end ruby_path = dbg_plugin.properties['path_to_ruby'] - ruby_path = 'ruby' if (ruby_path == '' || ruby_path == nil) + #ruby_path = 'ruby' if (ruby_path == '' || ruby_path == nil) exec_args = dbg_plugin.properties['cmd_line_options'] exec_dir = dbg_plugin.properties['working_dir'] exec_dir = File.expand_path(File.dirname(file)) if (exec_dir == '' || exec_dir == nil) @@ -138,9 +138,9 @@ # before running the command make sure that the ruby # interpreter is here or ask the user to specify a path - unless find_ruby || FileTest.exist?(ruby_path) + unless FileTest.exist?(ruby_path) cmd_mgr.command('App/Services/MessageBox').invoke("Where is Ruby?", - "I can't find the Ruby interpreter '#{ruby_path}'. Please configure the path to ruby in the Debugger/Run preference box") + "I can't find the default Ruby interpreter. Please configure the path to ruby in the Debugger/Run preference box") return end @@ -358,23 +358,6 @@ end end - def find_ruby - if RUBY_PLATFORM =~ /(mswin32|mingw32)/ - ruby_names = ['ruby.bat', 'ruby.exe'] - path_sep = ';' - else - ruby_names = ['ruby'] - path_sep = ':' - end - ENV['PATH'].split(path_sep).each do |dir| - ruby_names.each do |f| - fullpath = File.join(dir,f) - return fullpath if File.exist?(fullpath) - end - end - return nil - end - end end -------------- next part -------------- # Purpose: Setup and initialize the Ruby-interpreters configuration pane # # Authors: Jonathan Maasland < nochoice AT xs4all.nl > # Partially based on: fox_debugger_configurator.rb # by Laurent Julliard and Richard Kilmer # # This file is part of the FreeRIDE project # # This application is free software; you can redistribute it and/or # modify it under the terms of the Ruby license defined in the # COPYING file. # # Copyright (c) 2005 Jonathan Maasland. All rights reserved. # begin require 'rubygems' require_gem 'fxruby', '>= 1.2.0' rescue LoadError require 'fox12' end module FreeRIDE module FoxRenderer module DebuggerRenderFox class RubyConfiguratorRenderer include Fox def initialize(plugin) @plugin = plugin @dbg_plugin = plugin['/plugins/rubyide_tools_debugger'].manager @main = plugin['/system/ui/fox/FXMainWindow'].data # Construct the ruby-interpreters configuration subpanel # Parent it to the main window rubypanel = FXHorizontalFrame.new(@main, FRAME_NONE|LAYOUT_FILL_X|LAYOUT_FILL_Y) group = FXGroupBox.new(rubypanel, "Configured Ruby Interpreters", GROUPBOX_TITLE_LEFT|FRAME_RIDGE|LAYOUT_FILL_X|LAYOUT_FILL_Y) group_frame = FXHorizontalFrame.new(group, FRAME_NONE|LAYOUT_FILL_Y|LAYOUT_FILL_X) # Create the left part of the panel list_frame = FXVerticalFrame.new(group_frame, FRAME_NONE|LAYOUT_FILL_Y) @irv_list = FXList.new(list_frame, nil, 0, LAYOUT_FILL_X|LAYOUT_FILL_Y|LIST_NORMAL) do |lst| lst.connect(SEL_CHANGED, method(:onCmdChangeSel)) end button_frame = FXHorizontalFrame.new(list_frame, LAYOUT_FILL_X) FXButton.new(button_frame, "Add") do |button| button.connect(SEL_COMMAND, method(:onCmdAdd)) end @remove_btn = FXButton.new(button_frame, "Remove") do |button| button.connect(SEL_COMMAND, method(:onCmdRemove)) end # Create the interpreter settings-view (right part) group_frame2 = FXVerticalFrame.new(group_frame, LAYOUT_FILL_X|LAYOUT_FILL_Y) FXLabel.new(group_frame2, "Name:") @rb_name = FXTextField.new(group_frame2, 15, nil, 0, LAYOUT_FILL_X|TEXTFIELD_NORMAL) @rb_name.connect(SEL_COMMAND, method(:name_changed)) FXLabel.new(group_frame2, "Version:") @rb_ver = FXTextField.new(group_frame2, 15, nil, 0, LAYOUT_FILL_X|TEXTFIELD_NORMAL) @rb_ver.disable FXLabel.new(group_frame2, "Executable:") tmp_panel = FXHorizontalFrame.new(group_frame2, LAYOUT_FILL_X) @rb_exec = FXTextField.new(tmp_panel, 15, nil, 0, LAYOUT_FILL_X|TEXTFIELD_NORMAL) @rb_exec.connect(SEL_COMMAND, method(:tf_changed)) FXButton.new(tmp_panel, "...", nil, nil, 0, BUTTON_NORMAL|LAYOUT_RIGHT) do |button| button.connect(SEL_COMMAND, method(:onCmdBrowseRuby)) end FXLabel.new(group_frame2, "Path:") tmp_panel = FXHorizontalFrame.new(group_frame2, LAYOUT_FILL_X) @rb_path = FXTextField.new(tmp_panel, 25, nil, 0, LAYOUT_FILL_X|TEXTFIELD_NORMAL) @rb_path.connect(SEL_COMMAND, method(:tf_changed)) FXButton.new(tmp_panel, "...", nil, nil, 0, BUTTON_NORMAL|LAYOUT_RIGHT) do |button| button.connect(SEL_COMMAND, method(:onCmdBrowsePath)) end rubypanel.create rubypanel.hide pcfg = plugin['configurator/Debugger'] pcfg['Ruby'].attr_icon = nil pcfg['Ruby'].attr_label = 'Installed Ruby interpreters' pcfg['Ruby'].attr_description = 'Add or remove installed Ruby interpreters' pcfg['Ruby'].attr_frame = rubypanel # Ensure that the 'default' ruby interpreter is present or create it plugin["/system/state/all_plugins_loaded"].subscribe do |event, slot| if slot.data == true # Check if the default interpreter is already configured found = false interpreters = @dbg_plugin.properties["interpreters"] if interpreters interpreters.each_key do |key| found = true if key == "default" end end unless found # Try and setup the default ruby interpreter ruby_command = get_default_ruby_path if ruby_command @rb_path.text, @rb_exec.text = extract_path_and_exec(ruby_command) @rb_name.text = "default" s = { "default" => get_settings } @dbg_plugin.properties["interpreters"] = s @dbg_plugin.properties["path_to_ruby"] = s["default"]["command"] else @plugin['/system/ui/commands/App/Services/MessageBox'].invoke(@plugin, "Where is Ruby?", "I can't find the Ruby interpreter. " + "Please configure the path to ruby in the Debugger/Run preference box") end end end end end # Called by the DebuggerConfigurator to load the settings in the gui # The default interpreter is unique in that it always exists and it's # name is always 'default' # # All settings are stored in a hash # The given name for the interpreter is the key, it's value is # a hash containing the settings def load_properties @irv_list.clearItems interpreters = @dbg_plugin.properties['interpreters'] unless interpreters interpreters = { 'default' => get_new_settings } interpreters['default']['name'] = 'default' end interpreters.each do |key, value| idx = @irv_list.appendItem(key) @irv_list.setItemData(idx, value) end @irv_list.selectItem(0) # Adding true to the above statement should fire a SEL_CHANGED event # for the list, it does not however :( onCmdChangeSel(nil, nil, 0) @modified = false @plugin.log_info << "Loaded Debugger/Ruby properties" end ## # Called by DebuggerConfigurator to save the settings def save_properties # Save all changes in the list @irv_list.setItemData(@selected_idx, get_settings) @irv_list.setItemText(@selected_idx, @rb_name.text) rubies = Hash.new @irv_list.numItems.times do |idx| rubies[ @irv_list.getItemText(idx) ] = @irv_list.getItemData(idx) end @dbg_plugin.properties["interpreters"] = rubies @dbg_plugin.properties["path_to_ruby"] = rubies['default']['command'] @modified = false @plugin.log_info << "Saved Debugger/Ruby properties" end # Called by DebuggerConfigurator def modified? return @modified end private # Searches PATH for a file named ruby and returns the path to it, or nil def get_default_ruby_path if PLATFORM =~ /(mswin32|mingw32)/ path_delim = ";" ruby_names = [ "ruby.bat", "ruby.exe" ] else path_delim = ":" ruby_names = [ "ruby" ] end ENV['PATH'].split(path_delim).each do |path_entry| ruby_names.each do |name| full_path = File.join(path_entry, name) if File.exists?(full_path) @plugin.log_debug << "Using #{full_path} as the default ruby interpreter" return full_path end end end @plugin.log_info << "Unable to find a default ruby interpreter" @no_default_ruby_found = true return nil end # Attempt to run a ruby command using the currently provided settings. # If no executable name is provided this method will try 'ruby' as a default # # If succesful the ruby's version output is returned. # If an error occurred, false is returned def try_settings if @rb_path.text == '' and @rb_exec.text == '' @rb_ver.text = '' return false end if @rb_path.text == '' ruby_exec = @rb_exec.text else ruby_exec = File.join(@rb_path.text, @rb_exec.text) if(!(File.exists?(ruby_exec) and File.executable?(ruby_exec))) @plugin['/system/ui/commands/App/Services/MessageBox'].invoke(@plugin, "Error", "Could not find or execute #{ruby_exec}") @rb_ver.text = '' return false end end cmd = "#{ruby_exec} -v -e \"puts 'helloWorld'\"" begin output = `#{cmd}` rescue @plugin['/system/ui/commands/App/Services/MessageBox'].invoke(@plugin, "Error", "Error executing #{ruby_exec}") @rb_ver.text = '' return false end ver, line = output.split("\n") if((ver and line) and (ver =~ /ruby/) and (line == "helloWorld")) @rb_ver.text = ver return true else error_msg = "Error executing #{ruby_exec}" error_msg += "Command output was\n#{output}" if output != '' @plugin['/system/ui/commands/App/Services/MessageBox'].invoke(@plugin, "Error", error_msg) @rb_ver.text = '' return false end end # Returns a hash containing the current values in the ui def get_settings rv = { "name" => @rb_name.text, "exec" => @rb_exec.text, "path" => @rb_path.text, "command" => File.join(@rb_path.text , @rb_exec.text), "version" => @rb_ver.text } rv["command"] = @rb_exec.text if @rb_path.text == '' return rv end # Returns a hash containing the default settings def get_new_settings rv = { "name" => "unnamed", "path" => "" } if @no_default_ruby_found rv['exec'] = '' rv['command'] = '' else rv['exec'] = 'ruby' rv['command'] = 'ruby' end return rv end # Method returns an array of two elements # The first is the path, the second the name of the executable def extract_path_and_exec(full_path) dn = File.dirname(full_path) fn = full_path[dn.size+1..-1] # +1 to remove the starting path-separator [dn, fn] end def name_changed(sender, sel, ptr) if @rb_name.text == '' # Find the number to append to the default 'unnamed' name last_unnamed_nr = 0 idx = -1 while( (idx = @irv_list.findItem( 'unnamed', idx, SEARCH_FORWARD|SEARCH_PREFIX|SEARCH_NOWRAP)) != -1) @irv_list.getItemText(idx) =~ /unnamed([\d]*)/ if $1 and $1.length > 0 last_unnamed_nr = $1.to_i if($1.to_i > last_unnamed_nr) end idx += 1 end @rb_name.text = "unnamed#{last_unnamed_nr+1}" end @irv_list.setItemText(@selected_idx, @rb_name.text) end def tf_changed(sender, sel, ptr) @modified = true exec_empty = false if @rb_exec.text == '' exec_empty = true @rb_exec.text = 'ruby' end if !try_settings and exec_empty @rb_exec.text = '' end end def onCmdBrowsePath(sender, sel, ptr) dlg = FXDirDialog.new(@main, "Select the path to ruby") if dlg.execute != 0 @rb_path.text = dlg.getDirectory try_settings end end def onCmdBrowseRuby(sender, sel, ptr) dlg = FXFileDialog.new(@main, "Select the ruby executable") dlg.setPatternList("Files starting with ruby (ruby*)\nAll files (*)") dlg.setDirectory(@rb_path.text) if File.exists?(@rb_path.text) if dlg.execute != 0 @rb_path.text, @rb_exec.text = extract_path_and_exec(dlg.getFilename) puts "returned #{@rb_path.text} and #{@rb_exec.text}" @modified = true try_settings end end def onCmdAdd(sender, sel, ptr) new_settings = get_new_settings new_idx = @irv_list.appendItem(new_settings['name']) @irv_list.setItemData(new_idx, new_settings) @irv_list.killSelection @irv_list.selectItem(new_idx) onCmdChangeSel(nil, nil, new_idx) @modified = true end def onCmdRemove(sender, sel, ptr) @irv_list.removeItem(@selected_idx) @irv_list.setCurrentItem(0) @irv_list.selectItem(0, true) # Set @selected_idx to false so onCmdChangeSel doesn't try to save changes @selected_idx = false onCmdChangeSel(nil, nil, 0) @modified = true end # Called when the list-selection changes # ptr is the index of the new selection def onCmdChangeSel(sender, sel, ptr) # @selected_idx still points to the old selection, so we can use to # save the current ui-settings if(@selected_idx) # and @irv_list.numItems-1 >= @selected_idx) @irv_list.setItemText(@selected_idx, @rb_name.text) @irv_list.setItemData(@selected_idx, get_settings) end if @irv_list.getItemText(ptr) == 'default' @remove_btn.disable @rb_name.disable else @rb_name.enable @remove_btn.enable end settings = @irv_list.getItemData(ptr) @rb_name.text = settings['name'] @rb_path.text = settings['path'] @rb_exec.text = settings['exec'] try_settings @selected_idx = ptr end end end end end From nochoice at xs4all.nl Tue Sep 13 16:52:34 2005 From: nochoice at xs4all.nl (Jonathan Maasland) Date: Tue Sep 13 14:43:37 2005 Subject: [FR-devel] Submenu patch Message-ID: <43273C12.1050400@xs4all.nl> Laurent, I finished building and testing submenu-support for FreeRIDE. There is no limit to the depth of the sub-menus. (should anyone wonder) The reason I built it is because I thought all the project-related commands might be nicely placed inside their own submenu. One issue though is that I'm unsure where to place the project submenu in the File_menu. ATM I've parked it at the top. If you have another idea then please go ahead and change it. The functionality for the two newly accessible menu-options (new project and open project) I plan to build this week. On the way I split rubyide_fox_gui/menupane.rb#update into three shorter methods. My mind was starting to ache trying to understand the flow of that piece of code. Hope you don't mind, I think it's an improvement :) Another small thing that caught my eye was that in rubyide_gui/menupane.rb @count.to_s is used as the key for the command-slot. Imagine (or just test) having more than 10 menu-items.... "10" comes after "1" but before "2" Easy fix of course (included in the patch) but I noticed similar behaviour in .yaml files with stringified numbers... Any thoughts? Thanks again. Jonathan -------------- next part -------------- ? submenu.patch Index: plugins/rubyide_fox_gui/menupane.rb =================================================================== RCS file: /var/cvs/freeride/freeride/plugins/rubyide_fox_gui/menupane.rb,v retrieving revision 1.6 diff -u -r1.6 menupane.rb --- plugins/rubyide_fox_gui/menupane.rb 19 Feb 2005 14:48:52 -0000 1.6 +++ plugins/rubyide_fox_gui/menupane.rb 13 Sep 2005 18:15:58 -0000 @@ -80,74 +80,22 @@ @menu.detach() unless @menu == nil @menu = FXMenuPane.new(@main_window) @slot.attr_FXMenuPane = @menu + @menu_holder = [] + current_menu = @menu + @slot.manager.each_command do | cmd_slot, text, description, available, accelerator | begin if text == "SEPARATOR" - cmd_slot.attr_fxmenu = FXMenuSeparator.new(@menu) + cmd_slot.attr_fxmenu = FXMenuSeparator.new(current_menu) + elsif text == "SUBMENU" + @menu_holder << current_menu + current_menu = FXMenuPane.new(@main_window) + elsif text == "SUBMENU_END" + oldmenu = current_menu + current_menu = @menu_holder.pop + FXMenuCascade.new(current_menu, description, nil, oldmenu) else - menu_text = text - menu_text += "\t" - menu_text += accelerator - menu_text += "\t" - menu_text += description if description - menu_text = menu_text.strip - - if cmd_slot.attr_check.nil? - menu_type = FXMenuCommand - else - menu_type = FXMenuCheck - end - - cmd_slot.attr_fxmenu = menu_type.new(@menu, menu_text) do |menuitem| - menuitem.disable unless available - menuitem.check = true if cmd_slot.attr_check - menuitem.connect(SEL_COMMAND) { cmd_slot['actions/select'].invoke } - - # subscribe to that command slot only if not already done - # otherwise subscribers accumulate - unless @command_subscription[cmd_slot] - @command_subscription[cmd_slot] = cmd_slot.subscribe do |event, slot| - menuitem = slot.attr_fxmenu - if slot==cmd_slot && event==:notify_attribute_set - - # check whether enable/disable has changed - enabled = cmd_slot.attr_enable - unless enabled.nil? - if cmd_slot.attr_enable - menuitem.enable - else - menuitem.disable - end - end - - # check whether check/uncheck has changed - # in Fox this means changing the menu entry - # from FXMenuCommand to FXMenuCheck - # dynamically - checked = cmd_slot.attr_check - unless checked.nil? - if menuitem.instance_of? FXMenuCommand - menuitem_new = FXMenuCheck.new(@menu,menu_text) - menuitem_new.connect(SEL_COMMAND) { cmd_slot['actions/select'].invoke } - menuitem_new.create - menuitem_new.linkBefore(menuitem) - - menuitem.destroy - cmd_slot.attr_fxmenu = menuitem = menuitem_new - end - - if checked - menuitem.check = true - else - menuitem.check = false - end - - end - end - end - - end - end + build_menu_item(current_menu, cmd_slot, text, description, available, accelerator) end rescue => e puts "\nInternal error creating a menu pane: " + e + "\n" + e.backtrace.join("\n") @@ -161,9 +109,80 @@ @slot.attr_FXMenuTitle.menu = @menu end end - end # class Renderer + + + def build_menu_item(menu, cmd_slot, text, description, available, accelerator) + menu_text = text + menu_text += "\t" + menu_text += accelerator + menu_text += "\t" + menu_text += description if description + menu_text = menu_text.strip + + if cmd_slot.attr_check.nil? + menu_type = FXMenuCommand + else + menu_type = FXMenuCheck + end + + cmd_slot.attr_fxmenu = menu_type.new(menu, menu_text) do |menuitem| + menuitem.disable unless available + menuitem.check = true if cmd_slot.attr_check + menuitem.connect(SEL_COMMAND) { cmd_slot['actions/select'].invoke } + subscribe_to_command_slot(cmd_slot, menu, menu_text) + end + end + + def subscribe_to_command_slot(cmd_slot, menu, menu_text) + # subscribe to that command slot only if not already done + # otherwise subscribers accumulate + return if @command_subscription[cmd_slot] + + @command_subscription[cmd_slot] = cmd_slot.subscribe do |event, slot| + unless slot==cmd_slot && event==:notify_attribute_set + + menuitem = slot.attr_fxmenu + + # check whether enable/disable has changed + enabled = cmd_slot.attr_enable + unless enabled.nil? + if cmd_slot.attr_enable + menuitem.enable + else + menuitem.disable + end + end + + # check whether check/uncheck has changed + # in Fox this means changing the menu entry + # from FXMenuCommand to FXMenuCheck + # dynamically + checked = cmd_slot.attr_check + unless checked.nil? + if menuitem.instance_of? FXMenuCommand + menuitem_new = FXMenuCheck.new(menu,menu_text) + menuitem_new.connect(SEL_COMMAND) { cmd_slot['actions/select'].invoke } + menuitem_new.create + menuitem_new.linkBefore(menuitem) + + menuitem.destroy + cmd_slot.attr_fxmenu = menuitem = menuitem_new + end + + if checked + menuitem.check = true + else + menuitem.check = false + end + end #unless + + end #unless + end #block + end # method subscribe_to_command_slot + + end # class Renderer - end + end # class MenuPane end end # module FreeRIDE Index: plugins/rubyide_gui/component_layout.yaml =================================================================== RCS file: /var/cvs/freeride/freeride/plugins/rubyide_gui/component_layout.yaml,v retrieving revision 1.5 diff -u -r1.5 component_layout.yaml --- plugins/rubyide_gui/component_layout.yaml 31 Aug 2005 20:28:40 -0000 1.5 +++ plugins/rubyide_gui/component_layout.yaml 13 Sep 2005 18:16:14 -0000 @@ -48,14 +48,22 @@ - visible: true - Commands: '' "|": - - "1": App/File/New - - "2": App/File/Open - - "3": App/File/Close - - "4": App/File/CloseAll - - "5": App/File/Save - - "6": App/File/SaveAs - - "7": SEPARATOR - - "8": App/Exit + - "11": SUBMENU + "|": + - Text: Project + - Commands: '' + "|": + - "1": App/Project/New + - "2": App/Project/Open + - "12": SEPARATOR + - "13": App/File/New + - "14": App/File/Open + - "15": App/File/Close + - "16": App/File/CloseAll + - "17": App/File/Save + - "18": App/File/SaveAs + - "19": SEPARATOR + - "20": App/Exit - "2": '' "|": - Attributes: '' Index: plugins/rubyide_gui/component_manager.rb =================================================================== RCS file: /var/cvs/freeride/freeride/plugins/rubyide_gui/component_manager.rb,v retrieving revision 1.2 diff -u -r1.2 component_manager.rb --- plugins/rubyide_gui/component_manager.rb 27 Jan 2003 14:01:35 -0000 1.2 +++ plugins/rubyide_gui/component_manager.rb 13 Sep 2005 18:16:14 -0000 @@ -53,7 +53,14 @@ if menu_slot.has_child?("Commands") commands = [] menu_slot["Commands"].each_slot do |command_slot| - commands << command_slot.data + if command_slot.data!="SUBMENU" + commands << command_slot.data + else + submenu_hash = {} + submenu_hash["Text"] = command_slot["Text"] + submenu_hash["Commands"] = command_slot["Commands"] + commands << submenu_hash + end end menu.manager.commands = commands end Index: plugins/rubyide_gui/menupane.rb =================================================================== RCS file: /var/cvs/freeride/freeride/plugins/rubyide_gui/menupane.rb,v retrieving revision 1.3 diff -u -r1.3 menupane.rb --- plugins/rubyide_gui/menupane.rb 3 Dec 2004 21:24:02 -0000 1.3 +++ plugins/rubyide_gui/menupane.rb 13 Sep 2005 18:16:16 -0000 @@ -38,7 +38,7 @@ # Constructs a menupane # def initialize(plugin, base_slot) - @count = 0 + @count = 10 setup(plugin, base_slot) @cmd_mgr = plugin["/system/ui/commands"].manager @key_mgr = plugin["/system/ui/keys"].manager @@ -51,7 +51,7 @@ @base_slot.propagate_notifications = false; # remove any existing menuitems @base_slot.each_slot {|slot| slot.prune} - @count = 0 + @count = 10 command_list.each do |command_path| add_command(command_path) end @@ -64,6 +64,10 @@ next if slot.name=="actions" if slot.data=="SEPARATOR" yield slot, "SEPARATOR", nil, true, nil + elsif slot.data.kind_of?Hash + yield slot, "SUBMENU_END", slot.data["Text"].data, true, nil + elsif slot.data == nil + yield slot, "SUBMENU", nil, true, nil else command = @cmd_mgr.command(slot.data) keys = @key_mgr.get_binding(slot.data) @@ -120,12 +124,39 @@ ## # Add an new item at the end of the menupane's current command list + # + # command_path can be either a string or a hash + # If command_path is a string then a new entry will be made in the menu + # If command_path is a hash then it needs to provide the keys + # 'Text' and 'Commands' + # Commands is an array containing Strings or Hashes (lather rinse and repeat) # + # Two slots are created for a submenu, the start of the submenu and + # end of the submenu. + # The start-slot contains nil for data, the end-slot contains the hash def add_command(command_path) begin slot = @base_slot[@count.to_s] slot.data = command_path @count += 1 + + if command_path.kind_of?Hash + slot.data = nil + command_path["Commands"].each_slot do |slot| + if slot.data == "SUBMENU" + submenu_hash = {} + submenu_hash["Text"] = slot["Text"] + submenu_hash["Commands"] = slot["Commands"] + add_command(submenu_hash) + else + add_command(slot.data) + end + end + @base_slot[@count.to_s].data = command_path + @count += 1 + return + end + unless command_path=="SEPARATOR" cmd = @cmd_mgr.command(command_path) slot['actions/select'].set_proc {cmd.invoke} Index: plugins/rubyide_tools_debugger/debugger.rb =================================================================== RCS file: /var/cvs/freeride/freeride/plugins/rubyide_tools_debugger/debugger.rb,v retrieving revision 1.31 diff -u -r1.31 debugger.rb --- plugins/rubyide_tools_debugger/debugger.rb 29 Mar 2005 21:51:16 -0000 1.31 +++ plugins/rubyide_tools_debugger/debugger.rb 13 Sep 2005 18:16:21 -0000 @@ -79,6 +79,7 @@ # Insert the debugger menu item in the run menu and bind it # to the F10 key runmenu = plugin["/system/ui/components/MenuPane/Run_menu"].manager + puts "runmenu debug-info #{runmenu.class} #{runmenu.respond_to?(:add_command)}" runmenu.add_command("App/Run/Debugger") key_mgr = plugin['/system/ui/keys'].manager From roys at mindspring.com Tue Sep 13 17:34:40 2005 From: roys at mindspring.com (Roy Sutton) Date: Tue Sep 13 17:27:43 2005 Subject: [FR-devel] Submenu patch In-Reply-To: <43273C12.1050400@xs4all.nl> References: <43273C12.1050400@xs4all.nl> Message-ID: <432745F0.3060304@mindspring.com> Jonathan, Excellent work! You've raised a couple issues I'm going to throw some thoughts out at. First, if we are considering moving to wxRuby when it's ready it seems somewhat poor form to have so much based off modules with the name 'Fox' embedded right into them. So many modules have load dependencies on these it's bound to lead to all sorts of problems when we/if we move. Of course, I'm not advocating we go about making changes before they're necessary. Second, in my forthcoming FR patch (yes, I know it's quite late :) ) I will likely be adding a new flag to commands that can have remappable keyboard shortcuts. This will allow my code to parse through the command tree to find commands that can be mapped to shortcut keys. I've been quite caught up in wxRuby so I won't make any promises on this code. We'll need to figure out a clean method to have the different modules save out their keymappings. Of course, the alternative is just to re-wire them all after all modules load. Roy Jonathan Maasland wrote: > Laurent, > > I finished building and testing submenu-support for FreeRIDE. There is > no limit to the depth of the sub-menus. (should anyone wonder) > The reason I built it is because I thought all the project-related > commands might be nicely placed inside their own submenu > From laurent at moldus.org Wed Sep 14 02:42:36 2005 From: laurent at moldus.org (Laurent Julliard) Date: Wed Sep 14 02:35:24 2005 Subject: [FR-devel] Multiple interpreters patch In-Reply-To: <43220994.9040105@xs4all.nl> References: <431ADF11.8000304@xs4all.nl> <431BE0DB.7030300@moldus.org> <43220994.9040105@xs4all.nl> Message-ID: <4327C65C.9050704@moldus.org> Jonathan Maasland wrote: > Sorry I haven't responded sooner. Today was the first oppurtunity I had > to test the code on Windows. > As could be expected I found a couple a glitches. I attached a > completely new patch, made against the current cvs-tree. > Also the new fox_ruby_configurator.rb is attached. > > Next monday I'll start working on project-support. I don't know how long > I'll need but I'm hoping for a week and a half or less. You'll be > hearing from me soon :) > > Jonathan > > Laurent Julliard wrote: > > Jonathan, I have applied th patch and put it into the CVS repo. Works well. One remark though: I think it would be great if you could align the main Debugger/Run preference panel with the new onw because in the main one you can still choose a path to Ruby interpreter and users won't know which one is used. I understand from your patch that this is the default target that is used, right? So I think one thing you could do is to replace the "Path to Ruby" filed of the main panen by a drop-down select box where you can choose from one the interpretors by name (as defined in your panel) and keep the command line parameters and working dir in the main panel for now. What do you think? Laurent From nochoice at xs4all.nl Wed Sep 14 14:15:13 2005 From: nochoice at xs4all.nl (Jonathan Maasland) Date: Wed Sep 14 12:06:07 2005 Subject: [FR-devel] Multiple interpreters patch In-Reply-To: <4327C65C.9050704@moldus.org> References: <431ADF11.8000304@xs4all.nl> <431BE0DB.7030300@moldus.org> <43220994.9040105@xs4all.nl> <4327C65C.9050704@moldus.org> Message-ID: <432868B1.7050006@xs4all.nl> Laurent, Thanks for looking at the patch and checking it in. I really like your suggestion, I'll look into it tomorrow. Jonathan Laurent Julliard wrote: > Jonathan, > > I have applied th patch and put it into the CVS repo. Works well. One > remark though: I think it would be great if you could align the main > Debugger/Run preference panel with the new onw because in the main one > you can still choose a path to Ruby interpreter and users won't know > which one is used. I understand from your patch that this is the > default target that is used, right? > > So I think one thing you could do is to replace the "Path to Ruby" > filed of the main panen by a drop-down select box where you can choose > from one the interpretors by name (as defined in your panel) and keep > the command line parameters and working dir in the main panel for now. > > What do you think? > > Laurent > _______________________________________________ > Freeride-devel mailing list > Freeride-devel@rubyforge.org > http://rubyforge.org/mailman/listinfo/freeride-devel > > From nochoice at xs4all.nl Wed Sep 14 14:45:11 2005 From: nochoice at xs4all.nl (Jonathan Maasland) Date: Wed Sep 14 12:36:05 2005 Subject: [FR-devel] Submenu patch In-Reply-To: <432745F0.3060304@mindspring.com> References: <43273C12.1050400@xs4all.nl> <432745F0.3060304@mindspring.com> Message-ID: <43286FB7.40405@xs4all.nl> Roy Sutton wrote: > Jonathan, > > Excellent work! You've raised a couple issues I'm going to throw some > thoughts out at. First, if we are considering moving to wxRuby when > it's ready it seems somewhat poor form to have so much based off > modules with the name 'Fox' embedded right into them. So many modules > have load dependencies on these it's bound to lead to all sorts of > problems when we/if we move. Of course, I'm not advocating we go > about making changes before they're necessary. > Hi Roy, I agree with you, it's going to be complex when the change-over is there. However, just as you said, I also don't believe in making changes before they're necessary. Perhaps chopping up methods into smaller pieces but that is just good practice anyway. Also I'm very curious what Laurent and Curt (you still here?) think about this topic. > Second, in my forthcoming FR patch (yes, I know it's quite late :) ) I > will likely be adding a new flag to commands that can have remappable > keyboard shortcuts. This will allow my code to parse through the > command tree to find commands that can be mapped to shortcut keys. > I've been quite caught up in wxRuby so I won't make any promises on > this code. Nice! Sounds really great.... I'm looking forward to seeing your patch. > We'll need to figure out a clean method to have the different > modules save out their keymappings. Of course, the alternative is > just to re-wire them all after all modules load. > > Roy The alternative you suggerst seems, to me at least, to be a clean and simple solution..... I don't know how else you'd want to do it (while still keeping it DRY) Jonathan From curt.hibbs at gmail.com Wed Sep 14 14:02:49 2005 From: curt.hibbs at gmail.com (Curt Hibbs) Date: Wed, 14 Sep 2005 13:02:49 -0500 Subject: [FR-devel] Submenu patch In-Reply-To: <43286FB7.40405@xs4all.nl> References: <43273C12.1050400@xs4all.nl> <432745F0.3060304@mindspring.com> <43286FB7.40405@xs4all.nl> Message-ID: <31d15f4905091411028f7fc49@mail.gmail.com> On 9/14/05, Jonathan Maasland wrote: > > Roy Sutton wrote: > > > Jonathan, > > > > Excellent work! You've raised a couple issues I'm going to throw some > > thoughts out at. First, if we are considering moving to wxRuby when > > it's ready it seems somewhat poor form to have so much based off > > modules with the name 'Fox' embedded right into them. So many modules > > have load dependencies on these it's bound to lead to all sorts of > > problems when we/if we move. Of course, I'm not advocating we go > > about making changes before they're necessary. > > > Hi Roy, > > I agree with you, it's going to be complex when the change-over is > there. However, just as you said, I also don't believe in making changes > before they're necessary. Perhaps chopping up methods into smaller > pieces but that is just good practice anyway. > > Also I'm very curious what Laurent and Curt (you still here?) think > about this topic. Yeah, I'm still here! These days I lurk more than anything else as my other Ruby efforts already absorb more of my free time than I actually have. :-( When I did the original design/implementation for FreeRIDE's GUI, the idea was to try to isolate the GUI rendering behind the insulating layer of the Databus. Then, theoretically, you could simply drop in an alternative GUI rendering system. I know that separation hasn't worked out to be a clean as it was originally envisioned, but its still pretty good. I also agree that we shouldn't do anything until we're ready to work on the replacement (although we should avoid making the dependency problem worse). Its better to tackle the actual issues when we face them than to try to guess what they are in advance. Curt -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/freeride-devel/attachments/20050914/0d984895/attachment.htm From nochoice at xs4all.nl Wed Sep 14 23:26:31 2005 From: nochoice at xs4all.nl (Jonathan Maasland) Date: Thu, 15 Sep 2005 03:26:31 +0000 Subject: [FR-devel] Multiple interpreters patch In-Reply-To: <432868B1.7050006@xs4all.nl> References: <431ADF11.8000304@xs4all.nl> <431BE0DB.7030300@moldus.org> <43220994.9040105@xs4all.nl> <4327C65C.9050704@moldus.org> <432868B1.7050006@xs4all.nl> Message-ID: <4328E9E7.4090805@xs4all.nl> I couldn't sleep so I decided to implement your proposed enhancement. I made a couple of other (small) changes along the way. Patch is attached. Jonathan (it's 3.20am now btw :) ) Jonathan Maasland wrote: >Laurent, > >Thanks for looking at the patch and checking it in. >I really like your suggestion, I'll look into it tomorrow. > >Jonathan > >Laurent Julliard wrote: > > > >>Jonathan, >> >>I have applied th patch and put it into the CVS repo. Works well. One >>remark though: I think it would be great if you could align the main >>Debugger/Run preference panel with the new onw because in the main one >>you can still choose a path to Ruby interpreter and users won't know >>which one is used. I understand from your patch that this is the >>default target that is used, right? >> >>So I think one thing you could do is to replace the "Path to Ruby" >>filed of the main panen by a drop-down select box where you can choose >>from one the interpretors by name (as defined in your panel) and keep >>the command line parameters and working dir in the main panel for now. >> >>What do you think? >> >>Laurent >>_______________________________________________ >>Freeride-devel mailing list >>Freeride-devel at rubyforge.org >>http://rubyforge.org/mailman/listinfo/freeride-devel >> >> >> >> > >_______________________________________________ >Freeride-devel mailing list >Freeride-devel at rubyforge.org >http://rubyforge.org/mailman/listinfo/freeride-devel > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/freeride-devel/attachments/20050915/0a6c2da8/attachment-0001.htm -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: debug_config.patch Url: http://rubyforge.org/pipermail/freeride-devel/attachments/20050915/0a6c2da8/debug_config-0001.bat From greg.chrystall at gmail.com Wed Sep 14 21:40:41 2005 From: greg.chrystall at gmail.com (Greg Chrystall) Date: Thu, 15 Sep 2005 13:40:41 +1200 Subject: [FR-devel] HI All Message-ID: I am new to this whole list thing, but thought I would introduce myself. I have only been a ruby enthusiast for a year or so. I think ruby is great though! I am a kiwi - ie New Zealand (lord of the rings, once were warriors etc) and have just finished my BSC computer science, at the University of Auckland. I have unfortunately been "bought" by a recruitment agency... so it looks like the dream of a programming job will have to wait! I don't feel too bad thought because I think working on open source will be more fun! Anyway, what I want to work on is code completion for freeRide... But if you would like help elsewhere let me know, bearing in mind that I am a newbie to the whole open source methodology. Thanks, Greg -- Greg Chrystall greg.chrystall at gmail.com 027 696 7464 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/freeride-devel/attachments/20050915/8b68c935/attachment.htm From roys at mindspring.com Wed Sep 14 23:12:37 2005 From: roys at mindspring.com (Roy Sutton) Date: Wed, 14 Sep 2005 23:12:37 -0400 Subject: [FR-devel] Patch to work with Fox 1.4 installed Message-ID: <4328E6A5.6010601@mindspring.com> Note: This patch does -not- allow FreeRIDE to work with FXRuby 1.4. It just allows it to work with FXRuby 1.4 installed on the same system. Roy -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: appframe.rb.patch Url: http://rubyforge.org/pipermail/freeride-devel/attachments/20050914/3bf0c845/appframe.rb.bat From nochoice at xs4all.nl Thu Sep 15 01:42:51 2005 From: nochoice at xs4all.nl (Jonathan Maasland) Date: Thu, 15 Sep 2005 05:42:51 +0000 Subject: [FR-devel] HI All In-Reply-To: References: Message-ID: <432909DB.2040704@xs4all.nl> Hi Greg, Let me be the first to welcome you here :) I'm Jonathan, from the Netherlands, and I'm currently working on FreeRIDE for a school project. (see mailinglist-archive) I really like the idea of code-completion hower I think that it is somewhat difficult if not downright impossible :( Ruby's type-system is dynamically bound so you can never be 100% sure of the object-type (or supported methods) As a simple example, how would you handle: if cmd_slot.attr_check.nil? menu_type = FXMenuCommand else menu_type = FXMenuCheck end x = menu_type.new(@main,menu_text) x. I don't think a solution exists because of Ruby's nature. I hope I'm wrong about this but I'm afraid not. My advice would be to start reading up on the information in the Wiki. http://freeride.rubyforge.org/wiki/wiki.pl?DevDoc Learn how the databus-architecure works. It's quite easy to grasp, works really nice and is an essential part of FreeRIDE. Next you could try to create your own simple plugin and work your way into FreeRIDE and Fox. You'll need the Fox api-ref at http://www.fox-toolkit.org/ref12/classes.html and possibly the FxRuby api at http://www.fxruby.org/doc/api/ Both contain very limited descriptions and I use 'm mostly for finding the methods I need. Try to keep things simple and watch your error-log. I hope this helped you in some way. Good luck and have fun! Jonathan Greg Chrystall wrote: > I am new to this whole list thing, but thought I would introduce myself. > > I have only been a ruby enthusiast for a year or so. I think ruby is > great though! > > I am a kiwi - ie New Zealand (lord of the rings, once were warriors > etc) and have just finished my BSC computer science, at the University > of Auckland. I have unfortunately been "bought" by a recruitment > agency... so it looks like the dream of a programming job will have to > wait! I don't feel too bad thought because I think working on open > source will be more fun! > > Anyway, what I want to work on is code completion for freeRide... But > if you would like help elsewhere let me know, bearing in mind that I > am a newbie to the whole open source methodology. > > Thanks, > > Greg > > -- > Greg Chrystall > greg.chrystall at gmail.com > 027 696 7464 > >------------------------------------------------------------------------ > >_______________________________________________ >Freeride-devel mailing list >Freeride-devel at rubyforge.org >http://rubyforge.org/mailman/listinfo/freeride-devel > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/freeride-devel/attachments/20050915/c283cf0b/attachment.htm From roys at mindspring.com Wed Sep 14 23:50:32 2005 From: roys at mindspring.com (Roy Sutton) Date: Wed, 14 Sep 2005 23:50:32 -0400 Subject: [FR-devel] HI All In-Reply-To: <432909DB.2040704@xs4all.nl> References: <432909DB.2040704@xs4all.nl> Message-ID: <4328EF88.9090307@mindspring.com> Hello Greg, I thought I would also note for the list that there are a lot more prosaic uses for code completion, such as templating, that will work just fine with ruby. Jonathan is right, though, that much of the fancier code completion that you can do with strongly typed languages just doesn't work too well with ruby. Roy Jonathan Maasland wrote: > Hi Greg, > > Let me be the first to welcome you here :) > I'm Jonathan, from the Netherlands, and I'm currently working on > FreeRIDE for a school project. (see mailinglist-archive) > > I really like the idea of code-completion hower I think that it is > somewhat difficult if not downright impossible :( > Ruby's type-system is dynamically bound so you can never be 100% sure > of the object-type (or supported methods) > > As a simple example, how would you handle: > > if cmd_slot.attr_check.nil? > menu_type = FXMenuCommand > else > menu_type = FXMenuCheck > end > x = menu_type.new(@main,menu_text) > x. > > I don't think a solution exists because of Ruby's nature. I hope I'm > wrong about this but I'm afraid not. > > My advice would be to start reading up on the information in the Wiki. > http://freeride.rubyforge.org/wiki/wiki.pl?DevDoc > Learn how the databus-architecure works. It's quite easy to grasp, > works really nice and is an essential part of FreeRIDE. > > Next you could try to create your own simple plugin and work your way > into FreeRIDE and Fox. > You'll need the Fox api-ref at > http://www.fox-toolkit.org/ref12/classes.html and possibly the FxRuby > api at http://www.fxruby.org/doc/api/ > Both contain very limited descriptions and I use 'm mostly for finding > the methods I need. > > Try to keep things simple and watch your error-log. > > I hope this helped you in some way. > Good luck and have fun! > > Jonathan > > Greg Chrystall wrote: >> I am new to this whole list thing, but thought I would introduce myself. >> >> I have only been a ruby enthusiast for a year or so. I think ruby is >> great though! >> >> I am a kiwi - ie New Zealand (lord of the rings, once were warriors >> etc) and have just finished my BSC computer science, at the >> University of Auckland. I have unfortunately been "bought" by a >> recruitment agency... so it looks like the dream of a programming job >> will have to wait! I don't feel too bad thought because I think >> working on open source will be more fun! >> >> Anyway, what I want to work on is code completion for freeRide... But >> if you would like help elsewhere let me know, bearing in mind that I >> am a newbie to the whole open source methodology. >> >> Thanks, >> >> Greg >> >> -- >> Greg Chrystall >> greg.chrystall at gmail.com >> 027 696 7464 >> ------------------------------------------------------------------------ >> >> _______________________________________________ >> Freeride-devel mailing list >> Freeride-devel at rubyforge.org >> http://rubyforge.org/mailman/listinfo/freeride-devel >> > > ------------------------------------------------------------------------ > > _______________________________________________ > Freeride-devel mailing list > Freeride-devel at rubyforge.org > http://rubyforge.org/mailman/listinfo/freeride-devel > From curt.hibbs at gmail.com Thu Sep 15 00:12:31 2005 From: curt.hibbs at gmail.com (Curt Hibbs) Date: Wed, 14 Sep 2005 23:12:31 -0500 Subject: [FR-devel] HI All In-Reply-To: <4328EF88.9090307@mindspring.com> References: <432909DB.2040704@xs4all.nl> <4328EF88.9090307@mindspring.com> Message-ID: <31d15f4905091421123969ee21@mail.gmail.com> You can't have the accuracy of code-completion that you can get with statically typed languages, but you can still do quite a bit. First I'd google for ruby and code completion, because this topic has been discussed several times before (on ruby-talk), and you may get some good information from them. Also, try researching code completion in Smalltalk. Smalltalk would pose the same problems as Ruby and while I don't specifically know of any code completion work in Smalltalk, they have a very intelligent community and you just may find some useful approaches. Good luck! Curt On 9/14/05, Roy Sutton wrote: > > Hello Greg, > > I thought I would also note for the list that there are a lot more > prosaic uses for code completion, such as templating, that will work > just fine with ruby. Jonathan is right, though, that much of the > fancier code completion that you can do with strongly typed languages > just doesn't work too well with ruby. > > Roy > > Jonathan Maasland wrote: > > Hi Greg, > > > > Let me be the first to welcome you here :) > > I'm Jonathan, from the Netherlands, and I'm currently working on > > FreeRIDE for a school project. (see mailinglist-archive) > > > > I really like the idea of code-completion hower I think that it is > > somewhat difficult if not downright impossible :( > > Ruby's type-system is dynamically bound so you can never be 100% sure > > of the object-type (or supported methods) > > > > As a simple example, how would you handle: > > > > if cmd_slot.attr_check.nil? > > menu_type = FXMenuCommand > > else > > menu_type = FXMenuCheck > > end > > x = menu_type.new(@main,menu_text) > > x. > > > > I don't think a solution exists because of Ruby's nature. I hope I'm > > wrong about this but I'm afraid not. > > > > My advice would be to start reading up on the information in the Wiki. > > http://freeride.rubyforge.org/wiki/wiki.pl?DevDoc > > Learn how the databus-architecure works. It's quite easy to grasp, > > works really nice and is an essential part of FreeRIDE. > > > > Next you could try to create your own simple plugin and work your way > > into FreeRIDE and Fox. > > You'll need the Fox api-ref at > > http://www.fox-toolkit.org/ref12/classes.html and possibly the FxRuby > > api at http://www.fxruby.org/doc/api/ > > Both contain very limited descriptions and I use 'm mostly for finding > > the methods I need. > > > > Try to keep things simple and watch your error-log. > > > > I hope this helped you in some way. > > Good luck and have fun! > > > > Jonathan > > > > Greg Chrystall wrote: > >> I am new to this whole list thing, but thought I would introduce > myself. > >> > >> I have only been a ruby enthusiast for a year or so. I think ruby is > >> great though! > >> > >> I am a kiwi - ie New Zealand (lord of the rings, once were warriors > >> etc) and have just finished my BSC computer science, at the > >> University of Auckland. I have unfortunately been "bought" by a > >> recruitment agency... so it looks like the dream of a programming job > >> will have to wait! I don't feel too bad thought because I think > >> working on open source will be more fun! > >> > >> Anyway, what I want to work on is code completion for freeRide... But > >> if you would like help elsewhere let me know, bearing in mind that I > >> am a newbie to the whole open source methodology. > >> > >> Thanks, > >> > >> Greg > >> > >> -- > >> Greg Chrystall > >> greg.chrystall at gmail.com > >> 027 696 7464 > >> > ------------------------------------------------------------------------ > >> > >> _______________________________________________ > >> Freeride-devel mailing list > >> Freeride-devel at rubyforge.org > >> http://rubyforge.org/mailman/listinfo/freeride-devel > >> > > > > ------------------------------------------------------------------------ > > > > _______________________________________________ > > Freeride-devel mailing list > > Freeride-devel at rubyforge.org > > http://rubyforge.org/mailman/listinfo/freeride-devel > > > > _______________________________________________ > Freeride-devel mailing list > Freeride-devel at rubyforge.org > http://rubyforge.org/mailman/listinfo/freeride-devel > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/freeride-devel/attachments/20050914/17a1af68/attachment-0001.htm From wxruby at qualitycode.com Thu Sep 15 09:28:23 2005 From: wxruby at qualitycode.com (Kevin Smith) Date: Thu, 15 Sep 2005 09:28:23 -0400 Subject: [FR-devel] Refactoring and code completion in dynamic languages (was: HI All) In-Reply-To: <31d15f4905091421123969ee21@mail.gmail.com> References: <432909DB.2040704@xs4all.nl> <4328EF88.9090307@mindspring.com> <31d15f4905091421123969ee21@mail.gmail.com> Message-ID: <432976F7.4070704@qualitycode.com> Curt Hibbs wrote: > You can't have the accuracy of code-completion that you can get with > statically typed languages, but you can still do quite a bit. > > First I'd google for ruby and code completion, because this topic has been > discussed several times before (on ruby-talk), and you may get some good > information from them. > > Also, try researching code completion in Smalltalk. Smalltalk would pose the > same problems as Ruby and while I don't specifically know of any code > completion work in Smalltalk, they have a very intelligent community and you > just may find some useful approaches. Indeed. This topic is quite similar to automated refactoring, which the smalltalk community practically invented. It looks like my earlier post to this list on this topic was before the freeride shift to rubyforge, so I don't know where it might be archived. I was curious how the smalltalk folks managed to do smart refactoring in a dynamic language. I finally found a couple papers that described it. Basically, they assume that each app has a comprehensive unit test suite that can run quickly. When the user chooses a refactoring (e.g. "rename class"), they install some hooks and run the unit tests, accumulating a full call tree of the system. Then they use that data to perform the refactoring. Any code paths that are not covered by the unit tests won't get refactored properly. It sounds fragile, but certainly would be a strong encouragement to build fast, complete unit tests. The same mechanism could clearly be used for code-completion. The Anjuta IDE uses a far simpler (but less accurate) alternative for code-completion. Half the time it works great, and half the time it's a bit annoying, so overall I'm not sure if it's worthwhile or not. Of course, you can turn it off if you don't like it. Basically, it just memorizes every token it has seen. When you type a dot and a few letters, it brings up a popup with suggested tokens that match what you've typed so far. There is no intelligence there--just simple string matching. Kevin From curt.hibbs at gmail.com Thu Sep 15 10:18:20 2005 From: curt.hibbs at gmail.com (Curt Hibbs) Date: Thu, 15 Sep 2005 09:18:20 -0500 Subject: [FR-devel] Refactoring and code completion in dynamic languages (was: HI All) In-Reply-To: <432976F7.4070704@qualitycode.com> References: <432909DB.2040704@xs4all.nl> <4328EF88.9090307@mindspring.com> <31d15f4905091421123969ee21@mail.gmail.com> <432976F7.4070704@qualitycode.com> Message-ID: <31d15f490509150718a8a8eb9@mail.gmail.com> On 9/15/05, Kevin Smith wrote: > > > Basically, it just memorizes every token it has seen. When you type a > dot and a few letters, it brings up a popup with suggested tokens that > match what you've typed so far. There is no intelligence there--just > simple string matching. Interesting approach. I wonder if this quick'n'dirty start has some simple optimization that could reduce the annoyances and boost the usefulness? Curt -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/freeride-devel/attachments/20050915/4bb3867c/attachment.htm From laurent at moldus.org Fri Sep 16 03:39:32 2005 From: laurent at moldus.org (Laurent Julliard) Date: Fri, 16 Sep 2005 09:39:32 +0200 Subject: [FR-devel] Multiple interpreters patch In-Reply-To: <4328E9E7.4090805@xs4all.nl> References: <431ADF11.8000304@xs4all.nl> <431BE0DB.7030300@moldus.org> <43220994.9040105@xs4all.nl> <4327C65C.9050704@moldus.org> <432868B1.7050006@xs4all.nl> <4328E9E7.4090805@xs4all.nl> Message-ID: <432A76B4.4090009@moldus.org> Jonathan Maasland wrote: > I couldn't sleep so I decided to implement your proposed enhancement. I > made a couple of other (small) changes along the way. Patch is attached. > > Jonathan > > (it's 3.20am now btw :) ) > That's not good.... You should be sleeping by that time :-) I have integrated, tested and committed your patch in the CVS repo. Laurent From laurent at moldus.org Fri Sep 16 03:56:50 2005 From: laurent at moldus.org (Laurent Julliard) Date: Fri, 16 Sep 2005 09:56:50 +0200 Subject: [FR-devel] Submenu patch In-Reply-To: <43273C12.1050400@xs4all.nl> References: <43273C12.1050400@xs4all.nl> Message-ID: <432A7AC2.9000102@moldus.org> Jonathan Maasland wrote: > Laurent, > > I finished building and testing submenu-support for FreeRIDE. There is > no limit to the depth of the sub-menus. (should anyone wonder) > The reason I built it is because I thought all the project-related > commands might be nicely placed inside their own submenu. > > One issue though is that I'm unsure where to place the project submenu > in the File_menu. ATM I've parked it at the top. If you have another > idea then please go ahead and change it. > > The functionality for the two newly accessible menu-options (new project > and open project) I plan to build this week. > > On the way I split rubyide_fox_gui/menupane.rb#update into three shorter > methods. My mind was starting to ache trying to understand the flow of > that piece of code. Hope you don't mind, I think it's an improvement :) > > Another small thing that caught my eye was that in > rubyide_gui/menupane.rb @count.to_s is used as the key for the > command-slot. Imagine (or just test) having more than 10 menu-items.... > "10" comes after "1" but before "2" > Easy fix of course (included in the patch) but I noticed similar > behaviour in .yaml files with stringified numbers... > Any thoughts? > > Thanks again. > Jonathan > The patch is in the CVS repo except for a puts statement in debugger.rb that was there for debugging purposes only as far as I could tell. LJ From laurent at moldus.org Fri Sep 16 04:03:41 2005 From: laurent at moldus.org (Laurent Julliard) Date: Fri, 16 Sep 2005 10:03:41 +0200 Subject: [FR-devel] Patch to work with Fox 1.4 installed In-Reply-To: <4328E6A5.6010601@mindspring.com> References: <4328E6A5.6010601@mindspring.com> Message-ID: <432A7C5D.6080802@moldus.org> Roy Sutton wrote: > Note: This patch does -not- allow FreeRIDE to work with FXRuby 1.4. It > just allows it to work with FXRuby 1.4 installed on the same system. > > Roy > Roy, This is the shortest and most useful patch I have ever seen on this ML !! I have just committed the change to the CVS repo. LJ From nochoice at xs4all.nl Fri Sep 16 09:10:51 2005 From: nochoice at xs4all.nl (Jonathan Maasland) Date: Fri, 16 Sep 2005 13:10:51 +0000 Subject: [FR-devel] Submenu patch In-Reply-To: <432A7AC2.9000102@moldus.org> References: <43273C12.1050400@xs4all.nl> <432A7AC2.9000102@moldus.org> Message-ID: <432AC45B.3020608@xs4all.nl> Laurent, I'm really sorry but I made an amazingly stupid error which broke FreeRIDE. I'm completely baffled as to why I didn't see this before but anyways here is the fix. I'll do my best to do more testing before submitting my patches... Jonathan Laurent Julliard wrote: >The patch is in the CVS repo except for a puts statement in >debugger.rb that was there for debugging purposes only as far as I >could tell. > >LJ >_______________________________________________ >Freeride-devel mailing list >Freeride-devel at rubyforge.org >http://rubyforge.org/mailman/listinfo/freeride-devel > > > > -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: menufix.patch Url: http://rubyforge.org/pipermail/freeride-devel/attachments/20050916/c920ad22/menufix.bat From laurent at moldus.org Fri Sep 16 09:00:21 2005 From: laurent at moldus.org (Laurent Julliard) Date: Fri, 16 Sep 2005 15:00:21 +0200 Subject: [FR-devel] Submenu patch In-Reply-To: <432AC45B.3020608@xs4all.nl> References: <43273C12.1050400@xs4all.nl> <432A7AC2.9000102@moldus.org> <432AC45B.3020608@xs4all.nl> Message-ID: <432AC1E5.6030202@moldus.org> Jonathan Maasland wrote: > Laurent, > > I'm really sorry but I made an amazingly stupid error which broke FreeRIDE. > I'm completely baffled as to why I didn't see this before but anyways > here is the fix. > > I'll do my best to do more testing before submitting my patches... > > Jonathan > No problem. It's in CVS. By the way if you are familiar with CVS I'm ready to give you access to the CVS repo. We just need to agree on a way to work together: it might be better for you to create your own branch if you believe you are going to break a number of things for sometime. Let me know what you think? In any case I suggest that you first create your own account on http://rubyforge.org Laurent From nochoice at xs4all.nl Fri Sep 16 12:18:00 2005 From: nochoice at xs4all.nl (Jonathan Maasland) Date: Fri, 16 Sep 2005 16:18:00 +0000 Subject: [FR-devel] Submenu patch In-Reply-To: <432AC1E5.6030202@moldus.org> References: <43273C12.1050400@xs4all.nl> <432A7AC2.9000102@moldus.org> <432AC45B.3020608@xs4all.nl> <432AC1E5.6030202@moldus.org> Message-ID: <432AF038.107@xs4all.nl> I'm really excited that you're willing to give me commit-access to the repo. I'm familiar with the basics of CVS so I guess I'll be doing some re-reading this weekend, never really bothered with branches before. Working in a branch of my own seems only logical to do. Besides keeping the main-branch stable, I can make a silly mistake without everyone knowing about it :) I've created a rubyforge account, my username is jonathanm. Thank you so very much!! You completely made my day! Jonathan Laurent Julliard wrote: >No problem. It's in CVS. By the way if you are familiar with CVS I'm >ready to give you access to the CVS repo. We just need to agree on a >way to work together: it might be better for you to create your own >branch if you believe you are going to break a number of things for >sometime. Let me know what you think? > >In any case I suggest that you first create your own account on >http://rubyforge.org > >Laurent >_______________________________________________ >Freeride-devel mailing list >Freeride-devel at rubyforge.org >http://rubyforge.org/mailman/listinfo/freeride-devel > > > > From laurent at moldus.org Fri Sep 16 11:16:48 2005 From: laurent at moldus.org (Laurent Julliard) Date: Fri, 16 Sep 2005 17:16:48 +0200 Subject: [FR-devel] Submenu patch In-Reply-To: <432AF038.107@xs4all.nl> References: <43273C12.1050400@xs4all.nl> <432A7AC2.9000102@moldus.org> <432AC45B.3020608@xs4all.nl> <432AC1E5.6030202@moldus.org> <432AF038.107@xs4all.nl> Message-ID: <432AE1E0.4000705@moldus.org> Jonathan Maasland wrote: > I'm really excited that you're willing to give me commit-access to the > repo. I'm familiar with the basics of CVS so I guess I'll be doing some > re-reading this weekend, never really bothered with branches before. > > Working in a branch of my own seems only logical to do. Besides keeping > the main-branch stable, I can make a silly mistake without everyone > knowing about it :) > > I've created a rubyforge account, my username is jonathanm. > > Thank you so very much!! You completely made my day! > > Jonathan Ok. So you are now a project member with CVS write permission. What I suggest is the following: - You first tag the repository as it is today with a tag like FR_XXXX where XXXX is the name you want to give to your project - The create a tag branch from there FR_XXXXXX_ BRANCH and you now start working in isolation. - There is not much to say about the commit process except that we want the log message to be a) very explicit, b) to refer any bug or task number if it fixes one of those and c) to keep the Changelog file current with each of your commit. If you have any question please feel free to ask. Laurent From roys at mindspring.com Fri Sep 16 13:25:07 2005 From: roys at mindspring.com (Roy Sutton) Date: Fri, 16 Sep 2005 13:25:07 -0400 Subject: [FR-devel] Latest tarball Message-ID: <432AFFF3.2010006@mindspring.com> The latest tarball appears to be a bit more unstable than previous versions. I have gotten a few instances of: .../menupane.rb:150:in `subscribe_to_command_slot': undefined method `enable' for nil:NilClass (NoMethodError) from C:/RubyDev/FreeRIDE/freeride/./plugins/rubyide_fox_gui/menupane.rb:141:in `call' from C:/RubyDev/FreeRIDE/freeride/freebase/lib/freebase/databus.rb:612:in `notify' ... I got this from cancelling a find and from hitting escape when looking at the code templates. Further, selecting 'code assist' locks free ride until I send a break to it. I will drege up my old version and see if it happens there, too. Roy From curt.hibbs at gmail.com Fri Sep 16 13:43:07 2005 From: curt.hibbs at gmail.com (Curt Hibbs) Date: Fri, 16 Sep 2005 12:43:07 -0500 Subject: [FR-devel] Submenu patch In-Reply-To: <432AF038.107@xs4all.nl> References: <43273C12.1050400@xs4all.nl> <432A7AC2.9000102@moldus.org> <432AC45B.3020608@xs4all.nl> <432AC1E5.6030202@moldus.org> <432AF038.107@xs4all.nl> Message-ID: <31d15f4905091610435c06f74a@mail.gmail.com> What operating system do you use? If its Windows, I highly recommend using TortoiseCVS as your client. Curt On 9/16/05, Jonathan Maasland wrote: > > I'm really excited that you're willing to give me commit-access to the > repo. I'm familiar with the basics of CVS so I guess I'll be doing some > re-reading this weekend, never really bothered with branches before. > > Working in a branch of my own seems only logical to do. Besides keeping > the main-branch stable, I can make a silly mistake without everyone > knowing about it :) > > I've created a rubyforge account, my username is jonathanm. > > Thank you so very much!! You completely made my day! > > Jonathan > > Laurent Julliard wrote: > > >No problem. It's in CVS. By the way if you are familiar with CVS I'm > >ready to give you access to the CVS repo. We just need to agree on a > >way to work together: it might be better for you to create your own > >branch if you believe you are going to break a number of things for > >sometime. Let me know what you think? > > > >In any case I suggest that you first create your own account on > >http://rubyforge.org > > > >Laurent > >_______________________________________________ > >Freeride-devel mailing list > >Freeride-devel at rubyforge.org > >http://rubyforge.org/mailman/listinfo/freeride-devel > > > > > > > > > > _______________________________________________ > Freeride-devel mailing list > Freeride-devel at rubyforge.org > http://rubyforge.org/mailman/listinfo/freeride-devel > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/freeride-devel/attachments/20050916/17b87d10/attachment-0001.htm From laurent at moldus.org Sat Sep 17 08:27:09 2005 From: laurent at moldus.org (Laurent Julliard) Date: Sat, 17 Sep 2005 14:27:09 +0200 Subject: [FR-devel] Latest tarball In-Reply-To: <432AFFF3.2010006@mindspring.com> References: <432AFFF3.2010006@mindspring.com> Message-ID: <432C0B9D.9060101@moldus.org> Roy Sutton wrote: > The latest tarball appears to be a bit more unstable than previous > versions. I have gotten a few instances of: > > .../menupane.rb:150:in `subscribe_to_command_slot': undefined method > `enable' for nil:NilClass (NoMethodError) > from > C:/RubyDev/FreeRIDE/freeride/./plugins/rubyide_fox_gui/menupane.rb:141:in > `call' > from > C:/RubyDev/FreeRIDE/freeride/freebase/lib/freebase/databus.rb:612:in > `notify' > ... > > > I got this from cancelling a find and from hitting escape when looking > at the code templates. Can't replicate the problems above on my Linux system. Are you using Windows? Further, selecting 'code assist' locks free ride > until I send a break to it. I will drege up my old version and see if > it happens there, too. > Yes this one doesn;t work for now. Laurent -- Laurent JULLIARD http://www.moldus.org/~laurent From nochoice at xs4all.nl Sat Sep 17 16:35:27 2005 From: nochoice at xs4all.nl (Jonathan Maasland) Date: Sat, 17 Sep 2005 20:35:27 +0000 Subject: [FR-devel] Latest tarball In-Reply-To: <432C0B9D.9060101@moldus.org> References: <432AFFF3.2010006@mindspring.com> <432C0B9D.9060101@moldus.org> Message-ID: <432C7E0F.8040703@xs4all.nl> @Laurent: I encountered those errors here on Gentoo as well. @Roy: Try the latest cvs, Laurent applied my latest patch to solve the problem I accidentally created. My bad! Sorry for the inconvenience Jonathan Laurent Julliard wrote: >Roy Sutton wrote: > > >>The latest tarball appears to be a bit more unstable than previous >>versions. I have gotten a few instances of: >> >>.../menupane.rb:150:in `subscribe_to_command_slot': undefined method >>`enable' for nil:NilClass (NoMethodError) >> from >>C:/RubyDev/FreeRIDE/freeride/./plugins/rubyide_fox_gui/menupane.rb:141:in >>`call' >> from >>C:/RubyDev/FreeRIDE/freeride/freebase/lib/freebase/databus.rb:612:in >>`notify' >> ... >> >> >>I got this from cancelling a find and from hitting escape when looking >>at the code templates. >> >> > > >Can't replicate the problems above on my Linux system. Are you using >Windows? > > >Further, selecting 'code assist' locks free ride > > >>until I send a break to it. I will drege up my old version and see if >>it happens there, too. >> >> >> > >Yes this one doesn;t work for now. > >Laurent > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/freeride-devel/attachments/20050917/4a882643/attachment.htm From nochoice at xs4all.nl Sun Sep 18 09:31:49 2005 From: nochoice at xs4all.nl (Jonathan Maasland) Date: Sun, 18 Sep 2005 13:31:49 +0000 Subject: [FR-devel] Latest tarball In-Reply-To: <432C7E0F.8040703@xs4all.nl> References: <432AFFF3.2010006@mindspring.com> <432C0B9D.9060101@moldus.org> <432C7E0F.8040703@xs4all.nl> Message-ID: <432D6C45.8030109@xs4all.nl> I don't know what happened but the patch isn't applied in cvs. Apply the below patch to your tree to fix it: Index: plugins/rubyide_fox_gui/menupane.rb =================================================================== RCS file: /var/cvs/freeride/freeride/plugins/rubyide_fox_gui/menupane.rb,v retrieving revision 1.7 *diff -u -r1.7 menupane.rb* *--- plugins/rubyide_fox_gui/menupane.rb 16 Sep 2005 07:48:24 -0000 1.7* *+++ plugins/rubyide_fox_gui/menupane.rb 16 Sep 2005 10:47:35 -0000* @@ -139,7 +139,7 @@ return if @command_subscription[cmd_slot] @command_subscription[cmd_slot] = cmd_slot.subscribe do |event, slot| - unless slot==cmd_slot && event==:notify_attribute_set + if slot==cmd_slot && event==:notify_attribute_set && !slot.attr_fxmenu.nil? menuitem = slot.attr_fxmenu Jonathan Jonathan Maasland wrote: > @Laurent: > I encountered those errors here on Gentoo as well. > > @Roy: > Try the latest cvs, Laurent applied my latest patch to solve the > problem I accidentally created. > My bad! > > Sorry for the inconvenience > > Jonathan > > Laurent Julliard wrote: > >>Roy Sutton wrote: >> >> >>>The latest tarball appears to be a bit more unstable than previous >>>versions. I have gotten a few instances of: >>> >>>.../menupane.rb:150:in `subscribe_to_command_slot': undefined method >>>`enable' for nil:NilClass (NoMethodError) >>> from >>>C:/RubyDev/FreeRIDE/freeride/./plugins/rubyide_fox_gui/menupane.rb:141:in >>>`call' >>> from >>>C:/RubyDev/FreeRIDE/freeride/freebase/lib/freebase/databus.rb:612:in >>>`notify' >>> ... >>> >>> >>>I got this from cancelling a find and from hitting escape when looking >>>at the code templates. >>> >>> >> >> >>Can't replicate the problems above on my Linux system. Are you using >>Windows? >> >> >>Further, selecting 'code assist' locks free ride >> >> >>>until I send a break to it. I will drege up my old version and see if >>>it happens there, too. >>> >>> >>> >> >>Yes this one doesn;t work for now. >> >>Laurent >> >> >> >> > >------------------------------------------------------------------------ > >_______________________________________________ >Freeride-devel mailing list >Freeride-devel at rubyforge.org >http://rubyforge.org/mailman/listinfo/freeride-devel > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/freeride-devel/attachments/20050918/b71d85de/attachment.htm From laurent at moldus.org Tue Sep 20 02:20:14 2005 From: laurent at moldus.org (Laurent Julliard) Date: Tue, 20 Sep 2005 08:20:14 +0200 Subject: [FR-devel] Latest tarball In-Reply-To: <432D6C45.8030109@xs4all.nl> References: <432AFFF3.2010006@mindspring.com> <432C0B9D.9060101@moldus.org> <432C7E0F.8040703@xs4all.nl> <432D6C45.8030109@xs4all.nl> Message-ID: <432FAA1E.5080502@moldus.org> Jonathan Maasland wrote: > I don't know what happened but the patch isn't applied in cvs. > > Apply the below patch to your tree to fix it: > > Index: plugins/rubyide_fox_gui/menupane.rb > =================================================================== > RCS file: /var/cvs/freeride/freeride/plugins/rubyide_fox_gui/menupane.rb,v > retrieving revision 1.7 > *diff -u -r1.7 menupane.rb* > *--- plugins/rubyide_fox_gui/menupane.rb 16 Sep 2005 07:48:24 -0000 1.7* > *+++ plugins/rubyide_fox_gui/menupane.rb 16 Sep 2005 10:47:35 -0000* > @@ -139,7 +139,7 @@ > return if @command_subscription[cmd_slot] > > @command_subscription[cmd_slot] = cmd_slot.subscribe do |event, slot| > - unless slot==cmd_slot && event==:notify_attribute_set > + if slot==cmd_slot && event==:notify_attribute_set && !slot.attr_fxmenu.nil? > > menuitem = slot.attr_fxmenu > > > Jonathan My fault. I committed the Changelog but not the file itself :-( I just fixeed it. LJ From nochoice at xs4all.nl Fri Sep 23 17:40:20 2005 From: nochoice at xs4all.nl (Jonathan Maasland) Date: Fri, 23 Sep 2005 21:40:20 +0000 Subject: [FR-devel] Couple a questions Message-ID: <43347644.8030506@xs4all.nl> Hi all again, I'm still working on project support and while designing and fumbling I ran into two simple questions. First, a SourceParser instance is created for each EditPane, however I'd like to use one for parsing unopened files, ie. even when there are no EditPanes active. I don't really know where to put the parser-instance in the databus. At the moment I've parked it at '/plugins/rubyide_tools_source_parser/SourceParser'. I don't know if it is the appropriate place, maybe you'd want it somewhere under '/system'. Secondly, I'm in the process of building a DirectoryTree component. Basically you throw in a path and you get an FXTreeItem representing the directory-tree, however only containing files matching the FileTypes property of the FileBrowser. Ruby files will be expandable to show their structure (that's why I need the SourceParser). This is again a question of placement. Where do I put this new class? rubyide_fox_gui seems like a logical place. Somewhere during the next week I hope to create a branch of my own and commit some work. Thanks Jonathan From laurent at moldus.org Fri Sep 23 16:12:47 2005 From: laurent at moldus.org (Laurent Julliard) Date: Fri, 23 Sep 2005 22:12:47 +0200 Subject: [FR-devel] Couple a questions In-Reply-To: <43347644.8030506@xs4all.nl> References: <43347644.8030506@xs4all.nl> Message-ID: <433461BF.4050309@moldus.org> Jonathan Maasland wrote: > Hi all again, > > I'm still working on project support and while designing and fumbling I > ran into two simple questions. > > First, a SourceParser instance is created for each EditPane, however I'd > like to use one for parsing unopened files, ie. even when there are no > EditPanes active. I don't really know where to put the parser-instance > in the databus. At the moment I've parked it at > '/plugins/rubyide_tools_source_parser/SourceParser'. I don't know if it > is the appropriate place, maybe you'd want it somewhere under '/system'. > It should definitely go under a new /system/tools node in the databus like /system/tools/SourceParser/1 for the first parser and so on... And by the way all the SourceParser instantiated for each EditPane should also appear as an entry in there. So go ahead and create this new node. > Secondly, I'm in the process of building a DirectoryTree component. > Basically you throw in a path and you get an FXTreeItem representing the > directory-tree, however only containing files matching the FileTypes > property of the FileBrowser. Ruby files will be expandable to show their > structure (that's why I need the SourceParser). > This is again a question of placement. Where do I put this new class? > rubyide_fox_gui seems like a logical place. > Absolutely. One thing is: make sure you decouple the UI and non UI part as much as possible. If there is something to decouple then you should create a new plugin in rubyide_gui for the non UI part and another one in rubyide_fox_gui for the UI part. Another option is to create a new plugin in rubyide_fox_directory_tree (plus rubyide_directory tree if you believe there is enough non UI code that can be isolated. The first option is the best choice if your directory tree is mostly thought as an abstraction of a new GUI component The second path is better suited if you see the Directory Tree as a plugin in its own right like, say, the file browser plugin which is in rubyide_tools_fox_file_browser > Somewhere during the next week I hope to create a branch of my own and > commit some work. > Great! Laurent