wip
This commit is contained in:
parent
25916abbcd
commit
c216690351
2 changed files with 82 additions and 55 deletions
|
|
@ -46,12 +46,13 @@ class MessagesManager(QWidget):
|
|||
self.backend = None
|
||||
|
||||
self.connect(self.ui.backendsList, SIGNAL('itemSelectionChanged()'), self._backendChanged)
|
||||
self.connect(self.ui.threadsList, SIGNAL('itemSelectionChanged()'), self._threadChanged)
|
||||
self.connect(self.ui.messagesTree, SIGNAL('itemClicked(QTreeWidgetItem *, int)'), self._messageSelected)
|
||||
self.connect(self.ui.messagesTree, SIGNAL('itemActivated(QTreeWidgetItem *, int)'), self._messageSelected)
|
||||
self.connect(self, SIGNAL('gotMessage'), self._gotMessage)
|
||||
|
||||
def load(self):
|
||||
self.refresh()
|
||||
self.refreshThreads()
|
||||
|
||||
def _backendChanged(self):
|
||||
selection = self.ui.backendsList.selectedItems()
|
||||
|
|
@ -61,8 +62,21 @@ class MessagesManager(QWidget):
|
|||
|
||||
self.backend = selection[0].data(Qt.UserRole).toPyObject()
|
||||
|
||||
def refreshThreads(self):
|
||||
self.ui.messagesTree.clear()
|
||||
self.ui.threadsList.clear()
|
||||
|
||||
self.process_threads = QtDo(self.weboob, self._gotThread)
|
||||
self.process_threads.do('iter_threads', backends=self.backends, caps=ICapMessages)
|
||||
|
||||
def _gotThread(self, backend, thread):
|
||||
if not backend:
|
||||
return
|
||||
|
||||
def _threadChanged(self):
|
||||
self.ui.messagesTree.clear()
|
||||
self.refresh()
|
||||
pass
|
||||
|
||||
def refresh(self):
|
||||
if self.ui.messagesTree.topLevelItemCount() > 0:
|
||||
|
|
|
|||
|
|
@ -6,8 +6,8 @@
|
|||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>767</width>
|
||||
<height>591</height>
|
||||
<width>696</width>
|
||||
<height>592</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
|
|
@ -15,11 +15,11 @@
|
|||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<widget class="QSplitter" name="splitter_2">
|
||||
<widget class="QSplitter" name="splitter_3">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<widget class="QListWidget" name="backendsList">
|
||||
<widget class="QListWidget" name="backendsList_2">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Maximum" vsizetype="Maximum">
|
||||
<horstretch>0</horstretch>
|
||||
|
|
@ -27,16 +27,28 @@
|
|||
</sizepolicy>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QSplitter" name="splitter">
|
||||
<widget class="QSplitter" name="splitter_2">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Expanding">
|
||||
<horstretch>2</horstretch>
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
|
||||
<horstretch>10</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<widget class="QSplitter" name="splitter">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<widget class="QListWidget" name="threadsList">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Maximum" vsizetype="Maximum">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QTreeWidget" name="messagesTree">
|
||||
<property name="editTriggers">
|
||||
<set>QAbstractItemView::NoEditTriggers</set>
|
||||
|
|
@ -90,6 +102,7 @@
|
|||
</property>
|
||||
</column>
|
||||
</widget>
|
||||
</widget>
|
||||
<widget class="QTextEdit" name="messageBody">
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue