Index: palm/trunk/SCRIPTS/palmrungui
===================================================================
--- palm/trunk/SCRIPTS/palmrungui	(revision 4394)
+++ palm/trunk/SCRIPTS/palmrungui	(revision 4405)
@@ -25,4 +25,8 @@
 # -----------------
 # $Id$
+# Major revisions: New layout. Merged with palm job manager (palm_jm).
+# Minor revisions: Misc. bugs fixed.
+# 
+# 4394 2020-02-04 21:40:38Z maronga
 # Bugfix: harmonized naming convention of configuration files
 # 
@@ -74,7 +78,9 @@
 import subprocess
 from PyQt4 import QtCore, QtGui, uic
-from PyQt4.QtCore import QProcess
+from PyQt4.QtCore import QProcess,pyqtSlot,SIGNAL,SLOT
 from time import strftime
 import os
+import shutil
+
 
 
@@ -95,4 +101,5 @@
 
 palmrunline = ""
+set_list = []
 
 Ui_MainWindow = uic.loadUiType("%s/palmrungui_files/mainwindow.ui" % (palm_bin))[0]
@@ -114,8 +121,10 @@
         super(Mainwindow, self).__init__()
         self.setupUi(self)
-        
-        self.palm_logo.setPixmap(QtGui.QPixmap(palm_dir + "/trunk/SCRIPTS/palmrungui_files/logo.png"))   
+    
+        self.palm_logo.setPixmap(QtGui.QPixmap(palm_dir + "/trunk/SCRIPTS/palmrungui_files/logo.png"))        
         
         self.recent_jobs(50)
+        self.load_jobs()
+
         commandline = self.groupBox.findChild(QtGui.QLineEdit,"commandline")
         commandline.setText("")
@@ -143,5 +152,10 @@
             commandline.setText(palmrunline)
             self.setup_gui(palmrunline)
-                      
+
+
+    
+        QtGui.QApplication.processEvents()
+
+
         
     # starts xterm with palmrun commandline
@@ -224,5 +238,5 @@
         j = 0;
 
-        list_jobname = self.group_job.findChild(QtGui.QListWidget,"list_jobname")
+        list_jobname = self.group_history.findChild(QtGui.QListWidget,"list_jobname")
         list_jobname.clear()
 
@@ -261,5 +275,5 @@
     ###############################
     def enable_coupled(self):
-        coupledState = self.group_job.findChild(QtGui.QComboBox, "drop_job").currentText()
+        coupledState = self.group_execution.findChild(QtGui.QComboBox, "drop_job").currentText()
         group = self.group_execution.findChild(QtGui.QGroupBox, "group_coupled")
         
@@ -269,44 +283,28 @@
             self.group_coupled.setEnabled(False)
             
-            
-    # select a job via "select"-button
-    ################################
-    def choosejob(self):
-        jobDir = "%s/JOBS" % (palm_dir)        
-
-        # Pick a job from dialog
-        filename = QtGui.QFileDialog.getExistingDirectory(self, "Open a folder", jobDir, QtGui.QFileDialog.ShowDirsOnly)
-        
-        # If a file was selected, load it into mainwindow
-        if ( filename != ""):
-	    jobname = os.path.basename(unicode(filename))
-            self.group_job.findChild(QtGui.QLineEdit,"line_jobname").setText(jobname)
-            self.group_job.findChild(QtGui.QListWidget,"list_jobname").clearSelection()
-
-            # Change palmrunline accordingly
-            self.change_commandline("r","")
-            self.change_commandline("a","")
-            return
-        else:
-            return
-    
-        
+
     # select a job via click from list
     #################################
     def choosejob_list(self):
         #  Get selected item from list
-        list_jobname = self.group_job.findChild(QtGui.QListWidget,"list_jobname")
+        list_jobname = self.group_history.findChild(QtGui.QListWidget,"list_jobname")
         filename = str(list_jobname.currentItem().text())
+            
+        timestamp = filename[len(filename)-17:][:16]
+        jobname = filename[:len(filename) - 19];
+        
         itemint = list_jobname.currentRow()
-    
+
         # Reload list
-        self.setupUi(self)
         self.recent_jobs(50)
+        self.load_jobs()
     
         # Set selected item to jobname
         list_jobname.item(itemint).setSelected(True);
     
-        timestamp = filename[len(filename)-17:][:16]
-        jobname = filename[:len(filename) - 19];
+        # Set selected item to jobname in "available jobs" list
+        item2int = self.list_jobs.findItems(jobname,QtCore.Qt.MatchCaseSensitive)
+        self.list_jobs.setCurrentItem(item2int[0])
+        self.update_input()
     
         fileDir = "%s/.palmrungui.history" % (palm_dir)
@@ -338,5 +336,5 @@
     ######################################################
     def change_rc_list(self):
-        drop_job = self.group_job.findChild(QtGui.QComboBox,"drop_job").currentText()    
+        drop_job = self.group_execution.findChild(QtGui.QComboBox,"drop_job").currentText()    
         self.change_commandline("a","")
     
@@ -381,5 +379,5 @@
         # Change in parameter "r" (jobname)
         if (id_str == "r"):
-            filename = str(self.group_job.findChild(QtGui.QLineEdit,"line_jobname").text())
+            filename = str(self.group_execution.findChild(QtGui.QLineEdit,"line_jobname").text())
             s = filename.split("JOBS/") 
             param[0] = s[len(s)-1]
@@ -387,5 +385,5 @@
             if ( initialize == True ):#and self.group_runcontrol.isEnabled() == True ):
                 self.group_execution.setEnabled(True)
-                self.group_job.findChild(QtGui.QComboBox,"drop_job").setEnabled(True)
+                self.group_execution.findChild(QtGui.QComboBox,"drop_job").setEnabled(True)
                 self.group_advanced.setEnabled(True)
                 self.groupBox.findChild(QtGui.QPushButton,"button_start").setEnabled(True) 
@@ -394,5 +392,5 @@
             elif ( param[0] == ""):            
                 self.group_execution.setEnabled(False)
-                self.group_job.findChild(QtGui.QComboBox,"drop_job").setEnabled(False)
+                self.group_execution.findChild(QtGui.QComboBox,"drop_job").setEnabled(False)
                 self.groupBox.findChild(QtGui.QPushButton,"button_start").setEnabled(False) 
                 self.menuBar.findChild(QtGui.QMenu,"menuStart").actions()[3].setEnabled(False)
@@ -400,24 +398,14 @@
                 self.delete_commandline("r")
                 self.change_commandline("a","remove")
-                self.group_job.findChild(QtGui.QLabel,"label_usercode").setText("")
                 return 1 
             
             else:
-                # Check if user code is available
-                usercode = "%s/JOBS/%s/USER_CODE" % (palm_dir,param[0])
-                                
-                if (os.path.exists(usercode) is True): 
-                    self.group_job.findChild(QtGui.QLabel,"label_usercode").setText("<font color='green'>User code found.</font>")
-               
-                else:               
-                    self.group_job.findChild(QtGui.QLabel,"label_usercode").setText("<font color='red'>Warning: no user code found!</font>")
-               
-
-                # Check if _pdf file is available, otherwise notice user
-                drop_job = self.group_job.findChild(QtGui.QComboBox,"drop_job").currentText()
+
+                # Check if _p3dr file is available, otherwise notice user
+                drop_job = self.group_execution.findChild(QtGui.QComboBox,"drop_job").currentText()
                 if ( self.group_execution.findChild(QtGui.QCheckBox,"check_restarts").checkState() == 2 or 
                      drop_job == "Restart run" or drop_job == "Restart run (coupled atmosphere ocean)"     ):
 
-                    jobname = self.group_job.findChild(QtGui.QLineEdit, "line_jobname").text()
+                    jobname = self.group_execution.findChild(QtGui.QLineEdit, "line_jobname").text()
                     restartfile = "%s/JOBS/%s/INPUT/%s_p3dr" % (palm_dir,jobname,jobname)
 
@@ -446,5 +434,5 @@
         elif (id_str == "a"): 
     
-            drop_job = self.group_job.findChild(QtGui.QComboBox,"drop_job").currentText()
+            drop_job = self.group_execution.findChild(QtGui.QComboBox,"drop_job").currentText()
             rc_flag = "#"
     
@@ -485,7 +473,6 @@
                 # Check if _p3dr file is available, otherwise notice user
                 if (status_restarts == 2):
-                    jobname = str(self.group_job.findChild(QtGui.QLineEdit, "line_jobname").text())[len(palm_dir)+len("/JOBS/"):]
+                    jobname = str(self.group_execution.findChild(QtGui.QLineEdit, "line_jobname").text())
                     restartfile = "%s/JOBS/%s/INPUT/%s_p3dr" % (palm_dir,jobname,jobname)
-                    
                     if (os.path.exists(restartfile) == True):                   
                         self.group_execution.findChild(QtGui.QLabel,"label_restart").setText("")
@@ -544,8 +531,4 @@
             tmptext = self.group_execution.findChild(QtGui.QLineEdit,"line_host").text()
             self.change_commandline("c",tmptext)
-
-        elif ( self.sender() == self.group_job.findChild(QtGui.QLineEdit, "line_jobname") ):
-            tmptext = self.group_job.findChild(QtGui.QLineEdit,"line_jobname").text()
-            self.change_commandline("r",tmptext)
 
         elif ( self.sender() == self.group_execution.findChild(QtGui.QLineEdit,"line_q")):
@@ -731,5 +714,7 @@
         self.setupUi(self)
         self.tabWidget.setCurrentIndex(0)
+        self.palm_logo.setPixmap(QtGui.QPixmap(palm_dir + "/trunk/SCRIPTS/palmrungui_files/logo.png"))    
         self.recent_jobs(50)
+        self.load_jobs()
         
     # Safes current commandline and user Parameters to .sav file
@@ -772,8 +757,4 @@
         file.close()        
 
-    # Execute command which starts jobmanager (start palm_jm)
-    #######################################################
-    def start_jobmanager(self):
-        subprocess.Popen(["nohup","palm_jm",">>","/dev/null", "2>&1","&"])        
         
     # Executes command which starts watchdog (start palm_wd)
@@ -798,5 +779,5 @@
     def setup_gui(self, palmrun_str):  
       
-        self.palm_logo.setPixmap(QtGui.QPixmap(palm_dir + "/trunk/SCRIPTS/palmrungui_files/logo.png"))   
+        #self.palm_logo.setPixmap(QtGui.QPixmap(palm_dir + "/trunk/SCRIPTS/palmrungui_files/logo.png"))   
       
         #  Some initial settings
@@ -813,5 +794,5 @@
 
         else:
-            self.group_job.setEnabled(True) 
+            self.group_execution.setEnabled(True) 
 
         # Loop for all parameters in palmrunline
@@ -831,5 +812,5 @@
               
                 if ( options != ""):
-                    self.group_job.findChild(QtGui.QLineEdit,"line_jobname").setText(options) 
+                    self.group_execution.findChild(QtGui.QLineEdit,"line_jobname").setText(options) 
                     nojob = False 
                 
@@ -925,5 +906,5 @@
             
             elif ( parameter == "y"):              
-                self.group_job.findChild(QtGui.QComboBox, "drop_job").setCurrentIndex(3) 
+                self.group_execution.findChild(QtGui.QComboBox, "drop_job").setCurrentIndex(3) 
              
 
@@ -944,7 +925,7 @@
                     if (options_2 == "d3"):      
                         if (options_all[:3][-1] == "#"):
-                            self.group_job.findChild(QtGui.QComboBox, "drop_job").setCurrentIndex(0) 
+                            self.group_execution.findChild(QtGui.QComboBox, "drop_job").setCurrentIndex(0) 
                         elif (options_all[:3][-1] == "r"):
-                            self.group_job.findChild(QtGui.QComboBox, "drop_job").setCurrentIndex(1) 
+                            self.group_execution.findChild(QtGui.QComboBox, "drop_job").setCurrentIndex(1) 
                         
                         elif (options_all[:3][-1] == "o"):
@@ -954,5 +935,5 @@
                         self.group_execution.findChild(QtGui.QCheckBox,"check_restarts").setChecked(True) 
                         # Check if _pdf file is available, otherwise notice user
-                        jobname = str(self.group_job.findChild(QtGui.QLineEdit,"line_jobname").text())[len(palm_dir)+len("/JOBS/"):] 
+                        jobname = str(self.group_execution.findChild(QtGui.QLineEdit,"line_jobname").text()) 
                         
                         restartfile = "%sJOBS/%s/INPUT/%s_p3dr" % (palm_dir,jobname,jobname)
@@ -974,8 +955,8 @@
         if ( ocean_run == True ):
             if ( coupled_run == True ):
-                self.group_job.findChild(QtGui.QComboBox, "drop_job").setCurrentIndex(4) 
+                self.group_execution.findChild(QtGui.QComboBox, "drop_job").setCurrentIndex(4) 
             
             else:
-                self.group_job.findChild(QtGui.QComboBox, "drop_job").setCurrentIndex(3) 
+                self.group_execution.findChild(QtGui.QComboBox, "drop_job").setCurrentIndex(3) 
 
         if ( user != ""):
@@ -991,5 +972,5 @@
             self.groupBox.findChild(QtGui.QPushButton,"button_start").setEnabled(False) 
             self.menuBar.findChild(QtGui.QMenu,"menuStart").actions()[3].setEnabled(False) 
-            self.group_job.findChild(QtGui.QComboBox, "drop_job").setEnabled(False) 
+            self.group_execution.findChild(QtGui.QComboBox, "drop_job").setEnabled(False) 
             self.group_advanced.setEnabled(False) 
             self.check_advanced.setEnabled(False) 
@@ -999,5 +980,5 @@
             self.groupBox.findChild(QtGui.QPushButton,"button_start").setEnabled(True) 
             self.menuBar.findChild(QtGui.QMenu,"menuStart").actions()[3].setEnabled(True)
-            self.group_job.findChild(QtGui.QComboBox, "drop_job").setEnabled(True) 
+            self.group_execution.findChild(QtGui.QComboBox, "drop_job").setEnabled(True) 
             self.group_advanced.setEnabled(True) 
          
@@ -1049,4 +1030,393 @@
             self.groupBox.findChild(QtGui.QLineEdit,"commandline").setText(palmrunline) 
             self.setup_gui(palmrunline)        
+
+ 
+   
+    def update_all(self):
+ 
+       self.setEnabled(False)
+       self.list_input.clear() 
+       self.list_user.clear()
+       self.list_monitoring.clear()
+       self.list_output.clear()
+       self.load_jobs()
+       self.setEnabled(True)
+
+    # Load jobs into list
+    def load_jobs(self):
+       
+       self.list_jobs.clear() 
+       self.push_copy.setEnabled(False)
+       self.push_create_set.setEnabled(False)      
+      
+       self.line_path.setText(job_dir + "/")
+       
+       list_of_files = os.listdir(job_dir)
+             
+       for i in range(0,len(list_of_files)):
+          tmp_file = job_dir + "/" + list_of_files[i]
+
+          if ( os.path.isdir(tmp_file) ):
+	     self.list_jobs.addItem(str(list_of_files[i]))
+
+
+    # Update input and user code lists
+    def update_input(self):
+      
+       self.list_input.clear() 
+       self.list_user.clear()
+       self.list_monitoring.clear()
+       self.list_output.clear()
+       self.push_copy.setEnabled(True)
+       self.push_create_set.setEnabled(True)
+      
+       job_to_show = job_dir + "/" + self.list_jobs.currentItem().text() + "/INPUT"
+
+       if ( os.path.isdir(job_to_show) ):
+
+          list_of_files = os.listdir(job_to_show)
+         
+          for i in range(0,len(list_of_files)):
+             tmp_file = job_to_show + "/" + list_of_files[i]
+             
+             if ( os.path.isfile(tmp_file) ):
+	        self.list_input.addItem(str(list_of_files[i]))
+  
+       job_to_show = job_dir + "/" + self.list_jobs.currentItem().text() + "/USER_CODE"
+       
+       if ( os.path.isdir(job_to_show) ):
+          
+          list_of_files = os.listdir(job_to_show)
+          
+          for i in range(0,len(list_of_files)):
+             tmp_file = job_to_show + "/" + list_of_files[i]
+
+             if ( os.path.isfile(tmp_file) ):
+	        self.list_user.addItem(str(list_of_files[i]))
+
+       job_to_show = job_dir + "/" + self.list_jobs.currentItem().text() + "/MONITORING"
+       
+       if ( os.path.isdir(job_to_show) ):
+          
+          list_of_files = os.listdir(job_to_show)
+          
+          for i in range(0,len(list_of_files)):
+             tmp_file = job_to_show + "/" + list_of_files[i]
+
+             if ( os.path.isfile(tmp_file) ):
+	        self.list_monitoring.addItem(str(list_of_files[i]))
+
+       job_to_show = job_dir + "/" + self.list_jobs.currentItem().text() + "/OUTPUT"
+       
+       if ( os.path.isdir(job_to_show) ):
+          
+          list_of_files = os.listdir(job_to_show)
+          
+          for i in range(0,len(list_of_files)):
+             tmp_file = job_to_show + "/" + list_of_files[i]
+
+             if ( os.path.isfile(tmp_file) ):
+	        self.list_output.addItem(str(list_of_files[i]))
+  
+       self.group_execution.findChild(QtGui.QLineEdit,"line_jobname").setText(self.list_jobs.currentItem().text())
+       self.group_history.findChild(QtGui.QListWidget,"list_jobname").clearSelection()
+
+       # Change palmrunline accordingly
+       self.change_commandline("r","")
+       self.change_commandline("a","")
+  
+  
+    # Make a copy of a job
+    def copy_job(self):
+  
+       self.setEnabled(False)
+       old_job_name = self.list_jobs.currentItem().text()
+       
+       text, ret = QtGui.QInputDialog.getText(self, "Copy job", "Enter new job name:", mode = QtGui.QLineEdit.Normal, text = old_job_name)
+       
+       if ( ret ):
+          new_job_name = str(text)
+       else:
+	   self.setEnabled(True)
+	   return
+	 
+       new_input_dir  = job_dir + "/" + new_job_name + "/INPUT"
+
+#      check if a job exists with the new job name  
+       if ( os.path.isdir(new_input_dir) ):
+	   notify = QtGui.QMessageBox.warning(self,'Create new job directory',"Error. Could not create job directory. A job with the new name already exists.")
+	   self.setEnabled(True)
+	   return
+       else:
+	   os.makedirs(new_input_dir)
+
+#      copy and rename input files (if present)       
+       job_to_copy = job_dir + "/" + old_job_name + "/INPUT"
+
+       if ( os.path.isdir(job_to_copy) ):
+
+          list_of_files = os.listdir(job_to_copy)
+         
+          for i in range(0,len(list_of_files)):
+
+             tmp_file = job_to_copy + "/" + list_of_files[i]          
+             new_file = new_input_dir + "/" + list_of_files[i].replace(old_job_name, new_job_name)
+             shutil.copy(tmp_file, new_file)
+
+
+
+
+       new_user_dir  = job_dir + "/" + new_job_name + "/USER_CODE"
+       
+#      check if user code exists in the new job directory 
+       if ( os.path.isdir(new_user_dir) ):
+	   notify = QtGui.QMessageBox.warning(self,'Create new user code directory',"Error. Could not create user code directory. A user code directiory with the new name already exists.")
+	   self.setEnabled(True)
+	   return
+       else:
+	   os.makedirs(new_user_dir)
+
+
+#      copy user code files (if present)       
+       user_to_copy = job_dir + "/" + old_job_name + "/USER_CODE"
+
+       if ( os.path.isdir(user_to_copy) ):
+
+          list_of_files = os.listdir(user_to_copy)
+         
+          for i in range(0,len(list_of_files)):
+
+             tmp_file = user_to_copy + "/" + list_of_files[i]          
+             new_file = new_user_dir + "/" + list_of_files[i]
+             shutil.copy(tmp_file, new_file)
+
+       self.load_jobs()
+       self.list_input.clear() 
+       self.list_user.clear()
+       self.list_monitoring.clear()
+       self.list_output.clear()
+       self.setEnabled(True)
+
+
+    # Create a whole set of jobs
+    def create_set(self):
+  
+       global set_list
+#      disable mainwindow  
+       self.setEnabled(False)
+      
+#      show Options Dialog      
+       opt = CreateSetBox()
+       opt.exec_()
+
+       old_job_name = self.list_jobs.currentItem().text()
+
+       for j in range(0,len(set_list)):
+
+          if ( set_list[j] != "" ):
+             new_job_name   = str(set_list[j])
+             new_input_dir  = job_dir + "/" + str(set_list[j]) + "/INPUT"
+          else:
+             continue
+
+#         check if a job exists with the new job name  
+          if ( os.path.isdir(new_input_dir) ):
+             notify = QtGui.QMessageBox.warning(self,'Create new job directory',"Error. Could not create job directory. A job with the new name already exists.")
+             self.setEnabled(True)
+             return
+          else:
+             os.makedirs(new_input_dir)
+
+#         copy and rename input files (if present)       
+          job_to_copy = job_dir + "/" + old_job_name + "/INPUT"
+
+          if ( os.path.isdir(job_to_copy) ):
+
+             list_of_files = os.listdir(job_to_copy)
+         
+             for i in range(0,len(list_of_files)):
+
+                tmp_file = job_to_copy + "/" + list_of_files[i]          
+                new_file = new_input_dir + "/" + list_of_files[i].replace(old_job_name, new_job_name)
+                shutil.copy(tmp_file, new_file)
+
+
+          new_user_dir  = job_dir + "/" + new_job_name + "/USER_CODE"
+       
+#         check if user code exists in the new job directory 
+          if ( os.path.isdir(new_user_dir) ):
+	      notify = QtGui.QMessageBox.warning(self,'Create new user code directory',"Error. Could not create user code directory. A user code directiory with the new name already exists.")
+	      self.setEnabled(True)
+	      return
+          else:
+	      os.makedirs(new_user_dir)
+
+
+#         copy user code files (if present)       
+          user_to_copy = job_dir + "/" + old_job_name + "/USER_CODE"
+
+          if ( os.path.isdir(user_to_copy) ):
+
+             list_of_files = os.listdir(user_to_copy)
+         
+             for i in range(0,len(list_of_files)):
+
+                tmp_file = user_to_copy + "/" + list_of_files[i]          
+                new_file = new_user_dir + "/" + list_of_files[i]
+                shutil.copy(tmp_file, new_file)
+
+          self.load_jobs()
+          self.list_input.clear() 
+          self.list_user.clear()
+          self.list_monitoring.clear()
+          self.list_output.clear()
+
+       self.setEnabled(True) 
+       set_list = []
+   
+ # Add a custom context menu
+    def openmenuinput(self, position):
+
+        menu = QtGui.QMenu()
+
+        selection = self.list_input.selectedItems()
+        
+        if ( len(selection) != 0 ):
+
+           openAction = menu.addAction('Open selected files')     
+           openAction.setStatusTip('Open file(s) in your favorite editor')
+           openAction.triggered.connect(self.OpenFilesInput)
+           action = menu.exec_(self.list_input.mapToGlobal(position))
+
+ # Add a custom context menu
+    def openmenuuser(self, position):
+
+        menu = QtGui.QMenu()
+
+        selection = self.list_user.selectedItems()
+        
+        if ( len(selection) != 0 ):
+
+           openAction = menu.addAction('Open selected files')     
+           openAction.setStatusTip('Open file(s) in your favorite editor')
+           openAction.triggered.connect(self.OpenFilesUser)
+           action = menu.exec_(self.list_user.mapToGlobal(position))
+
+ # Add a custom context menu
+    def openmenuoutput(self, position):
+
+        menu = QtGui.QMenu()
+
+        selection = self.list_output.selectedItems()
+        
+        print("test")
+        if ( len(selection) != 0 ):
+
+           openAction = menu.addAction('Open selected files')     
+           openAction.setStatusTip('Open file(s) in your favorite editor')
+           openAction.triggered.connect(self.OpenFilesOutput)
+           action = menu.exec_(self.list_output.mapToGlobal(position))
+
+ # Add a custom context menu
+    def openmenumonitoring(self, position):
+
+        menu = QtGui.QMenu()
+
+        selection = self.list_monitoring.selectedItems()
+        
+        if ( len(selection) != 0 ):
+
+           openAction = menu.addAction('Open selected files')     
+           openAction.setStatusTip('Open file(s) in your favorite editor')
+           openAction.triggered.connect(self.OpenFilesMonitoring)
+           action = menu.exec_(self.list_monitoring.mapToGlobal(position))
+
+    def OpenFilesInput(self):
+   
+       sel_job = self.list_jobs.currentItem().text()
+       sel_files = self.list_input.selectedItems()
+       
+       input_dir = job_dir + "/" + sel_job + "/INPUT/"
+       
+       open_files = ""
+       for i in range(0,len(sel_files)):
+          open_files = open_files + "xdg-open " + input_dir +  sel_files[i].text() + "; "
+
+       os.system(str(open_files))
+
+    def OpenFilesUser(self):
+   
+       sel_job = self.list_jobs.currentItem().text()
+       sel_files = self.list_user.selectedItems()
+       
+       input_dir = job_dir + "/" + sel_job + "/USER_CODE/"
+       
+       open_files = ""
+       for i in range(0,len(sel_files)):
+          open_files = open_files + "xdg-open " + input_dir +  sel_files[i].text() + "; "
+
+       os.system(str(open_files)) 
+       selection = self.list_jobs.selectedItems()
+  
+    def OpenFilesMonitoring(self):
+   
+       sel_job = self.list_jobs.currentItem().text()
+       sel_files = self.list_monitoring.selectedItems()
+       
+       input_dir = job_dir + "/" + sel_job + "/MONITORING/"
+       
+       open_files = ""
+       for i in range(0,len(sel_files)):
+          open_files = open_files + "xdg-open " + input_dir +  sel_files[i].text() + "; "
+
+       os.system(str(open_files)) 
+       selection = self.list_jobs.selectedItems()
+  
+    def OpenFilesOutput(self):
+   
+       sel_job = self.list_jobs.currentItem().text()
+       sel_files = self.list_output.selectedItems()
+       
+       input_dir = job_dir + "/" + sel_job + "/OUTPUT/"
+       
+       open_files = ""
+       for i in range(0,len(sel_files)):
+          open_files = open_files + "xdg-open " + input_dir +  sel_files[i].text() + "; "
+
+       os.system(str(open_files)) 
+       selection = self.list_jobs.selectedItems()
+  
+# Message box for showing RUN_CONTROL output
+class CreateSetBox(QtGui.QDialog):
+    def __init__(self):
+      
+        super(CreateSetBox, self).__init__()
+        
+        uic.loadUi(palm_bin + '/palmrungui_files/create_set.ui', self)
+        
+        self.show()
+        
+        return
+
+#   Cancel button
+    def rejected(self):
+      
+       self.close()
+     
+       return
+  
+
+#   OK button
+    def accept(self):
+      
+       global set_list
+       
+       text = self.list.toPlainText() 
+       set_list = text.split('\n')
+       self.close()
+     
+       return
+
+
         
 
