← Back to team overview

epoptes team mailing list archive

[Merge] lp:~oiteam/epoptes/multiseat-one-root-terminal-per-host into lp:epoptes

 

Laércio de Sousa has proposed merging lp:~oiteam/epoptes/multiseat-one-root-terminal-per-host into lp:epoptes.

Requested reviews:
  Epoptes Developers (epoptes)

For more details, see:
https://code.launchpad.net/~oiteam/epoptes/multiseat-one-root-terminal-per-host/+merge/158950

As discussed in https://bugs.launchpad.net/epoptes/+bug/980141, I propose that, for multiseat environments, Epoptes should have, at least, an option to launch one root terminal per host, instead of just one root terminal per seat (display), since one only root terminal is sufficient to have full access to any seat.

At revision 354, this branch just replaces current "Root, locally" behavior, but I could evolve it to bring e.g. a new option "Root, locally (per host)" or something similar.
-- 
https://code.launchpad.net/~oiteam/epoptes/multiseat-one-root-terminal-per-host/+merge/158950
Your team Epoptes Developers is requested to review the proposed merge of lp:~oiteam/epoptes/multiseat-one-root-terminal-per-host into lp:epoptes.
=== modified file 'epoptes/ui/gui.py'
--- epoptes/ui/gui.py	2013-02-18 12:10:15 +0000
+++ epoptes/ui/gui.py	2013-04-15 15:01:06 +0000
@@ -334,18 +334,27 @@
 
 
     ## FIXME / FIXUS: Should we allow it?
-    def openTerminal(self, em):
+    def openTerminal(self, em, one_per_host=False):
         clients = self.getSelectedClients()
         
         # If there is no client selected, send the command to all
         if len(clients) == 0:
             clients = self.cstore
 
+        addresses = []
+
         for client in clients:
             inst = client[C_INSTANCE]
             if inst.type == 'offline':
                 continue
 
+            if one_per_host:
+                host_address = client[C_SESSION_HANDLE].split(':')[0]
+                if host_address in addresses:
+                    continue
+                else:
+                    addresses.append(host_address)
+
             port = self.findUnusedPort()
 
             subprocess.Popen(['xterm', '-e', 'socat',
@@ -358,7 +367,7 @@
 
 
     def openRootTerminal(self, widget):
-        self.openTerminal(EM_SYSTEM)
+        self.openTerminal(EM_SYSTEM, one_per_host=True)
 
 
     def remoteRootTerminal(self, widget):


Follow ups