Skip to content

Commit

Permalink
Merge from 3.x: PR #4869
Browse files Browse the repository at this point in the history
Fixes #4843
  • Loading branch information
ccordoba12 committed Aug 1, 2017
2 parents 0eaf1d7 + f46284d commit 06f310c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
5 changes: 4 additions & 1 deletion spyder/utils/qthelpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,10 @@ def add_actions(target, actions, insert_before=None):
elif isinstance(action, QAction):
if isinstance(action, SpyderAction):
if isinstance(target, QMenu) or not isinstance(target, QToolBar):
action = action.no_icon_action
try:
action = action.no_icon_action
except RuntimeError:
continue
if insert_before is None:
target.addAction(action)
else:
Expand Down
12 changes: 8 additions & 4 deletions spyder/widgets/editor.py
Original file line number Diff line number Diff line change
Expand Up @@ -1253,7 +1253,7 @@ def __setup_menu(self):
else:
actions = (self.new_action, self.open_action)
self.setFocus() # --> Editor.__get_focus_editortabwidget
add_actions(self.menu, list(actions)+self.__get_split_actions())
add_actions(self.menu, list(actions) + self.__get_split_actions())
self.close_action.setEnabled(self.is_closable)


Expand Down Expand Up @@ -2318,9 +2318,13 @@ def get_layout_settings(self):
"""Return layout state"""
splitsettings = []
for editorstack, orientation in self.iter_editorstacks():
clines = [finfo.editor.get_cursor_line_number()
for finfo in editorstack.data]
cfname = editorstack.get_current_filename()
clines = []
cfname = ''
orientation = False
if hasattr(editorstack, 'data'):
clines = [finfo.editor.get_cursor_line_number()
for finfo in editorstack.data]
cfname = editorstack.get_current_filename()
splitsettings.append((orientation == Qt.Vertical, cfname, clines))
return dict(hexstate=qbytearray_to_str(self.saveState()),
sizes=self.sizes(), splitsettings=splitsettings)
Expand Down

0 comments on commit 06f310c

Please sign in to comment.