Skip to content
Snippets Groups Projects
Commit 5cefcdba authored by Simon McVittie's avatar Simon McVittie
Browse files

Merge branch 'wip/smcv/test-ui-env' into 'master'

test-ui: Respect a few of the same environment variables as -wrap

See merge request steam/pressure-vessel!7
parents faf934f8 3b6dd6c3
No related branches found
No related tags found
No related merge requests found
...@@ -44,7 +44,7 @@ logger = logging.getLogger('pressure-vessel-test-ui') ...@@ -44,7 +44,7 @@ logger = logging.getLogger('pressure-vessel-test-ui')
# This doesn't fully work yet. Hack at own risk. # This doesn't fully work yet. Hack at own risk.
CAN_UNSHARE_HOME = False CAN_UNSHARE_HOME = (os.getenv('PRESSURE_VESSEL_SHARE_HOME') is not None)
class Gui: class Gui:
...@@ -120,7 +120,8 @@ class Gui: ...@@ -120,7 +120,8 @@ class Gui:
self.share_home_check = Gtk.CheckButton.new_with_label( self.share_home_check = Gtk.CheckButton.new_with_label(
'Share real home directory' 'Share real home directory'
) )
self.share_home_check.set_active(True) self.share_home_check.set_active(
bool(os.getenv('PRESSURE_VESSEL_SHARE_HOME')))
self.grid.attach(self.share_home_check, 1, row, 1, 1) self.grid.attach(self.share_home_check, 1, row, 1, 1)
row += 1 row += 1
...@@ -131,6 +132,12 @@ class Gui: ...@@ -131,6 +132,12 @@ class Gui:
self.xterm_check.set_active(False) self.xterm_check.set_active(False)
self.grid.attach(self.xterm_check, 1, row, 1, 1) self.grid.attach(self.xterm_check, 1, row, 1, 1)
env = os.getenv('PRESSURE_VESSEL_TERMINAL')
if env is not None:
if env == 'xterm':
self.xterm_check.set_active(True)
row += 1 row += 1
shell_label = Gtk.Label.new('Run an interactive shell') shell_label = Gtk.Label.new('Run an interactive shell')
...@@ -143,6 +150,18 @@ class Gui: ...@@ -143,6 +150,18 @@ class Gui:
self.shell_combo.append( self.shell_combo.append(
'--shell-instead', 'Instead of running the command') '--shell-instead', 'Instead of running the command')
self.shell_combo.set_active(0) self.shell_combo.set_active(0)
env = os.getenv('PRESSURE_VESSEL_SHELL')
if env is not None:
if env == 'after':
self.shell_combo.set_active(1)
elif env == 'fail':
self.shell_combo.set_active(2)
elif env == 'instead':
self.shell_combo.set_active(3)
self._shell_changed(self.shell_combo)
self.shell_combo.connect('changed', self._shell_changed) self.shell_combo.connect('changed', self._shell_changed)
self.grid.attach(self.shell_combo, 1, row, 1, 1) self.grid.attach(self.shell_combo, 1, row, 1, 1)
......
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