Index: palm/trunk/SCRIPTS/palmrungui.py
===================================================================
--- palm/trunk/SCRIPTS/palmrungui.py	(revision 2413)
+++ palm/trunk/SCRIPTS/palmrungui.py	(revision 2477)
@@ -25,4 +25,8 @@
 # -----------------
 # $Id$
+# Renamed restart run appendix from "f" to "r". Bugfix for displaying restart runs.>
+# Revised list of recently submitted jobs
+# 
+# 2413 2017-09-06 12:48:29Z maronga
 # Renamed to palmrungui and adapted for use with palmrun instead of mrun.
 # 
@@ -88,5 +92,5 @@
         
         self.setupUi(self)
-        self.recent_jobs(10)
+        self.recent_jobs(50)
         commandline = self.groupBox.findChild(QtGui.QLineEdit,"commandline")
         commandline.setText("")
@@ -176,5 +180,5 @@
         
         # Reload recent jobs
-        self.recent_jobs(10)
+        self.recent_jobs(50)
         
         
@@ -200,13 +204,13 @@
         i=len(history)-1
         count = 0
-        while i>=0 and count<10:
+        while i>=0 and count<number:
             timestamp = history[i][:16]
             listitem = history[i][17:len(history[i])-1]
-            listitem = filter(None,listitem.split(" -d"))[1]
-            listitem = filter(None,listitem.split(" -"))[0]
-            listitem = listitem.replace(" ","");
             matchitems = list_jobname.findItems(listitem, QtCore.Qt.MatchExactly)
 
             if ( len(matchitems) == 0 ):
+                listitem = filter(None,listitem.split(" -d"))[1]
+                listitem = filter(None,listitem.split(" -"))[0]
+                listitem = listitem.replace(" ",""); 
                 list_jobname.addItem(listitem);
                 s = "%s (%s)" % (listitem,timestamp)
@@ -262,5 +266,5 @@
     
         
-    # select a job via doubleclick from list
+    # select a job via click from list
     #################################
     def choosejob_list(self):
@@ -272,5 +276,5 @@
         # Reload list
         self.setupUi(self)
-        self.recent_jobs(10)
+        self.recent_jobs(50)
     
         # Set selected item to jobname
@@ -300,4 +304,6 @@
                 self.groupBox.findChild(QtGui.QLineEdit,"commandline").setText(palmrunline);
                 self.setup_gui(palmrunline);
+                self.list_jobname.item(itemint).setSelected(True);    
+                
                 return
             i = i-1
@@ -375,6 +381,6 @@
             else:
                 # Check if user code is available
-                usercode = "%s/USER_CODE/%s" % (version_path,param[0])
-                
+                usercode = "%s/JOBS/%s/USER_CODE" % (version_path,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>")
@@ -390,5 +396,5 @@
 
                     jobname = self.group_job.findChild(QtGui.QLineEdit, "line_jobname").text()
-                    restartfile = "%s/JOBS/%s/INPUT/%s_p3df" % (version_path,jobname,jobname)
+                    restartfile = "%s/JOBS/%s/INPUT/%s_p3dr" % (version_path,jobname,jobname)
 
                     if (os.path.exists(restartfile) == True):                  
@@ -397,13 +403,13 @@
 
                         if ( drop_job == "Restart run (coupled atmosphere ocean)" ):
-		            restartfileo = "%s/JOBS/%s/INPUT/%s_p3dof" % (version_path,jobname,jobname)
+		            restartfileo = "%s/JOBS/%s/INPUT/%s_p3dor" % (version_path,jobname,jobname)
                             if (os.path.exists(restartfileo) == True):                  
                                 self.group_execution.findChild(QtGui.QLabel,"label_restart").setText("hooo")
                   
                             else:       
-                                self.group_execution.findChild(QtGui.QLabel,"label_restart").setText("<font color='red'>Warning: No p3dof file found!</font>")   
+                                self.group_execution.findChild(QtGui.QLabel,"label_restart").setText("<font color='red'>Warning: No p3dor file found!</font>")   
                
                     else:       
-                        self.group_execution.findChild(QtGui.QLabel,"label_restart").setText("<font color='red'>Warning: No p3df file found!</font>")
+                        self.group_execution.findChild(QtGui.QLabel,"label_restart").setText("<font color='red'>Warning: No p3dr file found!</font>")
          
                
@@ -435,5 +441,5 @@
             
             elif (drop_job == "Restart run"):            
-                rc_flag = "f"
+                rc_flag = "r"
             
             elif (drop_job == "Precursor run (atmosphere)"):            
@@ -447,5 +453,5 @@
             
             elif (drop_job == "Restart run (coupled atmosphere ocean)"):            
-                rc_flag = "f"
+                rc_flag = "r"
             
             param[0] = "\"d3%s" % (rc_flag)
@@ -525,8 +531,8 @@
                 param[0]="%s restart" % (param[0])
     
-                # Check if _p3df file is available, otherwise notice user
+                # 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(version_path)+len("/JOBS/"):]
-                    restartfile = "%s/JOBS/%s/INPUT/%s_p3df" % (version_path,jobname,jobname)
+                    restartfile = "%s/JOBS/%s/INPUT/%s_p3dr" % (version_path,jobname,jobname)
                     
                     if (os.path.exists(restartfile) == True):                   
@@ -534,5 +540,5 @@
                    
                     else:                   
-                        self.group_execution.findChild(QtGui.QLabel,"label_restart").setText("<font color='red'>Warning: No p3df file found!</font>")
+                        self.group_execution.findChild(QtGui.QLabel,"label_restart").setText("<font color='red'>Warning: No p3dr file found!</font>")
 
             else:  
@@ -767,5 +773,5 @@
         self.setupUi(self)
         self.tabWidget.setCurrentIndex(0)
-        self.recent_jobs(10)
+        self.recent_jobs(50)
         
     # Safes current commandline and user Parameters to .sav file
@@ -974,4 +980,5 @@
                     options_all = optionssplit[j] 
                     options_2 = optionssplit[j][:2] 
+                                      
                     if (options_2 == "ts"):
                         self.group_runcontrol.findChild(QtGui.QCheckBox,"check_ts").setChecked(True) 
@@ -1004,12 +1011,11 @@
                         self.group_runcontrol.findChild(QtGui.QCheckBox,"check_pts").setChecked(True) 
                     
-                    if (options_2 == "d3"):       
-                        if (options_all[:3][:-1] == "#"):
+                    if (options_2 == "d3"):      
+                        if (options_all[:3][-1] == "#"):
                             self.group_job.findChild(QtGui.QComboBox, "drop_job").setCurrentIndex(0) 
-                        
-                        elif (options_all[:3][:-1] == "f"):
+                        elif (options_all[:3][-1] == "r"):
                             self.group_job.findChild(QtGui.QComboBox, "drop_job").setCurrentIndex(1) 
                         
-                        elif (options_all[:3][:-1] == "o"):
+                        elif (options_all[:3][-1] == "o"):
                             ocean_run = True 
                         
@@ -1019,10 +1025,10 @@
                         jobname = str(self.group_job.findChild(QtGui.QLineEdit,"line_jobname").text())[len(version_path)+len("/JOBS/"):] 
                         
-                        restartfile = "%sJOBS/%s/INPUT/%s_p3df" % (version_path,jobname,jobname)
+                        restartfile = "%sJOBS/%s/INPUT/%s_p3dr" % (version_path,jobname,jobname)
                         if (os.path.exists(restartfile) == True):   
                             self.group_execution.findChild(QtGui.QLabel,"label_restart").setText("") 
                        
                         else:
-                            self.group_execution.findChild(QtGui.QLabel,"label_restart").setText("<font color='red'>Warning: No p3df file \found!</font>") 
+                            self.group_execution.findChild(QtGui.QLabel,"label_restart").setText("<font color='red'>Warning: No p3dr file \found!</font>") 
                     j = j+1
 
