Skip to content

Commit

Permalink
Fix some issues with the profiler
Browse files Browse the repository at this point in the history
  • Loading branch information
goanpeca authored and dalthviz committed Dec 30, 2020
1 parent 09e27c4 commit c036197
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
1 change: 1 addition & 0 deletions spyder/api/widgets/mixins.py
Original file line number Diff line number Diff line change
Expand Up @@ -516,6 +516,7 @@ def create_action(self, name, text, icon=None, icon_text='', tip=None,
action.text_beside_icon = bool(icon_text)
action.shortcut_context = shortcut_context
action.register_shortcut = register_shortcut
action.tip = tip

if initial is not None:
if toggled:
Expand Down
3 changes: 2 additions & 1 deletion spyder/api/widgets/toolbars.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ def eventFilter(self, obj, event):
event_type = event.type()
action = obj.defaultAction() if isinstance(obj, QToolButton) else None
if event_type == QEvent.ToolTip and action is not None:
return action.text_beside_icon
if action.tip is None:
return action.text_beside_icon

return QObject.eventFilter(self, obj, event)

Expand Down
8 changes: 7 additions & 1 deletion spyder/plugins/profiler/widgets/main_widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,14 +208,15 @@ def setup(self, options):
)
browse_action = self.create_action(
ProfilerWidgetActions.Browse,
text=_('Browse'),
text='',
tip=_('Select Python script'),
icon=self.create_icon('fileopen'),
triggered=lambda x: self.select_file(),
)
self.log_action = self.create_action(
ProfilerWidgetActions.ShowOutput,
text=_("Output"),
icon_text=_("Output"),
tip=_("Show program's output"),
icon=self.create_icon('log'),
triggered=self.show_log,
Expand All @@ -237,23 +238,28 @@ def setup(self, options):
self.save_action = self.create_action(
ProfilerWidgetActions.SaveData,
text=_("Save data"),
icon_text=_("Save data"),
tip=_('Save profiling data'),
icon=self.create_icon('filesave'),
triggered=self.save_data,
)
self.load_action = self.create_action(
ProfilerWidgetActions.LoadData,
text=_("Load data"),
icon_text=_("Load data"),
tip=_('Load profiling data for comparison'),
icon=self.create_icon('fileimport'),
triggered=self.compare,
)
self.clear_action = self.create_action(
ProfilerWidgetActions.Clear,
text=_("Clear comparison"),
icon_text=_("Clear comparison"),
tip=_("Clear comparison"),
icon=self.create_icon('editdelete'),
triggered=self.clear,
)
self.clear_action.setEnabled(False)

# Main Toolbar
toolbar = self.get_main_toolbar()
Expand Down

0 comments on commit c036197

Please sign in to comment.