Index: palm/trunk/SCRIPTS/palmrungui
===================================================================
--- palm/trunk/SCRIPTS/palmrungui	(revision 4482)
+++ palm/trunk/SCRIPTS/palmrungui	(revision 4670)
@@ -1,3 +1,3 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 # -*- coding: utf-8 -*-
 #--------------------------------------------------------------------------------#
@@ -25,4 +25,9 @@
 # -----------------
 # $Id$
+# Ported to PyQt5, removed support for user parameters. Added support for Option
+# "-V" (do not re-build pre-built source code). Changed activation strings
+# according to default .palm.iofiles (svfin/svfout/rec)
+# 
+# 4482 2020-04-01 13:17:50Z maronga
 # Added possibility to delete all files in a directory and option to create
 # blank new jobs
@@ -98,9 +103,9 @@
 #
 #------------------------------------------------------------------------------!
-
 import sys
 import subprocess
-from PyQt4 import QtCore, QtGui, uic
-from PyQt4.QtCore import QProcess,pyqtSlot,SIGNAL,SLOT
+from PyQt5 import QtCore, QtGui, uic, QtWidgets
+from PyQt5.QtWidgets import QMainWindow, QApplication
+from PyQt5.QtCore import QProcess, pyqtSlot, QTimer
 from time import strftime
 import os
@@ -118,9 +123,9 @@
    job_dir = palm_dir + '/JOBS'
    user_dir = palm_dir + '/USER_CODE'
-   with open(palm_bin + '/palmrungui', 'r') as fh:
+   with open(palm_bin + '/palmrungui', 'r', encoding='utf8') as fh:
       # file found
       out = None
 except:   
-   print "Error. palmrungui probably called in wrong directory."
+   print ("Error. palmrungui probably called in wrong directory.")
    raise SystemExit
 
@@ -135,5 +140,6 @@
    return "%.1f%s%s" % (num, 'Y', suffix)
 
-
+def ilen(iterable):
+    return reduce(lambda sum, element: sum + 1, iterable, 0)
 
 palmrunline = ""
@@ -144,72 +150,67 @@
 Ui_aboutDialog = uic.loadUiType("%s/palmrungui_files/about.ui" % (palm_bin))[0]
 
-class HelpDialog(QtGui.QDialog,Ui_helpDialog):
+class HelpDialog(QtWidgets.QDialog,Ui_helpDialog):
     def __init__(self, parent=None):
         super(HelpDialog,self).__init__()
         self.setupUi(self)
         
-class AboutDialog(QtGui.QDialog,Ui_aboutDialog):
+class AboutDialog(QtWidgets.QDialog,Ui_aboutDialog):
     def __init__(self, parent=None):
         super(AboutDialog,self).__init__()
         self.setupUi(self)        
 
-class Mainwindow(QtGui.QMainWindow, Ui_MainWindow):
+class Mainwindow(QtWidgets.QMainWindow, Ui_MainWindow):
     def __init__(self, parent=None):
         super(Mainwindow, self).__init__()
         self.setupUi(self)
-    
-        self.palm_logo.setPixmap(QtGui.QPixmap(palm_bin + "/palmrungui_files/logo.png"))        
-        
-        with open(palm_bin + "/palmrungui") as search:
+
+        self.palm_logo.setPixmap(QtGui.QPixmap(palm_bin + "/palmrungui_files/logo.png"))
+        with open(palm_bin + "/palmrungui", encoding='utf8') as search:
            for line in search:
               line = line.rstrip()
               if "$Id" in line:
                  version = "Version: r" + line.split(" ")[3] + " (" + line.split(" ")[4] + ")"
-                 self.groupBox.findChild(QtGui.QLabel,"label_version").setText(version)
+                 self.groupBox.findChild(QtWidgets.QLabel,"label_version").setText(version)
                  break
-        
         self.recent_jobs(50)
         self.load_jobs()
 
+
+
         # look up configuration files and add to combo box
         
-        self.group_execution.findChild(QtGui.QComboBox,"combo_configuration").addItem("")
+        self.group_execution.findChild(QtWidgets.QComboBox,"combo_configuration").addItem("")
         
         for files in os.listdir(palm_dir):
            if files.startswith(".palm.config"):
-              tmpstring = filter(None,files.split(".palm.config."))[0]
-              self.group_execution.findChild(QtGui.QComboBox,"combo_configuration").addItem(tmpstring)
-
-        commandline = self.groupBox.findChild(QtGui.QLineEdit,"commandline")
+              tmpstring = list(filter(None,files.split(".palm.config.")))[0]
+              self.group_execution.findChild(QtWidgets.QComboBox,"combo_configuration").addItem(tmpstring)
+
+        commandline = self.groupBox.findChild(QtWidgets.QLineEdit,"commandline")
         commandline.setText("")
         
         self.tabWidget.setCurrentIndex(0)  
         
-        
+
         filename = "%s/.palmrungui.default" % (palm_dir)  
         if os.path.exists(filename):
-            pass
-        else:
-            return
-        
-        file = open(filename, "r")
-        if ( file is not None ):
-            # File opened successfully
-            palmrunline = file.readline()
-            #if neue zeile zeichen
-            palmrunline = palmrunline[:len(palmrunline)-1]
-            file.close() 
-
-        # In case a palmrunline was found, load it to mainwindow
-        if ( palmrunline != ""):
-            palmrunline = palmrunline[17:] 
-            commandline.setText(palmrunline)
-            self.setup_gui(palmrunline)
-
-
-        QtGui.QApplication.processEvents()
-
+           file = open(filename, "r")
+           if ( file is not None ):
+              # File opened successfully
+              palmrunline = file.readline()
+              #if neue zeile zeichen
+              palmrunline = palmrunline[:len(palmrunline)-1]
+              file.close()
+
+           # In case a palmrunline was found, load it to mainwindow
+           if ( palmrunline != ""):
+              palmrunline = palmrunline[17:]
+              commandline.setText(palmrunline)
+              self.setup_gui(palmrunline)
+
+        QtWidgets.QApplication.processEvents()
 
         # Start refresh timer. On timeout perform update
+
         self.timer = QtCore.QTimer(self)
         self.timer.timeout.connect(self.update_all)
@@ -222,4 +223,5 @@
 
         # The labeltimer induces the update of the remaining time in the UI
+
         self.labeltimer = QtCore.QTimer(self)
         self.labeltimer.timeout.connect(self.UpdatePush)
@@ -233,19 +235,13 @@
     #######################################
     def startpalmrun(self):
-        palmrunline = str(self.groupBox.findChild(QtGui.QLineEdit,"commandline").text())
-        userline    = str(self.group_advanced.findChild(QtGui.QLineEdit,"line_user").text())
-        
-        # Check for empty line
+        palmrunline = str(self.groupBox.findChild(QtWidgets.QLineEdit,"commandline").text())
         palmrunline_save = palmrunline
-        if (userline != ""):
-            palmrunline = "%s %s" % (palmrunline,userline)
-        history_line = palmrunline       
-        
+
         # Disable the main window
         self.tabWidget.setEnabled(False)
-        self.groupBox.findChild(QtGui.QPushButton,"button_start").setEnabled(False)
-        self.groupBox.findChild(QtGui.QLineEdit,"line_tag").setEnabled(False)
-        self.groupBox.findChild(QtGui.QPushButton,"button_start").setText("wait...")      
-        self.groupBox.findChild(QtGui.QLineEdit,"commandline").setText("Executing palmrun in xterm...")        
+        self.groupBox.findChild(QtWidgets.QPushButton,"button_start").setEnabled(False)
+        self.groupBox.findChild(QtWidgets.QLineEdit,"line_tag").setEnabled(False)
+        self.groupBox.findChild(QtWidgets.QPushButton,"button_start").setText("wait...")
+        self.groupBox.findChild(QtWidgets.QLineEdit,"commandline").setText("Executing palmrun in xterm...")
 
         # Wait until all commands have been executed (ugly) ?
@@ -282,8 +278,8 @@
         filename = "%s/.palmrungui.history" % (palm_dir)
         tmstamp = strftime("%Y/%m/%d %H:%M")
-        tag = str(self.groupBox.findChild(QtGui.QLineEdit,"line_tag").text())
+        tag = str(self.groupBox.findChild(QtWidgets.QLineEdit,"line_tag").text())
     
         file = open(filename,"a")
-        s = "%s %s (%s)\n" % (tmstamp,history_line,tag)
+        s = "%s %s (%s)\n" % (tmstamp,palmrunline_save,tag)
         file.write(s)
         file.close()              
@@ -291,8 +287,8 @@
         # Enable main window again
         self.tabWidget.setEnabled(True)
-        self.groupBox.findChild(QtGui.QPushButton,"button_start").setEnabled(True)
-        self.groupBox.findChild(QtGui.QPushButton,"button_start").setText("palmrun") 
-        self.groupBox.findChild(QtGui.QLineEdit,"commandline").setText(palmrunline_save)
-        self.groupBox.findChild(QtGui.QLineEdit,"line_tag").setEnabled(True)
+        self.groupBox.findChild(QtWidgets.QPushButton,"button_start").setEnabled(True)
+        self.groupBox.findChild(QtWidgets.QPushButton,"button_start").setText("palmrun")
+        self.groupBox.findChild(QtWidgets.QLineEdit,"commandline").setText(palmrunline_save)
+        self.groupBox.findChild(QtWidgets.QLineEdit,"line_tag").setEnabled(True)
         
         # Reload recent jobs
@@ -303,5 +299,5 @@
     # Update the label
     def UpdatePush(self):
-        remaining_time = (update_frequency - self.timetimer.elapsed()) / 1000 / 60
+        remaining_time = int((update_frequency - self.timetimer.elapsed()) / 1000 / 60)
         self.push_update.setText("Update (" + str(remaining_time) + " min)")
 
@@ -310,7 +306,7 @@
     #######################################
     def startpalmbuild(self):
-        palmbuildline = 'palmbuild -c ' + str(self.group_execution.findChild(QtGui.QComboBox, "combo_configuration").currentText())
-
-        full_build = self.group_execution.findChild(QtGui.QCheckBox,"check_rebuild").checkState()
+        palmbuildline = 'palmbuild -c ' + str(self.group_execution.findChild(QtWidgets.QComboBox, "combo_configuration").currentText())
+
+        full_build = self.group_execution.findChild(QtWidgets.QCheckBox,"check_rebuild").checkState()
 
         if ( full_build == 2 ):
@@ -318,14 +314,14 @@
               os.utime(palm_source + "/" + filename, None)
 
-        palmrunline_save = str(self.groupBox.findChild(QtGui.QLineEdit,"commandline").text())
+        palmrunline_save = str(self.groupBox.findChild(QtWidgets.QLineEdit,"commandline").text())
 
         # Disable the main window
         palmbuildline_save = palmbuildline
         self.tabWidget.setEnabled(False)
-        self.groupBox.findChild(QtGui.QPushButton,"button_start").setEnabled(False)
-        self.groupBox.findChild(QtGui.QLineEdit,"line_tag").setEnabled(False)  
-        self.groupBox.findChild(QtGui.QPushButton,"button_start").setText("wait...")  
-        self.group_execution.findChild(QtGui.QPushButton,"button_palmbuild").setText("wait...") 
-        self.groupBox.findChild(QtGui.QLineEdit,"commandline").setText("Executing palmbuild in xterm...")        
+        self.groupBox.findChild(QtWidgets.QPushButton,"button_start").setEnabled(False)
+        self.groupBox.findChild(QtWidgets.QLineEdit,"line_tag").setEnabled(False)
+        self.groupBox.findChild(QtWidgets.QPushButton,"button_start").setText("wait...")
+        self.group_execution.findChild(QtWidgets.QPushButton,"button_palmbuild").setText("wait...")
+        self.groupBox.findChild(QtWidgets.QLineEdit,"commandline").setText("Executing palmbuild in xterm...")
         
         # Wait until all commands have been executed (ugly) ?
@@ -359,9 +355,9 @@
         # Enable main window again
         self.tabWidget.setEnabled(True)
-        self.groupBox.findChild(QtGui.QPushButton,"button_start").setEnabled(True)
-        self.groupBox.findChild(QtGui.QLineEdit,"line_tag").setEnabled(True)
-        self.groupBox.findChild(QtGui.QPushButton,"button_start").setText("palmrun") 
-        self.groupBox.findChild(QtGui.QLineEdit,"commandline").setText(palmrunline_save)
-        self.group_execution.findChild(QtGui.QPushButton,"button_palmbuild").setText("(re-)build")      
+        self.groupBox.findChild(QtWidgets.QPushButton,"button_start").setEnabled(True)
+        self.groupBox.findChild(QtWidgets.QLineEdit,"line_tag").setEnabled(True)
+        self.groupBox.findChild(QtWidgets.QPushButton,"button_start").setText("palmrun")
+        self.groupBox.findChild(QtWidgets.QLineEdit,"commandline").setText(palmrunline_save)
+        self.group_execution.findChild(QtWidgets.QPushButton,"button_palmbuild").setText("(re-)build")
         # Reload recent jobs
         self.recent_jobs(50)
@@ -383,5 +379,5 @@
         j = 0
 
-        list_jobname = self.group_history.findChild(QtGui.QListWidget,"list_jobname")
+        list_jobname = self.group_history.findChild(QtWidgets.QListWidget,"list_jobname")
         list_jobname.clear()
 
@@ -397,13 +393,17 @@
 
             if ( len(matchitems) == 0 ):
-                listitem = filter(None,listitem.split(" -r"))[1]
+                listitem = list(filter(None,listitem.split(" -r")))[1]
                 listitem = listitem.strip()
-                listitem = filter(None,listitem.split(" "))[0]
+                listitem = list(filter(None,listitem.split(" ")))[0]
                 listitem = listitem.replace("\"","") 
                 list_jobname.addItem(listitem)
                 
-                configitem = filter(None,configitem.split(" -c"))[1]
-                configitem = configitem.strip()
-                configitem = filter(None,configitem.split(" "))[0]
+                configitem = list(filter(None,configitem.split(" -c")))
+                if ( len(configitem) < 2):
+                   count = count +1
+                   continue
+                else:
+                   configitem = configitem[1].strip()
+                configitem = list(filter(None,configitem.split(" ")))[0]
                 configitem = configitem.replace("\"","") 
 
@@ -412,5 +412,5 @@
                 
                 
-                tagitem = filter(None,tagitem.split(" ("))[1]
+                tagitem = list(filter(None,tagitem.split(" (")))[1]
                 tagitem = tagitem.replace(")","")  
                 if ( len(tagitem) == 0 ): 
@@ -440,6 +440,6 @@
     ###############################
     def enable_coupled(self):
-        coupledState = self.group_execution.findChild(QtGui.QComboBox, "drop_job").currentText()
-        group = self.group_execution.findChild(QtGui.QGroupBox, "group_coupled")
+        coupledState = self.group_execution.findChild(QtWidgets.QComboBox, "drop_job").currentText()
+        group = self.group_execution.findChild(QtWidgets.QGroupBox, "group_coupled")
         
         if (coupledState == "Restart run (coupled atmosphere ocean)" or coupledState == "Initial run (coupled atmosphere ocean)"):
@@ -453,5 +453,5 @@
     def choosejob_list(self):
         #  Get selected item from list
-        list_jobname = self.group_history.findChild(QtGui.QListWidget,"list_jobname")
+        list_jobname = self.group_history.findChild(QtWidgets.QListWidget,"list_jobname")
         filename = str(list_jobname.currentItem().text())
 
@@ -485,7 +485,7 @@
         while i>=1:
             listitem = history[i-1][17:len(history[i-1])-1]
-            listitem = filter(None,listitem.split(" -r"))[1]
+            listitem = list(filter(None,listitem.split(" -r")))[1]
             listitem = listitem.strip()
-            listitem = filter(None,listitem.split(" "))[0]
+            listitem = list(filter(None,listitem.split(" ")))[0]
             listitem = listitem.replace("\"","") 
 
@@ -495,13 +495,13 @@
                 palmrunline = palmrunline[17:]
                 palmrunline = palmrunline[:len(palmrunline)-1]
-                palmrunline = filter(None,palmrunline.split("("))[0]
-                self.groupBox.findChild(QtGui.QLineEdit,"commandline").setText(palmrunline)
+                palmrunline = list(filter(None,palmrunline.split("(")))[0]
+                self.groupBox.findChild(QtWidgets.QLineEdit,"commandline").setText(palmrunline)
                 
               
                 tag = history[i-1].split('\n')[0]
-                tag = filter(None,tag.split("("))[1]
+                tag = list(filter(None,tag.split("(")))[1]
                 tag = tag.replace(")","")
 
-                self.groupBox.findChild(QtGui.QLineEdit,"line_tag").setText(tag)
+                self.groupBox.findChild(QtWidgets.QLineEdit,"line_tag").setText(tag)
                 self.setup_gui(palmrunline)
                 self.list_jobname.item(itemint).setSelected(True)    
@@ -513,11 +513,11 @@
     ######################################################
     def change_rc_list(self):
-        drop_job = self.group_execution.findChild(QtGui.QComboBox,"drop_job").currentText()    
+        drop_job = self.group_execution.findChild(QtWidgets.QComboBox,"drop_job").currentText()
         self.change_commandline("a","")
     
         # Enable PE distribution for atmosphere/ocean
         if ( drop_job == "Restart run (coupled atmosphere ocean)" or drop_job == "Initial run (coupled atmosphere ocean)"):
-            drop_atmos = self.group_coupled.findChild(QtGui.QLineEdit,"line_PE_atmos").text() 
-            drop_ocean = self.group_coupled.findChild(QtGui.QLineEdit,"line_PE_ocean").text() 
+            drop_atmos = self.group_coupled.findChild(QtWidgets.QLineEdit,"line_PE_atmos").text()
+            drop_ocean = self.group_coupled.findChild(QtWidgets.QLineEdit,"line_PE_ocean").text()
             s = "%s %s" % (drop_atmos,drop_ocean)
             self.change_commandline("Y",s)
@@ -540,7 +540,7 @@
         fwt_str = str(fwt_str) 
         initialize = False
-        palmrunline = str(self.groupBox.findChild(QtGui.QLineEdit,"commandline").text())    
+        palmrunline = str(self.groupBox.findChild(QtWidgets.QLineEdit,"commandline").text())
         s = " -%s " % (id_str)
-        splitline = filter(None,palmrunline.split(s))
+        splitline = list(filter(None,palmrunline.split(s)))
 
         if ( len(splitline) == 0 ):
@@ -556,5 +556,5 @@
         # Change in parameter "r" (jobname)
         if (id_str == "r"):
-            filename = str(self.group_execution.findChild(QtGui.QLineEdit,"line_jobname").text())
+            filename = str(self.group_execution.findChild(QtWidgets.QLineEdit,"line_jobname").text())
             s = filename.split("JOBS/") 
             param[0] = s[len(s)-1]
@@ -562,17 +562,17 @@
             if ( initialize == True ):#and self.group_runcontrol.isEnabled() == True ):
                 self.group_execution.setEnabled(True)
-                self.group_execution.findChild(QtGui.QComboBox,"drop_job").setEnabled(True)
+                self.group_execution.findChild(QtWidgets.QComboBox,"drop_job").setEnabled(True)
                 self.group_advanced.setEnabled(True)
-                self.groupBox.findChild(QtGui.QPushButton,"button_start").setEnabled(True) 
-                self.menuBar.findChild(QtGui.QMenu,"menuStart").actions()[3].setEnabled(True)
-                self.groupBox.findChild(QtGui.QLineEdit,"line_tag").setEnabled(True)
+                self.groupBox.findChild(QtWidgets.QPushButton,"button_start").setEnabled(True)
+                self.menuBar.findChild(QtWidgets.QMenu,"menuStart").actions()[3].setEnabled(True)
+                self.groupBox.findChild(QtWidgets.QLineEdit,"line_tag").setEnabled(True)
             
             elif ( param[0] == ""):            
                 self.group_execution.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)
+                self.group_execution.findChild(QtWidgets.QComboBox,"drop_job").setEnabled(False)
+                self.groupBox.findChild(QtWidgets.QPushButton,"button_start").setEnabled(False)
+                self.menuBar.findChild(QtWidgets.QMenu,"menuStart").actions()[3].setEnabled(False)
                 self.group_advanced.setEnabled(False)
-                self.groupBox.findChild(QtGui.QLineEdit,"line_tag").setEnabled(True)
+                self.groupBox.findChild(QtWidgets.QLineEdit,"line_tag").setEnabled(True)
                 self.delete_commandline("r")
                 self.change_commandline("a","remove")
@@ -588,5 +588,5 @@
         elif (id_str == "a"): 
     
-            drop_job = self.group_execution.findChild(QtGui.QComboBox,"drop_job").currentText()
+            drop_job = self.group_execution.findChild(QtWidgets.QComboBox,"drop_job").currentText()
             rc_flag = "#"
     
@@ -620,5 +620,5 @@
                 param[0] = "%s d3%s" % (param[0],rc_flag)
     
-            status_restarts = self.group_execution.findChild(QtGui.QCheckBox,"check_restarts").checkState()
+            status_restarts = self.group_execution.findChild(QtWidgets.QCheckBox,"check_restarts").checkState()
 
             if (status_restarts == 2):
@@ -626,17 +626,21 @@
 
 
-            status_cycfill = self.group_execution.findChild(QtGui.QCheckBox,"check_cycfill").checkState()
+            status_cycfill = self.group_execution.findChild(QtWidgets.QCheckBox,"check_cycfill").checkState()
     
             if (status_cycfill == 2):            
-                param[0]="%s fill" % (param[0])
-            
-            status_svf = self.group_execution.findChild(QtGui.QCheckBox,"check_svf").checkState()
-    
+                param[0]="%s rec" % (param[0])
+
+            status_svf = self.group_execution.findChild(QtWidgets.QCheckBox,"check_svf").checkState()
+
             if (status_svf == 2):            
-                param[0]="%s svf" % (param[0])
+               param[0]="%s svfin" % (param[0])
+ 
+            status_svf_2 = self.group_execution.findChild(QtWidgets.QCheckBox,"check_svf_2").checkState()
+
+            if (status_svf_2 == 2):
+               param[0]="%s svfout" % (param[0])
 
             param[0]="%s\"" % (param[0])
- 
- 
+
             if ( fwt_str == "remove"):            
                 self.delete_commandline(id_str)
@@ -646,5 +650,5 @@
                 self.button_start.setEnabled(True)
                 self.action_save.setEnabled(True)
-                self.groupBox.findChild(QtGui.QLineEdit,"line_tag").setEnabled(True)
+                self.groupBox.findChild(QtWidgets.QLineEdit,"line_tag").setEnabled(True)
 
         # Change in any other parameter
@@ -664,70 +668,70 @@
         newpalmrunline = s.join(splitline)
     
-        # Pr the new palmrunline to mainwindow
+        # Print the new palmrunline to mainwindow
         newpalmrunline = newpalmrunline.replace("  "," ")
-        self.groupBox.findChild(QtGui.QLineEdit,"commandline").setText(newpalmrunline)
+        self.groupBox.findChild(QtWidgets.QLineEdit,"commandline").setText(newpalmrunline)
 
     # change lineinput depending on sender
     ###################################################################################
     def change_lineinput(self):
-        if ( self.sender() == self.group_execution.findChild(QtGui.QComboBox, "combo_configuration") ):
-            tmptext = self.group_execution.findChild(QtGui.QComboBox, "combo_configuration").currentText()
-            if tmptext.isEmpty():
+        if ( self.sender() == self.group_execution.findChild(QtWidgets.QComboBox, "combo_configuration") ):
+            tmptext = self.group_execution.findChild(QtWidgets.QComboBox, "combo_configuration").currentText()
+            if not tmptext:
                self.change_commandline("c"," ")
-               self.group_execution.findChild(QtGui.QPushButton,'button_palmbuild').setEnabled(False)
+               self.group_execution.findChild(QtWidgets.QPushButton,'button_palmbuild').setEnabled(False)
             else:
                self.change_commandline("c",tmptext)
-               self.group_execution.findChild(QtGui.QPushButton,'button_palmbuild').setEnabled(True)          
-
-        elif ( self.sender() == self.group_execution.findChild(QtGui.QLineEdit,"line_q")):
-            tmptext = self.group_execution.findChild(QtGui.QLineEdit,"line_q").text()
+               self.group_execution.findChild(QtWidgets.QPushButton,'button_palmbuild').setEnabled(True)
+
+        elif ( self.sender() == self.group_execution.findChild(QtWidgets.QLineEdit,"line_q")):
+            tmptext = self.group_execution.findChild(QtWidgets.QLineEdit,"line_q").text()
             self.change_commandline("q",tmptext)
         
-        elif ( self.sender() == self.group_execution.findChild(QtGui.QLineEdit,"line_account")):
-            tmptext = self.group_execution.findChild(QtGui.QLineEdit,"line_account").text()
+        elif ( self.sender() == self.group_execution.findChild(QtWidgets.QLineEdit,"line_account")):
+            tmptext = self.group_execution.findChild(QtWidgets.QLineEdit,"line_account").text()
             self.change_commandline("A",tmptext)
         
-        elif ( self.sender() ==  self.group_execution.findChild(QtGui.QLineEdit,"line_pe")):
-            tmptext = self.group_execution.findChild(QtGui.QLineEdit,"line_pe").text()
+        elif ( self.sender() ==  self.group_execution.findChild(QtWidgets.QLineEdit,"line_pe")):
+            tmptext = self.group_execution.findChild(QtWidgets.QLineEdit,"line_pe").text()
             self.change_commandline("X",tmptext)
         
-        elif ( self.sender() == self.group_execution.findChild(QtGui.QLineEdit,"line_tpn")):
-            tmptext = self.group_execution.findChild(QtGui.QLineEdit,"line_tpn").text()
+        elif ( self.sender() == self.group_execution.findChild(QtWidgets.QLineEdit,"line_tpn")):
+            tmptext = self.group_execution.findChild(QtWidgets.QLineEdit,"line_tpn").text()
             self.change_commandline("T",tmptext)
                 
-        elif ( self.sender() == self.group_execution.findChild(QtGui.QLineEdit,"line_time")):
-            tmptext = self.group_execution.findChild(QtGui.QLineEdit,"line_time").text()
+        elif ( self.sender() == self.group_execution.findChild(QtWidgets.QLineEdit,"line_time")):
+            tmptext = self.group_execution.findChild(QtWidgets.QLineEdit,"line_time").text()
             self.change_commandline("t",tmptext)
         
-        elif ( self.sender() == self.group_advanced.findChild(QtGui.QLineEdit,"line_M")):
-            tmptext = self.group_advanced.findChild(QtGui.QLineEdit,"line_M").text()
+        elif ( self.sender() == self.group_advanced.findChild(QtWidgets.QLineEdit,"line_M")):
+            tmptext = self.group_advanced.findChild(QtWidgets.QLineEdit,"line_M").text()
             self.change_commandline("M",tmptext)
         
-        elif ( self.sender() == self.group_advanced.findChild(QtGui.QLineEdit,"line_m")):
-            tmptext = self.group_advanced.findChild(QtGui.QLineEdit,"line_m").text()
+        elif ( self.sender() == self.group_advanced.findChild(QtWidgets.QLineEdit,"line_m")):
+            tmptext = self.group_advanced.findChild(QtWidgets.QLineEdit,"line_m").text()
             self.change_commandline("m",tmptext)
         
-        elif ( self.sender() == self.group_advanced.findChild(QtGui.QLineEdit,"line_D")):
-            tmptext = self.group_advanced.findChild(QtGui.QLineEdit,"line_D").text()
+        elif ( self.sender() == self.group_advanced.findChild(QtWidgets.QLineEdit,"line_D")):
+            tmptext = self.group_advanced.findChild(QtWidgets.QLineEdit,"line_D").text()
             self.change_commandline("D",tmptext)
         
-        elif ( self.sender() == self.group_advanced.findChild(QtGui.QLineEdit,"line_c")):
-            tmptext = self.group_advanced.findChild(QtGui.QLineEdit,"line_c").text()
+        elif ( self.sender() == self.group_advanced.findChild(QtWidgets.QLineEdit,"line_c")):
+            tmptext = self.group_advanced.findChild(QtWidgets.QLineEdit,"line_c").text()
             if ( tmptext == ".palmrungui.config"):
                 tmptext = ""
             self.change_commandline("c",tmptext)
         
-        elif ( self.sender() == self.group_advanced.findChild(QtGui.QLineEdit,"line_s")):
-            tmptext = self.group_advanced.findChild(QtGui.QLineEdit,"line_s").text()
+        elif ( self.sender() == self.group_advanced.findChild(QtWidgets.QLineEdit,"line_s")):
+            tmptext = self.group_advanced.findChild(QtWidgets.QLineEdit,"line_s").text()
             self.change_commandline("s",tmptext)
                 
-        elif ( self.sender() == self.group_advanced.findChild(QtGui.QLineEdit,"line_w")):
-            tmptext = self.group_advanced.findChild(QtGui.QLineEdit,"line_w").text()
+        elif ( self.sender() == self.group_advanced.findChild(QtWidgets.QLineEdit,"line_w")):
+            tmptext = self.group_advanced.findChild(QtWidgets.QLineEdit,"line_w").text()
             self.change_commandline("w",tmptext)
         
-        elif ( self.sender() == self.group_coupled.findChild(QtGui.QLineEdit,"line_PE_atmos") or 
-               self.sender() == self.group_coupled.findChild(QtGui.QLineEdit,"line_PE_ocean")):
-            t1 = self.group_coupled.findChild(QtGui.QLineEdit,"line_PE_atmos").text()
-            t2 = self.group_coupled.findChild(QtGui.QLineEdit,"line_PE_ocean").text()            
+        elif ( self.sender() == self.group_coupled.findChild(QtWidgets.QLineEdit,"line_PE_atmos") or
+               self.sender() == self.group_coupled.findChild(QtWidgets.QLineEdit,"line_PE_ocean")):
+            t1 = self.group_coupled.findChild(QtWidgets.QLineEdit,"line_PE_atmos").text()
+            t2 = self.group_coupled.findChild(QtWidgets.QLineEdit,"line_PE_ocean").text()
             tmptext = "%s %s" % (t1,t2)
             
@@ -742,22 +746,22 @@
             except ValueError:            
                 pass
-                
+
             try:
                 pe2 = int(t2)
             except ValueError:
                 pass
-                
+
             PE_total = pe1+pe2   
-            self.group_execution.findChild(QtGui.QLineEdit,"line_pe").setText(str(PE_total))
+            self.group_execution.findChild(QtWidgets.QLineEdit,"line_pe").setText(str(PE_total))
             self.change_commandline("X",str(PE_total))
-          
+
     # deletes parameter from commandline
     ##################################################################################### 
     def delete_commandline(self, id_str):   
         # Read palmrunline
-        commandline = self.groupBox.findChild(QtGui.QLineEdit,"commandline")
+        commandline = self.groupBox.findChild(QtWidgets.QLineEdit,"commandline")
         palmrunline = str(commandline.text())
         s = " -%s" % (id_str)
-        splitline = filter(None,palmrunline.split(s))
+        splitline = list(filter(None,palmrunline.split(s)))
         
         if ( len(splitline) == 1):
@@ -776,5 +780,5 @@
     ###################################################################################
     def check_flags(self):
-        status = self.group_execution.findChild(QtGui.QCheckBox,"check_delete_tmp_files" ).checkState()
+        status = self.group_execution.findChild(QtWidgets.QCheckBox,"check_delete_tmp_files" ).checkState()
         if (status == 2):      
             self.activate_flag("B")
@@ -782,5 +786,5 @@
             self.deactivate_flag("B")
     
-        status = self.group_execution.findChild(QtGui.QCheckBox,"check_verbose" ).checkState()
+        status = self.group_execution.findChild(QtWidgets.QCheckBox,"check_verbose" ).checkState()
         if (status == 2):
             self.activate_flag("v") 
@@ -788,5 +792,5 @@
             self.deactivate_flag("v")
         
-        status = self.group_advanced.findChild(QtGui.QCheckBox,"check_b" ).checkState() 
+        status = self.group_advanced.findChild(QtWidgets.QCheckBox,"check_b" ).checkState()
         if (status == 2):
             self.activate_flag("b")
@@ -794,5 +798,5 @@
             self.deactivate_flag("b")
     
-        status = self.group_advanced.findChild(QtGui.QCheckBox,"check_F" ).checkState()   
+        status = self.group_advanced.findChild(QtWidgets.QCheckBox,"check_F" ).checkState()
         if (status == 2):
             self.activate_flag("F")
@@ -800,5 +804,5 @@
             self.deactivate_flag("F")
             
-        status = self.group_advanced.findChild(QtGui.QCheckBox,"check_I" ).checkState() 
+        status = self.group_advanced.findChild(QtWidgets.QCheckBox,"check_I" ).checkState()
         if (status == 2):
             self.activate_flag("I")
@@ -806,5 +810,5 @@
             self.deactivate_flag("I")
 
-        status = self.group_advanced.findChild(QtGui.QCheckBox,"check_k" ).checkState() 
+        status = self.group_advanced.findChild(QtWidgets.QCheckBox,"check_k" ).checkState()
         if (status == 2):
             self.activate_flag("k")
@@ -812,5 +816,5 @@
             self.deactivate_flag("k")
 
-        status = self.group_advanced.findChild(QtGui.QCheckBox,"check_O" ).checkState() 
+        status = self.group_advanced.findChild(QtWidgets.QCheckBox,"check_O" ).checkState()
         if (status == 2):
             self.activate_flag("O")
@@ -818,5 +822,11 @@
             self.deactivate_flag("O")
 
-        status = self.group_advanced.findChild(QtGui.QCheckBox,"check_x" ).checkState() 
+        status = self.group_execution.findChild(QtWidgets.QCheckBox,"check_prebuilt" ).checkState()
+        if (status == 2):
+            self.activate_flag("V")
+        else:
+            self.deactivate_flag("V")
+
+        status = self.group_advanced.findChild(QtWidgets.QCheckBox,"check_x" ).checkState()
         if (status == 2):
             self.activate_flag("x")
@@ -824,5 +834,5 @@
             self.deactivate_flag("x")
         
-        status = self.group_advanced.findChild(QtGui.QCheckBox,"check_Z" ).checkState() 
+        status = self.group_advanced.findChild(QtWidgets.QCheckBox,"check_Z" ).checkState()
         if (status == 2):
             self.activate_flag("Z")
@@ -833,8 +843,8 @@
     ##################################################################################    
     def activate_flag(self, id_str):
-        commandline = self.groupBox.findChild(QtGui.QLineEdit,"commandline")
+        commandline = self.groupBox.findChild(QtWidgets.QLineEdit,"commandline")
         palmrunline = str(commandline.text())
         s = " -%s" % (id_str)
-        splitline = filter(None,palmrunline.split(s))
+        splitline = list(filter(None,palmrunline.split(s)))
         
         if ( len(splitline) == 1):
@@ -848,8 +858,8 @@
     ####################################################################################    
     def deactivate_flag(self, id_str):
-        commandline = self.groupBox.findChild(QtGui.QLineEdit,"commandline")
+        commandline = self.groupBox.findChild(QtWidgets.QLineEdit,"commandline")
         palmrunline = str(commandline.text())
         s = " -%s" % (id_str)
-        splitline = filter(None,palmrunline.split(s))
+        splitline = list(filter(None,palmrunline.split(s)))
  
         newpalmrunline = "".join(splitline)
@@ -862,5 +872,5 @@
         self.setupUi(self)
         self.tabWidget.setCurrentIndex(0)
-        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()
@@ -870,14 +880,9 @@
     ################################################################################
     def save_default(self):
-        user_string = self.group_advanced.findChild(QtGui.QLineEdit,"line_user").text()
-        cmd_string = self.groupBox.findChild(QtGui.QLineEdit,"commandline").text()
-        
-        string_to_file = cmd_string
-        if (user_string != ""): 
-            string_to_file = "%s%s" % (string_to_file,user_string)
-        
+        string_to_file = self.groupBox.findChild(QtWidgets.QLineEdit,"commandline").text()
+
         filename ="%s/.palmrungui.default" % (palm_dir)
         tmstamp = strftime("%Y/%m/%d %H:%M")
-        
+
         file = open(filename,"w")
         s = "%s %s" % (tmstamp, string_to_file)
@@ -907,8 +912,7 @@
     def setup_gui(self, palmrun_str):  
       
-        #self.palm_logo.setPixmap(QtGui.QPixmap(palm_dir + "/trunk/SCRIPTS/palmrungui_files/logo.png"))   
+        #self.palm_logo.setPixmap(QtWidgets.QPixmap(palm_dir + "/trunk/SCRIPTS/palmrungui_files/logo.png"))
       
         #  Some initial settings
-        user = "" 
         coupled_run = False 
         ocean_run   = False 
@@ -940,5 +944,5 @@
               
                 if ( options != ""):
-                    self.group_execution.findChild(QtGui.QLineEdit,"line_jobname").setText(options) 
+                    self.group_execution.findChild(QtWidgets.QLineEdit,"line_jobname").setText(options)
                     nojob = False 
                 
@@ -947,68 +951,71 @@
                 
             elif ( parameter == "c"):
-                tmpindex = self.group_execution.findChild(QtGui.QComboBox, "combo_configuration").findText(options.strip(),QtCore.Qt.MatchExactly)
+                tmpindex = self.group_execution.findChild(QtWidgets.QComboBox, "combo_configuration").findText(options.strip(),QtCore.Qt.MatchExactly)
                 if tmpindex != -1: 
-                   self.group_execution.findChild(QtGui.QComboBox, "combo_configuration").setCurrentIndex(tmpindex)
+                   self.group_execution.findChild(QtWidgets.QComboBox, "combo_configuration").setCurrentIndex(tmpindex)
                 else:
-                   self.group_execution.findChild(QtGui.QComboBox, "combo_configuration").setCurrentIndex(0)
+                   self.group_execution.findChild(QtWidgets.QComboBox, "combo_configuration").setCurrentIndex(0)
             elif ( parameter == "q"):
-                self.group_execution.findChild(QtGui.QLineEdit,"line_q").setText(options) 
+                self.group_execution.findChild(QtWidgets.QLineEdit,"line_q").setText(options)
              
             elif ( parameter == "A"):
-                self.group_execution.findChild(QtGui.QLineEdit,"line_account").setText(options) 
+                self.group_execution.findChild(QtWidgets.QLineEdit,"line_account").setText(options)
              
             elif ( parameter == "X"):
-                self.group_execution.findChild(QtGui.QLineEdit,"line_pe").setText(options) 
+                self.group_execution.findChild(QtWidgets.QLineEdit,"line_pe").setText(options)
              
             elif ( parameter == "T"):
-                self.group_execution.findChild(QtGui.QLineEdit,"line_tpn").setText(options) 
+                self.group_execution.findChild(QtWidgets.QLineEdit,"line_tpn").setText(options)
              
             elif ( parameter == "t"):
-                self.group_execution.findChild(QtGui.QLineEdit,"line_time").setText(options) 
+                self.group_execution.findChild(QtWidgets.QLineEdit,"line_time").setText(options)
              
             elif ( parameter == "B"):
-                self.group_execution.findChild(QtGui.QCheckBox,"check_delete_tmp_files").setChecked(True) 
+                self.group_execution.findChild(QtWidgets.QCheckBox,"check_delete_tmp_files").setChecked(True)
              
             elif ( parameter == "v"):
-                self.group_execution.findChild(QtGui.QCheckBox,"check_verbose").setChecked(True) 
+                self.group_execution.findChild(QtWidgets.QCheckBox,"check_verbose").setChecked(True)
                           
             elif ( parameter == "b"): 
-                self.group_advanced.findChild(QtGui.QCheckBox,"check_b").setChecked(True)  
+                self.group_advanced.findChild(QtWidgets.QCheckBox,"check_b").setChecked(True)
              
             elif ( parameter == "F"):
-                self.group_advanced.findChild(QtGui.QCheckBox,"check_F").setChecked(True) 
+                self.group_advanced.findChild(QtWidgets.QCheckBox,"check_F").setChecked(True)
              
             elif ( parameter == "I"):
-                self.group_advanced.findChild(QtGui.QCheckBox,"check_I").setChecked(True) 
+                self.group_advanced.findChild(QtWidgets.QCheckBox,"check_I").setChecked(True)
              
             elif ( parameter == "k"):
-                self.group_advanced.findChild(QtGui.QCheckBox,"check_k").setChecked(True) 
+                self.group_advanced.findChild(QtWidgets.QCheckBox,"check_k").setChecked(True)
              
             elif ( parameter == "O"): 
-                self.group_advanced.findChild(QtGui.QCheckBox,"check_O").setChecked(True) 
-             
+                self.group_advanced.findChild(QtWidgets.QCheckBox,"check_O").setChecked(True)
+
+            elif ( parameter == "V"):
+                self.group_execution.findChild(QtWidgets.QCheckBox,"check_prebuilt").setChecked(True)
+
             elif ( parameter == "x"):              
-                self.group_advanced.findChild(QtGui.QCheckBox,"check_x").setChecked(True) 
-             
+                self.group_advanced.findChild(QtWidgets.QCheckBox,"check_x").setChecked(True)
+
             elif ( parameter == "Z"):
-                self.group_advanced.findChild(QtGui.QCheckBox,"check_Z").setChecked(True) 
+                self.group_advanced.findChild(QtWidgets.QCheckBox,"check_Z").setChecked(True)
                
             elif ( parameter == "m"):
-                self.group_advanced.findChild(QtGui.QLineEdit,"line_m").setText(options) 
+                self.group_advanced.findChild(QtWidgets.QLineEdit,"line_m").setText(options)
              
             elif ( parameter == "M"):
-                self.group_advanced.findChild(QtGui.QLineEdit,"line_M").setText(options) 
+                self.group_advanced.findChild(QtWidgets.QLineEdit,"line_M").setText(options)
                           
             elif ( parameter == "D"):
-                self.group_advanced.findChild(QtGui.QLineEdit,"line_D").setText(options) 
+                self.group_advanced.findChild(QtWidgets.QLineEdit,"line_D").setText(options)
              
             elif ( parameter == "c"):
-                self.group_advanced.findChild(QtGui.QLineEdit,"line_c").setText(options) 
+                self.group_advanced.findChild(QtWidgets.QLineEdit,"line_c").setText(options)
                           
             elif ( parameter == "s"):
-                self.group_advanced.findChild(QtGui.QLineEdit,"line_s").setText(options) 
+                self.group_advanced.findChild(QtWidgets.QLineEdit,"line_s").setText(options)
              
             elif ( parameter == "w"):
-                self.group_advanced.findChild(QtGui.QLineEdit,"line_w").setText(options) 
+                self.group_advanced.findChild(QtWidgets.QLineEdit,"line_w").setText(options)
              
 
@@ -1017,19 +1024,19 @@
                 optionssplit = options.split(" ") 
                 
-                group_coupled = self.group_execution.findChild(QtGui.QGroupBox,"group_coupled")
-                group_coupled.findChild(QtGui.QLineEdit,"line_PE_atmos").setEnabled(True) 
-                group_coupled.findChild(QtGui.QLineEdit,"line_PE_ocean").setEnabled(True) 
-                group_coupled.findChild(QtGui.QLabel,"label_coupled1").setEnabled(True) 
-                group_coupled.findChild(QtGui.QLabel,"label_coupled2").setEnabled(True) 
-                group_coupled.findChild(QtGui.QLabel,"label_coupled3").setEnabled(True) 
-                group_coupled.findChild(QtGui.QLabel,"label_coupling").setEnabled(True) 
+                group_coupled = self.group_execution.findChild(QtWidgets.QGroupBox,"group_coupled")
+                group_coupled.findChild(QtWidgets.QLineEdit,"line_PE_atmos").setEnabled(True)
+                group_coupled.findChild(QtWidgets.QLineEdit,"line_PE_ocean").setEnabled(True)
+                group_coupled.findChild(QtWidgets.QLabel,"label_coupled1").setEnabled(True)
+                group_coupled.findChild(QtWidgets.QLabel,"label_coupled2").setEnabled(True)
+                group_coupled.findChild(QtWidgets.QLabel,"label_coupled3").setEnabled(True)
+                group_coupled.findChild(QtWidgets.QLabel,"label_coupling").setEnabled(True)
 
                 if (optionssplit.count() == 2):
-                    group_coupled.findChild(QtGui.QLineEdit,"line_PE_atmos").setEnabled(optionssplit[0]) 
-                    group_coupled.findChild(QtGui.QLineEdit,"line_PE_ocean").setEnabled(optionssplit[1])
+                    group_coupled.findChild(QtWidgets.QLineEdit,"line_PE_atmos").setEnabled(optionssplit[0])
+                    group_coupled.findChild(QtWidgets.QLineEdit,"line_PE_ocean").setEnabled(optionssplit[1])
                  
                 else:                  
-                    group_coupled.findChild(QtGui.QLineEdit,"line_PE_atmos").setText("") 
-                    group_coupled.findChild(QtGui.QLineEdit,"line_PE_ocean").setText("") 
+                    group_coupled.findChild(QtWidgets.QLineEdit,"line_PE_atmos").setText("")
+                    group_coupled.findChild(QtWidgets.QLineEdit,"line_PE_ocean").setText("")
  
                  
@@ -1037,5 +1044,5 @@
             
             elif ( parameter == "y"):              
-                self.group_execution.findChild(QtGui.QComboBox, "drop_job").setCurrentIndex(3) 
+                self.group_execution.findChild(QtWidgets.QComboBox, "drop_job").setCurrentIndex(3)
              
 
@@ -1056,7 +1063,7 @@
                     if (options_2 == "d3"):      
                         if (options_all[:3][-1] == "#"):
-                            self.group_execution.findChild(QtGui.QComboBox, "drop_job").setCurrentIndex(0) 
+                            self.group_execution.findChild(QtWidgets.QComboBox, "drop_job").setCurrentIndex(0)
                         elif (options_all[:3][-1] == "r"):
-                            self.group_execution.findChild(QtGui.QComboBox, "drop_job").setCurrentIndex(1) 
+                            self.group_execution.findChild(QtWidgets.QComboBox, "drop_job").setCurrentIndex(1)
                         
                         elif (options_all[:3][-1] == "o"):
@@ -1064,47 +1071,37 @@
                         
                     if (options_all == "restart"):
-                        self.group_execution.findChild(QtGui.QCheckBox,"check_restarts").setChecked(True) 
+                        self.group_execution.findChild(QtWidgets.QCheckBox,"check_restarts").setChecked(True)
 
                     j = j+1
-
-            # All unknown parameters are set as extra user parameters
-            else: 
-	        print parameter
-                user = "%s-%s \"%s\" " % (user,parameter,options)
-                splitline.removeAt(i) 
-
             i = i-1
         # Change drop box state in case of ocean precursor or coupled restart runs
         if ( ocean_run == True ):
             if ( coupled_run == True ):
-                self.group_execution.findChild(QtGui.QComboBox, "drop_job").setCurrentIndex(4) 
+                self.group_execution.findChild(QtWidgets.QComboBox, "drop_job").setCurrentIndex(4)
             
             else:
-                self.group_execution.findChild(QtGui.QComboBox, "drop_job").setCurrentIndex(3) 
-
-        if ( user != ""):
-            self.group_advanced.findChild(QtGui.QLineEdit,"line_user").setText(user)
+                self.group_execution.findChild(QtWidgets.QComboBox, "drop_job").setCurrentIndex(3)
 
         # Join palmrunline and post it to mainwindow
         palmrunline = " -".join(splitline) 
-        self.groupBox.findChild(QtGui.QLineEdit,"commandline").setText(palmrunline)          
+        self.groupBox.findChild(QtWidgets.QLineEdit,"commandline").setText(palmrunline)
 
         # Disable mainwindow if no job was found, otherwise enable
         if ( nojob == True ):
             self.group_execution.setEnabled(False) 
-            self.groupBox.findChild(QtGui.QPushButton,"button_start").setEnabled(False) 
-            self.menuBar.findChild(QtGui.QMenu,"menuStart").actions()[3].setEnabled(False) 
-            self.group_execution.findChild(QtGui.QComboBox, "drop_job").setEnabled(False) 
+            self.groupBox.findChild(QtWidgets.QPushButton,"button_start").setEnabled(False)
+            self.menuBar.findChild(QtWidgets.QMenu,"menuStart").actions()[3].setEnabled(False)
+            self.group_execution.findChild(QtWidgets.QComboBox, "drop_job").setEnabled(False)
             self.group_advanced.setEnabled(False) 
             self.check_advanced.setEnabled(False) 
-            self.groupBox.findChild(QtGui.QLineEdit,"line_tag").setEnabled(False)
+            self.groupBox.findChild(QtWidgets.QLineEdit,"line_tag").setEnabled(False)
          
         else:
             self.group_execution.setEnabled(True) 
-            self.groupBox.findChild(QtGui.QPushButton,"button_start").setEnabled(True) 
-            self.menuBar.findChild(QtGui.QMenu,"menuStart").actions()[3].setEnabled(True)
-            self.group_execution.findChild(QtGui.QComboBox, "drop_job").setEnabled(True) 
+            self.groupBox.findChild(QtWidgets.QPushButton,"button_start").setEnabled(True)
+            self.menuBar.findChild(QtWidgets.QMenu,"menuStart").actions()[3].setEnabled(True)
+            self.group_execution.findChild(QtWidgets.QComboBox, "drop_job").setEnabled(True)
             self.group_advanced.setEnabled(True) 
-            self.groupBox.findChild(QtGui.QLineEdit,"line_tag").setEnabled(True)
+            self.groupBox.findChild(QtWidgets.QLineEdit,"line_tag").setEnabled(True)
 
 
@@ -1124,12 +1121,12 @@
           palmrunline = palmrunline[17:]
           palmrunline = palmrunline[:len(palmrunline)-1]
-          palmrunline = filter(None,palmrunline.split("("))[0]
-          self.groupBox.findChild(QtGui.QLineEdit,"commandline").setText(palmrunline)
+          palmrunline = list(filter(None,palmrunline.split("(")))[0]
+          self.groupBox.findChild(QtWidgets.QLineEdit,"commandline").setText(palmrunline)
 
 #         Set selected item to jobname in "available jobs" list
           jobname = str(history_entry[17:])
-          jobname = filter(None,jobname.split(" -r"))[1]
+          jobname = list(filter(None,jobname.split(" -r")))[1]
           jobname = jobname.strip()
-          jobname = filter(None,jobname.split(" "))[0]
+          jobname = list(filter(None,jobname.split(" ")))[0]
           jobname = jobname.replace("\"","")
           item2int = self.list_jobs.findItems(jobname,QtCore.Qt.MatchCaseSensitive)
@@ -1141,7 +1138,7 @@
 #         Add tooltip tag
           tag = str(history_entry).split('\n')[0]
-          tag = filter(None,tag.split("("))[1]
+          tag = list(filter(None,tag.split("(")))[1]
           tag = tag.replace(")","")
-          self.groupBox.findChild(QtGui.QLineEdit,"line_tag").setText(tag)
+          self.groupBox.findChild(QtWidgets.QLineEdit,"line_tag").setText(tag)
  
 #         Process palmrungui to set up gui controls
@@ -1254,6 +1251,6 @@
                    self.list_output.addItem(str(list_of_files[i]) + " (" + file_size(tmp_file) + ")")
   
-          self.group_execution.findChild(QtGui.QLineEdit,"line_jobname").setText(jobitem.text())
-       self.group_history.findChild(QtGui.QListWidget,"list_jobname").clearSelection()
+          self.group_execution.findChild(QtWidgets.QLineEdit,"line_jobname").setText(jobitem.text())
+       self.group_history.findChild(QtWidgets.QListWidget,"list_jobname").clearSelection()
 
        self.timetimer.start()
@@ -1261,5 +1258,5 @@
        self.labeltimer.start(update_frequency/10)
        self.push_update.setText("Update (" + str(int(update_frequency/1000/60)) + " min)")
-       QtGui.QApplication.processEvents()
+       QtWidgets.QApplication.processEvents()
 
        # Change palmrunline accordingly
@@ -1272,5 +1269,5 @@
        self.setEnabled(False)
 
-       text, ret = QtGui.QInputDialog.getText(self, "Create new job", "Enter new job name:", mode = QtGui.QLineEdit.Normal, text = '')
+       text, ret = QtWidgets.QInputDialog.getText(self, "Create new job", "Enter new job name:", QtWidgets.QLineEdit.Normal, text = '')
 
        if ( ret ):
@@ -1284,5 +1281,5 @@
 #      check if a job exists with the new job name. If not, the new job is created and an empty _p3d file is created.
        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.")
+          notify = QtWidgets.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
@@ -1313,25 +1310,24 @@
     # 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)
-       
+       text, ret = QtWidgets.QInputDialog.getText(self, "Copy job", "Enter new job name:", QtWidgets.QLineEdit.Normal, text = old_job_name)
        if ( ret ):
           new_job_name = str(text)
        else:
-	   self.setEnabled(True)
-	   return
-	 
+          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
+          notify = QtWidgets.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)
+          os.makedirs(new_input_dir)
 
 #      copy and rename input files (if present)       
@@ -1355,9 +1351,9 @@
 #      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
+          notify = QtWidgets.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)
+          os.makedirs(new_user_dir)
 
 
@@ -1406,5 +1402,5 @@
 #         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.")
+             notify = QtWidgets.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
@@ -1427,12 +1423,12 @@
 
           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
+             notify = QtWidgets.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)
+             os.makedirs(new_user_dir)
 
 
@@ -1463,8 +1459,8 @@
     def openmenujob(self, position):
 
-        menu = QtGui.QMenu()
-
-
-        newAction = QtGui.QAction('Create new job', self)
+        menu = QtWidgets.QMenu()
+
+
+        newAction = QtWidgets.QAction('Create new job', self)
         newAction.triggered.connect(self.create_new_job)
         menu.addAction(newAction)
@@ -1474,9 +1470,9 @@
 
 
-           copyAction = QtGui.QAction('Copy job', self)
+           copyAction = QtWidgets.QAction('Copy job', self)
            copyAction.triggered.connect(self.copy_job)
-           createAction = QtGui.QAction('Create set from job', self)
+           createAction = QtWidgets.QAction('Create set from job', self)
            createAction.triggered.connect(self.create_set)
-           delAction = QtGui.QAction('Delete job', self)
+           delAction = QtWidgets.QAction('Delete job', self)
            delAction.triggered.connect(self.DeleteJob)
 
@@ -1490,5 +1486,5 @@
     def openmenuinput(self, position):
 
-        menu = QtGui.QMenu()
+        menu = QtWidgets.QMenu()
 
         selection = self.list_input.selectedItems()
@@ -1497,10 +1493,10 @@
 
 
-           openAction = QtGui.QAction('Open file(s)', self)
+           openAction = QtWidgets.QAction('Open file(s)', self)
            openAction.setStatusTip('Open file(s) in your favorite editor')
            openAction.triggered.connect(self.OpenFilesInput)
 
 
-           delAction = QtGui.QAction('Delete selected file(s)', self)
+           delAction = QtWidgets.QAction('Delete selected file(s)', self)
            delAction.triggered.connect(self.DeleteFilesInput)
 
@@ -1508,5 +1504,5 @@
            menu.addAction(delAction)
 
-        delallAction = QtGui.QAction('Delete all files', self)
+        delallAction = QtWidgets.QAction('Delete all files', self)
         delallAction.triggered.connect(self.DeleteAllFilesInput)
         menu.addAction(delallAction)
@@ -1517,5 +1513,5 @@
     def openmenuuser(self, position):
 
-        menu = QtGui.QMenu()
+        menu = QtWidgets.QMenu()
 
         selection = self.list_user.selectedItems()
@@ -1523,10 +1519,10 @@
         if ( len(selection) != 0 ):
 
-           openAction = QtGui.QAction('Open file(s)', self)
+           openAction = QtWidgets.QAction('Open file(s)', self)
            openAction.setStatusTip('Open file(s) in your favorite editor')
            openAction.triggered.connect(self.OpenFilesUser)
 
 
-           delAction = QtGui.QAction('Delete file(s)', self)
+           delAction = QtWidgets.QAction('Delete file(s)', self)
            delAction.triggered.connect(self.DeleteFilesUser)
 
@@ -1534,5 +1530,5 @@
            menu.addAction(delAction)
 
-        delallAction = QtGui.QAction('Delete all files', self)
+        delallAction = QtWidgets.QAction('Delete all files', self)
         delallAction.triggered.connect(self.DeleteAllFilesUser)
         menu.addAction(delallAction)
@@ -1543,5 +1539,5 @@
     def openmenuoutput(self, position):
 
-        menu = QtGui.QMenu()
+        menu = QtWidgets.QMenu()
 
         selection = self.list_output.selectedItems()
@@ -1549,9 +1545,9 @@
         if ( len(selection) != 0 ):
 
-           openAction = QtGui.QAction('Open file(s)', self)
+           openAction = QtWidgets.QAction('Open file(s)', self)
            openAction.setStatusTip('Open file(s) in your favorite editor')
            openAction.triggered.connect(self.OpenFilesOutput)
 
-           delAction = QtGui.QAction('Delete file(s)', self)
+           delAction = QtWidgets.QAction('Delete file(s)', self)
            delAction.triggered.connect(self.DeleteFilesOutput)
 
@@ -1561,5 +1557,5 @@
            menu.addAction(delAction)
 
-        delallAction = QtGui.QAction('Delete all files', self)
+        delallAction = QtWidgets.QAction('Delete all files', self)
         delallAction.triggered.connect(self.DeleteAllFilesOutput)
         menu.addAction(delallAction)
@@ -1570,5 +1566,5 @@
     def openmenumonitoring(self, position):
 
-        menu = QtGui.QMenu()
+        menu = QtWidgets.QMenu()
 
         selection = self.list_monitoring.selectedItems()
@@ -1576,9 +1572,9 @@
         if ( len(selection) != 0 ):
 
-           openAction = QtGui.QAction('Open file(s)', self)
+           openAction = QtWidgets.QAction('Open file(s)', self)
            openAction.setStatusTip('Open file(s) in your favorite editor')
            openAction.triggered.connect(self.OpenFilesMonitoring)
 
-           delAction = QtGui.QAction('Delete file(s)', self)
+           delAction = QtWidgets.QAction('Delete file(s)', self)
            delAction.triggered.connect(self.DeleteFilesMonitoring)
 
@@ -1588,5 +1584,5 @@
            menu.addAction(delAction)
 
-        delallAction = QtGui.QAction('Delete all files', self)
+        delallAction = QtWidgets.QAction('Delete all files', self)
         delallAction.triggered.connect(self.DeleteAllFilesMonitoring)
         menu.addAction(delallAction)
@@ -1596,5 +1592,5 @@
     def OpenConfig(self):
 
-       config = str(self.group_execution.findChild(QtGui.QComboBox, "combo_configuration").currentText())
+       config = str(self.group_execution.findChild(QtWidgets.QComboBox, "combo_configuration").currentText())
        if ( config != "" ):
           filename = ".palm.config." + config
@@ -1659,7 +1655,7 @@
     def DeleteFilesInput(self):
 
-       status = QtGui.QMessageBox.question(self,'Delete Confirmation', "Are you sure you want to delete these files?", QtGui.QMessageBox.Yes | QtGui.QMessageBox.No)
-
-       if status == QtGui.QMessageBox.Yes:
+       status = QtWidgets.QMessageBox.question(self,'Delete Confirmation', "Are you sure you want to delete these files?", QtWidgets.QMessageBox.Yes | QtWidgets.QMessageBox.No)
+
+       if status == QtWidgets.QMessageBox.Yes:
 
           sel_job = self.list_jobs.currentItem().text()
@@ -1669,5 +1665,5 @@
 
           for i in range(0,len(sel_files)):
-             filename = input_dir +  sel_files[i].text().split("(")[0].trimmed()
+             filename = input_dir +  sel_files[i].text().split("(")[0].strip()
              os.remove(filename)
 
@@ -1677,7 +1673,7 @@
     def DeleteFilesUser(self):
 
-       status = QtGui.QMessageBox.question(self,'Delete Confirmation', "Are you sure you want to delete these files?", QtGui.QMessageBox.Yes | QtGui.QMessageBox.No)
-
-       if status == QtGui.QMessageBox.Yes:
+       status = QtWidgets.QMessageBox.question(self,'Delete Confirmation', "Are you sure you want to delete these files?", QtWidgets.QMessageBox.Yes | QtWidgets.QMessageBox.No)
+
+       if status == QtWidgets.QMessageBox.Yes:
 
           sel_job = self.list_jobs.currentItem().text()
@@ -1687,5 +1683,5 @@
 
           for i in range(0,len(sel_files)):
-             filename = input_dir +  sel_files[i].text().split("(")[0].trimmed()
+             filename = input_dir +  sel_files[i].text().split("(")[0].strip()
              os.remove(filename)
 
@@ -1695,7 +1691,7 @@
     def DeleteFilesMonitoring(self):
 
-       status = QtGui.QMessageBox.question(self,'Delete Confirmation', "Are you sure you want to delete these files?", QtGui.QMessageBox.Yes | QtGui.QMessageBox.No)
-
-       if status == QtGui.QMessageBox.Yes:
+       status = QtWidgets.QMessageBox.question(self,'Delete Confirmation', "Are you sure you want to delete these files?", QtWidgets.QMessageBox.Yes | QtWidgets.QMessageBox.No)
+
+       if status == QtWidgets.QMessageBox.Yes:
 
           sel_job = self.list_jobs.currentItem().text()
@@ -1705,5 +1701,5 @@
 
           for i in range(0,len(sel_files)):
-             filename = input_dir +  sel_files[i].text().split("(")[0].trimmed()
+             filename = input_dir +  sel_files[i].text().split("(")[0].strip()
              os.remove(filename)
 
@@ -1713,7 +1709,7 @@
     def DeleteFilesOutput(self):
 
-       status = QtGui.QMessageBox.question(self,'Delete Confirmation', "Are you sure you want to delete these files?", QtGui.QMessageBox.Yes | QtGui.QMessageBox.No)
-
-       if status == QtGui.QMessageBox.Yes:
+       status = QtWidgets.QMessageBox.question(self,'Delete Confirmation', "Are you sure you want to delete these files?", QtWidgets.QMessageBox.Yes | QtWidgets.QMessageBox.No)
+
+       if status == QtWidgets.QMessageBox.Yes:
 
           sel_job = self.list_jobs.currentItem().text()
@@ -1723,5 +1719,5 @@
 
           for i in range(0,len(sel_files)):
-             filename = input_dir +  sel_files[i].text().split("(")[0].trimmed()
+             filename = input_dir +  sel_files[i].text().split("(")[0].strip()
              os.remove(filename)
 
@@ -1731,7 +1727,7 @@
     def DeleteAllFilesInput(self):
 
-       status = QtGui.QMessageBox.question(self,'Delete Confirmation', "Are you sure you want to delete all files?", QtGui.QMessageBox.Yes | QtGui.QMessageBox.No)
-
-       if status == QtGui.QMessageBox.Yes:
+       status = QtWidgets.QMessageBox.question(self,'Delete Confirmation', "Are you sure you want to delete all files?", QtWidgets.QMessageBox.Yes | QtWidgets.QMessageBox.No)
+
+       if status == QtWidgets.QMessageBox.Yes:
 
           check = self.list_jobs.currentItem()
@@ -1751,7 +1747,7 @@
     def DeleteAllFilesUser(self):
 
-       status = QtGui.QMessageBox.question(self,'Delete Confirmation', "Are you sure you want to delete all files?", QtGui.QMessageBox.Yes | QtGui.QMessageBox.No)
-
-       if status == QtGui.QMessageBox.Yes:
+       status = QtWidgets.QMessageBox.question(self,'Delete Confirmation', "Are you sure you want to delete all files?", QtWidgets.QMessageBox.Yes | QtWidgets.QMessageBox.No)
+
+       if status == QtWidgets.QMessageBox.Yes:
 
           check = self.list_jobs.currentItem()
@@ -1772,7 +1768,7 @@
     def DeleteAllFilesOutput(self):
 
-       status = QtGui.QMessageBox.question(self,'Delete Confirmation', "Are you sure you want to delete all files?", QtGui.QMessageBox.Yes | QtGui.QMessageBox.No)
-
-       if status == QtGui.QMessageBox.Yes:
+       status = QtWidgets.QMessageBox.question(self,'Delete Confirmation', "Are you sure you want to delete all files?", QtWidgets.QMessageBox.Yes | QtWidgets.QMessageBox.No)
+
+       if status == QtWidgets.QMessageBox.Yes:
 
           check = self.list_jobs.currentItem()
@@ -1793,7 +1789,7 @@
     def DeleteAllFilesMonitoring(self):
 
-       status = QtGui.QMessageBox.question(self,'Delete Confirmation', "Are you sure you want to delete all files?", QtGui.QMessageBox.Yes | QtGui.QMessageBox.No)
-
-       if status == QtGui.QMessageBox.Yes:
+       status = QtWidgets.QMessageBox.question(self,'Delete Confirmation', "Are you sure you want to delete all files?", QtWidgets.QMessageBox.Yes | QtWidgets.QMessageBox.No)
+
+       if status == QtWidgets.QMessageBox.Yes:
 
           check = self.list_jobs.currentItem()
@@ -1814,7 +1810,7 @@
     def DeleteJob(self):
 
-       status = QtGui.QMessageBox.question(self,'Delete Confirmation', "Are you sure you want to delete this job?", QtGui.QMessageBox.Yes | QtGui.QMessageBox.No)
-
-       if status == QtGui.QMessageBox.Yes:
+       status = QtWidgets.QMessageBox.question(self,'Delete Confirmation', "Are you sure you want to delete this job?", QtWidgets.QMessageBox.Yes | QtWidgets.QMessageBox.No)
+
+       if status == QtWidgets.QMessageBox.Yes:
 
           sel_job = self.list_jobs.currentItem().text()
@@ -1826,5 +1822,5 @@
 
 # Message box for showing RUN_CONTROL output
-class CreateSetBox(QtGui.QDialog):
+class CreateSetBox(QtWidgets.QDialog):
     def __init__(self):
 
@@ -1856,5 +1852,5 @@
 
 # Message box for showing RUN_CONTROL output
-class OpenHistoryBox(QtGui.QDialog):
+class OpenHistoryBox(QtWidgets.QDialog):
     def __init__(self):
 
@@ -1873,5 +1869,5 @@
 
 
-        list_jobname = self.findChild(QtGui.QListWidget,"list_history")
+        list_jobname = self.findChild(QtWidgets.QListWidget,"list_history")
 
         # Read history entries and append to recent job list
@@ -1916,7 +1912,7 @@
     def ClearHistory(self):
 
-       status = QtGui.QMessageBox.question(self,'Delete Confirmation', "Are you sure you want to delete your history?", QtGui.QMessageBox.Yes | QtGui.QMessageBox.No)
-
-       if status == QtGui.QMessageBox.Yes:
+       status = QtWidgets.QMessageBox.question(self,'Delete Confirmation', "Are you sure you want to delete your history?", QtWidgets.QMessageBox.Yes | QtWidgets.QMessageBox.No)
+
+       if status == QtWidgets.QMessageBox.Yes:
 
           if os.path.exists(palm_dir + "/.palmrungui.history"):
@@ -1927,5 +1923,5 @@
 
 if __name__ == "__main__":
-    app = QtGui.QApplication(sys.argv)
+    app = QtWidgets.QApplication(sys.argv)
     window = Mainwindow()
     window.show()
