DeltaEscher / editra

Automatically exported from code.google.com/p/editra
Other
0 stars 0 forks source link

Advanced tab in Preferences causes Editra to crash #488

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Edit => Preferences
2. Click on last "Advanced" tab
3. crash...

Running last Editra SVN rev. 63561, under Linux, or Windows

cheers,
Seb

#---- Notes ----#
Please provide additional information about the crash here

#---- System Information ----#
Editra Version: 0.5.33
Operating System: Linux 2.6.27-14-generic x86_64
Python Version: 2.5.2 (r252:60911, Oct  5 2008, 19:29:17) 
[GCC 4.3.2]
wxPython Version: 2.8.8.0 (gtk2-unicode)
wxPython Info: (__WXGTK__, wxGTK, unicode, gtk2, wx-assertions-off, SWIG-
1.3.29)
Python Encoding: Default=ascii  File=UTF-8
wxPython Encoding: UTF-8
System Architecture: 64bit x86_64
Byte order: little
Frozen: False
#---- End System Information ----#

#---- Traceback Info ----#
*** Fri Feb 26 16:28:39 2010 ***
Traceback (most recent call last):
  File "/opt/local/perso/jaluino/3rdparty/Editra/src/prefdlg.py", line 232, 
in OnPageChanging
    page.DoSelected()
  File "/opt/local/perso/jaluino/3rdparty/Editra/src/prefdlg.py", line 
1624, in DoSelected
    self._DoLayout()
  File "/opt/local/perso/jaluino/3rdparty/Editra/src/prefdlg.py", line 
1614, in _DoLayout
    nbook.AddPage(KeyBindingPanel(nbook), _("Keybindings"))
  File "/opt/local/perso/jaluino/3rdparty/Editra/src/prefdlg.py", line 
1675, in __init__
    if isinstance(val[0], int):
IndexError: list index out of range

#---- End Traceback Info ----#

Original issue reported on code.google.com by sebastie...@gmail.com on 26 Feb 2010 at 3:32

GoogleCodeExporter commented 8 years ago
Have you done anything like customizing your main menus? The only way I can see 
this
error happening is if something is corrupt in the menu management.

Please show me the output from running the following lines of code in the 
PyShell
plugin. (need to run them one line at a time)

import wx
mb = wx.GetApp().GetMainWindow().GetMenuBar()
mm = mb.GetMenuMap()
print mm

Thanks,

Cody

Original comment by CodyPrec...@gmail.com on 26 Feb 2010 at 5:25

GoogleCodeExporter commented 8 years ago
I did have add menu entries in main menubar. Here's the results:

[{u'Profile': [410, (106, u'Save Profile'), (107, u'Load Profile')], u'File': 
[(5002, 
u'New Tab'), (100, u'New Window'), (5000, u'Open'), (5001, u'Close Tab'), (103, 
u'Close Window'), (5021, u'Close All Tabs'), (5003, u'Save'), (5004, u'Save 
As'), 
(104, u'Save All'), (5140, u'Revert to Saved'), (105, u'Reload with 
Encoding...'), 
(110, u'Page Setup'), (5013, u'Print Preview'), (5010, u'Print'), (5006, 
u'Exit')], 
u'Sessions': [411, (108, u'Save Session'), (109, u'Load Session')]}, {u'Edit': 
[(5007, u'Undo'), (5008, u'Redo'), (5031, u'Cut'), (5032, u'Copy'), (5033, 
u'Paste'), 
(112, u'Paste After'), (111, u'Cycle Clipboard'), (5037, u'Select All'), (113, 
u'Column Mode'), (5035, u'Find'), (5039, u'Find/Replace'), (130, u'Quick 
Find'), 
(127, u'Find Previous'), (128, u'Find Next'), (129, u'Find Selected'), (5022, 
u'Preferences')], u'Bookmarks': [115, (5118, u'Toggle Bookmark'), (116, 
u'Remove All 
Bookmarks')], u'Line Edit': [114, (117, u'New Line After'), (118, u'New Line 
Before'), (119, u'Cut Line'), (120, u'Delete Line'), (121, u'Copy Line'), (122, 
u'Duplicate Line'), (123, u'Join Lines'), (124, u'Transpose Line'), (125, 
u'Move 
Current Line Up'), (126, u'Move Current Line Down')]}, {u'Code Folding': [413, 
(174, 
u'Toggle fold'), (175, u'Toggle all folds')], u'Shelf': [170, (165, u'Show 
Shelf'), 
(231, u'Editra Log'), (234, u'PyShell')], u'Editor': [412, (160, u'Highlight 
Caret 
Line'), (167, u'Indentation Guides'), (161, u'Show Edge Guide'), (162, u'Show 
EOL 
Markers'), (163, u'Show Line Numbers'), (164, u'Show Whitespace')], u'View': 
[(5138, 
u'Zoom Out'), (5137, u'Zoom In'), (5135, u'Zoom Default'), (171, u'Pane 
Navigator'), 
(178, u'Maximize Editor'), (172, u'Goto Line'), (173, u'Goto Matching Brace'), 
(176, 
u'Next Position'), (177, u'Previous Position'), (5106, u'Next Bookmark'), 
(5107, 
u'Previous Bookmark'), (168, u'Status Bar'), (169, u'Toolbar')]}, {u'EOL Mode': 
[180, 
(181, u'Old Macintosh (r)'), (182, u'Unix (n)'), (183, u'Windows (rn)')], 
u'Whitespace': [188, (189, u'Spaces to Tabs'), (190, u'Tabs to Spaces'), (191, 
u'Trim 
Trailing Whitespace')], u'Format': [(179, u'Font'), (192, u'Toggle Comment'), 
(5133, 
u'Indent Lines'), (5134, u'Unindent Lines'), (186, u'Uppercase'), (187, 
u'Lowercase'), (184, u'Use Soft Tabs'), (185, u'Word Wrap')]}, {u'Settings': 
[(193, 
u'Auto-Completion'), (194, u'Auto-Indent'), (199, u'Bracket Highlighting'), 
(198, 
u'Code Folding'), (195, u'Syntax Highlighting')]}, {u'Tools': [(211, u'Run'), 
(212, 
u'Run last executed'), (202, u'Editor Command'), (203, u'Plugin Manager'), 
(5030, 
u'Style Editor')], u'Generator': [207, (208, u'Generate HTML'), (209, 
u'Generate 
LaTeX'), (210, u'Generate RTF')]}, {u'Jaluino': []}, {u'Help': [(5014, 
u'About...'), 
(5122, u'Project Homepage...'), (213, u'Online Documentation...'), (214, 
u'Translate 
Editra...'), (216, u'Bug Tracker...'), (215, u'Feedback')]}]

I tried accessing "Advanced" tab with my plugin uninstalled, and indeed it's 
working. 
It looks like I've done something wrong... Where should I look ? Sorry for the 
noise...

Cheers,
Seb

Original comment by sebastie...@gmail.com on 26 Feb 2010 at 5:34

GoogleCodeExporter commented 8 years ago
Hi,

Yea here is the culprit:

{u'Jaluino': []}

The Jauino menu is empty. I should definitely be checking for this is case so I
consider that a bug in Editra but it is that menu added by your plugin is 
causing the
crash. If you append some item to it I would expect it not to crash.

Cody

Original comment by CodyPrec...@gmail.com on 26 Feb 2010 at 5:42

GoogleCodeExporter commented 8 years ago
Weird... My "Jaluino" menu entry contains items:

>>> import wx
>>> bar = wx.GetApp().GetMainWindow().GetMenuBar()
>>> jaluino = [e[0] for e in bar.GetMenus() if e[1] == u"Jaluino"][0]
>>> [m.GetLabel() for m in jaluino.GetMenuItems()]
[u'Compile', u'Upload', u'', u'Validate', u'', u'Open dependencies', u'Close 
dependencies', u'', u'Settings']

I need to check how I build it...

Seb

Original comment by sebastie...@gmail.com on 26 Feb 2010 at 7:23

GoogleCodeExporter commented 8 years ago
Ah, actually I now know what the problem is. In the current keybinding 
persistence
system menu items are only registered if they are associated with a known ID. 
Since
you created a new custom top level menu all its items are associated with 
unknown ID's. 

So don't worry about it I will fix it on this end.

thanks,

Cody

Original comment by CodyPrec...@gmail.com on 26 Feb 2010 at 7:37

GoogleCodeExporter commented 8 years ago
Fixed

Check for if the menu has known children when iterating the map.

Original comment by CodyPrec...@gmail.com on 1 Mar 2010 at 12:16