← 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/278194

Please ingore this. I'm just proposing it so I can download the patch easily from Launchpad.
-- 
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	2015-11-20 08:29:42 +0000
+++ epoptes/ui/gui.py	2015-11-20 18:32:59 +0000
@@ -348,18 +348,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',
@@ -372,7 +381,7 @@
 
 
     def openRootTerminal(self, widget):
-        self.openTerminal(EM_SYSTEM)
+        self.openTerminal(EM_SYSTEM, one_per_host=True)
 
 
     def remoteRootTerminal(self, widget):