Skip to content

Commit

Permalink
Merge pull request #494 from jonasdn/jonasdn/tabs
Browse files Browse the repository at this point in the history
Handle tabs from config better
  • Loading branch information
krichardsson authored Mar 25, 2021
2 parents 5006b3d + 5d00e39 commit 174003f
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions src/cfclient/ui/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -278,12 +278,15 @@ def __init__(self, *args):
# First instantiate all tabs and then open them in the correct order
try:
for tName in Config().get("open_tabs").split(","):
t = tabItems[tName]
if (t is not None and t.isEnabled()):
# Toggle though menu so it's also marked as open there
t.toggle()
except Exception as e:
logger.warning("Exception while opening tabs [{}]".format(e))
try:
t = tabItems[tName]
if (t is not None and t.isEnabled()):
# Toggle though menu so it's also marked as open there
t.toggle()
except Exception as e:
logger.warning("Exception while opening tab [{}]".format(e))
except KeyError as e:
logger.warning("Failed to get open_tabs: {}".format(e))

# Loading toolboxes (A bit of magic for a lot of automatic)
self.toolboxesMenuItem = QMenu("Toolboxes", self.menuView,
Expand Down

0 comments on commit 174003f

Please sign in to comment.