Skip to content

Commit

Permalink
[cuegui] Allow pre-selecting CUEBOT_FACILITY with an environment vari…
Browse files Browse the repository at this point in the history
…able (#1490)

When starting cuegui with the environment variable CUEBOT_FACILITY set,
the interface will select the correct facility if existing on the
`Cuebot Facility` menu option.
  • Loading branch information
DiegoTavares authored Aug 21, 2024
1 parent a70b025 commit 470fb94
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions cuegui/cuegui/MainWindow.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@

from builtins import str
from builtins import range

import os
import sys
import time

Expand Down Expand Up @@ -147,7 +149,9 @@ def __facilityMenuSetup(self, menu):
menu.triggered.connect(self.__facilityMenuHandle)

cue_config = opencue.Cuebot.getConfig()
self.facility_default = cue_config.get("cuebot.facility_default")
self.facility_default = os.getenv(
"CUEBOT_FACILITY",
cue_config.get("cuebot.facility_default"))
self.facility_dict = cue_config.get("cuebot.facility")

for facility in self.facility_dict:
Expand Down Expand Up @@ -190,7 +194,7 @@ def __createMenus(self):

# Menu bar
self.fileMenu = self.menuBar().addMenu("&File")
self.facilityMenu = self.__facilityMenuSetup(self.menuBar().addMenu("&Cuebot"))
self.facilityMenu = self.__facilityMenuSetup(self.menuBar().addMenu("&Cuebot Facility"))
self.PluginMenu = self.menuBar().addMenu("&Views/Plugins")
self.windowMenu = self.menuBar().addMenu("&Window")
self.helpMenu = self.menuBar().addMenu("&Help")
Expand Down

0 comments on commit 470fb94

Please sign in to comment.