Skip to content
Snippets Groups Projects
Unverified Commit 745e072f authored by Gigg, Martyn Anthony's avatar Gigg, Martyn Anthony Committed by GitHub
Browse files

Merge pull request #28452 from mantidproject/28445_Handle_Qt_shortcut_in_new_tab

Create new tab names correctly on KDE
parents 65b8078c d3cb3bf1
No related branches found
No related tags found
No related merge requests found
......@@ -19,6 +19,7 @@ See :doc:`mantidplot`.
MantidWorkbench
---------------
- Fixed new tab names not incrementing correctly on KDE display environments (i.e. KUbuntu).
See :doc:`mantidworkbench`.
......
......@@ -67,7 +67,7 @@ class MultiPythonFileInterpreter(QWidget):
if filename is None:
title = NEW_TAB_TITLE
i = 1
while title in self.tab_titles:
while title in self.stripped_tab_titles:
title = "{} ({})".format(NEW_TAB_TITLE, i)
i += 1
return title, title
......@@ -75,8 +75,13 @@ class MultiPythonFileInterpreter(QWidget):
return osp.basename(filename), filename
@property
def tab_titles(self):
return [self._tabs.tabText(i).rstrip('*') for i in range(self.editor_count)]
def stripped_tab_titles(self):
tab_text = [self._tabs.tabText(i) for i in range(self.editor_count)]
tab_text = [txt.rstrip('*') for txt in tab_text]
# Some DEs (such as KDE) will automatically assign keyboard shortcuts using the Qt & annotation
# see Qt Docs - qtabwidget#addTab
tab_text = [txt.replace('&', '') for txt in tab_text]
return tab_text
def closeEvent(self, event):
self.deleteLater()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment