[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():
|
||||
self.setLocflag(False)
|
||||
|
||||
def addListItem(self, text):
|
||||
self.listWidget.addItem(text)
|
||||
self.listWidget.scrollToBottom()
|
||||
|
||||
def autoPick(self):
|
||||
list = QListWidget()
|
||||
self.listWidget = QListWidget()
|
||||
self.setDirty(True)
|
||||
logDockWidget = QDockWidget("AutoPickLog", self)
|
||||
logDockWidget.setObjectName("LogDockWidget")
|
||||
logDockWidget.setAllowedAreas(Qt.LeftDockWidgetArea)
|
||||
logDockWidget.setWidget(list)
|
||||
logDockWidget.show()
|
||||
logDockWidget.setFloating(False)
|
||||
list.addItem('loading default values for local data ...')
|
||||
logDockWidget.setAllowedAreas(Qt.LeftDockWidgetArea | Qt.RightDockWidgetArea)
|
||||
logDockWidget.setWidget(self.listWidget)
|
||||
self.addDockWidget(Qt.LeftDockWidgetArea, logDockWidget)
|
||||
self.addListItem('loading default values for local data ...')
|
||||
autopick_parameter = AutoPickParameter('autoPyLoT_local.in')
|
||||
list.addItem(str(autopick_parameter))
|
||||
self.addListItem(str(autopick_parameter))
|
||||
|
||||
# Create the worker thread and run it
|
||||
self.thread = AutoPickThread(parent=self,
|
||||
func=autopickevent,
|
||||
data=self.getData().getWFData(),
|
||||
param=autopick_parameter)
|
||||
self.thread.message.connect(list.addItem)
|
||||
self.thread.message.connect(self.addListItem)
|
||||
self.thread.start()
|
||||
|
||||
self.drawPicks()
|
||||
@ -773,6 +776,7 @@ class MainWindow(QMainWindow):
|
||||
if extlocpath is None or locroot is None:
|
||||
self.PyLoTprefs()
|
||||
|
||||
|
||||
def check4Loc(self):
|
||||
return self.picksNum() > 4
|
||||
|
||||
|
@ -21,7 +21,7 @@ class AutoPickThread(QThread):
|
||||
for station in picks:
|
||||
self.parent().addPicks(station, picks[station])
|
||||
except AttributeError:
|
||||
print picks
|
||||
print(picks)
|
||||
|
||||
def write(self, text):
|
||||
self.message.emit(text)
|
||||
|
Loading…
Reference in New Issue
Block a user