[bugfix] autoPickListWidget is directly attached to the main window and autoScrolls to the latest entry
This commit is contained in:
		
							parent
							
								
									a2eb5868a7
								
							
						
					
					
						commit
						50a5586355
					
				
							
								
								
									
										20
									
								
								QtPyLoT.py
									
									
									
									
									
								
							
							
						
						
									
										20
									
								
								QtPyLoT.py
									
									
									
									
									
								
							| @ -655,25 +655,28 @@ class MainWindow(QMainWindow): | |||||||
|         elif self.getLocflag() and not self.check4Loc(): |         elif self.getLocflag() and not self.check4Loc(): | ||||||
|             self.setLocflag(False) |             self.setLocflag(False) | ||||||
| 
 | 
 | ||||||
|  |     def addListItem(self, text): | ||||||
|  |         self.listWidget.addItem(text) | ||||||
|  |         self.listWidget.scrollToBottom() | ||||||
|  | 
 | ||||||
|     def autoPick(self): |     def autoPick(self): | ||||||
|         list = QListWidget() |         self.listWidget = QListWidget() | ||||||
|         self.setDirty(True) |         self.setDirty(True) | ||||||
|         logDockWidget = QDockWidget("AutoPickLog", self) |         logDockWidget = QDockWidget("AutoPickLog", self) | ||||||
|         logDockWidget.setObjectName("LogDockWidget") |         logDockWidget.setObjectName("LogDockWidget") | ||||||
|         logDockWidget.setAllowedAreas(Qt.LeftDockWidgetArea) |         logDockWidget.setAllowedAreas(Qt.LeftDockWidgetArea | Qt.RightDockWidgetArea) | ||||||
|         logDockWidget.setWidget(list) |         logDockWidget.setWidget(self.listWidget) | ||||||
|         logDockWidget.show() |         self.addDockWidget(Qt.LeftDockWidgetArea, logDockWidget) | ||||||
|         logDockWidget.setFloating(False) |         self.addListItem('loading default values for local data ...') | ||||||
|         list.addItem('loading default values for local data ...') |  | ||||||
|         autopick_parameter = AutoPickParameter('autoPyLoT_local.in') |         autopick_parameter = AutoPickParameter('autoPyLoT_local.in') | ||||||
|         list.addItem(str(autopick_parameter)) |         self.addListItem(str(autopick_parameter)) | ||||||
| 
 | 
 | ||||||
|         # Create the worker thread and run it |         # Create the worker thread and run it | ||||||
|         self.thread = AutoPickThread(parent=self, |         self.thread = AutoPickThread(parent=self, | ||||||
|                                    func=autopickevent, |                                    func=autopickevent, | ||||||
|                                    data=self.getData().getWFData(), |                                    data=self.getData().getWFData(), | ||||||
|                                    param=autopick_parameter) |                                    param=autopick_parameter) | ||||||
|         self.thread.message.connect(list.addItem) |         self.thread.message.connect(self.addListItem) | ||||||
|         self.thread.start() |         self.thread.start() | ||||||
| 
 | 
 | ||||||
|         self.drawPicks() |         self.drawPicks() | ||||||
| @ -773,6 +776,7 @@ class MainWindow(QMainWindow): | |||||||
|         if extlocpath is None or locroot is None: |         if extlocpath is None or locroot is None: | ||||||
|             self.PyLoTprefs() |             self.PyLoTprefs() | ||||||
| 
 | 
 | ||||||
|  | 
 | ||||||
|     def check4Loc(self): |     def check4Loc(self): | ||||||
|         return self.picksNum() > 4 |         return self.picksNum() > 4 | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -21,7 +21,7 @@ class AutoPickThread(QThread): | |||||||
|             for station in picks: |             for station in picks: | ||||||
|                 self.parent().addPicks(station, picks[station]) |                 self.parent().addPicks(station, picks[station]) | ||||||
|         except AttributeError: |         except AttributeError: | ||||||
|             print picks |             print(picks) | ||||||
| 
 | 
 | ||||||
|     def write(self, text): |     def write(self, text): | ||||||
|         self.message.emit(text) |         self.message.emit(text) | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user